michael@0: function test() { michael@0: waitForExplicitFinish(); michael@0: michael@0: gBrowser.selectedTab = gBrowser.addTab(); michael@0: michael@0: SpecialPowers.setIntPref("ui.tooltipDelay", 0); michael@0: michael@0: let doStopPropagation = function (aEvent) michael@0: { michael@0: aEvent.stopPropagation(); michael@0: } michael@0: michael@0: let onPopupShown = function (aEvent) michael@0: { michael@0: is(aEvent.originalTarget.localName, "tooltip", "tooltip is showing"); michael@0: michael@0: let doc = gBrowser.contentDocument; michael@0: let win = gBrowser.contentWindow; michael@0: let p2 = doc.getElementById("p2"); michael@0: setTimeout(function () { michael@0: EventUtils.synthesizeMouseAtCenter(p2, { type: "mousemove" }, win); }, 0); michael@0: } michael@0: michael@0: let onPopupHiding = function (aEvent) michael@0: { michael@0: is(aEvent.originalTarget.localName, "tooltip", "tooltip is hiding"); michael@0: michael@0: let doc = gBrowser.contentDocument; michael@0: michael@0: doc.removeEventListener("mousemove", doStopPropagation, true); michael@0: doc.removeEventListener("mouseenter", doStopPropagation, true); michael@0: doc.removeEventListener("mouseleave", doStopPropagation, true); michael@0: doc.removeEventListener("mouseover", doStopPropagation, true); michael@0: doc.removeEventListener("mouseout", doStopPropagation, true); michael@0: document.removeEventListener("popupshown", onPopupShown, true); michael@0: document.removeEventListener("popuphiding", onPopupHiding, true); michael@0: michael@0: SpecialPowers.clearUserPref("ui.tooltipDelay"); michael@0: michael@0: gBrowser.removeCurrentTab(); michael@0: finish(); michael@0: } michael@0: michael@0: let onLoad = function (aEvent) michael@0: { michael@0: let doc = gBrowser.contentDocument; michael@0: let win = gBrowser.contentWindow; michael@0: let p1 = doc.getElementById("p1"); michael@0: let p2 = doc.getElementById("p2"); michael@0: michael@0: EventUtils.synthesizeMouseAtCenter(p2, { type: "mousemove" }, win); michael@0: michael@0: doc.addEventListener("mousemove", doStopPropagation, true); michael@0: doc.addEventListener("mouseenter", doStopPropagation, true); michael@0: doc.addEventListener("mouseleave", doStopPropagation, true); michael@0: doc.addEventListener("mouseover", doStopPropagation, true); michael@0: doc.addEventListener("mouseout", doStopPropagation, true); michael@0: document.addEventListener("popupshown", onPopupShown, true); michael@0: document.addEventListener("popuphiding", onPopupHiding, true); michael@0: michael@0: EventUtils.synthesizeMouseAtCenter(p1, { type: "mousemove" }, win); michael@0: } michael@0: michael@0: gBrowser.selectedBrowser.addEventListener("load", function loadListener() { michael@0: gBrowser.selectedBrowser.removeEventListener("load", loadListener, true); michael@0: setTimeout(onLoad, 0); michael@0: }, true); michael@0: michael@0: content.location = "data:text/html," + michael@0: "

This paragraph has a tooltip.

" + michael@0: "

This paragraph doesn't have tooltip.

"; michael@0: }