Summary: | [WebCore] Clean up script loading code in XML | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Yusuke Suzuki <ysuzuki> | ||||||
Component: | XML | Assignee: | Yusuke Suzuki <ysuzuki> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | cdumez, commit-queue, darin, dbates, esprehn+autocc, gyuyoung.kim, kangil.han, rniwa, sam | ||||||
Priority: | P2 | ||||||||
Version: | WebKit Nightly Build | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Bug Depends on: | |||||||||
Bug Blocks: | 147340 | ||||||||
Attachments: |
|
Description
Yusuke Suzuki
2016-09-06 15:41:23 PDT
Created attachment 295022 [details]
Patch
WIP
Created attachment 295028 [details]
Patch
Comment on attachment 295028 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=295028&action=review > Source/WebCore/dom/ScriptElement.cpp:167 > + // XHTML document does not support "defer" attribute semantics. > + // And module tag also uses defer attribute semantics. We disable script type="module" for non HTML document. Is this behavior spec compliant!? Comment on attachment 295028 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=295028&action=review >> Source/WebCore/dom/ScriptElement.cpp:167 >> + // And module tag also uses defer attribute semantics. We disable script type="module" for non HTML document. > > Is this behavior spec compliant!? XHTML defines "defer" attribute. But WebKit does not implement it for a long time. Once "defer" is implemented, we can reconsider enabling modules in XHTML. But I'm not sure that's worth doing (implementing defer semantics and enabling modules in XHTML). Since "defer" semantics is not implemented, before this patch, we just ignore the modules in XHTML document. But it causes some strange behavior. For example, if you write <script type="module"> in document, it is ignored. But if you create script tag with `type="module"` dynamically, it works. To make it consistent, I think disabling modules until "defer" is implemented in XHTML is better. I'll note the above description in this comment. Comment on attachment 295028 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=295028&action=review >>> Source/WebCore/dom/ScriptElement.cpp:167 >>> + // And module tag also uses defer attribute semantics. We disable script type="module" for non HTML document. >> >> Is this behavior spec compliant!? > > XHTML defines "defer" attribute. But WebKit does not implement it for a long time. > Once "defer" is implemented, we can reconsider enabling modules in XHTML. But I'm not sure that's worth doing (implementing defer semantics and enabling modules in XHTML). > > Since "defer" semantics is not implemented, before this patch, we just ignore the modules in XHTML document. But it causes some strange behavior. > For example, if you write <script type="module"> in document, it is ignored. But if you create script tag with `type="module"` dynamically, it works. > To make it consistent, I think disabling modules until "defer" is implemented in XHTML is better. > > I'll note the above description in this comment. We have a bug for that https://bugs.webkit.org/show_bug.cgi?id=123387. I'll paste this URL. According to that bug, blink intentionally does not support it https://bugs.chromium.org/p/chromium/issues/detail?id=611136. Committed r208840: <http://trac.webkit.org/changeset/208840> |