Bug 142261

Summary: <attachment> should show the file size as detail text below the icon
Product: WebKit Reporter: Tim Horton <thorton>
Component: New BugsAssignee: Tim Horton <thorton>
Status: RESOLVED FIXED    
Severity: Normal CC: andersca, buildbot, commit-queue, enrica, esprehn+autocc, glenn, gyuyoung.kim, kondapallykalyan, rniwa, sam, simon.fraser
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Archive of layout-test-results from ews101 for mac-mavericks
none
Archive of layout-test-results from ews107 for mac-mavericks-wk2
none
Patch dino: review+

Description Tim Horton 2015-03-03 22:54:28 PST
<attachment> should show the file size as detail text below the icon
Comment 1 Tim Horton 2015-03-03 22:55:45 PST
Created attachment 247841 [details]
Patch
Comment 2 Build Bot 2015-03-03 23:57:32 PST
Comment on attachment 247841 [details]
Patch

Attachment 247841 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.appspot.com/results/5700911208857600

New failing tests:
fast/attachment/attachment-subtitle.html
Comment 3 Build Bot 2015-03-03 23:57:36 PST
Created attachment 247848 [details]
Archive of layout-test-results from ews101 for mac-mavericks

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews101  Port: mac-mavericks  Platform: Mac OS X 10.9.5
Comment 4 Build Bot 2015-03-04 00:04:05 PST
Comment on attachment 247841 [details]
Patch

Attachment 247841 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.appspot.com/results/4926638127054848

New failing tests:
fast/attachment/attachment-subtitle.html
Comment 5 Build Bot 2015-03-04 00:04:10 PST
Created attachment 247849 [details]
Archive of layout-test-results from ews107 for mac-mavericks-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews107  Port: mac-mavericks-wk2  Platform: Mac OS X 10.9.5
Comment 6 Tim Horton 2015-03-04 00:06:24 PST
Need to land those results for Mavericks.
Comment 7 Tim Horton 2015-03-04 11:54:44 PST
Created attachment 247877 [details]
Patch
Comment 8 Dean Jackson 2015-03-04 17:35:29 PST
Comment on attachment 247877 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=247877&action=review

> Source/WebCore/rendering/RenderThemeMac.mm:2237
> +    // FIXME: What attribute should we use?
> +    String subtitleText = attachment.attachmentElement().fastGetAttribute(subtitleAttr);
> +

I don't understand the FIXME

> Source/WebCore/rendering/RenderThemeMac.mm:2261
> +    CGRect lineBounds = CTLineGetBoundsWithOptions(subtitleLine.get(), 0);
> +
> +    // Center the line relative to the icon.
> +    CGFloat xOffset = (attachmentIconBackgroundSize / 2) - (lineBounds.size.width / 2);
> +    CGFloat yOffset = 0;
> +
> +    if (!lines.isEmpty())
> +        yOffset = lines.last().backgroundRect.maxY();
> +    else
> +        yOffset = attachmentIconBackgroundSize + attachmentIconToTitleMargin;
> +
> +    LabelLine labelLine;
> +    subtitleTextRect = FloatRect(xOffset, yOffset, lineBounds.size.width, lineBounds.size.height);

Again, would be easier to do this in the shadow document :|
Comment 9 Tim Horton 2015-03-04 17:40:08 PST
http://trac.webkit.org/changeset/181056