WebKit Bugzilla
Attachment 371527 Details for
Bug 198623
: Images are not resizing correctly when dragged to a message in 1/3 view
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-198623-20190606150923.patch (text/plain), 24.73 KB, created by
zalan
on 2019-06-06 15:09:24 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
zalan
Created:
2019-06-06 15:09:24 PDT
Size:
24.73 KB
patch
obsolete
>Subversion Revision: 246067 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index ce97d1d8dfb9d3d9c0cdb9e031f2b073905c6594..cc32fcbbee3f7cacf309ed9af918f10206fe5b19 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,41 @@ >+2019-06-06 Zalan Bujtas <zalan@apple.com> >+ >+ Images are not resizing correctly when dragged to a message in 1/3 view >+ https://bugs.webkit.org/show_bug.cgi?id=198623 >+ <rdar://problem/51185518> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Mail's max-width: 100%; default style is in conflict with the preferred presentation size. This patch preserves the existing behaviour for Mail by >+ not setting the height (and rely on the width + aspect ratio). >+ >+ * editing/WebContentReader.h: >+ * editing/cocoa/WebContentReaderCocoa.mm: >+ (WebCore::createFragmentForImageAttachment): >+ (WebCore::WebContentReader::readImage): >+ (WebCore::attachmentForFilePath): >+ (WebCore::attachmentForData): >+ (WebCore::WebContentReader::readFilePath): >+ (WebCore::WebContentReader::readDataBuffer): >+ * editing/gtk/EditorGtk.cpp: >+ (WebCore::createFragmentFromPasteboardData): >+ * editing/markup.cpp: >+ (WebCore::createFragmentForImageAndURL): >+ * editing/markup.h: >+ * platform/Pasteboard.h: >+ (WebCore::PasteboardWebContentReader::readFilePath): >+ (WebCore::PasteboardWebContentReader::readImage): >+ (WebCore::PasteboardWebContentReader::readDataBuffer): >+ * platform/PasteboardItemInfo.h: >+ (WebCore::PasteboardItemInfo::encode const): >+ (WebCore::PasteboardItemInfo::decode): >+ * platform/ios/PasteboardIOS.mm: >+ (WebCore::Pasteboard::readPasteboardWebContentDataForType): >+ (WebCore::Pasteboard::read): >+ (WebCore::Pasteboard::readRespectingUTIFidelities): >+ * platform/ios/PlatformPasteboardIOS.mm: >+ (WebCore::PlatformPasteboard::informationForItemAtIndex): >+ > 2019-06-04 Zalan Bujtas <zalan@apple.com> > > [LFC][IFC] Decouple float placement and line shrinking >diff --git a/Source/WebCore/editing/WebContentReader.h b/Source/WebCore/editing/WebContentReader.h >index 2b9e99999cb778591a60ac0d3d96aebbaadef1c4..498b0a2ba76c1941205b073f775e0e89f42e4442 100644 >--- a/Source/WebCore/editing/WebContentReader.h >+++ b/Source/WebCore/editing/WebContentReader.h >@@ -71,14 +71,14 @@ public: > private: > #if PLATFORM(COCOA) > bool readWebArchive(SharedBuffer&) override; >- bool readFilePath(const String&, Optional<FloatSize> preferredPresentationSize = { }, const String& contentType = { }) override; >+ bool readFilePath(const String&, Optional<float> preferredPresentationWidth = { }, Optional<float> preferredPresentationHeight = { }, const String& contentType = { }) override; > bool readFilePaths(const Vector<String>&) override; > bool readHTML(const String&) override; > bool readRTFD(SharedBuffer&) override; > bool readRTF(SharedBuffer&) override; >- bool readImage(Ref<SharedBuffer>&&, const String& type, Optional<FloatSize> preferredPresentationSize = { }) override; >+ bool readImage(Ref<SharedBuffer>&&, const String& type, Optional<float> preferredPresentationWidth = { }, Optional<float> preferredPresentationHeight = { }) override; > bool readURL(const URL&, const String& title) override; >- bool readDataBuffer(SharedBuffer&, const String& type, const String& name, Optional<FloatSize> preferredPresentationSize = { }) override; >+ bool readDataBuffer(SharedBuffer&, const String& type, const String& name, Optional<float> preferredPresentationWidth = { }, Optional<float> preferredPresentationHeight = { }) override; > #endif > bool readPlainText(const String&) override; > }; >@@ -95,14 +95,14 @@ public: > private: > #if PLATFORM(COCOA) > bool readWebArchive(SharedBuffer&) override; >- bool readFilePath(const String&, Optional<FloatSize> = { }, const String& = { }) override { return false; } >+ bool readFilePath(const String&, Optional<float> /*preferredPresentationWidth*/ = { }, Optional<float> /*preferredPresentationHeight*/ = { }, const String& = { }) override { return false; } > bool readFilePaths(const Vector<String>&) override { return false; } > bool readHTML(const String&) override; > bool readRTFD(SharedBuffer&) override; > bool readRTF(SharedBuffer&) override; >- bool readImage(Ref<SharedBuffer>&&, const String&, Optional<FloatSize> = { }) override { return false; } >+ bool readImage(Ref<SharedBuffer>&&, const String&, Optional<float> /*preferredPresentationWidth*/ = { }, Optional<float> /*preferredPresentationHeight*/ = { }) override { return false; } > bool readURL(const URL&, const String&) override { return false; } >- bool readDataBuffer(SharedBuffer&, const String&, const String&, Optional<FloatSize> = { }) override { return false; } >+ bool readDataBuffer(SharedBuffer&, const String&, const String&, Optional<float> /*preferredPresentationWidth*/ = { }, Optional<float> /*preferredPresentationHeight*/ = { }) override { return false; } > #endif > bool readPlainText(const String&) override { return false; } > }; >diff --git a/Source/WebCore/editing/cocoa/WebContentReaderCocoa.mm b/Source/WebCore/editing/cocoa/WebContentReaderCocoa.mm >index be85b0ab30a3ba7873d6aabc60ba54ab334f2068..a1be337fafefdc1e7632d0d04dee7dbcc16f11f8 100644 >--- a/Source/WebCore/editing/cocoa/WebContentReaderCocoa.mm >+++ b/Source/WebCore/editing/cocoa/WebContentReaderCocoa.mm >@@ -247,7 +247,7 @@ static bool supportsClientSideAttachmentData(const Frame& frame) > > #endif > >-static Ref<DocumentFragment> createFragmentForImageAttachment(Frame& frame, Document& document, Ref<SharedBuffer>&& buffer, const String& contentType, Optional<FloatSize> preferredSize) >+static Ref<DocumentFragment> createFragmentForImageAttachment(Frame& frame, Document& document, Ref<SharedBuffer>&& buffer, const String& contentType, Optional<float> preferredWidth, Optional<float> preferredHeight) > { > #if ENABLE(ATTACHMENT_ELEMENT) > auto attachment = HTMLAttachmentElement::create(HTMLNames::attachmentTag, document); >@@ -261,10 +261,10 @@ static Ref<DocumentFragment> createFragmentForImageAttachment(Frame& frame, Docu > auto image = HTMLImageElement::create(document); > image->setAttributeWithoutSynchronization(HTMLNames::srcAttr, DOMURL::createObjectURL(document, Blob::create(buffer.get(), contentType))); > image->setAttachmentElement(WTFMove(attachment)); >- if (preferredSize) { >- image->setAttributeWithoutSynchronization(HTMLNames::widthAttr, AtomicString::number(preferredSize->width())); >- image->setAttributeWithoutSynchronization(HTMLNames::heightAttr, AtomicString::number(preferredSize->height())); >- } >+ if (preferredWidth) >+ image->setAttributeWithoutSynchronization(HTMLNames::widthAttr, AtomicString::number(*preferredWidth)); >+ if (preferredHeight) >+ image->setAttributeWithoutSynchronization(HTMLNames::heightAttr, AtomicString::number(*preferredHeight)); > fragment->appendChild(WTFMove(image)); > } else { > attachment->updateAttributes(buffer->size(), contentType, defaultImageAttachmentName); >@@ -681,14 +681,14 @@ bool WebContentReader::readPlainText(const String& text) > return true; > } > >-bool WebContentReader::readImage(Ref<SharedBuffer>&& buffer, const String& type, Optional<FloatSize> preferredPresentationSize) >+bool WebContentReader::readImage(Ref<SharedBuffer>&& buffer, const String& type, Optional<float> preferredPresentationWidth, Optional<float> preferredPresentationHeight) > { > ASSERT(frame.document()); > auto& document = *frame.document(); > if (shouldReplaceRichContentWithAttachments()) >- addFragment(createFragmentForImageAttachment(frame, document, WTFMove(buffer), type, preferredPresentationSize)); >+ addFragment(createFragmentForImageAttachment(frame, document, WTFMove(buffer), type, preferredPresentationWidth, preferredPresentationHeight)); > else >- addFragment(createFragmentForImageAndURL(document, DOMURL::createObjectURL(document, Blob::create(buffer.get(), type)), preferredPresentationSize)); >+ addFragment(createFragmentForImageAndURL(document, DOMURL::createObjectURL(document, Blob::create(buffer.get(), type)), preferredPresentationWidth, preferredPresentationHeight)); > > return fragment; > } >@@ -704,7 +704,7 @@ static String typeForAttachmentElement(const String& contentType) > return mimeType.isEmpty() ? contentType : mimeType; > } > >-static Ref<HTMLElement> attachmentForFilePath(Frame& frame, const String& path, Optional<FloatSize> preferredSize, const String& explicitContentType) >+static Ref<HTMLElement> attachmentForFilePath(Frame& frame, const String& path, Optional<float> preferredWidth, Optional<float> preferredHeight, const String& explicitContentType) > { > auto document = makeRef(*frame.document()); > auto attachment = HTMLAttachmentElement::create(HTMLNames::attachmentTag, document); >@@ -738,10 +738,10 @@ static Ref<HTMLElement> attachmentForFilePath(Frame& frame, const String& path, > auto image = HTMLImageElement::create(document); > image->setAttributeWithoutSynchronization(HTMLNames::srcAttr, DOMURL::createObjectURL(document, File::create(path))); > image->setAttachmentElement(WTFMove(attachment)); >- if (preferredSize) { >- image->setAttributeWithoutSynchronization(HTMLNames::widthAttr, AtomicString::number(preferredSize->width())); >- image->setAttributeWithoutSynchronization(HTMLNames::heightAttr, AtomicString::number(preferredSize->height())); >- } >+ if (preferredWidth) >+ image->setAttributeWithoutSynchronization(HTMLNames::widthAttr, AtomicString::number(*preferredWidth)); >+ if (preferredHeight) >+ image->setAttributeWithoutSynchronization(HTMLNames::heightAttr, AtomicString::number(*preferredHeight)); > return image; > } > >@@ -749,7 +749,7 @@ static Ref<HTMLElement> attachmentForFilePath(Frame& frame, const String& path, > return attachment; > } > >-static Ref<HTMLElement> attachmentForData(Frame& frame, SharedBuffer& buffer, const String& contentType, const String& name, Optional<FloatSize> preferredSize) >+static Ref<HTMLElement> attachmentForData(Frame& frame, SharedBuffer& buffer, const String& contentType, const String& name, Optional<float> preferredWidth, Optional<float> preferredHeight) > { > auto document = makeRef(*frame.document()); > auto attachment = HTMLAttachmentElement::create(HTMLNames::attachmentTag, document); >@@ -775,10 +775,10 @@ static Ref<HTMLElement> attachmentForData(Frame& frame, SharedBuffer& buffer, co > auto image = HTMLImageElement::create(document); > image->setAttributeWithoutSynchronization(HTMLNames::srcAttr, DOMURL::createObjectURL(document, File::create(Blob::create(buffer, WTFMove(attachmentType)), WTFMove(fileName)))); > image->setAttachmentElement(WTFMove(attachment)); >- if (preferredSize) { >- image->setAttributeWithoutSynchronization(HTMLNames::widthAttr, AtomicString::number(preferredSize->width())); >- image->setAttributeWithoutSynchronization(HTMLNames::heightAttr, AtomicString::number(preferredSize->height())); >- } >+ if (preferredWidth) >+ image->setAttributeWithoutSynchronization(HTMLNames::widthAttr, AtomicString::number(*preferredWidth)); >+ if (preferredHeight) >+ image->setAttributeWithoutSynchronization(HTMLNames::heightAttr, AtomicString::number(*preferredHeight)); > return image; > } > >@@ -788,7 +788,7 @@ static Ref<HTMLElement> attachmentForData(Frame& frame, SharedBuffer& buffer, co > > #endif // ENABLE(ATTACHMENT_ELEMENT) > >-bool WebContentReader::readFilePath(const String& path, Optional<FloatSize> preferredPresentationSize, const String& contentType) >+bool WebContentReader::readFilePath(const String& path, Optional<float> preferredPresentationWidth, Optional<float> preferredPresentationHeight, const String& contentType) > { > if (path.isEmpty() || !frame.document()) > return false; >@@ -799,7 +799,7 @@ bool WebContentReader::readFilePath(const String& path, Optional<FloatSize> pref > > #if ENABLE(ATTACHMENT_ELEMENT) > if (RuntimeEnabledFeatures::sharedFeatures().attachmentElementEnabled()) >- fragment->appendChild(attachmentForFilePath(frame, path, preferredPresentationSize, contentType)); >+ fragment->appendChild(attachmentForFilePath(frame, path, preferredPresentationWidth, preferredPresentationHeight, contentType)); > #endif > > return true; >@@ -847,7 +847,7 @@ bool WebContentReader::readURL(const URL& url, const String& title) > return true; > } > >-bool WebContentReader::readDataBuffer(SharedBuffer& buffer, const String& type, const String& name, Optional<FloatSize> preferredPresentationSize) >+bool WebContentReader::readDataBuffer(SharedBuffer& buffer, const String& type, const String& name, Optional<float> preferredPresentationWidth, Optional<float> preferredPresentationHeight) > { > if (buffer.isEmpty()) > return false; >@@ -863,7 +863,7 @@ bool WebContentReader::readDataBuffer(SharedBuffer& buffer, const String& type, > fragment = document->createDocumentFragment(); > > #if ENABLE(ATTACHMENT_ELEMENT) >- fragment->appendChild(attachmentForData(frame, buffer, type, name, preferredPresentationSize)); >+ fragment->appendChild(attachmentForData(frame, buffer, type, name, preferredPresentationWidth, preferredPresentationHeight)); > #else > UNUSED_PARAM(type); > UNUSED_PARAM(name); >diff --git a/Source/WebCore/editing/gtk/EditorGtk.cpp b/Source/WebCore/editing/gtk/EditorGtk.cpp >index 8c4ea290fc5b8c3d4c3d09ce305412d826a5dca7..c1d2ce70111a4bcbd1f6482f7659f408d139047a 100644 >--- a/Source/WebCore/editing/gtk/EditorGtk.cpp >+++ b/Source/WebCore/editing/gtk/EditorGtk.cpp >@@ -69,7 +69,7 @@ static RefPtr<DocumentFragment> createFragmentFromPasteboardData(Pasteboard& pas > auto blob = Blob::create(WTFMove(buffer), "image/png"); > if (!frame.document()) > return nullptr; >- return createFragmentForImageAndURL(*frame.document(), DOMURL::createObjectURL(*frame.document(), blob), { }); >+ return createFragmentForImageAndURL(*frame.document(), DOMURL::createObjectURL(*frame.document(), blob), { }, { }); > } > } > >diff --git a/Source/WebCore/editing/markup.cpp b/Source/WebCore/editing/markup.cpp >index d9ecf15967eafc0ef1dfeaf25a70084dd0e63db8..cd3834ebda515239fb489a8a0590952ec0b3c08f 100644 >--- a/Source/WebCore/editing/markup.cpp >+++ b/Source/WebCore/editing/markup.cpp >@@ -1236,15 +1236,14 @@ RefPtr<DocumentFragment> createFragmentForTransformToFragment(Document& outputDo > return fragment; > } > >-Ref<DocumentFragment> createFragmentForImageAndURL(Document& document, const String& url, Optional<FloatSize> preferredSize) >+Ref<DocumentFragment> createFragmentForImageAndURL(Document& document, const String& url, Optional<float> preferredWidth, Optional<float> preferredHeight) > { > auto imageElement = HTMLImageElement::create(document); > imageElement->setAttributeWithoutSynchronization(HTMLNames::srcAttr, url); >- if (preferredSize) { >- imageElement->setAttributeWithoutSynchronization(HTMLNames::widthAttr, AtomicString::number(preferredSize->width())); >- imageElement->setAttributeWithoutSynchronization(HTMLNames::heightAttr, AtomicString::number(preferredSize->height())); >- } >- >+ if (preferredWidth) >+ imageElement->setAttributeWithoutSynchronization(HTMLNames::widthAttr, AtomicString::number(*preferredWidth)); >+ if (preferredHeight) >+ imageElement->setAttributeWithoutSynchronization(HTMLNames::heightAttr, AtomicString::number(*preferredHeight)); > auto fragment = document.createDocumentFragment(); > fragment->appendChild(imageElement); > >diff --git a/Source/WebCore/editing/markup.h b/Source/WebCore/editing/markup.h >index e8696bb142b5306c245af2a90e5de0d344538425..c5048774d9c55ccb673927c6f38b716c0b50a7cd 100644 >--- a/Source/WebCore/editing/markup.h >+++ b/Source/WebCore/editing/markup.h >@@ -60,7 +60,7 @@ WEBCORE_EXPORT Ref<DocumentFragment> createFragmentFromText(Range& context, cons > WEBCORE_EXPORT Ref<DocumentFragment> createFragmentFromMarkup(Document&, const String& markup, const String& baseURL, ParserContentPolicy = AllowScriptingContent); > ExceptionOr<Ref<DocumentFragment>> createFragmentForInnerOuterHTML(Element&, const String& markup, ParserContentPolicy); > RefPtr<DocumentFragment> createFragmentForTransformToFragment(Document&, const String& sourceString, const String& sourceMIMEType); >-Ref<DocumentFragment> createFragmentForImageAndURL(Document&, const String&, Optional<FloatSize> preferredSize); >+Ref<DocumentFragment> createFragmentForImageAndURL(Document&, const String&, Optional<float> preferredWidth, Optional<float> preferredHeight); > ExceptionOr<Ref<DocumentFragment>> createContextualFragment(Element&, const String& markup, ParserContentPolicy); > > bool isPlainTextMarkup(Node*); >diff --git a/Source/WebCore/platform/Pasteboard.h b/Source/WebCore/platform/Pasteboard.h >index 97eeb1f510fcc3b16d2fea0e77a40fbd59a19dfa..8e4f760bfe4e731619628714c00f99f960299c14 100644 >--- a/Source/WebCore/platform/Pasteboard.h >+++ b/Source/WebCore/platform/Pasteboard.h >@@ -136,14 +136,14 @@ public: > > #if PLATFORM(COCOA) > virtual bool readWebArchive(SharedBuffer&) = 0; >- virtual bool readFilePath(const String&, Optional<FloatSize> preferredPresentationSize = { }, const String& contentType = { }) = 0; >+ virtual bool readFilePath(const String&, Optional<float> preferredPresentationWidth = { }, Optional<float> preferredPresentationHeight = { }, const String& contentType = { }) = 0; > virtual bool readFilePaths(const Vector<String>&) = 0; > virtual bool readHTML(const String&) = 0; > virtual bool readRTFD(SharedBuffer&) = 0; > virtual bool readRTF(SharedBuffer&) = 0; >- virtual bool readImage(Ref<SharedBuffer>&&, const String& type, Optional<FloatSize> preferredPresentationSize = { }) = 0; >+ virtual bool readImage(Ref<SharedBuffer>&&, const String& type, Optional<float> preferredPresentationWidth = { }, Optional<float> preferredPresentationHeight = { }) = 0; > virtual bool readURL(const URL&, const String& title) = 0; >- virtual bool readDataBuffer(SharedBuffer&, const String& type, const String& name, Optional<FloatSize> preferredPresentationSize = { }) = 0; >+ virtual bool readDataBuffer(SharedBuffer&, const String& type, const String& name, Optional<float> preferredPresentationWidth = { }, Optional<float> preferredPresentationHeight = { }) = 0; > #endif > virtual bool readPlainText(const String&) = 0; > }; >diff --git a/Source/WebCore/platform/PasteboardItemInfo.h b/Source/WebCore/platform/PasteboardItemInfo.h >index 903996245e85567147f24da93adc6e1a3cbf4903..5e06de6a60fe2cce36561ae26947c9d0b800bf53 100644 >--- a/Source/WebCore/platform/PasteboardItemInfo.h >+++ b/Source/WebCore/platform/PasteboardItemInfo.h >@@ -42,7 +42,8 @@ struct PasteboardItemInfo { > Vector<String> contentTypesForFileUpload; > Vector<String> contentTypesByFidelity; > String suggestedFileName; >- Optional<FloatSize> preferredPresentationSize; >+ Optional<float> preferredPresentationWidth; >+ Optional<float> preferredPresentationHeight; > bool isNonTextType { false }; > bool containsFileURLAndFileUploadContent { false }; > PasteboardItemPresentationStyle preferredPresentationStyle { PasteboardItemPresentationStyle::Unspecified }; >@@ -98,7 +99,7 @@ struct PasteboardItemInfo { > template<class Encoder> > void PasteboardItemInfo::encode(Encoder& encoder) const > { >- encoder << pathsForFileUpload << contentTypesForFileUpload << contentTypesByFidelity << suggestedFileName << preferredPresentationSize << isNonTextType << containsFileURLAndFileUploadContent; >+ encoder << pathsForFileUpload << contentTypesForFileUpload << contentTypesByFidelity << suggestedFileName << preferredPresentationWidth << preferredPresentationHeight << isNonTextType << containsFileURLAndFileUploadContent; > encoder.encodeEnum(preferredPresentationStyle); > } > >@@ -118,7 +119,10 @@ Optional<PasteboardItemInfo> PasteboardItemInfo::decode(Decoder& decoder) > if (!decoder.decode(result.suggestedFileName)) > return WTF::nullopt; > >- if (!decoder.decode(result.preferredPresentationSize)) >+ if (!decoder.decode(result.preferredPresentationWidth)) >+ return WTF::nullopt; >+ >+ if (!decoder.decode(result.preferredPresentationHeight)) > return WTF::nullopt; > > if (!decoder.decode(result.isNonTextType)) >diff --git a/Source/WebCore/platform/ios/PasteboardIOS.mm b/Source/WebCore/platform/ios/PasteboardIOS.mm >index 8e005cab51abc3d631cd54b3f31d0338ca8f5e4e..357fcde4c9889d9bfcf33c3f000207c54b809361 100644 >--- a/Source/WebCore/platform/ios/PasteboardIOS.mm >+++ b/Source/WebCore/platform/ios/PasteboardIOS.mm >@@ -225,7 +225,7 @@ Pasteboard::ReaderResult Pasteboard::readPasteboardWebContentDataForType(Pastebo > RefPtr<SharedBuffer> buffer = strategy.readBufferFromPasteboard(itemIndex, type, m_pasteboardName); > if (m_changeCount != changeCount()) > return ReaderResult::PasteboardWasChangedExternally; >- return buffer && reader.readImage(buffer.releaseNonNull(), type, itemInfo.preferredPresentationSize) ? ReaderResult::ReadType : ReaderResult::DidNotReadType; >+ return buffer && reader.readImage(buffer.releaseNonNull(), type, itemInfo.preferredPresentationWidth, itemInfo.preferredPresentationHeight) ? ReaderResult::ReadType : ReaderResult::DidNotReadType; > } > > if ([type isEqualToString:(__bridge NSString *)kUTTypeURL]) { >@@ -307,7 +307,7 @@ void Pasteboard::read(PasteboardWebContentReader& reader, WebContentReadingPolic > auto typeForFileUpload = info.contentTypeForHighestFidelityItem(); > if (auto buffer = strategy.readBufferFromPasteboard(i, typeForFileUpload, m_pasteboardName)) { > readURLAlongsideAttachmentIfNecessary(reader, strategy, typeForFileUpload, m_pasteboardName, i); >- reader.readDataBuffer(*buffer, typeForFileUpload, info.suggestedFileName, info.preferredPresentationSize); >+ reader.readDataBuffer(*buffer, typeForFileUpload, info.suggestedFileName, info.preferredPresentationWidth, info.preferredPresentationHeight); > continue; > } > } >@@ -348,7 +348,7 @@ void Pasteboard::readRespectingUTIFidelities(PasteboardWebContentReader& reader, > auto contentType = info.contentTypeForHighestFidelityItem(); > if (canReadAttachment && prefersAttachmentRepresentation(info)) { > readURLAlongsideAttachmentIfNecessary(reader, strategy, contentType, m_pasteboardName, index); >- reader.readFilePath(WTFMove(attachmentFilePath), info.preferredPresentationSize, contentType); >+ reader.readFilePath(WTFMove(attachmentFilePath), info.preferredPresentationWidth, info.preferredPresentationHeight, contentType); > continue; > } > #endif >@@ -367,7 +367,7 @@ void Pasteboard::readRespectingUTIFidelities(PasteboardWebContentReader& reader, > } > #if ENABLE(ATTACHMENT_ELEMENT) > if (canReadAttachment && result == ReaderResult::DidNotReadType) >- reader.readFilePath(WTFMove(attachmentFilePath), info.preferredPresentationSize, contentType); >+ reader.readFilePath(WTFMove(attachmentFilePath), info.preferredPresentationWidth, info.preferredPresentationHeight, contentType); > #endif > } > } >diff --git a/Source/WebCore/platform/ios/PlatformPasteboardIOS.mm b/Source/WebCore/platform/ios/PlatformPasteboardIOS.mm >index 8a86e4a4007dd5038eff308057fc07bc22597a24..2136daf380ef024f05d3d61cd6799da7419f407d 100644 >--- a/Source/WebCore/platform/ios/PlatformPasteboardIOS.mm >+++ b/Source/WebCore/platform/ios/PlatformPasteboardIOS.mm >@@ -31,6 +31,7 @@ > #import "Color.h" > #import "Image.h" > #import "Pasteboard.h" >+#import "RuntimeApplicationChecks.h" > #import "SharedBuffer.h" > #import "UTIUtilities.h" > #import "WebItemProviderPasteboard.h" >@@ -155,8 +156,11 @@ PasteboardItemInfo PlatformPasteboard::informationForItemAtIndex(int index) > #if PASTEBOARD_SUPPORTS_PRESENTATION_STYLE_AND_TEAM_DATA > info.preferredPresentationStyle = pasteboardItemPresentationStyle(itemProvider.preferredPresentationStyle); > #endif >- if (!CGSizeEqualToSize(itemProvider.preferredPresentationSize, CGSizeZero)) >- info.preferredPresentationSize = FloatSize { itemProvider.preferredPresentationSize }; >+ if (!CGSizeEqualToSize(itemProvider.preferredPresentationSize, CGSizeZero)) { >+ info.preferredPresentationWidth = itemProvider.preferredPresentationSize.width; >+ if (!IOSApplication::isMobileMail()) >+ info.preferredPresentationHeight = itemProvider.preferredPresentationSize.height; >+ } > info.containsFileURLAndFileUploadContent = itemProvider.web_containsFileURLAndFileUploadContent; > info.suggestedFileName = itemProvider.suggestedName; > NSArray<NSString *> *registeredTypeIdentifiers = itemProvider.registeredTypeIdentifiers;
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
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 198623
:
371527
|
371589