Auto merge of #14361 - nox:write, r=jdm

Implement document.write (fixes #3704)

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14361)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2016-11-29 04:18:43 -08:00 committed by GitHub
commit 00f30d1b7e
61 changed files with 369 additions and 363 deletions

View file

@ -1,3 +1,5 @@
[012.html]
type: testharness
expected: TIMEOUT
[Link with onclick navigation to javascript url with delayed document.write and href navigation ]
expected: FAIL

View file

@ -1,3 +1,8 @@
[008.html]
type: testharness
expected: ERROR
[history.pushState URL resolving should be done relative to the document, not the script]
expected: FAIL
[history.replaceState URL resolving should be done relative to the document, not the script]
expected: FAIL

View file

@ -10,6 +10,3 @@
[Script iframe-src]
expected: NOTRUN
[Script document-write]
expected: NOTRUN

View file

@ -0,0 +1,5 @@
[047.html]
type: testharness
[document.write]
expected: FAIL

View file

@ -0,0 +1,5 @@
[048.html]
type: testharness
[document.write]
expected: FAIL

View file

@ -0,0 +1,5 @@
[049.html]
type: testharness
[document.write plaintext]
expected: FAIL

View file

@ -0,0 +1,5 @@
[050.html]
type: testharness
[document.write plaintext]
expected: FAIL

View file

@ -0,0 +1,5 @@
[051.html]
type: testharness
[document.write \\r\\n]
expected: FAIL

View file

@ -0,0 +1,5 @@
[document.write-01.xhtml]
type: testharness
[document.write in XHTML]
expected: FAIL

View file

@ -0,0 +1,8 @@
[document.write-02.html]
type: testharness
[document.write(null)]
expected: FAIL
[document.write(undefined)]
expected: FAIL

View file

@ -0,0 +1,5 @@
[iframe_001.html]
type: testharness
[document.write into iframe]
expected: FAIL

View file

@ -0,0 +1,5 @@
[iframe_002.html]
type: testharness
[document.write into iframe]
expected: FAIL

View file

@ -0,0 +1,5 @@
[iframe_003.html]
type: testharness
[document.write script into iframe]
expected: FAIL

View file

@ -0,0 +1,5 @@
[iframe_004.html]
type: testharness
[document.write script into iframe write back into parent]
expected: FAIL

View file

@ -0,0 +1,5 @@
[iframe_005.html]
type: testharness
[document.write external script into iframe write back into parent]
expected: FAIL

View file

@ -0,0 +1,5 @@
[iframe_006.html]
type: testharness
[document.write external script into iframe write back into parent]
expected: FAIL

View file

@ -0,0 +1,5 @@
[iframe_007.html]
type: testharness
[document.write comment into iframe]
expected: FAIL

View file

@ -0,0 +1,5 @@
[iframe_008.html]
type: testharness
[document.write plaintext into iframe]
expected: FAIL

View file

@ -0,0 +1,5 @@
[iframe_009.html]
type: testharness
[document.write plaintext into iframe]
expected: FAIL

View file

@ -0,0 +1,5 @@
[iframe_010.html]
type: testharness
[document.write plaintext]
expected: FAIL

View file

@ -0,0 +1,5 @@
[document.writeln-01.xhtml]
type: testharness
[document.writeln in XHTML]
expected: FAIL

View file

@ -0,0 +1,8 @@
[document.writeln-02.html]
type: testharness
[document.writeln(null)]
expected: FAIL
[document.writeln(undefined)]
expected: FAIL

View file

@ -0,0 +1,5 @@
[document.writeln-03.html]
type: testharness
[Calling document.writeln with multiple arguments]
expected: FAIL

View file

@ -21,12 +21,6 @@
[Document interface: operation close()]
expected: FAIL
[Document interface: operation write(DOMString)]
expected: FAIL
[Document interface: operation writeln(DOMString)]
expected: FAIL
[Document interface: attribute designMode]
expected: FAIL
@ -900,18 +894,6 @@
[Document interface: document.implementation.createDocument(null, "", null) must inherit property "close" with the proper type (56)]
expected: FAIL
[Document interface: document.implementation.createDocument(null, "", null) must inherit property "write" with the proper type (57)]
expected: FAIL
[Document interface: calling write(DOMString) on document.implementation.createDocument(null, "", null) with too few arguments must throw TypeError]
expected: FAIL
[Document interface: document.implementation.createDocument(null, "", null) must inherit property "writeln" with the proper type (58)]
expected: FAIL
[Document interface: calling writeln(DOMString) on document.implementation.createDocument(null, "", null) with too few arguments must throw TypeError]
expected: FAIL
[Document interface: document.implementation.createDocument(null, "", null) must inherit property "designMode" with the proper type (62)]
expected: FAIL
@ -6144,12 +6126,6 @@
[Document interface: document.implementation.createDocument(null, "", null) must inherit property "close" with the proper type (57)]
expected: FAIL
[Document interface: document.implementation.createDocument(null, "", null) must inherit property "write" with the proper type (58)]
expected: FAIL
[Document interface: document.implementation.createDocument(null, "", null) must inherit property "writeln" with the proper type (59)]
expected: FAIL
[Document interface: document.implementation.createDocument(null, "", null) must inherit property "designMode" with the proper type (63)]
expected: FAIL
@ -6489,18 +6465,6 @@
[Document interface: new Document() must inherit property "close" with the proper type (57)]
expected: FAIL
[Document interface: new Document() must inherit property "write" with the proper type (58)]
expected: FAIL
[Document interface: calling write(DOMString) on new Document() with too few arguments must throw TypeError]
expected: FAIL
[Document interface: new Document() must inherit property "writeln" with the proper type (59)]
expected: FAIL
[Document interface: calling writeln(DOMString) on new Document() with too few arguments must throw TypeError]
expected: FAIL
[Document interface: new Document() must inherit property "designMode" with the proper type (63)]
expected: FAIL
@ -8547,12 +8511,6 @@
[Document interface: new Document() must inherit property "close" with the proper type (56)]
expected: FAIL
[Document interface: new Document() must inherit property "write" with the proper type (57)]
expected: FAIL
[Document interface: new Document() must inherit property "writeln" with the proper type (58)]
expected: FAIL
[Document interface: new Document() must inherit property "designMode" with the proper type (62)]
expected: FAIL

View file

@ -1,6 +1,6 @@
[video_008.htm]
type: testharness
expected: ERROR
expected: TIMEOUT
[HTML5 Media Elements: 'media' attribute]
expected: NOTRUN

View file

@ -1,5 +0,0 @@
[async_003.htm]
type: testharness
[An async script does not block the parser while downloading]
expected: FAIL

View file

@ -1,5 +0,0 @@
[async_004.htm]
type: testharness
[async script executes as soon as possible after a download is complete]
expected: FAIL

View file

@ -1,5 +0,0 @@
[async_005.htm]
type: testharness
[A script element with both async and defer set should execute asynchronously]
expected: FAIL

View file

@ -1,5 +0,0 @@
[async_009.htm]
type: testharness
[Document.write() silently fails from an Async script]
expected: FAIL

View file

@ -1,6 +0,0 @@
[script-onerror-insertion-point-1.html]
type: testharness
expected: TIMEOUT
[Test that the insertion point is defined in the error event of a parser-inserted script that actually started a fetch (but just had it fail).]
expected: NOTRUN

View file

@ -1,6 +0,0 @@
[script-onload-insertion-point.html]
type: testharness
expected: TIMEOUT
[Test that the insertion point is defined in the load event of a parser-inserted script.]
expected: NOTRUN

View file

@ -1,6 +0,0 @@
[005.html]
type: testharness
expected: ERROR
[ scheduler: document.write inline in markup ]
expected: FAIL

View file

@ -1,6 +0,0 @@
[006.html]
type: testharness
expected: ERROR
[ scheduler: document.write inline - multiple]
expected: FAIL

View file

@ -1,6 +0,0 @@
[007.html]
type: testharness
expected: ERROR
[ scheduler: document.write external]
expected: FAIL

View file

@ -1,6 +0,0 @@
[008.html]
type: testharness
expected: ERROR
[ scheduler: document.write external - multiple]
expected: FAIL

View file

@ -1,6 +0,0 @@
[009.html]
type: testharness
expected: ERROR
[ scheduler: document.write external - multiple with doc.write]
expected: FAIL

View file

@ -1,6 +0,0 @@
[010.html]
type: testharness
expected: ERROR
[ scheduler: document.write external + inline - multiple with doc.write]
expected: FAIL

View file

@ -1,6 +0,0 @@
[011.html]
type: testharness
expected: ERROR
[ scheduler: document.write external + inline - multiple with doc.write + subsequent markup]
expected: FAIL

View file

@ -1,6 +0,0 @@
[012.html]
type: testharness
expected: ERROR
[ scheduler: document.write external and onload events ]
expected: FAIL

View file

@ -1,6 +0,0 @@
[018.html]
type: testharness
expected: ERROR
[ scheduler: DOM added scripts and doc.write]
expected: FAIL

View file

@ -1,6 +0,0 @@
[026.html]
type: testharness
expected: ERROR
[ scheduler: doc write added script, .src set later]
expected: FAIL

View file

@ -1,6 +0,0 @@
[027.html]
type: testharness
expected: ERROR
[ scheduler: doc write added script with content, .src set later]
expected: FAIL

View file

@ -1,6 +0,0 @@
[041.html]
type: testharness
expected: ERROR
[ scheduler: document.write scripts that write scripts]
expected: FAIL

View file

@ -1,3 +0,0 @@
[068.html]
type: testharness
expected: ERROR

View file

@ -1,5 +0,0 @@
[086.html]
type: testharness
[ scheduler: async script and slow-loading async script]
expected: FAIL

View file

@ -1,5 +0,0 @@
[088.html]
type: testharness
[ scheduler: multiple scripts with defer and async attributes]
expected: FAIL

View file

@ -1,6 +1,5 @@
[096.html]
type: testharness
expected: ERROR
[ scheduler: defer script added from document.write relative to DOMContentLoaded]
expected: FAIL

View file

@ -1,6 +0,0 @@
[097.html]
type: testharness
expected: ERROR
[ scheduler: slow-loading async script added from document.write]
expected: FAIL

View file

@ -1,6 +1,5 @@
[098.html]
type: testharness
expected: ERROR
[ scheduler: defer script added from document.write]
expected: FAIL

View file

@ -1,5 +0,0 @@
[107-import.html]
type: testharness
[ scheduler: stylesheets blocking scripts document.write]
expected: FAIL

View file

@ -1,5 +0,0 @@
[107-noimport.html]
type: testharness
[ scheduler: stylesheets blocking scripts document.write]
expected: FAIL

View file

@ -1,5 +0,0 @@
[111.html]
type: testharness
[ scheduler: removing async attribute at runtime]
expected: FAIL

View file

@ -1,5 +0,0 @@
[112.html]
type: testharness
[ scheduler: removing async attribute at runtime, script also has defer attribute]
expected: FAIL

View file

@ -1,6 +0,0 @@
[120.html]
type: testharness
expected: ERROR
[scheduler: script created without a window ]
expected: NOTRUN

View file

@ -1,21 +0,0 @@
[149.html]
type: testharness
expected: ERROR
[for='window' event='onload()' parser inserted executes immediately]
expected: FAIL
[for='window' event='onload' parser inserted executes immediately]
expected: FAIL
[for=' WINdow\t\n' event='ONload\t\n' parser inserted executes immediately]
expected: FAIL
[for='window' event='onload()' dom inserted executes immediately]
expected: FAIL
[for='window' event='onload' dom inserted executes immediately]
expected: FAIL
[for=' WINdow\t\n' event='ONload\t\n' dom inserted executes immediately]
expected: FAIL