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 |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 // Since we are moving the |object| to a new parent |fullscreenRende
rer|, | 129 // Since we are moving the |object| to a new parent |fullscreenRende
rer|, |
130 // the line box tree underneath our |containingBlock| is not longer
valid. | 130 // the line box tree underneath our |containingBlock| is not longer
valid. |
131 containingBlock->deleteLineBoxTree(); | 131 containingBlock->deleteLineBoxTree(); |
132 | 132 |
133 parent->addChild(fullscreenRenderer, object); | 133 parent->addChild(fullscreenRenderer, object); |
134 object->remove(); | 134 object->remove(); |
135 | 135 |
136 // Always just do a full layout to ensure that line boxes get delete
d properly. | 136 // Always just do a full layout to ensure that line boxes get delete
d properly. |
137 // Because objects moved from |parent| to |fullscreenRenderer|, we w
ant to | 137 // Because objects moved from |parent| to |fullscreenRenderer|, we w
ant to |
138 // make new line boxes instead of leaving the old ones around. | 138 // make new line boxes instead of leaving the old ones around. |
139 parent->setNeedsLayoutAndPrefWidthsRecalcAndFullRepaint(); | 139 parent->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation(); |
140 containingBlock->setNeedsLayoutAndPrefWidthsRecalcAndFullRepaint(); | 140 containingBlock->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvali
dation(); |
141 } | 141 } |
142 fullscreenRenderer->addChild(object); | 142 fullscreenRenderer->addChild(object); |
143 fullscreenRenderer->setNeedsLayoutAndPrefWidthsRecalcAndFullRepaint(); | 143 fullscreenRenderer->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalid
ation(); |
144 } | 144 } |
145 | 145 |
146 ASSERT(document); | 146 ASSERT(document); |
147 FullscreenElementStack::from(*document).setFullScreenRenderer(fullscreenRend
erer); | 147 FullscreenElementStack::from(*document).setFullScreenRenderer(fullscreenRend
erer); |
148 return fullscreenRenderer; | 148 return fullscreenRenderer; |
149 } | 149 } |
150 | 150 |
151 void RenderFullScreen::unwrapRenderer() | 151 void RenderFullScreen::unwrapRenderer() |
152 { | 152 { |
153 // FIXME: We should not modify the structure of the render tree during | 153 // FIXME: We should not modify the structure of the render tree during |
154 // layout. crbug.com/370459 | 154 // layout. crbug.com/370459 |
155 DeprecatedDisableModifyRenderTreeStructureAsserts disabler; | 155 DeprecatedDisableModifyRenderTreeStructureAsserts disabler; |
156 | 156 |
157 if (parent()) { | 157 if (parent()) { |
158 RenderObject* child; | 158 RenderObject* child; |
159 while ((child = firstChild())) { | 159 while ((child = firstChild())) { |
160 // We have to clear the override size, because as a flexbox, we | 160 // We have to clear the override size, because as a flexbox, we |
161 // may have set one on the child, and we don't want to leave that | 161 // may have set one on the child, and we don't want to leave that |
162 // lying around on the child. | 162 // lying around on the child. |
163 if (child->isBox()) | 163 if (child->isBox()) |
164 toRenderBox(child)->clearOverrideSize(); | 164 toRenderBox(child)->clearOverrideSize(); |
165 child->remove(); | 165 child->remove(); |
166 parent()->addChild(child, this); | 166 parent()->addChild(child, this); |
167 parent()->setNeedsLayoutAndPrefWidthsRecalcAndFullRepaint(); | 167 parent()->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation(
); |
168 } | 168 } |
169 } | 169 } |
170 if (placeholder()) | 170 if (placeholder()) |
171 placeholder()->remove(); | 171 placeholder()->remove(); |
172 remove(); | 172 remove(); |
173 FullscreenElementStack::from(document()).setFullScreenRenderer(0); | 173 FullscreenElementStack::from(document()).setFullScreenRenderer(0); |
174 } | 174 } |
175 | 175 |
176 void RenderFullScreen::setPlaceholder(RenderBlock* placeholder) | 176 void RenderFullScreen::setPlaceholder(RenderBlock* placeholder) |
177 { | 177 { |
178 m_placeholder = placeholder; | 178 m_placeholder = placeholder; |
179 } | 179 } |
180 | 180 |
181 void RenderFullScreen::createPlaceholder(PassRefPtr<RenderStyle> style, const La
youtRect& frameRect) | 181 void RenderFullScreen::createPlaceholder(PassRefPtr<RenderStyle> style, const La
youtRect& frameRect) |
182 { | 182 { |
183 if (style->width().isAuto()) | 183 if (style->width().isAuto()) |
184 style->setWidth(Length(frameRect.width(), Fixed)); | 184 style->setWidth(Length(frameRect.width(), Fixed)); |
185 if (style->height().isAuto()) | 185 if (style->height().isAuto()) |
186 style->setHeight(Length(frameRect.height(), Fixed)); | 186 style->setHeight(Length(frameRect.height(), Fixed)); |
187 | 187 |
188 if (!m_placeholder) { | 188 if (!m_placeholder) { |
189 m_placeholder = new RenderFullScreenPlaceholder(this); | 189 m_placeholder = new RenderFullScreenPlaceholder(this); |
190 m_placeholder->setStyle(style); | 190 m_placeholder->setStyle(style); |
191 if (parent()) { | 191 if (parent()) { |
192 parent()->addChild(m_placeholder, this); | 192 parent()->addChild(m_placeholder, this); |
193 parent()->setNeedsLayoutAndPrefWidthsRecalcAndFullRepaint(); | 193 parent()->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation(
); |
194 } | 194 } |
195 } else | 195 } else |
196 m_placeholder->setStyle(style); | 196 m_placeholder->setStyle(style); |
197 } | 197 } |
OLD | NEW |