forked from WebKit/WebKit-http
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HTML Parser should produce 8bit substrings for inline style and scrip…
…t elements https://bugs.webkit.org/show_bug.cgi?id=93742 Reviewed by Benjamin Poulain. Source/WebCore: Currently all data associated with a token is stored and processed as UChars. Added code to determine that the contents of token data is all 8 bit by keeping the logical OR value of all prior characters. Also added a flag that the parser can set to indicate when the token data is converted to a String that we want to make an 8 bit string if possible. Enabled this handling for script, style, iframe, noembed, noframes, noscript and xmp tags. No new tests. Existing tests provide coverage. * html/parser/HTMLTokenizer.cpp: (WebCore::HTMLTokenizer::nextToken): * html/parser/HTMLTreeBuilder.cpp: (WebCore::HTMLTreeBuilder::ExternalCharacterTokenBuffer::ExternalCharacterTokenBuffer): (WebCore::HTMLTreeBuilder::ExternalCharacterTokenBuffer::isAll8BitData): (HTMLTreeBuilder::ExternalCharacterTokenBuffer): (WebCore::HTMLTreeBuilder::ExternalCharacterTokenBuffer::takeRemaining): * xml/parser/MarkupTokenBase.h: (WebCore::MarkupTokenBase::clear): (WebCore::MarkupTokenBase::appendToCharacter): (MarkupTokenBase): (WebCore::MarkupTokenBase::eraseCharacters): (WebCore::MarkupTokenBase::setConvertTo8Bit): (WebCore::MarkupTokenBase::isAll8BitData): (WebCore::AtomicMarkupTokenBase::AtomicMarkupTokenBase): (WebCore::AtomicMarkupTokenBase::isAll8BitData): (AtomicMarkupTokenBase): (WebCore::AtomicMarkupTokenBase::clearExternalCharacters): Source/WTF: Added 8 bit path to String::isAllSpecialCharacters(). Added new String creator that takes a pointer to a UChar array that is known to contain only 8 bit characters (LChar's). Added new helper method to copy contents of a UChar buffer to a LChar buffer. The helper method includes X86-64 intrinsics of SSE family instructions for performance. * wtf/Alignment.h: (WTF::isAlignedTo): * wtf/text/ASCIIFastPath.h: (WTF::copyLCharsFromUCharSource): * wtf/text/WTFString.cpp: (WTF::String::make8BitFrom16BitSource): * wtf/text/WTFString.h: (String): (WTF::isAllSpecialCharacters): (WTF::String::isAllSpecialCharacters): git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125846 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
9 changed files
with
186 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters