diff --git a/Cargo.lock b/Cargo.lock index 747ddc00156..ca2387259a6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1134,7 +1134,7 @@ dependencies = [ [[package]] name = "html5ever" -version = "0.14.0" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "heapsize 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2253,7 +2253,7 @@ dependencies = [ "gfx_traits 0.0.1", "heapsize 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize_derive 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "html5ever 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)", + "html5ever 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)", "html5ever-atoms 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.9.18 (registry+https://github.com/rust-lang/crates.io-index)", "hyper_serde 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3413,7 +3413,7 @@ dependencies = [ "checksum heartbeats-simple 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9ad003ce233955e9d95f2c69cde84e68302ba9ba4a673d351c9bff93c738aadc" "checksum heartbeats-simple-sys 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e1a408c0011427cc0e0049f7861c70377819aedfc006e8c901b1c70fd98fb1a4" "checksum hpack 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3d2da7d3a34cf6406d9d700111b8eafafe9a251de41ae71d8052748259343b58" -"checksum html5ever 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a3b2e982006a000535c1976213cd1baa3f455cd19335d50992ab219ffe1d3c06" +"checksum html5ever 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c28216b1b9d20ef7407d8d633a3c1c4ec9a529ee661184aac0a03876709bd6b8" "checksum html5ever-atoms 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f9bd86e3b6a5a7933a272cc0a854f24e371f31576e585c0b41e8f857270c5134" "checksum httparse 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a6e7a63e511f9edffbab707141fbb8707d1a3098615fb2adbd5769cdfcc9b17d" "checksum hyper 0.9.18 (registry+https://github.com/rust-lang/crates.io-index)" = "1b9bf64f730d6ee4b0528a5f0a316363da9d8104318731509d4ccc86248f82b3" diff --git a/components/script/dom/servoparser/html.rs b/components/script/dom/servoparser/html.rs index 688e2aba788..6142dba20f6 100644 --- a/components/script/dom/servoparser/html.rs +++ b/components/script/dom/servoparser/html.rs @@ -33,6 +33,7 @@ use html5ever::tree_builder::{NodeOrText, QuirksMode}; use html5ever::tree_builder::{Tracer as HtmlTracer, TreeBuilder, TreeBuilderOpts, TreeSink}; use js::jsapi::JSTracer; use servo_url::ServoUrl; +use std::ascii::AsciiExt; use std::borrow::Cow; use std::io::{self, Write}; use style::context::QuirksMode as ServoQuirksMode; @@ -264,6 +265,16 @@ impl TreeSink for Sink { } } + /// https://html.spec.whatwg.org/multipage/#html-integration-point + /// Specifically, the cases. + fn is_mathml_annotation_xml_integration_point(&self, handle: JS) -> bool { + let elem = handle.downcast::().unwrap(); + elem.get_attribute(&ns!(), &local_name!("encoding")).map_or(false, |attr| { + attr.value().eq_ignore_ascii_case("text/html") + || attr.value().eq_ignore_ascii_case("application/xhtml+xml") + }) + } + fn set_current_line(&mut self, line_number: u64) { self.current_line = line_number; } diff --git a/tests/wpt/metadata/html/syntax/parsing/html5lib_menuitem-element.html.ini b/tests/wpt/metadata/html/syntax/parsing/html5lib_menuitem-element.html.ini new file mode 100644 index 00000000000..a025d91c416 --- /dev/null +++ b/tests/wpt/metadata/html/syntax/parsing/html5lib_menuitem-element.html.ini @@ -0,0 +1,35 @@ +[html5lib_menuitem-element.html?run_type=uri] + type: testharness + [html5lib_menuitem-element.html afcd3b1e3317ac609ddab924d836ba1e3873b80f] + expected: FAIL + + [html5lib_menuitem-element.html 95c0c6923fe609297c1592f2cb82bb9f2d0f5aed] + expected: FAIL + + [html5lib_menuitem-element.html e2772fe779cbcefb4458f169a0cd495cf7115845] + expected: FAIL + + +[html5lib_menuitem-element.html?run_type=write_single] + type: testharness + [html5lib_menuitem-element.html afcd3b1e3317ac609ddab924d836ba1e3873b80f] + expected: FAIL + + [html5lib_menuitem-element.html 95c0c6923fe609297c1592f2cb82bb9f2d0f5aed] + expected: FAIL + + [html5lib_menuitem-element.html e2772fe779cbcefb4458f169a0cd495cf7115845] + expected: FAIL + + +[html5lib_menuitem-element.html?run_type=write] + type: testharness + [html5lib_menuitem-element.html afcd3b1e3317ac609ddab924d836ba1e3873b80f] + expected: FAIL + + [html5lib_menuitem-element.html 95c0c6923fe609297c1592f2cb82bb9f2d0f5aed] + expected: FAIL + + [html5lib_menuitem-element.html e2772fe779cbcefb4458f169a0cd495cf7115845] + expected: FAIL + diff --git a/tests/wpt/metadata/html/syntax/parsing/html5lib_tests20.html.ini b/tests/wpt/metadata/html/syntax/parsing/html5lib_tests20.html.ini deleted file mode 100644 index 34df6efa61d..00000000000 --- a/tests/wpt/metadata/html/syntax/parsing/html5lib_tests20.html.ini +++ /dev/null @@ -1,56 +0,0 @@ -[html5lib_tests20.html?run_type=write_single] - type: testharness - [html5lib_tests20.html a7e70930137ff8338778253ac93dc66f11eef966] - expected: FAIL - bug: https://github.com/servo/servo/issues/15980 - - [html5lib_tests20.html b92100bddc318e13996fbe96c087c35152cbb4e3] - expected: FAIL - bug: https://github.com/servo/servo/issues/15980 - - [html5lib_tests20.html f55b68de8cf9ec17e0512a6caae94e0fbf151260] - expected: FAIL - bug: https://github.com/servo/servo/issues/15980 - - [html5lib_tests20.html 7fb0d4342e3ed3fabee650b83ce66ffb2f66c173] - expected: FAIL - bug: https://github.com/servo/servo/issues/15980 - - -[html5lib_tests20.html?run_type=write] - type: testharness - [html5lib_tests20.html a7e70930137ff8338778253ac93dc66f11eef966] - expected: FAIL - bug: https://github.com/servo/servo/issues/15980 - - [html5lib_tests20.html b92100bddc318e13996fbe96c087c35152cbb4e3] - expected: FAIL - bug: https://github.com/servo/servo/issues/15980 - - [html5lib_tests20.html f55b68de8cf9ec17e0512a6caae94e0fbf151260] - expected: FAIL - bug: https://github.com/servo/servo/issues/15980 - - [html5lib_tests20.html 7fb0d4342e3ed3fabee650b83ce66ffb2f66c173] - expected: FAIL - bug: https://github.com/servo/servo/issues/15980 - - -[html5lib_tests20.html?run_type=uri] - type: testharness - [html5lib_tests20.html a7e70930137ff8338778253ac93dc66f11eef966] - expected: FAIL - bug: https://github.com/servo/servo/issues/15980 - - [html5lib_tests20.html b92100bddc318e13996fbe96c087c35152cbb4e3] - expected: FAIL - bug: https://github.com/servo/servo/issues/15980 - - [html5lib_tests20.html f55b68de8cf9ec17e0512a6caae94e0fbf151260] - expected: FAIL - bug: https://github.com/servo/servo/issues/15980 - - [html5lib_tests20.html 7fb0d4342e3ed3fabee650b83ce66ffb2f66c173] - expected: FAIL - bug: https://github.com/servo/servo/issues/15980 - diff --git a/tests/wpt/metadata/html/syntax/parsing/math-parse01.html.ini b/tests/wpt/metadata/html/syntax/parsing/math-parse01.html.ini deleted file mode 100644 index 87111b80e10..00000000000 --- a/tests/wpt/metadata/html/syntax/parsing/math-parse01.html.ini +++ /dev/null @@ -1,5 +0,0 @@ -[math-parse01.html] - type: testharness - [html tags allowed in annotation-xml/@encoding='text/html'.] - expected: FAIL - diff --git a/tests/wpt/metadata/html/syntax/parsing/math-parse03.html.ini b/tests/wpt/metadata/html/syntax/parsing/math-parse03.html.ini deleted file mode 100644 index 7caeb476ccc..00000000000 --- a/tests/wpt/metadata/html/syntax/parsing/math-parse03.html.ini +++ /dev/null @@ -1,11 +0,0 @@ -[math-parse03.html] - type: testharness - [p in annotation-xml encoding=text/html stays as child of annotation-xml] - expected: FAIL - - [p in annotation-xml encoding=TEXT/HTML stays as child of annotation-xml] - expected: FAIL - - [p in annotation-xml encoding=application/xhtml+xml stays as child of annotation-xml] - expected: FAIL -