Changeset 60791 in webkit


Ignore:
Timestamp:
Jun 7, 2010 11:51:31 AM (14 years ago)
Author:
abarth@webkit.org
Message:

2010-06-07 Adam Barth <abarth@webkit.org>

Reviewed by Eric Seidel.

"Fix" fast/dom/stripNullFromTextNodes.html in HTML5 parser
https://bugs.webkit.org/show_bug.cgi?id=40200

The proper handling of null characters is to replace them with U+FFFD.
This patch "fixes" fast/dom/stripNullFromTextNodes.html in the sense
that it makes it give the proper output w.r.t. HTML5. However, that
doesn't match the behavior of the old parser, which just stripped the
nulls.

  • html/HTML5Lexer.h: (WebCore::HTML5Lexer::InputStreamPreprocessor::peek):
Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r60790 r60791  
     12010-06-07  Adam Barth  <abarth@webkit.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        "Fix" fast/dom/stripNullFromTextNodes.html in HTML5 parser
     6        https://bugs.webkit.org/show_bug.cgi?id=40200
     7
     8        The proper handling of null characters is to replace them with U+FFFD.
     9        This patch "fixes" fast/dom/stripNullFromTextNodes.html in the sense
     10        that it makes it give the proper output w.r.t. HTML5.  However, that
     11        doesn't match the behavior of the old parser, which just stripped the
     12        nulls.
     13
     14        * html/HTML5Lexer.h:
     15        (WebCore::HTML5Lexer::InputStreamPreprocessor::peek):
     16
    1172010-06-07  Adam Barth  <abarth@webkit.org>
    218
  • trunk/WebCore/html/HTML5Lexer.h

    r60790 r60791  
    158158                    m_nextInputCharacter = '\n';
    159159                    m_skipNextNewLine = true;
    160                 } else
     160                } else {
    161161                    m_skipNextNewLine = false;
     162                    if (m_nextInputCharacter == '\0' || (m_nextInputCharacter >= 0xD800 && m_nextInputCharacter <= 0xDFFF))
     163                        m_nextInputCharacter = 0xFFFD;
     164                }
    162165                return true;
    163166            }
Note: See TracChangeset for help on using the changeset viewer.