Title: [249986] branches/safari-608-branch
Revision
249986
Author
[email protected]
Date
2019-09-17 15:29:07 -0700 (Tue, 17 Sep 2019)

Log Message

Cherry-pick r249507. rdar://problem/55427491

    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.

    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@249507 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Modified Paths

Added Paths

Diff

Modified: branches/safari-608-branch/LayoutTests/ChangeLog (249985 => 249986)


--- branches/safari-608-branch/LayoutTests/ChangeLog	2019-09-17 21:57:07 UTC (rev 249985)
+++ branches/safari-608-branch/LayoutTests/ChangeLog	2019-09-17 22:29:07 UTC (rev 249986)
@@ -1,3 +1,44 @@
+2019-09-17  Kocsen Chung  <[email protected]>
+
+        Cherry-pick r249507. rdar://problem/55427491
+
+    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.
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@249507 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2019-09-04  Tim Horton  <[email protected]>
+
+            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.
+
+            * 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.
+
 2019-09-09  Ryosuke Niwa  <[email protected]>
 
         REGRESSION (iOS 13): Bulleted list copied from Notes to Mail results in Times New Roman

Added: branches/safari-608-branch/LayoutTests/fast/attachment/attachment-border-should-stay-inside-attachment-expected.html ( => )


Added: branches/safari-608-branch/LayoutTests/fast/attachment/attachment-border-should-stay-inside-attachment.html
===================================================================
--- branches/safari-608-branch/LayoutTests/fast/attachment/attachment-border-should-stay-inside-attachment.html	                        (rev 0)
+++ branches/safari-608-branch/LayoutTests/fast/attachment/attachment-border-should-stay-inside-attachment.html	2019-09-17 22:29:07 UTC (rev 249986)
@@ -0,0 +1,58 @@
+<!DOCTYPE html><!-- webkit-test-runner [ enableAttachmentElement=true ] -->
+<html>
+<style>
+    attachment {
+        position: absolute;
+    }
+    div {
+        background-color: white;
+        width: 200px;
+        height: 200px;
+        position: absolute;
+    }
+</style>
+<body>
+<attachment style="top: 0px; left: 0px;"></attachment>
+<div style="top: 0px; left: 0px;"></div>
+<attachment style="top: 1px; left: 1px;"></attachment>
+<div style="top: 1px; left: 1px;"></div>
+<attachment style="top: 2px; left: 2px;"></attachment>
+<div style="top: 2px; left: 2px;"></div>
+<attachment style="top: 3px; left: 3px;"></attachment>
+<div style="top: 3px; left: 3px;"></div>
+<attachment style="top: 4px; left: 4px;"></attachment>
+<div style="top: 4px; left: 4px;"></div>
+<attachment style="top: 5px; left: 5px;"></attachment>
+<div style="top: 5px; left: 5px;"></div>
+<attachment style="top: 6px; left: 6px;"></attachment>
+<div style="top: 6px; left: 6px;"></div>
+<attachment style="top: 7px; left: 7px;"></attachment>
+<div style="top: 7px; left: 7px;"></div>
+<attachment style="top: 8px; left: 8px;"></attachment>
+<div style="top: 8px; left: 8px;"></div>
+<attachment style="top: 9px; left: 9px;"></attachment>
+<div style="top: 9px; left: 9px;"></div>
+<attachment style="top: 10px; left: 10px;"></attachment>
+<div style="top: 10px; left: 10px;"></div>
+<attachment style="top: 11px; left: 11px;"></attachment>
+<div style="top: 11px; left: 11px;"></div>
+<attachment style="top: 12px; left: 12px;"></attachment>
+<div style="top: 12px; left: 12px;"></div>
+<attachment style="top: 13px; left: 13px;"></attachment>
+<div style="top: 13px; left: 13px;"></div>
+<attachment style="top: 14px; left: 14px;"></attachment>
+<div style="top: 14px; left: 14px;"></div>
+<attachment style="top: 15px; left: 15px;"></attachment>
+<div style="top: 15px; left: 15px;"></div>
+<attachment style="top: 16px; left: 16px;"></attachment>
+<div style="top: 16px; left: 16px;"></div>
+<attachment style="top: 17px; left: 17px;"></attachment>
+<div style="top: 17px; left: 17px;"></div>
+<attachment style="top: 18px; left: 18px;"></attachment>
+<div style="top: 18px; left: 18px;"></div>
+<attachment style="top: 19px; left: 19px;"></attachment>
+<div style="top: 19px; left: 19px;"></div>
+<attachment style="top: 20px; left: 20px;"></attachment>
+<div style="top: 20px; left: 20px;"></div>
+</body>
+</html>

Modified: branches/safari-608-branch/Source/WebCore/ChangeLog (249985 => 249986)


--- branches/safari-608-branch/Source/WebCore/ChangeLog	2019-09-17 21:57:07 UTC (rev 249985)
+++ branches/safari-608-branch/Source/WebCore/ChangeLog	2019-09-17 22:29:07 UTC (rev 249986)
@@ -1,5 +1,50 @@
 2019-09-17  Kocsen Chung  <[email protected]>
 
+        Cherry-pick r249507. rdar://problem/55427491
+
+    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.
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@249507 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2019-09-04  Tim Horton  <[email protected]>
+
+            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.
+
+            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.
+
+2019-09-17  Kocsen Chung  <[email protected]>
+
         Cherry-pick r249854. rdar://problem/55427477
 
     Crash under WebCore::firstPositionInNode()

Modified: branches/safari-608-branch/Source/WebCore/rendering/RenderThemeIOS.mm (249985 => 249986)


--- branches/safari-608-branch/Source/WebCore/rendering/RenderThemeIOS.mm	2019-09-17 21:57:07 UTC (rev 249985)
+++ branches/safari-608-branch/Source/WebCore/rendering/RenderThemeIOS.mm	2019-09-17 22:29:07 UTC (rev 249986)
@@ -1529,6 +1529,7 @@
 
 const CGFloat attachmentBorderRadius = 16;
 static Color attachmentBorderColor() { return Color(204, 204, 204); }
+static CGFloat attachmentBorderThickness = 1;
 
 static Color attachmentProgressColor() { return Color(222, 222, 222); }
 const CGFloat attachmentProgressBorderThickness = 3;
@@ -1839,8 +1840,11 @@
 
 static Path attachmentBorderPath(RenderAttachmentInfo& info)
 {
+    auto insetAttachmentRect = info.attachmentRect;
+    insetAttachmentRect.inflate(-attachmentBorderThickness / 2);
+
     Path borderPath;
-    borderPath.addRoundedRect(info.attachmentRect, FloatSize(attachmentBorderRadius, attachmentBorderRadius));
+    borderPath.addRoundedRect(insetAttachmentRect, FloatSize(attachmentBorderRadius, attachmentBorderRadius));
     return borderPath;
 }
 
@@ -1847,7 +1851,7 @@
 static void paintAttachmentBorder(GraphicsContext& context, Path& borderPath)
 {
     context.setStrokeColor(attachmentBorderColor());
-    context.setStrokeThickness(1);
+    context.setStrokeThickness(attachmentBorderThickness);
     context.strokePath(borderPath);
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to