Bug 1167930 - Handle direction:rtl in vertical modes when converting a LogicalMargin to physical. r=smontagu

This commit is contained in:
Jonathan Kew 2015-05-28 18:29:07 +01:00
parent 2e25cb2966
commit 971348d9b6
2 changed files with 13 additions and 9 deletions

View File

@ -1219,13 +1219,17 @@ public:
nsMargin GetPhysicalMargin(WritingMode aWritingMode) const
{
CHECK_WRITING_MODE(aWritingMode);
return aWritingMode.IsVertical() ?
(aWritingMode.IsVerticalLR() ?
nsMargin(IStart(), BEnd(), IEnd(), BStart()) :
nsMargin(IStart(), BStart(), IEnd(), BEnd())) :
(aWritingMode.IsBidiLTR() ?
nsMargin(BStart(), IEnd(), BEnd(), IStart()) :
nsMargin(BStart(), IStart(), BEnd(), IEnd()));
return aWritingMode.IsVertical()
? (aWritingMode.IsVerticalLR()
? (aWritingMode.IsBidiLTR()
? nsMargin(IStart(), BEnd(), IEnd(), BStart())
: nsMargin(IEnd(), BEnd(), IStart(), BStart()))
: (aWritingMode.IsBidiLTR()
? nsMargin(IStart(), BStart(), IEnd(), BEnd())
: nsMargin(IEnd(), BStart(), IStart(), BEnd())))
: (aWritingMode.IsBidiLTR()
? nsMargin(BStart(), IEnd(), BEnd(), IStart())
: nsMargin(BStart(), IStart(), BEnd(), IEnd()));
}
/**

View File

@ -50,7 +50,7 @@ default-preferences pref(layout.css.vertical-text.enabled,true)
== float-in-rtl-vlr-2a.html float-in-rtl-vlr-2-ref.html
== float-in-rtl-vlr-2b.html float-in-rtl-vlr-2-ref.html
== float-in-rtl-vlr-2c.html float-in-rtl-vlr-2-ref.html
fails == float-in-rtl-vlr-2d.html float-in-rtl-vlr-2-ref.html # bug 1122253
== float-in-rtl-vlr-2d.html float-in-rtl-vlr-2-ref.html
fails == float-in-rtl-vlr-3a.html float-in-rtl-vlr-3-ref.html # bug 1131451
fails == float-in-rtl-vlr-3b.html float-in-rtl-vlr-3-ref.html # bug 1131451
fails == float-in-rtl-vlr-3c.html float-in-rtl-vlr-3-ref.html # bug 1131451
@ -66,7 +66,7 @@ fails == float-in-rtl-vlr-4d.html float-in-rtl-vlr-4-ref.html # bug 1131451
== float-in-rtl-vrl-2a.html float-in-rtl-vrl-2-ref.html
== float-in-rtl-vrl-2b.html float-in-rtl-vrl-2-ref.html
== float-in-rtl-vrl-2c.html float-in-rtl-vrl-2-ref.html
fails == float-in-rtl-vrl-2d.html float-in-rtl-vrl-2-ref.html # bug 1122253
== float-in-rtl-vrl-2d.html float-in-rtl-vrl-2-ref.html
fails == float-in-rtl-vrl-3a.html float-in-rtl-vrl-3-ref.html # bug 1131451
fails == float-in-rtl-vrl-3b.html float-in-rtl-vrl-3-ref.html # bug 1131451
fails == float-in-rtl-vrl-3c.html float-in-rtl-vrl-3-ref.html # bug 1131451