mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 07:07:45 +00:00
LibWeb: Fix auto
conversion to identifier
Calling `is_identifier()` here was wrong, since it just means you can get an Identifier from it. This meant that an `auto` LengthStyleValue would return true, then it would get `static_cast` to the wrong class, and return a garbage value. Basically, I really need to tidy up the API for StyleValue, so it's clear whether `is_foo()` means the object is a `FooStyleValue`, or it can just return a `foo` value.
This commit is contained in:
parent
b08094bccc
commit
85254ada94
1 changed files with 1 additions and 1 deletions
|
@ -1145,7 +1145,7 @@ private:
|
|||
|
||||
inline CSS::ValueID StyleValue::to_identifier() const
|
||||
{
|
||||
if (is_identifier())
|
||||
if (type() == Type::Identifier)
|
||||
return static_cast<const IdentifierStyleValue&>(*this).id();
|
||||
if (is_auto())
|
||||
return CSS::ValueID::Auto;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue