diff --git a/src/components/script/dom/element.rs b/src/components/script/dom/element.rs index d2a5d2057ea1..309204ee7a96 100644 --- a/src/components/script/dom/element.rs +++ b/src/components/script/dom/element.rs @@ -157,16 +157,15 @@ impl Element { }).map(|&x| x) } - #[inline] pub unsafe fn get_attr_val_for_layout(&self, namespace: Namespace, name: &str) -> Option<&'static str> { + // FIXME: only case-insensitive in the HTML namespace (as opposed to SVG, etc.) + let name = name.to_ascii_lower(); self.attrs.iter().find(|attr: & &@mut Attr| { // unsafely avoid a borrow because this is accessed by many tasks // during parallel layout - // FIXME: only case-insensitive in the HTML namespace (as opposed to SVG, etc.) let attr: ***Box = cast::transmute(attr); - name.eq_ignore_ascii_case((***attr).data.local_name) && - (***attr).data.namespace == namespace + name == (***attr).data.local_name && (***attr).data.namespace == namespace }).map(|attr| { let attr: **Box = cast::transmute(attr); cast::transmute((**attr).data.value.as_slice()) diff --git a/src/test/ref/basic.list b/src/test/ref/basic.list index 37de5b3e00f5..2226272034dd 100644 --- a/src/test/ref/basic.list +++ b/src/test/ref/basic.list @@ -23,3 +23,4 @@ == font_size_percentage.html font_size_em_ref.html == position_fixed_a.html position_fixed_b.html == img_size_a.html img_size_b.html +== upper_id_attr.html upper_id_attr_ref.html diff --git a/src/test/ref/upper_id_attr.html b/src/test/ref/upper_id_attr.html new file mode 100644 index 000000000000..0f6c20f63916 --- /dev/null +++ b/src/test/ref/upper_id_attr.html @@ -0,0 +1,9 @@ + + +
+ diff --git a/src/test/ref/upper_id_attr_ref.html b/src/test/ref/upper_id_attr_ref.html new file mode 100644 index 000000000000..16fab3f71795 --- /dev/null +++ b/src/test/ref/upper_id_attr_ref.html @@ -0,0 +1,5 @@ + + +