The default bug view has changed. See this FAQ.

avoid uses of enablePrivilege in style system mochitests

RESOLVED FIXED in mozilla6

Status

()

Core
CSS Parsing and Computation
P4
normal
RESOLVED FIXED
6 years ago
5 years ago

People

(Reporter: dbaron, Assigned: dbaron)

Tracking

Trunk
mozilla6
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(4 attachments)

(Assignee)

Description

6 years ago
I have patches to remove all but one of the uses of enablePrivilege in the layout/style/test/ mochitests.

The one remaining use is in test_bug405818.html, which I'm not immediately sure what to do about.
(Assignee)

Comment 1

6 years ago
Created attachment 528879 [details] [diff] [review]
patch 1: fix use of prefs API
Attachment #528879 - Flags: review?(bzbarsky)
(Assignee)

Comment 2

6 years ago
Created attachment 528881 [details] [diff] [review]
patch 2: convert uses of DOMWindowUtils
Attachment #528881 - Flags: review?(bzbarsky)
(Assignee)

Comment 3

6 years ago
Created attachment 528882 [details] [diff] [review]
patch 3: convert use of zoom
Attachment #528882 - Flags: review?(bzbarsky)
Comment on attachment 528881 [details] [diff] [review]
patch 2: convert uses of DOMWindowUtils

Review of attachment 528881 [details] [diff] [review]:

::: layout/style/test/test_pointer-events.html
@@ +70,5 @@
                               modifiers,           // long
                               ignoreWindowBounds)  // boolean
 {
+  SpecialPowers.DOMWindowUtils.sendMouseEvent(type, x, y, button, clickCount,
+                                              modifiers, ignoreWindowBounds);

Just curious why this is using sendMouseEvent when we have many synthesizeMouse* functions in EventUtils.js?  I sort of prefer this simpler approach.
(Assignee)

Comment 5

6 years ago
Not sure; I didn't write it, and I'd rather not change it without doing more retesting that it's still testing the original bug.

That said, I find the EventUtils stuff pretty magical, and prefer this more explicit approach.
This caller is passing true for ignoreWindowBounds, which is not something the synthesizeMouse stuff in EventUtils does.  That my matter in this case.  Or not.  It would take some looking at this test to make sure.
Comment on attachment 528879 [details] [diff] [review]
patch 1: fix use of prefs API

r=me
Attachment #528879 - Flags: review?(bzbarsky) → review+
Comment on attachment 528881 [details] [diff] [review]
patch 2: convert uses of DOMWindowUtils

r=me
Attachment #528881 - Flags: review?(bzbarsky) → review+
Comment on attachment 528882 [details] [diff] [review]
patch 3: convert use of zoom

r=me
Attachment #528882 - Flags: review?(bzbarsky) → review+
(Assignee)

Comment 10

6 years ago
https://hg.mozilla.org/mozilla-central/rev/2228e6343c47
https://hg.mozilla.org/mozilla-central/rev/442fe6006bbb
https://hg.mozilla.org/mozilla-central/rev/00d9bc4a9b9c

I'll call this bug fixed despite there being one left (see comment 0).
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
(Assignee)

Comment 11

5 years ago
Created attachment 659077 [details] [diff] [review]
use SpecialPowers.wrap() for the last case

Well, SpecialPowers.wrap() makes the last case easy (though I wonder if it's an overused tool), assuming this looks reasonable.
Attachment #659077 - Flags: review?(bzbarsky)
Comment on attachment 659077 [details] [diff] [review]
use SpecialPowers.wrap() for the last case

r=me
Attachment #659077 - Flags: review?(bzbarsky) → review+
(Assignee)

Comment 13

5 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/9a64e93daf5c
https://hg.mozilla.org/mozilla-central/rev/9a64e93daf5c
You need to log in before you can comment on or make changes to this bug.