Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add initial scroll position hook to HTML spec #10759

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -3904,6 +3904,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
<li>The <dfn data-x-href="https://drafts.csswg.org/css-overflow/#propdef-overflow">'overflow'</dfn> property and its <dfn data-x-href="https://drafts.csswg.org/css-overflow/#valdef-overflow-hidden">'hidden'</dfn> value</li>
<li>The <dfn data-x-href="https://drafts.csswg.org/css-overflow/#propdef-text-overflow">'text-overflow'</dfn> property</li>
<li>The term <dfn data-x-href="https://drafts.csswg.org/css-overflow/#scroll-container">scroll container</dfn>
<li>The term <dfn data-x-href="https://drafts.csswg.org/css-overflow/#initial-scroll-position">initial scroll position</dfn>
</ul>

<p>The following terms and features are defined in <cite>CSS Positioned Layout</cite>:
Expand Down Expand Up @@ -103718,6 +103719,8 @@ location.href = '#foo';</code></pre>
</ol>
</li>

<li><span>Update the initial scroll positions for scroll containers</span> in <var>document</var>.</li>

<li>
<p>If <var>documentIsNew</var> is true, then:

Expand Down Expand Up @@ -103879,6 +103882,27 @@ location.href = '#foo';</code></pre>
</li>
</ol>

<p>To <dfn>update the initial scroll positions for scroll containers</dfn> in a
<code>Document</code> <var>document</var>,
perform the following steps:</p>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation here doesn't follow the contribution guidelines. (This also applies elsewhere in this PR it seems.) You can also leave out "perform the following steps" here.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I believe I've now fixed the indentation.


<ol>
<li><p>Let <var>scrollers</var> be the list of all
<span data-x="scroll container">scroll containers</span> within <var>document</var>.<p></li>

<li>
<p>For each scroller in <var>scrollers</var>:</p>
DavMila marked this conversation as resolved.
Show resolved Hide resolved
<ol>
<li><p>If the user agent has reason to believe the user is no longer interested in scrolling
to <var>scroller</var>'s <span data-x="initial scroll position">initial scroll
position</span>, then abort these steps.</p></li>

<li><p>Update <var>scroller</var>'s <span data-x="initial scroll position">initial scroll
position</span> and scroll <var>scroller</var> to it.</p></li>
</ol>
</li>
</ol>

<p>To <dfn export>make document unsalvageable</dfn>, given a <code>Document</code>
<var>document</var> and a string <var>reason</var>:</p>

Expand Down Expand Up @@ -145050,6 +145074,7 @@ INSERT INTERFACES HERE
Dave Singer,
Dave Tapuska,
Dave Townsend<!-- Mossop on moz irc -->,
David Awogbemila,
David Baron,
David Bloom,
David Bokan,
Expand Down