Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(276)

Side by Side Diff: third_party/WebKit/Source/core/dom/LayoutTreeBuilder.cpp

Issue 2168373002: Revert of Reland "Implement FullScreen using top layer." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: resolve WebFrameTest.cpp conflict and appease presubmit Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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"
37 #include "core/layout/LayoutObject.h" 38 #include "core/layout/LayoutObject.h"
38 #include "core/layout/LayoutText.h" 39 #include "core/layout/LayoutText.h"
39 #include "core/layout/LayoutView.h" 40 #include "core/layout/LayoutView.h"
40 #include "core/svg/SVGElement.h" 41 #include "core/svg/SVGElement.h"
41 #include "platform/RuntimeEnabledFeatures.h" 42 #include "platform/RuntimeEnabledFeatures.h"
42 43
43 namespace blink { 44 namespace blink {
44 45
45 LayoutTreeBuilderForElement::LayoutTreeBuilderForElement(Element& element, Compu tedStyle* style) 46 LayoutTreeBuilderForElement::LayoutTreeBuilderForElement(Element& element, Compu tedStyle* style)
46 : LayoutTreeBuilder(element, nullptr) 47 : LayoutTreeBuilder(element, nullptr)
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 } 128 }
128 129
129 // Make sure the LayoutObject already knows it is going to be added to a Lay outFlowThread before we set the style 130 // Make sure the LayoutObject already knows it is going to be added to a Lay outFlowThread before we set the style
130 // for the first time. Otherwise code using inLayoutFlowThread() in the styl eWillChange and styleDidChange will fail. 131 // for the first time. Otherwise code using inLayoutFlowThread() in the styl eWillChange and styleDidChange will fail.
131 newLayoutObject->setIsInsideFlowThread(parentLayoutObject->isInsideFlowThrea d()); 132 newLayoutObject->setIsInsideFlowThread(parentLayoutObject->isInsideFlowThrea d());
132 133
133 LayoutObject* nextLayoutObject = this->nextLayoutObject(); 134 LayoutObject* nextLayoutObject = this->nextLayoutObject();
134 m_node->setLayoutObject(newLayoutObject); 135 m_node->setLayoutObject(newLayoutObject);
135 newLayoutObject->setStyle(&style); // setStyle() can depend on layoutObject( ) already being set. 136 newLayoutObject->setStyle(&style); // setStyle() can depend on layoutObject( ) already being set.
136 137
138 if (Fullscreen::isActiveFullScreenElement(*m_node)) {
139 newLayoutObject = LayoutFullScreen::wrapLayoutObject(newLayoutObject, pa rentLayoutObject, &m_node->document());
140 if (!newLayoutObject)
141 return;
142 }
143
137 // Note: Adding newLayoutObject instead of layoutObject(). layoutObject() ma y be a child of newLayoutObject. 144 // Note: Adding newLayoutObject instead of layoutObject(). layoutObject() ma y be a child of newLayoutObject.
138 parentLayoutObject->addChild(newLayoutObject, nextLayoutObject); 145 parentLayoutObject->addChild(newLayoutObject, nextLayoutObject);
139 } 146 }
140 147
141 void LayoutTreeBuilderForText::createLayoutObject() 148 void LayoutTreeBuilderForText::createLayoutObject()
142 { 149 {
143 ComputedStyle& style = m_layoutObjectParent->mutableStyleRef(); 150 ComputedStyle& style = m_layoutObjectParent->mutableStyleRef();
144 151
145 DCHECK(m_node->textLayoutObjectIsNeeded(style, *m_layoutObjectParent)); 152 DCHECK(m_node->textLayoutObjectIsNeeded(style, *m_layoutObjectParent));
146 153
147 LayoutText* newLayoutObject = m_node->createTextLayoutObject(style); 154 LayoutText* newLayoutObject = m_node->createTextLayoutObject(style);
148 if (!m_layoutObjectParent->isChildAllowed(newLayoutObject, style)) { 155 if (!m_layoutObjectParent->isChildAllowed(newLayoutObject, style)) {
149 newLayoutObject->destroy(); 156 newLayoutObject->destroy();
150 return; 157 return;
151 } 158 }
152 159
153 // Make sure the LayoutObject already knows it is going to be added to a Lay outFlowThread before we set the style 160 // Make sure the LayoutObject already knows it is going to be added to a Lay outFlowThread before we set the style
154 // for the first time. Otherwise code using inLayoutFlowThread() in the styl eWillChange and styleDidChange will fail. 161 // for the first time. Otherwise code using inLayoutFlowThread() in the styl eWillChange and styleDidChange will fail.
155 newLayoutObject->setIsInsideFlowThread(m_layoutObjectParent->isInsideFlowThr ead()); 162 newLayoutObject->setIsInsideFlowThread(m_layoutObjectParent->isInsideFlowThr ead());
156 163
157 LayoutObject* nextLayoutObject = this->nextLayoutObject(); 164 LayoutObject* nextLayoutObject = this->nextLayoutObject();
158 m_node->setLayoutObject(newLayoutObject); 165 m_node->setLayoutObject(newLayoutObject);
159 // Parent takes care of the animations, no need to call setAnimatableStyle. 166 // Parent takes care of the animations, no need to call setAnimatableStyle.
160 newLayoutObject->setStyle(&style); 167 newLayoutObject->setStyle(&style);
161 m_layoutObjectParent->addChild(newLayoutObject, nextLayoutObject); 168 m_layoutObjectParent->addChild(newLayoutObject, nextLayoutObject);
162 } 169 }
163 170
164 } // namespace blink 171 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Fullscreen.cpp ('k') | third_party/WebKit/Source/core/dom/PseudoElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698