OLD | NEW |
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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 return true; | 51 return true; |
52 do { | 52 do { |
53 if (!isHTMLIFrameElement(owner)) | 53 if (!isHTMLIFrameElement(owner)) |
54 return false; | 54 return false; |
55 if (!owner->hasAttribute(allowfullscreenAttr)) | 55 if (!owner->hasAttribute(allowfullscreenAttr)) |
56 return false; | 56 return false; |
57 } while ((owner = owner->document().ownerElement())); | 57 } while ((owner = owner->document().ownerElement())); |
58 return true; | 58 return true; |
59 } | 59 } |
60 | 60 |
| 61 static PassRefPtrWillBeRawPtr<Event> createEvent(const AtomicString& type, Event
Target& target) |
| 62 { |
| 63 RefPtrWillBeRawPtr<Event> event = Event::createBubble(type); |
| 64 event->setTarget(&target); |
| 65 return event; |
| 66 } |
| 67 |
61 const char* FullscreenElementStack::supplementName() | 68 const char* FullscreenElementStack::supplementName() |
62 { | 69 { |
63 return "FullscreenElementStack"; | 70 return "FullscreenElementStack"; |
64 } | 71 } |
65 | 72 |
66 FullscreenElementStack& FullscreenElementStack::from(Document& document) | 73 FullscreenElementStack& FullscreenElementStack::from(Document& document) |
67 { | 74 { |
68 FullscreenElementStack* fullscreen = fromIfExists(document); | 75 FullscreenElementStack* fullscreen = fromIfExists(document); |
69 if (!fullscreen) { | 76 if (!fullscreen) { |
70 fullscreen = new FullscreenElementStack(document); | 77 fullscreen = new FullscreenElementStack(document); |
(...skipping 26 matching lines...) Expand all Loading... |
97 { | 104 { |
98 if (FullscreenElementStack* found = fromIfExists(document)) | 105 if (FullscreenElementStack* found = fromIfExists(document)) |
99 return found->webkitIsFullScreen(); | 106 return found->webkitIsFullScreen(); |
100 return false; | 107 return false; |
101 } | 108 } |
102 | 109 |
103 FullscreenElementStack::FullscreenElementStack(Document& document) | 110 FullscreenElementStack::FullscreenElementStack(Document& document) |
104 : DocumentLifecycleObserver(&document) | 111 : DocumentLifecycleObserver(&document) |
105 , m_areKeysEnabledInFullScreen(false) | 112 , m_areKeysEnabledInFullScreen(false) |
106 , m_fullScreenRenderer(0) | 113 , m_fullScreenRenderer(0) |
107 , m_fullScreenChangeDelayTimer(this, &FullscreenElementStack::fullScreenChan
geDelayTimerFired) | 114 , m_eventQueueTimer(this, &FullscreenElementStack::eventQueueTimerFired) |
108 { | 115 { |
109 document.setHasFullscreenElementStack(); | 116 document.setHasFullscreenElementStack(); |
110 } | 117 } |
111 | 118 |
112 FullscreenElementStack::~FullscreenElementStack() | 119 FullscreenElementStack::~FullscreenElementStack() |
113 { | 120 { |
114 } | 121 } |
115 | 122 |
116 inline Document* FullscreenElementStack::document() | 123 inline Document* FullscreenElementStack::document() |
117 { | 124 { |
118 return lifecycleContext(); | 125 return lifecycleContext(); |
119 } | 126 } |
120 | 127 |
121 void FullscreenElementStack::documentWasDetached() | 128 void FullscreenElementStack::documentWasDetached() |
122 { | 129 { |
123 m_fullScreenChangeEventTargetQueue.clear(); | 130 m_eventQueue.clear(); |
124 m_fullScreenErrorEventTargetQueue.clear(); | |
125 | 131 |
126 if (m_fullScreenRenderer) | 132 if (m_fullScreenRenderer) |
127 setFullScreenRenderer(0); | 133 setFullScreenRenderer(0); |
128 | 134 |
129 #if ENABLE(OILPAN) | 135 #if ENABLE(OILPAN) |
130 m_fullScreenElement = nullptr; | 136 m_fullScreenElement = nullptr; |
131 m_fullScreenElementStack.clear(); | 137 m_fullScreenElementStack.clear(); |
132 #endif | 138 #endif |
133 | 139 |
134 } | 140 } |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 // 1. Let following document be the document after document in docs,
or null if there is no | 233 // 1. Let following document be the document after document in docs,
or null if there is no |
228 // such document. | 234 // such document. |
229 Document* currentDoc = *current; | 235 Document* currentDoc = *current; |
230 Document* followingDoc = following != docs.end() ? *following : 0; | 236 Document* followingDoc = following != docs.end() ? *following : 0; |
231 | 237 |
232 // 2. If following document is null, push context object on document
's fullscreen element | 238 // 2. If following document is null, push context object on document
's fullscreen element |
233 // stack, and queue a task to fire an event named fullscreenchange w
ith its bubbles attribute | 239 // stack, and queue a task to fire an event named fullscreenchange w
ith its bubbles attribute |
234 // set to true on the document. | 240 // set to true on the document. |
235 if (!followingDoc) { | 241 if (!followingDoc) { |
236 from(*currentDoc).pushFullscreenElementStack(element); | 242 from(*currentDoc).pushFullscreenElementStack(element); |
237 addDocumentToFullScreenChangeEventQueue(*currentDoc); | 243 enqueueChangeEvent(*currentDoc); |
238 continue; | 244 continue; |
239 } | 245 } |
240 | 246 |
241 // 3. Otherwise, if document's fullscreen element stack is either em
pty or its top element | 247 // 3. Otherwise, if document's fullscreen element stack is either em
pty or its top element |
242 // is not following document's browsing context container, | 248 // is not following document's browsing context container, |
243 Element* topElement = fullscreenElementFrom(*currentDoc); | 249 Element* topElement = fullscreenElementFrom(*currentDoc); |
244 if (!topElement || topElement != followingDoc->ownerElement()) { | 250 if (!topElement || topElement != followingDoc->ownerElement()) { |
245 // ...push following document's browsing context container on do
cument's fullscreen element | 251 // ...push following document's browsing context container on do
cument's fullscreen element |
246 // stack, and queue a task to fire an event named fullscreenchan
ge with its bubbles attribute | 252 // stack, and queue a task to fire an event named fullscreenchan
ge with its bubbles attribute |
247 // set to true on document. | 253 // set to true on document. |
248 from(*currentDoc).pushFullscreenElementStack(*followingDoc->owne
rElement()); | 254 from(*currentDoc).pushFullscreenElementStack(*followingDoc->owne
rElement()); |
249 addDocumentToFullScreenChangeEventQueue(*currentDoc); | 255 enqueueChangeEvent(*currentDoc); |
250 continue; | 256 continue; |
251 } | 257 } |
252 | 258 |
253 // 4. Otherwise, do nothing for this document. It stays the same. | 259 // 4. Otherwise, do nothing for this document. It stays the same. |
254 } while (++current != docs.end()); | 260 } while (++current != docs.end()); |
255 | 261 |
256 // 5. Return, and run the remaining steps asynchronously. | 262 // 5. Return, and run the remaining steps asynchronously. |
257 // 6. Optionally, perform some animation. | 263 // 6. Optionally, perform some animation. |
258 m_areKeysEnabledInFullScreen = requestType != PrefixedMozillaRequest &&
requestType != PrefixedVideoRequest; | 264 m_areKeysEnabledInFullScreen = requestType != PrefixedMozillaRequest &&
requestType != PrefixedVideoRequest; |
259 document()->frameHost()->chrome().client().enterFullScreenForElement(&el
ement); | 265 document()->frameHost()->chrome().client().enterFullScreenForElement(&el
ement); |
260 | 266 |
261 // 7. Optionally, display a message indicating how the user can exit dis
playing the context object fullscreen. | 267 // 7. Optionally, display a message indicating how the user can exit dis
playing the context object fullscreen. |
262 return; | 268 return; |
263 } while (0); | 269 } while (0); |
264 | 270 |
265 m_fullScreenErrorEventTargetQueue.append(&element); | 271 enqueueErrorEvent(element); |
266 m_fullScreenChangeDelayTimer.startOneShot(0, FROM_HERE); | |
267 } | 272 } |
268 | 273 |
269 void FullscreenElementStack::webkitCancelFullScreen() | 274 void FullscreenElementStack::webkitCancelFullScreen() |
270 { | 275 { |
271 // The Mozilla "cancelFullScreen()" API behaves like the W3C "fully exit ful
lscreen" behavior, which | 276 // The Mozilla "cancelFullScreen()" API behaves like the W3C "fully exit ful
lscreen" behavior, which |
272 // is defined as: | 277 // is defined as: |
273 // "To fully exit fullscreen act as if the exitFullscreen() method was invok
ed on the top-level browsing | 278 // "To fully exit fullscreen act as if the exitFullscreen() method was invok
ed on the top-level browsing |
274 // context's document and subsequently empty that document's fullscreen elem
ent stack." | 279 // context's document and subsequently empty that document's fullscreen elem
ent stack." |
275 if (!fullscreenElementFrom(document()->topDocument())) | 280 if (!fullscreenElementFrom(document()->topDocument())) |
276 return; | 281 return; |
(...skipping 30 matching lines...) Expand all Loading... |
307 ASSERT(toLocalFrame(descendant)->document()); | 312 ASSERT(toLocalFrame(descendant)->document()); |
308 if (fullscreenElementFrom(*toLocalFrame(descendant)->document())) | 313 if (fullscreenElementFrom(*toLocalFrame(descendant)->document())) |
309 descendants.prepend(toLocalFrame(descendant)->document()); | 314 descendants.prepend(toLocalFrame(descendant)->document()); |
310 } | 315 } |
311 | 316 |
312 // 4. For each descendant in descendants, empty descendant's fullscreen elem
ent stack, and queue a | 317 // 4. For each descendant in descendants, empty descendant's fullscreen elem
ent stack, and queue a |
313 // task to fire an event named fullscreenchange with its bubbles attribute s
et to true on descendant. | 318 // task to fire an event named fullscreenchange with its bubbles attribute s
et to true on descendant. |
314 for (WillBeHeapDeque<RefPtrWillBeMember<Document> >::iterator i = descendant
s.begin(); i != descendants.end(); ++i) { | 319 for (WillBeHeapDeque<RefPtrWillBeMember<Document> >::iterator i = descendant
s.begin(); i != descendants.end(); ++i) { |
315 ASSERT(*i); | 320 ASSERT(*i); |
316 from(**i).clearFullscreenElementStack(); | 321 from(**i).clearFullscreenElementStack(); |
317 addDocumentToFullScreenChangeEventQueue(**i); | 322 enqueueChangeEvent(**i); |
318 } | 323 } |
319 | 324 |
320 // 5. While doc is not null, run these substeps: | 325 // 5. While doc is not null, run these substeps: |
321 Element* newTop = 0; | 326 Element* newTop = 0; |
322 while (currentDoc) { | 327 while (currentDoc) { |
323 // 1. Pop the top element of doc's fullscreen element stack. | 328 // 1. Pop the top element of doc's fullscreen element stack. |
324 from(*currentDoc).popFullscreenElementStack(); | 329 from(*currentDoc).popFullscreenElementStack(); |
325 | 330 |
326 // If doc's fullscreen element stack is non-empty and the element now
at the top is either | 331 // If doc's fullscreen element stack is non-empty and the element now
at the top is either |
327 // not in a document or its node document is not doc, repeat this sub
step. | 332 // not in a document or its node document is not doc, repeat this sub
step. |
328 newTop = fullscreenElementFrom(*currentDoc); | 333 newTop = fullscreenElementFrom(*currentDoc); |
329 if (newTop && (!newTop->inDocument() || newTop->document() != currentDoc
)) | 334 if (newTop && (!newTop->inDocument() || newTop->document() != currentDoc
)) |
330 continue; | 335 continue; |
331 | 336 |
332 // 2. Queue a task to fire an event named fullscreenchange with its bubb
les attribute set to true | 337 // 2. Queue a task to fire an event named fullscreenchange with its bubb
les attribute set to true |
333 // on doc. | 338 // on doc. |
334 addDocumentToFullScreenChangeEventQueue(*currentDoc); | 339 enqueueChangeEvent(*currentDoc); |
335 | 340 |
336 // 3. If doc's fullscreen element stack is empty and doc's browsing cont
ext has a browsing context | 341 // 3. If doc's fullscreen element stack is empty and doc's browsing cont
ext has a browsing context |
337 // container, set doc to that browsing context container's node document
. | 342 // container, set doc to that browsing context container's node document
. |
338 if (!newTop && currentDoc->ownerElement()) { | 343 if (!newTop && currentDoc->ownerElement()) { |
339 currentDoc = ¤tDoc->ownerElement()->document(); | 344 currentDoc = ¤tDoc->ownerElement()->document(); |
340 continue; | 345 continue; |
341 } | 346 } |
342 | 347 |
343 // 4. Otherwise, set doc to null. | 348 // 4. Otherwise, set doc to null. |
344 currentDoc = 0; | 349 currentDoc = 0; |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
410 void FullscreenElementStack::webkitDidEnterFullScreenForElement(Element*) | 415 void FullscreenElementStack::webkitDidEnterFullScreenForElement(Element*) |
411 { | 416 { |
412 if (!m_fullScreenElement) | 417 if (!m_fullScreenElement) |
413 return; | 418 return; |
414 | 419 |
415 if (!document()->isActive()) | 420 if (!document()->isActive()) |
416 return; | 421 return; |
417 | 422 |
418 m_fullScreenElement->didBecomeFullscreenElement(); | 423 m_fullScreenElement->didBecomeFullscreenElement(); |
419 | 424 |
420 m_fullScreenChangeDelayTimer.startOneShot(0, FROM_HERE); | 425 m_eventQueueTimer.startOneShot(0, FROM_HERE); |
421 } | 426 } |
422 | 427 |
423 void FullscreenElementStack::webkitWillExitFullScreenForElement(Element*) | 428 void FullscreenElementStack::webkitWillExitFullScreenForElement(Element*) |
424 { | 429 { |
425 if (!m_fullScreenElement) | 430 if (!m_fullScreenElement) |
426 return; | 431 return; |
427 | 432 |
428 if (!document()->isActive()) | 433 if (!document()->isActive()) |
429 return; | 434 return; |
430 | 435 |
(...skipping 15 matching lines...) Expand all Loading... |
446 if (m_fullScreenRenderer) | 451 if (m_fullScreenRenderer) |
447 m_fullScreenRenderer->unwrapRenderer(); | 452 m_fullScreenRenderer->unwrapRenderer(); |
448 | 453 |
449 m_fullScreenElement = nullptr; | 454 m_fullScreenElement = nullptr; |
450 document()->setNeedsStyleRecalc(SubtreeStyleChange); | 455 document()->setNeedsStyleRecalc(SubtreeStyleChange); |
451 | 456 |
452 // When webkitCancelFullScreen is called, we call webkitExitFullScreen on th
e topDocument(). That | 457 // When webkitCancelFullScreen is called, we call webkitExitFullScreen on th
e topDocument(). That |
453 // means that the events will be queued there. So if we have no events here,
start the timer on | 458 // means that the events will be queued there. So if we have no events here,
start the timer on |
454 // the exiting document. | 459 // the exiting document. |
455 Document* exitingDocument = document(); | 460 Document* exitingDocument = document(); |
456 if (m_fullScreenChangeEventTargetQueue.isEmpty() && m_fullScreenErrorEventTa
rgetQueue.isEmpty()) | 461 if (m_eventQueue.isEmpty()) |
457 exitingDocument = &document()->topDocument(); | 462 exitingDocument = &document()->topDocument(); |
458 ASSERT(exitingDocument); | 463 ASSERT(exitingDocument); |
459 from(*exitingDocument).m_fullScreenChangeDelayTimer.startOneShot(0, FROM_HER
E); | 464 from(*exitingDocument).m_eventQueueTimer.startOneShot(0, FROM_HERE); |
460 } | 465 } |
461 | 466 |
462 void FullscreenElementStack::setFullScreenRenderer(RenderFullScreen* renderer) | 467 void FullscreenElementStack::setFullScreenRenderer(RenderFullScreen* renderer) |
463 { | 468 { |
464 if (renderer == m_fullScreenRenderer) | 469 if (renderer == m_fullScreenRenderer) |
465 return; | 470 return; |
466 | 471 |
467 if (renderer && m_savedPlaceholderRenderStyle) { | 472 if (renderer && m_savedPlaceholderRenderStyle) { |
468 renderer->createPlaceholder(m_savedPlaceholderRenderStyle.release(), m_s
avedPlaceholderFrameRect); | 473 renderer->createPlaceholder(m_savedPlaceholderRenderStyle.release(), m_s
avedPlaceholderFrameRect); |
469 } else if (renderer && m_fullScreenRenderer && m_fullScreenRenderer->placeho
lder()) { | 474 } else if (renderer && m_fullScreenRenderer && m_fullScreenRenderer->placeho
lder()) { |
470 RenderBlock* placeholder = m_fullScreenRenderer->placeholder(); | 475 RenderBlock* placeholder = m_fullScreenRenderer->placeholder(); |
471 renderer->createPlaceholder(RenderStyle::clone(placeholder->style()), pl
aceholder->frameRect()); | 476 renderer->createPlaceholder(RenderStyle::clone(placeholder->style()), pl
aceholder->frameRect()); |
472 } | 477 } |
473 | 478 |
474 if (m_fullScreenRenderer) | 479 if (m_fullScreenRenderer) |
475 m_fullScreenRenderer->destroy(); | 480 m_fullScreenRenderer->destroy(); |
476 ASSERT(!m_fullScreenRenderer); | 481 ASSERT(!m_fullScreenRenderer); |
477 | 482 |
478 m_fullScreenRenderer = renderer; | 483 m_fullScreenRenderer = renderer; |
479 } | 484 } |
480 | 485 |
481 void FullscreenElementStack::fullScreenRendererDestroyed() | 486 void FullscreenElementStack::fullScreenRendererDestroyed() |
482 { | 487 { |
483 m_fullScreenRenderer = 0; | 488 m_fullScreenRenderer = 0; |
484 } | 489 } |
485 | 490 |
486 void FullscreenElementStack::fullScreenChangeDelayTimerFired(Timer<FullscreenEle
mentStack>*) | 491 void FullscreenElementStack::enqueueChangeEvent(Document& document) |
| 492 { |
| 493 ASSERT(document.hasFullscreenElementStack()); |
| 494 FullscreenElementStack& fullscreen = from(document); |
| 495 |
| 496 EventTarget* target = fullscreen.webkitFullscreenElement(); |
| 497 if (!target) |
| 498 target = fullscreen.webkitCurrentFullScreenElement(); |
| 499 if (!target) |
| 500 target = &document; |
| 501 m_eventQueue.append(createEvent(EventTypeNames::webkitfullscreenchange, *tar
get)); |
| 502 // NOTE: The timer is started in webkitDidEnterFullScreenForElement/webkitDi
dExitFullScreenForElement. |
| 503 } |
| 504 |
| 505 void FullscreenElementStack::enqueueErrorEvent(Element& element) |
| 506 { |
| 507 m_eventQueue.append(createEvent(EventTypeNames::webkitfullscreenerror, eleme
nt)); |
| 508 m_eventQueueTimer.startOneShot(0, FROM_HERE); |
| 509 } |
| 510 |
| 511 void FullscreenElementStack::eventQueueTimerFired(Timer<FullscreenElementStack>*
) |
487 { | 512 { |
488 // Since we dispatch events in this function, it's possible that the | 513 // Since we dispatch events in this function, it's possible that the |
489 // document will be detached and GC'd. We protect it here to make sure we | 514 // document will be detached and GC'd. We protect it here to make sure we |
490 // can finish the function successfully. | 515 // can finish the function successfully. |
491 RefPtrWillBeRawPtr<Document> protectDocument(document()); | 516 RefPtrWillBeRawPtr<Document> protectDocument(document()); |
492 WillBeHeapDeque<RefPtrWillBeMember<Node> > changeQueue; | 517 WillBeHeapDeque<RefPtrWillBeRawPtr<Event> > eventQueue; |
493 m_fullScreenChangeEventTargetQueue.swap(changeQueue); | 518 m_eventQueue.swap(eventQueue); |
494 WillBeHeapDeque<RefPtrWillBeMember<Node> > errorQueue; | |
495 m_fullScreenErrorEventTargetQueue.swap(errorQueue); | |
496 | 519 |
497 while (!changeQueue.isEmpty()) { | 520 while (!eventQueue.isEmpty()) { |
498 RefPtrWillBeRawPtr<Node> node = changeQueue.takeFirst(); | 521 RefPtrWillBeRawPtr<Event> event = eventQueue.takeFirst(); |
| 522 Node* target = event->target()->toNode(); |
499 | 523 |
500 // If the element was removed from our tree, also message the documentEl
ement. | 524 // If the element was removed from our tree, also message the documentEl
ement. |
501 if (!node->inDocument() && document()->documentElement()) | 525 if (!target->inDocument() && document()->documentElement()) |
502 changeQueue.append(document()->documentElement()); | 526 eventQueue.append(createEvent(event->type(), *document()->documentEl
ement())); |
503 | 527 |
504 node->dispatchEvent(Event::createBubble(EventTypeNames::webkitfullscreen
change)); | 528 target->dispatchEvent(event); |
505 } | |
506 | |
507 while (!errorQueue.isEmpty()) { | |
508 RefPtrWillBeRawPtr<Node> node = errorQueue.takeFirst(); | |
509 | |
510 // If the element was removed from our tree, also message the documentEl
ement. | |
511 if (!node->inDocument() && document()->documentElement()) | |
512 errorQueue.append(document()->documentElement()); | |
513 | |
514 node->dispatchEvent(Event::createBubble(EventTypeNames::webkitfullscreen
error)); | |
515 } | 529 } |
516 } | 530 } |
517 | 531 |
518 void FullscreenElementStack::fullScreenElementRemoved() | 532 void FullscreenElementStack::fullScreenElementRemoved() |
519 { | 533 { |
520 m_fullScreenElement->setContainsFullScreenElementOnAncestorsCrossingFrameBou
ndaries(false); | 534 m_fullScreenElement->setContainsFullScreenElementOnAncestorsCrossingFrameBou
ndaries(false); |
521 webkitCancelFullScreen(); | 535 webkitCancelFullScreen(); |
522 } | 536 } |
523 | 537 |
524 void FullscreenElementStack::removeFullScreenElementOfSubtree(Node* node, bool a
mongChildrenOnly) | 538 void FullscreenElementStack::removeFullScreenElementOfSubtree(Node* node, bool a
mongChildrenOnly) |
(...skipping 26 matching lines...) Expand all Loading... |
551 return; | 565 return; |
552 | 566 |
553 m_fullScreenElementStack.removeLast(); | 567 m_fullScreenElementStack.removeLast(); |
554 } | 568 } |
555 | 569 |
556 void FullscreenElementStack::pushFullscreenElementStack(Element& element) | 570 void FullscreenElementStack::pushFullscreenElementStack(Element& element) |
557 { | 571 { |
558 m_fullScreenElementStack.append(&element); | 572 m_fullScreenElementStack.append(&element); |
559 } | 573 } |
560 | 574 |
561 void FullscreenElementStack::addDocumentToFullScreenChangeEventQueue(Document& d
oc) | |
562 { | |
563 ASSERT(doc.hasFullscreenElementStack()); | |
564 FullscreenElementStack& fullscreen = from(doc); | |
565 | |
566 Node* target = fullscreen.webkitFullscreenElement(); | |
567 if (!target) | |
568 target = fullscreen.webkitCurrentFullScreenElement(); | |
569 if (!target) | |
570 target = &doc; | |
571 m_fullScreenChangeEventTargetQueue.append(target); | |
572 } | |
573 | |
574 void FullscreenElementStack::trace(Visitor* visitor) | 575 void FullscreenElementStack::trace(Visitor* visitor) |
575 { | 576 { |
576 visitor->trace(m_fullScreenElement); | 577 visitor->trace(m_fullScreenElement); |
577 visitor->trace(m_fullScreenElementStack); | 578 visitor->trace(m_fullScreenElementStack); |
578 visitor->trace(m_fullScreenChangeEventTargetQueue); | 579 visitor->trace(m_eventQueue); |
579 visitor->trace(m_fullScreenErrorEventTargetQueue); | |
580 DocumentSupplement::trace(visitor); | 580 DocumentSupplement::trace(visitor); |
581 } | 581 } |
582 | 582 |
583 } // namespace WebCore | 583 } // namespace WebCore |
OLD | NEW |