mirror of
https://github.com/servo/servo.git
synced 2025-08-11 16:35:33 +01:00
style: Add support for 's' flag on attribute selectors.
We could keep using ParsedCaseSensitivity::CaseSensitive as a temporary stand-in for "case-sensitive or maybe not depending on what HTML says" until we check the attribute list, but it seems better to make that explicit. Differential Revision: https://phabricator.services.mozilla.com/D14093
This commit is contained in:
parent
901c055519
commit
a519d9ecc3
2 changed files with 73 additions and 25 deletions
|
@ -134,8 +134,13 @@ pub static SELECTOR_WHITESPACE: &'static [char] = &[' ', '\t', '\n', '\r', '\x0C
|
|||
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
|
||||
pub enum ParsedCaseSensitivity {
|
||||
CaseSensitive,
|
||||
// 's' was specified.
|
||||
ExplicitCaseSensitive,
|
||||
// 'i' was specified.
|
||||
AsciiCaseInsensitive,
|
||||
// No flags were specified and HTML says this is a case-sensitive attribute.
|
||||
CaseSensitive,
|
||||
// No flags were specified and HTML says this is a case-insensitive attribute.
|
||||
AsciiCaseInsensitiveIfInHtmlElementInHtmlDocument,
|
||||
}
|
||||
|
||||
|
@ -150,7 +155,10 @@ impl ParsedCaseSensitivity {
|
|||
ParsedCaseSensitivity::AsciiCaseInsensitiveIfInHtmlElementInHtmlDocument => {
|
||||
CaseSensitivity::CaseSensitive
|
||||
},
|
||||
ParsedCaseSensitivity::CaseSensitive => CaseSensitivity::CaseSensitive,
|
||||
ParsedCaseSensitivity::CaseSensitive |
|
||||
ParsedCaseSensitivity::ExplicitCaseSensitive => {
|
||||
CaseSensitivity::CaseSensitive
|
||||
},
|
||||
ParsedCaseSensitivity::AsciiCaseInsensitive => CaseSensitivity::AsciiCaseInsensitive,
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue