Bug 118172
Summary: | Handling of Variables in StylePropertySet is broken | ||
---|---|---|---|
Product: | WebKit | Reporter: | Claudio Saavedra <csaavedra> |
Component: | CSS | Assignee: | Nobody <webkit-unassigned> |
Status: | NEW | ||
Severity: | Normal | CC: | svillar |
Priority: | P2 | ||
Version: | 528+ (Nightly build) | ||
Hardware: | Unspecified | ||
OS: | Unspecified |
Claudio Saavedra
Any operation relying on StylePropertySet::findPropertyIndex(CSSPropertyID propertyID) to fetch data from a variable property will return always the last variable in the internal vector. This method is designed assuming that all properties have a different property ID, whereas all CSS custom properties share the CSSPropertyVariable ID.
For bug 117787 I'm adding an equivalent method, StylePropertySet::findVariableIndex(const AtomicString& variableName), but the existing StylePropertySet needs to be fixed to be able to distinguish when this should be used instead. I was tempted to add an assertion to findPropertyIndex:
// This method assumes that there is only one property per type,
// while there might be more than one CSSPropertyVariable property
// present. findVariableIndex() should be used instead.
ASSERT(propertyID != CSSPropertyVariable);
but I've noticed that there are plenty of uses of this that will need to be fixed, so I'll leave the assertion out.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |