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/ContentType.h" | 76 #include "platform/ContentType.h" |
77 #include "platform/Histogram.h" | 77 #include "platform/Histogram.h" |
78 #include "platform/LayoutTestSupport.h" | 78 #include "platform/LayoutTestSupport.h" |
(...skipping 3946 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4025 visitor->trace(m_client); | 4025 visitor->trace(m_client); |
4026 } | 4026 } |
4027 | 4027 |
4028 DEFINE_TRACE(HTMLMediaElement::AudioSourceProviderImpl) { | 4028 DEFINE_TRACE(HTMLMediaElement::AudioSourceProviderImpl) { |
4029 visitor->trace(m_client); | 4029 visitor->trace(m_client); |
4030 } | 4030 } |
4031 | 4031 |
4032 void HTMLMediaElement::checkViewportIntersectionChanged() { | 4032 void HTMLMediaElement::checkViewportIntersectionChanged() { |
4033 // TODO(xjz): Early return if we not in tab mirroring. | 4033 // TODO(xjz): Early return if we not in tab mirroring. |
4034 | 4034 |
4035 IntersectionGeometry geometry( | 4035 IntersectionGeometry geometry(nullptr, *this, Vector<Length>(), true); |
4036 &document(), this, Vector<Length>(), | |
4037 IntersectionGeometry::ReportRootBounds::kShouldReportRootBounds); | |
4038 geometry.computeGeometry(); | 4036 geometry.computeGeometry(); |
4039 IntRect intersectRect = geometry.intersectionIntRect(); | 4037 IntRect intersectRect = geometry.intersectionIntRect(); |
4040 if (m_currentIntersectRect == intersectRect) | 4038 if (m_currentIntersectRect == intersectRect) |
4041 return; | 4039 return; |
4042 | 4040 |
4043 m_currentIntersectRect = intersectRect; | 4041 m_currentIntersectRect = intersectRect; |
4044 // Reset on any intersection change, since this indicates the user is | 4042 // Reset on any intersection change, since this indicates the user is |
4045 // scrolling around in the document, the document is changing layout, etc. | 4043 // scrolling around in the document, the document is changing layout, etc. |
4046 m_viewportFillDebouncerTimer.stop(); | 4044 m_viewportFillDebouncerTimer.stop(); |
4047 bool isMostlyFillingViewport = | 4045 bool isMostlyFillingViewport = |
(...skipping 13 matching lines...) Expand all Loading... |
4061 kMostlyFillViewportBecomeStableSeconds, BLINK_FROM_HERE); | 4059 kMostlyFillViewportBecomeStableSeconds, BLINK_FROM_HERE); |
4062 } | 4060 } |
4063 | 4061 |
4064 void HTMLMediaElement::viewportFillDebouncerTimerFired(TimerBase*) { | 4062 void HTMLMediaElement::viewportFillDebouncerTimerFired(TimerBase*) { |
4065 m_mostlyFillingViewport = true; | 4063 m_mostlyFillingViewport = true; |
4066 if (m_webMediaPlayer) | 4064 if (m_webMediaPlayer) |
4067 m_webMediaPlayer->becameDominantVisibleContent(m_mostlyFillingViewport); | 4065 m_webMediaPlayer->becameDominantVisibleContent(m_mostlyFillingViewport); |
4068 } | 4066 } |
4069 | 4067 |
4070 } // namespace blink | 4068 } // namespace blink |
OLD | NEW |