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
Rename WebCore::findHTMLTag to findTag and extend it to find SVG and MathML tags #3395
Conversation
Not sure if I've got the cmake changes right. Let's see what the bots say. |
67070d4
to
e7e9bf4
Compare
β¦MathML tags https://bugs.webkit.org/show_bug.cgi?id=244020 rdar://problem/98767683 Reviewed by NOBODY (OOPS!). We currently generate the WebCore::findHTMLTag function and use this in the AtomHTMLToken constructor. We can extend this to look for any known tag name (HTML, SVG, or MathML) by reworking make-names.pl a bit. This isn't helpful for Speedometer performance, since parsing non-HTML tags is rare, but local testing shows it to be a neutral change. Handling all known tag names will set the stage for a later patch that does improve Speedometer performance. We generate a new pair of files, KnownTag.h and KnownTag.cpp, move the old findHTMLTag function there, and rename it to findTag. * Source/WebCore/CMakeLists.txt: * Source/WebCore/DerivedSources-output.xcfilelist: * Source/WebCore/DerivedSources.make: * Source/WebCore/WebCore.xcodeproj/project.pbxproj: * Source/WebCore/WebCoreMacros.cmake: Build system changes to invoke make_names.pl to generate KnownTag.{h,cpp}. * Source/WebCore/dom/make_names.pl: (readKnownTags): Read a list of tag name files. Any duplicate tag name found in a subsequent file is ignored (e.g. the SVG script tag will be ignored if the HTML tag name file is parsed first). Since the %parameters hash doesn't make much sense when parsing multiple files, it's cleared out by the end of the function, but the namespace for each tag (which comes from the parameters object) is recorded on the tag object. (printNamesHeaderFile): (printNamesCppFile): Remove the findHTMLTag generation from generated HTMLNames.{h,cpp} etc. (printKnownTagsHeaderFile): (printKnownTagsCppFile): Generated findTag in KnownTag.{h,cpp}. Use the namespace stored on the tag object to decide the QualifiedName on which to look up the local name. (findMaxTagLength): Just refer to the global %allTags variable, like other functions do. (tagsWithLength): Simplify. (generateFindTagForLength): We need to replace "_"s with "-"s when generating the big switch statement, since the tag names it's operating on have already been converted into identifiers. * Source/WebCore/html/parser/AtomHTMLToken.h: (WebCore::AtomHTMLToken::AtomHTMLToken): Call the new findTag function.
e7e9bf4
to
fdf12c1
Compare
|
EWS run on previous version of this PR (hash e7e9bf4)
|
1 similar comment
EWS run on previous version of this PR (hash e7e9bf4)
|
EWS run on previous version of this PR (hash 67070d4)
|
1 similar comment
EWS run on previous version of this PR (hash 67070d4)
|
Cancelling review for now; I think the new |
fdf12c1
fdf12c1