Changeset 272622 in webkit
- Timestamp:
- Feb 9, 2021 4:38:15 PM (18 months ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 7 edited
-
ChangeLog (modified) (1 diff)
-
dom/ScriptableDocumentParser.h (modified) (1 diff)
-
html/FTPDirectoryDocument.cpp (modified) (1 diff)
-
html/parser/HTMLDocumentParser.cpp (modified) (2 diffs)
-
html/parser/HTMLDocumentParser.h (modified) (1 diff)
-
xml/parser/XMLDocumentParser.cpp (modified) (1 diff)
-
xml/parser/XMLDocumentParser.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r272618 r272622 1 2021-02-09 Ryosuke Niwa <rniwa@webkit.org> 2 3 Reduce the overhead of HTMLDocumentParser in innerHTML setter 4 https://bugs.webkit.org/show_bug.cgi?id=221596 5 6 Reviewed by Simon Fraser. 7 8 This patch reduces the overhead of HTMLDocumentParser for innerHTML. 9 This appears to be ~0.5% Speedometer progression. 10 11 No new tests since there should be no observable behavior differences. 12 13 * dom/ScriptableDocumentParser.h: 14 (WebCore::ScriptableDocumentParser:isWaitingForScripts): Removed since this abstract 15 virtual function is only used in HTMLDocumentParser. 16 * html/FTPDirectoryDocument.cpp: 17 (WebCore::FTPDirectoryDocument::isWaitingForScripts): Removed. There are no scripts 18 in ftp directory document but there is no need to override it here. 19 * html/parser/HTMLDocumentParser.cpp: 20 (WebCore::HTMLDocumentParser::pumpTokenizer): Exit early when we're parsing a fragment 21 to avoid accessing the scheduler, preloader, and document loader for various things 22 since they're all irrelevant for fragment parsing. 23 (WebCore::HTMLDocumentParser::isWaitingForScripts const): Return false immediately when 24 parsing a document fragment as a fast path. 25 * html/parser/HTMLDocumentParser.h: 26 * xml/parser/XMLDocumentParser.cpp: 27 (WebCore::XMLDocumentParser::isWaitingForScripts const): Removed. Unused. 28 * xml/parser/XMLDocumentParser.h: 29 1 30 2021-02-09 Chris Dumez <cdumez@apple.com> 2 31 -
trunk/Source/WebCore/dom/ScriptableDocumentParser.h
r212614 r272622 39 39 virtual bool isExecutingScript() const { return false; } 40 40 41 virtual bool isWaitingForScripts() const = 0;42 43 41 virtual TextPosition textPosition() const = 0; 44 42 -
trunk/Source/WebCore/html/FTPDirectoryDocument.cpp
r268114 r272622 62 62 void finish() override; 63 63 64 // FIXME: Why do we need this?65 bool isWaitingForScripts() const override { return false; }66 67 64 void checkBuffer(int len = 10) 68 65 { -
trunk/Source/WebCore/html/parser/HTMLDocumentParser.cpp
r268700 r272622 327 327 ASSERT(refCount() >= 1); 328 328 329 if (isStopped() )329 if (isStopped() || isParsingFragment()) 330 330 return; 331 331 … … 516 516 bool HTMLDocumentParser::isWaitingForScripts() const 517 517 { 518 if (isParsingFragment()) { 519 // HTMLTreeBuilder may have a parser blocking script element but we ignore them during fragment parsing. 520 ASSERT(!m_scriptRunner || !m_scriptRunner->hasParserBlockingScript()); 521 return false; 522 } 518 523 // When the TreeBuilder encounters a </script> tag, it returns to the HTMLDocumentParser 519 524 // where the script is transfered from the treebuilder to the script runner. -
trunk/Source/WebCore/html/parser/HTMLDocumentParser.h
r257763 r272622 83 83 void prepareToStopParsing() final; 84 84 void stopParsing() final; 85 bool isWaitingForScripts() const override;85 bool isWaitingForScripts() const; 86 86 bool isExecutingScript() const final; 87 87 bool hasScriptsWaitingForStylesheets() const final; -
trunk/Source/WebCore/xml/parser/XMLDocumentParser.cpp
r262003 r272622 245 245 } 246 246 247 bool XMLDocumentParser::isWaitingForScripts() const248 {249 return m_pendingScript;250 }251 252 247 void XMLDocumentParser::pauseParsing() 253 248 { -
trunk/Source/WebCore/xml/parser/XMLDocumentParser.h
r252230 r272622 95 95 void append(RefPtr<StringImpl>&&) final; 96 96 void finish() final; 97 bool isWaitingForScripts() const final;98 97 void stopParsing() final; 99 98 void detach() final;
Note: See TracChangeset
for help on using the changeset viewer.