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)
Core
CSS Parsing and Computation
Tracking
()
RESOLVED
FIXED
mozilla24
People
(Reporter: rkawaguchi, Assigned: dbaron)
References
Details
(Whiteboard: perf)
Attachments
(2 files)
1.03 KB,
patch
|
jtd
:
review+
|
Details | Diff | Splinter Review |
17.23 KB,
patch
|
bzbarsky
:
review+
|
Details | Diff | Splinter Review |
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).
Assignee | ||
Comment 1•12 years ago
|
||
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
Assignee | ||
Comment 2•12 years ago
|
||
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)
Assignee | ||
Comment 3•12 years ago
|
||
Attachment #752558 -
Flags: review?(jdaggett)
Assignee | ||
Comment 4•12 years ago
|
||
Attachment #752559 -
Flags: review?(bzbarsky)
Assignee | ||
Comment 5•12 years ago
|
||
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
Comment 6•12 years ago
|
||
(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)
Updated•12 years ago
|
Attachment #752558 -
Flags: review?(jdaggett) → review+
Assignee | ||
Comment 7•12 years ago
|
||
![]() |
||
Comment 8•12 years ago
|
||
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+
Assignee | ||
Comment 9•12 years ago
|
||
Comment 10•12 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/ea47adb68738
https://hg.mozilla.org/mozilla-central/rev/3e67e9e31f0e
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.
Description
•