Skip to content

Commit

Permalink
Revert PR servo#1554 because it's wrong.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ms2ger committed Jan 25, 2014
1 parent 5ca55bb commit d6b5015
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/components/script/dom/element.rs
Expand Up @@ -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<Attr> = 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<Attr> = cast::transmute(attr);
cast::transmute((**attr).data.value.as_slice())
Expand Down
1 change: 1 addition & 0 deletions src/test/ref/basic.list
Expand Up @@ -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
9 changes: 9 additions & 0 deletions src/test/ref/upper_id_attr.html
@@ -0,0 +1,9 @@
<!doctype html>
<style>
div { height: 2em; background: green; }
#id { background: red; }
</style>
<div></div>
<script>
document.body.firstChild.setAttributeNS("", "ID", "id");
</script>
5 changes: 5 additions & 0 deletions src/test/ref/upper_id_attr_ref.html
@@ -0,0 +1,5 @@
<!doctype html>
<style>
div { height: 2em; background: green; }
</style>
<div></div>

1 comment on commit d6b5015

@SimonSapin
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r+

Please sign in to comment.