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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 | 112 |
113 fullscreenStyle->setBackgroundColor(StyleColor(Color::black)); | 113 fullscreenStyle->setBackgroundColor(StyleColor(Color::black)); |
114 | 114 |
115 setStyle(fullscreenStyle); | 115 setStyle(fullscreenStyle); |
116 } | 116 } |
117 | 117 |
118 LayoutObject* LayoutFullScreen::wrapLayoutObject(LayoutObject* object, LayoutObj
ect* parent, Document* document) | 118 LayoutObject* LayoutFullScreen::wrapLayoutObject(LayoutObject* object, LayoutObj
ect* parent, Document* document) |
119 { | 119 { |
120 // FIXME: We should not modify the structure of the layout tree during | 120 // FIXME: We should not modify the structure of the layout tree during |
121 // layout. crbug.com/370459 | 121 // layout. crbug.com/370459 |
122 DeprecatedDisableModifyRenderTreeStructureAsserts disabler; | 122 DeprecatedDisableModifyLayoutTreeStructureAsserts disabler; |
123 | 123 |
124 LayoutFullScreen* fullscreenLayoutObject = LayoutFullScreen::createAnonymous
(document); | 124 LayoutFullScreen* fullscreenLayoutObject = LayoutFullScreen::createAnonymous
(document); |
125 fullscreenLayoutObject->updateStyle(); | 125 fullscreenLayoutObject->updateStyle(); |
126 if (parent && !parent->isChildAllowed(fullscreenLayoutObject, fullscreenLayo
utObject->styleRef())) { | 126 if (parent && !parent->isChildAllowed(fullscreenLayoutObject, fullscreenLayo
utObject->styleRef())) { |
127 fullscreenLayoutObject->destroy(); | 127 fullscreenLayoutObject->destroy(); |
128 return 0; | 128 return 0; |
129 } | 129 } |
130 if (object) { | 130 if (object) { |
131 // |object->parent()| can be null if the object is not yet attached | 131 // |object->parent()| can be null if the object is not yet attached |
132 // to |parent|. | 132 // to |parent|. |
(...skipping 19 matching lines...) Expand all Loading... |
152 | 152 |
153 ASSERT(document); | 153 ASSERT(document); |
154 Fullscreen::from(*document).setFullScreenLayoutObject(fullscreenLayoutObject
); | 154 Fullscreen::from(*document).setFullScreenLayoutObject(fullscreenLayoutObject
); |
155 return fullscreenLayoutObject; | 155 return fullscreenLayoutObject; |
156 } | 156 } |
157 | 157 |
158 void LayoutFullScreen::unwrapLayoutObject() | 158 void LayoutFullScreen::unwrapLayoutObject() |
159 { | 159 { |
160 // FIXME: We should not modify the structure of the layout tree during | 160 // FIXME: We should not modify the structure of the layout tree during |
161 // layout. crbug.com/370459 | 161 // layout. crbug.com/370459 |
162 DeprecatedDisableModifyRenderTreeStructureAsserts disabler; | 162 DeprecatedDisableModifyLayoutTreeStructureAsserts disabler; |
163 | 163 |
164 if (parent()) { | 164 if (parent()) { |
165 for (LayoutObject* child = firstChild(); child; child = firstChild()) { | 165 for (LayoutObject* child = firstChild(); child; child = firstChild()) { |
166 // We have to clear the override size, because as a flexbox, we | 166 // We have to clear the override size, because as a flexbox, we |
167 // may have set one on the child, and we don't want to leave that | 167 // may have set one on the child, and we don't want to leave that |
168 // lying around on the child. | 168 // lying around on the child. |
169 if (child->isBox()) | 169 if (child->isBox()) |
170 toLayoutBox(child)->clearOverrideSize(); | 170 toLayoutBox(child)->clearOverrideSize(); |
171 child->remove(); | 171 child->remove(); |
172 parent()->addChild(child, this); | 172 parent()->addChild(child, this); |
(...skipping 22 matching lines...) Expand all Loading... |
195 m_placeholder = new LayoutFullScreenPlaceholder(this); | 195 m_placeholder = new LayoutFullScreenPlaceholder(this); |
196 m_placeholder->setStyle(style); | 196 m_placeholder->setStyle(style); |
197 if (parent()) { | 197 if (parent()) { |
198 parent()->addChild(m_placeholder, this); | 198 parent()->addChild(m_placeholder, this); |
199 parent()->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation(
LayoutInvalidationReason::Fullscreen); | 199 parent()->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation(
LayoutInvalidationReason::Fullscreen); |
200 } | 200 } |
201 } else { | 201 } else { |
202 m_placeholder->setStyle(style); | 202 m_placeholder->setStyle(style); |
203 } | 203 } |
204 } | 204 } |
OLD | NEW |