OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights | 2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights |
3 * reserved. | 3 * reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 21 matching lines...) Expand all Loading... | |
32 #include "bindings/core/v8/ScriptController.h" | 32 #include "bindings/core/v8/ScriptController.h" |
33 #include "bindings/core/v8/ScriptEventListener.h" | 33 #include "bindings/core/v8/ScriptEventListener.h" |
34 #include "bindings/core/v8/ScriptPromiseResolver.h" | 34 #include "bindings/core/v8/ScriptPromiseResolver.h" |
35 #include "core/HTMLNames.h" | 35 #include "core/HTMLNames.h" |
36 #include "core/css/MediaList.h" | 36 #include "core/css/MediaList.h" |
37 #include "core/dom/Attribute.h" | 37 #include "core/dom/Attribute.h" |
38 #include "core/dom/DOMException.h" | 38 #include "core/dom/DOMException.h" |
39 #include "core/dom/ElementTraversal.h" | 39 #include "core/dom/ElementTraversal.h" |
40 #include "core/dom/ElementVisibilityObserver.h" | 40 #include "core/dom/ElementVisibilityObserver.h" |
41 #include "core/dom/Fullscreen.h" | 41 #include "core/dom/Fullscreen.h" |
42 #include "core/dom/IntersectionGeometry.h" | |
43 #include "core/dom/TaskRunnerHelper.h" | 42 #include "core/dom/TaskRunnerHelper.h" |
44 #include "core/dom/shadow/ShadowRoot.h" | 43 #include "core/dom/shadow/ShadowRoot.h" |
45 #include "core/events/Event.h" | 44 #include "core/events/Event.h" |
46 #include "core/frame/FrameView.h" | 45 #include "core/frame/FrameView.h" |
47 #include "core/frame/LocalFrame.h" | 46 #include "core/frame/LocalFrame.h" |
48 #include "core/frame/Settings.h" | 47 #include "core/frame/Settings.h" |
49 #include "core/frame/UseCounter.h" | 48 #include "core/frame/UseCounter.h" |
50 #include "core/frame/csp/ContentSecurityPolicy.h" | 49 #include "core/frame/csp/ContentSecurityPolicy.h" |
51 #include "core/html/AutoplayUmaHelper.h" | 50 #include "core/html/AutoplayUmaHelper.h" |
52 #include "core/html/HTMLMediaSource.h" | 51 #include "core/html/HTMLMediaSource.h" |
53 #include "core/html/HTMLSourceElement.h" | 52 #include "core/html/HTMLSourceElement.h" |
54 #include "core/html/HTMLTrackElement.h" | 53 #include "core/html/HTMLTrackElement.h" |
55 #include "core/html/MediaError.h" | 54 #include "core/html/MediaError.h" |
56 #include "core/html/MediaFragmentURIParser.h" | 55 #include "core/html/MediaFragmentURIParser.h" |
57 #include "core/html/TimeRanges.h" | 56 #include "core/html/TimeRanges.h" |
58 #include "core/html/shadow/MediaControls.h" | 57 #include "core/html/shadow/MediaControls.h" |
59 #include "core/html/track/AudioTrack.h" | 58 #include "core/html/track/AudioTrack.h" |
60 #include "core/html/track/AudioTrackList.h" | 59 #include "core/html/track/AudioTrackList.h" |
61 #include "core/html/track/AutomaticTrackSelection.h" | 60 #include "core/html/track/AutomaticTrackSelection.h" |
62 #include "core/html/track/CueTimeline.h" | 61 #include "core/html/track/CueTimeline.h" |
63 #include "core/html/track/InbandTextTrack.h" | 62 #include "core/html/track/InbandTextTrack.h" |
64 #include "core/html/track/TextTrackContainer.h" | 63 #include "core/html/track/TextTrackContainer.h" |
65 #include "core/html/track/TextTrackList.h" | 64 #include "core/html/track/TextTrackList.h" |
66 #include "core/html/track/VideoTrack.h" | 65 #include "core/html/track/VideoTrack.h" |
67 #include "core/html/track/VideoTrackList.h" | 66 #include "core/html/track/VideoTrackList.h" |
68 #include "core/inspector/ConsoleMessage.h" | 67 #include "core/inspector/ConsoleMessage.h" |
68 #include "core/layout/IntersectionGeometry.h" | |
69 #include "core/layout/LayoutMedia.h" | 69 #include "core/layout/LayoutMedia.h" |
70 #include "core/layout/api/LayoutViewItem.h" | 70 #include "core/layout/api/LayoutViewItem.h" |
71 #include "core/layout/compositing/PaintLayerCompositor.h" | 71 #include "core/layout/compositing/PaintLayerCompositor.h" |
72 #include "core/loader/FrameLoader.h" | 72 #include "core/loader/FrameLoader.h" |
73 #include "core/loader/FrameLoaderClient.h" | 73 #include "core/loader/FrameLoaderClient.h" |
74 #include "core/page/ChromeClient.h" | 74 #include "core/page/ChromeClient.h" |
75 #include "core/page/NetworkStateNotifier.h" | 75 #include "core/page/NetworkStateNotifier.h" |
76 #include "platform/Histogram.h" | 76 #include "platform/Histogram.h" |
77 #include "platform/LayoutTestSupport.h" | 77 #include "platform/LayoutTestSupport.h" |
78 #include "platform/RuntimeEnabledFeatures.h" | 78 #include "platform/RuntimeEnabledFeatures.h" |
(...skipping 3940 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4019 visitor->trace(m_client); | 4019 visitor->trace(m_client); |
4020 } | 4020 } |
4021 | 4021 |
4022 DEFINE_TRACE(HTMLMediaElement::AudioSourceProviderImpl) { | 4022 DEFINE_TRACE(HTMLMediaElement::AudioSourceProviderImpl) { |
4023 visitor->trace(m_client); | 4023 visitor->trace(m_client); |
4024 } | 4024 } |
4025 | 4025 |
4026 void HTMLMediaElement::checkViewportIntersectionChanged() { | 4026 void HTMLMediaElement::checkViewportIntersectionChanged() { |
4027 // TODO(xjz): Early return if we not in tab mirroring. | 4027 // TODO(xjz): Early return if we not in tab mirroring. |
4028 | 4028 |
4029 IntersectionGeometry geometry( | 4029 IntersectionGeometry geometry(nullptr, *this, Vector<Length>(), true); |
ojan
2016/12/10 01:18:26
This "true" was the reason I asked for it to be an
szager1
2016/12/10 01:47:10
OK, I added a local variable here to clarify.
| |
4030 document().frame()->localFrameRoot()->document(), this, Vector<Length>(), | |
4031 IntersectionGeometry::ReportRootBounds::kShouldReportRootBounds); | |
4032 geometry.computeGeometry(); | 4030 geometry.computeGeometry(); |
4033 IntRect intersectRect = geometry.intersectionIntRect(); | 4031 IntRect intersectRect = geometry.intersectionIntRect(); |
4034 if (m_currentIntersectRect == intersectRect) | 4032 if (m_currentIntersectRect == intersectRect) |
4035 return; | 4033 return; |
4036 | 4034 |
4037 m_currentIntersectRect = intersectRect; | 4035 m_currentIntersectRect = intersectRect; |
4038 // Reset on any intersection change, since this indicates the user is | 4036 // Reset on any intersection change, since this indicates the user is |
4039 // scrolling around in the document, the document is changing layout, etc. | 4037 // scrolling around in the document, the document is changing layout, etc. |
4040 m_viewportFillDebouncerTimer.stop(); | 4038 m_viewportFillDebouncerTimer.stop(); |
4041 bool isMostlyFillingViewport = | 4039 bool isMostlyFillingViewport = |
(...skipping 13 matching lines...) Expand all Loading... | |
4055 kMostlyFillViewportBecomeStableSeconds, BLINK_FROM_HERE); | 4053 kMostlyFillViewportBecomeStableSeconds, BLINK_FROM_HERE); |
4056 } | 4054 } |
4057 | 4055 |
4058 void HTMLMediaElement::viewportFillDebouncerTimerFired(TimerBase*) { | 4056 void HTMLMediaElement::viewportFillDebouncerTimerFired(TimerBase*) { |
4059 m_mostlyFillingViewport = true; | 4057 m_mostlyFillingViewport = true; |
4060 if (m_webMediaPlayer) | 4058 if (m_webMediaPlayer) |
4061 m_webMediaPlayer->becameDominantVisibleContent(m_mostlyFillingViewport); | 4059 m_webMediaPlayer->becameDominantVisibleContent(m_mostlyFillingViewport); |
4062 } | 4060 } |
4063 | 4061 |
4064 } // namespace blink | 4062 } // namespace blink |
OLD | NEW |