зеркало из https://github.com/mozilla/gecko-dev.git
Bug 477754 - [RTL] Customize toolbar sheet is placed mostly outside of the browser; r=enndeakin sr=roc
This commit is contained in:
Родитель
b933c95430
Коммит
ad8c824657
|
@ -983,7 +983,10 @@ nsMenuPopupFrame::SetPopupPosition(nsIFrame* aAnchorFrame, PRBool aIsMove)
|
|||
|
||||
// mXPos and mYPos specify an additonal offset passed to OpenPopup that
|
||||
// should be added to the position
|
||||
screenPoint.x += presContext->CSSPixelsToAppUnits(mXPos);
|
||||
if (GetStyleVisibility()->mDirection == NS_STYLE_DIRECTION_RTL)
|
||||
screenPoint.x -= presContext->CSSPixelsToAppUnits(mXPos);
|
||||
else
|
||||
screenPoint.x += presContext->CSSPixelsToAppUnits(mXPos);
|
||||
screenPoint.y += presContext->CSSPixelsToAppUnits(mYPos);
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -47,6 +47,7 @@ include $(topsrcdir)/config/rules.mk
|
|||
_TEST_FILES = test_bug393970.xul \
|
||||
test_resizer.xul \
|
||||
window_resizer.xul \
|
||||
test_bug477754.xul \
|
||||
$(NULL)
|
||||
|
||||
libs:: $(_TEST_FILES)
|
||||
|
|
|
@ -0,0 +1,49 @@
|
|||
<?xml version="1.0"?>
|
||||
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
|
||||
<?xml-stylesheet href="/tests/SimpleTest/test.css" type="text/css"?>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=477754
|
||||
-->
|
||||
<window title="Mozilla Bug 477754"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
<script type="application/javascript" src="/MochiKit/packed.js" />
|
||||
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"/>
|
||||
|
||||
<!-- test resuls are displayed in the html:body -->
|
||||
<body xmlns="http://www.w3.org/1999/xhtml">
|
||||
<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=477754"
|
||||
target="_blank">Mozilla Bug 477754</a>
|
||||
</body>
|
||||
|
||||
<hbox pack="center">
|
||||
<label id="anchor" value="Anchor"/>
|
||||
</hbox>
|
||||
<panel id="testPopup" style="direction: rtl;" onpopupshown="doTest();">
|
||||
<label value="I am a popup"/>
|
||||
</panel>
|
||||
|
||||
<!-- test code goes here -->
|
||||
<script type="application/javascript"><![CDATA[
|
||||
/** Test for Bug 477754 **/
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
let testPopup, testAnchor;
|
||||
|
||||
addEventListener("load", function () {
|
||||
removeEventListener("load", arguments.callee, false);
|
||||
|
||||
testPopup = document.getElementById("testPopup");
|
||||
testAnchor = document.getElementById("anchor");
|
||||
|
||||
testPopup.openPopup(testAnchor, "after_start", 10, 0, false, false);
|
||||
}, false);
|
||||
|
||||
function doTest() {
|
||||
is(testAnchor.getBoundingClientRect().right - testPopup.getBoundingClientRect().right, 10,
|
||||
"RTL popup's right offset should be equal to the x offset passed to openPopup");
|
||||
testPopup.hidePopup();
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
]]></script>
|
||||
</window>
|
Загрузка…
Ссылка в новой задаче