Push pixel snapping logic into TransformState
authorleviw@chromium.org <leviw@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 16 Dec 2012 21:50:20 +0000 (21:50 +0000)
committerleviw@chromium.org <leviw@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 16 Dec 2012 21:50:20 +0000 (21:50 +0000)
https://bugs.webkit.org/show_bug.cgi?id=101779

Reviewed by Simon Fraser.

Source/WebCore:

The old SnapOffsetForTransforms behavior fell apart when there was content nested in
multiple levels of containers with sub-pixel offsets. The point of this flag was to
mirror the pixel snapping that occurs in paint, where offsets are accumulated bottom-
up through the render tree and snapped at the end. This change eliminates this flag
and pushes pixel snapping logic down into TransformState.

TransformState now tracks a LayoutSize accumulated offset when there's no transform
or we're just translating. We then snap and apply this offset before accumulating
values into a transform, and when returning planar coordinates to callers.

Test: fast/sub-pixel/transformed-iframe-copy-on-scroll.html added,
      fast/sub-pixel/sub-pixel-iframe-copy-on-scroll.html modified to also catch this bug.

* platform/graphics/transforms/TransformState.cpp:
(WebCore::TransformState::operator=): Pass accumulated offset.
(WebCore::TransformState::translateTransform): Extracted this functionality for
re-use when applying the accumulated offset, or accumulating from a call to move.
(WebCore::TransformState::translateMappedCoordinates): Same as above when we're not
acculating into a transform.
(WebCore::TransformState::move): Changed to accumulate into m_accumulatedOffset when
not accumulating into a transform.
(WebCore::TransformState::applyAccumulatedOffset):
(WebCore::TransformState::applyTransform): Applies the accumulated offset before the
transform.
(WebCore::TransformState::flatten): Ditto for flattening.
(WebCore::TransformState::mappedPoint): Translates by the accumulated offset before
returning.
(WebCore::TransformState::mappedQuad): Ditto.
* platform/graphics/transforms/TransformState.h:
(TransformState): Added m_accumulatedOffset.
* rendering/RenderGeometryMap.cpp:
(WebCore::RenderGeometryMap::mapToContainer): When not using a transform, we still need
to snap our offset before applying to our float result. Also, flatten when we have a
non-uniform step.
* rendering/RenderGeometryMap.h:
(RenderGeometryMap): Remove use of SnapOffsetForTransforms.

Everything below simply drops the use of SnapOffsetForTransforms:

* dom/ContainerNode.cpp:
(WebCore::ContainerNode::getUpperLeftCorner):
* dom/MouseRelatedEvent.cpp:
(WebCore::MouseRelatedEvent::computeRelativePosition):
* editing/FrameSelection.cpp:
(WebCore::CaretBase::absoluteBoundsForLocalRect):
* editing/RenderedPosition.cpp:
(WebCore::RenderedPosition::absoluteRect):
* editing/VisiblePosition.cpp:
(WebCore::VisiblePosition::absoluteCaretBounds):
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::listBoxDefaultEventHandler):
* html/shadow/SliderThumbElement.cpp:
(WebCore::SliderThumbElement::setPositionFromPoint):
* html/shadow/SpinButtonElement.cpp:
(WebCore::SpinButtonElement::defaultEventHandler):
* page/FrameView.cpp:
(WebCore::FrameView::convertFromRenderer):
(WebCore::FrameView::convertToRenderer):
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paintDocumentMarker):
(WebCore::InlineTextBox::paintTextMatchMarker):
(WebCore::InlineTextBox::computeRectForReplacementMarker):
* rendering/LayoutState.cpp:
(WebCore::LayoutState::LayoutState):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::mapLocalToContainer):
(WebCore::RenderBox::pushMappingToContainer):
* rendering/RenderBox.h:
(RenderBox):
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::computeStickyPositionConstraints):
* rendering/RenderEmbeddedObject.cpp:
(WebCore::RenderEmbeddedObject::isInUnavailablePluginIndicator):
* rendering/RenderFrameSet.cpp:
(WebCore::RenderFrameSet::userResize):
* rendering/RenderInline.cpp:
(WebCore::RenderInline::mapLocalToContainer):
(WebCore::RenderInline::pushMappingToContainer):
* rendering/RenderInline.h:
(RenderInline):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::absoluteToContents):
(WebCore::RenderLayer::scrollTo):
(WebCore::RenderLayer::childrenClipRect):
(WebCore::RenderLayer::selfClipRect):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::contentsVisible):
* rendering/RenderMediaControls.cpp:
(WebCore::RenderMediaControls::volumeSliderOffsetFromMuteButton):
* rendering/RenderMenuList.cpp:
(WebCore::RenderMenuList::showPopup):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::absoluteFocusRingQuads):
* rendering/RenderObject.h:
* rendering/RenderText.cpp:
(WebCore::RenderText::absoluteRectsForRange):
(WebCore::RenderText::absoluteQuads):
(WebCore::RenderText::absoluteQuadsForRange):
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::volumeSliderOffsetFromMuteButton):
* rendering/RenderView.cpp:
(WebCore::RenderView::selectionBounds):
* rendering/RenderView.h:
(RenderView):
* rendering/RenderWidget.cpp:
(WebCore::RenderWidget::updateWidgetGeometry):
* rendering/svg/RenderSVGForeignObject.cpp:
(WebCore::RenderSVGForeignObject::mapLocalToContainer):
* rendering/svg/RenderSVGForeignObject.h:
(RenderSVGForeignObject):
* rendering/svg/RenderSVGInline.cpp:
(WebCore::RenderSVGInline::mapLocalToContainer):
* rendering/svg/RenderSVGInline.h:
(RenderSVGInline):
* rendering/svg/RenderSVGModelObject.cpp:
(WebCore::RenderSVGModelObject::mapLocalToContainer):
* rendering/svg/RenderSVGModelObject.h:
(RenderSVGModelObject):
* rendering/svg/RenderSVGRoot.h:
(RenderSVGRoot):
* rendering/svg/RenderSVGText.cpp:
(WebCore::RenderSVGText::mapLocalToContainer):
* rendering/svg/RenderSVGText.h:
(RenderSVGText):
* rendering/svg/SVGRenderSupport.cpp:
(WebCore::SVGRenderSupport::mapLocalToContainer):
* rendering/svg/SVGRenderSupport.h:
(SVGRenderSupport):

Source/WebKit/chromium:

Eliminating use of SnapOffsetForTransforms as it's no longer needed.

* src/FindInPageCoordinates.cpp:
(WebKit::toNormalizedRect):
* src/LinkHighlight.cpp:
(WebKit::convertTargetSpaceQuadToCompositedLayer):
* src/WebInputEventConversion.cpp:
(WebKit::convertAbsoluteLocationForRenderObject):
* src/WebPluginContainerImpl.cpp:
(WebKit::WebPluginContainerImpl::windowToLocalPoint):

Source/WebKit/mac:

* WebView/WebFullScreenController.mm:
(screenRectOfContents): Removed SnapOffsetForTransforms as it's no longer needed.

Source/WebKit2:

Eliminating use of SnapOffsetForTransforms as it's no longer needed.

* WebProcess/FullScreen/WebFullScreenManager.cpp:
(WebKit::screenRectOfContents):

LayoutTests:

* fast/dom/Window/webkitConvertPoint.html: Updating values to match corrected pixel snapping.
* fast/multicol/break-properties.html: Fixing sub-pixel layout feature checking.
* fast/multicol/vertical-lr/break-properties.html: Ditto.
* fast/multicol/vertical-rl/break-properties.html: Ditto.
* fast/sub-pixel/sub-pixel-iframe-copy-on-scroll.html: Updating to catch the bug where the old
pixel snapping logic did the wrong thing when nested.
* fast/sub-pixel/transformed-iframe-copy-on-scroll.html: Added.
* platform/chromium-linux/fast/sub-pixel/sub-pixel-iframe-copy-on-scroll-expected.png:
* platform/chromium-linux/fast/sub-pixel/transformed-iframe-copy-on-scroll-expected.png: Added.
* platform/chromium-linux/fast/sub-pixel/transformed-iframe-copy-on-scroll-expected.txt: Added.
* platform/chromium-win/fast/sub-pixel/sub-pixel-iframe-copy-on-scroll-expected.txt:
* platform/chromium/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@137847 268f45cc-cd09-0410-ab3c-d52691b4dbfc

69 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/dom/Window/webkitConvertPoint.html
LayoutTests/fast/multicol/break-properties.html
LayoutTests/fast/multicol/vertical-lr/break-properties.html
LayoutTests/fast/multicol/vertical-rl/break-properties.html
LayoutTests/fast/sub-pixel/sub-pixel-iframe-copy-on-scroll.html
LayoutTests/fast/sub-pixel/transformed-iframe-copy-on-scroll.html [new file with mode: 0644]
LayoutTests/platform/chromium-linux/fast/sub-pixel/sub-pixel-iframe-copy-on-scroll-expected.png
LayoutTests/platform/chromium-linux/fast/sub-pixel/transformed-iframe-copy-on-scroll-expected.png [new file with mode: 0644]
LayoutTests/platform/chromium-linux/fast/sub-pixel/transformed-iframe-copy-on-scroll-expected.txt [new file with mode: 0644]
LayoutTests/platform/chromium-win/fast/sub-pixel/sub-pixel-iframe-copy-on-scroll-expected.txt
LayoutTests/platform/chromium/TestExpectations
LayoutTests/platform/mac/accessibility/radio-button-group-members-expected.txt
LayoutTests/platform/mac/fast/dom/Window/webkitConvertPoint-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/dom/ContainerNode.cpp
Source/WebCore/dom/MouseRelatedEvent.cpp
Source/WebCore/editing/FrameSelection.cpp
Source/WebCore/editing/RenderedPosition.cpp
Source/WebCore/editing/VisiblePosition.cpp
Source/WebCore/html/HTMLSelectElement.cpp
Source/WebCore/html/shadow/SliderThumbElement.cpp
Source/WebCore/html/shadow/SpinButtonElement.cpp
Source/WebCore/page/FrameView.cpp
Source/WebCore/platform/graphics/transforms/TransformState.cpp
Source/WebCore/platform/graphics/transforms/TransformState.h
Source/WebCore/rendering/InlineTextBox.cpp
Source/WebCore/rendering/LayoutState.cpp
Source/WebCore/rendering/RenderBox.cpp
Source/WebCore/rendering/RenderBox.h
Source/WebCore/rendering/RenderBoxModelObject.cpp
Source/WebCore/rendering/RenderEmbeddedObject.cpp
Source/WebCore/rendering/RenderFrameSet.cpp
Source/WebCore/rendering/RenderGeometryMap.cpp
Source/WebCore/rendering/RenderGeometryMap.h
Source/WebCore/rendering/RenderInline.cpp
Source/WebCore/rendering/RenderInline.h
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/rendering/RenderLayerBacking.cpp
Source/WebCore/rendering/RenderMediaControls.cpp
Source/WebCore/rendering/RenderMenuList.cpp
Source/WebCore/rendering/RenderObject.cpp
Source/WebCore/rendering/RenderObject.h
Source/WebCore/rendering/RenderText.cpp
Source/WebCore/rendering/RenderTheme.cpp
Source/WebCore/rendering/RenderView.cpp
Source/WebCore/rendering/RenderView.h
Source/WebCore/rendering/RenderWidget.cpp
Source/WebCore/rendering/svg/RenderSVGForeignObject.cpp
Source/WebCore/rendering/svg/RenderSVGForeignObject.h
Source/WebCore/rendering/svg/RenderSVGInline.cpp
Source/WebCore/rendering/svg/RenderSVGInline.h
Source/WebCore/rendering/svg/RenderSVGModelObject.cpp
Source/WebCore/rendering/svg/RenderSVGModelObject.h
Source/WebCore/rendering/svg/RenderSVGRoot.h
Source/WebCore/rendering/svg/RenderSVGText.cpp
Source/WebCore/rendering/svg/RenderSVGText.h
Source/WebCore/rendering/svg/SVGRenderSupport.cpp
Source/WebCore/rendering/svg/SVGRenderSupport.h
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/src/FindInPageCoordinates.cpp
Source/WebKit/chromium/src/LinkHighlight.cpp
Source/WebKit/chromium/src/WebInputEventConversion.cpp
Source/WebKit/chromium/src/WebPluginContainerImpl.cpp
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebView/WebFullScreenController.mm
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/FullScreen/WebFullScreenManager.cpp
WebKit.xcworkspace/xcshareddata/xcschemes/All Source.xcscheme

index ba3a82b..aff6fea 100644 (file)
@@ -1,3 +1,23 @@
+2012-12-16  Levi Weintraub  <leviw@chromium.org>
+
+        Push pixel snapping logic into TransformState
+        https://bugs.webkit.org/show_bug.cgi?id=101779
+
+        Reviewed by Simon Fraser.
+
+        * fast/dom/Window/webkitConvertPoint.html: Updating values to match corrected pixel snapping.
+        * fast/multicol/break-properties.html: Fixing sub-pixel layout feature checking.
+        * fast/multicol/vertical-lr/break-properties.html: Ditto.
+        * fast/multicol/vertical-rl/break-properties.html: Ditto.
+        * fast/sub-pixel/sub-pixel-iframe-copy-on-scroll.html: Updating to catch the bug where the old
+        pixel snapping logic did the wrong thing when nested.
+        * fast/sub-pixel/transformed-iframe-copy-on-scroll.html: Added.
+        * platform/chromium-linux/fast/sub-pixel/sub-pixel-iframe-copy-on-scroll-expected.png:
+        * platform/chromium-linux/fast/sub-pixel/transformed-iframe-copy-on-scroll-expected.png: Added.
+        * platform/chromium-linux/fast/sub-pixel/transformed-iframe-copy-on-scroll-expected.txt: Added.
+        * platform/chromium-win/fast/sub-pixel/sub-pixel-iframe-copy-on-scroll-expected.txt:
+        * platform/chromium/TestExpectations:
+
 2012-12-16  Eric Carlson  <eric.carlson@apple.com>
 
         Remove in-band text tracks when media element's src changes
index 6867bfa..b5b82a5 100644 (file)
                 runTest("Test 8",  "test8",  8, 273, 13, 313);
                 runTest("Test 9",  "test9",  28, 291, 33, 331);
                 runTest("Test 10", "test10", 28, 309, 33, 349);
-                runTest("Test 11", "test11", 158, 355, 174, 373);
-                runTest("Test 12", "test12", 168, 428, 184, 446);
+                runTest("Test 11", "test11", 158, 356, 174, 374);
+                runTest("Test 12", "test12", 168, 429, 184, 447);
                 runTest("Test 13", "test13", 28, 487, 33, 527);
             } else {
                 runTest("Test 1",  "test1",  8, 12, 13, 52);
index 65f4cee..8a297e4 100644 (file)
@@ -10,6 +10,7 @@
     <div class="shorter box" style="-webkit-column-break-after: always;"></div>
     <div id="after-break" class="shorter box"></div>
     <div id="no-break" class="shorter box" style="-webkit-column-break-inside: avoid;"></div>
+    <div id="subPixelTest" style="width:10.5px"></div>
 </div>
 <pre id="console"></pre>
 <script>
@@ -30,8 +31,8 @@
             log("FAIL: '" + id + "' is at (" + Math.round(rect.left) + ", " + Math.round(rect.top) + ") instead of (" + expectedLeft + " ," + expectedTop + ")");
     }
 
-    var rect = document.getElementById('break-before').getBoundingClientRect();
-    var hasSubpixelSupport = Math.round(rect.left) != rect.left;
+    var rect = document.getElementById('subPixelTest').getBoundingClientRect();
+    var hasSubpixelSupport = Math.round(rect.right) != rect.right;
 
     testBoxPosition("break-before", hasSubpixelSupport ? 220 : 218, 8);
     testBoxPosition("after-break", hasSubpixelSupport ? 431 : 428, 8);
index d285f6d..17fd2b6 100644 (file)
@@ -11,6 +11,7 @@
     <div class="shorter box" style="-webkit-column-break-after: always;"></div>
     <div id="after-break" class="shorter box"></div>
     <div id="no-break" class="shorter box" style="-webkit-column-break-inside: avoid;"></div>
+    <div id="subPixelTest" style="width:10.5px"></div>
 </div>
 <pre id="console"></pre>
 <script>
@@ -31,8 +32,8 @@
             log("FAIL: '" + id + "' is at (" + Math.round(rect.left) + ", " + Math.round(rect.top) + ") instead of (" + expectedLeft + " ," + expectedTop + ")");
     }
 
-    var rect = document.getElementById('break-before').getBoundingClientRect();
-    var hasSubpixelSupport = Math.round(rect.top) != rect.top;
+    var rect = document.getElementById('subPixelTest').getBoundingClientRect();
+    var hasSubpixelSupport = Math.round(rect.bottom) != rect.bottom;
 
     testBoxPosition("break-before", 8, hasSubpixelSupport ? 220 : 218);
     testBoxPosition("after-break", 8, hasSubpixelSupport ? 431 : 428);
index 427ffb4..1735ebe 100644 (file)
@@ -14,6 +14,7 @@
     <div class="shorter box" style="-webkit-column-break-after: always;"></div>
     <div id="after-break" class="shorter box"></div>
     <div id="no-break" class="shorter box" style="-webkit-column-break-inside: avoid;"></div>
+    <div id="subPixelTest" style="width:10.5px"></div>
 </div>
 <pre id="console"></pre>
 <script>
@@ -34,8 +35,8 @@
             log("FAIL: '" + id + "' is at (" + Math.round(rect.left) + ", " + Math.round(rect.top) + ") instead of (" + expectedLeft + " ," + expectedTop + ")");
     }
 
-    var rect = document.getElementById('break-before').getBoundingClientRect();
-    var hasSubpixelSupport = Math.round(rect.top) != rect.top;
+    var rect = document.getElementById('subPixelTest').getBoundingClientRect();
+    var hasSubpixelSupport = Math.round(rect.bottom) != rect.bottom;
 
     testBoxPosition("break-before", 748, hasSubpixelSupport ? 220 : 218);
     testBoxPosition("after-break", 748, hasSubpixelSupport ? 431 : 428);
index 07970cf..0f29889 100644 (file)
@@ -2,10 +2,12 @@
 <html>
 <head>
 <style type="text/css" media="screen">
+.subpixelPusher {
+    position: relative;
+    top: 0.4px;
+}
 .container {
-    position: absolute;
-    padding: 10.3px;
-    z-index: 1;
+    display: inline-block;
 }
 </style>
 <script src="../repaint/resources/repaint.js" type="text/javascript"></script>
 if (window.testRunner)
   testRunner.waitUntilDone();
 
-function setupIframe() {
-  var subDocument = document.getElementById('iframe').contentWindow.document;
-  subDocument.open('text/html', 'replace');
-  subDocument.write("<!DOCTYPE html>\n<html><body style=\"background-color: silver;height: 1000px;\"></body>")
-  subDocument.close();
+function setupIframes() {
+  setupIframe(document.getElementById('iframe1').contentWindow.document);
+  setupIframe(document.getElementById('iframe2').contentWindow.document);
+  document.getElementById('iframe1').contentWindow.scrollTo(0, 10);
+}
+
+function setupIframe(iframe) {
+  iframe.open('text/html', 'replace');
+  iframe.write("<!DOCTYPE html>\n<html><body style=\"background-color: silver;height: 1000px;\"></body>");
+  iframe.close();
 }
 
 function repaintTest() {
-  document.getElementById('iframe').contentWindow.scrollTo(0, 10);
+  document.getElementById('iframe1').contentWindow.scrollTo(0, 0);
+  document.getElementById('iframe2').contentWindow.scrollTo(0, 10);
   if (window.testRunner)
     testRunner.notifyDone();
 }
 </script>
 </head>
-<body onload="setupIframe();runRepaintTest()">
-  <p>The iframe below should remain grey when scrolling.</p>
-  <div class="container">
-    <iframe id="iframe"  style="width: 300px; height: 200px;"></iframe>
+<body onload="setupIframes();runRepaintTest()">
+  <p>The iframes below should remain grey with no repaint artifacts when scrolling.</p>
+  <div>
+    <div class="container">
+      <div class="subpixelPusher">
+        <div class="subpixelPusher">
+        <iframe id="iframe1"  style="width: 150px; height: 200px;"></iframe>
+      </div>
+      </div>
+    </div>
+    <div class="container">
+      <div class="subpixelPusher">
+        <div class="subpixelPusher">
+          <iframe id="iframe2"  style="width: 150px; height: 200px;"></iframe>
+        </div>
+      </div>
+    </div>
   </div>
-  </div>
-
 </body>
 </html>
diff --git a/LayoutTests/fast/sub-pixel/transformed-iframe-copy-on-scroll.html b/LayoutTests/fast/sub-pixel/transformed-iframe-copy-on-scroll.html
new file mode 100644 (file)
index 0000000..a2d26e0
--- /dev/null
@@ -0,0 +1,79 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style type="text/css" media="screen">
+.subpixelPusher {
+    position: relative;
+    top: 0.4px;
+    z-index: 1;
+}
+.container {
+    display: inline-block;
+    padding-left: 80px;
+    padding-top: 10px;
+}
+.transform {
+  -webkit-transform: rotate3d(0, 0, 1, 45deg);
+}
+</style>
+<script src="../repaint/resources/repaint.js" type="text/javascript"></script>
+<script>
+if (window.testRunner)
+  testRunner.waitUntilDone();
+
+function setupIframes() {
+  setupIframe(document.getElementById('iframe1').contentWindow.document);
+  setupIframe(document.getElementById('iframe2').contentWindow.document);
+  document.getElementById('iframe1').contentWindow.scrollTo(0, 10);
+}
+
+function setupIframe(iframe) {
+  iframe.open('text/html', 'replace');
+  iframe.write("<!DOCTYPE html>\n<html><body style=\"background-color: silver;height: 1000px;\"></body>");
+  iframe.close();
+}
+
+function repaintTest() {
+  document.getElementById('iframe1').contentWindow.scrollTo(0, 0);
+  document.getElementById('iframe2').contentWindow.scrollTo(0, 10);
+  if (window.testRunner)
+    testRunner.notifyDone();
+}
+</script>
+</head>
+<body onload="setupIframes();runRepaintTest()">
+  <p>The iframes below should remain grey with no repaint artifacts when scrolling.</p>
+  <div>
+    <div class="container">
+      <div class="transform">
+        <div class="subpixelPusher">
+          <div class="subpixelPusher">
+            <iframe id="iframe1"  style="width: 150px; height: 200px;"></iframe>
+          </div>
+        </div>
+      </div>
+    </div>
+    <div class="container">
+      <div class="subpixelPusher">
+        <div class="subpixelPusher">
+          <div class="subpixelPusher">
+            <div class="transform">
+              <div class="subpixelPusher">
+                <div class="subpixelPusher">
+                  <div class="subpixelPusher">
+                    <div class="transform">
+                      <div class="subpixelPusher">
+                        <iframe id="iframe2"  style="width: 150px; height: 200px;"></iframe>
+                      </div>
+                    </div>
+                  </div>                
+                </div>
+              </div>
+            </div>
+          </div>
+        </div>
+      </div>
+    </div>
+  </div>
+</body>
+</html>
index 4faa22a..84f903b 100644 (file)
Binary files a/LayoutTests/platform/chromium-linux/fast/sub-pixel/sub-pixel-iframe-copy-on-scroll-expected.png and b/LayoutTests/platform/chromium-linux/fast/sub-pixel/sub-pixel-iframe-copy-on-scroll-expected.png differ
diff --git a/LayoutTests/platform/chromium-linux/fast/sub-pixel/transformed-iframe-copy-on-scroll-expected.png b/LayoutTests/platform/chromium-linux/fast/sub-pixel/transformed-iframe-copy-on-scroll-expected.png
new file mode 100644 (file)
index 0000000..c343235
Binary files /dev/null and b/LayoutTests/platform/chromium-linux/fast/sub-pixel/transformed-iframe-copy-on-scroll-expected.png differ
diff --git a/LayoutTests/platform/chromium-linux/fast/sub-pixel/transformed-iframe-copy-on-scroll-expected.txt b/LayoutTests/platform/chromium-linux/fast/sub-pixel/transformed-iframe-copy-on-scroll-expected.txt
new file mode 100644 (file)
index 0000000..47a6221
--- /dev/null
@@ -0,0 +1,52 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x279
+  RenderBlock {HTML} at (0,0) size 800x279
+    RenderBody {BODY} at (8,16) size 784x255
+      RenderBlock {P} at (0,0) size 784x20
+        RenderText {#text} at (0,0) size 465x19
+          text run at (0,0) width 465: "The iframes below should remain grey with no repaint artifacts when scrolling."
+      RenderBlock {DIV} at (0,36) size 784x219
+        RenderBlock {DIV} at (0,0) size 234x219
+        RenderText {#text} at (234,199) size 4x19
+          text run at (234,199) width 4: " "
+        RenderBlock {DIV} at (238,0) size 234x219
+        RenderText {#text} at (0,0) size 0x0
+layer at (88,62) size 154x209
+  RenderBlock {DIV} at (80,10) size 154x209
+layer at (88,62) size 154x209
+  RenderBlock (relative positioned) zI: 1 {DIV} at (0,0) size 154x209
+layer at (88,63) size 154x209
+  RenderBlock (relative positioned) zI: 1 {DIV} at (0,0) size 154x209
+    RenderPartObject {IFRAME} at (0,0) size 154x204 [border: (2px inset #000000)]
+      layer at (0,0) size 135x1016
+        RenderView at (0,0) size 135x200
+      layer at (0,0) size 135x1016
+        RenderBlock {HTML} at (0,0) size 135x1016
+          RenderBody {BODY} at (8,8) size 119x1000 [bgcolor=#C0C0C0]
+    RenderText zI: 1 {#text} at (0,0) size 0x0
+layer at (326,62) size 154x209
+  RenderBlock (relative positioned) zI: 1 {DIV} at (80,10) size 154x209
+layer at (326,63) size 154x209
+  RenderBlock (relative positioned) zI: 1 {DIV} at (0,0) size 154x209
+layer at (326,63) size 154x209
+  RenderBlock (relative positioned) zI: 1 {DIV} at (0,0) size 154x209
+layer at (326,63) size 154x209
+  RenderBlock {DIV} at (0,0) size 154x209
+layer at (326,64) size 154x209
+  RenderBlock (relative positioned) zI: 1 {DIV} at (0,0) size 154x209
+layer at (326,64) size 154x209
+  RenderBlock (relative positioned) zI: 1 {DIV} at (0,0) size 154x209
+layer at (326,64) size 154x209
+  RenderBlock (relative positioned) zI: 1 {DIV} at (0,0) size 154x209
+layer at (326,64) size 154x209
+  RenderBlock {DIV} at (0,0) size 154x209
+layer at (326,65) size 154x209
+  RenderBlock (relative positioned) zI: 1 {DIV} at (0,0) size 154x209
+    RenderPartObject {IFRAME} at (0,0) size 154x204 [border: (2px inset #000000)]
+      layer at (0,0) size 135x1016
+        RenderView at (0,0) size 135x200
+      layer at (0,0) size 135x1016
+        RenderBlock {HTML} at (0,0) size 135x1016
+          RenderBody {BODY} at (8,8) size 119x1000 [bgcolor=#C0C0C0]
+    RenderText zI: 1 {#text} at (0,0) size 0x0
index 1c921f5..2e4401f 100644 (file)
@@ -1,17 +1,36 @@
 layer at (0,0) size 800x600
   RenderView at (0,0) size 800x600
-layer at (0,0) size 800x52
-  RenderBlock {HTML} at (0,0) size 800x52
-    RenderBody {BODY} at (8,16) size 784x20
+layer at (0,0) size 800x269
+  RenderBlock {HTML} at (0,0) size 800x269
+    RenderBody {BODY} at (8,16) size 784x245
       RenderBlock {P} at (0,0) size 784x20
-        RenderText {#text} at (0,0) size 315x19
-          text run at (0,0) width 315: "The iframe below should remain grey when scrolling."
-layer at (8,52) size 325x230
-  RenderBlock (positioned) zI: 1 {DIV} at (8,52) size 325x230
-    RenderPartObject {IFRAME} at (10,10) size 304x205 [border: (2px inset #000000)]
-      layer at (0,0) size 285x1016
-        RenderView at (0,0) size 285x200
-      layer at (0,0) size 285x1016
-        RenderBlock {HTML} at (0,0) size 285x1016
-          RenderBody {BODY} at (8,8) size 269x1000 [bgcolor=#C0C0C0]
-    RenderText zI: 1 {#text} at (0,0) size 0x0
+        RenderText {#text} at (0,0) size 465x19
+          text run at (0,0) width 465: "The iframes below should remain grey with no repaint artifacts when scrolling."
+      RenderBlock {DIV} at (0,36) size 784x209
+        RenderBlock {DIV} at (0,0) size 154x209
+        RenderText {#text} at (154,189) size 4x19
+          text run at (154,189) width 4: " "
+        RenderBlock {DIV} at (158,0) size 154x209
+        RenderText {#text} at (0,0) size 0x0
+layer at (8,52) size 154x209
+  RenderBlock (relative positioned) {DIV} at (0,0) size 154x209
+layer at (8,53) size 154x209
+  RenderBlock (relative positioned) {DIV} at (0,0) size 154x209
+    RenderPartObject {IFRAME} at (0,0) size 154x204 [border: (2px inset #000000)]
+      layer at (0,0) size 135x1016
+        RenderView at (0,0) size 135x200
+      layer at (0,0) size 135x1016
+        RenderBlock {HTML} at (0,0) size 135x1016
+          RenderBody {BODY} at (8,8) size 119x1000 [bgcolor=#C0C0C0]
+    RenderText {#text} at (0,0) size 0x0
+layer at (166,52) size 154x209
+  RenderBlock (relative positioned) {DIV} at (0,0) size 154x209
+layer at (166,53) size 154x209
+  RenderBlock (relative positioned) {DIV} at (0,0) size 154x209
+    RenderPartObject {IFRAME} at (0,0) size 154x204 [border: (2px inset #000000)]
+      layer at (0,0) size 135x1016
+        RenderView at (0,0) size 135x200
+      layer at (0,0) size 135x1016
+        RenderBlock {HTML} at (0,0) size 135x1016
+          RenderBody {BODY} at (8,8) size 119x1000 [bgcolor=#C0C0C0]
+    RenderText {#text} at (0,0) size 0x0
index 041fe3d..adcc423 100644 (file)
@@ -4069,6 +4069,14 @@ Bug(dpranke) [ Win ] webaudio/codec-tests/vorbis/vbr-128kbps-44khz.html [ Failur
 
 webkit.org/b/100023 [ Mac ] fast/sub-pixel/file-upload-control-at-fractional-offset.html [ Failure ImageOnlyFailure ]
 
+# Needs rebaseline after bots cycle
+Bug(leviw) [ Linux Win Mac ] fast/sub-pixel/sub-pixel-iframe-copy-on-scroll.html [ Pass ImageOnlyFailure Failure ]
+Bug(leviw) [ Linux Win Mac ] fast/sub-pixel/transformed-iframe-copy-on-scroll.html [ Pass ImageOnlyFailure Failure ]
+Bug(leviw) [ Linux Win Mac ] platform/chromium/fast/forms/suggestion-picker/date-suggestion-picker-appearance-with-scroll-bar.html [ Pass ImageOnlyFailure ]
+Bug(leviw) [ Linux Win Mac ] platform/chromium/fast/forms/suggestion-picker/month-suggestion-picker-appearance-with-scroll-bar.html [ Pass ImageOnlyFailure ]
+Bug(leviw) [ Linux Win Mac ] platform/chromium/fast/forms/suggestion-picker/week-suggestion-picker-appearance-with-scroll-bar.html [ Pass ImageOnlyFailure ]
+Bug(leviw) [ Linux ] fast/dom/Window/webkitConvertPoint.html [ Failure ]
+
 webkit.org/b/100478  [ Mac ] css3/filters/custom/effect-custom.html [ ImageOnlyFailure ]
 
 webkit.org/b/100424 editing/selection/user-select-all-selection.html [ Failure ]
index 9208c1d..f859206 100644 (file)
@@ -154,7 +154,7 @@ AXRoleDescription: radio button
 AXChildren: <array of size 0>
 AXHelp: 
 AXParent: <AXRadioButton: 'Yes'>
-AXSize: NSSize: {41, 19}
+AXSize: NSSize: {42, 19}
 AXTitle: Yes
 AXDescription: 
 AXValue: 0
@@ -182,7 +182,7 @@ AXRoleDescription: radio button
 AXChildren: <array of size 0>
 AXHelp: 
 AXParent: <AXRadioButton: 'No'>
-AXSize: NSSize: {36, 19}
+AXSize: NSSize: {37, 19}
 AXTitle: No
 AXDescription: 
 AXValue: 0
index 1d76b61..02604c1 100644 (file)
@@ -158,24 +158,24 @@ PASS y is 40
 
 Test 11
 PASS x is 158
-PASS y is 355
+PASS y is 356
 Round Trip of (0,0)
 PASS x is 0
 PASS y is 0
 PASS x is 174
-PASS y is 373
+PASS y is 374
 Round Trip of (5,40)
 PASS x is 5
 PASS y is 40
 
 Test 12
 PASS x is 168
-PASS y is 428
+PASS y is 429
 Round Trip of (0,0)
 PASS x is 0
 PASS y is 0
 PASS x is 184
-PASS y is 446
+PASS y is 447
 Round Trip of (5,40)
 PASS x is 5
 PASS y is 40
index a65a36f..3a10306 100644 (file)
@@ -1,3 +1,139 @@
+2012-12-16  Levi Weintraub  <leviw@chromium.org>
+
+        Push pixel snapping logic into TransformState
+        https://bugs.webkit.org/show_bug.cgi?id=101779
+
+        Reviewed by Simon Fraser.
+
+        The old SnapOffsetForTransforms behavior fell apart when there was content nested in
+        multiple levels of containers with sub-pixel offsets. The point of this flag was to
+        mirror the pixel snapping that occurs in paint, where offsets are accumulated bottom-
+        up through the render tree and snapped at the end. This change eliminates this flag
+        and pushes pixel snapping logic down into TransformState.
+
+        TransformState now tracks a LayoutSize accumulated offset when there's no transform
+        or we're just translating. We then snap and apply this offset before accumulating
+        values into a transform, and when returning planar coordinates to callers.
+
+        Test: fast/sub-pixel/transformed-iframe-copy-on-scroll.html added,
+              fast/sub-pixel/sub-pixel-iframe-copy-on-scroll.html modified to also catch this bug.
+
+        * platform/graphics/transforms/TransformState.cpp:
+        (WebCore::TransformState::operator=): Pass accumulated offset.
+        (WebCore::TransformState::translateTransform): Extracted this functionality for
+        re-use when applying the accumulated offset, or accumulating from a call to move.
+        (WebCore::TransformState::translateMappedCoordinates): Same as above when we're not
+        acculating into a transform.
+        (WebCore::TransformState::move): Changed to accumulate into m_accumulatedOffset when
+        not accumulating into a transform.
+        (WebCore::TransformState::applyAccumulatedOffset):
+        (WebCore::TransformState::applyTransform): Applies the accumulated offset before the
+        transform.
+        (WebCore::TransformState::flatten): Ditto for flattening.
+        (WebCore::TransformState::mappedPoint): Translates by the accumulated offset before
+        returning.
+        (WebCore::TransformState::mappedQuad): Ditto.
+        * platform/graphics/transforms/TransformState.h:
+        (TransformState): Added m_accumulatedOffset.
+        * rendering/RenderGeometryMap.cpp:
+        (WebCore::RenderGeometryMap::mapToContainer): When not using a transform, we still need
+        to snap our offset before applying to our float result. Also, flatten when we have a
+        non-uniform step.
+        * rendering/RenderGeometryMap.h:
+        (RenderGeometryMap): Remove use of SnapOffsetForTransforms.
+
+        Everything below simply drops the use of SnapOffsetForTransforms:
+
+        * dom/ContainerNode.cpp:
+        (WebCore::ContainerNode::getUpperLeftCorner):
+        * dom/MouseRelatedEvent.cpp:
+        (WebCore::MouseRelatedEvent::computeRelativePosition):
+        * editing/FrameSelection.cpp:
+        (WebCore::CaretBase::absoluteBoundsForLocalRect):
+        * editing/RenderedPosition.cpp:
+        (WebCore::RenderedPosition::absoluteRect):
+        * editing/VisiblePosition.cpp:
+        (WebCore::VisiblePosition::absoluteCaretBounds):
+        * html/HTMLSelectElement.cpp:
+        (WebCore::HTMLSelectElement::listBoxDefaultEventHandler):
+        * html/shadow/SliderThumbElement.cpp:
+        (WebCore::SliderThumbElement::setPositionFromPoint):
+        * html/shadow/SpinButtonElement.cpp:
+        (WebCore::SpinButtonElement::defaultEventHandler):
+        * page/FrameView.cpp:
+        (WebCore::FrameView::convertFromRenderer):
+        (WebCore::FrameView::convertToRenderer):
+        * rendering/InlineTextBox.cpp:
+        (WebCore::InlineTextBox::paintDocumentMarker):
+        (WebCore::InlineTextBox::paintTextMatchMarker):
+        (WebCore::InlineTextBox::computeRectForReplacementMarker):
+        * rendering/LayoutState.cpp:
+        (WebCore::LayoutState::LayoutState):
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::mapLocalToContainer):
+        (WebCore::RenderBox::pushMappingToContainer):
+        * rendering/RenderBox.h:
+        (RenderBox):
+        * rendering/RenderBoxModelObject.cpp:
+        (WebCore::RenderBoxModelObject::computeStickyPositionConstraints):
+        * rendering/RenderEmbeddedObject.cpp:
+        (WebCore::RenderEmbeddedObject::isInUnavailablePluginIndicator):
+        * rendering/RenderFrameSet.cpp:
+        (WebCore::RenderFrameSet::userResize):
+        * rendering/RenderInline.cpp:
+        (WebCore::RenderInline::mapLocalToContainer):
+        (WebCore::RenderInline::pushMappingToContainer):
+        * rendering/RenderInline.h:
+        (RenderInline):
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::absoluteToContents):
+        (WebCore::RenderLayer::scrollTo):
+        (WebCore::RenderLayer::childrenClipRect):
+        (WebCore::RenderLayer::selfClipRect):
+        * rendering/RenderLayerBacking.cpp:
+        (WebCore::RenderLayerBacking::contentsVisible):
+        * rendering/RenderMediaControls.cpp:
+        (WebCore::RenderMediaControls::volumeSliderOffsetFromMuteButton):
+        * rendering/RenderMenuList.cpp:
+        (WebCore::RenderMenuList::showPopup):
+        * rendering/RenderObject.cpp:
+        (WebCore::RenderObject::absoluteFocusRingQuads):
+        * rendering/RenderObject.h:
+        * rendering/RenderText.cpp:
+        (WebCore::RenderText::absoluteRectsForRange):
+        (WebCore::RenderText::absoluteQuads):
+        (WebCore::RenderText::absoluteQuadsForRange):
+        * rendering/RenderTheme.cpp:
+        (WebCore::RenderTheme::volumeSliderOffsetFromMuteButton):
+        * rendering/RenderView.cpp:
+        (WebCore::RenderView::selectionBounds):
+        * rendering/RenderView.h:
+        (RenderView):
+        * rendering/RenderWidget.cpp:
+        (WebCore::RenderWidget::updateWidgetGeometry):
+        * rendering/svg/RenderSVGForeignObject.cpp:
+        (WebCore::RenderSVGForeignObject::mapLocalToContainer):
+        * rendering/svg/RenderSVGForeignObject.h:
+        (RenderSVGForeignObject):
+        * rendering/svg/RenderSVGInline.cpp:
+        (WebCore::RenderSVGInline::mapLocalToContainer):
+        * rendering/svg/RenderSVGInline.h:
+        (RenderSVGInline):
+        * rendering/svg/RenderSVGModelObject.cpp:
+        (WebCore::RenderSVGModelObject::mapLocalToContainer):
+        * rendering/svg/RenderSVGModelObject.h:
+        (RenderSVGModelObject):
+        * rendering/svg/RenderSVGRoot.h:
+        (RenderSVGRoot):
+        * rendering/svg/RenderSVGText.cpp:
+        (WebCore::RenderSVGText::mapLocalToContainer):
+        * rendering/svg/RenderSVGText.h:
+        (RenderSVGText):
+        * rendering/svg/SVGRenderSupport.cpp:
+        (WebCore::SVGRenderSupport::mapLocalToContainer):
+        * rendering/svg/SVGRenderSupport.h:
+        (SVGRenderSupport):
+
 2012-12-15  Anders Carlsson  <andersca@apple.com>
 
         Rename FrameLoaderClient::download to convertMainResourceLoadToDownload
index 630a8fd..75fd704 100644 (file)
@@ -864,7 +864,7 @@ bool ContainerNode::getUpperLeftCorner(FloatPoint& point) const
                 RenderBox* box = toRenderBox(o);
                 point.moveBy(box->location());
             }
-            point = o->container()->localToAbsolute(point, UseTransforms | SnapOffsetForTransforms);
+            point = o->container()->localToAbsolute(point, UseTransforms);
             return true;
         }
     }
index 81326d0..40a5c6b 100644 (file)
@@ -165,7 +165,7 @@ void MouseRelatedEvent::computeRelativePosition()
 
     // Adjust offsetLocation to be relative to the target's position.
     if (RenderObject* r = targetNode->renderer()) {
-        FloatPoint localPos = r->absoluteToLocal(absoluteLocation(), UseTransforms | SnapOffsetForTransforms);
+        FloatPoint localPos = r->absoluteToLocal(absoluteLocation(), UseTransforms);
         m_offsetLocation = roundedLayoutPoint(localPos);
         float scaleFactor = 1 / (pageZoomFactor(this) * frameScaleFactor(this));
         if (scaleFactor != 1.0f)
index 22c9976..ba2a20b 100644 (file)
@@ -1312,7 +1312,7 @@ IntRect CaretBase::absoluteBoundsForLocalRect(Node* node, const LayoutRect& rect
     LayoutRect localRect(rect);
     if (caretPainter->isBox())
         toRenderBox(caretPainter)->flipForWritingMode(localRect);
-    return caretPainter->localToAbsoluteQuad(FloatRect(localRect), SnapOffsetForTransforms).enclosingBoundingBox();
+    return caretPainter->localToAbsoluteQuad(FloatRect(localRect)).enclosingBoundingBox();
 }
 
 IntRect FrameSelection::absoluteCaretBounds()
index d03c77b..7490d71 100644 (file)
@@ -230,7 +230,7 @@ IntRect RenderedPosition::absoluteRect(LayoutUnit* extraWidthToEndOfLine) const
         return IntRect();
 
     IntRect localRect = pixelSnappedIntRect(m_renderer->localCaretRect(m_inlineBox, m_offset, extraWidthToEndOfLine));
-    return localRect == IntRect() ? IntRect() : m_renderer->localToAbsoluteQuad(FloatRect(localRect), SnapOffsetForTransforms).enclosingBoundingBox();
+    return localRect == IntRect() ? IntRect() : m_renderer->localToAbsoluteQuad(FloatRect(localRect)).enclosingBoundingBox();
 }
 
 bool renderObjectContainsPosition(RenderObject* target, const Position& position)
index 51b8d24..8d1757a 100644 (file)
@@ -624,7 +624,7 @@ IntRect VisiblePosition::absoluteCaretBounds() const
     if (localRect.isEmpty() || !renderer)
         return IntRect();
 
-    return renderer->localToAbsoluteQuad(FloatRect(localRect), SnapOffsetForTransforms).enclosingBoundingBox();
+    return renderer->localToAbsoluteQuad(FloatRect(localRect)).enclosingBoundingBox();
 }
 
 int VisiblePosition::lineDirectionPointForBlockDirectionNavigation() const
index 3587234..1f92d74 100644 (file)
@@ -1286,7 +1286,7 @@ void HTMLSelectElement::listBoxDefaultEventHandler(Event* event)
 
         // Convert to coords relative to the list box if needed.
         MouseEvent* mouseEvent = static_cast<MouseEvent*>(event);
-        IntPoint localOffset = roundedIntPoint(renderer()->absoluteToLocal(mouseEvent->absoluteLocation(), UseTransforms | SnapOffsetForTransforms));
+        IntPoint localOffset = roundedIntPoint(renderer()->absoluteToLocal(mouseEvent->absoluteLocation(), UseTransforms));
         int listIndex = toRenderListBox(renderer())->listIndexAtOffset(toSize(localOffset));
         if (listIndex >= 0) {
             if (!disabled()) {
@@ -1306,7 +1306,7 @@ void HTMLSelectElement::listBoxDefaultEventHandler(Event* event)
         if (mouseEvent->button() != LeftButton || !mouseEvent->buttonDown())
             return;
 
-        IntPoint localOffset = roundedIntPoint(renderer()->absoluteToLocal(mouseEvent->absoluteLocation(), UseTransforms | SnapOffsetForTransforms));
+        IntPoint localOffset = roundedIntPoint(renderer()->absoluteToLocal(mouseEvent->absoluteLocation(), UseTransforms));
         int listIndex = toRenderListBox(renderer())->listIndexAtOffset(toSize(localOffset));
         if (listIndex >= 0) {
             if (!disabled()) {
index de889ca..2e5aabb 100644 (file)
@@ -259,7 +259,7 @@ void SliderThumbElement::setPositionFromPoint(const LayoutPoint& point)
         return;
 
     input->setTextAsOfLastFormControlChangeEvent(input->value());
-    LayoutPoint offset = roundedLayoutPoint(input->renderer()->absoluteToLocal(point, UseTransforms | SnapOffsetForTransforms));
+    LayoutPoint offset = roundedLayoutPoint(input->renderer()->absoluteToLocal(point, UseTransforms));
     bool isVertical = hasVerticalAppearance(input);
     bool isLeftToRightDirection = renderBox()->style()->isLeftToRightDirection();
     LayoutUnit trackSize;
index 01c48bc..f23bab8 100644 (file)
@@ -91,7 +91,7 @@ void SpinButtonElement::defaultEventHandler(Event* event)
     }
 
     MouseEvent* mouseEvent = static_cast<MouseEvent*>(event);
-    IntPoint local = roundedIntPoint(box->absoluteToLocal(mouseEvent->absoluteLocation(), UseTransforms | SnapOffsetForTransforms));
+    IntPoint local = roundedIntPoint(box->absoluteToLocal(mouseEvent->absoluteLocation(), UseTransforms));
     if (mouseEvent->type() == eventNames().mousedownEvent && mouseEvent->button() == LeftButton) {
         if (box->pixelSnappedBorderBoxRect().contains(local)) {
             // The following functions of HTMLInputElement may run JavaScript
index 046560e..c6b62c7 100644 (file)
@@ -3507,7 +3507,7 @@ void FrameView::adjustPageHeightDeprecated(float *newBottom, float oldTop, float
 
 IntRect FrameView::convertFromRenderer(const RenderObject* renderer, const IntRect& rendererRect) const
 {
-    IntRect rect = renderer->localToAbsoluteQuad(FloatRect(rendererRect), SnapOffsetForTransforms).enclosingBoundingBox();
+    IntRect rect = renderer->localToAbsoluteQuad(FloatRect(rendererRect)).enclosingBoundingBox();
 
     // Convert from page ("absolute") to FrameView coordinates.
     if (!delegatesScrolling())
@@ -3526,13 +3526,13 @@ IntRect FrameView::convertToRenderer(const RenderObject* renderer, const IntRect
 
     // FIXME: we don't have a way to map an absolute rect down to a local quad, so just
     // move the rect for now.
-    rect.setLocation(roundedIntPoint(renderer->absoluteToLocal(rect.location(), UseTransforms | SnapOffsetForTransforms)));
+    rect.setLocation(roundedIntPoint(renderer->absoluteToLocal(rect.location(), UseTransforms)));
     return rect;
 }
 
 IntPoint FrameView::convertFromRenderer(const RenderObject* renderer, const IntPoint& rendererPoint) const
 {
-    IntPoint point = roundedIntPoint(renderer->localToAbsolute(rendererPoint, UseTransforms | SnapOffsetForTransforms));
+    IntPoint point = roundedIntPoint(renderer->localToAbsolute(rendererPoint, UseTransforms));
 
     // Convert from page ("absolute") to FrameView coordinates.
     if (!delegatesScrolling())
@@ -3548,7 +3548,7 @@ IntPoint FrameView::convertToRenderer(const RenderObject* renderer, const IntPoi
     if (!delegatesScrolling())
         point += IntSize(scrollX(), scrollY());
 
-    return roundedIntPoint(renderer->absoluteToLocal(point, UseTransforms | SnapOffsetForTransforms));
+    return roundedIntPoint(renderer->absoluteToLocal(point, UseTransforms));
 }
 
 IntRect FrameView::convertToContainingView(const IntRect& localRect) const
index e0a9cec..3d8803e 100644 (file)
@@ -32,6 +32,7 @@ namespace WebCore {
 
 TransformState& TransformState::operator=(const TransformState& other)
 {
+    m_accumulatedOffset = other.m_accumulatedOffset;
     m_mapPoint = other.m_mapPoint;
     m_mapQuad = other.m_mapQuad;
     if (m_mapPoint)
@@ -49,32 +50,56 @@ TransformState& TransformState::operator=(const TransformState& other)
     return *this;
 }
 
-void TransformState::move(LayoutUnit x, LayoutUnit y, TransformAccumulation accumulate)
+void TransformState::translateTransform(const IntSize& offset)
 {
-    if (m_accumulatingTransform && m_accumulatedTransform) {
-        // If we're accumulating into an existing transform, apply the translation.
-        if (m_direction == ApplyTransformDirection)
-            m_accumulatedTransform->translateRight(x, y);
-        else
-            m_accumulatedTransform->translate(x, y);
-        
-        // Then flatten if necessary.
-        if (accumulate == FlattenTransform)
-            flatten();
-    } else {
-        // Just move the point and, optionally, the quad.
-        if (m_direction == UnapplyInverseTransformDirection) {
-            x = -x;
-            y = -y;
-        }
-        if (m_mapPoint)
-            m_lastPlanarPoint.move(x, y);
-        if (m_mapQuad)
-            m_lastPlanarQuad.move(x, y);
+    if (m_direction == ApplyTransformDirection)
+        m_accumulatedTransform->translateRight(offset.width(), offset.height());
+    else
+        m_accumulatedTransform->translate(offset.width(), offset.height());
+}
+
+void TransformState::translateMappedCoordinates(const IntSize& offset)
+{
+    IntSize adjustedOffset = (m_direction == ApplyTransformDirection) ? offset : -offset;
+    if (m_mapPoint)
+        m_lastPlanarPoint.move(adjustedOffset);
+    if (m_mapQuad)
+        m_lastPlanarQuad.move(adjustedOffset);
+}
+
+void TransformState::move(const LayoutSize& offset, TransformAccumulation accumulate)
+{
+    if (accumulate == FlattenTransform || !m_accumulatedTransform)
+        m_accumulatedOffset += offset;
+    else {
+        applyAccumulatedOffset();
+        if (m_accumulatingTransform && m_accumulatedTransform) {
+            // If we're accumulating into an existing transform, apply the translation.
+            translateTransform(roundedIntSize(offset));
+
+            // Then flatten if necessary.
+            if (accumulate == FlattenTransform)
+                flatten();
+        } else
+            // Just move the point and/or quad.
+            translateMappedCoordinates(roundedIntSize(offset));
     }
     m_accumulatingTransform = accumulate == AccumulateTransform;
 }
 
+void TransformState::applyAccumulatedOffset()
+{
+    IntSize offset = roundedIntSize(m_accumulatedOffset);
+    m_accumulatedOffset = LayoutSize();
+    if (!offset.isZero()) {
+        if (m_accumulatedTransform) {
+            translateTransform(offset);
+            flatten();
+        } else
+            translateMappedCoordinates(offset);
+    }
+}
+
 // FIXME: We transform AffineTransform to TransformationMatrix. This is rather inefficient.
 void TransformState::applyTransform(const AffineTransform& transformFromContainer, TransformAccumulation accumulate, bool* wasClamped)
 {
@@ -86,6 +111,8 @@ void TransformState::applyTransform(const TransformationMatrix& transformFromCon
     if (wasClamped)
         *wasClamped = false;
 
+    applyAccumulatedOffset();
+
     // If we have an accumulated transform from last time, multiply in this transform
     if (m_accumulatedTransform) {
         if (m_direction == ApplyTransformDirection)
@@ -109,6 +136,8 @@ void TransformState::flatten(bool* wasClamped)
     if (wasClamped)
         *wasClamped = false;
 
+    applyAccumulatedOffset();
+
     if (!m_accumulatedTransform) {
         m_accumulatingTransform = false;
         return;
@@ -122,13 +151,15 @@ FloatPoint TransformState::mappedPoint(bool* wasClamped) const
     if (wasClamped)
         *wasClamped = false;
 
+    FloatPoint point = m_lastPlanarPoint;
+    point.move((m_direction == ApplyTransformDirection) ? m_accumulatedOffset : -m_accumulatedOffset);
     if (!m_accumulatedTransform)
-        return m_lastPlanarPoint;
+        return point;
 
     if (m_direction == ApplyTransformDirection)
-        return m_accumulatedTransform->mapPoint(m_lastPlanarPoint);
+        return m_accumulatedTransform->mapPoint(point);
 
-    return m_accumulatedTransform->inverse().projectPoint(m_lastPlanarPoint, wasClamped);
+    return m_accumulatedTransform->inverse().projectPoint(point, wasClamped);
 }
 
 FloatQuad TransformState::mappedQuad(bool* wasClamped) const
@@ -136,13 +167,15 @@ FloatQuad TransformState::mappedQuad(bool* wasClamped) const
     if (wasClamped)
         *wasClamped = false;
 
+    FloatQuad quad = m_lastPlanarQuad;
+    quad.move((m_direction == ApplyTransformDirection) ? m_accumulatedOffset : -m_accumulatedOffset);
     if (!m_accumulatedTransform)
-        return m_lastPlanarQuad;
+        return quad;
 
     if (m_direction == ApplyTransformDirection)
-        return m_accumulatedTransform->mapQuad(m_lastPlanarQuad);
+        return m_accumulatedTransform->mapQuad(quad);
 
-    return m_accumulatedTransform->inverse().projectQuad(m_lastPlanarQuad, wasClamped);
+    return m_accumulatedTransform->inverse().projectQuad(quad, wasClamped);
 }
 
 void TransformState::flattenWithTransform(const TransformationMatrix& t, bool* wasClamped)
index 1d1d355..1afa340 100644 (file)
@@ -74,13 +74,13 @@ public:
     TransformState& operator=(const TransformState&);
     
     void setQuad(const FloatQuad& quad) { m_lastPlanarQuad = quad; }
-    
-    void move(const LayoutSize& s, TransformAccumulation accumulate = FlattenTransform)
+
+    void move(LayoutUnit x, LayoutUnit y, TransformAccumulation accumulate = FlattenTransform)
     {
-        move(s.width(), s.height(), accumulate);
+        move(LayoutSize(x, y), accumulate);
     }
-    
-    void move(LayoutUnit x, LayoutUnit y, TransformAccumulation = FlattenTransform);
+
+    void move(const LayoutSize&, TransformAccumulation = FlattenTransform);
     void applyTransform(const AffineTransform& transformFromContainer, TransformAccumulation = FlattenTransform, bool* wasClamped = 0);
     void applyTransform(const TransformationMatrix& transformFromContainer, TransformAccumulation = FlattenTransform, bool* wasClamped = 0);
     void flatten(bool* wasClamped = 0);
@@ -94,13 +94,17 @@ public:
     FloatQuad mappedQuad(bool* wasClamped = 0) const;
 
 private:
+    void translateTransform(const IntSize&);
+    void translateMappedCoordinates(const IntSize&);
     void flattenWithTransform(const TransformationMatrix&, bool* wasClamped);
+    void applyAccumulatedOffset();
     
     FloatPoint m_lastPlanarPoint;
     FloatQuad m_lastPlanarQuad;
 
     // We only allocate the transform if we need to
     OwnPtr<TransformationMatrix> m_accumulatedTransform;
+    LayoutSize m_accumulatedOffset;
     bool m_accumulatingTransform;
     bool m_mapPoint, m_mapQuad;
     TransformDirection m_direction;
index 1678a21..2992429 100644 (file)
@@ -1125,7 +1125,7 @@ void InlineTextBox::paintDocumentMarker(GraphicsContext* pt, const FloatPoint& b
         // display a toolTip. We don't do this for misspelling markers.
         if (grammar || isDictationMarker) {
             markerRect.move(-boxOrigin.x(), -boxOrigin.y());
-            markerRect = renderer()->localToAbsoluteQuad(FloatRect(markerRect), SnapOffsetForTransforms).enclosingBoundingBox();
+            markerRect = renderer()->localToAbsoluteQuad(FloatRect(markerRect)).enclosingBoundingBox();
             toRenderedDocumentMarker(marker)->setRenderedRect(markerRect);
         }
     }
@@ -1163,7 +1163,7 @@ void InlineTextBox::paintTextMatchMarker(GraphicsContext* pt, const FloatPoint&
 
     // Always compute and store the rect associated with this marker. The computed rect is in absolute coordinates.
     IntRect markerRect = enclosingIntRect(font.selectionRectForText(run, IntPoint(x(), selectionTop()), selHeight, sPos, ePos));
-    markerRect = renderer()->localToAbsoluteQuad(FloatRect(markerRect), SnapOffsetForTransforms).enclosingBoundingBox();
+    markerRect = renderer()->localToAbsoluteQuad(FloatRect(markerRect)).enclosingBoundingBox();
     toRenderedDocumentMarker(marker)->setRenderedRect(markerRect);
     
     // Optionally highlight the text
@@ -1191,7 +1191,7 @@ void InlineTextBox::computeRectForReplacementMarker(DocumentMarker* marker, Rend
     
     // Compute and store the rect associated with this marker.
     IntRect markerRect = enclosingIntRect(font.selectionRectForText(run, startPoint, h, sPos, ePos));
-    markerRect = renderer()->localToAbsoluteQuad(FloatRect(markerRect), SnapOffsetForTransforms).enclosingBoundingBox();
+    markerRect = renderer()->localToAbsoluteQuad(FloatRect(markerRect)).enclosingBoundingBox();
     toRenderedDocumentMarker(marker)->setRenderedRect(markerRect);
 }
     
index 485d917..9b048af 100644 (file)
@@ -156,7 +156,7 @@ LayoutState::LayoutState(RenderObject* root)
 #endif
 {
     RenderObject* container = root->container();
-    FloatPoint absContentPoint = container->localToAbsolute(FloatPoint(), UseTransforms | SnapOffsetForTransforms);
+    FloatPoint absContentPoint = container->localToAbsolute(FloatPoint(), UseTransforms);
     m_paintOffset = LayoutSize(absContentPoint.x(), absContentPoint.y());
 
     if (container->hasOverflowClip()) {
index a39ec9f..f7a5564 100644 (file)
@@ -1460,8 +1460,6 @@ void RenderBox::mapLocalToContainer(const RenderLayerModelObject* repaintContain
         *wasFixed = mode & IsFixed;
     
     LayoutSize containerOffset = offsetFromContainer(o, roundedLayoutPoint(transformState.mappedPoint()));
-    if (mode & SnapOffsetForTransforms)
-        containerOffset = roundedIntSize(containerOffset);
     
     bool preserve3D = mode & UseTransforms && (o->style()->preserves3D() || style()->preserves3D());
     if (mode & UseTransforms && shouldUseTransformFromContainer(o)) {
@@ -1512,8 +1510,6 @@ const RenderObject* RenderBox::pushMappingToContainer(const RenderLayerModelObje
 
     bool offsetDependsOnPoint = false;
     LayoutSize containerOffset = offsetFromContainer(container, LayoutPoint(), &offsetDependsOnPoint);
-    if (geometryMap.mapCoordinatesFlags() & SnapOffsetForTransforms)
-        containerOffset = roundedIntSize(containerOffset);
 
     if (container->isRenderFlowThread())
         offsetDependsOnPoint = true;
index 3b3a021..27bc840 100644 (file)
@@ -597,7 +597,7 @@ protected:
     
     virtual bool shouldComputeSizeAsReplaced() const { return isReplaced() && !isInlineBlockOrInlineTable(); }
 
-    virtual void mapLocalToContainer(const RenderLayerModelObject* repaintContainer, TransformState&, MapCoordinatesFlags = ApplyContainerFlip | SnapOffsetForTransforms, bool* wasFixed = 0) const OVERRIDE;
+    virtual void mapLocalToContainer(const RenderLayerModelObject* repaintContainer, TransformState&, MapCoordinatesFlags = ApplyContainerFlip, bool* wasFixed = 0) const OVERRIDE;
     virtual const RenderObject* pushMappingToContainer(const RenderLayerModelObject*, RenderGeometryMap&) const OVERRIDE;
     virtual void mapAbsoluteToLocalPoint(MapCoordinatesFlags, TransformState&) const;
 
index 1f8b4eb..0b7d771 100644 (file)
@@ -471,7 +471,7 @@ void RenderBoxModelObject::computeStickyPositionConstraints(StickyPositionViewpo
     // Compute the container-relative area within which the sticky element is allowed to move.
     containerContentRect.move(minLeftMargin, minTopMargin);
     containerContentRect.contract(minLeftMargin + minRightMargin, minTopMargin + minBottomMargin);
-    constraints.setAbsoluteContainingBlockRect(containingBlock->localToAbsoluteQuad(FloatRect(containerContentRect), SnapOffsetForTransforms).boundingBox());
+    constraints.setAbsoluteContainingBlockRect(containingBlock->localToAbsoluteQuad(FloatRect(containerContentRect)).boundingBox());
 
     LayoutRect stickyBoxRect = frameRectForStickyPositioning();
     LayoutRect flippedStickyBoxRect = stickyBoxRect;
@@ -479,7 +479,7 @@ void RenderBoxModelObject::computeStickyPositionConstraints(StickyPositionViewpo
     LayoutPoint stickyLocation = flippedStickyBoxRect.location();
 
     // FIXME: sucks to call localToAbsolute again, but we can't just offset from the previously computed rect if there are transforms.
-    FloatRect absContainerFrame = containingBlock->localToAbsoluteQuad(FloatRect(FloatPoint(), containingBlock->size()), SnapOffsetForTransforms).boundingBox();
+    FloatRect absContainerFrame = containingBlock->localToAbsoluteQuad(FloatRect(FloatPoint(), containingBlock->size())).boundingBox();
     // We can't call localToAbsolute on |this| because that will recur. FIXME: For now, assume that |this| is not transformed.
     FloatRect absoluteStickyBoxRect(absContainerFrame.location() + stickyLocation, flippedStickyBoxRect.size());
     constraints.setAbsoluteStickyBoxRect(absoluteStickyBoxRect);
index e964855..5d16d28 100644 (file)
@@ -358,7 +358,7 @@ bool RenderEmbeddedObject::isInUnavailablePluginIndicator(const LayoutPoint& poi
 
 bool RenderEmbeddedObject::isInUnavailablePluginIndicator(MouseEvent* event) const
 {
-    return isInUnavailablePluginIndicator(roundedLayoutPoint(absoluteToLocal(event->absoluteLocation(), UseTransforms | SnapOffsetForTransforms)));
+    return isInUnavailablePluginIndicator(roundedLayoutPoint(absoluteToLocal(event->absoluteLocation(), UseTransforms)));
 }
 
 static bool shouldUnavailablePluginMessageBeButton(Document* document, RenderEmbeddedObject::PluginUnavailabilityReason pluginUnavailabilityReason)
index 29c106b..8b60676 100644 (file)
@@ -701,7 +701,7 @@ bool RenderFrameSet::userResize(MouseEvent* evt)
         if (needsLayout())
             return false;
         if (evt->type() == eventNames().mousedownEvent && evt->button() == LeftButton) {
-            FloatPoint localPos = absoluteToLocal(evt->absoluteLocation(), UseTransforms | SnapOffsetForTransforms);
+            FloatPoint localPos = absoluteToLocal(evt->absoluteLocation(), UseTransforms);
             startResizing(m_cols, localPos.x());
             startResizing(m_rows, localPos.y());
             if (m_cols.m_splitBeingResized != noSplit || m_rows.m_splitBeingResized != noSplit) {
@@ -711,7 +711,7 @@ bool RenderFrameSet::userResize(MouseEvent* evt)
         }
     } else {
         if (evt->type() == eventNames().mousemoveEvent || (evt->type() == eventNames().mouseupEvent && evt->button() == LeftButton)) {
-            FloatPoint localPos = absoluteToLocal(evt->absoluteLocation(), UseTransforms | SnapOffsetForTransforms);
+            FloatPoint localPos = absoluteToLocal(evt->absoluteLocation(), UseTransforms);
             continueResizing(m_cols, localPos.x());
             continueResizing(m_rows, localPos.y());
             if (evt->type() == eventNames().mouseupEvent && evt->button() == LeftButton) {
index 7443489..4f2793f 100644 (file)
@@ -51,6 +51,7 @@ void RenderGeometryMap::mapToContainer(TransformState& transformState, const Ren
     // If the mapping includes something like columns, we have to go via renderers.
     if (hasNonUniformStep()) {
         m_mapping.last().m_renderer->mapLocalToContainer(container, transformState, ApplyContainerFlip | m_mapCoordinatesFlags);
+        transformState.flatten();
         return;
     }
     
@@ -104,7 +105,7 @@ FloatPoint RenderGeometryMap::mapToContainer(const FloatPoint& p, const RenderLa
     FloatPoint result;
     
     if (!hasFixedPositionStep() && !hasTransformStep() && !hasNonUniformStep() && (!container || (m_mapping.size() && container == m_mapping[0].m_renderer)))
-        result = p + m_accumulatedOffset;
+        result = p + roundedIntSize(m_accumulatedOffset);
     else {
         TransformState transformState(TransformState::ApplyTransformDirection, p);
         mapToContainer(transformState, container);
@@ -127,7 +128,7 @@ FloatQuad RenderGeometryMap::mapToContainer(const FloatRect& rect, const RenderL
     
     if (!hasFixedPositionStep() && !hasTransformStep() && !hasNonUniformStep() && (!container || (m_mapping.size() && container == m_mapping[0].m_renderer))) {
         result = rect;
-        result.move(m_accumulatedOffset);
+        result.move(roundedIntSize(m_accumulatedOffset));
     } else {
         TransformState transformState(TransformState::ApplyTransformDirection, rect.center(), rect);
         mapToContainer(transformState, container);
index bab106f..00c41f7 100644 (file)
@@ -74,7 +74,7 @@ struct RenderGeometryMapStep {
 class RenderGeometryMap {
     WTF_MAKE_NONCOPYABLE(RenderGeometryMap);
 public:
-    RenderGeometryMap(MapCoordinatesFlags = UseTransforms | SnapOffsetForTransforms);
+    RenderGeometryMap(MapCoordinatesFlags = UseTransforms);
     ~RenderGeometryMap();
 
     MapCoordinatesFlags mapCoordinatesFlags() const { return m_mapCoordinatesFlags; }
index a612ca5..7b13198 100644 (file)
@@ -1157,8 +1157,6 @@ void RenderInline::mapLocalToContainer(const RenderLayerModelObject* repaintCont
     }
 
     LayoutSize containerOffset = offsetFromContainer(o, roundedLayoutPoint(transformState.mappedPoint()));
-    if (mode & SnapOffsetForTransforms)
-        containerOffset = roundedIntSize(containerOffset);
 
     bool preserve3D = mode & UseTransforms && (o->style()->preserves3D() || style()->preserves3D());
     if (mode & UseTransforms && shouldUseTransformFromContainer(o)) {
@@ -1197,8 +1195,6 @@ const RenderObject* RenderInline::pushMappingToContainer(const RenderLayerModelO
 
     bool offsetDependsOnPoint = false;
     LayoutSize containerOffset = offsetFromContainer(container, LayoutPoint(), &offsetDependsOnPoint);
-    if (geometryMap.mapCoordinatesFlags() & SnapOffsetForTransforms)
-        containerOffset = roundedIntSize(containerOffset);
 
     bool preserve3D = container->style()->preserves3D() || style()->preserves3D();
     if (shouldUseTransformFromContainer(container)) {
index 0fab8d6..fd2a6de 100644 (file)
@@ -142,7 +142,7 @@ private:
     virtual LayoutRect rectWithOutlineForRepaint(const RenderLayerModelObject* repaintContainer, LayoutUnit outlineWidth) const OVERRIDE;
     virtual void computeRectForRepaint(const RenderLayerModelObject* repaintContainer, LayoutRect&, bool fixed) const OVERRIDE;
 
-    virtual void mapLocalToContainer(const RenderLayerModelObject* repaintContainer, TransformState&, MapCoordinatesFlags = ApplyContainerFlip | SnapOffsetForTransforms, bool* wasFixed = 0) const OVERRIDE;
+    virtual void mapLocalToContainer(const RenderLayerModelObject* repaintContainer, TransformState&, MapCoordinatesFlags = ApplyContainerFlip, bool* wasFixed = 0) const OVERRIDE;
     virtual const RenderObject* pushMappingToContainer(const RenderLayerModelObject* ancestorToStopAt, RenderGeometryMap&) const OVERRIDE;
 
     virtual VisiblePosition positionForPoint(const LayoutPoint&);
index 1a8d978..c0ce824 100644 (file)
@@ -1430,7 +1430,7 @@ RenderLayer* RenderLayer::clippingRootForPainting() const
 LayoutPoint RenderLayer::absoluteToContents(const LayoutPoint& absolutePoint) const
 {
     // We don't use convertToLayerCoords because it doesn't know about transforms
-    return roundedLayoutPoint(renderer()->absoluteToLocal(absolutePoint, UseTransforms | SnapOffsetForTransforms));
+    return roundedLayoutPoint(renderer()->absoluteToLocal(absolutePoint, UseTransforms));
 }
 
 bool RenderLayer::cannotBlitToWindow() const
@@ -2038,7 +2038,7 @@ void RenderLayer::scrollTo(int x, int y)
 
         FloatQuad quadForFakeMouseMoveEvent = FloatQuad(m_repaintRect);
         if (repaintContainer)
-            quadForFakeMouseMoveEvent = repaintContainer->localToAbsoluteQuad(quadForFakeMouseMoveEvent, SnapOffsetForTransforms);
+            quadForFakeMouseMoveEvent = repaintContainer->localToAbsoluteQuad(quadForFakeMouseMoveEvent);
         frame->eventHandler()->dispatchFakeMouseMoveEventSoonInQuad(quadForFakeMouseMoveEvent);
     }
 
@@ -4639,7 +4639,7 @@ LayoutRect RenderLayer::childrenClipRect() const
     ClipRectsContext clipRectsContext(clippingRootLayer, 0, TemporaryClipRects);
     // Need to use temporary clip rects, because the value of 'dontClipToOverflow' may be different from the painting path (<rdar://problem/11844909>).
     calculateRects(clipRectsContext, renderView->unscaledDocumentRect(), layerBounds, backgroundRect, foregroundRect, outlineRect);
-    return clippingRootLayer->renderer()->localToAbsoluteQuad(FloatQuad(foregroundRect.rect()), SnapOffsetForTransforms).enclosingBoundingBox();
+    return clippingRootLayer->renderer()->localToAbsoluteQuad(FloatQuad(foregroundRect.rect())).enclosingBoundingBox();
 }
 
 LayoutRect RenderLayer::selfClipRect() const
@@ -4652,7 +4652,7 @@ LayoutRect RenderLayer::selfClipRect() const
     ClipRect backgroundRect, foregroundRect, outlineRect;
     ClipRectsContext clipRectsContext(clippingRootLayer, 0, PaintingClipRects);
     calculateRects(clipRectsContext, renderView->documentRect(), layerBounds, backgroundRect, foregroundRect, outlineRect);
-    return clippingRootLayer->renderer()->localToAbsoluteQuad(FloatQuad(backgroundRect.rect()), SnapOffsetForTransforms).enclosingBoundingBox();
+    return clippingRootLayer->renderer()->localToAbsoluteQuad(FloatQuad(backgroundRect.rect())).enclosingBoundingBox();
 }
 
 LayoutRect RenderLayer::localClipRect() const
index 3f7cdff..0734183 100644 (file)
@@ -2064,7 +2064,7 @@ bool RenderLayerBacking::contentsVisible(const GraphicsLayer*, const IntRect& lo
         return false;
 
     IntRect visibleContentRect(view->visibleContentRect());
-    FloatQuad absoluteContentQuad = renderer()->localToAbsoluteQuad(FloatRect(localContentRect), SnapOffsetForTransforms);
+    FloatQuad absoluteContentQuad = renderer()->localToAbsoluteQuad(FloatRect(localContentRect));
     return absoluteContentQuad.enclosingBoundingBox().intersects(visibleContentRect);
 }
 #endif
index f17647b..1582fa5 100644 (file)
@@ -215,7 +215,7 @@ IntPoint RenderMediaControls::volumeSliderOffsetFromMuteButton(RenderBox* muteBu
 
     float zoomLevel = muteButtonBox->style()->effectiveZoom();
     int y = yOffset * zoomLevel + muteButtonBox->pixelSnappedOffsetHeight() - size.height();
-    FloatPoint absPoint = muteButtonBox->localToAbsolute(FloatPoint(muteButtonBox->pixelSnappedOffsetLeft(), y), IsFixed | UseTransforms | SnapOffsetForTransforms);
+    FloatPoint absPoint = muteButtonBox->localToAbsolute(FloatPoint(muteButtonBox->pixelSnappedOffsetLeft(), y), IsFixed | UseTransforms);
     if (absPoint.y() < 0)
         y = muteButtonBox->pixelSnappedHeight();
     return IntPoint(xOffset * zoomLevel, y);
index b721742..bab366e 100644 (file)
@@ -320,7 +320,7 @@ void RenderMenuList::showPopup()
 
     // Compute the top left taking transforms into account, but use
     // the actual width of the element to size the popup.
-    FloatPoint absTopLeft = localToAbsolute(FloatPoint(), UseTransforms | SnapOffsetForTransforms);
+    FloatPoint absTopLeft = localToAbsolute(FloatPoint(), UseTransforms);
     IntRect absBounds = absoluteBoundingBoxRectIgnoringTransforms();
     absBounds.setLocation(roundedIntPoint(absTopLeft));
     HTMLSelectElement* select = selectElement();
index 8e9f7e6..deb6d96 100644 (file)
@@ -1220,7 +1220,7 @@ void RenderObject::absoluteFocusRingQuads(Vector<FloatQuad>& quads)
     for (size_t i = 0; i < count; ++i) {
         IntRect rect = rects[i];
         rect.move(-absolutePoint.x(), -absolutePoint.y());
-        quads.append(localToAbsoluteQuad(FloatQuad(rect), SnapOffsetForTransforms));
+        quads.append(localToAbsoluteQuad(FloatQuad(rect)));
     }
 }
 
index ad46260..d380930 100644 (file)
@@ -109,8 +109,7 @@ enum MarkingBehavior {
 enum MapCoordinatesMode {
     IsFixed = 1 << 0,
     UseTransforms = 1 << 1,
-    ApplyContainerFlip = 1 << 2,
-    SnapOffsetForTransforms = 1 << 3
+    ApplyContainerFlip = 1 << 2
 };
 typedef unsigned MapCoordinatesFlags;
 
index 890f894..987ee95 100644 (file)
@@ -371,12 +371,12 @@ void RenderText::absoluteRectsForRange(Vector<IntRect>& rects, unsigned start, u
                     r.setX(selectionRect.x());
                 }
             }
-            rects.append(localToAbsoluteQuad(r, SnapOffsetForTransforms, wasFixed).enclosingBoundingBox());
+            rects.append(localToAbsoluteQuad(r, 0, wasFixed).enclosingBoundingBox());
         } else {
             // FIXME: This code is wrong. It's converting local to absolute twice. http://webkit.org/b/65722
             FloatRect rect = localQuadForTextBox(box, start, end, useSelectionHeight);
             if (!rect.isZero())
-                rects.append(localToAbsoluteQuad(rect, SnapOffsetForTransforms, wasFixed).enclosingBoundingBox());
+                rects.append(localToAbsoluteQuad(rect, 0, wasFixed).enclosingBoundingBox());
         }
     }
 }
@@ -419,7 +419,7 @@ void RenderText::absoluteQuads(Vector<FloatQuad>& quads, bool* wasFixed, Clippin
             else
                 boundaries.setHeight(ellipsisRect.maxY() - boundaries.y());
         }
-        quads.append(localToAbsoluteQuad(boundaries, SnapOffsetForTransforms, wasFixed));
+        quads.append(localToAbsoluteQuad(boundaries, 0, wasFixed));
     }
 }
     
@@ -454,11 +454,11 @@ void RenderText::absoluteQuadsForRange(Vector<FloatQuad>& quads, unsigned start,
                     r.setX(selectionRect.x());
                 }
             }
-            quads.append(localToAbsoluteQuad(r, SnapOffsetForTransforms, wasFixed));
+            quads.append(localToAbsoluteQuad(r, 0, wasFixed));
         } else {
             FloatRect rect = localQuadForTextBox(box, start, end, useSelectionHeight);
             if (!rect.isZero())
-                quads.append(localToAbsoluteQuad(rect, SnapOffsetForTransforms, wasFixed));
+                quads.append(localToAbsoluteQuad(rect, 0, wasFixed));
         }
     }
 }
index 22b1614..1ae9f39 100644 (file)
@@ -523,7 +523,7 @@ String RenderTheme::formatMediaControlsRemainingTime(float currentTime, float du
 IntPoint RenderTheme::volumeSliderOffsetFromMuteButton(RenderBox* muteButtonBox, const IntSize& size) const
 {
     int y = -size.height();
-    FloatPoint absPoint = muteButtonBox->localToAbsolute(FloatPoint(muteButtonBox->pixelSnappedOffsetLeft(), y), IsFixed | UseTransforms | SnapOffsetForTransforms);
+    FloatPoint absPoint = muteButtonBox->localToAbsolute(FloatPoint(muteButtonBox->pixelSnappedOffsetLeft(), y), IsFixed | UseTransforms);
     if (absPoint.y() < 0)
         y = muteButtonBox->height();
     return IntPoint(0, y);
index e689794..2c96c1b 100644 (file)
@@ -537,7 +537,7 @@ IntRect RenderView::selectionBounds(bool clipToVisibleContent) const
         // RenderSelectionInfo::rect() is in the coordinates of the repaintContainer, so map to page coordinates.
         LayoutRect currRect = info->rect();
         if (RenderLayerModelObject* repaintContainer = info->repaintContainer()) {
-            FloatQuad absQuad = repaintContainer->localToAbsoluteQuad(FloatRect(currRect), SnapOffsetForTransforms);
+            FloatQuad absQuad = repaintContainer->localToAbsoluteQuad(FloatRect(currRect));
             currRect = absQuad.enclosingBoundingBox(); 
         }
         selRect.unite(currRect);
index 7068730..b7b75b2 100644 (file)
@@ -229,7 +229,7 @@ public:
     bool hasRenderCounters() { return m_renderCounterCount; }
 
 protected:
-    virtual void mapLocalToContainer(const RenderLayerModelObject* repaintContainer, TransformState&, MapCoordinatesFlags = ApplyContainerFlip | SnapOffsetForTransforms, bool* wasFixed = 0) const OVERRIDE;
+    virtual void mapLocalToContainer(const RenderLayerModelObject* repaintContainer, TransformState&, MapCoordinatesFlags = ApplyContainerFlip, bool* wasFixed = 0) const OVERRIDE;
     virtual const RenderObject* pushMappingToContainer(const RenderLayerModelObject* ancestorToStopAt, RenderGeometryMap&) const OVERRIDE;
     virtual void mapAbsoluteToLocalPoint(MapCoordinatesFlags, TransformState&) const;
     virtual bool requiresColumns(int desiredColumnCount) const OVERRIDE;
index 588e963..6db0d69 100644 (file)
@@ -169,7 +169,7 @@ bool RenderWidget::updateWidgetGeometry()
     if (!m_widget->transformsAffectFrameRect())
         return setWidgetGeometry(absoluteContentBox());
 
-    LayoutRect absoluteContentBox(localToAbsoluteQuad(FloatQuad(contentBox), SnapOffsetForTransforms).boundingBox());
+    LayoutRect absoluteContentBox(localToAbsoluteQuad(FloatQuad(contentBox)).boundingBox());
     if (m_widget->isFrameView()) {
         contentBox.setLocation(absoluteContentBox.location());
         return setWidgetGeometry(contentBox);
index 408d887..e715fa4 100644 (file)
@@ -193,9 +193,9 @@ bool RenderSVGForeignObject::nodeAtPoint(const HitTestRequest&, HitTestResult&,
     return false;
 }
 
-void RenderSVGForeignObject::mapLocalToContainer(const RenderLayerModelObject* repaintContainer, TransformState& transformState, MapCoordinatesFlags mode, bool* wasFixed) const
+void RenderSVGForeignObject::mapLocalToContainer(const RenderLayerModelObject* repaintContainer, TransformState& transformState, MapCoordinatesFlags, bool* wasFixed) const
 {
-    SVGRenderSupport::mapLocalToContainer(this, repaintContainer, transformState, mode & SnapOffsetForTransforms, wasFixed);
+    SVGRenderSupport::mapLocalToContainer(this, repaintContainer, transformState, wasFixed);
 }
 
 const RenderObject* RenderSVGForeignObject::pushMappingToContainer(const RenderLayerModelObject* ancestorToStopAt, RenderGeometryMap& geometryMap) const
index 00979de..02c29cc 100644 (file)
@@ -54,7 +54,7 @@ public:
     virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction) OVERRIDE;
     virtual bool isSVGForeignObject() const { return true; }
 
-    virtual void mapLocalToContainer(const RenderLayerModelObject* repaintContainer, TransformState&, MapCoordinatesFlags = ApplyContainerFlip | SnapOffsetForTransforms, bool* wasFixed = 0) const OVERRIDE;
+    virtual void mapLocalToContainer(const RenderLayerModelObject* repaintContainer, TransformState&, MapCoordinatesFlags = ApplyContainerFlip, bool* wasFixed = 0) const OVERRIDE;
     virtual const RenderObject* pushMappingToContainer(const RenderLayerModelObject* ancestorToStopAt, RenderGeometryMap&) const OVERRIDE;
     virtual void setNeedsTransformUpdate() { m_needsTransformUpdate = true; }
 
index 9252c54..0984a3a 100644 (file)
@@ -79,9 +79,9 @@ void RenderSVGInline::computeFloatRectForRepaint(const RenderLayerModelObject* r
     SVGRenderSupport::computeFloatRectForRepaint(this, repaintContainer, repaintRect, fixed);
 }
 
-void RenderSVGInline::mapLocalToContainer(const RenderLayerModelObject* repaintContainer, TransformState& transformState, MapCoordinatesFlags mode, bool* wasFixed) const
+void RenderSVGInline::mapLocalToContainer(const RenderLayerModelObject* repaintContainer, TransformState& transformState, MapCoordinatesFlags, bool* wasFixed) const
 {
-    SVGRenderSupport::mapLocalToContainer(this, repaintContainer, transformState, mode & SnapOffsetForTransforms, wasFixed);
+    SVGRenderSupport::mapLocalToContainer(this, repaintContainer, transformState, wasFixed);
 }
 
 const RenderObject* RenderSVGInline::pushMappingToContainer(const RenderLayerModelObject* ancestorToStopAt, RenderGeometryMap& geometryMap) const
index 50dec2d..8157577 100644 (file)
@@ -47,7 +47,7 @@ public:
 
     virtual LayoutRect clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer) const OVERRIDE;
     virtual void computeFloatRectForRepaint(const RenderLayerModelObject* repaintContainer, FloatRect&, bool fixed = false) const OVERRIDE;
-    virtual void mapLocalToContainer(const RenderLayerModelObject* repaintContainer, TransformState&, MapCoordinatesFlags = ApplyContainerFlip | SnapOffsetForTransforms, bool* wasFixed = 0) const OVERRIDE;
+    virtual void mapLocalToContainer(const RenderLayerModelObject* repaintContainer, TransformState&, MapCoordinatesFlags = ApplyContainerFlip, bool* wasFixed = 0) const OVERRIDE;
     virtual const RenderObject* pushMappingToContainer(const RenderLayerModelObject* ancestorToStopAt, RenderGeometryMap&) const OVERRIDE;
     virtual void absoluteQuads(Vector<FloatQuad>&, bool* wasFixed) const;
 
index 019204e..823562b 100644 (file)
@@ -57,9 +57,9 @@ void RenderSVGModelObject::computeFloatRectForRepaint(const RenderLayerModelObje
     SVGRenderSupport::computeFloatRectForRepaint(this, repaintContainer, repaintRect, fixed);
 }
 
-void RenderSVGModelObject::mapLocalToContainer(const RenderLayerModelObject* repaintContainer, TransformState& transformState, MapCoordinatesFlags mode, bool* wasFixed) const
+void RenderSVGModelObject::mapLocalToContainer(const RenderLayerModelObject* repaintContainer, TransformState& transformState, MapCoordinatesFlags, bool* wasFixed) const
 {
-    SVGRenderSupport::mapLocalToContainer(this, repaintContainer, transformState, mode & SnapOffsetForTransforms, wasFixed);
+    SVGRenderSupport::mapLocalToContainer(this, repaintContainer, transformState, wasFixed);
 }
 
 const RenderObject* RenderSVGModelObject::pushMappingToContainer(const RenderLayerModelObject* ancestorToStopAt, RenderGeometryMap& geometryMap) const
index dc2d5da..0511f27 100644 (file)
@@ -58,7 +58,7 @@ public:
     virtual void absoluteRects(Vector<IntRect>&, const LayoutPoint& accumulatedOffset) const;
     virtual void absoluteQuads(Vector<FloatQuad>&, bool* wasFixed) const;
 
-    virtual void mapLocalToContainer(const RenderLayerModelObject* repaintContainer, TransformState&, MapCoordinatesFlags = ApplyContainerFlip | SnapOffsetForTransforms, bool* wasFixed = 0) const OVERRIDE;
+    virtual void mapLocalToContainer(const RenderLayerModelObject* repaintContainer, TransformState&, MapCoordinatesFlags = ApplyContainerFlip, bool* wasFixed = 0) const OVERRIDE;
     virtual const RenderObject* pushMappingToContainer(const RenderLayerModelObject* ancestorToStopAt, RenderGeometryMap&) const OVERRIDE;
     virtual void styleWillChange(StyleDifference, const RenderStyle* newStyle);
     virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);
index 38103f8..5234ef1 100644 (file)
@@ -104,7 +104,7 @@ private:
     virtual LayoutRect clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer) const OVERRIDE;
     virtual void computeFloatRectForRepaint(const RenderLayerModelObject* repaintContainer, FloatRect& repaintRect, bool fixed) const OVERRIDE;
 
-    virtual void mapLocalToContainer(const RenderLayerModelObject* repaintContainer, TransformState&, MapCoordinatesFlags = ApplyContainerFlip | SnapOffsetForTransforms, bool* wasFixed = 0) const OVERRIDE;
+    virtual void mapLocalToContainer(const RenderLayerModelObject* repaintContainer, TransformState&, MapCoordinatesFlags = ApplyContainerFlip, bool* wasFixed = 0) const OVERRIDE;
     virtual const RenderObject* pushMappingToContainer(const RenderLayerModelObject* ancestorToStopAt, RenderGeometryMap&) const OVERRIDE;
 
     virtual bool canBeSelectionLeaf() const { return false; }
index fd49f9b..166d9c2 100644 (file)
@@ -111,9 +111,9 @@ void RenderSVGText::computeFloatRectForRepaint(const RenderLayerModelObject* rep
     SVGRenderSupport::computeFloatRectForRepaint(this, repaintContainer, repaintRect, fixed);
 }
 
-void RenderSVGText::mapLocalToContainer(const RenderLayerModelObject* repaintContainer, TransformState& transformState, MapCoordinatesFlags mode, bool* wasFixed) const
+void RenderSVGText::mapLocalToContainer(const RenderLayerModelObject* repaintContainer, TransformState& transformState, MapCoordinatesFlags, bool* wasFixed) const
 {
-    SVGRenderSupport::mapLocalToContainer(this, repaintContainer, transformState, mode & SnapOffsetForTransforms, wasFixed);
+    SVGRenderSupport::mapLocalToContainer(this, repaintContainer, transformState, wasFixed);
 }
 
 const RenderObject* RenderSVGText::pushMappingToContainer(const RenderLayerModelObject* ancestorToStopAt, RenderGeometryMap& geometryMap) const
index cae5ba7..6f37057 100644 (file)
@@ -75,7 +75,7 @@ private:
     virtual void computeRectForRepaint(const RenderLayerModelObject* repaintContainer, LayoutRect&, bool fixed = false) const OVERRIDE;
     virtual void computeFloatRectForRepaint(const RenderLayerModelObject* repaintContainer, FloatRect&, bool fixed = false) const OVERRIDE;
 
-    virtual void mapLocalToContainer(const RenderLayerModelObject* repaintContainer, TransformState&, MapCoordinatesFlags = ApplyContainerFlip | SnapOffsetForTransforms, bool* wasFixed = 0) const OVERRIDE;
+    virtual void mapLocalToContainer(const RenderLayerModelObject* repaintContainer, TransformState&, MapCoordinatesFlags = ApplyContainerFlip, bool* wasFixed = 0) const OVERRIDE;
     virtual const RenderObject* pushMappingToContainer(const RenderLayerModelObject* ancestorToStopAt, RenderGeometryMap&) const OVERRIDE;
     virtual void addChild(RenderObject* child, RenderObject* beforeChild = 0);
     virtual void removeChild(RenderObject*) OVERRIDE;
index f40462a..ea28650 100644 (file)
@@ -84,7 +84,7 @@ void SVGRenderSupport::computeFloatRectForRepaint(const RenderObject* object, co
     object->parent()->computeFloatRectForRepaint(repaintContainer, repaintRect, fixed);
 }
 
-void SVGRenderSupport::mapLocalToContainer(const RenderObject* object, const RenderLayerModelObject* repaintContainer, TransformState& transformState, bool snapOffsetForTransforms, bool* wasFixed)
+void SVGRenderSupport::mapLocalToContainer(const RenderObject* object, const RenderLayerModelObject* repaintContainer, TransformState& transformState, bool* wasFixed)
 {
     transformState.applyTransform(object->localToParentTransform());
 
@@ -97,8 +97,6 @@ void SVGRenderSupport::mapLocalToContainer(const RenderObject* object, const Ren
         transformState.applyTransform(toRenderSVGRoot(parent)->localToBorderBoxTransform());
 
     MapCoordinatesFlags mode = UseTransforms;
-    if (snapOffsetForTransforms)
-        mode |= SnapOffsetForTransforms;
     parent->mapLocalToContainer(repaintContainer, transformState, mode, wasFixed);
 }
 
index f7375e4..0b18716 100644 (file)
@@ -68,7 +68,7 @@ public:
     static FloatRect repaintRectForRendererInLocalCoordinatesExcludingSVGShadow(const RenderObject*);
     static LayoutRect clippedOverflowRectForRepaint(const RenderObject*, const RenderLayerModelObject* repaintContainer);
     static void computeFloatRectForRepaint(const RenderObject*, const RenderLayerModelObject* repaintContainer, FloatRect&, bool fixed);
-    static void mapLocalToContainer(const RenderObject*, const RenderLayerModelObject* repaintContainer, TransformState&, bool snapOffsetForTransforms = true, bool* wasFixed = 0);
+    static void mapLocalToContainer(const RenderObject*, const RenderLayerModelObject* repaintContainer, TransformState&, bool* wasFixed = 0);
     static const RenderObject* pushMappingToContainer(const RenderObject*, const RenderLayerModelObject* ancestorToStopAt, RenderGeometryMap&);
     static bool checkForSVGRepaintDuringLayout(RenderObject*);
 
index 212672d..1dbaaee 100644 (file)
@@ -1,3 +1,31 @@
+2012-12-16  Levi Weintraub  <leviw@chromium.org>
+
+        Push pixel snapping logic into TransformState
+        https://bugs.webkit.org/show_bug.cgi?id=101779
+
+        Reviewed by Simon Fraser.
+
+        Eliminating use of SnapOffsetForTransforms as it's no longer needed.
+
+        * src/FindInPageCoordinates.cpp:
+        (WebKit::toNormalizedRect):
+        * src/LinkHighlight.cpp:
+        (WebKit::convertTargetSpaceQuadToCompositedLayer):
+        * src/WebInputEventConversion.cpp:
+        (WebKit::convertAbsoluteLocationForRenderObject):
+        * src/WebPluginContainerImpl.cpp:
+        (WebKit::WebPluginContainerImpl::windowToLocalPoint):
+
+2012-05-21  Jochen Eisinger  <jochen@chromium.org>
+
+        [chromium] Build content_shell from within WebKit
+        https://bugs.webkit.org/show_bug.cgi?id=87045
+
+        Reviewed by Simon Fraser.
+
+        * All.gyp:
+        * DEPS:
+
 2012-12-15  Anders Carlsson  <andersca@apple.com>
 
         Rename FrameLoaderClient::download to convertMainResourceLoadToDownload
index 5dbfacc..1492baf 100644 (file)
@@ -67,7 +67,7 @@ static FloatRect toNormalizedRect(const FloatRect& absoluteRect, const RenderObj
         scrolledOrigin = -IntPoint(container->scrolledContentOffset());
 
     FloatRect overflowRect(scrolledOrigin, container->maxLayoutOverflow());
-    FloatRect containerRect = container->localToAbsoluteQuad(FloatQuad(overflowRect), SnapOffsetForTransforms).enclosingBoundingBox();
+    FloatRect containerRect = container->localToAbsoluteQuad(FloatQuad(overflowRect)).enclosingBoundingBox();
 
     if (containerRect.isEmpty())
         return FloatRect();
index 48709dc..5cd9b6e 100644 (file)
@@ -161,7 +161,7 @@ static void convertTargetSpaceQuadToCompositedLayer(const FloatQuad& targetSpace
 
         point = targetRenderer->frame()->view()->contentsToWindow(point);
         point = compositedRenderer->frame()->view()->windowToContents(point);
-        FloatPoint floatPoint = compositedRenderer->absoluteToLocal(point, UseTransforms | SnapOffsetForTransforms);
+        FloatPoint floatPoint = compositedRenderer->absoluteToLocal(point, UseTransforms);
 
         switch (i) {
         case 0: compositedSpaceQuad.setP1(floatPoint); break;
index 6a34a65..0e93491 100644 (file)
@@ -404,7 +404,7 @@ static int getWebInputModifiers(const UIEventWithKeyState& event)
 
 static IntPoint convertAbsoluteLocationForRenderObject(const LayoutPoint& location, const WebCore::RenderObject& renderObject)
 {
-    return roundedIntPoint(renderObject.absoluteToLocal(location, UseTransforms | SnapOffsetForTransforms));
+    return roundedIntPoint(renderObject.absoluteToLocal(location, UseTransforms));
 }
 
 static void updateWebMouseEventFromWebCoreMouseEvent(const MouseRelatedEvent& event, const Widget& widget, const WebCore::RenderObject& renderObject, WebMouseEvent& webEvent)
index ac316b2..c653dc1 100644 (file)
@@ -551,7 +551,7 @@ WebPoint WebPluginContainerImpl::windowToLocalPoint(const WebPoint& point)
     if (!view)
         return point;
     WebPoint windowPoint = view->windowToContents(point);
-    return roundedIntPoint(m_element->renderer()->absoluteToLocal(LayoutPoint(windowPoint), UseTransforms | SnapOffsetForTransforms));
+    return roundedIntPoint(m_element->renderer()->absoluteToLocal(LayoutPoint(windowPoint), UseTransforms));
 }
 
 void WebPluginContainerImpl::didReceiveResponse(const ResourceResponse& response)
index ab27b1f..918e013 100644 (file)
@@ -1,3 +1,13 @@
+2012-12-16  Levi Weintraub  <leviw@chromium.org>
+
+        Push pixel snapping logic into TransformState
+        https://bugs.webkit.org/show_bug.cgi?id=101779
+
+        Reviewed by Simon Fraser.
+
+        * WebView/WebFullScreenController.mm:
+        (screenRectOfContents): Removed SnapOffsetForTransforms as it's no longer needed.
+
 2012-12-15  Anders Carlsson  <andersca@apple.com>
 
         Rename FrameLoaderClient::download to convertMainResourceLoadToDownload
index 8675803..e64f474 100644 (file)
@@ -56,7 +56,7 @@ static IntRect screenRectOfContents(Element* element)
     ASSERT(element);
     if (element->renderer() && element->renderer()->hasLayer() && element->renderer()->enclosingLayer()->isComposited()) {
         FloatQuad contentsBox = static_cast<FloatRect>(element->renderer()->enclosingLayer()->backing()->contentsBox());
-        contentsBox = element->renderer()->localToAbsoluteQuad(contentsBox, SnapOffsetForTransforms);
+        contentsBox = element->renderer()->localToAbsoluteQuad(contentsBox);
         return element->renderer()->view()->frameView()->contentsToScreen(contentsBox.enclosingBoundingBox());
     }
     return element->screenRect();
index e77153c..b69de89 100644 (file)
@@ -1,3 +1,15 @@
+2012-12-16  Levi Weintraub  <leviw@chromium.org>
+
+        Push pixel snapping logic into TransformState
+        https://bugs.webkit.org/show_bug.cgi?id=101779
+
+        Reviewed by Simon Fraser.
+
+        Eliminating use of SnapOffsetForTransforms as it's no longer needed.
+
+        * WebProcess/FullScreen/WebFullScreenManager.cpp:
+        (WebKit::screenRectOfContents):
+
 2012-12-16  Anders Carlsson  <andersca@apple.com>
 
         Rename WebFrame::convertHandleToDownload to convertMainResourceLoadToDownload
index 0323698..2869f93 100644 (file)
@@ -52,7 +52,7 @@ static IntRect screenRectOfContents(Element* element)
 #if USE(ACCELERATED_COMPOSITING)
     if (element->renderer() && element->renderer()->hasLayer() && element->renderer()->enclosingLayer()->isComposited()) {
         FloatQuad contentsBox = static_cast<FloatRect>(element->renderer()->enclosingLayer()->backing()->contentsBox());
-        contentsBox = element->renderer()->localToAbsoluteQuad(contentsBox, SnapOffsetForTransforms);
+        contentsBox = element->renderer()->localToAbsoluteQuad(contentsBox);
         return element->renderer()->view()->frameView()->contentsToScreen(contentsBox.enclosingBoundingBox());
     }
 #endif
index f7a1785..db5cedc 100644 (file)
       buildConfiguration = "Debug"
       ignoresPersistentStateOnLaunch = "YES"
       debugDocumentVersioning = "YES"
-      enableOpenGLFrameCaptureMode = "0"
       allowLocationSimulation = "YES">
       <PathRunnable
          FilePath = "/Applications/Safari.app/Contents/MacOS/SafariForWebKitDevelopment">