From d6b5015d7a4c2f4dbedefb2ffa3c45fb109f61ab Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Sat, 25 Jan 2014 09:50:03 +0100 Subject: [PATCH] Revert PR #1554 because it's wrong. --- src/components/script/dom/element.rs | 7 +++---- src/test/ref/basic.list | 1 + src/test/ref/upper_id_attr.html | 9 +++++++++ src/test/ref/upper_id_attr_ref.html | 5 +++++ 4 files changed, 18 insertions(+), 4 deletions(-) create mode 100644 src/test/ref/upper_id_attr.html create mode 100644 src/test/ref/upper_id_attr_ref.html diff --git a/src/components/script/dom/element.rs b/src/components/script/dom/element.rs index d2a5d2057ea..309204ee7a9 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 37de5b3e00f..2226272034d 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 00000000000..0f6c20f6391 --- /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 00000000000..16fab3f7179 --- /dev/null +++ b/src/test/ref/upper_id_attr_ref.html @@ -0,0 +1,5 @@ + + +