Closed Bug 1006595 Opened 11 years ago Closed 10 years ago

Add domUtils.GetCSSSubPropertiesForProperty, getCSSPropertyIsShorthand, CSSPropertySupportsType (Color, Gradient etc.)

Categories

(Core :: CSS Parsing and Computation, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla33

People

(Reporter: miker, Assigned: bzbarsky)

References

Details

(Keywords: dev-doc-needed)

Attachments

(1 file, 1 obsolete file)

We would like a few extra utility methods in DOMUtils that allow us to gather a little extra information about CSS properties. These are: void getCSSSubPropertiesForProperty(in AString aProperty, [optional] out unsigned long aLength, [array, size_is(aLength), retval] out wstring aValues); bool getCSSPropertySupportsColor(in AString aProperty); bool getCSSPropertySupportsGradient(in AString aProperty); bool getCSSPropertyIsShorthand(in AString aProperty); Ideally, we would use getCSSPropertySupportsType instead of getCSSPropertySupportsColor and getCSSPropertySupportsGradient but I couldn't find a simple way to get that to expose the variants from nsCSSProps.h to JS. Probably 'cos I am a JS hacker. Can somebody have a quick look over the code, suggest any improvements and let me know how to expose the variants?
Those variants are a bit of an implementation detail that I think we'd rather not expose...
That said, the implementations could obviously be shared internally, with a utility function that takes a variant id.
Summary: Add domUtils.getCSSSubPropertiesForProperty, CSSValuesForProperty, CSSPropertySupportsColor & GetCSSPropertySupportsGradient → Add domUtils.getCSSSubPropertiesForProperty, CSSValuesForProperty, CSSPropertySupportsType (Color, Gradient etc.)
API: bool GetCSSSubPropertiesForProperty(in AString aProperty); // Already in patch bool getCSSPropertyIsShorthand(in AString aProperty); // Already in patch bool getCSSPropertySupportsType(variant bits from idl);
Summary: Add domUtils.getCSSSubPropertiesForProperty, CSSValuesForProperty, CSSPropertySupportsType (Color, Gradient etc.) → Add domUtilsGetCSSSubPropertiesForProperty, getCSSPropertyIsShorthand, CSSPropertySupportsType (Color, Gradient etc.)
Summary: Add domUtilsGetCSSSubPropertiesForProperty, getCSSPropertyIsShorthand, CSSPropertySupportsType (Color, Gradient etc.) → Add domUtils.GetCSSSubPropertiesForProperty, getCSSPropertyIsShorthand, CSSPropertySupportsType (Color, Gradient etc.)
Mike, please double-check the behavior of NUMBER/INTEGER and see if it's the one you want
Attachment #8445930 - Flags: review?(dbaron)
Attachment #8445930 - Flags: feedback?(mratcliffe)
Assignee: mratcliffe → bzbarsky
Status: NEW → ASSIGNED
Whiteboard: [need review]
(In reply to Boris Zbarsky [:bz] from comment #6) > Mike, please double-check the behavior of NUMBER/INTEGER and see if it's the > one you want This is exactly what we need... thanks.
Attachment #8445930 - Flags: feedback?(mratcliffe) → feedback+
Comment on attachment 8445930 [details] [diff] [review] Add some APIs on inIDOMUtils to allow determining the subproperties of a CSS shorthand, whether a property is a shorthand, and whether a given property supports a given type of value r=dbaron
Attachment #8445930 - Flags: review?(dbaron) → review+
Attachment #8418104 - Attachment is obsolete: true
Flags: in-testsuite+
Whiteboard: [need review]
Target Milestone: --- → mozilla33
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Keywords: dev-doc-needed
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: