Bug 174529 - [WebIDL] Replace some custom bindings code in JSCSSStyleDeclarationCustom.cpp with named getters/setters
Summary: [WebIDL] Replace some custom bindings code in JSCSSStyleDeclarationCustom.cpp...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Sam Weinig
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-07-14 14:13 PDT by Sam Weinig
Modified: 2017-07-18 13:12 PDT (History)
3 users (show)

See Also:


Attachments
Patch (40.70 KB, patch)
2017-07-14 14:40 PDT, Sam Weinig
no flags Details | Formatted Diff | Diff
Patch (40.48 KB, patch)
2017-07-14 14:45 PDT, Sam Weinig
no flags Details | Formatted Diff | Diff
Patch (40.49 KB, patch)
2017-07-14 15:53 PDT, Sam Weinig
no flags Details | Formatted Diff | Diff
Patch (100.92 KB, patch)
2017-07-14 16:55 PDT, Sam Weinig
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews114 for mac-elcapitan (2.07 MB, application/zip)
2017-07-14 18:11 PDT, Build Bot
no flags Details
Archive of layout-test-results from ews106 for mac-elcapitan-wk2 (1.28 MB, application/zip)
2017-07-14 18:14 PDT, Build Bot
no flags Details
Archive of layout-test-results from ews100 for mac-elcapitan (1.25 MB, application/zip)
2017-07-14 18:24 PDT, Build Bot
no flags Details
Archive of layout-test-results from ews121 for ios-simulator-wk2 (982.33 KB, application/zip)
2017-07-14 18:47 PDT, Build Bot
no flags Details
Patch (107.84 KB, patch)
2017-07-15 10:22 PDT, Sam Weinig
no flags Details | Formatted Diff | Diff
Patch (107.50 KB, patch)
2017-07-15 10:35 PDT, Sam Weinig
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews105 for mac-elcapitan-wk2 (1.53 MB, application/zip)
2017-07-15 11:31 PDT, Build Bot
no flags Details
Archive of layout-test-results from ews122 for ios-simulator-wk2 (977.91 KB, application/zip)
2017-07-15 11:54 PDT, Build Bot
no flags Details
Archive of layout-test-results from ews115 for mac-elcapitan (1.78 MB, application/zip)
2017-07-15 12:02 PDT, Build Bot
no flags Details
Patch (108.76 KB, patch)
2017-07-15 13:25 PDT, Sam Weinig
cdumez: review+
cdumez: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sam Weinig 2017-07-14 14:13:51 PDT
[WebIDL] Replace some custom bindings code in JSCSSStyleDeclarationCustom.cpp with named getters/setters
Comment 1 Sam Weinig 2017-07-14 14:40:36 PDT Comment hidden (obsolete)
Comment 2 Sam Weinig 2017-07-14 14:45:51 PDT Comment hidden (obsolete)
Comment 3 Sam Weinig 2017-07-14 15:53:28 PDT Comment hidden (obsolete)
Comment 4 Sam Weinig 2017-07-14 16:55:10 PDT Comment hidden (obsolete)
Comment 5 Build Bot 2017-07-14 18:11:01 PDT Comment hidden (obsolete)
Comment 6 Build Bot 2017-07-14 18:11:02 PDT Comment hidden (obsolete)
Comment 7 Build Bot 2017-07-14 18:14:49 PDT Comment hidden (obsolete)
Comment 8 Build Bot 2017-07-14 18:14:50 PDT Comment hidden (obsolete)
Comment 9 Build Bot 2017-07-14 18:24:57 PDT Comment hidden (obsolete)
Comment 10 Build Bot 2017-07-14 18:24:58 PDT Comment hidden (obsolete)
Comment 11 Build Bot 2017-07-14 18:47:21 PDT Comment hidden (obsolete)
Comment 12 Build Bot 2017-07-14 18:47:22 PDT Comment hidden (obsolete)
Comment 13 Sam Weinig 2017-07-15 10:22:59 PDT Comment hidden (obsolete)
Comment 14 Sam Weinig 2017-07-15 10:35:18 PDT Comment hidden (obsolete)
Comment 15 Build Bot 2017-07-15 11:31:29 PDT Comment hidden (obsolete)
Comment 16 Build Bot 2017-07-15 11:31:31 PDT Comment hidden (obsolete)
Comment 17 Build Bot 2017-07-15 11:54:51 PDT Comment hidden (obsolete)
Comment 18 Build Bot 2017-07-15 11:54:53 PDT Comment hidden (obsolete)
Comment 19 Build Bot 2017-07-15 12:02:46 PDT Comment hidden (obsolete)
Comment 20 Build Bot 2017-07-15 12:02:48 PDT Comment hidden (obsolete)
Comment 21 Sam Weinig 2017-07-15 13:25:57 PDT
Created attachment 315566 [details]
Patch
Comment 22 Chris Dumez 2017-07-17 14:41:00 PDT
Comment on attachment 315566 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=315566&action=review

> Source/WebCore/css/CSSStyleDeclaration.idl:47
> +    // these should be normal attributes, but there are too many combinations with

Where is this is the spec? I could not find those normal attributes at:
https://drafts.csswg.org/cssom/#the-cssstyledeclaration-interface

Is our behavior really standard? Do other browsers really behave the same way as us?
Comment 23 Sam Weinig 2017-07-17 18:26:26 PDT
(In reply to Chris Dumez from comment #22)
> Comment on attachment 315566 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=315566&action=review
> 
> > Source/WebCore/css/CSSStyleDeclaration.idl:47
> > +    // these should be normal attributes, but there are too many combinations with
> 
> Where is this is the spec? I could not find those normal attributes at:
> https://drafts.csswg.org/cssom/#the-cssstyledeclaration-interface
> 
> Is our behavior really standard? Do other browsers really behave the same
> way as us?

That spec has crazy formatting for me :(.

The property bits are defined in:

https://drafts.csswg.org/cssom/#dom-cssstyledeclaration-camel-cased-attribute
https://drafts.csswg.org/cssom/#dom-cssstyledeclaration-webkit-cased-attribute
https://drafts.csswg.org/cssom/#dom-cssstyledeclaration-dashed-attribute

Note the text like:

"For each CSS property property that is a supported CSS property, the following partial interface applies where camel-cased attribute is obtained by running the CSS property to IDL attribute algorithm for property."
Comment 24 Sam Weinig 2017-07-17 18:28:01 PDT
(In reply to Sam Weinig from comment #23)
> (In reply to Chris Dumez from comment #22)
> > Is our behavior really standard? Do other browsers really behave the same
> > way as us?

Not sure what the compat story is here. I tried to minimize behavior change as much as possible here. Matching other browsers and the spec can come next.
Comment 25 Chris Dumez 2017-07-17 19:46:37 PDT
Comment on attachment 315566 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=315566&action=review

r=me with comments.

> Source/WebCore/bindings/scripts/CodeGeneratorJS.pm:906
> +    push(@$outputArray, $indent . "bool propertySupported = true;\n") if $namedSetterOperation->extendedAttributes->{PutOnlyForSupportedProperties};

nit: Variable name should have "is" prefix.

> Source/WebCore/bindings/scripts/CodeGeneratorJS.pm:965
> +        if ($namedSetterOperation->extendedAttributes->{PutOnlyForSupportedProperties}) {

Isn't this confusingly named? What the code seems to do is call JSObject::put() if the property is NOT supported. The name seems to indicate the opposite.

> Source/WebCore/css/CSSStyleDeclaration.h:74
> +    // Bindings support

Missing period at the end.

> Source/WebCore/css/CSSStyleDeclaration.idl:49
> +    // recosider this decision.

Typo.
Comment 26 Sam Weinig 2017-07-18 11:45:05 PDT
(In reply to Chris Dumez from comment #25)
> Comment on attachment 315566 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=315566&action=review
> 
> > Source/WebCore/bindings/scripts/CodeGeneratorJS.pm:965
> > +        if ($namedSetterOperation->extendedAttributes->{PutOnlyForSupportedProperties}) {
> 
> Isn't this confusingly named? What the code seems to do is call
> JSObject::put() if the property is NOT supported. The name seems to indicate
> the opposite.

Yeah, I guess. I was thinking of Put as meaning the custom setter, but that is not at all clear from the name. Renamed it to [CallNamedSetterOnlyForSupportedProperties].
Comment 27 Sam Weinig 2017-07-18 13:12:17 PDT
Committed r219622: <http://trac.webkit.org/changeset/219622>