Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(338)

Side by Side Diff: Source/WebCore/html/HTMLFrameElementBase.cpp

Issue 9768010: Merge 111108 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1025/
Patch Set: Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Simon Hausmann (hausmann@kde.org) 4 * (C) 2000 Simon Hausmann (hausmann@kde.org)
5 * (C) 2001 Dirk Mueller (mueller@kde.org) 5 * (C) 2001 Dirk Mueller (mueller@kde.org)
6 * Copyright (C) 2004, 2006, 2008, 2009 Apple Inc. All rights reserved. 6 * Copyright (C) 2004, 2006, 2008, 2009 Apple Inc. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 if (Frame* frame = contentFrame()) 187 if (Frame* frame = contentFrame())
188 frame->transferChildFrameToNewDocument(); 188 frame->transferChildFrameToNewDocument();
189 } 189 }
190 190
191 void HTMLFrameElementBase::insertedIntoDocument() 191 void HTMLFrameElementBase::insertedIntoDocument()
192 { 192 {
193 HTMLFrameOwnerElement::insertedIntoDocument(); 193 HTMLFrameOwnerElement::insertedIntoDocument();
194 194
195 if (m_remainsAliveOnRemovalFromTree) { 195 if (m_remainsAliveOnRemovalFromTree) {
196 updateOnReparenting(); 196 updateOnReparenting();
197 setRemainsAliveOnRemovalFromTree(false); 197 m_remainsAliveOnRemovalFromTree = false;
198 m_checkInDocumentTimer.stop();
198 return; 199 return;
199 } 200 }
200 // DocumentFragments don't kick of any loads. 201 // DocumentFragments don't kick of any loads.
201 if (!document()->frame()) 202 if (!document()->frame())
202 return; 203 return;
203 204
204 // JavaScript in src=javascript: and beforeonload can access the renderer 205 // JavaScript in src=javascript: and beforeonload can access the renderer
205 // during attribute parsing *before* the normal parser machinery would 206 // during attribute parsing *before* the normal parser machinery would
206 // attach the element. To support this, we lazyAttach here, but only 207 // attach the element. To support this, we lazyAttach here, but only
207 // if we don't already have a renderer (if we're inserted 208 // if we don't already have a renderer (if we're inserted
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 288
288 void HTMLFrameElementBase::setRemainsAliveOnRemovalFromTree(bool value) 289 void HTMLFrameElementBase::setRemainsAliveOnRemovalFromTree(bool value)
289 { 290 {
290 ASSERT(!value || canRemainAliveOnRemovalFromTree()); 291 ASSERT(!value || canRemainAliveOnRemovalFromTree());
291 m_remainsAliveOnRemovalFromTree = value; 292 m_remainsAliveOnRemovalFromTree = value;
292 293
293 // There is a possibility that JS will do document.adoptNode() on this eleme nt but will not insert it into the tree. 294 // There is a possibility that JS will do document.adoptNode() on this eleme nt but will not insert it into the tree.
294 // Start the async timer that is normally stopped by attach(). If it's not s topped and fires, it'll unload the frame. 295 // Start the async timer that is normally stopped by attach(). If it's not s topped and fires, it'll unload the frame.
295 if (value) 296 if (value)
296 m_checkInDocumentTimer.startOneShot(0); 297 m_checkInDocumentTimer.startOneShot(0);
297 else 298 else {
298 m_checkInDocumentTimer.stop(); 299 m_checkInDocumentTimer.stop();
300 willRemove();
301 }
299 } 302 }
300 303
301 void HTMLFrameElementBase::checkInDocumentTimerFired(Timer<HTMLFrameElementBase> *) 304 void HTMLFrameElementBase::checkInDocumentTimerFired(Timer<HTMLFrameElementBase> *)
302 { 305 {
303 ASSERT(!attached()); 306 ASSERT(!attached());
304 ASSERT(m_remainsAliveOnRemovalFromTree); 307 ASSERT(m_remainsAliveOnRemovalFromTree);
305 308
306 m_remainsAliveOnRemovalFromTree = false; 309 m_remainsAliveOnRemovalFromTree = false;
307 willRemove(); 310 willRemove();
308 } 311 }
309 312
310 void HTMLFrameElementBase::willRemove() 313 void HTMLFrameElementBase::willRemove()
311 { 314 {
312 if (m_remainsAliveOnRemovalFromTree) 315 if (m_remainsAliveOnRemovalFromTree)
313 return; 316 return;
314 317
315 HTMLFrameOwnerElement::willRemove(); 318 HTMLFrameOwnerElement::willRemove();
316 } 319 }
317 320
318 #if ENABLE(FULLSCREEN_API) 321 #if ENABLE(FULLSCREEN_API)
319 bool HTMLFrameElementBase::allowFullScreen() const 322 bool HTMLFrameElementBase::allowFullScreen() const
320 { 323 {
321 return hasAttribute(webkitallowfullscreenAttr); 324 return hasAttribute(webkitallowfullscreenAttr);
322 } 325 }
323 #endif 326 #endif
324 327
325 } // namespace WebCore 328 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698