Bug 80461

Summary: Base the access to CSSStyleDeclaration on the CSSPropertyID instead of the PropertyName
Product: WebKit Reporter: Benjamin Poulain <benjamin>
Component: WebCore Misc.Assignee: Benjamin Poulain <benjamin>
Status: RESOLVED FIXED    
Severity: Normal CC: abarth, ggaren, macpherson, menard, ojan, psolanki, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 77271    
Attachments:
Description Flags
Patch
none
Patch for landing none

Description Benjamin Poulain 2012-03-06 17:26:54 PST
This is the second part of https://bugs.webkit.org/show_bug.cgi?id=77271

Despite the recent improvement, cssPropertyIDForJSCSSPropertyName() remains the bottleneck in accessing CSS Properties.

We should cut that further by basing the PropertySlot on the CSSPropertyID instead of the PropertyName.
Comment 1 Benjamin Poulain 2012-03-06 17:41:42 PST
Created attachment 130495 [details]
Patch
Comment 2 Alexis Menard (darktears) 2012-03-06 17:55:48 PST
Comment on attachment 130495 [details]
Patch

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

> Source/WebCore/ChangeLog:14
> +        CSSPropertyID as the customIndex, and the value can be accessed direclty when the slot is

typo: directly
Comment 3 Alexis Menard (darktears) 2012-03-06 17:59:20 PST
Comment on attachment 130495 [details]
Patch

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

> Source/WebCore/css/CSSStyleDeclaration.idl:27
> +        JSCustomGetOwnPropertySlotAndDescriptor,

Where this comes from?
Comment 4 Benjamin Poulain 2012-03-06 18:02:10 PST
> > Source/WebCore/css/CSSStyleDeclaration.idl:27
> > +        JSCustomGetOwnPropertySlotAndDescriptor,
> 
> Where this comes from?

http://trac.webkit.org/wiki/WebKitIDL#JSCustomToNativeObject

This is how you can write your own getters.
Comment 5 Alexis Menard (darktears) 2012-03-06 18:06:59 PST
Comment on attachment 130495 [details]
Patch

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

> Source/WebCore/bindings/js/JSCSSStyleDeclarationCustom.cpp:333
> +        value = cssPropertyGetterPixelOrPosPrefix(exec, this, propertyInfo.propertyID);

why two slots? Could you just pass propertyInfo.hadPixelOrPosPrefix as parameter?
Comment 6 Build Bot 2012-03-06 18:07:34 PST
Comment on attachment 130495 [details]
Patch

Attachment 130495 [details] did not pass mac-ews (mac):
Output: http://queues.webkit.org/results/11836652
Comment 7 Alexis Menard (darktears) 2012-03-06 18:09:14 PST
(In reply to comment #4)
> > > Source/WebCore/css/CSSStyleDeclaration.idl:27
> > > +        JSCustomGetOwnPropertySlotAndDescriptor,
> > 
> > Where this comes from?
> 
> http://trac.webkit.org/wiki/WebKitIDL#JSCustomToNativeObject
> 
> This is how you can write your own getters.

Tricky thanks for pointing it out.
Comment 8 Alexis Menard (darktears) 2012-03-06 18:22:15 PST
Comment on attachment 130495 [details]
Patch

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

>> Source/WebCore/bindings/js/JSCSSStyleDeclarationCustom.cpp:333
>> +        value = cssPropertyGetterPixelOrPosPrefix(exec, this, propertyInfo.propertyID);
> 
> why two slots? Could you just pass propertyInfo.hadPixelOrPosPrefix as parameter?

In fact you can't modify the signature.
Comment 9 Geoffrey Garen 2012-03-08 14:39:35 PST
Comment on attachment 130495 [details]
Patch

r=me, fix the build please
Comment 10 Benjamin Poulain 2012-03-08 18:58:44 PST
Created attachment 130950 [details]
Patch for landing
Comment 11 WebKit Review Bot 2012-03-08 23:34:15 PST
Comment on attachment 130950 [details]
Patch for landing

Clearing flags on attachment: 130950

Committed r110271: <http://trac.webkit.org/changeset/110271>
Comment 12 WebKit Review Bot 2012-03-08 23:34:20 PST
All reviewed patches have been landed.  Closing bug.