Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(386)

Issue 25741004: set and get scrollTop/Left through documentElement and body should be symmetric, according to the d… (Closed)

Created:
7 years, 2 months ago by tonikitoo_
Modified:
7 years, 2 months ago
CC:
blink-reviews, dglazkov+blink, eae+blinkwatch, adamk+blink_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Visibility:
Public.

Description

After 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… #

Unified diffs Side-by-side diffs Delta from patch set Stats (+85 lines, -13 lines) Patch
M LayoutTests/compositing/scissor-out-of-viewport.html View 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/fast/css/resize-corner-tracking-touch.html View 2 chunks +2 lines, -2 lines 0 comments Download
M LayoutTests/fast/css/zoom-body-scroll.html View 2 chunks +2 lines, -2 lines 0 comments Download
M LayoutTests/fast/dom/Element/resources/scrollable-iframe-quirks.html View 1 1 chunk +9 lines, -1 line 0 comments Download
M LayoutTests/fast/dom/Element/resources/scrollable-iframe-strict.html View 1 1 chunk +9 lines, -1 line 0 comments Download
M LayoutTests/fast/dom/Element/scrollTop-scrollLeft-strict-quirks-modes.html View 1 chunk +4 lines, -0 lines 0 comments Download
M LayoutTests/fast/dom/Element/scrollTop-scrollLeft-strict-quirks-modes-expected.txt View 1 chunk +4 lines, -0 lines 0 comments Download
M LayoutTests/fast/events/touch/gesture/touch-gesture-fully-scrolled-iframe-propagates.html View 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/fast/events/touch/resources/compositor-touch-hit-rects-iframe.html View 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/fast/events/touch/resources/compositor-touch-hit-rects-iframe-fixed.html View 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/fast/events/touch/resources/compositor-touch-hit-rects-iframe-nested.html View 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/fast/multicol/scrolling-overflow.html View 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/fast/repaint/resources/iframe-scroll-repaint-iframe.html View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/dom/Element.cpp View 1 2 chunks +42 lines, -0 lines 0 comments Download
M Source/core/html/HTMLBodyElement.cpp View 2 chunks +6 lines, -0 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
Julien - ping for review
https://codereview.chromium.org/25741004/diff/3001/Source/core/dom/Element.cpp File Source/core/dom/Element.cpp (right): https://codereview.chromium.org/25741004/diff/3001/Source/core/dom/Element.cpp#newcode738 Source/core/dom/Element.cpp:738: view->setScrollPosition(IntPoint(static_cast<int>(newLeft * frame->pageZoomFactor()), view->scrollY())); The specification is weird and ...
7 years, 2 months ago (2013-10-05 01:05:46 UTC) #1
tonikitoo_
On 2013/10/05 01:05:46, Julien Chaffraix wrote: > (...) > "4. If the element is the ...
7 years, 2 months ago (2013-10-07 15:03:00 UTC) #2
Julien - ping for review
lgtm > It turns out that Blink with the patch would match latest IE, Firefox, ...
7 years, 2 months ago (2013-10-07 16:27:25 UTC) #3
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/a1.gomes@sisa.samsung.com/25741004/12001
7 years, 2 months ago (2013-10-07 17:48:29 UTC) #4
commit-bot: I haz the power
7 years, 2 months ago (2013-10-07 19:00:07 UTC) #5
Message was sent while issue was closed.
Change committed as 159035

Powered by Google App Engine
This is Rietveld 408576698