DescriptionAfter bug 157855 is fixed, getting the scrollTop/Left properties of both documentElement and body elements follow the behavior of other Web engines (Firefox, IE, Opera12, Safari), according to the HTML mode used (strict or quirks):
- in strict mode
documentElement.scrollTop, returns the frame Y scroll position.
body.scrollTop, returns always 0.
- in quirks mode
documentElement.scrollTop, returns always 0.
body.scrollTop, returns the frame Y scroll position.
(Same logic applies for scrollLeft).
However, now Blink has an asymmetry between the way scrollTop/Left values are gotten and the way they are set, regardless of the HTML mode used:
- in both strict and quirks modes
documentElement.scrollTop = xx, is no op
body.scrollTop = xx, sets the frame Y scroll position to "xx"
Patch fixes it making the "set" operations of scrollTop/Left for documentElement and body elements symmetric to their get operations' behavior, according to the HTML mode used. It also makes Blink to match all other Web engines. Result is:
- in strict mode
documentElement.scrollTop, returns the frame Y scroll position.
documentElement.scrollTop = xx, sets the frame Y scroll position to "xx".
body.scrollTop, returns always 0.
body.scrollTop = xx, is no op.
- quirks mode
documentElement.scrollTop, returns always 0.
documentElement.scrollTop = xx, is no op.
body.scrollTop, returns the frame Y scroll position.
body.scrollTop = xx, sets the frame Y scroll position to "xx".
(Same logic applies for scrollLeft).
An optimistic approach was chosen for this behavior change, with respect to not measure the usage of these properties beforehand. Rationale is that all WebSites already have to deal with the Blink divergent behavior and other Web engines behavior anyways, so if Blink starts to follow other engines, there should not be breakages.
New tests:
* fast/dom/Element/scrollTop-scrollLeft-strict-quirks-modes.html
Updated existing tests:
* fast/events/touch/resources/compositor-touch-hit-rects-iframe.html
* fast/events/touch/resources/compositor-touch-hit-rects-iframe-fixed.html
* compositing/scissor-out-of-viewport.html
* fast/multicol/scrolling-overflow.html
* fast/css/zoom-body-scroll.html
* fast/css/resize-corner-tracking-touch.html
* fast/repaint/resources/iframe-scroll-repaint-iframe.html
* fast/events/touch/resources/compositor-touch-hit-rects-iframe-nested.html
* fast/events/touch/gesture/touch-gesture-fully-scrolled-iframe-propagates.html
BUG=303131
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=159035
Patch Set 1 : set and get scrollTop/Left through documentElement and body should be symmetric, according to the d… #
Total comments: 2
Patch Set 2 : set and get scrollTop/Left through documentElement and body should be symmetric, according to the d… #Messages
Total messages: 5 (0 generated)
|