Changeset 249507 in webkit


Ignore:
Timestamp:
Sep 4, 2019 6:02:17 PM (5 years ago)
Author:
timothy_horton@apple.com
Message:

Line artifacts in note body after viewing note with <attachment>s
https://bugs.webkit.org/show_bug.cgi?id=201474
<rdar://problem/51306108>

Reviewed by Simon Fraser.

Source/WebCore:

Test: fast/attachment/attachment-border-should-stay-inside-attachment.html

  • rendering/RenderThemeIOS.mm:

(WebCore::attachmentBorderPath):
(WebCore::paintAttachmentBorder):
Inset the border rect by half the width, so that <attachment> doesn't
paint out-of-bounds.

LayoutTests:

  • fast/attachment/attachment-border-should-stay-inside-attachment-expected.html: Added.
  • fast/attachment/attachment-border-should-stay-inside-attachment.html: Added.

Add a test that ensures that <attachment> stays inside its bounds.

Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r249504 r249507  
     12019-09-04  Tim Horton  <timothy_horton@apple.com>
     2
     3        Line artifacts in note body after viewing note with <attachment>s
     4        https://bugs.webkit.org/show_bug.cgi?id=201474
     5        <rdar://problem/51306108>
     6
     7        Reviewed by Simon Fraser.
     8
     9        * fast/attachment/attachment-border-should-stay-inside-attachment-expected.html: Added.
     10        * fast/attachment/attachment-border-should-stay-inside-attachment.html: Added.
     11        Add a test that ensures that <attachment> stays inside its bounds.
     12
    1132019-09-04  Joseph Pecoraro  <pecoraro@apple.com>
    214
  • trunk/Source/WebCore/ChangeLog

    r249504 r249507  
     12019-09-04  Tim Horton  <timothy_horton@apple.com>
     2
     3        Line artifacts in note body after viewing note with <attachment>s
     4        https://bugs.webkit.org/show_bug.cgi?id=201474
     5        <rdar://problem/51306108>
     6
     7        Reviewed by Simon Fraser.
     8
     9        Test: fast/attachment/attachment-border-should-stay-inside-attachment.html
     10
     11        * rendering/RenderThemeIOS.mm:
     12        (WebCore::attachmentBorderPath):
     13        (WebCore::paintAttachmentBorder):
     14        Inset the border rect by half the width, so that <attachment> doesn't
     15        paint out-of-bounds.
     16
    1172019-09-04  Joseph Pecoraro  <pecoraro@apple.com>
    218
  • trunk/Source/WebCore/rendering/RenderThemeIOS.mm

    r248648 r249507  
    15301530const CGFloat attachmentBorderRadius = 16;
    15311531static Color attachmentBorderColor() { return Color(204, 204, 204); }
     1532static CGFloat attachmentBorderThickness = 1;
    15321533
    15331534static Color attachmentProgressColor() { return Color(222, 222, 222); }
     
    18401841static Path attachmentBorderPath(RenderAttachmentInfo& info)
    18411842{
     1843    auto insetAttachmentRect = info.attachmentRect;
     1844    insetAttachmentRect.inflate(-attachmentBorderThickness / 2);
     1845
    18421846    Path borderPath;
    1843     borderPath.addRoundedRect(info.attachmentRect, FloatSize(attachmentBorderRadius, attachmentBorderRadius));
     1847    borderPath.addRoundedRect(insetAttachmentRect, FloatSize(attachmentBorderRadius, attachmentBorderRadius));
    18441848    return borderPath;
    18451849}
     
    18481852{
    18491853    context.setStrokeColor(attachmentBorderColor());
    1850     context.setStrokeThickness(1);
     1854    context.setStrokeThickness(attachmentBorderThickness);
    18511855    context.strokePath(borderPath);
    18521856}
Note: See TracChangeset for help on using the changeset viewer.