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

Side by Side Diff: third_party/WebKit/Source/core/dom/Fullscreen.cpp

Issue 1858163002: Rename inDocument() to inShadowIncludingDocument() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 8 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
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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 // security risk, or platform limitation. 78 // security risk, or platform limitation.
79 return !document.settings() || document.settings()->fullscreenSupported(); 79 return !document.settings() || document.settings()->fullscreenSupported();
80 } 80 }
81 81
82 static bool fullscreenElementReady(const Element& element) 82 static bool fullscreenElementReady(const Element& element)
83 { 83 {
84 // A fullscreen element ready check for an element |element| returns true if all of the 84 // A fullscreen element ready check for an element |element| returns true if all of the
85 // following are true, and false otherwise: 85 // following are true, and false otherwise:
86 86
87 // |element| is in a document. 87 // |element| is in a document.
88 if (!element.inDocument()) 88 if (!element.inShadowIncludingDocument())
89 return false; 89 return false;
90 90
91 // |element|'s node document's fullscreen enabled flag is set. 91 // |element|'s node document's fullscreen enabled flag is set.
92 if (!fullscreenIsAllowedForAllOwners(element.document())) 92 if (!fullscreenIsAllowedForAllOwners(element.document()))
93 return false; 93 return false;
94 94
95 // |element|'s node document's fullscreen element stack is either empty or i ts top element is an 95 // |element|'s node document's fullscreen element stack is either empty or i ts top element is an
96 // inclusive ancestor of |element|. 96 // inclusive ancestor of |element|.
97 if (const Element* topElement = Fullscreen::fullscreenElementFrom(element.do cument())) { 97 if (const Element* topElement = Fullscreen::fullscreenElementFrom(element.do cument())) {
98 if (!topElement->contains(&element)) 98 if (!topElement->contains(&element))
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 Element* newTop = 0; 355 Element* newTop = 0;
356 while (currentDoc) { 356 while (currentDoc) {
357 RequestType requestType = from(*currentDoc).m_fullScreenElementStack.las t().second; 357 RequestType requestType = from(*currentDoc).m_fullScreenElementStack.las t().second;
358 358
359 // 1. Pop the top element of doc's fullscreen element stack. 359 // 1. Pop the top element of doc's fullscreen element stack.
360 from(*currentDoc).popFullscreenElementStack(); 360 from(*currentDoc).popFullscreenElementStack();
361 361
362 // If doc's fullscreen element stack is non-empty and the element now at the top is either 362 // If doc's fullscreen element stack is non-empty and the element now at the top is either
363 // not in a document or its node document is not doc, repeat this sub step. 363 // not in a document or its node document is not doc, repeat this sub step.
364 newTop = fullscreenElementFrom(*currentDoc); 364 newTop = fullscreenElementFrom(*currentDoc);
365 if (newTop && (!newTop->inDocument() || newTop->document() != currentDoc )) 365 if (newTop && (!newTop->inShadowIncludingDocument() || newTop->document( ) != currentDoc))
366 continue; 366 continue;
367 367
368 // 2. Queue a task to fire an event named fullscreenchange with its bubb les attribute set to true 368 // 2. Queue a task to fire an event named fullscreenchange with its bubb les attribute set to true
369 // on doc. 369 // on doc.
370 enqueueChangeEvent(*currentDoc, requestType); 370 enqueueChangeEvent(*currentDoc, requestType);
371 371
372 // 3. If doc's fullscreen element stack is empty and doc's browsing cont ext has a browsing context 372 // 3. If doc's fullscreen element stack is empty and doc's browsing cont ext has a browsing context
373 // container, set doc to that browsing context container's node document . 373 // container, set doc to that browsing context container's node document .
374 if (!newTop && currentDoc->ownerElement()) { 374 if (!newTop && currentDoc->ownerElement()) {
375 currentDoc = &currentDoc->ownerElement()->document(); 375 currentDoc = &currentDoc->ownerElement()->document();
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
551 // can finish the function successfully. 551 // can finish the function successfully.
552 RawPtr<Document> protectDocument(document()); 552 RawPtr<Document> protectDocument(document());
553 HeapDeque<Member<Event>> eventQueue; 553 HeapDeque<Member<Event>> eventQueue;
554 m_eventQueue.swap(eventQueue); 554 m_eventQueue.swap(eventQueue);
555 555
556 while (!eventQueue.isEmpty()) { 556 while (!eventQueue.isEmpty()) {
557 RawPtr<Event> event = eventQueue.takeFirst(); 557 RawPtr<Event> event = eventQueue.takeFirst();
558 Node* target = event->target()->toNode(); 558 Node* target = event->target()->toNode();
559 559
560 // If the element was removed from our tree, also message the documentEl ement. 560 // If the element was removed from our tree, also message the documentEl ement.
561 if (!target->inDocument() && document()->documentElement()) { 561 if (!target->inShadowIncludingDocument() && document()->documentElement( )) {
562 ASSERT(isPrefixed(event->type())); 562 ASSERT(isPrefixed(event->type()));
563 eventQueue.append(createEvent(event->type(), *document()->documentEl ement())); 563 eventQueue.append(createEvent(event->type(), *document()->documentEl ement()));
564 } 564 }
565 565
566 target->dispatchEvent(event); 566 target->dispatchEvent(event);
567 } 567 }
568 } 568 }
569 569
570 void Fullscreen::elementRemoved(Element& oldNode) 570 void Fullscreen::elementRemoved(Element& oldNode)
571 { 571 {
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
611 DEFINE_TRACE(Fullscreen) 611 DEFINE_TRACE(Fullscreen)
612 { 612 {
613 visitor->trace(m_fullScreenElement); 613 visitor->trace(m_fullScreenElement);
614 visitor->trace(m_fullScreenElementStack); 614 visitor->trace(m_fullScreenElementStack);
615 visitor->trace(m_eventQueue); 615 visitor->trace(m_eventQueue);
616 Supplement<Document>::trace(visitor); 616 Supplement<Document>::trace(visitor);
617 DocumentLifecycleObserver::trace(visitor); 617 DocumentLifecycleObserver::trace(visitor);
618 } 618 }
619 619
620 } // namespace blink 620 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Element.cpp ('k') | third_party/WebKit/Source/core/dom/IntersectionObservation.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698