mirror of
https://github.com/servo/servo
synced 2026-05-05 06:32:13 +02:00
Compare commits
1 Commits
github-act
...
cb_split
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
67fa2d6f62 |
@@ -422,16 +422,17 @@ impl HTMLImageElement {
|
|||||||
};
|
};
|
||||||
|
|
||||||
let value = usemap_attr.value();
|
let value = usemap_attr.value();
|
||||||
let (first, last) = value.split_at(1);
|
|
||||||
|
|
||||||
if first != "#" || last.len() == 0 {
|
if value.len() <= 1 || value.bytes()[0] != b'#' {
|
||||||
return None
|
return None
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let value = &value[1..];
|
||||||
|
|
||||||
let map = self.upcast::<Node>()
|
let map = self.upcast::<Node>()
|
||||||
.following_siblings()
|
.following_siblings()
|
||||||
.filter_map(Root::downcast::<HTMLMapElement>)
|
.filter_map(Root::downcast::<HTMLMapElement>)
|
||||||
.find(|n| n.upcast::<Element>().get_string_attribute(&LocalName::from("name")) == last);
|
.find(|n| n.upcast::<Element>().get_string_attribute(&LocalName::from("name")) == value);
|
||||||
|
|
||||||
let elements: Vec<Root<HTMLAreaElement>> = map.unwrap().upcast::<Node>()
|
let elements: Vec<Root<HTMLAreaElement>> = map.unwrap().upcast::<Node>()
|
||||||
.children()
|
.children()
|
||||||
|
|||||||
@@ -11,6 +11,14 @@
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
|
<div data-expect="no match">
|
||||||
|
<img src="/images/threecolors.png" usemap="💩"/>
|
||||||
|
<object data="/images/threecolors.png" usemap="💩"></object>
|
||||||
|
<map name="💩">
|
||||||
|
<area shape="rect" coords="0,0,99,50" href="#area-💩"/>
|
||||||
|
</map>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div data-expect="no match">
|
<div data-expect="no match">
|
||||||
<img src="/images/threecolors.png" usemap="no-hash-name"/>
|
<img src="/images/threecolors.png" usemap="no-hash-name"/>
|
||||||
<object data="/images/threecolors.png" usemap="no-hash-name"></object>
|
<object data="/images/threecolors.png" usemap="no-hash-name"></object>
|
||||||
|
|||||||
Reference in New Issue
Block a user