mirror of
https://github.com/servo/servo
synced 2026-04-25 17:15:48 +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 (first, last) = value.split_at(1);
|
||||
|
||||
if first != "#" || last.len() == 0 {
|
||||
if value.len() <= 1 || value.bytes()[0] != b'#' {
|
||||
return None
|
||||
}
|
||||
|
||||
let value = &value[1..];
|
||||
|
||||
let map = self.upcast::<Node>()
|
||||
.following_siblings()
|
||||
.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>()
|
||||
.children()
|
||||
|
||||
@@ -11,6 +11,14 @@
|
||||
</head>
|
||||
<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">
|
||||
<img src="/images/threecolors.png" usemap="no-hash-name"/>
|
||||
<object data="/images/threecolors.png" usemap="no-hash-name"></object>
|
||||
|
||||
Reference in New Issue
Block a user