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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 fullscreenRenderer->addChild(object); | 117 fullscreenRenderer->addChild(object); |
118 } | 118 } |
119 document->setFullScreenRenderer(fullscreenRenderer); | 119 document->setFullScreenRenderer(fullscreenRenderer); |
120 if (fullscreenRenderer->placeholder()) | 120 if (fullscreenRenderer->placeholder()) |
121 return fullscreenRenderer->placeholder(); | 121 return fullscreenRenderer->placeholder(); |
122 return fullscreenRenderer; | 122 return fullscreenRenderer; |
123 } | 123 } |
124 | 124 |
125 void RenderFullScreen::unwrapRenderer() | 125 void RenderFullScreen::unwrapRenderer() |
126 { | 126 { |
127 RenderObject* wrappedRenderer = firstChild(); | 127 RenderObject* holder = placeholder() ? placeholder() : this; |
128 if (wrappedRenderer) { | 128 RenderObject* parent = holder->parent(); |
129 wrappedRenderer->remove(); | 129 if (parent) { |
130 RenderObject* holder = placeholder() ? placeholder() : this; | 130 RenderObject* child = firstChild(); |
131 RenderObject* parent = holder->parent(); | 131 while (child) { |
132 if (parent) | 132 RenderObject* nextChild = child->nextSibling(); |
133 parent->addChild(wrappedRenderer, holder); | 133 child->remove(); |
| 134 parent->addChild(child, holder); |
| 135 child = nextChild; |
| 136 } |
134 } | 137 } |
135 remove(); | 138 remove(); |
136 document()->setFullScreenRenderer(0); | 139 document()->setFullScreenRenderer(0); |
137 } | 140 } |
138 | 141 |
139 void RenderFullScreen::setPlaceholder(RenderBlock* placeholder) | 142 void RenderFullScreen::setPlaceholder(RenderBlock* placeholder) |
140 { | 143 { |
141 m_placeholder = placeholder; | 144 m_placeholder = placeholder; |
142 } | 145 } |
143 | 146 |
(...skipping 10 matching lines...) Expand all Loading... |
154 if (parent()) { | 157 if (parent()) { |
155 parent()->addChild(m_placeholder, this); | 158 parent()->addChild(m_placeholder, this); |
156 remove(); | 159 remove(); |
157 } | 160 } |
158 m_placeholder->addChild(this); | 161 m_placeholder->addChild(this); |
159 } else | 162 } else |
160 m_placeholder->setStyle(style); | 163 m_placeholder->setStyle(style); |
161 } | 164 } |
162 | 165 |
163 #endif | 166 #endif |
OLD | NEW |