WebKit Bugzilla
Attachment 372299 Details for
Bug 198946
: Attachment elements are missing context menu previews
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-198946-20190618103037.patch (text/plain), 3.89 KB, created by
Dean Jackson
on 2019-06-17 17:30:38 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Dean Jackson
Created:
2019-06-17 17:30:38 PDT
Size:
3.89 KB
patch
obsolete
>Subversion Revision: 246416 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index b1068f7ee4217268165a048419577308adf51c8c..09770ce7952d6221050744037878566c48344159 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,19 @@ >+2019-06-17 Dean Jackson <dino@apple.com> >+ >+ Attachment elements are missing context menu previews >+ https://bugs.webkit.org/show_bug.cgi?id=198946 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ When requesting position information on an <attachment> element, >+ we were not providing a snapshot image. >+ >+ * WebProcess/WebPage/WebPage.h: New common method to take a snapshot. >+ * WebProcess/WebPage/ios/WebPageIOS.mm: >+ (WebKit::WebPage::shareableBitmapSnapshotForNode): New helper. >+ (WebKit::WebPage::positionInformation): If the element is an attachment, >+ then ask for a snapshot. >+ > 2019-06-13 Tim Horton <timothy_horton@apple.com> > > No content shows up for WKWebView while locked even with _canShowWhileLocked is YES >diff --git a/Source/WebKit/WebProcess/WebPage/WebPage.h b/Source/WebKit/WebProcess/WebPage/WebPage.h >index aa73058f95883bbee08372c29f0ebe47ba2f497c..0bba97df8b6db5fcfa11121d9bdc06c88f86315c 100644 >--- a/Source/WebKit/WebProcess/WebPage/WebPage.h >+++ b/Source/WebKit/WebProcess/WebPage/WebPage.h >@@ -1251,6 +1251,7 @@ private: > > void sendPositionInformation(InteractionInformationAtPosition&&); > InteractionInformationAtPosition positionInformation(const InteractionInformationRequest&); >+ RefPtr<ShareableBitmap> shareableBitmapSnapshotForNode(WebCore::Element&); > WebAutocorrectionContext autocorrectionContext(); > bool applyAutocorrectionInternal(const String& correction, const String& originalText); > bool shouldIgnoreMetaViewport() const; >diff --git a/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm b/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm >index 075a86aa68e75195c0329011c079dc596ca53a6a..7605913a3fa555c3db54ce33ed911adcceae85bb 100644 >--- a/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm >+++ b/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm >@@ -2656,6 +2656,14 @@ static void textInteractionPositionInformation(WebPage& page, const HTMLInputEle > } > #endif > >+RefPtr<ShareableBitmap> WebPage::shareableBitmapSnapshotForNode(Element& element) >+{ >+ // Ensure that the image contains at most 600K pixels, so that it is not too big. >+ if (RefPtr<WebImage> snapshot = snapshotNode(element, SnapshotOptionsShareable, 600 * 1024)) >+ return &snapshot->bitmap(); >+ return nullptr; >+} >+ > InteractionInformationAtPosition WebPage::positionInformation(const InteractionInformationRequest& request) > { > InteractionInformationAtPosition info; >@@ -2678,16 +2686,19 @@ InteractionInformationAtPosition WebPage::positionInformation(const InteractionI > Element& element = downcast<Element>(*hitNode); > elementPositionInformation(*this, element, request, info); > >- if (info.isLink && !info.isImage && request.includeSnapshot) { >- // Ensure that the image contains at most 600K pixels, so that it is not too big. >- if (RefPtr<WebImage> snapshot = snapshotNode(element, SnapshotOptionsShareable, 600 * 1024)) >- info.image = &snapshot->bitmap(); >- } >+ if (info.isLink && !info.isImage && request.includeSnapshot) >+ info.image = shareableBitmapSnapshotForNode(element); > } > >- if (!(info.isLink || info.isImage)) >+ if (!(info.isLink || info.isImage)) { > selectionPositionInformation(*this, request, info); > >+ if (info.isAttachment && request.includeSnapshot) { >+ Element& element = downcast<Element>(*hitNode); >+ info.image = shareableBitmapSnapshotForNode(element); >+ } >+ } >+ > // Prevent the callout bar from showing when tapping on the datalist button. > #if ENABLE(DATALIST_ELEMENT) > if (is<HTMLInputElement>(hitNode)) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
thorton
:
review+
ews-watchlist
:
commit-queue-
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 198946
: 372299 |
372321