|
document.documentElement.scrollTop/Left is zero
Blink, as of today, is the only engine that does not respect the
specification with regards to the values returned from scrollTop
and scrollLeft properties of documentElement and body nodes.
Current behavior is: in both strict and quirks modes, documentElement.scrollTop
always returns 0, while body.scrollTop always returns scrollY.
The analogy behavior applies to scrollLeft and scrollX (the return).
This patch fixes Blink's behavior in accordance to specification [1]:
if a document is in strict mode, document.documentElement.scrollTop
should return 'scrollY', and document.body.scrollTop should return 0.
On the other hand, if it is in quirks mode, document.documentElement
should return 0, and document.body.scrollTop should return 'scrollY'.
Same analogy applies to scrollLeft property.
An optimistic approach was chosen to fix this in the sense of doing this
change without collecting usage data first. The rationale behind it is
that given that Blink is the only engine behavior'ing differently, relevant
WebSites would already have two codepaths.
[1] http://dev.w3.org/csswg/cssom-view/#dom-element-scrolltop
Test: fast/dom/Element/scrollTop-scrollLeft-strict-quirks-modes.html
Existing updated tests:
fast/dom/anchor-without-content.html
fast/events/mouse-cursor-image-set.html
fast/events/mouse-cursor.html
fast/events/touch/gesture/touch-gesture-fully-scrolled-iframe-propagates.html
fast/events/touch/gesture/touch-gesture-noscroll-body-propagated.html
fast/events/touch/gesture/touch-gesture-noscroll-body-xhidden.html
fast/events/touch/gesture/touch-gesture-noscroll-body-yhidden.html
fast/events/touch/gesture/touch-gesture-scroll-iframe-editable.html
fast/events/touch/gesture/touch-gesture-scroll-iframe-not-propagated.html
fast/events/touch/gesture/touch-gesture-scroll-page-propagated.html
fast/events/touch/gesture/touch-gesture-scroll-page.html
fast/scrolling/hover-during-scroll.html
http/tests/navigation/resources/frame-with-anchor-same-origin.html
http/tests/navigation/resources/frame-with-anchor.html
BUG= 157855
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=158719
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=158864
Total comments: 14
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+209 lines, -77 lines) |
Patch |
|
M |
LayoutTests/fast/css/zoom-body-scroll.html
|
View
|
|
1 chunk |
+7 lines, -6 lines |
0 comments
|
Download
|
|
A |
LayoutTests/fast/dom/Element/resources/scrollable-iframe-quirks.html
|
View
|
1
|
1 chunk |
+17 lines, -0 lines |
0 comments
|
Download
|
|
A |
LayoutTests/fast/dom/Element/resources/scrollable-iframe-strict.html
|
View
|
1
|
1 chunk |
+19 lines, -0 lines |
0 comments
|
Download
|
|
A |
LayoutTests/fast/dom/Element/scrollTop-scrollLeft-strict-quirks-modes.html
|
View
|
1
|
1 chunk |
+38 lines, -0 lines |
0 comments
|
Download
|
|
A |
LayoutTests/fast/dom/Element/scrollTop-scrollLeft-strict-quirks-modes-expected.txt
|
View
|
|
1 chunk |
+19 lines, -0 lines |
0 comments
|
Download
|
|
M |
LayoutTests/fast/dom/anchor-without-content.html
|
View
|
|
1 chunk |
+4 lines, -4 lines |
0 comments
|
Download
|
|
M |
LayoutTests/fast/events/mouse-cursor.html
|
View
|
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
LayoutTests/fast/events/mouse-cursor-image-set.html
|
View
|
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
LayoutTests/fast/events/touch/gesture/touch-gesture-fully-scrolled-iframe-propagates.html
|
View
|
|
3 chunks |
+5 lines, -3 lines |
0 comments
|
Download
|
|
M |
LayoutTests/fast/events/touch/gesture/touch-gesture-fully-scrolled-iframe-propagates-expected.txt
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
LayoutTests/fast/events/touch/gesture/touch-gesture-noscroll-body-propagated.html
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
LayoutTests/fast/events/touch/gesture/touch-gesture-noscroll-body-propagated-expected.txt
|
View
|
|
1 chunk |
+4 lines, -4 lines |
0 comments
|
Download
|
|
M |
LayoutTests/fast/events/touch/gesture/touch-gesture-noscroll-body-xhidden.html
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
LayoutTests/fast/events/touch/gesture/touch-gesture-noscroll-body-xhidden-expected.txt
|
View
|
|
1 chunk |
+4 lines, -4 lines |
0 comments
|
Download
|
|
M |
LayoutTests/fast/events/touch/gesture/touch-gesture-noscroll-body-yhidden.html
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
LayoutTests/fast/events/touch/gesture/touch-gesture-noscroll-body-yhidden-expected.txt
|
View
|
|
1 chunk |
+4 lines, -4 lines |
0 comments
|
Download
|
|
M |
LayoutTests/fast/events/touch/gesture/touch-gesture-scroll-iframe-editable.html
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
LayoutTests/fast/events/touch/gesture/touch-gesture-scroll-iframe-editable-expected.txt
|
View
|
|
1 chunk |
+4 lines, -4 lines |
0 comments
|
Download
|
|
M |
LayoutTests/fast/events/touch/gesture/touch-gesture-scroll-iframe-not-propagated.html
|
View
|
|
3 chunks |
+3 lines, -1 line |
0 comments
|
Download
|
|
M |
LayoutTests/fast/events/touch/gesture/touch-gesture-scroll-iframe-not-propagated-expected.txt
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
LayoutTests/fast/events/touch/gesture/touch-gesture-scroll-page.html
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
LayoutTests/fast/events/touch/gesture/touch-gesture-scroll-page-expected.txt
|
View
|
|
1 chunk |
+4 lines, -4 lines |
0 comments
|
Download
|
|
M |
LayoutTests/fast/events/touch/gesture/touch-gesture-scroll-page-propagated.html
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
LayoutTests/fast/events/touch/gesture/touch-gesture-scroll-page-propagated-expected.txt
|
View
|
|
1 chunk |
+4 lines, -4 lines |
0 comments
|
Download
|
|
M |
LayoutTests/fast/scrolling/hover-during-scroll.html
|
View
|
|
3 chunks |
+3 lines, -3 lines |
0 comments
|
Download
|
|
M |
LayoutTests/fast/scrolling/hover-during-scroll-expected.txt
|
View
|
|
1 chunk |
+3 lines, -3 lines |
0 comments
|
Download
|
|
M |
LayoutTests/http/tests/navigation/anchor-frames-expected.txt
|
View
|
|
1 chunk |
+3 lines, -3 lines |
0 comments
|
Download
|
|
M |
LayoutTests/http/tests/navigation/anchor-frames-same-origin-expected.txt
|
View
|
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
LayoutTests/http/tests/navigation/resources/frame-with-anchor.html
|
View
|
|
2 chunks |
+4 lines, -4 lines |
0 comments
|
Download
|
|
M |
LayoutTests/http/tests/navigation/resources/frame-with-anchor-same-origin.html
|
View
|
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
LayoutTests/platform/mac/fast/events/touch/gesture/touch-gesture-noscroll-body-propagated-expected.txt
|
View
|
|
1 chunk |
+4 lines, -4 lines |
0 comments
|
Download
|
|
M |
LayoutTests/platform/mac/fast/events/touch/gesture/touch-gesture-noscroll-body-yhidden-expected.txt
|
View
|
|
1 chunk |
+4 lines, -4 lines |
0 comments
|
Download
|
|
M |
LayoutTests/rubberbanding/momentum-reset.html
|
View
|
1
2
|
2 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
Source/core/dom/Element.cpp
|
View
|
1
2
|
2 chunks |
+22 lines, -0 lines |
0 comments
|
Download
|
|
M |
Source/core/html/HTMLBodyElement.cpp
|
View
|
1
|
2 chunks |
+12 lines, -0 lines |
0 comments
|
Download
|
Total messages: 13 (0 generated)
|