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

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
« 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 50a63a3e6fb39273db67ebc6f3932bc0193f7759..2fc3379a46ff90f595f49f1a08cf23432c6f01ef 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"
@@ -891,10 +892,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());
@@ -911,6 +917,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