Chromium Code Reviews| Index: third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp |
| diff --git a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp |
| index b938ccffbe207cb53c29ea507fcb973da2d904a8..3cc9f55079373cb20da029a5340113d05db1564a 100644 |
| --- a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp |
| +++ b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp |
| @@ -41,6 +41,7 @@ |
| #include "core/layout/LayoutEmbeddedObject.h" |
| #include "core/layout/LayoutHTMLCanvas.h" |
| #include "core/layout/LayoutImage.h" |
| +#include "core/layout/LayoutInline.h" |
| #include "core/layout/LayoutPart.h" |
| #include "core/layout/LayoutVideo.h" |
| #include "core/layout/LayoutView.h" |
| @@ -884,10 +885,17 @@ void CompositedLayerMapping::ComputeBoundsOfOwningLayer( |
| IntRect& compositing_bounds_relative_to_composited_ancestor, |
| LayoutPoint& offset_from_composited_ancestor, |
| IntPoint& snapped_offset_from_composited_ancestor) { |
| - LayoutRect local_raw_compositing_bounds = CompositedBounds(); |
| + // HACK(chrishtr): adjust for position of inlines. |
| + LayoutPoint local_representative_point_for_fragmentation; |
| + if (owning_layer_.GetLayoutObject().IsLayoutInline()) { |
| + local_representative_point_for_fragmentation = |
| + ToLayoutInline(owning_layer_.GetLayoutObject()) |
| + .LinesVisualOverflowBoundingBox() |
|
trchen
2017/05/16 23:26:47
LinesVisualOverflowBoundingBox can be expensive (h
chrishtr
2017/05/17 02:00:14
Done, good idea.
|
| + .Location(); |
| + } |
| offset_from_composited_ancestor = ComputeOffsetFromCompositedAncestor( |
| &owning_layer_, composited_ancestor, |
| - local_raw_compositing_bounds.Location()); |
| + local_representative_point_for_fragmentation); |
| snapped_offset_from_composited_ancestor = |
| IntPoint(offset_from_composited_ancestor.X().Round(), |
| offset_from_composited_ancestor.Y().Round()); |
| @@ -904,6 +912,7 @@ void CompositedLayerMapping::ComputeBoundsOfOwningLayer( |
| // Move the bounds by the subpixel accumulation so that it pixel-snaps |
| // relative to absolute pixels instead of local coordinates. |
| + LayoutRect local_raw_compositing_bounds = CompositedBounds(); |
| local_raw_compositing_bounds.Move(subpixel_accumulation); |
| local_bounds = PixelSnappedIntRect(local_raw_compositing_bounds); |