close
Skip to content

[css-values-5] Blink and WPT disagree with spec on handling of invalid substituted if() conditions #14130

Description

@AtkinsSJ

In replace an if() function step 1.1 we have this:

  1. Substitute arbitrary substitution functions in the first <declaration-value> of branch, then parse the result as an <if-condition>. If parsing returns failure, continue; otherwise, let the result be condition.

This suggests that a condition like if(style(--x) and invalid: a; else: b) should:

  1. Substitute --x
  2. Try and fail to parse the resulting something and invalid clause as an <if-condition>
  3. Continue onto the else branch
  4. Return b

However, a few subtests of https://wpt.live/css/css-values/if-conditionals.html expect this to instead render the entire if() IACVT:

if(style(--x) and invalid: true_value; else: false_value)
if(invalid or style(--x): true_value; else: false_value)
if(style(not (--x: 5) or (--z: 10px)): true_value; else: false_value)

(These are subtests 191, 192, and 193.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions