Commit dbcc7320 authored by Anders Hartvoll Ruud's avatar Anders Hartvoll Ruud Committed by Commit Bot

Longhand/Shorthand should use CSSProperty::Flags instead of uint16_t

We are approaching our current 16-bit limit for flags, and last time
I exceeded this limit locally (and hence redefined CSSProperty::Flags
to uint32_t), it took a while to understand why things didn't work.
The reason was that the Longhand/Shorthand constructors truncated the
integer to uint16_t.

No new flags are planned at the moment, but I still want to eliminate
this trap for when we _do_ add a new flag.

Change-Id: I4527b7ed16b9f289135a3a37665cbcf319d8bb7c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2124252Reviewed-by: default avatarRune Lillesveen <futhark@chromium.org>
Commit-Queue: Anders Hartvoll Ruud <andruud@chromium.org>
Cr-Commit-Position: refs/heads/master@{#754432}
parent 81cc23a8
...@@ -43,9 +43,7 @@ class Longhand : public CSSProperty { ...@@ -43,9 +43,7 @@ class Longhand : public CSSProperty {
} }
protected: protected:
constexpr Longhand(CSSPropertyID id, constexpr Longhand(CSSPropertyID id, Flags flags, char repetition_separator)
uint16_t flags,
char repetition_separator)
: CSSProperty(id, flags | kLonghand, repetition_separator) {} : CSSProperty(id, flags | kLonghand, repetition_separator) {}
}; };
......
...@@ -31,9 +31,7 @@ class Shorthand : public CSSProperty { ...@@ -31,9 +31,7 @@ class Shorthand : public CSSProperty {
} }
protected: protected:
constexpr Shorthand(CSSPropertyID id, constexpr Shorthand(CSSPropertyID id, Flags flags, char repetition_separator)
uint16_t flags,
char repetition_separator)
: CSSProperty(id, flags | kShorthand, repetition_separator) {} : CSSProperty(id, flags | kShorthand, repetition_separator) {}
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment