Diff
Modified: trunk/Source/WebCore/ChangeLog (221957 => 221958)
--- trunk/Source/WebCore/ChangeLog 2017-09-13 04:39:48 UTC (rev 221957)
+++ trunk/Source/WebCore/ChangeLog 2017-09-13 06:44:45 UTC (rev 221958)
@@ -1,3 +1,51 @@
+2017-09-12 Frederic Wang <[email protected]>
+
+ Rename isRootLayer to isRenderViewLayer
+ https://bugs.webkit.org/show_bug.cgi?id=176684
+
+ Reviewed by Darin Adler.
+
+ This patch was generated with the help of do-webcore-rename with some coding style adjustment.
+
+ No new tests, behavior unchanged.
+
+ * rendering/RenderLayer.cpp:
+ (WebCore::RenderLayer::RenderLayer):
+ (WebCore::RenderLayer::enclosingTransformedAncestor const):
+ (WebCore::RenderLayer::enclosingFilterRepaintLayer const):
+ (WebCore::RenderLayer::setFilterBackendNeedsRepaintingInRect):
+ (WebCore::RenderLayer::clippingRootForPainting const):
+ (WebCore::RenderLayer::beginTransparencyLayers):
+ (WebCore::shouldSuppressPaintingLayer):
+ (WebCore::RenderLayer::paintFixedLayersInNamedFlows):
+ (WebCore::RenderLayer::hitTest):
+ (WebCore::RenderLayer::hitTestFixedLayersInNamedFlows):
+ (WebCore::RenderLayer::calculateClipRects const):
+ * rendering/RenderLayer.h:
+ * rendering/RenderLayerBacking.cpp:
+ (WebCore::RenderLayerBacking::RenderLayerBacking):
+ (WebCore::RenderLayerBacking::updateConfiguration):
+ (WebCore::RenderLayerBacking::updateAfterDescendants):
+ (WebCore::RenderLayerBacking::paintsIntoWindow const):
+ (WebCore::RenderLayerBacking::paintIntoLayer):
+ * rendering/RenderLayerCompositor.cpp:
+ (WebCore::RenderLayerCompositor::logLayerInfo):
+ (WebCore::RenderLayerCompositor::needsCompositingUpdateForStyleChangeOnNonCompositedLayer const):
+ (WebCore::RenderLayerCompositor::updateBacking):
+ (WebCore::RenderLayerCompositor::repaintInCompositedAncestor):
+ (WebCore::RenderLayerCompositor::addToOverlapMap):
+ (WebCore::RenderLayerCompositor::computeCompositingRequirementsForNamedFlowFixed):
+ (WebCore::RenderLayerCompositor::computeCompositingRequirements):
+ (WebCore::RenderLayerCompositor::rebuildCompositingLayerTreeForNamedFlowFixed):
+ (WebCore::RenderLayerCompositor::rebuildCompositingLayerTree):
+ (WebCore::RenderLayerCompositor::needsToBeComposited const):
+ (WebCore::RenderLayerCompositor::requiresOwnBackingStore const): Also move the IOS condition
+ up to avoid that check-webkit-style complains.
+ (WebCore::RenderLayerCompositor::reasonsForCompositing const):
+ (WebCore::RenderLayerCompositor::useCoordinatedScrollingForLayer const):
+ (WebCore::RenderLayerCompositor::needsFixedRootBackgroundLayer const):
+ (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
+
2017-09-12 Wenson Hsieh <[email protected]>
[iOS DnD] Support DataTransfer.getData and DataTransfer.setData when dragging or dropping
Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (221957 => 221958)
--- trunk/Source/WebCore/rendering/RenderLayer.cpp 2017-09-13 04:39:48 UTC (rev 221957)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp 2017-09-13 06:44:45 UTC (rev 221958)
@@ -267,7 +267,7 @@
}
RenderLayer::RenderLayer(RenderLayerModelObject& rendererLayerModelObject)
- : m_isRootLayer(rendererLayerModelObject.isRenderView())
+ : m_isRenderViewLayer(rendererLayerModelObject.isRenderView())
, m_forcedStackingContext(rendererLayerModelObject.isMedia())
, m_inResizeMode(false)
, m_scrollDimensionsDirty(true)
@@ -1526,7 +1526,7 @@
RenderLayer* RenderLayer::enclosingTransformedAncestor() const
{
RenderLayer* curr = parent();
- while (curr && !curr->isRootLayer() && !curr->transform())
+ while (curr && !curr->isRenderViewLayer() && !curr->transform())
curr = curr->parent();
return curr;
@@ -1593,7 +1593,7 @@
RenderLayer* RenderLayer::enclosingFilterRepaintLayer() const
{
for (const RenderLayer* curr = this; curr; curr = curr->parent()) {
- if ((curr != this && curr->requiresFullLayerImageForFilters()) || compositedWithOwnBackingStore(*curr) || curr->isRootLayer())
+ if ((curr != this && curr->requiresFullLayerImageForFilters()) || compositedWithOwnBackingStore(*curr) || curr->isRenderViewLayer())
return const_cast<RenderLayer*>(curr);
}
return nullptr;
@@ -1630,7 +1630,7 @@
return;
}
- if (parentLayer->isRootLayer()) {
+ if (parentLayer->isRenderViewLayer()) {
downcast<RenderView>(parentLayer->renderer()).repaintViewRectangle(parentLayerRect);
return;
}
@@ -1654,7 +1654,7 @@
const RenderLayer* current = this;
while (current) {
- if (current->isRootLayer())
+ if (current->isRenderViewLayer())
return const_cast<RenderLayer*>(current);
current = compositingContainer(*current);
@@ -1823,7 +1823,7 @@
context.clip(pixelSnappedClipRect);
#if ENABLE(CSS_COMPOSITING)
- bool usesCompositeOperation = hasBlendMode() && !(renderer().isSVGRoot() && parent() && parent()->isRootLayer());
+ bool usesCompositeOperation = hasBlendMode() && !(renderer().isSVGRoot() && parent() && parent()->isRenderViewLayer());
if (usesCompositeOperation)
context.setCompositeOperation(context.compositeOperation(), blendMode());
#endif
@@ -3940,7 +3940,7 @@
static inline bool shouldSuppressPaintingLayer(RenderLayer* layer)
{
- if (layer->renderer().style().isNotFinal() && !layer->isRootLayer() && !layer->renderer().isDocumentElementRenderer())
+ if (layer->renderer().style().isNotFinal() && !layer->isRenderViewLayer() && !layer->renderer().isDocumentElementRenderer())
return true;
// Avoid painting all layers if the document is in a state where visual updates aren't allowed.
@@ -4271,7 +4271,7 @@
// regions viewport.
void RenderLayer::paintFixedLayersInNamedFlows(GraphicsContext& context, const LayerPaintingInfo& paintingInfo, PaintLayerFlags paintFlags)
{
- if (!isRootLayer())
+ if (!isRenderViewLayer())
return;
// Get the named flows for the view
@@ -4945,7 +4945,7 @@
// We didn't hit any layer. If we are the root layer and the mouse is -- or just was -- down,
// return ourselves. We do this so mouse events continue getting delivered after a drag has
// exited the WebView, and so hit testing over a scrollbar hits the content document.
- if (!request.isChildFrameHitTest() && (request.active() || request.release()) && isRootLayer()) {
+ if (!request.isChildFrameHitTest() && (request.active() || request.release()) && isRenderViewLayer()) {
renderer().updateHitTestResult(result, downcast<RenderView>(renderer()).flipForWritingMode(hitTestLocation.point()));
insideLayer = this;
}
@@ -5073,7 +5073,7 @@
const HitTestingTransformState* unflattenedTransformState,
bool depthSortDescendants)
{
- if (!isRootLayer())
+ if (!isRenderViewLayer())
return nullptr;
// Get the named flows for the view
@@ -5882,7 +5882,7 @@
// Always examine the canvas and the root.
// FIXME: Could eliminate the isDocumentElementRenderer() check if we fix background painting so that the RenderView
// paints the root's background.
- if (isRootLayer() || renderer().isDocumentElementRenderer())
+ if (isRenderViewLayer() || renderer().isDocumentElementRenderer())
return true;
if (damageRect.isInfinite())
@@ -6035,7 +6035,7 @@
if ((flags & ExcludeHiddenDescendants) && this != ancestorLayer && !hasVisibleContent() && !hasVisibleDescendant())
return LayoutRect();
- if (isRootLayer()) {
+ if (isRenderViewLayer()) {
// The root layer is always just the size of the document.
return renderer().view().unscaledDocumentRect();
}
@@ -6585,7 +6585,7 @@
|| renderer().isVideo()
|| renderer().isEmbeddedObject()
|| renderer().isRenderIFrame()
- || (renderer().style().specifiesColumns() && !isRootLayer())
+ || (renderer().style().specifiesColumns() && !isRenderViewLayer())
|| renderer().isInFlowRenderFlowThread();
}
Modified: trunk/Source/WebCore/rendering/RenderLayer.h (221957 => 221958)
--- trunk/Source/WebCore/rendering/RenderLayer.h 2017-09-13 04:39:48 UTC (rev 221957)
+++ trunk/Source/WebCore/rendering/RenderLayer.h 2017-09-13 06:44:45 UTC (rev 221958)
@@ -293,7 +293,7 @@
bool inResizeMode() const { return m_inResizeMode; }
void setInResizeMode(bool b) { m_inResizeMode = b; }
- bool isRootLayer() const { return m_isRootLayer; }
+ bool isRenderViewLayer() const { return m_isRenderViewLayer; }
RenderLayerCompositor& compositor() const;
@@ -760,7 +760,7 @@
// Non-auto z-index always implies stacking context here, because StyleResolver::adjustRenderStyle already adjusts z-index
// based on positioning and other criteria.
- bool isStackingContext(const RenderStyle* style) const { return !style->hasAutoZIndex() || isRootLayer() || m_forcedStackingContext; }
+ bool isStackingContext(const RenderStyle* style) const { return !style->hasAutoZIndex() || isRenderViewLayer() || m_forcedStackingContext; }
bool isDirtyStackingContainer() const { return m_zOrderListsDirty && isStackingContainer(); }
@@ -1046,7 +1046,7 @@
// The bitfields are up here so they will fall into the padding from ScrollableArea on 64-bit.
- const bool m_isRootLayer : 1;
+ const bool m_isRenderViewLayer : 1;
const bool m_forcedStackingContext : 1;
// Keeps track of whether the layer is currently resizing, so events can cause resizing to start and stop.
Modified: trunk/Source/WebCore/rendering/RenderLayerBacking.cpp (221957 => 221958)
--- trunk/Source/WebCore/rendering/RenderLayerBacking.cpp 2017-09-13 04:39:48 UTC (rev 221957)
+++ trunk/Source/WebCore/rendering/RenderLayerBacking.cpp 2017-09-13 06:44:45 UTC (rev 221958)
@@ -209,7 +209,7 @@
RenderLayerBacking::RenderLayerBacking(RenderLayer& layer)
: m_owningLayer(layer)
{
- if (layer.isRootLayer()) {
+ if (layer.isRenderViewLayer()) {
m_isMainFrameRenderViewLayer = renderer().frame().isMainFrame();
m_isFrameLayerWithTiledBacking = renderer().page().chrome().client().shouldUseTiledBackingForFrameView(renderer().view().frameView());
}
@@ -720,7 +720,7 @@
PaintedContentsInfo contentsInfo(*this);
- if (!m_owningLayer.isRootLayer()) {
+ if (!m_owningLayer.isRenderViewLayer()) {
bool didUpdateContentsRect = false;
updateDirectlyCompositedBoxDecorations(contentsInfo, didUpdateContentsRect);
} else
@@ -1220,7 +1220,7 @@
PaintedContentsInfo contentsInfo(*this);
contentsInfo.setWantsSubpixelAntialiasedTextState(GraphicsLayer::supportsSubpixelAntialiasedLayerText());
- if (!m_owningLayer.isRootLayer()) {
+ if (!m_owningLayer.isRenderViewLayer()) {
bool didUpdateContentsRect = false;
updateDirectlyCompositedBoxDecorations(contentsInfo, didUpdateContentsRect);
if (!didUpdateContentsRect && m_graphicsLayer->usesContentsLayer())
@@ -2402,7 +2402,7 @@
if (m_isFrameLayerWithTiledBacking)
return false;
- if (m_owningLayer.isRootLayer()) {
+ if (m_owningLayer.isRenderViewLayer()) {
#if PLATFORM(IOS) || USE(COORDINATED_GRAPHICS)
if (compositor().inForcedCompositingMode())
return false;
@@ -2555,7 +2555,7 @@
#endif
FrameView::PaintingState paintingState;
- if (m_owningLayer.isRootLayer())
+ if (m_owningLayer.isRenderViewLayer())
renderer().view().frameView().willPaintContents(context, paintDirtyRect, paintingState);
// FIXME: GraphicsLayers need a way to split for RenderRegions.
@@ -2565,7 +2565,7 @@
if (m_owningLayer.containsDirtyOverlayScrollbars())
m_owningLayer.paintLayerContents(context, paintingInfo, paintFlags | RenderLayer::PaintLayerPaintingOverlayScrollbars);
- if (m_owningLayer.isRootLayer())
+ if (m_owningLayer.isRenderViewLayer())
renderer().view().frameView().didPaintContents(context, paintDirtyRect, paintingState);
compositor().didPaintBacking(this);
Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp (221957 => 221958)
--- trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp 2017-09-13 04:39:48 UTC (rev 221957)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp 2017-09-13 06:44:45 UTC (rev 221958)
@@ -798,7 +798,7 @@
return;
RenderLayerBacking* backing = layer.backing();
- if (requiresCompositingLayer(layer) || layer.isRootLayer()) {
+ if (requiresCompositingLayer(layer) || layer.isRenderViewLayer()) {
++m_obligateCompositedLayerCount;
m_obligatoryBackingStoreBytes += backing->backingStoreMemoryEstimate();
} else {
@@ -955,7 +955,7 @@
bool RenderLayerCompositor::needsCompositingUpdateForStyleChangeOnNonCompositedLayer(RenderLayer& layer, const RenderStyle* oldStyle) const
{
// Needed for scroll bars.
- if (layer.isRootLayer())
+ if (layer.isRenderViewLayer())
return true;
if (!oldStyle)
@@ -1023,7 +1023,7 @@
layer.ensureBacking();
- if (layer.isRootLayer() && useCoordinatedScrollingForLayer(layer)) {
+ if (layer.isRenderViewLayer() && useCoordinatedScrollingForLayer(layer)) {
updateScrollCoordinatedStatus(layer, { ScrollingNodeChangeFlags::Layer, ScrollingNodeChangeFlags::LayerGeometry });
if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator())
scrollingCoordinator->frameViewRootLayerDidChange(m_renderView.frameView());
@@ -1153,7 +1153,7 @@
// The contents of this layer may be moving from a GraphicsLayer to the window,
// so we need to make sure the window system synchronizes those changes on the screen.
- if (compositedAncestor->isRootLayer())
+ if (compositedAncestor->isRenderViewLayer())
m_renderView.frameView().setNeedsOneShotDrawingSynchronization();
}
@@ -1218,7 +1218,7 @@
void RenderLayerCompositor::addToOverlapMap(OverlapMap& overlapMap, const RenderLayer& layer, OverlapExtent& extent)
{
- if (layer.isRootLayer())
+ if (layer.isRenderViewLayer())
return;
computeExtent(overlapMap, layer, extent);
@@ -1273,7 +1273,7 @@
void RenderLayerCompositor::computeCompositingRequirementsForNamedFlowFixed(RenderLayer& layer, OverlapMap& overlapMap, CompositingState& childState, bool& layersChanged, bool& anyDescendantHas3DTransform)
{
- if (!layer.isRootLayer())
+ if (!layer.isRenderViewLayer())
return;
if (!layer.renderer().view().hasRenderNamedFlowThreads())
@@ -1321,7 +1321,7 @@
OverlapExtent layerExtent;
// Use the fact that we're composited as a hint to check for an animating transform.
// FIXME: Maybe needsToBeComposited() should return a bitmask of reasons, to avoid the need to recompute things.
- if (willBeComposited && !layer.isRootLayer())
+ if (willBeComposited && !layer.isRenderViewLayer())
layerExtent.hasTransformAnimation = isRunningTransformAnimation(layer.renderer());
bool respectTransforms = !layerExtent.hasTransformAnimation;
@@ -1426,11 +1426,11 @@
}
}
- if (layer.isRootLayer())
+ if (layer.isRenderViewLayer())
computeCompositingRequirementsForNamedFlowFixed(layer, overlapMap, childState, layersChanged, anyDescendantHas3DTransform);
// If we just entered compositing mode, the root will have become composited (as long as accelerated compositing is enabled).
- if (layer.isRootLayer()) {
+ if (layer.isRenderViewLayer()) {
if (inCompositingMode() && m_hasAcceleratedCompositing)
willBeComposited = true;
}
@@ -1442,7 +1442,7 @@
// compositing ancestor's backing, and so are still considered for overlap.
// FIXME: When layerExtent has taken animation bounds into account, we also know that the bounds
// include descendants, so we don't need to add them all to the overlap map.
- if (childState.compositingAncestor && !childState.compositingAncestor->isRootLayer())
+ if (childState.compositingAncestor && !childState.compositingAncestor->isRenderViewLayer())
addToOverlapMap(overlapMap, layer, layerExtent);
#if ENABLE(CSS_COMPOSITING)
@@ -1497,13 +1497,13 @@
compositingState.hasNotIsolatedCompositedBlendingDescendants = true;
#endif
- if (childState.compositingAncestor == &layer && !layer.isRootLayer())
+ if (childState.compositingAncestor == &layer && !layer.isRenderViewLayer())
overlapMap.popCompositingContainer();
// If we're back at the root, and no other layers need to be composited, and the root layer itself doesn't need
// to be composited, then we can drop out of compositing mode altogether. However, don't drop out of compositing mode
// if there are composited layers that we didn't hit in our traversal (e.g. because of visibility:hidden).
- if (layer.isRootLayer() && !childState.subtreeIsCompositing && !requiresCompositingLayer(layer) && !m_forceCompositingMode && !hasAnyAdditionalCompositedLayers(layer)) {
+ if (layer.isRenderViewLayer() && !childState.subtreeIsCompositing && !requiresCompositingLayer(layer) && !m_forceCompositingMode && !hasAnyAdditionalCompositedLayers(layer)) {
// Don't drop out of compositing on iOS, because we may flash. See <rdar://problem/8348337>.
#if !PLATFORM(IOS)
enableCompositingMode(false);
@@ -1583,7 +1583,7 @@
void RenderLayerCompositor::rebuildCompositingLayerTreeForNamedFlowFixed(RenderLayer& layer, Vector<GraphicsLayer*>& childGraphicsLayersOfEnclosingLayer, int depth)
{
- if (!layer.isRootLayer())
+ if (!layer.isRenderViewLayer())
return;
if (!layer.renderer().view().hasRenderNamedFlowThreads())
@@ -1669,7 +1669,7 @@
}
}
- if (layer.isRootLayer())
+ if (layer.isRenderViewLayer())
rebuildCompositingLayerTreeForNamedFlowFixed(layer, childList, depth + 1);
if (layerBacking) {
@@ -2162,7 +2162,7 @@
if (!canBeComposited(layer))
return false;
- return requiresCompositingLayer(layer, viewportConstrainedNotCompositedReason) || layer.mustCompositeForIndirectReasons() || (inCompositingMode() && layer.isRootLayer());
+ return requiresCompositingLayer(layer, viewportConstrainedNotCompositedReason) || layer.mustCompositeForIndirectReasons() || (inCompositingMode() && layer.isRenderViewLayer());
}
// Note: this specifies whether the RL needs a compositing layer for intrinsic reasons.
@@ -2216,7 +2216,7 @@
|| compositingAncestorLayer->backing()->paintsIntoCompositedAncestor()))
return true;
- if (layer.isRootLayer()
+ if (layer.isRenderViewLayer()
|| layer.transform() // note: excludes perspective and transformStyle3D.
|| requiresCompositingForAnimation(renderer)
|| requiresCompositingForPosition(renderer, layer)
@@ -2228,15 +2228,14 @@
|| requiresCompositingForFrame(renderer)
|| requiresCompositingForPlugin(renderer)
|| requiresCompositingForOverflowScrolling(layer)
+#if PLATFORM(IOS)
+ || requiresCompositingForScrolling(layer)
+#endif
|| renderer.isTransparent()
|| renderer.hasMask()
|| renderer.hasReflection()
|| renderer.hasFilter()
- || renderer.hasBackdropFilter()
-#if PLATFORM(IOS)
- || requiresCompositingForScrolling(layer)
-#endif
- )
+ || renderer.hasBackdropFilter())
return true;
if (layer.mustCompositeForIndirectReasons()) {
@@ -2345,7 +2344,7 @@
break;
}
- if (inCompositingMode() && renderer.layer()->isRootLayer())
+ if (inCompositingMode() && renderer.layer()->isRenderViewLayer())
reasons |= CompositingReason::Root;
return reasons;
@@ -2753,7 +2752,7 @@
bool RenderLayerCompositor::useCoordinatedScrollingForLayer(const RenderLayer& layer) const
{
- if (layer.isRootLayer() && hasCoordinatedScrolling())
+ if (layer.isRenderViewLayer() && hasCoordinatedScrolling())
return true;
return layer.usesAcceleratedScrolling();
@@ -2922,7 +2921,7 @@
bool RenderLayerCompositor::needsFixedRootBackgroundLayer(const RenderLayer& layer) const
{
- if (!layer.isRootLayer())
+ if (!layer.isRenderViewLayer())
return false;
if (m_renderView.settings().fixedBackgroundsPaintRelativeToDocument())
@@ -3893,9 +3892,9 @@
if (!scrollingCoordinator || !scrollingCoordinator->coordinatesScrollingForFrameView(m_renderView.frameView()))
return;
- bool isRootLayer = layer.isRootLayer();
+ bool isRenderViewLayer = layer.isRenderViewLayer();
- if (!layer.parent() && !isRootLayer)
+ if (!layer.parent() && !isRenderViewLayer)
return;
ASSERT(m_scrollCoordinatedLayers.contains(&layer));
@@ -3911,12 +3910,12 @@
return;
updateScrollCoordinationForThisFrame(parentDocumentHostingNodeID);
- if (!(reasons & ViewportConstrained) && isRootLayer)
+ if (!(reasons & ViewportConstrained) && isRenderViewLayer)
return;
}
ScrollingNodeID parentNodeID = enclosingScrollingNodeID(layer, ExcludeSelf);
- if (!parentNodeID && !isRootLayer)
+ if (!parentNodeID && !isRenderViewLayer)
return;
// Always call this even if the backing is already attached because the parent may have changed.
@@ -3958,7 +3957,7 @@
detachScrollCoordinatedLayer(layer, ViewportConstrained);
if (reasons & Scrolling) {
- if (isRootLayer)
+ if (isRenderViewLayer)
updateScrollCoordinationForThisFrame(parentNodeID);
else {
ScrollingNodeType nodeType = OverflowScrollingNode;