[webkit-changes] [223471] trunk

2017-10-16 Thread wenson_hsieh
Title: [223471] trunk








Revision 223471
Author wenson_hs...@apple.com
Date 2017-10-16 23:56:00 -0700 (Mon, 16 Oct 2017)


Log Message
Allow reading data and blob URLs via DataTransfer when the pasteboard contains files
https://bugs.webkit.org/show_bug.cgi?id=178377

Reviewed by Ryosuke Niwa.

Source/WebCore:

Adds data and blob URLs, alongside http(s), as URL protocols safe to expose to bindings.

Test: editing/pasteboard/drag-drop-href-as-url.html

* platform/Pasteboard.cpp:
(WebCore::Pasteboard::canExposeURLToDOMWhenPasteboardContainsFiles):

LayoutTests:

Tweaks an existing layout test to test dragging and dropping more URL protocols (ftp:, data: and blob:).

* editing/pasteboard/drag-drop-href-as-url-expected.txt:
* editing/pasteboard/drag-drop-href-as-url.html:

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/editing/pasteboard/drag-drop-href-as-url-expected.txt
trunk/LayoutTests/editing/pasteboard/drag-drop-href-as-url.html
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/platform/Pasteboard.cpp




Diff

Modified: trunk/LayoutTests/ChangeLog (223470 => 223471)

--- trunk/LayoutTests/ChangeLog	2017-10-17 06:51:39 UTC (rev 223470)
+++ trunk/LayoutTests/ChangeLog	2017-10-17 06:56:00 UTC (rev 223471)
@@ -1,3 +1,15 @@
+2017-10-16  Wenson Hsieh  
+
+Allow reading data and blob URLs via DataTransfer when the pasteboard contains files
+https://bugs.webkit.org/show_bug.cgi?id=178377
+
+Reviewed by Ryosuke Niwa.
+
+Tweaks an existing layout test to test dragging and dropping more URL protocols (ftp:, data: and blob:).
+
+* editing/pasteboard/drag-drop-href-as-url-expected.txt:
+* editing/pasteboard/drag-drop-href-as-url.html:
+
 2017-10-16  Ryosuke Niwa  
 
 Strip away event handlers and _javascript_ URLs when copying


Modified: trunk/LayoutTests/editing/pasteboard/drag-drop-href-as-url-expected.txt (223470 => 223471)

--- trunk/LayoutTests/editing/pasteboard/drag-drop-href-as-url-expected.txt	2017-10-17 06:51:39 UTC (rev 223470)
+++ trunk/LayoutTests/editing/pasteboard/drag-drop-href-as-url-expected.txt	2017-10-17 06:56:00 UTC (rev 223471)
@@ -9,3 +9,18 @@
 url: ""
 text/uri-list: ""
 Found file of type image/png
+3. link.href = ""
+URL: "data:text/plain;base64,SGVsbG8sIFdvcmxkIQ%3D%3D"
+url: "data:text/plain;base64,SGVsbG8sIFdvcmxkIQ%3D%3D"
+text/uri-list: "data:text/plain;base64,SGVsbG8sIFdvcmxkIQ%3D%3D"
+Found file of type image/png
+4. link.href = ""
+URL: "blob:https://www.webkit.org/1ef10222-3882-48c0-875e-1b55e845a931"
+url: "blob:https://www.webkit.org/1ef10222-3882-48c0-875e-1b55e845a931"
+text/uri-list: "blob:https://www.webkit.org/1ef10222-3882-48c0-875e-1b55e845a931"
+Found file of type image/png
+5. link.href = ""
+URL: ""
+url: ""
+text/uri-list: ""
+Found file of type image/png


Modified: trunk/LayoutTests/editing/pasteboard/drag-drop-href-as-url.html (223470 => 223471)

--- trunk/LayoutTests/editing/pasteboard/drag-drop-href-as-url.html	2017-10-17 06:51:39 UTC (rev 223470)
+++ trunk/LayoutTests/editing/pasteboard/drag-drop-href-as-url.html	2017-10-17 06:56:00 UTC (rev 223471)
@@ -30,6 +30,16 @@
 target.appendChild(div);
 }
 
+function simulateDragAndDrop() {
+let x = source.offsetLeft + source.offsetWidth / 2;
+let y = source.offsetTop + source.offsetHeight / 2;
+eventSender.mouseMoveTo(x, y);
+eventSender.mouseDown();
+eventSender.leapForward(500);
+eventSender.mouseMoveTo(x, y + 300);
+eventSender.mouseUp();
+}
+
 async function setup() {
 target.addEventListener("dragenter", event => event.preventDefault());
 target.addEventListener("dragover", event => event.preventDefault());
@@ -49,24 +59,26 @@
 testRunner.waitUntilDone();
 
 await source.decode();
-let x = source.offsetLeft + source.offsetWidth / 2;
-let y = source.offsetTop + source.offsetHeight / 2;
 
 append(`1. link.href = ""
-eventSender.mouseMoveTo(x, y);
-eventSender.mouseDown();
-eventSender.leapForward(500);
-eventSender.mouseMoveTo(x, y + 300);
-eventSender.mouseUp();
+simulateDragAndDrop();
 
 link.href = ""
 append(`2. link.href = ""
-eventSender.mouseMoveTo(x, y);
-eventSender.mouseDown();
-eventSender.leapForward(500);
-eventSender.mouseMoveTo(x, y + 300);
-eventSender.mouseUp();
+simulateDragAndDrop();
 
+link.href = ""
+append(`3. link.href = ""
+simulateDragAndDrop();
+
+link.href = ""
+append(`4. link.href = ""
+simulateDragAndDrop();
+
+link.href = ""
+append(`5. link.href = ""
+simulateDragAndDrop();
+
 testRunner.notifyDone();
 }
 


Modified: trunk/Source/WebCore/ChangeLog (223470 => 223471)

--- trunk/Source/WebCore/ChangeLog	2017-10-17 06:51:39 UTC (rev 223470)
+++ trunk/Source/WebCore/ChangeLog	2017-10-17 06:56:00 UTC (rev 223471)
@@ -1,3 +1,17 @@
+2017-10-16  Wenson Hsieh  
+
+Allow reading data and blob URLs via DataTransfer when the pasteboard contains files
+

[webkit-changes] [223470] releases/WebKitGTK/webkit-2.18

2017-10-16 Thread carlosgc
Title: [223470] releases/WebKitGTK/webkit-2.18








Revision 223470
Author carlo...@webkit.org
Date 2017-10-16 23:51:39 -0700 (Mon, 16 Oct 2017)


Log Message
Merge r222588 - Minimum font size may cause elements to have an infinite line-height
https://bugs.webkit.org/show_bug.cgi?id=177573


Reviewed by Dan Bernstein.

Source/WebCore:

When minimum font size is specified, we were trying to preserve the ratio of specified font-size
and specified line-height in order to boost the computed font size proportionately to the font-size
boost. However, this doesn't work when the specified font-size is 0, because the ratio between
line-height and font-size is infinite.

The most straightforward solution is just to make small font-sizes opt out of the line-height
adjustment because the result would be too big.

Test: fast/text/line-height-minimumFontSize-text-small-font-size.html

* css/StyleBuilderCustom.h:
(WebCore::computeLineHeightMultiplierDueToFontSize):
(WebCore::StyleBuilderCustom::applyValueLineHeight):

LayoutTests:

* fast/text/line-height-minimumFontSize-text-small-font-size-expected.txt: Added.
* fast/text/line-height-minimumFontSize-text-small-font-size.html: Added.

Modified Paths

releases/WebKitGTK/webkit-2.18/LayoutTests/ChangeLog
releases/WebKitGTK/webkit-2.18/Source/WebCore/ChangeLog
releases/WebKitGTK/webkit-2.18/Source/WebCore/css/StyleBuilderCustom.h


Added Paths

releases/WebKitGTK/webkit-2.18/LayoutTests/fast/text/line-height-minimumFontSize-text-small-font-size-expected.txt
releases/WebKitGTK/webkit-2.18/LayoutTests/fast/text/line-height-minimumFontSize-text-small-font-size.html




Diff

Modified: releases/WebKitGTK/webkit-2.18/LayoutTests/ChangeLog (223469 => 223470)

--- releases/WebKitGTK/webkit-2.18/LayoutTests/ChangeLog	2017-10-17 06:48:17 UTC (rev 223469)
+++ releases/WebKitGTK/webkit-2.18/LayoutTests/ChangeLog	2017-10-17 06:51:39 UTC (rev 223470)
@@ -1,5 +1,16 @@
 2017-09-27  Myles C. Maxfield  
 
+Minimum font size may cause elements to have an infinite line-height
+https://bugs.webkit.org/show_bug.cgi?id=177573
+
+
+Reviewed by Dan Bernstein.
+
+* fast/text/line-height-minimumFontSize-text-small-font-size-expected.txt: Added.
+* fast/text/line-height-minimumFontSize-text-small-font-size.html: Added.
+
+2017-09-27  Myles C. Maxfield  
+
 "Tag" codepoints require the complex text codepath
 https://bugs.webkit.org/show_bug.cgi?id=177251
 


Added: releases/WebKitGTK/webkit-2.18/LayoutTests/fast/text/line-height-minimumFontSize-text-small-font-size-expected.txt (0 => 223470)

--- releases/WebKitGTK/webkit-2.18/LayoutTests/fast/text/line-height-minimumFontSize-text-small-font-size-expected.txt	(rev 0)
+++ releases/WebKitGTK/webkit-2.18/LayoutTests/fast/text/line-height-minimumFontSize-text-small-font-size-expected.txt	2017-10-17 06:51:39 UTC (rev 223470)
@@ -0,0 +1,5 @@
+PASS document.getElementById('target').offsetHeight < 100 is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+Hi


Added: releases/WebKitGTK/webkit-2.18/LayoutTests/fast/text/line-height-minimumFontSize-text-small-font-size.html (0 => 223470)

--- releases/WebKitGTK/webkit-2.18/LayoutTests/fast/text/line-height-minimumFontSize-text-small-font-size.html	(rev 0)
+++ releases/WebKitGTK/webkit-2.18/LayoutTests/fast/text/line-height-minimumFontSize-text-small-font-size.html	2017-10-17 06:51:39 UTC (rev 223470)
@@ -0,0 +1,18 @@
+
+
+
+
+if (window.internals) {
+internals.settings.setMinimumFontSize(32);
+}
+
+
+
+
Hi
+