diff options
author | Anthony Ramine <n.oxyde@gmail.com> | 2017-03-16 15:46:46 +0100 |
---|---|---|
committer | Anthony Ramine <n.oxyde@gmail.com> | 2017-03-16 16:35:38 +0100 |
commit | 6b43624a7151f84871d53cf7e863f58b07c3c0f3 (patch) | |
tree | 9ed3d133b97d7b4a6bb5ba2de756001b119d929c /components/script/dom/servoparser | |
parent | 31c575b0e8b7a67ba129fad2f5bfda912e3036a6 (diff) | |
download | servo-6b43624a7151f84871d53cf7e863f58b07c3c0f3.tar.gz servo-6b43624a7151f84871d53cf7e863f58b07c3c0f3.zip |
Properly handle annotation-xml integration points (fixes #15980)
Diffstat (limited to 'components/script/dom/servoparser')
-rw-r--r-- | components/script/dom/servoparser/html.rs | 11 |
1 files changed, 11 insertions, 0 deletions
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 <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; } |