Changeset 194418 in webkit


Ignore:
Timestamp:
Dec 24, 2015 11:25:29 PM (8 years ago)
Author:
Alan Bujtas
Message:

ASSERTION FAILED: x2 >= x1 in WebCore::RenderElement::drawLineForBoxSide
https://bugs.webkit.org/show_bug.cgi?id=151210

Reviewed by Simon Fraser.

Source/WebCore:

"IntRect outer = snappedIntRect(inner)" explicitly converts inner to LayoutRect first and
returns a snapped IntRect. When inner (after the inflate) overflows LayoutUnit,
the snapped rect might become smaller than the inner rect.

This patch also enables outline painting on subpixel positions.

Tests: fast/borders/hidpi-outline-on-subpixel-position.html

fast/borders/outline-offset-overflow.html

  • rendering/RenderElement.cpp:

(WebCore::RenderElement::paintOutline):

LayoutTests:

"IntRect outer = snappedIntRect(inner)" explicitly converts inner to LayoutRect and
returns a snapped IntRect. When inner (after the inflate) overflows LayoutUnit,
the snapped outer rect becomes smaller than the inner rect.

This patch also enables outline painting on subpixel positions.

  • fast/borders/hidpi-outline-on-subpixel-position-expected.html: Added.
  • fast/borders/hidpi-outline-on-subpixel-position.html: Added.
  • fast/borders/outline-offset-overflow-expected.txt: Added.
  • fast/borders/outline-offset-overflow.html: Added.
Location:
trunk
Files:
4 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r194414 r194418  
     12015-12-24  Zalan Bujtas  <zalan@apple.com>
     2
     3        ASSERTION FAILED: x2 >= x1 in WebCore::RenderElement::drawLineForBoxSide
     4        https://bugs.webkit.org/show_bug.cgi?id=151210
     5
     6        Reviewed by Simon Fraser.
     7
     8        "IntRect outer = snappedIntRect(inner)" explicitly converts inner to LayoutRect and
     9        returns a snapped IntRect. When inner (after the inflate) overflows LayoutUnit,
     10        the snapped outer rect becomes smaller than the inner rect.
     11
     12        This patch also enables outline painting on subpixel positions.
     13
     14        * fast/borders/hidpi-outline-on-subpixel-position-expected.html: Added.
     15        * fast/borders/hidpi-outline-on-subpixel-position.html: Added.
     16        * fast/borders/outline-offset-overflow-expected.txt: Added.
     17        * fast/borders/outline-offset-overflow.html: Added.
     18
    1192015-12-23  Brady Eidson  <beidson@apple.com>
    220
  • trunk/Source/WebCore/ChangeLog

    r194417 r194418  
     12015-12-24  Zalan Bujtas  <zalan@apple.com>
     2
     3        ASSERTION FAILED: x2 >= x1 in WebCore::RenderElement::drawLineForBoxSide
     4        https://bugs.webkit.org/show_bug.cgi?id=151210
     5
     6        Reviewed by Simon Fraser.
     7
     8        "IntRect outer = snappedIntRect(inner)" explicitly converts inner to LayoutRect first and
     9        returns a snapped IntRect. When inner (after the inflate) overflows LayoutUnit,
     10        the snapped rect might become smaller than the inner rect.
     11
     12        This patch also enables outline painting on subpixel positions.
     13
     14        Tests: fast/borders/hidpi-outline-on-subpixel-position.html
     15               fast/borders/outline-offset-overflow.html
     16
     17        * rendering/RenderElement.cpp:
     18        (WebCore::RenderElement::paintOutline):
     19
    1202015-12-24  Simon Fraser  <simon.fraser@apple.com>
    221
  • trunk/Source/WebCore/rendering/RenderElement.cpp

    r194417 r194418  
    21222122        return;
    21232123
    2124     IntRect inner = snappedIntRect(paintRect);
    2125     inner.inflate(outlineOffset);
    2126 
    2127     IntRect outer = snappedIntRect(inner);
    2128     outer.inflate(outlineWidth);
     2124    FloatRect outer = paintRect;
     2125    outer.inflate(outlineOffset + outlineWidth);
     2126    FloatRect inner = outer;
     2127    inner.inflate(-outlineWidth);
    21292128
    21302129    // FIXME: This prevents outlines from painting inside the object. See bug 12042
     
    21502149    }
    21512150
    2152     int leftOuter = outer.x();
    2153     int leftInner = inner.x();
    2154     int rightOuter = outer.maxX();
    2155     int rightInner = inner.maxX();
    2156     int topOuter = outer.y();
    2157     int topInner = inner.y();
    2158     int bottomOuter = outer.maxY();
    2159     int bottomInner = inner.maxY();
     2151    float leftOuter = outer.x();
     2152    float leftInner = inner.x();
     2153    float rightOuter = outer.maxX();
     2154    float rightInner = std::min(inner.maxX(), rightOuter);
     2155    float topOuter = outer.y();
     2156    float topInner = inner.y();
     2157    float bottomOuter = outer.maxY();
     2158    float bottomInner = std::min(inner.maxY(), bottomOuter);
    21602159
    21612160    drawLineForBoxSide(graphicsContext, FloatRect(FloatPoint(leftOuter, topOuter), FloatPoint(leftInner, bottomOuter)), BSLeft, outlineColor, outlineStyle, outlineWidth, outlineWidth);
Note: See TracChangeset for help on using the changeset viewer.