OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2010 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
11 * documentation and/or other materials provided with the distribution. | 11 * documentation and/or other materials provided with the distribution. |
12 * | 12 * |
13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND AN
Y | 13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND AN
Y |
14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
15 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 15 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
16 * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR AN
Y | 16 * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR AN
Y |
17 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 17 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
18 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 18 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
19 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND O
N | 19 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND O
N |
20 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 20 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
22 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 22 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
23 */ | 23 */ |
24 | 24 |
25 #include "config.h" | 25 #include "config.h" |
26 #include "core/rendering/RenderFullScreen.h" | 26 #include "core/rendering/RenderFullScreen.h" |
27 | 27 |
28 #include "core/dom/FullscreenElementStack.h" | 28 #include "core/dom/Fullscreen.h" |
29 #include "core/rendering/RenderBlockFlow.h" | 29 #include "core/rendering/RenderBlockFlow.h" |
30 | 30 |
31 using namespace blink; | 31 using namespace blink; |
32 | 32 |
33 class RenderFullScreenPlaceholder FINAL : public RenderBlockFlow { | 33 class RenderFullScreenPlaceholder FINAL : public RenderBlockFlow { |
34 public: | 34 public: |
35 RenderFullScreenPlaceholder(RenderFullScreen* owner) | 35 RenderFullScreenPlaceholder(RenderFullScreen* owner) |
36 : RenderBlockFlow(0) | 36 : RenderBlockFlow(0) |
37 , m_owner(owner) | 37 , m_owner(owner) |
38 { | 38 { |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 { | 74 { |
75 if (m_placeholder) { | 75 if (m_placeholder) { |
76 remove(); | 76 remove(); |
77 if (!m_placeholder->beingDestroyed()) | 77 if (!m_placeholder->beingDestroyed()) |
78 m_placeholder->destroy(); | 78 m_placeholder->destroy(); |
79 ASSERT(!m_placeholder); | 79 ASSERT(!m_placeholder); |
80 } | 80 } |
81 | 81 |
82 // RenderObjects are unretained, so notify the document (which holds a point
er to a RenderFullScreen) | 82 // RenderObjects are unretained, so notify the document (which holds a point
er to a RenderFullScreen) |
83 // if its RenderFullScreen is destroyed. | 83 // if its RenderFullScreen is destroyed. |
84 FullscreenElementStack& fullscreen = FullscreenElementStack::from(document()
); | 84 Fullscreen& fullscreen = Fullscreen::from(document()); |
85 if (fullscreen.fullScreenRenderer() == this) | 85 if (fullscreen.fullScreenRenderer() == this) |
86 fullscreen.fullScreenRendererDestroyed(); | 86 fullscreen.fullScreenRendererDestroyed(); |
87 | 87 |
88 RenderFlexibleBox::willBeDestroyed(); | 88 RenderFlexibleBox::willBeDestroyed(); |
89 } | 89 } |
90 | 90 |
91 static PassRefPtr<RenderStyle> createFullScreenStyle() | 91 static PassRefPtr<RenderStyle> createFullScreenStyle() |
92 { | 92 { |
93 RefPtr<RenderStyle> fullscreenStyle = RenderStyle::createDefaultStyle(); | 93 RefPtr<RenderStyle> fullscreenStyle = RenderStyle::createDefaultStyle(); |
94 | 94 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 // Because objects moved from |parent| to |fullscreenRenderer|, we w
ant to | 143 // Because objects moved from |parent| to |fullscreenRenderer|, we w
ant to |
144 // make new line boxes instead of leaving the old ones around. | 144 // make new line boxes instead of leaving the old ones around. |
145 parent->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation(); | 145 parent->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation(); |
146 containingBlock->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvali
dation(); | 146 containingBlock->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvali
dation(); |
147 } | 147 } |
148 fullscreenRenderer->addChild(object); | 148 fullscreenRenderer->addChild(object); |
149 fullscreenRenderer->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalid
ation(); | 149 fullscreenRenderer->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalid
ation(); |
150 } | 150 } |
151 | 151 |
152 ASSERT(document); | 152 ASSERT(document); |
153 FullscreenElementStack::from(*document).setFullScreenRenderer(fullscreenRend
erer); | 153 Fullscreen::from(*document).setFullScreenRenderer(fullscreenRenderer); |
154 return fullscreenRenderer; | 154 return fullscreenRenderer; |
155 } | 155 } |
156 | 156 |
157 void RenderFullScreen::unwrapRenderer() | 157 void RenderFullScreen::unwrapRenderer() |
158 { | 158 { |
159 // FIXME: We should not modify the structure of the render tree during | 159 // FIXME: We should not modify the structure of the render tree during |
160 // layout. crbug.com/370459 | 160 // layout. crbug.com/370459 |
161 DeprecatedDisableModifyRenderTreeStructureAsserts disabler; | 161 DeprecatedDisableModifyRenderTreeStructureAsserts disabler; |
162 | 162 |
163 if (parent()) { | 163 if (parent()) { |
(...skipping 29 matching lines...) Expand all Loading... |
193 if (!m_placeholder) { | 193 if (!m_placeholder) { |
194 m_placeholder = new RenderFullScreenPlaceholder(this); | 194 m_placeholder = new RenderFullScreenPlaceholder(this); |
195 m_placeholder->setStyle(style); | 195 m_placeholder->setStyle(style); |
196 if (parent()) { | 196 if (parent()) { |
197 parent()->addChild(m_placeholder, this); | 197 parent()->addChild(m_placeholder, this); |
198 parent()->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation(
); | 198 parent()->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation(
); |
199 } | 199 } |
200 } else | 200 } else |
201 m_placeholder->setStyle(style); | 201 m_placeholder->setStyle(style); |
202 } | 202 } |
OLD | NEW |