| 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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 fullscreenStyle->setLeft(Length(0, WebCore::Fixed)); | 103 fullscreenStyle->setLeft(Length(0, WebCore::Fixed)); |
| 104 fullscreenStyle->setTop(Length(0, WebCore::Fixed)); | 104 fullscreenStyle->setTop(Length(0, WebCore::Fixed)); |
| 105 | 105 |
| 106 fullscreenStyle->setBackgroundColor(StyleColor(Color::black)); | 106 fullscreenStyle->setBackgroundColor(StyleColor(Color::black)); |
| 107 | 107 |
| 108 return fullscreenStyle.release(); | 108 return fullscreenStyle.release(); |
| 109 } | 109 } |
| 110 | 110 |
| 111 RenderObject* RenderFullScreen::wrapRenderer(RenderObject* object, RenderObject*
parent, Document* document) | 111 RenderObject* RenderFullScreen::wrapRenderer(RenderObject* object, RenderObject*
parent, Document* document) |
| 112 { | 112 { |
| 113 DisableRenderObjectLifecycleAsserts disabler; |
| 114 |
| 113 RenderFullScreen* fullscreenRenderer = RenderFullScreen::createAnonymous(doc
ument); | 115 RenderFullScreen* fullscreenRenderer = RenderFullScreen::createAnonymous(doc
ument); |
| 114 fullscreenRenderer->setStyle(createFullScreenStyle()); | 116 fullscreenRenderer->setStyle(createFullScreenStyle()); |
| 115 if (parent && !parent->isChildAllowed(fullscreenRenderer, fullscreenRenderer
->style())) { | 117 if (parent && !parent->isChildAllowed(fullscreenRenderer, fullscreenRenderer
->style())) { |
| 116 fullscreenRenderer->destroy(); | 118 fullscreenRenderer->destroy(); |
| 117 return 0; | 119 return 0; |
| 118 } | 120 } |
| 119 if (object) { | 121 if (object) { |
| 120 // |object->parent()| can be null if the object is not yet attached | 122 // |object->parent()| can be null if the object is not yet attached |
| 121 // to |parent|. | 123 // to |parent|. |
| 122 if (RenderObject* parent = object->parent()) { | 124 if (RenderObject* parent = object->parent()) { |
| (...skipping 16 matching lines...) Expand all Loading... |
| 139 fullscreenRenderer->setNeedsLayoutAndPrefWidthsRecalc(); | 141 fullscreenRenderer->setNeedsLayoutAndPrefWidthsRecalc(); |
| 140 } | 142 } |
| 141 | 143 |
| 142 ASSERT(document); | 144 ASSERT(document); |
| 143 FullscreenElementStack::from(*document).setFullScreenRenderer(fullscreenRend
erer); | 145 FullscreenElementStack::from(*document).setFullScreenRenderer(fullscreenRend
erer); |
| 144 return fullscreenRenderer; | 146 return fullscreenRenderer; |
| 145 } | 147 } |
| 146 | 148 |
| 147 void RenderFullScreen::unwrapRenderer() | 149 void RenderFullScreen::unwrapRenderer() |
| 148 { | 150 { |
| 151 DisableRenderObjectLifecycleAsserts disabler; |
| 152 |
| 149 if (parent()) { | 153 if (parent()) { |
| 150 RenderObject* child; | 154 RenderObject* child; |
| 151 while ((child = firstChild())) { | 155 while ((child = firstChild())) { |
| 152 // We have to clear the override size, because as a flexbox, we | 156 // We have to clear the override size, because as a flexbox, we |
| 153 // may have set one on the child, and we don't want to leave that | 157 // may have set one on the child, and we don't want to leave that |
| 154 // lying around on the child. | 158 // lying around on the child. |
| 155 if (child->isBox()) | 159 if (child->isBox()) |
| 156 toRenderBox(child)->clearOverrideSize(); | 160 toRenderBox(child)->clearOverrideSize(); |
| 157 child->remove(); | 161 child->remove(); |
| 158 parent()->addChild(child, this); | 162 parent()->addChild(child, this); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 180 if (!m_placeholder) { | 184 if (!m_placeholder) { |
| 181 m_placeholder = new RenderFullScreenPlaceholder(this); | 185 m_placeholder = new RenderFullScreenPlaceholder(this); |
| 182 m_placeholder->setStyle(style); | 186 m_placeholder->setStyle(style); |
| 183 if (parent()) { | 187 if (parent()) { |
| 184 parent()->addChild(m_placeholder, this); | 188 parent()->addChild(m_placeholder, this); |
| 185 parent()->setNeedsLayoutAndPrefWidthsRecalc(); | 189 parent()->setNeedsLayoutAndPrefWidthsRecalc(); |
| 186 } | 190 } |
| 187 } else | 191 } else |
| 188 m_placeholder->setStyle(style); | 192 m_placeholder->setStyle(style); |
| 189 } | 193 } |
| OLD | NEW |