Last Comment Bug 1215878 - implement revert keyword
: implement revert keyword
Status: NEW
: dev-doc-needed
Product: Core
Classification: Components
Component: CSS Parsing and Computation (show other bugs)
: unspecified
: Unspecified Unspecified
-- enhancement with 7 votes (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
: Jet Villegas (:jet)
Depends on:
  Show dependency treegraph
Reported: 2015-10-17 18:33 PDT by Cameron McCormack (:heycam) (away 25 Feb–5 Mar)
Modified: 2017-02-02 13:44 PST (History)
8 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Description User image Cameron McCormack (:heycam) (away 25 Feb–5 Mar) 2015-10-17 18:33:44 PDT
WebKit just implemented the revert keyword.  It's more useful than unset, when used with the all shorthand, so I think we should implement it too.

We should be able to just have an additional array on nsRuleData that stores the level each nsCSSValue came from.  Then when we encounter revert and have a non-eCSSUnit_Null value on the nsRuleData in a MapRuleInfoInto, we can overwrite the value with eCSSUnit_null if the current mLevel is greater than the level we have in the array.  We'll also need to adjust the RuleDetail that gets returned from CheckSpecifiedProperties when we encounter revert.
Comment 3 User image rtm 2016-04-09 14:14:12 PDT
This feature turns out to be crucial to a nextgen CSS framework I am working on, but I also think it would be useful for the average developer.
Comment 4 User image François REMY 2016-10-13 22:35:11 PDT
FWIW, you can use "revert" today in most browsers by doing ```property:var(--\\revert)``` instead.
No that is not a dirty hack ^_^ You are welcome :-)

Note You need to log in before you can comment on or make changes to this bug.