This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 27589 - Unclear how to deal with a parsed value containing !important in setPropertyValue
Summary: Unclear how to deal with a parsed value containing !important in setPropertyV...
Status: NEW
Alias: None
Product: CSS
Classification: Unclassified
Component: CSSOM (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Simon Pieters
QA Contact: public-css-bugzilla
Depends on:
Reported: 2014-12-11 23:40 UTC by Josh Matthews
Modified: 2014-12-12 15:17 UTC (History)
0 users

See Also:


Description Josh Matthews 2014-12-11 23:40:48 UTC

The text says
>value can not include "!important".

What does this mean in practice? Throw an exception? Terminate the steps silently?
Comment 1 Simon Pieters 2014-12-12 06:12:56 UTC
The note is non-normative so it doesn't mean anything on its own.

The normative part for what happens if you were to include !important is

6. Let component value list be the result of parsing value for property property."
To parse a CSS value value for a given property means to follow these steps:

1. Let list be the value returned by invoking parse a list of component values from value.

2. Match list against the grammar for the property property in the CSS specification.

3. If the above step failed, return null.

4. Return list.

Since !important is not part of the grammar for any property, this returns null.

Back to setProperty:

7. If component value list is null terminate these steps.

Would it be clearer if the note was removed?
Comment 2 Josh Matthews 2014-12-12 15:17:23 UTC
Yes, or at least reworded. The way it reads right now suggests that implementors should be directly addressing the condition somehow.