Make marquee work again when direction is rtl, by working around changes to range of offsetLeft. b=336736 Patch by Daniel Holbert <dholbert@mozilla.com>. r=martijn sr=dbaron
git-svn-id: svn://10.0.0.236/trunk@228272 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
13
mozilla/layout/reftests/bugs/336736-1-ref.html
Normal file
13
mozilla/layout/reftests/bugs/336736-1-ref.html
Normal file
@@ -0,0 +1,13 @@
|
||||
<html>
|
||||
<body>
|
||||
<!-- The "alternate" behavior is necessary for the
|
||||
marquee text to start out on the screen. -->
|
||||
<MARQUEE
|
||||
direction="right"
|
||||
scrollamount="0"
|
||||
behavior="alternate"
|
||||
>
|
||||
a
|
||||
</MARQUEE>
|
||||
</body>
|
||||
</html>
|
||||
13
mozilla/layout/reftests/bugs/336736-1.html
Normal file
13
mozilla/layout/reftests/bugs/336736-1.html
Normal file
@@ -0,0 +1,13 @@
|
||||
<html>
|
||||
<body dir="rtl">
|
||||
<!-- The "alternate" behavior is necessary for the
|
||||
marquee text to start out on the screen. -->
|
||||
<MARQUEE
|
||||
direction="right"
|
||||
scrollamount="0"
|
||||
behavior="alternate"
|
||||
>
|
||||
a
|
||||
</MARQUEE>
|
||||
</body>
|
||||
</html>
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user