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