mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Revert PR #1554 because it's wrong.
This commit is contained in:
parent
5ca55bb996
commit
d6b5015d7a
4 changed files with 18 additions and 4 deletions
|
@ -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())
|
||||
|
|
|
@ -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
src/test/ref/upper_id_attr.html
Normal file
9
src/test/ref/upper_id_attr.html
Normal file
|
@ -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
src/test/ref/upper_id_attr_ref.html
Normal file
5
src/test/ref/upper_id_attr_ref.html
Normal file
|
@ -0,0 +1,5 @@
|
|||
<!doctype html>
|
||||
<style>
|
||||
div { height: 2em; background: green; }
|
||||
</style>
|
||||
<div></div>
|
Loading…
Add table
Add a link
Reference in a new issue