From af7b36eed3fbd816e57e0fbd5ee2a7987abb62ff Mon Sep 17 00:00:00 2001 From: "dbaron%dbaron.org" Date: Mon, 18 Jun 2007 23:22:09 +0000 Subject: [PATCH] Make marquee work again when direction is rtl, by working around changes to range of offsetLeft. b=336736 Patch by Daniel Holbert . r=martijn sr=dbaron git-svn-id: svn://10.0.0.236/trunk@228272 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/reftests/bugs/336736-1-ref.html | 13 +++++++++++++ mozilla/layout/reftests/bugs/336736-1.html | 13 +++++++++++++ mozilla/layout/reftests/bugs/reftest.list | 1 + mozilla/layout/style/xbl-marquee/xbl-marquee.xml | 11 +++++++++++ 4 files changed, 38 insertions(+) create mode 100644 mozilla/layout/reftests/bugs/336736-1-ref.html create mode 100644 mozilla/layout/reftests/bugs/336736-1.html diff --git a/mozilla/layout/reftests/bugs/336736-1-ref.html b/mozilla/layout/reftests/bugs/336736-1-ref.html new file mode 100644 index 00000000000..e8fe89728f3 --- /dev/null +++ b/mozilla/layout/reftests/bugs/336736-1-ref.html @@ -0,0 +1,13 @@ + + + + + a + + + diff --git a/mozilla/layout/reftests/bugs/336736-1.html b/mozilla/layout/reftests/bugs/336736-1.html new file mode 100644 index 00000000000..9a32fa3a1f5 --- /dev/null +++ b/mozilla/layout/reftests/bugs/336736-1.html @@ -0,0 +1,13 @@ + + + + + a + + + diff --git a/mozilla/layout/reftests/bugs/reftest.list b/mozilla/layout/reftests/bugs/reftest.list index 7e20db357c9..b55b20a5ab3 100644 --- a/mozilla/layout/reftests/bugs/reftest.list +++ b/mozilla/layout/reftests/bugs/reftest.list @@ -121,6 +121,7 @@ random == 328829-1.xhtml 328829-1-ref.xhtml # bug 369046 (intermittent) == 335628-1.html 335628-1-ref.html != 335628-2.xul 335628-2-ref.xul == 336147-1.html 336147-1-ref.html +== 336736-1.html 336736-1-ref.html fails-if(MOZ_WIDGET_TOOLKIT=="cocoa") == 339289-1.html 339289-1-ref.html # mac bug 382399 == 341043-1a.html 341043-1-ref.html != 341043-1b.html 341043-1-ref.html diff --git a/mozilla/layout/style/xbl-marquee/xbl-marquee.xml b/mozilla/layout/style/xbl-marquee/xbl-marquee.xml index 78a3d2f2b57..22cbb4f6441 100644 --- a/mozilla/layout/style/xbl-marquee/xbl-marquee.xml +++ b/mozilla/layout/style/xbl-marquee/xbl-marquee.xml @@ -434,6 +434,17 @@ corrvalue : (this.innerDiv.offsetWidth + this.startAt)); } + // RTL Support. If text direction is right-to-left and marquee + // axis is horizontal, then negate and swap stopAt and startAt. + var dir = document.defaultView.getComputedStyle(this, "").direction; + if (dir == "rtl") { + if (this._direction == "right" || this._direction == "left") { + var tmp = this.startAt; + this.startAt = -this.stopAt; + this.stopAt = -tmp; + } + } + if (aResetPosition) { this.newPosition = this.startAt; this._fireEvent("start", false, false);