Title: [187298] branches/safari-601.1-branch

Diff

Modified: branches/safari-601.1-branch/LayoutTests/ChangeLog (187297 => 187298)


--- branches/safari-601.1-branch/LayoutTests/ChangeLog	2015-07-24 06:24:35 UTC (rev 187297)
+++ branches/safari-601.1-branch/LayoutTests/ChangeLog	2015-07-24 06:27:40 UTC (rev 187298)
@@ -1,5 +1,24 @@
 2015-07-23  Lucas Forschler  <[email protected]>
 
+        Merge r187116
+
+    2015-07-21  Said Abou-Hallawa  <[email protected]>
+
+            REGRESSION (r172417, r184065): Multiple rendering issues with fixed attached background-image
+            https://bugs.webkit.org/show_bug.cgi?id=147049
+            <rdar://problem/21110936>
+
+            Reviewed by Simon Fraser.
+
+            fixedLayoutSize background-image rendering for root and non-root elements.
+
+            * platform/mac-wk2/tiled-drawing/fixed-layout-size-fixed-attachment-cover-expected.html: Added.
+            * platform/mac-wk2/tiled-drawing/fixed-layout-size-fixed-attachment-cover.html: Added.
+            * platform/mac-wk2/tiled-drawing/fixed-layout-size-fixed-attachment-local-expected.html: Added.
+            * platform/mac-wk2/tiled-drawing/fixed-layout-size-fixed-attachment-local.html: Added.
+
+2015-07-23  Lucas Forschler  <[email protected]>
+
         Merge r186994
 
     2015-07-18  David Kilzer  <[email protected]>

Copied: branches/safari-601.1-branch/LayoutTests/platform/mac-wk2/tiled-drawing/fixed-layout-size-fixed-attachment-cover-expected.html (from rev 187116, trunk/LayoutTests/platform/mac-wk2/tiled-drawing/fixed-layout-size-fixed-attachment-cover-expected.html) (0 => 187298)


--- branches/safari-601.1-branch/LayoutTests/platform/mac-wk2/tiled-drawing/fixed-layout-size-fixed-attachment-cover-expected.html	                        (rev 0)
+++ branches/safari-601.1-branch/LayoutTests/platform/mac-wk2/tiled-drawing/fixed-layout-size-fixed-attachment-cover-expected.html	2015-07-24 06:27:40 UTC (rev 187298)
@@ -0,0 +1,22 @@
+<html>
+<head>
+<style>
+  body {
+    margin: 0;
+  }
+  .container {
+    height: 2000px;
+    overflow: hidden;
+    width: 50%;
+    height: 50%;
+    background-image: url('resources/green-blue.png');
+    background-attachment: fixed;
+    background-repeat: no-repeat;
+    background-size: 300px;
+  }
+</style>
+</head>
+<body>
+  <div class="container"></div>
+</body>
+</html>

Copied: branches/safari-601.1-branch/LayoutTests/platform/mac-wk2/tiled-drawing/fixed-layout-size-fixed-attachment-cover.html (from rev 187116, trunk/LayoutTests/platform/mac-wk2/tiled-drawing/fixed-layout-size-fixed-attachment-cover.html) (0 => 187298)


--- branches/safari-601.1-branch/LayoutTests/platform/mac-wk2/tiled-drawing/fixed-layout-size-fixed-attachment-cover.html	                        (rev 0)
+++ branches/safari-601.1-branch/LayoutTests/platform/mac-wk2/tiled-drawing/fixed-layout-size-fixed-attachment-cover.html	2015-07-24 06:27:40 UTC (rev 187298)
@@ -0,0 +1,27 @@
+<html>
+<head>
+<style>
+  body {
+    margin: 0;
+    height: 2000px;
+    overflow: hidden;
+    background: url('resources/green-blue.png') white;
+    background-attachment: fixed;
+    background-size: contain;
+    background-repeat: no-repeat;
+  }
+</style>
+<script>
+  function runTest() {
+    if (window.internals) {
+      window.internals.setFixedLayoutSize(800, 600);
+      window.internals.setPageScaleFactor(0.5, 0, 0);
+      window.internals.setUseFixedLayout(true);
+    }
+  }
+  window.addEventListener('load', runTest, false);
+</script>
+</head>
+<body>
+</body>
+</html>

Copied: branches/safari-601.1-branch/LayoutTests/platform/mac-wk2/tiled-drawing/fixed-layout-size-fixed-attachment-local-expected.html (from rev 187116, trunk/LayoutTests/platform/mac-wk2/tiled-drawing/fixed-layout-size-fixed-attachment-local-expected.html) (0 => 187298)


--- branches/safari-601.1-branch/LayoutTests/platform/mac-wk2/tiled-drawing/fixed-layout-size-fixed-attachment-local-expected.html	                        (rev 0)
+++ branches/safari-601.1-branch/LayoutTests/platform/mac-wk2/tiled-drawing/fixed-layout-size-fixed-attachment-local-expected.html	2015-07-24 06:27:40 UTC (rev 187298)
@@ -0,0 +1,22 @@
+<html>
+<head>
+<style>
+  body {
+    margin: 0;
+  }
+  .container {
+    height: 2000px;
+    overflow: hidden;
+    width: 50%;
+    height: 50%;
+    background-image: url('resources/green-blue.png');
+    background-attachment: fixed;
+    background-repeat: no-repeat;
+    background-size: 300px;
+  }
+</style>
+</head>
+<body>
+  <div class="container"></div>
+</body>
+</html>

Copied: branches/safari-601.1-branch/LayoutTests/platform/mac-wk2/tiled-drawing/fixed-layout-size-fixed-attachment-local.html (from rev 187116, trunk/LayoutTests/platform/mac-wk2/tiled-drawing/fixed-layout-size-fixed-attachment-local.html) (0 => 187298)


--- branches/safari-601.1-branch/LayoutTests/platform/mac-wk2/tiled-drawing/fixed-layout-size-fixed-attachment-local.html	                        (rev 0)
+++ branches/safari-601.1-branch/LayoutTests/platform/mac-wk2/tiled-drawing/fixed-layout-size-fixed-attachment-local.html	2015-07-24 06:27:40 UTC (rev 187298)
@@ -0,0 +1,30 @@
+<html>
+<head>
+  <style>
+    html {
+      background: white;
+    }
+    body {
+      margin: 0;
+      height: 2000px;
+      overflow: hidden;
+      background: url(resources/green-blue.png);
+      background-attachment: fixed;
+      background-size: contain;
+      background-repeat: no-repeat;
+    }
+  </style>
+  <script>
+  function runTest() {
+    if (window.internals) {
+      window.internals.setFixedLayoutSize(800, 600);
+      window.internals.setPageScaleFactor(0.5, 0, 0);
+      window.internals.setUseFixedLayout(true);
+    }
+  }
+  window.addEventListener('load', runTest, false);
+  </script>
+</head>
+<body>
+</body>
+</html>

Modified: branches/safari-601.1-branch/Source/WebCore/ChangeLog (187297 => 187298)


--- branches/safari-601.1-branch/Source/WebCore/ChangeLog	2015-07-24 06:24:35 UTC (rev 187297)
+++ branches/safari-601.1-branch/Source/WebCore/ChangeLog	2015-07-24 06:27:40 UTC (rev 187298)
@@ -1,5 +1,48 @@
 2015-07-23  Lucas Forschler  <[email protected]>
 
+        Merge r187116
+
+    2015-07-21  Said Abou-Hallawa  <[email protected]>
+
+            REGRESSION (r172417, r184065): Multiple rendering issues with fixed attached background-image
+            https://bugs.webkit.org/show_bug.cgi?id=147049
+            <rdar://problem/21110936>
+
+            Reviewed by Simon Fraser.
+
+            The fixed-attached background-image rendering is special. In general, to
+            display it, the destinationSize should be set to visibleContentSize. The
+            destinationLocation should be set such that the background-image does
+            not move with scrolling. The topContentInset should be subtracted from
+            the destinationLocation such that background-image can be rendered blurred
+            in the topContentArea. However there are cases in which these rules have to
+            be changed.
+
+            -- destinationSize: In the case of fixed layout size, the fixedLayoutSize
+            is bigger than the visibleContentSize. In this case, if the background-image
+            belongs to the root element, the destinationSize has to be set to fixedLayoutSize.
+            Otherwise it has to be set to the borderBoxSize unless the overflow is
+            hidden.
+
+            -- destinationLocation: If the background-image belongs to the root element, no
+            scroll offset to added to destinationLocation. For non-root element case,
+            FrameView::documentScrollOffsetRelativeToViewOrigin() should be used if no page
+            scaling is applied. Otherwise FrameView::scrollOffsetForFixedPosition() should be
+            used instead.
+
+            Tests: platform/mac-wk2/tiled-drawing/fixed-layout-size-fixed-attachment-cover.html
+                   platform/mac-wk2/tiled-drawing/fixed-layout-size-fixed-attachment-local.html
+
+            * rendering/RenderBoxModelObject.cpp:
+            (WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry): Ensure
+            the geometry for the fixed-attached background-image is calculated correctly.
+
+            * rendering/RenderLayerBacking.cpp:
+            (WebCore::RenderLayerBacking::updateGeometry): Ensure the background layer
+            gets the correct size for the fixedLayoutSize mode.
+
+2015-07-23  Lucas Forschler  <[email protected]>
+
         Merge r186981
 
     2015-07-17  Zalan Bujtas  <[email protected]>

Modified: branches/safari-601.1-branch/Source/WebCore/rendering/RenderBoxModelObject.cpp (187297 => 187298)


--- branches/safari-601.1-branch/Source/WebCore/rendering/RenderBoxModelObject.cpp	2015-07-24 06:24:35 UTC (rev 187297)
+++ branches/safari-601.1-branch/Source/WebCore/rendering/RenderBoxModelObject.cpp	2015-07-24 06:27:40 UTC (rev 187298)
@@ -1115,13 +1115,32 @@
             viewportRect = view().unscaledDocumentRect();
         else {
             FrameView& frameView = view().frameView();
-            viewportRect.setSize(frameView.unscaledVisibleContentSizeIncludingObscuredArea());
-            topContentInset = frameView.topContentInset(ScrollView::TopContentInsetType::WebCoreOrPlatformContentInset);
+            bool useFixedLayout = frameView.useFixedLayout() && !frameView.fixedLayoutSize().isEmpty();
 
-            if (fixedBackgroundPaintsInLocalCoordinates())
-                viewportRect.setLocation(LayoutPoint(0, -topContentInset));
-            else
+            if (useFixedLayout) {
+                // Use the fixedLayoutSize() when useFixedLayout() because the rendering will scale
+                // down the frameView to to fit in the current viewport.
+                viewportRect.setSize(frameView.fixedLayoutSize());
+            } else
+                viewportRect.setSize(frameView.unscaledVisibleContentSizeIncludingObscuredArea());
+
+            if (fixedBackgroundPaintsInLocalCoordinates()) {
+                if (!useFixedLayout) {
+                    // Shifting location up by topContentInset is needed for layout tests which expect
+                    // layout to be shifted down when calling window.internals.setTopContentInset().
+                    topContentInset = frameView.topContentInset(ScrollView::TopContentInsetType::WebCoreOrPlatformContentInset);
+                    viewportRect.setLocation(LayoutPoint(0, -topContentInset));
+                }
+            } else if (useFixedLayout || frameView.frameScaleFactor() != 1) {
+                // scrollOffsetForFixedPosition() is adjusted for page scale and it does not include
+                // topContentInset so do not add it to the calculation below.
+                viewportRect.setLocation(toLayoutPoint(frameView.scrollOffsetForFixedPosition()));
+            } else {
+                // documentScrollOffsetRelativeToViewOrigin() includes -topContentInset in its height
+                // so we need to account for that in calculating the phase size
+                topContentInset = frameView.topContentInset(ScrollView::TopContentInsetType::WebCoreOrPlatformContentInset);
                 viewportRect.setLocation(toLayoutPoint(frameView.documentScrollOffsetRelativeToViewOrigin()));
+            }
 
             top += topContentInset;
         }

Modified: branches/safari-601.1-branch/Source/WebCore/rendering/RenderLayerBacking.cpp (187297 => 187298)


--- branches/safari-601.1-branch/Source/WebCore/rendering/RenderLayerBacking.cpp	2015-07-24 06:24:35 UTC (rev 187297)
+++ branches/safari-601.1-branch/Source/WebCore/rendering/RenderLayerBacking.cpp	2015-07-24 06:27:40 UTC (rev 187298)
@@ -925,7 +925,7 @@
         if (backgroundLayerPaintsFixedRootBackground()) {
             const FrameView& frameView = renderer().view().frameView();
             backgroundPosition = toLayoutPoint(frameView.scrollOffsetForFixedPosition());
-            backgroundSize = frameView.visibleContentRect().size();
+            backgroundSize = frameView.layoutSize();
         }
         m_backgroundLayer->setPosition(backgroundPosition);
         m_backgroundLayer->setSize(backgroundSize);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to