Skip to content

Commit

Permalink
[giow] (1) Handle the case of a 'resize' handler removing the Documen…
Browse files Browse the repository at this point in the history
…t from the rendering

Affected topics: DOM APIs

git-svn-id: https://svn.whatwg.org/webapps@8851 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Nov 19, 2014
1 parent 4d582b1 commit 6722742
Show file tree
Hide file tree
Showing 3 changed files with 91 additions and 59 deletions.
54 changes: 32 additions & 22 deletions complete.html
Expand Up @@ -3011,7 +3011,7 @@ <h4 id=common-parser-idioms>2.4.1 Common parser idioms</h4>

<p>When a user agent is to <dfn id=strip-leading-and-trailing-whitespace>strip leading and trailing whitespace</dfn> from a string, the
user agent must remove all <a href=#space-character id=common-parser-idioms:space-character-2>space characters</a> that are at the
start or end of the string.<div class=status><input onclick=toggleStatus(this) value=⋰ type=button><p class=bugs><strong>Spec bugs:</strong> <a href="https://www.w3.org/Bugs/Public/show_bug.cgi?id=27348" title="containers seem to be what's preventing the changes, srcdoc">27348</a>, <a href="https://www.w3.org/Bugs/Public/show_bug.cgi?id=27350" title="containers seem to be what's preventing the changes, srcdoc">27350</a>, <a href="https://www.w3.org/Bugs/Public/show_bug.cgi?id=27351" title="containers seem to be what's preventing the changes, srcdoc">27351</a></div>
start or end of the string.<div class=status><input onclick=toggleStatus(this) value=⋰ type=button><p class=bugs><strong>Spec bugs:</strong> <a href="https://www.w3.org/Bugs/Public/show_bug.cgi?id=27348" title="containers seem to be what's preventing the changes, srcdoc">27348</a></div>

<p>When a user agent is to <dfn id=strip-and-collapse-whitespace>strip and collapse whitespace</dfn> in a string, it must replace
any sequence of one or more consecutive <a href=#space-character id=common-parser-idioms:space-character-3>space characters</a> in
Expand Down Expand Up @@ -4372,7 +4372,7 @@ <h4 id=mq>2.4.10 Media queries</h4>

<h3 id=urls>2.5 URLs</h3>

<h4 id=terminology-2>2.5.1 Terminology</h4><div class=status><input onclick=toggleStatus(this) value=⋰ type=button><p class=bugs><strong>Spec bugs:</strong> <a href="https://www.w3.org/Bugs/Public/show_bug.cgi?id=27349" title="containers seem to be what's preventing the changes, srcdoc">27349</a></div>
<h4 id=terminology-2>2.5.1 Terminology</h4>

<p>A <a href=#url id=terminology-2:url>URL</a> is a <dfn id=valid-url>valid URL</dfn> if it conforms to the authoring conformance
requirements in the WHATWG URL standard. <a href=#refsURL>[URL]</a></p>
Expand Down Expand Up @@ -63192,14 +63192,7 @@ <h5 id=processing-model-9>8.1.4.2 Processing model</h5>

<p><i>Update the rendering</i>: If this <a href=#event-loop id=processing-model-9:event-loop-7>event loop</a> is a <a href=#browsing-context id=processing-model-9:browsing-context-2>browsing
context</a> <a href=#event-loop id=processing-model-9:event-loop-8>event loop</a> (as opposed to a <a href=#workers>worker</a>
<a href=#event-loop id=processing-model-9:event-loop-9>event loop</a>), then, if necessary, run the following substeps.</p>

<p class=note>Whether these steps are necessary depends on the update frequency. For example,
if the browser is attempting to achieve a 60 Hz refresh rate, then these steps are only
necessary every 60th of a second (about 16.7ms). If the browser finds that the page is not able
to sustain this rate, it might drop to a more sustainable 30Hz, rather than occasionally
dropping frames. This specification does not mandate any particular model for when to update the
rendering.</p>
<a href=#event-loop id=processing-model-9:event-loop-9>event loop</a>), then run the following substeps.</p>

<ol><li><p>Let <var>now</var> be the value that would be returned by the <code id=processing-model-9:performance><a href=#performance>Performance</a></code>
object's <code id=processing-model-9:dom-performance-now><a href=#dom-performance-now>now()</a></code> method. <a href=#refsHRT>[HRT]</a></p>
Expand All @@ -63221,16 +63214,33 @@ <h5 id=processing-model-9>8.1.4.2 Processing model</h5>
<p>In the steps below that iterate over <var>docs</var>, each <code id=processing-model-9:document-6><a href=#document>Document</a></code> must be
processed in the order it is found in the list.</p>

<li><p>For each <code id=processing-model-9:document-7><a href=#document>Document</a></code> in <var>docs</var>, <dfn id=run-the-resize-steps>run the resize steps</dfn> for
that <code id=processing-model-9:document-8><a href=#document>Document</a></code>, passing in <var>now</var> as the timestamp. <a href=#refsCSSOMVIEW>[CSSOMVIEW]</a><li><p>For each <code id=processing-model-9:document-9><a href=#document>Document</a></code> in <var>docs</var>, <dfn id=run-the-scroll-steps>run the scroll steps</dfn> for
that <code id=processing-model-9:document-10><a href=#document>Document</a></code>, passing in <var>now</var> as the timestamp. <a href=#refsCSSOMVIEW>[CSSOMVIEW]</a><li><p>For each <code id=processing-model-9:document-11><a href=#document>Document</a></code> in <var>docs</var>, <dfn id=evaluate-media-queries-and-report-changes>evaluate media queries and
report changes</dfn> for that <code id=processing-model-9:document-12><a href=#document>Document</a></code>, passing in <var>now</var> as the
timestamp. <a href=#refsCSSOMVIEW>[CSSOMVIEW]</a><li><p>For each <code id=processing-model-9:document-13><a href=#document>Document</a></code> in <var>docs</var>, <dfn id=run-css-animations-and-send-events>run CSS animations and send
events</dfn> for that <code id=processing-model-9:document-14><a href=#document>Document</a></code>, passing in <var>now</var> as the timestamp. <a href=#refsCSSANIMATIONS>[CSSANIMATIONS]</a><li><p>For each <code id=processing-model-9:document-15><a href=#document>Document</a></code> in <var>docs</var>, <dfn id=run-the-fullscreen-rendering-steps>run the fullscreen rendering
steps</dfn> for that <code id=processing-model-9:document-16><a href=#document>Document</a></code>, passing in <var>now</var> as the timestamp. <a href=#refsFULLSCREEN>[FULLSCREEN]</a><li><p>For each <code id=processing-model-9:document-17><a href=#document>Document</a></code> in <var>docs</var>, <a href=#run-the-animation-frame-callbacks id=processing-model-9:run-the-animation-frame-callbacks>run the animation frame
callbacks</a> for that <code id=processing-model-9:document-18><a href=#document>Document</a></code>, passing in <var>now</var> as the
timestamp.<li><p>For each <code id=processing-model-9:document-19><a href=#document>Document</a></code> in <var>docs</var>, update the rendering or user
interface of that <code id=processing-model-9:document-20><a href=#document>Document</a></code> and its <a href=#browsing-context id=processing-model-9:browsing-context-4>browsing context</a> to reflect the
<li>

<p>If there is a <a href=#top-level-browsing-context id=processing-model-9:top-level-browsing-context>top-level browsing context</a> <var>B</var> that the user agent
believes would not benefit from having its rendering updated at this time, then remove from
<var>docs</var> all <code id=processing-model-9:document-7><a href=#document>Document</a></code> objects whose <a href=#browsing-context id=processing-model-9:browsing-context-4>browsing context</a>'s
<a href=#top-level-browsing-context id=processing-model-9:top-level-browsing-context-2>top-level browsing context</a> is <var>B</var>.</p>

<p class=note>Whether a <a href=#top-level-browsing-context id=processing-model-9:top-level-browsing-context-3>top-level browsing context</a> would benefit from having
its rendering updated depends on various factors, such as the update frequency. For example,
if the browser is attempting to achieve a 60 Hz refresh rate, then these steps are only
necessary every 60th of a second (about 16.7ms). If the browser finds that a <a href=#top-level-browsing-context id=processing-model-9:top-level-browsing-context-4>top-level
browsing context</a> is not able to sustain this rate, it might drop to a more sustainable
30Hz for that set of <code id=processing-model-9:document-8><a href=#document>Document</a></code>s, rather than occasionally dropping frames. (This
specification does not mandate any particular model for when to update the rendering.)
Similarly, if a <a href=#top-level-browsing-context id=processing-model-9:top-level-browsing-context-5>top-level browsing context</a> is in the background, the user agent
might decide to drop that page to a much slower 4Hz, or even less.</p>

<li><p>For each <a href=#fully-active id=processing-model-9:fully-active-2>fully active</a> <code id=processing-model-9:document-9><a href=#document>Document</a></code> in <var>docs</var>, <dfn id=run-the-resize-steps>run the resize steps</dfn> for
that <code id=processing-model-9:document-10><a href=#document>Document</a></code>, passing in <var>now</var> as the timestamp. <a href=#refsCSSOMVIEW>[CSSOMVIEW]</a><li><p>For each <a href=#fully-active id=processing-model-9:fully-active-3>fully active</a> <code id=processing-model-9:document-11><a href=#document>Document</a></code> in <var>docs</var>, <dfn id=run-the-scroll-steps>run the scroll steps</dfn> for
that <code id=processing-model-9:document-12><a href=#document>Document</a></code>, passing in <var>now</var> as the timestamp. <a href=#refsCSSOMVIEW>[CSSOMVIEW]</a><li><p>For each <a href=#fully-active id=processing-model-9:fully-active-4>fully active</a> <code id=processing-model-9:document-13><a href=#document>Document</a></code> in <var>docs</var>, <dfn id=evaluate-media-queries-and-report-changes>evaluate media queries and
report changes</dfn> for that <code id=processing-model-9:document-14><a href=#document>Document</a></code>, passing in <var>now</var> as the
timestamp. <a href=#refsCSSOMVIEW>[CSSOMVIEW]</a><li><p>For each <a href=#fully-active id=processing-model-9:fully-active-5>fully active</a> <code id=processing-model-9:document-15><a href=#document>Document</a></code> in <var>docs</var>, <dfn id=run-css-animations-and-send-events>run CSS animations and send
events</dfn> for that <code id=processing-model-9:document-16><a href=#document>Document</a></code>, passing in <var>now</var> as the timestamp. <a href=#refsCSSANIMATIONS>[CSSANIMATIONS]</a><li><p>For each <a href=#fully-active id=processing-model-9:fully-active-6>fully active</a> <code id=processing-model-9:document-17><a href=#document>Document</a></code> in <var>docs</var>, <dfn id=run-the-fullscreen-rendering-steps>run the fullscreen rendering
steps</dfn> for that <code id=processing-model-9:document-18><a href=#document>Document</a></code>, passing in <var>now</var> as the timestamp. <a href=#refsFULLSCREEN>[FULLSCREEN]</a><li><p>For each <a href=#fully-active id=processing-model-9:fully-active-7>fully active</a> <code id=processing-model-9:document-19><a href=#document>Document</a></code> in <var>docs</var>, <a href=#run-the-animation-frame-callbacks id=processing-model-9:run-the-animation-frame-callbacks>run the animation frame
callbacks</a> for that <code id=processing-model-9:document-20><a href=#document>Document</a></code>, passing in <var>now</var> as the
timestamp.<li><p>For each <a href=#fully-active id=processing-model-9:fully-active-8>fully active</a> <code id=processing-model-9:document-21><a href=#document>Document</a></code> in <var>docs</var>, update the rendering or user
interface of that <code id=processing-model-9:document-22><a href=#document>Document</a></code> and its <a href=#browsing-context id=processing-model-9:browsing-context-5>browsing context</a> to reflect the
current state.</ol>

<li><p>If this is a <a href=#workers>worker</a> <a href=#event-loop id=processing-model-9:event-loop-11>event loop</a> (i.e. one running for a
Expand Down Expand Up @@ -63340,8 +63350,8 @@ <h5 id=processing-model-9>8.1.4.2 Processing model</h5>
<p>Some of the algorithms in this specification, for historical reasons, require the user agent to
<dfn id=pause>pause</dfn> while running a <a href=#concept-task id=processing-model-9:concept-task-10>task</a> until a condition <var>goal</var> is met. This means running the following steps:</p>

<ol><li><p>If necessary, update the rendering or user interface of any <code id=processing-model-9:document-21><a href=#document>Document</a></code> or
<a href=#browsing-context id=processing-model-9:browsing-context-5>browsing context</a> to reflect the current state.<li><p>Wait until the condition <var>goal</var> is met. While a user agent has a paused
<ol><li><p>If necessary, update the rendering or user interface of any <code id=processing-model-9:document-23><a href=#document>Document</a></code> or
<a href=#browsing-context id=processing-model-9:browsing-context-6>browsing context</a> to reflect the current state.<li><p>Wait until the condition <var>goal</var> is met. While a user agent has a paused
<a href=#concept-task id=processing-model-9:concept-task-11>task</a>, the corresponding <a href=#event-loop id=processing-model-9:event-loop-27>event loop</a> must not run
further <a href=#concept-task id=processing-model-9:concept-task-12>tasks</a>, and any script in the currently running <a href=#concept-task id=processing-model-9:concept-task-13>task</a> must block. User agents should remain responsive to user input
while paused, however, albeit in a reduced capacity since the <a href=#event-loop id=processing-model-9:event-loop-28>event loop</a> will not be
Expand Down

0 comments on commit 6722742

Please sign in to comment.