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 17 matching lines...) Expand all Loading... |
28 | 28 |
29 #include "core/HTMLNames.h" | 29 #include "core/HTMLNames.h" |
30 #include "core/SVGNames.h" | 30 #include "core/SVGNames.h" |
31 #include "core/css/resolver/StyleResolver.h" | 31 #include "core/css/resolver/StyleResolver.h" |
32 #include "core/dom/FirstLetterPseudoElement.h" | 32 #include "core/dom/FirstLetterPseudoElement.h" |
33 #include "core/dom/Fullscreen.h" | 33 #include "core/dom/Fullscreen.h" |
34 #include "core/dom/Node.h" | 34 #include "core/dom/Node.h" |
35 #include "core/dom/PseudoElement.h" | 35 #include "core/dom/PseudoElement.h" |
36 #include "core/dom/Text.h" | 36 #include "core/dom/Text.h" |
37 #include "core/dom/shadow/InsertionPoint.h" | 37 #include "core/dom/shadow/InsertionPoint.h" |
| 38 #include "core/layout/LayoutFullScreen.h" |
38 #include "core/layout/LayoutObject.h" | 39 #include "core/layout/LayoutObject.h" |
39 #include "core/layout/LayoutText.h" | 40 #include "core/layout/LayoutText.h" |
40 #include "core/layout/LayoutView.h" | 41 #include "core/layout/LayoutView.h" |
41 #include "core/svg/SVGElement.h" | 42 #include "core/svg/SVGElement.h" |
42 #include "platform/RuntimeEnabledFeatures.h" | 43 #include "platform/RuntimeEnabledFeatures.h" |
43 | 44 |
44 namespace blink { | 45 namespace blink { |
45 | 46 |
46 LayoutTreeBuilderForElement::LayoutTreeBuilderForElement(Element& element, Compu
tedStyle* style) | 47 LayoutTreeBuilderForElement::LayoutTreeBuilderForElement(Element& element, Compu
tedStyle* style) |
47 : LayoutTreeBuilder(element, nullptr) | 48 : LayoutTreeBuilder(element, nullptr) |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 } | 129 } |
129 | 130 |
130 // Make sure the LayoutObject already knows it is going to be added to a Lay
outFlowThread before we set the style | 131 // Make sure the LayoutObject already knows it is going to be added to a Lay
outFlowThread before we set the style |
131 // for the first time. Otherwise code using inLayoutFlowThread() in the styl
eWillChange and styleDidChange will fail. | 132 // for the first time. Otherwise code using inLayoutFlowThread() in the styl
eWillChange and styleDidChange will fail. |
132 newLayoutObject->setIsInsideFlowThread(parentLayoutObject->isInsideFlowThrea
d()); | 133 newLayoutObject->setIsInsideFlowThread(parentLayoutObject->isInsideFlowThrea
d()); |
133 | 134 |
134 LayoutObject* nextLayoutObject = this->nextLayoutObject(); | 135 LayoutObject* nextLayoutObject = this->nextLayoutObject(); |
135 m_node->setLayoutObject(newLayoutObject); | 136 m_node->setLayoutObject(newLayoutObject); |
136 newLayoutObject->setStyle(&style); // setStyle() can depend on layoutObject(
) already being set. | 137 newLayoutObject->setStyle(&style); // setStyle() can depend on layoutObject(
) already being set. |
137 | 138 |
| 139 if (Fullscreen::isActiveFullScreenElement(*m_node)) { |
| 140 newLayoutObject = LayoutFullScreen::wrapLayoutObject(newLayoutObject, pa
rentLayoutObject, &m_node->document()); |
| 141 if (!newLayoutObject) |
| 142 return; |
| 143 } |
| 144 |
138 // 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. |
139 parentLayoutObject->addChild(newLayoutObject, nextLayoutObject); | 146 parentLayoutObject->addChild(newLayoutObject, nextLayoutObject); |
140 } | 147 } |
141 | 148 |
142 void LayoutTreeBuilderForText::createLayoutObject() | 149 void LayoutTreeBuilderForText::createLayoutObject() |
143 { | 150 { |
144 ComputedStyle& style = m_layoutObjectParent->mutableStyleRef(); | 151 ComputedStyle& style = m_layoutObjectParent->mutableStyleRef(); |
145 | 152 |
146 ASSERT(m_node->textLayoutObjectIsNeeded(style, *m_layoutObjectParent)); | 153 ASSERT(m_node->textLayoutObjectIsNeeded(style, *m_layoutObjectParent)); |
147 | 154 |
148 LayoutText* newLayoutObject = m_node->createTextLayoutObject(style); | 155 LayoutText* newLayoutObject = m_node->createTextLayoutObject(style); |
149 if (!m_layoutObjectParent->isChildAllowed(newLayoutObject, style)) { | 156 if (!m_layoutObjectParent->isChildAllowed(newLayoutObject, style)) { |
150 newLayoutObject->destroy(); | 157 newLayoutObject->destroy(); |
151 return; | 158 return; |
152 } | 159 } |
153 | 160 |
154 // Make sure the LayoutObject already knows it is going to be added to a Lay
outFlowThread before we set the style | 161 // Make sure the LayoutObject already knows it is going to be added to a Lay
outFlowThread before we set the style |
155 // for the first time. Otherwise code using inLayoutFlowThread() in the styl
eWillChange and styleDidChange will fail. | 162 // for the first time. Otherwise code using inLayoutFlowThread() in the styl
eWillChange and styleDidChange will fail. |
156 newLayoutObject->setIsInsideFlowThread(m_layoutObjectParent->isInsideFlowThr
ead()); | 163 newLayoutObject->setIsInsideFlowThread(m_layoutObjectParent->isInsideFlowThr
ead()); |
157 | 164 |
158 LayoutObject* nextLayoutObject = this->nextLayoutObject(); | 165 LayoutObject* nextLayoutObject = this->nextLayoutObject(); |
159 m_node->setLayoutObject(newLayoutObject); | 166 m_node->setLayoutObject(newLayoutObject); |
160 // Parent takes care of the animations, no need to call setAnimatableStyle. | 167 // Parent takes care of the animations, no need to call setAnimatableStyle. |
161 newLayoutObject->setStyle(&style); | 168 newLayoutObject->setStyle(&style); |
162 m_layoutObjectParent->addChild(newLayoutObject, nextLayoutObject); | 169 m_layoutObjectParent->addChild(newLayoutObject, nextLayoutObject); |
163 } | 170 } |
164 | 171 |
165 } | 172 } |
OLD | NEW |