https://bugs.webkit.org/show_bug.cgi?id=172327
<rdar://problem/
32282831>
Reviewed by Tim Horton.
When creating a drag image for an attachment element, don't include borders around the attachment.
* page/DragController.cpp:
(WebCore::DragController::startDrag):
* rendering/RenderAttachment.h:
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::paintAttachment):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217083
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2017-05-18 Wenson Hsieh <wenson_hsieh@apple.com>
+
+ Attachment drag preview should not have the attachment outline
+ https://bugs.webkit.org/show_bug.cgi?id=172327
+ <rdar://problem/32282831>
+
+ Reviewed by Tim Horton.
+
+ When creating a drag image for an attachment element, don't include borders around the attachment.
+
+ * page/DragController.cpp:
+ (WebCore::DragController::startDrag):
+ * rendering/RenderAttachment.h:
+ * rendering/RenderThemeIOS.mm:
+ (WebCore::RenderThemeIOS::paintAttachment):
+
2017-05-18 Youenn Fablet <youenn@apple.com>
Make WebRTC logging happen in Release
#include "PluginDocument.h"
#include "PluginViewBase.h"
#include "Position.h"
+#include "RenderAttachment.h"
#include "RenderFileUploadControl.h"
#include "RenderImage.h"
#include "RenderView.h"
#if ENABLE(ATTACHMENT_ELEMENT)
if (is<HTMLAttachmentElement>(element) && m_dragSourceAction & DragSourceActionAttachment) {
+ auto* attachmentRenderer = downcast<HTMLAttachmentElement>(element).renderer();
+ if (!attachmentRenderer)
+ return false;
+
src.editor().setIgnoreSelectionChanges(true);
auto previousSelection = src.selection().selection();
if (!dataTransfer.pasteboard().hasData()) {
if (!dragImage) {
TextIndicatorData textIndicator;
+ attachmentRenderer->setShouldDrawBorder(false);
dragImage = DragImage { dissolveDragImageToFraction(createDragImageForSelection(src, textIndicator), DragImageAlpha) };
+ attachmentRenderer->setShouldDrawBorder(true);
if (textIndicator.contentImage)
dragImage.setIndicatorData(textIndicator);
dragLoc = dragLocForSelectionDrag(src);
HTMLAttachmentElement& attachmentElement() const;
+ void setShouldDrawBorder(bool drawBorder) { m_shouldDrawBorder = drawBorder; }
+ bool shouldDrawBorder() const { return m_shouldDrawBorder; }
+
void invalidate();
private:
int baselinePosition(FontBaseline, bool, LineDirectionMode, LinePositionMode) const override;
LayoutUnit m_minimumIntrinsicWidth;
+ bool m_shouldDrawBorder { true };
};
inline RenderAttachment* HTMLAttachmentElement::renderer() const
context.translate(toFloatSize(paintRect.location()));
- Path borderPath = attachmentBorderPath(info);
- paintAttachmentBorder(context, borderPath);
- context.clipPath(borderPath);
+ if (attachment.shouldDrawBorder()) {
+ auto borderPath = attachmentBorderPath(info);
+ paintAttachmentBorder(context, borderPath);
+ context.clipPath(borderPath);
+ }
context.translate(FloatSize(0, info.contentYOrigin));