[Webkit-unassigned] [Bug 254755] New: HTML parser: only adjust approved SVG and MathML attributes
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Thu Mar 30 10:55:22 PDT 2023
https://bugs.webkit.org/show_bug.cgi?id=254755
Bug ID: 254755
Summary: HTML parser: only adjust approved SVG and MathML
attributes
Product: WebKit
Version: WebKit Nightly Build
Hardware: Unspecified
OS: Unspecified
Status: NEW
Severity: Normal
Priority: P2
Component: DOM
Assignee: webkit-unassigned at lists.webkit.org
Reporter: annevk at annevk.nl
CC: webkit-bug-importer at group.apple.com,
zimmermann at kde.org
The HTML Standard is quite particular about what attributes need to be adjusted: https://html.spec.whatwg.org/#adjust-mathml-attributes.
This results in 3 x 3 failures on WPT `html/syntax/parsing/html5lib_tests11.html`.
The fault lies in `HTMLTreeBuilder.cpp`. It uses `SVGNames::getSVGAttrs` (and seems to be only caller of that) rather than keeping its own list of known attributes. This is also the case for how it handles MathML, XLink, and XML names, but for those there are no test failures.
There are two solutions:
1. Change the tree builder to keep its own lists, similar to how the HTML Standard does it. I'm not familiar enough with C++ syntax to tackle this, but surely someone else is or can give directions. Given that the tree builder appears to be the sole consumer of `getSVGAttrs` and friends this might allow for some simplifications elsewhere in the code.
2. Remove the SVG attributes that cause the problem from `svgattrs.in`: contentScriptType, contentStyleType, and externalResourcesRequired. The first two seem fine, but the last one has some other uses it seems, but perhaps it's still safe to remove? None of these are cross-browser and technically are not supposed to work in HTML.
The main problem with 2 is that we might introduce the problem again in the future so perhaps it ought to be accompanied by asserts for the various name tables that no new camelcase names are added. Thoughts appreciated.
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20230330/43938903/attachment.htm>
More information about the webkit-unassigned
mailing list