Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update HTMLFastPathParser::scanTagName() to return an ElementName #12270

Merged

Conversation

cdumez
Copy link
Contributor

@cdumez cdumez commented Apr 1, 2023

8e6de78

Update HTMLFastPathParser::scanTagName() to return an ElementName
https://bugs.webkit.org/show_bug.cgi?id=254857

Reviewed by Darin Adler.

Update HTMLFastPathParser::scanTagName() to return an ElementName enum instead
of a Span<Character>. This simplifies the logic in the HTML fast parser and is
slightly more efficient.

* Source/WebCore/dom/make_names.pl:
(printElementNameHeaderFile):
(printElementNameCppFile):
* Source/WebCore/html/parser/HTMLDocumentParserFastPath.cpp:
(WebCore::HTMLFastPathParser::scanTagName):
(WebCore::HTMLFastPathParser::parseSpecificElements):
(WebCore::HTMLFastPathParser::parseElement):
(WebCore::onlyContainsLowercaseASCIILetters): Deleted.
(WebCore::tagNameHash): Deleted.

Canonical link: https://commits.webkit.org/262484@main

1f6983c

Misc iOS, tvOS & watchOS macOS Linux Windows
βœ… πŸ§ͺ style βœ… πŸ›  ios βœ… πŸ›  mac βœ… πŸ›  wpe βœ… πŸ›  wincairo
βœ… πŸ§ͺ bindings βœ… πŸ›  ios-sim βœ… πŸ›  mac-AS-debug βœ… πŸ§ͺ wpe-wk2
βœ… πŸ§ͺ webkitperl βœ… πŸ§ͺ ios-wk2 βœ… πŸ§ͺ api-mac βœ… πŸ›  gtk
βœ… πŸ§ͺ api-ios βœ… πŸ§ͺ mac-wk1   πŸ§ͺ gtk-wk2
βœ… πŸ›  tv   πŸ§ͺ mac-wk2 βœ… πŸ§ͺ api-gtk
βœ… πŸ›  tv-sim βœ… πŸ§ͺ mac-AS-debug-wk2
βœ… πŸ›  watch βœ… πŸ§ͺ mac-wk2-stress
βœ… πŸ›  πŸ§ͺ merge βœ… πŸ›  watch-sim

@cdumez cdumez self-assigned this Apr 1, 2023
@cdumez cdumez added the DOM For bugs specific to XML/HTML DOM elements (including parsing). label Apr 1, 2023
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Apr 1, 2023
@cdumez cdumez removed the merging-blocked Applied to prevent a change from being merged label Apr 1, 2023
@cdumez cdumez marked this pull request as ready for review April 1, 2023 07:03
@cdumez cdumez requested a review from rniwa as a code owner April 1, 2023 07:03
Comment on lines 1051 to 1052
print F "ElementName findHTMLElementNameFromBuffer(Span<const LChar>);\n";
print F "ElementName findHTMLElementNameFromBuffer(Span<const UChar>);\n";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can these just be findHTMLElementName? I don’t think we need β€œfrom buffer” in the name.

@@ -845,16 +815,16 @@ class HTMLFastPathParser {

template<class... Tags> RefPtr<Element> parseSpecificElements()
{
CharSpan tagName = scanTagName();
ElementName tagName = scanTagName();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

auto

@cdumez cdumez force-pushed the 254857_scanTagName_ElementName branch from 7fb9a90 to 0958e72 Compare April 1, 2023 17:10
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Apr 1, 2023
@cdumez cdumez removed the merging-blocked Applied to prevent a change from being merged label Apr 1, 2023
@cdumez cdumez force-pushed the 254857_scanTagName_ElementName branch from 0958e72 to 1f6983c Compare April 1, 2023 17:37
@cdumez cdumez added the merge-queue Applied to send a pull request to merge-queue label Apr 1, 2023
https://bugs.webkit.org/show_bug.cgi?id=254857

Reviewed by Darin Adler.

Update HTMLFastPathParser::scanTagName() to return an ElementName enum instead
of a Span<Character>. This simplifies the logic in the HTML fast parser and is
slightly more efficient.

* Source/WebCore/dom/make_names.pl:
(printElementNameHeaderFile):
(printElementNameCppFile):
* Source/WebCore/html/parser/HTMLDocumentParserFastPath.cpp:
(WebCore::HTMLFastPathParser::scanTagName):
(WebCore::HTMLFastPathParser::parseSpecificElements):
(WebCore::HTMLFastPathParser::parseElement):
(WebCore::onlyContainsLowercaseASCIILetters): Deleted.
(WebCore::tagNameHash): Deleted.

Canonical link: https://commits.webkit.org/262484@main
@webkit-commit-queue
Copy link
Collaborator

Committed 262484@main (8e6de78): https://commits.webkit.org/262484@main

Reviewed commits have been landed. Closing PR #12270 and removing active labels.

@webkit-commit-queue webkit-commit-queue merged commit 8e6de78 into WebKit:main Apr 1, 2023
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Apr 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DOM For bugs specific to XML/HTML DOM elements (including parsing).
Projects
None yet
5 participants