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

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: 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);
kojii 2016/04/18 06:32:28 Should we make this RELEASE_ASSERT()?
cbiesinger 2016/04/18 15:53:46 I don't really see value in that. The more interes
kojii 2016/04/19 06:39:08 It doesn't always crash, bug 600998 was unable to
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;
778 768
(...skipping 2902 matching lines...) Expand 10 before | Expand all | Expand 10 after
3681 const blink::LayoutObject* root = object1; 3671 const blink::LayoutObject* root = object1;
3682 while (root->parent()) 3672 while (root->parent())
3683 root = root->parent(); 3673 root = root->parent();
3684 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); 3674 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0);
3685 } else { 3675 } else {
3686 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); 3676 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n");
3687 } 3677 }
3688 } 3678 }
3689 3679
3690 #endif 3680 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698