Summary: | Images are not resizing correctly when dragged to a message in 1/3 view | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | zalan <zalan> | ||||||
Component: | Layout and Rendering | Assignee: | zalan <zalan> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | bfulgham, commit-queue, darin, simon.fraser, wenson_hsieh, zalan | ||||||
Priority: | P2 | Keywords: | InRadar | ||||||
Version: | WebKit Nightly Build | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Attachments: |
|
Description
zalan
2019-06-06 14:36:47 PDT
Created attachment 371527 [details]
Patch
Comment on attachment 371527 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=371527&action=review > Source/WebCore/editing/WebContentReader.h:74 > + bool readFilePath(const String&, Optional<float> preferredPresentationWidth = { }, Optional<float> preferredPresentationHeight = { }, const String& contentType = { }) override; Not critical, but a tiny bit inelegant to have such a long list of arguments. Maybe would be nice just to have a struct just for the width/height (both optional) so it’s easier to pass along from one function to the next and also easier to ignore. This might just clean it up a bit: struct OptionalSizes { Optional<float> width; Optional<float> height; }; Not sure that’s the perfect name, but it’s important that it’s a short name. On a separate note, not at all new to this patch, it’s not so ideal to turn CGFloat (double) into float and then turn it into a string. Could end up with a long string that would be shorter if it wasn’t converted to a float first. Generally speaking I think that the mix of floating point types is a small problem throughout our graphics code. > Source/WebCore/platform/ios/PlatformPasteboardIOS.mm:161 > + if (!IOSApplication::isMobileMail()) This needs a "why" comment. It’s very mysterious to have an unmotivated "if specific app" here. Even better would be to have a function name that makes it clear what the quirk in behavior is, not just a comment. (In reply to Darin Adler from comment #2) > Comment on attachment 371527 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=371527&action=review > > > Source/WebCore/editing/WebContentReader.h:74 > > + bool readFilePath(const String&, Optional<float> preferredPresentationWidth = { }, Optional<float> preferredPresentationHeight = { }, const String& contentType = { }) override; > > Not critical, but a tiny bit inelegant to have such a long list of > arguments. Maybe would be nice just to have a struct just for the > width/height (both optional) so it’s easier to pass along from one function > to the next and also easier to ignore. This might just clean it up a bit: > > struct OptionalSizes { > Optional<float> width; > Optional<float> height; > }; > I use such structures all the time in the layout code! I should have done that here too. > Not sure that’s the perfect name, but it’s important that it’s a short name. > > On a separate note, not at all new to this patch, it’s not so ideal to turn > CGFloat (double) into float and then turn it into a string. Could end up > with a long string that would be shorter if it wasn’t converted to a float > first. Generally speaking I think that the mix of floating point types is a > small problem throughout our graphics code. > > > Source/WebCore/platform/ios/PlatformPasteboardIOS.mm:161 > > + if (!IOSApplication::isMobileMail()) > > This needs a "why" comment. It’s very mysterious to have an unmotivated "if > specific app" here. Even better would be to have a function name that makes > it clear what the quirk in behavior is, not just a comment. Agree. Will add one. Created attachment 371589 [details]
Patch
The commit-queue encountered the following flaky tests while processing attachment 371589 [details]: resize-observer/element-leak.html bug 198667 The commit-queue is continuing to process your patch. Comment on attachment 371589 [details] Patch Clearing flags on attachment: 371589 Committed r246207: <https://trac.webkit.org/changeset/246207> All reviewed patches have been landed. Closing bug. |