WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch for landing
bug-107082-20130116185642.patch (text/plain), 6.06 KB, created by
Adam Barth
on 2013-01-16 18:59:41 PST
(
hide
)
Description:
Patch for landing
Filename:
MIME Type:
Creator:
Adam Barth
Created:
2013-01-16 18:59:41 PST
Size:
6.06 KB
patch
obsolete
>Index: Source/WebCore/ChangeLog >=================================================================== >--- Source/WebCore/ChangeLog (revision 139950) >+++ Source/WebCore/ChangeLog (working copy) >@@ -1,3 +1,24 @@ >+2013-01-16 Tony Gentilcore <tonyg@chromium.org> >+ >+ Introduce a method to build the tree from a CompactHTMLToken >+ https://bugs.webkit.org/show_bug.cgi?id=107082 >+ >+ Reviewed by Adam Barth. >+ >+ No new tests because covered by existing fast/parser tests. >+ >+ * html/parser/HTMLDocumentParser.cpp: >+ (WebCore): >+ (WebCore::HTMLDocumentParser::constructTreeFromCompactHTMLToken): >+ * html/parser/HTMLDocumentParser.h: >+ * html/parser/HTMLToken.h: >+ (AtomicHTMLToken): >+ (WebCore::AtomicHTMLToken::create): >+ (WebCore::AtomicHTMLToken::AtomicHTMLToken): >+ * xml/parser/MarkupTokenBase.h: >+ (WebCore::AtomicMarkupTokenBase::AtomicMarkupTokenBase): >+ (AtomicMarkupTokenBase): >+ > 2013-01-16 Adam Barth <abarth@webkit.org> > > Introduce BackgroundHTMLParser for parsing HTML on a background thread >Index: Source/WebCore/html/parser/HTMLDocumentParser.cpp >=================================================================== >--- Source/WebCore/html/parser/HTMLDocumentParser.cpp (revision 139950) >+++ Source/WebCore/html/parser/HTMLDocumentParser.cpp (working copy) >@@ -340,6 +340,16 @@ void HTMLDocumentParser::constructTreeFr > } > } > >+#if ENABLE(THREADED_HTML_PARSER) >+ >+void HTMLDocumentParser::constructTreeFromCompactHTMLToken(const CompactHTMLToken& compactToken) >+{ >+ RefPtr<AtomicHTMLToken> token = AtomicHTMLToken::create(compactToken); >+ m_treeBuilder->constructTree(token.get()); >+} >+ >+#endif >+ > bool HTMLDocumentParser::hasInsertionPoint() > { > // FIXME: The wasCreatedByScript() branch here might not be fully correct. >Index: Source/WebCore/html/parser/HTMLDocumentParser.h >=================================================================== >--- Source/WebCore/html/parser/HTMLDocumentParser.h (revision 139950) >+++ Source/WebCore/html/parser/HTMLDocumentParser.h (working copy) >@@ -127,6 +127,9 @@ private: > void pumpTokenizer(SynchronousMode); > void pumpTokenizerIfPossible(SynchronousMode); > void constructTreeFromHTMLToken(HTMLToken&); >+#if ENABLE(THREADED_HTML_PARSER) >+ void constructTreeFromCompactHTMLToken(const CompactHTMLToken&); >+#endif > > void runScriptsForPausedTreeBuilder(); > void resumeParsingAfterScriptExecution(); >Index: Source/WebCore/html/parser/HTMLToken.h >=================================================================== >--- Source/WebCore/html/parser/HTMLToken.h (revision 139949) >+++ Source/WebCore/html/parser/HTMLToken.h (working copy) >@@ -26,6 +26,7 @@ > #ifndef HTMLToken_h > #define HTMLToken_h > >+#include "CompactHTMLToken.h" > #include "HTMLTokenTypes.h" > #include "MarkupTokenBase.h" > #include <wtf/RefCounted.h> >@@ -68,6 +69,15 @@ public: > return adoptRef(new AtomicHTMLToken(token)); > } > >+#if ENABLE(THREADED_HTML_PARSER) >+ >+ static PassRefPtr<AtomicHTMLToken> create(const CompactHTMLToken& token) >+ { >+ return adoptRef(new AtomicHTMLToken(token)); >+ } >+ >+#endif >+ > static PassRefPtr<AtomicHTMLToken> create(HTMLTokenTypes::Type type, const AtomicString& name, const Vector<Attribute>& attributes = Vector<Attribute>()) > { > return adoptRef(new AtomicHTMLToken(type, name, attributes)); >@@ -84,6 +94,48 @@ private: > { > } > >+#if ENABLE(THREADED_HTML_PARSER) >+ >+ explicit AtomicHTMLToken(const CompactHTMLToken& token) >+ : AtomicMarkupTokenBase<HTMLToken>(token.type()) >+ { >+ switch (m_type) { >+ case HTMLTokenTypes::Uninitialized: >+ ASSERT_NOT_REACHED(); >+ break; >+ case HTMLTokenTypes::DOCTYPE: >+ m_name = token.data(); >+ m_doctypeData = adoptPtr(new HTMLToken::DoctypeData()); >+ m_doctypeData->m_hasPublicIdentifier = true; >+ m_doctypeData->m_publicIdentifier.append(token.publicIdentifier().characters(), token.publicIdentifier().length()); >+ m_doctypeData->m_hasSystemIdentifier = true; >+ m_doctypeData->m_systemIdentifier.append(token.systemIdentifier().characters(), token.systemIdentifier().length()); >+ break; >+ case HTMLTokenTypes::EndOfFile: >+ break; >+ case HTMLTokenTypes::StartTag: >+ m_attributes.reserveInitialCapacity(token.attributes().size()); >+ for (Vector<CompactAttribute>::const_iterator it = token.attributes().begin(); it != token.attributes().end(); ++it) >+ m_attributes.append(Attribute(QualifiedName(nullAtom, it->name(), nullAtom), it->value())); >+ // Fall through! >+ case HTMLTokenTypes::EndTag: >+ m_selfClosing = token.selfClosing(); >+ m_name = AtomicString(token.data()); >+ break; >+ case HTMLTokenTypes::Comment: >+ m_data = token.data(); >+ break; >+ case HTMLTokenTypes::Character: >+ m_externalCharacters = token.data().characters(); >+ m_externalCharactersLength = token.data().length(); >+ break; >+ default: >+ break; >+ } >+ } >+ >+#endif >+ > AtomicHTMLToken(HTMLTokenTypes::Type type, const AtomicString& name, const Vector<Attribute>& attributes = Vector<Attribute>()) > : AtomicMarkupTokenBase<HTMLToken>(type, name, attributes) > { >Index: Source/WebCore/xml/parser/MarkupTokenBase.h >=================================================================== >--- Source/WebCore/xml/parser/MarkupTokenBase.h (revision 139949) >+++ Source/WebCore/xml/parser/MarkupTokenBase.h (working copy) >@@ -473,6 +473,15 @@ public: > } > } > >+ explicit AtomicMarkupTokenBase(typename Token::Type::Type type) >+ : m_type(type) >+ , m_externalCharacters(0) >+ , m_externalCharactersLength(0) >+ , m_isAll8BitData(false) >+ , m_selfClosing(false) >+ { >+ } >+ > AtomicMarkupTokenBase(typename Token::Type::Type type, const AtomicString& name, const Vector<Attribute>& attributes = Vector<Attribute>()) > : m_type(type) > , m_name(name)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 107082
:
183088
|
183090
| 183094