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

Issue 59233014: Setting HTMLMediaElement.controller does not properly remove the 'mediagroup' content attribute (Closed)

Created:
7 years, 1 month ago by Inactive
Modified:
7 years, 1 month ago
CC:
blink-reviews, Nils Barth (inactive), kojih, arv+blink, jsbell+bindings_chromium.org, marja+watch_chromium.org, abarth-chromium, feature-media-reviews_chromium.org, dglazkov+blink, nessy, adamk+blink_chromium.org, Nate Chapin, vcarbune.chromium
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Visibility:
Public.

Description

Setting HTMLMediaElement.controller does not properly remove the 'mediagroup' content attribute Setting HTMLMediaElement.controller does not properly remove the 'mediagroup' content attribute, as mandated by the specification: http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#dom-media-controller We had custom bindings code for the controller attribute setter which attempt to remove the mediaGroup attribute by calling HTMLMediaElement::setMediaGroup(String()). However, while this updates the m_mediaGroup member in HTMLMediaElement, this does not really remove the attribute. Since mediaGroup is a reflected attribute, accessing the mediaGroup attribute from JS will end up calling Element::fastGetAttribute(mediaGroupAttr) on native side, and bypass the value stored in HTMLMediaElement::m_mediaGroup. This CL updates HTMLMediaElement::setController() so that it calls removeAttribute(mediaGroupAttr) to actually remove the attribute. It also gets rid of the custom bindings code and the m_mediaGroup member entirely as it is bug prone. BUG=316636 TEST=media/media-controller.html Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=161812

Patch Set 1 #

Total comments: 5

Patch Set 2 : Fix bug found by Philipj #

Total comments: 4

Patch Set 3 : Fix nits #

Patch Set 4 : Rebase on master #

Unified diffs Side-by-side diffs Delta from patch set Stats (+59 lines, -71 lines) Patch
M LayoutTests/media/media-controller.html View 1 2 2 chunks +19 lines, -1 line 0 comments Download
M LayoutTests/media/media-controller-expected.txt View 1 2 2 chunks +19 lines, -1 line 0 comments Download
M Source/bindings/bindings.gypi View 1 chunk +0 lines, -1 line 0 comments Download
D Source/bindings/v8/custom/V8HTMLMediaElementCustom.cpp View 1 chunk +0 lines, -52 lines 0 comments Download
M Source/core/html/HTMLMediaElement.h View 1 2 4 chunks +5 lines, -5 lines 0 comments Download
M Source/core/html/HTMLMediaElement.cpp View 1 2 3 3 chunks +15 lines, -10 lines 0 comments Download
M Source/core/html/HTMLMediaElement.idl View 1 2 3 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 26 (0 generated)
Inactive
For comparison, the generated code looks like: static void controllerAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) { ...
7 years, 1 month ago (2013-11-07 18:52:20 UTC) #1
haraken
https://codereview.chromium.org/59233014/diff/1/Source/bindings/v8/custom/V8HTMLMediaElementCustom.cpp File Source/bindings/v8/custom/V8HTMLMediaElementCustom.cpp (left): https://codereview.chromium.org/59233014/diff/1/Source/bindings/v8/custom/V8HTMLMediaElementCustom.cpp#oldcode36 Source/bindings/v8/custom/V8HTMLMediaElementCustom.cpp:36: if (!value->IsNull()) { Won't this CL change existing behavior ...
7 years, 1 month ago (2013-11-07 23:31:34 UTC) #2
philipj_slow
https://codereview.chromium.org/59233014/diff/1/Source/core/html/HTMLMediaElement.cpp File Source/core/html/HTMLMediaElement.cpp (right): https://codereview.chromium.org/59233014/diff/1/Source/core/html/HTMLMediaElement.cpp#newcode3776 Source/core/html/HTMLMediaElement.cpp:3776: setMediaGroup(String()); I think removeAttribute(mediagroupAttr) and letting parseAttribute deal with ...
7 years, 1 month ago (2013-11-08 07:00:17 UTC) #3
Inactive
https://codereview.chromium.org/59233014/diff/1/Source/bindings/v8/custom/V8HTMLMediaElementCustom.cpp File Source/bindings/v8/custom/V8HTMLMediaElementCustom.cpp (left): https://codereview.chromium.org/59233014/diff/1/Source/bindings/v8/custom/V8HTMLMediaElementCustom.cpp#oldcode36 Source/bindings/v8/custom/V8HTMLMediaElementCustom.cpp:36: if (!value->IsNull()) { On 2013/11/07 23:31:35, haraken wrote: > ...
7 years, 1 month ago (2013-11-08 15:35:38 UTC) #4
Inactive
https://codereview.chromium.org/59233014/diff/1/Source/core/html/HTMLMediaElement.cpp File Source/core/html/HTMLMediaElement.cpp (right): https://codereview.chromium.org/59233014/diff/1/Source/core/html/HTMLMediaElement.cpp#newcode3776 Source/core/html/HTMLMediaElement.cpp:3776: setMediaGroup(String()); On 2013/11/08 07:00:17, philipj wrote: > I think ...
7 years, 1 month ago (2013-11-08 17:08:30 UTC) #5
Inactive
Fixed the mediaGroup removal bug and extended the layout test to cover this. +tkent since ...
7 years, 1 month ago (2013-11-08 17:11:11 UTC) #6
haraken
> Yes, you are right that the generated handles undefined differently than the > custom ...
7 years, 1 month ago (2013-11-08 17:23:59 UTC) #7
Inactive
On 2013/11/08 17:23:59, haraken wrote: > > Yes, you are right that the generated handles ...
7 years, 1 month ago (2013-11-08 19:46:17 UTC) #8
Inactive
On 2013/11/08 19:46:17, Chris Dumez wrote: > On 2013/11/08 17:23:59, haraken wrote: > > > ...
7 years, 1 month ago (2013-11-08 19:46:45 UTC) #9
philipj_slow
https://codereview.chromium.org/59233014/diff/90002/LayoutTests/media/media-controller.html File LayoutTests/media/media-controller.html (right): https://codereview.chromium.org/59233014/diff/90002/LayoutTests/media/media-controller.html#newcode50 LayoutTests/media/media-controller.html:50: testExpected("video.mediaGroup", ""); Also checking !video.hasAttribute('mediagroup') here and below would ...
7 years, 1 month ago (2013-11-08 19:58:04 UTC) #10
Inactive
https://codereview.chromium.org/59233014/diff/90002/LayoutTests/media/media-controller.html File LayoutTests/media/media-controller.html (right): https://codereview.chromium.org/59233014/diff/90002/LayoutTests/media/media-controller.html#newcode50 LayoutTests/media/media-controller.html:50: testExpected("video.mediaGroup", ""); On 2013/11/08 19:58:04, philipj wrote: > Also ...
7 years, 1 month ago (2013-11-08 20:12:05 UTC) #11
philipj_slow
Non-owner LGTM.
7 years, 1 month ago (2013-11-08 21:09:44 UTC) #12
haraken
> Firefox 25 and IE10 to not appear to support mediacontroller or mediagroup > attribute. ...
7 years, 1 month ago (2013-11-08 21:54:13 UTC) #13
haraken
On 2013/11/08 21:54:13, haraken wrote: > > Firefox 25 and IE10 to not appear to ...
7 years, 1 month ago (2013-11-08 22:04:50 UTC) #14
Inactive
On 2013/11/08 22:04:50, haraken wrote: > On 2013/11/08 21:54:13, haraken wrote: > > > Firefox ...
7 years, 1 month ago (2013-11-08 22:34:45 UTC) #15
Inactive
+acolwell
7 years, 1 month ago (2013-11-08 22:52:30 UTC) #16
philipj_slow
On 2013/11/08 22:34:45, Chris Dumez wrote: > On 2013/11/08 22:04:50, haraken wrote: > > On ...
7 years, 1 month ago (2013-11-09 06:14:05 UTC) #17
Inactive
On 2013/11/09 06:14:05, philipj wrote: > On 2013/11/08 22:34:45, Chris Dumez wrote: > > On ...
7 years, 1 month ago (2013-11-09 18:24:31 UTC) #18
philipj_slow
On 2013/11/09 18:24:31, Chris Dumez wrote: > On 2013/11/09 06:14:05, philipj wrote: > > On ...
7 years, 1 month ago (2013-11-10 14:22:37 UTC) #19
tkent
lgtm. Looks reasonable.
7 years, 1 month ago (2013-11-11 00:28:22 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/ch.dumez@samsung.com/59233014/250001
7 years, 1 month ago (2013-11-11 00:28:41 UTC) #21
commit-bot: I haz the power
Failed to apply patch for Source/core/html/HTMLMediaElement.cpp: While running patch -p1 --forward --force --no-backup-if-mismatch; patching file ...
7 years, 1 month ago (2013-11-11 00:28:47 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/ch.dumez@samsung.com/59233014/430001
7 years, 1 month ago (2013-11-11 14:04:33 UTC) #23
philipj_slow
The pending trybot probably isn't going to fix itself, I had to uncheck the commit ...
7 years, 1 month ago (2013-11-12 10:06:38 UTC) #24
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/ch.dumez@samsung.com/59233014/430001
7 years, 1 month ago (2013-11-12 13:33:12 UTC) #25
commit-bot: I haz the power
7 years, 1 month ago (2013-11-12 15:07:22 UTC) #26
Message was sent while issue was closed.
Change committed as 161812

Powered by Google App Engine
This is Rietveld 408576698