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

Issue 214793005: Use HTMLMediaElement::togglePlayState() where appropriate (Closed)

Created:
6 years, 9 months ago by philipj_slow
Modified:
6 years, 9 months ago
CC:
blink-reviews, nessy, zoltan1, eae+blinkwatch, philipj_slow, gasubic, fs, eric.carlson_apple.com, leviw+renderwatch, feature-media-reviews_chromium.org, dglazkov+blink, adamk+blink_chromium.org, jchaffraix+rendering, dsinclair, bemjb+rendering_chromium.org, pdr., vcarbune.chromium, rune+blink
Visibility:
Public.

Description

Use HTMLMediaElement::togglePlayState() where appropriate togglePlayState() handles the MediaController case correctly, which the updated code paths did not. Introduce togglePlayStateWillPlay() to replace canPlay() and paused() in certain contexts. The readyState < HAVE_METADATA in canPlay() condition is not replicated because the hasSource() checks in paintMediaPlayButton and paintMediaOverlayPlayButton disables the buttons so that they can't be pressed at all. Some corner case seems likely to exist, but was not found in ad-hoc testing. Drop the ASSERT(controls()) in tooglePlayState() since it is now used in contexts not directly tied to MediaControls. The ASSERT doesn't fail yet, but the same ASSERT in togglePlayStateWillPlay() would, since MediaControlPlayButtonElement::updateDisplayType() is called when the controls are created for text track rendering but are not shown. These changes made it possible to reduce the size of MediaControllerInterface a little bit more. BUG=341813 TEST=none, no observable changes intended Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=170296

Patch Set 1 #

Total comments: 2

Patch Set 2 : documentation #

Unified diffs Side-by-side diffs Delta from patch set Stats (+27 lines, -52 lines) Patch
M Source/core/html/HTMLMediaElement.h View 1 3 chunks +6 lines, -5 lines 0 comments Download
M Source/core/html/HTMLMediaElement.cpp View 1 chunk +4 lines, -3 lines 0 comments Download
M Source/core/html/MediaController.h View 2 chunks +3 lines, -5 lines 0 comments Download
M Source/core/html/MediaController.cpp View 1 chunk +0 lines, -12 lines 0 comments Download
M Source/core/html/MediaControllerInterface.h View 2 chunks +0 lines, -6 lines 0 comments Download
M Source/core/html/MediaDocument.cpp View 1 chunk +1 line, -5 lines 0 comments Download
M Source/core/html/shadow/MediaControlElements.cpp View 4 chunks +5 lines, -8 lines 0 comments Download
M Source/core/html/shadow/MediaControls.cpp View 4 chunks +6 lines, -6 lines 0 comments Download
M Source/core/rendering/RenderMediaControls.cpp View 2 chunks +2 lines, -2 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
philipj_slow
PTAL. For a CL of this size I'd like to have produced some new tests, ...
6 years, 9 months ago (2014-03-27 17:26:52 UTC) #1
acolwell GONE FROM CHROMIUM
lgtm % nit https://codereview.chromium.org/214793005/diff/1/Source/core/html/HTMLMediaElement.h File Source/core/html/HTMLMediaElement.h (right): https://codereview.chromium.org/214793005/diff/1/Source/core/html/HTMLMediaElement.h#newcode160 Source/core/html/HTMLMediaElement.h:160: bool togglePlayStateWillPlay() const; nit: How about ...
6 years, 9 months ago (2014-03-28 01:02:52 UTC) #2
philipj_slow
https://codereview.chromium.org/214793005/diff/1/Source/core/html/HTMLMediaElement.h File Source/core/html/HTMLMediaElement.h (right): https://codereview.chromium.org/214793005/diff/1/Source/core/html/HTMLMediaElement.h#newcode160 Source/core/html/HTMLMediaElement.h:160: bool togglePlayStateWillPlay() const; On 2014/03/28 01:02:52, acolwell wrote: > ...
6 years, 9 months ago (2014-03-28 07:22:23 UTC) #3
philipj_slow
The CQ bit was checked by philipj@opera.com
6 years, 9 months ago (2014-03-28 07:22:53 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/philipj@opera.com/214793005/20001
6 years, 9 months ago (2014-03-28 07:22:57 UTC) #5
commit-bot: I haz the power
6 years, 9 months ago (2014-03-28 08:24:00 UTC) #6
Message was sent while issue was closed.
Change committed as 170296

Powered by Google App Engine
This is Rietveld 408576698