[html5] r2830 - [giow] (2) Change the way we find fragment identifiers to be slightly more compa [...]

whatwg at whatwg.org whatwg at whatwg.org
Tue Feb 17 19:27:16 PST 2009


Author: ianh
Date: 2009-02-17 19:27:16 -0800 (Tue, 17 Feb 2009)
New Revision: 2830

Modified:
   index
   source
Log:
[giow] (2) Change the way we find fragment identifiers to be slightly more compatible with legacy content.

Modified: index
===================================================================
--- index	2009-02-18 02:03:32 UTC (rev 2829)
+++ index	2009-02-18 03:27:16 UTC (rev 2830)
@@ -39588,6 +39588,27 @@
 
     </dl></li>
 
+   <li><p>If <a href="#the-document's-address">the document's address</a> has a fragment
+   identifier, then run these substeps:</p>
+
+    <ol><li><p>Wait for a user-agent defined amount of time, as desired
+     by the user agent implementor. (This is intended to allow the
+     user agent to optimise the user experience in the face of
+     performance concerns.)</li>
+
+     <li><p>If the <code>Document</code> object has no parser, or its
+     parser has <a href=#stop-parsing title="stop parsing">stopped parsing</a>, or
+     the user agent has reason to believe the user is no longer
+     interested in scrolling to the fragment identifier, then abort
+     these substeps.</li>
+
+     <li><p><a href=#scroll-to-the-fragment-identifier>Scroll to the fragment identifier</a> given in
+     <a href="#the-document's-address">the document's address</a>. If this fails to find <a href=#the-indicated-part-of-the-document title="the indicated part of the document">an indicated part of
+     the document</a>, then return to the first step of these
+     substeps.</li>
+
+    </ol></li>
+
   </ol><h4 id=read-html><span class=secno>5.10.2 </span><dfn title=navigate-html>Page load processing model for HTML files</dfn></h4>
 
   <p>When an HTML document is to be loaded in a <a href=#browsing-context>browsing
@@ -39850,21 +39871,28 @@
   <a href=#the-indicated-part-of-the-document>the indicated part of the document</a> is.</p>
 
   <ol><li><p><a href=#parse-a-url title="parse a url">Parse</a> the <a href=#url>URL</a>,
-   and let <i>fragid</i> be the <a href=#url-fragment title=url-fragment><fragment></a> component of the
+   and let <var title="">fragid</var> be the <a href=#url-fragment title=url-fragment><fragment></a> component of the
    URL.</li><!-- parsing can't fail, since we checked earlier on
    when navigating -->
 
-   <li><p>If <i>fragid</i> is the empty string, then the indicated
-   part of the document is the top of the document.</li>
+   <li><p>If <var title="">fragid</var> is the empty string, then the
+   indicated part of the document is the top of the document.</li>
 
-   <li><p>If there is an element in the DOM that has an ID exactly
-   equal to <i>fragid</i>, then the first such element in tree order
-   is <a href=#the-indicated-part-of-the-document>the indicated part of the document</a>; stop the
-   algorithm here.</li>
+   <li><p>Let <var title="">decoded fragid</var> be the result of
+   expanding any sequences of percent-encoded octets in <var title="">fragid</var> that are valid UTF-8 sequences into Unicode
+   characters as defined by UTF-8. If any percent-encoded octets in
+   that string are not valid UTF-8 sequences, then skip this step and
+   the next one.</p>
 
+   <li><p>If this step was not skipped and there is an element in the
+   DOM that has an ID exactly equal to <var title="">decoded
+   fragid</var>, then the first such element in tree order is
+   <a href=#the-indicated-part-of-the-document>the indicated part of the document</a>; stop the algorithm
+   here.</li>
+
    <li><p>If there is an <code><a href=#the-a-element>a</a></code> element in the DOM that has a
    <code title=attr-a-name><a href=#attr-a-name>name</a></code> attribute whose value is
-   exactly equal to <i>fragid</i>, then the first such element in tree
+   exactly equal to <var title="">fragid</var> (<em>not</em> <var title="">decoded fragid</var>), then the first such element in tree
    order is <a href=#the-indicated-part-of-the-document>the indicated part of the document</a>; stop the
    algorithm here.</li>
 

Modified: source
===================================================================
--- source	2009-02-18 02:03:32 UTC (rev 2829)
+++ source	2009-02-18 03:27:16 UTC (rev 2830)
@@ -45127,6 +45127,32 @@
 
    </li>
 
+   <li><p>If <span>the document's address</span> has a fragment
+   identifier, then run these substeps:</p>
+
+    <ol>
+
+     <li><p>Wait for a user-agent defined amount of time, as desired
+     by the user agent implementor. (This is intended to allow the
+     user agent to optimise the user experience in the face of
+     performance concerns.)</p></li>
+
+     <li><p>If the <code>Document</code> object has no parser, or its
+     parser has <span title="stop parsing">stopped parsing</span>, or
+     the user agent has reason to believe the user is no longer
+     interested in scrolling to the fragment identifier, then abort
+     these substeps.</p></li>
+
+     <li><p><span>Scroll to the fragment identifier</span> given in
+     <span>the document's address</span>. If this fails to find <span
+     title="the indicated part of the document">an indicated part of
+     the document</span>, then return to the first step of these
+     substeps.</p></li>
+
+    </ol>
+
+   </li>
+
   </ol>
 
 
@@ -45409,22 +45435,31 @@
   <ol>
 
    <li><p><span title="parse a url">Parse</span> the <span>URL</span>,
-   and let <i>fragid</i> be the <span
+   and let <var title="">fragid</var> be the <span
    title="url-fragment"><fragment></span> component of the
    URL.</p></li><!-- parsing can't fail, since we checked earlier on
    when navigating -->
 
-   <li><p>If <i>fragid</i> is the empty string, then the indicated
-   part of the document is the top of the document.</p></li>
+   <li><p>If <var title="">fragid</var> is the empty string, then the
+   indicated part of the document is the top of the document.</p></li>
 
-   <li><p>If there is an element in the DOM that has an ID exactly
-   equal to <i>fragid</i>, then the first such element in tree order
-   is <span>the indicated part of the document</span>; stop the
-   algorithm here.</p></li>
+   <li><p>Let <var title="">decoded fragid</var> be the result of
+   expanding any sequences of percent-encoded octets in <var
+   title="">fragid</var> that are valid UTF-8 sequences into Unicode
+   characters as defined by UTF-8. If any percent-encoded octets in
+   that string are not valid UTF-8 sequences, then skip this step and
+   the next one.</p>
 
+   <li><p>If this step was not skipped and there is an element in the
+   DOM that has an ID exactly equal to <var title="">decoded
+   fragid</var>, then the first such element in tree order is
+   <span>the indicated part of the document</span>; stop the algorithm
+   here.</p></li>
+
    <li><p>If there is an <code>a</code> element in the DOM that has a
    <code title="attr-a-name">name</code> attribute whose value is
-   exactly equal to <i>fragid</i>, then the first such element in tree
+   exactly equal to <var title="">fragid</var> (<em>not</em> <var
+   title="">decoded fragid</var>), then the first such element in tree
    order is <span>the indicated part of the document</span>; stop the
    algorithm here.</p></li>
 




More information about the Commit-Watchers mailing list