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

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

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

Powered by Google App Engine
This is Rietveld 408576698