Closed Bug 1304308 Opened 3 years ago Closed 3 years ago

[Pointer Event] Investigate failure of test_pointerevent_setpointercapture_inactive_button_mouse-manual.html

Categories

(Core :: DOM: Events, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla54
Tracking Status
firefox54 --- fixed

People

(Reporter: stone, Assigned: stone)

Details

Attachments

(1 file, 2 obsolete files)

No description provided.
Assignee: nobody → sshih
Attachment #8793255 - Flags: feedback?(btseng) → feedback+
Comment on attachment 8829766 [details]
Bug 1304308: Investigate failure of test_pointerevent_setpointercapture_inactive_button_mouse-manual.html.

https://reviewboard.mozilla.org/r/106774/#review108204

::: dom/events/test/pointerevents/mochitest_support_external.js:84
(Diff revision 1)
>        ok(!this.BUTTONS_STATE, "Mismatched mousedown/mouseup caught.");
>      }
>    };
>  }) ();
>  
> -// Helper function to send MouseEvent with different parameters
> +function createMouseEvent(eventType, params) {

Although, if you used "a" prefix for the arguments, the code would be easier to read, but original code doesn't use this rule, so, up to you.

::: dom/events/test/pointerevents/mochitest_support_external.js:135
(Diff revision 1)
> +}
> +
> +// Helper function to send MouseEvent with different parameters
> +function sendMouseEvent(int_win, elemId, mouseEventType, params) {
> +  var elem = int_win.document.getElementById(elemId);
> +  if(!!elem) {

nit: insert a whitespace after |if|. (And do we actually need |!!| here?)

::: dom/events/test/pointerevents/test_pointerevent_setpointercapture_inactive_button_mouse-manual.html:20
(Diff revision 1)
> -        sendMouseEvent(int_win, "target1", "mousemove");
> -        sendMouseEvent(int_win, "target0", "mousemove");
> -        sendMouseEvent(int_win, "target1", "mousemove");
> +        let target0 = int_win.document.getElementById("target0");
> +        let rect = target0.getBoundingClientRect();
> +        sendMouseEventAtPoint(int_win, rect.left + 1, rect.top + 1, "mousemove");
> +        sendMouseEventAtPoint(int_win, rect.left - 1, rect.top - 1, "mousemove");

Perhaps, this code assumes that "target0" won't have a descendant at rect.left + 1, rect.top + 1. If it doesn't cause any trouble, it's okay.
Attachment #8829766 - Flags: review?(masayuki) → review+
Attachment #8797044 - Attachment is obsolete: true
Keywords: checkin-needed
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/d02bf33a50fb
Investigate failure of test_pointerevent_setpointercapture_inactive_button_mouse-manual.html. r=masayuki
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/d02bf33a50fb
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla54
You need to log in before you can comment on or make changes to this bug.