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

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

Issue 1858163002: Rename inDocument() to inShadowIncludingDocument() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 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 603 matching lines...) Expand 10 before | Expand all | Expand 10 after
614 LayoutObject* HTMLMediaElement::createLayoutObject(const ComputedStyle&) 614 LayoutObject* HTMLMediaElement::createLayoutObject(const ComputedStyle&)
615 { 615 {
616 return new LayoutMedia(this); 616 return new LayoutMedia(this);
617 } 617 }
618 618
619 Node::InsertionNotificationRequest HTMLMediaElement::insertedInto(ContainerNode* insertionPoint) 619 Node::InsertionNotificationRequest HTMLMediaElement::insertedInto(ContainerNode* insertionPoint)
620 { 620 {
621 WTF_LOG(Media, "HTMLMediaElement::insertedInto(%p, %p)", this, insertionPoin t); 621 WTF_LOG(Media, "HTMLMediaElement::insertedInto(%p, %p)", this, insertionPoin t);
622 622
623 HTMLElement::insertedInto(insertionPoint); 623 HTMLElement::insertedInto(insertionPoint);
624 if (insertionPoint->inDocument()) { 624 if (insertionPoint->inShadowIncludingDocument()) {
625 UseCounter::count(document(), UseCounter::HTMLMediaElementInDocument); 625 UseCounter::count(document(), UseCounter::HTMLMediaElementInDocument);
626 if (!getAttribute(srcAttr).isEmpty() && m_networkState == NETWORK_EMPTY) { 626 if (!getAttribute(srcAttr).isEmpty() && m_networkState == NETWORK_EMPTY) {
627 m_ignorePreloadNone = false; 627 m_ignorePreloadNone = false;
628 invokeLoadAlgorithm(); 628 invokeLoadAlgorithm();
629 } 629 }
630 } 630 }
631 631
632 return InsertionShouldCallDidNotifySubtreeInsertions; 632 return InsertionShouldCallDidNotifySubtreeInsertions;
633 } 633 }
634 634
(...skipping 2820 matching lines...) Expand 10 before | Expand all | Expand 10 after
3455 3455
3456 ShadowRoot& shadowRoot = ensureUserAgentShadowRoot(); 3456 ShadowRoot& shadowRoot = ensureUserAgentShadowRoot();
3457 assertShadowRootChildren(shadowRoot); 3457 assertShadowRootChildren(shadowRoot);
3458 3458
3459 // The media controls should be inserted after the text track container, 3459 // The media controls should be inserted after the text track container,
3460 // so that they are rendered in front of captions and subtitles. 3460 // so that they are rendered in front of captions and subtitles.
3461 shadowRoot.appendChild(mediaControls); 3461 shadowRoot.appendChild(mediaControls);
3462 3462
3463 assertShadowRootChildren(shadowRoot); 3463 assertShadowRootChildren(shadowRoot);
3464 3464
3465 if (!shouldShowControls() || !inDocument()) 3465 if (!shouldShowControls() || !inShadowIncludingDocument())
3466 mediaControls->hide(); 3466 mediaControls->hide();
3467 } 3467 }
3468 3468
3469 void HTMLMediaElement::configureMediaControls() 3469 void HTMLMediaElement::configureMediaControls()
3470 { 3470 {
3471 if (!inDocument()) { 3471 if (!inShadowIncludingDocument()) {
3472 if (mediaControls()) 3472 if (mediaControls())
3473 mediaControls()->hide(); 3473 mediaControls()->hide();
3474 return; 3474 return;
3475 } 3475 }
3476 3476
3477 ensureMediaControls(); 3477 ensureMediaControls();
3478 mediaControls()->reset(); 3478 mediaControls()->reset();
3479 3479
3480 if (shouldShowControls(RecordMetricsBehavior::DoRecord)) 3480 if (shouldShowControls(RecordMetricsBehavior::DoRecord))
3481 mediaControls()->show(); 3481 mediaControls()->show();
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after
3870 } 3870 }
3871 3871
3872 #if !ENABLE(OILPAN) 3872 #if !ENABLE(OILPAN)
3873 WeakPtr<HTMLMediaElement> HTMLMediaElement::createWeakPtr() 3873 WeakPtr<HTMLMediaElement> HTMLMediaElement::createWeakPtr()
3874 { 3874 {
3875 return m_weakPtrFactory.createWeakPtr(); 3875 return m_weakPtrFactory.createWeakPtr();
3876 } 3876 }
3877 #endif 3877 #endif
3878 3878
3879 } // namespace blink 3879 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698