Bug 158818 - <attachment> elements jump around a lot around when subtitle text changes slightly
Summary: <attachment> elements jump around a lot around when subtitle text changes sli...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Tim Horton
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-15 16:22 PDT by Tim Horton
Modified: 2016-06-15 18:14 PDT (History)
7 users (show)

See Also:


Attachments
Patch (8.67 KB, patch)
2016-06-15 16:24 PDT, Tim Horton
simon.fraser: review+
buildbot: commit-queue-
Details | Formatted Diff | Diff
Archive of layout-test-results from ews122 for ios-simulator-wk2 (635.43 KB, application/zip)
2016-06-15 17:30 PDT, Build Bot
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Horton 2016-06-15 16:22:49 PDT
<attachment> elements jump around a lot around when subtitle text changes slightly
Comment 1 Tim Horton 2016-06-15 16:24:50 PDT
Created attachment 281402 [details]
Patch
Comment 2 Tim Horton 2016-06-15 16:25:15 PDT
<rdar://problem/24450270>
Comment 3 Simon Fraser (smfr) 2016-06-15 16:34:48 PDT
Comment on attachment 281402 [details]
Patch

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

> Source/WebCore/rendering/RenderThemeMac.mm:2603
> +    context.translate(FloatSize((paintRect.width() - attachmentIconBackgroundSize) / 2, 0));

You probably want to round down to avoid putting drawing on half-pixel boundaries. Or pixel snap.
Comment 4 Build Bot 2016-06-15 17:30:34 PDT
Comment on attachment 281402 [details]
Patch

Attachment 281402 [details] did not pass ios-sim-ews (ios-simulator-wk2):
Output: http://webkit-queues.webkit.org/results/1509668

New failing tests:
fast/attachment/attachment-subtitle-resize.html
Comment 5 Build Bot 2016-06-15 17:30:37 PDT
Created attachment 281412 [details]
Archive of layout-test-results from ews122 for ios-simulator-wk2

The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews122  Port: ios-simulator-wk2  Platform: Mac OS X 10.11.4
Comment 6 Darin Adler 2016-06-15 18:02:59 PDT
Comment on attachment 281402 [details]
Patch

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

> Source/WebCore/rendering/RenderAttachment.h:54
> +    LayoutUnit m_minimumIntrinsicWidth;

Does anything ever need to reset this to zero?
Comment 7 Tim Horton 2016-06-15 18:11:33 PDT
(In reply to comment #6)
> Comment on attachment 281402 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=281402&action=review
> 
> > Source/WebCore/rendering/RenderAttachment.h:54
> > +    LayoutUnit m_minimumIntrinsicWidth;
> 
> Does anything ever need to reset this to zero?

I haven't yet come up with a good way to know that it's OK to shrink, so for now any particular attachment will always only grow. Given the currently limited use case of <attachment> this is likely OK, but if we want it to be more generally useful we'll probably have to come up with something (reset it on a deferrable timer? just give up on intrinsic sizing and give it a fixed width? something smarter?).
Comment 8 Tim Horton 2016-06-15 18:14:20 PDT
http://trac.webkit.org/changeset/202117