Changeset 205519 in webkit


Ignore:
Timestamp:
Sep 6, 2016 4:12:15 PM (8 years ago)
Author:
mmaxfield@apple.com
Message:

Strikethrough positions are erroneously snapped twice
https://bugs.webkit.org/show_bug.cgi?id=161647
<rdar://problem/11542470>

Reviewed by Zalan Bujtas.

Source/WebCore:

Because we're using an int for the position of the baseline, the math to calculate the
strikethrough position is snapped. Then, we snap it again inside GraphicsContext.

Test: fast/text/strikethrough-int.html

  • rendering/InlineTextBox.cpp:

(WebCore::InlineTextBox::paintDecoration):

  • rendering/TextDecorationPainter.h:

(WebCore::TextDecorationPainter::setBaseline):

LayoutTests:

  • fast/css3-text/css3-text-decoration/text-decoration-line-through-mispositioned-expected.html: Updated.
  • fast/text/strikethrough-int-expected-mismatch.html: Added.
  • fast/text/strikethrough-int.html: Added.
Location:
trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r205515 r205519  
     12016-09-06  Myles C. Maxfield  <mmaxfield@apple.com>
     2
     3        Strikethrough positions are erroneously snapped twice
     4        https://bugs.webkit.org/show_bug.cgi?id=161647
     5        <rdar://problem/11542470>
     6
     7        Reviewed by Zalan Bujtas.
     8
     9        * fast/css3-text/css3-text-decoration/text-decoration-line-through-mispositioned-expected.html: Updated.
     10        * fast/text/strikethrough-int-expected-mismatch.html: Added.
     11        * fast/text/strikethrough-int.html: Added.
     12
    1132016-09-06  Chris Dumez  <cdumez@apple.com>
    214
  • trunk/LayoutTests/fast/css3-text/css3-text-decoration/text-decoration-line-through-mispositioned-expected.html

    r194465 r205519  
    88    position: absolute;
    99    left: 20px;
    10     top: 33px;
     10    top: 34px;
    1111    width: 120px;
    1212    height: 1px;
  • trunk/Source/WebCore/ChangeLog

    r205516 r205519  
     12016-09-06  Myles C. Maxfield  <mmaxfield@apple.com>
     2
     3        Strikethrough positions are erroneously snapped twice
     4        https://bugs.webkit.org/show_bug.cgi?id=161647
     5        <rdar://problem/11542470>
     6
     7        Reviewed by Zalan Bujtas.
     8
     9        Because we're using an int for the position of the baseline, the math to calculate the
     10        strikethrough position is snapped. Then, we snap it again inside GraphicsContext.
     11
     12        Test: fast/text/strikethrough-int.html
     13
     14        * rendering/InlineTextBox.cpp:
     15        (WebCore::InlineTextBox::paintDecoration):
     16        * rendering/TextDecorationPainter.h:
     17        (WebCore::TextDecorationPainter::setBaseline):
     18
    1192016-09-06  David Kilzer  <ddkilzer@apple.com>
    220
  • trunk/Source/WebCore/rendering/InlineTextBox.cpp

    r204531 r205519  
    716716        mirrorRTLSegment(m_logicalWidth, direction(), start, width);
    717717    }
    718    
    719     int baseline = lineStyle().fontMetrics().ascent();
     718
    720719    TextDecorationPainter decorationPainter(context, decoration, renderer(), isFirstLine());
    721720    decorationPainter.setInlineTextBox(this);
    722721    decorationPainter.setFont(font);
    723722    decorationPainter.setWidth(width);
    724     decorationPainter.setBaseline(baseline);
     723    decorationPainter.setBaseline(lineStyle().fontMetrics().ascent());
    725724    decorationPainter.setIsHorizontal(isHorizontal());
    726725    decorationPainter.addTextShadow(shadow);
  • trunk/Source/WebCore/rendering/TextDecorationPainter.h

    r194447 r205519  
    4646    void setIsHorizontal(bool isHorizontal) { m_isHorizontal = isHorizontal; }
    4747    void setWidth(float width) { m_width = width; }
    48     void setBaseline(int baseline) { m_baseline = baseline; }
     48    void setBaseline(float baseline) { m_baseline = baseline; }
    4949    void addTextShadow(const ShadowData* textShadow) { m_shadow = textShadow; }
    5050
     
    5757    bool m_isPrinting { false };
    5858    float m_width { 0 };
    59     int m_baseline { 0 };
     59    float m_baseline { 0 };
    6060    FloatPoint m_boxOrigin;
    6161    bool m_isHorizontal { true };
Note: See TracChangeset for help on using the changeset viewer.