Changeset 166322 in webkit


Ignore:
Timestamp:
Mar 26, 2014 3:05:24 PM (10 years ago)
Author:
mmaxfield@apple.com
Message:

Skipping underlines disregard points completely inside the underline rect
https://bugs.webkit.org/show_bug.cgi?id=130800

Patch by Myles C. Maxfield <mmaxfield@apple.com> on 2014-03-26
Reviewed by Dean Jackson.

Source/WebCore:

When determining bounds for underline skipping, endpoints of glyph contours
that lie entirely within the rect of the underline are ignored. This patch
makes these points affect the skipping regions the same way that intersections
do.

Test: fast/css3-text/css3-text-decoration/text-decoration-skip/glyph-inside-underline.html

  • platform/graphics/mac/FontMac.mm:

(WebCore::updateX): Refactored common code into a function
(WebCore::findPathIntersections): Test for endpoints which lie entirely within
the underline bounds

LayoutTests:

This test draws a glyph entire inside the underline. It should render the same
as it would without any underline at all.

  • fast/css3-text/css3-text-decoration/text-decoration-skip/resources/Litherum.svg: Added

an underscore glyph that would lie entirely within an underline

  • fast/css3-text/css3-text-decoration/text-decoration-skip/glyph-inside-underline.html:
Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r166309 r166322  
     12014-03-26  Myles C. Maxfield  <mmaxfield@apple.com>
     2
     3        Skipping underlines disregard points completely inside the underline rect
     4        https://bugs.webkit.org/show_bug.cgi?id=130800
     5
     6        Reviewed by Dean Jackson.
     7
     8        This test draws a glyph entire inside the underline. It should render the same
     9        as it would without any underline at all.
     10
     11        * fast/css3-text/css3-text-decoration/text-decoration-skip/resources/Litherum.svg: Added
     12        an underscore glyph that would lie entirely within an underline
     13        * fast/css3-text/css3-text-decoration/text-decoration-skip/glyph-inside-underline.html:
     14
    1152014-03-26  Simon Fraser  <simon.fraser@apple.com>
    216
  • trunk/LayoutTests/fast/css3-text/css3-text-decoration/text-decoration-skip/resources/Litherum.svg

    r164842 r166322  
    55<defs>
    66<font id="Litherum" horiz-adv-x="1024">
    7 <font-face units-per-em="14" ascent="14" descent="-7"/>
    8 <glyph unicode="|" horiz-adv-x="14" d="M5 -7v21h4v-21z"/>
     7<font-face units-per-em="56" ascent="56" descent="-28"/>
     8<glyph unicode="|" horiz-adv-x="56" d="M20 -28v84h16v-84z"/>
     9<glyph unicode="_" horiz-adv-x="56" d="M1 -5v1h54v-1z"/>
    910</font>
    1011</defs>
  • trunk/Source/WebCore/ChangeLog

    r166319 r166322  
     12014-03-26  Myles C. Maxfield  <mmaxfield@apple.com>
     2
     3        Skipping underlines disregard points completely inside the underline rect
     4        https://bugs.webkit.org/show_bug.cgi?id=130800
     5
     6        Reviewed by Dean Jackson.
     7
     8        When determining bounds for underline skipping, endpoints of glyph contours
     9        that lie entirely within the rect of the underline are ignored. This patch
     10        makes these points affect the skipping regions the same way that intersections
     11        do.
     12
     13        Test: fast/css3-text/css3-text-decoration/text-decoration-skip/glyph-inside-underline.html
     14
     15        * platform/graphics/mac/FontMac.mm:
     16        (WebCore::updateX): Refactored common code into a function
     17        (WebCore::findPathIntersections): Test for endpoints which lie entirely within
     18        the underline bounds
     19
    1202014-03-26  Pratik Solanki  <psolanki@apple.com>
    221
  • trunk/Source/WebCore/platform/graphics/mac/FontMac.mm

    r164842 r166322  
    389389}
    390390
     391static void updateX(GlyphIterationState& state, CGFloat x)
     392{
     393    state.minX = std::min(state.minX, x);
     394    state.maxX = std::max(state.maxX, x);
     395}
     396
    391397// This function is called by CGPathApply and is therefore invoked for each
    392398// contour in a glyph. This function models each contours as a straight line
     
    426432        return;
    427433    CGFloat x;
    428     if (findIntersectionPoint(state.y1, state.currentPoint, point, x)) {
    429         state.minX = std::min(state.minX, x);
    430         state.maxX = std::max(state.maxX, x);
    431     }
    432     if (findIntersectionPoint(state.y2, state.currentPoint, point, x)) {
    433         state.minX = std::min(state.minX, x);
    434         state.maxX = std::max(state.maxX, x);
    435     }
     434    if (findIntersectionPoint(state.y1, state.currentPoint, point, x))
     435        updateX(state, x);
     436    if (findIntersectionPoint(state.y2, state.currentPoint, point, x))
     437        updateX(state, x);
     438    if ((state.currentPoint.y >= state.y1 && state.currentPoint.y <= state.y2)
     439        || (state.currentPoint.y <= state.y1 && state.currentPoint.y >= state.y2))
     440        updateX(state, state.currentPoint.x);
    436441    state.currentPoint = point;
    437442}
Note: See TracChangeset for help on using the changeset viewer.