When page scaling is in use position:fixed has incorrect results
authorfsamuel@chromium.org <fsamuel@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 3 Dec 2011 00:04:46 +0000 (00:04 +0000)
committerfsamuel@chromium.org <fsamuel@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 3 Dec 2011 00:04:46 +0000 (00:04 +0000)
commitc90f604a5a38a230e9e74ad370d9358681d5f7c1
tree1631724f067c99b4f74d1032c6e72386afa14ecd
parentd1d8522026e45085e3710a21ddd2c3ea2b2452ae
When page scaling is in use position:fixed has incorrect results
https://bugs.webkit.org/show_bug.cgi?id=68617

Reviewed by Simon Fraser.

.:

* Source/autotools/symbols.filter:

Source/WebCore:

Add the option for position:fixed elements to be fixed to the frame
instead of the layout rectangle of the document.

Tests: fast/repaint/fixed-in-page-scale.html
       fast/repaint/fixed-right-bottom-in-page-scale.html
       fast/repaint/fixed-right-in-page-scale.html

* WebCore.exp.in:
* page/FrameView.cpp:
(WebCore::FrameView::reset):
(WebCore::FrameView::scrollXForFixedPosition):
(WebCore::FrameView::scrollYForFixedPosition):
  If position:fixed elements are relative to the frame, disregard the
  drag factor.
(WebCore::FrameView::setShouldLayoutFixedElementsRelativeToFrame):
* page/FrameView.h:
(WebCore::FrameView::shouldLayoutFixedElementsRelativeToFrame):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::shouldLayoutFixedElementRelativeToFrame):
(WebCore::RenderBox::containingBlockLogicalWidthForPositioned):
(WebCore::RenderBox::containingBlockLogicalHeightForPositioned):
  If position:fixed elements are relative to the frame, their container
  is the frame instead of the layout rect of the document.
  This allows proper positioning of these elements to the right and
  bottom.
* rendering/RenderBox.h:
* testing/Internals.cpp:
(WebCore::Internals::setShouldLayoutFixedElementsRelativeToFrame):
* testing/Internals.h:
* testing/Internals.idl:
  Allow enabling and disabling the new behavior in layout tests.

Source/WebKit2:

* win/WebKit2.def:
* win/WebKit2CFLite.def:

LayoutTests:

* fast/repaint/fixed-in-page-scale-expected.png: Added.
* fast/repaint/fixed-in-page-scale-expected.txt: Added.
* fast/repaint/fixed-in-page-scale.html: Added.
* fast/repaint/fixed-right-bottom-in-page-scale-expected.png: Added.
* fast/repaint/fixed-right-bottom-in-page-scale-expected.txt: Added.
* fast/repaint/fixed-right-bottom-in-page-scale.html: Added.
* fast/repaint/fixed-right-in-page-scale-expected.png: Added.
* fast/repaint/fixed-right-in-page-scale-expected.txt: Added.
* fast/repaint/fixed-right-in-page-scale.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@101875 268f45cc-cd09-0410-ab3c-d52691b4dbfc
24 files changed:
ChangeLog
LayoutTests/ChangeLog
LayoutTests/fast/repaint/fixed-in-page-scale-expected.png [new file with mode: 0644]
LayoutTests/fast/repaint/fixed-in-page-scale-expected.txt [new file with mode: 0644]
LayoutTests/fast/repaint/fixed-in-page-scale.html [new file with mode: 0644]
LayoutTests/fast/repaint/fixed-right-bottom-in-page-scale-expected.png [new file with mode: 0644]
LayoutTests/fast/repaint/fixed-right-bottom-in-page-scale-expected.txt [new file with mode: 0644]
LayoutTests/fast/repaint/fixed-right-bottom-in-page-scale.html [new file with mode: 0644]
LayoutTests/fast/repaint/fixed-right-in-page-scale-expected.png [new file with mode: 0644]
LayoutTests/fast/repaint/fixed-right-in-page-scale-expected.txt [new file with mode: 0644]
LayoutTests/fast/repaint/fixed-right-in-page-scale.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/page/FrameView.cpp
Source/WebCore/page/FrameView.h
Source/WebCore/rendering/RenderBox.cpp
Source/WebCore/rendering/RenderBox.h
Source/WebCore/testing/Internals.cpp
Source/WebCore/testing/Internals.h
Source/WebCore/testing/Internals.idl
Source/WebKit2/ChangeLog
Source/WebKit2/win/WebKit2.def
Source/WebKit2/win/WebKit2CFLite.def
Source/autotools/symbols.filter