Closed Bug 779662 Opened 12 years ago Closed 12 years ago

click-to-play: click handler on overlay too restrictive

Categories

(Core Graveyard :: Plug-ins, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla17

People

(Reporter: keeler, Assigned: keeler)

References

Details

Attachments

(1 file, 1 obsolete file)

Basically, I did this wrong and now I'm fixing it. The patch should be pretty self-explanatory.
Attached patch patch (obsolete) — Splinter Review
Attachment #648111 - Flags: review?(jaws)
Comment on attachment 648111 [details] [diff] [review]
patch

Review of attachment 648111 [details] [diff] [review]:
-----------------------------------------------------------------

::: browser/base/content/browser-plugins.js
@@ +279,5 @@
>      // The overlay is null if the XBL binding is not attached (element is display:none).
>      if (overlay) {
>        overlay.addEventListener("click", function(aEvent) {
> +        // Have to check that the target is not the link to update the plugin
> +        if (!(aEvent.target instanceof HTMLAnchorElement) && 

Can you see if aEvent.originalTarget will work better here? See https://developer.mozilla.org/en-US/docs/DOM/event.originalTarget and https://developer.mozilla.org/en-US/docs/DOM/event/Comparison_of_Event_Targets#Use_of_explicitOriginalTarget_and_originalTarget for more information.

Also, can you include a test for this that checks clicking on the image, non-link text, and link text in the overlay?
Attachment #648111 - Flags: review?(jaws) → feedback+
Attached patch patch v2Splinter Review
I was having trouble with EventUtils.synthesizeMouse until I figured out how it actually works and how to use it. In light of this, I decided it would be best to a) always pass in gTestBrowser.contentWindow and b) use synthesizeMouseAtCenter in all cases except where we specifically don't want to click the center. Let me know if this is too much scope creep, though.
Attachment #648111 - Attachment is obsolete: true
Attachment #649333 - Flags: review?(jaws)
Attachment #649333 - Flags: review?(jaws) → review+
Status: NEW → ASSIGNED
https://hg.mozilla.org/mozilla-central/rev/532ff9ae12b8
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: