diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /dom/xul/test/test_bug199692.xul | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'dom/xul/test/test_bug199692.xul')
-rw-r--r-- | dom/xul/test/test_bug199692.xul | 98 |
1 files changed, 98 insertions, 0 deletions
diff --git a/dom/xul/test/test_bug199692.xul b/dom/xul/test/test_bug199692.xul new file mode 100644 index 000000000..69a400a2a --- /dev/null +++ b/dom/xul/test/test_bug199692.xul @@ -0,0 +1,98 @@ +<?xml version="1.0"?> +<?xml-stylesheet href="chrome://global/skin" type="text/css"?> +<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?> +<!-- +https://bugzilla.mozilla.org/show_bug.cgi?id=199692 +--> +<window title="Test for Bug 199692" + id="test_bug199692_xul" + xmlns:html="http://www.w3.org/1999/xhtml" + xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" + xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> + + <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> + <vbox hidden="true"> + <bindings xmlns="http://www.mozilla.org/xbl" + xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> + <binding id="anon"> + <content> + <xul:label id="anon-label" value="ANON"/> + </content> + </binding> + </bindings> + </vbox> + +<body id="body" xmlns="http://www.w3.org/1999/xhtml"> +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=199692">Mozilla Bug 199692</a> + +<vbox id="content" style="position: relative;" +xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> + <xul:label id="non-anon-label" value="a textbox!:" control="textbox"/> + <xul:textbox id="textbox" multiline="true" rows="4" /> + <xul:radiogroup style="outline: 2px solid orange;"> + <xul:radio id="unselected-radio" label="Orange" style="outline: 2px solid red;"/> + <xul:radio id="selected-radio" label="Violet" selected="true"/> + <xul:radio id="disabled-radio" label="Yellow" disabled="true"/> + </xul:radiogroup> + <hbox id="bound" style="-moz-binding:url('#anon'); border: 2px solid green;"></hbox> +</vbox> +<pre id="test"> + <script class="testbody" type="text/javascript"> +<![CDATA[ + SimpleTest.waitForExplicitFinish(); + + // Before onload, XUL docs have no root frame. + is(document.elementFromPoint(10,10), null, + "Calls to elementFromPoint before onload should return null"); + + var d = 10; + function middle(e) { + return { "x": e.boxObject.x + e.boxObject.width/2, + "y": e.boxObject.y + e.boxObject.height/2 }; + } + function lower_right(e) { + return { "x": e.boxObject.x + e.boxObject.width - d, + "y": e.boxObject.y + e.boxObject.height - d }; + } + function upper_left(e) { + return { "x": e.boxObject.x + d, + "y": e.boxObject.y + d }; + } + function scrollbar_button(e) { // a bit down from upper right + return { "x": e.boxObject.x + e.boxObject.width - d, + "y": e.boxObject.y + d + 15 }; + } + + function test(ptFunc, id, message) { + var pt = ptFunc($(id)); + var e = document.elementFromPoint(pt.x, pt.y); + ok(e != null, message + " (returned null)"); + is(e.id, id, message); + } + + function do_test() { + // Avoid hardcoding x,y pixel values, to better deal with differing default + // font sizes or other layout defaults. + + test(middle, 'textbox', "Point within textbox should return textbox element"); + test(lower_right, 'textbox', "Point on textbox's scrollbar should return textbox element"); + test(scrollbar_button, 'textbox', "Point on textbox's scrollbar button should return textbox element"); + test(middle, 'non-anon-label', "Point on label should return label"); + test(upper_left, 'bound', "Point on XBL content should return element with -moz-binding style"); + + SimpleTest.finish(); + } + $("textbox").setAttribute("value", + "lorem ipsum dolor sit amet " + + "lorem ipsum dolor sit amet " + + "lorem ipsum dolor sit amet " + + "lorem ipsum dolor sit amet " + + "lorem ipsum dolor sit amet " + + "lorem ipsum dolor sit amet " + + "lorem ipsum dolor sit amet "); // force scrollbars to appear + addLoadEvent(do_test); +]]> + </script> +</pre> +</body> +</window> |