aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/servoparser/html.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/dom/servoparser/html.rs')
-rw-r--r--components/script/dom/servoparser/html.rs11
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;
}