Ribbon: Apply values via CustomProperty.
Instead of applying custom properties via the static Variable instance,
use the new CustomProperty class (which knows about its name and
registration) to apply values. This brings the custom property code path
closer to the standard property code path.
To assist CSSPropertyRef in producing a CSSProperty&, this CL adds the
class CSSPropertyName. The idea is that CSSPropertyName can be used instead
of CSSPropertyID/AtomicString where both standard and custom properties are
expected. My intent is to store a CSSPropertyName in
CSSPropertyValueMetadata (instead of the CSSProperty*), but this is a big
change, as everything that creates property/value pairs must carry the
CSSPropertyName. So, for now PropertyReference.Name() is faking it by
digging the name out of the associated CSSValue.
Note that CSSPropertyName::ToAtomicString intentionally does not return
a const AtomicString&. This is because 1) I want to try and reduce the
size of CSSPropertyName to one pointer, which means it will contain a
StringImpl* rather than an AtomicString, and 2) I want CSSPropertyName to
be something that can be passed to other threads if needed, which again
means StringImpl* (or String, at least) rather than AtomicString.
In general, this CL is a step on the path to achieve these things:
1. Removing the useless and dangerous static Variable instance.
2. Not having to piggy-back the custom property name in a CSSValue.
3. Not having to smuggle initial/inherit/unset via the
CSSCustomPropertyDeclaration (vs. applying CSSIdentifierValues
holding these values, like civilized individuals).
R=flackr@chromium.org, futhark@chromium.org
Change-Id: I1a062138fc86c5a398542ac147bf9d71feed7b3c
Reviewed-on: https://chromium-review.googlesource.com/c/1323113
Commit-Queue: Anders Ruud <andruud@chromium.org>
Reviewed-by:
Rune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#606829}
Showing
Please register or sign in to comment