Commit 5f8c1e85 authored by abarth@webkit.org's avatar abarth@webkit.org

WebCore:

2008-06-24  Adam Barth  <abarth@webkit.org>

        Reviewed by Darin Adler.

        Fix <https://bugs.webkit.org/show_bug.cgi?id=19597>

        Correctly parse <!-- </textarea> --> inside a <textarea>, matching
        Internet Explorer, Firefox, Opera, and HTML 5.

        Tests: fast/parser/comment-in-script-tricky.html
               fast/parser/comment-in-style.html
               fast/parser/comment-in-textarea.html
               fast/parser/comment-in-title.html

        * html/HTMLTokenizer.cpp:
        (WebCore::HTMLTokenizer::parseSpecial):

LayoutTests:

2008-06-24  Adam Barth  <abarth@webkit.org>

        Reviewed by Darin Adler.

        https://bugs.webkit.org/show_bug.cgi?id=19597

        Test that we correctly parse comments containing end tags in CDATA and
        RCDATA contexts.

        * fast/parser/comment-in-script-tricky-expected.txt: Added.
        * fast/parser/comment-in-script-tricky.html: Added.
        * fast/parser/comment-in-style.html: Added.
        * fast/parser/comment-in-textarea.html: Added.
        * fast/parser/comment-in-title-expected.txt: Added.
        * fast/parser/comment-in-title.html: Added.
        * platform/mac/fast/parser/comment-in-style-expected.checksum: Added.
        * platform/mac/fast/parser/comment-in-style-expected.png: Added.
        * platform/mac/fast/parser/comment-in-style-expected.txt: Added.
        * platform/mac/fast/parser/comment-in-textarea-expected.checksum: Added.
        * platform/mac/fast/parser/comment-in-textarea-expected.png: Added.
        * platform/mac/fast/parser/comment-in-textarea-expected.txt: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@34787 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 5d91738e
2008-06-24 Adam Barth <abarth@webkit.org>
Reviewed by Darin Adler.
https://bugs.webkit.org/show_bug.cgi?id=19597
Test that we correctly parse comments containing end tags in CDATA and
RCDATA contexts.
* fast/parser/comment-in-script-tricky-expected.txt: Added.
* fast/parser/comment-in-script-tricky.html: Added.
* fast/parser/comment-in-style.html: Added.
* fast/parser/comment-in-textarea.html: Added.
* fast/parser/comment-in-title-expected.txt: Added.
* fast/parser/comment-in-title.html: Added.
* platform/mac/fast/parser/comment-in-style-expected.checksum: Added.
* platform/mac/fast/parser/comment-in-style-expected.png: Added.
* platform/mac/fast/parser/comment-in-style-expected.txt: Added.
* platform/mac/fast/parser/comment-in-textarea-expected.checksum: Added.
* platform/mac/fast/parser/comment-in-textarea-expected.png: Added.
* platform/mac/fast/parser/comment-in-textarea-expected.txt: Added.
2008-06-24 Dan Bernstein <mitz@apple.com>
Reviewed by Mark Rowe.
<html>
<body>
<script>
if (window.layoutTestController)
layoutTestController.dumpAsText();
<!-- </script> -->
document.write('This should invoke document.write.');
</script>
</body>
</html>
<html>
<head>
<style>
/* <!-- </style> --> */
h1 { background-color: green; }
/* This comment should be part of the style. */
</style>
</head>
<body>
<h1>This text should have a green background.</h1>
</body>
</html>
<html>
<body>
<textarea>
<!-- </textarea> -->
This should be part of the textarea
</textarea>
</body>
</html>
The title of this document is:
<!-- </title> --> This text should be part of the title.
<html>
<head>
<title>
<!-- </title> -->
This text should be part of the title.
</title>
<script>
if (window.layoutTestController)
layoutTestController.dumpAsText();
window.onload = function () {
document.getElementById('console').appendChild(document.createTextNode(document.title));
}
</script>
</head>
<body>
<div>The title of this document is:</div>
<div id="console"></div>
</body>
</html>
89800d3484f30affcd171aa128435c60
\ No newline at end of file
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
layer at (0,0) size 800x600
RenderBlock {HTML} at (0,0) size 800x600
RenderBody {BODY} at (8,8) size 784x571
RenderBlock {H1} at (0,0) size 784x37 [bgcolor=#008000]
RenderText {#text} at (0,0) size 581x37
text run at (0,0) width 581: "This text should have a green background."
34d234b979785450b510527b32a87714
\ No newline at end of file
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
layer at (0,0) size 800x600
RenderBlock {HTML} at (0,0) size 800x600
RenderBody {BODY} at (8,8) size 784x584
RenderTextControl {TEXTAREA} at (2,2) size 163x28 [bgcolor=#FFFFFF] [border: (1px solid #000000)]
RenderText {#text} at (0,0) size 0x0
RenderText {#text} at (0,0) size 0x0
RenderText {#text} at (0,0) size 0x0
layer at (11,11) size 161x26 clip at (11,11) size 146x26 scrollHeight 52
RenderBlock {DIV} at (1,1) size 161x26
RenderText {#text} at (3,0) size 140x39
text run at (3,0) width 124: "<!-- </textarea> -->"
text run at (127,0) width 0: " "
text run at (3,13) width 140: "This should be part of the "
text run at (3,26) width 44: "textarea"
text run at (47,26) width 0: " "
RenderBR {BR} at (3,39) size 0x13
2008-06-24 Adam Barth <abarth@webkit.org>
Reviewed by Darin Adler.
Fix <https://bugs.webkit.org/show_bug.cgi?id=19597>
Correctly parse <!-- </textarea> --> inside a <textarea>, matching
Internet Explorer, Firefox, Opera, and HTML 5.
Tests: fast/parser/comment-in-script-tricky.html
fast/parser/comment-in-style.html
fast/parser/comment-in-textarea.html
fast/parser/comment-in-title.html
* html/HTMLTokenizer.cpp:
(WebCore::HTMLTokenizer::parseSpecial):
2008-06-24 Justin Garcia <justin.garcia@apple.com>
Reviewed by John.
......@@ -317,7 +317,7 @@ HTMLTokenizer::State HTMLTokenizer::parseSpecial(SegmentedString &src, State sta
checkScriptBuffer();
UChar ch = *src;
if (!scriptCodeResync && !brokenComments && !state.inTextArea() && !state.inXmp() && ch == '-' && scriptCodeSize >= 3 && !src.escaped() && scriptCode[scriptCodeSize-3] == '<' && scriptCode[scriptCodeSize-2] == '!' && scriptCode[scriptCodeSize-1] == '-') {
if (!scriptCodeResync && !brokenComments && !state.inXmp() && ch == '-' && scriptCodeSize >= 3 && !src.escaped() && scriptCode[scriptCodeSize-3] == '<' && scriptCode[scriptCodeSize-2] == '!' && scriptCode[scriptCodeSize-1] == '-') {
state.setInComment(true);
state = parseComment(src, state);
continue;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment