WebKit-https.git
2 years ago[Curl] Move error generation task into ResourceError
commit-queue@webkit.org [Mon, 18 Sep 2017 23:02:23 +0000 (23:02 +0000)]
[Curl] Move error generation task into ResourceError
https://bugs.webkit.org/show_bug.cgi?id=176963

Patch by Basuke Suzuki <Basuke.Suzuki@sony.com> on 2017-09-18
Reviewed by Alex Christensen.

* platform/Curl.cmake:
* platform/network/curl/CurlContext.cpp:
(WebCore::CurlHandle::errorDescription):
(WebCore::CurlHandle::errorDescription const):
* platform/network/curl/CurlContext.h:
* platform/network/curl/ResourceError.h:
(WebCore::ResourceError::setSslErrors):
(WebCore::ResourceError::hasSSLConnectError const): Deleted.
(WebCore::ResourceError::doPlatformIsolatedCopy): Deleted.
* platform/network/curl/ResourceErrorCurl.cpp: Added.
(WebCore::ResourceError::httpError):
(WebCore::ResourceError::sslError):
(WebCore::ResourceError::hasSSLConnectError const):
(WebCore::ResourceError::doPlatformIsolatedCopy):
(WebCore::ResourceError::platformCompare):
* platform/network/curl/ResourceHandleCurlDelegate.cpp:
(WebCore::ResourceHandleCurlDelegate::notifyFail):
(WebCore::ResourceHandleCurlDelegate::didFail):
* platform/network/curl/ResourceHandleCurlDelegate.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222187 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoErrorInstance and Exception need destroy methods
fpizlo@apple.com [Mon, 18 Sep 2017 22:41:04 +0000 (22:41 +0000)]
ErrorInstance and Exception need destroy methods
https://bugs.webkit.org/show_bug.cgi?id=177095

Reviewed by Saam Barati.

When I made ErrorInstance and Exception into JSDestructibleObjects, I forgot to make them
follow that type's protocol.

* runtime/ErrorInstance.cpp:
(JSC::ErrorInstance::destroy): Implement this to fix leaks.
* runtime/ErrorInstance.h:
* runtime/Exception.h: Change how this is declared now that this is a DestructibleObject.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222186 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoWSL needs to annotate vertex shaders and fragment shaders
mmaxfield@apple.com [Mon, 18 Sep 2017 22:39:30 +0000 (22:39 +0000)]
WSL needs to annotate vertex shaders and fragment shaders
https://bugs.webkit.org/show_bug.cgi?id=177066

Reviewed by Filip Pizlo.

Metal Shading Language requires annotating vertex and fragment shaders, so this information needs to be in
the source WSL file.

* WebGPUShadingLanguageRI/Func.js:
(Func):
(Func.prototype.get shaderType):
* WebGPUShadingLanguageRI/FuncDef.js:
(FuncDef):
* WebGPUShadingLanguageRI/NativeFunc.js:
(NativeFunc):
* WebGPUShadingLanguageRI/Parse.js:
(parseFuncDecl):
(parseProtocolFuncDecl):
(parseFuncDef):
(parseNativeFunc):
* WebGPUShadingLanguageRI/ResolveOverloadImpl.js:
(resolveOverloadImpl):
* WebGPUShadingLanguageRI/Test.js:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222185 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoWSL should know that constexpr parameters are not lvalues
fpizlo@apple.com [Mon, 18 Sep 2017 22:36:28 +0000 (22:36 +0000)]
WSL should know that constexpr parameters are not lvalues
https://bugs.webkit.org/show_bug.cgi?id=177104

Reviewed by Saam Barati.

This should be an error:

    void foo<int x>()
    {
        x = 42;
    }

Previously, it wasn't, because VariableRef always thought that it was an LValue. This patch
teaches the type checker that not all VariableRefs are LValues.

* WebGPUShadingLanguageRI/ConstexprTypeParameter.js:
(ConstexprTypeParameter.prototype.get varIsLValue):
* WebGPUShadingLanguageRI/FuncParameter.js:
(FuncParameter.prototype.get varIsLValue):
* WebGPUShadingLanguageRI/Test.js:
(TEST_nonArrayRefArrayLengthSucceed):
(TEST_nonArrayRefArrayLengthFail):
(TEST_nonArrayRefArrayLength): Deleted.
(TEST_assignLength): Deleted.
* WebGPUShadingLanguageRI/VariableDecl.js:
(VariableDecl.prototype.get varIsLValue):
* WebGPUShadingLanguageRI/VariableRef.js:
(VariableRef.prototype.get isLValue):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222184 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years ago[Cocoa] Upstream sandbox-related WebKitSystemInterface functions
aestes@apple.com [Mon, 18 Sep 2017 22:35:38 +0000 (22:35 +0000)]
[Cocoa] Upstream sandbox-related WebKitSystemInterface functions
https://bugs.webkit.org/show_bug.cgi?id=177047

Reviewed by Daniel Bates.

Source/WebKit:

* NetworkProcess/NetworkResourceLoadParameters.cpp:
(WebKit::NetworkResourceLoadParameters::encode const):
* Platform/spi/mac/QuarantineSPI.h: Added.
* Shared/SandboxExtension.h:
(): Deleted.
* Shared/mac/ChildProcessMac.mm:
(WebKit::enableSandboxStyleFileQuarantine):
(WebKit::ChildProcess::initializeSandbox):
* Shared/mac/SandboxExtensionMac.mm:
(WebKit::SandboxExtensionImpl::create):
(WebKit::SandboxExtensionImpl::SandboxExtensionImpl):
(WebKit::SandboxExtensionImpl::~SandboxExtensionImpl):
(WebKit::SandboxExtensionImpl::consume):
(WebKit::SandboxExtensionImpl::invalidate):
(WebKit::SandboxExtensionImpl::getSerializedFormat):
(WebKit::SandboxExtension::Handle::Handle):
(WebKit::SandboxExtension::Handle::~Handle):
(WebKit::SandboxExtension::Handle::encode const):
(WebKit::SandboxExtension::Handle::decode):
(WebKit::SandboxExtension::createHandleWithoutResolvingPath):
(WebKit::SandboxExtension::createHandleForReadWriteDirectory):
(WebKit::SandboxExtension::createHandleForTemporaryFile):
(WebKit::SandboxExtension::createHandleForGenericExtension):
(WebKit::SandboxExtension::SandboxExtension):
(WebKit::SandboxExtension::~SandboxExtension):
(WebKit::SandboxExtension::revoke):
(WebKit::SandboxExtension::consume):
(WebKit::SandboxExtension::consumePermanently):
(WebKit::wkSandboxExtensionType): Deleted.
* UIProcess/Cocoa/WebPageProxyCocoa.mm:
(WebKit::WebPageProxy::createSandboxExtensionsIfNeeded):
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeWebProcess):
* UIProcess/Downloads/DownloadProxy.cpp:
(WebKit::DownloadProxy::decideDestinationWithSuggestedFilenameAsync):
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::grantSandboxExtensionsToStorageProcessForBlobs):
* UIProcess/Storage/StorageProcessProxy.cpp:
(WebKit::StorageProcessProxy::getSandboxExtensionsForBlobFiles):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::maybeInitializeSandboxExtensionHandle):
(WebKit::WebPageProxy::loadFile):
(WebKit::WebPageProxy::didChooseFilesForOpenPanel):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::createNewWebProcess):
(WebKit::WebProcessPool::processDidFinishLaunching):
(WebKit::WebProcessPool::resumeDownload):
(WebKit::WebProcessPool::startMemorySampler):
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/FileAPI/BlobRegistryProxy.cpp:
(WebKit::BlobRegistryProxy::registerFileBlobURL):

Source/WTF:

* wtf/spi/darwin/SandboxSPI.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222183 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoWeb Inspector: make Canvas recording tests more human readable
webkit@devinrousso.com [Mon, 18 Sep 2017 22:27:05 +0000 (22:27 +0000)]
Web Inspector: make Canvas recording tests more human readable
https://bugs.webkit.org/show_bug.cgi?id=176441

Reviewed by Joseph Pecoraro.

* TestExpectations:

* inspector/canvas/resources/recording-utilities.js: Added.
(TestPage.registerInitializer):
Create common functions for requesting and printing a recording.

* inspector/canvas/recording-2d-expected.txt:
* inspector/canvas/recording-2d.html:

* inspector/canvas/recording-webgl-expected.txt:
* inspector/canvas/recording-webgl.html:

* inspector/canvas/recording-webgl-snapshots-expected.txt:
* inspector/canvas/recording-webgl-snapshots.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222182 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoWeb Inspector: introduce an AppController class and shared instance of it
bburg@apple.com [Mon, 18 Sep 2017 21:33:41 +0000 (21:33 +0000)]
Web Inspector: introduce an AppController class and shared instance of it
https://bugs.webkit.org/show_bug.cgi?id=177024

Reviewed by Matt Baker.

WebInspectorUI currently has an app controller singleton that's distributed
among many properties on the WI object, which also serves as a namespace for
classes, enums, and other frontend objects. The singleton should be a proper
class so that we can think more easily about what state is global.

In the process of moving pieces of Main.js into AppController, I intend to move
most UI related code into a view controller class for the top level view.
AppController really shouldn't be doing anything to the view hierarchy or DOM.
It is yet to be determined how responsibility for global DOM events, such as
those for keyboard shortcuts, will be handled.

This larger refactoring project will let us more easily do things like connect
to multiple debuggables in the same Inspector instance, and switch between views
of different debuggable targets. Even if this never comes to pass, the code will
be a lot easier to reason about and maintain in the future.

For the first patch, introduce {AppController, TestAppController} <: AppControllerBase.
Shared code goes in the base class. In the Main.html and Test.html files, first
construct the AppController and then call .initialize() to avoid cyclic dependencies
on the global singleton WI.sharedApp.

* UserInterface/Main.html:
* UserInterface/Test.html:
* UserInterface/Test/Test.js:
(WI.loaded):
* UserInterface/Base/Main.js:
(WI.loaded):
Move some shared code out of here into AppControllerBase.constructor.
Eventually WI.loaded should not exist, and its code will move elsewhere.

(WI.contentLoaded):
Adopt global reference.

* UserInterface/Controllers/AppControllerBase.js: Copied from Source/WebInspectorUI/UserInterface/Protocol/MainTarget.js.
(WI.AppControllerBase):
(WI.AppControllerBase.prototype.get hasExtraDomains):
(WI.AppControllerBase.prototype.get debuggableType):
(WI.AppControllerBase.prototype.initialize):

* UserInterface/Controllers/AppController.js: New.
(WI.AppController):
(WI.AppController.prototype.get hasExtraDomains):
(WI.AppController.prototype.get debuggableType):
(WI.AppController.prototype.activateExtraDomains):

* UserInterface/Test/TestAppController.js: New.
(WI.TestAppController):
(WI.TestAppController.prototype.get hasExtraDomains):
(WI.TestAppController.prototype.get debuggableType):

* UserInterface/Controllers/TimelineManager.js:
(WI.TimelineManager.defaultTimelineTypes):
(WI.TimelineManager.availableTimelineTypes):
(WI.TimelineManager.prototype.scriptProfilerProgrammaticCaptureStarted):
(WI.TimelineManager.prototype.scriptProfilerProgrammaticCaptureStopped):
(WI.TimelineManager.prototype.scriptProfilerTrackingCompleted):
* UserInterface/Models/TimelineRecording.js:
(WI.TimelineRecording.sourceCodeTimelinesSupported):
* UserInterface/Protocol/InspectorObserver.js:
(WI.InspectorObserver.prototype.inspect):
(WI.InspectorObserver.prototype.activateExtraDomains):
(WI.InspectorObserver):
* UserInterface/Protocol/MainTarget.js:
(WI.MainTarget):
(WI.MainTarget.prototype.get displayName):
* UserInterface/Views/ResourceSidebarPanel.js:
(WI.ResourceSidebarPanel):
(WI.ResourceSidebarPanel.prototype.initialLayout):
(WI.ResourceSidebarPanel.prototype._addScript):
(WI.ResourceSidebarPanel.prototype._extraDomainsActivated):
* UserInterface/Views/Toolbar.js:
Use WI.sharedApp.{debuggableType, hasExtraDomains}.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222181 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoUnreviewed, rolling out r222170.
ryanhaddad@apple.com [Mon, 18 Sep 2017 21:04:58 +0000 (21:04 +0000)]
Unreviewed, rolling out r222170.

The API test added with this change is failing.

Reverted changeset:

"Allow WTF::map to use any class that is iterable and has a
size getter"
https://bugs.webkit.org/show_bug.cgi?id=177026
http://trac.webkit.org/changeset/222170

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222180 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoAdd a section in WSL's documentation about how API objects and WSL interact
mmaxfield@apple.com [Mon, 18 Sep 2017 21:03:31 +0000 (21:03 +0000)]
Add a section in WSL's documentation about how API objects and WSL interact
https://bugs.webkit.org/show_bug.cgi?id=177089

Reviewed by Filip Pizlo.

No global variables; entry points accept arguments. Buffers are array references ([]),
and texture and sampler opaque types exist. Data is passed between stages in return
values.

* WebGPUShadingLanguageRI/WSL.md:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222179 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoAnother WK1 unflake attempt.
antti@apple.com [Mon, 18 Sep 2017 21:01:30 +0000 (21:01 +0000)]
Another WK1 unflake attempt.

* transitions/transition-display-property-2.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222178 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years ago[Curl] Forward declare SSL context
don.olmstead@sony.com [Mon, 18 Sep 2017 20:48:49 +0000 (20:48 +0000)]
[Curl] Forward declare SSL context

Unreviewed build fix after r222147. OpenSSL's SHA1 declaration conflicts with WTF's.

No new tests. No change in behavior.

* platform/network/curl/CurlSSLHandle.h:
* platform/network/curl/CurlSSLVerifier.cpp:
* platform/network/curl/CurlSSLVerifier.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222177 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agogetData('text/plain') doesn't work on iOS 10
rniwa@webkit.org [Mon, 18 Sep 2017 20:38:15 +0000 (20:38 +0000)]
getData('text/plain') doesn't work on iOS 10
https://bugs.webkit.org/show_bug.cgi?id=177034

Reviewed by Wenson Hsieh.

Source/WebCore:

The bug was caused by the mispatch of UTI between reading & writing plain text.
Use kUTTypeText (instead of kUTTypePlainText) to read from UIPasteboard on iOS 10.

Re-enabled tests were passing on iOS 11 and continues to pass after this code change.

Tests: editing/pasteboard/clipboard-event.html
       editing/pasteboard/datatransfer-items-paste-plaintext.html
       editing/pasteboard/get-data-text-plain-paste.html

* platform/ios/PasteboardIOS.mm:
(WebCore::cocoaTypeFromHTMLClipboardType):

LayoutTests:

Removed the failing test expectations from tests that now pass on iOS.

* platform/ios/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222176 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years ago[JSC] Consider dropping JSObjectSetPrototype feature for JSGlobalObject
utatane.tea@gmail.com [Mon, 18 Sep 2017 20:06:34 +0000 (20:06 +0000)]
[JSC] Consider dropping JSObjectSetPrototype feature for JSGlobalObject
https://bugs.webkit.org/show_bug.cgi?id=177070

Reviewed by Saam Barati.

Due to the security reason, our global object is immutable prototype exotic object.
It prevents users from injecting proxies into the prototype chain of the global object[1].
But our JSC API does not respect this attribute, and allows users to change [[Prototype]]
of the global object after instantiating it.

This patch removes this feature. Once global object is instantiated, we cannot change [[Prototype]]
of the global object. It drops JSGlobalObject::resetPrototype use, which involves GlobalThis
edge cases.

[1]: https://github.com/tc39/ecma262/commit/935dad4283d045bc09c67a259279772d01b3d33d

* API/JSObjectRef.cpp:
(JSObjectSetPrototype):
* API/tests/CustomGlobalObjectClassTest.c:
(globalObjectSetPrototypeTest):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222175 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoWeb Inspector: console.assert messages shouldn't end in an exclamation point
mattbaker@apple.com [Mon, 18 Sep 2017 19:35:18 +0000 (19:35 +0000)]
Web Inspector: console.assert messages shouldn't end in an exclamation point
https://bugs.webkit.org/show_bug.cgi?id=177054

Reviewed by Joseph Pecoraro.

* UserInterface/Base/EventListener.js:
* UserInterface/Base/EventListenerSet.js:
(WI.EventListenerSet.prototype.register):
Drive-by: make assertions the same in both.
* UserInterface/Views/LayoutTimelineView.js:
(WI.LayoutTimelineView.prototype._processPendingRecords):

* UserInterface/Views/Resizer.js:
(WI.Resizer.prototype._currentPosition):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222174 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoUnreviewed, fix typo.
fpizlo@apple.com [Mon, 18 Sep 2017 19:14:10 +0000 (19:14 +0000)]
Unreviewed, fix typo.

* WebGPUShadingLanguageRI/WSL.md:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222173 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoWSL cannot use typedefs of arrays
fpizlo@apple.com [Mon, 18 Sep 2017 18:57:29 +0000 (18:57 +0000)]
WSL cannot use typedefs of arrays
https://bugs.webkit.org/show_bug.cgi?id=177061

Reviewed by Saam Barati.

This test case didn't work before because of a missing visit call in Checker.

* WebGPUShadingLanguageRI/Checker.js:
(Checker.prototype.visitTypeRef):
* WebGPUShadingLanguageRI/Test.js:
(TEST_typedefArray):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222172 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoWeb Inspector: REGRESSION(r221901): Single frame recordings don't reset the recording...
webkit@devinrousso.com [Mon, 18 Sep 2017 18:56:39 +0000 (18:56 +0000)]
Web Inspector: REGRESSION(r221901): Single frame recordings don't reset the recording navigation item
https://bugs.webkit.org/show_bug.cgi?id=176893

Reviewed by Matt Baker.

* UserInterface/Controllers/CanvasManager.js:
(WI.CanvasManager.prototype.recordingFinished):
Set the `_recordingCanvas` to null whenever a recording has finished and been sent to the
frontend. It is also necessary to do this inside `stopRecording`, as it is possible for the
user to start and stop a recording before any actions are recorded, meaning that no
recording would be sent to the frontend and this function will never get called.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222171 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoAllow WTF::map to use any class that is iterable and has a size getter
commit-queue@webkit.org [Mon, 18 Sep 2017 18:52:10 +0000 (18:52 +0000)]
Allow WTF::map to use any class that is iterable and has a size getter
https://bugs.webkit.org/show_bug.cgi?id=177026

Patch by Youenn Fablet <youenn@apple.com> on 2017-09-18
Reviewed by Darin Adler.

Source/WebCore:

No change of behavior.
Using WTF::map to go from maps to vectors.

* loader/appcache/ApplicationCacheHost.cpp:
(WebCore::ApplicationCacheHost::resourceList):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::dispatchAllPendingUnloadEvents):

Source/WTF:

Computing the Item type given to the lambda using the iterator instead of ValueType which is specific to Vector.
Adding the possibility to pass a non const container reference and a lambda taking non const references as well.

* wtf/Vector.h:
(WTF::MapFunctionInspector::acceptsReference):
(WTF::Mapper::map):
(WTF::map):

Tools:

* TestWebKitAPI/Tests/WTF/Vector.cpp:
(TestWebKitAPI::TEST):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222170 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoFigure out how WSL will support field overloads like float4.xz and friends
fpizlo@apple.com [Mon, 18 Sep 2017 18:51:52 +0000 (18:51 +0000)]
Figure out how WSL will support field overloads like float4.xz and friends
https://bugs.webkit.org/show_bug.cgi?id=177031

Reviewed by JF Bastien.

WSL needs to support getters and setters, so that we can do things like:

    float4 vec;
    vec.zx = float2(1, 2);
    // z = 1, x = 2

There's no way to express this float4.zx returning a pointer to something, since it's doing swizzling.
It could return a crazy smart pointer, but that sounds like a lot of work. So, I decided to go for
lvalue emulation instead.

The idea of lvalue emulation is that when we try to make an lvalue work for an assignment or RMW
operation (like += and friends), we consider the possibility that we have to first load the value using
a getter and then store it with a setter. This patch makes this work recursively, so that this will
work:

    float4 vec;
    vec.zwx.y = 42;
    // now w is 42

This works because we decompose it automatically:

    float4 vec;
    float3 tmp = vec.zwx;
    tmp.y = 42;
    vec.zwx = tmp;

This'll work to any depth.

To check if this works, this patch adds two substantial new tests called TEST_genericAccessors() and
TEST_bitSubscriptAccessor(). This tests that this stuff works with a lot of generic types, and that it's
possible to turn integers into bitvectors using subscript overloading. This patch also adds smaller unit
tests also.

Oh, and it's now possible to get an array's length.

* WebGPUShadingLanguageRI/AddressSpace.js:
(needsPrimitiveProtocol):
(protocolSuffix):
* WebGPUShadingLanguageRI/All.js:
* WebGPUShadingLanguageRI/AnonymousVariable.js: Added.
(AnonymousVariable):
(AnonymousVariable.prototype.get origin):
(AnonymousVariable.prototype.get name):
(AnonymousVariable.prototype.toString):
* WebGPUShadingLanguageRI/ArrayRefType.js:
(ArrayRefType.prototype.argumentForAndOverload):
(ArrayRefType.prototype.argumentTypeForAndOverload):
* WebGPUShadingLanguageRI/ArrayType.js:
(ArrayType.prototype.argumentForAndOverload):
(ArrayType.prototype.argumentTypeForAndOverload):
(ArrayType):
* WebGPUShadingLanguageRI/Assignment.js:
(Assignment):
* WebGPUShadingLanguageRI/CallAssignment.js: Removed.
* WebGPUShadingLanguageRI/CallExpression.js:
(CallExpression.resolve):
(CallExpression.prototype.resolve):
(CallExpression.prototype.resolveToOverload):
* WebGPUShadingLanguageRI/Checker.js:
(Checker.prototype.visitProgram):
(Checker.prototype.visitFuncDef):
(Checker.prototype.visitNativeFunc):
(Checker.prototype.visitProtocolDecl):
(Checker.prototype.visitIdentityExpression):
(Checker.prototype.visitReadModifyWriteExpression):
(Checker.prototype.visitAnonymousVariable):
(Checker.prototype.visitMakeArrayRefExpression):
(Checker.prototype._finishVisitingPropertyAccess):
(Checker.prototype.visitDotExpression):
(Checker.prototype.visitIndexExpression):
(Checker.prototype.visitCallExpression):
(Checker):
(Checker.prototype.visitProtocolDecl.NoticeTypeVariable.prototype.visitTypeRef): Deleted.
(Checker.prototype.visitProtocolDecl.NoticeTypeVariable.prototype.visitVariableRef): Deleted.
(Checker.prototype.visitProtocolDecl.NoticeTypeVariable): Deleted.
(Checker.prototype.visitProtocolDecl.set throw): Deleted.
* WebGPUShadingLanguageRI/CommaExpression.js:
* WebGPUShadingLanguageRI/DotExpression.js:
(DotExpression):
(DotExpression.prototype.get struct):
(DotExpression.prototype.get getFuncName):
(DotExpression.prototype.get andFuncName):
(DotExpression.prototype.get setFuncName):
* WebGPUShadingLanguageRI/EBuffer.js:
* WebGPUShadingLanguageRI/EBufferBuilder.js:
(EBufferBuilder.prototype.visitAnonymousVariable):
(EBufferBuilder.prototype.visitLetExpression): Deleted.
* WebGPUShadingLanguageRI/Evaluator.js:
(Evaluator.prototype.visitIdentityExpression):
(Evaluator.prototype.visitMakePtrExpression):
(Evaluator.prototype.visitAnonymousVariable):
(Evaluator.prototype.visitDotExpression): Deleted.
(Evaluator.prototype.visitLetExpression): Deleted.
* WebGPUShadingLanguageRI/ExpressionFinder.js:
(ExpressionFinder.prototype.visitReadModifyWriteExpression):
(ExpressionFinder.prototype.visitIdentityExpression):
* WebGPUShadingLanguageRI/ForLoop.js:
(ForLoop.prototype.toString):
(ForLoop):
* WebGPUShadingLanguageRI/Func.js:
(Func):
* WebGPUShadingLanguageRI/FuncInstantiator.js:
(FuncInstantiator.prototype.getUnique.InstantiationSubstitution.prototype.visitCallExpression):
(FuncInstantiator.prototype.getUnique.InstantiationSubstitution):
(FuncInstantiator.prototype.getUnique.Instantiate.prototype.visitFuncDef):
(FuncInstantiator.prototype.getUnique.Instantiate.prototype.visitNativeFunc):
(FuncInstantiator.prototype.getUnique.Instantiate):
(FuncInstantiator.prototype.getUnique):
(FuncInstantiator):
* WebGPUShadingLanguageRI/IdentityExpression.js: Added.
(IdentityExpression):
(IdentityExpression.prototype.get target):
(IdentityExpression.prototype.get unifyNode):
(IdentityExpression.prototype.get isConstexpr):
(IdentityExpression.prototype.get isLValue):
(IdentityExpression.prototype.get addressSpace):
(IdentityExpression.prototype.toString):
* WebGPUShadingLanguageRI/IndexExpression.js: Added.
(IndexExpression):
(IndexExpression.prototype.get array):
(IndexExpression.prototype.get index):
(IndexExpression.prototype.get isLValue):
(IndexExpression.prototype.get addressSpace):
(IndexExpression.prototype.get getFuncName):
(IndexExpression.prototype.get andFuncName):
(IndexExpression.prototype.get setFuncName):
(IndexExpression.prototype.toString):
* WebGPUShadingLanguageRI/InferTypesForCall.js:
(inferTypesForCall):
* WebGPUShadingLanguageRI/Inline.js:
(_inlineFunction):
* WebGPUShadingLanguageRI/Inliner.js:
(Inliner.prototype.visitCallExpression):
(Inliner.prototype.visitDotExpression): Deleted.
* WebGPUShadingLanguageRI/Intrinsics.js:
(Intrinsics):
* WebGPUShadingLanguageRI/LetExpression.js: Removed.
* WebGPUShadingLanguageRI/MakeArrayRefExpression.js:
(MakeArrayRefExpression.prototype.becomeConvertPtrToArrayRefExpression): Deleted.
* WebGPUShadingLanguageRI/NameContext.js:
(NameContext):
(NameContext.prototype.add):
(NameContext.prototype.doStatement):
(NameContext.prototype.handleDefining): Deleted.
(NameContext.prototype.isDefined): Deleted.
(NameContext.prototype.define): Deleted.
(NameContext.prototype.defineAll): Deleted.
* WebGPUShadingLanguageRI/NameResolver.js:
(NameResolver.prototype.doStatement):
(NameResolver.prototype.visitProtocolDecl):
(NameResolver.prototype.visitProgram): Deleted.
* WebGPUShadingLanguageRI/NativeFunc.js:
(NativeFunc):
* WebGPUShadingLanguageRI/NativeFuncInstance.js:
(NativeFuncInstance):
(NativeFuncInstance.prototype.get implementationData):
* WebGPUShadingLanguageRI/Node.js:
(Node.prototype.visit):
(Node.visit):
(Node.unify): Deleted.
* WebGPUShadingLanguageRI/NormalUsePropertyResolver.js: Added.
(NormalUsePropertyResolver.prototype.visitDotExpression):
(NormalUsePropertyResolver.prototype.visitIndexExpression):
(NormalUsePropertyResolver):
* WebGPUShadingLanguageRI/Parse.js:
(finishParsingPostIncrement):
(parsePossibleSuffix):
(finishParsingPreIncrement):
(genericParseCommaExpression):
(parseFuncName):
* WebGPUShadingLanguageRI/Prepare.js:
(prepare):
* WebGPUShadingLanguageRI/Program.js:
(Program):
(Program.prototype.get globalNameContext):
(Program.prototype.add):
* WebGPUShadingLanguageRI/PropertyAccessExpression.js: Added.
(PropertyAccessExpression):
(PropertyAccessExpression.prototype.get resultType):
(PropertyAccessExpression.prototype.rewriteAfterCloning):
(PropertyAccessExpression.prototype.updateCallsAfterChangingBase):
(PropertyAccessExpression.prototype.emitGet):
(PropertyAccessExpression.prototype.emitSet):
* WebGPUShadingLanguageRI/PropertyResolver.js: Added.
(PropertyResolver.prototype._visitPropertyAccess):
(PropertyResolver.prototype.visitDotExpression):
(PropertyResolver.prototype.visitIndexExpression):
(PropertyResolver.prototype._handleReadModifyWrite):
(PropertyResolver.prototype.visitReadModifyWriteExpression):
(PropertyResolver.prototype.visitAssignment):
(PropertyResolver.visitMakePtrExpression):
(PropertyResolver.prototype.visitMakeArrayRefExpression):
(PropertyResolver):
* WebGPUShadingLanguageRI/PtrType.js:
(PtrType.prototype.argumentForAndOverload):
(PtrType.prototype.argumentTypeForAndOverload):
(PtrType.prototype.returnTypeFromAndOverload):
* WebGPUShadingLanguageRI/ReadModifyWriteExpression.js: Added.
(ReadModifyWriteExpression):
(ReadModifyWriteExpression.prototype.get lValue):
(ReadModifyWriteExpression.prototype.oldValueRef):
(ReadModifyWriteExpression.prototype.newValueRef):
(ReadModifyWriteExpression.prototype.toString):
* WebGPUShadingLanguageRI/ResolveNames.js:
(createNameResolver):
(resolveNamesInTypes):
(resolveNamesInProtocols):
(resolveNamesInFunctions):
(resolveNames): Deleted.
* WebGPUShadingLanguageRI/ResolveOverloadImpl.js:
(resolveOverloadImpl):
* WebGPUShadingLanguageRI/ResolveProperties.js: Added.
(resolveProperties):
* WebGPUShadingLanguageRI/ResolveTypeDefs.js:
(resolveTypeDefsInTypes):
(resolveTypeDefsInProtocols):
(resolveTypeDefsInFunctions):
(resolveTypeDefs): Deleted.
* WebGPUShadingLanguageRI/ReturnChecker.js:
(ReturnChecker.prototype._isBoolCastFromLiteralTrue):
* WebGPUShadingLanguageRI/Rewriter.js:
(Rewriter):
(Rewriter.prototype.visitVariableDecl):
(Rewriter.prototype.visitTypeRef):
(Rewriter.prototype.visitAssignment):
(Rewriter.prototype.visitReadModifyWriteExpression):
(Rewriter.prototype.visitDereferenceExpression):
(Rewriter.prototype._handlePropertyAccessExpression):
(Rewriter.prototype.visitDotExpression):
(Rewriter.prototype.visitIndexExpression):
(Rewriter.prototype.visitReturn):
(Rewriter.prototype.visitGenericLiteralType):
(Rewriter.prototype.visitNullType):
(Rewriter.prototype.processDerivedCallData):
(Rewriter.prototype.visitCallExpression):
(Rewriter.prototype.visitFunctionLikeBlock):
(Rewriter.prototype.visitIfStatement):
(Rewriter.prototype.visitForLoop):
(Rewriter.prototype.visitAnonymousVariable):
(Rewriter.prototype.visitIdentityExpression):
(Rewriter.prototype.visitLetExpression): Deleted.
* WebGPUShadingLanguageRI/StandardLibrary.js:
* WebGPUShadingLanguageRI/StructLayoutBuilder.js:
(StructLayoutBuilder.prototype.visitNativeFuncInstance):
(StructLayoutBuilder):
* WebGPUShadingLanguageRI/StructType.js:
(StructType.prototype.instantiate):
* WebGPUShadingLanguageRI/Substitution.js:
(Substitution.prototype.get map):
* WebGPUShadingLanguageRI/SuffixCallAssignment.js: Removed.
* WebGPUShadingLanguageRI/SynthesizeStructAccessors.js: Added.
(synthesizeStructAccessors.createTypeParameters):
(synthesizeStructAccessors.):
(synthesizeStructAccessors.createFieldType):
(synthesizeStructAccessors.createTypeRef):
(synthesizeStructAccessors.setupAnder):
(synthesizeStructAccessors):
* WebGPUShadingLanguageRI/Test.html:
* WebGPUShadingLanguageRI/Test.js:
(checkNumber):
(TEST_simpleProtocol):
(TEST_assignLength):
(TEST_simpleSetter):
(TEST_genericAccessors):
* WebGPUShadingLanguageRI/Type.js:
(Type.prototype.get isRef):
(Type.prototype.argumentForAndOverload):
(Type.prototype.argumentTypeForAndOverload):
(Type.prototype.returnTypeFromAndOverload):
(Type):
* WebGPUShadingLanguageRI/TypeParameterRewriter.js: Added.
(TypeParameterRewriter.prototype.visitConstexprTypeParameter):
(TypeParameterRewriter.prototype.visitTypeVariable):
(TypeParameterRewriter):
* WebGPUShadingLanguageRI/TypeVariableTracker.js: Added.
(TypeVariableTracker):
* WebGPUShadingLanguageRI/Value.js:
(Value.prototype.become):
(Value):
* WebGPUShadingLanguageRI/VariableRef.js:
(VariableRef.prototype.get unifyNode):
(VariableRef.prototype.get addressSpace):
* WebGPUShadingLanguageRI/Visitor.js:
(Visitor.prototype.visitNativeFuncInstance):
(Visitor.prototype.visitProtocolDecl):
(Visitor): Deleted.
* WebGPUShadingLanguageRI/VisitorBase.js: Removed.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222169 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoAlways update display: contents styles in RenderTreeUpdater.
commit-queue@webkit.org [Mon, 18 Sep 2017 18:26:57 +0000 (18:26 +0000)]
Always update display: contents styles in RenderTreeUpdater.
https://bugs.webkit.org/show_bug.cgi?id=177065

Patch by Emilio Cobos Ãlvarez <emilio@crisal.io> on 2017-09-18
Reviewed by Antti Koivisto.

Source/WebCore:

Otherwise we keep an old style around, making following style updates wrong.

Test: fast/css/display-contents-style-update.html

* style/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::updateElementRenderer):

LayoutTests:

* fast/css/display-contents-style-update-expected.html: Added.
* fast/css/display-contents-style-update.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222168 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoAvoid style resolution when clearing focused element.
antti@apple.com [Mon, 18 Sep 2017 18:23:22 +0000 (18:23 +0000)]
Avoid style resolution when clearing focused element.
https://bugs.webkit.org/show_bug.cgi?id=176224
<rdar://problem/34206409>

Reviewed by Zalan Bujtas.

Source/WebCore:

Test: fast/dom/focus-style-resolution.html

* dom/Document.cpp:
(WebCore::Document::setFocusedElement):

    Don't do synchronous style resolution with FocusRemovalEventsMode::DoNotDispatch.
    Style resolution may dispatch events.

* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::didBlur):

    Move resolveStyleIfNeeded call to setFocusedElement. It is the only client for didBlur.

LayoutTests:

* fast/dom/focus-style-resolution-expected.txt: Added.
* fast/dom/focus-style-resolution.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222167 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoRolling out the previous to land again with a test.
antti@apple.com [Mon, 18 Sep 2017 18:21:17 +0000 (18:21 +0000)]
Rolling out the previous to land again with a test.

* dom/Document.cpp:
(WebCore::Document::setFocusedElement):
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::didBlur):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222166 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years ago[Cocoa] Upstream WKSetCrashReportApplicationSpecificInformation() from WebKitSystemIn...
aestes@apple.com [Mon, 18 Sep 2017 18:17:18 +0000 (18:17 +0000)]
[Cocoa] Upstream WKSetCrashReportApplicationSpecificInformation() from WebKitSystemInterface
https://bugs.webkit.org/show_bug.cgi?id=177048

Reviewed by Alex Christensen.

Source/WebKit:

* Platform/IPC/mac/ConnectionMac.mm:
(IPC::Connection::sendMessage):
(IPC::readFromMachPort):
* Platform/cocoa/CrashReporter.h: Copied from Source/WebKit/Shared/Cocoa/ChildProcessCocoa.mm.
* Platform/cocoa/CrashReporter.mm: Copied from Source/WebKit/Shared/Cocoa/ChildProcessCocoa.mm.
(WebKit::setCrashReportApplicationSpecificInformation):
* Platform/spi/Cocoa/CrashReporterClientSPI.h: Copied from Source/WebKit/Shared/Cocoa/ChildProcessCocoa.mm.
* Shared/Cocoa/ChildProcessCocoa.mm:
(WebKit::ChildProcess::didReceiveInvalidMessage):
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::_WKSetCrashReportApplicationSpecificInformation):

Tools:

* DumpRenderTree/mac/DumpRenderTree.mm:
(runTest):
* WebKitTestRunner/cocoa/CrashReporterInfo.mm:
(WTR::setCrashReportApplicationSpecificInformationToURL):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222165 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoAvoid style resolution when clearing focused element.
antti@apple.com [Mon, 18 Sep 2017 18:14:52 +0000 (18:14 +0000)]
Avoid style resolution when clearing focused element.
https://bugs.webkit.org/show_bug.cgi?id=176224
<rdar://problem/34206409>

Reviewed by Zalan Bujtas.

Test: fast/dom/focus-style-resolution.html

* dom/Document.cpp:
(WebCore::Document::setFocusedElement):

    Don't do synchronous style resolution with FocusRemovalEventsMode::DoNotDispatch.
    Style resolution may dispatch events.

* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::didBlur):

    Move resolveStyleIfNeeded call to setFocusedElement. It is the only client for didBlur.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222164 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years ago[WK1] Layout Test fast/events/beforeunload-dom-manipulation-crash.html is crashing.
pvollan@apple.com [Mon, 18 Sep 2017 18:01:48 +0000 (18:01 +0000)]
[WK1] Layout Test fast/events/beforeunload-dom-manipulation-crash.html is crashing.
https://bugs.webkit.org/show_bug.cgi?id=177071

Reviewed by Brent Fulgham.

The Page pointer in the history controller's frame is null. Add a null pointer check before
accessing the page.

No new tests, covered by exiting tests.

* loader/HistoryController.cpp:
(WebCore::HistoryController::updateForStandardLoad):
(WebCore::HistoryController::updateForRedirectWithLockedBackForwardList):
(WebCore::HistoryController::updateForClientRedirect):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222163 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoTry to unflake a test.
antti@apple.com [Mon, 18 Sep 2017 17:54:08 +0000 (17:54 +0000)]
Try to unflake a test.

Unreviewed.

* transitions/transition-display-property-2.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222162 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoMove baseline for editing/mac/attributed-string/font-style-variant-effect.html to...
ryanhaddad@apple.com [Mon, 18 Sep 2017 17:23:53 +0000 (17:23 +0000)]
Move baseline for editing/mac/attributed-string/font-style-variant-effect.html to mac-sierra.

Unreviewed test gardening.

* platform/mac-sierra/editing/mac/attributed-string/font-style-variant-effect-expected.txt: Renamed from LayoutTests/platform/mac-elcapitan/editing/mac/attributed-string/font-style-variant-effect-expected.txt.
* platform/win/TestExpectations: Drive by fix for an accidental commit.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222161 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agobuild-webkit spawns fewer subprocesses than ninja uses by default
timothy_horton@apple.com [Mon, 18 Sep 2017 16:54:44 +0000 (16:54 +0000)]
build-webkit spawns fewer subprocesses than ninja uses by default
https://bugs.webkit.org/show_bug.cgi?id=177057

Reviewed by Alex Christensen.

* Scripts/build-webkit:
By default, ninja will parallelize over (cores + 2) jobs. build-webkit
specifies -j(cores), which overrides this. Remove our override if building
with ninja; just let it do its own thing. In my testing, this minor
change is the difference between ~10% idle CPU time and 0.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222160 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoLand a patch to verify svn->git update is working.
lforschler@apple.com [Mon, 18 Sep 2017 16:53:33 +0000 (16:53 +0000)]
Land a patch to verify svn->git update is working.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222159 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoMark http/tests/websocket/tests/hybi/secure-cookie-secure-connection.pl as a failure...
ryanhaddad@apple.com [Mon, 18 Sep 2017 16:26:39 +0000 (16:26 +0000)]
Mark http/tests/websocket/tests/hybi/secure-cookie-secure-connection.pl as a failure on Windows.
https://bugs.webkit.org/show_bug.cgi?id=177072

Unreviewed test gardening.

* platform/win/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222158 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoMark fast/events/beforeunload-dom-manipulation-crash.html as a crash on Windows.
ryanhaddad@apple.com [Mon, 18 Sep 2017 16:26:37 +0000 (16:26 +0000)]
Mark fast/events/beforeunload-dom-manipulation-crash.html as a crash on Windows.
https://bugs.webkit.org/show_bug.cgi?id=177071

Unreviewed test gardening.

* platform/win/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222157 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoMark http/tests/security/video-cross-origin-caching.html as a flaky crash on Windows.
ryanhaddad@apple.com [Mon, 18 Sep 2017 16:26:35 +0000 (16:26 +0000)]
Mark http/tests/security/video-cross-origin-caching.html as a flaky crash on Windows.
https://bugs.webkit.org/show_bug.cgi?id=160447

Unreviewed test gardening.

* platform/win/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222156 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoUpdate my status.
ryanhaddad@apple.com [Mon, 18 Sep 2017 16:26:33 +0000 (16:26 +0000)]
Update my status.

Unreviewed.

* Scripts/webkitpy/common/config/contributors.json:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222155 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoREGRESSION(r221974): [Harfbuzz] Test fast/text/international/hebrew-selection.html...
ryanhaddad@apple.com [Mon, 18 Sep 2017 16:26:31 +0000 (16:26 +0000)]
REGRESSION(r221974): [Harfbuzz] Test fast/text/international/hebrew-selection.html is failing since r221974
https://bugs.webkit.org/show_bug.cgi?id=177036

Reviewed by Michael Catanzaro.

In r221974 I rewrote the characterIndexForXPosition implementation without taking into account that there can be
multiple glyphs for the same character, so we can't simply do index++ and index-- to get the next and previous
character index.

* platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
(WebCore::HarfBuzzShaper::HarfBuzzRun::characterIndexForXPosition): Always get the character index from
m_glyphToCharacterIndexes array.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222154 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoStart working on WSL documentation
ryanhaddad@apple.com [Mon, 18 Sep 2017 16:26:29 +0000 (16:26 +0000)]
Start working on WSL documentation
https://bugs.webkit.org/show_bug.cgi?id=177064

Reviewed by Mylex Maxfield.

This is a work in progress. I'd like to check it in and then keep adding to it.

* WebGPUShadingLanguageRI/WSL.md: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222153 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoWSL needs to understand && and ||
ryanhaddad@apple.com [Mon, 18 Sep 2017 16:26:13 +0000 (16:26 +0000)]
WSL needs to understand && and ||
https://bugs.webkit.org/show_bug.cgi?id=177062

Reviewed by Filip Pizlo.

Very similar to LogicalNot.

* WebGPUShadingLanguageRI/All.js:
* WebGPUShadingLanguageRI/Checker.js:
* WebGPUShadingLanguageRI/EBufferBuilder.js:
(EBufferBuilder.prototype.visitLogicalExpression):
* WebGPUShadingLanguageRI/Evaluator.js:
(Evaluator.prototype.visitLogicalExpression):
* WebGPUShadingLanguageRI/Lexer.js:
(Lexer.prototype.next):
(Lexer):
* WebGPUShadingLanguageRI/LogicalExpression.js: Added.
(LogicalExpression):
(LogicalExpression.prototype.get text):
(LogicalExpression.prototype.get left):
(LogicalExpression.prototype.get right):
(LogicalExpression.prototype.toString):
* WebGPUShadingLanguageRI/Parse.js:
(parseLeftLogicalExpression):
* WebGPUShadingLanguageRI/Rewriter.js:
(Rewriter.prototype.visitLogicalExpression):
* WebGPUShadingLanguageRI/Test.html:
* WebGPUShadingLanguageRI/Test.js:
* WebGPUShadingLanguageRI/Visitor.js:
(Visitor.prototype.visitProtocolDecl):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222152 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoVirtualize ImageDecoder
jer.noble@apple.com [Mon, 18 Sep 2017 16:24:59 +0000 (16:24 +0000)]
Virtualize ImageDecoder
https://bugs.webkit.org/show_bug.cgi?id=176118

Reviewed by Eric Carlson.

Add an explicit, abstract base class ImageDecoder, and convert ImageDecoderCG to a true
subclass. This will allow multiple ImageDecoder subclasses to exist simultaneously at
runtime.

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/ImageDecoders.cmake:
* platform/graphics/ImageDecoder.cpp: Added.
(WebCore::ImageDecoder::create):
(WebCore::ImageDecoder::bytesDecodedToDetermineProperties):
* platform/graphics/ImageDecoder.h: Added.
(WebCore::ImageDecoder::isSizeAvailable):
(WebCore::ImageDecoder::isAllDataReceived const):
* platform/graphics/cg/ImageDecoderCG.cpp:
(WebCore::ImageDecoderCG::ImageDecoderCG):
(WebCore::ImageDecoderCG::bytesDecodedToDetermineProperties):
(WebCore::ImageDecoderCG::uti const):
(WebCore::ImageDecoderCG::filenameExtension const):
(WebCore::ImageDecoderCG::encodedDataStatus const):
(WebCore::ImageDecoderCG::frameCount const):
(WebCore::ImageDecoderCG::repetitionCount const):
(WebCore::ImageDecoderCG::hotSpot const):
(WebCore::ImageDecoderCG::frameSizeAtIndex const):
(WebCore::ImageDecoderCG::frameIsCompleteAtIndex const):
(WebCore::ImageDecoderCG::frameOrientationAtIndex const):
(WebCore::ImageDecoderCG::frameDurationAtIndex const):
(WebCore::ImageDecoderCG::frameAllowSubsamplingAtIndex const):
(WebCore::ImageDecoderCG::frameHasAlphaAtIndex const):
(WebCore::ImageDecoderCG::frameBytesAtIndex const):
(WebCore::ImageDecoderCG::createFrameImageAtIndex const):
(WebCore::ImageDecoderCG::setData):
(WebCore::ImageDecoder::ImageDecoder): Deleted.
(WebCore::ImageDecoder::bytesDecodedToDetermineProperties): Deleted.
(WebCore::ImageDecoder::uti const): Deleted.
(WebCore::ImageDecoder::filenameExtension const): Deleted.
(WebCore::ImageDecoder::encodedDataStatus const): Deleted.
(WebCore::ImageDecoder::frameCount const): Deleted.
(WebCore::ImageDecoder::repetitionCount const): Deleted.
(WebCore::ImageDecoder::hotSpot const): Deleted.
(WebCore::ImageDecoder::frameSizeAtIndex const): Deleted.
(WebCore::ImageDecoder::frameIsCompleteAtIndex const): Deleted.
(WebCore::ImageDecoder::frameOrientationAtIndex const): Deleted.
(WebCore::ImageDecoder::frameDurationAtIndex const): Deleted.
(WebCore::ImageDecoder::frameAllowSubsamplingAtIndex const): Deleted.
(WebCore::ImageDecoder::frameHasAlphaAtIndex const): Deleted.
(WebCore::ImageDecoder::frameBytesAtIndex const): Deleted.
(WebCore::ImageDecoder::createFrameImageAtIndex const): Deleted.
(WebCore::ImageDecoder::setData): Deleted.
* platform/graphics/cg/ImageDecoderCG.h:
(WebCore::ImageDecoderCG::create):
(WebCore::ImageDecoder::create): Deleted.
(WebCore::ImageDecoder::isSizeAvailable): Deleted.
(WebCore::ImageDecoder::isAllDataReceived const): Deleted.
(WebCore::ImageDecoder::clearFrameBufferCache): Deleted.
* platform/graphics/win/ImageDecoderDirect2D.cpp:
(WebCore::ImageDecoderDirect2D::ImageDecoderDirect2D):
(WebCore::ImageDecoderDirect2D::systemImagingFactory):
(WebCore::ImageDecoderDirect2D::bytesDecodedToDetermineProperties):
(WebCore::ImageDecoderDirect2D::filenameExtension const):
(WebCore::ImageDecoderDirect2D::isSizeAvailable const):
(WebCore::ImageDecoderDirect2D::encodedDataStatus const):
(WebCore::ImageDecoderDirect2D::size const):
(WebCore::ImageDecoderDirect2D::frameCount const):
(WebCore::ImageDecoderDirect2D::repetitionCount const):
(WebCore::ImageDecoderDirect2D::hotSpot const):
(WebCore::ImageDecoderDirect2D::frameSizeAtIndex const):
(WebCore::ImageDecoderDirect2D::frameIsCompleteAtIndex const):
(WebCore::ImageDecoderDirect2D::frameOrientationAtIndex const):
(WebCore::ImageDecoderDirect2D::frameDurationAtIndex const):
(WebCore::ImageDecoderDirect2D::frameAllowSubsamplingAtIndex const):
(WebCore::ImageDecoderDirect2D::frameHasAlphaAtIndex const):
(WebCore::ImageDecoderDirect2D::frameBytesAtIndex const):
(WebCore::ImageDecoderDirect2D::setTargetContext):
(WebCore::ImageDecoderDirect2D::createFrameImageAtIndex const):
(WebCore::ImageDecoderDirect2D::setData):
* platform/graphics/win/ImageDecoderDirect2D.h:
(WebCore::ImageDecoderDirect2D::create):
(WebCore::ImageDecoder::create): Deleted.
(WebCore::ImageDecoder::isAllDataReceived const): Deleted.
(WebCore::ImageDecoder::clearFrameBufferCache): Deleted.
* platform/image-decoders/ScalableImageDecoder.cpp: Renamed from Source/WebCore/platform/image-decoders/ImageDecoder.cpp.
(WebCore::ScalableImageDecoder::create):
(WebCore::ScalableImageDecoder::frameIsCompleteAtIndex const):
(WebCore::ScalableImageDecoder::frameHasAlphaAtIndex const):
(WebCore::ScalableImageDecoder::frameBytesAtIndex const):
(WebCore::ScalableImageDecoder::frameDurationAtIndex const):
(WebCore::ScalableImageDecoder::createFrameImageAtIndex):
(WebCore::ScalableImageDecoder::prepareScaleDataIfNecessary):
(WebCore::ScalableImageDecoder::upperBoundScaledX):
(WebCore::ScalableImageDecoder::lowerBoundScaledX):
(WebCore::ScalableImageDecoder::upperBoundScaledY):
(WebCore::ScalableImageDecoder::lowerBoundScaledY):
(WebCore::ScalableImageDecoder::scaledY):
* platform/image-decoders/ScalableImageDecoder.h: Renamed from Source/WebCore/platform/image-decoders/ImageDecoder.h.
(WebCore::ScalableImageDecoder::ScalableImageDecoder):
(WebCore::ScalableImageDecoder::~ScalableImageDecoder):
(WebCore::ScalableImageDecoder::premultiplyAlpha const):
(WebCore::ScalableImageDecoder::isAllDataReceived const):
(WebCore::ScalableImageDecoder::size const):
(WebCore::ScalableImageDecoder::scaledSize):
(WebCore::ScalableImageDecoder::setSize):
(WebCore::ScalableImageDecoder::setIgnoreGammaAndColorProfile):
(WebCore::ScalableImageDecoder::ignoresGammaAndColorProfile const):
(WebCore::ScalableImageDecoder::rgbColorProfile):
(WebCore::ScalableImageDecoder::subsamplingLevelForScale):
(WebCore::ScalableImageDecoder::inputDeviceColorProfile):
(WebCore::ScalableImageDecoder::setFailed):
(WebCore::ScalableImageDecoder::failed const):
* platform/image-decoders/bmp/BMPImageDecoder.cpp:
(WebCore::BMPImageDecoder::BMPImageDecoder):
(WebCore::BMPImageDecoder::setData):
(WebCore::BMPImageDecoder::setFailed):
* platform/image-decoders/bmp/BMPImageDecoder.h:
* platform/image-decoders/bmp/BMPImageReader.h:
* platform/image-decoders/gif/GIFImageDecoder.cpp:
(WebCore::GIFImageDecoder::GIFImageDecoder):
(WebCore::GIFImageDecoder::setData):
(WebCore::GIFImageDecoder::setSize):
(WebCore::GIFImageDecoder::setFailed):
* platform/image-decoders/gif/GIFImageDecoder.h:
* platform/image-decoders/ico/ICOImageDecoder.cpp:
(WebCore::ICOImageDecoder::ICOImageDecoder):
(WebCore::ICOImageDecoder::setData):
(WebCore::ICOImageDecoder::size):
(WebCore::ICOImageDecoder::setSize):
(WebCore::ICOImageDecoder::setFailed):
* platform/image-decoders/ico/ICOImageDecoder.h:
* platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
(WebCore::JPEGImageDecoder::JPEGImageDecoder):
(WebCore::JPEGImageDecoder::setSize):
(WebCore::JPEGImageDecoder::setFailed):
* platform/image-decoders/jpeg/JPEGImageDecoder.h:
* platform/image-decoders/png/PNGImageDecoder.cpp:
(WebCore::PNGImageReader::decode):
(WebCore::PNGImageDecoder::PNGImageDecoder):
(WebCore::PNGImageDecoder::setSize):
(WebCore::PNGImageDecoder::frameBufferAtIndex):
(WebCore::PNGImageDecoder::setFailed):
* platform/image-decoders/png/PNGImageDecoder.h:
* platform/image-decoders/webp/WEBPImageDecoder.cpp:
(WebCore::WEBPImageDecoder::WEBPImageDecoder):
(WebCore::WEBPImageDecoder::decode):
* platform/image-decoders/webp/WEBPImageDecoder.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222151 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years ago[Mac] Upstream miscellaneous WebKitSystemInterface functions
aestes@apple.com [Mon, 18 Sep 2017 16:21:29 +0000 (16:21 +0000)]
[Mac] Upstream miscellaneous WebKitSystemInterface functions
https://bugs.webkit.org/show_bug.cgi?id=177029

Reviewed by Alex Christensen.

Source/WebCore:

* Configurations/WebCore.xcconfig: Used -force_load of libPAL instead of -ObjC. This forces
the linker to load both Objective-C and C PAL symbols in WebCore. This change is needed for
PAL::popUpMenu(), which is used by WebKit and WebKitLegacy but not WebCore.
* platform/cocoa/LocalizedStringsCocoa.mm:
(WebCore::contextMenuItemTagSearchWeb):
* platform/cocoa/ScrollController.mm:
(WebCore::elasticDeltaForTimeDelta):
(WebCore::elasticDeltaForReboundDelta):
(WebCore::reboundDeltaForElasticDelta):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
* platform/mac/CursorMac.mm:
(WebCore::WKCoreCursor_coreCursorType):
(WebCore::createCoreCursorClass):
(WebCore::coreCursorClass):
(WebCore::cursor):
(WebCore::Cursor::ensurePlatformCursor const):
* platform/mac/WebCoreSystemInterface.h:
* platform/mac/WebCoreSystemInterface.mm:
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::paintTextArea):

Source/WebCore/PAL:

* PAL.xcodeproj/project.pbxproj:
* pal/PlatformMac.cmake:
* pal/spi/cf/CFUtilitiesSPI.h:
* pal/spi/cocoa/LaunchServicesSPI.h: Renamed from Source/WebCore/PAL/pal/spi/ios/LaunchServicesSPI.h.
* pal/spi/mac/HIServicesSPI.h:
* pal/spi/mac/NSCellSPI.h: Copied from Source/WebCore/PAL/pal/spi/cf/CFUtilitiesSPI.h.
* pal/spi/mac/NSMenuSPI.h:
* pal/spi/mac/NSScrollViewSPI.h: Copied from Source/WebCore/PAL/pal/spi/cf/CFUtilitiesSPI.h.
* pal/spi/mac/NSScrollerImpSPI.h:
* pal/system/cf/DefaultSearchProvider.cpp: Copied from Source/WebCore/PAL/pal/spi/cf/CFUtilitiesSPI.h.
(PAL::defaultSearchProviderDisplayName):
* pal/system/cf/DefaultSearchProvider.h: Copied from Source/WebCore/PAL/pal/spi/cf/CFUtilitiesSPI.h.
* pal/system/mac/PopupMenu.h: Copied from Source/WebCore/PAL/pal/spi/cf/CFUtilitiesSPI.h.
* pal/system/mac/PopupMenu.mm: Added.
(PAL::popUpMenu):

Source/WebKit:

* NetworkProcess/mac/NetworkProcessMac.mm:
(WebKit::NetworkProcess::initializeProcessName):
* PluginProcess/mac/PluginProcessMac.mm:
(WebKit::PluginProcess::initializeProcessName):
* StorageProcess/mac/StorageProcessMac.mm:
(WebKit::StorageProcess::initializeProcessName):
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::trackingAreaOptions):
(WebKit::WebViewImpl::mightBeginScrollWhileInactive):
* UIProcess/mac/WebPopupMenuProxyMac.mm:
(WebKit::WebPopupMenuProxyMac::showPopupMenu):
* WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
(WebKit::NetscapePlugin::popUpContextMenu):
* WebProcess/Plugins/PDF/PDFPlugin.mm:
(WebKit::PDFPlugin::handleContextMenuEvent):
* WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
(InitWebCoreSystemInterface):
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::initializeProcessName):
(WebKit::WebProcess::updateActivePages):

Source/WebKitLegacy/mac:

* DefaultDelegates/WebDefaultContextMenuDelegate.mm:
(-[WebDefaultUIDelegate menuItemWithTag:target:representedObject:]):
* Plugins/Hosted/NetscapePluginHostProxy.mm:
(WebKit::NetscapePluginHostProxy::NetscapePluginHostProxy):
* WebCoreSupport/PopupMenuMac.mm:
(PopupMenuMac::show):
* WebCoreSupport/WebSystemInterface.mm:
(InitWebCoreSystemInterface):
* WebView/WebHTMLView.mm:
(-[WebHTMLView setDataSource:]):
(-[WebHTMLView attachRootLayer:]):
* WebView/WebView.mm:
(-[WebView _needsAdobeFrameReloadingQuirk]):
(-[WebView _needsLinkElementTextCSSQuirk]):
(-[WebView _needsIsLoadingInAPISenseQuirk]):
(-[WebView _needsFrameLoadDelegateRetainQuirk]):
(-[WebView _preferencesChanged:]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222150 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years ago[Win] Fix invalid line in TestExpectations.
pvollan@apple.com [Mon, 18 Sep 2017 16:09:25 +0000 (16:09 +0000)]
[Win] Fix invalid line in TestExpectations.

Unreviewed test gardening.

* platform/win/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222149 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years ago[Win][PAL] Move WebCoreHeaderDetection.h to PAL
commit-queue@webkit.org [Mon, 18 Sep 2017 15:44:12 +0000 (15:44 +0000)]
[Win][PAL] Move WebCoreHeaderDetection.h to PAL
https://bugs.webkit.org/show_bug.cgi?id=176990

Patch by Yoshiaki Jitsukawa <Yoshiaki.Jitsukawa@sony.com> on 2017-09-18
Reviewed by Alex Christensen.

.:

Create DerivedSources directory for PAL if WebCore build is enabled.

* Source/cmake/WebKitCommon.cmake:
* Source/cmake/WebKitFS.cmake:

Source/WebCore:

* PlatformWin.cmake:
Stop generating WebCoreHeaderDetection.h in WebCore.

* config.h:
* platform/graphics/ca/win/PlatformCALayerWin.cpp:
* platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
Include PALHeaderDetection.h instead of WebCoreHeaderDetection.h

Source/WebCore/PAL:

* AVFoundationSupport.py: Renamed from Source/WebCore/AVFoundationSupport.py.
(lookFor):
(fileContains):

* pal/PlatformWin.cmake:
Add a custom target PAL_PreBuild to generate PALHeaderDetection.h

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222148 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years ago[Curl] Create classes dedicated to handle SSL related tasks
commit-queue@webkit.org [Mon, 18 Sep 2017 15:41:15 +0000 (15:41 +0000)]
[Curl] Create classes dedicated to handle SSL related tasks
and separate verifier and certificate management.
https://bugs.webkit.org/show_bug.cgi?id=176910

Patch by Basuke Suzuki <Basuke.Suzuki@sony.com> on 2017-09-18
Reviewed by Alex Christensen.

* platform/Curl.cmake:
* platform/network/curl/CurlContext.cpp:
(WebCore::CurlContext::CurlContext):
(WebCore::CurlHandle::setCACertPath):
(WebCore::certificatePath): Deleted.
(WebCore::CurlHandle::enableCAInfoIfExists): Deleted.
(WebCore::CurlHandle::setSslErrors): Deleted.
(WebCore::CurlHandle::getSslErrors): Deleted.
* platform/network/curl/CurlContext.h:
(WebCore::CurlContext::sslHandle):
(WebCore::CurlContext::getCertificatePath const): Deleted.
(WebCore::CurlContext::shouldIgnoreSSLErrors const): Deleted.
* platform/network/curl/CurlDownload.cpp:
(WebCore::CurlDownload::setupRequest):
* platform/network/curl/CurlSSLHandle.cpp: Added.
(WebCore::CurlSSLHandle::CurlSSLHandle):
(WebCore::CurlSSLHandle::getCACertPathEnv):
(WebCore::CurlSSLHandle::setHostAllowsAnyHTTPSCertificate):
(WebCore::CurlSSLHandle::isAllowedHTTPSCertificateHost):
(WebCore::CurlSSLHandle::canIgnoredHTTPSCertificate):
(WebCore::CurlSSLHandle::setClientCertificateInfo):
(WebCore::CurlSSLHandle::getSSLClientCertificate):
* platform/network/curl/CurlSSLHandle.h: Renamed from Source/WebCore/platform/network/curl/SSLHandle.h.
(WebCore::CurlSSLHandle::shouldIgnoreSSLErrors const):
(WebCore::CurlSSLHandle::getCACertPath const):
* platform/network/curl/CurlSSLVerifier.cpp: Renamed from Source/WebCore/platform/network/curl/SSLHandle.cpp.
(WebCore::CurlSSLVerifier::setSslCtx):
(WebCore::CurlSSLVerifier::certVerifyCallback):
(WebCore::CurlSSLVerifier::getPemDataFromCtx):
(WebCore::CurlSSLVerifier::convertToSSLCertificateFlags):
* platform/network/curl/CurlSSLVerifier.h: Added.
(WebCore::CurlSSLVerifier::setCurlHandle):
(WebCore::CurlSSLVerifier::setHostName):
(WebCore::CurlSSLVerifier::sslErrors):
* platform/network/curl/ResourceHandleCurl.cpp:
(WebCore::ResourceHandle::setHostAllowsAnyHTTPSCertificate):
(WebCore::ResourceHandle::setClientCertificateInfo):
* platform/network/curl/ResourceHandleCurlDelegate.cpp:
(WebCore::ResourceHandleCurlDelegate::ResourceHandleCurlDelegate):
(WebCore::ResourceHandleCurlDelegate::setupRequest):
(WebCore::ResourceHandleCurlDelegate::notifyFail):
(WebCore::ResourceHandleCurlDelegate::willSetupSslCtx):
(WebCore::ResourceHandleCurlDelegate::willSetupSslCtxCallback):
* platform/network/curl/ResourceHandleCurlDelegate.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222147 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoMark http/tests/websocket/tests/hybi/secure-cookie-secure-connection.pl as a failure...
pvollan@apple.com [Mon, 18 Sep 2017 15:29:38 +0000 (15:29 +0000)]
Mark http/tests/websocket/tests/hybi/secure-cookie-secure-connection.pl as a failure on Windows.
https://bugs.webkit.org/show_bug.cgi?id=177072

Unreviewed test gardening.

* platform/win/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222146 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoMark fast/events/beforeunload-dom-manipulation-crash.html as a crash on Windows.
pvollan@apple.com [Mon, 18 Sep 2017 15:23:46 +0000 (15:23 +0000)]
Mark fast/events/beforeunload-dom-manipulation-crash.html as a crash on Windows.
https://bugs.webkit.org/show_bug.cgi?id=177071

Unreviewed test gardening.

* platform/win/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222145 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoMark http/tests/security/video-cross-origin-caching.html as a flaky crash on Windows.
pvollan@apple.com [Mon, 18 Sep 2017 15:04:53 +0000 (15:04 +0000)]
Mark http/tests/security/video-cross-origin-caching.html as a flaky crash on Windows.
https://bugs.webkit.org/show_bug.cgi?id=160447

Unreviewed test gardening.

* platform/win/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222144 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years ago[DFG] Remove ToThis more aggressively
utatane.tea@gmail.com [Mon, 18 Sep 2017 12:47:26 +0000 (12:47 +0000)]
[DFG] Remove ToThis more aggressively
https://bugs.webkit.org/show_bug.cgi?id=177056

Reviewed by Saam Barati.

JSTests:

* stress/generator-with-this-strict.js: Added.
(shouldBe):
(generator):
(target):
* stress/generator-with-this.js: Added.
(shouldBe):
(generator):
(target):

Source/JavaScriptCore:

The variation of toThis() implementation is limited. So, we attempts to implement common toThis operation in AI.
We move scope related toThis to JSScope::toThis. And AI investigates proven value/structure's toThis methods
and attempts to fold/convert to efficient nodes.

We introduces GetGlobalThis, which just loads globalThis from semantic origin's globalObject. Using this,
we can implement JSScope::toThis in DFG. This can avoid costly toThis indirect function pointer call.

Currently, we just emit GetGlobalThis if necessary. We can further convert it to constant if we can put
watchpoint to JSGlobalObject's globalThis change. But we leave it for a future patch for now.

This removes GetGlobalThis from ES6 generators in common cases.

spread-generator.es6      303.1550+-9.5037          290.9337+-8.3487          might be 1.0420x faster

* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::isToThisAnIdentity):
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGConstantFoldingPhase.cpp:
(JSC::DFG::ConstantFoldingPhase::foldConstants):
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGNode.h:
(JSC::DFG::Node::convertToGetGlobalThis):
* dfg/DFGNodeType.h:
* dfg/DFGPredictionPropagationPhase.cpp:
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileGetGlobalThis):
* dfg/DFGSpeculativeJIT.h:
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileNode):
(JSC::FTL::DFG::LowerDFGToB3::compileGetGlobalThis):
* runtime/JSGlobalLexicalEnvironment.cpp:
(JSC::JSGlobalLexicalEnvironment::toThis): Deleted.
* runtime/JSGlobalLexicalEnvironment.h:
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::toThis): Deleted.
* runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::addressOfGlobalThis):
* runtime/JSLexicalEnvironment.cpp:
(JSC::JSLexicalEnvironment::toThis): Deleted.
* runtime/JSLexicalEnvironment.h:
* runtime/JSScope.cpp:
(JSC::JSScope::toThis):
* runtime/JSScope.h:
* runtime/StrictEvalActivation.cpp:
(JSC::StrictEvalActivation::toThis): Deleted.
* runtime/StrictEvalActivation.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222143 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoUpdate my status.
Ms2ger@igalia.com [Mon, 18 Sep 2017 08:10:13 +0000 (08:10 +0000)]
Update my status.

Unreviewed.

* Scripts/webkitpy/common/config/contributors.json:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222142 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoREGRESSION(r221974): [Harfbuzz] Test fast/text/international/hebrew-selection.html...
carlosgc@webkit.org [Mon, 18 Sep 2017 05:22:33 +0000 (05:22 +0000)]
REGRESSION(r221974): [Harfbuzz] Test fast/text/international/hebrew-selection.html is failing since r221974
https://bugs.webkit.org/show_bug.cgi?id=177036

Reviewed by Michael Catanzaro.

In r221974 I rewrote the characterIndexForXPosition implementation without taking into account that there can be
multiple glyphs for the same character, so we can't simply do index++ and index-- to get the next and previous
character index.

* platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
(WebCore::HarfBuzzShaper::HarfBuzzRun::characterIndexForXPosition): Always get the character index from
m_glyphToCharacterIndexes array.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222141 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoStart working on WSL documentation
fpizlo@apple.com [Mon, 18 Sep 2017 05:05:56 +0000 (05:05 +0000)]
Start working on WSL documentation
https://bugs.webkit.org/show_bug.cgi?id=177064

Reviewed by Mylex Maxfield.

This is a work in progress. I'd like to check it in and then keep adding to it.

* WebGPUShadingLanguageRI/WSL.md: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222140 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoWSL needs to understand && and ||
mmaxfield@apple.com [Mon, 18 Sep 2017 03:39:19 +0000 (03:39 +0000)]
WSL needs to understand && and ||
https://bugs.webkit.org/show_bug.cgi?id=177062

Reviewed by Filip Pizlo.

Very similar to LogicalNot.

* WebGPUShadingLanguageRI/All.js:
* WebGPUShadingLanguageRI/Checker.js:
* WebGPUShadingLanguageRI/EBufferBuilder.js:
(EBufferBuilder.prototype.visitLogicalExpression):
* WebGPUShadingLanguageRI/Evaluator.js:
(Evaluator.prototype.visitLogicalExpression):
* WebGPUShadingLanguageRI/Lexer.js:
(Lexer.prototype.next):
(Lexer):
* WebGPUShadingLanguageRI/LogicalExpression.js: Added.
(LogicalExpression):
(LogicalExpression.prototype.get text):
(LogicalExpression.prototype.get left):
(LogicalExpression.prototype.get right):
(LogicalExpression.prototype.toString):
* WebGPUShadingLanguageRI/Parse.js:
(parseLeftLogicalExpression):
* WebGPUShadingLanguageRI/Rewriter.js:
(Rewriter.prototype.visitLogicalExpression):
* WebGPUShadingLanguageRI/Test.html:
* WebGPUShadingLanguageRI/Test.js:
* WebGPUShadingLanguageRI/Visitor.js:
(Visitor.prototype.visitProtocolDecl):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222139 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoWSL needs float and double support
mmaxfield@apple.com [Mon, 18 Sep 2017 00:31:53 +0000 (00:31 +0000)]
WSL needs float and double support
https://bugs.webkit.org/show_bug.cgi?id=177058

Reviewed by Filip Pizlo.

Use the existing int and uint types as a model. The types themselves are straighforward. Just like int and uint,
you can't pass a float as a double argument and vice-versa. This patch adds operator+, -, *, and / for floats
and doubles.

Float literals are more complicated. If your number has a "." character in it, it is treated as a float literal.
You can add a suffix of "f" or "d" to force the literal to pretend to be a float or a double. These literals are
able to masquerade as either floats or doubles (unlike an explicit type). However, these literals are not able
to masquerade as ints or uints. There's also a nice check that your float literal can actually fit in a float.

* WebGPUShadingLanguageRI/All.js:
* WebGPUShadingLanguageRI/DoubleLiteral.js: Copied from Tools/WebGPUShadingLanguageRI/Type.js.
(let.DoubleLiteral.createLiteral.createType):
* WebGPUShadingLanguageRI/DoubleLiteralType.js: Copied from Tools/WebGPUShadingLanguageRI/Type.js.
(let.DoubleLiteralType.createLiteralType.verifyAsArgument):
* WebGPUShadingLanguageRI/FloatLiteral.js: Copied from Tools/WebGPUShadingLanguageRI/Type.js.
(let.FloatLiteral.createLiteral.createType):
* WebGPUShadingLanguageRI/FloatLiteralType.js: Copied from Tools/WebGPUShadingLanguageRI/Type.js.
(let.FloatLiteralType.createLiteralType.verifyAsArgument):
* WebGPUShadingLanguageRI/Intrinsics.js:
(Intrinsics):
* WebGPUShadingLanguageRI/Lexer.js:
(Lexer.prototype.next):
(Lexer):
* WebGPUShadingLanguageRI/NativeType.js:
(NativeType):
(NativeType.prototype.get isFloating):
(NativeType.prototype.set isFloating):
(NativeType.prototype.get isFloat): Deleted.
(NativeType.prototype.set isFloat): Deleted.
* WebGPUShadingLanguageRI/Parse.js:
(parseTerm):
* WebGPUShadingLanguageRI/Rewriter.js:
(Rewriter.prototype.visitGenericLiteral):
* WebGPUShadingLanguageRI/StandardLibrary.js:
(uint.operator):
(int.operator):
* WebGPUShadingLanguageRI/Test.html:
* WebGPUShadingLanguageRI/Test.js:
(makeFloat):
(makeDouble):
(checkNumber):
(checkFloat):
(checkDouble):
* WebGPUShadingLanguageRI/Type.js:
(Type.prototype.get isFloating):
(Type.prototype.get isFloat): Deleted.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222138 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoWeb Inspector: Styles Redesign: support toggling properties
nvasilyev@apple.com [Sun, 17 Sep 2017 20:11:37 +0000 (20:11 +0000)]
Web Inspector: Styles Redesign: support toggling properties
https://bugs.webkit.org/show_bug.cgi?id=176643

Reviewed by Matt Baker.

Source/WebInspectorUI:

Add checkboxes to toggle (comment/uncomment) CSS properties.

* UserInterface/Base/Utilities.js:
(String.prototype.get lineCount):
(String.prototype.get lastLine):
Add string methods that are used by WI.CSSProperty.prototype._updateOwnerStyleText.

* UserInterface/Models/CSSProperty.js:
(WI.CSSProperty.prototype.commentOut):
(WI.CSSProperty.prototype.set text):
(WI.CSSProperty.prototype.get editable):
(WI.CSSProperty.prototype._updateOwnerStyleText):
Add methods necessary for property toggling.

* UserInterface/Models/CSSStyleDeclaration.js:
(WI.CSSStyleDeclaration):
(WI.CSSStyleDeclaration.prototype.get allVisibleProperties):
Add a getter that is used by SpreadsheetCSSStyleDeclarationEditor.prototype._propertiesToRender.

(WI.CSSStyleDeclaration.prototype.get visibleProperties):
* UserInterface/Models/TextRange.js:
(WI.TextRange.prototype.clone):
(WI.TextRange.prototype.cloneAndModify):
(WI.TextRange.prototype.relativeTo):
Add methods that are used by WI.CSSProperty.prototype._updateOwnerStyleText.

* UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.css:
(.spreadsheet-style-declaration-editor):
(.spreadsheet-style-declaration-editor .property-toggle):
(.spreadsheet-css-declaration:matches(:hover, :focus) .property-toggle,):
(.spreadsheet-style-declaration-editor .property.disabled,):
* UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js:
(WI.SpreadsheetCSSStyleDeclarationEditor.prototype.layout):
(WI.SpreadsheetCSSStyleDeclarationEditor.prototype.set style):
(WI.SpreadsheetCSSStyleDeclarationEditor.prototype.get _propertiesToRender):
(WI.SpreadsheetCSSStyleDeclarationEditor):
(WI.SpreadsheetStyleProperty):
(WI.SpreadsheetStyleProperty.prototype.get element):
(WI.SpreadsheetStyleProperty.prototype._update):
* UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.css:
* UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
(WI.SpreadsheetCSSStyleDeclarationSection.prototype.initialLayout):
* UserInterface/Views/SpreadsheetRulesStyleDetailsPanel.js:
(WI.SpreadsheetRulesStyleDetailsPanel.prototype.refresh):
(WI.SpreadsheetRulesStyleDetailsPanel):
* UserInterface/Views/SyntaxHighlightingDefaultTheme.css:
(.cm-s-default .cm-comment,):
* UserInterface/Views/Variables.css:
(:root):
Make comment color a CSS variable.

LayoutTests:

Add tests for String.prototype.lineCount and String.prototype.lastLine.

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

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222137 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoMerge JSLexicalEnvironment and JSEnvironmentRecord
utatane.tea@gmail.com [Sun, 17 Sep 2017 17:28:15 +0000 (17:28 +0000)]
Merge JSLexicalEnvironment and JSEnvironmentRecord
https://bugs.webkit.org/show_bug.cgi?id=175492

Reviewed by Saam Barati.

JSEnvironmentRecord is only inherited by JSLexicalEnvironment.
We can merge JSEnvironmentRecord and JSLexicalEnvironment.

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileGetByValOnScopedArguments):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* ftl/FTLAbstractHeapRepository.h:
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileGetByVal):
(JSC::FTL::DFG::LowerDFGToB3::compileCreateActivation):
(JSC::FTL::DFG::LowerDFGToB3::compileGetClosureVar):
(JSC::FTL::DFG::LowerDFGToB3::compilePutClosureVar):
(JSC::FTL::DFG::LowerDFGToB3::compileMaterializeCreateActivation):
* jit/JITPropertyAccess.cpp:
(JSC::JIT::emitGetClosureVar):
(JSC::JIT::emitPutClosureVar):
(JSC::JIT::emitScopedArgumentsGetByVal):
* jit/JITPropertyAccess32_64.cpp:
(JSC::JIT::emitGetClosureVar):
(JSC::JIT::emitPutClosureVar):
* llint/LLIntOffsetsExtractor.cpp:
* llint/LowLevelInterpreter.asm:
* llint/LowLevelInterpreter32_64.asm:
* llint/LowLevelInterpreter64.asm:
* runtime/JSEnvironmentRecord.cpp: Removed.
* runtime/JSEnvironmentRecord.h: Removed.
* runtime/JSLexicalEnvironment.cpp:
(JSC::JSLexicalEnvironment::visitChildren):
(JSC::JSLexicalEnvironment::heapSnapshot):
(JSC::JSLexicalEnvironment::getOwnNonIndexPropertyNames):
* runtime/JSLexicalEnvironment.h:
(JSC::JSLexicalEnvironment::subspaceFor):
(JSC::JSLexicalEnvironment::variables):
(JSC::JSLexicalEnvironment::isValidScopeOffset):
(JSC::JSLexicalEnvironment::variableAt):
(JSC::JSLexicalEnvironment::offsetOfVariables):
(JSC::JSLexicalEnvironment::offsetOfVariable):
(JSC::JSLexicalEnvironment::allocationSizeForScopeSize):
(JSC::JSLexicalEnvironment::allocationSize):
(JSC::JSLexicalEnvironment::finishCreationUninitialized):
(JSC::JSLexicalEnvironment::finishCreation):
* runtime/JSModuleEnvironment.cpp:
(JSC::JSModuleEnvironment::create):
* runtime/JSObject.h:
(JSC::JSObject::isEnvironment const):
(JSC::JSObject::isEnvironmentRecord const): Deleted.
* runtime/JSSegmentedVariableObject.h:
* runtime/StringPrototype.cpp:
(JSC::checkObjectCoercible):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222136 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agohttps://bugs.webkit.org/show_bug.cgi?id=177038
msaboff@apple.com [Sun, 17 Sep 2017 15:39:02 +0000 (15:39 +0000)]
https://bugs.webkit.org/show_bug.cgi?id=177038
Add an option to run-jsc-stress-tests to limit tests variations to a basic set

Reviewed by JF Bastien.

JSTests:

* stress/unshiftCountSlowCase-correct-postCapacity.js: Disabled this test on ARM64 iOS devices
as it dies using too much memory.

Tools:

Added the --basic option that runs defaults tests with the following modes, default, no-llint,
no-cjit-validate-phases, no-cjit-collect-continuously, dfg-eager and for FTL platforms: no-ftl,
ftl-eager-no-cjit and ftl-no-cjit-small-pool.  This takes about half the time as running all
16 modes of a full run.

* Scripts/run-jsc-stress-tests:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222135 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years ago[WPE][GTK] Merge ProcessLauncher[WPE,GTK]
mcatanzaro@igalia.com [Sun, 17 Sep 2017 14:37:31 +0000 (14:37 +0000)]
[WPE][GTK] Merge ProcessLauncher[WPE,GTK]
https://bugs.webkit.org/show_bug.cgi?id=177041

Unreviewed fixup, I broke the size of the argv buffer when experimenting with how to respond
to review comments. Not sure why this didn't blow up everything during testing.

* UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
(WebKit::ProcessLauncher::launchProcess):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222134 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years ago[WPE][GTK] Merge ProcessLauncher[WPE,GTK]
mcatanzaro@igalia.com [Sun, 17 Sep 2017 14:34:02 +0000 (14:34 +0000)]
[WPE][GTK] Merge ProcessLauncher[WPE,GTK]
https://bugs.webkit.org/show_bug.cgi?id=177041

Reviewed by Carlos Garcia Campos.

* PlatformGTK.cmake:
* PlatformWPE.cmake:
* UIProcess/Launcher/glib/ProcessLauncherGLib.cpp: Renamed from Source/WebKit/UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp.
(WebKit::childSetupFunction):
(WebKit::ProcessLauncher::launchProcess):
(WebKit::ProcessLauncher::terminateProcess):
(WebKit::ProcessLauncher::platformInvalidate):
* UIProcess/Launcher/wpe/ProcessLauncherWPE.cpp: Removed.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222133 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years ago[Harfbuzz] Test fast/text/complex-text-selection.html is failing since r222090
carlosgc@webkit.org [Sun, 17 Sep 2017 08:06:57 +0000 (08:06 +0000)]
[Harfbuzz] Test fast/text/complex-text-selection.html is failing since r222090
https://bugs.webkit.org/show_bug.cgi?id=177035

Reviewed by Michael Catanzaro.

The problem was not actually introduced in r222090, but revelaed by that change. The bug was added in r222086,
when adding the support for shaping a range of characters. We are not correctly filtering the characters in case
of rtl in some cases.

Fixes: fast/text/complex-text-selection.html

* platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
(WebCore::HarfBuzzShaper::fillGlyphBufferFromHarfBuzzRun): When checking if the current character is inside
the given range, continue or break the loop depending on whether text is rtl or not.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222132 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoFix the Tools build with CMake on macOS
timothy_horton@apple.com [Sat, 16 Sep 2017 18:46:44 +0000 (18:46 +0000)]
Fix the Tools build with CMake on macOS
https://bugs.webkit.org/show_bug.cgi?id=177030

Reviewed by Geoffrey Garen.

Source/WebKit:

* PlatformMac.cmake:
Add some WebKitLegacy headers to forward (for use by the tools).

Source/WebKitLegacy:

* PlatformMac.cmake:
Add some forwarding headers.

Tools:

* TestWebKitAPI/CMakeLists.txt:
Add a workaround identical to what the gtest CMakeLists has.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222131 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years ago[GTK] Build failure with enchant-2.1.1
mcatanzaro@igalia.com [Sat, 16 Sep 2017 15:01:53 +0000 (15:01 +0000)]
[GTK] Build failure with enchant-2.1.1
https://bugs.webkit.org/show_bug.cgi?id=176877

Unreviewed build fix for enchant 2.1.1.

enchant_dict_free_suggestions() has been deprecated since at least 2005. Use its
replacement, enchant_dict_free_string_list(), instead. That's also been around since at
least 2005.

* platform/text/enchant/TextCheckerEnchant.cpp:
(WebCore::TextCheckerEnchant::getGuessesForWord):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222130 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoComputing animated style should not require renderers
antti@apple.com [Sat, 16 Sep 2017 12:33:04 +0000 (12:33 +0000)]
Computing animated style should not require renderers
https://bugs.webkit.org/show_bug.cgi?id=171926
<rdar://problem/34428035>

Reviewed by Sam Weinig.

Source/WebCore:

CSS animation system is now element rather than renderer based. This allows cleaning up
style resolution and render tree update code.

This also fixes bug animation doesn't run if display property is animated from one rendered type
to another. Added a test case for this.

Test: transitions/transition-display-property-2.html

* page/animation/CSSAnimationController.cpp:
(WebCore::CSSAnimationController::updateAnimations):

    Pass in the old style instead of getting it from the renderer.
    Factor to return the animated style as a return value.

* page/animation/CSSAnimationController.h:
* rendering/RenderElement.cpp:
(WebCore::RenderElement::RenderElement):
(WebCore::RenderElement::willBeDestroyed):

    Animation are now canceled by RenderTreeUpdater::tearDownRenderers.

* rendering/RenderElement.h:
(WebCore::RenderElement::hasInitialAnimatedStyle const): Deleted.
(WebCore::RenderElement::setHasInitialAnimatedStyle): Deleted.

    We no longer need to this concept.

* style/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::updateElementRenderer):
(WebCore::RenderTreeUpdater::createRenderer):

    We now get correct animated style from style resolution in all cases so we don't need to compute
    it separately for new renderers.

(WebCore::RenderTreeUpdater::tearDownRenderers):

    Cancel animations when render tree is fully torn down. Keep them when updating style.

* style/RenderTreeUpdater.h:
* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::createAnimatedElementUpdate):

    We can now compute animated style without renderer. Special cases dealing with rendererless case
    can be removed.

LayoutTests:

* transitions/transition-display-property-2-expected.html: Added.
* transitions/transition-display-property-2.html: Added.
* transitions/transition-display-property.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222129 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years ago[GTK] Bump fontconfig version to 2.12.4
carlosgc@webkit.org [Sat, 16 Sep 2017 09:27:22 +0000 (09:27 +0000)]
[GTK] Bump fontconfig version to 2.12.4
https://bugs.webkit.org/show_bug.cgi?id=176997

Reviewed by Michael Catanzaro.

It's the latest stable version and we can get rid of the patches we have.

* WebKitTestRunner/gtk/fonts/fonts.conf: Remove hinting config we no longer need with newer FreeType and
deprecated <blank> that current fontconfig just ignores.
* gtk/jhbuild.modules:
* gtk/patches/fontconfig-2.11.1-add-autogen.patch: Removed.
* gtk/patches/fontconfig-Avoid-conflicts-with-integer-width-macros-from-TS-18661-1-2014.patch: Removed.
* gtk/patches/fontconfig-Fix-the-build-issue-with-gperf-3.1.patch: Removed.
* gtk/patches/fontconfig-fix-osx-cache.diff: Removed.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222128 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoUnreviewed GTK+ gardening. Rebaseline tests after r222090.
carlosgc@webkit.org [Sat, 16 Sep 2017 08:28:06 +0000 (08:28 +0000)]
Unreviewed GTK+ gardening. Rebaseline tests after r222090.

* platform/gtk/svg/W3C-I18N/g-dirRTL-ubNone-expected.png:
* platform/gtk/svg/W3C-I18N/g-dirRTL-ubNone-expected.txt:
* platform/gtk/svg/W3C-I18N/g-dirRTL-ubOverride-expected.png:
* platform/gtk/svg/W3C-I18N/g-dirRTL-ubOverride-expected.txt:
* platform/gtk/svg/W3C-I18N/text-dirRTL-ubNone-expected.png:
* platform/gtk/svg/W3C-I18N/text-dirRTL-ubNone-expected.txt:
* platform/gtk/svg/W3C-I18N/tspan-direction-rtl-expected.png:
* platform/gtk/svg/W3C-I18N/tspan-direction-rtl-expected.txt:
* platform/gtk/svg/W3C-SVG-1.1/fonts-glyph-02-t-expected.png:
* platform/gtk/svg/W3C-SVG-1.1/fonts-glyph-02-t-expected.txt:
* platform/gtk/svg/custom/glyph-selection-arabic-forms-expected.png:
* platform/gtk/svg/custom/glyph-selection-arabic-forms-expected.txt:
* platform/gtk/svg/text/bidi-tspans-expected.png:
* platform/gtk/svg/text/bidi-tspans-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222127 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years ago[Harbuzz] Test fast/text/international/harfbuzz-runs-with-no-glyph.html is crashing
carlosgc@webkit.org [Sat, 16 Sep 2017 06:39:15 +0000 (06:39 +0000)]
[Harbuzz] Test fast/text/international/harfbuzz-runs-with-no-glyph.html is crashing
https://bugs.webkit.org/show_bug.cgi?id=177005

Reviewed by Michael Catanzaro.

Fixes: fast/text/international/harfbuzz-runs-with-no-glyph.html

* platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
(WebCore::HarfBuzzShaper::HarfBuzzRun::xPositionForOffset): Return early if there aren't glyphs.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222126 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoAvoid calling String::format() in PlatformCAFilters::setFiltersOnLayer()
commit-queue@webkit.org [Sat, 16 Sep 2017 02:26:44 +0000 (02:26 +0000)]
Avoid calling String::format() in PlatformCAFilters::setFiltersOnLayer()
https://bugs.webkit.org/show_bug.cgi?id=177028

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2017-09-15
Reviewed by Tim Horton.

String::format() is a bigger hammer for what we need to do in this function.

* platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222125 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoWeb Inspector: REGRESSION(r222057): recording state doesn't update when changing...
webkit@devinrousso.com [Sat, 16 Sep 2017 02:12:17 +0000 (02:12 +0000)]
Web Inspector: REGRESSION(r222057): recording state doesn't update when changing actions
https://bugs.webkit.org/show_bug.cgi?id=176988

Reviewed by Matt Baker.

Replace `updateActionIndex` with `updateAction`, where the currently selected RecordingAction
is passed to the DetailsSidebarPanel. Also remove the call to `this._recording.actions` in
order to ensure that all logic performed by both DetailsSidebarPanel is synchronous.

* Localizations/en.lproj/localizedStrings.js:

* UserInterface/Views/RecordingTabContentView.js:
(WI.RecordingTabContentView.prototype._updateActionIndex):

* UserInterface/Views/RecordingContentView.js:
(WI.RecordingContentView.prototype.async._generateContentCanvas2D):
(WI.RecordingContentView.prototype.async._generateContentCanvasWebGL):

* UserInterface/Views/RecordingStateDetailsSidebarPanel.js:
(WI.RecordingStateDetailsSidebarPanel):
(WI.RecordingStateDetailsSidebarPanel.prototype.set recording):
(WI.RecordingStateDetailsSidebarPanel.prototype.updateAction):
(WI.RecordingStateDetailsSidebarPanel.prototype._generateDetailsCanvas2D):
(WI.RecordingStateDetailsSidebarPanel.prototype.updateActionIndex): Deleted.

* UserInterface/Views/RecordingTraceDetailsSidebarPanel.js:
(WI.RecordingTraceDetailsSidebarPanel):
(WI.RecordingTraceDetailsSidebarPanel.prototype.set recording):
(WI.RecordingTraceDetailsSidebarPanel.prototype.updateAction):
(WI.RecordingTraceDetailsSidebarPanel.prototype.updateActionIndex): Deleted.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222124 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoShould not mark a platform as missing in summary page if all expecting metrics are...
dewei_zhu@apple.com [Sat, 16 Sep 2017 01:11:27 +0000 (01:11 +0000)]
Should not mark a platform as missing in summary page if all expecting metrics are exlucded.
https://bugs.webkit.org/show_bug.cgi?id=176970

Reviewed by Ryosuke Niwa.

In summary page, if all metrics for a test are excluded in excludedConfigurations for a platform, this platform should not be marked as missing.

* public/v3/pages/summary-page.js:
(SummaryPageConfigurationGroup):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222123 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoMove run-webkit-archive from Tools/Scripts to Tools/BuildSlaveSupport
lforschler@apple.com [Sat, 16 Sep 2017 00:05:42 +0000 (00:05 +0000)]
Move run-webkit-archive from Tools/Scripts to Tools/BuildSlaveSupport

Reviewed by Alexey Proskuryakov.

* Scripts/run-webkit-archive: Removed.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222122 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoteach build.webkit.org to include run-webkit-archive in the root folder of uploaded...
lforschler@apple.com [Sat, 16 Sep 2017 00:04:16 +0000 (00:04 +0000)]
teach build.webkit.org to include run-webkit-archive in the root folder of uploaded macOS archives.
https://bugs.webkit.org/show_bug.cgi?id=176965

Reviewed by Alexey Proskuryakov.

* BuildSlaveSupport/built-product-archive:
(addLauncherToArchive): Helper function to add the launcher script
(createZip): teach function about addLauncherToArchive
* BuildSlaveSupport/run-webkit-archive: Added.
(check_for_valid_platform): Add logic to ensure platform is Darwin
(find_dyld_framework_path): Find the dyld framework path
(run_safari_for_webkit_development): launch SafariForWebKitDevelopment
(set_dyld_framework_path): export the environment for dydl framework path

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222121 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years ago[WSL] Small cleanup in Evaluator
mmaxfield@apple.com [Sat, 16 Sep 2017 00:02:48 +0000 (00:02 +0000)]
[WSL] Small cleanup in Evaluator
https://bugs.webkit.org/show_bug.cgi?id=176971

Reviewed by Filip Pizlo.

Use the symbols for break and continue instead of the objects themselves.

No tests because there is no behavior change.

* WebGPUShadingLanguageRI/Evaluator.js:
(Evaluator.prototype.visitWhileLoop):
(Evaluator.prototype.visitDoWhileLoop):
(Evaluator.prototype.visitForLoop):
(Evaluator.prototype.visitBreak):
(Evaluator.prototype.visitContinue):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222120 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoiOS: Use blob URL instead of a WebKit fake URL when pasting an image
rniwa@webkit.org [Fri, 15 Sep 2017 23:59:35 +0000 (23:59 +0000)]
iOS: Use blob URL instead of a WebKit fake URL when pasting an image
https://bugs.webkit.org/show_bug.cgi?id=176986
<rdar://problem/34455052>

Reviewed by Wenson Hsieh.

Source/WebCore:

Fixed the bug that pasting an image on iOS resulted in an img element with src attribute
set to a WebKit fake URL so that the Web content could never save it.

Like r208451 on Mac, use a Blob URL instead.

This patch also removes createFragmentForImageResourceAndAddResource since it's no longer used.

Tests: LayoutTests/editing/pasteboard/paste-image-as-blob-url.html

* editing/cocoa/WebContentReaderCocoa.mm:
(WebCore::WebContentReader::readImage): Moved the code here from WebContentReaderMac.mm.
* editing/ios/WebContentReaderIOS.mm:
(WebCore::WebContentReader::readImage): Deleted. This is the code
* editing/mac/WebContentReaderMac.mm:
(WebCore::WebContentReader::readImage): Moved to WebContentReaderCocoa.mm. Note that
typeAsFilenameWithExtension was dead code after r208451
* editing/markup.cpp:
(WebCore::createFragmentForImageResourceAndAddResource): Deleted.
* editing/markup.h:

LayoutTests:

Removed the failing expectation on the test added by r208451 now that it passes on iOS.

* platform/ios/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222119 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoWSL Evaluator should only allocate EBuffers when dealing with intrinsics
fpizlo@apple.com [Fri, 15 Sep 2017 23:48:18 +0000 (23:48 +0000)]
WSL Evaluator should only allocate EBuffers when dealing with intrinsics
https://bugs.webkit.org/show_bug.cgi?id=176973

Reviewed by Myles Maxfield.

Whether or not two temporary values share the same EBuffer is ultimately observable in WSL,
because you can do this:

    thread int^ operator&[](thread int^ ptr, uint index)
    {
        g_ptr = ptr;
        return ptr;
    }

And then this is a thing:

    42[0];
    // g_ptr now points to 42's location

Normally this would have a lot of bad implications. But in WSL, if you did choose to do this,
you'd get a pointer to something well-defined: the EBuffer of 42's GenericLiteral. Each static
occurrence of a literal gets its own location, and the semantics of the language call for
42 to be stored into this location when `42` "executes". So, while the programmer could do all
kinds of strange things, at least the strangeness they would see is something we can spec.

But to do this, the interpreter needs to allocate EBuffers in the same way a compiler would.
It cannot allocate them during execution, except when interacting with intrinsics, which won't
know the difference.

In the process, I found places that needed to use AutoWrapper instead of TypeRef.wrap.

* WebGPUShadingLanguageRI/AutoWrapper.js:
(AutoWrapper.prototype.visitGenericLiteralType):
(AutoWrapper.prototype.visitNullType):
(AutoWrapper):
* WebGPUShadingLanguageRI/CallExpression.js:
(CallExpression.prototype.resolve):
* WebGPUShadingLanguageRI/CallFunction.js:
(callFunction):
* WebGPUShadingLanguageRI/Checker.js:
* WebGPUShadingLanguageRI/CreateLiteralType.js:
(createLiteralType.GenericLiteralType.prototype.commitUnification):
* WebGPUShadingLanguageRI/EBuffer.js:
(EBuffer):
(EBuffer.setCanAllocateEBuffers):
(EBuffer.disallowAllocation):
(EBuffer.allowAllocation):
* WebGPUShadingLanguageRI/EBufferBuilder.js:
(EBufferBuilder.prototype.visitVariableDecl):
(EBufferBuilder.prototype.visitFuncDef):
(EBufferBuilder.prototype.visitFunctionLikeBlock):
(EBufferBuilder.prototype.visitCallExpression):
(EBufferBuilder.prototype.visitMakePtrExpression):
(EBufferBuilder.prototype.visitGenericLiteral):
(EBufferBuilder.prototype.visitNullLiteral):
(EBufferBuilder.prototype.visitBoolLiteral):
(EBufferBuilder.prototype.visitLogicalNot):
(EBufferBuilder):
* WebGPUShadingLanguageRI/EPtr.js:
(EPtr.box):
(EPtr.prototype.box):
* WebGPUShadingLanguageRI/Evaluator.js:
(Evaluator.prototype._snapshot):
(Evaluator.prototype.runFunc):
(Evaluator.prototype._runBody):
(Evaluator.prototype.visitFunctionLikeBlock):
(Evaluator.prototype.visitMakePtrExpression):
(Evaluator.prototype.visitGenericLiteral):
(Evaluator.prototype.visitNullLiteral):
(Evaluator.prototype.visitBoolLiteral):
(Evaluator.prototype.visitLogicalNot):
(Evaluator.prototype.visitCallExpression):
(Evaluator):
(Evaluator.prototype.runBody): Deleted.
* WebGPUShadingLanguageRI/Inliner.js:
(Inliner.prototype.visitCallExpression):
* WebGPUShadingLanguageRI/InstantiateImmediates.js:
(InstantiateImmediates.prototype.visitTypeRef):
* WebGPUShadingLanguageRI/Rewriter.js:
(Rewriter.prototype.visitMakePtrExpression):
(Rewriter.prototype.visitGenericLiteral):
(Rewriter.prototype.visitNullLiteral):
(Rewriter.prototype.processDerivedCallData):
(Rewriter.prototype.visitFunctionLikeBlock):
(Rewriter.prototype.visitLogicalNot):
* WebGPUShadingLanguageRI/TypeRef.js:
(TypeRef.prototype.toString):
(TypeRef):
* WebGPUShadingLanguageRI/Visitor.js:
(Visitor.prototype.visitProtocolDecl):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222118 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoFollow up to r222111, rebaseline tests for Sierra.
ryanhaddad@apple.com [Fri, 15 Sep 2017 23:44:45 +0000 (23:44 +0000)]
Follow up to r222111, rebaseline tests for Sierra.
https://bugs.webkit.org/show_bug.cgi?id=176463

Unreviewed test gardening.

* platform/mac-elcapitan/platform/mac/fast/loader/file-url-mimetypes-3-expected.txt: Removed.
* platform/mac-sierra/editing/mac/attributed-string/anchor-element-expected.txt: Renamed from LayoutTests/platform/mac-elcapitan/editing/mac/attributed-string/anchor-element-expected.txt.
* platform/mac-sierra/editing/mac/attributed-string/basic-expected.txt: Renamed from LayoutTests/platform/mac-elcapitan/editing/mac/attributed-string/basic-expected.txt.
* platform/mac-sierra/editing/mac/attributed-string/comment-cdata-section-expected.txt: Renamed from LayoutTests/platform/mac-elcapitan/editing/mac/attributed-string/comment-cdata-section-expected.txt.
* platform/mac-sierra/editing/mac/attributed-string/font-size-expected.txt: Renamed from LayoutTests/platform/mac-elcapitan/editing/mac/attributed-string/font-size-expected.txt.
* platform/mac-sierra/editing/mac/attributed-string/font-weight-expected.txt: Renamed from LayoutTests/platform/mac-elcapitan/editing/mac/attributed-string/font-weight-expected.txt.
* platform/mac-sierra/editing/mac/attributed-string/letter-spacing-expected.txt: Renamed from LayoutTests/platform/mac-elcapitan/editing/mac/attributed-string/letter-spacing-expected.txt.
* platform/mac-sierra/editing/mac/attributed-string/text-decorations-expected.txt: Renamed from LayoutTests/platform/mac-elcapitan/editing/mac/attributed-string/text-decorations-expected.txt.
* platform/mac-sierra/editing/mac/attributed-string/vertical-align-expected.txt: Renamed from LayoutTests/platform/mac-elcapitan/editing/mac/attributed-string/vertical-align-expected.txt.
* platform/mac-sierra/editing/mac/input/firstrectforcharacterrange-styled-expected.txt: Renamed from LayoutTests/platform/mac-elcapitan/editing/mac/input/firstrectforcharacterrange-styled-expected.txt.
* platform/mac-sierra/js/dom/global-constructors-attributes-expected.txt:
* platform/mac-sierra/platform/mac/fast/loader/file-url-mimetypes-3-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222117 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoRationalize how WSL's operator&[] works
fpizlo@apple.com [Fri, 15 Sep 2017 23:44:35 +0000 (23:44 +0000)]
Rationalize how WSL's operator&[] works
https://bugs.webkit.org/show_bug.cgi?id=176958

Reviewed by Myles Maxfield.

This makes operator&[] work with non-array-ref types. The way this works is that if you do base[index]
then we pattern match base's type and proceed accordingly:

    If base's type is T^:
        => Reject

    If base's type is T[]:
        => Accept

    If base's type is T[c]:
        => Wrap it with a MakeArrayRefExpression and accept.

    All other cases:
        => Wrap it with a MakePtrExpression and accept.

This makes it possible for operator&[] to work with lvalues. It also means that operator&[] gets to
"see" the temporary values we create via snapshot() in the interpreter. We'll have to fix that, and I've
filed bug 176973 for that. Once that's fixed, this will have well-defined behavior, though with the very
peculiar caveat that an expression like this:

     totallyNotAnLValue()[42]

Could be used to get a pointer to a non-lvalue. But we can be extremely precise about what that means
and prohibit dangling pointers, which is kinda crazy.

In order to do this, I had to make MakeArrayRefExpression work, so I did that and added tests for it.

* WebGPUShadingLanguageRI/All.js:
* WebGPUShadingLanguageRI/ArrayRefType.js:
(ArrayRefType.prototype.unifyImpl):
(ArrayRefType.prototype.toString):
(ArrayRefType):
* WebGPUShadingLanguageRI/ArrayType.js:
(ArrayType):
(ArrayType.prototype.get numElementsValue):
(ArrayType.prototype.get size):
(ArrayType.prototype.populateDefaultValue):
(ArrayType.prototype.unifyImpl):
* WebGPUShadingLanguageRI/Checker.js:
* WebGPUShadingLanguageRI/ConvertPtrToArrayRefExpression.js: Added.
(ConvertPtrToArrayRefExpression):
(ConvertPtrToArrayRefExpression.prototype.get lValue):
(ConvertPtrToArrayRefExpression.prototype.toString):
* WebGPUShadingLanguageRI/CreateLiteral.js:
(createLiteral.GenericLiteral.withType):
(createLiteral.GenericLiteral.prototype.get isLiteral):
(createLiteral.GenericLiteral.prototype.unifyImpl):
* WebGPUShadingLanguageRI/DotExpression.js:
(DotExpression.prototype.get addressSpace):
* WebGPUShadingLanguageRI/Evaluator.js:
(Evaluator.prototype.visitMakeArrayRefExpression):
(Evaluator.prototype.visitConvertPtrToArrayRefExpression):
* WebGPUShadingLanguageRI/Intrinsics.js:
(Intrinsics):
* WebGPUShadingLanguageRI/MakeArrayRefExpression.js: Added.
(MakeArrayRefExpression):
(MakeArrayRefExpression.prototype.get lValue):
(MakeArrayRefExpression.prototype.becomeConvertPtrToArrayRefExpression):
(MakeArrayRefExpression.prototype.toString):
* WebGPUShadingLanguageRI/MakePtrExpression.js:
(MakePtrExpression.prototype.toString):
(MakePtrExpression):
* WebGPUShadingLanguageRI/PtrType.js:
(PtrType.prototype.toString):
(PtrType):
* WebGPUShadingLanguageRI/ReferenceType.js:
(ReferenceType):
* WebGPUShadingLanguageRI/Rewriter.js:
(Rewriter.prototype.visitArrayType):
(Rewriter.prototype.visitMakeArrayRefExpression):
(Rewriter.prototype.visitConvertPtrToArrayRefExpression):
* WebGPUShadingLanguageRI/StandardLibrary.js:
* WebGPUShadingLanguageRI/Test.html:
* WebGPUShadingLanguageRI/Test.js:
(TEST_buildArrayThenSumItUsingArrayReference):
(TEST_overrideSubscriptStruct):
(TEST_overrideSubscriptStructAndUsePointers):
(TEST_overrideSubscriptStructAndUsePointersIncorrectly):
(TEST_makeArrayRefFromPointer):
(TEST_makeArrayRefFromArrayRef):
* WebGPUShadingLanguageRI/Visitor.js:
(Visitor.prototype.visitProtocolDecl):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222116 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoArity fixup during inlining should do a 2 phase commit so it properly recovers the...
sbarati@apple.com [Fri, 15 Sep 2017 23:27:56 +0000 (23:27 +0000)]
Arity fixup during inlining should do a 2 phase commit so it properly recovers the frame in case of exit
https://bugs.webkit.org/show_bug.cgi?id=176981

Reviewed by Yusuke Suzuki.

JSTests:

* stress/exit-during-inlined-arity-fixup-recover-proper-frame.js: Added.
(assert):
(verify):
(func):
(const.bar.createBuiltin):

Source/JavaScriptCore:

This patch makes inline arity fixup happen in two phases:
1. We get all the values we need and MovHint them to the expected locals.
2. We SetLocal them inside the callee's CodeOrigin. This way, if we exit, the callee's
   frame is already set up. If any SetLocal exits, we have a valid exit state.
   This is required because if we didn't do this in two phases, we may exit in
   the middle of arity fixup from the caller's CodeOrigin. This is unsound because if
   we did the SetLocals in the caller's frame, the memcpy may clobber needed parts
   of the frame right before exiting. For example, consider if we need to pad two args:
   [arg3][arg2][arg1][arg0]
   [fix ][fix ][arg3][arg2][arg1][arg0]
   We memcpy starting from arg0 in the direction of arg3. If we were to exit at a type check
   for arg3's SetLocal in the caller's CodeOrigin, we'd exit with a frame like so:
   [arg3][arg2][arg1][arg2][arg1][arg0]
   And the caller would then just end up thinking its argument are:
   [arg3][arg2][arg1][arg2]
   which is incorrect.

This patch also fixes a couple of bugs in IdentitiyWithProfile:
1. The bytecode generator for this bytecode intrinsic was written incorrectly.
   It needed to store the result of evaluating its argument in a temporary that
   it creates. Otherwise, it might try to simply overwrite a constant
   or a register that it didn't own.
2. We weren't eliminating this node in CSE inside the DFG.

* bytecompiler/NodesCodegen.cpp:
(JSC::BytecodeIntrinsicNode::emit_intrinsic_idWithProfile):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::inlineCall):
* dfg/DFGCSEPhase.cpp:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222115 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoAvoid style recomputation when forwarding a focus event to an text field's input...
wenson_hsieh@apple.com [Fri, 15 Sep 2017 22:18:51 +0000 (22:18 +0000)]
Avoid style recomputation when forwarding a focus event to an text field's input type
https://bugs.webkit.org/show_bug.cgi?id=176160
<rdar://problem/34184820>

Reviewed by Ryosuke Niwa.

Source/WebCore:

Currently, TextFieldInputType::forwardEvent synchronously triggers style recomputation, for the purpose of
scrolling to the origin upon handling a blur event, and also for updating caps lock state after a blur or focus.
In synchronously triggering style recomputation, we may end up running arbitrary JavaScript, which may change
the HTMLInputElement's type and cause the current TextFieldInputType to be destroyed.

To mitigate this, we only update caps lock state when forwarding a focus or blur event to the InputType, and
instead scroll blurred text fields to the origin later, in HTMLInputElement::didBlur (invoked from
Document::setFocusedElement after blur and focusout events have fired). Instead of having the InputType update
style, lift the call to Document::updateStyleIfNeeded up into HTMLInputElement so that we gracefully handle the
case where the page destroys and sets a new InputType within the scope of this style update.

Test: fast/forms/change-input-type-in-focus-handler.html

* dom/Document.cpp:
(WebCore::Document::setFocusedElement):
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::didBlur):
* html/HTMLInputElement.h:
* html/InputType.h:
(WebCore::InputType::elementDidBlur):
* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::forwardEvent):
(WebCore::TextFieldInputType::elementDidBlur):
* html/TextFieldInputType.h:

LayoutTests:

Adds a new layout test verifying that we don't crash when changing the input type from within a focus event listener.

* fast/forms/change-input-type-in-focus-handler-expected.txt: Added.
* fast/forms/change-input-type-in-focus-handler.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222114 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoWTF: use Forward.h when appropriate instead of Vector.h
jfbastien@apple.com [Fri, 15 Sep 2017 21:28:55 +0000 (21:28 +0000)]
WTF: use Forward.h when appropriate instead of Vector.h
https://bugs.webkit.org/show_bug.cgi?id=176984

Reviewed by Saam Barati.

There's no need to include Vector.h when Forward.h will suffice. All we need is to move the template default parameters from Vector, and then the forward declaration can be used in so many new places: if a header only takes Vector by reference, rvalue reference, pointer, returns any of these, or has them as members then the header doesn't need to see the definition because the declaration will suffice.

Source/JavaScriptCore:

* bytecode/HandlerInfo.h:
* heap/GCIncomingRefCounted.h:
* heap/GCSegmentedArray.h:
* wasm/js/JSWebAssemblyModule.h:

Source/WebCore:

* Modules/entriesapi/FileSystemEntriesCallback.h:
* Modules/indexeddb/IDBEventDispatcher.h:
* Modules/indexeddb/IDBFactory.h:
* Modules/indexeddb/client/IDBConnectionProxy.h:
* Modules/indexeddb/server/IDBConnectionToClientDelegate.h:
* Modules/webdatabase/DatabaseTask.h:
* Modules/websockets/WebSocketChannelClient.h:
* contentextensions/CombinedURLFilters.h:
* crypto/SerializedCryptoKeyWrap.h:
* css/InspectorCSSOMWrappers.h:
* css/PageRuleCollector.h:
* css/parser/CSSParserTokenRange.h:
* dom/DocumentTouch.h:
* dom/MutationCallback.h:
* editing/EditingStyle.h:
* editing/SpellChecker.h:
* editing/markup.h:
* fileapi/ThreadableBlobRegistry.h:
* html/FileListCreator.h:
* inspector/WebHeapAgent.h:
* loader/ContentFilter.cpp:
(WebCore::ContentFilter::ContentFilter):
* loader/ContentFilter.h:
* loader/CookieJar.h:
* loader/FrameLoaderClient.h:
* loader/LoaderStrategy.h:
* loader/SubframeLoader.h:
* page/ChromeClient.h:
* page/FrameSnapshotting.h:
* page/IntersectionObserverCallback.h:
* page/PageSerializer.h:
* page/UserContentURLPattern.h:
* page/scrolling/AxisScrollSnapOffsets.h:
* page/win/FrameWin.h:
* platform/CookiesStrategy.h:
* platform/KeyedCoding.h:
* platform/PasteboardStrategy.h:
* platform/SSLKeyGenerator.h:
* platform/ScrollableArea.h:
* platform/encryptedmedia/CDMFactory.h:
* platform/gamepad/EmptyGamepadProvider.cpp:
* platform/gamepad/GamepadProvider.h:
* platform/gamepad/GamepadProviderClient.h:
* platform/gamepad/PlatformGamepad.h:
* platform/graphics/GeometryUtilities.cpp:
* platform/graphics/GeometryUtilities.h:
* platform/graphics/Icon.h:
* platform/graphics/LayoutRect.h:
* platform/graphics/Path.h:
* platform/graphics/WOFFFileFormat.h:
* platform/graphics/avfoundation/MediaSampleAVFObjC.h:
* platform/graphics/avfoundation/objc/AVAssetTrackUtilities.h:
* platform/graphics/ca/PlatformCAAnimation.h:
* platform/graphics/ca/win/PlatformCALayerWinInternal.h:
* platform/graphics/opentype/OpenTypeMathData.h:
* platform/image-encoders/JPEGImageEncoder.h:
* platform/image-encoders/PNGImageEncoder.h:
* platform/network/BlobRegistry.h:
* platform/network/HTTPParsers.h:
* platform/network/PlatformCookieJar.h:
* platform/network/cf/DownloadBundle.h:
* platform/network/curl/CurlCacheEntry.h:
* platform/network/curl/DownloadBundle.h:
* platform/text/LineEnding.h:
* platform/text/QuotedPrintable.cpp:
* platform/text/QuotedPrintable.h:
* rendering/FlexibleBoxAlgorithm.h:
* rendering/style/QuotesData.h:
* rendering/svg/SVGSubpathData.h:
* storage/StorageEventDispatcher.h:
* style/StyleInvalidator.h:
* style/StyleRelations.h:
* svg/SVGAltGlyphDefElement.h:
* svg/SVGAltGlyphItemElement.h:

Source/WebDriver:

* Session.h:

Source/WebKit:

* Scripts/webkit/LegacyMessages-expected.h:
* Scripts/webkit/Messages-expected.h:
* Shared/API/APIData.h:
* UIProcess/API/APIContextMenuClient.h:
* UIProcess/API/APIFormClient.h:
* UIProcess/API/APIHTTPCookieStore.h:
* UIProcess/API/APINotificationProvider.h:
* UIProcess/API/glib/WebKitNotificationProvider.h:
* UIProcess/Notifications/WebNotificationProvider.h:
* UIProcess/TextCheckerCompletion.h:
* UIProcess/WebCookieManagerProxy.h:
* UIProcess/WebOpenPanelResultListenerProxy.h:
* UIProcess/WebPasteboardProxy.h:
* UIProcess/WebPopupMenuProxy.h:
* UIProcess/WebTextCheckerClient.h:
* WebProcess/Cookies/WebCookieManager.h:
* WebProcess/Gamepad/WebGamepadProvider.h:
* WebProcess/InjectedBundle/API/APIInjectedBundleEditorClient.h:
* WebProcess/InjectedBundle/API/APIInjectedBundlePageContextMenuClient.h:
* WebProcess/InjectedBundle/API/APIInjectedBundlePageLoaderClient.h:
* WebProcess/InjectedBundle/APIInjectedBundleFormClient.h:
* WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
* WebProcess/Network/webrtc/WebRTCMonitor.h:
* WebProcess/Network/webrtc/WebRTCResolver.h:
* WebProcess/WebPage/DrawingArea.h:
* WebProcess/WebPage/WebOpenPanelResultListener.h:

Source/WTF:

* wtf/Forward.h:
* wtf/Vector.h:
* wtf/text/StringVector.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222113 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoConsider enabling -Wno-expansion-to-defined for gcc 7
annulen@yandex.ru [Fri, 15 Sep 2017 21:23:10 +0000 (21:23 +0000)]
Consider enabling -Wno-expansion-to-defined for gcc 7
https://bugs.webkit.org/show_bug.cgi?id=167643

Reviewed by Michael Catanzaro.

Don't disable -Wexpansion-to-defined for Clang.
As suggested by Nico Weber, this warning produces false positives with
GCC only.

* Source/cmake/WebKitCompilerFlags.cmake:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222112 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoMove test expectations from 'mac-highsierra' to 'mac' directory
ryanhaddad@apple.com [Fri, 15 Sep 2017 21:15:04 +0000 (21:15 +0000)]
Move test expectations from 'mac-highsierra' to 'mac' directory
https://bugs.webkit.org/show_bug.cgi?id=176463

Unreviewed test gardening.

ChangeLog truncated due to hundreds of LayoutTest files being changed.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222111 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agogenerate-unified-source-bundles.rb shouldn't write a file that isn't going to change
keith_miller@apple.com [Fri, 15 Sep 2017 21:06:49 +0000 (21:06 +0000)]
generate-unified-source-bundles.rb shouldn't write a file that isn't going to change
https://bugs.webkit.org/show_bug.cgi?id=177021

Reviewed by Tim Horton.

* generate-unified-source-bundles.rb:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222110 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoASSERTION FAILED: writtenAudioDuration >= readAudioDuration in com.apple.WebCore...
commit-queue@webkit.org [Fri, 15 Sep 2017 20:39:39 +0000 (20:39 +0000)]
ASSERTION FAILED: writtenAudioDuration >= readAudioDuration in com.apple.WebCore:WebCore::RealtimeOutgoingAudioSource::isReachingBufferedAudioDataHighLimit() + 222
https://bugs.webkit.org/show_bug.cgi?id=175164
<rdar://problem/33712305>

Patch by Youenn Fablet <youenn@apple.com> on 2017-09-15
Reviewed by Eric Carlson.

No observable change of behavior.

* platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp:
(WebCore::RealtimeOutgoingAudioSource::hasBufferedEngouhData):
(WebCore::RealtimeOutgoingAudioSource::audioSamplesAvailable): Calling pullData only if there is at least 0.01 seconds of available data.
* platform/mediastream/mac/RealtimeOutgoingAudioSource.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222109 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoWSL should support ++, --, +=, and all of those things
fpizlo@apple.com [Fri, 15 Sep 2017 20:36:27 +0000 (20:36 +0000)]
WSL should support ++, --, +=, and all of those things
https://bugs.webkit.org/show_bug.cgi?id=176975

Reviewed by Myles Maxfield.

This adds an internal AST construct called LetExpression, that allows us to anonymously capture
a value. This change uses LetExpression to implement prefix and suffix ++/-- and all of the
+=/-=/etc.

* WebGPUShadingLanguageRI/All.js:
* WebGPUShadingLanguageRI/Checker.js:
* WebGPUShadingLanguageRI/EBufferBuilder.js:
(EBufferBuilder.prototype.visitVariableDecl):
(EBufferBuilder.prototype.visitLetExpression):
(EBufferBuilder):
* WebGPUShadingLanguageRI/Evaluator.js:
(Evaluator.prototype.visitLetExpression):
* WebGPUShadingLanguageRI/LetExpression.js: Added.
(LetExpression):
(LetExpression.prototype.get origin):
(LetExpression.prototype.get name):
(LetExpression.prototype.toString):
* WebGPUShadingLanguageRI/Lexer.js:
(Lexer.prototype.next):
(Lexer):
* WebGPUShadingLanguageRI/NameResolver.js:
(NameResolver.prototype.visitProtocolDecl):
* WebGPUShadingLanguageRI/Parse.js:
(isCallExpression):
(finishParsingPostIncrement):
(parsePossibleSuffix):
(finishParsingPreIncrement):
(parsePreIncrement):
(parsePossiblePrefix):
(parsePossibleAssignment):
(parsePostIncrement):
(parseEffectfulExpression):
* WebGPUShadingLanguageRI/Rewriter.js:
(Rewriter.prototype.visitFunctionLikeBlock):
(Rewriter.prototype.visitLetExpression):
(Rewriter):
* WebGPUShadingLanguageRI/StandardLibrary.js:
(int.operator):
(uint.operator):
* WebGPUShadingLanguageRI/Test.html:
* WebGPUShadingLanguageRI/Test.js:
(TEST_prefixPlusPlus):
(TEST_prefixPlusPlusResult):
(TEST_postfixPlusPlus):
(TEST_postfixPlusPlusResult):
(TEST_prefixMinusMinus):
(TEST_prefixMinusMinusResult):
(TEST_postfixMinusMinus):
(TEST_postfixMinusMinusResult):
(TEST_plusEquals):
(TEST_plusEqualsResult):
(TEST_minusEquals):
(TEST_minusEqualsResult):
(TEST_timesEquals):
(TEST_timesEqualsResult):
(TEST_divideEquals):
(TEST_divideEqualsResult):
* WebGPUShadingLanguageRI/Visitor.js:
(Visitor.prototype.visitProtocolDecl):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222108 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoMove code using Vector::map to WTF:map
commit-queue@webkit.org [Fri, 15 Sep 2017 20:09:16 +0000 (20:09 +0000)]
Move code using Vector::map to WTF:map
https://bugs.webkit.org/show_bug.cgi?id=176860

Patch by Youenn Fablet <youenn@apple.com> on 2017-09-15
Reviewed by Jer Noble.

No change of behavior.

* loader/FormSubmission.cpp:
(WebCore::FormSubmission::create): Moving to WTF::map.
* page/Settings.cpp:
(WebCore::Settings::setMediaContentTypesRequiringHardwareSupport): Using iterator split to not create a temporary vector.
* platform/ContentType.cpp:
(WebCore::ContentType::ContentType):
(WebCore::splitParameters):
(WebCore::ContentType::codecs const): Ditto.
(WebCore::ContentType::profiles const): Ditto.
(WebCore::stripHTMLWhiteSpace): Deleted.
* platform/ContentType.h:
(WebCore::ContentType::create): Deleted.
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::load): Minor count churning change.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222107 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoMark inspector/debugger/breakpoint-action-detach.html as flaky on Sierra.
ryanhaddad@apple.com [Fri, 15 Sep 2017 20:06:46 +0000 (20:06 +0000)]
Mark inspector/debugger/breakpoint-action-detach.html as flaky on Sierra.
https://bugs.webkit.org/show_bug.cgi?id=168338

Unreviewed test gardening.

* platform/mac/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222106 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoMediaPlayerPrivateMediaStreamAVFObjC::requestNotificationWhenReadyForVideoData should...
commit-queue@webkit.org [Fri, 15 Sep 2017 19:55:22 +0000 (19:55 +0000)]
MediaPlayerPrivateMediaStreamAVFObjC::requestNotificationWhenReadyForVideoData should enqueue data if still useful
https://bugs.webkit.org/show_bug.cgi?id=177016

Patch by Youenn Fablet <youenn@apple.com> on 2017-09-15
Reviewed by Jer Noble.

No change of behavior.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::requestNotificationWhenReadyForVideoData): exciting early in block to prevent enqueueing.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222105 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoUnreviewed, rolling out r222040.
ryanhaddad@apple.com [Fri, 15 Sep 2017 19:54:01 +0000 (19:54 +0000)]
Unreviewed, rolling out r222040.

The LayoutTest added with this change is a flaky image failure
on mac-wk1 debug bots.

Reverted changeset:

"Computing animated style should not require renderers"
https://bugs.webkit.org/show_bug.cgi?id=171926
http://trac.webkit.org/changeset/222040

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222104 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoFix the macOS CMake build
timothy_horton@apple.com [Fri, 15 Sep 2017 19:53:01 +0000 (19:53 +0000)]
Fix the macOS CMake build
https://bugs.webkit.org/show_bug.cgi?id=177015

Reviewed by Andy Estes.

Source/WebCore:

* CMakeLists.txt:
Add Payment Request files.

* PlatformMac.cmake:
Add the CoreServices umbrella framework to the framework search path.
Add service workers directories to the forwarding headers path.
Add Modules/cache directory to the forwarding headers path.

* rendering/svg/RenderSVGRoot.cpp:
(WebCore::resolveLengthAttributeForSVG): Deleted unused function.

Source/WebCore/PAL:

* pal/PlatformMac.cmake:
Add WebPanel.

Source/WebKit:

* CMakeLists.txt:
Add the new RemoteLayerTree directories to the header search path.
Add CookieStorageUtilsCF.mm to Sources.

* PlatformMac.cmake:
Add a few more files, and fix the generated forwarding headers include
path to name "WebKit" instead of "WebKit2".

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222103 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoWeb Inspector: Canvas: recording parameters that include colors should show an Inline...
mattbaker@apple.com [Fri, 15 Sep 2017 19:50:40 +0000 (19:50 +0000)]
Web Inspector: Canvas: recording parameters that include colors should show an InlineSwatch (2D canvas)
https://bugs.webkit.org/show_bug.cgi?id=176822
<rdar://problem/34402170>

Reviewed by Devin Rousso.

Source/WebInspectorUI:

Show inline swatches in the canvas recording action and state sidebars.

* UserInterface/Models/Color.js:
Added helpers for dealing with CMYK and normalized RGB. The latter is
for RGB components scaled to the range [0, 1]. Also improved handling
for 8-bit channel values.
(WI.Color.rgb2hsv):
(WI.Color.cmyk2rgb):
(WI.Color.normalized2rgb):
(WI.Color._eightBitChannel):
(WI.Color.prototype._toRGBString):
(WI.Color.prototype._toRGBAString):
(WI.Color.prototype._componentToHexValue):
(WI.Color.prototype._rgbToHSL):
(WI.Color.prototype._componentToNumber): Deleted.
Replaced by _eightBitChannel.

* UserInterface/Models/RecordingAction.js:
(WI.RecordingAction):
(WI.RecordingAction.prototype.getColorParameters):
Get a subset of parameters that describe a color. This can be an array
containing one value (e.g. fillStyle), or multiple values, as is the
case with non-standard API functions that describe color using multiple
parameters (e.g. setFillColor).

* UserInterface/Views/InlineSwatch.css:
(.inline-swatch:not(.read-only):hover > span):
(.inline-swatch:hover > span): Deleted.
* UserInterface/Views/InlineSwatch.js:
(WI.InlineSwatch):
Read-only colors shouldn't show a context menu or hover effects.

* UserInterface/Views/RecordingActionTreeElement.css:
(.tree-outline:matches(:focus, .force-focus) .item.action > .titles .parameters > .inline-swatch):

* UserInterface/Views/RecordingActionTreeElement.js:
(WI.RecordingActionTreeElement._generateDOM.createParameterElement):
(WI.RecordingActionTreeElement._generateDOM):
(WI.RecordingActionTreeElement._createSwatchForColorParameters):

* UserInterface/Views/RecordingStateDetailsSidebarPanel.css:
(.sidebar > .panel.details.recording-state > .content > .data-grid .inline-swatch):

* UserInterface/Views/RecordingStateDetailsSidebarPanel.js:
(WI.RecordingStateDetailsSidebarPanel.prototype._generateDetailsCanvas2D.isColorProperty):
(WI.RecordingStateDetailsSidebarPanel.prototype._generateDetailsCanvas2D.createInlineSwatch):
(WI.RecordingStateDetailsSidebarPanel.prototype._generateDetailsCanvas2D):
(WI.RecordingStateDetailsSidebarPanel):

LayoutTests:

Add tests for color space conversions.

* inspector/model/color-expected.txt:
* inspector/model/color.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222102 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoUnreviewed test maintenance.
bfulgham@apple.com [Fri, 15 Sep 2017 19:30:52 +0000 (19:30 +0000)]
Unreviewed test maintenance.

* platform/mac-wk1/TestExpectations: Skip test under WK1 due to a bug.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222101 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoUnreviewed, correct a typo in a TestExpectations file.
ryanhaddad@apple.com [Fri, 15 Sep 2017 18:12:14 +0000 (18:12 +0000)]
Unreviewed, correct a typo in a TestExpectations file.

* platform/ios/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222100 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoStorage Access API: Deny access to nested iframes
wilander@apple.com [Fri, 15 Sep 2017 17:54:35 +0000 (17:54 +0000)]
Storage Access API: Deny access to nested iframes
https://bugs.webkit.org/show_bug.cgi?id=176939
<rdar://problem/34439609>

Reviewed by Brent Fulgham.

Source/WebCore:

Test: http/tests/storageAccess/request-and-grant-storage-access-cross-origin-sandboxed-nested-iframe.html

* dom/Document.cpp:
(WebCore::Document::requestStorageAccess):

LayoutTests:

* http/tests/storageAccess/request-and-grant-storage-access-cross-origin-sandboxed-nested-iframe-expected.txt: Added.
* http/tests/storageAccess/request-and-grant-storage-access-cross-origin-sandboxed-nested-iframe.html: Added.
* http/tests/storageAccess/resources/nesting-iframe.html: Added.
* platform/mac-wk2/TestExpectations:
    Added the new test as a [ Pass ].

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222099 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoAnimationBase should ref the element
antti@apple.com [Fri, 15 Sep 2017 17:44:49 +0000 (17:44 +0000)]
AnimationBase should ref the element
https://bugs.webkit.org/show_bug.cgi?id=176993

Reviewed by Simon Fraser.

We now longer have renderer pointer. Element can be reffed for safety.

This doesn't create reference cycle as the element pointer is cleared when render tree is
torn down. This happens at the latest when the element is removed from the tree.

* page/animation/AnimationBase.cpp:
(WebCore::AnimationBase::~AnimationBase):
(WebCore::AnimationBase::clear):
* page/animation/AnimationBase.h:
(WebCore::AnimationBase::~AnimationBase): Deleted.
(WebCore::AnimationBase::clear): Deleted.
* page/animation/ImplicitAnimation.cpp:
(WebCore::ImplicitAnimation::pauseAnimation):
(WebCore::ImplicitAnimation::sendTransitionEvent):
(WebCore::ImplicitAnimation::reset):
* page/animation/KeyframeAnimation.cpp:
(WebCore::KeyframeAnimation::pauseAnimation):
(WebCore::KeyframeAnimation::endAnimation):
(WebCore::KeyframeAnimation::sendAnimationEvent):
(WebCore::KeyframeAnimation::resolveKeyframeStyles):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222098 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoSource/WebCore:
bfulgham@apple.com [Fri, 15 Sep 2017 17:37:18 +0000 (17:37 +0000)]
Source/WebCore:
Make DocumentLoader a FrameDestructionObserver
https://bugs.webkit.org/show_bug.cgi?id=176364
<rdar://problem/34254780>

Reviewed by Alex Christensen.

The DocumentLoader needs to know when its Frame is destroyed so that it can
perform properly cleanup.

Test: fast/events/beforeunload-dom-manipulation-crash.html

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::DocumentLoader): Call FrameDestructionObserver constructor.
(WebCore::DocumentLoader::responseReceived): Drive-by fix. Make sure the current
object is valid during the callback.
(WebCore::DocumentLoader::attachToFrame): Use FrameDestructionObserver::observerFrame rather
than setting the m_frame variable directly.
(WebCore::DocumentLoader::detachFromFrame): Ditto.
* loader/DocumentLoader.h:
(WebCore::DocumentLoader::frame const): Deleted, as this is provided by the FrameDestructionObserver.

Tools:
Provide mechanism to immediately end tests
https://bugs.webkit.org/show_bug.cgi?id=176364
<rdar://problem/34254780>

Reviewed by Alex Christensen.

WebKitTestRunner does not output state if the top loading frame has not been removed. This prevents some
tests that attempt to exercise failed load state from working properly.

This change adds a new 'forceImmediateCompletion' handler for DumpRenderTree and WebKitTestRunner so
that we can properly test these conditions.

* DumpRenderTree/TestRunner.h:
* DumpRenderTree/mac/TestRunnerMac.mm:
(TestRunner::forceImmediateCompletion): Added.
* DumpRenderTree/win/TestRunnerWin.cpp:
(TestRunner::forceImmediateCompletion): Ditto.
* WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::forceImmediateCompletion): Ditto.
* WebKitTestRunner/InjectedBundle/TestRunner.h:

LayoutTests:
Make DocumentLoader a FrameDestructionObserver
https://bugs.webkit.org/show_bug.cgi?id=176364
<rdar://problem/34254780>

Reviewed by Alex Christensen.

* fast/events/beforeunload-dom-manipulation-crash-expected.txt: Added.
* fast/events/beforeunload-dom-manipulation-crash.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222097 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoUpdate some WebGL2 return types to match the specification.
Ms2ger@igalia.com [Fri, 15 Sep 2017 17:34:29 +0000 (17:34 +0000)]
Update some WebGL2 return types to match the specification.
https://bugs.webkit.org/show_bug.cgi?id=176996

Reviewed by Alex Christensen.

This should not change the behavior in any way, but it makes it simpler
to compare our IDL with the specification's.

No new tests because there is no behavior change.

* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::getUniformIndices):
* html/canvas/WebGL2RenderingContext.h:
* html/canvas/WebGL2RenderingContext.idl:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222096 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoRemove FilterOperation::blendingNeedsRendererSize()
antti@apple.com [Fri, 15 Sep 2017 17:22:57 +0000 (17:22 +0000)]
Remove FilterOperation::blendingNeedsRendererSize()
https://bugs.webkit.org/show_bug.cgi?id=176994

Reviewed by Simon Fraser.

It is not used.

* page/animation/CSSPropertyAnimation.cpp:
(WebCore::blendFunc):
* platform/graphics/filters/FilterOperation.h:
(WebCore::FilterOperation::blend):
(WebCore::FilterOperation::shouldBeRestrictedBySecurityOrigin const):
(WebCore::FilterOperation::blendingNeedsRendererSize const): Deleted.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222095 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoWPT harness errors on leaks and iOS-sim EWS bots
commit-queue@webkit.org [Fri, 15 Sep 2017 17:03:00 +0000 (17:03 +0000)]
WPT harness errors on leaks and iOS-sim EWS bots
https://bugs.webkit.org/show_bug.cgi?id=175269
<rdar://problem/33902404>

Unreviewed.

Patch by Youenn Fablet <youenn@apple.com> on 2017-09-15

* TestExpectations: Reactivating event source test.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222094 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoAdd an URL method to remove both query string and fragment identifier
commit-queue@webkit.org [Fri, 15 Sep 2017 16:51:17 +0000 (16:51 +0000)]
Add an URL method to remove both query string and fragment identifier
https://bugs.webkit.org/show_bug.cgi?id=176911

Patch by Youenn Fablet <youenn@apple.com> on 2017-09-15
Reviewed by Alex Christensen.

Source/WebCore:

Covered by existing tests and new API tests.

* Modules/cache/DOMCache.cpp:
(WebCore::DOMCache::retrieveRecords): Using new helper method.
* platform/URL.cpp:
(WebCore::URL::removeQueryAndFragmentIdentifier):
* platform/URL.h:

Source/WebKit:

* NetworkProcess/cache/CacheStorageEngineCache.cpp:
(WebKit::CacheStorage::computeKeyURL):

Tools:

Adding unit test for new URL method as well as modified setQuery and setFragmentIdentifier.

* TestWebKitAPI/Tests/WebCore/URL.cpp:
(TestWebKitAPI::createURL):
(TestWebKitAPI::TEST_F):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222093 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years ago[Cocoa] Upstream MediaRemote and VideoToolbox WebKitSystemInterface functions
aestes@apple.com [Fri, 15 Sep 2017 16:34:27 +0000 (16:34 +0000)]
[Cocoa] Upstream MediaRemote and VideoToolbox WebKitSystemInterface functions
https://bugs.webkit.org/show_bug.cgi?id=176953

Reviewed by Eric Carlson.

Source/WebCore:

* platform/cocoa/VideoToolboxSoftLink.cpp:
* platform/cocoa/VideoToolboxSoftLink.h:
* platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm:
(WebCore::queryDecoderAvailability):
(WebCore::CDMPrivateMediaSourceAVFObjC::supportsKeySystem):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessPlaybackTargetType const):
(WebCore::exernalDeviceDisplayNameForPlayer):
(WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessPlaybackTargetName const):
* platform/ios/WebCoreSystemInterfaceIOS.mm:
* platform/mac/MediaRemoteSoftLink.cpp:
* platform/mac/MediaRemoteSoftLink.h:
* platform/mac/WebCoreSystemInterface.h:
* platform/mac/WebCoreSystemInterface.mm:

Source/WebCore/PAL:

* pal/spi/mac/AVFoundationSPI.h:
* pal/spi/mac/MediaRemoteSPI.h:

Source/WebKit:

* WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
(InitWebCoreSystemInterface):

Source/WebKitLegacy/mac:

* WebCoreSupport/WebSystemInterface.mm:
(InitWebCoreSystemInterface):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222092 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoSwitch text tracks to release logging
eric.carlson@apple.com [Fri, 15 Sep 2017 16:20:07 +0000 (16:20 +0000)]
Switch text tracks to release logging
https://bugs.webkit.org/show_bug.cgi?id=176809
<rdar://problem/34397605>

Reviewed by Jer Noble.

Source/WebCore:

Make all track objects use the same logger and log identifier as the media element they
"belong" to. Convert all track logging from debug-only to release logging.

* WebCore.xcodeproj/project.pbxproj:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::updateActiveTextTrackCues):
* html/HTMLMediaElement.h:
* html/track/AudioTrack.cpp:
(WebCore::AudioTrack::AudioTrack):
(WebCore::AudioTrack::setPrivate):
(WebCore::AudioTrack::setMediaElement):
* html/track/AudioTrack.h:
* html/track/DataCue.cpp:
(WebCore::DataCue::toString const):
* html/track/DataCue.h:
(PAL::LogArgument<WebCore::DataCue>::toString):
* html/track/InbandDataTextTrack.cpp:
(WebCore::InbandDataTextTrack::addDataCue):
(WebCore::InbandDataTextTrack::updateDataCue):
(WebCore::InbandDataTextTrack::removeDataCue):
* html/track/InbandDataTextTrack.h:
* html/track/InbandGenericTextTrack.cpp:
(WebCore::InbandGenericTextTrack::addGenericCue):
(WebCore::InbandGenericTextTrack::removeGenericCue):
(WebCore::InbandGenericTextTrack::newCuesParsed):
(WebCore::InbandGenericTextTrack::fileFailedToParse):
* html/track/InbandGenericTextTrack.h:
* html/track/InbandTextTrack.cpp:
(WebCore::InbandTextTrack::InbandTextTrack):
(WebCore::InbandTextTrack::setMediaElement):
* html/track/InbandTextTrack.h:
* html/track/InbandWebVTTTextTrack.cpp:
(WebCore::InbandWebVTTTextTrack::newCuesParsed):
(WebCore::InbandWebVTTTextTrack::fileFailedToParse):
* html/track/InbandWebVTTTextTrack.h:
* html/track/LoadableTextTrack.cpp:
(WebCore::LoadableTextTrack::newCuesAvailable):
(WebCore::LoadableTextTrack::cueLoadingCompleted):
* html/track/LoadableTextTrack.h:
* html/track/TextTrack.cpp:
(WebCore::TextTrack::addCue):
(WebCore::TextTrack::removeCue):
(WebCore::TextTrack::setLanguage):
* html/track/TextTrack.h:
* html/track/TextTrackCue.cpp:
(WebCore::TextTrackCue::toString const):
* html/track/TextTrackCue.h:
(PAL::LogArgument<WebCore::TextTrackCue>::toString):
* html/track/TextTrackCueGeneric.cpp:
(WebCore::TextTrackCueGeneric::setFontSize):
(WebCore::TextTrackCueGeneric::toString const):
* html/track/TextTrackCueGeneric.h:
(PAL::LogArgument<WebCore::TextTrackCueGeneric>::toString):
* html/track/TrackBase.cpp:
(WebCore::nextLogIdentifier):
(WebCore::nullLogger):
(WebCore::TrackBase::TrackBase):
(WebCore::TrackBase::setMediaElement):
(WebCore::TrackBase::logChannel const):
(WebCore::TrackBase::~TrackBase): Deleted.
* html/track/TrackBase.h:
(WebCore::TrackBase::setMediaElement): Deleted.
* html/track/VTTCue.cpp:
(WebCore::VTTCue::setFontSize):
(WebCore::VTTCue::toString const):
* html/track/VTTCue.h:
(PAL::LogArgument<WebCore::VTTCue>::toString):
* html/track/VideoTrack.cpp:
(WebCore::VideoTrack::VideoTrack):
(WebCore::VideoTrack::setPrivate):
(WebCore::VideoTrack::setMediaElement):
* html/track/VideoTrack.h:
* platform/graphics/AudioTrackPrivate.h:
* platform/graphics/InbandTextTrackPrivate.h:
(WebCore::InbandTextTrackPrivate::setClient):
* platform/graphics/InbandTextTrackPrivateClient.h:
(WebCore::GenericCueData::toString const):
(PAL::LogArgument<WebCore::GenericCueData>::toString):
* platform/graphics/TrackPrivateBase.cpp: Added.
(WebCore::TrackPrivateBase::setLogger):
(WebCore::TrackPrivateBase::logChannel const):
* platform/graphics/TrackPrivateBase.h:
* platform/graphics/VideoTrackPrivate.h:
* platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
* platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.cpp:
(WebCore::InbandMetadataTextTrackPrivateAVF::updatePendingCueEndTimes):
(WebCore::InbandMetadataTextTrackPrivateAVF::flushPartialCues):
* platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.h:
* platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
(WebCore::InbandTextTrackPrivateAVF::processAttributedStrings):
(WebCore::InbandTextTrackPrivateAVF::removeCompletedCues):
(WebCore::InbandTextTrackPrivateAVF::resetCueValues):
(WebCore::InbandTextTrackPrivateAVF::processNativeSamples):
(WebCore::InbandTextTrackPrivateAVF::readNativeSampleBuffer):
* platform/graphics/avfoundation/InbandTextTrackPrivateAVF.h:
* platform/graphics/avfoundation/objc/AudioTrackPrivateAVFObjC.mm:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
* platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
(WebCore::AudioTrackPrivateMediaStreamCocoa::createAudioUnit):
* platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.h:

Source/WebCore/PAL:

* pal/Logger.h:
(PAL::LogArgument::toString):
(PAL::Logger::willLog const):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222091 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years ago[Harfbuzz] Material icons not rendered correctly when using the web font
carlosgc@webkit.org [Fri, 15 Sep 2017 15:37:02 +0000 (15:37 +0000)]
[Harfbuzz] Material icons not rendered correctly when using the web font
https://bugs.webkit.org/show_bug.cgi?id=176995

Reviewed by Michael Catanzaro.

Only a few of them are correctly rendered and some others are wrong. We only render correctly the ones that
don't have an underscore in their name (or that start with a number like 3d_rotation). In the cases where the
name before the underscore is also an icon, we render that icon instead, that's why some of them are wrong. This
is happening because the underscore is causing the HarfbuffShaper to split the text in 3 runs, one for the word
before the underscore, another one for the underscore and another for the word after the underscore. So, we
end up trying to shape the 3 runs independently and we fail when the icon doesn't exist, or when it exists but
it's not the one we are looking for. The cause of this is that the underscore has a different script (Common)
than the rest of characters (Latin) which is a condition in HarfbuffShaper to create a different run. The
unicode spec says that characters with Common script should be handled differently, but we are just ignoring
it. The spec proposes to use an heuristic based on simply inheriting the script of the previous character, which
should work in most of the cases. We could take a more conservative approach and do that only if both characters
are ASCII. We should also consider handling other cases mentioned by the spec like brackets and quotation marks,
but that belongs to a different bug/commit.

* platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
(WebCore::scriptsAreCompatibleForCharacters): Helper function to check if the current and previous scripts are
compatible,
(WebCore::HarfBuzzShaper::collectHarfBuzzRuns): Use scriptsAreCompatibleForCharacters() to decided whether to
finish the current run or not. In case of Common script, inherit also the script from the previous character.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222090 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years ago[Win] Update test expectations for cache storage tests.
pvollan@apple.com [Fri, 15 Sep 2017 14:50:23 +0000 (14:50 +0000)]
[Win] Update test expectations for cache storage tests.
https://bugs.webkit.org/show_bug.cgi?id=176998

Unreviewed test gardening.

* platform/win/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222089 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years ago[Win] Update test expectations for failures on one of the EWS machines.
pvollan@apple.com [Fri, 15 Sep 2017 14:43:05 +0000 (14:43 +0000)]
[Win] Update test expectations for failures on one of the EWS machines.
https://bugs.webkit.org/show_bug.cgi?id=176998

Unreviewed test gardening.

* platform/win/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222088 268f45cc-cd09-0410-ab3c-d52691b4dbfc