[Webkit-unassigned] [Bug 188464] Support drag-and-drop for input[type=color]

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Aug 10 20:37:39 PDT 2018


https://bugs.webkit.org/show_bug.cgi?id=188464

--- Comment #26 from Daniel Bates <dbates at webkit.org> ---
Comment on attachment 346938
  --> https://bugs.webkit.org/attachment.cgi?id=346938
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=346938&action=review

I haven’t read through the entire patch. Here are some comment so far.

> Source/WebCore/page/DragController.cpp:353
> +        if (input.isColorControl() && !input.isDisabledFormControl())

We should not allow dragging when the control is read-only.

> Source/WebCore/page/DragController.cpp:1179
> +        Color color = input.valueAsColor();

Auto?

> Source/WebCore/page/DragController.cpp:1185
> +        dragImageOffset = IntPoint(dragImageSize(dragImage.get()));

Uniform intialization syntax?

> Source/WebCore/platform/ios/DragImageIOS.mm:256
> +    FloatRect imageRect(0, 0, elementRect.width() * pageScaleFactor, elementRect.height() * pageScaleFactor);

Uniform initialization syntax?

> Source/WebCore/platform/ios/DragImageIOS.mm:259
> +    UIImage *image = [render.get() imageWithActions:^(UIGraphicsImageRendererContext *rendererContext) {

The .get() is not needed.

> Source/WebCore/platform/ios/DragImageIOS.mm:260
> +        GraphicsContext context(rendererContext.CGContext);

Uniform initialization syntax.

> Source/WebCore/platform/ios/DragImageIOS.mm:263
> +        context.fillRoundedRect(FloatRoundedRect(imageRect, FloatRoundedRect::Radii(4 * pageScaleFactor)), color);

Ditto. Also, we should cache the rounded rect in a local and then reference it here and in line 266 below as opposed to computing it twice.

> Source/WebCore/platform/ios/DragImageIOS.mm:266
> +    visiblePath.addRoundedRect(FloatRoundedRect(imageRect, FloatRoundedRect::Radii(4 * pageScaleFactor)));

How did you come up with 4 here and above?

> Source/WebCore/platform/mac/DragDataMac.mm:94
> +    return String(UIColorPboardType);

Uniform initialization syntax?

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20180811/5a12e7d6/attachment.html>


More information about the webkit-unassigned mailing list