Bug 215753 - Do not use undefined default param in CSSStyleDeclaration.idl
Summary: Do not use undefined default param in CSSStyleDeclaration.idl
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Rob Buis
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-08-22 10:12 PDT by Rob Buis
Modified: 2020-08-23 06:41 PDT (History)
10 users (show)

See Also:


Attachments
Patch (1.86 KB, patch)
2020-08-22 10:13 PDT, Rob Buis
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Rob Buis 2020-08-22 10:12:48 PDT
Do not use undefined default parameter value in CSSStyleDeclaration.idl, instead use no explicit default
parameter at all. This means a zero length String will be used, which will be more efficient when using
the cssPropertyID helper method, as well as less error-prone.
Comment 1 Rob Buis 2020-08-22 10:13:58 PDT
Created attachment 407054 [details]
Patch
Comment 2 Darin Adler 2020-08-22 14:11:43 PDT
Comment on attachment 407054 [details]
Patch

Could we have added a tests? Or is there no way to detect that we are failing to look up "undefined" vs. failing to look up a null string?
Comment 3 Rob Buis 2020-08-23 06:38:50 PDT
(In reply to Darin Adler from comment #2)
> Comment on attachment 407054 [details]
> Patch
> 
> Could we have added a tests? Or is there no way to detect that we are
> failing to look up "undefined" vs. failing to look up a null string?

I think the only way is through timing both lookups, and asserting that the null string lookup (early exit) will take less time than looking up "undefined". I personally thing this is a bit overkill but let me know if you want me to add such a test.
Comment 4 EWS 2020-08-23 06:40:29 PDT
Committed r266046: <https://trac.webkit.org/changeset/266046>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 407054 [details].
Comment 5 Radar WebKit Bug Importer 2020-08-23 06:41:14 PDT
<rdar://problem/67640590>