Bug 164693

Summary: document.currentScript should be null when running a script inside a shadow tree
Product: WebKit Reporter: Ryosuke Niwa <rniwa>
Component: DOMAssignee: Ryosuke Niwa <rniwa>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, commit-queue, dbates, esprehn+autocc, kangil.han, koivisto, webkit-bug-importer, ysuzuki
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 148695    
Attachments:
Description Flags
Fixes the bug none

Ryosuke Niwa
Reported 2016-11-12 16:51:49 PST
document.currentScript should be null when running a script inside a shadow tree instead of being set to the old script element waiting on that script to finish. The following test is failing because of that: imported/w3c/web-platform-tests/shadow-dom/Document-prototype-currentScript.html
Attachments
Fixes the bug (5.52 KB, patch)
2016-11-12 16:57 PST, Ryosuke Niwa
no flags
Ryosuke Niwa
Comment 1 2016-11-12 16:57:56 PST
Created attachment 294642 [details] Fixes the bug
Yusuke Suzuki
Comment 2 2016-11-12 18:11:37 PST
Comment on attachment 294642 [details] Fixes the bug View in context: https://bugs.webkit.org/attachment.cgi?id=294642&action=review r=me > Source/WebCore/dom/CurrentScriptIncrementer.h:46 > + m_document.pushCurrentScript(scriptElement.isInShadowTree() ? nullptr : &scriptElement); Later, it will be extended to handle module script elements.
Yusuke Suzuki
Comment 3 2016-11-12 18:13:02 PST
Comment on attachment 294642 [details] Fixes the bug View in context: https://bugs.webkit.org/attachment.cgi?id=294642&action=review r=me >> Source/WebCore/dom/CurrentScriptIncrementer.h:46 >> + m_document.pushCurrentScript(scriptElement.isInShadowTree() ? nullptr : &scriptElement); > > Later, it will be extended to handle module script elements. Later, it will be extended to handle module script elements.
Ryosuke Niwa
Comment 4 2016-11-12 18:22:36 PST
Comment on attachment 294642 [details] Fixes the bug View in context: https://bugs.webkit.org/attachment.cgi?id=294642&action=review >>> Source/WebCore/dom/CurrentScriptIncrementer.h:46 >>> + m_document.pushCurrentScript(scriptElement.isInShadowTree() ? nullptr : &scriptElement); >> >> Later, it will be extended to handle module script elements. > > Later, it will be extended to handle module script elements. Yup. Thanks for the review!
WebKit Commit Bot
Comment 5 2016-11-12 18:46:44 PST
Comment on attachment 294642 [details] Fixes the bug Clearing flags on attachment: 294642 Committed r208660: <http://trac.webkit.org/changeset/208660>
WebKit Commit Bot
Comment 6 2016-11-12 18:46:50 PST
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 7 2016-11-13 00:58:39 PST
Note You need to log in before you can comment on or make changes to this bug.