Closed Bug 511803 Opened 16 years ago Closed 12 years ago

Store transform function name as eCSSKeyword_* in nsCSSValue::Array

Categories

(Core :: CSS Parsing and Computation, defect)

defect
Not set
minor

Tracking

()

RESOLVED FIXED
mozilla24

People

(Reporter: rkawaguchi, Assigned: dbaron)

References

Details

(Whiteboard: perf)

Attachments

(2 files)

This is a follow-up bug for bug 113577. Currently, a CSS transform function such as "skewX" and "rotate" is stored in nsCSSValue of type eCSSUnit_Function, and the first element of nsCSSValue::Array stores the function name as nsString. bug 113577 has introduced a new mechanism for storing CSS functions using eCSSKeyword_* (enum) as the first element of nsCSSValue::Array. Two helper functions are available for the purpose: // Initializes as a function value with the specified function id. Array* nsCSSValue::InitFunction(nsCSSKeyword aFunctionId, PRUint32 aNumArgs); // Checks if this is a function value with the specified function id. PRBool nsCSSValue::EqualsFunction(nsCSSKeyword aFunctionId) const; This bug will use this new mechanism for CSS transform functions to unify the way to store CSS function values (also to achieve slight performance and memory usage improvements).
No longer depends on: 113577
Depends on: 113577
This was originally followup from bug 113577 comment 44 bug 113577 comment 51. We hit it again in bug 872678. I have a patch in progress.
Assignee: rkawaguchi → dbaron
The patch I'm going to post here is expected to make one behavioral change, which I think is an improvement anyway, but I wanted to run it by you. It should change serialization of the functions in font-variant-alternates (i.e., stylistic(), styleset(), character-variant(), swash(), ornaments(), annotation()) to convert to the canonical lowercase rather than preserving the case that the author used. This will match what we do for other functions (although for some of the transform functions, e.g., translateX(), the canonical case is mixed case).
Flags: needinfo?(jdaggett)
And note that this removes a bunch of hashtable lookups from performance-sensitive code (in particular, animation of transforms, including on the compositor thread; see bug 872678).
Whiteboard: perf
(In reply to David Baron [:dbaron] (don't cc:, use needinfo? instead) from comment #2) > The patch I'm going to post here is expected to make one behavioral change, > which I think is an improvement anyway, but I wanted to run it by you. > > It should change serialization of the functions in font-variant-alternates > (i.e., stylistic(), styleset(), character-variant(), swash(), ornaments(), > annotation()) to convert to the canonical lowercase rather than preserving > the case that the author used. This will match what we do for other > functions (although for some of the transform functions, e.g., translateX(), > the canonical case is mixed case). This makes complete sense to me.
Flags: needinfo?(jdaggett)
Attachment #752558 - Flags: review?(jdaggett) → review+
Comment on attachment 752559 [details] [diff] [review] patch 2: Convert all eCSSUnit_Function storage to use nsCSSKeyword. This leads to one behavior change, which is case canonicalization for font-variant-alternates function values. r=me
Attachment #752559 - Flags: review?(bzbarsky) → review+
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla24
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: