mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
style: Make input[type=number] pseudo-elements accessible to chrome.
Bug: 1433389 Reviewed-by: jwatt MozReview-Commit-ID: 2ycajPYd3CV
This commit is contained in:
parent
f2df3052d9
commit
b76bbdf501
3 changed files with 62 additions and 28 deletions
|
@ -114,7 +114,7 @@ impl PseudoElement {
|
|||
% if pseudo.is_tree_pseudo_element():
|
||||
0,
|
||||
% elif pseudo.is_anon_box():
|
||||
structs::CSS_PSEUDO_ELEMENT_UA_SHEET_ONLY,
|
||||
structs::CSS_PSEUDO_ELEMENT_ENABLED_IN_UA_SHEETS,
|
||||
% else:
|
||||
structs::SERVO_CSS_PSEUDO_ELEMENT_FLAGS_${pseudo.original_ident},
|
||||
% endif
|
||||
|
@ -224,19 +224,24 @@ impl PseudoElement {
|
|||
///
|
||||
/// Returns `None` if the pseudo-element is not recognised.
|
||||
#[inline]
|
||||
pub fn from_slice(s: &str, in_ua_stylesheet: bool) -> Option<Self> {
|
||||
#[allow(unused_imports)] use std::ascii::AsciiExt;
|
||||
|
||||
pub fn from_slice(name: &str) -> Option<Self> {
|
||||
// We don't need to support tree pseudos because functional
|
||||
// pseudo-elements needs arguments, and thus should be created
|
||||
// via other methods.
|
||||
% for pseudo in SIMPLE_PSEUDOS:
|
||||
if in_ua_stylesheet || ${pseudo_element_variant(pseudo)}.exposed_in_non_ua_sheets() {
|
||||
if s.eq_ignore_ascii_case("${pseudo.value[1:]}") {
|
||||
return Some(${pseudo_element_variant(pseudo)});
|
||||
match_ignore_ascii_case! { name,
|
||||
% for pseudo in SIMPLE_PSEUDOS:
|
||||
"${pseudo.value[1:]}" => {
|
||||
return Some(${pseudo_element_variant(pseudo)})
|
||||
}
|
||||
% endfor
|
||||
_ => {
|
||||
// FIXME: -moz-tree check should probably be
|
||||
// ascii-case-insensitive.
|
||||
if name.starts_with("-moz-tree-") {
|
||||
return PseudoElement::tree_pseudo_element(name, Box::new([]))
|
||||
}
|
||||
}
|
||||
% endfor
|
||||
}
|
||||
|
||||
None
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue