Chromium Code Reviews| Index: Source/core/paint/DeprecatedPaintLayer.cpp |
| diff --git a/Source/core/paint/DeprecatedPaintLayer.cpp b/Source/core/paint/DeprecatedPaintLayer.cpp |
| index 561020b810667e0304e8f6c13af08d4f3a715cec..930d82e1f41faf38494796518af146967a59a707 100644 |
| --- a/Source/core/paint/DeprecatedPaintLayer.cpp |
| +++ b/Source/core/paint/DeprecatedPaintLayer.cpp |
| @@ -711,6 +711,19 @@ bool DeprecatedPaintLayer::update3DTransformedDescendantStatus() |
| return has3DTransform(); |
| } |
| +LayoutPoint DeprecatedPaintLayer::locationExcludeOverflowScroll() const |
| +{ |
| + // Our m_location already has scroll offset baked-in. We have to revert it here. |
|
pdr.
2015/09/08 04:23:53
Ok, lets keep this and LocationQueryBehavior bug l
trchen
2015/09/15 04:48:40
Done.
|
| + IntSize scrollOffset; |
| + if (DeprecatedPaintLayer* positionedParent = layoutObject()->isOutOfFlowPositioned() ? enclosingPositionedAncestor() : nullptr) { |
|
pdr.
2015/09/08 04:23:53
Nit: temporary code, but can we rewrite it like so
trchen
2015/09/15 04:48:40
Done.
|
| + if (positionedParent->layoutObject()->hasOverflowClip()) |
| + scrollOffset = positionedParent->layoutBox()->scrolledContentOffset(); |
| + } else if (parent() && parent()->layoutObject()->hasOverflowClip()) { |
| + scrollOffset = parent()->layoutBox()->scrolledContentOffset(); |
| + } |
| + return m_location + LayoutSize(scrollOffset); |
| +} |
| + |
| bool DeprecatedPaintLayer::updateLayerPosition() |
| { |
| LayoutPoint localPoint; |
| @@ -1244,7 +1257,7 @@ void DeprecatedPaintLayer::insertOnlyThisLayer() |
| } |
| // Returns the layer reached on the walk up towards the ancestor. |
| -static inline const DeprecatedPaintLayer* accumulateOffsetTowardsAncestor(const DeprecatedPaintLayer* layer, const DeprecatedPaintLayer* ancestorLayer, LayoutPoint& location) |
| +static inline const DeprecatedPaintLayer* accumulateOffsetTowardsAncestor(const DeprecatedPaintLayer* layer, const DeprecatedPaintLayer* ancestorLayer, LayoutPoint& location, DeprecatedPaintLayer::LocationQueryBehavior behavior) |
| { |
| ASSERT(ancestorLayer != layer); |
| @@ -1269,10 +1282,10 @@ static inline const DeprecatedPaintLayer* accumulateOffsetTowardsAncestor(const |
| // of both relative to the container and subtract. |
| LayoutPoint thisCoords; |
| - layer->convertToLayerCoords(parentLayer, thisCoords); |
| + layer->convertToLayerCoords(parentLayer, thisCoords, behavior); |
| LayoutPoint ancestorCoords; |
| - ancestorLayer->convertToLayerCoords(parentLayer, ancestorCoords); |
| + ancestorLayer->convertToLayerCoords(parentLayer, ancestorCoords, behavior); |
| location += (thisCoords - ancestorCoords); |
| return ancestorLayer; |
| @@ -1289,18 +1302,18 @@ static inline const DeprecatedPaintLayer* accumulateOffsetTowardsAncestor(const |
| if (!parentLayer) |
| return nullptr; |
| - location += layer->location(); |
| + location += layer->location(behavior); |
| return parentLayer; |
| } |
| -void DeprecatedPaintLayer::convertToLayerCoords(const DeprecatedPaintLayer* ancestorLayer, LayoutPoint& location) const |
| +void DeprecatedPaintLayer::convertToLayerCoords(const DeprecatedPaintLayer* ancestorLayer, LayoutPoint& location, LocationQueryBehavior behavior) const |
| { |
| if (ancestorLayer == this) |
| return; |
| const DeprecatedPaintLayer* currLayer = this; |
| while (currLayer && currLayer != ancestorLayer) |
| - currLayer = accumulateOffsetTowardsAncestor(currLayer, ancestorLayer, location); |
| + currLayer = accumulateOffsetTowardsAncestor(currLayer, ancestorLayer, location, behavior); |
| } |
| void DeprecatedPaintLayer::convertToLayerCoords(const DeprecatedPaintLayer* ancestorLayer, LayoutRect& rect) const |
| @@ -2333,6 +2346,9 @@ bool DeprecatedPaintLayer::hasCompositedClippingMask() const |
| bool DeprecatedPaintLayer::paintsWithTransform(GlobalPaintFlags globalPaintFlags) const |
| { |
| + if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) |
| + return hasTransformRelatedProperty(); |
| + |
| return (transform() || layoutObject()->style()->position() == FixedPosition) && ((globalPaintFlags & GlobalPaintFlattenCompositingLayers) || compositingState() != PaintsIntoOwnBacking); |
| } |