1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 05:17:35 +00:00

LibWeb: Implement the CSS revert keyword

This is a universal value like `initial` and `inherit` and works by
reverting the current value to whatever we had at the start of the
current cascade origin.

The implementation is somewhat inefficient as we make a copy of all
current values at the start of each origin. I'm sure we can come up with
a way to make this faster eventually.
This commit is contained in:
Andreas Kling 2023-07-29 17:14:18 +02:00
parent 13d5d47b56
commit 8f29bdb62c
8 changed files with 257 additions and 187 deletions

View file

@ -132,6 +132,7 @@ public:
Ratio,
Rect,
Resolution,
Revert,
Shadow,
String,
TextDecoration,
@ -191,6 +192,7 @@ public:
bool is_ratio() const { return type() == Type::Ratio; }
bool is_rect() const { return type() == Type::Rect; }
bool is_resolution() const { return type() == Type::Resolution; }
bool is_revert() const { return type() == Type::Revert; }
bool is_shadow() const { return type() == Type::Shadow; }
bool is_string() const { return type() == Type::String; }
bool is_text_decoration() const { return type() == Type::TextDecoration; }