Changeset 238860 in webkit


Ignore:
Timestamp:
Dec 4, 2018 10:50:52 AM (5 years ago)
Author:
Ryan Haddad
Message:

Unreviewed, rolling out r238838.

The layout test added with this change is failing on iOS.

Reverted changeset:

"Thick overlines and line-throughs grow in the wrong
direction"
https://bugs.webkit.org/show_bug.cgi?id=192264
https://trac.webkit.org/changeset/238838

Location:
trunk
Files:
2 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r238855 r238860  
     12018-12-04  Ryan Haddad  <ryanhaddad@apple.com>
     2
     3        Unreviewed, rolling out r238838.
     4
     5        The layout test added with this change is failing on iOS.
     6
     7        Reverted changeset:
     8
     9        "Thick overlines and line-throughs grow in the wrong
     10        direction"
     11        https://bugs.webkit.org/show_bug.cgi?id=192264
     12        https://trac.webkit.org/changeset/238838
     13
    1142018-12-04  Ryan Haddad  <ryanhaddad@apple.com>
    215
  • trunk/Source/WebCore/ChangeLog

    r238855 r238860  
     12018-12-04  Ryan Haddad  <ryanhaddad@apple.com>
     2
     3        Unreviewed, rolling out r238838.
     4
     5        The layout test added with this change is failing on iOS.
     6
     7        Reverted changeset:
     8
     9        "Thick overlines and line-throughs grow in the wrong
     10        direction"
     11        https://bugs.webkit.org/show_bug.cgi?id=192264
     12        https://trac.webkit.org/changeset/238838
     13
    1142018-12-04  Ryan Haddad  <ryanhaddad@apple.com>
    215
  • trunk/Source/WebCore/rendering/TextDecorationPainter.cpp

    r238838 r238860  
    297297            float wavyOffset = m_styles.overlineStyle == TextDecorationStyle::Wavy ? m_wavyOffset : 0;
    298298            FloatRect rect(localOrigin, FloatSize(m_width, textDecorationThickness));
    299             float autoTextDecorationThickness = TextDecorationThickness::createWithAuto().resolve(m_lineStyle.computedFontSize(), fontMetrics);
    300             rect.move(0, autoTextDecorationThickness - textDecorationThickness - wavyOffset);
     299            rect.move(0, -wavyOffset);
    301300            paintDecoration(TextDecoration::Overline, m_styles.overlineStyle, m_styles.overlineColor, rect);
    302301        }
    303302        if (m_decorations.contains(TextDecoration::LineThrough)) {
    304303            FloatRect rect(localOrigin, FloatSize(m_width, textDecorationThickness));
    305             float autoTextDecorationThickness = TextDecorationThickness::createWithAuto().resolve(m_lineStyle.computedFontSize(), fontMetrics);
    306             auto center = 2 * fontMetrics.floatAscent() / 3 + autoTextDecorationThickness / 2;
    307             rect.move(0, center - textDecorationThickness / 2);
     304            rect.move(0, 2 * fontMetrics.floatAscent() / 3);
    308305            paintDecoration(TextDecoration::LineThrough, m_styles.linethroughStyle, m_styles.linethroughColor, rect);
    309306        }
  • trunk/Source/WebCore/style/InlineTextBoxStyle.cpp

    r238838 r238860  
    126126
    127127    // These metrics must match where underlines get drawn.
    128     // FIXME: Share the code in TextDecorationPainter::paintTextDecoration() so we can just query it for the painted geometry.
    129128    if (decoration & TextDecoration::Underline) {
    130129        // Compensate for the integral ceiling in GraphicsContext::computeLineBoundsAndAntialiasingModeForText()
     
    142141    }
    143142    if (decoration & TextDecoration::Overline) {
    144         FloatRect rect(FloatPoint(), FloatSize(1, strokeThickness));
    145         float autoTextDecorationThickness = TextDecorationThickness::createWithAuto().resolve(lineStyle.computedFontSize(), lineStyle.fontMetrics());
    146         rect.move(0, autoTextDecorationThickness - strokeThickness - wavyOffset);
    147143        if (decorationStyle == TextDecorationStyle::Wavy) {
    148             FloatBoxExtent wavyExpansion;
    149             wavyExpansion.setTop(wavyStrokeParameters.controlPointDistance);
    150             wavyExpansion.setBottom(wavyStrokeParameters.controlPointDistance);
    151             rect.expand(wavyExpansion);
     144            extendIntToFloat(overflowResult.bottom, -wavyOffset + wavyStrokeParameters.controlPointDistance + strokeThickness - height);
     145            extendIntToFloat(overflowResult.top, wavyOffset + wavyStrokeParameters.controlPointDistance + strokeThickness);
     146        } else {
     147            extendIntToFloat(overflowResult.bottom, strokeThickness - height);
     148            // top is untouched
    152149        }
    153         extendIntToFloat(overflowResult.top, -rect.y());
    154         extendIntToFloat(overflowResult.bottom, rect.maxY() - height);
    155150    }
    156151    if (decoration & TextDecoration::LineThrough) {
    157         FloatRect rect(FloatPoint(), FloatSize(1, strokeThickness));
    158         float autoTextDecorationThickness = TextDecorationThickness::createWithAuto().resolve(lineStyle.computedFontSize(), lineStyle.fontMetrics());
    159         auto center = 2 * lineStyle.fontMetrics().floatAscent() / 3 + autoTextDecorationThickness / 2;
    160         rect.move(0, center - strokeThickness / 2);
     152        float baseline = lineStyle.fontMetrics().floatAscent();
    161153        if (decorationStyle == TextDecorationStyle::Wavy) {
    162             FloatBoxExtent wavyExpansion;
    163             wavyExpansion.setTop(wavyStrokeParameters.controlPointDistance);
    164             wavyExpansion.setBottom(wavyStrokeParameters.controlPointDistance);
    165             rect.expand(wavyExpansion);
     154            extendIntToFloat(overflowResult.bottom, 2 * baseline / 3 + wavyStrokeParameters.controlPointDistance + strokeThickness - height);
     155            extendIntToFloat(overflowResult.top, -(2 * baseline / 3 - wavyStrokeParameters.controlPointDistance - strokeThickness));
     156        } else {
     157            extendIntToFloat(overflowResult.bottom, 2 * baseline / 3 + strokeThickness - height);
     158            extendIntToFloat(overflowResult.top, -(2 * baseline / 3));
    166159        }
    167         extendIntToFloat(overflowResult.top, -rect.y());
    168         extendIntToFloat(overflowResult.bottom, rect.maxY() - height);
    169160    }
    170161    return overflowResult;
Note: See TracChangeset for help on using the changeset viewer.