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 | 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All |
6 * rights reserved. | 6 * rights reserved. |
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. | 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. |
8 * (http://www.torchmobile.com/) | 8 * (http://www.torchmobile.com/) |
9 * Copyright (C) 2011 Google Inc. All rights reserved. | 9 * Copyright (C) 2011 Google Inc. All rights reserved. |
10 * | 10 * |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 | 93 |
94 LayoutObject* parentLayoutObject = this->parentLayoutObject(); | 94 LayoutObject* parentLayoutObject = this->parentLayoutObject(); |
95 if (!parentLayoutObject) | 95 if (!parentLayoutObject) |
96 return false; | 96 return false; |
97 if (!parentLayoutObject->canHaveChildren()) | 97 if (!parentLayoutObject->canHaveChildren()) |
98 return false; | 98 return false; |
99 return m_node->layoutObjectIsNeeded(style()); | 99 return m_node->layoutObjectIsNeeded(style()); |
100 } | 100 } |
101 | 101 |
102 ComputedStyle& LayoutTreeBuilderForElement::style() const { | 102 ComputedStyle& LayoutTreeBuilderForElement::style() const { |
103 if (!m_style) | 103 m_style = |
| 104 m_node->document().getStyleReattachData(*m_node).computedStyle.get(); |
| 105 if (!m_style) { |
| 106 // This should happen in the case of Elements that have CustomStyleCallbacks |
104 m_style = m_node->styleForLayoutObject(); | 107 m_style = m_node->styleForLayoutObject(); |
| 108 } |
105 return *m_style; | 109 return *m_style; |
106 } | 110 } |
107 | 111 |
108 DISABLE_CFI_PERF | 112 DISABLE_CFI_PERF |
109 void LayoutTreeBuilderForElement::createLayoutObject() { | 113 void LayoutTreeBuilderForElement::createLayoutObject() { |
110 ComputedStyle& style = this->style(); | 114 ComputedStyle& style = this->style(); |
111 | 115 |
112 LayoutObject* newLayoutObject = m_node->createLayoutObject(style); | 116 LayoutObject* newLayoutObject = m_node->createLayoutObject(style); |
113 if (!newLayoutObject) | 117 if (!newLayoutObject) |
114 return; | 118 return; |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 m_layoutObjectParent->isInsideFlowThread()); | 171 m_layoutObjectParent->isInsideFlowThread()); |
168 | 172 |
169 LayoutObject* nextLayoutObject = this->nextLayoutObject(); | 173 LayoutObject* nextLayoutObject = this->nextLayoutObject(); |
170 m_node->setLayoutObject(newLayoutObject); | 174 m_node->setLayoutObject(newLayoutObject); |
171 // Parent takes care of the animations, no need to call setAnimatableStyle. | 175 // Parent takes care of the animations, no need to call setAnimatableStyle. |
172 newLayoutObject->setStyle(&style); | 176 newLayoutObject->setStyle(&style); |
173 m_layoutObjectParent->addChild(newLayoutObject, nextLayoutObject); | 177 m_layoutObjectParent->addChild(newLayoutObject, nextLayoutObject); |
174 } | 178 } |
175 | 179 |
176 } // namespace blink | 180 } // namespace blink |
OLD | NEW |