|
|
|
Lines 1908-1938
nsLineLayout::VerticalAlignFrames(PerSpa
|
Link Here
|
|---|
|
| 1908 |
pfd->mMargin.top; |
1908 |
pfd->mMargin.top; |
| 1909 |
} |
1909 |
} |
| 1910 |
pfd->mVerticalAlign = VALIGN_OTHER; |
1910 |
pfd->mVerticalAlign = VALIGN_OTHER; |
| 1911 |
break; |
1911 |
break; |
| 1912 |
|
1912 |
|
| 1913 |
case NS_STYLE_VERTICAL_ALIGN_TEXT_TOP: |
1913 |
case NS_STYLE_VERTICAL_ALIGN_TEXT_TOP: |
| 1914 |
// The top of the logical box is aligned with the top of |
1914 |
// The top of the logical box is aligned with the top of |
| 1915 |
// the parent elements text. |
1915 |
// the parent elements text. |
| 1916 |
fm->GetMaxAscent(parentAscent); |
1916 |
fm->GetEmAscent(parentAscent); |
| 1917 |
if (frameSpan) { |
1917 |
if (frameSpan) { |
| 1918 |
pfd->mBounds.y = baselineY - parentAscent - |
1918 |
pfd->mBounds.y = baselineY - parentAscent - |
| 1919 |
pfd->mBorderPadding.top + frameSpan->mTopLeading; |
1919 |
pfd->mBorderPadding.top + frameSpan->mTopLeading; |
| 1920 |
} |
1920 |
} |
| 1921 |
else { |
1921 |
else { |
| 1922 |
pfd->mBounds.y = baselineY - parentAscent + pfd->mMargin.top; |
1922 |
pfd->mBounds.y = baselineY - parentAscent + pfd->mMargin.top; |
| 1923 |
} |
1923 |
} |
| 1924 |
pfd->mVerticalAlign = VALIGN_OTHER; |
1924 |
pfd->mVerticalAlign = VALIGN_OTHER; |
| 1925 |
break; |
1925 |
break; |
| 1926 |
|
1926 |
|
| 1927 |
case NS_STYLE_VERTICAL_ALIGN_TEXT_BOTTOM: |
1927 |
case NS_STYLE_VERTICAL_ALIGN_TEXT_BOTTOM: |
| 1928 |
// The bottom of the logical box is aligned with the |
1928 |
// The bottom of the logical box is aligned with the |
| 1929 |
// bottom of the parent elements text. |
1929 |
// bottom of the parent elements text. |
| 1930 |
fm->GetMaxDescent(parentDescent); |
1930 |
fm->GetEmDescent(parentDescent); |
| 1931 |
if (frameSpan) { |
1931 |
if (frameSpan) { |
| 1932 |
pfd->mBounds.y = baselineY + parentDescent - |
1932 |
pfd->mBounds.y = baselineY + parentDescent - |
| 1933 |
pfd->mBounds.height + pfd->mBorderPadding.bottom - |
1933 |
pfd->mBounds.height + pfd->mBorderPadding.bottom - |
| 1934 |
frameSpan->mBottomLeading; |
1934 |
frameSpan->mBottomLeading; |
| 1935 |
} |
1935 |
} |
| 1936 |
else { |
1936 |
else { |
| 1937 |
pfd->mBounds.y = baselineY + parentDescent - |
1937 |
pfd->mBounds.y = baselineY + parentDescent - |
| 1938 |
pfd->mBounds.height - pfd->mMargin.bottom; |
1938 |
pfd->mBounds.height - pfd->mMargin.bottom; |
|
Lines 2090-2110
nsLineLayout::VerticalAlignFrames(PerSpa
|
Link Here
|
|---|
|
| 2090 |
} |
2090 |
} |
| 2091 |
} |
2091 |
} |
| 2092 |
if (applyMinLH) { |
2092 |
if (applyMinLH) { |
| 2093 |
if ((psd->mX != psd->mLeftEdge) || preMode || foundLI) { |
2093 |
if ((psd->mX != psd->mLeftEdge) || preMode || foundLI) { |
| 2094 |
#ifdef NOISY_VERTICAL_ALIGN |
2094 |
#ifdef NOISY_VERTICAL_ALIGN |
| 2095 |
printf(" [span]==> adjusting min/maxY: currentValues: %d,%d", minY, maxY); |
2095 |
printf(" [span]==> adjusting min/maxY: currentValues: %d,%d", minY, maxY); |
| 2096 |
#endif |
2096 |
#endif |
| 2097 |
nscoord minimumLineHeight = mMinLineHeight; |
2097 |
nscoord minimumLineHeight = mMinLineHeight; |
| 2098 |
nscoord fontAscent, fontHeight; |
2098 |
nscoord fontAscent, fontDescent; |
| 2099 |
fm->GetMaxAscent(fontAscent); |
2099 |
fm->GetEmAscent(fontAscent); |
| 2100 |
fm->GetHeight(fontHeight); |
2100 |
fm->GetEmDescent(fontDescent); |
| 2101 |
|
2101 |
|
| 2102 |
nscoord leading = minimumLineHeight - fontHeight; |
2102 |
nscoord leading = minimumLineHeight - fontAscent - fontDescent; |
| 2103 |
nscoord yTop = -fontAscent - leading/2; |
2103 |
nscoord yTop = -fontAscent - leading/2; |
| 2104 |
nscoord yBottom = yTop + minimumLineHeight; |
2104 |
nscoord yBottom = yTop + minimumLineHeight; |
| 2105 |
if (yTop < minY) minY = yTop; |
2105 |
if (yTop < minY) minY = yTop; |
| 2106 |
if (yBottom > maxY) maxY = yBottom; |
2106 |
if (yBottom > maxY) maxY = yBottom; |
| 2107 |
|
2107 |
|
| 2108 |
#ifdef NOISY_VERTICAL_ALIGN |
2108 |
#ifdef NOISY_VERTICAL_ALIGN |
| 2109 |
printf(" new values: %d,%d\n", minY, maxY); |
2109 |
printf(" new values: %d,%d\n", minY, maxY); |
| 2110 |
#endif |
2110 |
#endif |