Closed
Bug 898175
Opened 11 years ago
Closed 11 years ago
[CSS Filters] Refactor parsing to use a keyword lookup table for filter function names
Categories
(Core :: CSS Parsing and Computation, defect)
Core
CSS Parsing and Computation
Tracking
()
RESOLVED
FIXED
mozilla26
People
(Reporter: mvujovic, Assigned: mvujovic)
References
Details
Attachments
(1 file, 1 obsolete file)
18.16 KB,
patch
|
Details | Diff | Splinter Review |
In bug 895182, dbaron suggested: """ One minor comment: I tend to dislike storing data as code rather than storing data as data; I think the two functions GetFilterFunctionName and StyleFilterTypeForFunctionName could have been replaced by a keyword table in nsCSSProps plus calls to nsCSSProps::FindKeyword and nsCSSProps::ValueToKeyword. """
Assignee | ||
Comment 1•11 years ago
|
||
This patch passes Mochitests locally. Small issue: I wish I could use "uint8_t mType" instead of "int32_t mType" in nsStyleFilter, but the keyword lookup APIs like FindKeyword want to assign to int32_t. I could use a cast, but I thought that was uglier.
Attachment #781302 -
Flags: review?(dbaron)
Assignee | ||
Comment 2•11 years ago
|
||
Adding heycam because he's also been reviewing this code.
Comment on attachment 781302 [details] [diff] [review] 898175-1-git.patch >- Type mType; >- nsIURI* mURL; >- nsStyleCoord mCoord; >+ int32_t mType; // [reset] see nsStyleConsts.h >+ nsIURI* mURL; // [reset] >+ nsStyleCoord mCoord; // [reset] I would prefer not to have these [reset] comments, which are for properties (noting whether they're inherited or non-inherited (reset)). These are parts of a value, not properties. On the other hand, the see comment should say "see NS_STYLE_FILTER_* constants in nsStyleConsts.h" or similar. r=dbaron with that
Attachment #781302 -
Flags: review?(dbaron) → review+
Comment 4•11 years ago
|
||
The patch should be updated and landed after the patch for hue-rotate and drop-shadow landed (both uploaded and read ready for review/landing).
Assignee | ||
Comment 5•11 years ago
|
||
(In reply to David Baron [:dbaron] (don't cc:, use needinfo? instead) from comment #3) > Comment on attachment 781302 [details] [diff] [review] > 898175-1-git.patch > > >- Type mType; > >- nsIURI* mURL; > >- nsStyleCoord mCoord; > >+ int32_t mType; // [reset] see nsStyleConsts.h > >+ nsIURI* mURL; // [reset] > >+ nsStyleCoord mCoord; // [reset] > > I would prefer not to have these [reset] comments, which are for properties > (noting whether they're inherited or non-inherited (reset)). These are parts > of a value, not properties. > > On the other hand, the see comment should say "see NS_STYLE_FILTER_* > constants in nsStyleConsts.h" or similar. > > r=dbaron with that Makes sense. I'll do that. Thanks for reviewing!
Assignee | ||
Comment 6•11 years ago
|
||
(In reply to Dirk Schulze from comment #4) > The patch should be updated and landed after the patch for hue-rotate and > drop-shadow landed (both uploaded and read ready for review/landing). Yes, I will rebase after hue-rotate and drop-shadow land and add constants for them. Should be a trivial change.
Comment 8•11 years ago
|
||
New patch looks good. https://hg.mozilla.org/integration/mozilla-inbound/rev/d7c45e9d8a9d
Comment 9•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/d7c45e9d8a9d
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla26
You need to log in
before you can comment on or make changes to this bug.
Description
•