WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
234162
Image does not update after Markup Pane is dismissed.
https://bugs.webkit.org/show_bug.cgi?id=234162
Summary
Image does not update after Markup Pane is dismissed.
Megan Gardner
Reported
2021-12-10 11:37:41 PST
Image does not update after Markup Pane is dismissed.
Attachments
Patch
(19.57 KB, patch)
2021-12-10 11:47 PST
,
Megan Gardner
no flags
Details
Formatted Diff
Diff
Patch
(19.56 KB, patch)
2021-12-10 13:54 PST
,
Megan Gardner
no flags
Details
Formatted Diff
Diff
Patch for landing
(19.55 KB, patch)
2021-12-10 15:57 PST
,
Megan Gardner
no flags
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Megan Gardner
Comment 1
2021-12-10 11:47:26 PST
Created
attachment 446773
[details]
Patch
Devin Rousso
Comment 2
2021-12-10 12:09:15 PST
Comment on
attachment 446773
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=446773&action=review
r=me
> Source/WebCore/dom/mac/ImageControlsMac.cpp:133 > + if (!is<HTMLImageElement>(*shadowHost))
NIT: you can merge this with the above `if (!shadowHost)` since `is` checks for an invalid pointer ``` if (!is<HTMLImageElement>(shadowHost)) return false; ```
> Source/WebCore/dom/mac/ImageControlsMac.cpp:135 > + HTMLImageElement& imageElement = downcast<HTMLImageElement>(*shadowHost);
NIT: Chould we move this inside the `if` since it's not used outside?
> Source/WebCore/page/ChromeClient.h:535 > + virtual void handleImageServiceClick(const IntPoint&, Image&, bool /*isEditable*/, const IntRect&, const String&) { }
I'd include the name like `const String& /* attachmentID */` as it's not really clear otherwise what it's for.
> Source/WebKit/UIProcess/API/Cocoa/_WKAttachment.mm:153 > +- (void)setData:(NSData *)data newContentType:(NSString *)newContentType
NIT: Do we actually need this? Can't we just `[attachment setData:data newContentType:String(NSPasteboardTypeTIFF) newFilename:nil completion:nil];`?
> Source/WebKit/UIProcess/mac/WKSharingServicePickerDelegate.mm:151 > + [itemProvider loadDataRepresentationForTypeIdentifier:(NSString *)kUTTypeData completionHandler:^(NSData *data, NSError *error) {
NIT: Is the `(NSString *)` cast necessary?
> Source/WebKit/UIProcess/mac/WKSharingServicePickerDelegate.mm:155 > + auto apiAttachment = _menuProxy->page()->attachmentForIdentifier(_attachmentID);
Do we need to check that `_menuProxy` and/or `_menuProxy->page()` exist at this point? ``` WebPageProxy* page = _menuProxy ? _menyProxy->page() : nullptr; if (!page) return; auto apiAttachment = page->attachmentForIdentifier(_attachmentID); ... ```
> Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.mm:247 > + [[WKSharingServicePickerDelegate sharedSharingServicePickerDelegate] setAttachmentID:m_context.controlledImageAttachmentID()];
``` [WKSharingServicePickerDelegate.sharedSharingServicePickerDelegate setAttachmentID:m_context.controlledImageAttachmentID()]; ```
> Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h:384 > + void handleImageServiceClick(const WebCore::IntPoint&, WebCore::Image&, bool isEditable, const WebCore::IntRect&, const String&) final;
ditto (Source/WebCore/page/ChromeClient.h:535)
Megan Gardner
Comment 3
2021-12-10 13:32:01 PST
Comment on
attachment 446773
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=446773&action=review
>> Source/WebKit/UIProcess/API/Cocoa/_WKAttachment.mm:153 >> +- (void)setData:(NSData *)data newContentType:(NSString *)newContentType > > NIT: Do we actually need this? Can't we just `[attachment setData:data newContentType:String(NSPasteboardTypeTIFF) newFilename:nil completion:nil];`?
Well, the old SPI is deprecated, so it's probably best to make this separate from that.
>> Source/WebKit/UIProcess/mac/WKSharingServicePickerDelegate.mm:155 >> + auto apiAttachment = _menuProxy->page()->attachmentForIdentifier(_attachmentID); > > Do we need to check that `_menuProxy` and/or `_menuProxy->page()` exist at this point? > ``` > WebPageProxy* page = _menuProxy ? _menyProxy->page() : nullptr; > if (!page) > return; > > auto apiAttachment = page->attachmentForIdentifier(_attachmentID); > ... > ```
Well, we don't check about 10 lines down from this in pre-existing code, so if we should we should in both places.
>> Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.mm:247 >> + [[WKSharingServicePickerDelegate sharedSharingServicePickerDelegate] setAttachmentID:m_context.controlledImageAttachmentID()]; > > ``` > [WKSharingServicePickerDelegate.sharedSharingServicePickerDelegate setAttachmentID:m_context.controlledImageAttachmentID()]; > ```
literally every other line in this file that calls something on the shared delegate uses the [] method, I'd prefer it to be consistent.
Megan Gardner
Comment 4
2021-12-10 13:54:16 PST
Created
attachment 446806
[details]
Patch
Megan Gardner
Comment 5
2021-12-10 15:57:26 PST
Created
attachment 446835
[details]
Patch for landing
EWS
Comment 6
2021-12-10 16:48:05 PST
Committed
r286886
(
245115@main
): <
https://commits.webkit.org/245115@main
> All reviewed patches have been landed. Closing bug and clearing flags on
attachment 446835
[details]
.
Radar WebKit Bug Importer
Comment 7
2021-12-10 16:49:19 PST
<
rdar://problem/86346270
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug