Changeset 117310 in webkit
- Timestamp:
- May 16, 2012 11:30:09 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r117309 r117310 1 2012-05-16 Emil A Eklund <eae@chromium.org> 2 3 Change ascents and descent back to ints for now 4 https://bugs.webkit.org/show_bug.cgi?id=86518 5 6 Reviewed by Eric Seidel. 7 8 Change ascents and descent calculation back to integers for now as it 9 looks like we'll need to support both the 1/60 and 1/1 implementations of 10 FractionalLayoutUnit for the immediate future to ensure that text is 11 rendered at the same offset and with the height regardless of the 12 ENABLE_SUBPIXEL_LAYOUT flag. 13 14 This ensures that most websites will look the same at 100% zoom 15 regardless of the flag and also allows us to the same test expectations 16 for the vast majority of layout tests. 17 18 Eventually we want to move those back to FractionalLayoutUnits as that 19 will result in more correct rendering. 20 21 * platform/chromium-win/fast/block/float/overhanging-tall-block-expected.txt: 22 * platform/mac/fast/block/float/overhanging-tall-block-expected.txt: 23 1 24 2012-05-16 Ken Buchanan <kenrb@chromium.org> 2 25 -
trunk/LayoutTests/platform/chromium-win/fast/block/float/overhanging-tall-block-expected.txt
r116033 r117310 1 layer at (0,0) size 800x16000000 261 layer at (0,0) size 800x1600000018 2 2 RenderView at (0,0) size 800x600 3 layer at (0,0) size 800x16000000 26backgroundClip at (0,0) size 800x1073741823 clip at (0,0) size 800x1073741823 outlineClip at (0,0) size 800x10737418233 layer at (0,0) size 800x1600000018 backgroundClip at (0,0) size 800x1073741823 clip at (0,0) size 800x1073741823 outlineClip at (0,0) size 800x1073741823 4 4 RenderBlock {HTML} at (0,0) size 800x1600000000 5 5 RenderBody {BODY} at (8,8) size 784x1600000000 … … 7 7 RenderBlock {DIV} at (0,1600000000) size 784x0 8 8 RenderBlock {DIV} at (0,1600000000) size 784x0 9 layer at (10, 10) size 179x1600000004 backgroundClip at (10,10) size 179x1073741813 clip at (11,11) size 177x1073741812outlineClip at (0,0) size 800x107374182310 RenderTextControl {TEXTAREA} at (2, 2) size 179x1600000000 [bgcolor=#FFFFFF] [border: (1px solid #000000)]9 layer at (10,2) size 179x1600000004 backgroundClip at (10,2) size 179x1073741821 clip at (11,3) size 177x1073741820 outlineClip at (0,0) size 800x1073741823 10 RenderTextControl {TEXTAREA} at (2,-6) size 179x1600000000 [bgcolor=#FFFFFF] [border: (1px solid #000000)] 11 11 RenderBlock {DIV} at (3,3) size 175x16 12 layer at (10,-10949672 72) size 179x1600000004 backgroundClip at (10,0) size 179x505032732 clip at (11,0) size 177x505032731outlineClip at (0,0) size 800x107374182312 layer at (10,-1094967280) size 179x1600000004 backgroundClip at (10,0) size 179x505032724 clip at (11,0) size 177x505032723 outlineClip at (0,0) size 800x1073741823 13 13 RenderTextControl {TEXTAREA} at (2,1600000000) size 179x-2147483648 [bgcolor=#FFFFFF] [border: (1px solid #000000)] 14 14 RenderBlock {DIV} at (3,3) size 175x16 -
trunk/LayoutTests/platform/mac/fast/block/float/overhanging-tall-block-expected.txt
r116176 r117310 1 layer at (0,0) size 800x13000000 281 layer at (0,0) size 800x1300000018 2 2 RenderView at (0,0) size 800x600 3 layer at (0,0) size 800x13000000 28 backgroundClip at (0,0) size 800x1073741823 clip at (0,0) size 800x1073741823 outlineClip at (0,0) size 800x10737418233 layer at (0,0) size 800x1300000018 backgroundClip at (0,0) size 800x1073741823 clip at (0,0) size 800x1073741823 outlineClip at (0,0) size 800x1073741823 4 4 RenderBlock {HTML} at (0,0) size 800x1300000000 5 5 RenderBody {BODY} at (8,8) size 784x1300000000 … … 7 7 RenderBlock {DIV} at (0,1300000000) size 784x0 8 8 RenderBlock {DIV} at (0,1300000000) size 784x0 9 layer at (10, 10) size 161x1300000006 backgroundClip at (10,10) size 161x1073741813 clip at (11,11) size 159x1073741812 outlineClip at (0,0) size 800x107374182310 RenderTextControl {TEXTAREA} at (2, 2) size 161x1300000000 [bgcolor=#FFFFFF] [border: (1px solid #000000)]9 layer at (10,0) size 161x1300000006 backgroundClip at (10,0) size 161x1073741823 clip at (11,1) size 159x1073741822 outlineClip at (0,0) size 800x1073741823 10 RenderTextControl {TEXTAREA} at (2,-8) size 161x1300000000 [bgcolor=#FFFFFF] [border: (1px solid #000000)] 11 11 RenderBlock {DIV} at (3,3) size 155x13 -
trunk/Source/WebCore/ChangeLog
r117309 r117310 1 2012-05-15 Emil A Eklund <eae@chromium.org> 2 3 Change ascents and descent back to ints for now 4 https://bugs.webkit.org/show_bug.cgi?id=86518 5 6 Reviewed by Eric Seidel. 7 8 Change ascents and descent calculation back to integers for now as it 9 looks like we'll need to support both the 1/60 and 1/1 implementations of 10 FractionalLayoutUnit for the immediate future to ensure that text is 11 rendered at the same offset and with the height regardless of the 12 ENABLE_SUBPIXEL_LAYOUT flag. 13 14 This ensures that most websites will look the same at 100% zoom 15 regardless of the flag and also allows us to the same test expectations 16 for the vast majority of layout tests. 17 18 Eventually we want to move those back to FractionalLayoutUnits as that 19 will result in more correct rendering. 20 21 No new tests, no change in functionality. 22 23 * rendering/InlineFlowBox.cpp: 24 (WebCore::InlineFlowBox::computeLogicalBoxHeights): 25 * rendering/RootInlineBox.cpp: 26 (WebCore::setAscentAndDescent): 27 (WebCore::RootInlineBox::ascentAndDescentForBox): 28 * rendering/RootInlineBox.h: 29 (RootInlineBox): 30 1 31 2012-05-16 Ken Buchanan <kenrb@chromium.org> 2 32 -
trunk/Source/WebCore/rendering/InlineFlowBox.cpp
r115689 r117310 518 518 if (isRootInlineBox()) { 519 519 // Examine our root box. 520 LayoutUnit ascent = 0;521 LayoutUnit descent = 0;520 int ascent = 0; 521 int descent = 0; 522 522 rootBox->ascentAndDescentForBox(rootBox, textBoxDataMap, ascent, descent, affectsAscent, affectsDescent); 523 523 if (strictMode || hasTextChildren() || (!checkChildren && hasTextDescendants())) { … … 550 550 curr->setLogicalTop(rootBox->verticalPositionForBox(curr, verticalPositionCache)); 551 551 552 LayoutUnit ascent = 0;553 LayoutUnit descent = 0;552 int ascent = 0; 553 int descent = 0; 554 554 rootBox->ascentAndDescentForBox(curr, textBoxDataMap, ascent, descent, affectsAscent, affectsDescent); 555 555 -
trunk/Source/WebCore/rendering/RootInlineBox.cpp
r114784 r117310 709 709 } 710 710 711 static void setAscentAndDescent( LayoutUnit& ascent, LayoutUnit& descent, LayoutUnit newAscent, LayoutUnit newDescent, bool& ascentDescentSet)711 static void setAscentAndDescent(int& ascent, int& descent, int newAscent, int newDescent, bool& ascentDescentSet) 712 712 { 713 713 if (!ascentDescentSet) { … … 721 721 } 722 722 723 void RootInlineBox::ascentAndDescentForBox(InlineBox* box, GlyphOverflowAndFallbackFontsMap& textBoxDataMap, LayoutUnit& ascent, LayoutUnit& descent,723 void RootInlineBox::ascentAndDescentForBox(InlineBox* box, GlyphOverflowAndFallbackFontsMap& textBoxDataMap, int& ascent, int& descent, 724 724 bool& affectsAscent, bool& affectsDescent) const 725 725 { … … 758 758 for (size_t i = 0; i < usedFonts->size(); ++i) { 759 759 const FontMetrics& fontMetrics = usedFonts->at(i)->fontMetrics(); 760 LayoutUnit usedFontAscent = fontMetrics.ascent(baselineType());761 LayoutUnit usedFontDescent = fontMetrics.descent(baselineType());762 LayoutUnit halfLeading = (fontMetrics.lineSpacing() - fontMetrics.height()) / 2;763 LayoutUnit usedFontAscentAndLeading = usedFontAscent + halfLeading;764 LayoutUnit usedFontDescentAndLeading = fontMetrics.lineSpacing() - usedFontAscentAndLeading;760 int usedFontAscent = fontMetrics.ascent(baselineType()); 761 int usedFontDescent = fontMetrics.descent(baselineType()); 762 int halfLeading = (fontMetrics.lineSpacing() - fontMetrics.height()) / 2; 763 int usedFontAscentAndLeading = usedFontAscent + halfLeading; 764 int usedFontDescentAndLeading = fontMetrics.lineSpacing() - usedFontAscentAndLeading; 765 765 if (includeFont) { 766 766 setAscentAndDescent(ascent, descent, usedFontAscent, usedFontDescent, ascentDescentSet); … … 780 780 // If leading is included for the box, then we compute that box. 781 781 if (includeLeading && !setUsedFontWithLeading) { 782 LayoutUnit ascentWithLeading = box->baselinePosition(baselineType());783 LayoutUnit descentWithLeading = box->lineHeight() - ascentWithLeading;782 int ascentWithLeading = box->baselinePosition(baselineType()); 783 int descentWithLeading = box->lineHeight() - ascentWithLeading; 784 784 setAscentAndDescent(ascent, descent, ascentWithLeading, descentWithLeading, ascentDescentSet); 785 785 … … 793 793 794 794 if (includeFontForBox(box) && !setUsedFont) { 795 LayoutUnit fontAscent = box->renderer()->style(isFirstLineStyle())->fontMetrics().ascent();796 LayoutUnit fontDescent = box->renderer()->style(isFirstLineStyle())->fontMetrics().descent();795 int fontAscent = box->renderer()->style(isFirstLineStyle())->fontMetrics().ascent(); 796 int fontDescent = box->renderer()->style(isFirstLineStyle())->fontMetrics().descent(); 797 797 setAscentAndDescent(ascent, descent, fontAscent, fontDescent, ascentDescentSet); 798 798 affectsAscent = fontAscent - box->logicalTop() > 0; -
trunk/Source/WebCore/rendering/RootInlineBox.h
r114784 r117310 152 152 LayoutRect paddedLayoutOverflowRect(LayoutUnit endPadding) const; 153 153 154 void ascentAndDescentForBox(InlineBox*, GlyphOverflowAndFallbackFontsMap&, LayoutUnit& ascent, LayoutUnit& descent, bool& affectsAscent, bool& affectsDescent) const;154 void ascentAndDescentForBox(InlineBox*, GlyphOverflowAndFallbackFontsMap&, int& ascent, int& descent, bool& affectsAscent, bool& affectsDescent) const; 155 155 LayoutUnit verticalPositionForBox(InlineBox*, VerticalPositionCache&); 156 156 bool includeLeadingForBox(InlineBox*) const;
Note: See TracChangeset
for help on using the changeset viewer.