REGRESSION (r181879): Scrolling order on pages with focused iframe is broken.
authorbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 4 Jun 2015 17:53:24 +0000 (17:53 +0000)
committerbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 4 Jun 2015 17:53:24 +0000 (17:53 +0000)
commit1375cadd4241c87295cdaf3a936dc2a5bdd183da
treec1b0218981fa3770d78d7e57f2169de7a636bacc
parent10cebaa6695098e84f895b062c9fe6d7abc8ad15
REGRESSION (r181879): Scrolling order on pages with focused iframe is broken.
https://bugs.webkit.org/show_bug.cgi?id=145637
<rdar://problem/20635581>

Reviewed by Zalan Bujtas.

Source/WebCore:

Test: platform/mac-wk2/tiled-drawing/scrolling/iframe_in_iframe.html

This page revealed a bug in our RenderBox code caused by the mismatch between
our scrolling units, which are all integrally snapped, with our client height
and widths, which are not snapped at all.

In certain cases, the client height would have a small subpixel difference compared
to the scroll height, which would cause WebKit to believe it was scrollable. When
this happened, it would get stuck latched to this element and block scrolling events.

* page/Frame.cpp:
(WebCore::Frame::scrollOverflowLayer): Use roundToInt for clientWidth and clientHeight,
rather than integer truncation.
* rendering/RenderBox.cpp:
(WebCore::RenderBox::canBeScrolledAndHasScrollableArea): Need to round clientWidth
and clientHeight to compare with scrollWidth/scrollHeight.
* rendering/RenderBox.h:
(WebCore::RenderBox::hasScrollableOverflowX): Ditto.
(WebCore::RenderBox::hasScrollableOverflowY): Ditto.
* rendering/RenderMarquee.cpp:
(WebCore::RenderMarquee::computePosition): Use roundToInt for clientWidth and
clientHeight, rather than integer truncation.

LayoutTests:

* platform/mac-wk2/tiled-drawing/scrolling/iframe_in_iframe-expected.txt: Added.
* platform/mac-wk2/tiled-drawing/scrolling/iframe_in_iframe.html: Added.
* platform/mac-wk2/tiled-drawing/scrolling/resources/inner_content.html: Added.
* platform/mac-wk2/tiled-drawing/scrolling/resources/testContent.html: Added.
* platform/mac-wk2/tiled-drawing/scrolling/resources/testImage.png: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@185201 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/iframe_in_iframe-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/iframe_in_iframe.html [new file with mode: 0644]
LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/resources/inner_content.html [new file with mode: 0644]
LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/resources/testContent.html [new file with mode: 0644]
LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/resources/testImage.png [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/page/Frame.cpp
Source/WebCore/rendering/RenderBox.cpp
Source/WebCore/rendering/RenderBox.h
Source/WebCore/rendering/RenderMarquee.cpp