OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. | 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. |
5 * | 5 * |
6 * Other contributors: | 6 * Other contributors: |
7 * Robert O'Callahan <roc+@cs.cmu.edu> | 7 * Robert O'Callahan <roc+@cs.cmu.edu> |
8 * David Baron <dbaron@fas.harvard.edu> | 8 * David Baron <dbaron@fas.harvard.edu> |
9 * Christian Biesinger <cbiesinger@web.de> | 9 * Christian Biesinger <cbiesinger@web.de> |
10 * Randall Jesup <rjesup@wgate.com> | 10 * Randall Jesup <rjesup@wgate.com> |
(...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
702 } | 702 } |
703 | 703 |
704 // If we live in a 3d hierarchy, then the layer at the root of that hierarch y needs | 704 // If we live in a 3d hierarchy, then the layer at the root of that hierarch y needs |
705 // the m_has3DTransformedDescendant set. | 705 // the m_has3DTransformedDescendant set. |
706 if (preserves3D()) | 706 if (preserves3D()) |
707 return has3DTransform() || m_has3DTransformedDescendant; | 707 return has3DTransform() || m_has3DTransformedDescendant; |
708 | 708 |
709 return has3DTransform(); | 709 return has3DTransform(); |
710 } | 710 } |
711 | 711 |
712 LayoutPoint DeprecatedPaintLayer::locationExcludeOverflowScroll() const | |
713 { | |
714 // Our m_location already has scroll offset baked-in. We have to revert it h ere. | |
715 IntSize scrollOffset; | |
716 if (DeprecatedPaintLayer* positionedParent = layoutObject()->isOutOfFlowPosi tioned() ? enclosingPositionedAncestor() : nullptr) { | |
717 if (positionedParent->layoutObject()->hasOverflowClip()) | |
718 scrollOffset = positionedParent->layoutBox()->scrolledContentOffset( ); | |
719 } else if (parent() && parent()->layoutObject()->hasOverflowClip()) { | |
720 scrollOffset = parent()->layoutBox()->scrolledContentOffset(); | |
721 } | |
722 return m_location + LayoutSize(scrollOffset); | |
723 } | |
724 | |
712 bool DeprecatedPaintLayer::updateLayerPosition() | 725 bool DeprecatedPaintLayer::updateLayerPosition() |
713 { | 726 { |
714 LayoutPoint localPoint; | 727 LayoutPoint localPoint; |
715 LayoutPoint inlineBoundingBoxOffset; // We don't put this into the Layer x/y for inlines, so we need to subtract it out when done. | 728 LayoutPoint inlineBoundingBoxOffset; // We don't put this into the Layer x/y for inlines, so we need to subtract it out when done. |
716 | 729 |
717 if (layoutObject()->isInline() && layoutObject()->isLayoutInline()) { | 730 if (layoutObject()->isInline() && layoutObject()->isLayoutInline()) { |
718 LayoutInline* inlineFlow = toLayoutInline(layoutObject()); | 731 LayoutInline* inlineFlow = toLayoutInline(layoutObject()); |
719 IntRect lineBox = inlineFlow->linesBoundingBox(); | 732 IntRect lineBox = inlineFlow->linesBoundingBox(); |
720 m_size = lineBox.size(); | 733 m_size = lineBox.size(); |
721 inlineBoundingBoxOffset = lineBox.location(); | 734 inlineBoundingBoxOffset = lineBox.location(); |
(...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1235 | 1248 |
1236 // Remove all descendant layers from the hierarchy and add them to the new p osition. | 1249 // Remove all descendant layers from the hierarchy and add them to the new p osition. |
1237 for (LayoutObject* curr = layoutObject()->slowFirstChild(); curr; curr = cur r->nextSibling()) | 1250 for (LayoutObject* curr = layoutObject()->slowFirstChild(); curr; curr = cur r->nextSibling()) |
1238 curr->moveLayers(m_parent, this); | 1251 curr->moveLayers(m_parent, this); |
1239 | 1252 |
1240 // Clear out all the clip rects. | 1253 // Clear out all the clip rects. |
1241 m_clipper.clearClipRectsIncludingDescendants(); | 1254 m_clipper.clearClipRectsIncludingDescendants(); |
1242 } | 1255 } |
1243 | 1256 |
1244 // Returns the layer reached on the walk up towards the ancestor. | 1257 // Returns the layer reached on the walk up towards the ancestor. |
1245 static inline const DeprecatedPaintLayer* accumulateOffsetTowardsAncestor(const DeprecatedPaintLayer* layer, const DeprecatedPaintLayer* ancestorLayer, LayoutPo int& location) | 1258 static inline const DeprecatedPaintLayer* accumulateOffsetTowardsAncestor(const DeprecatedPaintLayer* layer, const DeprecatedPaintLayer* ancestorLayer, LayoutPo int& location, DeprecatedPaintLayer::LocationQueryBehavior behavior) |
1246 { | 1259 { |
1247 ASSERT(ancestorLayer != layer); | 1260 ASSERT(ancestorLayer != layer); |
1248 | 1261 |
1249 const LayoutBoxModelObject* layoutObject = layer->layoutObject(); | 1262 const LayoutBoxModelObject* layoutObject = layer->layoutObject(); |
1250 EPosition position = layoutObject->style()->position(); | 1263 EPosition position = layoutObject->style()->position(); |
1251 | 1264 |
1252 if (position == FixedPosition && (!ancestorLayer || ancestorLayer == layoutO bject->view()->layer())) { | 1265 if (position == FixedPosition && (!ancestorLayer || ancestorLayer == layoutO bject->view()->layer())) { |
1253 // If the fixed layer's container is the root, just add in the offset of the view. We can obtain this by calling | 1266 // If the fixed layer's container is the root, just add in the offset of the view. We can obtain this by calling |
1254 // localToAbsolute() on the LayoutView. | 1267 // localToAbsolute() on the LayoutView. |
1255 FloatPoint absPos = layoutObject->localToAbsolute(FloatPoint(), IsFixed) ; | 1268 FloatPoint absPos = layoutObject->localToAbsolute(FloatPoint(), IsFixed) ; |
1256 location += LayoutSize(absPos.x(), absPos.y()); | 1269 location += LayoutSize(absPos.x(), absPos.y()); |
1257 return ancestorLayer; | 1270 return ancestorLayer; |
1258 } | 1271 } |
1259 | 1272 |
1260 DeprecatedPaintLayer* parentLayer; | 1273 DeprecatedPaintLayer* parentLayer; |
1261 if (position == AbsolutePosition || position == FixedPosition) { | 1274 if (position == AbsolutePosition || position == FixedPosition) { |
1262 bool foundAncestorFirst; | 1275 bool foundAncestorFirst; |
1263 parentLayer = layer->enclosingPositionedAncestor(ancestorLayer, &foundAn cestorFirst); | 1276 parentLayer = layer->enclosingPositionedAncestor(ancestorLayer, &foundAn cestorFirst); |
1264 | 1277 |
1265 if (foundAncestorFirst) { | 1278 if (foundAncestorFirst) { |
1266 // Found ancestorLayer before the container of the out-of-flow objec t, so compute offset | 1279 // Found ancestorLayer before the container of the out-of-flow objec t, so compute offset |
1267 // of both relative to the container and subtract. | 1280 // of both relative to the container and subtract. |
1268 | 1281 |
1269 LayoutPoint thisCoords; | 1282 LayoutPoint thisCoords; |
1270 layer->convertToLayerCoords(parentLayer, thisCoords); | 1283 layer->convertToLayerCoords(parentLayer, thisCoords, behavior); |
1271 | 1284 |
1272 LayoutPoint ancestorCoords; | 1285 LayoutPoint ancestorCoords; |
1273 ancestorLayer->convertToLayerCoords(parentLayer, ancestorCoords); | 1286 ancestorLayer->convertToLayerCoords(parentLayer, ancestorCoords, beh avior); |
1274 | 1287 |
1275 location += (thisCoords - ancestorCoords); | 1288 location += (thisCoords - ancestorCoords); |
1276 return ancestorLayer; | 1289 return ancestorLayer; |
1277 } | 1290 } |
1278 } else if (layoutObject->isColumnSpanAll()) { | 1291 } else if (layoutObject->isColumnSpanAll()) { |
1279 LayoutBlock* multicolContainer = layoutObject->containingBlock(); | 1292 LayoutBlock* multicolContainer = layoutObject->containingBlock(); |
1280 ASSERT(toLayoutBlockFlow(multicolContainer)->multiColumnFlowThread()); | 1293 ASSERT(toLayoutBlockFlow(multicolContainer)->multiColumnFlowThread()); |
1281 parentLayer = multicolContainer->layer(); | 1294 parentLayer = multicolContainer->layer(); |
1282 ASSERT(parentLayer); | 1295 ASSERT(parentLayer); |
1283 } else { | 1296 } else { |
1284 parentLayer = layer->parent(); | 1297 parentLayer = layer->parent(); |
1285 } | 1298 } |
1286 | 1299 |
1287 if (!parentLayer) | 1300 if (!parentLayer) |
1288 return nullptr; | 1301 return nullptr; |
1289 | 1302 |
1290 location += layer->location(); | 1303 location += layer->location(behavior); |
1291 return parentLayer; | 1304 return parentLayer; |
1292 } | 1305 } |
1293 | 1306 |
1294 void DeprecatedPaintLayer::convertToLayerCoords(const DeprecatedPaintLayer* ance storLayer, LayoutPoint& location) const | 1307 void DeprecatedPaintLayer::convertToLayerCoords(const DeprecatedPaintLayer* ance storLayer, LayoutPoint& location, LocationQueryBehavior behavior) const |
1295 { | 1308 { |
1296 if (ancestorLayer == this) | 1309 if (ancestorLayer == this) |
1297 return; | 1310 return; |
1298 | 1311 |
1299 const DeprecatedPaintLayer* currLayer = this; | 1312 const DeprecatedPaintLayer* currLayer = this; |
1300 while (currLayer && currLayer != ancestorLayer) | 1313 while (currLayer && currLayer != ancestorLayer) |
1301 currLayer = accumulateOffsetTowardsAncestor(currLayer, ancestorLayer, lo cation); | 1314 currLayer = accumulateOffsetTowardsAncestor(currLayer, ancestorLayer, lo cation, behavior); |
1302 } | 1315 } |
1303 | 1316 |
1304 void DeprecatedPaintLayer::convertToLayerCoords(const DeprecatedPaintLayer* ance storLayer, LayoutRect& rect) const | 1317 void DeprecatedPaintLayer::convertToLayerCoords(const DeprecatedPaintLayer* ance storLayer, LayoutRect& rect) const |
1305 { | 1318 { |
1306 LayoutPoint delta; | 1319 LayoutPoint delta; |
1307 convertToLayerCoords(ancestorLayer, delta); | 1320 convertToLayerCoords(ancestorLayer, delta); |
1308 rect.moveBy(delta); | 1321 rect.moveBy(delta); |
1309 } | 1322 } |
1310 | 1323 |
1311 LayoutPoint DeprecatedPaintLayer::visualOffsetFromAncestor(const DeprecatedPaint Layer* ancestorLayer) const | 1324 LayoutPoint DeprecatedPaintLayer::visualOffsetFromAncestor(const DeprecatedPaint Layer* ancestorLayer) const |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1407 if (respectOverflowClip == IgnoreOverflowClip) | 1420 if (respectOverflowClip == IgnoreOverflowClip) |
1408 paginationClipRectsContext.setIgnoreOverflowClip(); | 1421 paginationClipRectsContext.setIgnoreOverflowClip(); |
1409 LayoutRect layerBoundsInFlowThread; | 1422 LayoutRect layerBoundsInFlowThread; |
1410 ClipRect backgroundRectInFlowThread; | 1423 ClipRect backgroundRectInFlowThread; |
1411 ClipRect foregroundRectInFlowThread; | 1424 ClipRect foregroundRectInFlowThread; |
1412 ClipRect outlineRectInFlowThread; | 1425 ClipRect outlineRectInFlowThread; |
1413 clipper().calculateRects(paginationClipRectsContext, LayoutRect(LayoutRect:: infiniteIntRect()), layerBoundsInFlowThread, backgroundRectInFlowThread, foregro undRectInFlowThread, | 1426 clipper().calculateRects(paginationClipRectsContext, LayoutRect(LayoutRect:: infiniteIntRect()), layerBoundsInFlowThread, backgroundRectInFlowThread, foregro undRectInFlowThread, |
1414 outlineRectInFlowThread, &offsetWithinPaginatedLayer); | 1427 outlineRectInFlowThread, &offsetWithinPaginatedLayer); |
1415 | 1428 |
1416 // Take our bounding box within the flow thread and clip it. | 1429 // Take our bounding box within the flow thread and clip it. |
1417 LayoutRect layerBoundingBoxInFlowThread = layerBoundingBox ? *layerBoundingB ox : physicalBoundingBox(enclosingPaginationLayer(), &offsetWithinPaginatedLayer ); | 1430 LayoutRect layerBoundingBoxInFlowThread = layerBoundingBox ? *layerBoundingB ox : physicalBoundingBox(nullptr, &offsetWithinPaginatedLayer); |
1418 layerBoundingBoxInFlowThread.intersect(backgroundRectInFlowThread.rect()); | 1431 layerBoundingBoxInFlowThread.intersect(backgroundRectInFlowThread.rect()); |
1419 | 1432 |
1420 // Make the dirty rect relative to the fragmentation context (multicol conta iner, etc.). | 1433 // Make the dirty rect relative to the fragmentation context (multicol conta iner, etc.). |
1421 LayoutFlowThread* enclosingFlowThread = toLayoutFlowThread(enclosingPaginati onLayer()->layoutObject()); | 1434 LayoutFlowThread* enclosingFlowThread = toLayoutFlowThread(enclosingPaginati onLayer()->layoutObject()); |
1422 LayoutPoint offsetOfPaginationLayerFromRoot; // Visual offset from the root layer to the nearest fragmentation context. | 1435 LayoutPoint offsetOfPaginationLayerFromRoot; // Visual offset from the root layer to the nearest fragmentation context. |
1423 bool rootLayerIsInsidePaginationLayer = rootLayer->enclosingPaginationLayer( ) == enclosingPaginationLayer(); | 1436 bool rootLayerIsInsidePaginationLayer = rootLayer->enclosingPaginationLayer( ) == enclosingPaginationLayer(); |
1424 if (rootLayerIsInsidePaginationLayer) { | 1437 if (rootLayerIsInsidePaginationLayer) { |
1425 // The root layer is in the same fragmentation context as this layer, so we need to look | 1438 // The root layer is in the same fragmentation context as this layer, so we need to look |
1426 // inside it and subtract the offset between the fragmentation context a nd the root layer. | 1439 // inside it and subtract the offset between the fragmentation context a nd the root layer. |
1427 offsetOfPaginationLayerFromRoot = -rootLayer->visualOffsetFromAncestor(e nclosingPaginationLayer()); | 1440 offsetOfPaginationLayerFromRoot = -rootLayer->visualOffsetFromAncestor(e nclosingPaginationLayer()); |
(...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2029 // ASSERT(layoutObject()->document().lifecycle().state() >= DocumentLifecycl e::LayoutClean); | 2042 // ASSERT(layoutObject()->document().lifecycle().state() >= DocumentLifecycl e::LayoutClean); |
2030 | 2043 |
2031 if (!layoutObject()->isLayoutBlock()) | 2044 if (!layoutObject()->isLayoutBlock()) |
2032 return false; | 2045 return false; |
2033 | 2046 |
2034 return toLayoutBlock(layoutObject())->shouldPaintSelectionGaps(); | 2047 return toLayoutBlock(layoutObject())->shouldPaintSelectionGaps(); |
2035 } | 2048 } |
2036 | 2049 |
2037 bool DeprecatedPaintLayer::intersectsDamageRect(const LayoutRect& layerBounds, c onst LayoutRect& damageRect, const DeprecatedPaintLayer* rootLayer, const Layout Point* offsetFromRoot) const | 2050 bool DeprecatedPaintLayer::intersectsDamageRect(const LayoutRect& layerBounds, c onst LayoutRect& damageRect, const DeprecatedPaintLayer* rootLayer, const Layout Point* offsetFromRoot) const |
2038 { | 2051 { |
2052 ASSERT(!(rootLayer && offsetFromRoot)); | |
2039 // Always examine the canvas and the root. | 2053 // Always examine the canvas and the root. |
2040 // FIXME: Could eliminate the isDocumentElement() check if we fix background painting so that the LayoutView | 2054 // FIXME: Could eliminate the isDocumentElement() check if we fix background painting so that the LayoutView |
2041 // paints the root's background. | 2055 // paints the root's background. |
2042 if (isRootLayer() || layoutObject()->isDocumentElement()) | 2056 if (isRootLayer() || layoutObject()->isDocumentElement()) |
2043 return true; | 2057 return true; |
2044 | 2058 |
2045 // If we aren't an inline flow, and our layer bounds do intersect the damage rect, then we | 2059 // If we aren't an inline flow, and our layer bounds do intersect the damage rect, then we |
2046 // can go ahead and return true. | 2060 // can go ahead and return true. |
2047 LayoutView* view = layoutObject()->view(); | 2061 LayoutView* view = layoutObject()->view(); |
2048 ASSERT(view); | 2062 ASSERT(view); |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2095 static inline LayoutRect flippedLogicalBoundingBox(LayoutRect boundingBox, Layou tObject* layoutObjects) | 2109 static inline LayoutRect flippedLogicalBoundingBox(LayoutRect boundingBox, Layou tObject* layoutObjects) |
2096 { | 2110 { |
2097 LayoutRect result = boundingBox; | 2111 LayoutRect result = boundingBox; |
2098 if (layoutObjects->isBox()) | 2112 if (layoutObjects->isBox()) |
2099 toLayoutBox(layoutObjects)->flipForWritingMode(result); | 2113 toLayoutBox(layoutObjects)->flipForWritingMode(result); |
2100 else | 2114 else |
2101 layoutObjects->containingBlock()->flipForWritingMode(result); | 2115 layoutObjects->containingBlock()->flipForWritingMode(result); |
2102 return result; | 2116 return result; |
2103 } | 2117 } |
2104 | 2118 |
2105 LayoutRect DeprecatedPaintLayer::physicalBoundingBox(const DeprecatedPaintLayer* ancestorLayer, const LayoutPoint* offsetFromRoot) const | 2119 LayoutRect DeprecatedPaintLayer::physicalBoundingBox(const DeprecatedPaintLayer* ancestorLayer, const LayoutPoint* offsetFromRoot) const |
pdr.
2015/09/03 06:16:59
Can we just switch this to two functions?
LayoutR
trchen
2015/09/04 06:10:14
Done.
| |
2106 { | 2120 { |
2121 ASSERT(!(ancestorLayer && offsetFromRoot)); | |
2107 LayoutRect result = flippedLogicalBoundingBox(logicalBoundingBox(), layoutOb ject()); | 2122 LayoutRect result = flippedLogicalBoundingBox(logicalBoundingBox(), layoutOb ject()); |
2108 if (offsetFromRoot) | 2123 if (offsetFromRoot) |
2109 result.moveBy(*offsetFromRoot); | 2124 result.moveBy(*offsetFromRoot); |
2110 else | 2125 else |
2111 convertToLayerCoords(ancestorLayer, result); | 2126 convertToLayerCoords(ancestorLayer, result); |
2112 return result; | 2127 return result; |
2113 } | 2128 } |
2114 | 2129 |
2115 LayoutRect DeprecatedPaintLayer::fragmentsBoundingBox(const DeprecatedPaintLayer * ancestorLayer) const | 2130 LayoutRect DeprecatedPaintLayer::fragmentsBoundingBox(const DeprecatedPaintLayer * ancestorLayer) const |
2116 { | 2131 { |
(...skipping 29 matching lines...) Expand all Loading... | |
2146 // because those Layers don't paint into the graphics layer | 2161 // because those Layers don't paint into the graphics layer |
2147 // for this Layer. For example, the bounds of squashed Layers | 2162 // for this Layer. For example, the bounds of squashed Layers |
2148 // will be included in the computation of the appropriate squashing | 2163 // will be included in the computation of the appropriate squashing |
2149 // GraphicsLayer. | 2164 // GraphicsLayer. |
2150 if (node->layer()->compositingState() != NotComposited) | 2165 if (node->layer()->compositingState() != NotComposited) |
2151 continue; | 2166 continue; |
2152 result.unite(node->layer()->boundingBoxForCompositing(ancestorLayer)); | 2167 result.unite(node->layer()->boundingBoxForCompositing(ancestorLayer)); |
2153 } | 2168 } |
2154 } | 2169 } |
2155 | 2170 |
2156 LayoutRect DeprecatedPaintLayer::physicalBoundingBoxIncludingReflectionAndStacki ngChildren(const DeprecatedPaintLayer* ancestorLayer, const LayoutPoint& offsetF romRoot) const | 2171 LayoutRect DeprecatedPaintLayer::physicalBoundingBoxIncludingReflectionAndStacki ngChildren(const LayoutPoint& offsetFromRoot) const |
2157 { | 2172 { |
2158 LayoutPoint origin; | 2173 LayoutPoint origin; |
2159 LayoutRect result = physicalBoundingBox(ancestorLayer, &origin); | 2174 LayoutRect result = physicalBoundingBox(nullptr, &origin); |
2160 | 2175 |
2161 const_cast<DeprecatedPaintLayer*>(this)->stackingNode()->updateLayerListsIfN eeded(); | 2176 const_cast<DeprecatedPaintLayer*>(this)->stackingNode()->updateLayerListsIfN eeded(); |
2162 | 2177 |
2163 expandRectForReflectionAndStackingChildren(this, result); | 2178 expandRectForReflectionAndStackingChildren(this, result); |
2164 | 2179 |
2165 result.moveBy(offsetFromRoot); | 2180 result.moveBy(offsetFromRoot); |
2166 return result; | 2181 return result; |
2167 } | 2182 } |
2168 | 2183 |
2169 LayoutRect DeprecatedPaintLayer::boundingBoxForCompositing(const DeprecatedPaint Layer* ancestorLayer, CalculateBoundsOptions options) const | 2184 LayoutRect DeprecatedPaintLayer::boundingBoxForCompositing(const DeprecatedPaint Layer* ancestorLayer, CalculateBoundsOptions options) const |
(...skipping 15 matching lines...) Expand all Loading... | |
2185 // The layer created for the LayoutFlowThread is just a helper for painting and hit-testing, | 2200 // The layer created for the LayoutFlowThread is just a helper for painting and hit-testing, |
2186 // and should not contribute to the bounding box. The LayoutMultiColumnSets will contribute | 2201 // and should not contribute to the bounding box. The LayoutMultiColumnSets will contribute |
2187 // the correct size for the layout content of the multicol container. | 2202 // the correct size for the layout content of the multicol container. |
2188 if (layoutObject()->isLayoutFlowThread()) | 2203 if (layoutObject()->isLayoutFlowThread()) |
2189 return LayoutRect(); | 2204 return LayoutRect(); |
2190 | 2205 |
2191 LayoutRect result = clipper().localClipRect(); | 2206 LayoutRect result = clipper().localClipRect(); |
2192 // TODO(chrishtr): avoid converting to IntRect and back. | 2207 // TODO(chrishtr): avoid converting to IntRect and back. |
2193 if (result == LayoutRect(LayoutRect::infiniteIntRect())) { | 2208 if (result == LayoutRect(LayoutRect::infiniteIntRect())) { |
2194 LayoutPoint origin; | 2209 LayoutPoint origin; |
2195 result = physicalBoundingBox(ancestorLayer, &origin); | 2210 result = physicalBoundingBox(nullptr, &origin); |
2196 | 2211 |
2197 const_cast<DeprecatedPaintLayer*>(this)->stackingNode()->updateLayerList sIfNeeded(); | 2212 const_cast<DeprecatedPaintLayer*>(this)->stackingNode()->updateLayerList sIfNeeded(); |
2198 | 2213 |
2199 // Reflections are implemented with Layers that hang off of the reflecte d layer. However, | 2214 // Reflections are implemented with Layers that hang off of the reflecte d layer. However, |
2200 // the reflection layer subtree does not include the subtree of the pare nt Layer, so | 2215 // the reflection layer subtree does not include the subtree of the pare nt Layer, so |
2201 // a recursive computation of stacking children yields no results. This breaks cases when there are stacking | 2216 // a recursive computation of stacking children yields no results. This breaks cases when there are stacking |
2202 // children of the parent, that need to be included in reflected composi ted bounds. | 2217 // children of the parent, that need to be included in reflected composi ted bounds. |
2203 // Fix this by including composited bounds of stacking children of the r eflected Layer. | 2218 // Fix this by including composited bounds of stacking children of the r eflected Layer. |
2204 if (hasCompositedDeprecatedPaintLayerMapping() && parent() && parent()-> reflectionInfo() && parent()->reflectionInfo()->reflectionLayer() == this) | 2219 if (hasCompositedDeprecatedPaintLayerMapping() && parent() && parent()-> reflectionInfo() && parent()->reflectionInfo()->reflectionLayer() == this) |
2205 expandRectForReflectionAndStackingChildren(parent(), result); | 2220 expandRectForReflectionAndStackingChildren(parent(), result); |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2328 return m_compositedDeprecatedPaintLayerMapping && m_compositedDeprecatedPain tLayerMapping->hasMaskLayer(); | 2343 return m_compositedDeprecatedPaintLayerMapping && m_compositedDeprecatedPain tLayerMapping->hasMaskLayer(); |
2329 } | 2344 } |
2330 | 2345 |
2331 bool DeprecatedPaintLayer::hasCompositedClippingMask() const | 2346 bool DeprecatedPaintLayer::hasCompositedClippingMask() const |
2332 { | 2347 { |
2333 return m_compositedDeprecatedPaintLayerMapping && m_compositedDeprecatedPain tLayerMapping->hasChildClippingMaskLayer(); | 2348 return m_compositedDeprecatedPaintLayerMapping && m_compositedDeprecatedPain tLayerMapping->hasChildClippingMaskLayer(); |
2334 } | 2349 } |
2335 | 2350 |
2336 bool DeprecatedPaintLayer::paintsWithTransform(GlobalPaintFlags globalPaintFlags ) const | 2351 bool DeprecatedPaintLayer::paintsWithTransform(GlobalPaintFlags globalPaintFlags ) const |
2337 { | 2352 { |
2353 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) | |
2354 return hasTransformRelatedProperty(); | |
2355 | |
2338 return (transform() || layoutObject()->style()->position() == FixedPosition) && ((globalPaintFlags & GlobalPaintFlattenCompositingLayers) || compositingStat e() != PaintsIntoOwnBacking); | 2356 return (transform() || layoutObject()->style()->position() == FixedPosition) && ((globalPaintFlags & GlobalPaintFlattenCompositingLayers) || compositingStat e() != PaintsIntoOwnBacking); |
2339 } | 2357 } |
2340 | 2358 |
2341 bool DeprecatedPaintLayer::backgroundIsKnownToBeOpaqueInRect(const LayoutRect& l ocalRect) const | 2359 bool DeprecatedPaintLayer::backgroundIsKnownToBeOpaqueInRect(const LayoutRect& l ocalRect) const |
2342 { | 2360 { |
2343 if (!isSelfPaintingLayer() && !hasSelfPaintingLayerDescendant()) | 2361 if (!isSelfPaintingLayer() && !hasSelfPaintingLayerDescendant()) |
2344 return false; | 2362 return false; |
2345 | 2363 |
2346 if (paintsWithTransparency(GlobalPaintNormalPhase)) | 2364 if (paintsWithTransparency(GlobalPaintNormalPhase)) |
2347 return false; | 2365 return false; |
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2744 | 2762 |
2745 void showLayerTree(const blink::LayoutObject* layoutObject) | 2763 void showLayerTree(const blink::LayoutObject* layoutObject) |
2746 { | 2764 { |
2747 if (!layoutObject) { | 2765 if (!layoutObject) { |
2748 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n"); | 2766 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n"); |
2749 return; | 2767 return; |
2750 } | 2768 } |
2751 showLayerTree(layoutObject->enclosingLayer()); | 2769 showLayerTree(layoutObject->enclosingLayer()); |
2752 } | 2770 } |
2753 #endif | 2771 #endif |
OLD | NEW |