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

Side by Side Diff: Source/core/dom/FullscreenElementStack.cpp

Issue 23714003: Refactoring: Add Event::createBubble. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/dom/Event.h ('k') | Source/core/dom/Node.cpp » ('j') | 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) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r ights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r ights reserved.
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
8 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 8 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
9 * Copyright (C) 2013 Google Inc. All rights reserved. 9 * Copyright (C) 2013 Google Inc. All rights reserved.
10 * 10 *
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after
483 node = document()->documentElement(); 483 node = document()->documentElement();
484 // The dispatchEvent below may have blown away our documentElement. 484 // The dispatchEvent below may have blown away our documentElement.
485 if (!node) 485 if (!node)
486 continue; 486 continue;
487 487
488 // If the element was removed from our tree, also message the documentEl ement. Since we may 488 // If the element was removed from our tree, also message the documentEl ement. Since we may
489 // have a document hierarchy, check that node isn't in another document. 489 // have a document hierarchy, check that node isn't in another document.
490 if (!document()->contains(node.get()) && !node->inDocument()) 490 if (!document()->contains(node.get()) && !node->inDocument())
491 changeQueue.append(document()->documentElement()); 491 changeQueue.append(document()->documentElement());
492 492
493 node->dispatchEvent(Event::create(eventNames().webkitfullscreenchangeEve nt, true, false)); 493 node->dispatchEvent(Event::createBubble(eventNames().webkitfullscreencha ngeEvent));
494 } 494 }
495 495
496 while (!errorQueue.isEmpty()) { 496 while (!errorQueue.isEmpty()) {
497 RefPtr<Node> node = errorQueue.takeFirst(); 497 RefPtr<Node> node = errorQueue.takeFirst();
498 if (!node) 498 if (!node)
499 node = document()->documentElement(); 499 node = document()->documentElement();
500 // The dispatchEvent below may have blown away our documentElement. 500 // The dispatchEvent below may have blown away our documentElement.
501 if (!node) 501 if (!node)
502 continue; 502 continue;
503 503
504 // If the element was removed from our tree, also message the documentEl ement. Since we may 504 // If the element was removed from our tree, also message the documentEl ement. Since we may
505 // have a document hierarchy, check that node isn't in another document. 505 // have a document hierarchy, check that node isn't in another document.
506 if (!document()->contains(node.get()) && !node->inDocument()) 506 if (!document()->contains(node.get()) && !node->inDocument())
507 errorQueue.append(document()->documentElement()); 507 errorQueue.append(document()->documentElement());
508 508
509 node->dispatchEvent(Event::create(eventNames().webkitfullscreenerrorEven t, true, false)); 509 node->dispatchEvent(Event::createBubble(eventNames().webkitfullscreenerr orEvent));
510 } 510 }
511 } 511 }
512 512
513 void FullscreenElementStack::fullScreenElementRemoved() 513 void FullscreenElementStack::fullScreenElementRemoved()
514 { 514 {
515 m_fullScreenElement->setContainsFullScreenElementOnAncestorsCrossingFrameBou ndaries(false); 515 m_fullScreenElement->setContainsFullScreenElementOnAncestorsCrossingFrameBou ndaries(false);
516 webkitCancelFullScreen(); 516 webkitCancelFullScreen();
517 } 517 }
518 518
519 void FullscreenElementStack::removeFullScreenElementOfSubtree(Node* node, bool a mongChildrenOnly) 519 void FullscreenElementStack::removeFullScreenElementOfSubtree(Node* node, bool a mongChildrenOnly)
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
559 if (!target) 559 if (!target)
560 target = fullscreen->webkitCurrentFullScreenElement(); 560 target = fullscreen->webkitCurrentFullScreenElement();
561 } 561 }
562 562
563 if (!target) 563 if (!target)
564 target = doc; 564 target = doc;
565 m_fullScreenChangeEventTargetQueue.append(target); 565 m_fullScreenChangeEventTargetQueue.append(target);
566 } 566 }
567 567
568 } // namespace WebCore 568 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/dom/Event.h ('k') | Source/core/dom/Node.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698