Update to string-cache 0.3

This commit is contained in:
Simon Sapin 2016-10-30 19:27:43 +01:00
parent 9fcc9d9d3f
commit 53b638c0e2
170 changed files with 1309 additions and 1050 deletions

View file

@ -1660,7 +1660,10 @@ trait ObjectElement {
impl<N> ObjectElement for N where N: ThreadSafeLayoutNode {
fn has_object_data(&self) -> bool {
let elem = self.as_element().unwrap();
let type_and_data = (elem.get_attr(&ns!(), &atom!("type")), elem.get_attr(&ns!(), &atom!("data")));
let type_and_data = (
elem.get_attr(&ns!(), &local_name!("type")),
elem.get_attr(&ns!(), &local_name!("data")),
);
match type_and_data {
(None, Some(uri)) => is_image_data(uri),
_ => false
@ -1669,7 +1672,10 @@ impl<N> ObjectElement for N where N: ThreadSafeLayoutNode {
fn object_data(&self) -> Option<Url> {
let elem = self.as_element().unwrap();
let type_and_data = (elem.get_attr(&ns!(), &atom!("type")), elem.get_attr(&ns!(), &atom!("data")));
let type_and_data = (
elem.get_attr(&ns!(), &local_name!("type")),
elem.get_attr(&ns!(), &local_name!("data")),
);
match type_and_data {
(None, Some(uri)) if is_image_data(uri) => Url::parse(uri).ok(),
_ => None