Commit 08c7ee2b authored by commit-queue@webkit.org's avatar commit-queue@webkit.org
Browse files

Unreviewed, rolling out r159764.

http://trac.webkit.org/changeset/159764
https://bugs.webkit.org/show_bug.cgi?id=125055

appears to hurt html5-full-render times (Requested by kling on
#webkit).

* html/parser/HTMLConstructionSite.cpp:
(WebCore::HTMLConstructionSite::insertTextNode):
* html/parser/HTMLConstructionSite.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159909 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 90901b5d
2013-12-01 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r159764.
http://trac.webkit.org/changeset/159764
https://bugs.webkit.org/show_bug.cgi?id=125055
appears to hurt html5-full-render times (Requested by kling on
#webkit).
* html/parser/HTMLConstructionSite.cpp:
(WebCore::HTMLConstructionSite::insertTextNode):
* html/parser/HTMLConstructionSite.h:
2013-12-01 Andreas Kling <akling@apple.com> 2013-12-01 Andreas Kling <akling@apple.com>
   
Make more computed style helpers return PassRef. Make more computed style helpers return PassRef.
...@@ -505,11 +505,11 @@ void HTMLConstructionSite::insertTextNode(const String& characters, WhitespaceMo ...@@ -505,11 +505,11 @@ void HTMLConstructionSite::insertTextNode(const String& characters, WhitespaceMo
} }
while (currentPosition < characters.length()) { while (currentPosition < characters.length()) {
RefPtr<Text> textNode = Text::createWithLengthLimit(task.parent->document(), stringForTextNode(characters, shouldUseAtomicString), currentPosition, lengthLimit); RefPtr<Text> textNode = Text::createWithLengthLimit(task.parent->document(), shouldUseAtomicString ? AtomicString(characters).string() : characters, currentPosition, lengthLimit);
// If we have a whole string of unbreakable characters the above could lead to an infinite loop. Exceeding the length limit is the lesser evil. // If we have a whole string of unbreakable characters the above could lead to an infinite loop. Exceeding the length limit is the lesser evil.
if (!textNode->length()) { if (!textNode->length()) {
String substring = characters.substring(currentPosition); String substring = characters.substring(currentPosition);
textNode = Text::create(task.parent->document(), stringForTextNode(substring, shouldUseAtomicString)); textNode = Text::create(task.parent->document(), shouldUseAtomicString ? AtomicString(substring).string() : substring);
} }
currentPosition += textNode->length(); currentPosition += textNode->length();
...@@ -666,14 +666,4 @@ void HTMLConstructionSite::fosterParent(PassRefPtr<Node> node) ...@@ -666,14 +666,4 @@ void HTMLConstructionSite::fosterParent(PassRefPtr<Node> node)
m_attachmentQueue.append(task); m_attachmentQueue.append(task);
} }
String HTMLConstructionSite::stringForTextNode(const String& string, bool shouldUseAtomicString)
{
static const unsigned maximumLengthForDeduplication = 64;
if (shouldUseAtomicString)
return AtomicString(string).string();
if (string.length() > maximumLengthForDeduplication)
return string;
return *m_stringsForDeduplication.add(string).iterator;
}
} }
...@@ -170,8 +170,6 @@ private: ...@@ -170,8 +170,6 @@ private:
void mergeAttributesFromTokenIntoElement(AtomicHTMLToken*, Element*); void mergeAttributesFromTokenIntoElement(AtomicHTMLToken*, Element*);
void dispatchDocumentElementAvailableIfNeeded(); void dispatchDocumentElementAvailableIfNeeded();
String stringForTextNode(const String&, bool shouldUseAtomicString);
Document* m_document; Document* m_document;
// This is the root ContainerNode to which the parser attaches all newly // This is the root ContainerNode to which the parser attaches all newly
...@@ -198,8 +196,6 @@ private: ...@@ -198,8 +196,6 @@ private:
unsigned m_maximumDOMTreeDepth; unsigned m_maximumDOMTreeDepth;
bool m_inQuirksMode; bool m_inQuirksMode;
HashSet<String> m_stringsForDeduplication;
}; };
} // namespace WebCore } // namespace WebCore
......
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