WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-104626-20121210214339.patch (text/plain), 8.06 KB, created by
Simon Fraser (smfr)
on 2012-12-10 21:46:17 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Simon Fraser (smfr)
Created:
2012-12-10 21:46:17 PST
Size:
8.06 KB
patch
obsolete
>Subversion Revision: 137242 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 3f1860ef3da6e3a83c157c73e42d0e51de853f97..caa9cb633a805585190bc56fae9758979529648d 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,25 @@ >+2012-12-10 Simon Fraser <simon.fraser@apple.com> >+ >+ REGRESSION (r137215): WebKit stretches and shrinks a part of screen on scroll >+ https://bugs.webkit.org/show_bug.cgi?id=104626 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ r137215 removed a compositing layer repaint on size changes. However, there >+ are cases where the compositing code constrains layer size by clipping >+ with the viewport and a clipping ancestor. When that happens, we must >+ invalidate the layer on a size change to avoid showing stretched or >+ shrunken content. >+ >+ Test: compositing/repaint/clipped-layer-size-change.html >+ >+ * rendering/RenderLayerBacking.cpp: >+ (WebCore::RenderLayerBacking::RenderLayerBacking): >+ (WebCore::RenderLayerBacking::updateCompositedBounds): >+ (WebCore::RenderLayerBacking::updateGraphicsLayerGeometry): >+ * rendering/RenderLayerBacking.h: >+ (RenderLayerBacking): >+ > 2012-12-10 Jessie Berlin <jberlin@apple.com> > > Fix the Mac build after r137233 >diff --git a/Source/WebCore/rendering/RenderLayerBacking.cpp b/Source/WebCore/rendering/RenderLayerBacking.cpp >index bda6b3ea1d09b1579d9f3c2dc63b39537e41c5c0..a766e960c2b866fff6c4901fd3c52928f8a6361d 100644 >--- a/Source/WebCore/rendering/RenderLayerBacking.cpp >+++ b/Source/WebCore/rendering/RenderLayerBacking.cpp >@@ -101,6 +101,7 @@ RenderLayerBacking::RenderLayerBacking(RenderLayer* layer) > : m_owningLayer(layer) > , m_scrollLayerID(0) > , m_artificiallyInflatedBounds(false) >+ , m_boundsConstrainedByClipping(false) > , m_isMainFrameRenderViewLayer(false) > , m_usingTiledCacheLayer(false) > , m_requiresOwnBackingStore(true) >@@ -366,7 +367,6 @@ bool RenderLayerBacking::shouldClipCompositedBounds() const > return true; > } > >- > void RenderLayerBacking::updateCompositedBounds() > { > IntRect layerBounds = compositor()->calculateCompositedBounds(m_owningLayer, m_owningLayer); >@@ -389,7 +389,9 @@ void RenderLayerBacking::updateCompositedBounds() > clippingBounds.move(-delta.x(), -delta.y()); > > layerBounds.intersect(pixelSnappedIntRect(clippingBounds)); >- } >+ m_boundsConstrainedByClipping = true; >+ } else >+ m_boundsConstrainedByClipping = false; > > // If the element has a transform-origin that has fixed lengths, and the renderer has zero size, > // then we need to ensure that the compositing layer has non-zero size so that we can apply >@@ -631,8 +633,14 @@ void RenderLayerBacking::updateGraphicsLayerGeometry() > > FloatSize oldSize = m_graphicsLayer->size(); > FloatSize newSize = relativeCompositingBounds.size(); >- if (oldSize != newSize) >+ if (oldSize != newSize) { > m_graphicsLayer->setSize(newSize); >+ // Usually invalidation will happen via layout etc, but if we've affected the layer >+ // size by constraining relative to a clipping ancestor or the viewport, we >+ // have to invalidate to avoid showing stretched content. >+ if (m_boundsConstrainedByClipping) >+ m_graphicsLayer->setNeedsDisplay(); >+ } > > // If we have a layer that clips children, position it. > IntRect clippingBox; >diff --git a/Source/WebCore/rendering/RenderLayerBacking.h b/Source/WebCore/rendering/RenderLayerBacking.h >index b2556166296c87a24b77deaf821ac045b741139f..bfde3b989b7d9b5b22ace494266dbed26293ae30 100644 >--- a/Source/WebCore/rendering/RenderLayerBacking.h >+++ b/Source/WebCore/rendering/RenderLayerBacking.h >@@ -275,7 +275,8 @@ private: > > IntRect m_compositedBounds; > >- bool m_artificiallyInflatedBounds; // bounds had to be made non-zero to make transform-origin work >+ bool m_artificiallyInflatedBounds; // bounds had to be made non-zero to make transform-origin work >+ bool m_boundsConstrainedByClipping; > bool m_isMainFrameRenderViewLayer; > bool m_usingTiledCacheLayer; > bool m_requiresOwnBackingStore; >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 3a26d02d7a4cbf03f5b27fd283fd24ff70ddd608..689a074f23af3b07124c677960b5042decd4099b 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,15 @@ >+2012-12-10 Simon Fraser <simon.fraser@apple.com> >+ >+ REGRESSION(r137215): WebKit stretches and shrinks a part of screen on scroll >+ https://bugs.webkit.org/show_bug.cgi?id=104626 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Testcase that scrolls an overflow area containing a compositing layer. >+ >+ * compositing/repaint/clipped-layer-size-change-expected.html: Added. >+ * compositing/repaint/clipped-layer-size-change.html: Added. >+ > 2012-12-10 Kangil Han <kangil.han@samsung.com> > > [EFL] Rebaseline expected results for "visibility:hidden; position: absolute;" cases >diff --git a/LayoutTests/compositing/repaint/clipped-layer-size-change-expected.html b/LayoutTests/compositing/repaint/clipped-layer-size-change-expected.html >new file mode 100644 >index 0000000000000000000000000000000000000000..3e351b940f93fe25e3a81d9cd1e87f5abe90ca99 >--- /dev/null >+++ b/LayoutTests/compositing/repaint/clipped-layer-size-change-expected.html >@@ -0,0 +1,43 @@ >+<!DOCTYPE html> >+ >+<html> >+<head> >+ <style> >+ #container { >+ width: 200px; >+ height: 200px; >+ overflow: hidden; >+ border: 1px solid black; >+ } >+ >+ .scroll-content { >+ height: 600px; >+ } >+ >+ .inner { >+ position: relative; >+ width: 150px; >+ height: 150px; >+ margin-top: -10px; /* force overlap with the composited element */ >+ margin-left: 10px; >+ box-sizing: border-box; >+ border: 40px solid black; >+ } >+ >+ .composited { >+ height: 50px; >+ width: 100px; >+ -webkit-transform: translateZ(0); >+ } >+ </style> >+</head> >+<body> >+ >+ <div id="container"> >+ <div class="scroll-content"> >+ <div class="composited"></div> >+ <div class="inner"></div> >+ </div> >+ </div> >+</body> >+</html> >diff --git a/LayoutTests/compositing/repaint/clipped-layer-size-change.html b/LayoutTests/compositing/repaint/clipped-layer-size-change.html >new file mode 100644 >index 0000000000000000000000000000000000000000..29c100e6205e1673d4d817ccdac09d4e9001dc81 >--- /dev/null >+++ b/LayoutTests/compositing/repaint/clipped-layer-size-change.html >@@ -0,0 +1,59 @@ >+<!DOCTYPE html> >+ >+<html> >+<head> >+ <style> >+ #container { >+ width: 200px; >+ height: 200px; >+ overflow: hidden; >+ border: 1px solid black; >+ } >+ >+ .scroll-content { >+ height: 600px; >+ } >+ >+ .inner { >+ position: relative; >+ width: 150px; >+ height: 150px; >+ margin-top: -10px; /* force overlap with the composited element */ >+ margin-left: 10px; >+ box-sizing: border-box; >+ border: 40px solid black; >+ } >+ >+ .composited { >+ height: 150px; >+ width: 100px; >+ -webkit-transform: translateZ(0); >+ } >+ </style> >+ <script> >+ if (window.testRunner) >+ testRunner.waitUntilDone(); >+ >+ function doTest() >+ { >+ window.setTimeout(function() { >+ var container = document.getElementById('container'); >+ window.console.log('scrolling') >+ container.scrollTop = 100; >+ if (window.testRunner) >+ testRunner.notifyDone(); >+ }, 0); >+ } >+ window.addEventListener('load', doTest, false); >+ </script> >+</head> >+<body> >+ >+ <div id="container"> >+ <div class="scroll-content"> >+ <div class="composited"></div> >+ <div class="inner"></div> >+ </div> >+ </div> >+</body> >+</html>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
bdakin
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 104626
:
178700
|
178701
| 178707