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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutObject.cpp

Issue 1955073002: LayoutObject::paintingLayer() to correctly handle column-span:all (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv ed. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv ed.
7 * Copyright (C) 2009 Google Inc. All rights reserved. 7 * Copyright (C) 2009 Google Inc. All rights reserved.
8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after
608 // Step 4: If |checkParent| is set, climb up to our parent and check its sib lings that 608 // Step 4: If |checkParent| is set, climb up to our parent and check its sib lings that
609 // follow us to see if we can locate a layer. 609 // follow us to see if we can locate a layer.
610 if (checkParent && parent()) 610 if (checkParent && parent())
611 return parent()->findNextLayer(parentLayer, this, true); 611 return parent()->findNextLayer(parentLayer, this, true);
612 612
613 return nullptr; 613 return nullptr;
614 } 614 }
615 615
616 PaintLayer* LayoutObject::enclosingLayer() const 616 PaintLayer* LayoutObject::enclosingLayer() const
617 { 617 {
618 for (const LayoutObject* current = this; current; current = current->parent( )) { 618 for (const LayoutObject* current = this; current; current = current->isColum nSpanAll() ? current->spannerPlaceholder() : current->parent()) {
619 if (current->hasLayer()) 619 if (current->hasLayer())
620 return toLayoutBoxModelObject(current)->layer(); 620 return toLayoutBoxModelObject(current)->layer();
621 } 621 }
622 // FIXME: we should get rid of detached layout subtrees, at which point this code should 622 // FIXME: we should get rid of detached layout subtrees, at which point this code should
623 // not be reached. crbug.com/411429 623 // not be reached. crbug.com/411429
624 return nullptr; 624 return nullptr;
625 } 625 }
626 626
627 bool LayoutObject::scrollRectToVisible(const LayoutRect& rect, const ScrollAlign ment& alignX, const ScrollAlignment& alignY, ScrollType scrollType, bool makeVis ibleInVisualViewport) 627 bool LayoutObject::scrollRectToVisible(const LayoutRect& rect, const ScrollAlign ment& alignX, const ScrollAlignment& alignY, ScrollType scrollType, bool makeVis ibleInVisualViewport)
628 { 628 {
(...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after
1238 DisableCompositingQueryAsserts disabler; 1238 DisableCompositingQueryAsserts disabler;
1239 if (const PaintLayer* paintInvalidationLayer = enclosingLayer->enclosing LayerForPaintInvalidationCrossingFrameBoundaries()) 1239 if (const PaintLayer* paintInvalidationLayer = enclosingLayer->enclosing LayerForPaintInvalidationCrossingFrameBoundaries())
1240 paintInvalidationLayer->layoutObject()->invalidateDisplayItemClientO nBacking(displayItemClient, PaintInvalidationFull); 1240 paintInvalidationLayer->layoutObject()->invalidateDisplayItemClientO nBacking(displayItemClient, PaintInvalidationFull);
1241 enclosingLayer->setNeedsRepaint(); 1241 enclosingLayer->setNeedsRepaint();
1242 } 1242 }
1243 } 1243 }
1244 1244
1245 #if ENABLE(ASSERT) 1245 #if ENABLE(ASSERT)
1246 static void assertEnclosingSelfPaintingLayerHasSetNeedsRepaint(const LayoutObjec t& layoutObject) 1246 static void assertEnclosingSelfPaintingLayerHasSetNeedsRepaint(const LayoutObjec t& layoutObject)
1247 { 1247 {
1248 PaintLayer* enclosingSelfPaintingLayer = nullptr; 1248 PaintLayer* enclosingSelfPaintingLayer = layoutObject.enclosingLayer() ? lay outObject.enclosingLayer()->enclosingSelfPaintingLayer() : nullptr;
1249 const LayoutObject* curr = &layoutObject;
1250 while (curr) {
1251 if (curr->hasLayer() && toLayoutBoxModelObject(curr)->hasSelfPaintingLay er()) {
1252 enclosingSelfPaintingLayer = toLayoutBoxModelObject(curr)->layer();
1253 break;
1254 }
1255 // Multi-column spanner is painted by the layer of the multi-column cont ainer instead of
1256 // its enclosing layer (the layer of the multi-column flow thread).
1257 curr = curr->isColumnSpanAll() ? curr->containingBlock() : curr->parent( );
1258 }
1259 ASSERT(!enclosingSelfPaintingLayer || enclosingSelfPaintingLayer->needsRepai nt()); 1249 ASSERT(!enclosingSelfPaintingLayer || enclosingSelfPaintingLayer->needsRepai nt());
1260 } 1250 }
1261 #endif 1251 #endif
1262 1252
1263 void LayoutObject::invalidateDisplayItemClients(const LayoutBoxModelObject& pain tInvalidationContainer, PaintInvalidationReason invalidationReason) const 1253 void LayoutObject::invalidateDisplayItemClients(const LayoutBoxModelObject& pain tInvalidationContainer, PaintInvalidationReason invalidationReason) const
1264 { 1254 {
1265 // It's caller's responsibility to ensure enclosingSelfPaintingLayer's needs Repaint is set. 1255 // It's caller's responsibility to ensure enclosingSelfPaintingLayer's needs Repaint is set.
1266 // Don't set the flag here because getting enclosingSelfPaintLayer has cost and the caller can use 1256 // Don't set the flag here because getting enclosingSelfPaintLayer has cost and the caller can use
1267 // various ways (e.g. PaintInvalidatinState::enclosingSelfPaintingLayer()) t o reduce the cost. 1257 // various ways (e.g. PaintInvalidatinState::enclosingSelfPaintingLayer()) t o reduce the cost.
1268 #if ENABLE(ASSERT) 1258 #if ENABLE(ASSERT)
(...skipping 2437 matching lines...) Expand 10 before | Expand all | Expand 10 after
3706 const blink::LayoutObject* root = object1; 3696 const blink::LayoutObject* root = object1;
3707 while (root->parent()) 3697 while (root->parent())
3708 root = root->parent(); 3698 root = root->parent();
3709 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); 3699 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0);
3710 } else { 3700 } else {
3711 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); 3701 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n");
3712 } 3702 }
3713 } 3703 }
3714 3704
3715 #endif 3705 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698