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)
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

index 9a60363620e71e08ef111d899fc53f843089ccca..6403a895f2d2c84212a8fb47e1f24b3520f017ae 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2011-12-02  Fady Samuel  <fsamuel@chromium.org>
+
+        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:
+
 2011-12-02  Martin Robinson  <mrobinson@igalia.com>
 
         Try to fix the GTK+ debug bot. As discussed with other GTK+
index 5d2e45e9e17fbe9032f216acf4c9da5b7a52df03..9b1e003f750d1c11be6017e7b1621b0268b872ff 100644 (file)
@@ -1,3 +1,20 @@
+2011-12-02  Fady Samuel  <fsamuel@chromium.org>
+
+        When page scaling is in use position:fixed has incorrect results
+        https://bugs.webkit.org/show_bug.cgi?id=68617
+
+        Reviewed by Simon Fraser.
+
+        * 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.
+
 2011-12-02  Vincent Scheib  <scheib@chromium.org>
 
         [Chromium] Marking svg/W3C-SVG-1.1/fonts-elem-04-b.svg flaky for text
diff --git a/LayoutTests/fast/repaint/fixed-in-page-scale-expected.png b/LayoutTests/fast/repaint/fixed-in-page-scale-expected.png
new file mode 100644 (file)
index 0000000..3235399
Binary files /dev/null and b/LayoutTests/fast/repaint/fixed-in-page-scale-expected.png differ
diff --git a/LayoutTests/fast/repaint/fixed-in-page-scale-expected.txt b/LayoutTests/fast/repaint/fixed-in-page-scale-expected.txt
new file mode 100644 (file)
index 0000000..8b13789
--- /dev/null
@@ -0,0 +1 @@
+
diff --git a/LayoutTests/fast/repaint/fixed-in-page-scale.html b/LayoutTests/fast/repaint/fixed-in-page-scale.html
new file mode 100644 (file)
index 0000000..a95c572
--- /dev/null
@@ -0,0 +1,54 @@
+<html>
+<head>
+    <style>
+        ::-webkit-scrollbar {
+            width: 0px;
+            height: 0px;
+        }
+    </style>
+    <script>
+      window.enablePixelTesting = true;
+      if (window.internals)
+          window.internals.setShouldLayoutFixedElementsRelativeToFrame(document, true);
+
+      function scroll() {
+          window.scrollTo(100,100);
+      }
+
+      function scaleWithEventSender() {
+          var scaleFactor = 2.0;
+          var scaleOffset = 0;
+          if (window.eventSender) {
+             eventSender.scalePageBy(scaleFactor, scaleOffset, scaleOffset);
+          }
+      }
+
+      function test() {
+          scaleWithEventSender();
+          scroll();
+      }
+    </script>
+    <script src="../js/resources/js-test-pre.js"></script>
+</head>
+<body style="width:2000px; height:2000px; margin:0px;" onload="test();">
+    <div style="position: fixed; top: -100px; left: -100px; z-index: 1">
+        <div style="left:0; top:0; width:100px; height:100px; position:absolute; background:yellow;"></div>
+        <div style="left:100px; top:0; width:100px; height:100px; position:absolute; background:green;"></div>
+
+        <div style="left:0; top:100px; width:100px; height:100px; position:absolute; background:green;"></div>
+        <div style="left:100px; top:100px; width:100px; height:100px; position:absolute; background:black;"></div>
+    </div>
+
+    <div style="left:0; top:0; width:100px; height:100px; position:absolute; background:yellow;"></div>
+    <div style="left:100px; top:0; width:100px; height:100px; position:absolute; background:green;"></div>
+    <div style="left:200px; top:0; width:100px; height:100px; position:absolute; background:blue;"></div>
+
+    <div style="left:0; top:100px; width:100px; height:100px; position:absolute; background: green;"></div>
+    <div style="left:100px; top:100px; width:100px; height:100px; position:absolute; background:blue;"></div>
+    <div style="left:200px; top:100px; width:100px; height:100px; position:absolute; background:yellow;"></div>
+
+    <div style="left:0; top:200px; width:100px; height:100px; position:absolute; background:blue;"></div>
+    <div style="left:100px; top:200px; width:100px; height:100px; position:absolute; background:yellow;"></div>
+    <div style="left:200px; top:200px; width:100px; height:100px; position:absolute; background:green;"></div>
+</body>
+</html>
diff --git a/LayoutTests/fast/repaint/fixed-right-bottom-in-page-scale-expected.png b/LayoutTests/fast/repaint/fixed-right-bottom-in-page-scale-expected.png
new file mode 100644 (file)
index 0000000..725f5af
Binary files /dev/null and b/LayoutTests/fast/repaint/fixed-right-bottom-in-page-scale-expected.png differ
diff --git a/LayoutTests/fast/repaint/fixed-right-bottom-in-page-scale-expected.txt b/LayoutTests/fast/repaint/fixed-right-bottom-in-page-scale-expected.txt
new file mode 100644 (file)
index 0000000..8b13789
--- /dev/null
@@ -0,0 +1 @@
+
diff --git a/LayoutTests/fast/repaint/fixed-right-bottom-in-page-scale.html b/LayoutTests/fast/repaint/fixed-right-bottom-in-page-scale.html
new file mode 100644 (file)
index 0000000..12fc45a
--- /dev/null
@@ -0,0 +1,43 @@
+<html>
+<head>
+    <style>
+        ::-webkit-scrollbar {
+            width: 0px;
+            height: 0px;
+        }
+    </style>
+    <script>
+      window.enablePixelTesting = true;
+      if (window.internals)
+          window.internals.setShouldLayoutFixedElementsRelativeToFrame(document, true);
+
+      function scroll() {
+          window.scrollTo(100,100);
+      }
+
+      function scaleWithEventSender() {
+          var scaleFactor = 2.0;
+          var scaleOffset = 0;
+          if (window.eventSender) {
+             eventSender.scalePageBy(scaleFactor, scaleOffset, scaleOffset);
+          }
+      }
+
+      function test() {
+          document.body.style.width = (document.body.clientWidth + 100) + "px";
+          scaleWithEventSender();
+          scroll();
+      }
+    </script>
+    <script src="../js/resources/js-test-pre.js"></script>
+</head>
+<body style="height: 2000px; width: 2000px; margin:0px;" onload="test();">
+    <div style="position: fixed; bottom: 100px; right: 100px; z-index: 1">
+        <div style="left:0; top:0; width:100px; height:100px; position:absolute; background:black;"></div>
+        <div style="left:100px; top:0; width:100px; height:100px; position:absolute; background:green;"></div>
+
+        <div style="left:0px; top:100px; width:100px; height:100px; position:absolute; background:yellow;"></div>
+        <div style="left:100px; top:100px; width:100px; height:100px; position:absolute; background:blue;"></div>
+    </div>
+</body>
+</html>
diff --git a/LayoutTests/fast/repaint/fixed-right-in-page-scale-expected.png b/LayoutTests/fast/repaint/fixed-right-in-page-scale-expected.png
new file mode 100644 (file)
index 0000000..01e3e0e
Binary files /dev/null and b/LayoutTests/fast/repaint/fixed-right-in-page-scale-expected.png differ
diff --git a/LayoutTests/fast/repaint/fixed-right-in-page-scale-expected.txt b/LayoutTests/fast/repaint/fixed-right-in-page-scale-expected.txt
new file mode 100644 (file)
index 0000000..8b13789
--- /dev/null
@@ -0,0 +1 @@
+
diff --git a/LayoutTests/fast/repaint/fixed-right-in-page-scale.html b/LayoutTests/fast/repaint/fixed-right-in-page-scale.html
new file mode 100644 (file)
index 0000000..90383e8
--- /dev/null
@@ -0,0 +1,56 @@
+<html>
+<head>
+    <style>
+        ::-webkit-scrollbar {
+            width: 0px;
+            height: 0px;
+        }
+    </style>
+    <script>
+      window.enablePixelTesting = true;
+      if (window.internals)
+          window.internals.setShouldLayoutFixedElementsRelativeToFrame(document, true);
+
+      function scroll() {
+          window.scrollTo(100,100);
+      }
+
+      function scaleWithEventSender() {
+          var scaleFactor = 2.0;
+          var scaleOffset = 0;
+          if (window.eventSender) {
+             eventSender.scalePageBy(scaleFactor, scaleOffset, scaleOffset);
+          }
+      }
+
+      function test() {
+          scaleWithEventSender();
+          scroll();
+      }
+    </script>
+    <script src="../js/resources/js-test-pre.js"></script>
+</head>
+<body style="height:2000px; width: 2000px; margin:0px;" onload="test();">
+    <div style="position: fixed; top: -100px; right: 100px; z-index: 1">
+        <div style="left:0; top:0; width:100px; height:100px; position:absolute; background:yellow;"></div>
+        <div style="left:100px; top:0; width:100px; height:100px; position:absolute; background:green;"></div>
+
+        <div style="left:0; top:100px; width:100px; height:100px; position:absolute; background:black;"></div>
+        <div style="left:100px; top:100px; width:100px; height:100px; position:absolute; background:blue;"></div>
+    </div>
+    <div style="position: absolute; width:300px; height:300px; top: 0px; left: 300px" id="grid">
+        <div style="float:left; width:100px; height:100px; background:yellow;"></div>
+        <div style="float:left; width:100px; height:100px; background:green;"></div>
+        <div style="float:left; width:100px; height:100px; background:blue;"></div>
+
+        <div style="float:left; width:100px; height:100px; background: green;"></div>
+        <div style="float:left; width:100px; height:100px; background:blue;"></div>
+        <div style="float:left; width:100px; height:100px; background:yellow;"></div>
+
+        <div style="float:left; width:100px; height:100px; background:blue;"></div>
+        <div style="float:left; width:100px; height:100px; background:yellow;"></div>
+        <div style="float:left; width:100px; height:100px; background:green;"></div>
+    </div>
+    <div id="console"></div>
+</body>
+</html>
index 73002f4d85812ee4721521558dbd178679e71439..35999e65f9749d83c59cc65d2ecc1027ad4556d3 100644 (file)
@@ -1,3 +1,42 @@
+2011-12-02  Fady Samuel  <fsamuel@chromium.org>
+
+        When page scaling is in use position:fixed has incorrect results
+        https://bugs.webkit.org/show_bug.cgi?id=68617
+
+        Reviewed by Simon Fraser.
+
+        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.
+
 2011-12-02  Benjamin Poulain  <bpoulain@apple.com>
 
         Build fix for SubresourceLoader when building with Core Foundation
index 5943bab586e8bf616bfbce5195f5b6f008f75121..d1a98d13d96838c4bf3b5d5b2494e1b0eca814a7 100644 (file)
@@ -1028,6 +1028,7 @@ __ZN7WebCore9FrameView17setScrollPositionERKNS_8IntPointE
 __ZN7WebCore9FrameView17setTracksRepaintsEb
 __ZN7WebCore9FrameView18updateControlTintsEv
 __ZN7WebCore9FrameView19scrollElementToRectEPNS_7ElementERKNS_7IntRectE
+__ZN7WebCore9FrameView43setShouldLayoutFixedElementsRelativeToFrameEb
 __ZN7WebCore9FrameView20enterCompositingModeEv
 __ZN7WebCore9FrameView21flushDeferredRepaintsEv
 __ZN7WebCore9FrameView22setBaseBackgroundColorERKNS_5ColorE
index 543c8a8149c52086cf543875de4eb970cbe387c0..218b1b8ea43cd655edd88fc2e6790cf06d4c2848 100644 (file)
@@ -217,6 +217,7 @@ void FrameView::reset()
     m_cannotBlitToWindow = false;
     m_isOverlapped = false;
     m_contentIsOpaque = false;
+    m_shouldLayoutFixedElementsRelativeToFrame = false;
     m_borderX = 30;
     m_borderY = 30;
     m_layoutTimer.stop();
@@ -1394,7 +1395,7 @@ int FrameView::scrollXForFixedPosition() const
     // When the page is scaled, the scaled "viewport" with respect to which fixed object are positioned
     // doesn't move as fast as the content view, so that when the content is scrolled all the way to the
     // end, the bottom of the scaled "viewport" touches the bottom of the real viewport.
-    float dragFactor = (contentsWidth() - visibleContentWidth * frameScaleFactor) / maxX;
+    float dragFactor = shouldLayoutFixedElementsRelativeToFrame() ? 1 : (contentsWidth() - visibleContentWidth * frameScaleFactor) / maxX;
 
     return x * dragFactor / frameScaleFactor;
 }
@@ -1425,8 +1426,7 @@ int FrameView::scrollYForFixedPosition() const
         return y;
 
     float frameScaleFactor = m_frame->frameScaleFactor();
-    float dragFactor = (contentsHeight() - visibleContentHeight * frameScaleFactor) / maxY;
-
+    float dragFactor = shouldLayoutFixedElementsRelativeToFrame() ? 1 : (contentsHeight() - visibleContentHeight * frameScaleFactor) / maxY;
     return y * dragFactor / frameScaleFactor;
 }
 
@@ -1435,6 +1435,18 @@ IntSize FrameView::scrollOffsetForFixedPosition() const
     return IntSize(scrollXForFixedPosition(), scrollYForFixedPosition());
 }
 
+void FrameView::setShouldLayoutFixedElementsRelativeToFrame(bool shouldLayoutFixedElementsRelativeToFrame)
+{
+    if (shouldLayoutFixedElementsRelativeToFrame == m_shouldLayoutFixedElementsRelativeToFrame)
+        return;
+
+    m_shouldLayoutFixedElementsRelativeToFrame = shouldLayoutFixedElementsRelativeToFrame;
+
+    if (!hasFixedObjects())
+        return;
+
+    setNeedsLayout();
+}
 IntPoint FrameView::currentMousePosition() const
 {
     return m_frame ? m_frame->eventHandler()->currentMousePosition() : IntPoint();
index 7c4c894af37faf110d86a4c0e786d7e9f62b803f..dcd6d334a56b876facd5943c20f29191854941cc 100644 (file)
@@ -196,6 +196,9 @@ public:
     int scrollYForFixedPosition() const;
     IntSize scrollOffsetForFixedPosition() const;
 
+    bool shouldLayoutFixedElementsRelativeToFrame() const { return m_shouldLayoutFixedElementsRelativeToFrame; }
+    void setShouldLayoutFixedElementsRelativeToFrame(bool);
+
     void beginDeferredRepaints();
     void endDeferredRepaints();
     void checkStopDelayingDeferredRepaints();
@@ -411,9 +414,9 @@ private:
     bool m_cannotBlitToWindow;
     bool m_isOverlapped;
     bool m_contentIsOpaque;
+    bool m_shouldLayoutFixedElementsRelativeToFrame;
     unsigned m_slowRepaintObjectCount;
     unsigned m_fixedObjectCount;
-
     int m_borderX;
     int m_borderY;
 
index bce02ceaca8a0c8101c9a6c4ac6edc31c3f2a971..b9c25d6a4612281e0a8e4ecc86327537cfaa3609 100644 (file)
@@ -631,6 +631,11 @@ LayoutRect RenderBox::reflectedRect(const LayoutRect& r) const
     return result;
 }
 
+bool RenderBox::shouldLayoutFixedElementRelativeToFrame(Frame* frame, FrameView* frameView) const
+{
+    return style() && style()->position() == FixedPosition && container()->isRenderView() && frame && frameView && frameView->shouldLayoutFixedElementsRelativeToFrame();
+}
+
 bool RenderBox::includeVerticalScrollbarSize() const
 {
     return hasOverflowClip() && !layer()->hasOverlayScrollbars()
@@ -2317,6 +2322,12 @@ void RenderBox::computeBlockDirectionMargins(RenderBlock* containingBlock)
 LayoutUnit RenderBox::containingBlockLogicalWidthForPositioned(const RenderBoxModelObject* containingBlock, RenderRegion* region,
     LayoutUnit offsetFromLogicalTopOfFirstPage, bool checkForPerpendicularWritingMode) const
 {
+    // Container for position:fixed is the frame.
+    Frame* frame = view() ? view()->frame(): 0;
+    FrameView* frameView = view() ? view()->frameView() : 0;
+    if (shouldLayoutFixedElementRelativeToFrame(frame, frameView))
+        return (view()->isHorizontalWritingMode() ? frameView->visibleWidth() : frameView->visibleHeight()) / frame->frameScaleFactor();
+
     if (checkForPerpendicularWritingMode && containingBlock->isHorizontalWritingMode() != isHorizontalWritingMode())
         return containingBlockLogicalHeightForPositioned(containingBlock, false);
 
@@ -2369,6 +2380,11 @@ LayoutUnit RenderBox::containingBlockLogicalWidthForPositioned(const RenderBoxMo
 
 LayoutUnit RenderBox::containingBlockLogicalHeightForPositioned(const RenderBoxModelObject* containingBlock, bool checkForPerpendicularWritingMode) const
 {
+    Frame* frame = view() ? view()->frame(): 0;
+    FrameView* frameView = view() ? view()->frameView() : 0;
+    if (shouldLayoutFixedElementRelativeToFrame(frame, frameView))
+        return (view()->isHorizontalWritingMode() ? frameView->visibleHeight() : frameView->visibleWidth()) / frame->frameScaleFactor();
+
     if (checkForPerpendicularWritingMode && containingBlock->isHorizontalWritingMode() != isHorizontalWritingMode())
         return containingBlockLogicalWidthForPositioned(containingBlock, 0, 0, false);
 
index bc1ffd9834cb79b47f70e7a2cdedfa4eda7412f0..e4eef65de9c09d6d518598504526ef6ce8466652 100644 (file)
@@ -462,6 +462,8 @@ protected:
     void paintRootBoxFillLayers(const PaintInfo&);
 
 private:
+    bool shouldLayoutFixedElementRelativeToFrame(Frame*, FrameView*) const;
+
     bool includeVerticalScrollbarSize() const;
     bool includeHorizontalScrollbarSize() const;
 
index d5ab7887e383fb4b8a0892947ffc8e16f6402e7d..9f5136ffd162f05948df1b27174c0ae5ec28b696 100644 (file)
@@ -577,6 +577,17 @@ unsigned Internals::lengthFromRange(Element* scope, const Range* range, Exceptio
     return length;
 }
 
+void Internals::setShouldLayoutFixedElementsRelativeToFrame(Document* document, bool enabled, ExceptionCode& ec)
+{
+    if (!document || !document->view()) {
+        ec = INVALID_ACCESS_ERR;
+        return;
+    }
+
+    FrameView* frameView = document->view();
+    frameView->setShouldLayoutFixedElementsRelativeToFrame(enabled);
+}
+
 void Internals::setUnifiedTextCheckingEnabled(Document* document, bool enabled, ExceptionCode& ec)
 {
     if (!document || !document->frame() || !document->frame()->settings()) {
index b909d7089c3d0ebd51db69aba3c9aa3b6642d9ab..28efb4e1c90ca8c3b496d4a198452ebfa87f6c19 100644 (file)
@@ -104,6 +104,7 @@ public:
     PassRefPtr<Range> rangeFromLocationAndLength(Element* scope, int rangeLocation, int rangeLength, ExceptionCode&);
     unsigned locationFromRange(Element* scope, const Range*, ExceptionCode&);
     unsigned lengthFromRange(Element* scope, const Range*, ExceptionCode&);
+    void setShouldLayoutFixedElementsRelativeToFrame(Document*, bool, ExceptionCode&);
 
     void setUnifiedTextCheckingEnabled(Document*, bool, ExceptionCode&);
     bool unifiedTextCheckingEnabled(Document*, ExceptionCode&);
index ccc892c602d8bf2dab26fb2496344d4025d2912c..f66bb56c15560163e9ac14d42ba6fd1fb929c94d 100644 (file)
@@ -77,6 +77,7 @@ module window {
         unsigned long locationFromRange(in Element scope, in Range range) raises (DOMException);
         unsigned long lengthFromRange(in Element scope, in Range range) raises (DOMException);
 
+        void setShouldLayoutFixedElementsRelativeToFrame(in Document document, in boolean enabled) raises(DOMException);
         void setUnifiedTextCheckingEnabled(in Document document, in boolean enabled) raises (DOMException);
         boolean unifiedTextCheckingEnabled(in Document document) raises (DOMException);
     };
index db0d4a992038bd3d1324ebfa4c0fa79348ee7979..54979f3c5b22971157a1024bab6bcda3c6d9e96e 100644 (file)
@@ -1,3 +1,13 @@
+2011-12-02  Fady Samuel  <fsamuel@chromium.org>
+
+        When page scaling is in use position:fixed has incorrect results
+        https://bugs.webkit.org/show_bug.cgi?id=68617
+
+        Reviewed by Simon Fraser.
+
+        * win/WebKit2.def:
+        * win/WebKit2CFLite.def:
+
 2011-12-02  Alexey Proskuryakov  <ap@apple.com>
 
         Update sandbox rules
index 489d59711c5b8662619bfc4a4db8e3f497ae1b6b..b46f159ba8dac4c69feb061b238968187cff6c80 100644 (file)
@@ -169,6 +169,7 @@ EXPORTS
         ?rangeFromLocationAndLength@TextIterator@WebCore@@SA?AV?$PassRefPtr@VRange@WebCore@@@WTF@@PAVElement@2@HH_N@Z
         ?removeShadowRoot@Element@WebCore@@QAEXXZ
         ?scrollElementToRect@FrameView@WebCore@@QAEXPAVElement@2@ABVIntRect@2@@Z
+        ?setShouldLayoutFixedElementsRelativeToFrame@FrameView@WebCore@@QAEX_N@Z
         ?setDOMException@WebCore@@YAXPAVExecState@JSC@@H@Z
         ?setMockScrollbarsEnabled@Settings@WebCore@@SAX_N@Z
         ?setPagination@Page@WebCore@@QAEXABUPagination@12@@Z
index 3065bd8be12f82ea1cf2a029d44b1406ed5f3866..e57dcdb86f6da980d50c4e1b0d6c8659a442c53c 100644 (file)
@@ -162,6 +162,7 @@ EXPORTS
         ?rangeFromLocationAndLength@TextIterator@WebCore@@SA?AV?$PassRefPtr@VRange@WebCore@@@WTF@@PAVElement@2@HH_N@Z
         ?removeShadowRoot@Element@WebCore@@QAEXXZ
         ?scrollElementToRect@FrameView@WebCore@@QAEXPAVElement@2@ABVIntRect@2@@Z
+        ?setShouldLayoutFixedElementsRelativeToFrame@FrameView@WebCore@@QAEX_N@Z
         ?setDOMException@WebCore@@YAXPAVExecState@JSC@@H@Z
         ?setMockScrollbarsEnabled@Settings@WebCore@@SAX_N@Z
         ?setPagination@Page@WebCore@@QAEXABUPagination@12@@Z
index 4387ca930c8c32b5cf5209f447aab249c56c3b56..40cb78bb53fe4496206ba0f3a149998b5f9dd778 100644 (file)
@@ -83,6 +83,7 @@ _ZN7WebCore10ScrollView23setScrollbarsSuppressedEbb;
 _ZN7WebCore8Settings24setMockScrollbarsEnabledEb;
 _ZN7WebCore9FrameView17paintControlTintsEv;
 _ZN7WebCore9FrameView19scrollElementToRectEPNS_7ElementERKNS_7IntRectE;
+_ZN7WebCore9FrameView43setShouldLayoutFixedElementsRelativeToFrameEb;
 local:
 _Z*;
 cti*;