[webkit-changes] [239547] trunk/Source/WebKit

2018-12-23 Thread wenson_hsieh
Title: [239547] trunk/Source/WebKit








Revision 239547
Author wenson_hs...@apple.com
Date 2018-12-23 21:07:01 -0800 (Sun, 23 Dec 2018)


Log Message
[iOS] Remove some unnecessary editing SPI after 
https://bugs.webkit.org/show_bug.cgi?id=193019

Reviewed by Dan Bernstein.

Remove these SPI method declarations, as well as method forwarding in WKContentView. Mail was the only adoptee
of these methods; after , they have moved to the underscore-prefixed versions, so we
we have no need for these erroneously-named SPI methods anymore. There is no change in behavior; verified this
through existing API tests (WKWebViewEditActions), as well as building iOS Mail against WebKit with these
changes to WKWebViewPrivate.h.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView canPerformAction:withSender:]):
(-[WKWebView targetForAction:withSender:]):
(-[WKWebView _setFont:sender:]):
(-[WKWebView _setFontSize:sender:]):
(-[WKWebView _setTextColor:sender:]):
(-[WKWebView setFont:sender:]): Deleted.
(-[WKWebView setTextColor:sender:]): Deleted.
(-[WKWebView setFontSize:sender:]): Deleted.
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView canPerformActionForWebView:withSender:]):
(-[WKContentView setFontForWebView:sender:]): Deleted.
(-[WKContentView setFontSizeForWebView:sender:]): Deleted.
(-[WKContentView setTextColorForWebView:sender:]): Deleted.

Modified Paths

trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h
trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h
trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm




Diff

Modified: trunk/Source/WebKit/ChangeLog (239546 => 239547)

--- trunk/Source/WebKit/ChangeLog	2018-12-23 23:51:30 UTC (rev 239546)
+++ trunk/Source/WebKit/ChangeLog	2018-12-24 05:07:01 UTC (rev 239547)
@@ -1,5 +1,35 @@
 2018-12-23  Wenson Hsieh  
 
+[iOS] Remove some unnecessary editing SPI after 
+https://bugs.webkit.org/show_bug.cgi?id=193019
+
+Reviewed by Dan Bernstein.
+
+Remove these SPI method declarations, as well as method forwarding in WKContentView. Mail was the only adoptee
+of these methods; after , they have moved to the underscore-prefixed versions, so we
+we have no need for these erroneously-named SPI methods anymore. There is no change in behavior; verified this
+through existing API tests (WKWebViewEditActions), as well as building iOS Mail against WebKit with these
+changes to WKWebViewPrivate.h.
+
+* UIProcess/API/Cocoa/WKWebView.mm:
+(-[WKWebView canPerformAction:withSender:]):
+(-[WKWebView targetForAction:withSender:]):
+(-[WKWebView _setFont:sender:]):
+(-[WKWebView _setFontSize:sender:]):
+(-[WKWebView _setTextColor:sender:]):
+(-[WKWebView setFont:sender:]): Deleted.
+(-[WKWebView setTextColor:sender:]): Deleted.
+(-[WKWebView setFontSize:sender:]): Deleted.
+* UIProcess/API/Cocoa/WKWebViewPrivate.h:
+* UIProcess/ios/WKContentViewInteraction.h:
+* UIProcess/ios/WKContentViewInteraction.mm:
+(-[WKContentView canPerformActionForWebView:withSender:]):
+(-[WKContentView setFontForWebView:sender:]): Deleted.
+(-[WKContentView setFontSizeForWebView:sender:]): Deleted.
+(-[WKContentView setTextColorForWebView:sender:]): Deleted.
+
+2018-12-23  Wenson Hsieh  
+
 Fix fast/ruby/ruby-base-merge-block-children-crash-2.html after r239543
 https://bugs.webkit.org/show_bug.cgi?id=193015
 


Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm (239546 => 239547)

--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm	2018-12-23 23:51:30 UTC (rev 239546)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm	2018-12-24 05:07:01 UTC (rev 239547)
@@ -1445,9 +1445,6 @@
 
 FOR_EACH_WKCONTENTVIEW_ACTION(FORWARD_CANPERFORMACTION_TO_WKCONTENTVIEW)
 FOR_EACH_PRIVATE_WKCONTENTVIEW_ACTION(FORWARD_CANPERFORMACTION_TO_WKCONTENTVIEW)
-FORWARD_CANPERFORMACTION_TO_WKCONTENTVIEW(setTextColor:sender)
-FORWARD_CANPERFORMACTION_TO_WKCONTENTVIEW(setFontSize:sender)
-FORWARD_CANPERFORMACTION_TO_WKCONTENTVIEW(setFont:sender)
 FORWARD_CANPERFORMACTION_TO_WKCONTENTVIEW(_setTextColor:sender)
 FORWARD_CANPERFORMACTION_TO_WKCONTENTVIEW(_setFontSize:sender)
 FORWARD_CANPERFORMACTION_TO_WKCONTENTVIEW(_setFont:sender)
@@ -1465,9 +1462,6 @@
 
 FOR_EACH_WKCONTENTVIEW_ACTION(FORWARD_TARGETFORACTION_TO_WKCONTENTVIEW)
 FOR_EACH_PRIVATE_WKCONTENTVIEW_ACTION(FORWARD_TARGETFORACTION_TO_WKCONTENTVIEW)
-FORWARD_TARGETFORACTION_TO_WKCONTENTVIEW(setTextColor:sender)
-FORWARD_TARGETFORACTION_TO_WKCONTENTVIEW(setFontSize:sender)
-FORWARD_TARGETFORACTION_TO_WKCONTENTVIEW(setFont:sender)
 

[webkit-changes] [239546] trunk/Source/WebKit

2018-12-23 Thread wenson_hsieh
Title: [239546] trunk/Source/WebKit








Revision 239546
Author wenson_hs...@apple.com
Date 2018-12-23 15:51:30 -0800 (Sun, 23 Dec 2018)


Log Message
Fix fast/ruby/ruby-base-merge-block-children-crash-2.html after r239543
https://bugs.webkit.org/show_bug.cgi?id=193015


Reviewed by Tim Horton.

Fix the crash by gracefully handling integer overflow when computing the area of a very large editable element.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
(-[WKContentView _updateChangedSelection:]):

Modified Paths

trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm




Diff

Modified: trunk/Source/WebKit/ChangeLog (239545 => 239546)

--- trunk/Source/WebKit/ChangeLog	2018-12-23 10:46:38 UTC (rev 239545)
+++ trunk/Source/WebKit/ChangeLog	2018-12-23 23:51:30 UTC (rev 239546)
@@ -1,3 +1,17 @@
+2018-12-23  Wenson Hsieh  
+
+Fix fast/ruby/ruby-base-merge-block-children-crash-2.html after r239543
+https://bugs.webkit.org/show_bug.cgi?id=193015
+
+
+Reviewed by Tim Horton.
+
+Fix the crash by gracefully handling integer overflow when computing the area of a very large editable element.
+
+* UIProcess/ios/WKContentViewInteraction.mm:
+(-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
+(-[WKContentView _updateChangedSelection:]):
+
 2018-12-22  Wenson Hsieh  
 
 [iOS] Suppress native selection behaviors when focusing a very small editable element


Modified: trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm (239545 => 239546)

--- trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm	2018-12-23 10:46:38 UTC (rev 239545)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm	2018-12-23 23:51:30 UTC (rev 239546)
@@ -4476,7 +4476,8 @@
 else
 [self _stopSuppressingSelectionAssistantForReason:WebKit::FocusedElementIsTransparent];
 
-if (information.elementRect.area() < minimumFocusedElementAreaForSuppressingSelectionAssistant)
+auto elementArea = information.elementRect.area();
+if (!elementArea.hasOverflowed() && elementArea < minimumFocusedElementAreaForSuppressingSelectionAssistant)
 [self _beginSuppressingSelectionAssistantForReason:WebKit::FocusedElementIsTooSmall];
 else
 [self _stopSuppressingSelectionAssistantForReason:WebKit::FocusedElementIsTooSmall];
@@ -5013,7 +5014,8 @@
 else
 [self _stopSuppressingSelectionAssistantForReason:WebKit::FocusedElementIsTransparent];
 
-if (postLayoutData.focusedElementRect.area() < minimumFocusedElementAreaForSuppressingSelectionAssistant)
+auto elementArea = postLayoutData.focusedElementRect.area();
+if (!elementArea.hasOverflowed() && elementArea < minimumFocusedElementAreaForSuppressingSelectionAssistant)
 [self _beginSuppressingSelectionAssistantForReason:WebKit::FocusedElementIsTooSmall];
 else
 [self _stopSuppressingSelectionAssistantForReason:WebKit::FocusedElementIsTooSmall];






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [239545] trunk/LayoutTests

2018-12-23 Thread carlosgc
Title: [239545] trunk/LayoutTests








Revision 239545
Author carlo...@webkit.org
Date 2018-12-23 02:46:38 -0800 (Sun, 23 Dec 2018)


Log Message
Unreviewed GTK+ gardening. Rebaseline fast/text/zero-font-size.html after r239539.

* platform/gtk/fast/text/zero-font-size-expected.txt:

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/platform/gtk/fast/text/zero-font-size-expected.txt




Diff

Modified: trunk/LayoutTests/ChangeLog (239544 => 239545)

--- trunk/LayoutTests/ChangeLog	2018-12-23 10:09:09 UTC (rev 239544)
+++ trunk/LayoutTests/ChangeLog	2018-12-23 10:46:38 UTC (rev 239545)
@@ -1,3 +1,9 @@
+2018-12-23  Carlos Garcia Campos  
+
+Unreviewed GTK+ gardening. Rebaseline fast/text/zero-font-size.html after r239539.
+
+* platform/gtk/fast/text/zero-font-size-expected.txt:
+
 2018-12-13  Yusuke Suzuki  
 
 [BigInt] Support BigInt in JSON.stringify


Modified: trunk/LayoutTests/platform/gtk/fast/text/zero-font-size-expected.txt (239544 => 239545)

--- trunk/LayoutTests/platform/gtk/fast/text/zero-font-size-expected.txt	2018-12-23 10:09:09 UTC (rev 239544)
+++ trunk/LayoutTests/platform/gtk/fast/text/zero-font-size-expected.txt	2018-12-23 10:46:38 UTC (rev 239545)
@@ -8,8 +8,8 @@
   text run at (0,0) width 770: "Test that text with 0px font size is not displayed, even if a non-zero minimum font size setting is specified. On success, this"
   text run at (0,18) width 336: "paragraph should be the only text visible on the page."
   RenderBlock {DIV} at (0,52) size 784x0 [color=#FF]
-RenderText {#text} at (0,0) size 3x0
-  text run at (0,0) width 3: "FAIL"
+RenderText {#text} at (0,0) size 0x0
+  text run at (0,0) width 0: "FAIL"
   RenderBlock {DIV} at (0,52) size 784x0 [color=#FF]
-RenderText {#text} at (0,0) size 3x0
-  text run at (0,0) width 3: "FAIL"
+RenderText {#text} at (0,0) size 0x0
+  text run at (0,0) width 0: "FAIL"






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [239544] trunk

2018-12-23 Thread yusukesuzuki
Title: [239544] trunk








Revision 239544
Author yusukesuz...@slowstart.org
Date 2018-12-23 02:09:09 -0800 (Sun, 23 Dec 2018)


Log Message
[BigInt] Support BigInt in JSON.stringify
https://bugs.webkit.org/show_bug.cgi?id=192624

Reviewed by Saam Barati.

JSTests:

* stress/big-int-json-stringify-to-json.js: Added.
(shouldBe):
(shouldThrow):
(BigInt.prototype.toJSON):
(shouldBe.JSON.stringify):
* stress/big-int-json-stringify.js: Added.
(shouldBe):
(shouldThrow):

Source/_javascript_Core:

This patch adds BigInt support to JSON.stringify, specified in [1].

[1]: https://tc39.github.io/proposal-bigint/#sec-serializejsonproperty

* runtime/JSONObject.cpp:
(JSC::unwrapBoxedPrimitive):
(JSC::Stringifier::toJSON):
(JSC::Stringifier::toJSONImpl):
(JSC::Stringifier::appendStringifiedValue):

LayoutTests:

The test is wrong according to the spec[1]. valueOf of Boolean object won't be called.

[1]: https://tc39.github.io/ecma262/#sec-serializejsonproperty

* js/resources/JSON-stringify.js:
* js/resources/json2-es5-compat.js:
(str):

Modified Paths

trunk/JSTests/ChangeLog
trunk/LayoutTests/ChangeLog
trunk/LayoutTests/js/resources/JSON-stringify.js
trunk/LayoutTests/js/resources/json2-es5-compat.js
trunk/Source/_javascript_Core/ChangeLog
trunk/Source/_javascript_Core/runtime/JSONObject.cpp


Added Paths

trunk/JSTests/stress/big-int-json-stringify-to-json.js
trunk/JSTests/stress/big-int-json-stringify.js




Diff

Modified: trunk/JSTests/ChangeLog (239543 => 239544)

--- trunk/JSTests/ChangeLog	2018-12-23 06:38:24 UTC (rev 239543)
+++ trunk/JSTests/ChangeLog	2018-12-23 10:09:09 UTC (rev 239544)
@@ -1,3 +1,19 @@
+2018-12-13  Yusuke Suzuki  
+
+[BigInt] Support BigInt in JSON.stringify
+https://bugs.webkit.org/show_bug.cgi?id=192624
+
+Reviewed by Saam Barati.
+
+* stress/big-int-json-stringify-to-json.js: Added.
+(shouldBe):
+(shouldThrow):
+(BigInt.prototype.toJSON):
+(shouldBe.JSON.stringify):
+* stress/big-int-json-stringify.js: Added.
+(shouldBe):
+(shouldThrow):
+
 2018-12-20  Yusuke Suzuki  
 
 [JSC] Implement "well-formed JSON.stringify" proposal


Added: trunk/JSTests/stress/big-int-json-stringify-to-json.js (0 => 239544)

--- trunk/JSTests/stress/big-int-json-stringify-to-json.js	(rev 0)
+++ trunk/JSTests/stress/big-int-json-stringify-to-json.js	2018-12-23 10:09:09 UTC (rev 239544)
@@ -0,0 +1,50 @@
+//@ runBigIntEnabled
+
+function shouldBe(actual, expected)
+{
+if (actual !== expected)
+throw new Error('bad value: ' + actual);
+}
+noInline(shouldBe);
+
+function shouldThrow(func, errorMessage) {
+var errorThrown = false;
+var error = null;
+try {
+func();
+} catch (e) {
+errorThrown = true;
+error = e;
+}
+if (!errorThrown)
+throw new Error('not thrown');
+if (String(error) !== errorMessage)
+throw new Error(`bad error: ${String(error)}`);
+}
+noInline(shouldThrow);
+
+var counter = 0;
+BigInt.prototype.toJSON = function () {
+++counter;
+return Number(String(this));
+};
+
+shouldBe(JSON.stringify(0n), `0`);
+shouldBe(counter, 1);
+
+shouldBe(JSON.stringify([0n]), `[0]`);
+shouldBe(counter, 2);
+
+shouldBe(JSON.stringify({hello:0n}), `{"hello":0}`);
+shouldBe(counter, 3);
+
+var bigIntObject = Object(0n);
+
+shouldBe(JSON.stringify(bigIntObject), `0`);
+shouldBe(counter, 4);
+
+shouldBe(JSON.stringify([bigIntObject]), `[0]`);
+shouldBe(counter, 5);
+
+shouldBe(JSON.stringify({hello:bigIntObject}), `{"hello":0}`);
+shouldBe(counter, 6);


Added: trunk/JSTests/stress/big-int-json-stringify.js (0 => 239544)

--- trunk/JSTests/stress/big-int-json-stringify.js	(rev 0)
+++ trunk/JSTests/stress/big-int-json-stringify.js	2018-12-23 10:09:09 UTC (rev 239544)
@@ -0,0 +1,52 @@
+//@ runBigIntEnabled
+
+function shouldBe(actual, expected)
+{
+if (actual !== expected)
+throw new Error('bad value: ' + actual);
+}
+noInline(shouldBe);
+
+function shouldThrow(func, errorMessage) {
+var errorThrown = false;
+var error = null;
+try {
+func();
+} catch (e) {
+errorThrown = true;
+error = e;
+}
+if (!errorThrown)
+throw new Error('not thrown');
+if (String(error) !== errorMessage)
+throw new Error(`bad error: ${String(error)}`);
+}
+noInline(shouldThrow);
+
+shouldThrow(() => {
+JSON.stringify(0n);
+}, `TypeError: JSON.stringify cannot serialize BigInt.`);
+
+shouldThrow(() => {
+JSON.stringify([0n]);
+}, `TypeError: JSON.stringify cannot serialize BigInt.`);
+
+shouldThrow(() => {
+JSON.stringify({hello:0n});
+}, `TypeError: JSON.stringify cannot serialize BigInt.`);
+
+var bigIntObject = Object(0n);
+
+shouldThrow(() => {
+JSON.stringify(bigIntObject);
+}, `TypeError: JSON.stringify cannot serialize BigInt.`);
+
+shouldThrow(() => {
+JSON.stringify([bigIntObject]);
+}, `TypeError: JSON.stringify