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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 return false; | 53 return false; |
54 } while ((owner = owner->document().ownerElement())); | 54 } while ((owner = owner->document().ownerElement())); |
55 return true; | 55 return true; |
56 } | 56 } |
57 | 57 |
58 const char* FullscreenElementStack::supplementName() | 58 const char* FullscreenElementStack::supplementName() |
59 { | 59 { |
60 return "FullscreenElementStack"; | 60 return "FullscreenElementStack"; |
61 } | 61 } |
62 | 62 |
63 FullscreenElementStack* FullscreenElementStack::from(Document* document) | 63 FullscreenElementStack& FullscreenElementStack::from(Document& document) |
64 { | 64 { |
65 FullscreenElementStack* fullscreen = fromIfExists(document); | 65 FullscreenElementStack* fullscreen = fromIfExists(document); |
66 if (!fullscreen) { | 66 if (!fullscreen) { |
67 fullscreen = new FullscreenElementStack(document); | 67 fullscreen = new FullscreenElementStack(document); |
68 DocumentSupplement::provideTo(document, supplementName(), adoptPtr(fulls
creen)); | 68 DocumentSupplement::provideTo(document, supplementName(), adoptPtr(fulls
creen)); |
69 } | 69 } |
70 | 70 |
71 return fullscreen; | 71 return *fullscreen; |
72 } | 72 } |
73 | 73 |
74 FullscreenElementStack* FullscreenElementStack::fromIfExistsSlow(Document* docum
ent) | 74 FullscreenElementStack* FullscreenElementStack::fromIfExistsSlow(Document& docum
ent) |
75 { | 75 { |
76 return static_cast<FullscreenElementStack*>(DocumentSupplement::from(documen
t, supplementName())); | 76 return static_cast<FullscreenElementStack*>(DocumentSupplement::from(documen
t, supplementName())); |
77 } | 77 } |
78 | 78 |
79 Element* FullscreenElementStack::fullscreenElementFrom(Document* document) | 79 Element* FullscreenElementStack::fullscreenElementFrom(Document& document) |
80 { | 80 { |
81 if (FullscreenElementStack* found = fromIfExists(document)) | 81 if (FullscreenElementStack* found = fromIfExists(document)) |
82 return found->webkitFullscreenElement(); | 82 return found->webkitFullscreenElement(); |
83 return 0; | 83 return 0; |
84 } | 84 } |
85 | 85 |
86 Element* FullscreenElementStack::currentFullScreenElementFrom(Document* document
) | 86 Element* FullscreenElementStack::currentFullScreenElementFrom(Document& document
) |
87 { | 87 { |
88 if (FullscreenElementStack* found = fromIfExists(document)) | 88 if (FullscreenElementStack* found = fromIfExists(document)) |
89 return found->webkitCurrentFullScreenElement(); | 89 return found->webkitCurrentFullScreenElement(); |
90 return 0; | 90 return 0; |
91 } | 91 } |
92 | 92 |
93 bool FullscreenElementStack::isFullScreen(Document* document) | 93 bool FullscreenElementStack::isFullScreen(Document& document) |
94 { | 94 { |
95 if (FullscreenElementStack* found = fromIfExists(document)) | 95 if (FullscreenElementStack* found = fromIfExists(document)) |
96 return found->webkitIsFullScreen(); | 96 return found->webkitIsFullScreen(); |
97 return false; | 97 return false; |
98 } | 98 } |
99 | 99 |
100 FullscreenElementStack::FullscreenElementStack(Document* document) | 100 FullscreenElementStack::FullscreenElementStack(Document& document) |
101 : DocumentLifecycleObserver(document) | 101 : DocumentLifecycleObserver(&document) |
102 , m_areKeysEnabledInFullScreen(false) | 102 , m_areKeysEnabledInFullScreen(false) |
103 , m_fullScreenRenderer(0) | 103 , m_fullScreenRenderer(0) |
104 , m_fullScreenChangeDelayTimer(this, &FullscreenElementStack::fullScreenChan
geDelayTimerFired) | 104 , m_fullScreenChangeDelayTimer(this, &FullscreenElementStack::fullScreenChan
geDelayTimerFired) |
105 { | 105 { |
106 document->setHasFullscreenElementStack(); | 106 document.setHasFullscreenElementStack(); |
107 } | 107 } |
108 | 108 |
109 FullscreenElementStack::~FullscreenElementStack() | 109 FullscreenElementStack::~FullscreenElementStack() |
110 { | 110 { |
111 } | 111 } |
112 | 112 |
113 inline Document* FullscreenElementStack::document() | 113 inline Document* FullscreenElementStack::document() |
114 { | 114 { |
115 return lifecycleContext(); | 115 return lifecycleContext(); |
116 } | 116 } |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 // made via the legacy Mozilla-style API.) | 164 // made via the legacy Mozilla-style API.) |
165 if (!m_fullScreenElementStack.isEmpty() && !inLegacyMozillaMode) { | 165 if (!m_fullScreenElementStack.isEmpty() && !inLegacyMozillaMode) { |
166 Element* lastElementOnStack = m_fullScreenElementStack.last().get(); | 166 Element* lastElementOnStack = m_fullScreenElementStack.last().get(); |
167 if (lastElementOnStack == element || !lastElementOnStack->contains(e
lement)) | 167 if (lastElementOnStack == element || !lastElementOnStack->contains(e
lement)) |
168 break; | 168 break; |
169 } | 169 } |
170 | 170 |
171 // A descendant browsing context's document has a non-empty fullscreen e
lement stack. | 171 // A descendant browsing context's document has a non-empty fullscreen e
lement stack. |
172 bool descendentHasNonEmptyStack = false; | 172 bool descendentHasNonEmptyStack = false; |
173 for (Frame* descendant = document()->frame() ? document()->frame()->tree
().traverseNext() : 0; descendant; descendant = descendant->tree().traverseNext(
)) { | 173 for (Frame* descendant = document()->frame() ? document()->frame()->tree
().traverseNext() : 0; descendant; descendant = descendant->tree().traverseNext(
)) { |
174 if (fullscreenElementFrom(descendant->document())) { | 174 ASSERT(descendant->document()); |
| 175 if (fullscreenElementFrom(*descendant->document())) { |
175 descendentHasNonEmptyStack = true; | 176 descendentHasNonEmptyStack = true; |
176 break; | 177 break; |
177 } | 178 } |
178 } | 179 } |
179 if (descendentHasNonEmptyStack && !inLegacyMozillaMode) | 180 if (descendentHasNonEmptyStack && !inLegacyMozillaMode) |
180 break; | 181 break; |
181 | 182 |
182 // This algorithm is not allowed to show a pop-up: | 183 // This algorithm is not allowed to show a pop-up: |
183 // An algorithm is allowed to show a pop-up if, in the task in which t
he algorithm is running, either: | 184 // An algorithm is allowed to show a pop-up if, in the task in which t
he algorithm is running, either: |
184 // - an activation behavior is currently being processed whose click e
vent was trusted, or | 185 // - an activation behavior is currently being processed whose click e
vent was trusted, or |
(...skipping 25 matching lines...) Expand all Loading... |
210 | 211 |
211 // 1. Let following document be the document after document in docs,
or null if there is no | 212 // 1. Let following document be the document after document in docs,
or null if there is no |
212 // such document. | 213 // such document. |
213 Document* currentDoc = *current; | 214 Document* currentDoc = *current; |
214 Document* followingDoc = following != docs.end() ? *following : 0; | 215 Document* followingDoc = following != docs.end() ? *following : 0; |
215 | 216 |
216 // 2. If following document is null, push context object on document
's fullscreen element | 217 // 2. If following document is null, push context object on document
's fullscreen element |
217 // stack, and queue a task to fire an event named fullscreenchange w
ith its bubbles attribute | 218 // stack, and queue a task to fire an event named fullscreenchange w
ith its bubbles attribute |
218 // set to true on the document. | 219 // set to true on the document. |
219 if (!followingDoc) { | 220 if (!followingDoc) { |
220 from(currentDoc)->pushFullscreenElementStack(element); | 221 from(*currentDoc).pushFullscreenElementStack(element); |
221 addDocumentToFullScreenChangeEventQueue(currentDoc); | 222 addDocumentToFullScreenChangeEventQueue(currentDoc); |
222 continue; | 223 continue; |
223 } | 224 } |
224 | 225 |
225 // 3. Otherwise, if document's fullscreen element stack is either em
pty or its top element | 226 // 3. Otherwise, if document's fullscreen element stack is either em
pty or its top element |
226 // is not following document's browsing context container, | 227 // is not following document's browsing context container, |
227 Element* topElement = fullscreenElementFrom(currentDoc); | 228 Element* topElement = fullscreenElementFrom(*currentDoc); |
228 if (!topElement || topElement != followingDoc->ownerElement()) { | 229 if (!topElement || topElement != followingDoc->ownerElement()) { |
229 // ...push following document's browsing context container on do
cument's fullscreen element | 230 // ...push following document's browsing context container on do
cument's fullscreen element |
230 // stack, and queue a task to fire an event named fullscreenchan
ge with its bubbles attribute | 231 // stack, and queue a task to fire an event named fullscreenchan
ge with its bubbles attribute |
231 // set to true on document. | 232 // set to true on document. |
232 from(currentDoc)->pushFullscreenElementStack(followingDoc->owner
Element()); | 233 from(*currentDoc).pushFullscreenElementStack(followingDoc->owner
Element()); |
233 addDocumentToFullScreenChangeEventQueue(currentDoc); | 234 addDocumentToFullScreenChangeEventQueue(currentDoc); |
234 continue; | 235 continue; |
235 } | 236 } |
236 | 237 |
237 // 4. Otherwise, do nothing for this document. It stays the same. | 238 // 4. Otherwise, do nothing for this document. It stays the same. |
238 } while (++current != docs.end()); | 239 } while (++current != docs.end()); |
239 | 240 |
240 // 5. Return, and run the remaining steps asynchronously. | 241 // 5. Return, and run the remaining steps asynchronously. |
241 // 6. Optionally, perform some animation. | 242 // 6. Optionally, perform some animation. |
242 m_areKeysEnabledInFullScreen = flags & Element::ALLOW_KEYBOARD_INPUT; | 243 m_areKeysEnabledInFullScreen = flags & Element::ALLOW_KEYBOARD_INPUT; |
243 document()->frameHost()->chrome().client().enterFullScreenForElement(ele
ment); | 244 document()->frameHost()->chrome().client().enterFullScreenForElement(ele
ment); |
244 | 245 |
245 // 7. Optionally, display a message indicating how the user can exit dis
playing the context object fullscreen. | 246 // 7. Optionally, display a message indicating how the user can exit dis
playing the context object fullscreen. |
246 return; | 247 return; |
247 } while (0); | 248 } while (0); |
248 | 249 |
249 m_fullScreenErrorEventTargetQueue.append(element ? element : document()->doc
umentElement()); | 250 m_fullScreenErrorEventTargetQueue.append(element ? element : document()->doc
umentElement()); |
250 m_fullScreenChangeDelayTimer.startOneShot(0); | 251 m_fullScreenChangeDelayTimer.startOneShot(0); |
251 } | 252 } |
252 | 253 |
253 void FullscreenElementStack::webkitCancelFullScreen() | 254 void FullscreenElementStack::webkitCancelFullScreen() |
254 { | 255 { |
| 256 ASSERT(document()->topDocument()); |
255 // The Mozilla "cancelFullScreen()" API behaves like the W3C "fully exit ful
lscreen" behavior, which | 257 // The Mozilla "cancelFullScreen()" API behaves like the W3C "fully exit ful
lscreen" behavior, which |
256 // is defined as: | 258 // is defined as: |
257 // "To fully exit fullscreen act as if the exitFullscreen() method was invok
ed on the top-level browsing | 259 // "To fully exit fullscreen act as if the exitFullscreen() method was invok
ed on the top-level browsing |
258 // context's document and subsequently empty that document's fullscreen elem
ent stack." | 260 // context's document and subsequently empty that document's fullscreen elem
ent stack." |
259 if (!fullscreenElementFrom(document()->topDocument())) | 261 if (!fullscreenElementFrom(*document()->topDocument())) |
260 return; | 262 return; |
261 | 263 |
262 // To achieve that aim, remove all the elements from the top document's stac
k except for the first before | 264 // To achieve that aim, remove all the elements from the top document's stac
k except for the first before |
263 // calling webkitExitFullscreen(): | 265 // calling webkitExitFullscreen(): |
264 Vector<RefPtr<Element> > replacementFullscreenElementStack; | 266 Vector<RefPtr<Element> > replacementFullscreenElementStack; |
265 replacementFullscreenElementStack.append(fullscreenElementFrom(document()->t
opDocument())); | 267 replacementFullscreenElementStack.append(fullscreenElementFrom(*document()->
topDocument())); |
266 FullscreenElementStack* topFullscreenElementStack = from(document()->topDocu
ment()); | 268 FullscreenElementStack& topFullscreenElementStack = from(*document()->topDoc
ument()); |
267 topFullscreenElementStack->m_fullScreenElementStack.swap(replacementFullscre
enElementStack); | 269 topFullscreenElementStack.m_fullScreenElementStack.swap(replacementFullscree
nElementStack); |
268 topFullscreenElementStack->webkitExitFullscreen(); | 270 topFullscreenElementStack.webkitExitFullscreen(); |
269 } | 271 } |
270 | 272 |
271 void FullscreenElementStack::webkitExitFullscreen() | 273 void FullscreenElementStack::webkitExitFullscreen() |
272 { | 274 { |
273 // The exitFullscreen() method must run these steps: | 275 // The exitFullscreen() method must run these steps: |
274 | 276 |
275 // 1. Let doc be the context object. (i.e. "this") | 277 // 1. Let doc be the context object. (i.e. "this") |
276 Document* currentDoc = document(); | 278 Document* currentDoc = document(); |
277 ASSERT(currentDoc->isActive()); | 279 ASSERT(currentDoc->isActive()); |
278 | 280 |
279 // 2. If doc's fullscreen element stack is empty, terminate these steps. | 281 // 2. If doc's fullscreen element stack is empty, terminate these steps. |
280 if (m_fullScreenElementStack.isEmpty()) | 282 if (m_fullScreenElementStack.isEmpty()) |
281 return; | 283 return; |
282 | 284 |
283 // 3. Let descendants be all the doc's descendant browsing context's documen
ts with a non-empty fullscreen | 285 // 3. Let descendants be all the doc's descendant browsing context's documen
ts with a non-empty fullscreen |
284 // element stack (if any), ordered so that the child of the doc is last and
the document furthest | 286 // element stack (if any), ordered so that the child of the doc is last and
the document furthest |
285 // away from the doc is first. | 287 // away from the doc is first. |
286 Deque<RefPtr<Document> > descendants; | 288 Deque<RefPtr<Document> > descendants; |
287 for (Frame* descendant = document()->frame() ? document()->frame()->tree().
traverseNext() : 0; descendant; descendant = descendant->tree().traverseNext())
{ | 289 for (Frame* descendant = document()->frame() ? document()->frame()->tree().
traverseNext() : 0; descendant; descendant = descendant->tree().traverseNext())
{ |
288 if (fullscreenElementFrom(descendant->document())) | 290 ASSERT(descendant->document()); |
| 291 if (fullscreenElementFrom(*descendant->document())) |
289 descendants.prepend(descendant->document()); | 292 descendants.prepend(descendant->document()); |
290 } | 293 } |
291 | 294 |
292 // 4. For each descendant in descendants, empty descendant's fullscreen elem
ent stack, and queue a | 295 // 4. For each descendant in descendants, empty descendant's fullscreen elem
ent stack, and queue a |
293 // task to fire an event named fullscreenchange with its bubbles attribute s
et to true on descendant. | 296 // task to fire an event named fullscreenchange with its bubbles attribute s
et to true on descendant. |
294 for (Deque<RefPtr<Document> >::iterator i = descendants.begin(); i != descen
dants.end(); ++i) { | 297 for (Deque<RefPtr<Document> >::iterator i = descendants.begin(); i != descen
dants.end(); ++i) { |
295 from(i->get())->clearFullscreenElementStack(); | 298 ASSERT(*i); |
| 299 from(**i).clearFullscreenElementStack(); |
296 addDocumentToFullScreenChangeEventQueue(i->get()); | 300 addDocumentToFullScreenChangeEventQueue(i->get()); |
297 } | 301 } |
298 | 302 |
299 // 5. While doc is not null, run these substeps: | 303 // 5. While doc is not null, run these substeps: |
300 Element* newTop = 0; | 304 Element* newTop = 0; |
301 while (currentDoc) { | 305 while (currentDoc) { |
302 // 1. Pop the top element of doc's fullscreen element stack. | 306 // 1. Pop the top element of doc's fullscreen element stack. |
303 from(currentDoc)->popFullscreenElementStack(); | 307 from(*currentDoc).popFullscreenElementStack(); |
304 | 308 |
305 // If doc's fullscreen element stack is non-empty and the element now
at the top is either | 309 // If doc's fullscreen element stack is non-empty and the element now
at the top is either |
306 // not in a document or its node document is not doc, repeat this sub
step. | 310 // not in a document or its node document is not doc, repeat this sub
step. |
307 newTop = fullscreenElementFrom(currentDoc); | 311 newTop = fullscreenElementFrom(*currentDoc); |
308 if (newTop && (!newTop->inDocument() || newTop->document() != currentDoc
)) | 312 if (newTop && (!newTop->inDocument() || newTop->document() != currentDoc
)) |
309 continue; | 313 continue; |
310 | 314 |
311 // 2. Queue a task to fire an event named fullscreenchange with its bubb
les attribute set to true | 315 // 2. Queue a task to fire an event named fullscreenchange with its bubb
les attribute set to true |
312 // on doc. | 316 // on doc. |
313 addDocumentToFullScreenChangeEventQueue(currentDoc); | 317 addDocumentToFullScreenChangeEventQueue(currentDoc); |
314 | 318 |
315 // 3. If doc's fullscreen element stack is empty and doc's browsing cont
ext has a browsing context | 319 // 3. If doc's fullscreen element stack is empty and doc's browsing cont
ext has a browsing context |
316 // container, set doc to that browsing context container's node document
. | 320 // container, set doc to that browsing context container's node document
. |
317 if (!newTop && currentDoc->ownerElement()) { | 321 if (!newTop && currentDoc->ownerElement()) { |
(...skipping 20 matching lines...) Expand all Loading... |
338 // full screen stack. | 342 // full screen stack. |
339 if (!newTop) { | 343 if (!newTop) { |
340 host->chrome().client().exitFullScreenForElement(m_fullScreenElement.get
()); | 344 host->chrome().client().exitFullScreenForElement(m_fullScreenElement.get
()); |
341 return; | 345 return; |
342 } | 346 } |
343 | 347 |
344 // Otherwise, notify the chrome of the new full screen element. | 348 // Otherwise, notify the chrome of the new full screen element. |
345 host->chrome().client().enterFullScreenForElement(newTop); | 349 host->chrome().client().enterFullScreenForElement(newTop); |
346 } | 350 } |
347 | 351 |
348 bool FullscreenElementStack::webkitFullscreenEnabled(Document* document) | 352 bool FullscreenElementStack::webkitFullscreenEnabled(Document& document) |
349 { | 353 { |
350 // 4. The fullscreenEnabled attribute must return true if the context object
and all ancestor | 354 // 4. The fullscreenEnabled attribute must return true if the context object
and all ancestor |
351 // browsing context's documents have their fullscreen enabled flag set, or f
alse otherwise. | 355 // browsing context's documents have their fullscreen enabled flag set, or f
alse otherwise. |
352 | 356 |
353 // Top-level browsing contexts are implied to have their allowFullScreen att
ribute set. | 357 // Top-level browsing contexts are implied to have their allowFullScreen att
ribute set. |
354 return isAttributeOnAllOwners(allowfullscreenAttr, webkitallowfullscreenAttr
, document->ownerElement()); | 358 return isAttributeOnAllOwners(allowfullscreenAttr, webkitallowfullscreenAttr
, document.ownerElement()); |
355 | 359 |
356 } | 360 } |
357 | 361 |
358 void FullscreenElementStack::webkitWillEnterFullScreenForElement(Element* elemen
t) | 362 void FullscreenElementStack::webkitWillEnterFullScreenForElement(Element* elemen
t) |
359 { | 363 { |
360 ASSERT(element); | 364 ASSERT(element); |
361 if (!document()->isActive()) | 365 if (!document()->isActive()) |
362 return; | 366 return; |
363 | 367 |
364 ASSERT(document()->settings()); // If we're active we must have settings. | 368 ASSERT(document()->settings()); // If we're active we must have settings. |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
431 | 435 |
432 m_fullScreenElement = 0; | 436 m_fullScreenElement = 0; |
433 document()->setNeedsStyleRecalc(SubtreeStyleChange); | 437 document()->setNeedsStyleRecalc(SubtreeStyleChange); |
434 | 438 |
435 // When webkitCancelFullScreen is called, we call webkitExitFullScreen on th
e topDocument(). That | 439 // When webkitCancelFullScreen is called, we call webkitExitFullScreen on th
e topDocument(). That |
436 // means that the events will be queued there. So if we have no events here,
start the timer on | 440 // means that the events will be queued there. So if we have no events here,
start the timer on |
437 // the exiting document. | 441 // the exiting document. |
438 Document* exitingDocument = document(); | 442 Document* exitingDocument = document(); |
439 if (m_fullScreenChangeEventTargetQueue.isEmpty() && m_fullScreenErrorEventTa
rgetQueue.isEmpty()) | 443 if (m_fullScreenChangeEventTargetQueue.isEmpty() && m_fullScreenErrorEventTa
rgetQueue.isEmpty()) |
440 exitingDocument = document()->topDocument(); | 444 exitingDocument = document()->topDocument(); |
441 from(exitingDocument)->m_fullScreenChangeDelayTimer.startOneShot(0); | 445 ASSERT(exitingDocument); |
| 446 from(*exitingDocument).m_fullScreenChangeDelayTimer.startOneShot(0); |
442 } | 447 } |
443 | 448 |
444 void FullscreenElementStack::setFullScreenRenderer(RenderFullScreen* renderer) | 449 void FullscreenElementStack::setFullScreenRenderer(RenderFullScreen* renderer) |
445 { | 450 { |
446 if (renderer == m_fullScreenRenderer) | 451 if (renderer == m_fullScreenRenderer) |
447 return; | 452 return; |
448 | 453 |
449 if (renderer && m_savedPlaceholderRenderStyle) { | 454 if (renderer && m_savedPlaceholderRenderStyle) { |
450 renderer->createPlaceholder(m_savedPlaceholderRenderStyle.release(), m_s
avedPlaceholderFrameRect); | 455 renderer->createPlaceholder(m_savedPlaceholderRenderStyle.release(), m_s
avedPlaceholderFrameRect); |
451 } else if (renderer && m_fullScreenRenderer && m_fullScreenRenderer->placeho
lder()) { | 456 } else if (renderer && m_fullScreenRenderer && m_fullScreenRenderer->placeho
lder()) { |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
550 void FullscreenElementStack::pushFullscreenElementStack(Element* element) | 555 void FullscreenElementStack::pushFullscreenElementStack(Element* element) |
551 { | 556 { |
552 m_fullScreenElementStack.append(element); | 557 m_fullScreenElementStack.append(element); |
553 } | 558 } |
554 | 559 |
555 void FullscreenElementStack::addDocumentToFullScreenChangeEventQueue(Document* d
oc) | 560 void FullscreenElementStack::addDocumentToFullScreenChangeEventQueue(Document* d
oc) |
556 { | 561 { |
557 ASSERT(doc); | 562 ASSERT(doc); |
558 | 563 |
559 Node* target = 0; | 564 Node* target = 0; |
560 if (FullscreenElementStack* fullscreen = fromIfExists(doc)) { | 565 if (FullscreenElementStack* fullscreen = fromIfExists(*doc)) { |
561 target = fullscreen->webkitFullscreenElement(); | 566 target = fullscreen->webkitFullscreenElement(); |
562 if (!target) | 567 if (!target) |
563 target = fullscreen->webkitCurrentFullScreenElement(); | 568 target = fullscreen->webkitCurrentFullScreenElement(); |
564 } | 569 } |
565 | 570 |
566 if (!target) | 571 if (!target) |
567 target = doc; | 572 target = doc; |
568 m_fullScreenChangeEventTargetQueue.append(target); | 573 m_fullScreenChangeEventTargetQueue.append(target); |
569 } | 574 } |
570 | 575 |
571 } // namespace WebCore | 576 } // namespace WebCore |
OLD | NEW |