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

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

Issue 2553103004: Refactor IntersectionGeometry class and move it to core/layout. (Closed)
Patch Set: Simplify isContainingBlockChainDescendant Created 4 years 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 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
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
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 bool shouldReportRootBounds = true;
4030 document().frame()->localFrameRoot()->document(), this, Vector<Length>(), 4030 IntersectionGeometry geometry(nullptr, *this, Vector<Length>(),
4031 IntersectionGeometry::ReportRootBounds::kShouldReportRootBounds); 4031 shouldReportRootBounds);
4032 geometry.computeGeometry(); 4032 geometry.computeGeometry();
4033 IntRect intersectRect = geometry.intersectionIntRect(); 4033 IntRect intersectRect = geometry.intersectionIntRect();
4034 if (m_currentIntersectRect == intersectRect) 4034 if (m_currentIntersectRect == intersectRect)
4035 return; 4035 return;
4036 4036
4037 m_currentIntersectRect = intersectRect; 4037 m_currentIntersectRect = intersectRect;
4038 // Reset on any intersection change, since this indicates the user is 4038 // Reset on any intersection change, since this indicates the user is
4039 // scrolling around in the document, the document is changing layout, etc. 4039 // scrolling around in the document, the document is changing layout, etc.
4040 m_viewportFillDebouncerTimer.stop(); 4040 m_viewportFillDebouncerTimer.stop();
4041 bool isMostlyFillingViewport = 4041 bool isMostlyFillingViewport =
(...skipping 13 matching lines...) Expand all
4055 kMostlyFillViewportBecomeStableSeconds, BLINK_FROM_HERE); 4055 kMostlyFillViewportBecomeStableSeconds, BLINK_FROM_HERE);
4056 } 4056 }
4057 4057
4058 void HTMLMediaElement::viewportFillDebouncerTimerFired(TimerBase*) { 4058 void HTMLMediaElement::viewportFillDebouncerTimerFired(TimerBase*) {
4059 m_mostlyFillingViewport = true; 4059 m_mostlyFillingViewport = true;
4060 if (m_webMediaPlayer) 4060 if (m_webMediaPlayer)
4061 m_webMediaPlayer->becameDominantVisibleContent(m_mostlyFillingViewport); 4061 m_webMediaPlayer->becameDominantVisibleContent(m_mostlyFillingViewport);
4062 } 4062 }
4063 4063
4064 } // namespace blink 4064 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/IntersectionObserver.cpp ('k') | third_party/WebKit/Source/core/layout/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698