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

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

Issue 1887933002: (CANCELED) Fix TextAutosizer not to scheduleRelayout() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: simplifiedLayout 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) 2007 David Smith (catfish.man@gmail.com) 4 * (C) 2007 David Smith (catfish.man@gmail.com)
5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 1023 matching lines...) Expand 10 before | Expand all | Expand 10 after
1034 for (LayoutBox* box = firstChildBox(); box; box = box->nextSiblingBox()) { 1034 for (LayoutBox* box = firstChildBox(); box; box = box->nextSiblingBox()) {
1035 if (!box->isOutOfFlowPositioned()) { 1035 if (!box->isOutOfFlowPositioned()) {
1036 if (box->isLayoutMultiColumnSpannerPlaceholder()) 1036 if (box->isLayoutMultiColumnSpannerPlaceholder())
1037 toLayoutMultiColumnSpannerPlaceholder(box)->markForLayoutIfO bjectInFlowThreadNeedsLayout(); 1037 toLayoutMultiColumnSpannerPlaceholder(box)->markForLayoutIfO bjectInFlowThreadNeedsLayout();
1038 box->layoutIfNeeded(); 1038 box->layoutIfNeeded();
1039 } 1039 }
1040 } 1040 }
1041 } 1041 }
1042 } 1042 }
1043 1043
1044 bool LayoutBlock::simplifiedLayout() 1044 bool LayoutBlock::simplifiedLayout(SubtreeLayoutScope* layouter)
1045 { 1045 {
1046 // Check if we need to do a full layout. 1046 // Check if we need to do a full layout.
1047 if (normalChildNeedsLayout() || selfNeedsLayout()) 1047 if (normalChildNeedsLayout() || selfNeedsLayout())
1048 return false; 1048 return false;
1049 1049
1050 // Check that we actually need to do a simplified layout. 1050 // Check that we actually need to do a simplified layout.
1051 if (!posChildNeedsLayout() && !(needsSimplifiedNormalFlowLayout() || needsPo sitionedMovementLayout())) 1051 if (!posChildNeedsLayout() && !(needsSimplifiedNormalFlowLayout() || needsPo sitionedMovementLayout()))
1052 return false; 1052 return false;
1053 1053
1054 { 1054 {
1055 // LayoutState needs this deliberate scope to pop before paint invalidat ion. 1055 // LayoutState needs this deliberate scope to pop before paint invalidat ion.
1056 LayoutState state(*this, locationOffset()); 1056 LayoutState state(*this, locationOffset());
1057 1057
1058 if (needsPositionedMovementLayout() && !tryLayoutDoingPositionedMovement Only()) 1058 if (needsPositionedMovementLayout() && !tryLayoutDoingPositionedMovement Only())
1059 return false; 1059 return false;
1060 1060
1061 if (LayoutFlowThread* flowThread = flowThreadContainingBlock()) { 1061 if (LayoutFlowThread* flowThread = flowThreadContainingBlock()) {
1062 if (!flowThread->canSkipLayout(*this)) 1062 if (!flowThread->canSkipLayout(*this))
1063 return false; 1063 return false;
1064 } 1064 }
1065 1065
1066 TextAutosizer::LayoutScope textAutosizerLayoutScope(this); 1066 TextAutosizer::LayoutScope textAutosizerLayoutScope(this, layouter);
1067 1067
1068 // Lay out positioned descendants or objects that just need to recompute overflow. 1068 // Lay out positioned descendants or objects that just need to recompute overflow.
1069 if (needsSimplifiedNormalFlowLayout()) 1069 if (needsSimplifiedNormalFlowLayout())
1070 simplifiedNormalFlowLayout(); 1070 simplifiedNormalFlowLayout();
1071 1071
1072 // Lay out our positioned objects if our positioned child bit is set. 1072 // Lay out our positioned objects if our positioned child bit is set.
1073 // Also, if an absolute position element inside a relative positioned co ntainer moves, and the absolute element has a fixed position 1073 // Also, if an absolute position element inside a relative positioned co ntainer moves, and the absolute element has a fixed position
1074 // child, neither the fixed element nor its container learn of the movem ent since posChildNeedsLayout() is only marked as far as the 1074 // child, neither the fixed element nor its container learn of the movem ent since posChildNeedsLayout() is only marked as far as the
1075 // relative positioned container. So if we can have fixed pos objects in our positioned objects list check if any of them 1075 // relative positioned container. So if we can have fixed pos objects in our positioned objects list check if any of them
1076 // are statically positioned and thus need to move with their absolute a ncestors. 1076 // are statically positioned and thus need to move with their absolute a ncestors.
(...skipping 1756 matching lines...) Expand 10 before | Expand all | Expand 10 after
2833 void LayoutBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Layout Object* obj) const 2833 void LayoutBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Layout Object* obj) const
2834 { 2834 {
2835 showLayoutObject(); 2835 showLayoutObject();
2836 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box()) 2836 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box())
2837 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1); 2837 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1);
2838 } 2838 }
2839 2839
2840 #endif 2840 #endif
2841 2841
2842 } // namespace blink 2842 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698