mirror of
https://github.com/servo/servo.git
synced 2025-09-10 15:08:21 +01:00
style: Support calc() in color functions.
This commit is contained in:
parent
e91c9ec7fe
commit
23d69ea77d
7 changed files with 230 additions and 72 deletions
|
@ -4563,8 +4563,17 @@ fn parse_color(
|
|||
) -> Result<specified::Color, ()> {
|
||||
let mut input = ParserInput::new(value);
|
||||
let mut parser = Parser::new(&mut input);
|
||||
let url_data = unsafe { dummy_url_data() };
|
||||
let context = ParserContext::new(
|
||||
Origin::Author,
|
||||
url_data,
|
||||
Some(CssRuleType::Style),
|
||||
ParsingMode::DEFAULT,
|
||||
QuirksMode::NoQuirks,
|
||||
);
|
||||
|
||||
let start_position = parser.position();
|
||||
parser.parse_entirely(specified::Color::parse_color).map_err(|err| {
|
||||
parser.parse_entirely(|i| specified::Color::parse(&context, i)).map_err(|err| {
|
||||
if let Some(error_reporter) = error_reporter {
|
||||
match err.kind {
|
||||
ParseErrorKind::Custom(StyleParseErrorKind::ValueError(..)) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue