-<p>When the <code>scroll</code> operation is invoked these steps must be run:</p> <ol> <li><p>If either <var title="">x</var> or <var title="">y</var> is infinite or NaN terminate this algorithm.</li> <li> <dl> <dt>If <a href="#document-content">document content</a> can have overflow to the right <dd><p>Let <var title="">x</var> be max(0, min(<var title="">x</var>, <a href="#content">content</a> width - <a href="#content-edge">content edge</a> width)).</dd> <dt>If <a href="#document-content">document content</a> can have overflow to the left (under right-to-left conditions) <dd><p>Let <var title="">x</var> be min(0, max(<var title="">x</var>, <a href="#content-edge">content edge</a> width - <a href="#content">content</a> width)).</dd> </dl> </li> <li><p>Let <var title="">y</var> be max(0, min(<var title="">y</var>, <a href="#document-content">document content</a> height - <a href="#viewport">viewport</a> height excluding the size of a rendered scroll bar (if any))).</li> <li><p>Align the x-coordinate <var title="">x</var> of the <a href="#document-content">document content</a> with the left of the <a href="#viewport">viewport</a> and align the y-coordinate <var title="">y</var> of the <a href="#document-content">document content</a> with the top of the <a href="#viewport">viewport</a>.</li> <li><p>If the aligning caused content to move <a class="external" href="http://dev.w3.org/html5/spec/single-page.html#queue-a-task">queue a task</a> to <a class="external" href="http://dom.spec.whatwg.org/#concept-event-fire" title="concept-event-fire">fire an event</a> named <code title="event-scroll">scroll</code> that bubbles at the <code class="external"><a href="http://dom.spec.whatwg.org/#document">Document</a></code> object, unless a <a class="external" href="http://dev.w3.org/html5/spec/single-page.html#concept-task" title="concept-task">task</a> to fire that event at the <code class="external"><a href="http://dom.spec.whatwg.org/#document">Document</a></code> object was already <a class="external" href="http://dev.w3.org/html5/spec/single-page.html#queue-a-task" title="queue a task">queued</a>.</li> </ol></dd>
0 commit comments