WebKit-https.git
2 years agoinnerText->renderBox() can be null in HTMLTextFormControlElement::setSelectionRange
rniwa@webkit.org [Wed, 1 Nov 2017 21:26:33 +0000 (21:26 +0000)]
innerText->renderBox() can be null in HTMLTextFormControlElement::setSelectionRange
https://bugs.webkit.org/show_bug.cgi?id=179103

Reviewed by Antti Koivisto.

Added a missing null check.

Unfortunately, no new tests since we don't have a working reproduction for trunk code.

* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::setSelectionRange): Added a null check.

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

2 years agoPlumbing for handling SW scripts failing to evaluate
beidson@apple.com [Wed, 1 Nov 2017 21:23:52 +0000 (21:23 +0000)]
Plumbing for handling SW scripts failing to evaluate
https://bugs.webkit.org/show_bug.cgi?id=178926

Reviewed by Chris Dumez.

Source/WebCore:

No new tests (Currently no observable behavior change).

In an upcoming patch we'll actually run the appropriate observable steps for when
a ServiceWorker script fails to evaluate.

This is a standalone refactoring + plumbing patch that will make the observable changes
easier to review.

* bindings/js/WorkerScriptController.cpp:
(WebCore::WorkerScriptController::evaluate):
* bindings/js/WorkerScriptController.h:
(WebCore::WorkerScriptController::workerGlobalScopeWrapper):
(WebCore::WorkerScriptController::vm):
(WebCore::WorkerScriptController::initScriptIfNeeded):

* workers/WorkerMessagingProxy.cpp:
(WebCore::WorkerMessagingProxy::startWorkerGlobalScope):

* workers/WorkerThread.cpp:
(WebCore::WorkerThread::start):
(WebCore::WorkerThread::workerThread):
* workers/WorkerThread.h:

* workers/service/context/SWContextManager.cpp:
(WebCore::SWContextManager::registerServiceWorkerThreadForUpdate):
(WebCore::SWContextManager::registerServiceWorkerThread): Deleted.
* workers/service/context/SWContextManager.h:

* workers/service/context/ServiceWorkerThread.h:
(WebCore::ServiceWorkerThread::serverConnectionIdentifier const):
(WebCore::ServiceWorkerThread::contextData const):

* workers/service/context/ServiceWorkerThreadProxy.cpp:
(WebCore::ServiceWorkerThreadProxy::create):
(WebCore::ServiceWorkerThreadProxy::ServiceWorkerThreadProxy):

* workers/service/server/SWServer.cpp:
(WebCore::SWServer::updateWorker):
(WebCore::SWServer::createWorker): Deleted.
* workers/service/server/SWServer.h:

* workers/service/server/SWServerRegistration.cpp:
(WebCore::SWServerRegistration::scriptFetchFinished):
(WebCore::SWServerRegistration::scriptContextFailedToStart):

Source/WebKit:

* StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
(WebKit::WebSWServerConnection::updateServiceWorkerContext):
(WebKit::WebSWServerConnection::setContextConnection):
(WebKit::WebSWServerConnection::startServiceWorkerContext): Deleted.
* StorageProcess/ServiceWorker/WebSWServerConnection.h:

* WebProcess/Storage/WebSWContextManagerConnection.cpp:
(WebKit::WebSWContextManagerConnection::updateServiceWorker):
(WebKit::WebSWContextManagerConnection::serviceWorkerStartedWithMessage):
(WebKit::WebSWContextManagerConnection::startServiceWorker): Deleted.
* WebProcess/Storage/WebSWContextManagerConnection.h:
* WebProcess/Storage/WebSWContextManagerConnection.messages.in:

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

2 years agoMark a couple of service worker tests as flaky.
cdumez@apple.com [Wed, 1 Nov 2017 21:06:50 +0000 (21:06 +0000)]
Mark a couple of service worker tests as flaky.

* TestExpectations:

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

2 years agoWeb Inspector: Combine all storage icon files into a single file
commit-queue@webkit.org [Wed, 1 Nov 2017 21:04:31 +0000 (21:04 +0000)]
Web Inspector: Combine all storage icon files into a single file
https://bugs.webkit.org/show_bug.cgi?id=179134

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-11-01
Reviewed by Devin Rousso.

* UserInterface/Main.html:
* UserInterface/Views/CookieIcon.css: Removed.
* UserInterface/Views/DOMStorageIcons.css: Removed.
* UserInterface/Views/DatabaseIcon.css: Removed.
* UserInterface/Views/DatabaseTableIcon.css: Removed.
* UserInterface/Views/StorageIcons.css: Added.
(.application-cache-manifest .icon):
(.application-cache-frame .icon):
(.cookie-icon .icon):
(.local-storage-icon .icon):
(.session-storage-icon .icon):
(.database-icon .icon):
(.database-table-icon .icon):

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

2 years ago[Win] Detect Visual Studio 2017 location
commit-queue@webkit.org [Wed, 1 Nov 2017 20:44:55 +0000 (20:44 +0000)]
[Win] Detect Visual Studio 2017 location
https://bugs.webkit.org/show_bug.cgi?id=175275

Patch by Stephan Szabo <stephan.szabo@sony.com> on 2017-11-01
Reviewed by Yusuke Suzuki.

* Scripts/build-jsc:
* Scripts/build-webkit:
* Scripts/update-vswhere.py: Added.
* Scripts/webkitdirs.pm:
(requireModulesForVSWhere):
(pickCurrentVisualStudioInstallation):
(pickLegacyVisualStudioInstallation):
(visualStudioInstallDir):
(visualStudioInstallDirVSWhere):
(visualStudioInstallDirLegacy):
(visualStudioInstallDirFallback):
(msBuildInstallDir):
(visualStudioVersion):
(visualStudioVersionFromInstallDir):
(generateBuildSystemFromCMakeProject):

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

2 years agoAssert that NoEventDispatchAssertion is not in the stack when executing a script
rniwa@webkit.org [Wed, 1 Nov 2017 20:38:58 +0000 (20:38 +0000)]
Assert that NoEventDispatchAssertion is not in the stack when executing a script
https://bugs.webkit.org/show_bug.cgi?id=179107

Reviewed by Simon Fraser.

Assert that NoEventDispatchAssertion::isEventAllowedInMainThread() is true when we're about to execute a script
by adding the assertion in ScriptController::canExecuteScripts which gets called with AboutToExecuteScript
whenever we're about to run scripts in event handlers, etc...

We don't assert the construction of event handlers in JSLazyEventListener since this happens while copying
the DOM tree inside a SVG use element and creating a event handler's JS function won't execute arbitrary scripts.

No new tests since there should be no behavioral change other

* bindings/js/JSLazyEventListener.cpp:
(WebCore::JSLazyEventListener::initializeJSFunction const): Use newly added AboutToCreateEventListener.
(WebCore::JSLazyEventListener::create): Ditto.
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::canExecuteScripts): Added the assertion.
* bindings/js/ScriptController.h:

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

2 years agoFix the !USE(QUICKLOOK) build
timothy_horton@apple.com [Wed, 1 Nov 2017 20:12:52 +0000 (20:12 +0000)]
Fix the !USE(QUICKLOOK) build
https://bugs.webkit.org/show_bug.cgi?id=179128

Reviewed by Wenson Hsieh.

* TestWebKitAPI/Tests/WebCore/ios/PreviewLoader.cpp:

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

2 years agoRegression(r219659): Can no longer log into ifttt.com using Google account
cdumez@apple.com [Wed, 1 Nov 2017 19:39:12 +0000 (19:39 +0000)]
Regression(r219659): Can no longer log into ifttt.com using Google account
https://bugs.webkit.org/show_bug.cgi?id=179117

Reviewed by Geoffrey Garen.

LayoutTests/imported/w3c:

Rebaseline WPT tests.

* web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-expected.txt:
* web-platform-tests/html/browsers/the-window-object/window-indexed-properties-expected.txt:

Source/WebCore:

After r219659, it is no longer possible to log into ifttt.com using a Google
account:
- Signed into a Google account already
- Visit https://ifttt.com/login
- Click "Continue with Google"
- Select the signed in account

It turns out that this change to the HTML specification was not Web-compatible:
See https://bugzilla.mozilla.org/show_bug.cgi?id=1412741 & https://github.com/whatwg/html/issues/3183

This patch reverts r219659 for now until we agree on what behavior should get
specified.

No new tests, rebaselined existing tests.

* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
(WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
(WebCore::JSDOMWindow::getOwnPropertyNames):
* bindings/js/JSLocationCustom.cpp:
(WebCore::getOwnPropertySlotCommon):
(WebCore::JSLocation::getOwnPropertyNames):

LayoutTests:

Update / rebaseline existing test.

* http/tests/security/cross-origin-descriptors-expected.txt:
* http/tests/security/cross-origin-descriptors.html:

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

2 years agoWeb Inspector: Styles Redesign: Hovering over a selector should highlight matching...
nvasilyev@apple.com [Wed, 1 Nov 2017 19:10:20 +0000 (19:10 +0000)]
Web Inspector: Styles Redesign: Hovering over a selector should highlight matching elements on the page
https://bugs.webkit.org/show_bug.cgi?id=179040

Reviewed by Devin Rousso.

* UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
(WI.SpreadsheetCSSStyleDeclarationSection.prototype.initialLayout):
Use mouseenter/mouseleave events instead of mousein/mouseout (as in the old styles sidebar)
to avoid unnecessary events being fired.

(WI.SpreadsheetCSSStyleDeclarationSection.prototype._highlightNodesWithSelector):
(WI.SpreadsheetCSSStyleDeclarationSection.prototype._hideDOMNodeHighlight):

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

2 years agoUnreviewed, use weakPointer instead of FTLOutput::weakPointer
utatane.tea@gmail.com [Wed, 1 Nov 2017 18:54:54 +0000 (18:54 +0000)]
Unreviewed, use weakPointer instead of FTLOutput::weakPointer
https://bugs.webkit.org/show_bug.cgi?id=178934

* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileStringSlice):

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

2 years agoMake iOS Find UI reveal matches in scrollable elements
fred.wang@free.fr [Wed, 1 Nov 2017 18:50:36 +0000 (18:50 +0000)]
Make iOS Find UI reveal matches in scrollable elements
https://bugs.webkit.org/show_bug.cgi?id=178789

Patch by Frederic Wang <fwang@igalia.com> on 2017-11-01
Reviewed by Tim Horton.

Source/WebKit:

* WebProcess/WebPage/ios/FindControllerIOS.mm:
(WebKit::FindController::didFindString): Reveal selection up to the main frame. The main frame
is handled by the SmartMagnificationController.

Tools:

This patch exposes WKWebView's findString function in order to test the fix for bug 178789.

* DumpRenderTree/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::findString): Dummy implementation of findString.
* DumpRenderTree/mac/UIScriptControllerMac.mm:
(WTR::UIScriptController::findString): Ditto.
* TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl: Declare findString.
* TestRunnerShared/UIScriptContext/UIScriptController.cpp:
(WTR::UIScriptController::findString): Dummy implementation of findString.
* TestRunnerShared/UIScriptContext/UIScriptController.h: Declare findString.
* WebKitTestRunner/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::findString): Implement findString by forwarding the call to the
web view.
* WebKitTestRunner/mac/UIScriptControllerMac.mm:
(WTR::UIScriptController::findString): Dummy implementation of findString.

LayoutTests:

Adds a test to verify that an overflow node is scrolled to reveal results it contains when
iOS's Find UI is used.

* platform/ios/fast/scrolling/find-text-in-overflow-node-expected.txt: Added.
* platform/ios/fast/scrolling/find-text-in-overflow-node.html: Added.

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

2 years agotransferFromImageBitmap should update canvas dimensions
dino@apple.com [Wed, 1 Nov 2017 18:43:57 +0000 (18:43 +0000)]
transferFromImageBitmap should update canvas dimensions
https://bugs.webkit.org/show_bug.cgi?id=179096
<rdar://problem/35285218>

Reviewed by Sam Weinig.

LayoutTests/imported/w3c:

Update expected results now that we pass more of this test.

* web-platform-tests/imagebitmap-renderingcontext/bitmaprenderer-as-imagesource-expected.txt:

Source/WebCore:

When transferFromImageBitmap is called, the dimensions of the HTMLCanvasElement
should be updated to reflect the size of the passed ImageBitmap.

Update an existing WPT result.

* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::setImageBuffer const): Update the
size of the element based on the incoming buffer.
* html/HTMLCanvasElement.h: Mark m_size as mutable so we can
call it from the const function setImageBuffer.

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

2 years agoMark fast/dom/Window/window-resize-update-scrollbars.html as a timeout on Windows.
pvollan@apple.com [Wed, 1 Nov 2017 18:25:40 +0000 (18:25 +0000)]
Mark fast/dom/Window/window-resize-update-scrollbars.html as a timeout on Windows.
https://bugs.webkit.org/show_bug.cgi?id=179130

Unreviewed test gardening.

* platform/win/TestExpectations:

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

2 years agoAdd a test for _WKInputDelegate.willSubmitFormValues
achristensen@apple.com [Wed, 1 Nov 2017 17:36:56 +0000 (17:36 +0000)]
Add a test for _WKInputDelegate.willSubmitFormValues
https://bugs.webkit.org/show_bug.cgi?id=179086

Reviewed by Darin Adler.

Hidden input types are not included in this submission because FormSubmission::create ignores them
because input.isTextField() returns false.  This is existing behavior that wasn't shown by a test.
HTTPBodies are also not sent to WKURLSchemeHandlers.  This is existing behavior that wasn't shown by a test.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKitCocoa/_WKInputDelegate.mm: Added.
(-[FormSubmissionDelegate _webView:willSubmitFormValues:userObject:submissionHandler:]):
(TEST):

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

2 years ago[JSC] Introduce @toObject
utatane.tea@gmail.com [Wed, 1 Nov 2017 17:32:08 +0000 (17:32 +0000)]
[JSC] Introduce @toObject
https://bugs.webkit.org/show_bug.cgi?id=178726

Reviewed by Saam Barati.

JSTests:

* stress/array-copywithin.js:
(shouldThrow):
* stress/object-constructor-boolean-edge.js: Added.
(shouldBe):
(test):
* stress/object-constructor-global.js: Added.
(shouldBe):
* stress/object-constructor-null-edge.js: Added.
(shouldBe):
(test):
* stress/object-constructor-number-edge.js: Added.
(shouldBe):
(test):
* stress/object-constructor-object-edge.js: Added.
(shouldBe):
(test):
(i.arg):
* stress/object-constructor-string-edge.js: Added.
(shouldBe):
(test):
* stress/object-constructor-symbol-edge.js: Added.
(shouldBe):
(test):
* stress/object-constructor-undefined-edge.js: Added.
(shouldBe):
(test):
* stress/symbol-array-from.js: Added.
(shouldBe):
* stress/to-object-intrinsic-boolean-edge.js: Added.
(shouldBe):
(builtin.createBuiltin):
* stress/to-object-intrinsic-null-or-undefined-edge.js: Added.
(shouldThrow):
* stress/to-object-intrinsic-number-edge.js: Added.
(shouldBe):
(builtin.createBuiltin):
* stress/to-object-intrinsic-object-edge.js: Added.
(shouldBe):
(builtin.createBuiltin):
(i.arg):
* stress/to-object-intrinsic-string-edge.js: Added.
(shouldBe):
(builtin.createBuiltin):
* stress/to-object-intrinsic-symbol-edge.js: Added.
(shouldBe):
(builtin.createBuiltin):
* stress/to-object-intrinsic.js: Added.
(shouldBe):
(shouldThrow):
(builtin.createBuiltin):

Source/JavaScriptCore:

This patch introduces @toObject intrinsic. And we introduce op_to_object bytecode and DFG ToObject node.
Previously we emulated @toObject behavior in builtin JS. But it consumes much bytecode size while @toObject
is frequently seen and defined clearly in the spec. Furthermore, the emulated @toObject always calls
ObjectConstructor in LLInt and Baseline.

We add a new intrinsic `@toObject(target, "error message")`. It takes an error message string constant to
offer understandable messages in builtin JS. We can change the frequently seen "emulated ToObject" operation

    if (this === @undefined || this === null)
        @throwTypeError("error message");
    var object = @Object(this);

with

    var object = @toObject(this, "error message");

And we handle op_to_object in DFG as ToObject node. While CallObjectConstructor does not throw an error for null/undefined,
ToObject needs to throw an error for null/undefined. So it is marked as MustGenerate and it clobbers the world.
In fixup phase, we attempt to convert ToObject to CallObjectConstructor with edge filters to relax its side effect.

It also fixes a bug that CallObjectConstructor DFG node uses Node's semantic GlobalObject instead of function's one.

* builtins/ArrayConstructor.js:
(from):
* builtins/ArrayPrototype.js:
(values):
(keys):
(entries):
(reduce):
(reduceRight):
(every):
(forEach):
(filter):
(map):
(some):
(fill):
(find):
(findIndex):
(includes):
(sort):
(globalPrivate.concatSlowPath):
(copyWithin):
* builtins/DatePrototype.js:
(toLocaleString.toDateTimeOptionsAnyAll):
(toLocaleString):
(toLocaleDateString.toDateTimeOptionsDateDate):
(toLocaleDateString):
(toLocaleTimeString.toDateTimeOptionsTimeTime):
(toLocaleTimeString):
* builtins/GlobalOperations.js:
(globalPrivate.copyDataProperties):
(globalPrivate.copyDataPropertiesNoExclusions):
* builtins/ObjectConstructor.js:
(entries):
* builtins/StringConstructor.js:
(raw):
* builtins/TypedArrayConstructor.js:
(from):
* builtins/TypedArrayPrototype.js:
(map):
(filter):
* bytecode/BytecodeDumper.cpp:
(JSC::BytecodeDumper<Block>::dumpBytecode):
* bytecode/BytecodeIntrinsicRegistry.h:
* bytecode/BytecodeList.json:
* bytecode/BytecodeUseDef.h:
(JSC::computeUsesForBytecodeOffset):
(JSC::computeDefsForBytecodeOffset):
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::finishCreation):
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::emitToObject):
* bytecompiler/BytecodeGenerator.h:
* bytecompiler/NodesCodegen.cpp:
(JSC::BytecodeIntrinsicNode::emit_intrinsic_toObject):
* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleConstantInternalFunction):
(JSC::DFG::ByteCodeParser::parseBlock):
* dfg/DFGCapabilities.cpp:
(JSC::DFG::capabilityLevel):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
(JSC::DFG::FixupPhase::fixupToObject):
(JSC::DFG::FixupPhase::fixupCallObjectConstructor):
* dfg/DFGNode.h:
(JSC::DFG::Node::convertToCallObjectConstructor):
(JSC::DFG::Node::convertToNewStringObject):
(JSC::DFG::Node::convertToNewObject):
(JSC::DFG::Node::hasIdentifier):
(JSC::DFG::Node::hasHeapPrediction):
(JSC::DFG::Node::hasCellOperand):
* dfg/DFGNodeType.h:
* dfg/DFGOperations.cpp:
* dfg/DFGOperations.h:
* dfg/DFGPredictionPropagationPhase.cpp:
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileToObjectOrCallObjectConstructor):
(JSC::DFG::SpeculativeJIT::compileCallObjectConstructor): Deleted.
* dfg/DFGSpeculativeJIT.h:
(JSC::DFG::SpeculativeJIT::callOperation):
* 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::compileToObjectOrCallObjectConstructor):
(JSC::FTL::DFG::LowerDFGToB3::compileCallObjectConstructor): Deleted.
* jit/JIT.cpp:
(JSC::JIT::privateCompileMainPass):
(JSC::JIT::privateCompileSlowCases):
* jit/JIT.h:
* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_to_object):
(JSC::JIT::emitSlow_op_to_object):
* jit/JITOpcodes32_64.cpp:
(JSC::JIT::emit_op_to_object):
(JSC::JIT::emitSlow_op_to_object):
* jit/JITOperations.cpp:
* jit/JITOperations.h:
* llint/LowLevelInterpreter32_64.asm:
* llint/LowLevelInterpreter64.asm:
* runtime/CommonSlowPaths.cpp:
(JSC::SLOW_PATH_DECL):
* runtime/CommonSlowPaths.h:

Source/WebCore:

Use @isObject instead. It is more efficient.

* Modules/mediastream/NavigatorUserMedia.js:
(getUserMedia):

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

2 years agoUnreviewed, rolling out r224273 and r224278.
commit-queue@webkit.org [Wed, 1 Nov 2017 16:28:17 +0000 (16:28 +0000)]
Unreviewed, rolling out r224273 and r224278.
https://bugs.webkit.org/show_bug.cgi?id=179120

Some crashes under guard malloc (Requested by anttik on
#webkit).

Reverted changesets:

"Remove empty continuations in
RenderObject::removeFromParentAndDestroyCleaningUpAnonymousWrappers"
https://bugs.webkit.org/show_bug.cgi?id=179014
https://trac.webkit.org/changeset/224273

"Fix ContinuationChainNode::insertAfter assertion."
https://bugs.webkit.org/show_bug.cgi?id=179115
https://trac.webkit.org/changeset/224278

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

2 years agoFix ContinuationChainNode::insertAfter assertion.
commit-queue@webkit.org [Wed, 1 Nov 2017 15:36:49 +0000 (15:36 +0000)]
Fix ContinuationChainNode::insertAfter assertion.
https://bugs.webkit.org/show_bug.cgi?id=179115

Patch by Emilio Cobos Álvarez <emilio@crisal.io> on 2017-11-01
Reviewed by Antti Koivisto.

The assertion was writing instead of reading next->previous.

Hopefully it's harmless because it was clobbered on the same line, but
it's worth asserting what it was intending to assert.

No new tests (no behaviour change).

* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::ContinuationChainNode::insertAfter):

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

2 years agoUse LazyNeverDestroyed instead of DEFINE_GLOBAL
commit-queue@webkit.org [Wed, 1 Nov 2017 13:31:36 +0000 (13:31 +0000)]
Use LazyNeverDestroyed instead of DEFINE_GLOBAL
https://bugs.webkit.org/show_bug.cgi?id=174979

Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2017-11-01
Reviewed by Yusuke Suzuki.

Source/JavaScriptCore:

* config.h: Removed definitions of SKIP_STATIC_CONSTRUCTORS_ON_MSVC and SKIP_STATIC_CONSTRUCTORS_ON_GCC.

Source/WebCore:

No new tests since there should be no behavioral change.

* DerivedSources.cpp: Remove the warning of StaticConstructors.h.
* WebCore.order: Removed
* config.h: Removed definitions of SKIP_STATIC_CONSTRUCTORS_ON_MSVC and SKIP_STATIC_CONSTRUCTORS_ON_GCC.
* dom/QualifiedName.cpp:
(WebCore::createQualifiedName): Deleted.
* dom/QualifiedName.h: Removed createQualifiedName.
* dom/make_names.pl:
(printCppHead): Do not include StaticConstructors.h.

Source/WTF:

DEFINE_GLOBAL is not used anymore. Remove it.

* WTF.xcodeproj/project.pbxproj: Removed StaticConstructors.h
* config.h: Removed definitions of SKIP_STATIC_CONSTRUCTORS_ON_MSVC and SKIP_STATIC_CONSTRUCTORS_ON_GCC.
* wtf/CMakeLists.txt: Removed StaticConstructors.h
* wtf/StaticConstructors.h: Removed.

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

2 years ago[DFG][FTL] Introduce StringSlice
utatane.tea@gmail.com [Wed, 1 Nov 2017 13:25:21 +0000 (13:25 +0000)]
[DFG][FTL] Introduce StringSlice
https://bugs.webkit.org/show_bug.cgi?id=178934

Reviewed by Saam Barati.

JSTests:

* microbenchmarks/string-slice-empty.js: Added.
(slice):
* microbenchmarks/string-slice-one-char.js: Added.
(slice):
* microbenchmarks/string-slice.js: Added.
(slice):

Source/JavaScriptCore:

String.prototype.slice is one of the most frequently called function in ARES-6/Babylon.
This patch introduces StringSlice DFG node to optimize it in DFG and FTL.

This patch's StringSlice node optimizes the following things.

1. Empty string generation is accelerated. It is fully executed inline.
2. One char string generation is accelerated. `< 0x100` character is supported right now.
It is the same to charAt acceleration.
3. We calculate start and end index in DFG/FTL with Int32Use information and call optimized
operation.

We do not inline (3)'s operation right now since we do not have a way to call bmalloc allocation from DFG / FTL.
And we do not optimize String.prototype.{substring,substr} right now. But they can be optimized based on this change
in subsequent changes.

This patch improves ARES-6/Babylon performance by 3% in steady state.

Baseline:
    Running... Babylon ( 1  to go)
    firstIteration:     50.05 +- 13.68 ms
    averageWorstCase:   16.80 +- 1.27 ms
    steadyState:        7.53 +- 0.22 ms

Patched:
    Running... Babylon ( 1  to go)
    firstIteration:     50.91 +- 13.41 ms
    averageWorstCase:   16.12 +- 0.99 ms
    steadyState:        7.30 +- 0.29 ms

* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGBackwardsPropagationPhase.cpp:
(JSC::DFG::BackwardsPropagationPhase::propagate):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleIntrinsicCall):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGNodeType.h:
* dfg/DFGOperations.cpp:
* dfg/DFGOperations.h:
* dfg/DFGPredictionPropagationPhase.cpp:
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileStringSlice):
(JSC::DFG::SpeculativeJIT::emitPopulateSliceIndex):
(JSC::DFG::SpeculativeJIT::compileArraySlice):
(JSC::DFG::SpeculativeJIT::compileArrayIndexOf):
* dfg/DFGSpeculativeJIT.h:
(JSC::DFG::SpeculativeJIT::callOperation):
* 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::populateSliceRange):
(JSC::FTL::DFG::LowerDFGToB3::compileArraySlice):
(JSC::FTL::DFG::LowerDFGToB3::compileStringSlice):
* jit/JITOperations.h:
* runtime/Intrinsic.cpp:
(JSC::intrinsicName):
* runtime/Intrinsic.h:
* runtime/StringPrototype.cpp:
(JSC::StringPrototype::finishCreation):

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

2 years ago[GTK] Always include TextureMapper.cmake
mcatanzaro@igalia.com [Wed, 1 Nov 2017 12:22:53 +0000 (12:22 +0000)]
[GTK] Always include TextureMapper.cmake
https://bugs.webkit.org/show_bug.cgi?id=179060

Reviewed by Carlos Garcia Campos.

* PlatformGTK.cmake:

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

2 years agoREGRESSION(r224192): [WPE] Fix WebEventFactory::createWebWheelEvent
mcatanzaro@igalia.com [Wed, 1 Nov 2017 12:21:07 +0000 (12:21 +0000)]
REGRESSION(r224192): [WPE] Fix WebEventFactory::createWebWheelEvent
https://bugs.webkit.org/show_bug.cgi?id=179098

Reviewed by Sam Weinig.

* Shared/wpe/WebEventFactory.cpp:
(WebKit::WebEventFactory::createWebWheelEvent):

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

2 years agoRemove empty continuations in RenderObject::removeFromParentAndDestroyCleaningUpAnony...
antti@apple.com [Wed, 1 Nov 2017 07:57:02 +0000 (07:57 +0000)]
Remove empty continuations in RenderObject::removeFromParentAndDestroyCleaningUpAnonymousWrappers
https://bugs.webkit.org/show_bug.cgi?id=179014

Reviewed by Geoff Garen.

Source/WebCore:

Treat continuation similarly to other anonymous wrappers. This makes things more understandable
and allows removal of some questionable code in RenderBlock::takeChild.

The patch also makes continuation chain a double linked so we can efficiently remove single
continuations from the chain. It also gets rid of algorithms that recurse in continuation chain.

* accessibility/AccessibilityRenderObject.cpp:
(WebCore::firstChildInContinuation):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::styleDidChange):

    Don't add and remove continuations from the chain when updating style. Prevent recursion by walking
    the chain only in the (non-continuation) head renderer.

(WebCore::RenderBlock::dropAnonymousBoxChild):

    Make a member function.

(WebCore::RenderBlock::takeChild):

    Remove code that destroyed empty continuations and caused the parent to destroy itself.
    Empty continuations are now removed by RenderObject::removeFromParentAndDestroyCleaningUpAnonymousWrappers.

* rendering/RenderBlock.h:
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::ContinuationChainNode::ContinuationChainNode):
(WebCore::RenderBoxModelObject::ContinuationChainNode::~ContinuationChainNode):
(WebCore::RenderBoxModelObject::ContinuationChainNode::insertAfter):

    Track continuations with double linked lists.

(WebCore::continuationChainNodeMap):
(WebCore::RenderBoxModelObject::willBeDestroyed):

    Don't recurse to destroy continuation chain.
    Destroy all continuations iteratively if this is the head of the chain.
    When destroying a continuation renderer simply remove it from the chain.

(WebCore::RenderBoxModelObject::continuation const):
(WebCore::RenderBoxModelObject::insertIntoContinuationChainAfter):
(WebCore::RenderBoxModelObject::removeFromContinuationChain):
(WebCore::RenderBoxModelObject::ensureContinuationChainNode):
(WebCore::continuationMap): Deleted.
(WebCore::RenderBoxModelObject::setContinuation): Deleted.
* rendering/RenderBoxModelObject.h:
* rendering/RenderElement.cpp:
(WebCore::RenderElement::RenderElement):
(WebCore::RenderElement::removeAnonymousWrappersForInlinesIfNecessary):

    Make this a function of the parent renderer itself instead of getting 'parent()' as first operation and
    then using it.
    Don't remove continuations (isAnonymousBlockContinuation() test gives wrong result for the last continuation of the chain).

(WebCore::RenderElement::styleDidChange):

    removeAnonymousWrappersForInlinesIfNecessary is no function of the parent.

(WebCore::RenderElement::updateOutlineAutoAncestor):
* rendering/RenderElement.h:
(WebCore::RenderElement::hasContinuationChainNode const):
(WebCore::RenderElement::setHasContinuationChainNode):
(WebCore::RenderElement::hasContinuation const): Deleted.
(WebCore::RenderElement::setHasContinuation): Deleted.
* rendering/RenderInline.cpp:
(WebCore::RenderInline::styleDidChange):

    Don't add and remove continuations from the chain when updating style. Prevent recursion by walking
    the chain only in the (non-continuation) head renderer.

(WebCore::RenderInline::addChildIgnoringContinuation):

    Remove the old continuation from the chain. splitFlow() will add it back into the right place.

(WebCore::RenderInline::splitInlines):
(WebCore::RenderInline::addChildToContinuation):
(WebCore::RenderInline::childBecameNonInline):

    Remove the old continuation from the chain. splitFlow() will add it back into the right place.

* rendering/RenderInline.h:
* rendering/RenderObject.cpp:
(WebCore::RenderObject::propagateRepaintToParentWithOutlineAutoIfNeeded const):
(WebCore::RenderObject::outputRenderObject const):
(WebCore::findDestroyRootIncludingAnonymous):

    Allow anonymous continuations as destroy roots.

(WebCore::RenderObject::removeFromParentAndDestroyCleaningUpAnonymousWrappers):

    Removing a continuation may leave behind unnecessary anonymous sibling wrappers.
    Call removeAnonymousWrappersForInlinesIfNecessary() on parent after removal to get rid of them.

LayoutTests:

* fast/ruby/float-overhang-from-ruby-text-expected.txt:
* platform/mac/fast/ruby/rubyDOM-remove-rt1-expected.txt:

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

2 years agoWebAssembly: Wasm::IndexOrName has a raw pointer to Name
jfbastien@apple.com [Wed, 1 Nov 2017 06:15:59 +0000 (06:15 +0000)]
WebAssembly: Wasm::IndexOrName has a raw pointer to Name
https://bugs.webkit.org/show_bug.cgi?id=176644

Reviewed by Michael Saboff.

IndexOrName now keeps a RefPtr to its original NameSection, which
holds the Name (or references nullptr if Index). Holding onto the
entire section seems like the better thing to do, since backtraces
probably contain multiple names from the same Module.

* JavaScriptCore.xcodeproj/project.pbxproj:
* interpreter/Interpreter.cpp:
(JSC::GetStackTraceFunctor::operator() const):
* interpreter/StackVisitor.h: Frame is no longer POD because of the
RefPtr.
* runtime/StackFrame.cpp:
(JSC::StackFrame::StackFrame):
* runtime/StackFrame.h: Drop the union, size is now 40 bytes.
(JSC::StackFrame::StackFrame): Deleted. Initialized in class instead.
(JSC::StackFrame::wasm): Deleted. Make it a ctor instead.
* wasm/WasmBBQPlanInlines.h:
(JSC::Wasm::BBQPlan::initializeCallees):
* wasm/WasmCallee.cpp:
(JSC::Wasm::Callee::Callee):
* wasm/WasmCallee.h:
(JSC::Wasm::Callee::create):
* wasm/WasmFormat.h: Move NameSection to its own header.
(JSC::Wasm::isValidNameType):
(JSC::Wasm::NameSection::get): Deleted.
* wasm/WasmIndexOrName.cpp:
(JSC::Wasm::IndexOrName::IndexOrName):
(JSC::Wasm::makeString):
* wasm/WasmIndexOrName.h:
(JSC::Wasm::IndexOrName::IndexOrName):
(JSC::Wasm::IndexOrName::isEmpty const):
(JSC::Wasm::IndexOrName::isIndex const):
* wasm/WasmModuleInformation.cpp:
(JSC::Wasm::ModuleInformation::ModuleInformation):
* wasm/WasmModuleInformation.h:
(JSC::Wasm::ModuleInformation::ModuleInformation): Deleted.
* wasm/WasmNameSection.h:
(JSC::Wasm::NameSection::get):
(JSC::Wasm::NameSection::create): Deleted.
* wasm/WasmNameSectionParser.cpp:
(JSC::Wasm::NameSectionParser::parse):
* wasm/WasmNameSectionParser.h:
* wasm/WasmOMGPlan.cpp:
(JSC::Wasm::OMGPlan::work):

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

2 years agoFix a couple of service worker tests and unskip them
cdumez@apple.com [Wed, 1 Nov 2017 03:26:41 +0000 (03:26 +0000)]
Fix a couple of service worker tests and unskip them
https://bugs.webkit.org/show_bug.cgi?id=179088

Reviewed by Sam Weinig.

LayoutTests/imported/w3c:

Merge fixes from https://github.com/w3c/web-platform-tests/pull/8019 and rebaseline tests.

* web-platform-tests/service-workers/service-worker/fetch-event-network-error.https-expected.txt:
* web-platform-tests/service-workers/service-worker/fetch-event-respond-with-argument.https-expected.txt:
* web-platform-tests/service-workers/service-worker/resources/fetch-event-network-error-controllee-iframe.html:
* web-platform-tests/service-workers/service-worker/resources/fetch-event-respond-with-argument-iframe.html:

LayoutTests:

Unskip the 2 tests.

* TestExpectations:

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

2 years agoFix Windows build after r224260
achristensen@apple.com [Wed, 1 Nov 2017 02:07:20 +0000 (02:07 +0000)]
Fix Windows build after r224260

* WebView.cpp:
(WebView::gesture):

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

2 years agoupdateMaskedAncestorShouldIsolateBlending() should check the Nullability of the compu...
commit-queue@webkit.org [Wed, 1 Nov 2017 01:39:09 +0000 (01:39 +0000)]
updateMaskedAncestorShouldIsolateBlending() should check the Nullability of the computedStyle() of the element's ancestors
https://bugs.webkit.org/show_bug.cgi?id=179085
<rdar://problem/30888101>

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2017-10-31
Reviewed by Ryosuke Niwa.

This is a defensive change. The Element::computedStyle() can be null only
if the element is not a connected to the DOM tree. This may happen if
while the DOM tree is being changed, a different event is handled such
that it requires styleReclac()/layout() to happen. In this case, the render
tree will be in an incorrect state.

* rendering/svg/SVGRenderSupport.cpp:
(WebCore::SVGRenderSupport::updateMaskedAncestorShouldIsolateBlending):

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

2 years agoWeb Inspector: Add Inspector menu items to Mac MiniBrowser
ross.kirsling@sony.com [Wed, 1 Nov 2017 01:27:39 +0000 (01:27 +0000)]
Web Inspector: Add Inspector menu items to Mac MiniBrowser
https://bugs.webkit.org/show_bug.cgi?id=65218

Reviewed by Joseph Pecoraro.

Add Option-Command-I shortcut and corresponding Show/Close Web Inspector menu item to Mac MiniBrowser.
Only works when browser window is focused, but at least WI can be opened without having to Inspect Element.

* MiniBrowser/mac/BrowserWindowController.h:
* MiniBrowser/mac/BrowserWindowController.m:
(-[BrowserWindowController showHideWebInspector:]):
* MiniBrowser/mac/MainMenu.xib:
* MiniBrowser/mac/WK1BrowserWindowController.m:
(-[WK1BrowserWindowController validateMenuItem:]):
(-[WK1BrowserWindowController showHideWebInspector:]):
* MiniBrowser/mac/WK2BrowserWindowController.m:
(-[WK2BrowserWindowController validateMenuItem:]):
(-[WK2BrowserWindowController showHideWebInspector:]):

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

2 years agoUse asynchronous ResourceHandleClient calls for WebKit1
achristensen@apple.com [Wed, 1 Nov 2017 01:13:04 +0000 (01:13 +0000)]
Use asynchronous ResourceHandleClient calls for WebKit1
https://bugs.webkit.org/show_bug.cgi?id=160677

Reviewed by Brady Eidson.

Source/WebCore:

Covered by existing tests.

* PlatformAppleWin.cmake:
* PlatformMac.cmake:
* WebCore.xcodeproj/project.pbxproj:
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::willSendRequestAsync):
(WebCore::ResourceLoader::didReceiveResponseAsync):
(WebCore::ResourceLoader::canAuthenticateAgainstProtectionSpaceAsync):
* loader/ResourceLoader.h:
* loader/appcache/ApplicationCacheGroup.cpp:
(WebCore::ApplicationCacheGroup::didReceiveResponseAsync):
(WebCore::ApplicationCacheGroup::willSendRequestAsync):
(WebCore::ApplicationCacheGroup::canAuthenticateAgainstProtectionSpaceAsync):
(WebCore::ApplicationCacheGroup::didReceiveResponse): Deleted.
* loader/appcache/ApplicationCacheGroup.h:
* platform/network/BlobResourceHandle.cpp:
(WebCore::BlobResourceHandle::continueDidReceiveResponse):
(WebCore::BlobResourceHandle::getSizeForNext):
(WebCore::BlobResourceHandle::notifyResponseOnSuccess):
(WebCore::BlobResourceHandle::notifyResponseOnError):
* platform/network/PingHandle.h:
* platform/network/ResourceHandle.cpp:
(WebCore::ResourceHandle::didReceiveResponse):
(WebCore::ResourceHandle::usesAsyncCallbacks): Deleted.
* platform/network/ResourceHandle.h:
* platform/network/ResourceHandleClient.cpp:
(WebCore::ResourceHandleClient::~ResourceHandleClient):
(WebCore::ResourceHandleClient::willSendRequest): Deleted.
(WebCore::ResourceHandleClient::willSendRequestAsync): Deleted.
(WebCore::ResourceHandleClient::didReceiveResponseAsync): Deleted.
(WebCore::ResourceHandleClient::canAuthenticateAgainstProtectionSpaceAsync): Deleted.
* platform/network/ResourceHandleClient.h:
(WebCore::ResourceHandleClient::didReceiveAuthenticationChallenge):
(WebCore::ResourceHandleClient::didReceiveResponse): Deleted.
(WebCore::ResourceHandleClient::usesAsyncCallbacks): Deleted.
(WebCore::ResourceHandleClient::canAuthenticateAgainstProtectionSpace): Deleted.
* platform/network/ResourceHandleInternal.h:
(WebCore::ResourceHandleInternal::ResourceHandleInternal):
* platform/network/SynchronousLoaderClient.cpp:
(WebCore::SynchronousLoaderClient::willSendRequestAsync):
(WebCore::SynchronousLoaderClient::canAuthenticateAgainstProtectionSpaceAsync):
(WebCore::SynchronousLoaderClient::didReceiveResponseAsync):
(WebCore::SynchronousLoaderClient::didFinishLoading):
(WebCore::SynchronousLoaderClient::didFail):
(WebCore::SynchronousLoaderClient::willSendRequest): Deleted.
(WebCore::SynchronousLoaderClient::canAuthenticateAgainstProtectionSpace): Deleted.
(WebCore::SynchronousLoaderClient::didReceiveResponse): Deleted.
* platform/network/SynchronousLoaderClient.h:
* platform/network/cf/ResourceHandleCFNet.cpp:
(WebCore::ResourceHandle::createCFURLConnection):
(WebCore::ResourceHandle::start):
(WebCore::ResourceHandle::willSendRequest):
(WebCore::ResourceHandle::shouldUseCredentialStorage):
(WebCore::ResourceHandle::canAuthenticateAgainstProtectionSpace):
(WebCore::ResourceHandle::platformLoadResourceSynchronously):
* platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::ResourceHandleCFURLConnectionDelegateWithOperationQueue):
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::releaseHandle):
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::willSendRequest):
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse):
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveData):
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didFinishLoading):
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didFail):
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::willCacheResponse):
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveChallenge):
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didSendBodyData):
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::shouldUseCredentialStorage):
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::canRespondToProtectionSpace):
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::continueCanAuthenticateAgainstProtectionSpace):
* platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.h:
* platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp: Removed.
* platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.h: Removed.
* platform/network/mac/ResourceHandleMac.mm:
(WebCore::ResourceHandle::start):
(WebCore::ResourceHandle::schedule):
(WebCore::ResourceHandle::makeDelegate):
(WebCore::ResourceHandle::delegate):
(WebCore::ResourceHandle::platformLoadResourceSynchronously):
(WebCore::ResourceHandle::willSendRequest):
(WebCore::ResourceHandle::continueWillSendRequest):
(WebCore::ResourceHandle::continueDidReceiveResponse):
(WebCore::ResourceHandle::canAuthenticateAgainstProtectionSpace):
(WebCore::ResourceHandle::continueCanAuthenticateAgainstProtectionSpace):
(WebCore::ResourceHandle::continueWillCacheResponse):
(WebCore::ResourceHandle::shouldUseCredentialStorage): Deleted.
* platform/network/mac/WebCoreResourceHandleAsDelegate.h: Removed.
* platform/network/mac/WebCoreResourceHandleAsDelegate.mm: Removed.
* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.h:
* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveAuthenticationChallenge:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:canAuthenticateAgainstProtectionSpace:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveData:lengthReceived:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:didSendBodyData:totalBytesWritten:totalBytesExpectedToWrite:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:didFailWithError:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:willCacheResponse:]):

Source/WebKitLegacy:

* WebCoreSupport/WebResourceLoadScheduler.cpp:
(WebResourceLoadScheduler::createPingHandle):

Tools:

* TestWebKitAPI/Tests/mac/SimplifyMarkup.mm:
(TestWebKitAPI::TEST):
The HTML being loaded contains an iframe, so testing if the main resource has loaded doesn't necessarily mean all subresources are loaded.
Wait until they are loaded before continuing the test.  This is a test of editing commands once the page has loaded, not a test of loading.

LayoutTests:

* TestExpectations:
* platform/gtk/TestExpectations:
* platform/ios-wk2/TestExpectations:
* platform/mac-wk2/TestExpectations:
* platform/wk2/TestExpectations:

http/tests/cache/iframe-304-crash.html used to deterministically record its didFinishLoading callback,
but only for WK1.  It was marked as flaky for all WK2 ports.  It is now flaky in WK1 because the order
of the testRunner.notifyDone call and the didFinishLoading logging is no longer deterministic with
asynchronous loading, but the test still verifies that there is no crash.

http/tests/security/cross-origin-modal-dialog-base.html does navigation during showModalDialog, which
probably should've never worked in WK1 and never worked in WK2.  WK1 behavior now matches WK2 behavior.
I'm not aware of any complaints about no navigation working during showModalDialog in WK2 and I imagine
nobody will be regressed by this change, but if we do find such a problem, creative use of MessageQueues
like we do with sync xhr in WK1 now could theoretically fix the problem, but we are trying to get
rid of showModalDialog anyway.  The test was written to verify that the SecurityOrigin doesn't fall back
to the wrong origin, and it certainly doesn't now.

These tests dump load delegate call order, which are less deterministic now but the tests still behave correctly.
http/tests/svg/svg-use-external.html
http/tests/loading/text-content-type-with-binary-extension.html
http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-iframe-in-main-frame.html

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

2 years agoUnreviewed, rolling out r224143.
commit-queue@webkit.org [Wed, 1 Nov 2017 00:29:19 +0000 (00:29 +0000)]
Unreviewed, rolling out r224143.
https://bugs.webkit.org/show_bug.cgi?id=179091

The patch requires non-standard perl modules in macOS and
breaks AWFY (Requested by yusukesuzuki on #webkit).

Reverted changeset:

"[Win] Detect Visual Studio 2017 location"
https://bugs.webkit.org/show_bug.cgi?id=175275
https://trac.webkit.org/changeset/224143

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

2 years agoRubber-banding overflow-scrolling-touch shows black
simon.fraser@apple.com [Wed, 1 Nov 2017 00:21:20 +0000 (00:21 +0000)]
Rubber-banding overflow-scrolling-touch shows black
https://bugs.webkit.org/show_bug.cgi?id=179087
rdar://problem/35260253

Reviewed by Sam Weinig.

Source/WebCore:

The "backgroundIsKnownToBeObscured" optimization was kicking in for an overflow:scroll
whose area was completely covered by its contents, which happens with overlay scrollbars.

However, this ignored the fact that you can rubber-band to reveal the background, and,
on iOS, composited scrolling requires that the scroller background is painted since it goes
into its own layer.

Fix by turning off the optimization for layers that scroll overflow, including those
using composited scrolling.

Test: fast/scrolling/rubber-band-shows-background.html

* rendering/RenderBox.cpp:
(WebCore::RenderBox::foregroundIsKnownToBeOpaqueInRect const):
(WebCore::RenderBox::computeBackgroundIsKnownToBeObscured):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollTo):
(WebCore::RenderLayer::calculateClipRects const):
* rendering/RenderLayer.h:

LayoutTests:

* fast/scrolling/rubber-band-shows-background-expected.html: Added.
* fast/scrolling/rubber-band-shows-background.html: Added.

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

2 years agoRemove TestExpectation entry for a test that has been deleted.
ryanhaddad@apple.com [Wed, 1 Nov 2017 00:15:28 +0000 (00:15 +0000)]
Remove TestExpectation entry for a test that has been deleted.
https://bugs.webkit.org/show_bug.cgi?id=178190

Unreviewed test gardening.

* TestExpectations:

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

2 years agoClean up some drag and drop feature flags
timothy_horton@apple.com [Tue, 31 Oct 2017 23:58:53 +0000 (23:58 +0000)]
Clean up some drag and drop feature flags
https://bugs.webkit.org/show_bug.cgi?id=179082

Reviewed by Simon Fraser.

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore/PAL:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit:

* Configurations/FeatureDefines.xcconfig:

Source/WebKitLegacy/mac:

* Configurations/FeatureDefines.xcconfig:

Tools:

* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:
* TestWebKitAPI/ios/UIKitSPI.h:

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

2 years agoLayout Test imported/w3c/web-platform-tests/service-workers/service-worker/fetch...
commit-queue@webkit.org [Tue, 31 Oct 2017 23:54:42 +0000 (23:54 +0000)]
Layout Test imported/w3c/web-platform-tests/service-workers/service-worker/fetch-header-visibility.https.html is flaky.
https://bugs.webkit.org/show_bug.cgi?id=179081

Patch by Youenn Fablet <youenn@apple.com> on 2017-10-31
Reviewed by Chris Dumez.

* TestExpectations: Marking test as flaky.

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

2 years ago[iOS] Skip LayoutTests that rely on eventsender.keyDown()
ryanhaddad@apple.com [Tue, 31 Oct 2017 23:30:32 +0000 (23:30 +0000)]
[iOS] Skip LayoutTests that rely on eventsender.keyDown()
https://bugs.webkit.org/show_bug.cgi?id=179061

Unreviewed test gardening.

* platform/ios-wk2/TestExpectations:
* platform/ios/TestExpectations:

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

2 years agoMake it possible to test rubber-banding in overflow scroll
simon.fraser@apple.com [Tue, 31 Oct 2017 23:26:52 +0000 (23:26 +0000)]
Make it possible to test rubber-banding in overflow scroll
https://bugs.webkit.org/show_bug.cgi?id=179078

Reviewed by Sam Weinig.

Source/WebCore:

Test: fast/scrolling/unconstrained-scrollto.html

Add internals.unconstrainedScrollTo(element, x, y) and plumb through ScrollClamping
(which replaces RenderLayer::ScrollOffsetClamping) to support it.

Flip the default from unclamped to clamped for various RenderLayer scrolling-related
functions, since most callers want clamped.

* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::scrollTo const):
* dom/Element.cpp:
(WebCore::Element::scrollTo):
* dom/Element.h:
* html/HTMLBodyElement.cpp:
(WebCore::HTMLBodyElement::scrollTo):
* html/HTMLBodyElement.h:
* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::elementDidBlur):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::scrollTo const):
* page/DOMWindow.h:
* page/Frame.cpp:
(WebCore::Frame::scrollOverflowLayer):
(WebCore::Frame::checkOverflowScroll):
* platform/ScrollAnimator.cpp:
(WebCore::ScrollAnimator::scrollToOffsetWithoutAnimation):
* platform/ScrollAnimator.h:
* platform/ScrollTypes.h:
* platform/ScrollableArea.cpp:
(WebCore::ScrollableArea::scrollToOffsetWithoutAnimation):
* platform/ScrollableArea.h:
* platform/cocoa/ScrollController.h:
* platform/mac/ScrollAnimatorMac.h:
* platform/mac/ScrollAnimatorMac.mm:
(WebCore::ScrollAnimatorMac::scrollToOffsetWithoutAnimation):
(WebCore::ScrollAnimatorMac::immediateScrollToPosition):
* platform/mock/ScrollAnimatorMock.h:
* rendering/RenderBox.cpp:
(WebCore::RenderBox::setScrollLeft):
(WebCore::RenderBox::setScrollTop):
* rendering/RenderBox.h:
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::panScrollFromPoint):
(WebCore::RenderLayer::scrollByRecursively):
(WebCore::RenderLayer::applyPostLayoutScrollPositionIfNeeded):
(WebCore::RenderLayer::scrollToXPosition):
(WebCore::RenderLayer::scrollToYPosition):
(WebCore::RenderLayer::scrollToOffset):
* rendering/RenderLayer.h:
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::setScrollLeft):
(WebCore::RenderListBox::setScrollTop):
* rendering/RenderListBox.h:
* rendering/RenderTextControlSingleLine.cpp:
(WebCore::RenderTextControlSingleLine::setScrollLeft):
(WebCore::RenderTextControlSingleLine::setScrollTop):
* rendering/RenderTextControlSingleLine.h:
* testing/Internals.cpp:
(WebCore::Internals::unconstrainedScrollTo):
* testing/Internals.h:
* testing/Internals.idl:

Source/WebKitLegacy/mac:

Add internals.unconstrainedScrollTo(element, x, y) and plumb through ScrollClamping
(which replaces RenderLayer::ScrollOffsetClamping) to support it.

Flip the default from unclamped to clamped for various RenderLayer scrolling-related
functions, since most callers want clamped.

* DOM/DOMHTML.mm:
(-[DOMHTMLElement setScrollXOffset:scrollYOffset:adjustForIOSCaret:]):

LayoutTests:

Test that internals.unconstrainedScrollTo() works.

* fast/scrolling/unconstrained-scrollto-expected.txt: Added.
* fast/scrolling/unconstrained-scrollto.html: Added.

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

2 years agoUnreviewed, rolling out r224243, r224246, and r224248.
commit-queue@webkit.org [Tue, 31 Oct 2017 23:12:32 +0000 (23:12 +0000)]
Unreviewed, rolling out r224243, r224246, and r224248.
https://bugs.webkit.org/show_bug.cgi?id=179083

The patch and fix broke the Windows build. (Requested by
mlewis13 on #webkit).

Reverted changesets:

"StructureStubInfo should have GPRReg members not int8_ts"
https://bugs.webkit.org/show_bug.cgi?id=179071
https://trac.webkit.org/changeset/224243

"Make all register enums be backed by uint8_t."
https://bugs.webkit.org/show_bug.cgi?id=179074
https://trac.webkit.org/changeset/224246

"Unreviewed, windows build fix."
https://trac.webkit.org/changeset/224248

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

2 years agoFollowup to r224238: API::Attachment should generate a _WKAttachment ObjC wrapper
wenson_hsieh@apple.com [Tue, 31 Oct 2017 22:41:22 +0000 (22:41 +0000)]
Followup to r224238: API::Attachment should generate a _WKAttachment ObjC wrapper
https://bugs.webkit.org/show_bug.cgi?id=179080

Reviewed by Tim Horton.

Fixes a failing API test. The new Attachment object type added in r224238 was not actually being handled in
Object::newObject, so a plain WKObject Objective C wrapper was being created; fix this by allocating a new
_WKAttachment object for Type::Attachment.

* Shared/Cocoa/APIObject.mm:
(API::Object::newObject):

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

2 years agoAccept Settings object in ImageBitmapRenderingContext constructor and getContext
dino@apple.com [Tue, 31 Oct 2017 22:33:27 +0000 (22:33 +0000)]
Accept Settings object in ImageBitmapRenderingContext constructor and getContext
https://bugs.webkit.org/show_bug.cgi?id=179075
<rdar://problem/35279965>

Reviewed by Sam Weinig.

Allow getContext("bitmaprenderer") to take a dictionary as another argument, and
pass that on to the ImageBitmapRenderingContext constructor.

Unfortunately this meant having to move ImageBitmapRenderingContext::Settings out into
a stand-alone struct, since it needs to be defined in HTMLCanvasElement, which itself
needs to be defined for ImageBitmapRenderingContext.

* DerivedSources.make: Add new IDL.
* WebCore.xcodeproj/project.pbxproj: New files.

* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::createContextBitmapRenderer):
(WebCore::HTMLCanvasElement::getContextBitmapRenderer):

    Accept the ImageBitmapRenderingContextSettings object, and pass it on.

* html/HTMLCanvasElement.h:
* html/canvas/ImageBitmapRenderingContext.cpp:
(WebCore::ImageBitmapRenderingContext::ImageBitmapRenderingContext):
* html/canvas/ImageBitmapRenderingContext.h:
* html/canvas/ImageBitmapRenderingContext.idl:
* html/canvas/ImageBitmapRenderingContextSettings.h: Copied from Source/WebCore/html/canvas/ImageBitmapRenderingContext.idl.
* html/canvas/ImageBitmapRenderingContextSettings.idl: Added.

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

2 years agoFix up some content filtering feature flags
timothy_horton@apple.com [Tue, 31 Oct 2017 22:23:48 +0000 (22:23 +0000)]
Fix up some content filtering feature flags
https://bugs.webkit.org/show_bug.cgi?id=179079

Reviewed by Simon Fraser.

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore/PAL:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit:

* Configurations/FeatureDefines.xcconfig:

Source/WebKitLegacy/mac:

* Configurations/FeatureDefines.xcconfig:

Tools:

* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:
* TestWebKitAPI/Tests/WebKitCocoa/ContentFilteringPlugIn.mm:
(-[MockContentFilterEnabler initWithCoder:]):
(-[MockContentFilterEnabler dealloc]):

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

2 years agorwt should allow service worker to load localhost HTTPS resources with any certificate
commit-queue@webkit.org [Tue, 31 Oct 2017 22:11:45 +0000 (22:11 +0000)]
rwt should allow service worker to load localhost HTTPS resources with any certificate
https://bugs.webkit.org/show_bug.cgi?id=179018

Patch by Youenn Fablet <youenn@apple.com> on 2017-10-31
Reviewed by Chris Dumez.

Source/WebKit:

Allowing ServiceWorkerProcessProxy to handle authentication challenge.
Temporarily adding a boolean flag through WebProcessPool to lower the SSL certificate verifications for service workers.
This allows reducing flakiness in our layout tests for rwt.
Future work should be done to expose a correct API for the application level to handle authentication challenges properly.

* UIProcess/API/C/WKContext.cpp:
(WKContextSetAllowsAnySSLCertificateForServiceWorkerTesting):
* UIProcess/API/C/WKContextPrivate.h:
* UIProcess/API/Cocoa/WKProcessPool.mm:
(-[WKProcessPool _setAllowsAnySSLCertificateForServiceWorker:]):
* UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::didReceiveAuthenticationChallenge):
(WebKit::NetworkProcessProxy::canAuthenticateAgainstProtectionSpace):
* UIProcess/ServiceWorkerProcessProxy.cpp:
(WebKit::ServiceWorkerProcessProxy::didReceiveAuthenticationChallenge):
* UIProcess/ServiceWorkerProcessProxy.h:
* UIProcess/WebProcessPool.h:

Tools:

* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetStateToConsistentValues): allowing any SSL certificate for service workers.

LayoutTests:

* TestExpectations:
* http/tests/workers/service/service-worker-fetch-expected.txt: Removed.
* http/tests/workers/service/service-worker-fetch.https-expected.txt: Added.
* http/tests/workers/service/service-worker-fetch.https.html: Renamed from LayoutTests/http/tests/workers/service/service-worker-fetch.html.

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

2 years agoWeb Inspector: UIProcess ASSERT in ~RemoteWebInspectorProxy when InspectorProcess...
commit-queue@webkit.org [Tue, 31 Oct 2017 21:43:58 +0000 (21:43 +0000)]
Web Inspector: UIProcess ASSERT in ~RemoteWebInspectorProxy when InspectorProcess crashes
https://bugs.webkit.org/show_bug.cgi?id=179044

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-10-31
Reviewed by Alex Christensen.

* UIProcess/RemoteWebInspectorProxy.cpp:
(WebKit::RemoteWebInspectorProxy::frontendDidClose):
Add a protector to keep the proxy alive for the duration of this method.

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

2 years agoUnreviewed, windows build fix.
keith_miller@apple.com [Tue, 31 Oct 2017 21:37:59 +0000 (21:37 +0000)]
Unreviewed, windows build fix.

* assembler/X86Assembler.h:
(JSC::X86Assembler::numberOfRegisters):
(JSC::X86Assembler::numberOfSPRegisters):
(JSC::X86Assembler::numberOfFPRegisters):

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

2 years agoMark imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-eleme...
ryanhaddad@apple.com [Tue, 31 Oct 2017 21:32:35 +0000 (21:32 +0000)]
Mark imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/sandbox_032.htm as flaky.
https://bugs.webkit.org/show_bug.cgi?id=179069

Unreviewed test gardening.

* TestExpectations:

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

2 years agoMake all register enums be backed by uint8_t.
keith_miller@apple.com [Tue, 31 Oct 2017 21:25:17 +0000 (21:25 +0000)]
Make all register enums be backed by uint8_t.
https://bugs.webkit.org/show_bug.cgi?id=179074

Reviewed by Mark Lam.

* assembler/ARM64Assembler.h:
* assembler/ARMAssembler.h:
* assembler/ARMv7Assembler.h:
* assembler/MIPSAssembler.h:
* assembler/MacroAssembler.h:
* assembler/X86Assembler.h:

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

2 years ago[iOS] Skip LayoutTests that rely on mouse events
ryanhaddad@apple.com [Tue, 31 Oct 2017 20:50:37 +0000 (20:50 +0000)]
[iOS] Skip LayoutTests that rely on mouse events
https://bugs.webkit.org/show_bug.cgi?id=179034

Unreviewed test gardening.

* platform/ios-simulator/TestExpectations:
* platform/ios-wk2/TestExpectations:
* platform/ios/TestExpectations:

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

2 years agonavigator.serviceWorker should always return the same object
cdumez@apple.com [Tue, 31 Oct 2017 20:38:12 +0000 (20:38 +0000)]
navigator.serviceWorker should always return the same object
https://bugs.webkit.org/show_bug.cgi?id=179067

Reviewed by Youenn Fablet.

Source/WebCore:

navigator.serviceWorker should always return the same object:
- https://www.w3.org/TR/service-workers-1/#navigator-service-worker

Add visitor to make sure we don't gc() the ServiceWorkerContainer wrapper too early.

Test: http/tests/workers/service/navigator-serviceWorker-same-object.html

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSNavigatorCustom.cpp: Copied from Source/WebCore/workers/service/ServiceWorkerContainer.idl.
(WebCore::JSNavigator::visitAdditionalChildren):
* page/Navigator.idl:
* workers/service/ServiceWorkerContainer.idl:

LayoutTests:

Add layout test coverage.

* http/tests/workers/service/navigator-serviceWorker-same-object-expected.txt: Added.
* http/tests/workers/service/navigator-serviceWorker-same-object.html: Added.

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

2 years agoStructureStubInfo should have GPRReg members not int8_ts
keith_miller@apple.com [Tue, 31 Oct 2017 20:29:55 +0000 (20:29 +0000)]
StructureStubInfo should have GPRReg members not int8_ts
https://bugs.webkit.org/show_bug.cgi?id=179071

Reviewed by Michael Saboff.

This patch makes the various RegisterID enums be backed by
uint8_t. This means that we can remove the old int8_t members in
StructureStubInfo and replace them with the correct enum types.

Also, this fixes an indentation issue in ARMv7Assembler.h.

* assembler/ARM64Assembler.h:
* assembler/ARMAssembler.h:
* assembler/ARMv7Assembler.h:
(JSC::ARMRegisters::asSingle):
(JSC::ARMRegisters::asDouble):
* assembler/MIPSAssembler.h:
* assembler/X86Assembler.h:
* bytecode/InlineAccess.cpp:
(JSC::InlineAccess::generateSelfPropertyAccess):
(JSC::getScratchRegister):
* bytecode/PolymorphicAccess.cpp:
(JSC::PolymorphicAccess::regenerate):
* bytecode/StructureStubInfo.h:
(JSC::StructureStubInfo::valueRegs const):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileIn):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileIn):
* jit/JITInlineCacheGenerator.cpp:
(JSC::JITByIdGenerator::JITByIdGenerator):
(JSC::JITGetByIdWithThisGenerator::JITGetByIdWithThisGenerator):

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

2 years ago[Web Animations] Support AnimationEffect parameter in Animation constructor and read...
commit-queue@webkit.org [Tue, 31 Oct 2017 20:28:18 +0000 (20:28 +0000)]
[Web Animations] Support AnimationEffect parameter in Animation constructor and read-write timeline property
https://bugs.webkit.org/show_bug.cgi?id=179066

Patch by Antoine Quint <graouts@apple.com> on 2017-10-31
Reviewed by Dean Jackson.

Source/WebCore:

We update the Animation constructor signature and behavior to allow for an AnimationEffect as its first,
null by default, parameter and implement the spec behavior where an omitted AnimationTimeline parameter
should default to the document timeline. We also make the timeline property read-write.

Existing tests are rebaselined and amended for this new behavior.

* animation/WebAnimation.cpp:
(WebCore::WebAnimation::create):
(WebCore::WebAnimation::WebAnimation):
(WebCore::WebAnimation::setEffect):
(WebCore::WebAnimation::setTimeline):
* animation/WebAnimation.h:
* animation/WebAnimation.idl:

LayoutTests:

Rebaseline and amend tests to show support for the AnimationEffect first parameter to the Animation
constructor and the default document timeline value for the AnimationTimeline second parameter.

* http/wpt/web-animations/interfaces/Animation/constructor-expected.txt:
* http/wpt/web-animations/interfaces/Animation/idlharness-expected.txt:
* http/wpt/web-animations/interfaces/Animation/startTime-expected.txt:
* http/wpt/web-animations/interfaces/KeyframeEffect/setTarget-expected.txt:
* http/wpt/web-animations/timing-model/animations/current-time-expected.txt:
* http/wpt/web-animations/timing-model/animations/reversing-an-animation-expected.txt:
* http/wpt/web-animations/timing-model/animations/set-the-animation-start-time-expected.txt:
* http/wpt/web-animations/timing-model/animations/set-the-timeline-of-an-animation-expected.txt:
* http/wpt/wk-web-animations/timing-model/animation-creation-basic-expected.txt:
* http/wpt/wk-web-animations/timing-model/animation-creation-basic.html:
* http/wpt/wk-web-animations/timing-model/animation-current-time.html:
* http/wpt/wk-web-animations/timing-model/animation-playback-rate.html:
* webanimations/animation-creation-addition.html:

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

2 years agoLayout viewport rect is too wide after window resize
commit-queue@webkit.org [Tue, 31 Oct 2017 20:27:18 +0000 (20:27 +0000)]
Layout viewport rect is too wide after window resize
https://bugs.webkit.org/show_bug.cgi?id=175235

Patch by Ali Juma <ajuma@chromium.org> on 2017-10-31
Reviewed by Dave Hyatt.

Source/WebCore:

After a window resize, ScrollView::updateScrollbars adds/removes scrollbars and triggers
layout. Each addition or removal triggers another pass, but at most 2 additional passes
are allowed. If a scrollbar is added or removed in the final allowed pass, layout is
left in an inconsistent state wrt the presence of scrollbars.

To avoid unnecessary passes, don't remove both scrollbars when only one needs to be
removed. This saves the extra pass needed to add the scrollbar back.

Test: fast/dom/Window/window-resize-update-scrollbars.html

* platform/ScrollView.cpp:
(WebCore::ScrollView::updateScrollbars):

LayoutTests:

* fast/dom/Window/window-resize-update-scrollbars-expected.txt: Added.
* fast/dom/Window/window-resize-update-scrollbars.html: Added.
* platform/ios/TestExpectations:

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

2 years agoCrash in: com.apple.WebKit: WebKit::CacheStorage::Caches::initializeSize(WTF::Functi...
commit-queue@webkit.org [Tue, 31 Oct 2017 20:20:11 +0000 (20:20 +0000)]
Crash in:  com.apple.WebKit: WebKit::CacheStorage::Caches::initializeSize(WTF::Function<void (std::optional<WebCore::DOMCacheEngine::Error>&&)>&&) + 30 (CacheStorageEngineCaches.cpp:163)
https://bugs.webkit.org/show_bug.cgi?id=179037

Patch by Youenn Fablet <youenn@apple.com> on 2017-10-31
Reviewed by Chris Dumez.

Source/WebKit:

* NetworkProcess/cache/CacheStorageEngineCaches.cpp:
(WebKit::CacheStorage::Caches::initializeSize): the storage backend may be cleared when clearing caches by the UI Process.
Returning early in that case. A web application will typically fail to open a cache in this case.
On retry, the cache should be opened.

LayoutTests:

* TestExpectations: Unskipping crashing tests.

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

2 years agoAdjusted test expectations for animations/needs-layout.html.
jlewis3@apple.com [Tue, 31 Oct 2017 19:54:45 +0000 (19:54 +0000)]
Adjusted test expectations for animations/needs-layout.html.
https://bugs.webkit.org/show_bug.cgi?id=172397

Unreviewed test gardening.

* platform/ios-wk2/TestExpectations:
* platform/mac-wk1/TestExpectations:
* platform/mac-wk2/TestExpectations:

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

2 years ago[Attachment Support] Implement WKWebView SPI for inserting attachment elements
wenson_hsieh@apple.com [Tue, 31 Oct 2017 19:29:12 +0000 (19:29 +0000)]
[Attachment Support] Implement WKWebView SPI for inserting attachment elements
https://bugs.webkit.org/show_bug.cgi?id=179013
<rdar://problem/35249668>

Reviewed by Tim Horton.

Source/WebCore:

Adds Editor helper methods to insert an attachment element at the current selection.

Test: WKAttachmentTests.AttachmentElementInsertion

* editing/Editor.cpp:
(WebCore::Editor::insertAttachment):
(WebCore::Editor::insertAttachmentFromFile):
* editing/Editor.h:

Add two new helpers for inserting attachment elements, either from a filename or a data blob. This is a wrapper
around Editor::replaceSelectionWithFragment.

* html/HTMLAttachmentElement.cpp:
(WebCore::HTMLAttachmentElement::HTMLAttachmentElement):
(WebCore::HTMLAttachmentElement::create):
* html/HTMLAttachmentElement.h:

Add a unique identifier string to HTMLAttachmentElement. This unique identifier allows the UI process to
reference and indirectly manipulate attachment elements.

Source/WebCore/PAL:

Add a PAL library function to convert a file size to a human-readable string. On Cocoa platforms, this is a
wrapper around NSLocalizedFileSizeDescription; otherwise, we fall back to a naive platform-agnostic
implementation in FileSizeFormatter.cpp.

* PAL.xcodeproj/project.pbxproj:
* pal/CMakeLists.txt:
* pal/FileSizeFormatter.cpp: Added.
(fileSizeDescription):
* pal/FileSizeFormatter.h: Added.
* pal/cocoa/FileSizeFormatterCocoa.mm: Added.
(fileSizeDescription):
* pal/spi/cocoa/NSFileSizeFormatterSPI.h: Added.

Source/WebKit:

Adds native SPI to insert attachment elements given a filename, an optional MIME type, and a data blob. See
change-by-change comments below for more detail. Covered by a new API test.

* PlatformMac.cmake:
* Shared/API/APIObject.h:
* Shared/API/Cocoa/WebKitPrivate.h:
* UIProcess/API/APIAttachment.cpp: Copied from Source/WebKit/Shared/API/Cocoa/WebKitPrivate.h.
(API::Attachment::create):
(API::Attachment::Attachment):
(API::Attachment::~Attachment):

Introduce API::Attachment, which represents a platform-agnostic Attachment.

* UIProcess/API/APIAttachment.h: Copied from Source/WebKit/Shared/API/Cocoa/WebKitPrivate.h.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _insertAttachmentWithFilename:contentType:data:options:completion:]):

Adds support for inserting a new attachment element. Calls out to WebPageProxy to insert the attachment from the
given data blob, and creates a new API-object-backed _WKAttachment.

(-[WKWebView _executeEditCommand:argument:completion:]):

Support passing in a nil completion block.

* UIProcess/API/Cocoa/WKWebViewInternal.h:
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/API/Cocoa/_WKAttachment.h: Copied from Source/WebKit/Shared/API/Cocoa/WebKitPrivate.h.
* UIProcess/API/Cocoa/_WKAttachment.mm: Copied from Source/WebCore/html/HTMLAttachmentElement.h.

Introduces _WKAttachment, an Objective C wrapper around the API::Attachment.

(-[_WKAttachment _apiObject]):
(-[_WKAttachment isEqual:]):
(-[_WKAttachment uniqueIdentifier]):
(-[_WKAttachment hash]):

Add _WKAttachment, a WebKit SPI object that wraps an attachment element unique identifier. Also, allow
_WKAttachment to be used as a hashable NSDictionary key.

(-[_WKAttachment description]):
* UIProcess/API/Cocoa/_WKAttachmentInternal.h: Copied from Source/WebKit/Shared/API/Cocoa/WebKitPrivate.h.
(API::wrapper):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::insertAttachment):

Implement IPC support for inserting an attachment.

* UIProcess/WebPageProxy.h:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::insertAttachment):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:

Tools:

Adds a new API test suite to exercise attachment element insertion and manipulation.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKitCocoa/WKAttachmentTests.mm: Added.
(webViewForTestingAttachments):
(testHTMLData):
(testImageData):
(-[TestWKWebView synchronouslyInsertAttachmentWithFilename:contentType:data:options:]):
(-[TestWKWebView valueOfAttribute:forQuerySelector:]):
(TestWebKitAPI::TEST):

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

2 years agoFix custom header field setting with reloads and asynchronous navigation action polic...
commit-queue@webkit.org [Tue, 31 Oct 2017 19:21:37 +0000 (19:21 +0000)]
Fix custom header field setting with reloads and asynchronous navigation action policy decisions
https://bugs.webkit.org/show_bug.cgi?id=179064

Patch by Alex Christensen <achristensen@webkit.org> on 2017-10-31
Reviewed by Tim Horton.

Source/WebCore:

r223909 had two problems:
1. It called addHTTPHeaderField instead of setHTTPHeaderField, so when a page is reloaded the header field
is added to the resource request to be reloaded, which already had the headers added.
2. It only worked in the synchronous decidePolicyForNavigationAction code path, not for asynchronous completion handlers.

These are both fixed, and both cases are covered with new API tests.

* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::requestResource):

Source/WebKit:

* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::applyToDocumentLoader):
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::didReceivePolicyDecision):
* WebProcess/WebPage/WebFrame.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::didReceivePolicyDecision):

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/WebsitePolicies.mm:
(-[CustomHeaderFieldsDelegate _webView:decidePolicyForNavigationAction:decisionHandler:]):
(TEST):

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

2 years agoWeb Inspector: make ScriptCallStack::maxCallStackSizeToCapture the default value...
webkit@devinrousso.com [Tue, 31 Oct 2017 18:34:25 +0000 (18:34 +0000)]
Web Inspector: make ScriptCallStack::maxCallStackSizeToCapture the default value when capturing backtraces
https://bugs.webkit.org/show_bug.cgi?id=179048

Reviewed by Mark Lam.

Source/JavaScriptCore:

* inspector/ScriptCallStackFactory.h:
* inspector/ScriptCallStackFactory.cpp:
(createScriptCallStack):
(createScriptCallStackForConsole):
(createScriptCallStackFromException):

* inspector/ConsoleMessage.cpp:
(Inspector::ConsoleMessage::autogenerateMetadata):
* inspector/JSGlobalObjectInspectorController.cpp:
(Inspector::JSGlobalObjectInspectorController::reportAPIException):
* inspector/agents/InspectorConsoleAgent.cpp:
(Inspector::InspectorConsoleAgent::count):
* inspector/agents/JSGlobalObjectDebuggerAgent.cpp:
(Inspector::JSGlobalObjectDebuggerAgent::breakpointActionLog):

Source/WebCore:

No change in functionality.

* bindings/js/JSDOMExceptionHandling.cpp:
(WebCore::reportException):
* dom/RejectedPromiseTracker.cpp:
(WebCore::createScriptCallStackFromReason):
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::compileShader):
(WebCore::WebGLRenderingContextBase::printToConsole):
* inspector/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::buildInitiatorObject):
* inspector/PageDebuggerAgent.cpp:
(WebCore::PageDebuggerAgent::breakpointActionLog):
* inspector/WorkerDebuggerAgent.cpp:
(WebCore::WorkerDebuggerAgent::breakpointActionLog):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::postMessage):

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

2 years ago[GTK] Rebaseline after r224223
cturner@igalia.com [Tue, 31 Oct 2017 16:36:02 +0000 (16:36 +0000)]
[GTK] Rebaseline after r224223
https://bugs.webkit.org/show_bug.cgi?id=179059

Reviewed by Carlos Garcia Campos.

* platform/gtk/editing/selection/vertical-rl-rtl-extend-line-backward-br-expected.txt:
* platform/gtk/editing/selection/vertical-rl-rtl-extend-line-backward-p-expected.txt:
* platform/gtk/editing/selection/vertical-rl-rtl-extend-line-forward-br-expected.txt:
* platform/gtk/editing/selection/vertical-rl-rtl-extend-line-forward-p-expected.txt:
* platform/gtk/fast/css/text-overflow-ellipsis-text-align-center-expected.png:
* platform/gtk/fast/css/text-overflow-ellipsis-text-align-center-expected.txt:
* platform/gtk/fast/css/text-overflow-ellipsis-text-align-right-expected.png:
* platform/gtk/fast/css/text-overflow-ellipsis-text-align-right-expected.txt:

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

2 years ago[GTK] Test gardening
cturner@igalia.com [Tue, 31 Oct 2017 16:25:52 +0000 (16:25 +0000)]
[GTK] Test gardening
https://bugs.webkit.org/show_bug.cgi?id=179058

Unreviewed gardening.

* platform/gtk/TestExpectations:

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

2 years ago[GTK] Build more files under WebCore as unified sources
mcatanzaro@igalia.com [Tue, 31 Oct 2017 15:16:07 +0000 (15:16 +0000)]
[GTK] Build more files under WebCore as unified sources
https://bugs.webkit.org/show_bug.cgi?id=178968

Reviewed by Keith Miller.

* PlatformGTK.cmake:
* PlatformWPE.cmake:
* SourcesGTK.txt: Added.
* SourcesWPE.txt:

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

2 years agoUnreviewed. Update OptionsGTK.cmake and NEWS for 2.19.1 release.
carlosgc@webkit.org [Tue, 31 Oct 2017 15:11:12 +0000 (15:11 +0000)]
Unreviewed. Update OptionsGTK.cmake and NEWS for 2.19.1 release.

.:

* Source/cmake/OptionsGTK.cmake: Bump version numbers.

Source/WebKit:

* gtk/NEWS: Add release notes for 2.19.1.

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

2 years agoUnreviewed. Fix GTK+ make distcheck.
carlosgc@webkit.org [Tue, 31 Oct 2017 14:48:25 +0000 (14:48 +0000)]
Unreviewed. Fix GTK+ make distcheck.

Source/JavaScriptCore:

Ensure DERIVED_SOURCES_JAVASCRIPTCORE_DIR/yarr is created before scripts generating files there are run.

* CMakeLists.txt:

Source/WebKit:

Include WebCore/TextEncodingRegistry.h to ensure the forwarding header is generated.

* UIProcess/API/glib/WebKitSettings.cpp:

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

2 years agoUnreviewed, rolling out r223884.
commit-queue@webkit.org [Tue, 31 Oct 2017 14:45:50 +0000 (14:45 +0000)]
Unreviewed, rolling out r223884.
https://bugs.webkit.org/show_bug.cgi?id=179055

It broke GTK+ make distcheck (Requested by KaL on #webkit).

Reverted changeset:

"[GTK][WPE] generate-forwarding-headers.pl should also scan
derived sources in WebKit framework"
https://bugs.webkit.org/show_bug.cgi?id=178579
https://trac.webkit.org/changeset/223884

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

2 years agoLimit the number of results to be submitted in one submission.
dewei_zhu@apple.com [Tue, 31 Oct 2017 10:01:18 +0000 (10:01 +0000)]
Limit the number of results to be submitted in one submission.
https://bugs.webkit.org/show_bug.cgi?id=179045

Reviewed by Ryosuke Niwa.

Submitting results for a large number of builds with owned commit information may exceed the size limit of php.
Added a way to split the results into groups of certain sizes, and submit them one by one.

* server-tests/tools-os-build-fetcher-tests.js: Updated the unit tests.
* tools/js/os-build-fetcher.js: Added '_maxNumberOfResultsPerSubmit' which can be specified by a configuration but also use 20 as default value.
(prototype.fetchAndReportNewBuilds): Instead of submitting all results once, split them into groups and submit them one by one.
(prototype._fetchAvailableBuilds): 'label' is already quoted, should remove unnecessary quotes.
(prototype._addOwnedCommitsForBuild): Added logging to log the size of owned commits.

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

2 years agoOwnedCommitViewer should include the preceding commit.
dewei_zhu@apple.com [Tue, 31 Oct 2017 09:44:39 +0000 (09:44 +0000)]
OwnedCommitViewer should include the preceding commit.
https://bugs.webkit.org/show_bug.cgi?id=179047

Reviewed by Ryosuke Niwa.

OwnedCommitViewer shows the difference between owned commits.
To show changes made by first owned commit, we need to have the preceding commit information.

* public/v3/components/commit-log-viewer.js:
(CommitLogViewer):
(CommitLogViewer.prototype._fetchCommitLogs): Fetch preceding commit if the commits fetched is not a single commit.
(CommitLogViewer.prototype.render):
(CommitLogViewer.prototype._renderCommitList): Conditionally rendering preceding commit in commit list.

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

2 years agoUnreviewed. Fix GTK+/WPE make distcheck.
carlosgc@webkit.org [Tue, 31 Oct 2017 09:39:32 +0000 (09:39 +0000)]
Unreviewed. Fix GTK+/WPE make distcheck.

* CMakeLists.txt: Only include PerformanceTests directory to the build for GTK+ and WPE ports when developer
mode is enabled.

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

2 years agoAssert that no script is executed during LayoutPhase::InRenderTreeLayout
rniwa@webkit.org [Tue, 31 Oct 2017 08:39:38 +0000 (08:39 +0000)]
Assert that no script is executed during LayoutPhase::InRenderTreeLayout
https://bugs.webkit.org/show_bug.cgi?id=179046

Reviewed by Antti Koivisto.

Added NoEventDispatchAssertion to LayoutPhase::InRenderTreeLayout.

* page/LayoutContext.cpp:
(WebCore::LayoutContext::layout):

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

2 years agoWeb Inspector: replace Canvas stack iteration with createScriptCallStack
webkit@devinrousso.com [Tue, 31 Oct 2017 08:06:07 +0000 (08:06 +0000)]
Web Inspector: replace Canvas stack iteration with createScriptCallStack
https://bugs.webkit.org/show_bug.cgi?id=178980

Reviewed by Joseph Pecoraro.

Source/WebCore:

No new tests, updated existing tests.

* inspector/InspectorCanvas.cpp:
(WebCore::InspectorCanvas::buildObjectForCanvas):
(WebCore::InspectorCanvas::buildAction):
(WebCore::iterateCallFrames): Deleted.

LayoutTests:

* inspector/canvas/create-context-2d-expected.txt:
* inspector/canvas/create-context-webgl-expected.txt:
* inspector/canvas/create-context-webgl2-expected.txt:
* inspector/canvas/create-context-webgpu-expected.txt:
* inspector/canvas/recording-2d-expected.txt:
* inspector/canvas/recording-webgl-expected.txt:
* inspector/canvas/recording-webgl-snapshots-expected.txt:

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

2 years ago[FreeType] Simple and complex paths are not applied consistently
carlosgc@webkit.org [Tue, 31 Oct 2017 07:10:50 +0000 (07:10 +0000)]
[FreeType] Simple and complex paths are not applied consistently
https://bugs.webkit.org/show_bug.cgi?id=177601

Reviewed by Michael Catanzaro.

Due to bug #100050, when rendering text, the complex path is forced in case kerning or shaping is enabled and
only part of the run is going to be rendered. This happens in the GTK+ port when selecting text (except when
selecting the whole run, of course). The text is initially rendered using the simple path as returned by
FontCascade::codePath() and then the selection is rendered using the complex path, overriding what
FontCascade::codePath() returned in that case. This doesn't happen in mac, because the selection is rendered
differently, so FontCascade::drawText always renders the full run (simple path) when selecting text. Selecting
text is the most noticeable inconsistency, but it's not the only one. Similar exceptions are applied when
calculating the text width, or getting the offset of a given position. The rendered text is the simple one, but
the calculations are performed using the complex path, so depending on the kerning and ligatures we might end up
with wrong results. If the text has been rendered using the simple path, the selections and all other
calculations should be performed with the simple path too. This patch moves the condition to force complex text
to FontCascade::codePath(), and only for non Freetype ports. This ensures that all callers to
FontCascade::codePath() will get a consistent result.

* platform/graphics/FontCascade.cpp:
(WebCore::FontCascade::drawText const): Use the mode returned by codePath().
(WebCore::FontCascade::drawEmphasisMarks const): Ditto.
(WebCore::FontCascade::adjustSelectionRectForText const): Use the mode returned by codePath().
(WebCore::FontCascade::offsetForPosition const): Ditto.
(WebCore::FontCascade::codePath const): Force complex text for partial runs for ports not enabling advance text
rendering mode by default.
* platform/graphics/FontCascade.h: Add to and from optional parameters to codePath().

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

2 years agoUpdate safe area inset demo pages to use env()
timothy_horton@apple.com [Tue, 31 Oct 2017 03:22:18 +0000 (03:22 +0000)]
Update safe area inset demo pages to use env()
https://bugs.webkit.org/show_bug.cgi?id=179041

Reviewed by Simon Fraser.

* demos/safe-area-insets/1-default.html:
* demos/safe-area-insets/2-viewport-fit.html:
* demos/safe-area-insets/3-safe-area-constants.html:
* demos/safe-area-insets/4-min-max.html:
* demos/safe-area-insets/safe-areas.html:
Update to use env() instead of constant(), but keep constant() around
for backwards-compatibility.

Adjust the colors on the safe areas test page to look a little less holiday-like.

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

2 years agoFire updatefound event after resolving the registration promise
cdumez@apple.com [Tue, 31 Oct 2017 03:13:03 +0000 (03:13 +0000)]
Fire updatefound event after resolving the registration promise
https://bugs.webkit.org/show_bug.cgi?id=178985

Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

Rebaseline tests and land expected results for tests that are timing out.
A lot of tests are now actualling testing something instead of failing right away.

* web-platform-tests/service-workers/cache-storage/serviceworker/cache-add.https-expected.txt:
* web-platform-tests/service-workers/cache-storage/serviceworker/cache-delete.https-expected.txt:
* web-platform-tests/service-workers/cache-storage/serviceworker/cache-keys.https-expected.txt:
* web-platform-tests/service-workers/cache-storage/serviceworker/cache-match.https-expected.txt:
* web-platform-tests/service-workers/cache-storage/serviceworker/cache-matchAll.https-expected.txt:
* web-platform-tests/service-workers/cache-storage/serviceworker/cache-put.https-expected.txt:
* web-platform-tests/service-workers/cache-storage/serviceworker/cache-storage-keys.https-expected.txt:
* web-platform-tests/service-workers/cache-storage/serviceworker/cache-storage-match.https-expected.txt:
* web-platform-tests/service-workers/cache-storage/serviceworker/cache-storage.https-expected.txt:
* web-platform-tests/service-workers/cache-storage/serviceworker/credentials.https-expected.txt:
* web-platform-tests/service-workers/service-worker/ServiceWorkerGlobalScope/close.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/ServiceWorkerGlobalScope/extendable-message-event-constructor.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/ServiceWorkerGlobalScope/extendable-message-event.https-expected.txt:
* web-platform-tests/service-workers/service-worker/ServiceWorkerGlobalScope/postmessage.https-expected.txt:
* web-platform-tests/service-workers/service-worker/ServiceWorkerGlobalScope/registration-attribute.https-expected.txt:
* web-platform-tests/service-workers/service-worker/ServiceWorkerGlobalScope/service-worker-error-event.https-expected.txt:
* web-platform-tests/service-workers/service-worker/ServiceWorkerGlobalScope/unregister.https-expected.txt:
* web-platform-tests/service-workers/service-worker/ServiceWorkerGlobalScope/update.https-expected.txt:
* web-platform-tests/service-workers/service-worker/activate-event-after-install-state-change.https-expected.txt:
* web-platform-tests/service-workers/service-worker/activation-after-registration.https-expected.txt:
* web-platform-tests/service-workers/service-worker/active.https-expected.txt:
* web-platform-tests/service-workers/service-worker/appcache-ordering-main.https-expected.txt:
* web-platform-tests/service-workers/service-worker/claim-affect-other-registration.https-expected.txt:
* web-platform-tests/service-workers/service-worker/claim-fetch.https-expected.txt:
* web-platform-tests/service-workers/service-worker/claim-not-using-registration.https-expected.txt:
* web-platform-tests/service-workers/service-worker/claim-using-registration.https-expected.txt:
* web-platform-tests/service-workers/service-worker/claim-worker-fetch.https-expected.txt:
* web-platform-tests/service-workers/service-worker/client-id.https-expected.txt:
* web-platform-tests/service-workers/service-worker/client-navigate.https-expected.txt:
* web-platform-tests/service-workers/service-worker/clients-get-client-types.https-expected.txt:
* web-platform-tests/service-workers/service-worker/clients-get-cross-origin.https-expected.txt:
* web-platform-tests/service-workers/service-worker/clients-get.https-expected.txt:
* web-platform-tests/service-workers/service-worker/clients-matchall-client-types.https-expected.txt:
* web-platform-tests/service-workers/service-worker/clients-matchall-exact-controller.https-expected.txt:
* web-platform-tests/service-workers/service-worker/clients-matchall-include-uncontrolled.https-expected.txt:
* web-platform-tests/service-workers/service-worker/clients-matchall-on-evaluation.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/clients-matchall-order.https-expected.txt:
* web-platform-tests/service-workers/service-worker/clients-matchall.https-expected.txt:
* web-platform-tests/service-workers/service-worker/controller-on-disconnect.https-expected.txt:
* web-platform-tests/service-workers/service-worker/controller-on-load.https-expected.txt:
* web-platform-tests/service-workers/service-worker/controller-on-reload.https-expected.txt:
* web-platform-tests/service-workers/service-worker/extendable-event-async-waituntil.https-expected.txt:
* web-platform-tests/service-workers/service-worker/extendable-event-waituntil.https-expected.txt:
* web-platform-tests/service-workers/service-worker/fetch-canvas-tainting-cache.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/fetch-canvas-tainting.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/fetch-cors-xhr.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/fetch-csp.https-expected.txt:
* web-platform-tests/service-workers/service-worker/fetch-event-after-navigation-within-page.https-expected.txt:
* web-platform-tests/service-workers/service-worker/fetch-event-async-respond-with.https-expected.txt:
* web-platform-tests/service-workers/service-worker/fetch-event-network-error.https-expected.txt:
* web-platform-tests/service-workers/service-worker/fetch-event-redirect.https-expected.txt:
* web-platform-tests/service-workers/service-worker/fetch-event-referrer-policy.https-expected.txt:
* web-platform-tests/service-workers/service-worker/fetch-event-respond-with-argument.https-expected.txt:
* web-platform-tests/service-workers/service-worker/fetch-event-respond-with-readable-stream.https-expected.txt:
* web-platform-tests/service-workers/service-worker/fetch-event-respond-with-response-body-with-invalid-chunk.https-expected.txt:
* web-platform-tests/service-workers/service-worker/fetch-event-respond-with-stops-propagation.https-expected.txt:
* web-platform-tests/service-workers/service-worker/fetch-event-throws-after-respond-with.https-expected.txt:
* web-platform-tests/service-workers/service-worker/fetch-event-within-sw.https-expected.txt:
* web-platform-tests/service-workers/service-worker/fetch-event.https-expected.txt:
* web-platform-tests/service-workers/service-worker/fetch-frame-resource.https-expected.txt:
* web-platform-tests/service-workers/service-worker/fetch-header-visibility.https-expected.txt:
* web-platform-tests/service-workers/service-worker/fetch-mixed-content-to-inscope.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/fetch-mixed-content-to-outscope.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/fetch-request-css-base-url.https-expected.txt:
* web-platform-tests/service-workers/service-worker/fetch-request-css-cross-origin-mime-check.https-expected.txt:
* web-platform-tests/service-workers/service-worker/fetch-request-css-images.https-expected.txt:
* web-platform-tests/service-workers/service-worker/fetch-request-fallback.https-expected.txt:
* web-platform-tests/service-workers/service-worker/fetch-request-html-imports.https-expected.txt:
* web-platform-tests/service-workers/service-worker/fetch-request-no-freshness-headers.https-expected.txt:
* web-platform-tests/service-workers/service-worker/fetch-request-redirect.https-expected.txt:
* web-platform-tests/service-workers/service-worker/fetch-request-resources.https-expected.txt:
* web-platform-tests/service-workers/service-worker/fetch-request-xhr-sync.https-expected.txt:
* web-platform-tests/service-workers/service-worker/fetch-request-xhr.https-expected.txt:
* web-platform-tests/service-workers/service-worker/fetch-response-taint.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/fetch-response-xhr.https-expected.txt:
* web-platform-tests/service-workers/service-worker/fetch-waits-for-activate.https-expected.txt:
* web-platform-tests/service-workers/service-worker/foreign-fetch-basics.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/foreign-fetch-cors.https-expected.txt:
* web-platform-tests/service-workers/service-worker/foreign-fetch-event.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/foreign-fetch-workers.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/getregistrations.https-expected.txt:
* web-platform-tests/service-workers/service-worker/http-to-https-redirect-and-register.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/iframe-sandbox-register-link-element.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/immutable-prototype-serviceworker.https-expected.txt:
* web-platform-tests/service-workers/service-worker/import-scripts-redirect.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/import-scripts-updated-flag.https-expected.txt:
* web-platform-tests/service-workers/service-worker/indexeddb.https-expected.txt:
* web-platform-tests/service-workers/service-worker/install-event-type.https-expected.txt:
* web-platform-tests/service-workers/service-worker/installing.https-expected.txt:
* web-platform-tests/service-workers/service-worker/interfaces-sw.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/interfaces-window.https-expected.txt:
* web-platform-tests/service-workers/service-worker/invalid-blobtype.https-expected.txt:
* web-platform-tests/service-workers/service-worker/invalid-header.https-expected.txt:
* web-platform-tests/service-workers/service-worker/iso-latin1-header.https-expected.txt:
* web-platform-tests/service-workers/service-worker/link-element-register-basic.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/link-element-register-mime-types.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/link-element-register-scope.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/link-element-register-script-url.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/link-element-register-script.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/link-element-register-security-error.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/mime-sniffing.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/multi-globals/url-parsing.https-expected.txt:
* web-platform-tests/service-workers/service-worker/multiple-register.https-expected.txt:
* web-platform-tests/service-workers/service-worker/multiple-update.https-expected.txt:
* web-platform-tests/service-workers/service-worker/navigate-window.https-expected.txt:
* web-platform-tests/service-workers/service-worker/navigation-preload/broken-chunked-encoding.https-expected.txt:
* web-platform-tests/service-workers/service-worker/navigation-preload/chunked-encoding.https-expected.txt:
* web-platform-tests/service-workers/service-worker/navigation-preload/empty-preload-response-body.https-expected.txt:
* web-platform-tests/service-workers/service-worker/navigation-preload/get-state.https-expected.txt:
* web-platform-tests/service-workers/service-worker/navigation-preload/redirect.https-expected.txt:
* web-platform-tests/service-workers/service-worker/navigation-preload/request-headers.https-expected.txt:
* web-platform-tests/service-workers/service-worker/navigation-preload/resource-timing.https-expected.txt:
* web-platform-tests/service-workers/service-worker/navigation-redirect-body.https-expected.txt:
* web-platform-tests/service-workers/service-worker/navigation-redirect-to-http.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/navigation-redirect.https-expected.txt:
* web-platform-tests/service-workers/service-worker/onactivate-script-error.https-expected.txt:
* web-platform-tests/service-workers/service-worker/oninstall-script-error.https-expected.txt:
* web-platform-tests/service-workers/service-worker/opaque-response-preloaded.https-expected.txt:
* web-platform-tests/service-workers/service-worker/performance-timeline.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/postmessage-blob-url.https-expected.txt:
* web-platform-tests/service-workers/service-worker/postmessage-from-waiting-serviceworker.https-expected.txt:
* web-platform-tests/service-workers/service-worker/postmessage-msgport-to-client.https-expected.txt:
* web-platform-tests/service-workers/service-worker/postmessage-to-client.https-expected.txt:
* web-platform-tests/service-workers/service-worker/postmessage.https-expected.txt:
* web-platform-tests/service-workers/service-worker/ready.https-expected.txt:
* web-platform-tests/service-workers/service-worker/redirected-response.https-expected.txt:
* web-platform-tests/service-workers/service-worker/referer.https-expected.txt:
* web-platform-tests/service-workers/service-worker/referrer-policy-header.https-expected.txt:
* web-platform-tests/service-workers/service-worker/register-default-scope.https-expected.txt:
* web-platform-tests/service-workers/service-worker/register-foreign-fetch-errors.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/register-same-scope-different-script-url.https-expected.txt:
* web-platform-tests/service-workers/service-worker/register-wait-forever-in-install-worker.https-expected.txt:
* web-platform-tests/service-workers/service-worker/registration-basic.https-expected.txt:
* web-platform-tests/service-workers/service-worker/registration-end-to-end.https-expected.txt:
* web-platform-tests/service-workers/service-worker/registration-events.https-expected.txt:
* web-platform-tests/service-workers/service-worker/registration-mime-types.https-expected.txt:
* web-platform-tests/service-workers/service-worker/registration-scope.https-expected.txt:
* web-platform-tests/service-workers/service-worker/registration-script-url.https-expected.txt:
* web-platform-tests/service-workers/service-worker/registration-script.https-expected.txt:
* web-platform-tests/service-workers/service-worker/registration-security-error.https-expected.txt:
* web-platform-tests/service-workers/service-worker/registration-service-worker-attributes.https-expected.txt:
* web-platform-tests/service-workers/service-worker/registration-updateviacache.https-expected.txt:
* web-platform-tests/service-workers/service-worker/request-body-blob.https-expected.txt:
* web-platform-tests/service-workers/service-worker/request-end-to-end.https-expected.txt:
* web-platform-tests/service-workers/service-worker/resource-timing.https-expected.txt:
* web-platform-tests/service-workers/service-worker/service-worker-csp-connect.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/service-worker-csp-default.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/service-worker-csp-script.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/serviceworker-message-event-historical.https-expected.txt:
* web-platform-tests/service-workers/service-worker/serviceworkerobject-scripturl.https-expected.txt:
* web-platform-tests/service-workers/service-worker/shared-worker-controlled.https-expected.txt:
* web-platform-tests/service-workers/service-worker/skip-waiting-installed.https-expected.txt:
* web-platform-tests/service-workers/service-worker/skip-waiting-using-registration.https-expected.txt:
* web-platform-tests/service-workers/service-worker/skip-waiting-without-client.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/skip-waiting.https-expected.txt:
* web-platform-tests/service-workers/service-worker/state.https-expected.txt:
* web-platform-tests/service-workers/service-worker/synced-state.https-expected.txt:
* web-platform-tests/service-workers/service-worker/uncontrolled-page.https-expected.txt:
* web-platform-tests/service-workers/service-worker/unregister-controller.https-expected.txt:
* web-platform-tests/service-workers/service-worker/unregister-then-register-new-script.https-expected.txt:
* web-platform-tests/service-workers/service-worker/unregister-then-register.https-expected.txt:
* web-platform-tests/service-workers/service-worker/unregister.https-expected.txt:
* web-platform-tests/service-workers/service-worker/update-after-navigation-fetch-event.https-expected.txt:
* web-platform-tests/service-workers/service-worker/update-after-oneday.https-expected.txt:
* web-platform-tests/service-workers/service-worker/update-bytecheck.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/update-recovery.https-expected.txt:
* web-platform-tests/service-workers/service-worker/update.https-expected.txt:
* web-platform-tests/service-workers/service-worker/waiting.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/websocket.https-expected.txt:
* web-platform-tests/service-workers/service-worker/windowclient-navigate.https-expected.txt:
* web-platform-tests/service-workers/service-worker/worker-interception.https-expected.txt:
* web-platform-tests/service-workers/service-worker/xhr.https-expected.txt:

Source/WebCore:

Fake series of events that are supposed to happen after registering a service worker
that notify the page of the service worker's installation and activation.

Also make sure that registration.installing / waiting / active return proper values.
Make sure that serviceWorker.scriptURL returns a proper value.

This unblocks a lot of web-platform-tests since they were blocked shortly after
registration due to missing events or registration.installing being null.

* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::activeServiceWorker const):
(WebCore::ScriptExecutionContext::setActiveServiceWorker):
* dom/ScriptExecutionContext.h:
* loader/WorkerThreadableLoader.cpp:
(WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::prepareFetch):
* workers/WorkerScriptLoader.cpp:
(WebCore::WorkerScriptLoader::loadSynchronously):
(WebCore::WorkerScriptLoader::loadAsynchronously):
* workers/service/ServiceWorker.cpp:
(WebCore::ServiceWorker::ServiceWorker):
(WebCore::ServiceWorker::setState):
* workers/service/ServiceWorker.h:
* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::controller const):
(WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
(WebCore::ServiceWorkerContainer::jobResolvedWithUnregistrationResult):
* workers/service/ServiceWorkerContainer.h:
* workers/service/ServiceWorkerRegistration.cpp:
(WebCore::ServiceWorkerRegistration::ServiceWorkerRegistration):
(WebCore::ServiceWorkerRegistration::~ServiceWorkerRegistration):
(WebCore::ServiceWorkerRegistration::installing):
(WebCore::ServiceWorkerRegistration::waiting):
(WebCore::ServiceWorkerRegistration::active):
* workers/service/ServiceWorkerRegistration.h:
* workers/service/ServiceWorkerRegistrationData.cpp:
(WebCore::ServiceWorkerRegistrationData::isolatedCopy const):
* workers/service/ServiceWorkerRegistrationData.h:
(WebCore::ServiceWorkerRegistrationData::encode const):
(WebCore::ServiceWorkerRegistrationData::decode):
* workers/service/server/SWClientConnection.cpp:
(WebCore::SWClientConnection::postMessageToServiceWorkerClient):
* workers/service/server/SWServerRegistration.cpp:
(WebCore::SWServerRegistration::scriptContextStarted):
(WebCore::SWServerRegistration::runRegisterJob):
(WebCore::SWServerRegistration::data const):
* workers/service/server/SWServerRegistration.h:

LayoutTests:

Update tests that are skipped due to timing out.

* TestExpectations:

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

2 years agoWe need a storeStoreFence before storing to the instruction stream's live variable...
sbarati@apple.com [Tue, 31 Oct 2017 01:15:08 +0000 (01:15 +0000)]
We need a storeStoreFence before storing to the instruction stream's live variable catch data
https://bugs.webkit.org/show_bug.cgi?id=178649

Reviewed by Keith Miller.

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::ensureCatchLivenessIsComputedForBytecodeOffsetSlow):

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

2 years ago[iOS] Rebaseline and re-enable CSS tests
ryanhaddad@apple.com [Mon, 30 Oct 2017 23:48:21 +0000 (23:48 +0000)]
[iOS] Rebaseline and re-enable CSS tests
https://bugs.webkit.org/show_bug.cgi?id=178746

Unreviewed test gardening.

* platform/ios-simulator/TestExpectations:
* platform/ios-wk2/TestExpectations:
[ truncated ]

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

2 years agoUse LazyNeverDestroyed instead of DEFINE_GLOBAL for XMLNames, HTMLNames, MathMLNames...
commit-queue@webkit.org [Mon, 30 Oct 2017 23:41:01 +0000 (23:41 +0000)]
Use LazyNeverDestroyed instead of DEFINE_GLOBAL for XMLNames, HTMLNames, MathMLNames and SVGNames
https://bugs.webkit.org/show_bug.cgi?id=175118

Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2017-10-30
Reviewed by Alex Christensen.

Source/WebCore:

Stop using DEFINE_GLOBAL hack in favor of LazyNeverDestroyed.

No new tests since there should be no behavioral change.

* dom/make_names.pl:
(printConstructors):
(printNamesHeaderFile):
(printNamesCppFile):
(printDefinitions):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::inheritsPresentationalRole const):
* css/StyleResolver.cpp:
(WebCore::hasEffectiveDisplayNoneForDisplayContents):
* dom/CustomElementReactionQueue.cpp:
(WebCore::CustomElementReactionQueue::observesStyleAttribute const):
* dom/Document.cpp:
(WebCore::Document::validateCustomElementName):
* dom/Element.cpp:
(WebCore::isStyleAttribute):
(WebCore::canAttachAuthorShadowRoot):
* dom/ElementData.cpp:
(WebCore::ElementData::findLanguageAttribute const):
* domjit/JSDocumentDOMJIT.cpp:
(WebCore::compileDocumentBodyAttribute):
* editing/Editor.cpp:
(WebCore::Editor::applyEditingStyleToBodyElement const):
* editing/EditorCommand.cpp:
(WebCore::valueDefaultParagraphSeparator):
* editing/MarkupAccumulator.cpp:
(WebCore::MarkupAccumulator::serializeNodesWithNamespaces):
(WebCore::MarkupAccumulator::appendNamespace):
(WebCore::MarkupAccumulator::elementCannotHaveEndTag):
* editing/ReplaceSelectionCommand.cpp:
(WebCore::isProhibitedParagraphChild):
* html/HTMLBodyElement.cpp:
(WebCore::HTMLBodyElement::createWindowEventHandlerNameMap):
* html/HTMLDocument.cpp:
(WebCore::HTMLDocument::isCaseSensitiveAttribute):
* html/HTMLElement.cpp:
(WebCore::HTMLElement::createEventHandlerNameMap):
* html/parser/HTMLConstructionSite.cpp:
(WebCore::HTMLConstructionSite::findFosterSite):
* html/parser/HTMLElementStack.cpp:
(WebCore::HTMLElementStack::hasTemplateInHTMLScope const):
* html/parser/HTMLPreloadScanner.cpp:
(WebCore::TokenPreloadScanner::updatePredictedBaseURL):
* html/parser/HTMLTreeBuilder.cpp:
(WebCore::HTMLTreeBuilder::processFakePEndTagIfPInButtonScope):
(WebCore::HTMLTreeBuilder::processStartTagForInBody):
(WebCore::HTMLTreeBuilder::processTemplateEndTag):
(WebCore::HTMLTreeBuilder::processEndOfFileForInTemplateContents):
(WebCore::HTMLTreeBuilder::processStartTag):
(WebCore::HTMLTreeBuilder::processBodyEndTagForInBody):
(WebCore::HTMLTreeBuilder::processEndTagForInBody):
(WebCore::HTMLTreeBuilder::processCaptionEndTagForInCaption):
(WebCore::HTMLTreeBuilder::processTableEndTagForInTable):
(WebCore::HTMLTreeBuilder::processEndTag):
(WebCore::HTMLTreeBuilder::insertPhoneNumberLink):
(WebCore::HTMLTreeBuilder::defaultForBeforeHTML):
(WebCore::HTMLTreeBuilder::defaultForBeforeHead):
(WebCore::HTMLTreeBuilder::defaultForInHead):
(WebCore::HTMLTreeBuilder::defaultForInHeadNoscript):
(WebCore::HTMLTreeBuilder::defaultForAfterHead):
* html/parser/TextDocumentParser.cpp:
(WebCore::TextDocumentParser::insertFakePreElement):
* rendering/svg/SVGPathData.cpp:
(WebCore::pathFromGraphicsElement):
* rendering/svg/SVGResources.cpp:
(WebCore::clipperFilterMaskerTags):
(WebCore::markerTags):
(WebCore::fillAndStrokeTags):
(WebCore::chainableResourceTags):
* svg/SVGAnimatedBoolean.h:
* svg/SVGAnimatedEnumeration.h:
* svg/SVGAnimatedInteger.h:
* svg/SVGAnimatedLength.h:
* svg/SVGAnimatedLengthList.h:
* svg/SVGAnimatedNumber.h:
* svg/SVGAnimatedNumberList.h:
* svg/SVGAnimatedPreserveAspectRatio.h:
* svg/SVGAnimatedRect.h:
* svg/SVGAnimatedString.h:
* svg/SVGAnimatedTransformList.h:
* svg/SVGAnimationElement.cpp:
(WebCore::SVGAnimationElement::isSupportedAttribute):
* svg/SVGCursorElement.cpp:
(WebCore::SVGCursorElement::isSupportedAttribute):
* svg/SVGElement.cpp:
(WebCore::createAttributeNameToCSSPropertyIDMap):
(WebCore::SVGElement::childShouldCreateRenderer const):
(WebCore::SVGElement::animatableAttributeForName):
* svg/SVGFilterElement.cpp:
(WebCore::SVGFilterElement::isSupportedAttribute):
* svg/SVGFilterPrimitiveStandardAttributes.cpp:
(WebCore::SVGFilterPrimitiveStandardAttributes::isSupportedAttribute):
* svg/SVGForeignObjectElement.cpp:
(WebCore::SVGForeignObjectElement::isSupportedAttribute):
* svg/SVGGradientElement.cpp:
(WebCore::SVGGradientElement::isSupportedAttribute):
* svg/SVGImageElement.cpp:
(WebCore::SVGImageElement::isSupportedAttribute):
* svg/SVGLineElement.cpp:
(WebCore::SVGLineElement::isSupportedAttribute):
* svg/SVGMarkerElement.cpp:
(WebCore::SVGMarkerElement::isSupportedAttribute):
* svg/SVGMaskElement.cpp:
(WebCore::SVGMaskElement::isSupportedAttribute):
* svg/SVGPathElement.cpp:
(WebCore::SVGPathElement::dPropertyInfo):
(WebCore::SVGPathElement::isSupportedAttribute):
* svg/SVGPatternElement.cpp:
(WebCore::SVGPatternElement::isSupportedAttribute):
* svg/SVGPolyElement.cpp:
(WebCore::SVGPolyElement::pointsPropertyInfo):
* svg/SVGRadialGradientElement.cpp:
(WebCore::SVGRadialGradientElement::isSupportedAttribute):
* svg/SVGTextContentElement.cpp:
(WebCore::SVGTextContentElement::textLengthPropertyInfo):
(WebCore::SVGTextContentElement::isSupportedAttribute):
* svg/SVGTextPathElement.cpp:
(WebCore::SVGTextPathElement::isSupportedAttribute):
* svg/SVGUseElement.cpp:
(WebCore::createAllowedElementSet):
* xml/NativeXPathNSResolver.cpp:
(WebCore::NativeXPathNSResolver::lookupNamespaceURI):
* xml/parser/XMLDocumentParser.cpp:
(WebCore::XMLDocumentParser::parseDocumentFragment):

Source/WebKit:

* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLPrivate.cpp:
(WebKit::wrap):

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

2 years agoUnreviewed, skip cache storage WPT tests that cause flaky crashes on the bots
cdumez@apple.com [Mon, 30 Oct 2017 23:35:46 +0000 (23:35 +0000)]
Unreviewed, skip cache storage WPT tests that cause flaky crashes on the bots
https://bugs.webkit.org/show_bug.cgi?id=179035

* TestExpectations:

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

2 years agoWeb Inspector: [PARITY] Styles Redesign: Ability to modify style attributes
nvasilyev@apple.com [Mon, 30 Oct 2017 23:11:06 +0000 (23:11 +0000)]
Web Inspector: [PARITY] Styles Redesign: Ability to modify style attributes
https://bugs.webkit.org/show_bug.cgi?id=178328
<rdar://problem/35000990>

Reviewed by Joseph Pecoraro.

Source/WebInspectorUI:

Before this patch, modifying a property of a style attribute duplicated the old property
and appended the new one. This happened because WI.TextRange.prototype.resolveOffsets
didn't resolve offsets correctly when text didn't end with a trailing new line.

Since WI.TextRange.prototype.resolveOffsets is used elsewhere and this could be expected
behavior, append a line break before resolving a range.

* UserInterface/Models/CSSProperty.js:
(WI.CSSProperty.prototype._updateOwnerStyleText):

LayoutTests:

Add tests for WI.TextRange.protopyte.resolveOffsets.

* inspector/unit-tests/text-range-expected.txt: Added.
* inspector/unit-tests/text-range.html: Added.

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

2 years agoFollowup rebaseline to r224204.
jlewis3@apple.com [Mon, 30 Oct 2017 23:08:29 +0000 (23:08 +0000)]
Followup rebaseline to r224204.

Unreviewed test gardening.

* platform/mac-elcapitan-wk2/http/tests/contentextensions/make-https-expected.txt: Added.
* platform/mac-sierra-wk2/http/tests/contentextensions/make-https-expected.txt: Added.

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

2 years ago[WebGL] Optimization to skip painting if texture and source surface hasn't changed...
jer.noble@apple.com [Mon, 30 Oct 2017 22:43:56 +0000 (22:43 +0000)]
[WebGL] Optimization to skip painting if texture and source surface hasn't changed isn't working; re-optimize.
https://bugs.webkit.org/show_bug.cgi?id=178953

Reviewed by Dean Jackson.

The "seed" value of the current bound texture never matches the last saved value in
VideoTextureCopierCV::copyImageToPlatformTexture(). The value is modified by the function
itself, so a fresh value needs to be re-queried after the image's surface is attached to the
texture.

Once this fix is in, however, the <canvas> being painted will flash when no new image is
available. This is because the wrong texture target is being restored by the GC3DStateSaver
at the end of copyImageToPlatformTexture(). While we're fixing that, we may as well use the
texture state saved by the GraphicsContext3D itself to restore the correct texture unit,
texture target, and texture.

* platform/graphics/GraphicsContext3D.h:
(WebCore::GraphicsContext3D::activeTextureUnit const):
(WebCore::GraphicsContext3D::currentBoundTexture const):
(WebCore::GraphicsContext3D::currentBoundTarget const):
(WebCore::GraphicsContext3D::GraphicsContext3DState::currentBoundTexture const):
(WebCore::GraphicsContext3D::GraphicsContext3DState::boundTexture const):
(WebCore::GraphicsContext3D::GraphicsContext3DState::currentBoundTarget const):
(WebCore::GraphicsContext3D::GraphicsContext3DState::boundTarget const):
(WebCore::GraphicsContext3D::GraphicsContext3DState::currentBoundTexture): Deleted.
(WebCore::GraphicsContext3D::GraphicsContext3DState::boundTexture): Deleted.
(WebCore::GraphicsContext3D::GraphicsContext3DState::boundTarget): Deleted.
* platform/graphics/cv/VideoTextureCopierCV.cpp:
(WebCore::VideoTextureCopierCV::copyImageToPlatformTexture):
(WebCore::VideoTextureCopierCV::GC3DStateSaver::GC3DStateSaver):
(WebCore::VideoTextureCopierCV::GC3DStateSaver::~GC3DStateSaver):
* platform/graphics/cv/VideoTextureCopierCV.h:
* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
(WebCore::GraphicsContext3D::prepareTexture):
(WebCore::GraphicsContext3D::activeTexture):
(WebCore::GraphicsContext3D::bindTexture):

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

2 years agoWKBundlePageWillSendSubmitEventCallback is called with incorrect frame parameter
mcatanzaro@igalia.com [Mon, 30 Oct 2017 22:42:23 +0000 (22:42 +0000)]
WKBundlePageWillSendSubmitEventCallback is called with incorrect frame parameter
https://bugs.webkit.org/show_bug.cgi?id=176719

Reviewed by Chris Dumez.

Source/WebCore:

WKBundlePageWillSendSubmitEventCallback is clearly intended to parallel
WKBundlePageWillSubmitFormCallback, since almost all the parameters are the same. Now, in
WKBundlePageWillSubmitFormCallback, the first WKBundleFrameRef, "frame", is the frame of the
form target, and the second WKBundleFrameRef, sourceFrame, is the frame containing the form.
That's correct. But in WKBundlePageWillSendSubmitEventCallback, both frame and sourceFrame
are always identical. The problem is that the FrameLoaderClient delegate is called on the
wrong FrameLoaderClient. It should be called on the FrameLoaderClient of the target frame,
but HTMLFormElement calls it on the FrameLoaderClient of the source frame instead.

Fix this by factoring the target frame computation out of FormSubmission into some helpers.

* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::prepareForSubmission):
(WebCore::HTMLFormElement::effectiveTarget const):
(WebCore::HTMLFormElement::findSubmitButton const):
* html/HTMLFormElement.h:
* loader/FormSubmission.cpp:
(WebCore::FormSubmission::create):

Tools:

Test that WKBundlePageWillSendSubmitEventCallback is called with separate frame and
sourceFrame parameters when the target frame of the form submission is not the source frame.

* TestWebKitAPI/Tests/WebKit/WillSendSubmitEvent.cpp:
(TestWebKitAPI::didReceiveMessageFromInjectedBundle):
* TestWebKitAPI/Tests/WebKit/WillSendSubmitEvent_Bundle.cpp:
(TestWebKitAPI::willSendSubmitEvent):
* TestWebKitAPI/Tests/WebKit/auto-submitting-form.html:

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

2 years agoRebaselined imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-ontrack.https...
jlewis3@apple.com [Mon, 30 Oct 2017 22:32:13 +0000 (22:32 +0000)]
Rebaselined imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-ontrack.https.html for iOS after r224156.

Unreviewed test gardening.

* platform/ios-wk2/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-ontrack.https-expected.txt: Added.

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

2 years agoRebaselining multiple http/tests/websocket/tests/hybi/contentextensions/ test after...
jlewis3@apple.com [Mon, 30 Oct 2017 22:21:00 +0000 (22:21 +0000)]
Rebaselining multiple http/tests/websocket/tests/hybi/contentextensions/ test after r224031.

Unreviewed test gardening.

* http/tests/websocket/tests/hybi/contentextensions/upgrade-expected.txt:
* http/tests/websocket/tests/hybi/contentextensions/upgrade-worker-expected.txt:

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

2 years agoWeb Inspector: Clicking filler in data grid should clear selection
ross.kirsling@sony.com [Mon, 30 Oct 2017 22:08:01 +0000 (22:08 +0000)]
Web Inspector: Clicking filler in data grid should clear selection
https://bugs.webkit.org/show_bug.cgi?id=179027

Reviewed by Brian Burg.

* UserInterface/Views/DataGrid.js:
(WI.DataGrid.prototype._mouseDownInDataTable):

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

2 years agoASSERTION FAILED: internalValuesConsistent(m_url) in WebCore::URLParser::URLParser
achristensen@apple.com [Mon, 30 Oct 2017 21:55:28 +0000 (21:55 +0000)]
ASSERTION FAILED: internalValuesConsistent(m_url) in WebCore::URLParser::URLParser
https://bugs.webkit.org/show_bug.cgi?id=178861

Reviewed by Tim Horton.

Source/WebCore:

This is a dark corner of the URL spec that has wildly different behavior in different browsers.
The assertion fired when we have a file URL with a ? or a # after file:// and it was because
m_pathAfterLastSlash was still 0. We definitely shouldn't assert. I'm making us consistent with
other cases where we have nothing there and add an implied missing slash.

Covered by new API tests.

* platform/URLParser.cpp:
(WebCore::URLParser::parse):

Tools:

* TestWebKitAPI/Tests/WebCore/URLParser.cpp:
(TestWebKitAPI::TEST_F):

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

2 years agoCorrectly determine affinity when inserting text via Keyboard Suggestions
megan_gardner@apple.com [Mon, 30 Oct 2017 21:24:37 +0000 (21:24 +0000)]
Correctly determine affinity when inserting text via Keyboard Suggestions
https://bugs.webkit.org/show_bug.cgi?id=178969

Reviewed by Ryosuke Niwa.

Source/WebCore:

There has been talk about renaming these enums, but in the meantime we should at least have a comment
clarifying what they actually mean.

No new tests only adding a comment, no tests needed.

* editing/TextAffinity.h:

Source/WebKit:

Use the logic of VisiblePosition to correctly determine cursor affinity. We were
defaulting to upstream, but that in incorrect and resulted in hitting asserts that
we should not. This should give us the correct affinity in all cases.

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::syncApplyAutocorrection):

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

2 years agoWeb Inspector: Canvas Tab: no path components shown in recording content view after...
webkit@devinrousso.com [Mon, 30 Oct 2017 20:53:02 +0000 (20:53 +0000)]
Web Inspector: Canvas Tab: no path components shown in recording content view after selecting a recording via View Recordings... dropdown
https://bugs.webkit.org/show_bug.cgi?id=178807
<rdar://problem/35176463>

Reviewed by Brian Burg.

When the first Recording is taken of a canvas, it is immediately added as a child. When the
CanvasTreeElement is `attached`, however, it will attempt to regenerate its children if
necessary. This is especially true for canvases with ShaderPrograms, as they are added with
`addRepresentedObjectToNewChildQueue`, meaning that the child TreeElements aren't actually
added until the next tick, preventing the ContentBrowser logic from generating path
components correctly.

This patch switches to using `addChildForRepresentedObject` so that there is no delay when
adding children, and also ensures that any existing recordings are also added on regeneration.

* UserInterface/Views/CanvasTabContentView.js:
(WI.CanvasTabContentView.prototype._recordingAdded):
Move logic for adding TreeElements for new Recordings to CanvasTreeElement.

* UserInterface/Views/CanvasTreeElement.js:
(WI.CanvasTreeElement.createRecordingTreeElement):
(WI.CanvasTreeElement):
(WI.CanvasTreeElement.prototype.onattach):
(WI.CanvasTreeElement.prototype.ondetach):
(WI.CanvasTreeElement.prototype.onpopulate):
(WI.CanvasTreeElement.prototype._handleItemAdded):
(WI.CanvasTreeElement.prototype._handleItemRemoved):
(WI.CanvasTreeElement.prototype._shaderProgramAdded): Deleted.
(WI.CanvasTreeElement.prototype._shaderProgramRemoved): Deleted.

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

2 years agoCrash in addChildNodesToDeletionQueue
rniwa@webkit.org [Mon, 30 Oct 2017 20:37:37 +0000 (20:37 +0000)]
Crash in addChildNodesToDeletionQueue
https://bugs.webkit.org/show_bug.cgi?id=178974
<rdar://problem/35234372>

Reviewed by Brent Fulgham.

Source/WebCore:

The bug was caused by HTMLConstructionSite::insertTextNode constructing an ill-formed tree
when fostering parent under a template element by adjusting HTMLConstructionSiteTask's parent
without clearing nextChild. Fixed the crash by simply removing this code since executeTask
already takes care of fostering the parent in static inline insert(HTMLConstructionSiteTask&).

Test: fast/parser/foster-parent-under-template.html

* html/parser/HTMLConstructionSite.cpp:
(WebCore::HTMLConstructionSite::insertTextNode):

LayoutTests:

Add a regression test.

* fast/parser/foster-parent-inside-template-expected.txt: Added.
* fast/parser/foster-parent-inside-template.html: Added.
* resources/dump-as-markup.js:
(Markup._get): Fixed the bug that this code would always throw an exception inside a browser.

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

2 years agoUnreviewed, rolling out r224078.
commit-queue@webkit.org [Mon, 30 Oct 2017 20:31:22 +0000 (20:31 +0000)]
Unreviewed, rolling out r224078.
https://bugs.webkit.org/show_bug.cgi?id=179026

MotionMark regression (Requested by shallawa on #webkit).

Reverted changeset:

"When navigating back to a page, compositing layers may not
use accelerated drawing"
https://bugs.webkit.org/show_bug.cgi?id=178749
https://trac.webkit.org/changeset/224078

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

2 years agoEliminate Basic compiler test from RexBench
msaboff@apple.com [Mon, 30 Oct 2017 20:00:18 +0000 (20:00 +0000)]
Eliminate Basic compiler test from RexBench
https://bugs.webkit.org/show_bug.cgi?id=179025

Reviewed by Saam Barati.

* RexBench/Basic: Removed.
* RexBench/Basic/ast.js: Removed.
* RexBench/Basic/basic.js: Removed.
* RexBench/Basic/benchmark.js: Removed.
* RexBench/Basic/caseless_map.js: Removed.
* RexBench/Basic/lexer.js: Removed.
* RexBench/Basic/number.js: Removed.
* RexBench/Basic/parser.js: Removed.
* RexBench/Basic/random.js: Removed.
* RexBench/Basic/state.js: Removed.
* RexBench/Basic/stress-test.js: Removed.
* RexBench/Basic/util.js: Removed.
* RexBench/basic_benchmark.js: Removed.
* RexBench/about.html:
* RexBench/cli.js:
* RexBench/glue.js:
* RexBench/index.html:

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

2 years ago[Setting] Only expose experimental features that are compiled in
commit-queue@webkit.org [Mon, 30 Oct 2017 19:45:49 +0000 (19:45 +0000)]
[Setting] Only expose experimental features that are compiled in
https://bugs.webkit.org/show_bug.cgi?id=179023

Patch by Sam Weinig <sam@webkit.org> on 2017-10-30
Reviewed by Tim Horton.

* Scripts/PreferencesTemplates/WebPreferencesExperimentalFeatures.cpp.erb:

    Update template to conditionally expose experimental features based on their
    'condition' option in WebPreferences.yaml

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

2 years agoImplement "bitmaprenderer" CanvasRenderingContext
dino@apple.com [Mon, 30 Oct 2017 19:34:42 +0000 (19:34 +0000)]
Implement "bitmaprenderer" CanvasRenderingContext
https://bugs.webkit.org/show_bug.cgi?id=178992
<rdar://problem/34147157>

Reviewed by Sam Weinig.

LayoutTests/imported/w3c:

Update the expected results now more of the interface has
been added.

* web-platform-tests/imagebitmap-renderingcontext/bitmaprenderer-as-imagesource-expected.txt:
* web-platform-tests/imagebitmap-renderingcontext/context-creation-with-alpha-expected.txt:
* web-platform-tests/imagebitmap-renderingcontext/tranferFromImageBitmap-null-expected.txt:
* web-platform-tests/imagebitmap-renderingcontext/transferFromImageBitmap-detached-expected.txt:

Source/WebCore:

Implement the "bitmaprenderer" context for HTMLCanvasElement.
Use as much of the existing 2d context code as possible, which
means that we are painting the ImageBitmap into the backing
store. This isn't optimal, but it is good enough to get
going while we move buffer ownership from the canvas object
into the rendering contexts.

This patch raised a few issues on the HTML specification:
https://github.com/whatwg/html/issues/3164
https://github.com/whatwg/html/issues/3165
https://github.com/whatwg/html/issues/3166
https://github.com/whatwg/html/issues/3167

Update existing Web Platform Test results.

* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::createContext2d): Drive-by comment fix.
(WebCore::HTMLCanvasElement::createContextWebGL): Ditto.
(WebCore::HTMLCanvasElement::createContextWebGPU): Ditto.
(WebCore::HTMLCanvasElement::createContextBitmapRenderer): We now require
a layer/backing store for a bitmap context.
(WebCore::HTMLCanvasElement::paintsIntoCanvasBuffer const): Add bitmap-renderer
to the type of context that uses the canvas's backing store.
(WebCore::HTMLCanvasElement::createImageBuffer const): Comment fix.
(WebCore::HTMLCanvasElement::setImageBuffer const): Change parameter to a &&.
(WebCore::HTMLCanvasElement::setImageBufferAndMarkDirty): New function to set
the backing store efficiently, as well as make it look like we need to repaint
the entire canvas.
(WebCore::HTMLCanvasElement::drawingContext const): The buffer doesn't actually
need to provide a GraphicsContext if we're a bitmap renderer.
* html/HTMLCanvasElement.h:

* html/ImageBitmap.cpp:
(WebCore::ImageBitmap::transferOwnershipAndClose): New helper to give the ownership
of the ImageBuffer away, and look like close() was called.
* html/ImageBitmap.h:

* html/canvas/ImageBitmapRenderingContext.cpp: Implement the algorithm from the HTML
specification.
(WebCore::ImageBitmapRenderingContext::ImageBitmapRenderingContext):
(WebCore::ImageBitmapRenderingContext::isAccelerated const):
(WebCore::ImageBitmapRenderingContext::setOutputBitmap):
(WebCore::ImageBitmapRenderingContext::transferFromImageBitmap):
* html/canvas/ImageBitmapRenderingContext.h:
* html/canvas/ImageBitmapRenderingContext.idl:

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

2 years agoRemove flaky expectation for contentextension tests.
ryanhaddad@apple.com [Mon, 30 Oct 2017 18:44:44 +0000 (18:44 +0000)]
Remove flaky expectation for contentextension tests.
https://bugs.webkit.org/show_bug.cgi?id=162942

Unreviewed test gardening.

The underlying issue was resolved a while ago, but this expectation was not removed.

* platform/mac-wk2/TestExpectations:

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

2 years agotab-size: 0px asserts
simon.fraser@apple.com [Mon, 30 Oct 2017 18:23:24 +0000 (18:23 +0000)]
tab-size: 0px asserts
https://bugs.webkit.org/show_bug.cgi?id=176198

Reviewed by Antti Koivisto.

Don't claim to support tab-size values with units. We don't, and they would become 0, rather
than fall back to the default as should happen.

Source/WebCore:

Enhanced fast/css/tab-size.html to test.

* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeTabSize):

LayoutTests:

* fast/css/tab-size-expected.html:
* fast/css/tab-size.html:

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

2 years ago[WPE] Fix build warnings
mcatanzaro@igalia.com [Mon, 30 Oct 2017 18:21:02 +0000 (18:21 +0000)]
[WPE] Fix build warnings
https://bugs.webkit.org/show_bug.cgi?id=178899

Reviewed by Carlos Alberto Lopez Perez.

Source/JavaScriptCore:

* PlatformWPE.cmake:

Source/WebCore:

These are actually mostly cross-platform issues.

* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::arrayBufferViewElementSize):
* platform/Cairo.cmake:
* platform/Curl.cmake:
* platform/FreeType.cmake:
* platform/GCrypt.cmake:
* platform/graphics/texmap/TextureMapperShaderProgram.cpp:
(WebCore::TextureMapperShaderProgram::create):
* platform/network/soup/SoupNetworkSession.cpp:
(WebCore::SoupNetworkSession::SoupNetworkSession):

Source/WebKit:

* PlatformWPE.cmake:

Source/WTF:

* wtf/PlatformWPE.cmake:

Tools:

* TestWebKitAPI/Tests/WebKitGLib/TestDownloads.cpp:
(testContextMenuDownloadActions):
(testBlobDownload):
(beforeAll):
* TestWebKitAPI/Tests/WebKitGLib/TestResources.cpp:
* TestWebKitAPI/Tests/WebKitGLib/TestUIClient.cpp:
(testWebViewJavaScriptDialogs):
* TestWebKitAPI/Tests/WebKitGLib/TestWebExtensions.cpp:
* TestWebKitAPI/Tests/WebKitGLib/TestWebKitSettings.cpp:
* WebKitTestRunner/PlatformWPE.cmake:
* WebKitTestRunner/wpe/HeadlessViewBackend.cpp:
* WebKitTestRunner/wpe/TestControllerWPE.cpp:
(WTR::threadDefaultContext): Deleted.

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

2 years ago[Settings] Replace macro driven experimental features code with generated code
commit-queue@webkit.org [Mon, 30 Oct 2017 18:16:11 +0000 (18:16 +0000)]
[Settings] Replace macro driven experimental features code with generated code
https://bugs.webkit.org/show_bug.cgi?id=178994

Patch by Sam Weinig <sam@webkit.org> on 2017-10-30
Reviewed by Simon Fraser.

As a first step toward allowing experimental features to vary based on compile
time flags, replace the macro driven implementation of the WebPreferences part
of experimental features, with one generated from a template file.

* CMakeLists.txt:
* DerivedSources.make:
* Scripts/GeneratePreferences.rb:
* WebKit.xcodeproj/project.pbxproj:

    Generate the new template.

* Scripts/PreferencesTemplates/WebPreferencesExperimentalFeatures.cpp.erb: Added.
* UIProcess/WebPreferences.cpp:
(WebKit::createExperimentalFeaturesVector): Deleted.
(WebKit::WebPreferences::experimentalFeatures): Deleted.
(WebKit::WebPreferences::isEnabledForFeature const): Deleted.
(WebKit::WebPreferences::setEnabledForFeature): Deleted.
(WebKit::WebPreferences::enableAllExperimentalFeatures): Deleted.

    Replace macro implementation with template generated one.

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

2 years ago[WPE] Upstream or stop using cairo-egl-device-create-for-egl-surface.patch
mcatanzaro@igalia.com [Mon, 30 Oct 2017 18:13:59 +0000 (18:13 +0000)]
[WPE] Upstream or stop using cairo-egl-device-create-for-egl-surface.patch
https://bugs.webkit.org/show_bug.cgi?id=178898

Reviewed by Žan Doberšek.

This patch seems to be unused.

* wpe/jhbuild.modules:
* wpe/patches/cairo-egl-device-create-for-egl-surface.patch: Removed.

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

2 years ago[WPE] Build more files under WebCore as unified sources and get rid of WebCorePlatfor...
mcatanzaro@igalia.com [Mon, 30 Oct 2017 18:12:04 +0000 (18:12 +0000)]
[WPE] Build more files under WebCore as unified sources and get rid of WebCorePlatformWPE build target
https://bugs.webkit.org/show_bug.cgi?id=178964

Reviewed by Carlos Alberto Lopez Perez.

Source/WebCore:

This also gets rid of the WebCorePlatformWPE build target to simplify the build. It links to
all the same libraries as the WebCore target, so it doesn't seem to have any purpose. Bye.

Some CMake files under platform are not unified, either because there is not much to gain
(e.g. ImageDecoders, where everything is in a separate directory), or because it is complex
(e.g. GStreamer, where GObject implementations would be tricky to build unified), and
because we're limited to using only features declared in WebKitFeatures.cmake inside the
unified sources lists, which makes some of the platform files a bit tricky (notably,
anything that needs to go into WebCorePlatformGTK for the GTK port). So it's not perfect.

* PlatformWPE.cmake:
* SourcesWPE.txt: Added.
* crypto/gcrypt/GCryptUtilities.h:
* platform/Cairo.cmake:
* platform/GCrypt.cmake:
* platform/SourcesCairo.txt: Added.
* platform/SourcesGCrypt.txt: Added.
* platform/SourcesGLib.txt: Added.
* platform/SourcesSoup.txt: Added.

Source/WebKit:

* PlatformWPE.cmake:

Tools:

* TestWebKitAPI/PlatformWPE.cmake:

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

2 years ago[Web Animations] Rewrite homegrown tests as Web Platform tests
commit-queue@webkit.org [Mon, 30 Oct 2017 18:09:54 +0000 (18:09 +0000)]
[Web Animations] Rewrite homegrown tests as Web Platform tests
https://bugs.webkit.org/show_bug.cgi?id=179017

We rewrite all of the new homegrown Web Animations tests as Web Platorm tests,
except for one test which checks dumping of the document timeline using an
internals method which is not appropriate as a WPT.

Patch by Antoine Quint <graouts@apple.com> on 2017-10-30
Reviewed by Dean Jackson.

* http/wpt/wk-web-animations/timing-model/animation-creation-basic-expected.txt: Added.
* http/wpt/wk-web-animations/timing-model/animation-creation-basic.html: Added.
* http/wpt/wk-web-animations/timing-model/animation-current-time-expected.txt: Added.
* http/wpt/wk-web-animations/timing-model/animation-current-time.html: Added.
* http/wpt/wk-web-animations/timing-model/animation-effect-expected.txt: Added.
* http/wpt/wk-web-animations/timing-model/animation-effect-timing-expected.txt: Added.
* http/wpt/wk-web-animations/timing-model/animation-effect-timing.html: Added.
* http/wpt/wk-web-animations/timing-model/animation-effect.html: Added.
* http/wpt/wk-web-animations/timing-model/animation-interface-effect-property-expected.txt: Added.
* http/wpt/wk-web-animations/timing-model/animation-interface-effect-property.html: Added.
* http/wpt/wk-web-animations/timing-model/animation-interface-start-time-property-expected.txt: Added.
* http/wpt/wk-web-animations/timing-model/animation-interface-start-time-property.html: Added.
* http/wpt/wk-web-animations/timing-model/document-timeline-expected.txt: Added.
* http/wpt/wk-web-animations/timing-model/document-timeline.html: Added.
* http/wpt/wk-web-animations/timing-model/keyframe-effect-expected.txt: Added.
* http/wpt/wk-web-animations/timing-model/keyframe-effect-interface-timing-duration-expected.txt: Added.
* http/wpt/wk-web-animations/timing-model/keyframe-effect-interface-timing-duration.html: Added.
* http/wpt/wk-web-animations/timing-model/keyframe-effect.html: Added.
* http/wpt/wk-web-animations/timing-model/timeline-current-time-expected.txt: Added.
* http/wpt/wk-web-animations/timing-model/timeline-current-time.html: Added.
* webanimations/animation-creation-basic-expected.txt: Removed.
* webanimations/animation-creation-basic.html: Removed.
* webanimations/animation-current-time-expected.txt: Removed.
* webanimations/animation-current-time.html: Removed.
* webanimations/animation-effect-expected.txt: Removed.
* webanimations/animation-effect-timing-expected.txt: Removed.
* webanimations/animation-effect-timing.html: Removed.
* webanimations/animation-effect.html: Removed.
* webanimations/animation-interface-effect-property-expected.txt: Removed.
* webanimations/animation-interface-effect-property.html: Removed.
* webanimations/animation-interface-start-time-property-expected.txt: Removed.
* webanimations/animation-interface-start-time-property.html: Removed.
* webanimations/document-timeline-expected.txt: Removed.
* webanimations/document-timeline.html: Removed.
* webanimations/keyframe-effect-expected.txt: Removed.
* webanimations/keyframe-effect-interface-timing-duration-expected.txt: Removed.
* webanimations/keyframe-effect-interface-timing-duration.html: Removed.
* webanimations/keyframe-effect.html: Removed.
* webanimations/timeline-current-time-expected.txt: Removed.
* webanimations/timeline-current-time.html: Removed.

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

2 years agoRemove more unused ENABLE(GAMEPAD_DEPRECATED) code
mcatanzaro@igalia.com [Mon, 30 Oct 2017 18:08:21 +0000 (18:08 +0000)]
Remove more unused ENABLE(GAMEPAD_DEPRECATED) code
https://bugs.webkit.org/show_bug.cgi?id=178364

Reviewed by Carlos Alberto Lopez Perez.

* Modules/gamepad/deprecated/Gamepad.cpp: Removed.
* Modules/gamepad/deprecated/Gamepad.h: Removed.
* Modules/gamepad/deprecated/Gamepad.idl: Removed.
* Modules/gamepad/deprecated/GamepadList.cpp: Removed.
* Modules/gamepad/deprecated/GamepadList.h: Removed.
* Modules/gamepad/deprecated/GamepadList.idl: Removed.
* Modules/gamepad/deprecated/NavigatorGamepad.cpp: Removed.
* Modules/gamepad/deprecated/NavigatorGamepad.h: Removed.
* Modules/gamepad/deprecated/NavigatorGamepad.idl: Removed.

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

2 years agoUse if conditional function in DerivedSources.make to reduce duplication
dbates@webkit.org [Mon, 30 Oct 2017 17:57:38 +0000 (17:57 +0000)]
Use if conditional function in DerivedSources.make to reduce duplication
https://bugs.webkit.org/show_bug.cgi?id=178989

Reviewed by Darin Adler.

In DerivedSources.make we currently duplicate most of the Makefile recipe for generating HTML/SVG
tags and attributes to support passing the optional command line option --extraDefines when one
or more HTML/SVG compile-time features are enabled. Instead we can make use of a Makefile
conditional function in the recipe itself to avoid code duplication.

* DerivedSources.make:

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

2 years ago[Win] Rebaseline tests after r224177.
pvollan@apple.com [Mon, 30 Oct 2017 17:39:38 +0000 (17:39 +0000)]
[Win] Rebaseline tests after r224177.

Unreviewed test gardening.

* platform/win/editing/deleting/4922367-expected.txt:
* platform/win/editing/deleting/delete-at-paragraph-boundaries-004-expected.txt:
* platform/win/editing/deleting/delete-at-paragraph-boundaries-010-expected.txt:
* platform/win/editing/deleting/delete-at-paragraph-boundaries-011-expected.txt:
* platform/win/editing/deleting/delete-block-merge-contents-005-expected.txt:
* platform/win/editing/deleting/delete-block-merge-contents-006-expected.txt:
* platform/win/editing/deleting/delete-block-merge-contents-007-expected.txt:
* platform/win/editing/deleting/delete-block-merge-contents-008-expected.txt:
* platform/win/editing/deleting/delete-block-merge-contents-023-expected.txt:
* platform/win/editing/deleting/delete-block-merge-contents-024-expected.txt:
* platform/win/editing/deleting/delete-br-008-expected.txt:
* platform/win/editing/deleting/delete-br-009-expected.txt:
* platform/win/editing/deleting/delete-br-010-expected.txt:
* platform/win/editing/deleting/delete-line-015-expected.txt:
* platform/win/editing/deleting/delete-line-016-expected.txt:
* platform/win/editing/deleting/delete-line-017-expected.txt:
* platform/win/editing/deleting/merge-no-br-expected.txt:
* platform/win/editing/deleting/type-delete-after-quote-expected.txt:
* platform/win/editing/execCommand/4747450-expected.txt:
* platform/win/editing/execCommand/4916402-expected.txt:
* platform/win/editing/execCommand/4916541-expected.txt:
* platform/win/editing/execCommand/4924441-expected.txt:
* platform/win/editing/execCommand/5136770-expected.txt:
* platform/win/editing/execCommand/5142012-2-expected.txt:
* platform/win/editing/execCommand/5190926-expected.txt:
* platform/win/editing/execCommand/5481523-expected.txt:
* platform/win/editing/execCommand/create-list-with-hr-expected.txt:
* platform/win/editing/execCommand/indent-selection-expected.txt:
* platform/win/editing/execCommand/insert-list-and-stitch-expected.txt:
* platform/win/editing/execCommand/nsresponder-indent-expected.txt:
* platform/win/editing/inserting/insert-br-quoted-004-expected.txt:
* platform/win/editing/inserting/insert-br-quoted-006-expected.txt:
* platform/win/editing/style/4916887-expected.txt:
* platform/win/editing/style/5046875-1-expected.txt:
* platform/win/editing/style/5046875-2-expected.txt:
* platform/win/editing/style/5279521-expected.txt:
* platform/win/editing/style/create-block-for-style-003-expected.txt:
* platform/win/editing/style/create-block-for-style-004-expected.txt:
* platform/win/editing/style/create-block-for-style-007-expected.txt:
* platform/win/editing/style/create-block-for-style-009-expected.txt:
* platform/win/editing/style/create-block-for-style-010-expected.txt:
* platform/win/editing/style/create-block-for-style-011-expected.txt:
* platform/win/editing/style/create-block-for-style-012-expected.txt:
* platform/win/editing/style/create-block-for-style-013-expected.txt:
* platform/win/editing/style/smoosh-styles-001-expected.txt:
* platform/win/editing/style/style-boundary-005-expected.txt:
* platform/win/editing/unsupported-content/list-delete-001-expected.txt:
* platform/win/fast/forms/button-generated-content-expected.txt:
* platform/win/fast/ruby/rubyDOM-remove-text2-expected.txt:

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

2 years agoRebaselined imported/w3c/web-platform-tests/service-workers/service-worker/fetch...
jlewis3@apple.com [Mon, 30 Oct 2017 17:28:16 +0000 (17:28 +0000)]
Rebaselined imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-within-sw-manual.https.html for iOS.

Unreviewed test gardening.

* platform/ios-wk2/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-within-sw-manual.https-expected.txt: Added.

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

2 years ago[Web Animations] Add Web Platform tests
commit-queue@webkit.org [Mon, 30 Oct 2017 16:15:16 +0000 (16:15 +0000)]
[Web Animations] Add Web Platform tests
https://bugs.webkit.org/show_bug.cgi?id=178999

Patch by Antoine Quint <graouts@apple.com> on 2017-10-30
Reviewed by Sam Weinig.

The vast majority is failing, as expected due to the nascent status of our Web Animations implementation.

* http/wpt/web-animations/OWNERS: Added.
* http/wpt/web-animations/README.md: Added.
* http/wpt/web-animations/animation-model/animation-types/accumulation-per-property-expected.txt: Added.
* http/wpt/web-animations/animation-model/animation-types/accumulation-per-property.html: Added.
* http/wpt/web-animations/animation-model/animation-types/addition-per-property-expected.txt: Added.
* http/wpt/web-animations/animation-model/animation-types/addition-per-property.html: Added.
* http/wpt/web-animations/animation-model/animation-types/discrete-animation-expected.txt: Added.
* http/wpt/web-animations/animation-model/animation-types/discrete-animation.html: Added.
* http/wpt/web-animations/animation-model/animation-types/interpolation-per-property-expected.txt: Added.
* http/wpt/web-animations/animation-model/animation-types/interpolation-per-property.html: Added.
* http/wpt/web-animations/animation-model/animation-types/property-list.js: Added.
(testAnimationSamplesWithAnyOrder):
(isSupported):
(TestKeyframe.):
(TestKeyframe.get Object):
(TestKeyframe):
(get propertyToIDL):
(calcFromPercentage):
* http/wpt/web-animations/animation-model/animation-types/property-types.js: Added.
(const.discreteType.):
(const.discreteType.testInterpolation):
(const.discreteType.testAdditionOrAccumulation):
(const.discreteType.testAddition):
(const.discreteType.testAccumulation):
(const.lengthType.testInterpolation):
(const.lengthType.testAdditionOrAccumulation):
(const.lengthType.testAddition):
(const.lengthType.testAccumulation):
(const.lengthPairType.testInterpolation):
(const.lengthPairType.testAdditionOrAccumulation):
(const.lengthPairType.testAddition):
(const.lengthPairType.testAccumulation):
(const.percentageType.testInterpolation):
(const.percentageType.testAdditionOrAccumulation):
(const.percentageType.testAddition):
(const.percentageType.testAccumulation):
(const.integerType.testInterpolation):
(const.integerType.testAdditionOrAccumulation):
(const.integerType.testAddition):
(const.integerType.testAccumulation):
(const.positiveIntegerType.testInterpolation):
(const.positiveIntegerType.testAdditionOrAccumulation):
(const.positiveIntegerType.testAddition):
(const.positiveIntegerType.testAccumulation):
(const.lengthPercentageOrCalcType.testInterpolation):
(const.lengthPercentageOrCalcType.testAdditionOrAccumulation):
(const.lengthPercentageOrCalcType.testAddition):
(const.lengthPercentageOrCalcType.testAccumulation):
(const.positiveNumberType.testInterpolation):
(const.positiveNumberType.testAdditionOrAccumulation):
(const.positiveNumberType.testAddition):
(const.positiveNumberType.testAccumulation):
(const.opacityType.testInterpolation):
(const.opacityType.testAdditionOrAccumulation):
(const.opacityType.testAddition):
(const.opacityType.testAccumulation):
(const.visibilityType.testInterpolation):
(const.visibilityType.testAdditionOrAccumulation):
(const.visibilityType.testAddition):
(const.visibilityType.testAccumulation):
(const.colorType.testInterpolation):
(const.colorType.testAdditionOrAccumulation):
(const.colorType.testAddition):
(const.colorType.testAccumulation):
(const.transformListType.testInterpolation):
(const.transformListType.testAddition):
(const.transformListType.testAccumulation):
(const.filterListType.testInterpolation):
(const.filterListType.testAddition):
(const.filterListType.testAccumulation):
(const.textShadowListType.testInterpolation):
(const.textShadowListType.testAddition):
(const.textShadowListType.testAccumulation):
(const.boxShadowListType.testInterpolation):
(const.boxShadowListType.testAddition):
(const.boxShadowListType.testAccumulation):
(const.positionType.testInterpolation):
(const.positionType.testAdditionOrAccumulation):
(const.positionType.testAddition):
(const.positionType.testAccumulation):
(const.rectType.testInterpolation):
(const.rectType.testAdditionOrAccumulation):
(const.rectType.testAddition):
(const.rectType.testAccumulation):
(const.dasharrayType.testInterpolation):
(const.dasharrayType.testAdditionOrAccumulation):
(const.dasharrayType.testAddition):
(const.dasharrayType.testAccumulation):
(const.fontStretchType.testInterpolation):
(const.fontStretchType.testAdditionOrAccumulation):
(const.fontStretchType.testAddition):
(const.fontStretchType.testAccumulation):
(const.fontVariationSettingsType.testInterpolation):
(const.fontVariationSettingsType.testAdditionOrAccumulation):
(const.fontVariationSettingsType.testAddition):
(const.fontVariationSettingsType.testAccumulation):
* http/wpt/web-animations/animation-model/combining-effects/effect-composition-expected.txt: Added.
* http/wpt/web-animations/animation-model/combining-effects/effect-composition.html: Added.
* http/wpt/web-animations/animation-model/keyframe-effects/effect-value-context-expected.txt: Added.
* http/wpt/web-animations/animation-model/keyframe-effects/effect-value-context.html: Added.
* http/wpt/web-animations/animation-model/keyframe-effects/effect-value-overlapping-keyframes-expected.txt: Added.
* http/wpt/web-animations/animation-model/keyframe-effects/effect-value-overlapping-keyframes.html: Added.
* http/wpt/web-animations/animation-model/keyframe-effects/effect-value-transformed-distance-expected.txt: Added.
* http/wpt/web-animations/animation-model/keyframe-effects/effect-value-transformed-distance.html: Added.
* http/wpt/web-animations/animation-model/keyframe-effects/effect-value-visibility-expected.txt: Added.
* http/wpt/web-animations/animation-model/keyframe-effects/effect-value-visibility.html: Added.
* http/wpt/web-animations/interfaces/Animatable/animate-expected.txt: Added.
* http/wpt/web-animations/interfaces/Animatable/animate-no-browsing-context-expected.txt: Added.
* http/wpt/web-animations/interfaces/Animatable/animate-no-browsing-context.html: Added.
* http/wpt/web-animations/interfaces/Animatable/animate.html: Added.
* http/wpt/web-animations/interfaces/Animatable/getAnimations-expected.txt: Added.
* http/wpt/web-animations/interfaces/Animatable/getAnimations.html: Added.
* http/wpt/web-animations/interfaces/Animation/cancel-expected.txt: Added.
* http/wpt/web-animations/interfaces/Animation/cancel.html: Added.
* http/wpt/web-animations/interfaces/Animation/constructor-expected.txt: Added.
* http/wpt/web-animations/interfaces/Animation/constructor.html: Added.
* http/wpt/web-animations/interfaces/Animation/effect-expected.txt: Added.
* http/wpt/web-animations/interfaces/Animation/effect.html: Added.
* http/wpt/web-animations/interfaces/Animation/finish-expected.txt: Added.
* http/wpt/web-animations/interfaces/Animation/finish.html: Added.
* http/wpt/web-animations/interfaces/Animation/finished-expected.txt: Added.
* http/wpt/web-animations/interfaces/Animation/finished.html: Added.
* http/wpt/web-animations/interfaces/Animation/id-expected.txt: Added.
* http/wpt/web-animations/interfaces/Animation/id.html: Added.
* http/wpt/web-animations/interfaces/Animation/idlharness-expected.txt: Added.
* http/wpt/web-animations/interfaces/Animation/idlharness.html: Added.
* http/wpt/web-animations/interfaces/Animation/oncancel-expected.txt: Added.
* http/wpt/web-animations/interfaces/Animation/oncancel.html: Added.
* http/wpt/web-animations/interfaces/Animation/onfinish-expected.txt: Added.
* http/wpt/web-animations/interfaces/Animation/onfinish.html: Added.
* http/wpt/web-animations/interfaces/Animation/pause-expected.txt: Added.
* http/wpt/web-animations/interfaces/Animation/pause.html: Added.
* http/wpt/web-animations/interfaces/Animation/play-expected.txt: Added.
* http/wpt/web-animations/interfaces/Animation/play.html: Added.
* http/wpt/web-animations/interfaces/Animation/playState-expected.txt: Added.
* http/wpt/web-animations/interfaces/Animation/playState.html: Added.
* http/wpt/web-animations/interfaces/Animation/playbackRate-expected.txt: Added.
* http/wpt/web-animations/interfaces/Animation/playbackRate.html: Added.
* http/wpt/web-animations/interfaces/Animation/ready-expected.txt: Added.
* http/wpt/web-animations/interfaces/Animation/ready.html: Added.
* http/wpt/web-animations/interfaces/Animation/startTime-expected.txt: Added.
* http/wpt/web-animations/interfaces/Animation/startTime.html: Added.
* http/wpt/web-animations/interfaces/AnimationEffectTiming/delay-expected.txt: Added.
* http/wpt/web-animations/interfaces/AnimationEffectTiming/delay.html: Added.
* http/wpt/web-animations/interfaces/AnimationEffectTiming/direction-expected.txt: Added.
* http/wpt/web-animations/interfaces/AnimationEffectTiming/direction.html: Added.
* http/wpt/web-animations/interfaces/AnimationEffectTiming/duration-expected.txt: Added.
* http/wpt/web-animations/interfaces/AnimationEffectTiming/duration.html: Added.
* http/wpt/web-animations/interfaces/AnimationEffectTiming/easing-expected.txt: Added.
* http/wpt/web-animations/interfaces/AnimationEffectTiming/easing.html: Added.
* http/wpt/web-animations/interfaces/AnimationEffectTiming/endDelay-expected.txt: Added.
* http/wpt/web-animations/interfaces/AnimationEffectTiming/endDelay.html: Added.
* http/wpt/web-animations/interfaces/AnimationEffectTiming/fill-expected.txt: Added.
* http/wpt/web-animations/interfaces/AnimationEffectTiming/fill.html: Added.
* http/wpt/web-animations/interfaces/AnimationEffectTiming/getAnimations-expected.txt: Added.
* http/wpt/web-animations/interfaces/AnimationEffectTiming/getAnimations.html: Added.
* http/wpt/web-animations/interfaces/AnimationEffectTiming/getComputedStyle-expected.txt: Added.
* http/wpt/web-animations/interfaces/AnimationEffectTiming/getComputedStyle.html: Added.
* http/wpt/web-animations/interfaces/AnimationEffectTiming/iterationStart-expected.txt: Added.
* http/wpt/web-animations/interfaces/AnimationEffectTiming/iterationStart.html: Added.
* http/wpt/web-animations/interfaces/AnimationEffectTiming/iterations-expected.txt: Added.
* http/wpt/web-animations/interfaces/AnimationEffectTiming/iterations.html: Added.
* http/wpt/web-animations/interfaces/AnimationTimeline/document-timeline-expected.txt: Added.
* http/wpt/web-animations/interfaces/AnimationTimeline/document-timeline.html: Added.
* http/wpt/web-animations/interfaces/AnimationTimeline/idlharness-expected.txt: Added.
* http/wpt/web-animations/interfaces/AnimationTimeline/idlharness.html: Added.
* http/wpt/web-animations/interfaces/Document/getAnimations-expected.txt: Added.
* http/wpt/web-animations/interfaces/Document/getAnimations.html: Added.
* http/wpt/web-animations/interfaces/DocumentTimeline/constructor-expected.txt: Added.
* http/wpt/web-animations/interfaces/DocumentTimeline/constructor.html: Added.
* http/wpt/web-animations/interfaces/KeyframeEffect/composite-expected.txt: Added.
* http/wpt/web-animations/interfaces/KeyframeEffect/composite.html: Added.
* http/wpt/web-animations/interfaces/KeyframeEffect/constructor-expected.txt: Added.
* http/wpt/web-animations/interfaces/KeyframeEffect/constructor.html: Added.
* http/wpt/web-animations/interfaces/KeyframeEffect/copy-constructor-expected.txt: Added.
* http/wpt/web-animations/interfaces/KeyframeEffect/copy-constructor.html: Added.
* http/wpt/web-animations/interfaces/KeyframeEffect/getComputedTiming-expected.txt: Added.
* http/wpt/web-animations/interfaces/KeyframeEffect/getComputedTiming.html: Added.
* http/wpt/web-animations/interfaces/KeyframeEffect/iterationComposite-expected.txt: Added.
* http/wpt/web-animations/interfaces/KeyframeEffect/iterationComposite.html: Added.
* http/wpt/web-animations/interfaces/KeyframeEffect/processing-a-keyframes-argument-001-expected.txt: Added.
* http/wpt/web-animations/interfaces/KeyframeEffect/processing-a-keyframes-argument-001.html: Added.
* http/wpt/web-animations/interfaces/KeyframeEffect/processing-a-keyframes-argument-002-expected.txt: Added.
* http/wpt/web-animations/interfaces/KeyframeEffect/processing-a-keyframes-argument-002.html: Added.
* http/wpt/web-animations/interfaces/KeyframeEffect/setKeyframes-expected.txt: Added.
* http/wpt/web-animations/interfaces/KeyframeEffect/setKeyframes.html: Added.
* http/wpt/web-animations/interfaces/KeyframeEffect/setTarget-expected.txt: Added.
* http/wpt/web-animations/interfaces/KeyframeEffect/setTarget.html: Added.
* http/wpt/web-animations/interfaces/KeyframeEffectReadOnly/copy-constructor-expected.txt: Added.
* http/wpt/web-animations/interfaces/KeyframeEffectReadOnly/copy-constructor.html: Added.
* http/wpt/web-animations/resources/easing-tests.js: Added.
(easingFunction.stepStart):
(easingFunction.stepEnd):
(easingFunction.framesTiming):
(easingFunction.cubicBezier):
* http/wpt/web-animations/resources/effect-tests.js: Added.
(assert_computed_timing_for_each_phase):
* http/wpt/web-animations/resources/keyframe-utils.js: Added.
(assert_frame_lists_equal):
(assert_frames_equal):
* http/wpt/web-animations/resources/xhr-doc.py: Added.
(main):
* http/wpt/web-animations/testcommon.js: Added.
(window.assert_times_equal.window.assert_times_equal):
(createDiv):
(createElement):
(createStyle):
(createPseudo):
(xForT):
(yForT):
(tForX):
(return.bezierClosure):
(cubicBezier):
(stepEnd.return.stepEndClosure):
(stepEnd):
(stepStart.return.stepStartClosure):
(stepStart):
(framesTiming.return.framesClosure):
(framesTiming):
(waitForAnimationFrames):
(rotate3dToMatrix3d):
(rotate3dToMatrix):
(assert_matrix_equals):
* http/wpt/web-animations/timing-model/animation-effects/active-time-expected.txt: Added.
* http/wpt/web-animations/timing-model/animation-effects/active-time.html: Added.
* http/wpt/web-animations/timing-model/animation-effects/current-iteration-expected.txt: Added.
* http/wpt/web-animations/timing-model/animation-effects/current-iteration.html: Added.
* http/wpt/web-animations/timing-model/animation-effects/local-time-expected.txt: Added.
* http/wpt/web-animations/timing-model/animation-effects/local-time.html: Added.
* http/wpt/web-animations/timing-model/animation-effects/phases-and-states-expected.txt: Added.
* http/wpt/web-animations/timing-model/animation-effects/phases-and-states.html: Added.
* http/wpt/web-animations/timing-model/animation-effects/simple-iteration-progress-expected.txt: Added.
* http/wpt/web-animations/timing-model/animation-effects/simple-iteration-progress.html: Added.
* http/wpt/web-animations/timing-model/animations/canceling-an-animation-expected.txt: Added.
* http/wpt/web-animations/timing-model/animations/canceling-an-animation.html: Added.
* http/wpt/web-animations/timing-model/animations/current-time-expected.txt: Added.
* http/wpt/web-animations/timing-model/animations/current-time.html: Added.
* http/wpt/web-animations/timing-model/animations/finishing-an-animation-expected.txt: Added.
* http/wpt/web-animations/timing-model/animations/finishing-an-animation.html: Added.
* http/wpt/web-animations/timing-model/animations/pausing-an-animation-expected.txt: Added.
* http/wpt/web-animations/timing-model/animations/pausing-an-animation.html: Added.
* http/wpt/web-animations/timing-model/animations/playing-an-animation-expected.txt: Added.
* http/wpt/web-animations/timing-model/animations/playing-an-animation.html: Added.
* http/wpt/web-animations/timing-model/animations/reversing-an-animation-expected.txt: Added.
* http/wpt/web-animations/timing-model/animations/reversing-an-animation.html: Added.
* http/wpt/web-animations/timing-model/animations/set-the-animation-start-time-expected.txt: Added.
* http/wpt/web-animations/timing-model/animations/set-the-animation-start-time.html: Added.
* http/wpt/web-animations/timing-model/animations/set-the-target-effect-of-an-animation-expected.txt: Added.
* http/wpt/web-animations/timing-model/animations/set-the-target-effect-of-an-animation.html: Added.
* http/wpt/web-animations/timing-model/animations/set-the-timeline-of-an-animation-expected.txt: Added.
* http/wpt/web-animations/timing-model/animations/set-the-timeline-of-an-animation.html: Added.
* http/wpt/web-animations/timing-model/animations/updating-the-finished-state-expected.txt: Added.
* http/wpt/web-animations/timing-model/animations/updating-the-finished-state.html: Added.
* http/wpt/web-animations/timing-model/time-transformations/transformed-progress-expected.txt: Added.
* http/wpt/web-animations/timing-model/time-transformations/transformed-progress.html: Added.

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

2 years ago[Web Animations] Expose the playbackRate property on Animation
graouts@webkit.org [Mon, 30 Oct 2017 15:09:02 +0000 (15:09 +0000)]
[Web Animations] Expose the playbackRate property on Animation
https://bugs.webkit.org/show_bug.cgi?id=178931

Reviewed by Sam Weinig.

Source/WebCore:

Account for the playback rate when computing and setting an animation's
current time, ensuring that we adjust the start time to preserve the
current time when setting a new playback rate.

Test: http/wpt/wk-web-animations/timing-model/animation-playback-rate.html

* animation/WebAnimation.cpp:
(WebCore::WebAnimation::WebAnimation):
(WebCore::WebAnimation::currentTime const):
(WebCore::WebAnimation::setCurrentTime):
(WebCore::WebAnimation::setPlaybackRate):
* animation/WebAnimation.h:
* animation/WebAnimation.idl:

LayoutTests:

Add a new test, using WPT, to check that the playbackRate property is accounted
for when getting and setting the current time.

* http/wpt/wk-web-animations/timing-model/animation-playback-rate-expected.txt: Added.
* http/wpt/wk-web-animations/timing-model/animation-playback-rate.html: Added.

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