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