Closed Bug 1084039 Opened 10 years ago Closed 10 years ago

Clean up AnimationPlayerCollection::PseudoElement()

Categories

(Core :: CSS Parsing and Computation, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla36

People

(Reporter: dholbert, Assigned: dholbert)

Details

Attachments

(1 file)

Right now, AnimationPlayerCollection::PseudoElement() looks like this:

254   nsString PseudoElement()
255   {
256     if (IsForElement()) {
257       return EmptyString();
258     } else if (IsForBeforePseudo()) {
259       return NS_LITERAL_STRING("::before");
260     } else {
261       return NS_LITERAL_STRING("::after");
262     }
263   }

http://mxr.mozilla.org/mozilla-central/source/layout/style/AnimationCommon.h?rev=a014629454d0#254

Three things that I think should change:
 (1) It should be marked as "const"
 (2) We should drop "else" after return
 (3) In the third case, we should probably assert that "IsForAfterPseudo()" is true, to sanity-check that we don't accidentally fall into that final "return" for a non-::after scenario.
Attached patch fix v1Splinter Review
Attachment #8506406 - Flags: review?(birtles)
Attachment #8506406 - Flags: review?(birtles) → review+
https://hg.mozilla.org/mozilla-central/rev/375f9239e689
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla36
You need to log in before you can comment on or make changes to this bug.