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

Issue 670833002: Early out if the scroll position passed in by js is NaN (Closed)

Created:
6 years, 2 months ago by Yufeng Shen (Slow to review)
Modified:
6 years, 2 months ago
Reviewers:
Rick Byers
CC:
blink-reviews, simonp
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Project:
blink
Visibility:
Public.

Description

Early out if the scroll position passed in by js is NaN This is interesting bug from slashdot.org. When the page is first loaded, it has a js scroll call but a NaN scroll position is passed in. We used to have IntPoint representing scrollPosition, and the scroll position goes as: double(NaN) -> static_cast<int> -> int(LONG/INT_MIN) -> adjusted to 0 and it happens to work that page is not scrolled with NaN scroll position. Now that we change to use DoublePoint to represent scroll position, the NaN value eventually gets adjusted to be the maximal scroll position and the page will scroll to the bottom when loaded. Instead of depending on the nasty conversion rule of NaN, lets make it specific that if NaN is passed in, just early out in the scrolling path. BUG=424987 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=184210

Patch Set 1 #

Total comments: 1

Patch Set 2 : address comments #

Total comments: 8

Patch Set 3 : address comments #

Total comments: 8

Patch Set 4 : address comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+98 lines, -2 lines) Patch
A LayoutTests/fast/scrolling/scrolling-apis-nan-scroll-position.html View 1 2 3 1 chunk +59 lines, -0 lines 0 comments Download
A LayoutTests/fast/scrolling/scrolling-apis-nan-scroll-position-expected.txt View 1 2 1 chunk +19 lines, -0 lines 0 comments Download
M Source/core/dom/Element.cpp View 1 2 chunks +8 lines, -2 lines 0 comments Download
M Source/core/frame/LocalDOMWindow.cpp View 1 2 chunks +6 lines, -0 lines 0 comments Download
M Source/core/html/HTMLBodyElement.cpp View 1 2 3 2 chunks +6 lines, -0 lines 0 comments Download

Messages

Total messages: 12 (2 generated)
Yufeng Shen (Slow to review)
6 years, 2 months ago (2014-10-21 20:09:22 UTC) #2
Rick Byers
Interesting, can you please add the link to the actual stackOverflow discussion? Is there an ...
6 years, 2 months ago (2014-10-21 20:44:15 UTC) #3
Rick Byers
On 2014/10/21 20:44:15, Rick Byers wrote: > Interesting, can you please add the link to ...
6 years, 2 months ago (2014-10-21 20:45:00 UTC) #4
miletus1
On 2014/10/21 20:44:15, Rick Byers wrote: > Interesting, can you please add the link to ...
6 years, 2 months ago (2014-10-21 22:11:14 UTC) #5
Rick Byers
Looking good, just a couple more little things https://codereview.chromium.org/670833002/diff/20001/LayoutTests/fast/scrolling/scrolling-apis-nan-scroll-position.html File LayoutTests/fast/scrolling/scrolling-apis-nan-scroll-position.html (right): https://codereview.chromium.org/670833002/diff/20001/LayoutTests/fast/scrolling/scrolling-apis-nan-scroll-position.html#newcode26 LayoutTests/fast/scrolling/scrolling-apis-nan-scroll-position.html:26: { ...
6 years, 2 months ago (2014-10-21 22:22:33 UTC) #6
Yufeng Shen (Slow to review)
https://codereview.chromium.org/670833002/diff/20001/LayoutTests/fast/scrolling/scrolling-apis-nan-scroll-position.html File LayoutTests/fast/scrolling/scrolling-apis-nan-scroll-position.html (right): https://codereview.chromium.org/670833002/diff/20001/LayoutTests/fast/scrolling/scrolling-apis-nan-scroll-position.html#newcode26 LayoutTests/fast/scrolling/scrolling-apis-nan-scroll-position.html:26: { On 2014/10/21 22:22:33, Rick Byers wrote: > you ...
6 years, 2 months ago (2014-10-21 22:49:31 UTC) #7
Rick Byers
LGTM with a couple minor nits https://codereview.chromium.org/670833002/diff/40001/LayoutTests/fast/scrolling/scrolling-apis-nan-scroll-position.html File LayoutTests/fast/scrolling/scrolling-apis-nan-scroll-position.html (right): https://codereview.chromium.org/670833002/diff/40001/LayoutTests/fast/scrolling/scrolling-apis-nan-scroll-position.html#newcode15 LayoutTests/fast/scrolling/scrolling-apis-nan-scroll-position.html:15: <body style="width:30000px;height:30000px" onload="runTest()"> ...
6 years, 2 months ago (2014-10-22 13:55:34 UTC) #8
Yufeng Shen (Slow to review)
https://codereview.chromium.org/670833002/diff/40001/LayoutTests/fast/scrolling/scrolling-apis-nan-scroll-position.html File LayoutTests/fast/scrolling/scrolling-apis-nan-scroll-position.html (right): https://codereview.chromium.org/670833002/diff/40001/LayoutTests/fast/scrolling/scrolling-apis-nan-scroll-position.html#newcode15 LayoutTests/fast/scrolling/scrolling-apis-nan-scroll-position.html:15: <body style="width:30000px;height:30000px" onload="runTest()"> On 2014/10/22 13:55:33, Rick Byers wrote: ...
6 years, 2 months ago (2014-10-22 17:38:46 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/670833002/60001
6 years, 2 months ago (2014-10-22 17:39:54 UTC) #11
commit-bot: I haz the power
6 years, 2 months ago (2014-10-22 18:44:35 UTC) #12
Message was sent while issue was closed.
Committed patchset #4 (id:60001) as 184210

Powered by Google App Engine
This is Rietveld 408576698