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

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

Issue 1896803002: Fix TextAutosizer not to scheduleRelayout() by MarkContainerChainInLayout (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert RELEASE_ASSERT Created 4 years, 8 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 730 matching lines...) Expand 10 before | Expand all | Expand 10 after
741 // this object breaks across columns). Spanners may also have been added or removed since the 741 // this object breaks across columns). Spanners may also have been added or removed since the
742 // previous layout pass, which is just another way of affecting the column h eights (and the 742 // previous layout pass, which is just another way of affecting the column h eights (and the
743 // number of rows). Instead of identifying cases where it's safe to allow re layout roots, just 743 // number of rows). Instead of identifying cases where it's safe to allow re layout roots, just
744 // disallow them inside multicol. 744 // disallow them inside multicol.
745 if (object->isInsideFlowThread()) 745 if (object->isInsideFlowThread())
746 return false; 746 return false;
747 747
748 return true; 748 return true;
749 } 749 }
750 750
751 void LayoutObject::markContainerChainForLayout(bool scheduleRelayout)
752 {
753 markContainerChainForLayout(scheduleRelayout, nullptr);
754 }
755
756 void LayoutObject::markContainerChainForLayout(SubtreeLayoutScope* layouter)
757 {
758 // When we have a layouter, it means that we're in layout and we're marking
759 // a descendant as needing layout with the intention of visiting it during
760 // this layout. We shouldn't be scheduling it to be laid out later.
761 markContainerChainForLayout(!layouter, layouter);
762 }
763
764 void LayoutObject::markContainerChainForLayout(bool scheduleRelayout, SubtreeLay outScope* layouter) 751 void LayoutObject::markContainerChainForLayout(bool scheduleRelayout, SubtreeLay outScope* layouter)
765 { 752 {
766 ASSERT(!isSetNeedsLayoutForbidden()); 753 ASSERT(!isSetNeedsLayoutForbidden());
767 ASSERT(!layouter || this != layouter->root()); 754 ASSERT(!layouter || this != layouter->root());
755 // When we have a layouter, it means that we're in layout and we're marking
756 // a descendant as needing layout with the intention of visiting it during
757 // this layout. We shouldn't be scheduling it to be laid out later.
768 ASSERT(!scheduleRelayout || !layouter); 758 ASSERT(!scheduleRelayout || !layouter);
769 759
770 LayoutObject* object = container(); 760 LayoutObject* object = container();
771 LayoutObject* last = this; 761 LayoutObject* last = this;
772 762
773 bool simplifiedNormalFlowLayout = needsSimplifiedNormalFlowLayout() && !self NeedsLayout() && !normalChildNeedsLayout(); 763 bool simplifiedNormalFlowLayout = needsSimplifiedNormalFlowLayout() && !self NeedsLayout() && !normalChildNeedsLayout();
774 764
775 while (object) { 765 while (object) {
776 if (object->selfNeedsLayout()) 766 if (object->selfNeedsLayout())
777 return; 767 return;
(...skipping 2917 matching lines...) Expand 10 before | Expand all | Expand 10 after
3695 const blink::LayoutObject* root = object1; 3685 const blink::LayoutObject* root = object1;
3696 while (root->parent()) 3686 while (root->parent())
3697 root = root->parent(); 3687 root = root->parent();
3698 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); 3688 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0);
3699 } else { 3689 } else {
3700 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); 3690 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n");
3701 } 3691 }
3702 } 3692 }
3703 3693
3704 #endif 3694 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutObject.h ('k') | third_party/WebKit/Source/core/layout/TextAutosizer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698