[webkit-changes] [248895] trunk

2019-08-20 Thread drousso
Title: [248895] trunk








Revision 248895
Author drou...@apple.com
Date 2019-08-20 00:04:02 -0700 (Tue, 20 Aug 2019)


Log Message
Web Inspector: Use URL constructor to better handle all kinds of URLs
https://bugs.webkit.org/show_bug.cgi?id=165155

Reviewed by Joseph Pecoraro.

Source/WebInspectorUI:

* UserInterface/Base/URLUtilities.js:
(parseURL):

LayoutTests:

* inspector/unit-tests/url-utilities.html:
* inspector/unit-tests/url-utilities-expected.txt:

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/inspector/unit-tests/url-utilities-expected.txt
trunk/LayoutTests/inspector/unit-tests/url-utilities.html
trunk/Source/WebInspectorUI/ChangeLog
trunk/Source/WebInspectorUI/UserInterface/Base/URLUtilities.js




Diff

Modified: trunk/LayoutTests/ChangeLog (248894 => 248895)

--- trunk/LayoutTests/ChangeLog	2019-08-20 06:58:15 UTC (rev 248894)
+++ trunk/LayoutTests/ChangeLog	2019-08-20 07:04:02 UTC (rev 248895)
@@ -1,3 +1,13 @@
+2019-08-20  Devin Rousso  
+
+Web Inspector: Use URL constructor to better handle all kinds of URLs
+https://bugs.webkit.org/show_bug.cgi?id=165155
+
+Reviewed by Joseph Pecoraro.
+
+* inspector/unit-tests/url-utilities.html:
+* inspector/unit-tests/url-utilities-expected.txt:
+
 2019-08-19  Devin Rousso  
 
 Web Inspector: Debugger: add a global breakpoint for pausing in the next microtask


Modified: trunk/LayoutTests/inspector/unit-tests/url-utilities-expected.txt (248894 => 248895)

--- trunk/LayoutTests/inspector/unit-tests/url-utilities-expected.txt	2019-08-20 06:58:15 UTC (rev 248894)
+++ trunk/LayoutTests/inspector/unit-tests/url-utilities-expected.txt	2019-08-20 07:04:02 UTC (rev 248895)
@@ -16,7 +16,7 @@
 PASS: host should be: 'example.com'
 PASS: port should be: 'null'
 PASS: origin should be: 'http://example.com'
-PASS: path should be: 'null'
+PASS: path should be: '/'
 PASS: queryString should be: 'null'
 PASS: fragment should be: 'null'
 PASS: lastPathComponent should be: 'null'
@@ -36,13 +36,24 @@
 PASS: scheme should be: 'http'
 PASS: userinfo should be: 'null'
 PASS: host should be: 'example.com'
-PASS: port should be: '80'
-PASS: origin should be: 'http://example.com:80'
+PASS: port should be: 'null'
+PASS: origin should be: 'http://example.com'
 PASS: path should be: '/'
 PASS: queryString should be: 'null'
 PASS: fragment should be: 'null'
 PASS: lastPathComponent should be: 'null'
 
+Test Valid: http://example.com:42/
+PASS: scheme should be: 'http'
+PASS: userinfo should be: 'null'
+PASS: host should be: 'example.com'
+PASS: port should be: '42'
+PASS: origin should be: 'http://example.com:42'
+PASS: path should be: '/'
+PASS: queryString should be: 'null'
+PASS: fragment should be: 'null'
+PASS: lastPathComponent should be: 'null'
+
 Test Valid: http://example.com/path/to/page.html
 PASS: scheme should be: 'http'
 PASS: userinfo should be: 'null'
@@ -61,7 +72,7 @@
 PASS: port should be: 'null'
 PASS: origin should be: 'http://example.com'
 PASS: path should be: '/path/to/page.html'
-PASS: queryString should be: ''
+PASS: queryString should be: 'null'
 PASS: fragment should be: 'null'
 PASS: lastPathComponent should be: 'page.html'
 
@@ -126,7 +137,7 @@
 PASS: host should be: 'example.com'
 PASS: port should be: 'null'
 PASS: origin should be: 'http://example.com'
-PASS: path should be: 'null'
+PASS: path should be: '/'
 PASS: queryString should be: 'null'
 PASS: fragment should be: 'alpha/beta'
 PASS: lastPathComponent should be: 'null'
@@ -148,7 +159,7 @@
 PASS: host should be: 'example'
 PASS: port should be: 'null'
 PASS: origin should be: 'http://example'
-PASS: path should be: 'null'
+PASS: path should be: '/'
 PASS: queryString should be: 'null'
 PASS: fragment should be: 'null'
 PASS: lastPathComponent should be: 'null'
@@ -159,7 +170,7 @@
 PASS: host should be: 'my.example.com'
 PASS: port should be: 'null'
 PASS: origin should be: 'http://my.example.com'
-PASS: path should be: 'null'
+PASS: path should be: '/'
 PASS: queryString should be: 'null'
 PASS: fragment should be: 'null'
 PASS: lastPathComponent should be: 'null'
@@ -175,54 +186,32 @@
 PASS: fragment should be: 'null'
 PASS: lastPathComponent should be: 'null'
 
--- Known issues 
-
 Test Invalid: http://
-FAIL: Should not be a complete URL
-Expected: truthy
-Actual: false
+PASS: Should not be a complete URL
 PASS: URL constructor thinks this is invalid
 
-Test Invalid: http://example.com:9
-FAIL: Should not be a complete URL
-Expected: truthy
-Actual: false
+Test Invalid: http://example.com:65537
+PASS: Should not be a complete URL
 PASS: URL constructor thinks this is invalid
 
 Test Valid: http:example.com/
-FAIL: scheme should be: 'http'
-Expected: "http"
-Actual: null
+PASS: scheme should be: 'http'
 PASS: userinfo should be: 'null'
-FAIL: host should be: 'example.com'
-Expected: "example.com"
-Actual: null
+PASS: host should be: 'example.com'
 PASS: port should be: 'null'
-FAIL: orig

[webkit-changes] [248896] trunk/Source/WebCore

2019-08-20 Thread youenn
Title: [248896] trunk/Source/WebCore








Revision 248896
Author you...@apple.com
Date 2019-08-20 02:39:25 -0700 (Tue, 20 Aug 2019)


Log Message
PendingActivationMediaStream does not need to be refcounted
https://bugs.webkit.org/show_bug.cgi?id=200879

Reviewed by Alex Christensen.

No observable change of behavior.

* Modules/mediastream/UserMediaRequest.cpp:
(WebCore::UserMediaRequest::allow):
(WebCore::UserMediaRequest::mediaStreamDidFail):
No need to asynchronously remove the observer since MediaStreamPrivate handles that properply now.
* Modules/mediastream/UserMediaRequest.h:

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/Modules/mediastream/UserMediaRequest.cpp
trunk/Source/WebCore/Modules/mediastream/UserMediaRequest.h




Diff

Modified: trunk/Source/WebCore/ChangeLog (248895 => 248896)

--- trunk/Source/WebCore/ChangeLog	2019-08-20 07:04:02 UTC (rev 248895)
+++ trunk/Source/WebCore/ChangeLog	2019-08-20 09:39:25 UTC (rev 248896)
@@ -1,3 +1,18 @@
+2019-08-20  Youenn Fablet  
+
+PendingActivationMediaStream does not need to be refcounted
+https://bugs.webkit.org/show_bug.cgi?id=200879
+
+Reviewed by Alex Christensen.
+
+No observable change of behavior.
+
+* Modules/mediastream/UserMediaRequest.cpp:
+(WebCore::UserMediaRequest::allow):
+(WebCore::UserMediaRequest::mediaStreamDidFail):
+No need to asynchronously remove the observer since MediaStreamPrivate handles that properply now.
+* Modules/mediastream/UserMediaRequest.h:
+
 2019-08-19  Devin Rousso  
 
 Web Inspector: Debugger: add a global breakpoint for pausing in the next microtask


Modified: trunk/Source/WebCore/Modules/mediastream/UserMediaRequest.cpp (248895 => 248896)

--- trunk/Source/WebCore/Modules/mediastream/UserMediaRequest.cpp	2019-08-20 07:04:02 UTC (rev 248895)
+++ trunk/Source/WebCore/Modules/mediastream/UserMediaRequest.cpp	2019-08-20 09:39:25 UTC (rev 248896)
@@ -240,7 +240,7 @@
 }
 
 scopeExit.release();
-m_pendingActivationMediaStream = PendingActivationMediaStream::create(WTFMove(protector), *this, WTFMove(stream), WTFMove(completionHandler));
+m_pendingActivationMediaStream = makeUnique(WTFMove(protector), *this, WTFMove(stream), WTFMove(completionHandler));
 };
 
 auto& document = downcast(*scriptExecutionContext());
@@ -395,8 +395,7 @@
 break;
 }
 m_promise.reject(NotReadableError, makeString("Failed starting capture of a "_s, typeDescription, " track"_s));
-// We are in an observer iterator loop, we do not want to change the observers within this loop.
-callOnMainThread([stream = WTFMove(m_pendingActivationMediaStream)] { });
+m_pendingActivationMediaStream = nullptr;
 }
 
 } // namespace WebCore


Modified: trunk/Source/WebCore/Modules/mediastream/UserMediaRequest.h (248895 => 248896)

--- trunk/Source/WebCore/Modules/mediastream/UserMediaRequest.h	2019-08-20 07:04:02 UTC (rev 248895)
+++ trunk/Source/WebCore/Modules/mediastream/UserMediaRequest.h	2019-08-20 09:39:25 UTC (rev 248896)
@@ -82,17 +82,13 @@
 void mediaStreamIsReady(Ref&&);
 void mediaStreamDidFail(RealtimeMediaSource::Type);
 
-class PendingActivationMediaStream : public RefCounted, private MediaStreamPrivate::Observer {
+class PendingActivationMediaStream : private MediaStreamPrivate::Observer {
+WTF_MAKE_FAST_ALLOCATED;
 public:
-static Ref create(Ref>&& protectingUserMediaRequest, UserMediaRequest& userMediaRequest, Ref&& stream, CompletionHandler&& completionHandler)
-{
-return adoptRef(*new PendingActivationMediaStream { WTFMove(protectingUserMediaRequest), userMediaRequest, WTFMove(stream), WTFMove(completionHandler) });
-}
+PendingActivationMediaStream(Ref>&&, UserMediaRequest&, Ref&&, CompletionHandler&&);
 ~PendingActivationMediaStream();
 
 private:
-PendingActivationMediaStream(Ref>&&, UserMediaRequest&, Ref&&, CompletionHandler&&);
-
 void characteristicsChanged() final;
 
 Ref> m_protectingUserMediaRequest;
@@ -105,7 +101,7 @@
 Vector m_audioDeviceUIDs;
 
 DOMPromiseDeferred> m_promise;
-RefPtr m_pendingActivationMediaStream;
+std::unique_ptr m_pendingActivationMediaStream;
 MediaStreamRequest m_request;
 };
 






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


[webkit-changes] [248897] trunk/Source/WebCore

2019-08-20 Thread youenn
Title: [248897] trunk/Source/WebCore








Revision 248897
Author you...@apple.com
Date 2019-08-20 02:48:20 -0700 (Tue, 20 Aug 2019)


Log Message
Remove DeferredPromise::sessionID()
https://bugs.webkit.org/show_bug.cgi?id=200616

Reviewed by Alex Christensen.

Calling sessionID() on DeferredPromise is valid if the DeferredPromise is not suspended.
Since this might not always be true in call sites, add a resolve promise that is passed a function that returns
the value to resolve.
This function is taking a ScriptExecutionContext from which the session ID can be retrieved.
This is safe since the function will only be called if the DeferredPromise is not suspended.
Update call sites accordingly.
No change of behavior.

* Modules/fetch/FetchBodyConsumer.cpp:
(WebCore::resolveWithTypeAndData):
(WebCore::FetchBodyConsumer::resolve):
* Modules/fetch/FetchBodyOwner.cpp:
(WebCore::FetchBodyOwner::blob):
* bindings/js/JSDOMPromiseDeferred.h:
(WebCore::DeferredPromise::resolveCallbackValueWithNewlyCreated):
(WebCore::DeferredPromise::sessionID const): Deleted.

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/Modules/fetch/FetchBodyConsumer.cpp
trunk/Source/WebCore/Modules/fetch/FetchBodyConsumer.h
trunk/Source/WebCore/Modules/fetch/FetchBodyOwner.cpp
trunk/Source/WebCore/bindings/js/JSDOMPromiseDeferred.h




Diff

Modified: trunk/Source/WebCore/ChangeLog (248896 => 248897)

--- trunk/Source/WebCore/ChangeLog	2019-08-20 09:39:25 UTC (rev 248896)
+++ trunk/Source/WebCore/ChangeLog	2019-08-20 09:48:20 UTC (rev 248897)
@@ -1,5 +1,29 @@
 2019-08-20  Youenn Fablet  
 
+Remove DeferredPromise::sessionID()
+https://bugs.webkit.org/show_bug.cgi?id=200616
+
+Reviewed by Alex Christensen.
+
+Calling sessionID() on DeferredPromise is valid if the DeferredPromise is not suspended.
+Since this might not always be true in call sites, add a resolve promise that is passed a function that returns
+the value to resolve.
+This function is taking a ScriptExecutionContext from which the session ID can be retrieved.
+This is safe since the function will only be called if the DeferredPromise is not suspended.
+Update call sites accordingly.
+No change of behavior.
+
+* Modules/fetch/FetchBodyConsumer.cpp:
+(WebCore::resolveWithTypeAndData):
+(WebCore::FetchBodyConsumer::resolve):
+* Modules/fetch/FetchBodyOwner.cpp:
+(WebCore::FetchBodyOwner::blob):
+* bindings/js/JSDOMPromiseDeferred.h:
+(WebCore::DeferredPromise::resolveCallbackValueWithNewlyCreated):
+(WebCore::DeferredPromise::sessionID const): Deleted.
+
+2019-08-20  Youenn Fablet  
+
 PendingActivationMediaStream does not need to be refcounted
 https://bugs.webkit.org/show_bug.cgi?id=200879
 


Modified: trunk/Source/WebCore/Modules/fetch/FetchBodyConsumer.cpp (248896 => 248897)

--- trunk/Source/WebCore/Modules/fetch/FetchBodyConsumer.cpp	2019-08-20 09:39:25 UTC (rev 248896)
+++ trunk/Source/WebCore/Modules/fetch/FetchBodyConsumer.cpp	2019-08-20 09:48:20 UTC (rev 248897)
@@ -64,7 +64,9 @@
 fulfillPromiseWithArrayBuffer(WTFMove(promise), data, length);
 return;
 case FetchBodyConsumer::Type::Blob:
-promise->resolveWithNewlyCreated>(blobFromData(promise->sessionID(), data, length, contentType).get());
+promise->resolveCallbackValueWithNewlyCreated>([&data, &length, &contentType](auto& context) {
+return blobFromData(context.sessionID(), data, length, contentType);
+});
 return;
 case FetchBodyConsumer::Type::JSON:
 fulfillPromiseWithJSON(WTFMove(promise), textFromUTF8(data, length));
@@ -130,7 +132,9 @@
 fulfillPromiseWithArrayBuffer(WTFMove(promise), takeAsArrayBuffer().get());
 return;
 case Type::Blob:
-promise->resolveWithNewlyCreated>(takeAsBlob(promise->sessionID()).get());
+promise->resolveCallbackValueWithNewlyCreated>([this](auto& context) {
+return takeAsBlob(context.sessionID());
+});
 return;
 case Type::JSON:
 fulfillPromiseWithJSON(WTFMove(promise), takeAsText());


Modified: trunk/Source/WebCore/Modules/fetch/FetchBodyConsumer.h (248896 => 248897)

--- trunk/Source/WebCore/Modules/fetch/FetchBodyConsumer.h	2019-08-20 09:39:25 UTC (rev 248896)
+++ trunk/Source/WebCore/Modules/fetch/FetchBodyConsumer.h	2019-08-20 09:48:20 UTC (rev 248897)
@@ -32,6 +32,7 @@
 #include "JSDOMPromiseDeferred.h"
 #include "ReadableStreamSink.h"
 #include "SharedBuffer.h"
+#include 
 
 namespace WebCore {
 


Modified: trunk/Source/WebCore/Modules/fetch/FetchBodyOwner.cpp (248896 => 248897)

--- trunk/Source/WebCore/Modules/fetch/FetchBodyOwner.cpp	2019-08-20 09:39:25 UTC (rev 248896)
+++ trunk/Source/WebCore/Modules/fetch/FetchBodyOwner.cpp	2019-08-20 09:48:20 UTC (rev 248897)
@@ -124,7 +124,9 @@
 }
 
 if (isBodyNullOrOpaque()) {
-promise->resolve>(B

[webkit-changes] [248898] trunk

2019-08-20 Thread pecoraro
Title: [248898] trunk








Revision 248898
Author pecor...@apple.com
Date 2019-08-20 03:41:33 -0700 (Tue, 20 Aug 2019)


Log Message
Web Inspector: Support for _javascript_ BigInt
https://bugs.webkit.org/show_bug.cgi?id=180731


Source/_javascript_Core:

Reviewed by Devin Rousso.

* inspector/InjectedScriptSource.js:
(toStringDescription):
(isSymbol):
(isBigInt):
(let.InjectedScript.prototype._fallbackWrapper):
(let.RemoteObject):
(let.RemoteObject.subtype):
(let.RemoteObject.describe):
(let.RemoteObject.prototype._appendPropertyPreviews):
(let.RemoteObject.set _isPreviewableObjectInternal):
(let.RemoteObject.prototype._isPreviewableObject.set add):
* inspector/protocol/Runtime.json:
New RemoteObject type and preview support.

* runtime/RuntimeType.cpp:
(JSC::runtimeTypeForValue):
(JSC::runtimeTypeAsString):
* runtime/RuntimeType.h:
* runtime/TypeSet.cpp:
(JSC::TypeSet::displayName const):
(JSC::TypeSet::inspectorTypeSet const):
New type for the type profiler.

* heap/HeapSnapshotBuilder.cpp:
(JSC::HeapSnapshotBuilder::json):
* inspector/agents/InspectorHeapAgent.cpp:
(Inspector::InspectorHeapAgent::getPreview):
* runtime/JSBigInt.cpp:
(JSC::JSBigInt::toString):
(JSC::JSBigInt::tryGetString):
(JSC::JSBigInt::toStringBasePowerOfTwo):
(JSC::JSBigInt::toStringGeneric):
* runtime/JSBigInt.h:
BigInts are not tied to a GlobalObject, so provide a way to get a
String for HeapSnapshot previews that are not tied to an ExecState.

Source/WebInspectorUI:

Reviewed by Devin Rousso.

* UserInterface/External/CodeMirror/_javascript_.js:
(expressionAllowed):
Cherry-pick BigInt _javascript_ mode support from CodeMirror:
https://github.com/codemirror/CodeMirror/pull/5411

* UserInterface/Images/TypeBigInt.svg: Added.
* UserInterface/Views/Variables.css:
(:root):
(@media (prefers-color-scheme: dark)):
* UserInterface/Views/CodeMirrorAdditions.js:
* UserInterface/Views/SyntaxHighlightingDefaultTheme.css:
(.cm-s-default .cm-number.cm-bigint,):
* UserInterface/Views/ObjectTreePropertyTreeElement.css:
(.object-tree-property.bigint > .icon):
* UserInterface/Views/HeapSnapshotInstancesContentView.css:
(.heap-snapshot .icon.bigint):
Style BigInt similiar but different from numbers but with
a [B] icon instead of [N].

* UserInterface/Views/FormattedValue.css:
(.formatted-bigint):
* UserInterface/Views/FormattedValue.js:
(WI.FormattedValue.hasSimpleDisplay):
* UserInterface/Views/SourceCodeTextEditor.js:
(WI.SourceCodeTextEditor.prototype._tokenTrackingControllerHighlightedJavaScriptExpression.populate):
(WI.SourceCodeTextEditor.prototype._tokenTrackingControllerHighlightedJavaScriptExpression):
Simple value formatting for the new type.

* UserInterface/Models/TypeSet.js:
(WI.TypeSet):
(WI.TypeSet.prototype.get primitiveTypeNames):
* UserInterface/Views/TypeTokenView.css:
(.type-token-bigint):
* UserInterface/Views/TypeTokenView.js:
(WI.TypeTokenView.prototype._displayTypeName):
(WI.TypeTokenView):
New type handling for the Type profiler.

* UserInterface/Protocol/RemoteObject.js:
(WI.RemoteObject):
(WI.RemoteObject.createBigIntFromDescriptionString):
* UserInterface/Views/HeapSnapshotClusterContentView.js:
(WI.HeapSnapshotClusterContentView.iconStyleClassNameForClassName):
* UserInterface/Views/HeapSnapshotInstanceDataGridNode.js:
(WI.HeapSnapshotInstanceDataGridNode.prototype._populatePreview):
BigInt values are not tied to a GlobalObject, so do some special casing
in the Heap output (like Strings) so we get a preview.

Source/WebKit:

Reviewed by Devin Rousso.

* WebProcess/WebPage/WebInspectorUI.cpp:
(WebKit::WebInspectorUI::WebInspectorUI):
Enable BigInt in the Web Inspector process. It only makes use of
`globalThis.BigInt(...)` to hold the value.

LayoutTests:

Reviewed by Devin Rousso.

* inspector/model/remote-object-expected.txt:
* inspector/model/remote-object.html:
* inspector/model/resources/remote-object-utilities.js:
Include simple tests for a BigInt value and preview.

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/inspector/model/remote-object-expected.txt
trunk/LayoutTests/inspector/model/remote-object.html
trunk/LayoutTests/inspector/model/resources/remote-object-utilities.js
trunk/Source/_javascript_Core/ChangeLog
trunk/Source/_javascript_Core/heap/HeapSnapshotBuilder.cpp
trunk/Source/_javascript_Core/inspector/InjectedScriptSource.js
trunk/Source/_javascript_Core/inspector/agents/InspectorHeapAgent.cpp
trunk/Source/_javascript_Core/inspector/protocol/Runtime.json
trunk/Source/_javascript_Core/runtime/JSBigInt.cpp
trunk/Source/_javascript_Core/runtime/JSBigInt.h
trunk/Source/_javascript_Core/runtime/RuntimeType.cpp
trunk/Source/_javascript_Core/runtime/RuntimeType.h
trunk/Source/_javascript_Core/runtime/TypeSet.cpp
trunk/Source/WebInspectorUI/ChangeLog
trunk/Source/WebInspectorUI/UserInterface/External/CodeMirror/_javascript_.js
trunk/Source/WebInspectorUI/UserInterface/Models/TypeSet.js
trunk/Source/WebInspectorUI/UserInterface/Protocol/RemoteObject.js
trunk/Source/WebInspectorUI/UserInterface/Vi

[webkit-changes] [248899] trunk/Source/WebCore

2019-08-20 Thread youenn
Title: [248899] trunk/Source/WebCore








Revision 248899
Author you...@apple.com
Date 2019-08-20 06:26:06 -0700 (Tue, 20 Aug 2019)


Log Message
Make IDB quota check lambdas take a weak of UniqueIDBDatabaseTransaction instead of a ref
https://bugs.webkit.org/show_bug.cgi?id=196696

Reviewed by Alex Christensen.

Refing the transaction in the lambdas extend their lifetime.
Taking a weak pointer of them is better as this will not extend their lifetime.
In particular, if the database is deleted, the corresponding transactions might be deleted.
This makes quota checks less intrusive in IDB lifetime management.
Covered by existing tests.

* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::createObjectStore):
(WebCore::IDBServer::UniqueIDBDatabase::deleteObjectStore):
(WebCore::IDBServer::UniqueIDBDatabase::renameObjectStore):
(WebCore::IDBServer::UniqueIDBDatabase::clearObjectStore):
(WebCore::IDBServer::UniqueIDBDatabase::createIndex):
(WebCore::IDBServer::UniqueIDBDatabase::deleteIndex):
(WebCore::IDBServer::UniqueIDBDatabase::renameIndex):
(WebCore::IDBServer::UniqueIDBDatabase::commitTransaction):
(WebCore::IDBServer::UniqueIDBDatabase::abortTransaction):
* Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp
trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h




Diff

Modified: trunk/Source/WebCore/ChangeLog (248898 => 248899)

--- trunk/Source/WebCore/ChangeLog	2019-08-20 10:41:33 UTC (rev 248898)
+++ trunk/Source/WebCore/ChangeLog	2019-08-20 13:26:06 UTC (rev 248899)
@@ -1,5 +1,30 @@
 2019-08-20  Youenn Fablet  
 
+Make IDB quota check lambdas take a weak of UniqueIDBDatabaseTransaction instead of a ref
+https://bugs.webkit.org/show_bug.cgi?id=196696
+
+Reviewed by Alex Christensen.
+
+Refing the transaction in the lambdas extend their lifetime.
+Taking a weak pointer of them is better as this will not extend their lifetime.
+In particular, if the database is deleted, the corresponding transactions might be deleted.
+This makes quota checks less intrusive in IDB lifetime management.
+Covered by existing tests.
+
+* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
+(WebCore::IDBServer::UniqueIDBDatabase::createObjectStore):
+(WebCore::IDBServer::UniqueIDBDatabase::deleteObjectStore):
+(WebCore::IDBServer::UniqueIDBDatabase::renameObjectStore):
+(WebCore::IDBServer::UniqueIDBDatabase::clearObjectStore):
+(WebCore::IDBServer::UniqueIDBDatabase::createIndex):
+(WebCore::IDBServer::UniqueIDBDatabase::deleteIndex):
+(WebCore::IDBServer::UniqueIDBDatabase::renameIndex):
+(WebCore::IDBServer::UniqueIDBDatabase::commitTransaction):
+(WebCore::IDBServer::UniqueIDBDatabase::abortTransaction):
+* Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:
+
+2019-08-20  Youenn Fablet  
+
 Remove DeferredPromise::sessionID()
 https://bugs.webkit.org/show_bug.cgi?id=200616
 


Modified: trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp (248898 => 248899)

--- trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp	2019-08-20 10:41:33 UTC (rev 248898)
+++ trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp	2019-08-20 13:26:06 UTC (rev 248899)
@@ -802,12 +802,16 @@
 LOG(IndexedDB, "(main) UniqueIDBDatabase::createObjectStore");
 
 auto taskSize = defaultWriteOperationCost + estimateSize(info);
-requestSpace(taskSize, "createObjectStore", [this, taskSize, transaction = makeRef(transaction), info, callback = WTFMove(callback)](auto error) mutable {
+requestSpace(taskSize, "createObjectStore", [this, taskSize, transaction = makeWeakPtr(transaction), info, callback = WTFMove(callback)](auto error) mutable {
 if (error) {
 callback(WTFMove(*error));
 return;
 }
-this->createObjectStoreAfterQuotaCheck(taskSize, transaction.get(), info, WTFMove(callback));
+if (!transaction) {
+callback(IDBError { UnknownError });
+return;
+}
+this->createObjectStoreAfterQuotaCheck(taskSize, *transaction, info, WTFMove(callback));
 });
 }
 
@@ -848,12 +852,16 @@
 ASSERT(isMainThread());
 LOG(IndexedDB, "(main) UniqueIDBDatabase::deleteObjectStore");
 
-waitForRequestSpaceCompletion([this, transaction = makeRef(transaction), objectStoreName, callback = WTFMove(callback)](auto error) mutable {
+waitForRequestSpaceCompletion([this, transaction = makeWeakPtr(transaction), objectStoreName, callback = WTFMove(callback)](auto error) mutable {
 if (error) {
 callback(WTFMove(*error));
 return;
 }
-this->deleteObjectStoreAfterQuotaCheck(transaction, objectStoreName, WTFMove(callback))

[webkit-changes] [248900] trunk

2019-08-20 Thread dino
Title: [248900] trunk








Revision 248900
Author d...@apple.com
Date 2019-08-20 09:10:43 -0700 (Tue, 20 Aug 2019)


Log Message
REGRESSION: Open in New Tab is missing from context menu
https://bugs.webkit.org/show_bug.cgi?id=200909


Reviewed by Simon Fraser.

Source/WebKit:

Don't assume the new API if webView:contextMenuWillPresentForElement:
is implemented.

* UIProcess/ios/WKContentViewInteraction.mm:
(needsDeprecatedPreviewAPI):

Tools:

Add a new test that runs through the legacy context menu
flow, and verifies that it will be called if there aren't
appropriate delegates for the new API.

* TestWebKitAPI/Tests/WebKitCocoa/ContextMenus.mm:
(contextMenuWebViewDriver):
(-[TestContextMenuUIDelegate webView:contextMenuConfigurationForElement:completionHandler:]):
(TEST):
(-[LegacyPreviewViewController previewActionItems]):
(-[LegacyContextMenuUIDelegate webView:shouldPreviewElement:]):
(-[LegacyContextMenuUIDelegate webView:previewingViewControllerForElement:defaultActions:]):
(-[LegacyContextMenuUIDelegate webView:contextMenuWillPresentForElement:]):
(-[LegacyContextMenuUIDelegate _webView:contextMenuDidEndForElement:]):
* TestWebKitAPI/cocoa/TestContextMenuDriver.h:

Modified Paths

trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
trunk/Tools/ChangeLog
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ContextMenus.mm
trunk/Tools/TestWebKitAPI/cocoa/TestContextMenuDriver.h




Diff

Modified: trunk/Source/WebKit/ChangeLog (248899 => 248900)

--- trunk/Source/WebKit/ChangeLog	2019-08-20 13:26:06 UTC (rev 248899)
+++ trunk/Source/WebKit/ChangeLog	2019-08-20 16:10:43 UTC (rev 248900)
@@ -1,3 +1,17 @@
+2019-08-20  Dean Jackson  
+
+REGRESSION: Open in New Tab is missing from context menu
+https://bugs.webkit.org/show_bug.cgi?id=200909
+
+
+Reviewed by Simon Fraser.
+
+Don't assume the new API if webView:contextMenuWillPresentForElement:
+is implemented.
+
+* UIProcess/ios/WKContentViewInteraction.mm:
+(needsDeprecatedPreviewAPI):
+
 2019-08-20  Joseph Pecoraro  
 
 Web Inspector: Support for _javascript_ BigInt


Modified: trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm (248899 => 248900)

--- trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm	2019-08-20 13:26:06 UTC (rev 248899)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm	2019-08-20 16:10:43 UTC (rev 248900)
@@ -7719,8 +7719,9 @@
 static bool needsDeprecatedPreviewAPI(id delegate)
 {
 // FIXME: Replace these with booleans in UIDelegate.h.
-// Note that we explicitly do not test for @selector(_webView:contextMenuDidEndForElement:) since
-// that's used by MobileSafari to clean up state even though they haven't moved to the new API.
+// Note that we explicitly do not test for @selector(_webView:contextMenuDidEndForElement:)
+// and @selector(webView:contextMenuWillPresentForElement) since the methods are used by MobileSafari
+// to manage state despite the app not moving to the new API.
 
 return delegate
 && ![delegate respondsToSelector:@selector(_webView:contextMenuConfigurationForElement:completionHandler:)]
@@ -7728,7 +7729,6 @@
 && ![delegate respondsToSelector:@selector(_webView:contextMenuForElement:willCommitWithAnimator:)]
 && ![delegate respondsToSelector:@selector(webView:contextMenuForElement:willCommitWithAnimator:)]
 && ![delegate respondsToSelector:@selector(_webView:contextMenuWillPresentForElement:)]
-&& ![delegate respondsToSelector:@selector(webView:contextMenuWillPresentForElement:)]
 && ![delegate respondsToSelector:@selector(webView:contextMenuDidEndForElement:)]
 && ([delegate respondsToSelector:@selector(webView:shouldPreviewElement:)]
 || [delegate respondsToSelector:@selector(webView:previewingViewControllerForElement:defaultActions:)]


Modified: trunk/Tools/ChangeLog (248899 => 248900)

--- trunk/Tools/ChangeLog	2019-08-20 13:26:06 UTC (rev 248899)
+++ trunk/Tools/ChangeLog	2019-08-20 16:10:43 UTC (rev 248900)
@@ -1,3 +1,26 @@
+2019-08-20  Dean Jackson  
+
+REGRESSION: Open in New Tab is missing from context menu
+https://bugs.webkit.org/show_bug.cgi?id=200909
+
+
+Reviewed by Simon Fraser.
+
+Add a new test that runs through the legacy context menu
+flow, and verifies that it will be called if there aren't
+appropriate delegates for the new API.
+
+* TestWebKitAPI/Tests/WebKitCocoa/ContextMenus.mm:
+(contextMenuWebViewDriver):
+(-[TestContextMenuUIDelegate webView:contextMenuConfigurationForElement:completionHandler:]):
+(TEST):
+(-[LegacyPreviewViewController previewActionItems]):
+(-[LegacyContextMenuUIDelegate webView:shouldPreviewElement:]):
+(-[LegacyContextMenuUIDelegate webView:previewingViewControllerForElement:defaultActions:]):
+(-[LegacyContextMenuUIDelegate webView:contextMenuWill

[webkit-changes] [248901] trunk/Source

2019-08-20 Thread cdumez
Title: [248901] trunk/Source








Revision 248901
Author cdu...@apple.com
Date 2019-08-20 09:34:56 -0700 (Tue, 20 Aug 2019)


Log Message
Use a strongly typed identifier for StorageNamespace's identifier
https://bugs.webkit.org/show_bug.cgi?id=200895

Reviewed by Alex Christensen and Youenn Fablet.

Source/WebCore:

* storage/StorageNamespace.h:

Source/WebKit:

Use a strongly typed identifier for StorageNamespace's identifier instead of uint64_t, to
avoid type confusion.

* NetworkProcess/WebStorage/LocalStorageNamespace.cpp:
(WebKit::LocalStorageNamespace::LocalStorageNamespace):
* NetworkProcess/WebStorage/LocalStorageNamespace.h:
* NetworkProcess/WebStorage/StorageManager.cpp:
(WebKit::StorageManager::createSessionStorageNamespace):
(WebKit::StorageManager::destroySessionStorageNamespace):
(WebKit::StorageManager::cloneSessionStorageNamespace):
(WebKit::StorageManager::createLocalStorageArea):
(WebKit::StorageManager::createTransientLocalStorageArea):
(WebKit::StorageManager::createSessionStorageArea):
(WebKit::StorageManager::getOrCreateLocalStorageNamespace):
(WebKit::StorageManager::getOrCreateTransientLocalStorageNamespace):
(WebKit::StorageManager::getOrCreateSessionStorageNamespace):
* NetworkProcess/WebStorage/StorageManager.h:
* NetworkProcess/WebStorage/StorageManagerSet.cpp:
(WebKit::StorageManagerSet::connectToLocalStorageArea):
(WebKit::StorageManagerSet::connectToTransientLocalStorageArea):
(WebKit::StorageManagerSet::connectToSessionStorageArea):
(WebKit::StorageManagerSet::cloneSessionStorageNamespace):
* NetworkProcess/WebStorage/StorageManagerSet.h:
* NetworkProcess/WebStorage/StorageManagerSet.messages.in:
* Scripts/webkit/messages.py:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::setPrivateBrowsingEnabled):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_textAutoSizingAdjustmentTimer):
* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::sessionStorageNamespaceIdentifier const):
* WebProcess/WebPage/WebPageGroupProxy.h:
(WebKit::WebPageGroupProxy::localStorageNamespaceIdentifier const):
* WebProcess/WebStorage/StorageAreaMap.cpp:
(WebKit::StorageAreaMap::dispatchSessionStorageEvent):
(WebKit::StorageAreaMap::dispatchLocalStorageEvent):
* WebProcess/WebStorage/StorageNamespaceIdentifier.h: Copied from Source/WebKit/WebProcess/WebStorage/WebStorageNamespaceProvider.h.
* WebProcess/WebStorage/StorageNamespaceImpl.cpp:
(WebKit::StorageNamespaceImpl::createSessionStorageNamespace):
(WebKit::StorageNamespaceImpl::createLocalStorageNamespace):
(WebKit::StorageNamespaceImpl::createTransientLocalStorageNamespace):
(WebKit::StorageNamespaceImpl::StorageNamespaceImpl):
(WebKit::StorageNamespaceImpl::copy):
(WebKit::StorageNamespaceImpl::sessionStoragePageID const):
(WebKit::StorageNamespaceImpl::pageGroupID const):
* WebProcess/WebStorage/StorageNamespaceImpl.h:
(WebKit::StorageNamespaceImpl::storageNamespaceID const):
* WebProcess/WebStorage/WebStorageNamespaceProvider.cpp:
(WebKit::WebStorageNamespaceProvider::getOrCreate):
(WebKit::WebStorageNamespaceProvider::WebStorageNamespaceProvider):
(WebKit::WebStorageNamespaceProvider::~WebStorageNamespaceProvider):
(WebKit::WebStorageNamespaceProvider::createSessionStorageNamespace):
(WebKit::WebStorageNamespaceProvider::createLocalStorageNamespace):
(WebKit::WebStorageNamespaceProvider::createTransientLocalStorageNamespace):
* WebProcess/WebStorage/WebStorageNamespaceProvider.h:

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/storage/StorageNamespace.h
trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/NetworkProcess/WebStorage/LocalStorageNamespace.cpp
trunk/Source/WebKit/NetworkProcess/WebStorage/LocalStorageNamespace.h
trunk/Source/WebKit/NetworkProcess/WebStorage/StorageManager.cpp
trunk/Source/WebKit/NetworkProcess/WebStorage/StorageManager.h
trunk/Source/WebKit/NetworkProcess/WebStorage/StorageManagerSet.cpp
trunk/Source/WebKit/NetworkProcess/WebStorage/StorageManagerSet.h
trunk/Source/WebKit/NetworkProcess/WebStorage/StorageManagerSet.messages.in
trunk/Source/WebKit/Scripts/webkit/messages.py
trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj
trunk/Source/WebKit/WebProcess/InjectedBundle/InjectedBundle.cpp
trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp
trunk/Source/WebKit/WebProcess/WebPage/WebPage.h
trunk/Source/WebKit/WebProcess/WebPage/WebPageGroupProxy.h
trunk/Source/WebKit/WebProcess/WebStorage/StorageAreaMap.cpp
trunk/Source/WebKit/WebProcess/WebStorage/StorageNamespaceImpl.cpp
trunk/Source/WebKit/WebProcess/WebStorage/StorageNamespaceImpl.h
trunk/Source/WebKit/WebProcess/WebStorage/WebStorageNamespaceProvider.cpp
trunk/Source/WebKit/WebProcess/WebStorage/WebStorageNamespaceProvider.h


Added Paths

trunk/Source/WebKit/WebProcess/WebStorage/StorageNamespaceIdentifier.h




Diff

Modified: trunk/Source/WebCore/ChangeLog (248900 => 248901)

--- trunk/Source/WebCore/ChangeLog	2019-08-20 16:10:43 UTC (rev 248900)
+++ trunk/Source/WebCore/ChangeLog	2019-08

[webkit-changes] [248902] trunk/Source

2019-08-20 Thread cdumez
Title: [248902] trunk/Source








Revision 248902
Author cdu...@apple.com
Date 2019-08-20 09:53:21 -0700 (Tue, 20 Aug 2019)


Log Message
Unsafe usage of CookieStorageObserver from a background thread
https://bugs.webkit.org/show_bug.cgi?id=200920

Reviewed by Alex Christensen.

Source/WebCore:

Unsafe usage of CookieStorageObserver from a background thread. CookieStorageObserver gets
constructed / destructed on the main thread. However, CookieStorageObserver::cookiesDidChange()
gets called on a background thread and tries to ref |this|. Even though CookieStorageObserver
is ThreadSafeRefCounted, this is still unsafe because the CookieStorageObserver destructor may
already be running on the main thread when CookieStorageObserver::cookiesDidChange() gets called
on the background thread.

* platform/network/NetworkStorageSession.h:
* platform/network/cocoa/CookieStorageObserver.h:
* platform/network/cocoa/CookieStorageObserver.mm:
(WebCore::CookieStorageObserver::CookieStorageObserver):
(WebCore::CookieStorageObserver::cookiesDidChange):
(WebCore::CookieStorageObserver::create): Deleted.
* platform/network/cocoa/NetworkStorageSessionCocoa.mm:
(WebCore::NetworkStorageSession::cookieStorageObserver const):

Source/WebKit:

* UIProcess/API/APIHTTPCookieStore.h:
* UIProcess/API/Cocoa/APIHTTPCookieStoreCocoa.mm:
(API::HTTPCookieStore::startObservingChangesToDefaultUIProcessCookieStore):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/platform/network/NetworkStorageSession.h
trunk/Source/WebCore/platform/network/cocoa/CookieStorageObserver.h
trunk/Source/WebCore/platform/network/cocoa/CookieStorageObserver.mm
trunk/Source/WebCore/platform/network/cocoa/NetworkStorageSessionCocoa.mm
trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/UIProcess/API/APIHTTPCookieStore.h
trunk/Source/WebKit/UIProcess/API/Cocoa/APIHTTPCookieStoreCocoa.mm




Diff

Modified: trunk/Source/WebCore/ChangeLog (248901 => 248902)

--- trunk/Source/WebCore/ChangeLog	2019-08-20 16:34:56 UTC (rev 248901)
+++ trunk/Source/WebCore/ChangeLog	2019-08-20 16:53:21 UTC (rev 248902)
@@ -1,5 +1,28 @@
 2019-08-20  Chris Dumez  
 
+Unsafe usage of CookieStorageObserver from a background thread
+https://bugs.webkit.org/show_bug.cgi?id=200920
+
+Reviewed by Alex Christensen.
+
+Unsafe usage of CookieStorageObserver from a background thread. CookieStorageObserver gets
+constructed / destructed on the main thread. However, CookieStorageObserver::cookiesDidChange()
+gets called on a background thread and tries to ref |this|. Even though CookieStorageObserver
+is ThreadSafeRefCounted, this is still unsafe because the CookieStorageObserver destructor may
+already be running on the main thread when CookieStorageObserver::cookiesDidChange() gets called
+on the background thread.
+
+* platform/network/NetworkStorageSession.h:
+* platform/network/cocoa/CookieStorageObserver.h:
+* platform/network/cocoa/CookieStorageObserver.mm:
+(WebCore::CookieStorageObserver::CookieStorageObserver):
+(WebCore::CookieStorageObserver::cookiesDidChange):
+(WebCore::CookieStorageObserver::create): Deleted.
+* platform/network/cocoa/NetworkStorageSessionCocoa.mm:
+(WebCore::NetworkStorageSession::cookieStorageObserver const):
+
+2019-08-20  Chris Dumez  
+
 Use a strongly typed identifier for StorageNamespace's identifier
 https://bugs.webkit.org/show_bug.cgi?id=200895
 


Modified: trunk/Source/WebCore/platform/network/NetworkStorageSession.h (248901 => 248902)

--- trunk/Source/WebCore/platform/network/NetworkStorageSession.h	2019-08-20 16:34:56 UTC (rev 248901)
+++ trunk/Source/WebCore/platform/network/NetworkStorageSession.h	2019-08-20 16:53:21 UTC (rev 248902)
@@ -200,7 +200,7 @@
 CookieStorageObserver& cookieStorageObserver() const;
 
 private:
-mutable RefPtr m_cookieStorageObserver;
+mutable std::unique_ptr m_cookieStorageObserver;
 #endif
 static bool m_processMayUseCookieAPI;
 };


Modified: trunk/Source/WebCore/platform/network/cocoa/CookieStorageObserver.h (248901 => 248902)

--- trunk/Source/WebCore/platform/network/cocoa/CookieStorageObserver.h	2019-08-20 16:34:56 UTC (rev 248901)
+++ trunk/Source/WebCore/platform/network/cocoa/CookieStorageObserver.h	2019-08-20 16:53:21 UTC (rev 248902)
@@ -28,7 +28,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 
 OBJC_CLASS NSHTTPCookieStorage;
 OBJC_CLASS WebCookieObserverAdapter;
@@ -35,9 +35,11 @@
 
 namespace WebCore {
 
-class WEBCORE_EXPORT CookieStorageObserver : public ThreadSafeRefCounted {
+class WEBCORE_EXPORT CookieStorageObserver : public CanMakeWeakPtr {
+WTF_MAKE_FAST_ALLOCATED;
+WTF_MAKE_NONCOPYABLE(CookieStorageObserver);
 public:
-static Ref create(NSHTTPCookieStorage *);
+explicit CookieStorageObserver(NSHTTPCookieStorage *);
 ~CookieStorageObserver();
 
 void startObserving(Function&& callback);

[webkit-changes] [248903] trunk

2019-08-20 Thread darin
Title: [248903] trunk








Revision 248903
Author da...@apple.com
Date 2019-08-20 10:14:37 -0700 (Tue, 20 Aug 2019)


Log Message
Variadic StringBuilder::append does not handle upconverting from 8-bit to 16-bit correctly
https://bugs.webkit.org/show_bug.cgi?id=200921

Reviewed by Saam Barati.

Source/WTF:

* wtf/text/StringBuilder.cpp:
(WTF::StringBuilder::appendUninitialized8): Renamed from
appendUninitializedWithoutOverflowCheckForLChar and moved the length overflow
check in here to cut down on unnecessary inlining and code size.
(WTF::StringBuilder::appendUninitialized16): Renamed from
appendUninitializedWithoutOverflowCheckForUChar, moved the length overflow check
in here, and moved the necessary upconversion code from the const UChar* overload of
the appendCharacters function.
(WTF::StringBuilder::appendCharacters): Removed unneeded "length has already overflowed"
check at the start of the function since the code in the function already handles that
case correctly. Refactored the const UChar* overload to use the new appendCharacters16
function so it can share more code with StringBuilder::appendFromAdapters.

* wtf/text/StringBuilder.h:
(WTF::StringBuilder::appendFromAdapters): Updated the function names for the
two appendUninitialized functions, which now do a bit more than before. Removed the
overflow check since the appendUninitialized8/16 functions now handle that; better to
not make the inlined code larger to handle a failure case.

Tools:

* TestWebKitAPI/Tests/WTF/StringBuilder.cpp:
Changed tests to use EXPECT macros instead of ASSERT macros since we don't
need to abort after the first failure. Added three new tests to the VariadicAppend
test to cover various cases of upconverting from 8-bit to 16-bit strings.

Modified Paths

trunk/Source/WTF/ChangeLog
trunk/Source/WTF/wtf/text/StringBuilder.cpp
trunk/Source/WTF/wtf/text/StringBuilder.h
trunk/Tools/ChangeLog
trunk/Tools/TestWebKitAPI/Tests/WTF/StringBuilder.cpp




Diff

Modified: trunk/Source/WTF/ChangeLog (248902 => 248903)

--- trunk/Source/WTF/ChangeLog	2019-08-20 16:53:21 UTC (rev 248902)
+++ trunk/Source/WTF/ChangeLog	2019-08-20 17:14:37 UTC (rev 248903)
@@ -1,3 +1,29 @@
+2019-08-20  Darin Adler  
+
+Variadic StringBuilder::append does not handle upconverting from 8-bit to 16-bit correctly
+https://bugs.webkit.org/show_bug.cgi?id=200921
+
+Reviewed by Saam Barati.
+
+* wtf/text/StringBuilder.cpp:
+(WTF::StringBuilder::appendUninitialized8): Renamed from
+appendUninitializedWithoutOverflowCheckForLChar and moved the length overflow
+check in here to cut down on unnecessary inlining and code size.
+(WTF::StringBuilder::appendUninitialized16): Renamed from
+appendUninitializedWithoutOverflowCheckForUChar, moved the length overflow check
+in here, and moved the necessary upconversion code from the const UChar* overload of
+the appendCharacters function.
+(WTF::StringBuilder::appendCharacters): Removed unneeded "length has already overflowed"
+check at the start of the function since the code in the function already handles that
+case correctly. Refactored the const UChar* overload to use the new appendCharacters16
+function so it can share more code with StringBuilder::appendFromAdapters.
+
+* wtf/text/StringBuilder.h:
+(WTF::StringBuilder::appendFromAdapters): Updated the function names for the
+two appendUninitialized functions, which now do a bit more than before. Removed the
+overflow check since the appendUninitialized8/16 functions now handle that; better to
+not make the inlined code larger to handle a failure case.
+
 2019-08-19  Sam Weinig  
 
 [WHLSL] Make generated Metal code should be indented properly to ease reading while debugging


Modified: trunk/Source/WTF/wtf/text/StringBuilder.cpp (248902 => 248903)

--- trunk/Source/WTF/wtf/text/StringBuilder.cpp	2019-08-20 16:53:21 UTC (rev 248902)
+++ trunk/Source/WTF/wtf/text/StringBuilder.cpp	2019-08-20 17:14:37 UTC (rev 248903)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010-2018 Apple Inc. All rights reserved.
+ * Copyright (C) 2010-2019 Apple Inc. All rights reserved.
  * Copyright (C) 2012 Google Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -259,18 +259,42 @@
 m_length = requiredLength;
 return getBufferCharacters() + currentLength;
 }
-
+
 return appendUninitializedSlow(requiredLength.unsafeGet());
 }
 
-UChar* StringBuilder::appendUninitializedWithoutOverflowCheckForUChar(CheckedInt32 requiredLength)
+LChar* StringBuilder::appendUninitialized8(CheckedInt32 requiredLength)
 {
-return appendUninitializedWithoutOverflowCheck(requiredLength);
+if (UNLIKELY(requiredLength.hasOverflowed())) {
+didOverflow();
+return nullptr;
+}
+return appendUninitializedWithoutOverflowCheck(requiredLength);
 }
 
-LChar*

[webkit-changes] [248904] trunk/Source/WebCore

2019-08-20 Thread sbarati
Title: [248904] trunk/Source/WebCore








Revision 248904
Author sbar...@apple.com
Date 2019-08-20 10:19:04 -0700 (Tue, 20 Aug 2019)


Log Message
[WHLSL] Only take the pointer of a variable or global variable reference if it is used
https://bugs.webkit.org/show_bug.cgi?id=200908

Reviewed by Dean Jackson.

Previously, we would always emit Metal code to produce an lvalue pointer
even when it wasn't used. This patch adds a mechanism to lazily generate
such pointers when they're actually needed, since we often don't use them.
This is a 7% Metal compile time speedup on compute_boids with a p value of
0.0001.

* Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp:
(WebCore::WHLSL::Metal::FunctionDefinitionWriter::appendRightValueWithNullability):
(WebCore::WHLSL::Metal::FunctionDefinitionWriter::appendLeftValue):
(WebCore::WHLSL::Metal::FunctionDefinitionWriter::takeLastLeftValue):
(WebCore::WHLSL::Metal::FunctionDefinitionWriter::visit):
* Modules/webgpu/WHLSL/Metal/WHLSLMangledNames.h:
(WebCore::WHLSL::Metal::MangledVariableName::operator bool const):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp
trunk/Source/WebCore/Modules/webgpu/WHLSL/Metal/WHLSLMangledNames.h




Diff

Modified: trunk/Source/WebCore/ChangeLog (248903 => 248904)

--- trunk/Source/WebCore/ChangeLog	2019-08-20 17:14:37 UTC (rev 248903)
+++ trunk/Source/WebCore/ChangeLog	2019-08-20 17:19:04 UTC (rev 248904)
@@ -1,3 +1,24 @@
+2019-08-20  Saam Barati  
+
+[WHLSL] Only take the pointer of a variable or global variable reference if it is used
+https://bugs.webkit.org/show_bug.cgi?id=200908
+
+Reviewed by Dean Jackson.
+
+Previously, we would always emit Metal code to produce an lvalue pointer
+even when it wasn't used. This patch adds a mechanism to lazily generate
+such pointers when they're actually needed, since we often don't use them.
+This is a 7% Metal compile time speedup on compute_boids with a p value of
+0.0001.
+
+* Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp:
+(WebCore::WHLSL::Metal::FunctionDefinitionWriter::appendRightValueWithNullability):
+(WebCore::WHLSL::Metal::FunctionDefinitionWriter::appendLeftValue):
+(WebCore::WHLSL::Metal::FunctionDefinitionWriter::takeLastLeftValue):
+(WebCore::WHLSL::Metal::FunctionDefinitionWriter::visit):
+* Modules/webgpu/WHLSL/Metal/WHLSLMangledNames.h:
+(WebCore::WHLSL::Metal::MangledVariableName::operator bool const):
+
 2019-08-20  Chris Dumez  
 
 Unsafe usage of CookieStorageObserver from a background thread


Modified: trunk/Source/WebCore/Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp (248903 => 248904)

--- trunk/Source/WebCore/Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp	2019-08-20 17:14:37 UTC (rev 248903)
+++ trunk/Source/WebCore/Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp	2019-08-20 17:19:04 UTC (rev 248904)
@@ -138,9 +138,10 @@
 
 struct StackItem {
 MangledVariableName value;
-Optional leftValue;
+MangledVariableName leftValue;
 Nullability valueNullability;
 Nullability leftValueNullability;
+std::function generateLeftValue;
 };
 
 struct StackValue {
@@ -155,7 +156,7 @@
 // a non-null lvalue.
 void appendRightValueWithNullability(AST::_expression_&, MangledVariableName value, Nullability nullability)
 {
-m_stack.append({ WTFMove(value), WTF::nullopt, nullability, Nullability::CanBeNull });
+m_stack.append({ WTFMove(value), { }, nullability, Nullability::CanBeNull, { } });
 }
 
 void appendRightValue(AST::_expression_& _expression_, MangledVariableName value)
@@ -163,10 +164,11 @@
 appendRightValueWithNullability(_expression_, WTFMove(value), Nullability::CanBeNull);
 }
 
-void appendLeftValue(AST::_expression_& _expression_, MangledVariableName value, MangledVariableName leftValue, Nullability nullability)
+void appendLeftValue(AST::_expression_& _expression_, MangledVariableName value, MangledVariableName leftValue, Nullability nullability, std::function generateLeftValue = { })
 {
 ASSERT_UNUSED(_expression_, _expression_.typeAnnotation().leftAddressSpace());
-m_stack.append({ WTFMove(value), WTFMove(leftValue), Nullability::CanBeNull, nullability });
+ASSERT(leftValue || generateLeftValue);
+m_stack.append({ WTFMove(value), WTFMove(leftValue), Nullability::CanBeNull, nullability, WTFMove(generateLeftValue) });
 }
 
 MangledVariableName takeLastValue()
@@ -182,9 +184,10 @@
 
 StackValue takeLastLeftValue()
 {
-ASSERT(m_stack.last().leftValue);
 auto last = m_stack.takeLast();
-return { *last.leftValue, last.leftValueNullability };
+if (!last.leftValue)
+last.leftValue = last.generateLeftValue();
+return { last.leftValue, last.leftValueNullab

[webkit-changes] [248905] trunk

2019-08-20 Thread justin_michaud
Title: [248905] trunk








Revision 248905
Author justin_mich...@apple.com
Date 2019-08-20 10:35:46 -0700 (Tue, 20 Aug 2019)


Log Message
Fix InBounds speculation of typed array PutByVal and add extra step to integer range optimization to search for equality relationships on the RHS value
https://bugs.webkit.org/show_bug.cgi?id=200782

Reviewed by Saam Barati.

JSTests:

Skip long memcpy test on debug, and try to fix flakiness for recompilation count tests by disabling cjit.

* microbenchmarks/memcpy-typed-loop.js:
* stress/int8-repeat-in-then-out-of-bounds.js:

Tools:

* Scripts/run-jsc-stress-tests:

Modified Paths

trunk/JSTests/ChangeLog
trunk/JSTests/microbenchmarks/memcpy-typed-loop.js
trunk/JSTests/stress/int8-repeat-in-then-out-of-bounds.js
trunk/Tools/ChangeLog
trunk/Tools/Scripts/run-jsc-stress-tests




Diff

Modified: trunk/JSTests/ChangeLog (248904 => 248905)

--- trunk/JSTests/ChangeLog	2019-08-20 17:19:04 UTC (rev 248904)
+++ trunk/JSTests/ChangeLog	2019-08-20 17:35:46 UTC (rev 248905)
@@ -1,3 +1,15 @@
+2019-08-20  Justin Michaud  
+
+Fix InBounds speculation of typed array PutByVal and add extra step to integer range optimization to search for equality relationships on the RHS value
+https://bugs.webkit.org/show_bug.cgi?id=200782
+
+Reviewed by Saam Barati.
+
+Skip long memcpy test on debug, and try to fix flakiness for recompilation count tests by disabling cjit.
+
+* microbenchmarks/memcpy-typed-loop.js:
+* stress/int8-repeat-in-then-out-of-bounds.js:
+
 2019-08-19  Alexey Shvayka  
 
 Proxy constructor should throw if handler is revoked Proxy


Modified: trunk/JSTests/microbenchmarks/memcpy-typed-loop.js (248904 => 248905)

--- trunk/JSTests/microbenchmarks/memcpy-typed-loop.js	2019-08-20 17:19:04 UTC (rev 248904)
+++ trunk/JSTests/microbenchmarks/memcpy-typed-loop.js	2019-08-20 17:35:46 UTC (rev 248905)
@@ -1,3 +1,4 @@
+//@ skip if $buildType == "debug"
 function doTest(arr1, arr2) {
 if (arr1.length != arr2.length)
 return []


Modified: trunk/JSTests/stress/int8-repeat-in-then-out-of-bounds.js (248904 => 248905)

--- trunk/JSTests/stress/int8-repeat-in-then-out-of-bounds.js	2019-08-20 17:19:04 UTC (rev 248904)
+++ trunk/JSTests/stress/int8-repeat-in-then-out-of-bounds.js	2019-08-20 17:35:46 UTC (rev 248905)
@@ -1,4 +1,4 @@
-//@ defaultNoEagerRun
+//@ defaultNoEagerRun(*NO_CJIT_OPTIONS)
 
 function foo(a, inBounds) {
 a[0] = 1;


Modified: trunk/Tools/ChangeLog (248904 => 248905)

--- trunk/Tools/ChangeLog	2019-08-20 17:19:04 UTC (rev 248904)
+++ trunk/Tools/ChangeLog	2019-08-20 17:35:46 UTC (rev 248905)
@@ -1,3 +1,12 @@
+2019-08-20  Justin Michaud  
+
+Fix InBounds speculation of typed array PutByVal and add extra step to integer range optimization to search for equality relationships on the RHS value
+https://bugs.webkit.org/show_bug.cgi?id=200782
+
+Reviewed by Saam Barati.
+
+* Scripts/run-jsc-stress-tests:
+
 2019-08-20  Darin Adler  
 
 Variadic StringBuilder::append does not handle upconverting from 8-bit to 16-bit correctly


Modified: trunk/Tools/Scripts/run-jsc-stress-tests (248904 => 248905)

--- trunk/Tools/Scripts/run-jsc-stress-tests	2019-08-20 17:19:04 UTC (rev 248904)
+++ trunk/Tools/Scripts/run-jsc-stress-tests	2019-08-20 17:35:46 UTC (rev 248905)
@@ -885,22 +885,22 @@
 # This is expected to not do eager runs because eager runs can have a lot of recompilations
 # for reasons that don't arise in the real world. It's used for tests that assert convergence
 # by counting recompilations.
-def defaultNoEagerRun
-runDefault
+def defaultNoEagerRun(*optionalTestSpecificOptions)
+runDefault(*optionalTestSpecificOptions)
 if $jitTests
-runNoLLInt
-runNoCJITValidatePhases
-runNoCJITCollectContinuously if shouldCollectContinuously?
+runNoLLInt(*optionalTestSpecificOptions)
+runNoCJITValidatePhases(*optionalTestSpecificOptions)
+runNoCJITCollectContinuously(*optionalTestSpecificOptions) if shouldCollectContinuously?
 
 return if !$isFTLPlatform
 
-runNoFTL
-runFTLNoCJITValidate
+runNoFTL(*optionalTestSpecificOptions)
+runFTLNoCJITValidate(*optionalTestSpecificOptions)
 
 return if $mode == "basic"
 
-runFTLNoCJITNoInlineValidate
-runFTLNoCJITB3O0
+runFTLNoCJITNoInlineValidate(*optionalTestSpecificOptions)
+runFTLNoCJITB3O0(*optionalTestSpecificOptions)
 end
 end
 






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


[webkit-changes] [248906] trunk

2019-08-20 Thread ysuzuki
Title: [248906] trunk








Revision 248906
Author ysuz...@apple.com
Date 2019-08-20 10:37:07 -0700 (Tue, 20 Aug 2019)


Log Message
[JSC] Array.prototype.toString should not get "join" function each time
https://bugs.webkit.org/show_bug.cgi?id=200905

Reviewed by Mark Lam.

JSTests:

* stress/array-prototype-join-change.js: Added.
(shouldBe):
(array2.join):
(DerivedArray):
(DerivedArray.prototype.join):
(array3.__proto__.join):
(Array.prototype.join):

Source/_javascript_Core:

We avoid looking up `join` every time Array#toString is called. This patch implements the most profitable and easy
case first as we are doing optimization for Array#slice: non-modified original Array. Configuring watchpoint for
Array.prototype.join change and use this information and structure information to determine whether `join` lookup
in Array.prototype.toString is unnecessary. This improves JetStream2/3d-raytrace-SP score by 1.6%

ToT: 363.56
Patched: 369.26

This patch also renames InlineWatchpointSet fields from Watchpoint to WatchpointSet since they are not Watchpoint.

* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleIntrinsicCall):
* dfg/DFGGraph.h:
(JSC::DFG::Graph::isWatchingArrayIteratorProtocolWatchpoint):
(JSC::DFG::Graph::isWatchingNumberToStringWatchpoint):
* runtime/ArrayPrototype.cpp:
(JSC::speciesWatchpointIsValid):
(JSC::canUseDefaultArrayJoinForToString):
(JSC::arrayProtoFuncToString):
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::JSGlobalObject):
(JSC::JSGlobalObject::init):
(JSC::JSGlobalObject::tryInstallArraySpeciesWatchpoint):
* runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::arrayIteratorProtocolWatchpointSet):
(JSC::JSGlobalObject::mapIteratorProtocolWatchpointSet):
(JSC::JSGlobalObject::setIteratorProtocolWatchpointSet):
(JSC::JSGlobalObject::stringIteratorProtocolWatchpointSet):
(JSC::JSGlobalObject::mapSetWatchpointSet):
(JSC::JSGlobalObject::setAddWatchpointSet):
(JSC::JSGlobalObject::arraySpeciesWatchpointSet):
(JSC::JSGlobalObject::arrayJoinWatchpointSet):
(JSC::JSGlobalObject::numberToStringWatchpointSet):
(JSC::JSGlobalObject::arrayIteratorProtocolWatchpoint): Deleted.
(JSC::JSGlobalObject::mapIteratorProtocolWatchpoint): Deleted.
(JSC::JSGlobalObject::setIteratorProtocolWatchpoint): Deleted.
(JSC::JSGlobalObject::stringIteratorProtocolWatchpoint): Deleted.
(JSC::JSGlobalObject::mapSetWatchpoint): Deleted.
(JSC::JSGlobalObject::setAddWatchpoint): Deleted.
(JSC::JSGlobalObject::arraySpeciesWatchpoint): Deleted.
(JSC::JSGlobalObject::numberToStringWatchpoint): Deleted.
* runtime/JSGlobalObjectInlines.h:
(JSC::JSGlobalObject::isArrayPrototypeIteratorProtocolFastAndNonObservable):
(JSC::JSGlobalObject::isMapPrototypeIteratorProtocolFastAndNonObservable):
(JSC::JSGlobalObject::isSetPrototypeIteratorProtocolFastAndNonObservable):
(JSC::JSGlobalObject::isStringPrototypeIteratorProtocolFastAndNonObservable):
(JSC::JSGlobalObject::isMapPrototypeSetFastAndNonObservable):
(JSC::JSGlobalObject::isSetPrototypeAddFastAndNonObservable):

Modified Paths

trunk/JSTests/ChangeLog
trunk/Source/_javascript_Core/ChangeLog
trunk/Source/_javascript_Core/dfg/DFGByteCodeParser.cpp
trunk/Source/_javascript_Core/dfg/DFGGraph.h
trunk/Source/_javascript_Core/runtime/ArrayPrototype.cpp
trunk/Source/_javascript_Core/runtime/JSGlobalObject.cpp
trunk/Source/_javascript_Core/runtime/JSGlobalObject.h
trunk/Source/_javascript_Core/runtime/JSGlobalObjectInlines.h


Added Paths

trunk/JSTests/stress/array-prototype-join-change.js




Diff

Modified: trunk/JSTests/ChangeLog (248905 => 248906)

--- trunk/JSTests/ChangeLog	2019-08-20 17:35:46 UTC (rev 248905)
+++ trunk/JSTests/ChangeLog	2019-08-20 17:37:07 UTC (rev 248906)
@@ -1,3 +1,18 @@
+2019-08-20  Yusuke Suzuki  
+
+[JSC] Array.prototype.toString should not get "join" function each time
+https://bugs.webkit.org/show_bug.cgi?id=200905
+
+Reviewed by Mark Lam.
+
+* stress/array-prototype-join-change.js: Added.
+(shouldBe):
+(array2.join):
+(DerivedArray):
+(DerivedArray.prototype.join):
+(array3.__proto__.join):
+(Array.prototype.join):
+
 2019-08-20  Justin Michaud  
 
 Fix InBounds speculation of typed array PutByVal and add extra step to integer range optimization to search for equality relationships on the RHS value


Added: trunk/JSTests/stress/array-prototype-join-change.js (0 => 248906)

--- trunk/JSTests/stress/array-prototype-join-change.js	(rev 0)
+++ trunk/JSTests/stress/array-prototype-join-change.js	2019-08-20 17:37:07 UTC (rev 248906)
@@ -0,0 +1,32 @@
+function shouldBe(actual, expected) {
+if (actual !== expected)
+throw new Error('bad value: ' + actual);
+}
+
+var array = [0, 1, 2, 3];
+shouldBe(`${array}`, `0,1,2,3`);
+
+var array2 = [0, 1, 2, 3];
+array2.join = function () { return `42`; }
+shouldBe(`${array2}`, `42`);
+
+class DerivedArray extends Array {
+constructor()
+{
+super(0, 1, 2, 3);

[webkit-changes] [248907] trunk/Source

2019-08-20 Thread bfulgham
Title: [248907] trunk/Source








Revision 248907
Author bfulg...@apple.com
Date 2019-08-20 10:50:09 -0700 (Tue, 20 Aug 2019)


Log Message
[FTW] Fix scrolling in modern WebKit views
https://bugs.webkit.org/show_bug.cgi?id=200923

Reviewed by Don Olmstead.

The initial implementation of scrolling in Direct2D had errors that
caused hilarious rendering glitches. This patch corrects the logic
so that page scroll is correct.
Source/WebCore:

* platform/graphics/win/BackingStoreBackendDirect2D.h:
* platform/graphics/win/BackingStoreBackendDirect2DImpl.cpp:
(WebCore::BackingStoreBackendDirect2DImpl::scroll):
(WebCore::BackingStoreBackendDirect2DImpl::bitmapBrush):
* platform/graphics/win/BackingStoreBackendDirect2DImpl.h:
* platform/graphics/win/Direct2DOperations.cpp:
(WebCore::Direct2D::drawNativeImage):
* platform/graphics/win/Direct2DUtilities.cpp:
(WebCore::Direct2D::copyRectFromOneSurfaceToAnother):
(WebCore::Direct2D::writeImageToDiskAsPNG): Added diagnostic utility to
dump textures to disk for review.
* platform/graphics/win/Direct2DUtilities.h:
* platform/graphics/win/ImageDecoderDirect2D.cpp:
(WebCore::ImageDecoderDirect2D::systemImagingFactory): Switch to more
recent factory with additional features.
* platform/graphics/win/ImageDecoderDirect2D.h:

Source/WebKit:

This patch also fixes a bug that would trigger when resizing windows.

* Shared/win/ShareableBitmapDirect2D.cpp:
(WebKit::ShareableBitmap::paint):
* UIProcess/BackingStore.h:
(WebKit::BackingStore::renderTarget): Deleted.
* UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp:
(WebKit::DrawingAreaProxyCoordinatedGraphics::sizeDidChange):
(WebKit::DrawingAreaProxyCoordinatedGraphics::deviceScaleFactorDidChange):
* UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.h:
* UIProcess/win/BackingStoreDirect2D.cpp:
(WebKit::BackingStore::paint):
(WebKit::BackingStore::incorporateUpdate):
(WebKit::BackingStore::scroll):
* UIProcess/win/WebView.cpp:
(WebKit::WebView::paint):
(WebKit::WebView::onSizeEvent):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/platform/graphics/win/BackingStoreBackendDirect2D.h
trunk/Source/WebCore/platform/graphics/win/BackingStoreBackendDirect2DImpl.cpp
trunk/Source/WebCore/platform/graphics/win/BackingStoreBackendDirect2DImpl.h
trunk/Source/WebCore/platform/graphics/win/Direct2DOperations.cpp
trunk/Source/WebCore/platform/graphics/win/Direct2DUtilities.cpp
trunk/Source/WebCore/platform/graphics/win/Direct2DUtilities.h
trunk/Source/WebCore/platform/graphics/win/ImageDecoderDirect2D.cpp
trunk/Source/WebCore/platform/graphics/win/ImageDecoderDirect2D.h
trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/Shared/win/ShareableBitmapDirect2D.cpp
trunk/Source/WebKit/UIProcess/BackingStore.h
trunk/Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp
trunk/Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.h
trunk/Source/WebKit/UIProcess/win/BackingStoreDirect2D.cpp
trunk/Source/WebKit/UIProcess/win/WebView.cpp




Diff

Modified: trunk/Source/WebCore/ChangeLog (248906 => 248907)

--- trunk/Source/WebCore/ChangeLog	2019-08-20 17:37:07 UTC (rev 248906)
+++ trunk/Source/WebCore/ChangeLog	2019-08-20 17:50:09 UTC (rev 248907)
@@ -1,3 +1,31 @@
+2019-08-20  Brent Fulgham  
+
+[FTW] Fix scrolling in modern WebKit views
+https://bugs.webkit.org/show_bug.cgi?id=200923
+
+Reviewed by Don Olmstead.
+
+The initial implementation of scrolling in Direct2D had errors that
+caused hilarious rendering glitches. This patch corrects the logic
+so that page scroll is correct.
+ 
+* platform/graphics/win/BackingStoreBackendDirect2D.h:
+* platform/graphics/win/BackingStoreBackendDirect2DImpl.cpp:
+(WebCore::BackingStoreBackendDirect2DImpl::scroll):
+(WebCore::BackingStoreBackendDirect2DImpl::bitmapBrush):
+* platform/graphics/win/BackingStoreBackendDirect2DImpl.h:
+* platform/graphics/win/Direct2DOperations.cpp:
+(WebCore::Direct2D::drawNativeImage):
+* platform/graphics/win/Direct2DUtilities.cpp:
+(WebCore::Direct2D::copyRectFromOneSurfaceToAnother):
+(WebCore::Direct2D::writeImageToDiskAsPNG): Added diagnostic utility to
+dump textures to disk for review.
+* platform/graphics/win/Direct2DUtilities.h:
+* platform/graphics/win/ImageDecoderDirect2D.cpp:
+(WebCore::ImageDecoderDirect2D::systemImagingFactory): Switch to more
+recent factory with additional features.
+* platform/graphics/win/ImageDecoderDirect2D.h:
+
 2019-08-20  Saam Barati  
 
 [WHLSL] Only take the pointer of a variable or global variable reference if it is used


Modified: trunk/Source/WebCore/platform/graphics/win/BackingStoreBackendDirect2D.h (248906 => 248907)

--- trunk/Source/WebCore/platform/graphics/win/BackingStoreBackendDirect2D.h	2019-08-20 17:37:07 UTC (rev 248906)
+++ trunk/Source/W

[webkit-changes] [248908] trunk/LayoutTests

2019-08-20 Thread ryanhaddad
Title: [248908] trunk/LayoutTests








Revision 248908
Author ryanhad...@apple.com
Date 2019-08-20 10:54:02 -0700 (Tue, 20 Aug 2019)


Log Message
Web Inspector: Support for _javascript_ BigInt
https://bugs.webkit.org/show_bug.cgi?id=180731

Unreviewed test gardening.

* inspector/timeline/line-column-expected.txt: Rebaseline test.

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/inspector/timeline/line-column-expected.txt




Diff

Modified: trunk/LayoutTests/ChangeLog (248907 => 248908)

--- trunk/LayoutTests/ChangeLog	2019-08-20 17:50:09 UTC (rev 248907)
+++ trunk/LayoutTests/ChangeLog	2019-08-20 17:54:02 UTC (rev 248908)
@@ -1,3 +1,12 @@
+2019-08-20  Ryan Haddad  
+
+Web Inspector: Support for _javascript_ BigInt
+https://bugs.webkit.org/show_bug.cgi?id=180731
+
+Unreviewed test gardening.
+
+* inspector/timeline/line-column-expected.txt: Rebaseline test.
+
 2019-08-20  Joseph Pecoraro  
 
 Web Inspector: Support for _javascript_ BigInt


Modified: trunk/LayoutTests/inspector/timeline/line-column-expected.txt (248907 => 248908)

--- trunk/LayoutTests/inspector/timeline/line-column-expected.txt	2019-08-20 17:50:09 UTC (rev 248907)
+++ trunk/LayoutTests/inspector/timeline/line-column-expected.txt	2019-08-20 17:54:02 UTC (rev 248908)
@@ -45,7 +45,7 @@
   "functionName": "",
   "url": "",
   "scriptId": "",
-  "lineNumber": 138,
+  "lineNumber": 141,
   "columnNumber": 97
 }
   ],
@@ -107,7 +107,7 @@
   "functionName": "",
   "url": "",
   "scriptId": "",
-  "lineNumber": 138,
+  "lineNumber": 141,
   "columnNumber": 97
 }
   ],
@@ -160,7 +160,7 @@
   "functionName": "",
   "url": "",
   "scriptId": "",
-  "lineNumber": 138,
+  "lineNumber": 141,
   "columnNumber": 97
 }
   ],
@@ -220,7 +220,7 @@
   "functionName": "",
   "url": "",
   "scriptId": "",
-  "lineNumber": 138,
+  "lineNumber": 141,
   "columnNumber": 97
 }
   ],






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


[webkit-changes] [248909] trunk

2019-08-20 Thread wenson_hsieh
Title: [248909] trunk








Revision 248909
Author wenson_hs...@apple.com
Date 2019-08-20 11:46:36 -0700 (Tue, 20 Aug 2019)


Log Message
Clicking the search icon on ae.com hangs the web content process
https://bugs.webkit.org/show_bug.cgi?id=200889


Reviewed by Ryosuke Niwa.

Source/WebCore:

The hang occurs under FrameSelection::selectionAtSentenceStart, while computing an EditorState to send to the UI
process. This act of determining whether the given positon is at the start of sentence entails moving backwards
from the start of the current visible selection until the start of a paragraph or sentence is found, using
VisiblePosition::previous to iterate backwards through VisiblePositions.

However, on this website, VisiblePosition::previous ends up just returning the current position, and we loop
infinitely as a result because we never actually move backwards. This happens because VisiblePosition::previous
first uses previousVisuallyDistinctCandidate to find a candidate Position before the current position, but when
the position is canonicalized to create a VisiblePosition, it is moved back to its original Position as the deep
equivalent.

In the attached test case (which is representative of the relevant part of the DOM on ae.com), we try to find
the previous VisiblePosition from (#c, 0). The previous visually distinct candidate we initially find is
(#b, 0), since:

1. The enclosing renderer is a RenderBlock with a non-zero height.
2. The enclosing renderer has no rendered children.
3. The position is at the first editing position in the node (i.e. the span element).

However, when canonicalizing the position, we find that neither the upstream nor the downstream position is a
candidate because both the upstream and downstream nodes end up well outside of the span (the upstream node ends
up being at the start of the body element, and the downstream position ends up right before the start of #c's
container). The downstream position is at the end of a text node with a leading newline, it's not a candidate
because its last caret offset is less than the length of the text node.

As a result, even though the given position (#b, 0) is a candidate itself, its downstream and upstream positions
are not. Thus, VisiblePosition::canonicalPosition expands the scope of its candidate positions to the next
closest candidate positions; the next candidate position is (#c, 0). Both of these candidates are outside of the
containing block, so we (somewhat arbitrarily) break the tie by choosing the next visible position, bringing us
back to (#c, 0).

There are several ways to fix this, one of which involves fixing the downstream/upstream positions of (#b, 0) so
that they no longer jump out of the containing block of #b and cause (#b, 0) to be an invalid visible position
despite being a candidate position. This can be achieved by adjusting the heuristic in
endsOfNodeAreVisuallyDistinctPositions (used when moving upstream or downstream). Currently, this helper
function returns false for #b because they contain a single (non-rendered) whitespace character. Removing this
extraneous whitespace character actually causes the problem to stop reproducing, since #b and #c no longer
contain any child nodes. This is important because the heuristic in Position::downstream attempts to keep the
downstream position within the confines of the enclosing visual boundary, which (currently) ends up being the
entire body element because endsOfNodeAreVisuallyDistinctPositions returns false for #b.

To avoid this scenario, we teach endsOfNodeAreVisuallyDistinctPositions to treat inline-block containers that
are empty (that is, contain no rendered content) but may have children for editing in the same way as inline-
block containers that don't have any children; in both scenarios, they may contain a candidate position, so we
should treat the ends of the container node as being visually distinct.

Doing so causes the downstream position of (#b, 0) to be kept within the immediate containing span element,
which then allows (#b, 0) to be a canonical VisiblePosition.

Tests:  fast/events/focus-anchor-with-tabindex-hang.html
editing/selection/modify-backward-inline-block-containers.html

* editing/VisiblePosition.cpp:
(WebCore::VisiblePosition::previous const):

LayoutTests:

* editing/selection/modify-backward-inline-block-containers-expected.txt: Added.
* editing/selection/modify-backward-inline-block-containers.html: Added.

Add a layout test to ensure that the selection may be moved through empty inline-block containers that span the
width of the page.

* fast/events/focus-anchor-with-tabindex-hang-expected.txt: Added.
* fast/events/focus-anchor-with-tabindex-hang.html: Added.

Add a layout test to ensure that clicking an empty span under a focusable anchor element moves focus to the
anchor element instead of hanging the web content process or hitting a debug assertion.

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/Source/WebCore/Change

[webkit-changes] [248910] trunk/Tools

2019-08-20 Thread jbedard
Title: [248910] trunk/Tools








Revision 248910
Author jbed...@apple.com
Date 2019-08-20 11:55:34 -0700 (Tue, 20 Aug 2019)


Log Message
results.webkit.org: Add ToolTips
https://bugs.webkit.org/show_bug.cgi?id=200801

Rubber-stamped by Aakash Jain.

When dots or scale labels are hovered over, we should display a tool tip with additional information about
The specific element.

* resultsdbpy/resultsdbpy/view/static/css/tooltip.css: Added.
(.tooltip): Add class for ToolTip text box.
(.tooltip-arrow-up): Add class for ToolTip arrow pointing up.
(.tooltip-arrow-down): Add class for ToolTip arrow pointing down.
* resultsdbpy/resultsdbpy/view/static/js/commit.js:
(_CommitBank.prototype.commitsDuringUuid): Return a list of commits which were the trunk of their respective
repositories at a given time.
* resultsdbpy/resultsdbpy/view/static/js/timeline.js:
(xAxisFromScale): Add callbacks triggered when the mouse enters or leaves elements in the scale canvas.
(TimelineFromEndpoint.render): Add callbacks triggered when the mouse enters or leaves dot elements.
* resultsdbpy/resultsdbpy/view/static/js/tooltip.js: Added.
(isPointInElement): Given an element and a point, return true if that point is within the bounds of the element.
(_ToolTip):
(_ToolTip.prototype.set): Set the content and location of the ToolTip.
(_ToolTip.prototype.toString): Return the html needed to render the ToolTip.
(_ToolTip.prototype.unset): Clear and hide the ToolTip.
(_ToolTip.prototype.isIn): Check if a given point is contained within the ToolTip.
* resultsdbpy/resultsdbpy/view/static/library/js/components/TimelineComponents.js:
(Timeline.CanvasSeriesComponent): Convert onHover events to onEnter/onLeave events. Add toolTips points to both
dot and scale elements.
* resultsdbpy/resultsdbpy/view/templates/search.html: Add ToolTip.
* resultsdbpy/resultsdbpy/view/templates/suite_results.html: Ditto.

Modified Paths

trunk/Tools/ChangeLog
trunk/Tools/resultsdbpy/resultsdbpy/view/static/js/commit.js
trunk/Tools/resultsdbpy/resultsdbpy/view/static/js/timeline.js
trunk/Tools/resultsdbpy/resultsdbpy/view/static/library/js/components/TimelineComponents.js
trunk/Tools/resultsdbpy/resultsdbpy/view/templates/search.html
trunk/Tools/resultsdbpy/resultsdbpy/view/templates/suite_results.html


Added Paths

trunk/Tools/resultsdbpy/resultsdbpy/view/static/css/tooltip.css
trunk/Tools/resultsdbpy/resultsdbpy/view/static/js/tooltip.js




Diff

Modified: trunk/Tools/ChangeLog (248909 => 248910)

--- trunk/Tools/ChangeLog	2019-08-20 18:46:36 UTC (rev 248909)
+++ trunk/Tools/ChangeLog	2019-08-20 18:55:34 UTC (rev 248910)
@@ -1,3 +1,36 @@
+2019-08-20  Jonathan Bedard  
+
+results.webkit.org: Add ToolTips
+https://bugs.webkit.org/show_bug.cgi?id=200801
+
+Rubber-stamped by Aakash Jain.
+
+When dots or scale labels are hovered over, we should display a tool tip with additional information about
+The specific element.
+
+* resultsdbpy/resultsdbpy/view/static/css/tooltip.css: Added.
+(.tooltip): Add class for ToolTip text box.
+(.tooltip-arrow-up): Add class for ToolTip arrow pointing up.
+(.tooltip-arrow-down): Add class for ToolTip arrow pointing down.
+* resultsdbpy/resultsdbpy/view/static/js/commit.js:
+(_CommitBank.prototype.commitsDuringUuid): Return a list of commits which were the trunk of their respective
+repositories at a given time.
+* resultsdbpy/resultsdbpy/view/static/js/timeline.js:
+(xAxisFromScale): Add callbacks triggered when the mouse enters or leaves elements in the scale canvas.
+(TimelineFromEndpoint.render): Add callbacks triggered when the mouse enters or leaves dot elements.
+* resultsdbpy/resultsdbpy/view/static/js/tooltip.js: Added.
+(isPointInElement): Given an element and a point, return true if that point is within the bounds of the element.
+(_ToolTip):
+(_ToolTip.prototype.set): Set the content and location of the ToolTip.
+(_ToolTip.prototype.toString): Return the html needed to render the ToolTip.
+(_ToolTip.prototype.unset): Clear and hide the ToolTip.
+(_ToolTip.prototype.isIn): Check if a given point is contained within the ToolTip.
+* resultsdbpy/resultsdbpy/view/static/library/js/components/TimelineComponents.js:
+(Timeline.CanvasSeriesComponent): Convert onHover events to onEnter/onLeave events. Add toolTips points to both
+dot and scale elements.
+* resultsdbpy/resultsdbpy/view/templates/search.html: Add ToolTip.
+* resultsdbpy/resultsdbpy/view/templates/suite_results.html: Ditto.
+
 2019-08-20  Justin Michaud  
 
 Fix InBounds speculation of typed array PutByVal and add extra step to integer range optimization to search for equality relationships on the RHS value


Added: trunk/Tools/resultsdbpy/resultsdbpy/view/static/css/tooltip.css (0 => 248910)

--- trunk/Tools/resultsdbpy/resultsdbpy/view/static/css/

[webkit-changes] [248911] trunk

2019-08-20 Thread zalan
Title: [248911] trunk








Revision 248911
Author za...@apple.com
Date 2019-08-20 11:58:12 -0700 (Tue, 20 Aug 2019)


Log Message
[ContentChangeObserver] isConsideredClickable should be able to process elements with no renderers
https://bugs.webkit.org/show_bug.cgi?id=200926


Reviewed by Simon Fraser.

Source/WebCore:

This patch fixes the crash when the visible->hidden change triggers an isConsideredClickable() call with a 'display: none' element.

Test: fast/events/touch/ios/content-observation/going-from-hidden-to-visible-and-to-hidden-crash.html

* page/ios/ContentChangeObserver.cpp:
(WebCore::isConsideredClickable):

LayoutTests:

* fast/events/touch/ios/content-observation/going-from-hidden-to-visible-and-to-hidden-crash-expected.txt: Added.
* fast/events/touch/ios/content-observation/going-from-hidden-to-visible-and-to-hidden-crash.html: Added.

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/page/ios/ContentChangeObserver.cpp


Added Paths

trunk/LayoutTests/fast/events/touch/ios/content-observation/going-from-hidden-to-visible-and-to-hidden-crash-expected.txt
trunk/LayoutTests/fast/events/touch/ios/content-observation/going-from-hidden-to-visible-and-to-hidden-crash.html




Diff

Modified: trunk/LayoutTests/ChangeLog (248910 => 248911)

--- trunk/LayoutTests/ChangeLog	2019-08-20 18:55:34 UTC (rev 248910)
+++ trunk/LayoutTests/ChangeLog	2019-08-20 18:58:12 UTC (rev 248911)
@@ -1,3 +1,14 @@
+2019-08-20  Zalan Bujtas  
+
+[ContentChangeObserver] isConsideredClickable should be able to process elements with no renderers
+https://bugs.webkit.org/show_bug.cgi?id=200926
+
+
+Reviewed by Simon Fraser.
+
+* fast/events/touch/ios/content-observation/going-from-hidden-to-visible-and-to-hidden-crash-expected.txt: Added.
+* fast/events/touch/ios/content-observation/going-from-hidden-to-visible-and-to-hidden-crash.html: Added.
+
 2019-08-20  Wenson Hsieh  
 
 Clicking the search icon on ae.com hangs the web content process


Added: trunk/LayoutTests/fast/events/touch/ios/content-observation/going-from-hidden-to-visible-and-to-hidden-crash-expected.txt (0 => 248911)

--- trunk/LayoutTests/fast/events/touch/ios/content-observation/going-from-hidden-to-visible-and-to-hidden-crash-expected.txt	(rev 0)
+++ trunk/LayoutTests/fast/events/touch/ios/content-observation/going-from-hidden-to-visible-and-to-hidden-crash-expected.txt	2019-08-20 18:58:12 UTC (rev 248911)
@@ -0,0 +1,2 @@
+PASS if no crash and 'clicked' text is shown below.
+clicked


Added: trunk/LayoutTests/fast/events/touch/ios/content-observation/going-from-hidden-to-visible-and-to-hidden-crash.html (0 => 248911)

--- trunk/LayoutTests/fast/events/touch/ios/content-observation/going-from-hidden-to-visible-and-to-hidden-crash.html	(rev 0)
+++ trunk/LayoutTests/fast/events/touch/ios/content-observation/going-from-hidden-to-visible-and-to-hidden-crash.html	2019-08-20 18:58:12 UTC (rev 248911)
@@ -0,0 +1,50 @@
+
+
+
+This tests the case when visible and non-clickable content gets removed.
+
+#tapThis {
+width: 400px;
+height: 400px;
+border: 1px solid green;
+}
+
+#alreadyVisible {
+display: block;
+width: 100px;
+height: 100px;
+background-color: green;
+}
+
+