Skip to content

Commit e4fdf11

Browse files
committed
Fixed some stuff before sending the report in.
1 parent 5754e47 commit e4fdf11

2 files changed

Lines changed: 27 additions & 21 deletions

File tree

thesis/thesis.pdf

-198 KB
Binary file not shown.

thesis/thesis.tex

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
\usepackage{pgfplots}
2323
\pgfplotsset{compat=newest} % Allows to place the legend below plot
2424
\usepgfplotslibrary{units} % Allows to enter the units nicely
25-
\usepackage{todonotes}
25+
\usepackage[disable]{todonotes}
2626
\usepackage[toc,acronym]{glossaries}
2727
\makenoidxglossaries
2828
% \makeglossaries
@@ -246,12 +246,12 @@
246246
Sammanfattning ska vara här.
247247
\end{foreignabstract}
248248
\clearpage
249-
\noindent
250-
\large
251-
The colored rectangles that appear throughout this thesis are comments and feedback (presented as todos), which mean that they are not part of the actual content.
252-
It should be noted that all named todo items are not quotations of the persons that it was received from.
253-
Instead, all todo items represent my own interpretation of the feedback given to me.
254-
\clearpage
249+
% \noindent
250+
% \large
251+
% The colored rectangles that appear throughout this thesis are comments and feedback (presented as todos), which mean that they are not part of the actual content.
252+
% It should be noted that all named todo items are not quotations of the persons that it was received from.
253+
% Instead, all todo items represent my own interpretation of the feedback given to me.
254+
% \clearpage
255255
\section*{Acknowledgements}
256256
I would like to thank my supervisors Tomas Ekholm, Philipp Haller and Stefan Sennerö for their enthusiastic involvement of this thesis.
257257
They have provided me with great feedback and support throughout the project.
@@ -285,7 +285,7 @@
285285
\section{Targeted audience}
286286
This thesis is targeted for \gls{web} developers that wish to gain a deeper understanding of element queries and how one could solve the problem today.
287287
Heavy use of \gls{web} terminology is being used and intermediate \gls{web} development knowledge is beneficial.
288-
For readers that are not familiar with web terminology there is a glossary at the end of the document.
288+
For readers that are not familiar with web terminology there is a glossary at the end of this thesis.
289289
\todo[inline]{Philipp wanted this to be more general.}
290290
\section{Problem statement}\label{sec:problem}
291291
By using \gls{CSS} \gls{media queries}, developers can specify different style rules for different \gls{viewport} sizes.
@@ -1810,27 +1810,33 @@
18101810
% To avoid \gls{layout thrashing} by other scripts it can beneficial to asynchronously postpone the \glslink{batch processing}{batch} until the next layout cycle of the \gls{browser}, which is also handled by the subsystem.
18111811
Both Section~\ref{sec:layout-process} and \ref{sec:layout-thrashing} is recommended to read in order to understand the optimizations described in this section.
18121812

1813-
The batch processor is the foundation for good performace and is therefore used by several subsystems of \gls{ELQ}.
1813+
The batch processor is the foundation for good performace of the library, and is therefore used by several subsystems.
18141814
It serves two purposes:
18151815
\begin{enumerate}
18161816
\item Automatically process a batch asynchronously.
18171817
\item Process a batch in different levels.
18181818
\end{enumerate}
18191819

1820-
The idea is that users may register functions via the \code{add} method.
1821-
The method also accepts an optional level parameter that specified at which level the function should be executed.
1822-
1823-
\textbf{Batch processor}: via the \code{elq.BatchProcessor} property that refers to a factory function that creates \glslink{batch processing}{batch processor} instances.
1824-
Instead of having a single \glslink{batch processing}{batch processor} instance shared among all library entities (i.e., core subsystems and plugins), each entity has to create an own instance.
1825-
This to avoid entities interfering with each other while processing \glslink{batch processing}{batches}.
1826-
For example, some entities might want to force the \glslink{batch processing}{batch} to be processed at a point where it would be beneficial for other entities to delay the processing.
1827-
The \code{createBatchProcessor} accepts an optional options object parameter and returns a \glslink{batch processing}{batch processor} instance
1828-
Two important options to the \code{createBatchProcessor} are the \code{async} and \code{auto} options.
1820+
The automated asynchronous processing of batches is important because some subsystems do not know how many operations are to be performed when called.
1821+
For instance, the public \gls{ELQ} \gls{API} method \code{start} is called with elements to be initiated by the library.
1822+
As part of the initialization, the element resize detection subsystem may be called that needs to prepare elements to be detectable.
1823+
This needs to be batch processed, which is possible to do synchronously.
1824+
However, if the \code{start} method is called mutliple times synchronously layout thrashing occurs since one batch for each method call is created.
1825+
See listing~\ref{} for example code that invokes the \code{start} method multiple times synchronously.
1826+
\begin{lstlisting}[gobble=10,label={code:batch-processor-example},caption={Example of multiple synchronous calls to the \gls{ELQ} \code{start} method.},captionpos=b]]
1827+
elq.start(document.getElementById("..."));
1828+
elq.start(document.getElementById("..."));
1829+
elq.start(document.getElementById("..."));
1830+
1831+
var elements = document.querySelectorAll("...");
1832+
elements.forEach(elq.start);
1833+
\end{lstlisting}
1834+
Of course, such usage could be warned against in the \gls{API} documentation but to keep the \gls{API} as simple as possible another approach has been taken.
1835+
By delaying the batch to execute asynchronously, on he next JavaScript event tick on most layout engines, all synchronous calls to the method is grouped to the pending batch.
1836+
This behavior can be controlled by the \code{async} and \code{auto} options of the factory function.
18291837
If the \code{async} option is enabled, the \glslink{batch processing}{batch} will be processed asynchronously as soon as possible after that the \code{force} method has been invoked.
18301838
If the \code{auto} option is enabled, the batch will automatically be processed as soon as possible asynchronously (this implies that \code{async} has to be enabled).
1831-
The batch processor instance has two methods: \code{add} and \code{force}.
1832-
The \code{add} method requires a function parameter that will be called when the \glslink{batch processing}{batch} is processed, and accepts an optional level parameter that defines at which level the given functon should be processed.
1833-
The \code{force} method commence the processing of the \glslink{batch processing}{batch}, which can happen synchronously or asynchronously defined by an optional parameter.
1839+
18341840
\todo[inline]{Finish me!}
18351841

18361842
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

0 commit comments

Comments
 (0)