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

Issue 2701433003: Hide overlay play button if it can't be shown without clipping (Closed)

Created:
3 years, 10 months ago by steimel
Modified:
3 years, 9 months ago
CC:
blink-reviews, blink-reviews-html_chromium.org, blink-reviews-layout_chromium.org, chromium-reviews, dglazkov+blink, eae+blinkwatch, eric.carlson_apple.com, feature-media-reviews_chromium.org, fs, gasubic, jchaffraix+rendering, leviw+renderwatch, mlamouri+watch-blink_chromium.org, pdr+renderingwatchlist_chromium.org, nessy, Srirama, szager+layoutwatch_chromium.org, zoltan1
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Hide overlay play button if it can't be shown without clipping. This CL also refactors MediaControls to listen for size changes via ResizeObserver instead of via notifications from LayoutMedia. Additionally, this CL changes the position of the overlay play button to vertically center on the height of the video minus the height of the media controls panel. BUG=652951 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2 Review-Url: https://codereview.chromium.org/2701433003 Cr-Commit-Position: refs/heads/master@{#456724} Committed: https://chromium.googlesource.com/chromium/src/+/5b069f0bfe05879dc2dfbc32d9b4b171c622d5c3

Patch Set 1 #

Patch Set 2 : Refactor to use ResizeObserver #

Total comments: 12

Patch Set 3 : Initialize MediaControls size on first layout. Other code review feedback #

Patch Set 4 : rebase #

Total comments: 14

Patch Set 5 : avayvod feedback #

Total comments: 2

Patch Set 6 : Add delay to layout test to allow ResizeObserver to run #

Total comments: 10

Patch Set 7 : mlamouri feedback #

Total comments: 11

Patch Set 8 : Use IntSize instead of ints and add layout test #

Patch Set 9 : rebase #

Patch Set 10 : Turn on overlay play button in layout test #

Total comments: 1

Patch Set 11 : Create/Destroy ResizeObserver onInsert/onRemove. Add (currently broken) layout test for moving vide… #

Total comments: 4

Patch Set 12 : Vertically center overlay play button disregarding panel. Handle differences in panel height betwee… #

Total comments: 4

Patch Set 13 : Use new runtime flag to enable overlay play button #

Patch Set 14 : Utilize MediaControlsPainter to recenter play button instead of hacky css #

Patch Set 15 : Fix compile warning for uninitialized variable #

Total comments: 14

Patch Set 16 : mlamouri feedback #

Patch Set 17 : Rebase and fix #

Total comments: 2

Patch Set 18 : Add comments for dependent constants #

Unified diffs Side-by-side diffs Delta from patch set Stats (+288 lines, -72 lines) Patch
M third_party/WebKit/LayoutTests/media/controls-cast-button-narrow.html View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +0 lines, -7 lines 0 comments Download
M third_party/WebKit/LayoutTests/media/controls/download-button-displays-with-preload-none.html View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +0 lines, -6 lines 0 comments Download
A third_party/WebKit/LayoutTests/media/controls/overlay-play-button.js View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +38 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/media/controls/overlay-play-button-document-move.html View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +60 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/media/controls/overlay-play-button-narrow.html View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +52 lines, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/media/media-controls.js View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +6 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/css/mediaControls.css View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/css/mediaControlsAndroid.css View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/html/shadow/MediaControls.h View 1 2 3 4 5 6 7 8 9 10 11 12 4 chunks +14 lines, -7 lines 0 comments Download
M third_party/WebKit/Source/core/html/shadow/MediaControls.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 11 chunks +90 lines, -19 lines 0 comments Download
M third_party/WebKit/Source/core/html/shadow/MediaControlsTest.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 11 chunks +15 lines, -14 lines 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutMedia.h View 1 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutMedia.cpp View 1 2 3 4 5 6 3 chunks +0 lines, -15 lines 0 comments Download
M third_party/WebKit/Source/core/paint/MediaControlsPainter.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 4 chunks +9 lines, -2 lines 0 comments Download

Messages

Total messages: 108 (73 generated)
steimel
PTAL. Not sure if this is the right way to go about this, but I've ...
3 years, 10 months ago (2017-02-16 01:42:06 UTC) #2
mlamouri (slow - plz ping)
The panel is either visible or hidden and has a fixed height depending on the ...
3 years, 10 months ago (2017-02-16 10:29:48 UTC) #3
mlamouri (slow - plz ping)
Just to leave a comment on what we discussed offline: there was a confusion with ...
3 years, 10 months ago (2017-02-20 11:18:39 UTC) #4
steimel
PTAL
3 years, 10 months ago (2017-02-21 17:33:52 UTC) #5
mlamouri (slow - plz ping)
https://codereview.chromium.org/2701433003/diff/20001/third_party/WebKit/Source/core/html/shadow/MediaControls.cpp File third_party/WebKit/Source/core/html/shadow/MediaControls.cpp (right): https://codereview.chromium.org/2701433003/diff/20001/third_party/WebKit/Source/core/html/shadow/MediaControls.cpp#newcode131 third_party/WebKit/Source/core/html/shadow/MediaControls.cpp:131: ~MediaControlsResizeObserverCallback() override{}; nit: s/{};/ = default;/ https://codereview.chromium.org/2701433003/diff/20001/third_party/WebKit/Source/core/html/shadow/MediaControls.cpp#newcode135 third_party/WebKit/Source/core/html/shadow/MediaControls.cpp:135: for ...
3 years, 10 months ago (2017-02-22 11:48:08 UTC) #10
steimel
PTAL :) https://codereview.chromium.org/2701433003/diff/20001/third_party/WebKit/Source/core/html/shadow/MediaControls.cpp File third_party/WebKit/Source/core/html/shadow/MediaControls.cpp (right): https://codereview.chromium.org/2701433003/diff/20001/third_party/WebKit/Source/core/html/shadow/MediaControls.cpp#newcode131 third_party/WebKit/Source/core/html/shadow/MediaControls.cpp:131: ~MediaControlsResizeObserverCallback() override{}; On 2017/02/22 11:48:08, mlamouri wrote: ...
3 years, 10 months ago (2017-02-23 00:53:48 UTC) #12
whywhat
https://codereview.chromium.org/2701433003/diff/60001/third_party/WebKit/Source/core/html/shadow/MediaControls.cpp File third_party/WebKit/Source/core/html/shadow/MediaControls.cpp (right): https://codereview.chromium.org/2701433003/diff/60001/third_party/WebKit/Source/core/html/shadow/MediaControls.cpp#newcode132 third_party/WebKit/Source/core/html/shadow/MediaControls.cpp:132: class MediaControls::MediaControlsResizeObserverCallback nit: could you add a comment to ...
3 years, 10 months ago (2017-02-23 21:37:32 UTC) #20
steimel
PTAL https://codereview.chromium.org/2701433003/diff/60001/third_party/WebKit/Source/core/html/shadow/MediaControls.cpp File third_party/WebKit/Source/core/html/shadow/MediaControls.cpp (right): https://codereview.chromium.org/2701433003/diff/60001/third_party/WebKit/Source/core/html/shadow/MediaControls.cpp#newcode132 third_party/WebKit/Source/core/html/shadow/MediaControls.cpp:132: class MediaControls::MediaControlsResizeObserverCallback On 2017/02/23 21:37:31, whywhat wrote: > ...
3 years, 10 months ago (2017-02-24 00:42:44 UTC) #21
whywhat
Thanks, lgtm. I'm not an owner of this part of the code sadly though *staring ...
3 years, 10 months ago (2017-02-24 00:57:41 UTC) #24
steimel
https://codereview.chromium.org/2701433003/diff/80001/third_party/WebKit/Source/core/html/shadow/MediaControls.cpp File third_party/WebKit/Source/core/html/shadow/MediaControls.cpp (right): https://codereview.chromium.org/2701433003/diff/80001/third_party/WebKit/Source/core/html/shadow/MediaControls.cpp#newcode55 third_party/WebKit/Source/core/html/shadow/MediaControls.cpp:55: constexpr int kAndroidMediaPanelHeight = 48; On 2017/02/24 00:57:41, whywhat ...
3 years, 9 months ago (2017-02-27 15:39:22 UTC) #27
mlamouri (slow - plz ping)
I'm mostly concerned about the ResizeObserver usage in addition of LayoutMedia. I would prefer only ...
3 years, 9 months ago (2017-02-27 18:22:58 UTC) #30
steimel
PTAL https://codereview.chromium.org/2701433003/diff/100001/third_party/WebKit/Source/core/html/shadow/MediaControls.cpp File third_party/WebKit/Source/core/html/shadow/MediaControls.cpp (right): https://codereview.chromium.org/2701433003/diff/100001/third_party/WebKit/Source/core/html/shadow/MediaControls.cpp#newcode52 third_party/WebKit/Source/core/html/shadow/MediaControls.cpp:52: constexpr int kOverlayPlayButtonWidth = 48; On 2017/02/27 18:22:58, ...
3 years, 9 months ago (2017-02-28 00:59:47 UTC) #33
mlamouri (slow - plz ping)
Code lg2m! Thanks for your taking the hard (but better!) path here. You should add ...
3 years, 9 months ago (2017-02-28 16:03:14 UTC) #38
mlamouri (slow - plz ping)
+atotic@ FYI as we are using the ResizeObserver for internal code.
3 years, 9 months ago (2017-02-28 16:05:13 UTC) #40
steimel
PTAL :) https://codereview.chromium.org/2701433003/diff/120001/third_party/WebKit/Source/core/html/shadow/MediaControls.cpp File third_party/WebKit/Source/core/html/shadow/MediaControls.cpp (right): https://codereview.chromium.org/2701433003/diff/120001/third_party/WebKit/Source/core/html/shadow/MediaControls.cpp#newcode199 third_party/WebKit/Source/core/html/shadow/MediaControls.cpp:199: m_effectiveHeight(0), On 2017/02/28 16:03:14, mlamouri wrote: > ...
3 years, 9 months ago (2017-03-01 15:58:31 UTC) #44
atotic
On 2017/02/28 at 16:05:13, mlamouri wrote: > +atotic@ FYI as we are using the ResizeObserver ...
3 years, 9 months ago (2017-03-01 20:27:22 UTC) #53
atotic
https://codereview.chromium.org/2701433003/diff/120001/third_party/WebKit/Source/core/html/shadow/MediaControls.h File third_party/WebKit/Source/core/html/shadow/MediaControls.h (right): https://codereview.chromium.org/2701433003/diff/120001/third_party/WebKit/Source/core/html/shadow/MediaControls.h#newcode225 third_party/WebKit/Source/core/html/shadow/MediaControls.h:225: Member<ResizeObserver> m_resizeObserver; I am not an Oilpan expert, but ...
3 years, 9 months ago (2017-03-01 20:27:35 UTC) #54
mlamouri (slow - plz ping)
On 2017/03/01 at 20:27:35, atotic wrote: > https://codereview.chromium.org/2701433003/diff/120001/third_party/WebKit/Source/core/html/shadow/MediaControls.h > File third_party/WebKit/Source/core/html/shadow/MediaControls.h (right): > > https://codereview.chromium.org/2701433003/diff/120001/third_party/WebKit/Source/core/html/shadow/MediaControls.h#newcode225 ...
3 years, 9 months ago (2017-03-02 09:27:29 UTC) #55
mlamouri (slow - plz ping)
https://codereview.chromium.org/2701433003/diff/180001/third_party/WebKit/Source/core/html/shadow/MediaControls.cpp File third_party/WebKit/Source/core/html/shadow/MediaControls.cpp (right): https://codereview.chromium.org/2701433003/diff/180001/third_party/WebKit/Source/core/html/shadow/MediaControls.cpp#newcode193 third_party/WebKit/Source/core/html/shadow/MediaControls.cpp:193: m_resizeObserver(ResizeObserver::create( I've just added a `onInsertedIntoDocument` and `onRemovedFromDocument` callback ...
3 years, 9 months ago (2017-03-02 13:56:51 UTC) #57
steimel
Okay, so I wanted to get this patchset out today so you could look it ...
3 years, 9 months ago (2017-03-03 01:38:51 UTC) #58
mlamouri (slow - plz ping)
On 2017/03/03 at 01:38:51, steimel wrote: > Okay, so I wanted to get this patchset ...
3 years, 9 months ago (2017-03-03 14:33:57 UTC) #60
steimel
Thanks Mounir! Once your CL lands I'll rebase this one and we'll be good to ...
3 years, 9 months ago (2017-03-03 19:38:54 UTC) #61
ikilpatrick
Drive-by review, I just have some basic questions :) https://codereview.chromium.org/2701433003/diff/220001/third_party/WebKit/Source/core/html/shadow/MediaControls.cpp File third_party/WebKit/Source/core/html/shadow/MediaControls.cpp (right): https://codereview.chromium.org/2701433003/diff/220001/third_party/WebKit/Source/core/html/shadow/MediaControls.cpp#newcode893 third_party/WebKit/Source/core/html/shadow/MediaControls.cpp:893: ...
3 years, 9 months ago (2017-03-03 20:52:30 UTC) #63
steimel
https://codereview.chromium.org/2701433003/diff/220001/third_party/WebKit/Source/core/html/shadow/MediaControls.cpp File third_party/WebKit/Source/core/html/shadow/MediaControls.cpp (right): https://codereview.chromium.org/2701433003/diff/220001/third_party/WebKit/Source/core/html/shadow/MediaControls.cpp#newcode893 third_party/WebKit/Source/core/html/shadow/MediaControls.cpp:893: m_elementSizeChangedTimer.startOneShot(0, BLINK_FROM_HERE); On 2017/03/03 20:52:29, ikilpatrick wrote: > does ...
3 years, 9 months ago (2017-03-06 23:04:13 UTC) #66
steimel
PTAL changes to how I'm centering the overlay play button. Thanks :)
3 years, 9 months ago (2017-03-07 01:52:01 UTC) #70
mlamouri (slow - plz ping)
Sorry I couldn't finish the review there is an issue below. https://codereview.chromium.org/2701433003/diff/280001/third_party/WebKit/Source/core/html/shadow/MediaControls.cpp File third_party/WebKit/Source/core/html/shadow/MediaControls.cpp (right): ...
3 years, 9 months ago (2017-03-07 19:07:31 UTC) #80
mlamouri (slow - plz ping)
lgtm with comments applied. Thanks a lot :) https://codereview.chromium.org/2701433003/diff/280001/third_party/WebKit/LayoutTests/virtual/android/media/controls/overlay-play-button-document-move.html File third_party/WebKit/LayoutTests/virtual/android/media/controls/overlay-play-button-document-move.html (right): https://codereview.chromium.org/2701433003/diff/280001/third_party/WebKit/LayoutTests/virtual/android/media/controls/overlay-play-button-document-move.html#newcode2 third_party/WebKit/LayoutTests/virtual/android/media/controls/overlay-play-button-document-move.html:2: <title>media ...
3 years, 9 months ago (2017-03-08 19:13:04 UTC) #81
steimel
https://codereview.chromium.org/2701433003/diff/280001/third_party/WebKit/LayoutTests/virtual/android/media/controls/overlay-play-button-document-move.html File third_party/WebKit/LayoutTests/virtual/android/media/controls/overlay-play-button-document-move.html (right): https://codereview.chromium.org/2701433003/diff/280001/third_party/WebKit/LayoutTests/virtual/android/media/controls/overlay-play-button-document-move.html#newcode2 third_party/WebKit/LayoutTests/virtual/android/media/controls/overlay-play-button-document-move.html:2: <title>media controls overlay play button document move</title> On 2017/03/08 ...
3 years, 9 months ago (2017-03-09 16:42:25 UTC) #83
steimel
+foolip@ for OWNERS review
3 years, 9 months ago (2017-03-09 16:52:33 UTC) #85
ikilpatrick
https://codereview.chromium.org/2701433003/diff/320001/third_party/WebKit/Source/core/html/shadow/MediaControls.cpp File third_party/WebKit/Source/core/html/shadow/MediaControls.cpp (right): https://codereview.chromium.org/2701433003/diff/320001/third_party/WebKit/Source/core/html/shadow/MediaControls.cpp#newcode54 third_party/WebKit/Source/core/html/shadow/MediaControls.cpp:54: // Defined in core/css/mediaControls.css and core/css/mediaControlsAndroid.css. do you also ...
3 years, 9 months ago (2017-03-09 21:48:14 UTC) #94
steimel
https://codereview.chromium.org/2701433003/diff/320001/third_party/WebKit/Source/core/html/shadow/MediaControls.cpp File third_party/WebKit/Source/core/html/shadow/MediaControls.cpp (right): https://codereview.chromium.org/2701433003/diff/320001/third_party/WebKit/Source/core/html/shadow/MediaControls.cpp#newcode54 third_party/WebKit/Source/core/html/shadow/MediaControls.cpp:54: // Defined in core/css/mediaControls.css and core/css/mediaControlsAndroid.css. On 2017/03/09 21:48:14, ...
3 years, 9 months ago (2017-03-10 15:53:14 UTC) #96
steimel
+dcheng@ for OWNERS review
3 years, 9 months ago (2017-03-13 21:41:50 UTC) #101
foolip
rs lgtm
3 years, 9 months ago (2017-03-14 14:49:55 UTC) #102
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2701433003/340001
3 years, 9 months ago (2017-03-14 14:52:19 UTC) #105
commit-bot: I haz the power
3 years, 9 months ago (2017-03-14 16:26:29 UTC) #108
Message was sent while issue was closed.
Committed patchset #18 (id:340001) as
https://chromium.googlesource.com/chromium/src/+/5b069f0bfe05879dc2dfbc32d9b4...

Powered by Google App Engine
This is Rietveld 408576698