Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(520)

Unified Diff: third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp

Issue 2883083004: Only adjust composited pagination position to account for lines offset of inlines. (Closed)
Patch Set: none Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..eb785e9d44fb6d6f7c4720d0e19aa07363e6082e 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().IsInline()) {
+ local_representative_point_for_fragmentation =
+ ToLayoutInline(owning_layer_.GetLayoutObject())
+ .LinesVisualOverflowBoundingBox()
+ .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);

Powered by Google App Engine
This is Rietveld 408576698