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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLVideoElement.cpp

Issue 2758233003: Fix the conditions when fullscreen detector listeners are registered (Closed)
Patch Set: Created 3 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 video->suspendIfNeeded(); 72 video->suspendIfNeeded();
73 return video; 73 return video;
74 } 74 }
75 75
76 DEFINE_TRACE(HTMLVideoElement) { 76 DEFINE_TRACE(HTMLVideoElement) {
77 visitor->trace(m_imageLoader); 77 visitor->trace(m_imageLoader);
78 visitor->trace(m_customControlsFullscreenDetector); 78 visitor->trace(m_customControlsFullscreenDetector);
79 HTMLMediaElement::trace(visitor); 79 HTMLMediaElement::trace(visitor);
80 } 80 }
81 81
82 Node::InsertionNotificationRequest HTMLVideoElement::insertedInto(
83 ContainerNode* insertionPoint) {
84 if (insertionPoint->isConnected() && m_customControlsFullscreenDetector)
85 m_customControlsFullscreenDetector->attach();
86
87 return HTMLMediaElement::insertedInto(insertionPoint);
88 }
89
90 void HTMLVideoElement::removedFrom(ContainerNode* insertionPoint) {
91 HTMLMediaElement::removedFrom(insertionPoint);
92
93 if (insertionPoint->inActiveDocument() && m_customControlsFullscreenDetector)
mlamouri (slow - plz ping) 2017/03/20 17:05:25 OOC, why are you adding this? I did not really und
Zhiqiang Zhang (Slow) 2017/03/20 17:14:22 The check is to see if the node was connected to a
94 m_customControlsFullscreenDetector->detach();
95 }
96
82 void HTMLVideoElement::contextDestroyed(ExecutionContext* context) { 97 void HTMLVideoElement::contextDestroyed(ExecutionContext* context) {
83 if (m_customControlsFullscreenDetector) 98 if (m_customControlsFullscreenDetector)
84 m_customControlsFullscreenDetector->contextDestroyed(); 99 m_customControlsFullscreenDetector->contextDestroyed();
85 100
86 HTMLMediaElement::contextDestroyed(context); 101 HTMLMediaElement::contextDestroyed(context);
87 } 102 }
88 103
89 bool HTMLVideoElement::layoutObjectIsNeeded(const ComputedStyle& style) { 104 bool HTMLVideoElement::layoutObjectIsNeeded(const ComputedStyle& style) {
90 return HTMLElement::layoutObjectIsNeeded(style); 105 return HTMLElement::layoutObjectIsNeeded(style);
91 } 106 }
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 return ScriptPromise(); 402 return ScriptPromise();
388 if (!ImageBitmap::isResizeOptionValid(options, exceptionState)) 403 if (!ImageBitmap::isResizeOptionValid(options, exceptionState))
389 return ScriptPromise(); 404 return ScriptPromise();
390 return ImageBitmapSource::fulfillImageBitmap( 405 return ImageBitmapSource::fulfillImageBitmap(
391 scriptState, 406 scriptState,
392 ImageBitmap::create(this, cropRect, 407 ImageBitmap::create(this, cropRect,
393 eventTarget.toLocalDOMWindow()->document(), options)); 408 eventTarget.toLocalDOMWindow()->document(), options));
394 } 409 }
395 410
396 } // namespace blink 411 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698