Bug 367246. When the scrolled frame's width exceeds its available width (because its padding alone is greater than the available width) and the direction is RTL, the scrolled frame should be positioned with its right edge at the right edge of the scrollport. r+sr=dbaron

This commit is contained in:
Robert O'Callahan 2008-07-14 09:50:35 +12:00
Родитель 7ba625cd25
Коммит 9619dadcbe
3 изменённых файлов: 18 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,9 @@
<html>
<body>
<div style="direction: rtl">
<div style="padding: 10px; width: 1px; overflow: scroll;">Foopy</div>
</div>
</body>
</html>

Просмотреть файл

@ -31,6 +31,7 @@ load 364686-1.xhtml
load 366021-1.xhtml
load 366667-1.html
load 366952-1.html
load 367246-1.html
load 368330-1.html
load 368461-1.xhtml
load 368860-1.html

Просмотреть файл

@ -2610,6 +2610,14 @@ nsGfxScrollFrameInner::GetScrolledRect(const nsSize& aScrollPortSize) const
} else {
if (x2 > aScrollPortSize.width)
x2 = aScrollPortSize.width;
// When the scrolled frame chooses a size larger than its available width (because
// its padding alone is larger than the available width), we need to keep the
// start-edge of the scroll frame anchored to the start-edge of the scrollport.
// When the scrolled frame is RTL, this means moving it in our left-based
// coordinate system, so we need to compensate for its extra width here by
// effectively repositioning the frame.
nscoord extraWidth = PR_MAX(0, mScrolledFrame->GetSize().width - aScrollPortSize.width);
x2 += extraWidth;
}
return nsRect(x1, y1, x2 - x1, y2 - y1);