<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[181114] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/181114">181114</a></dd>
<dt>Author</dt> <dd>timothy_horton@apple.com</dd>
<dt>Date</dt> <dd>2015-03-05 16:34:25 -0800 (Thu, 05 Mar 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>&lt;attachment&gt; should support indication of download progress
https://bugs.webkit.org/show_bug.cgi?id=142336
&lt;rdar://problem/19982504&gt;

Reviewed by Anders Carlsson.

* html/HTMLAttachmentElement.cpp:
(WebCore::HTMLAttachmentElement::parseAttribute):
Invalidate the attachment if the progress attribute changes.

* platform/graphics/FloatRoundedRect.h:
(WebCore::FloatRoundedRect::Radii::Radii):
Add a Radii constructor that takes a single argument that is used
as the radius for all corners, for convenience.

* rendering/RenderThemeMac.mm:
(WebCore::attachmentProgressBarBackgroundColor):
(WebCore::attachmentProgressBarFillColor):
(WebCore::attachmentProgressBarBorderColor):
Add a bunch of constants for the progress bar.

(WebCore::paintAttachmentIconBackground):
Make use of fillRoundedRect instead of creating a path.

(WebCore::paintAttachmentProgress):
(WebCore::RenderThemeMac::paintAttachment):
Paint a progress bar if the progress attribute exists and
is a valid floating point number.

* fast/attachment/attachment-progress.html: Added.
* platform/mac/fast/attachment/attachment-progress-expected.png: Added.
* platform/mac/fast/attachment/attachment-progress-expected.txt: Added.
* platform/mac-mavericks/fast/attachment/attachment-progress-expected.txt: Added.
Add a test for the &lt;attachment&gt; progress attribute.

* platform/mac/fast/attachment/attachment-rendering-expected.png:
Rebaseline a test that changed in <a href="http://trac.webkit.org/projects/webkit/changeset/181058">r181058</a> (and will change again!), but
which didn't start failing because the pixel test tolerance is such that
it only fails the hash check and not the test itself.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsplatformmacfastattachmentattachmentrenderingexpectedpng">trunk/LayoutTests/platform/mac/fast/attachment/attachment-rendering-expected.png</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLAttachmentElementcpp">trunk/Source/WebCore/html/HTMLAttachmentElement.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsFloatRoundedRecth">trunk/Source/WebCore/platform/graphics/FloatRoundedRect.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderThemeMacmm">trunk/Source/WebCore/rendering/RenderThemeMac.mm</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastattachmentattachmentprogresshtml">trunk/LayoutTests/fast/attachment/attachment-progress.html</a></li>
<li><a href="#trunkLayoutTestsplatformmacfastattachmentattachmentprogressexpectedpng">trunk/LayoutTests/platform/mac/fast/attachment/attachment-progress-expected.png</a></li>
<li><a href="#trunkLayoutTestsplatformmacfastattachmentattachmentprogressexpectedtxt">trunk/LayoutTests/platform/mac/fast/attachment/attachment-progress-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformmacmavericksfastattachmentattachmentprogressexpectedtxt">trunk/LayoutTests/platform/mac-mavericks/fast/attachment/attachment-progress-expected.txt</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (181113 => 181114)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-03-06 00:29:24 UTC (rev 181113)
+++ trunk/LayoutTests/ChangeLog        2015-03-06 00:34:25 UTC (rev 181114)
</span><span class="lines">@@ -1,3 +1,22 @@
</span><ins>+2015-03-05  Timothy Horton  &lt;timothy_horton@apple.com&gt;
+
+        &lt;attachment&gt; should support indication of download progress
+        https://bugs.webkit.org/show_bug.cgi?id=142336
+        &lt;rdar://problem/19982504&gt;
+
+        Reviewed by Anders Carlsson.
+
+        * fast/attachment/attachment-progress.html: Added.
+        * platform/mac/fast/attachment/attachment-progress-expected.png: Added.
+        * platform/mac/fast/attachment/attachment-progress-expected.txt: Added.
+        * platform/mac-mavericks/fast/attachment/attachment-progress-expected.txt: Added.
+        Add a test for the &lt;attachment&gt; progress attribute.
+
+        * platform/mac/fast/attachment/attachment-rendering-expected.png:
+        Rebaseline a test that changed in r181058 (and will change again!), but
+        which didn't start failing because the pixel test tolerance is such that
+        it only fails the hash check and not the test itself.
+
</ins><span class="cx"> 2015-03-05  Benjamin Poulain  &lt;bpoulain@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Add basic support for character sets to the URL Filter parser
</span></span></pre></div>
<a id="trunkLayoutTestsfastattachmentattachmentprogresshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/attachment/attachment-progress.html (0 => 181114)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/attachment/attachment-progress.html                                (rev 0)
+++ trunk/LayoutTests/fast/attachment/attachment-progress.html        2015-03-06 00:34:25 UTC (rev 181114)
</span><span class="lines">@@ -0,0 +1,22 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;body&gt;
+&lt;attachment progress=&quot;-1.5&quot;&gt;&lt;/attachment&gt;
+&lt;attachment progress=&quot;0&quot;&gt;&lt;/attachment&gt;
+&lt;attachment progress=&quot;0.2&quot;&gt;&lt;/attachment&gt;
+&lt;attachment progress=&quot;0.4&quot;&gt;&lt;/attachment&gt;
+&lt;attachment progress=&quot;0.6&quot;&gt;&lt;/attachment&gt;
+&lt;attachment progress=&quot;0.8&quot;&gt;&lt;/attachment&gt;
+&lt;attachment progress=&quot;1&quot;&gt;&lt;/attachment&gt;
+&lt;attachment progress=&quot;1.5&quot;&gt;&lt;/attachment&gt;
+&lt;script&gt;
+var file;
+if (window.internals)
+    file = window.internals.createFile(&quot;resources/test-file.txt&quot;);
+
+var attachments = document.getElementsByTagName(&quot;attachment&quot;);
+for (var i = 0; i &lt; attachments.length; i++)
+    attachments[i].file = file;
+&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformmacfastattachmentattachmentprogressexpectedpng"></a>
<div class="binary"><h4>Added: trunk/LayoutTests/platform/mac/fast/attachment/attachment-progress-expected.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Property changes on: trunk/LayoutTests/platform/mac/fast/attachment/attachment-progress-expected.png
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="trunkLayoutTestsplatformmacfastattachmentattachmentprogressexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/platform/mac/fast/attachment/attachment-progress-expected.txt (0 => 181114)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/fast/attachment/attachment-progress-expected.txt                                (rev 0)
+++ trunk/LayoutTests/platform/mac/fast/attachment/attachment-progress-expected.txt        2015-03-06 00:34:25 UTC (rev 181114)
</span><span class="lines">@@ -0,0 +1,29 @@
</span><ins>+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x93
+  RenderBlock {HTML} at (0,0) size 800x93
+    RenderBody {BODY} at (8,8) size 784x77
+      RenderAttachment {ATTACHMENT} at (0,0) size 74x77
+      RenderText {#text} at (74,54) size 4x18
+        text run at (74,54) width 4: &quot; &quot;
+      RenderAttachment {ATTACHMENT} at (78,0) size 74x77
+      RenderText {#text} at (152,54) size 4x18
+        text run at (152,54) width 4: &quot; &quot;
+      RenderAttachment {ATTACHMENT} at (156,0) size 74x77
+      RenderText {#text} at (230,54) size 4x18
+        text run at (230,54) width 4: &quot; &quot;
+      RenderAttachment {ATTACHMENT} at (234,0) size 74x77
+      RenderText {#text} at (308,54) size 4x18
+        text run at (308,54) width 4: &quot; &quot;
+      RenderAttachment {ATTACHMENT} at (312,0) size 74x77
+      RenderText {#text} at (386,54) size 4x18
+        text run at (386,54) width 4: &quot; &quot;
+      RenderAttachment {ATTACHMENT} at (390,0) size 74x77
+      RenderText {#text} at (464,54) size 4x18
+        text run at (464,54) width 4: &quot; &quot;
+      RenderAttachment {ATTACHMENT} at (468,0) size 74x77
+      RenderText {#text} at (542,54) size 4x18
+        text run at (542,54) width 4: &quot; &quot;
+      RenderAttachment {ATTACHMENT} at (546,0) size 74x77
+      RenderText {#text} at (0,0) size 0x0
+      RenderText {#text} at (0,0) size 0x0
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformmacfastattachmentattachmentrenderingexpectedpng"></a>
<div class="binary"><h4>Modified: trunk/LayoutTests/platform/mac/fast/attachment/attachment-rendering-expected.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacmavericksfastattachmentattachmentprogressexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/platform/mac-mavericks/fast/attachment/attachment-progress-expected.txt (0 => 181114)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac-mavericks/fast/attachment/attachment-progress-expected.txt                                (rev 0)
+++ trunk/LayoutTests/platform/mac-mavericks/fast/attachment/attachment-progress-expected.txt        2015-03-06 00:34:25 UTC (rev 181114)
</span><span class="lines">@@ -0,0 +1,29 @@
</span><ins>+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x93
+  RenderBlock {HTML} at (0,0) size 800x93
+    RenderBody {BODY} at (8,8) size 784x77
+      RenderAttachment {ATTACHMENT} at (0,0) size 78x77
+      RenderText {#text} at (78,54) size 4x18
+        text run at (78,54) width 4: &quot; &quot;
+      RenderAttachment {ATTACHMENT} at (82,0) size 78x77
+      RenderText {#text} at (160,54) size 4x18
+        text run at (160,54) width 4: &quot; &quot;
+      RenderAttachment {ATTACHMENT} at (164,0) size 78x77
+      RenderText {#text} at (242,54) size 4x18
+        text run at (242,54) width 4: &quot; &quot;
+      RenderAttachment {ATTACHMENT} at (246,0) size 78x77
+      RenderText {#text} at (324,54) size 4x18
+        text run at (324,54) width 4: &quot; &quot;
+      RenderAttachment {ATTACHMENT} at (328,0) size 78x77
+      RenderText {#text} at (406,54) size 4x18
+        text run at (406,54) width 4: &quot; &quot;
+      RenderAttachment {ATTACHMENT} at (410,0) size 78x77
+      RenderText {#text} at (488,54) size 4x18
+        text run at (488,54) width 4: &quot; &quot;
+      RenderAttachment {ATTACHMENT} at (492,0) size 78x77
+      RenderText {#text} at (570,54) size 4x18
+        text run at (570,54) width 4: &quot; &quot;
+      RenderAttachment {ATTACHMENT} at (574,0) size 78x77
+      RenderText {#text} at (0,0) size 0x0
+      RenderText {#text} at (0,0) size 0x0
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (181113 => 181114)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-03-06 00:29:24 UTC (rev 181113)
+++ trunk/Source/WebCore/ChangeLog        2015-03-06 00:34:25 UTC (rev 181114)
</span><span class="lines">@@ -1,3 +1,34 @@
</span><ins>+2015-03-05  Timothy Horton  &lt;timothy_horton@apple.com&gt;
+
+        &lt;attachment&gt; should support indication of download progress
+        https://bugs.webkit.org/show_bug.cgi?id=142336
+        &lt;rdar://problem/19982504&gt;
+
+        Reviewed by Anders Carlsson.
+
+        * html/HTMLAttachmentElement.cpp:
+        (WebCore::HTMLAttachmentElement::parseAttribute):
+        Invalidate the attachment if the progress attribute changes.
+
+        * platform/graphics/FloatRoundedRect.h:
+        (WebCore::FloatRoundedRect::Radii::Radii):
+        Add a Radii constructor that takes a single argument that is used
+        as the radius for all corners, for convenience.
+
+        * rendering/RenderThemeMac.mm:
+        (WebCore::attachmentProgressBarBackgroundColor):
+        (WebCore::attachmentProgressBarFillColor):
+        (WebCore::attachmentProgressBarBorderColor):
+        Add a bunch of constants for the progress bar.
+
+        (WebCore::paintAttachmentIconBackground):
+        Make use of fillRoundedRect instead of creating a path.
+
+        (WebCore::paintAttachmentProgress):
+        (WebCore::RenderThemeMac::paintAttachment):
+        Paint a progress bar if the progress attribute exists and
+        is a valid floating point number.
+
</ins><span class="cx"> 2015-03-05  Commit Queue  &lt;commit-queue@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed, rolling out r180846.
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLAttachmentElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLAttachmentElement.cpp (181113 => 181114)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLAttachmentElement.cpp        2015-03-06 00:29:24 UTC (rev 181113)
+++ trunk/Source/WebCore/html/HTMLAttachmentElement.cpp        2015-03-06 00:34:25 UTC (rev 181114)
</span><span class="lines">@@ -74,7 +74,7 @@
</span><span class="cx"> 
</span><span class="cx"> void HTMLAttachmentElement::parseAttribute(const QualifiedName&amp; name, const AtomicString&amp; value)
</span><span class="cx"> {
</span><del>-    if (name == subtitleAttr &amp;&amp; is&lt;RenderAttachment&gt;(renderer())) {
</del><ins>+    if ((name == progressAttr || name == subtitleAttr) &amp;&amp; is&lt;RenderAttachment&gt;(renderer())) {
</ins><span class="cx">         downcast&lt;RenderAttachment&gt;(*renderer()).invalidate();
</span><span class="cx">         return;
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsFloatRoundedRecth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/FloatRoundedRect.h (181113 => 181114)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/FloatRoundedRect.h        2015-03-06 00:29:24 UTC (rev 181113)
+++ trunk/Source/WebCore/platform/graphics/FloatRoundedRect.h        2015-03-06 00:34:25 UTC (rev 181114)
</span><span class="lines">@@ -57,6 +57,14 @@
</span><span class="cx">         {
</span><span class="cx">         }
</span><span class="cx"> 
</span><ins>+        explicit Radii(float uniformRadius)
+            : m_topLeft(uniformRadius, uniformRadius)
+            , m_topRight(uniformRadius, uniformRadius)
+            , m_bottomLeft(uniformRadius, uniformRadius)
+            , m_bottomRight(uniformRadius, uniformRadius)
+        {
+        }
+
</ins><span class="cx">         void setTopLeft(const FloatSize&amp; size) { m_topLeft = size; }
</span><span class="cx">         void setTopRight(const FloatSize&amp; size) { m_topRight = size; }
</span><span class="cx">         void setBottomLeft(const FloatSize&amp; size) { m_bottomLeft = size; }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderThemeMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderThemeMac.mm (181113 => 181114)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderThemeMac.mm        2015-03-06 00:29:24 UTC (rev 181113)
+++ trunk/Source/WebCore/rendering/RenderThemeMac.mm        2015-03-06 00:34:25 UTC (rev 181114)
</span><span class="lines">@@ -2094,6 +2094,14 @@
</span><span class="cx"> const CGFloat attachmentSubtitleFontSize = 10;
</span><span class="cx"> static Color attachmentSubtitleTextColor() { return Color(82, 145, 214, 255); }
</span><span class="cx"> 
</span><ins>+const CGFloat attachmentProgressBarWidth = 30;
+const CGFloat attachmentProgressBarHeight = 5;
+const CGFloat attachmentProgressBarOffset = -9;
+const CGFloat attachmentProgressBarBorderWidth = 1;
+static Color attachmentProgressBarBackgroundColor() { return Color(0, 0, 0, 89); }
+static Color attachmentProgressBarFillColor() { return Color(Color::white); }
+static Color attachmentProgressBarBorderColor() { return Color(0, 0, 0, 128); }
+
</ins><span class="cx"> const CGFloat attachmentMargin = 3;
</span><span class="cx"> 
</span><span class="cx"> struct AttachmentLayout {
</span><span class="lines">@@ -2300,17 +2308,13 @@
</span><span class="cx">     if (paintBorder)
</span><span class="cx">         backgroundRect.inflate(-attachmentIconSelectionBorderThickness);
</span><span class="cx"> 
</span><del>-    FloatSize iconBackgroundRadiusSize(attachmentIconBackgroundRadius, attachmentIconBackgroundRadius);
</del><ins>+    context.fillRoundedRect(FloatRoundedRect(backgroundRect, FloatRoundedRect::Radii(attachmentIconBackgroundRadius)), attachmentIconBackgroundColor(), ColorSpaceDeviceRGB);
</ins><span class="cx"> 
</span><del>-    Path backgroundPath;
-    backgroundPath.addRoundedRect(backgroundRect, iconBackgroundRadiusSize);
-    context.setFillColor(attachmentIconBackgroundColor(), ColorSpaceDeviceRGB);
-    context.fillPath(backgroundPath);
-
</del><span class="cx">     if (paintBorder) {
</span><span class="cx">         FloatRect borderRect = layout.iconBackgroundRect;
</span><span class="cx">         borderRect.inflate(-attachmentIconSelectionBorderThickness / 2);
</span><span class="cx"> 
</span><ins>+        FloatSize iconBackgroundRadiusSize(attachmentIconBackgroundRadius, attachmentIconBackgroundRadius);
</ins><span class="cx">         Path borderPath;
</span><span class="cx">         borderPath.addRoundedRect(borderRect, iconBackgroundRadiusSize);
</span><span class="cx">         context.setStrokeColor(attachmentIconBorderColor(), ColorSpaceDeviceRGB);
</span><span class="lines">@@ -2494,6 +2498,47 @@
</span><span class="cx">     CTLineDraw(layout.subtitleLine.get(), context.platformContext());
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static void paintAttachmentProgress(const RenderAttachment&amp; attachment, GraphicsContext&amp; context, AttachmentLayout&amp; layout)
+{
+    String progressString = attachment.attachmentElement().fastGetAttribute(progressAttr);
+    if (progressString.isEmpty())
+        return;
+    bool validProgress;
+    float progress = progressString.toFloat(&amp;validProgress);
+    if (!validProgress)
+        return;
+
+    GraphicsContextStateSaver saver(context);
+
+    FloatRect progressBounds((attachmentIconBackgroundSize - attachmentProgressBarWidth) / 2, layout.iconBackgroundRect.maxY() + attachmentProgressBarOffset - attachmentProgressBarHeight, attachmentProgressBarWidth, attachmentProgressBarHeight);
+
+    FloatRect borderRect = progressBounds;
+    borderRect.inflate(-0.5);
+    FloatRect backgroundRect = borderRect;
+    backgroundRect.inflate(-attachmentProgressBarBorderWidth / 2);
+
+    FloatRoundedRect backgroundRoundedRect(backgroundRect, FloatRoundedRect::Radii(backgroundRect.height() / 2));
+    context.fillRoundedRect(backgroundRoundedRect, attachmentProgressBarBackgroundColor(), ColorSpaceDeviceRGB);
+
+    {
+        GraphicsContextStateSaver clipSaver(context);
+        context.clipRoundedRect(backgroundRoundedRect);
+
+        FloatRect progressRect = progressBounds;
+        progressRect.setWidth(progressRect.width() * progress);
+        progressRect = encloseRectToDevicePixels(progressRect, attachment.document().deviceScaleFactor());
+
+        context.fillRect(progressRect, attachmentProgressBarFillColor(), ColorSpaceDeviceRGB);
+    }
+
+    Path borderPath;
+    float borderRadius = borderRect.height() / 2;
+    borderPath.addRoundedRect(borderRect, FloatSize(borderRadius, borderRadius));
+    context.setStrokeColor(attachmentProgressBarBorderColor(), ColorSpaceDeviceRGB);
+    context.setStrokeThickness(attachmentProgressBarBorderWidth);
+    context.strokePath(borderPath);
+}
+
</ins><span class="cx"> bool RenderThemeMac::paintAttachment(const RenderObject&amp; renderer, const PaintInfo&amp; paintInfo, const IntRect&amp; paintRect)
</span><span class="cx"> {
</span><span class="cx">     if (!is&lt;RenderAttachment&gt;(renderer))
</span><span class="lines">@@ -2519,6 +2564,7 @@
</span><span class="cx">         paintAttachmentTitleBackground(attachment, context, layout);
</span><span class="cx">     paintAttachmentTitle(attachment, context, layout);
</span><span class="cx">     paintAttachmentSubtitle(attachment, context, layout);
</span><ins>+    paintAttachmentProgress(attachment, context, layout);
</ins><span class="cx"> 
</span><span class="cx">     return true;
</span><span class="cx"> }
</span></span></pre>
</div>
</div>

</body>
</html>