WebKit-https.git
3 years agoSearch events should not fire synchronously for search type input elements with incre...
jiewen_tan@apple.com [Mon, 8 May 2017 19:17:29 +0000 (19:17 +0000)]
Search events should not fire synchronously for search type input elements with incremental attribute set
https://bugs.webkit.org/show_bug.cgi?id=171376
<rdar://problem/31863296>

Reviewed by Chris Dumez.

Source/WebCore:

For some reasons, we fire search events immediately for search type input elements with incremental
attribute set only when the length of the input equals to zero. This behaviour should be prevented
as event listeners in the middle might perform unexpectedly.

Test: fast/forms/search/search-incremental-crash.html

* html/SearchInputType.cpp:
(WebCore::SearchInputType::startSearchEventTimer):

LayoutTests:

* fast/forms/search/search-incremental-crash-expected.txt: Added.
* fast/forms/search/search-incremental-crash.html: Added.

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

3 years agoClean UserMediaCaptureManager::capabilities return value
commit-queue@webkit.org [Mon, 8 May 2017 18:58:09 +0000 (18:58 +0000)]
Clean UserMediaCaptureManager::capabilities return value
https://bugs.webkit.org/show_bug.cgi?id=171808

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

* WebProcess/cocoa/UserMediaCaptureManager.cpp:
(WebKit::UserMediaCaptureManager::capabilities):
* WebProcess/cocoa/UserMediaCaptureManager.h:

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

3 years agoText overlaps on http://www.duden.de/rechtschreibung/Acre
zalan@apple.com [Mon, 8 May 2017 18:38:20 +0000 (18:38 +0000)]
Text overlaps on www.duden.de/rechtschreibung/Acre
https://bugs.webkit.org/show_bug.cgi?id=171796
<rdar://problem/31036028>

Reviewed by Simon Fraser.

Source/WebCore:

Simple line layout pre-measures space using the primary font,
even if the space glyph requires a fallback font (and even if the string does not have a space in it at all).
When this width gets cached (see WidthCache) we might end up using it later during normal line layout and
it could produce incorrect layout.
This patch removes the space width caching from Simple line layout, since Font already caches it.

Test: fast/text/simple-line-layout-fallback-space-glyph.html

* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::createLineRuns):
* rendering/SimpleLineLayoutTextFragmentIterator.cpp:
(WebCore::SimpleLineLayout::TextFragmentIterator::Style::Style):
(WebCore::SimpleLineLayout::TextFragmentIterator::skipToNextPosition):
(WebCore::SimpleLineLayout::TextFragmentIterator::textWidth):
* rendering/SimpleLineLayoutTextFragmentIterator.h:

LayoutTests:

* fast/text/simple-line-layout-fallback-space-glyph-expected.html: Added.
* fast/text/simple-line-layout-fallback-space-glyph.html: Added.

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

3 years agoRefactor ImageInputType::width() / height() for clarity
cdumez@apple.com [Mon, 8 May 2017 18:28:23 +0000 (18:28 +0000)]
Refactor ImageInputType::width() / height() for clarity
https://bugs.webkit.org/show_bug.cgi?id=171810

Reviewed by Zalan Bujtas.

Refactor ImageInputType::width() / height() for clarity.

* html/ImageInputType.cpp:
(WebCore::ImageInputType::height):
(WebCore::ImageInputType::width):

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

3 years agoBail out of simple line layout when hyphen needs a fallback font.
zalan@apple.com [Mon, 8 May 2017 18:19:31 +0000 (18:19 +0000)]
Bail out of simple line layout when hyphen needs a fallback font.
https://bugs.webkit.org/show_bug.cgi?id=171811

Reviewed by Antti Koivisto.

With hyphen: auto is set, we don't know if the hypen string is going to be used, until
after we started laying out the content and figured that the text overflows the line.
However it's too late to bail out of simple line layout at this point, so let's just
pre-check if the hyphen string needs a fallback font.

* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::canUseForStyle):

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

3 years agoREGRESSION(r216179): [GTK] Script install-dependencies misses liborc
clopez@igalia.com [Mon, 8 May 2017 18:13:52 +0000 (18:13 +0000)]
REGRESSION(r216179): [GTK] Script install-dependencies misses liborc
https://bugs.webkit.org/show_bug.cgi?id=171681

Reviewed by Carlos Garcia Campos.

* gtk/install-dependencies:

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

3 years agoTURNS gathering is not working properly
commit-queue@webkit.org [Mon, 8 May 2017 17:39:37 +0000 (17:39 +0000)]
TURNS gathering is not working properly
https://bugs.webkit.org/show_bug.cgi?id=171747

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

Source/ThirdParty/libwebrtc:

* Source/webrtc/base/openssladapter.cc: Adding support for SNI in case of TLS ice candidate gathering.

Source/WebCore:

Covered by manual tests.

* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::configurationFromMediaEndpointConfiguration): Reveting TURNS ice server skipping.

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

3 years agoUnreviewed, rolling out r216419.
mcatanzaro@igalia.com [Mon, 8 May 2017 17:36:42 +0000 (17:36 +0000)]
Unreviewed, rolling out r216419.

Broke 70 layout tests on GTK bot

Reverted changeset:

"Ensure clean tree before AX cache update."
https://bugs.webkit.org/show_bug.cgi?id=171546
http://trac.webkit.org/changeset/216419

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

3 years agoCoreAudioCaptureSource should not modify its shared unit if already started/stopped
commit-queue@webkit.org [Mon, 8 May 2017 17:31:54 +0000 (17:31 +0000)]
CoreAudioCaptureSource should not modify its shared unit if already started/stopped
https://bugs.webkit.org/show_bug.cgi?id=171804

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

Manual testing only since CoreAudioSharedUnit is not mocked.

* platform/mediastream/mac/CoreAudioCaptureSource.cpp:
(WebCore::CoreAudioCaptureSource::startProducingData): Exit early if source is already started.
(WebCore::CoreAudioCaptureSource::stopProducingData): Exit early if source is already stopped.

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

3 years agoComposedTreeIterator does not traverse all slotted children if the traversal root...
antti@apple.com [Mon, 8 May 2017 17:20:54 +0000 (17:20 +0000)]
ComposedTreeIterator does not traverse all slotted children if the traversal root is a slot element.
https://bugs.webkit.org/show_bug.cgi?id=171375
<rdar://problem/31863184>

Reviewed by Zalan Bujtas.

Source/WebCore:

We were hitting an assert when using details element with a flow thread. The root cause for this turned
out to be that we only traversed the first slotted child if the traversal root was a slot element.

Test: fast/html/details-flow-thread.html

* dom/ComposedTreeIterator.cpp:
(WebCore::ComposedTreeIterator::traverseNextLeavingContext):

    Try to traverse to the next slotted child before testing if we at the end of the current context.

LayoutTests:

* fast/html/details-flow-thread-expected.txt: Added.
* fast/html/details-flow-thread.html: Added.
* fast/shadow-dom/composed-tree-slots-expected.txt:
* fast/shadow-dom/composed-tree-slots.html:

    Expand the test so it also prints out slot subtrees using slots as traversal roots.

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

3 years agoWebAssembly: don't just emit extended offset adds for patch
jfbastien@apple.com [Mon, 8 May 2017 17:06:29 +0000 (17:06 +0000)]
WebAssembly: don't just emit extended offset adds for patch
https://bugs.webkit.org/show_bug.cgi?id=171799

Reviewed by Mark Lam.

It isn't necessary to restrict.

* b3/air/AirLowerStackArgs.cpp:
(JSC::B3::Air::lowerStackArgs):

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

3 years agoIntroduce ExceptionScope::assertNoException() and releaseAssertNoException().
mark.lam@apple.com [Mon, 8 May 2017 16:56:32 +0000 (16:56 +0000)]
Introduce ExceptionScope::assertNoException() and releaseAssertNoException().
https://bugs.webkit.org/show_bug.cgi?id=171776

Reviewed by Keith Miller.

Source/JavaScriptCore:

Instead of ASSERT(!scope.exception()), we can now do scope.assertNoException().
Ditto for RELEASE_ASSERT and scope.releaseAssertNoException().

The advantage of using ExceptionScope::assertNoException() and
releaseAssertNoException() is that if the assertion fails, these utility
functions will print the stack trace for where the unexpected exception is
detected as well as where the unexpected exception was thrown from.  This makes
it much easier to debug the source of unhandled exceptions.

* debugger/Debugger.cpp:
(JSC::Debugger::pauseIfNeeded):
* dfg/DFGOperations.cpp:
* interpreter/Interpreter.cpp:
(JSC::eval):
(JSC::notifyDebuggerOfUnwinding):
(JSC::Interpreter::executeProgram):
(JSC::Interpreter::executeCall):
(JSC::Interpreter::executeConstruct):
(JSC::Interpreter::prepareForRepeatCall):
(JSC::Interpreter::execute):
(JSC::Interpreter::debug):
* interpreter/ShadowChicken.cpp:
(JSC::ShadowChicken::functionsOnStack):
* jsc.cpp:
(GlobalObject::moduleLoaderResolve):
(GlobalObject::moduleLoaderFetch):
(functionGenerateHeapSnapshot):
(functionSamplingProfilerStackTraces):
(box):
(runWithScripts):
* runtime/AbstractModuleRecord.cpp:
(JSC::AbstractModuleRecord::finishCreation):
* runtime/ArrayPrototype.cpp:
(JSC::ArrayPrototype::tryInitializeSpeciesWatchpoint):
* runtime/Completion.cpp:
(JSC::rejectPromise):
* runtime/ErrorInstance.cpp:
(JSC::ErrorInstance::sanitizedToString):
* runtime/ExceptionHelpers.cpp:
(JSC::createError):
* runtime/ExceptionScope.cpp:
(JSC::ExceptionScope::unexpectedExceptionMessage):
* runtime/ExceptionScope.h:
(JSC::ExceptionScope::assertNoException):
(JSC::ExceptionScope::releaseAssertNoException):
(JSC::ExceptionScope::unexpectedExceptionMessage):
* runtime/GenericArgumentsInlines.h:
(JSC::GenericArguments<Type>::defineOwnProperty):
* runtime/IntlCollator.cpp:
(JSC::IntlCollator::createCollator):
(JSC::IntlCollator::resolvedOptions):
* runtime/IntlDateTimeFormat.cpp:
(JSC::IntlDateTimeFormat::resolvedOptions):
(JSC::IntlDateTimeFormat::format):
* runtime/IntlNumberFormat.cpp:
(JSC::IntlNumberFormat::createNumberFormat):
(JSC::IntlNumberFormat::resolvedOptions):
* runtime/JSCJSValue.cpp:
(JSC::JSValue::putToPrimitiveByIndex):
* runtime/JSGenericTypedArrayViewPrototypeFunctions.h:
(JSC::genericTypedArrayViewProtoFuncIncludes):
(JSC::genericTypedArrayViewProtoFuncIndexOf):
(JSC::genericTypedArrayViewProtoFuncLastIndexOf):
(JSC::genericTypedArrayViewPrivateFuncSubarrayCreate):
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
* runtime/JSGlobalObjectFunctions.cpp:
(JSC::globalFuncHostPromiseRejectionTracker):
* runtime/JSModuleEnvironment.cpp:
(JSC::JSModuleEnvironment::getOwnPropertySlot):
* runtime/JSModuleLoader.cpp:
(JSC::JSModuleLoader::finishCreation):
* runtime/JSModuleNamespaceObject.cpp:
(JSC::JSModuleNamespaceObject::finishCreation):
* runtime/JSONObject.cpp:
(JSC::Stringifier::toJSON):
* runtime/JSObject.cpp:
(JSC::JSObject::ordinaryToPrimitive):
* runtime/JSPropertyNameEnumerator.h:
(JSC::propertyNameEnumerator):
* runtime/ObjectConstructor.cpp:
(JSC::objectConstructorGetOwnPropertyDescriptors):
(JSC::objectConstructorDefineProperty):
* runtime/ObjectPrototype.cpp:
(JSC::objectProtoFuncHasOwnProperty):
* runtime/ProgramExecutable.cpp:
(JSC::ProgramExecutable::initializeGlobalProperties):
* runtime/ReflectObject.cpp:
(JSC::reflectObjectDefineProperty):
* runtime/SamplingProfiler.cpp:
(JSC::SamplingProfiler::StackFrame::nameFromCallee):
* runtime/StringPrototype.cpp:
(JSC::stringProtoFuncRepeatCharacter):
* runtime/TemplateRegistry.cpp:
(JSC::TemplateRegistry::getTemplateObject):
* runtime/VM.cpp:
(JSC::VM::throwException):
* runtime/VM.h:
(JSC::VM::nativeStackTraceOfLastThrow):
(JSC::VM::clearException):
* wasm/WasmB3IRGenerator.cpp:
* wasm/js/JSWebAssemblyInstance.cpp:
(JSC::JSWebAssemblyInstance::create):

Source/WebCore:

No new tests because there's no behavior change in functionality.  We're only
refactoring the code to use the new assertion utility function.

* Modules/plugins/QuickTimePluginReplacement.mm:
(WebCore::QuickTimePluginReplacement::installReplacement):
* bindings/js/JSCryptoKeySerializationJWK.cpp:
(WebCore::getJSArrayFromJSON):
(WebCore::getStringFromJSON):
(WebCore::getBooleanFromJSON):
* bindings/js/JSCustomElementRegistryCustom.cpp:
(WebCore::JSCustomElementRegistry::whenDefined):
* bindings/js/JSDOMExceptionHandling.cpp:
(WebCore::propagateExceptionSlowPath):
(WebCore::throwNotSupportedError):
(WebCore::throwInvalidStateError):
(WebCore::throwSecurityError):
(WebCore::throwDOMSyntaxError):
(WebCore::throwDataCloneError):
(WebCore::throwIndexSizeError):
(WebCore::throwTypeMismatchError):
* bindings/js/JSDOMGlobalObject.cpp:
(WebCore::makeThisTypeErrorForBuiltins):
(WebCore::makeGetterTypeErrorForBuiltins):
* bindings/js/JSDOMGlobalObjectTask.cpp:
* bindings/js/JSDOMPromise.h:
(WebCore::callPromiseFunction):
* bindings/js/JSDOMWindowBase.cpp:
(WebCore::JSDOMWindowMicrotaskCallback::call):
* bindings/js/JSMainThreadExecState.h:
(WebCore::JSMainThreadExecState::~JSMainThreadExecState):
* bindings/js/ReadableStreamDefaultController.cpp:
(WebCore::ReadableStreamDefaultController::isControlledReadableStreamLocked):
* bindings/js/ReadableStreamDefaultController.h:
(WebCore::ReadableStreamDefaultController::enqueue):
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneDeserializer::readTerminal):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateSerializerFunction):
* bindings/scripts/test/JS/JSTestNode.cpp:
(WebCore::JSTestNode::serialize):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::JSTestObj::serialize):
* bindings/scripts/test/JS/JSTestSerialization.cpp:
(WebCore::JSTestSerialization::serialize):
* bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
(WebCore::JSTestSerializationInherit::serialize):
* bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
(WebCore::JSTestSerializationInheritFinal::serialize):
* contentextensions/ContentExtensionParser.cpp:
(WebCore::ContentExtensions::getTypeFlags):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::didAddUserAgentShadowRoot):
(WebCore::HTMLMediaElement::updateMediaControlsAfterPresentationModeChange):
(WebCore::HTMLMediaElement::getCurrentMediaControlsStatus):
* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::didAddUserAgentShadowRoot):

Source/WTF:

1. Add an option to skip some number of top frames when capturing the StackTrace.
2. Add an option to use an indentation string when dumping the StackTrace.

* wtf/StackTrace.cpp:
(WTF::StackTrace::captureStackTrace):
(WTF::StackTrace::dump):
* wtf/StackTrace.h:

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

3 years agoUnreviewed. Fix GTK+ test /webkit2/WebKitConsoleMessage/network-error after r215556.
carlosgc@webkit.org [Mon, 8 May 2017 16:55:31 +0000 (16:55 +0000)]
Unreviewed. Fix GTK+ test /webkit2/WebKitConsoleMessage/network-error after r215556.

Glib uses now Unicode quotes in error messages.

* TestWebKitAPI/Tests/WebKit2Gtk/TestConsoleMessage.cpp:
(testWebKitConsoleMessageNetworkError):

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

3 years agoMove 'style' from Element to HTMLElement / SVGElement and make it settable
cdumez@apple.com [Mon, 8 May 2017 16:50:46 +0000 (16:50 +0000)]
Move 'style' from Element to HTMLElement / SVGElement and make it settable
https://bugs.webkit.org/show_bug.cgi?id=171795

Reviewed by Alex Christensen.

Source/WebCore:

Move 'style' from Element to HTMLElement / SVGElement and make it settable
as per:
- https://drafts.csswg.org/cssom/#the-elementcssinlinestyle-interface

Both Firefox and Chrome already match the specification (both for the
property location and having it settable).

Test: fast/css/Element-style.html

* CMakeLists.txt:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* css/ElementCSSInlineStyle.idl: Added.
* css/PropertySetCSSStyleDeclaration.h:
* css/StyleProperties.cpp:
(WebCore::MutableStyleProperties::ensureCSSStyleDeclaration):
(WebCore::MutableStyleProperties::ensureInlineCSSStyleDeclaration):
* css/StyleProperties.h:
* dom/Attr.cpp:
(WebCore::Attr::style):
* dom/Document.cpp:
(WebCore::Document::createCSSStyleDeclaration):
* dom/Element.cpp:
* dom/Element.h:
* dom/Element.idl:
* dom/StyledElement.cpp:
(WebCore::StyledElement::cssomStyle):
* dom/StyledElement.h:
* editing/Editor.cpp:
(WebCore::Editor::applyEditingStyleToElement):
* editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline):
* html/HTMLElement.idl:

* html/ImageInputType.cpp:
(WebCore::ImageInputType::height):
(WebCore::ImageInputType::width):
Fix bug that was found by fast/forms/input-width-height-attributes-without-renderer-loaded-image.html.
That test relied on setting HTMLElement.style which did not work until now. Call updateLayout()
*before* doing the renderer check.

* inspector/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::getMatchedStylesForNode):
(WebCore::InspectorCSSAgent::getInlineStylesForNode):
(WebCore::InspectorCSSAgent::getComputedStyleForNode):
(WebCore::InspectorCSSAgent::asInspectorStyleSheet):
(WebCore::InspectorCSSAgent::buildObjectForAttributesStyle):
* inspector/InspectorCSSAgent.h:
* inspector/InspectorStyleSheet.cpp:
(WebCore::InspectorStyle::create):
(WebCore::InspectorStyle::InspectorStyle):
(WebCore::InspectorStyle::extractSourceData):
(WebCore::InspectorStyle::setText):
(WebCore::InspectorStyleSheet::inspectorStyleForId):
(WebCore::InspectorStyleSheetForInlineStyle::create):
(WebCore::InspectorStyleSheetForInlineStyle::InspectorStyleSheetForInlineStyle):
(WebCore::InspectorStyleSheetForInlineStyle::didModifyElementAttribute):
(WebCore::InspectorStyleSheetForInlineStyle::setStyleText):
(WebCore::InspectorStyleSheetForInlineStyle::ensureParsedDataReady):
(WebCore::InspectorStyleSheetForInlineStyle::inlineStyle):
* inspector/InspectorStyleSheet.h:
* svg/SVGElement.idl:

Source/WebKit/mac:

Build fix.

* DOM/DOMElement.mm:
(-[DOMElement style]):
* WebCoreSupport/WebEditorClient.mm:
(WebEditorClient::shouldApplyStyle):
* WebView/WebFrame.mm:
(-[WebFrame _typingStyle]):

Source/WebKit2:

Build fix.

* WebProcess/WebCoreSupport/WebEditorClient.cpp:
(WebKit::WebEditorClient::shouldApplyStyle):

LayoutTests:

* accessibility/roles-exposed.html:
Add null check for element.style.

* fast/css/Element-style-expected.txt: Added.
* fast/css/Element-style.html: Added.
Add layout test coverage.

* fast/forms/input-width-height-attributes-without-renderer-loaded-image-expected.txt:
Rebaseline test that was setting HTMLElement.style which was a no-op until this patch. Now that it actually
does something, the input element actually looses its renderer. This found a bug which I fixed in this
patch.

* js/dom/dom-static-property-for-in-iteration-expected.txt:
Rebaseline as property enumeration order has changed.

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

3 years agoAX: Propagate aria-readonly to grid descendants
jdiggs@igalia.com [Mon, 8 May 2017 16:43:07 +0000 (16:43 +0000)]
AX: Propagate aria-readonly to grid descendants
https://bugs.webkit.org/show_bug.cgi?id=171189

Reviewed by Chris Fleizach.

Source/WebCore:

Propagate aria-readonly to grid descendants if the property is not
explicitly set on the descendant.

Test: accessibility/gtk/aria-readonly-propagated.html
      Additional test cases also added to accessibility/aria-readonly.html

* accessibility/AccessibilityARIAGridCell.cpp:
(WebCore::AccessibilityARIAGridCell::ariaReadOnlyValue):
* accessibility/AccessibilityARIAGridCell.h:
* accessibility/AccessibilityObject.h:

LayoutTests:

Add new test cases to aria-readonly.html. In addition, because the platform-specific
test expectations seem due to how platforms treat whitespace from the test file, hide
the test cases after the test is run so that there are no extraneous characters and
a single expectations file can be shared.

* accessibility/aria-readonly-expected.txt: Updated.
* accessibility/aria-readonly.html: Updated.
* accessibility/gtk/aria-readonly-propagated-expected.txt: Added.
* accessibility/gtk/aria-readonly-propagated.html: Added.
* platform/mac-elcapitan/accessibility/aria-readonly-expected.txt: Removed.
* platform/mac/accessibility/aria-readonly-expected.txt: Removed.
* platform/win/accessibility/aria-readonly-expected.txt: Removed.

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

3 years agoUnreviewed. Fix GTK+ test /webkit2/WebKitWebView/javascript-dialogs after r215404.
carlosgc@webkit.org [Mon, 8 May 2017 16:40:44 +0000 (16:40 +0000)]
Unreviewed. Fix GTK+ test /webkit2/WebKitWebView/javascript-dialogs after r215404.

Sending down+up keys is no longer enough to simulate a real user interaction after r215404, the key events now
should be handled by the web process to be considered a user interaction. So, add an input to the HTML and send
characters to the input. Also fix typo in the function name.

* TestWebKitAPI/Tests/WebKit2Gtk/TestUIClient.cpp:
(testWebViewJavaScriptDialogs):

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

3 years agoEnsure clean tree before AX cache update.
zalan@apple.com [Mon, 8 May 2017 15:33:47 +0000 (15:33 +0000)]
Ensure clean tree before AX cache update.
https://bugs.webkit.org/show_bug.cgi?id=171546
<rdar://problem/31934942>

Source/WebCore:

While updating an accessibility object state, we might
perform unintentional style updates. This style update could
end up destroying renderes that are still referenced by function calls
on the callstack.
To avoid that, AXObjectCache should operate on a clean tree only.

Reviewed by Chris Fleizach.

Test: accessibility/crash-when-render-tree-is-not-clean.html

* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::checkedStateChanged):
(WebCore::AXObjectCache::selectedChildrenChanged):
(WebCore::AXObjectCache::handleAriaExpandedChange):
(WebCore::AXObjectCache::handleActiveDescendantChanged):
(WebCore::AXObjectCache::handleAriaRoleChanged):
(WebCore::AXObjectCache::handleAttributeChanged):
(WebCore::AXObjectCache::handleAriaModalChange):
(WebCore::AXObjectCache::labelChanged):
* accessibility/AXObjectCache.h:
(WebCore::AXObjectCache::checkedStateChanged):
(WebCore::AXObjectCache::handleActiveDescendantChanged):
(WebCore::AXObjectCache::handleAriaExpandedChange):
(WebCore::AXObjectCache::handleAriaRoleChanged):
(WebCore::AXObjectCache::handleAriaModalChange):
(WebCore::AXObjectCache::handleAttributeChanged):
(WebCore::AXObjectCache::selectedChildrenChanged):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::handleAriaExpandedChanged):
* dom/Element.cpp:
(WebCore::Element::attributeChanged):
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::setChecked):

LayoutTests:

Reviewed by Chris Fleizach.

* accessibility/crash-when-render-tree-is-not-clean.html: Added.

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

3 years agoUnprefix unicode-bidi CSS values
mmaxfield@apple.com [Mon, 8 May 2017 15:26:38 +0000 (15:26 +0000)]
Unprefix unicode-bidi CSS values
https://bugs.webkit.org/show_bug.cgi?id=171761

Reviewed by Simon Fraser.

Source/WebCore:

Create new values which parse to the same internal state as the
prefixed values.

Tests: fast/text/bidi-unprefix.html
       imported/w3c/i18n/bidi/bidi-embed-001.html
       imported/w3c/i18n/bidi/bidi-embed-002.html
       imported/w3c/i18n/bidi/bidi-embed-003.html
       imported/w3c/i18n/bidi/bidi-embed-004.html
       imported/w3c/i18n/bidi/bidi-embed-005.html
       imported/w3c/i18n/bidi/bidi-embed-006.html
       imported/w3c/i18n/bidi/bidi-embed-007.html
       imported/w3c/i18n/bidi/bidi-embed-008.html
       imported/w3c/i18n/bidi/bidi-embed-009.html
       imported/w3c/i18n/bidi/bidi-embed-010.html
       imported/w3c/i18n/bidi/bidi-embed-011.html
       imported/w3c/i18n/bidi/bidi-isolate-001.html
       imported/w3c/i18n/bidi/bidi-isolate-002.html
       imported/w3c/i18n/bidi/bidi-isolate-003.html
       imported/w3c/i18n/bidi/bidi-isolate-004.html
       imported/w3c/i18n/bidi/bidi-isolate-005.html
       imported/w3c/i18n/bidi/bidi-isolate-006.html
       imported/w3c/i18n/bidi/bidi-isolate-007.html
       imported/w3c/i18n/bidi/bidi-isolate-008.html
       imported/w3c/i18n/bidi/bidi-isolate-009.html
       imported/w3c/i18n/bidi/bidi-isolate-010.html
       imported/w3c/i18n/bidi/bidi-isolate-011.html
       imported/w3c/i18n/bidi/bidi-isolate-override-001.html
       imported/w3c/i18n/bidi/bidi-isolate-override-002.html
       imported/w3c/i18n/bidi/bidi-isolate-override-003.html
       imported/w3c/i18n/bidi/bidi-isolate-override-004.html
       imported/w3c/i18n/bidi/bidi-isolate-override-005.html
       imported/w3c/i18n/bidi/bidi-isolate-override-006.html
       imported/w3c/i18n/bidi/bidi-isolate-override-007.html
       imported/w3c/i18n/bidi/bidi-isolate-override-008.html
       imported/w3c/i18n/bidi/bidi-isolate-override-009.html
       imported/w3c/i18n/bidi/bidi-isolate-override-010.html
       imported/w3c/i18n/bidi/bidi-isolate-override-011.html
       imported/w3c/i18n/bidi/bidi-isolate-override-012.html
       imported/w3c/i18n/bidi/bidi-normal-001.html
       imported/w3c/i18n/bidi/bidi-normal-002.html
       imported/w3c/i18n/bidi/bidi-normal-003.html
       imported/w3c/i18n/bidi/bidi-normal-004.html
       imported/w3c/i18n/bidi/bidi-normal-005.html
       imported/w3c/i18n/bidi/bidi-normal-006.html
       imported/w3c/i18n/bidi/bidi-normal-007.html
       imported/w3c/i18n/bidi/bidi-normal-008.html
       imported/w3c/i18n/bidi/bidi-normal-009.html
       imported/w3c/i18n/bidi/bidi-normal-010.html
       imported/w3c/i18n/bidi/bidi-normal-011.html
       imported/w3c/i18n/bidi/bidi-override-001.html
       imported/w3c/i18n/bidi/bidi-override-002.html
       imported/w3c/i18n/bidi/bidi-override-003.html
       imported/w3c/i18n/bidi/bidi-override-004.html
       imported/w3c/i18n/bidi/bidi-override-005.html
       imported/w3c/i18n/bidi/bidi-override-006.html
       imported/w3c/i18n/bidi/bidi-override-007.html
       imported/w3c/i18n/bidi/bidi-override-008.html
       imported/w3c/i18n/bidi/bidi-override-009.html
       imported/w3c/i18n/bidi/bidi-override-010.html
       imported/w3c/i18n/bidi/bidi-override-011.html
       imported/w3c/i18n/bidi/bidi-override-012.html
       imported/w3c/i18n/bidi/bidi-plaintext-001.html
       imported/w3c/i18n/bidi/bidi-plaintext-003.html
       imported/w3c/i18n/bidi/bidi-plaintext-005.html
       imported/w3c/i18n/bidi/bidi-plaintext-006.html
       imported/w3c/i18n/bidi/bidi-plaintext-007.html
       imported/w3c/i18n/bidi/bidi-plaintext-008.html
       imported/w3c/i18n/bidi/bidi-plaintext-009.html
       imported/w3c/i18n/bidi/bidi-plaintext-010.html
       imported/w3c/i18n/bidi/bidi-plaintext-011.html
       imported/w3c/i18n/bidi/bidi-table-001.html
       imported/w3c/i18n/bidi/bidi-unset-001.html
       imported/w3c/i18n/bidi/bidi-unset-002.html
       imported/w3c/i18n/bidi/bidi-unset-003.html
       imported/w3c/i18n/bidi/bidi-unset-004.html
       imported/w3c/i18n/bidi/bidi-unset-005.html
       imported/w3c/i18n/bidi/bidi-unset-006.html
       imported/w3c/i18n/bidi/bidi-unset-007.html
       imported/w3c/i18n/bidi/bidi-unset-008.html
       imported/w3c/i18n/bidi/bidi-unset-009.html
       imported/w3c/i18n/bidi/bidi-unset-010.html
       imported/w3c/i18n/bidi/block-embed-001.html
       imported/w3c/i18n/bidi/block-embed-002.html
       imported/w3c/i18n/bidi/block-embed-003.html
       imported/w3c/i18n/bidi/block-override-001.html
       imported/w3c/i18n/bidi/block-override-002.html
       imported/w3c/i18n/bidi/block-override-003.html
       imported/w3c/i18n/bidi/block-override-004.html
       imported/w3c/i18n/bidi/block-override-isolate-001.html
       imported/w3c/i18n/bidi/block-override-isolate-002.html
       imported/w3c/i18n/bidi/block-override-isolate-003.html
       imported/w3c/i18n/bidi/block-override-isolate-004.html
       imported/w3c/i18n/bidi/block-plaintext-001.html
       imported/w3c/i18n/bidi/block-plaintext-002.html
       imported/w3c/i18n/bidi/block-plaintext-003.html
       imported/w3c/i18n/bidi/block-plaintext-004.html
       imported/w3c/i18n/bidi/block-plaintext-005.html
       imported/w3c/i18n/bidi/block-plaintext-006.html

* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator EUnicodeBidi):
* css/CSSProperties.json:
* css/CSSValueKeywords.in:
* css/html.css:
(bdi, output):
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
* html/HTMLElement.cpp:
(WebCore::unicodeBidiAttributeForDirAuto):
* html/track/TextTrackCueGeneric.cpp:
(WebCore::TextTrackCueGenericBoxElement::applyCSSProperties):
* html/track/VTTCue.cpp:
(WebCore::VTTCueBox::applyCSSProperties):

Source/WebInspectorUI:

* UserInterface/Models/CSSKeywordCompletions.js:

LayoutTests:

Import W3C's internationalization tests from
https://www.w3.org/International/tests/repo/results/writing-modes-bidi

* fast/css/default-bidi-css-rules-expected.txt: Updating expected results.
* fast/css/default-bidi-css-rules.html: Ditto.
* fast/css/unicode-bidi-computed-value-expected.txt: Ditto.
* fast/css/unicode-bidi-computed-value.html: Ditto.
* fast/text/bidi-unprefix-expected.txt: Added. Test unprefixing.
* fast/text/bidi-unprefix.html: Added.
* imported/w3c/i18n/bidi/bidi-embed-001-expected.html: Added.
* imported/w3c/i18n/bidi/bidi-embed-001.html: Added.
* imported/w3c/i18n/bidi/bidi-embed-002-expected.html: Added.
* imported/w3c/i18n/bidi/bidi-embed-002.html: Added.
* imported/w3c/i18n/bidi/bidi-embed-003-expected.html: Added.
* imported/w3c/i18n/bidi/bidi-embed-003.html: Added.
* imported/w3c/i18n/bidi/bidi-embed-004-expected.html: Added.
* imported/w3c/i18n/bidi/bidi-embed-004.html: Added.
* imported/w3c/i18n/bidi/bidi-embed-005-expected.html: Added.
* imported/w3c/i18n/bidi/bidi-embed-005.html: Added.
* imported/w3c/i18n/bidi/bidi-embed-006-expected.html: Added.
* imported/w3c/i18n/bidi/bidi-embed-006.html: Added.
* imported/w3c/i18n/bidi/bidi-embed-007-expected.html: Added.
* imported/w3c/i18n/bidi/bidi-embed-007.html: Added.
* imported/w3c/i18n/bidi/bidi-embed-008-expected.html: Added.
* imported/w3c/i18n/bidi/bidi-embed-008.html: Added.
* imported/w3c/i18n/bidi/bidi-embed-009-expected.html: Added.
* imported/w3c/i18n/bidi/bidi-embed-009.html: Added.
* imported/w3c/i18n/bidi/bidi-embed-010-expected.html: Added.
* imported/w3c/i18n/bidi/bidi-embed-010.html: Added.
* imported/w3c/i18n/bidi/bidi-embed-011-expected.html: Added.
* imported/w3c/i18n/bidi/bidi-embed-011.html: Added.
* imported/w3c/i18n/bidi/bidi-isolate-001-expected.html: Added.
* imported/w3c/i18n/bidi/bidi-isolate-001.html: Added.
* imported/w3c/i18n/bidi/bidi-isolate-002-expected.html: Added.
* imported/w3c/i18n/bidi/bidi-isolate-002.html: Added.
* imported/w3c/i18n/bidi/bidi-isolate-003-expected.html: Added.
* imported/w3c/i18n/bidi/bidi-isolate-003.html: Added.
* imported/w3c/i18n/bidi/bidi-isolate-004-expected.html: Added.
* imported/w3c/i18n/bidi/bidi-isolate-004.html: Added.
* imported/w3c/i18n/bidi/bidi-isolate-005-expected.html: Added.
* imported/w3c/i18n/bidi/bidi-isolate-005.html: Added.
* imported/w3c/i18n/bidi/bidi-isolate-006-expected.html: Added.
* imported/w3c/i18n/bidi/bidi-isolate-006.html: Added.
* imported/w3c/i18n/bidi/bidi-isolate-007-expected.html: Added.
* imported/w3c/i18n/bidi/bidi-isolate-007.html: Added.
* imported/w3c/i18n/bidi/bidi-isolate-008-expected.html: Added.
* imported/w3c/i18n/bidi/bidi-isolate-008.html: Added.
* imported/w3c/i18n/bidi/bidi-isolate-009-expected.html: Added.
* imported/w3c/i18n/bidi/bidi-isolate-009.html: Added.
* imported/w3c/i18n/bidi/bidi-isolate-010-expected.html: Added.
* imported/w3c/i18n/bidi/bidi-isolate-010.html: Added.
* imported/w3c/i18n/bidi/bidi-isolate-011-expected.html: Added.
* imported/w3c/i18n/bidi/bidi-isolate-011.html: Added.
* imported/w3c/i18n/bidi/bidi-isolate-override-001-expected.html: Added.
* imported/w3c/i18n/bidi/bidi-isolate-override-001.html: Added.
* imported/w3c/i18n/bidi/bidi-isolate-override-002-expected.html: Added.
* imported/w3c/i18n/bidi/bidi-isolate-override-002.html: Added.
* imported/w3c/i18n/bidi/bidi-isolate-override-003-expected.html: Added.
* imported/w3c/i18n/bidi/bidi-isolate-override-003.html: Added.
* imported/w3c/i18n/bidi/bidi-isolate-override-004-expected.html: Added.
* imported/w3c/i18n/bidi/bidi-isolate-override-004.html: Added.
* imported/w3c/i18n/bidi/bidi-isolate-override-005-expected.html: Added.
* imported/w3c/i18n/bidi/bidi-isolate-override-005.html: Added.
* imported/w3c/i18n/bidi/bidi-isolate-override-006-expected.html: Added.
* imported/w3c/i18n/bidi/bidi-isolate-override-006.html: Added.
* imported/w3c/i18n/bidi/bidi-isolate-override-007-expected.html: Added.
* imported/w3c/i18n/bidi/bidi-isolate-override-007.html: Added.
* imported/w3c/i18n/bidi/bidi-isolate-override-008-expected.html: Added.
* imported/w3c/i18n/bidi/bidi-isolate-override-008.html: Added.
* imported/w3c/i18n/bidi/bidi-isolate-override-009-expected.html: Added.
* imported/w3c/i18n/bidi/bidi-isolate-override-009.html: Added.
* imported/w3c/i18n/bidi/bidi-isolate-override-010-expected.html: Added.
* imported/w3c/i18n/bidi/bidi-isolate-override-010.html: Added.
* imported/w3c/i18n/bidi/bidi-isolate-override-011-expected.html: Added.
* imported/w3c/i18n/bidi/bidi-isolate-override-011.html: Added.
* imported/w3c/i18n/bidi/bidi-isolate-override-012-expected.html: Added.
* imported/w3c/i18n/bidi/bidi-isolate-override-012.html: Added.
* imported/w3c/i18n/bidi/bidi-normal-001-expected.html: Added.
* imported/w3c/i18n/bidi/bidi-normal-001.html: Added.
* imported/w3c/i18n/bidi/bidi-normal-002-expected.html: Added.
* imported/w3c/i18n/bidi/bidi-normal-002.html: Added.
* imported/w3c/i18n/bidi/bidi-normal-003-expected.html: Added.
* imported/w3c/i18n/bidi/bidi-normal-003.html: Added.
* imported/w3c/i18n/bidi/bidi-normal-004-expected.html: Added.
* imported/w3c/i18n/bidi/bidi-normal-004.html: Added.
* imported/w3c/i18n/bidi/bidi-normal-005-expected.html: Added.
* imported/w3c/i18n/bidi/bidi-normal-005.html: Added.
* imported/w3c/i18n/bidi/bidi-normal-006-expected.html: Added.
* imported/w3c/i18n/bidi/bidi-normal-006.html: Added.
* imported/w3c/i18n/bidi/bidi-normal-007-expected.html: Added.
* imported/w3c/i18n/bidi/bidi-normal-007.html: Added.
* imported/w3c/i18n/bidi/bidi-normal-008-expected.html: Added.
* imported/w3c/i18n/bidi/bidi-normal-008.html: Added.
* imported/w3c/i18n/bidi/bidi-normal-009-expected.html: Added.
* imported/w3c/i18n/bidi/bidi-normal-009.html: Added.
* imported/w3c/i18n/bidi/bidi-normal-010-expected.html: Added.
* imported/w3c/i18n/bidi/bidi-normal-010.html: Added.
* imported/w3c/i18n/bidi/bidi-normal-011-expected.html: Added.
* imported/w3c/i18n/bidi/bidi-normal-011.html: Added.
* imported/w3c/i18n/bidi/bidi-override-001-expected.html: Added.
* imported/w3c/i18n/bidi/bidi-override-001.html: Added.
* imported/w3c/i18n/bidi/bidi-override-002-expected.html: Added.
* imported/w3c/i18n/bidi/bidi-override-002.html: Added.
* imported/w3c/i18n/bidi/bidi-override-003-expected.html: Added.
* imported/w3c/i18n/bidi/bidi-override-003.html: Added.
* imported/w3c/i18n/bidi/bidi-override-004-expected.html: Added.
* imported/w3c/i18n/bidi/bidi-override-004.html: Added.
* imported/w3c/i18n/bidi/bidi-override-005-expected.html: Added.
* imported/w3c/i18n/bidi/bidi-override-005.html: Added.
* imported/w3c/i18n/bidi/bidi-override-006-expected.html: Added.
* imported/w3c/i18n/bidi/bidi-override-006.html: Added.
* imported/w3c/i18n/bidi/bidi-override-007-expected.html: Added.
* imported/w3c/i18n/bidi/bidi-override-007.html: Added.
* imported/w3c/i18n/bidi/bidi-override-008-expected.html: Added.
* imported/w3c/i18n/bidi/bidi-override-008.html: Added.
* imported/w3c/i18n/bidi/bidi-override-009-expected.html: Added.
* imported/w3c/i18n/bidi/bidi-override-009.html: Added.
* imported/w3c/i18n/bidi/bidi-override-010-expected.html: Added.
* imported/w3c/i18n/bidi/bidi-override-010.html: Added.
* imported/w3c/i18n/bidi/bidi-override-011-expected.html: Added.
* imported/w3c/i18n/bidi/bidi-override-011.html: Added.
* imported/w3c/i18n/bidi/bidi-override-012-expected.html: Added.
* imported/w3c/i18n/bidi/bidi-override-012.html: Added.
* imported/w3c/i18n/bidi/bidi-plaintext-001-expected.html: Added.
* imported/w3c/i18n/bidi/bidi-plaintext-001.html: Added.
* imported/w3c/i18n/bidi/bidi-plaintext-003-expected.html: Added.
* imported/w3c/i18n/bidi/bidi-plaintext-003.html: Added.
* imported/w3c/i18n/bidi/bidi-plaintext-005-expected.html: Added.
* imported/w3c/i18n/bidi/bidi-plaintext-005.html: Added.
* imported/w3c/i18n/bidi/bidi-plaintext-006-expected.html: Added.
* imported/w3c/i18n/bidi/bidi-plaintext-006.html: Added.
* imported/w3c/i18n/bidi/bidi-plaintext-007-expected.html: Added.
* imported/w3c/i18n/bidi/bidi-plaintext-007.html: Added.
* imported/w3c/i18n/bidi/bidi-plaintext-008-expected.html: Added.
* imported/w3c/i18n/bidi/bidi-plaintext-008.html: Added.
* imported/w3c/i18n/bidi/bidi-plaintext-009-expected.html: Added.
* imported/w3c/i18n/bidi/bidi-plaintext-009.html: Added.
* imported/w3c/i18n/bidi/bidi-plaintext-010-expected.html: Added.
* imported/w3c/i18n/bidi/bidi-plaintext-010.html: Added.
* imported/w3c/i18n/bidi/bidi-plaintext-011-expected.html: Added.
* imported/w3c/i18n/bidi/bidi-plaintext-011.html: Added.
* imported/w3c/i18n/bidi/bidi-table-001-expected.html: Added.
* imported/w3c/i18n/bidi/bidi-table-001.html: Added.
* imported/w3c/i18n/bidi/bidi-unset-001-expected.html: Added.
* imported/w3c/i18n/bidi/bidi-unset-001.html: Added.
* imported/w3c/i18n/bidi/bidi-unset-002-expected.html: Added.
* imported/w3c/i18n/bidi/bidi-unset-002.html: Added.
* imported/w3c/i18n/bidi/bidi-unset-003-expected.html: Added.
* imported/w3c/i18n/bidi/bidi-unset-003.html: Added.
* imported/w3c/i18n/bidi/bidi-unset-004-expected.html: Added.
* imported/w3c/i18n/bidi/bidi-unset-004.html: Added.
* imported/w3c/i18n/bidi/bidi-unset-005-expected.html: Added.
* imported/w3c/i18n/bidi/bidi-unset-005.html: Added.
* imported/w3c/i18n/bidi/bidi-unset-006-expected.html: Added.
* imported/w3c/i18n/bidi/bidi-unset-006.html: Added.
* imported/w3c/i18n/bidi/bidi-unset-007-expected.html: Added.
* imported/w3c/i18n/bidi/bidi-unset-007.html: Added.
* imported/w3c/i18n/bidi/bidi-unset-008-expected.html: Added.
* imported/w3c/i18n/bidi/bidi-unset-008.html: Added.
* imported/w3c/i18n/bidi/bidi-unset-009-expected.html: Added.
* imported/w3c/i18n/bidi/bidi-unset-009.html: Added.
* imported/w3c/i18n/bidi/bidi-unset-010-expected.html: Added.
* imported/w3c/i18n/bidi/bidi-unset-010.html: Added.
* imported/w3c/i18n/bidi/block-embed-001-expected.html: Added.
* imported/w3c/i18n/bidi/block-embed-001.html: Added.
* imported/w3c/i18n/bidi/block-embed-002-expected.html: Added.
* imported/w3c/i18n/bidi/block-embed-002.html: Added.
* imported/w3c/i18n/bidi/block-embed-003-expected.html: Added.
* imported/w3c/i18n/bidi/block-embed-003.html: Added.
* imported/w3c/i18n/bidi/block-override-001-expected.html: Added.
* imported/w3c/i18n/bidi/block-override-001.html: Added.
* imported/w3c/i18n/bidi/block-override-002-expected.html: Added.
* imported/w3c/i18n/bidi/block-override-002.html: Added.
* imported/w3c/i18n/bidi/block-override-003-expected.html: Added.
* imported/w3c/i18n/bidi/block-override-003.html: Added.
* imported/w3c/i18n/bidi/block-override-004-expected.html: Added.
* imported/w3c/i18n/bidi/block-override-004.html: Added.
* imported/w3c/i18n/bidi/block-override-isolate-001-expected.html: Added.
* imported/w3c/i18n/bidi/block-override-isolate-001.html: Added.
* imported/w3c/i18n/bidi/block-override-isolate-002-expected.html: Added.
* imported/w3c/i18n/bidi/block-override-isolate-002.html: Added.
* imported/w3c/i18n/bidi/block-override-isolate-003-expected.html: Added.
* imported/w3c/i18n/bidi/block-override-isolate-003.html: Added.
* imported/w3c/i18n/bidi/block-override-isolate-004-expected.html: Added.
* imported/w3c/i18n/bidi/block-override-isolate-004.html: Added.
* imported/w3c/i18n/bidi/block-plaintext-001-expected.html: Added.
* imported/w3c/i18n/bidi/block-plaintext-001.html: Added.
* imported/w3c/i18n/bidi/block-plaintext-002-expected.html: Added.
* imported/w3c/i18n/bidi/block-plaintext-002.html: Added.
* imported/w3c/i18n/bidi/block-plaintext-003-expected.html: Added.
* imported/w3c/i18n/bidi/block-plaintext-003.html: Added.
* imported/w3c/i18n/bidi/block-plaintext-004-expected.html: Added.
* imported/w3c/i18n/bidi/block-plaintext-004.html: Added.
* imported/w3c/i18n/bidi/block-plaintext-005-expected.html: Added.
* imported/w3c/i18n/bidi/block-plaintext-005.html: Added.
* imported/w3c/i18n/bidi/block-plaintext-006-expected.html: Added.
* imported/w3c/i18n/bidi/block-plaintext-006.html: Added.
* imported/w3c/i18n/bidi/resources/sileot-webfont.woff: Added.
* platform/ios/TestExpectations:
* platform/mac/TestExpectations:

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

3 years agoUnreviewed GTK+ gardening. Update expectations of several tests.
carlosgc@webkit.org [Mon, 8 May 2017 09:36:05 +0000 (09:36 +0000)]
Unreviewed GTK+ gardening. Update expectations of several tests.

* platform/gtk/TestExpectations:

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

3 years ago2017-05-08 James Craig <jcraig@apple.com>
jcraig@apple.com [Mon, 8 May 2017 07:56:02 +0000 (07:56 +0000)]
2017-05-08  James Craig  <jcraig@apple.com>

        More demo files for prefers-reduced-motion post
        https://bugs.webkit.org/show_bug.cgi?id=170663

        Unreviewed.

        * blog-files/prefers-reduced-motion/jaws.gif: Added.
        * blog-files/prefers-reduced-motion/jaws.jpg: Added.
        * blog-files/prefers-reduced-motion/prm.htm: New animated GIF example.

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

3 years ago[GTK] Web Inspector: Add new GTK+ icon for timeline recording stopwatch
commit-queue@webkit.org [Mon, 8 May 2017 07:11:49 +0000 (07:11 +0000)]
[GTK] Web Inspector: Add new GTK+ icon for timeline recording stopwatch
https://bugs.webkit.org/show_bug.cgi?id=154088

Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2017-05-08
Reviewed by Carlos Garcia Campos.

Add a free icon and remove some unused ones for the Web Inspector
in GTK+.

* UserInterface/Images/gtk/Stopwatch.png: Removed.
* UserInterface/Images/gtk/Stopwatch.svg: Added.
* UserInterface/Images/gtk/Stopwatch@2x.png: Removed.
* UserInterface/Views/TimelineIcons.css:
(body:not(.mac-platform, .windows-platform) .stopwatch-icon .icon): Deleted.

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

3 years agoRegenerate w3c-import.log files after r215670
commit-queue@webkit.org [Mon, 8 May 2017 05:31:06 +0000 (05:31 +0000)]
Regenerate w3c-import.log files after r215670
https://bugs.webkit.org/show_bug.cgi?id=171210

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

Updating all w3c-import.log files of web-platform-tests.
Fixing some import expectations.
Fixing some tests to match the current import revision, only syntatic changes (meta annotations and links to resources).

* resources/import-expectations.json:
* web-platform-tests/WebCryptoAPI/OWNERS:
* web-platform-tests/WebCryptoAPI/derive_bits_keys/pbkdf2.worker.js: meta annotation changes.
* web-platform-tests/WebCryptoAPI/generateKey/failures_AES-CBC.worker.js: Ditto for all crypto tests.
* web-platform-tests/WebCryptoAPI/generateKey/failures_AES-CTR.worker.js:
* web-platform-tests/WebCryptoAPI/generateKey/failures_AES-GCM.worker.js:
* web-platform-tests/WebCryptoAPI/generateKey/failures_AES-KW.worker.js:
* web-platform-tests/WebCryptoAPI/generateKey/failures_ECDH.worker.js:
* web-platform-tests/WebCryptoAPI/generateKey/failures_ECDSA.worker.js:
* web-platform-tests/WebCryptoAPI/generateKey/failures_HMAC.worker.js:
* web-platform-tests/WebCryptoAPI/generateKey/failures_RSA-OAEP.worker.js:
* web-platform-tests/WebCryptoAPI/generateKey/failures_RSA-PSS.worker.js:
* web-platform-tests/WebCryptoAPI/generateKey/failures_RSASSA-PKCS1-v1_5.worker.js:
* web-platform-tests/WebCryptoAPI/generateKey/successes_AES-CBC.worker.js:
* web-platform-tests/WebCryptoAPI/generateKey/successes_AES-CTR.worker.js:
* web-platform-tests/WebCryptoAPI/generateKey/successes_AES-GCM.worker.js:
* web-platform-tests/WebCryptoAPI/generateKey/successes_AES-KW.worker.js:
* web-platform-tests/WebCryptoAPI/generateKey/successes_ECDH.worker.js:
* web-platform-tests/WebCryptoAPI/generateKey/successes_ECDSA.worker.js:
* web-platform-tests/WebCryptoAPI/generateKey/successes_HMAC.worker.js:
* web-platform-tests/WebCryptoAPI/generateKey/successes_RSA-OAEP.worker.js:
* web-platform-tests/WebCryptoAPI/generateKey/successes_RSA-PSS.worker.js:
* web-platform-tests/WebCryptoAPI/generateKey/successes_RSASSA-PKCS1-v1_5.worker.js:
* web-platform-tests/WebCryptoAPI/tools/generate.py:
* web-platform-tests/WebCryptoAPI/wrapKey_unwrapKey/wrapKey_unwrapKey.worker.js:
* web-platform-tests/css/css-grid-1/grid-layout-properties.html:
* web-platform-tests/css/selectors4/focus-within-009.html:
* web-platform-tests/domparsing/DOMParser-parseFromString-html.html:
* web-platform-tests/domparsing/createContextualFragment.html:
* web-platform-tests/domparsing/innerhtml-01.xhtml:
* web-platform-tests/domparsing/innerhtml-03.xhtml:
* web-platform-tests/domparsing/innerhtml-04.html:
* web-platform-tests/domparsing/innerhtml-05.xhtml:
* web-platform-tests/domparsing/innerhtml-06.html:
* web-platform-tests/domparsing/innerhtml-07.html:
* web-platform-tests/domparsing/insert-adjacent.html:
* web-platform-tests/domparsing/insert_adjacent_html.html:
* web-platform-tests/domparsing/outerhtml-01.html:
* web-platform-tests/domparsing/outerhtml-02.html:
* web-platform-tests/domparsing/xml-serialization.xhtml:

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

3 years agoSet the Response.blob() type based on the content-type header value.
commit-queue@webkit.org [Mon, 8 May 2017 00:01:07 +0000 (00:01 +0000)]
Set the Response.blob() type based on the content-type header value.
https://bugs.webkit.org/show_bug.cgi?id=170849

Patch by Ben Kelly <ben@wanderview.com> on 2017-05-07
Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

* web-platform-tests/fetch/api/response/response-consume-expected.txt:

Source/WebCore:

There are two problems to fix here:

1.  Currently the FetchResponse class only called updateContentType()
when first created even though all the headers were not available.  This
patch calls updateContentType() again after the headers are populated.

2.  The fetch design requires propagating the normalized blob
type to FetchBodyConsumer as well.  Currently this is only done if
Response.blob() is called after the body is completely loaded.  If
we hit the consumeOnceLoadingFinished() path, then the type is not
passed.  This is similar to what was happening in bug 171489 with
ReadableStream bodies.  This patch sets the type on the
FetchBodyConsumer in consumeOnceLoadingFinished() as well.

Theses changes allow WebKit to pass the "Consume response's body: from
fetch to blob" case in the WPT response-consume.html test.

Test: http://w3c-test.org/fetch/api/response/response-consume.html

* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::BodyLoader::didReceiveResponse): Modified to
call FetchBodyOwner::updateContentType() after filling m_headers.
(WebCore::FetchBody::consumeOnceLoadingFinished): Call
FetchBodyConsumer::setContentType() when being consumed as
a blob.
* Modules/fetch/FetchBody.h: Modify consumeOnceLoadingFinished()
to take the content type string.
* Modules/fetch/FetchBodyOwner.cpp:
(WebCore::FetchBodyOwner::consumeOnceLoadingFinished): Pass
the content type string down to FetchBody so it can be
propagated to the FetchBodyConsumer.

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

3 years ago[iOS] REGRESSION (r209409): getBoundingClientRect is wrong for fixed-position element...
simon.fraser@apple.com [Sun, 7 May 2017 21:23:18 +0000 (21:23 +0000)]
[iOS] REGRESSION (r209409): getBoundingClientRect is wrong for fixed-position elements in resize/orientationchange
https://bugs.webkit.org/show_bug.cgi?id=171140
Source/WebCore:

Reviewed by Sam Weinig.

WebPage::dynamicViewportSizeUpdate() is called during rotation, and does a layout which needs to have
an up-to-date layout viewport, since the layout viewport state is detectable in orientationchange and
resize events via fetching the client rect of fixed elements. Normally we send in the layout viewport
from the UI process, but in this case we need to compute one in the web process. So factor code
into FrameView to do the computation, called from both places.

Tests: fast/events/ios/rotation/layout-viewport-during-rotation.html
       fast/events/ios/rotation/layout-viewport-during-safari-type-rotation.html

* page/FrameView.cpp:
(WebCore::FrameView::computeUpdatedLayoutViewportRect):
* page/FrameView.h:

Source/WebKit2:

rdar://problem/31765167

Reviewed by Sam Weinig.

WebPage::dynamicViewportSizeUpdate() is called during rotation, and does a layout which needs to have
an up-to-date layout viewport, since the layout viewport state is detectable in orientationchange and
resize events via fetching the client rect of fixed elements. Normally we send in the layout viewport
from the UI process, but in this case we need to compute one in the web process. So factor code
into FrameView to do the computation, called from both places.

* UIProcess/WebPageProxy.h:
* UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm:
(WebKit::RemoteScrollingCoordinatorProxy::customFixedPositionRect):
* UIProcess/ios/WKContentView.mm:
(-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::computeCustomFixedPositionRect):
* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::dynamicViewportSizeUpdate):

LayoutTests:

Reviewed by Sam Weinig.

Tests that fetch the dimensions of a fixed element in resize and orientationchange handlers,
which is a proxy for reading the layout viewport.

* fast/events/ios/rotation/layout-viewport-during-rotation-expected.txt: Added.
* fast/events/ios/rotation/layout-viewport-during-rotation.html: Added.
* fast/events/ios/rotation/layout-viewport-during-safari-type-rotation-expected.txt: Added.
* fast/events/ios/rotation/layout-viewport-during-safari-type-rotation.html: Added.
* fast/events/ios/rotation/resources/rotation-utils.js: Added.
(stringFromRect):
(accumulateLog):
(logFixedObject):
(logFixedAndViewports):
(doTest):

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

3 years agoDrop remaining uses of PassRefPtr in editing code
cdumez@apple.com [Sun, 7 May 2017 20:02:31 +0000 (20:02 +0000)]
Drop remaining uses of PassRefPtr in editing code
https://bugs.webkit.org/show_bug.cgi?id=171787

Reviewed by Darin Adler.

Drop remaining uses of PassRefPtr in editing code.

* editing/AlternativeTextController.cpp:
(WebCore::AlternativeTextController::timerFired):
* editing/ApplyStyleCommand.cpp:
(WebCore::toIdentifier):
* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::didApplyCommand):
(WebCore::CompositeEditCommand::moveParagraphs):
* editing/CompositeEditCommand.h:
* editing/Editor.cpp:
(WebCore::Editor::shouldInsertFragment):
(WebCore::Editor::replaceSelectionWithFragment):
(WebCore::Editor::appliedEditing):
(WebCore::Editor::performCutOrCopy):
(WebCore::Editor::willWriteSelectionToPasteboard):
(WebCore::Editor::advanceToNextMisspelling):
(WebCore::Editor::isSelectionUngrammatical):
(WebCore::Editor::guessesForMisspelledOrUngrammatical):
(WebCore::Editor::markMisspellingsOrBadGrammar):
(WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges):
(WebCore::correctSpellcheckingPreservingTextCheckingParagraph):
(WebCore::Editor::markAndReplaceFor):
(WebCore::Editor::changeBackToReplacedString):
* editing/Editor.h:
* editing/EditorCommand.cpp:
(WebCore::executeInsertFragment):
(WebCore::Editor::command):
(WebCore::Editor::Command::Command):
* editing/FormatBlockCommand.cpp:
(WebCore::FormatBlockCommand::formatRange):
* editing/IndentOutdentCommand.cpp:
(WebCore::IndentOutdentCommand::indentIntoBlockquote):
(WebCore::IndentOutdentCommand::outdentParagraph):
* editing/InsertListCommand.cpp:
(WebCore::InsertListCommand::fixOrphanedListChild):
(WebCore::InsertListCommand::mergeWithNeighboringLists):
(WebCore::InsertListCommand::doApplyForSingleParagraph):
(WebCore::InsertListCommand::unlistifyParagraph):
(WebCore::InsertListCommand::listifyParagraph):
* editing/InsertListCommand.h:
* editing/InsertParagraphSeparatorCommand.cpp:
(WebCore::InsertParagraphSeparatorCommand::doApply):
* editing/InsertTextCommand.cpp:
(WebCore::InsertTextCommand::InsertTextCommand):
* editing/InsertTextCommand.h:
(WebCore::InsertTextCommand::createWithMarkerSupplier):
* editing/MoveSelectionCommand.cpp:
(WebCore::MoveSelectionCommand::MoveSelectionCommand):
* editing/MoveSelectionCommand.h:
(WebCore::MoveSelectionCommand::create):
* editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplacementFragment::removeNodePreservingChildren):
(WebCore::ReplacementFragment::removeNode):
(WebCore::ReplacementFragment::insertNodeBefore):
(WebCore::ReplacementFragment::restoreAndRemoveTestRenderingNodesToFragment):
(WebCore::ReplacementFragment::removeUnrenderedNodes):
(WebCore::ReplacementFragment::removeInterchangeNodes):
(WebCore::ReplaceSelectionCommand::makeInsertedContentRoundTrippableWithHTMLTreeBuilder):
(WebCore::ReplaceSelectionCommand::moveNodeOutOfAncestor):
(WebCore::removeHeadContents):
(WebCore::ReplaceSelectionCommand::doApply):
(WebCore::ReplaceSelectionCommand::insertAsListItems):
* editing/ReplaceSelectionCommand.h:
* editing/SpellChecker.cpp:
(WebCore::SpellCheckRequest::SpellCheckRequest):
(WebCore::SpellCheckRequest::create):
(WebCore::SpellChecker::canCheckAsynchronously):
(WebCore::SpellChecker::isCheckable):
(WebCore::SpellChecker::requestCheckingFor):
(WebCore::SpellChecker::invokeRequest):
(WebCore::SpellChecker::enqueueRequest):
(WebCore::SpellChecker::didCheck):
* editing/SpellChecker.h:
(WebCore::SpellCheckRequest::checkingRange):
(WebCore::SpellCheckRequest::paragraphRange):
* editing/TextCheckingHelper.cpp:
(WebCore::expandToParagraphBoundary):
(WebCore::TextCheckingParagraph::TextCheckingParagraph):
(WebCore::TextCheckingParagraph::expandRangeToNextEnd):
(WebCore::TextCheckingParagraph::rangeLength):
(WebCore::TextCheckingParagraph::paragraphRange):
(WebCore::TextCheckingParagraph::subrange):
(WebCore::TextCheckingParagraph::offsetTo):
(WebCore::TextCheckingParagraph::offsetAsRange):
(WebCore::TextCheckingParagraph::text):
(WebCore::TextCheckingParagraph::checkingStart):
(WebCore::TextCheckingParagraph::checkingEnd):
(WebCore::TextCheckingParagraph::checkingLength):
(WebCore::TextCheckingHelper::TextCheckingHelper):
(WebCore::TextCheckingHelper::findFirstMisspelling):
(WebCore::TextCheckingHelper::findFirstMisspellingOrBadGrammar):
(WebCore::TextCheckingHelper::findFirstGrammarDetail):
(WebCore::TextCheckingHelper::findFirstBadGrammar):
(WebCore::TextCheckingHelper::isUngrammatical):
(WebCore::TextCheckingHelper::guessesForMisspelledOrUngrammaticalRange):
(WebCore::TextCheckingHelper::unifiedTextCheckerEnabled):
* editing/TextCheckingHelper.h:
* editing/TypingCommand.cpp:
(WebCore::TypingCommand::typingAddedToOpenCommand):
* editing/cocoa/EditorCocoa.mm:
(WebCore::Editor::replaceSelectionWithAttributedString):
* editing/gtk/EditorGtk.cpp:
(WebCore::Editor::pasteWithPasteboard):
* editing/ios/EditorIOS.mm:
(WebCore::Editor::pasteWithPasteboard):
* editing/mac/EditorMac.mm:
(WebCore::Editor::pasteWithPasteboard):
(WebCore::Editor::replaceNodeFromPasteboard):
* editing/win/EditorWin.cpp:
(WebCore::Editor::pasteWithPasteboard):
(WebCore::createFragmentFromPlatformData):
* page/DragController.cpp:
(WebCore::DragController::concludeEditDrag):
(WebCore::DragController::startDrag):

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

3 years ago[GTK] Cannot sign in with new Google sign-in page
mcatanzaro@igalia.com [Sun, 7 May 2017 19:59:41 +0000 (19:59 +0000)]
[GTK] Cannot sign in with new Google sign-in page
https://bugs.webkit.org/show_bug.cgi?id=171770

Unreviewed. This just adds a test.

* TestWebKitAPI/Tests/WebCore/UserAgentQuirks.cpp:
(TestWebKitAPI::TEST):

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

3 years ago[MediaStream] r216197 caused some webrtc tests to fail
commit-queue@webkit.org [Sun, 7 May 2017 19:10:40 +0000 (19:10 +0000)]
[MediaStream] r216197 caused some webrtc tests to fail
https://bugs.webkit.org/show_bug.cgi?id=171728

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

Source/WebCore:

Covered by existing tests.

Rename MediaStream::endStream to MediaStream::endCaptureTracks and only stopping capture tracks.
Using it when Document is asked to stop media capture.

Adding the ability to have only one active capture source at a time in a WebProcess.
This is done by keeping in its related factory the active capture source.
When a new source is created and started, it replaces the active capture source which becomes muted.
Using that mechanism for iOS.

* Modules/mediastream/MediaStream.cpp:
(WebCore::MediaStream::endCaptureTracks):
(WebCore::MediaStream::endStream): Deleted.
* Modules/mediastream/MediaStream.h:
* Modules/mediastream/MediaStreamTrack.h:
(WebCore::MediaStreamTrack::isCaptureTrack):
* dom/Document.cpp:
(WebCore::Document::stopMediaCapture):
* platform/mediastream/mac/AVAudioCaptureSource.mm:
(WebCore::AVAudioCaptureSourceFactory::setActiveSource):
(WebCore::AVAudioCaptureSource::setupCaptureSession):
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSourceFactory::setActiveSource):
(WebCore::AVVideoCaptureSource::setupCaptureSession):
* platform/mediastream/mac/CoreAudioCaptureSource.cpp:
(WebCore::CoreAudioCaptureSourceFactory::setActiveSource):
(WebCore::CoreAudioSharedUnit::startProducingData):

Source/WebKit2:

* UIProcess/UserMediaProcessManager.cpp:
(WebKit::UserMediaProcessManager::willEnableMediaStreamInPage): Removing muting streams of the page requesting
additional capture streams. This is now done in the WebProcess.

LayoutTests:

* platform/ios-wk2/TestExpectations:

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

3 years agoClean up some WebProcessProxy, WebPage, and message handler includes
timothy_horton@apple.com [Sun, 7 May 2017 18:03:05 +0000 (18:03 +0000)]
Clean up some WebProcessProxy, WebPage, and message handler includes
https://bugs.webkit.org/show_bug.cgi?id=171791

Reviewed by Sam Weinig.

This is worth another ~10% off WebKit2 clean build time on Mac.
This time, the most impactful change is the removal of
UserMediaPermissionRequestManager.h from WebPage.h, which completely
eradicates JSC's VM.h (which is enormous) from WebPage.h (at least on Mac).

* Scripts/webkit/messages.py:
(headers_for_type):
Stop specializing CompositionUnderline now that it has its own file.

* Shared/API/c/WKDeprecatedFunctions.cpp:
* Shared/WebCoreArgumentCoders.cpp:
* UIProcess/API/Cocoa/WKBrowsingContextGroup.mm:
* UIProcess/Gamepad/UIGamepadProvider.cpp:
* UIProcess/HiddenPageThrottlingAutoIncreasesCounter.h: Added.
* UIProcess/HighPerformanceGraphicsUsageSampler.cpp:
* UIProcess/Network/NetworkProcessProxy.cpp:
* UIProcess/PerActivityStateCPUUsageSampler.cpp:
* UIProcess/UserContent/WebUserContentControllerProxy.cpp:
* UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
(WebKit::toWebCore):
* UIProcess/VisibleWebPageCounter.h: Added.
* UIProcess/VisitedLinkStore.h:
* UIProcess/WebPageGroup.h:
* UIProcess/WebPageProxy.h:
* UIProcess/WebProcessLifetimeTracker.cpp:
* UIProcess/WebProcessPool.h:
* UIProcess/WebProcessProxy.h:
Remove WebPageProxy and forward-declare a whole bunch of things.

* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/WebCoreSupport/WebUserMediaClient.cpp:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::userMediaAccessWasGranted):
(WebKit::WebPage::userMediaAccessWasDenied):
(WebKit::WebPage::didCompleteMediaDeviceEnumeration):
(WebKit::WebPage::grantUserMediaDeviceSandboxExtensions):
(WebKit::WebPage::revokeUserMediaDeviceSandboxExtensions):
* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::userMediaPermissionRequestManager):
* WebProcess/WebPage/ios/FindControllerIOS.mm:
* WebProcess/WebPage/ios/WebPageIOS.mm:
* WebProcess/WebPage/mac/RemoteLayerTreeContext.h:
(WebKit::RemoteLayerTreeContext::deviceScaleFactor): Deleted.
(WebKit::RemoteLayerTreeContext::layerHostingMode): Deleted.
* WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:
(WebKit::RemoteLayerTreeContext::deviceScaleFactor):
(WebKit::RemoteLayerTreeContext::layerHostingMode):

* WebCore.xcodeproj/project.pbxproj:
* editing/CompositionUnderline.h: Added.
(WebCore::CompositionUnderline::CompositionUnderline):
* editing/Editor.h:
(WebCore::CompositionUnderline::CompositionUnderline): Deleted.
Move CompositionUnderline out of Editor.h, so that other files can
include that without Editor.h (which is quite large). Also, modernize it slightly.

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

3 years agoImplement Subresource Integrity (SRI)
commit-queue@webkit.org [Sun, 7 May 2017 10:24:48 +0000 (10:24 +0000)]
Implement Subresource Integrity (SRI)
https://bugs.webkit.org/show_bug.cgi?id=148363
LayoutTests/imported/w3c:

Patch by Sam Weinig <sam@webkit.org> on 2017-05-07
Reviewed by Daniel Bates.

* web-platform-tests/html/dom/reflection-metadata-expected.txt:
* web-platform-tests/html/dom/reflection-misc-expected.txt:
Update results now that we support the reflected 'integrity' property.

Source/WebCore:

<rdar://problem/18945879>

Patch by Sam Weinig <sam@webkit.org> on 2017-05-07
Reviewed by Daniel Bates.

Tests: http/tests/subresource-integrity/sri-disabled-with-setting.html
       http/tests/subresource-integrity/sri-enabled-with-setting.html
       http/tests/subresource-integrity/sri-script-cors.html
       http/tests/subresource-integrity/sri-style-cors.html

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
Add new files.

* dom/LoadableClassicScript.cpp:
(WebCore::LoadableClassicScript::create):
(WebCore::LoadableClassicScript::notifyFinished):
* dom/LoadableClassicScript.h:
* dom/LoadableScript.h:
* dom/ScriptElement.cpp:
(WebCore::ScriptElement::requestClassicScript):
Store integrity metadata in the script fetcher so it can be passed to
the checked when script load finishes.

* html/HTMLAttributeNames.in:
Add 'integrity'.

* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::process):
When requesting a stylesheet, cache the integrity metadata so it can
be used when the load completes (accessing the attribute at load completion
time is incorrect, as a script might have changed the attributes value since
the request was made).

(WebCore::HTMLLinkElement::setCSSStyleSheet):
Add an integrity check using the cached integrity metadata when a load
finishes.

* html/HTMLLinkElement.h:
Add cached integrity metadata member.

* html/HTMLLinkElement.idl:
* html/HTMLScriptElement.idl:
Add integrity property.

* html/parser/HTMLParserIdioms.h:
(WebCore::isNotHTMLSpace):
Templatize isNotHTMLSpace so it can work for both UChar and LChar.

* loader/ResourceCryptographicDigest.cpp:
(WebCore::parseCryptographicDigestImpl):
(WebCore::parseEncodedCryptographicDigestImpl):
(WebCore::parseEncodedCryptographicDigest):
(WebCore::decodeEncodedResourceCryptographicDigest):
* loader/ResourceCryptographicDigest.h:
Add concept of an encoded digest to more closely model the spec so that hashes
that match the grammar but are invalid (say, mixing base64 and base64URL) make
it through the algorithm longer, and don't cause us to load something that should
be blocked.

* loader/SubresourceIntegrity.cpp: Added.
* loader/SubresourceIntegrity.h: Added.
Add implementation of Subresource Integrity metadata validation allowing
for a CachedResource and integrity metadata to be passed for validation.

* page/Settings.in:
Add setting for Subresource Integrity, defaulted to enabled.

LayoutTests:

<rdar://problem/18945879>

Patch by Sam Weinig <sam@webkit.org> on 2017-05-07
Reviewed by Daniel Bates.

Add tests for Subresource Integrity based off the ones from Web
Platform Tests. They have been changed to:
- Split <link> and <script> testing.
- Add additional tests:
    - Integrity hashes using base64URL encoding.
    - Integrity hashes using mixed base64 and base64URL encoding.
    - Integrity metadata that does not conform to the grammar at all.
    - Multiple valid, but only one matching, integrity hashes.
    - Non-matching integrity hash with options.
- Run one at a time, so console output is consistent.

We can/should upstream these changes, but this avoids the possibility that
an update of the imported web-platform-tests could cause these tests to fail.

Also adds tests that show the Subresource Integrity setting works correctly.

* http/tests/subresource-integrity: Added.
* http/tests/subresource-integrity/.htaccess: Added.
* http/tests/subresource-integrity/resources: Added.
* http/tests/subresource-integrity/resources/alternate.css: Added.
* http/tests/subresource-integrity/resources/crossorigin-anon-script.js: Added.
* http/tests/subresource-integrity/resources/crossorigin-anon-style.css: Added.
* http/tests/subresource-integrity/resources/crossorigin-creds-script.js: Added.
* http/tests/subresource-integrity/resources/crossorigin-creds-style.css: Added.
* http/tests/subresource-integrity/resources/crossorigin-ineligible-script.js: Added.
* http/tests/subresource-integrity/resources/crossorigin-ineligible-style.css: Added.
* http/tests/subresource-integrity/resources/matching-digest.js: Added.
* http/tests/subresource-integrity/resources/non-matching-digest.js: Added.
* http/tests/subresource-integrity/resources/sri-utilities.js: Added.
* http/tests/subresource-integrity/resources/style.css: Added.
* http/tests/subresource-integrity/sri-disabled-with-setting-expected.txt: Added.
* http/tests/subresource-integrity/sri-disabled-with-setting.html: Added.
* http/tests/subresource-integrity/sri-enabled-with-setting-expected.txt: Added.
* http/tests/subresource-integrity/sri-enabled-with-setting.html: Added.
* http/tests/subresource-integrity/sri-script-expected.txt: Added.
* http/tests/subresource-integrity/sri-script.html: Added.
* http/tests/subresource-integrity/sri-style-expected.txt: Added.
* http/tests/subresource-integrity/sri-style.html: Added.

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

3 years ago[GTK] Cannot sign in with new Google sign-in page
mcatanzaro@igalia.com [Sun, 7 May 2017 09:29:45 +0000 (09:29 +0000)]
[GTK] Cannot sign in with new Google sign-in page
https://bugs.webkit.org/show_bug.cgi?id=171770

Reviewed by Carlos Garcia Campos.

Google's new authentication page does not work with the Firefox user
agent that's required to make various Google websites work. Special-case
accounts.google.com so that it receives our standard user agent.

* platform/UserAgentQuirks.cpp:
(WebCore::isGoogle):
(WebCore::urlRequiresFirefoxBrowser):

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

3 years ago[Cocoa] CTFontDescriptorCreateMatchingFontDescriptor() is not case insensitive
mmaxfield@apple.com [Sun, 7 May 2017 05:43:29 +0000 (05:43 +0000)]
[Cocoa] CTFontDescriptorCreateMatchingFontDescriptor() is not case insensitive
https://bugs.webkit.org/show_bug.cgi?id=171636
<rdar://problem/30811218>

Reviewed by Dean Jackson.

Source/WebCore:

LastResort is the only name which needs to be looked up case-sensitively. We can handle
this in our existing function which handles special font names (like -apple-system) to
make sure that we always do the right thing.

Test: fast/text/lastResort.html

* platform/graphics/ios/FontCacheIOS.mm:
(WebCore::platformFontWithFamilySpecialCase):
* platform/graphics/mac/FontCacheMac.mm:
(WebCore::platformFontWithFamilySpecialCase):
* platform/spi/cocoa/CoreTextSPI.h:

LayoutTests:

* fast/text/lastResort-expected.html: Added.
* fast/text/lastResort.html: Added.

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

3 years agoImplement the concept of cookie-averse document
cdumez@apple.com [Sun, 7 May 2017 05:18:34 +0000 (05:18 +0000)]
Implement the concept of cookie-averse document
https://bugs.webkit.org/show_bug.cgi?id=171746
<rdar://problem/32004466>

Reviewed by Sam Weinig.

Source/WebCore:

Implement the concept of cookie-averse document:
- https://html.spec.whatwg.org/#cookie-averse-document-object

Test: fast/cookies/cookie-averse-document.html

* dom/Document.cpp:
(WebCore::Document::isCookieAverse):
(WebCore::Document::cookie):
(WebCore::Document::setCookie):
* dom/Document.h:

LayoutTests:

Add layout test coverage.

* fast/cookies/cookie-averse-document-expected.txt: Added.
* fast/cookies/cookie-averse-document.html: Added.

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

3 years agoUnreviewed build fix after r216339.
cdumez@apple.com [Sun, 7 May 2017 03:57:05 +0000 (03:57 +0000)]
Unreviewed build fix after r216339.

* dom/Document.h:
(WebCore::Document::readyState):

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

3 years agoAlign our IDL files with the latest DOM specification
cdumez@apple.com [Sun, 7 May 2017 03:48:28 +0000 (03:48 +0000)]
Align our IDL files with the latest DOM specification
https://bugs.webkit.org/show_bug.cgi?id=171777

Reviewed by Sam Weinig.

Source/WebCore:

Align our IDL files with the latest DOM specification:
- https://dom.spec.whatwg.org

No Web-facing behavior change. Things that do not match the specification
have been annotated with FIXME comments.

* dom/CharacterData.idl:
* dom/Comment.idl:
* dom/CustomEvent.idl:
* dom/DOMImplementation.idl:
* dom/Document.cpp:
* dom/Document.h:
(WebCore::Document::readyState):
* dom/Document.idl:
* dom/MutationObserver.idl:
* dom/NamedNodeMap.idl:
* dom/NodeFilter.idl:
* dom/NodeIterator.idl:
* dom/NodeList.idl:
* dom/NonDocumentTypeChildNode.idl:
* dom/ParentNode.idl:
* dom/ProcessingInstruction.idl:
* dom/Range.idl:
* dom/ShadowRoot.idl:
* dom/Text.idl:
* dom/TreeWalker.idl:
* html/DOMTokenList.idl:

Source/WebKit/mac:

Build fix.

* DOM/DOMDocument.mm:
(-[DOMDocument readyState]):

Source/WebKit2:

GTK build fix.

* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.cpp:
(webkit_dom_document_get_ready_state):

LayoutTests:

Rebaseline a few tests.

* fast/dom/Document/adoptNode-null-expected.txt:
* fast/dom/Document/adoptNode-null.html:
* fast/dom/Document/importNode-null-expected.txt:
* fast/dom/Document/importNode-null.html:
* fast/dom/Range/range-intersectsNode-expected.txt:
* fast/text/text-combine-crash-expected.txt:

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

3 years agoReduce the number of includes in WebPage.h and WebProcess.h
timothy_horton@apple.com [Sun, 7 May 2017 03:25:20 +0000 (03:25 +0000)]
Reduce the number of includes in WebPage.h and WebProcess.h
https://bugs.webkit.org/show_bug.cgi?id=171779

Reviewed by Sam Weinig.

* WebProcess/InjectedBundle/API/APIInjectedBundleEditorClient.h:
* WebProcess/Network/NetworkProcessConnection.cpp:
* WebProcess/Network/webrtc/LibWebRTCProvider.cpp:
* WebProcess/Network/webrtc/LibWebRTCResolver.cpp:
* WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm:
* WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
* WebProcess/WebPage/FindController.cpp:
* WebProcess/WebPage/WebFrame.cpp:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::disableEnumeratingAllNetworkInterfaces):
(WebKit::WebPage::enableEnumeratingAllNetworkInterfaces):
(WebKit::WebPage::didReceivePolicyDecision):
* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::disableEnumeratingAllNetworkInterfaces): Deleted.
(WebKit::WebPage::enableEnumeratingAllNetworkInterfaces): Deleted.
* WebProcess/WebPage/ios/FindIndicatorOverlayClientIOS.h:
* WebProcess/WebProcess.cpp:
* WebProcess/WebProcess.h:
In my measurement, this improves WebKit2 debug clean build time by
~10% for Mac and ~5% for iOS. The most valuable change is the one to
remove LibWebRTC headers..

* page/TextIndicator.h:

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

3 years agoMark http/tests/loading/resourceLoadStatistics/prevalent-resource-without-user-intera...
ap@apple.com [Sun, 7 May 2017 03:18:27 +0000 (03:18 +0000)]
Mark http/tests/loading/resourceLoadStatistics/prevalent-resource-without-user-interaction.html as flaky
https://bugs.webkit.org/show_bug.cgi?id=171785

* platform/wk2/TestExpectations:

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

3 years agoREGRESSION (r216294): The new test fails on WebKit1
ap@apple.com [Sun, 7 May 2017 02:58:23 +0000 (02:58 +0000)]
REGRESSION (r216294): The new test fails on WebKit1
https://bugs.webkit.org/show_bug.cgi?id=171780

Rolling back https://trac.webkit.org/r216294, https://trac.webkit.org/r216296,
https://trac.webkit.org/216299, https://trac.webkit.org/216330

Source/WebCore:

* page/FrameView.cpp:
(WebCore::FrameView::paintContents):
* page/FrameView.h:
* platform/ScrollView.cpp:
(WebCore::ScrollView::paint):
* platform/ScrollView.h:
* platform/Scrollbar.cpp:
(WebCore::Scrollbar::paint):
* platform/Scrollbar.h:
* platform/Widget.h:
* platform/graphics/filters/FilterOperation.h:
(WebCore::FilterOperation::movesPixels):
(WebCore::FilterOperation::shouldBeRestrictedBySecurityOrigin): Deleted.
* platform/graphics/filters/FilterOperations.cpp:
(WebCore::FilterOperations::hasFilterThatShouldBeRestrictedBySecurityOrigin): Deleted.
* platform/graphics/filters/FilterOperations.h:
* platform/gtk/WidgetGtk.cpp:
(WebCore::Widget::paint):
* platform/ios/WidgetIOS.mm:
(WebCore::Widget::paint):
* platform/mac/WidgetMac.mm:
(WebCore::Widget::paint):
* platform/win/WidgetWin.cpp:
(WebCore::Widget::paint):
* rendering/FilterEffectRenderer.cpp:
(WebCore::FilterEffectRenderer::build):
* rendering/FilterEffectRenderer.h:
* rendering/PaintInfo.h:
(WebCore::PaintInfo::PaintInfo):
(): Deleted.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::paint):
(WebCore::RenderLayer::setupFilters):
(WebCore::RenderLayer::paintForegroundForFragmentsWithPhase):
* rendering/RenderLayer.h:
* rendering/RenderScrollbar.cpp:
(WebCore::RenderScrollbar::paint):
* rendering/RenderScrollbar.h:
* rendering/RenderWidget.cpp:
(WebCore::RenderWidget::paintContents):

Source/WebKit/win:

* Plugins/PluginView.h:
* Plugins/PluginViewWin.cpp:
(WebCore::PluginView::paint):

Source/WebKit2:

* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::paint):
* WebProcess/Plugins/PluginView.h:

LayoutTests:

* http/tests/css/filters-on-iframes-expected.html: Removed.
* http/tests/css/filters-on-iframes.html: Removed.
* http/tests/css/resources/blank.html: Removed.
* http/tests/css/resources/references-external.html: Removed.
* http/tests/css/resources/solid-red.html: Removed.

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

3 years ago[iOS WK2] Make rotation tests more reliable
simon.fraser@apple.com [Sun, 7 May 2017 02:53:51 +0000 (02:53 +0000)]
[iOS WK2] Make rotation tests more reliable
https://bugs.webkit.org/show_bug.cgi?id=171778

Reviewed by Tim Horton.

Source/WebKit2:

Switching between "safari-style" rotation and normal rotation left state on the WKWebView
that would cause later viewport-sensitive tests to fail. The WKWebView would be left
with override layout parameters, and an override orientation, and these caused viewport
size to leak into later tests, and WebCore orientation to not get reset correctly.

Also, WKWebView was unregistering for UIWindowDidRotateNotification notifications when
an override orientation was set, and would never re-register, causing lost orientationchanged
events.

Fix by exposing WKWebView SPI to clear the various bits of overide state. Also don't unregister
from the UIWindowDidRotateNotification notification; it's already ignored anyway if it fires.

Also wait for a visible content rect update after resizing the WKWebVeiw between tests, to make sure
the WebProcess is caught up before proceeding with the test.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _setInterfaceOrientationOverride:]):
(-[WKWebView _clearInterfaceOrientationOverride]):
(-[WKWebView _beginAnimatedResizeWithUpdates:]):
(-[WKWebView _clearOverrideLayoutParameters]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:

Tools:

Switching between "safari-style" rotation and normal rotation left state on the WKWebView
that would cause later viewport-sensitive tests to fail. The WKWebView would be left
with override layout parameters, and an override orientation, and these caused viewport
size to leak into later tests, and WebCore orientation to not get reset correctly.

Also, WKWebView was unregistering for UIWindowDidRotateNotification notifications when
an override orientation was set, and would never re-register, causing lost orientationchanged
events.

Fix by exposing WKWebView SPI to clear the various bits of overide state. Also don't unregister
from the UIWindowDidRotateNotification notification; it's already ignored anyway if it fires.

Also wait for a visible content rect update after resizing the WKWebVeiw between tests, to make sure
the WebProcess is caught up before proceeding with the test.

* WebKitTestRunner/ios/PlatformWebViewIOS.mm:
(-[PlatformWebViewController viewWillTransitionToSize:withTransitionCoordinator:]):
* WebKitTestRunner/ios/TestControllerIOS.mm:
(WTR::TestController::platformResetStateToConsistentValues):
(WTR::TestController::platformConfigureViewForTest):

LayoutTests:

New baseline.

* fast/events/ios/rotation/zz-no-rotation-expected.txt:
* fast/events/ios/rotation/zz-no-rotation.html:

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

3 years agoUnreviewed, rolling out r216333.
cdumez@apple.com [Sat, 6 May 2017 23:39:51 +0000 (23:39 +0000)]
Unreviewed, rolling out r216333.

Caused layout test failures

Reverted changeset:

"Implement the concept of cookie-averse document"
https://bugs.webkit.org/show_bug.cgi?id=171746
http://trac.webkit.org/changeset/216333

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

3 years agoImplement the concept of cookie-averse document
cdumez@apple.com [Sat, 6 May 2017 20:32:35 +0000 (20:32 +0000)]
Implement the concept of cookie-averse document
https://bugs.webkit.org/show_bug.cgi?id=171746
<rdar://problem/32004466>

Reviewed by Sam Weinig.

Source/WebCore:

Implement the concept of cookie-averse document:
- https://html.spec.whatwg.org/#cookie-averse-document-object

Test: fast/cookies/cookie-averse-document.html

* dom/Document.cpp:
(WebCore::Document::isCookieAverse):
(WebCore::Document::cookie):
(WebCore::Document::setCookie):
* dom/Document.h:

LayoutTests:

Add layout test coverage.

* fast/cookies/cookie-averse-document-expected.txt: Added.
* fast/cookies/cookie-averse-document.html: Added.

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

3 years agoFix 32bit Windows build by giving correct parameters to MASM
commit-queue@webkit.org [Sat, 6 May 2017 18:06:03 +0000 (18:06 +0000)]
Fix 32bit Windows build by giving correct parameters to MASM
https://bugs.webkit.org/show_bug.cgi?id=170833

Patch by Bill Ming <mbbill@gmail.com> on 2017-05-06
Reviewed by Alex Christensen.

* CMakeLists.txt:

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

3 years agoREGERSSION(r213499): Emoji with Fitzpatrick modifiers are drawn as two separate glyphs
mmaxfield@apple.com [Sat, 6 May 2017 17:54:16 +0000 (17:54 +0000)]
REGERSSION(r213499): Emoji with Fitzpatrick modifiers are drawn as two separate glyphs
https://bugs.webkit.org/show_bug.cgi?id=171750
<rdar://problem/31122612>

Reviewed by Zalan Bujtas.

Source/WebCore:

Emoji with Fitzpatrick modifiers need to take our complex text codepath. When looking through
the string to determine which code path to use, we ask if a particular codepoint is an emoji
group candidate. r213499 expanded the set of these candidates to include Fitzpatrick modifiers,
which means the next "if" statement would never be hit. Instead, we should check that "if"
statement first (because order is not important here). The next checks do not intersect with
any emoji group candidates.

Test: fast/text/fitzpatrick-combination.html

* platform/graphics/FontCascade.cpp:
(WebCore::FontCascade::characterRangeCodePath):

LayoutTests:

* fast/text/fitzpatrick-combination-expected.html: Added.
* fast/text/fitzpatrick-combination.html: Added.

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

3 years agoFix Windows build after r216294.
simon.fraser@apple.com [Sat, 6 May 2017 17:31:10 +0000 (17:31 +0000)]
Fix Windows build after r216294.

* Plugins/PluginView.h:
* Plugins/PluginViewWin.cpp:
(WebCore::PluginView::paint):

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

3 years ago[ES6] Arrow function. Issue in access to this after eval('super()') within constructor
gskachkov@gmail.com [Sat, 6 May 2017 17:16:12 +0000 (17:16 +0000)]
[ES6] Arrow function. Issue in access to this after eval('super()') within constructor
https://bugs.webkit.org/show_bug.cgi?id=171543

Reviewed by Saam Barati.

JSTests:

* stress/arrowfunction-lexical-bind-supercall-4.js:
(J):
(K):

Source/JavaScriptCore:

Current patch force to use 'this' within arrow function or eval
from virtual scope each time, instead of using thisRegister.

* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::ensureThis):

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

3 years agoRemove unused lambda capture
annulen@yandex.ru [Sat, 6 May 2017 17:15:44 +0000 (17:15 +0000)]
Remove unused lambda capture
https://bugs.webkit.org/show_bug.cgi?id=171772

Reviewed by Yusuke Suzuki.

* DatabaseProcess/DatabaseProcess.cpp:
(WebKit::DatabaseProcess::fetchWebsiteData):

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

3 years agomessages_unittest.py should support a [-r|--reset-results] switch
ddkilzer@apple.com [Sat, 6 May 2017 15:05:48 +0000 (15:05 +0000)]
messages_unittest.py should support a [-r|--reset-results] switch
<https://webkit.org/b/171627>

Reviewed by Daniel Bates.

This change adds support for a [-r|--reset-results] switch when
running messages_unittest.py to make it easy to update the
expected file results.

This also cleans up a lot of duplicate code in
messages_unittest.py by extracting common code into new methods
and by pushing code down into methods where it's actually used.

* Scripts/webkit/LegacyMessageReceiver-expected.cpp:
* Scripts/webkit/LegacyMessages-expected.h:
* Scripts/webkit/MessageReceiver-expected.cpp:
* Scripts/webkit/MessageReceiverSuperclass-expected.cpp:
* Scripts/webkit/Messages-expected.h:
* Scripts/webkit/MessagesSuperclass-expected.h:
- Update expected files using the new --reset-results switch.

* Scripts/webkit/messages_unittest.py:
- Remove what appears to be a debugging print statement.
- Replace the code that reads in expected files with variables
  that contain the expected file names.  The code to read in the
  contents moved into
  GeneratedFileContentsTest.assertGeneratedFileContentsEqual().
(ParsingTest.check_message):
- Drive-by fix to change "!= None" to "is not None".
(GeneratedFileContentsTest.assertGeneratedFileContentsEqual):
- Add support for [-r|--reset-results] switch here.  This will
  write out updated expected file contents when the switch is
  used.
- Push down most of the global code that reads in file contents
  into this method.
- Change use of split('\n') into splitlines(False).
(GeneratedFileContentsTest.assertHeaderEqual): Add.
- Extracts common code from test_receiver_headers().
(GeneratedFileContentsTest.assertImplementationEqual): Add.
- Extracts common code from test_receiver_implementations().
(HeaderTest):
(HeaderTest.test_receiver_headers):
- Rename from HeaderTest.test_header().
- Simplify by calling assertHeaderEqual().
(ReceiverImplementationTest):
(ReceiverImplementationTest.test_receiver_implementations):
- Rename from
  ReceiverImplementationTest.test_receiver_implementation().
- Simplify by calling assertImplementationEqual().
(add_reset_results_to_unittest_help): Add.
- Inserts help text for [-r|--reset-results] switch.
(parse_sys_argv): Add.
- Parses [-r|--reset-results] switch, and then removes it from
  sys.argv.  We do this instead of using argparse so that the
  original help for the unittest module is still shown when
  using --help.

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

3 years ago[Mac][cmake] Buildfix after r216047
ossy@webkit.org [Sat, 6 May 2017 11:34:09 +0000 (11:34 +0000)]
[Mac][cmake] Buildfix after r216047
https://bugs.webkit.org/show_bug.cgi?id=171769

Unreviewed buildfix.

* WebKitTestRunner/cocoa/TestRunnerWKWebView.mm:

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

3 years agoRealtimeMediaSourceCenter callbacks should be passed as r-values
commit-queue@webkit.org [Sat, 6 May 2017 08:55:59 +0000 (08:55 +0000)]
RealtimeMediaSourceCenter callbacks should be passed as r-values
https://bugs.webkit.org/show_bug.cgi?id=171407

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

No change of behavior, this is mostly style here.

* platform/mediastream/RealtimeMediaSourceCenter.h:
* platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
(WebCore::RealtimeMediaSourceCenterMac::validateRequestConstraints):
(WebCore::RealtimeMediaSourceCenterMac::createMediaStream):
* platform/mediastream/mac/RealtimeMediaSourceCenterMac.h:
* platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp:
(WebCore::RealtimeMediaSourceCenterOwr::validateRequestConstraints):
* platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.h:
* platform/mock/MockRealtimeMediaSourceCenter.cpp:
(WebCore::MockRealtimeMediaSourceCenter::validateRequestConstraints):
(WebCore::MockRealtimeMediaSourceCenter::createMediaStream):
* platform/mock/MockRealtimeMediaSourceCenter.h:

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

3 years agoPut does not properly consult the prototype chain
keith_miller@apple.com [Sat, 6 May 2017 05:19:39 +0000 (05:19 +0000)]
Put does not properly consult the prototype chain
https://bugs.webkit.org/show_bug.cgi?id=171754

Reviewed by Saam Barati.

We should do a follow up that cleans up the rest of put. See:
https://bugs.webkit.org/show_bug.cgi?id=171759

* runtime/JSCJSValue.cpp:
(JSC::JSValue::putToPrimitive):
* runtime/JSObject.cpp:
(JSC::JSObject::putInlineSlow):
* runtime/JSObjectInlines.h:
(JSC::JSObject::canPerformFastPutInline):

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

3 years ago[WTF] Use memoryFootprint for MemoryUsage retrieval in Linux
utatane.tea@gmail.com [Sat, 6 May 2017 04:55:04 +0000 (04:55 +0000)]
[WTF] Use memoryFootprint for MemoryUsage retrieval in Linux
https://bugs.webkit.org/show_bug.cgi?id=171757

Reviewed by Michael Catanzaro.

This patch leverages memoryFootprint() to retrieve physical footprint in Linux.

* wtf/linux/MemoryPressureHandlerLinux.cpp:
(WTF::MemoryPressureHandler::ReliefLogger::platformMemoryUsage):

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

3 years agoRenderers being destroyed should not be added to AX's deferred list.
zalan@apple.com [Sat, 6 May 2017 04:41:32 +0000 (04:41 +0000)]
Renderers being destroyed should not be added to AX's deferred list.
https://bugs.webkit.org/show_bug.cgi?id=171768
<rdar://problem/31955660>

Reviewed by Simon Fraser.

Source/WebCore:

In certain cases, when custom scrollbars are present, while destroying the scrollbars' block parent, we
  - first remove the block from the AX's deferred list (AXObjectCache::remove)
  - destroy the render layer that owns the custom scrollbars (RenderLayer::destroyLayer)
  - detach the scrollbars from the parent (block) (RenderObject::removeFromParent)
    - clean up the block's lines (RenderBlock::deleteLines)
      - push the block back to the AX's deferred list (AXObjectCache::recomputeDeferredIsIgnored)
At this point no one will remove the current block from AX's deferred list.

Test: accessibility/crash-when-renderers-are-added-back-to-deferred-list.html

* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::recomputeDeferredIsIgnored):
(WebCore::AXObjectCache::deferTextChanged):

LayoutTests:

* accessibility/crash-when-renderers-are-added-back-to-deferred-list-expected.txt: Added.
* accessibility/crash-when-renderers-are-added-back-to-deferred-list.html: Added.

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

3 years agoWebAssembly: Air::Inst::generate crashes on large binary on A64
jfbastien@apple.com [Sat, 6 May 2017 03:57:42 +0000 (03:57 +0000)]
WebAssembly: Air::Inst::generate crashes on large binary on A64
https://bugs.webkit.org/show_bug.cgi?id=170215

Reviewed by Filip Pizlo.

ARM can't encode all offsets in a single instruction. We usualy
handle this type of detail early, or the macro assembler uses a
scratch register to take care of the large immediate. After
register allocation we assumed that we would never get large
offsets, and asserted this was the case. That was a fine
assumption with JavaScript, but WebAssembly ends up generating
stack frames which are too big to encode.

There are two places that needed to be fixed:
    1. AirGenerate
    2. AirLowerStackArgs

We now unconditionally pin the dataTempRegister on ARM64, and use
it when immediates don't fit.

Number 1. is easy: we're just incrementing SP, make sure we can
use a scratch register when that happens.

Number 2. is more complex: not all Inst can receive a stack
argument whose base register isn't SP or FP. Specifically,
Patchpoints and Stackmaps get very sad because they just want to
know the offset value, but when we materialize the offset as
follows:

    Move (spill337), (spill201), %r0, @8735

Becomes (where %r16 is dataTempRegister):
    Move $1404, %r16, @8736
    Add64 %sp, %r16, @8736
    Move (%r16), 2032(%sp), %r0, @8736

The code currently doesn't see through our little dance. To work
around this issue we introduce a new Air Arg kind:
ExtendedOffsetAddr. This is the same as a regular Addr, but with
an offset which may be too big to encode. Opcodes then declare
whether their arguments can handle such inputs, and if so we
generate them, otherwise we generate Addr as shown above.

None of this affects x86 because it can always encode large
immediates.

This patch also drive-by converts some uses of `override` to
`final`. It makes the code easier to grok, and maybe helps the
optimizer sometimes but really that doens't matter.

* assembler/MacroAssembler.h:
* assembler/MacroAssemblerARM64.h:
* b3/B3CheckSpecial.cpp:
(JSC::B3::CheckSpecial::admitsExtendedOffsetAddr):
* b3/B3CheckSpecial.h:
* b3/B3Common.cpp:
(JSC::B3::pinnedExtendedOffsetAddrRegister): keep the CPU-specific
pinning information in a cpp file
* b3/B3Common.h:
* b3/B3PatchpointSpecial.cpp:
(JSC::B3::PatchpointSpecial::admitsExtendedOffsetAddr):
* b3/B3PatchpointSpecial.h:
* b3/B3StackmapSpecial.cpp:
(JSC::B3::StackmapSpecial::isArgValidForRep):
(JSC::B3::StackmapSpecial::repForArg):
* b3/B3StackmapSpecial.h:
* b3/air/AirArg.cpp:
(JSC::B3::Air::Arg::isStackMemory):
(JSC::B3::Air::Arg::jsHash):
(JSC::B3::Air::Arg::dump):
(WTF::printInternal):
(JSC::B3::Air::Arg::stackAddrImpl): Deleted. There was only one
use of this (in AirLowerStackArgs) and it was now confusing to
split the logic up between these two. Inline the code that used to
be here into its one usepoint instead.
* b3/air/AirArg.h:
(JSC::B3::Air::Arg::extendedOffsetAddr):
(JSC::B3::Air::Arg::isExtendedOffsetAddr):
(JSC::B3::Air::Arg::isMemory):
(JSC::B3::Air::Arg::base):
(JSC::B3::Air::Arg::offset):
(JSC::B3::Air::Arg::isGP):
(JSC::B3::Air::Arg::isFP):
(JSC::B3::Air::Arg::isValidForm):
(JSC::B3::Air::Arg::forEachTmpFast):
(JSC::B3::Air::Arg::forEachTmp):
(JSC::B3::Air::Arg::asAddress):
(JSC::B3::Air::Arg::stackAddr): Deleted.
* b3/air/AirCCallSpecial.cpp:
(JSC::B3::Air::CCallSpecial::isValid):
(JSC::B3::Air::CCallSpecial::admitsExtendedOffsetAddr):
(JSC::B3::Air::CCallSpecial::generate):
* b3/air/AirCCallSpecial.h:
* b3/air/AirCode.cpp:
(JSC::B3::Air::Code::Code):
(JSC::B3::Air::Code::pinRegister): Check that the register wasn't
pinned before pinning it. It's likely a bug to pin the same
register twice.
* b3/air/AirCustom.h:
(JSC::B3::Air::PatchCustom::admitsExtendedOffsetAddr):
(JSC::B3::Air::CCallCustom::admitsExtendedOffsetAddr):
(JSC::B3::Air::ShuffleCustom::admitsExtendedOffsetAddr):
(JSC::B3::Air::EntrySwitchCustom::admitsExtendedOffsetAddr):
(JSC::B3::Air::WasmBoundsCheckCustom::admitsExtendedOffsetAddr):
* b3/air/AirGenerate.cpp:
(JSC::B3::Air::generate):
* b3/air/AirInst.h:
* b3/air/AirInstInlines.h:
(JSC::B3::Air::Inst::admitsExtendedOffsetAddr):
* b3/air/AirLowerStackArgs.cpp:
(JSC::B3::Air::lowerStackArgs):
* b3/air/AirPrintSpecial.cpp:
(JSC::B3::Air::PrintSpecial::admitsExtendedOffsetAddr):
(JSC::B3::Air::PrintSpecial::generate):
* b3/air/AirPrintSpecial.h:
* b3/air/AirSpecial.h:
* b3/air/opcode_generator.rb:

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

3 years agoCrash in ImageFrameCache::decodedSizeChanged() after image load cancellation
said@apple.com [Sat, 6 May 2017 03:27:16 +0000 (03:27 +0000)]
Crash in ImageFrameCache::decodedSizeChanged() after image load cancellation
https://bugs.webkit.org/show_bug.cgi?id=171736

Reviewed by Tim Horton.

Tests: Covered by run-webkit-tests fast/images/image-formats-support.html
--guard-malloc.

Because an image format is not supported, the ImageObserver of the Image
is deleted then the Image itself is deleted. In BitmapImage destructor,
we make a call which ends up accessing the deleted ImageObserver.

To fix this, we need to change the BitImage destructor to avoid calling
ImageFrameCache::decodedSizeChanged() since it is not really needed.

* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::~BitmapImage):

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

3 years agoREGRESSION (r212998): Web Inspector: bad spacing of go-to arrow for HTTP POST request...
nvasilyev@apple.com [Sat, 6 May 2017 01:59:14 +0000 (01:59 +0000)]
REGRESSION (r212998): Web Inspector: bad spacing of go-to arrow for HTTP POST request data
https://bugs.webkit.org/show_bug.cgi?id=171674

Reviewed by Matt Baker.

* UserInterface/Views/DetailsSection.css:
(body[dir=ltr] .details-section > .content > .group > .row.simple > .value .go-to-arrow):
(body[dir=rtl] .details-section > .content > .group > .row.simple > .value .go-to-arrow):
Swap margin-left and margin-right. This regressed when RTL support was added.

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

3 years ago[Mac] Adjust cursor position for dragged link (and stop it from moving based on how...
timothy_horton@apple.com [Sat, 6 May 2017 01:39:00 +0000 (01:39 +0000)]
[Mac] Adjust cursor position for dragged link (and stop it from moving based on how fast you are dragging)
https://bugs.webkit.org/show_bug.cgi?id=171764
<rdar://problem/32005865>

Reviewed by Simon Fraser.

* page/DragController.cpp:
(WebCore::DragController::startDrag):
Compute dragImageAnchorPoint only if it is needed.
Don't compute a random unused imageRect.
Factor link drag image offset computation out into DragImage functions
for platforms to override.

Pass dragOrigin (the mouseDown point), not mouseDraggedPoint, to
doSystemDrag, just like all the other drag types. This plus the
WebKit2 change makes the link stable vs. the cursor, instead of
positioned based on how fast you move after the mouse down.

* page/DragController.h:
* page/gtk/DragControllerGtk.cpp:
* page/mac/DragControllerMac.mm:
* page/win/DragControllerWin.cpp:
Move LinkDragBorderInset into DragImage, and share between the non-Mac platforms.

* platform/DragImage.cpp:
(WebCore::dragOffsetForLinkDragImage):
(WebCore::anchorPointForLinkDragImage):
* platform/DragImage.h:
As previously mentioned, move the computation of drag image offset here.

* platform/mac/DragImageMac.mm:
(WebCore::dragOffsetForLinkDragImage):
(WebCore::anchorPointForLinkDragImage):
Put the new drag image to the bottom right of the cursor.

* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::dragImageForView):
Always use the last mouse down event to originate the drag; this was a 2004 hack
to work around a seemingly-fixed macOS bug that somehow propagated into WebKit2.
With WebKit2, this would cause trouble because currentEvent could move on
during the bounce to the Web Content process and back, causing the delta between
clientPoint and the mouse point to be dependent on timing, and thus causing the
link to sit at timing-dependent distance from the cursor, instead of exactly
where dragOffsetForLinkDragImage placed it.

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

3 years agoMark compositing/tiling/non-active-window-tiles-size.html as flaky
ryanhaddad@apple.com [Sat, 6 May 2017 01:10:32 +0000 (01:10 +0000)]
Mark compositing/tiling/non-active-window-tiles-size.html as flaky
https://bugs.webkit.org/show_bug.cgi?id=171763

Unreviewed test gardening.

Patch by Matt Lewis <jlewis3@apple.com> on 2017-05-05

* platform/mac-wk2/TestExpectations:

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

3 years agoMove trivial String prototype functions to JS builtins
oliver@apple.com [Sat, 6 May 2017 00:33:20 +0000 (00:33 +0000)]
Move trivial String prototype functions to JS builtins
https://bugs.webkit.org/show_bug.cgi?id=171737

Reviewed by Saam Barati.

Source/JavaScriptCore:

Super simple change to migrate all of the old school
html-ifying string operations to builtin JS.

Core implementation is basically a 1-for-1 match to the spec.

* builtins/StringPrototype.js:
(globalPrivate.createHTML):
(anchor):
(big):
(blink):
(bold):
(fixed):
(fontcolor):
(fontsize):
(italics):
(link):
(small):
(strike):
(sub):
(sup):
* runtime/StringPrototype.cpp:
(JSC::StringPrototype::finishCreation):
(JSC::stringProtoFuncBig): Deleted.
(JSC::stringProtoFuncSmall): Deleted.
(JSC::stringProtoFuncBlink): Deleted.
(JSC::stringProtoFuncBold): Deleted.
(JSC::stringProtoFuncFixed): Deleted.
(JSC::stringProtoFuncItalics): Deleted.
(JSC::stringProtoFuncStrike): Deleted.
(JSC::stringProtoFuncSub): Deleted.
(JSC::stringProtoFuncSup): Deleted.
(JSC::stringProtoFuncFontcolor): Deleted.
(JSC::stringProtoFuncFontsize): Deleted.
(JSC::stringProtoFuncAnchor): Deleted.
(JSC::stringProtoFuncLink): Deleted.

LayoutTests:

Updated output

* js/dom/string-anchor-expected.txt:
* js/dom/string-anchor.html:
* js/dom/string-fontcolor-expected.txt:
* js/dom/string-fontcolor.html:
* js/dom/string-fontsize-expected.txt:
* js/dom/string-fontsize.html:
* js/dom/string-link-expected.txt:
* js/dom/string-link.html:

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

3 years agoLeaks always reports "WebKit Malloc Memory Pressure Handler" dispatch_queue/source...
commit-queue@webkit.org [Sat, 6 May 2017 00:24:11 +0000 (00:24 +0000)]
Leaks always reports "WebKit Malloc Memory Pressure Handler" dispatch_queue/source as leaking
https://bugs.webkit.org/show_bug.cgi?id=171532

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-05-05
Reviewed by Geoffrey Garen.

* bmalloc/Heap.cpp:
(bmalloc::Heap::Heap):
* bmalloc/Heap.h:
Store the dispatch_source_t in a member to avoid a false positive leak.

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

3 years ago...and now the GTK and Windows builds.
dino@apple.com [Sat, 6 May 2017 00:17:00 +0000 (00:17 +0000)]
...and now the GTK and Windows builds.

* platform/gtk/WidgetGtk.cpp:
(WebCore::Widget::paint):
* platform/win/WidgetWin.cpp:
(WebCore::Widget::paint):

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

3 years ago[WTF] Do not export deleted constructor in StringView
commit-queue@webkit.org [Sat, 6 May 2017 00:08:55 +0000 (00:08 +0000)]
[WTF] Do not export deleted constructor in StringView
https://bugs.webkit.org/show_bug.cgi?id=171751

Patch by Don Olmstead <don.olmstead@am.sony.com> on 2017-05-05
Reviewed by Alexey Proskuryakov.

* wtf/text/StringView.h:

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

3 years agoAPI test WebKit2.WebsiteDataStoreCustomPaths is failing on ios-simulator.
beidson@apple.com [Sat, 6 May 2017 00:08:42 +0000 (00:08 +0000)]
API test WebKit2.WebsiteDataStoreCustomPaths is failing on ios-simulator.
<rdar://problem/31977294> and https://bugs.webkit.org/show_bug.cgi?id=171513

Reviewed by Andy Estes.

Source/WebCore:

Covered by API test.

* platform/spi/cf/CFNetworkSPI.h:

Source/WebKit2:

* NetworkProcess/cocoa/NetworkProcessCocoa.mm:
(WebKit::NetworkProcess::syncAllCookies):

Tools:

* TestWebKitAPI/Tests/WebKit2Cocoa/WebsiteDataStoreCustomPaths.mm:
(TEST):

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

3 years agoTry to fix iOS build.
dino@apple.com [Sat, 6 May 2017 00:04:37 +0000 (00:04 +0000)]
Try to fix iOS build.

* platform/ios/WidgetIOS.mm:
(WebCore::Widget::paint):

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

3 years ago[JSC] Remove export from Intrinsic
commit-queue@webkit.org [Sat, 6 May 2017 00:03:25 +0000 (00:03 +0000)]
[JSC] Remove export from Intrinsic
https://bugs.webkit.org/show_bug.cgi?id=171752

Patch by Don Olmstead <don.olmstead@am.sony.com> on 2017-05-05
Reviewed by Alexey Proskuryakov.

* runtime/Intrinsic.h:

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

3 years agoRestrict SVG filters to accessible security origins
dino@apple.com [Fri, 5 May 2017 23:49:41 +0000 (23:49 +0000)]
Restrict SVG filters to accessible security origins
https://bugs.webkit.org/show_bug.cgi?id=118689
<rdar://problem/27362159>

Reviewed by Brent Fulgham.

Source/WebCore:

Certain SVG filters should only be allowed to operate
on content that is has SecurityOrigin access to. Implement
this by including a flag in PaintInfo and LayerPaintingInfo,
and have RenderWidget make sure the documents have acceptable
SecurityOrigins as it goes to paint.

This could be used as the first step in a "safe painting"
strategy, allowing some content to be rendered into a
canvas or via the element() CSS function... but it is only
a small first step.

Test: http/tests/css/filters-on-iframes.html

* page/FrameView.cpp:
(WebCore::FrameView::paintContents):
* page/FrameView.h:
* platform/ScrollView.cpp:
(WebCore::ScrollView::paint):
* platform/ScrollView.h:
* platform/Scrollbar.cpp:
(WebCore::Scrollbar::paint):
* platform/Scrollbar.h:
* platform/Widget.h:
* platform/graphics/filters/FilterOperation.h:
(WebCore::FilterOperation::shouldBeRestrictedBySecurityOrigin):
* platform/graphics/filters/FilterOperations.cpp:
(WebCore::FilterOperations::hasFilterThatShouldBeRestrictedBySecurityOrigin):
* platform/graphics/filters/FilterOperations.h:
* platform/mac/WidgetMac.mm:
(WebCore::Widget::paint):
* rendering/FilterEffectRenderer.cpp:
(WebCore::FilterEffectRenderer::build):
* rendering/FilterEffectRenderer.h:
* rendering/PaintInfo.h:
(WebCore::PaintInfo::PaintInfo):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::paint):
(WebCore::RenderLayer::setupFilters):
(WebCore::RenderLayer::paintForegroundForFragmentsWithPhase):
* rendering/RenderLayer.h:
* rendering/RenderScrollbar.cpp:
(WebCore::RenderScrollbar::paint):
* rendering/RenderScrollbar.h:
* rendering/RenderWidget.cpp:
(WebCore::RenderWidget::paintContents):

Source/WebKit2:

Update parameter lists.

* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::paint):
* WebProcess/Plugins/PluginView.h:

LayoutTests:

Add a test that shows safe frames, unsafe frames, and
then a safe frame that itself has an unsafe frame, to
show that the security requirements are being forwarded
down the tree.

* http/tests/css/filters-on-iframes-expected.html: Added.
* http/tests/css/filters-on-iframes.html: Added.
* http/tests/css/resources/blank.html: Added.
* http/tests/css/resources/references-external.html: Added.
* http/tests/css/resources/solid-red.html: Added.

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

3 years agoUnreviewed, rolling out r216273.
ryanhaddad@apple.com [Fri, 5 May 2017 23:46:45 +0000 (23:46 +0000)]
Unreviewed, rolling out r216273.

This change caused an assertion failure on WK1.

Reverted changeset:

"Crash in ImageFrameCache::decodedSizeChanged() after image
load cancellation"
https://bugs.webkit.org/show_bug.cgi?id=171736
http://trac.webkit.org/changeset/216273

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

3 years ago[Cocoa] Converting from WebCore::Cookie to NSHTTPCookie always marks cookies as sessi...
bburg@apple.com [Fri, 5 May 2017 23:45:05 +0000 (23:45 +0000)]
[Cocoa] Converting from WebCore::Cookie to NSHTTPCookie always marks cookies as session cookies
https://bugs.webkit.org/show_bug.cgi?id=171748
<rdar://problem/32027327>

Reviewed by Michael Catanzaro.

Source/WebCore:

The function that we use to convert from WebCore::Cookie to NSHTTPCookie was
also misusing the NSHTTPCookieDiscard property. If any value is provided for
this key, even @NO, CFNetwork interprets that to mean that the cookie has the
"session" flag.

This is known to affect cookies set via WebCookieManager, WKHTTPCookieStore,
and WebAutomationSession.

This is covered by existing test WebKit2.WKHTTPCookieStore.

* platform/network/cocoa/CookieCocoa.mm:
(WebCore::Cookie::operator NSHTTPCookie *):
Don't include the property if the cookie is not a session cookie.

Tools:

Remove temporary workaround now that the assertion failure is fixed.

* TestWebKitAPI/Tests/WebKit2Cocoa/WKHTTPCookieStore.mm:
(TEST):

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

3 years agoMake it possible to test rotation in iOS WebKitTestRunner
simon.fraser@apple.com [Fri, 5 May 2017 23:39:19 +0000 (23:39 +0000)]
Make it possible to test rotation in iOS WebKitTestRunner
https://bugs.webkit.org/show_bug.cgi?id=171755

Reviewed by Tim Horton.

Tools:

Add to UIScriptController:
    void simulateRotation(DeviceOrientation orientation, object callback);
    void simulateRotationLikeSafari(DeviceOrientation orientation, object callback);

The former just does a view resize, as a simple WKWebView app would do. The second does
animation more like MobileSafari, using _begin/_endAnimatedResize. and associated override
layout size and interface orientation. The two behaviors produce different resize and
orientationchange events and sizes, and both need to be tested.

Rotation is initiated by a call on UIDevice, and responded to by the root view controller,
which is now a custom subclass (PlatformWebViewController).

* DumpRenderTree/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::simulateRotation):
(WTR::UIScriptController::simulateRotationLikeSafari):
* DumpRenderTree/mac/UIScriptControllerMac.mm:
(WTR::UIScriptController::simulateRotation):
(WTR::UIScriptController::simulateRotationLikeSafari):
* TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl:
* TestRunnerShared/UIScriptContext/UIScriptController.cpp:
(WTR::toDeviceOrientation):
(WTR::UIScriptController::simulateRotation):
(WTR::UIScriptController::simulateRotationLikeSafari):
* TestRunnerShared/UIScriptContext/UIScriptController.h:
* WebKitTestRunner/cocoa/TestRunnerWKWebView.h:
* WebKitTestRunner/cocoa/TestRunnerWKWebView.mm:
(-[TestRunnerWKWebView dealloc]):
(-[TestRunnerWKWebView _didEndRotation]):
* WebKitTestRunner/ios/PlatformWebViewIOS.mm:
(-[PlatformWebViewController viewWillTransitionToSize:withTransitionCoordinator:]):
(WTR::PlatformWebView::PlatformWebView):
* WebKitTestRunner/ios/TestControllerIOS.mm:
(WTR::TestController::platformResetStateToConsistentValues):
* WebKitTestRunner/ios/UIScriptControllerIOS.mm:
(WTR::toUIDeviceOrientation):
(WTR::UIScriptController::simulateRotation):
(WTR::UIScriptController::simulateRotationLikeSafari):
(WTR::UIScriptController::platformClearAllCallbacks):
* WebKitTestRunner/mac/UIScriptControllerMac.mm:
(WTR::UIScriptController::simulateRotation):
(WTR::UIScriptController::simulateRotationLikeSafari):

LayoutTests:

Two rotation tests and one that comes last to ensure that the device was not left in a rotated state.

* fast/events/ios/rotation/basic-rotation-expected.txt: Added.
* fast/events/ios/rotation/basic-rotation.html: Added.
* fast/events/ios/rotation/safari-like-rotation-expected.txt: Added.
* fast/events/ios/rotation/safari-like-rotation.html: Added.
* fast/events/ios/rotation/zz-no-rotation-expected.txt: Added.
* fast/events/ios/rotation/zz-no-rotation.html: Added.

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

3 years agoEnsure NSColorPickerTouchBarItem only uses sRGB colors
bdakin@apple.com [Fri, 5 May 2017 23:33:04 +0000 (23:33 +0000)]
Ensure NSColorPickerTouchBarItem only uses sRGB colors
https://bugs.webkit.org/show_bug.cgi?id=171758
-and corresponding-
rdar://problem/28314183

Reviewed by Tim Horton.

* UIProcess/Cocoa/WebViewImpl.mm:
(-[WKTextTouchBarItemController itemForIdentifier:]):

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

3 years agoMark http/tests/loading/resourceLoadStatistics/prevalent-resource-without-user-intera...
ryanhaddad@apple.com [Fri, 5 May 2017 23:26:01 +0000 (23:26 +0000)]
Mark http/tests/loading/resourceLoadStatistics/prevalent-resource-without-user-interaction.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=171756

Unreviewed test gardening.

* platform/wk2/TestExpectations:

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

3 years agoUse ImageDiff built by host SDK and remove ImageDiff from DumpRenderTree
jbedard@apple.com [Fri, 5 May 2017 22:56:29 +0000 (22:56 +0000)]
Use ImageDiff built by host SDK and remove ImageDiff from DumpRenderTree
https://bugs.webkit.org/show_bug.cgi?id=168945
<rdar://problem/30745695>

Reviewed by David Kilzer.

Use ImageDiff built with the host machine's SDK and stop building ImageDiff with the
target SDK. These two changes must happen simultaneously because some archives will
clobber the ImageDiff from the host SDK with the ImageDiff from the target SDK.

* DumpRenderTree/mac/Configurations/ImageDiff.xcconfig: Remove ImageDiff from project.
* DumpRenderTree/PlatformWin.cmake: Remove ImageDiff. Note that the CMakeLists.txt in the
tools directory still includes ImageDiff.
* DumpRenderTree/cg/ImageDiffCG.cpp: Removed.
* DumpRenderTree/mac/Configurations/DumpRenderTree.xcconfig: Removed.
* Scripts/webkitpy/port/darwin.py:
(DarwinPort._path_to_image_diff): Return the correct path to ImageDiff when building
locally or when running archives.
* Scripts/webkitpy/port/image_diff.py:
(IOSSimulatorImageDiffer): Deleted.
* Scripts/webkitpy/port/ios_simulator.py:
(IOSSimulatorPort.diff_image): Deleted.

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

3 years agoTURNS gathering is not working properly
commit-queue@webkit.org [Fri, 5 May 2017 22:50:56 +0000 (22:50 +0000)]
TURNS gathering is not working properly
https://bugs.webkit.org/show_bug.cgi?id=171747

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

Did manual testing on real TURNS servers.

* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::configurationFromMediaEndpointConfiguration): Disabling TURNS servers gathering.

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

3 years agoMark test http/tests/security/module-correct-mime-types.html slow.
ryanhaddad@apple.com [Fri, 5 May 2017 22:43:43 +0000 (22:43 +0000)]
Mark test http/tests/security/module-correct-mime-types.html slow.
https://bugs.webkit.org/show_bug.cgi?id=164960

Unreviewed test gardening.

Patch by Matt Lewis <jlewis3@apple.com> on 2017-05-05

* platform/ios-wk2/TestExpectations:

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

3 years agoputDirectIndex does not properly do defineOwnProperty
sbarati@apple.com [Fri, 5 May 2017 22:35:31 +0000 (22:35 +0000)]
putDirectIndex does not properly do defineOwnProperty
https://bugs.webkit.org/show_bug.cgi?id=171591
<rdar://problem/31735695>

Reviewed by Geoffrey Garen.

JSTests:

* stress/array-prototype-splice-making-typed-array.js:
(test):
* stress/array-species-config-array-constructor.js:
(shouldThrow):
(test):
* stress/put-direct-index-broken-2.js: Added.
(assert):
(test):
(makeLengthWritable):
(set get restoreOldDesc):
* stress/put-direct-index-broken.js: Added.
(whatToTest):
(tryRunning):
(tryItOut):
* stress/put-indexed-getter-setter.js: Added.
(foo.X.prototype.set 7):
(foo.X.prototype.get 7):
(foo.X):
(foo):

Source/JavaScriptCore:

This patch fixes putDirectIndex and its JIT implementations to be
compatible with the ES6 spec. I think our code became out of date
when we implemented ArraySpeciesCreate since ArraySpeciesCreate may
return arbitrary objects. We perform putDirectIndex on that arbitrary
object. The behavior we want is as if we performed defineProperty({configurable:true, enumerable:true, writable:true}).
However, we weren't doing this. putDirectIndex assumed it could just splat
data into any descendent of JSObject's butterfly. For example, this means
we'd just splat into the butterfly of a typed array, even though a typed
array doesn't use its butterfly to store its indexed properties in the usual
way. Also, typed array properties are non-configurable, so this operation
should throw. This also means if we saw a ProxyObject, we'd just splat
into its butterfly, but this is obviously wrong because ProxyObject should
intercept the defineProperty operation.

This patch fixes this issue by adding a whitelist of cell types that can
go down putDirectIndex's fast path. Anything not in that whitelist will
simply call into defineOwnProperty.

* bytecode/ByValInfo.h:
(JSC::jitArrayModePermitsPutDirect):
* dfg/DFGArrayMode.cpp:
(JSC::DFG::ArrayMode::refine):
* jit/JITOperations.cpp:
* runtime/ArrayPrototype.cpp:
(JSC::arrayProtoFuncSplice):
* runtime/ClonedArguments.cpp:
(JSC::ClonedArguments::createStructure):
* runtime/JSGenericTypedArrayViewInlines.h:
(JSC::JSGenericTypedArrayView<Adaptor>::defineOwnProperty):
* runtime/JSObject.cpp:
(JSC::canDoFastPutDirectIndex):
(JSC::JSObject::defineOwnIndexedProperty):
(JSC::JSObject::putDirectIndexSlowOrBeyondVectorLength):
(JSC::JSObject::putDirectIndexBeyondVectorLength): Deleted.
* runtime/JSObject.h:
(JSC::JSObject::putDirectIndex):
(JSC::JSObject::canSetIndexQuicklyForPutDirect): Deleted.
* runtime/JSType.h:

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

3 years agoUnreviewed, rolling out r216275.
ryanhaddad@apple.com [Fri, 5 May 2017 22:30:03 +0000 (22:30 +0000)]
Unreviewed, rolling out r216275.

This change broke internal builds.

Reverted changeset:

"[Cocoa] CTFontDescriptorCreateMatchingFontDescriptor() is not
case insensitive"
https://bugs.webkit.org/show_bug.cgi?id=171636
http://trac.webkit.org/changeset/216275

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

3 years ago[WK2][iOS][macOS] Expand sandbox to access vm.footprint_suspend
bfulgham@apple.com [Fri, 5 May 2017 22:23:51 +0000 (22:23 +0000)]
[WK2][iOS][macOS] Expand sandbox to access vm.footprint_suspend
https://bugs.webkit.org/show_bug.cgi?id=171749
<rdar://problem/32019494>

Reviewed by Geoffrey Garen.

The 'sysctl' whitelist needs to be extended to support an additional VM-related feature.

* DatabaseProcess/mac/com.apple.WebKit.Databases.sb.in:
* NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
* PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
* Resources/SandboxProfiles/ios/com.apple.WebKit.Databases.sb:
* Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
* WebProcess/com.apple.WebProcess.sb.in:

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

3 years ago[Cocoa] CTFontDescriptorCreateMatchingFontDescriptor() is not case insensitive
mmaxfield@apple.com [Fri, 5 May 2017 21:54:59 +0000 (21:54 +0000)]
[Cocoa] CTFontDescriptorCreateMatchingFontDescriptor() is not case insensitive
https://bugs.webkit.org/show_bug.cgi?id=171636
<rdar://problem/30811218>

Reviewed by Dean Jackson.

Source/WebCore:

LastResort is the only name which needs to be looked up case-sensitively. We can handle
this in our existing function which handles special font names (like -apple-system) to
make sure that we always do the right thing.

Test: fast/text/lastResort.html

* platform/spi/cocoa/CoreTextSPI.h:
* platform/graphics/ios/FontCacheIOS.mm:
(WebCore::platformFontWithFamilySpecialCase):
* platform/graphics/mac/FontCacheMac.mm:
(WebCore::platformFontWithFamilySpecialCase):

LayoutTests:

* fast/text/lastResort-expected.html: Added.
* fast/text/lastResort.html: Added.

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

3 years ago[GTK][JSCOnly] Merge MainThread implementations and use generic one
utatane.tea@gmail.com [Fri, 5 May 2017 21:36:58 +0000 (21:36 +0000)]
[GTK][JSCOnly] Merge MainThread implementations and use generic one
https://bugs.webkit.org/show_bug.cgi?id=171738

Reviewed by Michael Catanzaro.

GLib MainThread implementation is generic enough to be used in JSCOnly.
We move it to generic/ and GTK (GLib ports) and JSCOnly use it.
And we also drop GLib MainThread's isMainThread function because
generic thread ID one is enough.

This patch also cleans up initializing main thread code by using std::call_once.

* wtf/MainThread.cpp:
(WTF::initializeMainThread):
(WTF::isMainThread):
(WTF::initializeMainThreadToProcessMainThread):
(WTF::initializeWebThread):
(WTF::canAccessThreadLocalDataForThread):
(WTF::initializeMainThreadOnce): Deleted.
(WTF::initializeMainThreadToProcessMainThreadOnce): Deleted.
(WTF::initializeWebThreadOnce): Deleted.
* wtf/PlatformGTK.cmake:
* wtf/PlatformJSCOnly.cmake:
* wtf/generic/MainThreadGeneric.cpp:
(WTF::MainThreadDispatcher::MainThreadDispatcher):
(WTF::MainThreadDispatcher::schedule):
(WTF::MainThreadDispatcher::fired):
(WTF::scheduleDispatchFunctionsOnMainThread):
* wtf/glib/MainThreadGLib.cpp: Removed.

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

3 years agoCrash in ImageFrameCache::decodedSizeChanged() after image load cancellation
said@apple.com [Fri, 5 May 2017 21:35:54 +0000 (21:35 +0000)]
Crash in ImageFrameCache::decodedSizeChanged() after image load cancellation
https://bugs.webkit.org/show_bug.cgi?id=171736

Reviewed by Tim Horton.

Tests: Covered by run-webkit-tests fast/images/image-formats-support.html
--guard-malloc.

Because an image format is not supported, the ImageObserver of the Image
is deleted then the Image itself is deleted. In BitmapImage destructor,
we make a call which ends up accessing the deleted ImageObserver.

To fix this, we need to setImageObsever of the Image to-be-deleted to
nullptr. So the Image can avoid accessing its ImageObserver, while it is
being deleted. Also we can change the BitImage destructor to avoid calling
ImageFrameCache::decodedSizeChanged() since it is not really needed.

* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::clearImage):
* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::~BitmapImage):

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

3 years agoAPI test WebKit2.WKHTTPCookieStore fails due to possible issue with handling non...
bburg@apple.com [Fri, 5 May 2017 21:15:51 +0000 (21:15 +0000)]
API test WebKit2.WKHTTPCookieStore fails due to possible issue with handling non-session cookies
https://bugs.webkit.org/show_bug.cgi?id=171748

Unreviewed test gardening.

The assertion failure will be investigated separately in order to avoid rolling out
the fix for "secure" cookies. This assertion fails even without r216258 applied.

* TestWebKitAPI/Tests/WebKit2Cocoa/WKHTTPCookieStore.mm:
(TEST):

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

3 years agoUnreviewed, rolling out r216260.
jbedard@apple.com [Fri, 5 May 2017 20:52:37 +0000 (20:52 +0000)]
Unreviewed, rolling out r216260.

Breaks internal iOS testers

Reverted changeset:

"Use ImageDiff built by host SDK and remove ImageDiff from
DumpRenderTree"
https://bugs.webkit.org/show_bug.cgi?id=168945
http://trac.webkit.org/changeset/216260

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

3 years agoUnskip media/click-placeholder-not-pausing.html.
ryanhaddad@apple.com [Fri, 5 May 2017 20:36:24 +0000 (20:36 +0000)]
Unskip media/click-placeholder-not-pausing.html.

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

3 years agoREGRESSION: LayoutTest streams/reference-implementation/readable-stream-templated...
joepeck@webkit.org [Fri, 5 May 2017 20:31:56 +0000 (20:31 +0000)]
REGRESSION: LayoutTest streams/reference-implementation/readable-stream-templated.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=171580
<rdar://problem/32009647>

Rubber-stamped by Alexey Proskuryakov.

* TestExpectations:
* streams/reference-implementation/pipe-to-expected.txt:
Rebaseline expectations. This test was previously flakey so the results were
missed unless the test was run with --force.

* streams/reference-implementation/readable-stream-templated-expected.txt:
* streams/reference-implementation/readable-stream-templated.html:
Silence unhandled rejections. This test did not expect unhandled promise
rejections to affect test results, so ignore them.

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

3 years ago[macOS Sierra] LayoutTest http/tests/inspector/network/resource-request-headers.html...
joepeck@webkit.org [Fri, 5 May 2017 20:31:53 +0000 (20:31 +0000)]
[macOS Sierra] LayoutTest http/tests/inspector/network/resource-request-headers.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=170702
<rdar://problem/31616643>

Rubber-stamped by Brian Burg.

* platform/mac-wk2/TestExpectations:
* http/tests/inspector/network/resource-request-headers.html:
Make this test unflakey by ensuring we wait for the load to complete.

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

3 years agoResource Load Statistics: Don't cover in-memory and disk caches during website data...
wilander@apple.com [Fri, 5 May 2017 20:23:28 +0000 (20:23 +0000)]
Resource Load Statistics: Don't cover in-memory and disk caches during website data removal
https://bugs.webkit.org/show_bug.cgi?id=171741
<rdar://problem/32020691>

Reviewed by Brent Fulgham.

* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::removeDataRecords):
    No longer removes WebsiteDataType::DiskCache or WebsiteDataType::MemoryCache.

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

3 years ago[JSC] include JSCInlines.h in ObjectInitializationScope.cpp
commit-queue@webkit.org [Fri, 5 May 2017 20:21:17 +0000 (20:21 +0000)]
[JSC] include JSCInlines.h in ObjectInitializationScope.cpp
https://bugs.webkit.org/show_bug.cgi?id=171744

Patch by Guillaume Emont <guijemont@igalia.com> on 2017-05-05
Reviewed by Mark Lam.

* runtime/ObjectInitializationScope.cpp:

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

3 years agoCrashTracer: [USER] com.apple.WebKit.WebContent.Development at com.apple.WebCore...
bburg@apple.com [Fri, 5 May 2017 19:44:47 +0000 (19:44 +0000)]
CrashTracer: [USER] com.apple.WebKit.WebContent.Development at com.apple.WebCore: WebCore::commonVMSlow + 57
https://bugs.webkit.org/show_bug.cgi?id=171669
<rdar://problem/31967684>

Reviewed by Mark Lam.

Source/WebCore:

* bindings/js/CommonVM.h:
(WebCore::commonVMOrNull):
Add an inline accessor function to expose the global variable.

Source/WebKit2:

safaridriver's AutomaticInspection capability causes us to call WebInspectorProxy::connect()
underneath the Automation.inspectBrowsingContext command. This fires a NeedDebuggerBreak
interrupt for the web content's VM, but this is racy because the web content process may
not yet be fully initialized when this interrupt is handled.

To work around this, just don't deliver any interrupts if the VM singleton is still null.
This is a reliable signal that the web content process is not fully initialized yet. Not delivering
is harmless; the interrupt only exists to break out of infinite loops in JS code, but there
could not be any such infinite loop yet if the web content process is not fully initialized.

* WebProcess/WebPage/WebInspectorInterruptDispatcher.cpp:
(WebKit::WebInspectorInterruptDispatcher::notifyNeedDebuggerBreak):

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

3 years agoGCController.cpp's collect() should be Async
fpizlo@apple.com [Fri, 5 May 2017 19:43:22 +0000 (19:43 +0000)]
GCController.cpp's collect() should be Async
https://bugs.webkit.org/show_bug.cgi?id=171708

Reviewed by Saam Barati.

No new tests because no change in behavior.

This is one step towards not requesting sync GCs in WebCore. I'm landing this incrementally to
make bisecting super easy.

* bindings/js/GCController.cpp:
(WebCore::collect):

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

3 years agoWeb Automation: cookie-related commands don't work correctly
bburg@apple.com [Fri, 5 May 2017 19:31:21 +0000 (19:31 +0000)]
Web Automation: cookie-related commands don't work correctly
https://bugs.webkit.org/show_bug.cgi?id=171713
<rdar://problem/29829930>

Reviewed by Alexey Proskuryakov.

Commands that use WebCookieManager directly should complete when
the manager's completion handler is called. Otherwise, this will race
with subsequent accesses to cookies via the web process (document.cookie).

Also, these commands need to use the active browsing context's session ID.
They currently use the process pool's storage session, which is wrong
since we specially configure automation instances with an ephemeral store.

* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::addSingleCookie):
(WebKit::WebAutomationSession::deleteAllCookies):

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

3 years agoUse ImageDiff built by host SDK and remove ImageDiff from DumpRenderTree
jbedard@apple.com [Fri, 5 May 2017 19:26:35 +0000 (19:26 +0000)]
Use ImageDiff built by host SDK and remove ImageDiff from DumpRenderTree
https://bugs.webkit.org/show_bug.cgi?id=168945
<rdar://problem/30745695>

Reviewed by David Kilzer.

Use ImageDiff built with the host machine's SDK and stop building ImageDiff with the
target SDK. These two changes must happen simultaneously because some archives will
clobber the ImageDiff from the host SDK with the ImageDiff from the target SDK.

* DumpRenderTree/mac/Configurations/ImageDiff.xcconfig: Remove ImageDiff from project.
* DumpRenderTree/PlatformWin.cmake: Remove ImageDiff. Note that the CMakeLists.txt in the
tools directory still includes ImageDiff.
* DumpRenderTree/cg/ImageDiffCG.cpp: Removed.
* DumpRenderTree/mac/Configurations/DumpRenderTree.xcconfig: Removed.
* Scripts/webkitpy/port/darwin.py:
(DarwinPort._path_to_image_diff): Return the correct path to ImageDiff when building
locally or when running archives.
* Scripts/webkitpy/port/image_diff.py:
(IOSSimulatorImageDiffer): Deleted.
* Scripts/webkitpy/port/ios_simulator.py:
(IOSSimulatorPort.diff_image): Deleted.

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

3 years agoAttr Nodes should not have children
cdumez@apple.com [Fri, 5 May 2017 19:26:11 +0000 (19:26 +0000)]
Attr Nodes should not have children
https://bugs.webkit.org/show_bug.cgi?id=171688
<rdar://problem/31998412>

Reviewed by Andreas Kling.

Source/WebCore:

Attr Nodes should not have children as per the latest DOM specification:
- https://dom.spec.whatwg.org/#interface-attr
- https://dom.spec.whatwg.org/#dom-attr-value
- https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity (Step 1)

Firefox and Chrome both have been matching the DOM specification for a while so I think
we should do the same. This aligns us with other browsers, simplifies the code, is
more efficient and the code being removed has been prone to security bugs.

Test: fast/dom/Attr/cannot-have-children.html

* dom/Attr.cpp:
(WebCore::Attr::Attr):
(WebCore::Attr::create):
(WebCore::Attr::setValue):
(WebCore::Attr::cloneNodeInternal):
* dom/Attr.h:
- Have Attr subclass Node instead of ContainerNode as it can no longer have children.
- Drop logic to dealing with children / creating a Text child.

* dom/CharacterData.cpp:
(WebCore::CharacterData::notifyParentAfterChange):
Drop useless check found by the compiler. parentNode() can no longer be an Attr node.

* dom/Node.cpp:
(WebCore::appendTextContent):
appendTextContent() is called by Node.TextContent(). For Attr Nodes, we should no longer traverse
its subtree to gather Text Nodes. Instead, we now return Attr.value, as per the specification:
- https://dom.spec.whatwg.org/#dom-node-textcontent

* dom/Range.cpp:
(WebCore::lengthOfContentsInNode):
As per https://dom.spec.whatwg.org/#concept-node-length, we should return the number of children
for Attr Nodes, which will always be 0.

* xml/XPathUtil.cpp:
(WebCore::XPath::isValidContextNode):
Always return true for TEXT_NODE as the !(node->parentNode() && node->parentNode()->isAttributeNode())
check will also with true now. This is because a parentNode() cannot be an Attribute Node.

LayoutTests:

* fast/dom/Attr/cannot-have-children-expected.txt: Added.
* fast/dom/Attr/cannot-have-children.html: Added.
Add layout test coverage. I have verified that this test passes in both
Firefox and Chrome.

* dom/html/level1/*: Removed legacy / outdated tests.
* dom/xhtml/level1/*: Removed legacy / outdated tests.

* fast/dom/Attr/child-nodes-cache-expected.txt: Removed.
* fast/dom/Attr/child-nodes-cache.html: Removed.
* fast/dom/Attr/child-nodes-length-cache-expected.txt: Removed.
* fast/dom/Attr/child-nodes-length-cache.html: Removed.
* fast/dom/Attr/invalidate-nodelist-after-attr-setvalue-expected.txt: Removed.
* fast/dom/Attr/invalidate-nodelist-after-attr-setvalue.html: Removed.
* fast/dom/attribute-change-on-mutate-expected.txt: Removed.
* fast/dom/attribute-change-on-mutate.html: Removed.
* svg/custom/image-with-attr-change-after-delete-crash-expected.txt: Removed.
* svg/custom/image-with-attr-change-after-delete-crash.html: Removed.
* traversal/moz-bug590771-expected.txt: Removed.
* traversal/moz-bug590771.html: Removed.
Removed some outdated tests.

* fast/custom-elements/reactions-for-webkit-extensions-expected.txt:
* fast/custom-elements/reactions-for-webkit-extensions.html:
* fast/dom/Attr/change-id-via-attr-node-value-expected.txt:
* fast/dom/Attr/change-id-via-attr-node-value.html:
* fast/dom/Element/normalize-crash.html:
* fast/dom/Element/normalize-crash2.html:
* fast/dom/HTMLLinkElement/event-while-removing-attribute-expected.txt:
* fast/dom/HTMLLinkElement/event-while-removing-attribute.html:
* fast/dom/MutationObserver/observe-attributes-expected.txt:
* fast/dom/MutationObserver/observe-attributes.html:
* fast/dom/import-attribute-node.html:
* fast/dom/insertedIntoDocument-child.html:
* fast/dom/insertedIntoDocument-sibling.html:
* fast/dom/no-assert-for-malformed-js-url-attribute-expected.txt:
* fast/dom/no-assert-for-malformed-js-url-attribute.html:
* fast/dom/normalize-attributes-mutation-event-crash.html:
* fast/dom/serialize-nodes.xhtml:
* http/tests/security/xss-DENIED-iframe-src-alias-expected.txt:
Update existing tests so they stop relying on Attr Node having Text children.

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

3 years ago[Cocoa] Converting from WebCore::Cookie to NSHTTPCookie always marks cookies as secure
bburg@apple.com [Fri, 5 May 2017 19:21:37 +0000 (19:21 +0000)]
[Cocoa] Converting from WebCore::Cookie to NSHTTPCookie always marks cookies as secure
https://bugs.webkit.org/show_bug.cgi?id=171700
<rdar://problem/32017975>

Reviewed by Brady Eidson.

Source/WebCore:

The function that we use to convert from WebCore::Cookie to NSHTTPCookie was
misusing the NSHTTPCookieSecure property. If any value is provided for this key,
even @NO, CFNetwork interprets that to mean that the cookie has the "secure" flag.
Thus, in some cases we would store an "insecure" cookie on a site that uses the
http:// protocol, and be unable to later retrieve the cookie. This is known to
affect cookies set via WebCookieManager, WKHTTPCookieStore, and WebAutomationSession.

This is covered by existing test WebKit2.WKHTTPCookieStore.
The test had a bug that masked this problem.

* platform/network/cocoa/CookieCocoa.mm:
(WebCore::Cookie::operator NSHTTPCookie *):
Don't include the property if the cookie is not secure.

Tools:

Fix a mistake in the test that should have caught this bug.

* TestWebKitAPI/Tests/WebKit2Cocoa/WKHTTPCookieStore.mm:
(TEST):
The assertions that were meant to check round-tripping were actually checking
the properties of the original cookie objects, not the round-tripped ones.
This test now fails without the bugfix and passes when it is applied.

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

3 years agoAdd SPI to WebItemProviderPasteboard to synchronously load data with a given timeout
wenson_hsieh@apple.com [Fri, 5 May 2017 19:20:32 +0000 (19:20 +0000)]
Add SPI to WebItemProviderPasteboard to synchronously load data with a given timeout
https://bugs.webkit.org/show_bug.cgi?id=171725
<rdar://problem/32014052>

Reviewed by Beth Dakin.

Adds a synchronousTimeout: argument to doAfterLoadingProvidedContentIntoFileURLs:. If a positive timeout
interval is specified by the client, then we will block the main thread for at most that amount of time after
beginning to load from the item providers.

To do this, we introduce another `dispatch_group_t` in parallel to the `fileLoadingGroup` that is entered and
left in the same places. However, instead of attaching a handler block, we simply perform a synchronous wait for
either the time limit to be reached, or the item providers to finish loading.

No new tests -- no change in behavior yet.

* platform/ios/WebItemProviderPasteboard.h:
* platform/ios/WebItemProviderPasteboard.mm:
(-[WebItemProviderPasteboard doAfterLoadingProvidedContentIntoFileURLs:]):
(-[WebItemProviderPasteboard doAfterLoadingProvidedContentIntoFileURLs:synchronousTimeout:]):

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

3 years agoClean up Attr.idl
cdumez@apple.com [Fri, 5 May 2017 19:16:03 +0000 (19:16 +0000)]
Clean up Attr.idl
https://bugs.webkit.org/show_bug.cgi?id=171691

Reviewed by Andreas Kling.

Clean up Attr.idl to match the spec:
- https://dom.spec.whatwg.org/#interface-attr

No Web-facing behavior change except for Attr properties being enumerated
in a slightly different order.

* dom/Attr.idl:

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

3 years agoUse EXPECT_EQ() when comparing strings in TestWebKitAPI tests
dbates@webkit.org [Fri, 5 May 2017 18:45:16 +0000 (18:45 +0000)]
Use EXPECT_EQ() when comparing strings in TestWebKitAPI tests
https://bugs.webkit.org/show_bug.cgi?id=171698

Reviewed by Darin Adler.

We should use EXPECT_EQ() instead of EXPECT_TRUE() to compare WTF::String() objects
so that we get pretty diff output when the actual string differs from the expected
string as opposed to seeing a boolean result. The former makes makes it straightforward
to diagnose a regression without reading the code for the test or instrumenting it to
determine the actual string that was compared.

* TestWebKitAPI/Tests/WTF/WTFString.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebCore/mac/GPUFunction.mm:
(TestWebKitAPI::TEST_F):
* TestWebKitAPI/Tests/WebCore/mac/GPULibrary.mm:
(TestWebKitAPI::TEST_F):

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

3 years agoMark w3c test persisted-user-state-restoration/scroll-restoration-fragment-scrolling...
ryanhaddad@apple.com [Fri, 5 May 2017 18:41:36 +0000 (18:41 +0000)]
Mark w3c test persisted-user-state-restoration/scroll-restoration-fragment-scrolling-cross-origin.html as flaky on mac-wk1.
https://bugs.webkit.org/show_bug.cgi?id=161360

Unreviewed test gardening.

* platform/mac-wk1/TestExpectations:

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

3 years agoASSERTION FAILED: !frame().document()->inRenderTreeUpdate() in WebCore::FrameView...
antti@apple.com [Fri, 5 May 2017 18:39:30 +0000 (18:39 +0000)]
ASSERTION FAILED: !frame().document()->inRenderTreeUpdate() in WebCore::FrameView::layout(bool)
https://bugs.webkit.org/show_bug.cgi?id=171717

Reviewed by Brent Fulgham.

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::checkCompleted):

    Don't allow frame load to complete in the middle of a render tree update. Instead delay the check.

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

3 years agoMark 2 webrtc test as failing.
ryanhaddad@apple.com [Fri, 5 May 2017 18:22:45 +0000 (18:22 +0000)]
Mark 2 webrtc test as failing.
https://bugs.webkit.org/show_bug.cgi?id=171728

Unreviewed test gardening.

Patch by Matt Lewis <jlewis3@apple.com> on 2017-05-05

* platform/ios-wk2/TestExpectations:

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

3 years agoRefactor / Clean up Element.idl
cdumez@apple.com [Fri, 5 May 2017 18:14:12 +0000 (18:14 +0000)]
Refactor / Clean up Element.idl
https://bugs.webkit.org/show_bug.cgi?id=171734

Reviewed by Sam Weinig.

Source/WebCore:

Refactor / Clean up Element.idl to match the latest specification:
- https://dom.spec.whatwg.org/#interface-element

There is no Web-facing behavior change in this patch besides the Element properties
being enumerated in a slightly different order. Things that do not match the
specification have merely been annotated with FIXME comments for now. This makes
it much more obvious what's standard, what's not and what needs fixing.

* dom/Element.idl:

LayoutTests:

Rebaseline a couple of tests due to Element properties being enumerated in a slightly
different order and because exception messages have changed slightly.

* fast/dom/Element/attr-param-typechecking-expected.txt:
* js/dom/dom-static-property-for-in-iteration-expected.txt:

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

3 years agoLink drag images for apple.com front page links have a lot of spurious whitespace
timothy_horton@apple.com [Fri, 5 May 2017 18:13:18 +0000 (18:13 +0000)]
Link drag images for apple.com front page links have a lot of spurious whitespace
https://bugs.webkit.org/show_bug.cgi?id=171719
<rdar://problem/32010854>

Reviewed by Wenson Hsieh.

* page/DragController.cpp:
(WebCore::DragController::startDrag):
Use the white-space-simplified string that we put on the pasteboard
for the drag image, too!

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

3 years agoRename webProcessDidCrashWithReason callback to webProcessDidTerminate and stop calli...
cdumez@apple.com [Fri, 5 May 2017 18:11:46 +0000 (18:11 +0000)]
Rename webProcessDidCrashWithReason callback to webProcessDidTerminate and stop calling webProcessDidCrash for client terminations
https://bugs.webkit.org/show_bug.cgi?id=171624

Reviewed by Dan Bernstein.

Source/WebKit2:

Follow-up fixes after r216129 based on feedback I have received:
- Rename webProcessDidCrashWithReason callback function to webProcessDidTerminate given that this is called
  for non-crashes (e.g. terminations requested by the client).
- Rename WKProcessCrashReason / ProcessCrashReason to WKProcessTerminationReason / ProcessTerminationReason
  for consistency with the new naming.
- Stop calling processDidCrash / webProcessDidCrash for terminations requested by the client, to maintain
  pre-r216129 behavior. Those are not crashes (The client used an API such as WKPageTerminateProcess()).
  webProcessDidTerminate will still be called though.
- Fix a bug where - for terminations due to resource limits - WebPageProxy::processDidCrash() was getting
  called twice: First by WebProcessProxy::requestTermination() with reason "RequestedByClient" then a
  second time by WebProcessProxy::terminateProcessDueToResourceLimits() with the proper reason.

* Shared/ProcessTerminationReason.h: Renamed from Source/WebKit2/Shared/ProcessCrashReason.h.
* UIProcess/API/APINavigationClient.h:
(API::NavigationClient::processDidTerminate):
* UIProcess/API/C/WKAPICast.h:
(WebKit::toAPI):
* UIProcess/API/C/WKPage.cpp:
(WKPageTerminate):
(WKPageSetPageNavigationClient):
* UIProcess/API/C/WKPageNavigationClient.h:
* UIProcess/API/C/WKProcessTerminationReason.h: Renamed from Source/WebKit2/UIProcess/API/C/WKProcessCrashReason.h.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _killWebContentProcessAndResetState]):
* UIProcess/Cocoa/NavigationState.h:
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::NavigationClient::processDidTerminate):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::processDidTerminate):
* UIProcess/WebPageProxy.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::didClose):
(WebKit::WebProcessProxy::requestTermination):
(WebKit::WebProcessProxy::logDiagnosticMessageForResourceLimitTermination):
(WebKit::WebProcessProxy::didExceedActiveMemoryLimit):
(WebKit::WebProcessProxy::didExceedInactiveMemoryLimit):
(WebKit::WebProcessProxy::didExceedBackgroundCPULimit):
* UIProcess/WebProcessProxy.h:
* WebKit2.xcodeproj/project.pbxproj:

Tools:

Extend API test coverage to cover crashes in addition to terminations requested by the client.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2/ProcessDidTerminate.cpp: Renamed from Tools/TestWebKitAPI/Tests/WebKit2/ProcessDidCrashWithReason.cpp.
(TestWebKitAPI::webProcessWasTerminatedByClient):
(TestWebKitAPI::webProcessCrashed):
(TestWebKitAPI::TEST):

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