Skip to content
  • ddkilzer@apple.com's avatar
    WebCore: · 82f9f10c
    ddkilzer@apple.com authored
            Bug 7931: Escaped elements within a textarea block can cause the textarea box to be closed prematurely
    
            <https://bugs.webkit.org/show_bug.cgi?id=7931>
    
            Reviewed by Darin.
    
            Tests: fast/parser/entity-end-iframe-tag.html
                   fast/parser/entity-end-script-tag.html
                   fast/parser/entity-end-style-tag.html
                   fast/parser/entity-end-textarea-tag.html
                   fast/parser/entity-end-title-tag.html
                   fast/parser/entity-end-xmp-tag.html
    
            Previously the parser accepted end tags for textarea, title and
            iframe elements that contained entity-escaped characters such as
            '&lt;'.  The fix is to save the position of the last entity-escaped
            character converted and to use that to make sure the end tag does
            not contain an escaped character.
    
            Note that this was not an issue for script, style and xmp elements
            since they already ignored entity-escaped characters.
    
            * html/HTMLTokenizer.cpp:
            (WebCore::HTMLTokenizer::parseSpecial): When looking for a closing
            tag, ignore any text with entity-escaped characters by making sure
            lastDecodedEntityPosition is less than the first character of the
            end tag.
    
    LayoutTests:
    
            Bug 7931: Escaped elements within a textarea block can cause the textarea box to be closed prematurely
    
            <https://bugs.webkit.org/show_bug.cgi?id=7931>
    
            Reviewed by Darin.
    
            The entity-end-textarea-tag.html contains 11 test cases:  one
            for each character in '</textarea>'.  The rest of the tests
            only test one encoding:  '<' as '&lt;'.
    
            * fast/parser/entity-end-iframe-tag-expected.txt: Added.
            * fast/parser/entity-end-iframe-tag.html: Added.
            * fast/parser/entity-end-script-tag-expected.txt: Added.
            * fast/parser/entity-end-script-tag.html: Added.
            * fast/parser/entity-end-style-tag-expected.txt: Added.
            * fast/parser/entity-end-style-tag.html: Added.
            * fast/parser/entity-end-textarea-tag-expected.txt: Added.
            * fast/parser/entity-end-textarea-tag.html: Added.
            * fast/parser/entity-end-title-tag-expected.txt: Added.
            * fast/parser/entity-end-title-tag.html: Added.
            * fast/parser/entity-end-xmp-tag-expected.txt: Added.
            * fast/parser/entity-end-xmp-tag.html: Added.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@34722 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    82f9f10c