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

Issue 205683003: Update <video muted=""> handling to match spec (Closed)

Created:
6 years, 9 months ago by philipj_slow
Modified:
6 years, 7 months ago
CC:
blink-reviews, gasubic, sof, eae+blinkwatch, fs, eric.carlson_apple.com, feature-media-reviews_chromium.org, dglazkov+blink, nessy, adamk+blink_chromium.org, Inactive, vcarbune.chromium, rwlbuis
Visibility:
Public.

Description

Update <video muted=""> handling to match spec Per spec, "When a media element is created, if it has a muted attribute specified, the user agent must mute the media element's audio output, overriding any user preference." Only a parser-created element can have an attribute at the time it is created. BUG=350303

Patch Set 1 #

Patch Set 2 : import test #

Patch Set 3 : update defaultMuted test #

Unified diffs Side-by-side diffs Delta from patch set Stats (+226 lines, -43 lines) Patch
A LayoutTests/media/muted.html View 1 1 chunk +169 lines, -0 lines 0 comments Download
A LayoutTests/media/muted-expected.txt View 1 1 chunk +26 lines, -0 lines 0 comments Download
M LayoutTests/media/video-defaultmuted.html View 1 2 2 chunks +17 lines, -28 lines 0 comments Download
M LayoutTests/media/video-defaultmuted-expected.txt View 1 2 2 chunks +1 line, -13 lines 0 comments Download
M Source/core/dom/Element.h View 1 2 1 chunk +5 lines, -0 lines 0 comments Download
M Source/core/html/HTMLMediaElement.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/html/HTMLMediaElement.cpp View 1 2 2 chunks +6 lines, -2 lines 0 comments Download
M Source/core/html/parser/HTMLConstructionSite.cpp View 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 16 (0 generated)
philipj_slow
I'm not super proud of the finishParsingAttributes() solution, but I tried for a long to ...
6 years, 9 months ago (2014-03-26 18:25:03 UTC) #1
acolwell GONE FROM CHROMIUM
This looks ok to me, but you should probably have someone who works on the ...
6 years, 9 months ago (2014-03-28 00:24:09 UTC) #2
philipj_slow
tkent, I see that you do some reviewing in this area, can you take a ...
6 years, 9 months ago (2014-03-28 07:32:38 UTC) #3
tkent
Adding parser gurus.
6 years, 9 months ago (2014-03-28 07:36:14 UTC) #4
abarth-chromium
How does this affect http://src.chromium.org/viewvc/blink/trunk/PerformanceTests/Parser/html-parser.html ?
6 years, 9 months ago (2014-03-28 17:20:20 UTC) #5
philipj_slow
On 2014/03/28 17:20:20, abarth wrote: > How does this affect > http://src.chromium.org/viewvc/blink/trunk/PerformanceTests/Parser/html-parser.html > ? The ...
6 years, 9 months ago (2014-03-29 07:08:37 UTC) #6
abarth-chromium
On 2014/03/29 07:08:37, philipj wrote: > On 2014/03/28 17:20:20, abarth wrote: > > How does ...
6 years, 8 months ago (2014-03-29 17:52:55 UTC) #7
philipj_slow
The previous tests were run on my laptop on battery so to be sure I ...
6 years, 8 months ago (2014-03-31 16:25:25 UTC) #8
philipj_slow
I tried moving the virtual call into Element::parserSetAttributes but it's still a 1.5% regression.
6 years, 8 months ago (2014-03-31 16:55:25 UTC) #9
abarth-chromium
Philosophically, I think it would be better if the parser wasn't a special case. We ...
6 years, 8 months ago (2014-03-31 21:17:07 UTC) #10
philipj_slow
On 2014/03/31 21:17:07, abarth wrote: > Philosophically, I think it would be better if the ...
6 years, 8 months ago (2014-04-01 03:57:53 UTC) #11
eseidel
Seems we could just cheat and do this in finishedParsingChildren. If someone has a script ...
6 years, 8 months ago (2014-04-02 19:48:40 UTC) #12
philipj_slow
On 2014/04/02 19:48:40, eseidel wrote: > Seems we could just cheat and do this in ...
6 years, 8 months ago (2014-04-02 20:33:13 UTC) #13
philipj_slow
I filed a new spec bug to hopefully move this along: https://www.w3.org/Bugs/Public/show_bug.cgi?id=25460 I'll close this ...
6 years, 8 months ago (2014-04-25 11:33:41 UTC) #14
eseidel
Sorry if you've covered this above. Can't we just mute from inside parseAttribute()? and only ...
6 years, 7 months ago (2014-05-06 08:45:27 UTC) #15
philipj_slow
6 years, 7 months ago (2014-05-06 10:53:12 UTC) #16
Message was sent while issue was closed.
On 2014/05/06 08:45:27, eseidel wrote:
> Sorry if you've covered this above.
> 
> Can't we just mute from inside parseAttribute()? and only if the element has
> createdByParser set (which the parser knows how to do, you may need to set the
> right flag in HTMLTags.in).

Unfortunately, that also wouldn't match the spec, in a case like this:

<!DOCTYPE html>
<video>
<script>
var v = document.querySelector('video');
v.setAttribute('muted', '');
w(v.muted);
</script>
</video>

(script inside video just to show that also checking isFinishedParsingChildren()
isn't going to help)

It's pretty easy to approximate what the spec says, but I've found no
combination of hacks to match it exactly.

One thought is to add a setByParser attribute to parseAttribute, but would that
be acceptable, assuming it doesn't affect performance?

Powered by Google App Engine
This is Rietveld 408576698