mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 11:49:44 +00:00
LibWeb: Don't compare against HTML-uppercased tag names in HTML parser
Element::tag_name() returns an uppercased string for HTML elements, which is usually not what's expected by the parser algorithms that look at tag names.
This commit is contained in:
parent
79613eae7f
commit
49b88fc095
Notes:
github-actions[bot]
2024-11-05 11:30:36 +00:00
Author: https://github.com/awesomekling
Commit: 49b88fc095
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2161
2 changed files with 25 additions and 23 deletions
|
@ -6,8 +6,8 @@ Rerun
|
|||
|
||||
Found 66 tests
|
||||
|
||||
47 Pass
|
||||
19 Fail
|
||||
63 Pass
|
||||
3 Fail
|
||||
Details
|
||||
Result Test Name MessagePass html5lib_innerHTML_foreign-fragment.html 4917b7458e1fff6c5cb21d7baf6863cc9550c61e
|
||||
Pass html5lib_innerHTML_foreign-fragment.html b6d19b8ccacd2fde354df002b856f649ae91b20e
|
||||
|
@ -27,44 +27,44 @@ Pass html5lib_innerHTML_foreign-fragment.html 2007abb6eef0427335962c65b7c8d7315f
|
|||
Pass html5lib_innerHTML_foreign-fragment.html 2e22f45e60f67be00f4827a4ca18f6bce7d7aacb
|
||||
Pass html5lib_innerHTML_foreign-fragment.html ba901841df046ba97bff9470e995f9792cb4aba5
|
||||
Pass html5lib_innerHTML_foreign-fragment.html 439bec6b2c990ad6650baef76ebfb08220b186cf
|
||||
Fail html5lib_innerHTML_foreign-fragment.html 6b7a24dd43b1f9059baee275caefabbef4b2d131
|
||||
Pass html5lib_innerHTML_foreign-fragment.html 6b7a24dd43b1f9059baee275caefabbef4b2d131
|
||||
Pass html5lib_innerHTML_foreign-fragment.html 0a323099fae55bee0bf410053a7b5dae30ac6621
|
||||
Pass html5lib_innerHTML_foreign-fragment.html 0b4329325579cf075c3a220f1e19825804e5775f
|
||||
Fail html5lib_innerHTML_foreign-fragment.html d2f37bafc0cd3bf4530cc1f6ef2fd261e0720201
|
||||
Fail html5lib_innerHTML_foreign-fragment.html 6d037965d612d849672a73f2e8649ea90907483d
|
||||
Pass html5lib_innerHTML_foreign-fragment.html d2f37bafc0cd3bf4530cc1f6ef2fd261e0720201
|
||||
Pass html5lib_innerHTML_foreign-fragment.html 6d037965d612d849672a73f2e8649ea90907483d
|
||||
Pass html5lib_innerHTML_foreign-fragment.html 5bcd7fe5efe9d5a750a8cc293db28b686644cb13
|
||||
Pass html5lib_innerHTML_foreign-fragment.html 9db26efc179b9a1be9cc7ea3086e4a9554e42562
|
||||
Fail html5lib_innerHTML_foreign-fragment.html e2bb8b2426ee1452f323274b05a458d52bf2f631
|
||||
Fail html5lib_innerHTML_foreign-fragment.html 387ce2642c063a59c09b0a267cb8d35000e0a5a9
|
||||
Pass html5lib_innerHTML_foreign-fragment.html e2bb8b2426ee1452f323274b05a458d52bf2f631
|
||||
Pass html5lib_innerHTML_foreign-fragment.html 387ce2642c063a59c09b0a267cb8d35000e0a5a9
|
||||
Pass html5lib_innerHTML_foreign-fragment.html 849d87495f6410c685eeceaaa9ce7331aa34c347
|
||||
Pass html5lib_innerHTML_foreign-fragment.html 8377205f1e8ae86e7b7f2679410ed480ddb6bdab
|
||||
Fail html5lib_innerHTML_foreign-fragment.html 8f929d7038047d37e8faf1e8956c7fa4c5b6b687
|
||||
Fail html5lib_innerHTML_foreign-fragment.html 4070c271e57701248ff03bc6a2b9e714b69a8d61
|
||||
Pass html5lib_innerHTML_foreign-fragment.html 8f929d7038047d37e8faf1e8956c7fa4c5b6b687
|
||||
Pass html5lib_innerHTML_foreign-fragment.html 4070c271e57701248ff03bc6a2b9e714b69a8d61
|
||||
Pass html5lib_innerHTML_foreign-fragment.html 59e76a925187915211a6ec38d0908a30577240c0
|
||||
Pass html5lib_innerHTML_foreign-fragment.html ea8e786baa7f216bc0346e425991ec6665142d82
|
||||
Fail html5lib_innerHTML_foreign-fragment.html 1b2d5a4c9bed75970b2a6d71c33e52788c736fac
|
||||
Fail html5lib_innerHTML_foreign-fragment.html 3657e075c88c2088e844cfb5140d344083c0b85a
|
||||
Pass html5lib_innerHTML_foreign-fragment.html 1b2d5a4c9bed75970b2a6d71c33e52788c736fac
|
||||
Pass html5lib_innerHTML_foreign-fragment.html 3657e075c88c2088e844cfb5140d344083c0b85a
|
||||
Pass html5lib_innerHTML_foreign-fragment.html 909832844e7ff22822696f30c9ad9aba08b86a25
|
||||
Pass html5lib_innerHTML_foreign-fragment.html 6ed082cc506da530d3128c24b8980cb551f28c43
|
||||
Fail html5lib_innerHTML_foreign-fragment.html 18609521e139b2ffea10b1cd0cab5dc133b921c4
|
||||
Pass html5lib_innerHTML_foreign-fragment.html 18609521e139b2ffea10b1cd0cab5dc133b921c4
|
||||
Pass html5lib_innerHTML_foreign-fragment.html 14e07b0c2adecfe362428885346c200e89f08e66
|
||||
Pass html5lib_innerHTML_foreign-fragment.html 0cb505b329a178f11563ae05fe553f33f57d01cd
|
||||
Pass html5lib_innerHTML_foreign-fragment.html b4c43a4fcdaa1a4c753674c4f92987b70d54d80b
|
||||
Pass html5lib_innerHTML_foreign-fragment.html 7021fb0933e92112b94ee54b923efb6bc71e3b07
|
||||
Pass html5lib_innerHTML_foreign-fragment.html 7c4b1614e2180b6649f3b02cf5c4a9d735166e1b
|
||||
Fail html5lib_innerHTML_foreign-fragment.html bdeacb9250263776c63c2c7f731717c389bdc34c
|
||||
Pass html5lib_innerHTML_foreign-fragment.html bdeacb9250263776c63c2c7f731717c389bdc34c
|
||||
Fail html5lib_innerHTML_foreign-fragment.html 2c46c15bdba5835b0f2f0e9eb5bc8566047b7d6d
|
||||
Fail html5lib_innerHTML_foreign-fragment.html 8dfcfbf823ad6c7b6f7b81efc352f29b4e41e8be
|
||||
Fail html5lib_innerHTML_foreign-fragment.html 74a8a40517c6fe110f0c71af7efb56d459ea8227
|
||||
Pass html5lib_innerHTML_foreign-fragment.html 74a8a40517c6fe110f0c71af7efb56d459ea8227
|
||||
Pass html5lib_innerHTML_foreign-fragment.html 0c1782eb0f62f616627f0132729d6a194f8b7546
|
||||
Pass html5lib_innerHTML_foreign-fragment.html 9dc5a819afe33d6babc04edc8f92cb8045f0f006
|
||||
Pass html5lib_innerHTML_foreign-fragment.html 1a7663e45ee098567d82d0fa4351794cc7ef26f9
|
||||
Fail html5lib_innerHTML_foreign-fragment.html 74fc819300ea11a14c04d5840d1daf6f998be64c
|
||||
Fail html5lib_innerHTML_foreign-fragment.html fe33f97f6a5482b2663340572a0d79309199c815
|
||||
Pass html5lib_innerHTML_foreign-fragment.html 74fc819300ea11a14c04d5840d1daf6f998be64c
|
||||
Pass html5lib_innerHTML_foreign-fragment.html fe33f97f6a5482b2663340572a0d79309199c815
|
||||
Pass html5lib_innerHTML_foreign-fragment.html dfaa71da17a62d7f5de9f180beefcf36a05ce447
|
||||
Pass html5lib_innerHTML_foreign-fragment.html 822f22f8f09e3a5cc1575f17487f3138543ce138
|
||||
Fail html5lib_innerHTML_foreign-fragment.html 48e58a3e03d51a1676401ad872c03b96c52d3e2e
|
||||
Fail html5lib_innerHTML_foreign-fragment.html 4e716ca1a2ba1079c8e163f8ba13dfc448abbf0f
|
||||
Pass html5lib_innerHTML_foreign-fragment.html 48e58a3e03d51a1676401ad872c03b96c52d3e2e
|
||||
Pass html5lib_innerHTML_foreign-fragment.html 4e716ca1a2ba1079c8e163f8ba13dfc448abbf0f
|
||||
Pass html5lib_innerHTML_foreign-fragment.html 33b553bb92ae345ef57f85312ad6e04c742f151e
|
||||
Pass html5lib_innerHTML_foreign-fragment.html e4208cd58954d48c8493fdf215595a4afe21621a
|
||||
Pass html5lib_innerHTML_foreign-fragment.html 6c4299f29a55fe8d2972ab3b0b8af6c8c640c88f
|
||||
|
|
|
@ -122,7 +122,7 @@ static bool is_mathml_text_integration_point(DOM::Element const& element)
|
|||
// - A MathML mn element
|
||||
// - A MathML ms element
|
||||
// - A MathML mtext element
|
||||
return element.tag_name().is_one_of(MathML::TagNames::mi, MathML::TagNames::mo, MathML::TagNames::mn, MathML::TagNames::ms, MathML::TagNames::mtext);
|
||||
return element.local_name().is_one_of(MathML::TagNames::mi, MathML::TagNames::mo, MathML::TagNames::mn, MathML::TagNames::ms, MathML::TagNames::mtext);
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/parsing.html#html-integration-point
|
||||
|
@ -132,7 +132,7 @@ static bool is_html_integration_point(DOM::Element const& element)
|
|||
// - A MathML annotation-xml element whose start tag token had an attribute with the name "encoding" whose value was an ASCII case-insensitive match for the string "text/html"
|
||||
// - A MathML annotation-xml element whose start tag token had an attribute with the name "encoding" whose value was an ASCII case-insensitive match for the string "application/xhtml+xml"
|
||||
if (element.namespace_uri() == Namespace::MathML
|
||||
&& element.tag_name() == MathML::TagNames::annotation_xml) {
|
||||
&& element.local_name() == MathML::TagNames::annotation_xml) {
|
||||
auto encoding = element.attribute("encoding"_fly_string);
|
||||
if (encoding.has_value() && (encoding->equals_ignoring_ascii_case("text/html"sv) || encoding->equals_ignoring_ascii_case("application/xhtml+xml"sv)))
|
||||
return true;
|
||||
|
@ -141,8 +141,10 @@ static bool is_html_integration_point(DOM::Element const& element)
|
|||
// - An SVG foreignObject element
|
||||
// - An SVG desc element
|
||||
// - An SVG title element
|
||||
if (element.tag_name().is_one_of(SVG::TagNames::foreignObject, SVG::TagNames::desc, SVG::TagNames::title))
|
||||
if (element.namespace_uri() == Namespace::SVG
|
||||
&& element.local_name().is_one_of(SVG::TagNames::foreignObject, SVG::TagNames::desc, SVG::TagNames::title)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -204,7 +206,7 @@ void HTMLParser::run(HTMLTokenizer::StopAtInsertionPoint stop_at_insertion_point
|
|||
|| adjusted_current_node()->namespace_uri() == Namespace::HTML
|
||||
|| (is_mathml_text_integration_point(*adjusted_current_node()) && token.is_start_tag() && token.tag_name() != MathML::TagNames::mglyph && token.tag_name() != MathML::TagNames::malignmark)
|
||||
|| (is_mathml_text_integration_point(*adjusted_current_node()) && token.is_character())
|
||||
|| (adjusted_current_node()->namespace_uri() == Namespace::MathML && adjusted_current_node()->tag_name() == MathML::TagNames::annotation_xml && token.is_start_tag() && token.tag_name() == SVG::TagNames::svg)
|
||||
|| (adjusted_current_node()->namespace_uri() == Namespace::MathML && adjusted_current_node()->local_name() == MathML::TagNames::annotation_xml && token.is_start_tag() && token.tag_name() == SVG::TagNames::svg)
|
||||
|| (is_html_integration_point(*adjusted_current_node()) && (token.is_start_tag() || token.is_character()))
|
||||
|| token.is_end_of_file()) {
|
||||
// -> If the stack of open elements is empty
|
||||
|
@ -4230,7 +4232,7 @@ void HTMLParser::process_using_the_rules_for_foreign_content(HTMLToken& token)
|
|||
}
|
||||
|
||||
// -> An end tag whose tag name is "script", if the current node is an SVG script element
|
||||
if (token.is_end_tag() && current_node()->namespace_uri() == Namespace::SVG && current_node()->tag_name() == SVG::TagNames::script) {
|
||||
if (token.is_end_tag() && current_node()->namespace_uri() == Namespace::SVG && current_node()->local_name() == SVG::TagNames::script) {
|
||||
ScriptEndTag:
|
||||
// Pop the current node off the stack of open elements.
|
||||
auto& script_element = verify_cast<SVG::SVGScriptElement>(*m_stack_of_open_elements.pop());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue