Status

()

Core
CSS Parsing and Computation
--
enhancement
2 years ago
20 days ago

People

(Reporter: heycam, Unassigned)

Tracking

({dev-doc-needed})

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [parity-safari], URL)

(Reporter)

Description

2 years ago
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.
Keywords: dev-doc-needed

Comment 1

2 years ago
Could someone add [parity-safari] to the Whiteboard?
See https://developer.apple.com/library/prerelease/mac/releasenotes/General/WhatsNewInSafari/Articles/Safari_9_1.html#//apple_ref/doc/uid/TP40014305-CH10-SW14
(Reporter)

Updated

2 years ago
Whiteboard: [parity-safari]

Comment 2

2 years ago
Update MDN docs: 

https://developer.mozilla.org/en-US/docs/Web/CSS/all
https://developer.mozilla.org/en-US/docs/Web/CSS/revert

Comment 3

a year ago
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

10 months ago
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 :-)

Comment 5

6 months ago
(In reply to Fran├žois REMY from comment #4)
> 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 :-)

Unfortunately no, an invalid custom property value is equivalent to `unset`, not `revert`.

Comment 6

20 days ago
The way to implement is simple, add a oldstyle & newstyle type index/pointer paramaters to each identified ruleset, when revert or -moz-restyle (for clarity this is for undoing a revert) are used you simply look up the previously overriden or the next overide via those parameters.
You need to log in before you can comment on or make changes to this bug.