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

Issue 127903002: Empty reflected attributes and string literals in extended attributes. (Closed)

Created:
6 years, 11 months ago by sof
Modified:
6 years, 10 months ago
CC:
blink-reviews, kojih, arv+blink, jsbell+bindings_chromium.org, abarth-chromium, marja+watch_chromium.org, adamk+blink_chromium.org, Nate Chapin, watchdog-blink-watchlist_google.com, Inactive
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Visibility:
Public.

Description

Empty reflected attributes and string literals in extended attributes. Encoding the CORS setting attribute http://www.whatwg.org/specs/web-apps/current-work/#cors-settings-attribute as a reflected attribute exposed a missing piece in our reflected attribute handling: attributes that are empty (no value) can separately be mapped to an attribute state. Upon reflection via its IDL attribute, that state must then be mapped to its canonical value/keyword. Support the expression of this through the setting of [ReflectEmpty="value"]. Separately, but also induced by CORS attributes, an attribute value may contain non-identifier characters (as defined by WebIDL), which makes identifiers not a perfect fit for specifying these reflected attribute values (the use of "-" being the direct problem for CORS attribute values.) To address, extended attributes can now take string literals on their right hand sides (e.g., [Attr="B"|"C"|"D"].) Attribute value lists provided with [ReflectOnly=<list>] can then contain the wider range of characters. To go with that, the [ReflectEmpty], [ReflectMissing] and [ReflectInvalid] attributes can also be given string literals on their right hand side, e.g., [ReflectEmpty="Value1", ReflectInvalid="Value2"] The string literal must match one of the values in the [ReflectOnly] list. R=haraken,nbarth BUG=331694 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=164776

Patch Set 1 #

Total comments: 3

Patch Set 2 : Switch to using enumeration types and string literals #

Patch Set 3 : Allow string literals for extended attributes #

Total comments: 2

Patch Set 4 : Comment re: syntactic extension + add Python parser productions (and test.) #

Total comments: 2

Patch Set 5 : docstring formatting #

Unified diffs Side-by-side diffs Delta from patch set Stats (+149 lines, -17 lines) Patch
M Source/bindings/IDLExtendedAttributes.txt View 2 1 chunk +1 line, -0 lines 0 comments Download
M Source/bindings/scripts/code_generator_v8.pm View 1 2 2 chunks +25 lines, -11 lines 0 comments Download
M Source/bindings/scripts/idl_parser.pm View 1 2 3 1 chunk +6 lines, -0 lines 0 comments Download
M Source/bindings/scripts/unstable/blink_idl_parser.py View 1 2 3 4 2 chunks +21 lines, -0 lines 0 comments Download
M Source/bindings/tests/idls/TestObject.idl View 1 2 2 chunks +9 lines, -6 lines 0 comments Download
M Source/bindings/tests/idls/TestObjectPython.idl View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M Source/bindings/tests/results/V8TestObject.cpp View 2 chunks +56 lines, -0 lines 0 comments Download
M Source/bindings/tests/results/V8TestObjectPython.cpp View 1 2 3 2 chunks +30 lines, -0 lines 0 comments Download

Messages

Total messages: 37 (0 generated)
sof
Please take a look when you next have a moment. A missing piece & subtlety ...
6 years, 11 months ago (2014-01-08 10:19:43 UTC) #1
haraken
Specifically, on what DOM attributes are you going to use [ReflectEmpty], [ReflectInvalid] etc? I'm not ...
6 years, 11 months ago (2014-01-08 10:45:37 UTC) #2
sof
On 2014/01/08 10:45:37, haraken wrote: > Specifically, on what DOM attributes are you going to ...
6 years, 11 months ago (2014-01-08 10:49:58 UTC) #3
sof
https://codereview.chromium.org/127903002/diff/1/Source/bindings/scripts/idl_parser.pm File Source/bindings/scripts/idl_parser.pm (right): https://codereview.chromium.org/127903002/diff/1/Source/bindings/scripts/idl_parser.pm#newcode236 Source/bindings/scripts/idl_parser.pm:236: my $identifierTokenPattern = '^([A-Z_a-z][0-9A-Z_a-z-]*)'; On 2014/01/08 10:45:38, haraken wrote: ...
6 years, 11 months ago (2014-01-08 10:50:12 UTC) #4
haraken
On 2014/01/08 10:50:12, sof wrote: > https://codereview.chromium.org/127903002/diff/1/Source/bindings/scripts/idl_parser.pm > File Source/bindings/scripts/idl_parser.pm (right): > > https://codereview.chromium.org/127903002/diff/1/Source/bindings/scripts/idl_parser.pm#newcode236 > ...
6 years, 11 months ago (2014-01-08 10:58:39 UTC) #5
sof
On 2014/01/08 10:58:39, haraken wrote: > On 2014/01/08 10:50:12, sof wrote: > > > https://codereview.chromium.org/127903002/diff/1/Source/bindings/scripts/idl_parser.pm ...
6 years, 11 months ago (2014-01-08 11:01:16 UTC) #6
haraken
On 2014/01/08 10:49:58, sof wrote: > On 2014/01/08 10:45:37, haraken wrote: > > Specifically, on ...
6 years, 11 months ago (2014-01-08 11:03:10 UTC) #7
sof
On 2014/01/08 11:03:10, haraken wrote: > On 2014/01/08 10:49:58, sof wrote: > > On 2014/01/08 ...
6 years, 11 months ago (2014-01-08 11:06:50 UTC) #8
haraken
> Two options: > > - forgo & drop supporting attribute reflection. > - allow ...
6 years, 11 months ago (2014-01-08 11:07:19 UTC) #9
sof
On 2014/01/08 11:07:19, haraken wrote: > > Two options: > > > > - forgo ...
6 years, 11 months ago (2014-01-08 11:09:47 UTC) #10
haraken
On 2014/01/08 11:06:50, sof wrote: > On 2014/01/08 11:03:10, haraken wrote: > > On 2014/01/08 ...
6 years, 11 months ago (2014-01-08 11:12:22 UTC) #11
sof
On 2014/01/08 11:12:22, haraken wrote: > On 2014/01/08 11:06:50, sof wrote: > > On 2014/01/08 ...
6 years, 11 months ago (2014-01-08 11:18:24 UTC) #12
haraken
On 2014/01/08 11:09:47, sof wrote: > On 2014/01/08 11:07:19, haraken wrote: > > > Two ...
6 years, 11 months ago (2014-01-08 11:21:00 UTC) #13
haraken
> > Thanks for the link! Makes sense. > > > > (My point is ...
6 years, 11 months ago (2014-01-08 11:22:00 UTC) #14
Nils Barth (inactive)
Comment on the grammar. https://codereview.chromium.org/127903002/diff/1/Source/bindings/scripts/idl_parser.pm File Source/bindings/scripts/idl_parser.pm (right): https://codereview.chromium.org/127903002/diff/1/Source/bindings/scripts/idl_parser.pm#newcode236 Source/bindings/scripts/idl_parser.pm:236: my $identifierTokenPattern = '^([A-Z_a-z][0-9A-Z_a-z-]*)'; To ...
6 years, 11 months ago (2014-01-08 11:28:28 UTC) #15
sof
On 2014/01/08 11:21:00, haraken wrote: > On 2014/01/08 11:09:47, sof wrote: > > On 2014/01/08 ...
6 years, 11 months ago (2014-01-08 11:30:20 UTC) #16
haraken
> The basic problem is that we want to include more complex data in extended ...
6 years, 11 months ago (2014-01-08 12:38:41 UTC) #17
haraken
(BTW, it's a bit sad we need so many IDL attributes just for [Reflect], although ...
6 years, 11 months ago (2014-01-08 12:40:57 UTC) #18
sof
On 2014/01/08 12:38:41, haraken wrote: > > The basic problem is that we want to ...
6 years, 11 months ago (2014-01-08 12:43:19 UTC) #19
sof
On 2014/01/08 12:40:57, haraken wrote: > (BTW, it's a bit sad we need so many ...
6 years, 11 months ago (2014-01-08 12:52:45 UTC) #20
haraken
On 2014/01/08 12:52:45, sof wrote: > On 2014/01/08 12:40:57, haraken wrote: > > (BTW, it's ...
6 years, 11 months ago (2014-01-08 12:55:25 UTC) #21
sof
On 2014/01/08 11:30:20, sof wrote: > On 2014/01/08 11:21:00, haraken wrote: > > On 2014/01/08 ...
6 years, 11 months ago (2014-01-08 14:44:39 UTC) #22
Nils Barth (inactive)
On 2014/01/08 14:44:39, sof wrote: > Done, switched [ReflectOnly] over to take an enumeration type, ...
6 years, 11 months ago (2014-01-09 00:55:18 UTC) #23
haraken
I read the spec and probably I'm changing my mind (sorry about that). - The ...
6 years, 11 months ago (2014-01-09 01:12:31 UTC) #24
Nils Barth (inactive)
On 2014/01/09 01:12:31, haraken wrote: > I read the spec and probably I'm changing my ...
6 years, 11 months ago (2014-01-09 01:18:40 UTC) #25
haraken
On 2014/01/09 01:18:40, Nils Barth wrote: > On 2014/01/09 01:12:31, haraken wrote: > > I ...
6 years, 11 months ago (2014-01-09 01:31:20 UTC) #26
sof
On 2014/01/09 01:31:20, haraken wrote: > On 2014/01/09 01:18:40, Nils Barth wrote: > > On ...
6 years, 11 months ago (2014-01-09 09:51:48 UTC) #27
haraken
LGTM https://codereview.chromium.org/127903002/diff/320001/Source/bindings/scripts/idl_parser.pm File Source/bindings/scripts/idl_parser.pm (right): https://codereview.chromium.org/127903002/diff/320001/Source/bindings/scripts/idl_parser.pm#newcode1623 Source/bindings/scripts/idl_parser.pm:1623: if ($next->type() == StringToken) { Would you add ...
6 years, 11 months ago (2014-01-09 10:19:04 UTC) #28
sof
https://codereview.chromium.org/127903002/diff/320001/Source/bindings/scripts/idl_parser.pm File Source/bindings/scripts/idl_parser.pm (right): https://codereview.chromium.org/127903002/diff/320001/Source/bindings/scripts/idl_parser.pm#newcode1623 Source/bindings/scripts/idl_parser.pm:1623: if ($next->type() == StringToken) { On 2014/01/09 10:19:05, haraken ...
6 years, 11 months ago (2014-01-09 11:13:16 UTC) #29
Nils Barth (inactive)
On 2014/01/09 11:13:16, sof wrote: > I also added productions to the Python parser; please ...
6 years, 11 months ago (2014-01-09 11:24:16 UTC) #30
Nils Barth (inactive)
https://codereview.chromium.org/127903002/diff/380001/Source/bindings/scripts/unstable/blink_idl_parser.py File Source/bindings/scripts/unstable/blink_idl_parser.py (right): https://codereview.chromium.org/127903002/diff/380001/Source/bindings/scripts/unstable/blink_idl_parser.py#newcode387 Source/bindings/scripts/unstable/blink_idl_parser.py:387: """ One-line docstring please: http://www.python.org/dev/peps/pep-0257/#one-line-docstrings This docstring can be ...
6 years, 11 months ago (2014-01-09 11:24:26 UTC) #31
haraken
> I also added productions to the Python parser; please have a look that no ...
6 years, 11 months ago (2014-01-09 11:24:29 UTC) #32
sof
https://codereview.chromium.org/127903002/diff/380001/Source/bindings/scripts/unstable/blink_idl_parser.py File Source/bindings/scripts/unstable/blink_idl_parser.py (right): https://codereview.chromium.org/127903002/diff/380001/Source/bindings/scripts/unstable/blink_idl_parser.py#newcode387 Source/bindings/scripts/unstable/blink_idl_parser.py:387: """ On 2014/01/09 11:24:27, Nils Barth wrote: > One-line ...
6 years, 11 months ago (2014-01-09 11:42:34 UTC) #33
sof
Assuming we're ok now & pushing this one along. Thanks both, really appreciate it -- ...
6 years, 11 months ago (2014-01-09 12:35:35 UTC) #34
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/sigbjornf@opera.com/127903002/460001
6 years, 11 months ago (2014-01-09 12:36:13 UTC) #35
commit-bot: I haz the power
Change committed as 164776
6 years, 11 months ago (2014-01-09 13:45:23 UTC) #36
Nils Barth (inactive)
6 years, 10 months ago (2014-02-05 07:13:19 UTC) #37
Message was sent while issue was closed.
Python side is:
IDL compiler: [ReflectEmpty]
https://codereview.chromium.org/155623004/

Powered by Google App Engine
This is Rietveld 408576698