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

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

Issue 2738943004: Fix position of composited, paginated inlines. (Closed)
Patch Set: none Created 3 years, 9 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 3e727a9fa52cdbbc5555336d773a389605033895..67c1c3647d5e8f310e76be282c099d4e1f4bd8b0 100644
--- a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
+++ b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
@@ -805,12 +805,20 @@ static IntRect clipBox(LayoutBox& layoutObject) {
static LayoutPoint computeOffsetFromCompositedAncestor(
const PaintLayer* layer,
- const PaintLayer* compositedAncestor) {
- LayoutPoint offset = layer->visualOffsetFromAncestor(compositedAncestor);
+ const PaintLayer* compositedAncestor,
+ const LayoutPoint offsetFromPaintLayer) {
trchen 2017/03/09 23:41:16 const LayoutPoint localRepresentativePointForFragm
chrishtr 2017/03/10 01:50:04 Done.
+ // Add in the offset of the composited bounds from the coordinate space of
+ // the PaintLayer, since visualOffsetFromAncestor() requires the pre-offset
+ // input to be in the space of the PaintLayer. We also need to add in this
+ // offset before computation of visualOffsetFromAncestor(), because it affects
+ // fragmentation offset if compositedAncestor crosses a pagination boundary.
trchen 2017/03/09 23:41:16 // Currently visual fragmentation for composited l
chrishtr 2017/03/10 01:50:04 Done.
+ LayoutPoint offset =
+ layer->visualOffsetFromAncestor(compositedAncestor, offsetFromPaintLayer);
if (compositedAncestor)
offset.move(compositedAncestor->compositedLayerMapping()
->owningLayer()
.subpixelAccumulation());
+ offset.moveBy(-offsetFromPaintLayer);
return offset;
}
@@ -821,8 +829,8 @@ void CompositedLayerMapping::computeBoundsOfOwningLayer(
LayoutPoint& offsetFromCompositedAncestor,
IntPoint& snappedOffsetFromCompositedAncestor) {
LayoutRect localRawCompositingBounds = compositedBounds();
- offsetFromCompositedAncestor =
- computeOffsetFromCompositedAncestor(&m_owningLayer, compositedAncestor);
+ offsetFromCompositedAncestor = computeOffsetFromCompositedAncestor(
+ &m_owningLayer, compositedAncestor, localRawCompositingBounds.location());
snappedOffsetFromCompositedAncestor =
IntPoint(offsetFromCompositedAncestor.x().round(),
offsetFromCompositedAncestor.y().round());

Powered by Google App Engine
This is Rietveld 408576698