bug 1001233 - convert bullet frame's margin to the block frame's writing mode when positioning bullet. r=smontagu

This commit is contained in:
Jonathan Kew 2014-05-13 18:09:27 +01:00
Родитель 9b7bb0b045
Коммит 5bd536514e
3 изменённых файлов: 35 добавлений и 8 удалений

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

@ -0,0 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style>
li::-moz-list-bullet {
direction: rtl;
margin-right: 1em;
}
</style>
</head>
<body>
Body
<ul>
<li>list item</li>
</ul>
</body>
</html>

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

@ -528,5 +528,6 @@ test-pref(layout.css.sticky.enabled,true) load 949932.html
load 973701-1.xhtml
load 973701-2.xhtml
load 986899.html
load 1001233.html
load 1001258-1.html
load outline-on-frameset.xhtml

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

@ -6832,18 +6832,26 @@ nsBlockFrame::ReflowBullet(nsIFrame* aBulletFrame,
// in the current writing mode. Then we subtract out the start
// border/padding and the bullet's width and margin to offset the position.
WritingMode wm = rs.GetWritingMode();
LogicalRect logicalFAS(wm, floatAvailSpace, floatAvailSpace.XMost());
nscoord containerWidth = floatAvailSpace.XMost();
LogicalRect logicalFAS(wm, floatAvailSpace, containerWidth);
// Get the bullet's margin, converted to our writing mode so that we can
// combine it with other logical values here.
WritingMode bulletWM = reflowState.GetWritingMode();
LogicalMargin bulletMargin =
reflowState.ComputedLogicalMargin().ConvertTo(wm, bulletWM);
nscoord iStart = logicalFAS.IStart(wm) -
rs.ComputedLogicalBorderPadding().IStart(wm)
- reflowState.ComputedLogicalMargin().IEnd(wm) - aMetrics.ISize();
rs.ComputedLogicalBorderPadding().IStart(wm) -
bulletMargin.IEnd(wm) -
aMetrics.ISize();
// Approximate the bullets position; vertical alignment will provide
// the final vertical location.
// the final vertical location. We pass our writing-mode here, because
// it may be different from the bullet frame's mode.
nscoord bStart = logicalFAS.BStart(wm);
aBulletFrame->SetRect(LogicalRect(wm, LogicalPoint(wm, iStart, bStart),
LogicalSize(wm, aMetrics.ISize(),
aMetrics.BSize())),
floatAvailSpace.XMost());
aBulletFrame->SetRect(wm, LogicalRect(wm, LogicalPoint(wm, iStart, bStart),
LogicalSize(wm, aMetrics.ISize(),
aMetrics.BSize())),
containerWidth);
aBulletFrame->DidReflow(aState.mPresContext, &aState.mReflowState,
nsDidReflowStatus::FINISHED);
}