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

Issue 1417683004: Media controls refer to less magic state. (Closed)

Created:
5 years, 2 months ago by liberato (no reviews please)
Modified:
5 years, 1 month ago
Reviewers:
philipj_slow
CC:
chromium-reviews, nessy, mlamouri+watch-blink_chromium.org, blink-reviews-html_chromium.org, gasubic, fs, eric.carlson_apple.com, feature-media-reviews_chromium.org, dglazkov+blink, dshwang, slimming-paint-reviews_chromium.org, blink-reviews-paint_chromium.org, blink-reviews, vcarbune.chromium
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Repaint media controls when network state changes. Cause any change in network state in HTMLMediaElement to repaint the media controls, since they rely on it silently during painting. BUG=545704 Committed: https://crrev.com/cf0b46870c0ea22aa558903496685e4fe5b3840c Cr-Commit-Position: refs/heads/master@{#357153}

Patch Set 1 : rebased. #

Patch Set 2 : matched alpha to old value (0.5->0.4) #

Patch Set 3 : made setIsEnabled change css immediately, to not break panel hiding. #

Patch Set 4 : fixed test, marked for rebaseline. #

Patch Set 5 : rebased. #

Patch Set 6 : actually rebaselined tests #

Patch Set 7 : cl feedback #

Patch Set 8 : added sliders and whitespace. #

Total comments: 1

Patch Set 9 : added a test. #

Patch Set 10 : added test to cl for real this time. #

Patch Set 11 : ...because casting to enum really is okay. #

Patch Set 12 : ...because NeedsRebaseline is not a platform type. #

Total comments: 18

Patch Set 13 : cl feedback, switched to reftest. #

Patch Set 14 : rebased, fixed assert. #

Total comments: 13

Patch Set 15 : cl feedback. #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+130 lines, -20 lines) Patch
A third_party/WebKit/LayoutTests/media/controls-repaint-for-network-change.html View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +34 lines, -0 lines 2 comments Download
A third_party/WebKit/LayoutTests/media/controls-repaint-for-network-change-expected.html View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +30 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLMediaElement.h View 1 2 3 4 5 6 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLMediaElement.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 15 chunks +25 lines, -16 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 1 chunk +5 lines, -0 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 3 chunks +21 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/testing/Internals.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +3 lines, -0 lines 1 comment Download
M third_party/WebKit/Source/core/testing/Internals.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +8 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/testing/Internals.idl View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 24 (8 generated)
liberato (no reviews please)
all of the test rebaselines were cases in which the test memorized non-disabled buttons incorrectly. ...
5 years, 2 months ago (2015-10-22 21:33:49 UTC) #4
philipj_slow
This CL is doing a bunch of different things, I'd like to discuss the core ...
5 years, 2 months ago (2015-10-23 08:31:25 UTC) #6
liberato (no reviews please)
On 2015/10/23 08:31:25, philipj wrote: > This CL is doing a bunch of different things, ...
5 years, 2 months ago (2015-10-23 15:04:08 UTC) #7
philipj_slow
I do agree that it's extra strange when the very *same* kind of state (visibility) ...
5 years, 2 months ago (2015-10-23 17:36:17 UTC) #8
philipj_slow
Note sure if you wanted review yet, but this looks great. A test, somehow, would ...
5 years, 2 months ago (2015-10-23 17:41:21 UTC) #9
liberato (no reviews please)
5 years, 2 months ago (2015-10-23 21:58:32 UTC) #11
philipj_slow
Did you forget to upload media/controls-repaint-for-network-change.html?
5 years, 1 month ago (2015-10-26 10:33:00 UTC) #13
liberato (no reviews please)
On 2015/10/26 10:33:00, philipj wrote: > Did you forget to upload media/controls-repaint-for-network-change.html? yes, sorry about ...
5 years, 1 month ago (2015-10-26 14:07:25 UTC) #14
philipj_slow
Actual solution looks good, just some thoughts about the things around it. https://codereview.chromium.org/1417683004/diff/260001/third_party/WebKit/LayoutTests/TestExpectations File third_party/WebKit/LayoutTests/TestExpectations ...
5 years, 1 month ago (2015-10-28 15:14:02 UTC) #15
liberato (no reviews please)
https://chromiumcodereview.appspot.com/1417683004/diff/260001/third_party/WebKit/LayoutTests/TestExpectations File third_party/WebKit/LayoutTests/TestExpectations (right): https://chromiumcodereview.appspot.com/1417683004/diff/260001/third_party/WebKit/LayoutTests/TestExpectations#newcode1005 third_party/WebKit/LayoutTests/TestExpectations:1005: crbug.com/545704 media/controls-repaint-for-network-change.html [ NeedsRebaseline ] On 2015/10/28 15:14:01, philipj ...
5 years, 1 month ago (2015-10-29 16:10:26 UTC) #16
philipj_slow
lgtm % test nits https://chromiumcodereview.appspot.com/1417683004/diff/300001/third_party/WebKit/LayoutTests/media/controls-repaint-for-network-change-expected.html File third_party/WebKit/LayoutTests/media/controls-repaint-for-network-change-expected.html (right): https://chromiumcodereview.appspot.com/1417683004/diff/300001/third_party/WebKit/LayoutTests/media/controls-repaint-for-network-change-expected.html#newcode17 third_party/WebKit/LayoutTests/media/controls-repaint-for-network-change-expected.html:17: var audios = document.getElementById("audio1").src = ...
5 years, 1 month ago (2015-10-30 10:55:37 UTC) #17
liberato (no reviews please)
thanks for the feedback. all addressed, sending to CQ. -fl https://chromiumcodereview.appspot.com/1417683004/diff/300001/third_party/WebKit/LayoutTests/media/controls-repaint-for-network-change-expected.html File third_party/WebKit/LayoutTests/media/controls-repaint-for-network-change-expected.html (right): https://chromiumcodereview.appspot.com/1417683004/diff/300001/third_party/WebKit/LayoutTests/media/controls-repaint-for-network-change-expected.html#newcode17 ...
5 years, 1 month ago (2015-10-30 15:09:07 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1417683004/320001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1417683004/320001
5 years, 1 month ago (2015-10-30 15:09:29 UTC) #21
commit-bot: I haz the power
Committed patchset #15 (id:320001)
5 years, 1 month ago (2015-10-30 18:46:10 UTC) #22
commit-bot: I haz the power
Patchset 15 (id:??) landed as https://crrev.com/cf0b46870c0ea22aa558903496685e4fe5b3840c Cr-Commit-Position: refs/heads/master@{#357153}
5 years, 1 month ago (2015-10-30 18:46:48 UTC) #23
philipj_slow
5 years, 1 month ago (2015-11-03 09:04:06 UTC) #24
Message was sent while issue was closed.
Some follow-ups, can you create a new CL?

https://codereview.chromium.org/1417683004/diff/300001/third_party/WebKit/Sou...
File third_party/WebKit/Source/core/testing/Internals.h (right):

https://codereview.chromium.org/1417683004/diff/300001/third_party/WebKit/Sou...
third_party/WebKit/Source/core/testing/Internals.h:399: void
setMediaElementNetworkState(HTMLMediaElement*, long state);
On 2015/10/30 15:09:07, liberato wrote:
> On 2015/10/30 10:55:37, philipj wrote:
> > The long type in WebIDL <https://heycam.github.io/webidl/#idl-long>
> corresponds
> > to int32_t in C++, and internally int is used if you look at at e.g.
> > Element.scrollWidth or the generated code.
> 
> Done.

The int32_t mention was to point out that WebIDL's long has a very specific
range, but nevertheless int should be used internally.

https://codereview.chromium.org/1417683004/diff/320001/third_party/WebKit/Lay...
File
third_party/WebKit/LayoutTests/media/controls-repaint-for-network-change.html
(right):

https://codereview.chromium.org/1417683004/diff/320001/third_party/WebKit/Lay...
third_party/WebKit/LayoutTests/media/controls-repaint-for-network-change.html:21:
var src = findMediaFile("audio", "content/empty");
This ended up unused.

https://codereview.chromium.org/1417683004/diff/320001/third_party/WebKit/Lay...
third_party/WebKit/LayoutTests/media/controls-repaint-for-network-change.html:24:
window.internals.setMediaElementNetworkState(audios[0], 0);
Hmm, wasn't networkState already 0?

https://codereview.chromium.org/1417683004/diff/320001/third_party/WebKit/Sou...
File third_party/WebKit/Source/core/testing/Internals.h (right):

https://codereview.chromium.org/1417683004/diff/320001/third_party/WebKit/Sou...
third_party/WebKit/Source/core/testing/Internals.h:399: void
setMediaElementNetworkState(HTMLMediaElement*, int32_t state);
This should have been just int.

Powered by Google App Engine
This is Rietveld 408576698