Bug 153968 - Attribute getters should not require an explicit 'this' value for Window properties
Summary: Attribute getters should not require an explicit 'this' value for Window prop...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Bindings (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: WebExposed
Depends on:
Blocks:
 
Reported: 2016-02-07 17:02 PST by Chris Dumez
Modified: 2016-02-08 21:15 PST (History)
9 users (show)

See Also:


Attachments
WIP Patch (90.78 KB, patch)
2016-02-07 17:04 PST, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (95.84 KB, patch)
2016-02-07 18:49 PST, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (95.85 KB, patch)
2016-02-08 10:30 PST, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2016-02-07 17:02:43 PST
Attribute getters should not require an explicit 'this' value for Window properties. This is because the Window interface is marked as [ImplicitThis]:
- http://heycam.github.io/webidl/#ImplicitThis
- https://www.w3.org/Bugs/Public/show_bug.cgi?id=29421

This matches the behavior of Firefox and the expectations of the W3C web-platform-tests.
Comment 1 Chris Dumez 2016-02-07 17:04:01 PST
Created attachment 270833 [details]
WIP Patch
Comment 2 Chris Dumez 2016-02-07 18:49:22 PST
Created attachment 270836 [details]
Patch
Comment 3 Chris Dumez 2016-02-08 10:30:26 PST
Created attachment 270864 [details]
Patch
Comment 4 Gavin Barraclough 2016-02-08 18:08:47 PST
Comment on attachment 270864 [details]
Patch

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

> Source/WebCore/bindings/scripts/CodeGeneratorJS.pm:2296
>                  }

OOI could do away with the if/else in the perl & the ?: in the C++ by doing something like this:

push(@implContent, "    if (decodedThisValue.isUndefinedOrNull()) decodedThisValue = state->thisValue().toThis(state, NotStrictMode);\n") if ($interface->extendedAttributes->{"ImplicitThis"});
push(@implContent, "    auto* castedThis = $castingFunction(decodedThisValue);\n");

Not sure if that's really much better tho.
Comment 5 Chris Dumez 2016-02-08 21:15:09 PST
Comment on attachment 270864 [details]
Patch

Clearing flags on attachment: 270864

Committed r196303: <http://trac.webkit.org/changeset/196303>
Comment 6 Chris Dumez 2016-02-08 21:15:14 PST
All reviewed patches have been landed.  Closing bug.