Title: [206541] trunk
- Revision
- 206541
- Author
- [email protected]
- Date
- 2016-09-28 13:36:46 -0700 (Wed, 28 Sep 2016)
Log Message
It should be possible to dispatch events on template documents
https://bugs.webkit.org/show_bug.cgi?id=162687
Reviewed by Ryosuke Niwa.
Source/WebCore:
It should be possible to dispatch events on template documents. Firefox
supports this. Chrome does not but this is likely not intentional as
Chrome generally supports dispatching events on frameless documents.
Test: fast/dom/template-document-dispatchEvent.html
* dom/Document.cpp:
(WebCore::Document::ensureTemplateDocument):
LayoutTests:
Add layout test coverage.
* fast/dom/template-document-dispatchEvent-expected.txt: Added.
* fast/dom/template-document-dispatchEvent.html: Added.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (206540 => 206541)
--- trunk/LayoutTests/ChangeLog 2016-09-28 20:35:52 UTC (rev 206540)
+++ trunk/LayoutTests/ChangeLog 2016-09-28 20:36:46 UTC (rev 206541)
@@ -1,3 +1,15 @@
+2016-09-28 Chris Dumez <[email protected]>
+
+ It should be possible to dispatch events on template documents
+ https://bugs.webkit.org/show_bug.cgi?id=162687
+
+ Reviewed by Ryosuke Niwa.
+
+ Add layout test coverage.
+
+ * fast/dom/template-document-dispatchEvent-expected.txt: Added.
+ * fast/dom/template-document-dispatchEvent.html: Added.
+
2016-09-28 Ryan Haddad <[email protected]>
Update TestExpectations for crashing fast/images tests.
Added: trunk/LayoutTests/fast/dom/template-document-dispatchEvent-expected.txt (0 => 206541)
--- trunk/LayoutTests/fast/dom/template-document-dispatchEvent-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/dom/template-document-dispatchEvent-expected.txt 2016-09-28 20:36:46 UTC (rev 206541)
@@ -0,0 +1,11 @@
+Test that it is possible to dispatchEvent() works on template documents.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS wasEventDispatched is false
+PASS wasEventDispatched is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: trunk/LayoutTests/fast/dom/template-document-dispatchEvent.html (0 => 206541)
--- trunk/LayoutTests/fast/dom/template-document-dispatchEvent.html (rev 0)
+++ trunk/LayoutTests/fast/dom/template-document-dispatchEvent.html 2016-09-28 20:36:46 UTC (rev 206541)
@@ -0,0 +1,24 @@
+<DOCTYPE html>
+<html>
+<body>
+<script src=""
+<template id="t"></template>
+<script>
+description("Test that it is possible to dispatchEvent() works on template documents.");
+
+var wasEventDispatched = false;
+let doc = document.implementation.createDocument('', '');
+let tXml = doc.importNode(t);
+
+tXml.content.ownerDocument.addEventListener("click", function(evt) {
+ shouldBeFalse("wasEventDispatched");
+ wasEventDispatched = true;
+}, true);
+var clickEvent = tXml.content.ownerDocument.createEvent("Event");
+clickEvent.initEvent("click", true, true);
+tXml.content.ownerDocument.dispatchEvent(clickEvent);
+shouldBeTrue("wasEventDispatched");
+</script>
+<script src=""
+</body>
+</html>
Modified: trunk/Source/WebCore/ChangeLog (206540 => 206541)
--- trunk/Source/WebCore/ChangeLog 2016-09-28 20:35:52 UTC (rev 206540)
+++ trunk/Source/WebCore/ChangeLog 2016-09-28 20:36:46 UTC (rev 206541)
@@ -1,3 +1,19 @@
+2016-09-28 Chris Dumez <[email protected]>
+
+ It should be possible to dispatch events on template documents
+ https://bugs.webkit.org/show_bug.cgi?id=162687
+
+ Reviewed by Ryosuke Niwa.
+
+ It should be possible to dispatch events on template documents. Firefox
+ supports this. Chrome does not but this is likely not intentional as
+ Chrome generally supports dispatching events on frameless documents.
+
+ Test: fast/dom/template-document-dispatchEvent.html
+
+ * dom/Document.cpp:
+ (WebCore::Document::ensureTemplateDocument):
+
2016-09-27 Dean Jackson <[email protected]>
Use Color references where possible
Modified: trunk/Source/WebCore/dom/Document.cpp (206540 => 206541)
--- trunk/Source/WebCore/dom/Document.cpp 2016-09-28 20:35:52 UTC (rev 206540)
+++ trunk/Source/WebCore/dom/Document.cpp 2016-09-28 20:36:46 UTC (rev 206541)
@@ -6758,6 +6758,7 @@
else
m_templateDocument = Document::create(nullptr, blankURL());
+ m_templateDocument->setContextDocument(contextDocument());
m_templateDocument->setTemplateDocumentHost(this); // balanced in dtor.
return *m_templateDocument;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes