Bug 8961 - document.write() doesn't flush plain text
Summary: document.write() doesn't flush plain text
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 420+
Hardware: All All
: P2 Normal
Assignee: Dave Hyatt
URL:
Keywords:
: 7885 9587 13043 14599 14709 16762 20563 20970 22234 26432 (view as bug list)
Depends on:
Blocks: 16230 44024
  Show dependency treegraph
 
Reported: 2006-05-17 13:23 PDT by Krishna
Modified: 2019-05-02 16:20 PDT (History)
17 users (show)

See Also:


Attachments
prompt dialog test case (408 bytes, text/html)
2006-05-17 13:24 PDT, Krishna
no flags Details
automated test (471 bytes, text/html)
2006-12-24 08:42 PST, Alexey Proskuryakov
no flags Details
a slightly more evil test (697 bytes, text/html)
2007-10-26 12:58 PDT, Alexey Proskuryakov
no flags Details
This patch fixes the test cases. (603 bytes, patch)
2008-02-11 12:39 PST, Dave Hyatt
no flags Details | Formatted Diff | Diff
Patch (12.00 KB, patch)
2010-08-13 20:21 PDT, Adam Barth
no flags Details | Formatted Diff | Diff
Patch for landing (11.99 KB, patch)
2010-08-13 20:25 PDT, Adam Barth
no flags Details | Formatted Diff | Diff
Patch for landing (11.34 KB, patch)
2010-08-13 23:24 PDT, Adam Barth
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Krishna 2006-05-17 13:23:03 PDT
Steps To Reproduce:
1. Open Safari or S60 Web Browser
2. Load the test file
3. Click the link "Prompt"
4. Edit text in the prompt dialog
5. Select OK for prompt dialog.

Expected Result:
Prompt dialog closes and result page is loaded with the edited text

Actual Result:
Prompt dialog closes and a blank result page opened.


Test source:
<html>

<head>
<script type="text/javascript">
function message(){
var name = prompt("Please enter your name","John Wayne")
if (name != null && name != "")
{
document.write("Hello " + name)
}

}
</script>
</head>


<body>

<p> Select the link "Prompt" and verify that the prompt dialog is displayed correctly. </p>

<a href="javascript: message()">Prompt</a> <br/>

</body>
</html>
Comment 1 Krishna 2006-05-17 13:24:27 PDT
Created attachment 8372 [details]
prompt dialog test case

This test page is same as the given test source in the description.
Comment 2 Krishna 2006-05-17 13:36:22 PDT
(In reply to comment #1)
> Created an attachment (id=8372) [edit]
> prompt dialog test case
> This test page is same as the given test source in the description.

The browser expects the close html tag, after the document writes are complete. The behaviour is same on both safari and S60 Web Browser. The follwoing function works ok. But can we expect the content author to write this kind of javascript function?

function message(){
var name = prompt("Please enter your name","John Wayne")
alert(name);
if (name != null && name != "")
{
document.write("Hello " + name);
document.write("</body></html>");
}
}
Comment 3 Alexey Proskuryakov 2006-05-18 05:23:02 PDT
The text does get displayed when any HTML tag is written, though - try changing the name to "John Wayne</p>". Or to "John<p>Wayne".
Comment 4 Krishna 2006-05-30 10:36:07 PDT
TSW Error ID: EXTH-6HL4ZD
Comment 5 David Kilzer (:ddkilzer) 2006-06-26 03:19:51 PDT
*** Bug 9587 has been marked as a duplicate of this bug. ***
Comment 6 David Kilzer (:ddkilzer) 2006-06-26 03:21:49 PDT
(In reply to comment #5)
> *** Bug 9587 has been marked as a duplicate of this bug. *** 

Hmm...how do we want to handle this?  My inclination is to change the Hardware, OS and Version settings to match "HEAD" rather than the S60 branch.  Should we just keep these bugs separate instead?

Comment 7 Alexey Proskuryakov 2006-06-26 03:47:10 PDT
(In reply to comment #6)
> Hmm...how do we want to handle this?  My inclination is to change the Hardware,
> OS and Version settings to match "HEAD" rather than the S60 branch.

Indeed - I've been told before that this is how bugs still present in TOT are supposed to be handled. Changing to All/All/420+.
Comment 8 Joost de Valk (AlthA) 2006-06-26 04:49:52 PDT
I definitly agree on this, it's up to nokia to backport a patch :) .
Comment 9 Alexey Proskuryakov 2006-12-24 08:42:02 PST
Created attachment 12004 [details]
automated test
Comment 10 Alexey Proskuryakov 2007-09-26 21:27:46 PDT
*** Bug 14709 has been marked as a duplicate of this bug. ***
Comment 11 Alexey Proskuryakov 2007-09-26 21:28:41 PDT
Bug 14709 has some in-depth discussion of this issue.
Comment 12 Alexey Proskuryakov 2007-10-26 12:58:25 PDT
Created attachment 16888 [details]
a slightly more evil test
Comment 13 Alexey Proskuryakov 2007-12-30 07:06:03 PST
*** Bug 7885 has been marked as a duplicate of this bug. ***
Comment 14 Alexey Proskuryakov 2008-01-06 00:21:34 PST
*** Bug 16762 has been marked as a duplicate of this bug. ***
Comment 15 Dave Hyatt 2008-02-11 12:39:36 PST
Created attachment 19076 [details]
This patch fixes the test cases.

Nobody ever recorded which Acid3 test this affects in the bug.  My score on Acid3 does not change with this patch, so either the patch isn't good enough or the test has changed to make this no longer be an Acid3 issue.
Comment 16 Dave Hyatt 2008-02-11 12:42:33 PST
Looks like this is no longer related to Acid3.

Comment 17 Dave Hyatt 2008-02-11 12:43:44 PST
Comment on attachment 19076 [details]
This patch fixes the test cases.

I will land the evil test case from the bug.
Comment 18 Robert Blaut 2008-02-11 12:48:29 PST
(In reply to comment #15)
> Created an attachment (id=19076) [edit]
> This patch fixes the test cases.
> 
> Nobody ever recorded which Acid3 test this affects in the bug.  My score on
> Acid3 does not change with this patch, so either the patch isn't good enough or
> the test has changed to make this no longer be an Acid3 issue.
> 

Dave, look into this bug 16762. The bug have description about relation between Acid3 test and this bug.
Comment 19 Dave Hyatt 2008-02-11 12:49:03 PST
Comment on attachment 19076 [details]
This patch fixes the test cases.

Actually need to think about this some more.
Comment 20 Eric Seidel (no email) 2008-04-15 13:24:36 PDT
I believe this is the bug causing these Hixie tests to fail:
http://hixie.ch/tests/adhoc/dom/level0/write/007.html
http://hixie.ch/tests/adhoc/dom/level0/write/008.html
Comment 21 mitz 2008-08-28 18:35:53 PDT
*** Bug 20563 has been marked as a duplicate of this bug. ***
Comment 22 Alexey Proskuryakov 2008-09-21 02:41:09 PDT
*** Bug 20970 has been marked as a duplicate of this bug. ***
Comment 23 Alexey Proskuryakov 2008-11-14 11:12:46 PST
*** Bug 22234 has been marked as a duplicate of this bug. ***
Comment 24 Alexey Proskuryakov 2008-11-28 13:28:50 PST
*** Bug 13043 has been marked as a duplicate of this bug. ***
Comment 25 Alexey Proskuryakov 2009-06-17 01:44:36 PDT
*** Bug 26432 has been marked as a duplicate of this bug. ***
Comment 26 Adam Barth 2010-08-13 20:21:27 PDT
Created attachment 64401 [details]
Patch
Comment 27 Eric Seidel (no email) 2010-08-13 20:23:18 PDT
Comment on attachment 64401 [details]
Patch

WebCore/ChangeLog:9
 +          reached the end of the input stream, but that's now how the spec
now how.  You mean "not" how.

Yay test driven development!
Comment 28 Adam Barth 2010-08-13 20:23:23 PDT
*** Bug 14599 has been marked as a duplicate of this bug. ***
Comment 29 Adam Barth 2010-08-13 20:25:06 PDT
Created attachment 64402 [details]
Patch for landing
Comment 30 WebKit Commit Bot 2010-08-13 22:39:41 PDT
Comment on attachment 64402 [details]
Patch for landing

Rejecting patch 64402 from commit-queue.

Failed to run "[u'/Users/eseidel/Projects/CommitQueue/WebKitTools/Scripts/svn-apply', u'--force']" exit_code: 1
Last 500 characters of output:
ocument-write-evil-expected.txt
patching file LayoutTests/fast/tokenizer/flush-characters-in-document-write-evil.html
patching file LayoutTests/fast/tokenizer/flush-characters-in-document-write-expected.txt
patching file LayoutTests/fast/tokenizer/flush-characters-in-document-write.html
patching file WebCore/ChangeLog
Hunk #1 FAILED at 1.
1 out of 1 hunk FAILED -- saving rejects to file WebCore/ChangeLog.rej
patching file WebCore/html/HTMLTokenizer.cpp
patching file WebCore/html/HTMLTokenizer.h

Full output: http://queues.webkit.org/results/3775148
Comment 31 Adam Barth 2010-08-13 23:24:30 PDT
Created attachment 64409 [details]
Patch for landing
Comment 32 WebKit Commit Bot 2010-08-14 01:45:08 PDT
Comment on attachment 64409 [details]
Patch for landing

Rejecting patch 64409 from commit-queue.

Failed to run "['WebKitTools/Scripts/run-webkit-tests', '--no-launch-safari', '--exit-after-n-failures=1', '--wait-for-httpd', '--ignore-tests', 'compositing', '--quiet']" exit_code: 1
Running build-dumprendertree
Compiling Java tests
make: Nothing to be done for `default'.
Running tests from /Users/eseidel/Projects/CommitQueue/LayoutTests
Testing 20839 test cases.
http/tests/appcache/credential-url.html -> crashed

Exiting early after 1 failures. 19873 tests run.
747.73s total testing time

19872 test cases (99%) succeeded
1 test case (<1%) crashed
281 test cases (1%) had stderr output

Full output: http://queues.webkit.org/results/3768150
Comment 33 Eric Seidel (no email) 2010-08-14 08:39:05 PDT
Comment on attachment 64409 [details]
Patch for landing

Looks like a flake.
Comment 34 WebKit Commit Bot 2010-08-14 10:43:18 PDT
Comment on attachment 64409 [details]
Patch for landing

Rejecting patch 64409 from commit-queue.

Failed to run "['WebKitTools/Scripts/run-webkit-tests', '--no-launch-safari', '--exit-after-n-failures=1', '--wait-for-httpd', '--ignore-tests', 'compositing', '--quiet']" exit_code: 1
Running build-dumprendertree
Compiling Java tests
make: Nothing to be done for `default'.
Running tests from /Users/eseidel/Projects/CommitQueue/LayoutTests
Testing 20840 test cases.
http/tests/appcache/credential-url.html -> crashed

Exiting early after 1 failures. 19874 tests run.
738.32s total testing time

19873 test cases (99%) succeeded
1 test case (<1%) crashed
276 test cases (1%) had stderr output

Full output: http://queues.webkit.org/results/3747160
Comment 35 Adam Barth 2010-08-15 00:10:06 PDT
This patch caused an existing test to expose an existing crasher (Bug 44024), which we'll want to fix before landing this patch.  ;)
Comment 36 Adam Barth 2010-08-15 12:24:13 PDT
Comment on attachment 64409 [details]
Patch for landing

Okiedokes.  Let's give this another try.
Comment 37 WebKit Commit Bot 2010-08-15 12:43:41 PDT
Comment on attachment 64409 [details]
Patch for landing

Clearing flags on attachment: 64409

Committed r65382: <http://trac.webkit.org/changeset/65382>
Comment 38 WebKit Commit Bot 2010-08-15 12:43:50 PDT
All reviewed patches have been landed.  Closing bug.
Comment 39 Joel Parks 2011-03-21 11:52:08 PDT
re-purposing InTSW keyword for use by QtWebkit team