Bug 171701 - [Mac] Modernize image for dragged link
Summary: [Mac] Modernize image for dragged link
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Tim Horton
URL:
Keywords:
Depends on: 171706
Blocks:
  Show dependency treegraph
 
Reported: 2017-05-04 17:34 PDT by Tim Horton
Modified: 2017-05-04 19:24 PDT (History)
6 users (show)

See Also:


Attachments
patch (21.54 KB, patch)
2017-05-04 17:34 PDT, Tim Horton
simon.fraser: review+
Details | Formatted Diff | Diff
Patch (21.66 KB, patch)
2017-05-04 18:21 PDT, Tim Horton
no flags Details | Formatted Diff | Diff
Patch (27.17 KB, patch)
2017-05-04 18:46 PDT, Tim Horton
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Horton 2017-05-04 17:34:27 PDT
Created attachment 309118 [details]
patch

[Mac] Modernize image for dragged link
Comment 1 Build Bot 2017-05-04 17:36:58 PDT
Attachment 309118 [details] did not pass style-queue:


ERROR: Source/WebCore/ChangeLog:1:  ChangeLog entry has no bug number  [changelog/bugnumber] [5]
Total errors found: 1 in 3 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 2 Tim Horton 2017-05-04 18:21:33 PDT
Created attachment 309124 [details]
Patch
Comment 3 Simon Fraser (smfr) 2017-05-04 18:25:59 PDT
Comment on attachment 309118 [details]
patch

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

> Source/WebCore/platform/mac/DragImageMac.mm:161
> +const float linkImagePadding = 10; // Keep in sync with DragController::LinkDragBorderInset.
> +const float linkImageDomainBaselineToTitleBaseline = 18;
> +const float linkImageCornerRadius = 5;
> +const float linkImageMaximumWidth = 400;
> +const float linkImageFontSize = 11;

Some of these should be CGFloats.

> Source/WebCore/platform/mac/DragImageMac.mm:176
> +    void layOutText(NSString *text, NSColor *, NSFont *, CFIndex maximumLines, CTLineTruncationType, CGFloat& maximumAvailableWidth, CGFloat& maximumUsedTextWidth, CGFloat& currentY);

layOutText is hard on my eyes.
Comment 4 Tim Horton 2017-05-04 18:46:20 PDT
Created attachment 309126 [details]
Patch
Comment 5 Simon Fraser (smfr) 2017-05-04 18:48:37 PDT
Comment on attachment 309126 [details]
Patch

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

> Source/WebCore/platform/mac/DragImageMac.mm:176
> +    void addLine(CTLineRef, Vector<CGPoint>& origins, CFIndex lineIndex, CGFloat x, CGFloat& y, CGFloat& maximumUsedTextWidth, bool isLastLine);

Can origins be const?
Comment 6 Tim Horton 2017-05-04 18:59:12 PDT
Sure.
Comment 7 Tim Horton 2017-05-04 19:24:27 PDT
https://trac.webkit.org/changeset/216226/webkit