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

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

Issue 1763343002: Fix SubtreeLayoutScope not to schedule relayout (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2623
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutObject.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 738 matching lines...) Expand 10 before | Expand all | Expand 10 after
749 // this object breaks across columns). Spanners may also have been added or removed since the 749 // this object breaks across columns). Spanners may also have been added or removed since the
750 // previous layout pass, which is just another way of affecting the column h eights (and the 750 // previous layout pass, which is just another way of affecting the column h eights (and the
751 // number of rows). Instead of identifying cases where it's safe to allow re layout roots, just 751 // number of rows). Instead of identifying cases where it's safe to allow re layout roots, just
752 // disallow them inside multicol. 752 // disallow them inside multicol.
753 if (object->isInsideFlowThread()) 753 if (object->isInsideFlowThread())
754 return false; 754 return false;
755 755
756 return true; 756 return true;
757 } 757 }
758 758
759 void LayoutObject::markContainerChainForLayout(bool scheduleRelayout)
760 {
761 markContainerChainForLayout(scheduleRelayout, nullptr);
762 }
763
764 void LayoutObject::markContainerChainForLayout(SubtreeLayoutScope* layouter)
765 {
766 // When we have a layouter, it means that we're in layout and we're marking
767 // a descendant as needing layout with the intention of visiting it during
768 // this layout. We shouldn't be scheduling it to be laid out later.
769 markContainerChainForLayout(!layouter, layouter);
770 }
771
759 void LayoutObject::markContainerChainForLayout(bool scheduleRelayout, SubtreeLay outScope* layouter) 772 void LayoutObject::markContainerChainForLayout(bool scheduleRelayout, SubtreeLay outScope* layouter)
760 { 773 {
761 ASSERT(!isSetNeedsLayoutForbidden()); 774 ASSERT(!isSetNeedsLayoutForbidden());
762 ASSERT(!layouter || this != layouter->root()); 775 ASSERT(!layouter || this != layouter->root());
776 ASSERT(!scheduleRelayout || !layouter);
763 777
764 LayoutObject* object = container(); 778 LayoutObject* object = container();
765 LayoutObject* last = this; 779 LayoutObject* last = this;
766 780
767 bool simplifiedNormalFlowLayout = needsSimplifiedNormalFlowLayout() && !self NeedsLayout() && !normalChildNeedsLayout(); 781 bool simplifiedNormalFlowLayout = needsSimplifiedNormalFlowLayout() && !self NeedsLayout() && !normalChildNeedsLayout();
768 782
769 while (object) { 783 while (object) {
770 if (object->selfNeedsLayout()) 784 if (object->selfNeedsLayout())
771 return; 785 return;
772 786
(...skipping 2742 matching lines...) Expand 10 before | Expand all | Expand 10 after
3515 const blink::LayoutObject* root = object1; 3529 const blink::LayoutObject* root = object1;
3516 while (root->parent()) 3530 while (root->parent())
3517 root = root->parent(); 3531 root = root->parent();
3518 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); 3532 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0);
3519 } else { 3533 } else {
3520 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); 3534 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n");
3521 } 3535 }
3522 } 3536 }
3523 3537
3524 #endif 3538 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutObject.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698