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

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

Issue 9766014: Merge 111108 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/963/
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 // Loads may cause synchronous javascript execution (e.g. beforeload or 205 // Loads may cause synchronous javascript execution (e.g. beforeload or
205 // src=javascript), which could try to access the renderer before the normal 206 // src=javascript), which could try to access the renderer before the normal
206 // parser machinery would call lazyAttach() and set us as needing style 207 // parser machinery would call lazyAttach() and set us as needing style
207 // resolve. Any code which expects this to be attached will resolve style 208 // resolve. Any code which expects this to be attached will resolve style
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 290
290 void HTMLFrameElementBase::setRemainsAliveOnRemovalFromTree(bool value) 291 void HTMLFrameElementBase::setRemainsAliveOnRemovalFromTree(bool value)
291 { 292 {
292 ASSERT(!value || canRemainAliveOnRemovalFromTree()); 293 ASSERT(!value || canRemainAliveOnRemovalFromTree());
293 m_remainsAliveOnRemovalFromTree = value; 294 m_remainsAliveOnRemovalFromTree = value;
294 295
295 // There is a possibility that JS will do document.adoptNode() on this eleme nt but will not insert it into the tree. 296 // There is a possibility that JS will do document.adoptNode() on this eleme nt but will not insert it into the tree.
296 // Start the async timer that is normally stopped by attach(). If it's not s topped and fires, it'll unload the frame. 297 // Start the async timer that is normally stopped by attach(). If it's not s topped and fires, it'll unload the frame.
297 if (value) 298 if (value)
298 m_checkInDocumentTimer.startOneShot(0); 299 m_checkInDocumentTimer.startOneShot(0);
299 else 300 else {
300 m_checkInDocumentTimer.stop(); 301 m_checkInDocumentTimer.stop();
302 willRemove();
303 }
301 } 304 }
302 305
303 void HTMLFrameElementBase::checkInDocumentTimerFired(Timer<HTMLFrameElementBase> *) 306 void HTMLFrameElementBase::checkInDocumentTimerFired(Timer<HTMLFrameElementBase> *)
304 { 307 {
305 ASSERT(!attached()); 308 ASSERT(!attached());
306 ASSERT(m_remainsAliveOnRemovalFromTree); 309 ASSERT(m_remainsAliveOnRemovalFromTree);
307 310
308 m_remainsAliveOnRemovalFromTree = false; 311 m_remainsAliveOnRemovalFromTree = false;
309 willRemove(); 312 willRemove();
310 } 313 }
311 314
312 void HTMLFrameElementBase::willRemove() 315 void HTMLFrameElementBase::willRemove()
313 { 316 {
314 if (m_remainsAliveOnRemovalFromTree) 317 if (m_remainsAliveOnRemovalFromTree)
315 return; 318 return;
316 319
317 HTMLFrameOwnerElement::willRemove(); 320 HTMLFrameOwnerElement::willRemove();
318 } 321 }
319 322
320 #if ENABLE(FULLSCREEN_API) 323 #if ENABLE(FULLSCREEN_API)
321 bool HTMLFrameElementBase::allowFullScreen() const 324 bool HTMLFrameElementBase::allowFullScreen() const
322 { 325 {
323 return hasAttribute(webkitallowfullscreenAttr); 326 return hasAttribute(webkitallowfullscreenAttr);
324 } 327 }
325 #endif 328 #endif
326 329
327 } // namespace WebCore 330 } // 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