Skip to content

Commit

Permalink
Merge r221335 - Assertion failure when opening a file with a missing …
Browse files Browse the repository at this point in the history
…tag closing bracket

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

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2017-08-29
Reviewed by Darin Adler.

Source/WebCore:

If a tag is missing its closing bracket, the tokenizer just needs to advance()
the character position without checking m_currentCharacter != '\n'. Newline
character is a valid ending for partially closed tags.

Test: fast/tokenizer/missing-script-tag-closing-bracket.html

* html/parser/HTMLTokenizer.cpp:
(WebCore::HTMLTokenizer::commitToPartialEndTag):

LayoutTests:

* fast/tokenizer/missing-script-tag-closing-bracket-expected.txt: Added.
* fast/tokenizer/missing-script-tag-closing-bracket.html: Added.
  • Loading branch information
Said Abou-Hallawa authored and carlosgcampos committed Sep 2, 2017
1 parent 1192d5f commit 0cb983e
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 1 deletion.
10 changes: 10 additions & 0 deletions LayoutTests/ChangeLog
@@ -1,3 +1,13 @@
2017-08-29 Said Abou-Hallawa <sabouhallawa@apple.com>

Assertion failure when opening a file with a missing tag closing bracket
https://bugs.webkit.org/show_bug.cgi?id=176061

Reviewed by Darin Adler.

* fast/tokenizer/missing-script-tag-closing-bracket-expected.txt: Added.
* fast/tokenizer/missing-script-tag-closing-bracket.html: Added.

2017-08-19 Sergio Villar Senin <svillar@igalia.com>

[SVG] Leak in SVGAnimatedListPropertyTearOff
Expand Down
@@ -0,0 +1 @@
Pass if no assertion failure happens.
@@ -0,0 +1,7 @@
<body>
<p>Pass if no assertion failure happens.</p>
<script>
if (window.testRunner)
testRunner.dumpAsText();
</script
</body>
16 changes: 16 additions & 0 deletions Source/WebCore/ChangeLog
@@ -1,3 +1,19 @@
2017-08-29 Said Abou-Hallawa <sabouhallawa@apple.com>

Assertion failure when opening a file with a missing tag closing bracket
https://bugs.webkit.org/show_bug.cgi?id=176061

Reviewed by Darin Adler.

If a tag is missing its closing bracket, the tokenizer just needs to advance()
the character position without checking m_currentCharacter != '\n'. Newline
character is a valid ending for partially closed tags.

Test: fast/tokenizer/missing-script-tag-closing-bracket.html

* html/parser/HTMLTokenizer.cpp:
(WebCore::HTMLTokenizer::commitToPartialEndTag):

2017-08-19 Sergio Villar Senin <svillar@igalia.com>

[SVG] Leak in SVGAnimatedListPropertyTearOff
Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/html/parser/HTMLTokenizer.cpp
Expand Up @@ -159,7 +159,7 @@ bool HTMLTokenizer::commitToPartialEndTag(SegmentedString& source, UChar charact
{
ASSERT(source.currentCharacter() == character);
appendToTemporaryBuffer(character);
source.advancePastNonNewline();
source.advance();

if (haveBufferedCharacterToken()) {
// Emit the buffered character token.
Expand Down

0 comments on commit 0cb983e

Please sign in to comment.