Bug 1220352 - Make baseline positioning in vertical writing-mode independent of border and padding. r=jfkthame

Differential Revision: https://phabricator.services.mozilla.com/D47014

--HG--
extra : moz-landing-system : lando
This commit is contained in:
L. David Baron 2019-09-25 20:47:35 +00:00
parent dca80bb570
commit e09d436481
15 changed files with 22 additions and 51 deletions

View File

@ -2029,9 +2029,16 @@ void nsLineLayout::VerticalAlignFrames(PerSpanData* psd) {
default:
case StyleVerticalAlignKeyword::Baseline:
if (lineWM.IsVertical() && !lineWM.IsSideways()) {
// FIXME: We should really use a central baseline from the
// baseline table of the font, rather than assuming it's in
// the middle.
if (frameSpan) {
nscoord borderBoxBSize = pfd->mBounds.BSize(lineWM);
nscoord bStartBP = pfd->mBorderPadding.BStart(lineWM);
nscoord bEndBP = pfd->mBorderPadding.BEnd(lineWM);
nscoord contentBoxBSize = borderBoxBSize - bStartBP - bEndBP;
pfd->mBounds.BStart(lineWM) =
revisedBaselineBCoord - pfd->mBounds.BSize(lineWM) / 2;
revisedBaselineBCoord - contentBoxBSize / 2 - bStartBP;
} else {
pfd->mBounds.BStart(lineWM) = revisedBaselineBCoord -
logicalBSize / 2 +

View File

@ -157,18 +157,6 @@ random css-writing-modes/line-box-direction-srl-055.xht
random css-writing-modes/line-box-direction-vlr-016.xht
random css-writing-modes/line-box-direction-vrl-015.xht
# Bug 1220352
fails random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) css-writing-modes/line-box-height-vlr-003.xht
fails random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) css-writing-modes/line-box-height-vlr-005.xht
fails random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) css-writing-modes/line-box-height-vlr-011.xht
fails random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) css-writing-modes/line-box-height-vlr-013.xht
fails random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) css-writing-modes/line-box-height-vlr-021.xht
fails random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) css-writing-modes/line-box-height-vlr-023.xht
fails random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) css-writing-modes/line-box-height-vrl-002.xht
fails random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) css-writing-modes/line-box-height-vrl-004.xht
fails random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) css-writing-modes/line-box-height-vrl-010.xht
fails random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) css-writing-modes/line-box-height-vrl-012.xht
# Bug 1258635 - text-combine-upright: digits
skip css-writing-modes/full-width-003.html
skip css-writing-modes/text-combine-upright-value-digits?-001.html

View File

@ -841,20 +841,20 @@ fuzzy-if(OSX||winWidget,0-213,0-1540) random-if(/^Windows\x20NT\x206\.1/.test(ht
random == css-writing-modes/line-box-direction-vrl-015.xht css-writing-modes/block-flow-direction-001-ref.xht
fuzzy-if(OSX||winWidget,0-213,0-1540) random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == css-writing-modes/line-box-direction-vrl-017.xht css-writing-modes/block-flow-direction-001-ref.xht
fuzzy-if(OSX||winWidget,0-213,0-1540) random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == css-writing-modes/line-box-direction-vrl-019.xht css-writing-modes/block-flow-direction-001-ref.xht
fails random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == css-writing-modes/line-box-height-vlr-003.xht css-writing-modes/line-box-height-vlr-003-ref.xht
fails random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == css-writing-modes/line-box-height-vlr-005.xht css-writing-modes/line-box-height-vlr-003-ref.xht
== css-writing-modes/line-box-height-vlr-003.xht css-writing-modes/line-box-height-vlr-003-ref.xht
== css-writing-modes/line-box-height-vlr-005.xht css-writing-modes/line-box-height-vlr-003-ref.xht
== css-writing-modes/line-box-height-vlr-007.xht css-writing-modes/line-box-height-vlr-007-ref.xht
== css-writing-modes/line-box-height-vlr-009.xht css-writing-modes/line-box-height-vlr-007-ref.xht
fails random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == css-writing-modes/line-box-height-vlr-011.xht css-writing-modes/line-box-height-vlr-011-ref.xht
fails random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == css-writing-modes/line-box-height-vlr-013.xht css-writing-modes/line-box-height-vlr-011-ref.xht
fails random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == css-writing-modes/line-box-height-vlr-021.xht css-writing-modes/line-box-height-vlr-021-ref.xht
fails random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == css-writing-modes/line-box-height-vlr-023.xht css-writing-modes/line-box-height-vlr-023-ref.xht
fails random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == css-writing-modes/line-box-height-vrl-002.xht css-writing-modes/line-box-height-vrl-002-ref.xht
fails random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == css-writing-modes/line-box-height-vrl-004.xht css-writing-modes/line-box-height-vrl-002-ref.xht
== css-writing-modes/line-box-height-vlr-011.xht css-writing-modes/line-box-height-vlr-011-ref.xht
== css-writing-modes/line-box-height-vlr-013.xht css-writing-modes/line-box-height-vlr-011-ref.xht
== css-writing-modes/line-box-height-vlr-021.xht css-writing-modes/line-box-height-vlr-021-ref.xht
== css-writing-modes/line-box-height-vlr-023.xht css-writing-modes/line-box-height-vlr-023-ref.xht
== css-writing-modes/line-box-height-vrl-002.xht css-writing-modes/line-box-height-vrl-002-ref.xht
== css-writing-modes/line-box-height-vrl-004.xht css-writing-modes/line-box-height-vrl-002-ref.xht
== css-writing-modes/line-box-height-vrl-006.xht css-writing-modes/line-box-height-vrl-006-ref.xht
== css-writing-modes/line-box-height-vrl-008.xht css-writing-modes/line-box-height-vrl-006-ref.xht
fails random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == css-writing-modes/line-box-height-vrl-010.xht css-writing-modes/line-box-height-vrl-010-ref.xht
fails random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == css-writing-modes/line-box-height-vrl-012.xht css-writing-modes/line-box-height-vrl-010-ref.xht
== css-writing-modes/line-box-height-vrl-010.xht css-writing-modes/line-box-height-vrl-010-ref.xht
== css-writing-modes/line-box-height-vrl-012.xht css-writing-modes/line-box-height-vrl-010-ref.xht
== css-writing-modes/margin-collapse-vlr-003.xht reference/ref-filled-green-100px-square.xht
== css-writing-modes/margin-collapse-vlr-009.xht reference/ref-filled-green-100px-square.xht
== css-writing-modes/margin-collapse-vlr-011.xht reference/ref-filled-green-100px-square.xht

View File

@ -13,8 +13,6 @@
.v-lr { writing-mode: vertical-lr; }
.v-rl { writing-mode: vertical-rl; }
.i { inline-size: 1.5em; }
.u { vertical-align: 0.75em; }
.d { vertical-align: -0.75em; }
</style>
</head>
<body>
@ -39,10 +37,10 @@
<span>12<b>33</b><span class="i"></span>21</span>
</div>
<div class="v-lr">
<span>12<b class="u">33</b>21</span>
<span>12<b>33</b>21</span>
</div>
<div class="v-lr">
<span>12<b class="d">33</b>21</span>
<span>12<b>33</b>21</span>
</div>
<div class="v-lr sw">
<span>12<b>33</b>21</span>
@ -58,10 +56,10 @@
<span>12<b>33</b><span class="i"></span>21</span>
</div>
<div class="v-rl">
<span>12<b class="d">33</b>21</span>
<span>12<b>33</b>21</span>
</div>
<div class="v-rl">
<span>12<b class="u">33</b>21</span>
<span>12<b>33</b>21</span>
</div>
<div class="v-rl sw">
<span>12<b>33</b>21</span>

View File

@ -1,2 +0,0 @@
[inline-box-border-vlr-001.html]
expected: FAIL

View File

@ -1,2 +0,0 @@
[line-box-height-vlr-003.xht]
expected: FAIL

View File

@ -1,2 +0,0 @@
[line-box-height-vlr-005.xht]
expected: FAIL

View File

@ -1,2 +0,0 @@
[line-box-height-vlr-011.xht]
expected: FAIL

View File

@ -1,2 +0,0 @@
[line-box-height-vlr-013.xht]
expected: FAIL

View File

@ -1,2 +0,0 @@
[line-box-height-vlr-021.xht]
expected: FAIL

View File

@ -1,2 +0,0 @@
[line-box-height-vlr-023.xht]
expected: FAIL

View File

@ -1,2 +0,0 @@
[line-box-height-vrl-002.xht]
expected: FAIL

View File

@ -1,2 +0,0 @@
[line-box-height-vrl-004.xht]
expected: FAIL

View File

@ -1,2 +0,0 @@
[line-box-height-vrl-010.xht]
expected: FAIL

View File

@ -1,2 +0,0 @@
[line-box-height-vrl-012.xht]
expected: FAIL