Summary: | Add the support for nomodule attribute on script element | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Ryosuke Niwa <rniwa> | ||||||||
Component: | DOM | Assignee: | Yusuke Suzuki <ysuzuki> | ||||||||
Status: | RESOLVED FIXED | ||||||||||
Severity: | Normal | CC: | annevk, cdumez, ggaren, keith_miller, saam, sgospodarets, webkit-bug-importer, ysuzuki | ||||||||
Priority: | P2 | Keywords: | InRadar | ||||||||
Version: | Safari Technology Preview | ||||||||||
Hardware: | Unspecified | ||||||||||
OS: | Unspecified | ||||||||||
Attachments: |
|
Description
Ryosuke Niwa
2017-01-12 14:11:57 PST
Created attachment 298755 [details]
Patch
Comment on attachment 298755 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=298755&action=review > Source/WebCore/html/HTMLScriptElement.idl:32 > + attribute boolean noModule; Can this be a [Reflect] attribute, and avoid the need for the explicit implementation? Comment on attachment 298755 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=298755&action=review >> Source/WebCore/html/HTMLScriptElement.idl:32 >> + attribute boolean noModule; > > Can this be a [Reflect] attribute, and avoid the need for the explicit implementation? Ah, I thought we need the implementation because of the name `noModule` JS property v.s. `nomodule` attribute name. But it seems that we can use `Reflect` and `ImplementedAs`. Fixed. Comment on attachment 298755 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=298755&action=review >>> Source/WebCore/html/HTMLScriptElement.idl:32 >>> + attribute boolean noModule; >> >> Can this be a [Reflect] attribute, and avoid the need for the explicit implementation? > > Ah, I thought we need the implementation because of the name `noModule` JS property v.s. `nomodule` attribute name. > But it seems that we can use `Reflect` and `ImplementedAs`. Fixed. Oops, no, we can just use [Reflect] according to the CodeGenerator.pm. Created attachment 298757 [details]
Patch
Comment on attachment 298757 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=298757&action=review > Source/WebCore/dom/ScriptElement.h:112 > + virtual bool noModuleAttributeValue() const = 0; I think it’s better to call this hasNoModuleAttribute instead of noModuleAttributeValue. Comment on attachment 298757 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=298757&action=review >> Source/WebCore/dom/ScriptElement.h:112 >> + virtual bool noModuleAttributeValue() const = 0; > > I think it’s better to call this hasNoModuleAttribute instead of noModuleAttributeValue. If we change this to `hasNoModuleAttribute`, I think we should change deferAttributeValue, asyncAttributeValue. Changed. Created attachment 298893 [details]
Patch for landing
Did you ever land this patch? I can't find it on trac. (In reply to comment #10) > Did you ever land this patch? I can't find it on trac. yeah, I need to land it. Committed r211078: <http://trac.webkit.org/changeset/211078> Just want to make sure, will the first stable version of Safari with ES modules support also contain the "nomodule" addition? Otherwise, the whole point may be missed: https://blog.hospodarets.com/native-ecmascript-modules-nomodule#comment-3218775686 |