Closed Bug 936273 Opened 11 years ago Closed 11 years ago

UITour: Allow page to specify which highlight animation to use

Categories

(Firefox :: General, defect, P3)

defect

Tracking

()

RESOLVED FIXED
Firefox 29

People

(Reporter: Unfocused, Assigned: MattN)

References

Details

Attachments

(2 files, 1 obsolete file)

Currently, the highlight animation is chosen randomly. Would be nice for the page to be able to specify which animation to use.
I should note: This would only cover choosing which of the pre-set animations to use. It would not allow the page to define arbitrary animations.
Priority: -- → P4
Assignee: nobody → MattN+bmo
Status: NEW → ASSIGNED
Priority: P4 → P3
This depends on patches to bug 940902 and bug 936187.
Attachment #8339031 - Flags: review?(bmcbride)
Comment on attachment 8339031 [details] [diff] [review] v.1 Pass the effect through to the attribute, with tests Review of attachment 8339031 [details] [diff] [review]: ----------------------------------------------------------------- ::: browser/modules/UITour.jsm @@ +86,5 @@ > case "showHighlight": { > let targetPromise = this.getTarget(window, data.target); > if (!targetPromise) > return false; > + targetPromise.then(target => this.showHighlight(target, data.effect)); Think the API should be more explicit here. Currently, if you specify an effect we don't support, it uses a random effect - which feels a bit too magic. I'd rather have the page specify "random" to get a random effect, and if it specified an effect we don't support it should default to "none". Also, as a general rule, I've tried to do all input checking/sanitisation in this method here - keeping it all together so it's easier to audit.
Attachment #8339031 - Flags: review?(bmcbride) → review-
(In reply to Blair McBride [:Unfocused] from comment #3) > Comment on attachment 8339031 [details] [diff] [review] > v.1 Pass the effect through to the attribute, with tests > > ::: browser/modules/UITour.jsm > @@ +86,5 @@ > > case "showHighlight": { > > let targetPromise = this.getTarget(window, data.target); > > if (!targetPromise) > > return false; > > + targetPromise.then(target => this.showHighlight(target, data.effect)); > > Think the API should be more explicit here. Currently, if you specify an > effect we don't support, it uses a random effect - which feels a bit too > magic. I'd rather have the page specify "random" to get a random effect, and > if it specified an effect we don't support it should default to "none". OK, I changed the default to "none". > Also, as a general rule, I've tried to do all input checking/sanitisation in > this method here - keeping it all together so it's easier to audit. I originally did it in showHighlight so that we would validate the argument from callers other than a website but I suppose this new way allows a JSM consumer use a custom animation.
Attachment #8339031 - Attachment is obsolete: true
Attachment #8342769 - Flags: review?(bmcbride)
Attachment #8342769 - Flags: review?(bmcbride) → review+
Flags: in-testsuite+
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 29
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: