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 if (!m_style) { |
104 m_style = m_node->styleForLayoutObject(); | 104 if (m_node->hasCustomStyleCallbacks()) { |
| 105 m_style = m_node->styleForLayoutObject(); |
| 106 } |
| 107 else { |
| 108 m_style = m_node->document().getStyleReattachData(*m_node).computedStyle.g
et(); |
| 109 } |
| 110 } |
| 111 DCHECK(m_style); |
105 return *m_style; | 112 return *m_style; |
106 } | 113 } |
107 | 114 |
108 DISABLE_CFI_PERF | 115 DISABLE_CFI_PERF |
109 void LayoutTreeBuilderForElement::createLayoutObject() { | 116 void LayoutTreeBuilderForElement::createLayoutObject() { |
110 ComputedStyle& style = this->style(); | 117 ComputedStyle& style = this->style(); |
111 | 118 |
112 LayoutObject* newLayoutObject = m_node->createLayoutObject(style); | 119 LayoutObject* newLayoutObject = m_node->createLayoutObject(style); |
113 if (!newLayoutObject) | 120 if (!newLayoutObject) |
114 return; | 121 return; |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 m_layoutObjectParent->isInsideFlowThread()); | 174 m_layoutObjectParent->isInsideFlowThread()); |
168 | 175 |
169 LayoutObject* nextLayoutObject = this->nextLayoutObject(); | 176 LayoutObject* nextLayoutObject = this->nextLayoutObject(); |
170 m_node->setLayoutObject(newLayoutObject); | 177 m_node->setLayoutObject(newLayoutObject); |
171 // Parent takes care of the animations, no need to call setAnimatableStyle. | 178 // Parent takes care of the animations, no need to call setAnimatableStyle. |
172 newLayoutObject->setStyle(&style); | 179 newLayoutObject->setStyle(&style); |
173 m_layoutObjectParent->addChild(newLayoutObject, nextLayoutObject); | 180 m_layoutObjectParent->addChild(newLayoutObject, nextLayoutObject); |
174 } | 181 } |
175 | 182 |
176 } // namespace blink | 183 } // namespace blink |
OLD | NEW |