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

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: 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) 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 611 matching lines...) Expand 10 before | Expand all | Expand 10 after
622 LayoutObject* HTMLMediaElement::createLayoutObject(const ComputedStyle&) 622 LayoutObject* HTMLMediaElement::createLayoutObject(const ComputedStyle&)
623 { 623 {
624 return new LayoutMedia(this); 624 return new LayoutMedia(this);
625 } 625 }
626 626
627 Node::InsertionNotificationRequest HTMLMediaElement::insertedInto(ContainerNode* insertionPoint) 627 Node::InsertionNotificationRequest HTMLMediaElement::insertedInto(ContainerNode* insertionPoint)
628 { 628 {
629 WTF_LOG(Media, "HTMLMediaElement::insertedInto(%p, %p)", this, insertionPoin t); 629 WTF_LOG(Media, "HTMLMediaElement::insertedInto(%p, %p)", this, insertionPoin t);
630 630
631 HTMLElement::insertedInto(insertionPoint); 631 HTMLElement::insertedInto(insertionPoint);
632 if (insertionPoint->inDocument()) { 632 if (insertionPoint->inShadowIncludingDocument()) {
633 UseCounter::count(document(), UseCounter::HTMLMediaElementInDocument); 633 UseCounter::count(document(), UseCounter::HTMLMediaElementInDocument);
634 if (!getAttribute(srcAttr).isEmpty() && m_networkState == NETWORK_EMPTY) { 634 if (!getAttribute(srcAttr).isEmpty() && m_networkState == NETWORK_EMPTY) {
635 m_ignorePreloadNone = false; 635 m_ignorePreloadNone = false;
636 invokeLoadAlgorithm(); 636 invokeLoadAlgorithm();
637 } 637 }
638 } 638 }
639 639
640 return InsertionShouldCallDidNotifySubtreeInsertions; 640 return InsertionShouldCallDidNotifySubtreeInsertions;
641 } 641 }
642 642
(...skipping 2824 matching lines...) Expand 10 before | Expand all | Expand 10 after
3467 3467
3468 ShadowRoot& shadowRoot = ensureUserAgentShadowRoot(); 3468 ShadowRoot& shadowRoot = ensureUserAgentShadowRoot();
3469 assertShadowRootChildren(shadowRoot); 3469 assertShadowRootChildren(shadowRoot);
3470 3470
3471 // The media controls should be inserted after the text track container, 3471 // The media controls should be inserted after the text track container,
3472 // so that they are rendered in front of captions and subtitles. 3472 // so that they are rendered in front of captions and subtitles.
3473 shadowRoot.appendChild(mediaControls); 3473 shadowRoot.appendChild(mediaControls);
3474 3474
3475 assertShadowRootChildren(shadowRoot); 3475 assertShadowRootChildren(shadowRoot);
3476 3476
3477 if (!shouldShowControls() || !inDocument()) 3477 if (!shouldShowControls() || !inShadowIncludingDocument())
3478 mediaControls->hide(); 3478 mediaControls->hide();
3479 } 3479 }
3480 3480
3481 void HTMLMediaElement::configureMediaControls() 3481 void HTMLMediaElement::configureMediaControls()
3482 { 3482 {
3483 if (!inDocument()) { 3483 if (!inShadowIncludingDocument()) {
3484 if (mediaControls()) 3484 if (mediaControls())
3485 mediaControls()->hide(); 3485 mediaControls()->hide();
3486 return; 3486 return;
3487 } 3487 }
3488 3488
3489 ensureMediaControls(); 3489 ensureMediaControls();
3490 mediaControls()->reset(); 3490 mediaControls()->reset();
3491 3491
3492 if (shouldShowControls(RecordMetricsBehavior::DoRecord)) 3492 if (shouldShowControls(RecordMetricsBehavior::DoRecord))
3493 mediaControls()->show(); 3493 mediaControls()->show();
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after
3882 } 3882 }
3883 3883
3884 #if !ENABLE(OILPAN) 3884 #if !ENABLE(OILPAN)
3885 WeakPtr<HTMLMediaElement> HTMLMediaElement::createWeakPtr() 3885 WeakPtr<HTMLMediaElement> HTMLMediaElement::createWeakPtr()
3886 { 3886 {
3887 return m_weakPtrFactory.createWeakPtr(); 3887 return m_weakPtrFactory.createWeakPtr();
3888 } 3888 }
3889 #endif 3889 #endif
3890 3890
3891 } // namespace blink 3891 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLMarqueeElement.cpp ('k') | third_party/WebKit/Source/core/html/HTMLMetaElement-in.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698