Changeset 200327 in webkit
- Timestamp:
- May 2, 2016 11:19:44 AM (8 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r200326 r200327 1 2016-05-01 Ryosuke Niwa <rniwa@webkit.org> 2 3 document.currentScript must be null when we're executing a script inside a shadow tree 4 https://bugs.webkit.org/show_bug.cgi?id=157245 5 6 Reviewed by Darin Adler. 7 8 Add a W3C style testharness.js test. 9 10 * fast/shadow-dom/Document-prototype-currentScript-expected.txt: Added. 11 * fast/shadow-dom/Document-prototype-currentScript.html: Added. 12 * fast/shadow-dom/resources/Document-prototype-currentScript-helper.js: Added. 13 1 14 2016-04-29 Alex Christensen <achristensen@webkit.org> 2 15 -
trunk/Source/WebCore/ChangeLog
r200326 r200327 1 2016-05-01 Ryosuke Niwa <rniwa@webkit.org> 2 3 document.currentScript must be null when we're executing a script inside a shadow tree 4 https://bugs.webkit.org/show_bug.cgi?id=157245 5 6 Reviewed by Darin Adler. 7 8 Fix the bug by not setting currentScript as spec'ed in HTML5 specification: 9 https://html.spec.whatwg.org/multipage/dom.html#dom-document-currentscript 10 https://html.spec.whatwg.org/multipage/scripting.html#execute-the-script-block 11 as of 3dc763829ca1598427b588cf08830c1e2af5a05c 12 13 New behavior matches that of Google Chrome Canary. 14 15 Test: fast/shadow-dom/Document-prototype-currentScript.html 16 17 * dom/CurrentScriptIncrementer.h: 18 (WebCore::CurrentScriptIncrementer::CurrentScriptIncrementer): 19 (WebCore::CurrentScriptIncrementer::~CurrentScriptIncrementer): 20 * dom/ScriptElement.cpp: 21 (WebCore::ScriptElement::executeScript): 22 1 23 2016-04-29 Alex Christensen <achristensen@webkit.org> 2 24 -
trunk/Source/WebCore/dom/CurrentScriptIncrementer.h
r175583 r200327 38 38 WTF_MAKE_NONCOPYABLE(CurrentScriptIncrementer); 39 39 public: 40 CurrentScriptIncrementer(Document& document, Element *element)40 CurrentScriptIncrementer(Document& document, Element& element) 41 41 : m_document(document) 42 , m_isHTMLScriptElement (is<HTMLScriptElement>(*element))42 , m_isHTMLScriptElementOutsideShadowTree(is<HTMLScriptElement>(element) && !element.isInShadowTree()) 43 43 { 44 if (m_isHTMLScriptElement )45 m_document.pushCurrentScript( downcast<HTMLScriptElement>(element));44 if (m_isHTMLScriptElementOutsideShadowTree) 45 m_document.pushCurrentScript(&downcast<HTMLScriptElement>(element)); 46 46 } 47 47 48 48 ~CurrentScriptIncrementer() 49 49 { 50 if (m_isHTMLScriptElement )50 if (m_isHTMLScriptElementOutsideShadowTree) 51 51 m_document.popCurrentScript(); 52 52 } … … 54 54 private: 55 55 Document& m_document; 56 bool m_isHTMLScriptElement ;56 bool m_isHTMLScriptElementOutsideShadowTree; 57 57 }; 58 58 -
trunk/Source/WebCore/dom/ScriptElement.cpp
r197944 r200327 313 313 if (Frame* frame = document->frame()) { 314 314 IgnoreDestructiveWriteCountIncrementer ignoreDesctructiveWriteCountIncrementer(m_isExternalScript ? document.ptr() : nullptr); 315 CurrentScriptIncrementer currentScriptIncrementer(document, &m_element);315 CurrentScriptIncrementer currentScriptIncrementer(document, m_element); 316 316 317 317 // Create a script from the script element node, using the script
Note: See TracChangeset
for help on using the changeset viewer.