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

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

Issue 2892593004: Only adjust composited pagination position to account for lines offset of inlines. (Closed)
Patch Set: try this 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
« no previous file with comments | « third_party/WebKit/LayoutTests/paint/pagination/composited-paginated-outlined-box-expected.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 5fb632f3340bba1fa95377e07e6af8f1517f8c82..d897302ced4126b0e0c8afb0eba6b62099c36b90 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"
@@ -885,10 +886,15 @@ 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()).FirstLineBoxTopLeft();
+ }
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());
@@ -905,6 +911,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);
« no previous file with comments | « third_party/WebKit/LayoutTests/paint/pagination/composited-paginated-outlined-box-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698