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

Side by Side Diff: Source/core/dom/LayoutTreeBuilder.cpp

Issue 1124993002: Cleanup: Only need one bit (not two) to express flow thread state. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/core/layout/LayoutBlock.cpp » ('j') | Source/core/layout/LayoutObject.h » ('J')
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) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved.
6 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 6 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
7 * Copyright (C) 2011 Google Inc. All rights reserved. 7 * Copyright (C) 2011 Google Inc. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 125
126 LayoutObject* parentLayoutObject = this->parentLayoutObject(); 126 LayoutObject* parentLayoutObject = this->parentLayoutObject();
127 127
128 if (!parentLayoutObject->isChildAllowed(newLayoutObject, style)) { 128 if (!parentLayoutObject->isChildAllowed(newLayoutObject, style)) {
129 newLayoutObject->destroy(); 129 newLayoutObject->destroy();
130 return; 130 return;
131 } 131 }
132 132
133 // Make sure the LayoutObject already knows it is going to be added to a Lay outFlowThread before we set the style 133 // Make sure the LayoutObject already knows it is going to be added to a Lay outFlowThread before we set the style
134 // for the first time. Otherwise code using inLayoutFlowThread() in the styl eWillChange and styleDidChange will fail. 134 // for the first time. Otherwise code using inLayoutFlowThread() in the styl eWillChange and styleDidChange will fail.
135 newLayoutObject->setFlowThreadState(parentLayoutObject->flowThreadState()); 135 newLayoutObject->setIsInsideFlowThread(parentLayoutObject->isInsideFlowThrea d());
136 136
137 LayoutObject* nextLayoutObject = this->nextLayoutObject(); 137 LayoutObject* nextLayoutObject = this->nextLayoutObject();
138 m_node->setLayoutObject(newLayoutObject); 138 m_node->setLayoutObject(newLayoutObject);
139 newLayoutObject->setStyle(&style); // setStyle() can depend on layoutObject( ) already being set. 139 newLayoutObject->setStyle(&style); // setStyle() can depend on layoutObject( ) already being set.
140 140
141 if (Fullscreen::isActiveFullScreenElement(*m_node)) { 141 if (Fullscreen::isActiveFullScreenElement(*m_node)) {
142 newLayoutObject = LayoutFullScreen::wrapLayoutObject(newLayoutObject, pa rentLayoutObject, &m_node->document()); 142 newLayoutObject = LayoutFullScreen::wrapLayoutObject(newLayoutObject, pa rentLayoutObject, &m_node->document());
143 if (!newLayoutObject) 143 if (!newLayoutObject)
144 return; 144 return;
145 } 145 }
(...skipping 10 matching lines...) Expand all
156 ASSERT(m_node->textLayoutObjectIsNeeded(style, *parentLayoutObject)); 156 ASSERT(m_node->textLayoutObjectIsNeeded(style, *parentLayoutObject));
157 157
158 LayoutText* newLayoutObject = m_node->createTextLayoutObject(style); 158 LayoutText* newLayoutObject = m_node->createTextLayoutObject(style);
159 if (!parentLayoutObject->isChildAllowed(newLayoutObject, style)) { 159 if (!parentLayoutObject->isChildAllowed(newLayoutObject, style)) {
160 newLayoutObject->destroy(); 160 newLayoutObject->destroy();
161 return; 161 return;
162 } 162 }
163 163
164 // Make sure the LayoutObject already knows it is going to be added to a Lay outFlowThread before we set the style 164 // Make sure the LayoutObject already knows it is going to be added to a Lay outFlowThread before we set the style
165 // for the first time. Otherwise code using inLayoutFlowThread() in the styl eWillChange and styleDidChange will fail. 165 // for the first time. Otherwise code using inLayoutFlowThread() in the styl eWillChange and styleDidChange will fail.
166 newLayoutObject->setFlowThreadState(parentLayoutObject->flowThreadState()); 166 newLayoutObject->setIsInsideFlowThread(parentLayoutObject->isInsideFlowThrea d());
167 167
168 LayoutObject* nextLayoutObject = this->nextLayoutObject(); 168 LayoutObject* nextLayoutObject = this->nextLayoutObject();
169 m_node->setLayoutObject(newLayoutObject); 169 m_node->setLayoutObject(newLayoutObject);
170 // Parent takes care of the animations, no need to call setAnimatableStyle. 170 // Parent takes care of the animations, no need to call setAnimatableStyle.
171 newLayoutObject->setStyle(&style); 171 newLayoutObject->setStyle(&style);
172 parentLayoutObject->addChild(newLayoutObject, nextLayoutObject); 172 parentLayoutObject->addChild(newLayoutObject, nextLayoutObject);
173 } 173 }
174 174
175 } 175 }
OLDNEW
« no previous file with comments | « no previous file | Source/core/layout/LayoutBlock.cpp » ('j') | Source/core/layout/LayoutObject.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698