mirror of
https://github.com/servo/servo.git
synced 2025-08-09 15:35:34 +01:00
Make some selector matching code a little more consistent.
This commit is contained in:
parent
6681476713
commit
f556197567
1 changed files with 5 additions and 2 deletions
|
@ -622,7 +622,9 @@ fn matches_simple_selector<E:TElement,
|
|||
// here because the UA style otherwise disables all style sharing completely.
|
||||
*shareable = false
|
||||
}
|
||||
element.match_attr(attr, |v| v == value.as_slice())
|
||||
element.match_attr(attr, |attr_value| {
|
||||
attr_value == value.as_slice()
|
||||
})
|
||||
}
|
||||
AttrIncludes(ref attr, ref value) => {
|
||||
*shareable = false;
|
||||
|
@ -633,7 +635,8 @@ fn matches_simple_selector<E:TElement,
|
|||
AttrDashMatch(ref attr, ref value, ref dashing_value) => {
|
||||
*shareable = false;
|
||||
element.match_attr(attr, |attr_value| {
|
||||
attr_value == value.as_slice() || attr_value.starts_with(dashing_value.as_slice())
|
||||
attr_value == value.as_slice() ||
|
||||
attr_value.starts_with(dashing_value.as_slice())
|
||||
})
|
||||
}
|
||||
AttrPrefixMatch(ref attr, ref value) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue