Title: [171074] trunk/Source/WebCore
- Revision
- 171074
- Author
- [email protected]
- Date
- 2014-07-14 12:51:28 -0700 (Mon, 14 Jul 2014)
Log Message
<rdar://problem/17305458> Cannot interact with video controls in ePubs
Bug 134836 - [New Multicolumn] Crawl to check for compositing between us and the enclosingPaginationLayer
https://bugs.webkit.org/show_bug.cgi?id=134836
Reviewed by Dean Jackson.
The paginatedAndComposited bit being set in updateLayerPositions just didn't work, since compositing states
can change without triggering that function. This patch just gets rid of the bit and does a crawl every time
to check. This ensures that changes in compositing states don't necessitate any changes in pagination,
since the lookup will always check the current compositing state.
The new function that does this check is hasCompositedLayerInEnclosingPaginationChain.
I have been unable to reproduce this issue, and this is therefore a purely speculative fix. I have no test
case to provide because of this.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::RenderLayer):
(WebCore::RenderLayer::updateLayerPositions):
(WebCore::RenderLayer::hasCompositedLayerInEnclosingPaginationChain):
(WebCore::RenderLayer::updatePagination):
* rendering/RenderLayer.h:
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (171073 => 171074)
--- trunk/Source/WebCore/ChangeLog 2014-07-14 19:15:24 UTC (rev 171073)
+++ trunk/Source/WebCore/ChangeLog 2014-07-14 19:51:28 UTC (rev 171074)
@@ -1,3 +1,28 @@
+2014-07-11 David Hyatt <[email protected]>
+
+ <rdar://problem/17305458> Cannot interact with video controls in ePubs
+ Bug 134836 - [New Multicolumn] Crawl to check for compositing between us and the enclosingPaginationLayer
+ https://bugs.webkit.org/show_bug.cgi?id=134836
+
+ Reviewed by Dean Jackson.
+
+ The paginatedAndComposited bit being set in updateLayerPositions just didn't work, since compositing states
+ can change without triggering that function. This patch just gets rid of the bit and does a crawl every time
+ to check. This ensures that changes in compositing states don't necessitate any changes in pagination,
+ since the lookup will always check the current compositing state.
+
+ The new function that does this check is hasCompositedLayerInEnclosingPaginationChain.
+
+ I have been unable to reproduce this issue, and this is therefore a purely speculative fix. I have no test
+ case to provide because of this.
+
+ * rendering/RenderLayer.cpp:
+ (WebCore::RenderLayer::RenderLayer):
+ (WebCore::RenderLayer::updateLayerPositions):
+ (WebCore::RenderLayer::hasCompositedLayerInEnclosingPaginationChain):
+ (WebCore::RenderLayer::updatePagination):
+ * rendering/RenderLayer.h:
+
2014-07-14 Zalan Bujtas <[email protected]>
Move composite bounds calculation to RenderLayerBacking.
Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (171073 => 171074)
--- trunk/Source/WebCore/rendering/RenderLayer.cpp 2014-07-14 19:15:24 UTC (rev 171073)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp 2014-07-14 19:51:28 UTC (rev 171074)
@@ -199,7 +199,6 @@
, m_staticInlinePosition(0)
, m_staticBlockPosition(0)
, m_enclosingPaginationLayer(0)
- , m_enclosingLayerIsPaginatedAndComposited(false)
{
m_isNormalFlowOnly = shouldBeNormalFlowOnly();
m_isSelfPaintingLayer = shouldBeSelfPaintingLayer();
@@ -382,10 +381,8 @@
if (flags & UpdatePagination)
updatePagination();
- else {
+ else
m_enclosingPaginationLayer = nullptr;
- m_enclosingLayerIsPaginatedAndComposited = false;
- }
if (m_hasVisibleContent) {
// FIXME: LayoutState does not work with RenderLayers as there is not a 1-to-1
@@ -916,10 +913,46 @@
return 0;
}
+// FIXME: This is terrible. Bring back a cached bit for this someday. This crawl is going to slow down all
+// painting of content inside paginated layers.
+bool RenderLayer::hasCompositedLayerInEnclosingPaginationChain() const
+{
+ // No enclosing layer means no compositing in the chain.
+ if (!m_enclosingPaginationLayer)
+ return false;
+
+ // If the enclosing layer is composited, we don't have to check anything in between us and that
+ // layer.
+ if (m_enclosingPaginationLayer->isComposited())
+ return true;
+
+ // If we are the enclosing pagination layer, then we can't be composited or we'd have passed the
+ // previous check.
+ if (m_enclosingPaginationLayer == this)
+ return false;
+
+ // The enclosing paginated layer is our ancestor and is not composited, so we have to check
+ // intermediate layers between us and the enclosing pagination layer. Start with our own layer.
+ if (isComposited())
+ return true;
+
+ // For normal flow layers, we can recur up the layer tree.
+ if (isNormalFlowOnly())
+ return parent()->hasCompositedLayerInEnclosingPaginationChain();
+
+ // Otherwise we have to go up the containing block chain. Find the first enclosing
+ // containing block layer ancestor, and check that.
+ RenderView* renderView = &renderer().view();
+ for (RenderBlock* containingBlock = renderer().containingBlock(); containingBlock && containingBlock != renderView; containingBlock = containingBlock->containingBlock()) {
+ if (containingBlock->hasLayer())
+ return containingBlock->layer()->hasCompositedLayerInEnclosingPaginationChain();
+ }
+ return false;
+}
+
void RenderLayer::updatePagination()
{
m_enclosingPaginationLayer = nullptr;
- m_enclosingLayerIsPaginatedAndComposited = false;
if (!parent())
return;
@@ -930,7 +963,6 @@
// to that layer easily.
if (renderer().isInFlowRenderFlowThread()) {
m_enclosingPaginationLayer = this;
- m_enclosingLayerIsPaginatedAndComposited = isComposited();
return;
}
@@ -938,13 +970,10 @@
// Content inside a transform is not considered to be paginated, since we simply
// paint the transform multiple times in each column, so we don't have to use
// fragments for the transformed content.
- if (parent()->hasTransform()) {
+ if (parent()->hasTransform())
m_enclosingPaginationLayer = nullptr;
- m_enclosingLayerIsPaginatedAndComposited = false;
- } else {
+ else
m_enclosingPaginationLayer = parent()->enclosingPaginationLayer(IncludeCompositedPaginatedLayers);
- m_enclosingLayerIsPaginatedAndComposited = isComposited() ? true : parent()->enclosingLayerIsPaginatedAndComposited();
- }
return;
}
@@ -957,13 +986,10 @@
// Content inside a transform is not considered to be paginated, since we simply
// paint the transform multiple times in each column, so we don't have to use
// fragments for the transformed content.
- if (containingBlock->layer()->hasTransform()) {
+ if (containingBlock->layer()->hasTransform())
m_enclosingPaginationLayer = nullptr;
- m_enclosingLayerIsPaginatedAndComposited = false;
- } else {
+ else
m_enclosingPaginationLayer = containingBlock->layer()->enclosingPaginationLayer(IncludeCompositedPaginatedLayers);
- m_enclosingLayerIsPaginatedAndComposited = isComposited() ? true : containingBlock->layer()->enclosingLayerIsPaginatedAndComposited();
- }
return;
}
}
Modified: trunk/Source/WebCore/rendering/RenderLayer.h (171073 => 171074)
--- trunk/Source/WebCore/rendering/RenderLayer.h 2014-07-14 19:15:24 UTC (rev 171073)
+++ trunk/Source/WebCore/rendering/RenderLayer.h 2014-07-14 19:51:28 UTC (rev 171074)
@@ -514,14 +514,14 @@
void positionNewlyCreatedOverflowControls();
+ bool hasCompositedLayerInEnclosingPaginationChain() const;
enum PaginationInclusionMode { ExcludeCompositedPaginatedLayers, IncludeCompositedPaginatedLayers };
RenderLayer* enclosingPaginationLayer(PaginationInclusionMode mode) const
{
- if (mode == ExcludeCompositedPaginatedLayers && m_enclosingLayerIsPaginatedAndComposited)
+ if (mode == ExcludeCompositedPaginatedLayers && hasCompositedLayerInEnclosingPaginationChain())
return nullptr;
return m_enclosingPaginationLayer;
}
- bool enclosingLayerIsPaginatedAndComposited() const { return m_enclosingLayerIsPaginatedAndComposited; }
void updateTransform();
@@ -1337,7 +1337,6 @@
// Pointer to the enclosing RenderLayer that caused us to be paginated. It is 0 if we are not paginated.
RenderLayer* m_enclosingPaginationLayer;
- bool m_enclosingLayerIsPaginatedAndComposited;
IntRect m_blockSelectionGapsBounds;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes