Properly handle annotation-xml integration points (fixes #15980)

This commit is contained in:
Anthony Ramine 2017-03-16 15:46:46 +01:00
parent 31c575b0e8
commit 6b43624a71
4 changed files with 11 additions and 72 deletions

View file

@ -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 <annotation-xml> cases.
fn is_mathml_annotation_xml_integration_point(&self, handle: JS<Node>) -> bool {
let elem = handle.downcast::<Element>().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;
}

View file

@ -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

View file

@ -1,5 +0,0 @@
[math-parse01.html]
type: testharness
[html tags allowed in annotation-xml/@encoding='text/html'.]
expected: FAIL

View file

@ -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