Skip to content

Commit

Permalink
[giow] (2) Change the way we find fragment identifiers to be slightly…
Browse files Browse the repository at this point in the history
… more compatible with legacy content.

git-svn-id: http://svn.whatwg.org/webapps@2830 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Feb 18, 2009
1 parent 2898fa9 commit 794be76
Show file tree
Hide file tree
Showing 2 changed files with 79 additions and 16 deletions.
44 changes: 36 additions & 8 deletions index
Expand Up @@ -39588,6 +39588,27 @@ user reload must be equivalent to .reload()

</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
Expand Down Expand Up @@ -39850,21 +39871,28 @@ user reload must be equivalent to .reload()
<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>&lt;fragment&gt;</a> component of the
and let <var title="">fragid</var> be the <a href=#url-fragment title=url-fragment>&lt;fragment&gt;</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>

Expand Down
51 changes: 43 additions & 8 deletions source
Expand Up @@ -45127,6 +45127,32 @@ user reload must be equivalent to .reload()

</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>


Expand Down Expand Up @@ -45409,22 +45435,31 @@ user reload must be equivalent to .reload()
<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">&lt;fragment&gt;</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>

Expand Down

0 comments on commit 794be76

Please sign in to comment.