Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 141 if (!newLayoutObject) | 141 if (!newLayoutObject) |
| 142 return; | 142 return; |
| 143 } | 143 } |
| 144 | 144 |
| 145 // Note: Adding newLayoutObject instead of layoutObject(). layoutObject() ma y be a child of newLayoutObject. | 145 // Note: Adding newLayoutObject instead of layoutObject(). layoutObject() ma y be a child of newLayoutObject. |
| 146 parentLayoutObject->addChild(newLayoutObject, nextLayoutObject); | 146 parentLayoutObject->addChild(newLayoutObject, nextLayoutObject); |
| 147 } | 147 } |
| 148 | 148 |
| 149 void LayoutTreeBuilderForText::createLayoutObject() | 149 void LayoutTreeBuilderForText::createLayoutObject() |
| 150 { | 150 { |
| 151 ComputedStyle& style = m_layoutObjectParent->mutableStyleRef(); | 151 const ComputedStyle& parentStyle = m_layoutObjectParent->styleRef(); |
| 152 RefPtr<ComputedStyle> style = ComputedStyle::createWithInheritableProperties (parentStyle); | |
|
leviw_travelin_and_unemployed
2015/05/29 17:44:52
Have you ran the perf tests? I wonder if this allo
| |
| 152 | 153 |
| 153 ASSERT(m_node->textLayoutObjectIsNeeded(style, *m_layoutObjectParent)); | 154 ASSERT(m_node->textLayoutObjectIsNeeded(*style, *m_layoutObjectParent)); |
| 154 | 155 |
| 155 LayoutText* newLayoutObject = m_node->createTextLayoutObject(style); | 156 LayoutText* newLayoutObject = m_node->createTextLayoutObject(parentStyle); |
| 156 if (!m_layoutObjectParent->isChildAllowed(newLayoutObject, style)) { | 157 if (!m_layoutObjectParent->isChildAllowed(newLayoutObject, *style)) { |
| 157 newLayoutObject->destroy(); | 158 newLayoutObject->destroy(); |
| 158 return; | 159 return; |
| 159 } | 160 } |
| 160 | 161 |
| 161 // Make sure the LayoutObject already knows it is going to be added to a Lay outFlowThread before we set the style | 162 // Make sure the LayoutObject already knows it is going to be added to a Lay outFlowThread before we set the style |
| 162 // for the first time. Otherwise code using inLayoutFlowThread() in the styl eWillChange and styleDidChange will fail. | 163 // for the first time. Otherwise code using inLayoutFlowThread() in the styl eWillChange and styleDidChange will fail. |
| 163 newLayoutObject->setIsInsideFlowThread(m_layoutObjectParent->isInsideFlowThr ead()); | 164 newLayoutObject->setIsInsideFlowThread(m_layoutObjectParent->isInsideFlowThr ead()); |
| 164 | 165 |
| 165 LayoutObject* nextLayoutObject = this->nextLayoutObject(); | 166 LayoutObject* nextLayoutObject = this->nextLayoutObject(); |
| 166 m_node->setLayoutObject(newLayoutObject); | 167 m_node->setLayoutObject(newLayoutObject); |
| 167 // Parent takes care of the animations, no need to call setAnimatableStyle. | 168 newLayoutObject->setStyle(style); |
| 168 newLayoutObject->setStyle(&style); | |
| 169 m_layoutObjectParent->addChild(newLayoutObject, nextLayoutObject); | 169 m_layoutObjectParent->addChild(newLayoutObject, nextLayoutObject); |
| 170 } | 170 } |
| 171 | 171 |
| 172 } | 172 } |
| OLD | NEW |