WebKit-https.git
19 months agoUnreviewed GTK+ gardening after r228270.
magomez@igalia.com [Thu, 8 Feb 2018 15:10:57 +0000 (15:10 +0000)]
Unreviewed GTK+ gardening after r228270.

* platform/gtk/TestExpectations:

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

19 months ago[GTK] WaylandCompositor misusing eglGetProcAddress
magomez@igalia.com [Thu, 8 Feb 2018 14:05:13 +0000 (14:05 +0000)]
[GTK] WaylandCompositor misusing eglGetProcAddress
https://bugs.webkit.org/show_bug.cgi?id=182490

Reviewed by Michael Catanzaro.

Check that the appropriate extensions are available before calling eglGetProcAddress, as even
getting a non null value from it, the functionality can be disabled at runtime.

* UIProcess/gtk/WaylandCompositor.cpp:
(WebKit::WaylandCompositor::initializeEGL):

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

19 months ago[GStreamer] LayoutTest webaudio/silent-audio-interrupted-in-background.html makes...
philn@webkit.org [Thu, 8 Feb 2018 13:10:48 +0000 (13:10 +0000)]
[GStreamer] LayoutTest webaudio/silent-audio-interrupted-in-background.html makes its subsequent test flaky crash
https://bugs.webkit.org/show_bug.cgi?id=173916

Reviewed by Xabier Rodriguez Calvar.

Source/WebCore:

This patch fixes two crashes and a runtime warning:

- The provider client configuration should be done from the main
thread but the no-more-pads signal of deinterleave was fired from
a non-main thread.

- The deinterleave pad-removed signal can be fired for a not fully
configured pipeline if the audio context is interrupted. So the
peer quark of the removed pad needs to be checked, it might be a
null pointer.

- The provider connects to the deinterleave signals only when a
client is provided, so the signal disconnection needs to check
that to avoid runtime warnings.

* platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp:
(WebCore::AudioSourceProviderGStreamer::AudioSourceProviderGStreamer):
Create a main thread notifier.
(WebCore::AudioSourceProviderGStreamer::~AudioSourceProviderGStreamer):
Invalidate notifier and check a client was set before
disconnecting from deinterleave signals.
(WebCore::AudioSourceProviderGStreamer::handleRemovedDeinterleavePad):
Check validity of the pad peer.
(WebCore::AudioSourceProviderGStreamer::deinterleavePadsConfigured):
Set client from main thread.
* platform/audio/gstreamer/AudioSourceProviderGStreamer.h:

LayoutTests:

* platform/gtk/TestExpectations: Unskip fixed test.

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

19 months agoUnreviewed, rolling out r228267, r228268, and r228269.
commit-queue@webkit.org [Thu, 8 Feb 2018 12:47:12 +0000 (12:47 +0000)]
Unreviewed, rolling out r228267, r228268, and r228269.
https://bugs.webkit.org/show_bug.cgi?id=182601

jhbuild socks (Requested by philn on #webkit).

Reverted changesets:

"[JHBuild] Update Mesa to version 17"
https://bugs.webkit.org/show_bug.cgi?id=182599
https://trac.webkit.org/changeset/228267

"Unreviewed, GTK build fix attempt after r228267."
https://trac.webkit.org/changeset/228268

"Unreviewed, final GTK build fix attempt after r228267."
https://trac.webkit.org/changeset/228269

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

19 months agoUnreviewed, final GTK build fix attempt after r228267.
philn@webkit.org [Thu, 8 Feb 2018 12:21:00 +0000 (12:21 +0000)]
Unreviewed, final GTK build fix attempt after r228267.

* gtk/jhbuild.modules: sha256sum for libdrm was for the tar.gz archive. Oops.

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

19 months agoUnreviewed, GTK build fix attempt after r228267.
philn@webkit.org [Thu, 8 Feb 2018 11:59:06 +0000 (11:59 +0000)]
Unreviewed, GTK build fix attempt after r228267.

* gtk/jhbuild.modules: Update to libdrm version 2.4.89, Mesa 17 requires at least version 2.4.75.

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

19 months ago[JHBuild] Update Mesa to version 17
philn@webkit.org [Thu, 8 Feb 2018 11:28:20 +0000 (11:28 +0000)]
[JHBuild] Update Mesa to version 17
https://bugs.webkit.org/show_bug.cgi?id=182599

Reviewed by Carlos Alberto Lopez Perez.

* gtk/jhbuild.modules: Update Mesa to version 17.3.3.

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

19 months ago[JSC] Implement Array.prototype.flatMap and Array.prototype.flatten
utatane.tea@gmail.com [Thu, 8 Feb 2018 10:43:13 +0000 (10:43 +0000)]
[JSC] Implement Array.prototype.flatMap and Array.prototype.flatten
https://bugs.webkit.org/show_bug.cgi?id=182440

Reviewed by Darin Adler.

JSTests:

* stress/array-flatmap.js: Added.
(shouldBe):
(shouldBeArray):
(shouldThrow):
(var):
* stress/array-flatten.js: Added.
(shouldBe):
(shouldBeArray):
* test262.yaml:
* test262/test/built-ins/Array/prototype/flatMap/depth-always-one.js:
(3.flatMap):
Pick test262 82c6148980332febe92a544a1fb653718e9fdb57 change.

Source/JavaScriptCore:

This patch implements Array.prototype.flatMap and Array.prototype.flatten
since they are now stage 3 [1].

[1]: https://tc39.github.io/proposal-flatMap/#sec-FlattenIntoArray

* builtins/ArrayPrototype.js:
(filter):
(map):
(globalPrivate.concatSlowPath):
(globalPrivate.arraySpeciesCreate):
(globalPrivate.flattenIntoArray):
(flatten):
(globalPrivate.flattenIntoArrayWithCallback):
We separate flattenIntoArray from flattenIntoArrayWithCallback due to performance reason.
We carefully keep both functions small to encourage inlining.

(flatMap):
* runtime/ArrayPrototype.cpp:
(JSC::ArrayPrototype::finishCreation):

LayoutTests:

* inspector/model/remote-object-get-properties-expected.txt:
* js/Object-getOwnPropertyNames-expected.txt:
* js/script-tests/Object-getOwnPropertyNames.js:

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

19 months ago[GStreamer][WebAudio] No need for version check in each loop iteration
philn@webkit.org [Thu, 8 Feb 2018 10:14:01 +0000 (10:14 +0000)]
[GStreamer][WebAudio] No need for version check in each loop iteration
https://bugs.webkit.org/show_bug.cgi?id=182577

Reviewed by Xabier Rodriguez Calvar.

* platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp:
(webkit_web_audio_src_init): Detect version once only, when creating the element.
(webKitWebAudioSrcLoop): Use boolean variable instead of checking the version every time.

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

19 months agoAdd scrolling node types to distinguish main frames and subframes.
fred.wang@free.fr [Thu, 8 Feb 2018 10:01:43 +0000 (10:01 +0000)]
Add scrolling node types to distinguish main frames and subframes.
https://bugs.webkit.org/show_bug.cgi?id=182533

Patch by Frederic Wang <fwang@igalia.com> on 2018-02-08
Reviewed by Simon Fraser.

Source/WebCore:

This patch splits FrameScrollingNode type into two types: MainFrameScrollingNode and
SubframeScrollingNode. This is needed because new places in the code are likely to
distinguish them e.g. in ScrollingTreeScrollingNodeDelegateIOS::updateChildNodesAfterScroll
or when iOS frame scrolling is introduced (see bug 173833).

No new tests, behavior unchanged.

* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::ensureRootStateNodeForFrameView): This is only called
for main frames, so pass MainFrameScrollingNode.
* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::operator<<): Distinguish subframe and main frame when dumping.
* page/scrolling/ScrollingCoordinator.h: Split FrameScrollingNode into two cases.
* page/scrolling/ScrollingStateFrameScrollingNode.cpp: Add node type to constructor and
ASSERT it remains of type FrameScrollingNode.
(WebCore::ScrollingStateFrameScrollingNode::create):
(WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
* page/scrolling/ScrollingStateFrameScrollingNode.h: Add node type to constructor.
* page/scrolling/ScrollingStateNode.h:
(WebCore::ScrollingStateNode::isFrameScrollingNode const): Includes the two cases.
* page/scrolling/ScrollingStateTree.cpp:
(WebCore::ScrollingStateTree::createNode): Split FrameScrollingNode into two cases and pass
the node type.
(WebCore::ScrollingStateTree::attachNode): The first case only happens for main frames while
the second case only happens with subframes. Use the appriate node type.
* page/scrolling/ScrollingTreeFrameScrollingNode.cpp: Add node type to constructor and
ASSERT it remains of type FrameScrollingNode.
(WebCore::ScrollingTreeFrameScrollingNode::ScrollingTreeFrameScrollingNode):
* page/scrolling/ScrollingTreeFrameScrollingNode.h: Add node type to constructor.
* page/scrolling/ScrollingTreeNode.h: Includes the two cases.
(WebCore::ScrollingTreeNode::isFrameScrollingNode const):
* page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h: Add node type to constructor.
* page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm: Ditto.
(WebCore::ScrollingTreeFrameScrollingNodeIOS::create):
(WebCore::ScrollingTreeFrameScrollingNodeIOS::ScrollingTreeFrameScrollingNodeIOS):
* page/scrolling/ios/ScrollingTreeIOS.cpp: Split FrameScrollingNode into two cases.
(WebCore::ScrollingTreeIOS::createScrollingTreeNode):
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h: Add node type to constructor.
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm: Ditto.
(WebCore::ScrollingTreeFrameScrollingNodeMac::create):
(WebCore::ScrollingTreeFrameScrollingNodeMac::ScrollingTreeFrameScrollingNodeMac):
* page/scrolling/mac/ScrollingTreeMac.cpp: Split FrameScrollingNode into two cases.
(ScrollingTreeMac::createScrollingTreeNode):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::reattachSubframeScrollLayers): Distinguish the cases of
main frames and subframes.
(WebCore::scrollCoordinationRoleForNodeType): Split FrameScrollingNode into two cases.
(WebCore::RenderLayerCompositor::updateScrollCoordinationForThisFrame): Distinguish the cases
of main frames and subframes.
(WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer): Split FrameScrollingNode into
two cases.

Source/WebKit:

* Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp: Replace the case of
FrameScrollingNode with MainFrameScrollingNode and SubframeScrollingNode.
(WebKit::encodeNodeAndDescendants):
(WebKit::RemoteScrollingCoordinatorTransaction::decode):
(WebKit::dump):
* UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp: Ditto.
(WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
* UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp: Ditto and pass the node type to the
constructor of the frame scrolling node.
(WebKit::RemoteScrollingTree::createScrollingTreeNode):
* UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm: Replace the case of
FrameScrollingNode with MainFrameScrollingNode and SubframeScrollingNode.
(WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
* UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm: In order to
determine whether the node is a main frame or subframe, use the node type instead of checking
whether the node as a parent.
(WebKit::ScrollingTreeScrollingNodeDelegateIOS::updateChildNodesAfterScroll):

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

19 months agoTry to fix ErrorEvent tests seen failing on buildbot after fix for bug 179591.
darin@apple.com [Thu, 8 Feb 2018 08:00:03 +0000 (08:00 +0000)]
Try to fix ErrorEvent tests seen failing on buildbot after fix for bug 179591.

* bindings/js/JSErrorHandler.cpp:
(WebCore::JSErrorHandler::handleEvent): Add back line of code accidentally removed.

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

19 months agoWebDriver: addCookie command should prepend a dot to domain if missing
carlosgc@webkit.org [Thu, 8 Feb 2018 07:49:21 +0000 (07:49 +0000)]
WebDriver: addCookie command should prepend a dot to domain if missing
https://bugs.webkit.org/show_bug.cgi?id=182328
<rdar://problem/37116398>

Reviewed by Michael Catanzaro.

RFC 2965: If an explicitly specified value does not start with a dot, the user agent supplies a leading dot.

Fixes: imported/w3c/webdriver/tests/cookies/add_cookie.py::test_add_domain_cookie

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

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

19 months agoAdd a way to check if a host is an IP address
carlosgc@webkit.org [Thu, 8 Feb 2018 06:37:10 +0000 (06:37 +0000)]
Add a way to check if a host is an IP address
https://bugs.webkit.org/show_bug.cgi?id=182427

Reviewed by Alex Christensen.

Source/WebCore:

There are several places where this is needed. We currently just assume that any host ending in a digit is an IP
address, except in PublicSuffix where platform specific code is used. This patch adds URL::hostIsIPAddress()
platform specific implementations, falling back to current assumption if there isn't an implementation for the
platform.

* page/OriginAccessEntry.cpp:
(WebCore::OriginAccessEntry::OriginAccessEntry): Use URL::hostIsIPAddress().
* platform/URL.cpp:
(WebCore::URL::hostIsIPAddress): Fallback implementation.
* platform/URL.h:
* platform/mac/PublicSuffixMac.mm:
(WebCore::topPrivatelyControlledDomain): Use URL::hostIsIPAddress().
* platform/mac/URLMac.mm:
(WebCore::URL::hostIsIPAddress): Move implementation from PublicSuffixMac.mm.
* platform/network/curl/CookieUtil.cpp:
(WebCore::CookieUtil::isIPAddress): Use URL::hostIsIPAddress().
* platform/soup/URLSoup.cpp:
(WebCore::URL::hostIsIPAddress): Use g_hostname_is_ip_address().

Tools:

Add unit test for URL::hostIsIPAddress().

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

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

19 months agoEvent improvements
darin@apple.com [Thu, 8 Feb 2018 06:06:29 +0000 (06:06 +0000)]
Event improvements
https://bugs.webkit.org/show_bug.cgi?id=179591

Reviewed by Chris Dumez.

Source/JavaScriptCore:

Remove all uses of ScriptValue other than in the implementation of ScriptObject.

* bindings/ScriptFunctionCall.cpp: Removed include of ScriptValue.h.

* bindings/ScriptObject.cpp: Removed unused overload of ScriptObject constructor.
* bindings/ScriptObject.h: Ditto.

* bindings/ScriptValue.cpp:
(Deprecated::ScriptValue::~ScriptValue): Deleted.
(Deprecated::ScriptValue::getString const): Deleted.
(Deprecated::ScriptValue::toString const): Deleted.
(Deprecated::ScriptValue::isEqual const): Deleted.
(Deprecated::ScriptValue::isNull const): Deleted.
(Deprecated::ScriptValue::isUndefined const): Deleted.
(Deprecated::ScriptValue::isObject const): Deleted.
(Deprecated::ScriptValue::isFunction const): Deleted.
(Deprecated::ScriptValue::toInspectorValue const): Deleted.
* bindings/ScriptValue.h: Removed many unused functions. Made the rest
protected since this is now used only in ScriptObject.

* inspector/ConsoleMessage.cpp:
(Inspector::ConsoleMessage::addToFrontend): Stop using ScriptValue.
(Inspector::ConsoleMessage::isEqual const): Updated for change to ScriptArguments::isEqual.

* inspector/ScriptArguments.cpp:
(Inspector::ScriptArguments::create): Take a Vector of JSC::Strong, not ScriptValue,
use rvalue reference with move instead of lvalue reference with swap, and take execution
state by reference instead of pointer.
(Inspector::ScriptArguments::createEmpty): Deleted. Can now use create instead.
(Inspector::ScriptArguments::ScriptArguments): Ditto.
(Inspector::ScriptArguments::~ScriptArguments): Deleted.
(Inspector::ScriptArguments::argumentAt const): Updated to use JSC::Strong.
(Inspector::ScriptArguments::getFirstArgumentAsString): Ditto.
(Inspector::ScriptArguments::isEqual const): Ditto. Also changed to use JS internals
instead of calling through the C API.
* inspector/ScriptArguments.h: Updated for the above.

* inspector/ScriptCallStackFactory.cpp:
(Inspector::createScriptArguments): Updated for changes to ScriptArguments.

* inspector/ScriptDebugServer.cpp: Removed include of ScriptValue.h.
* inspector/agents/InspectorAgent.cpp: Ditto.
* inspector/agents/InspectorDebuggerAgent.cpp: Ditto.
(Inspector::InspectorDebuggerAgent::evaluateOnCallFrame): Use JSC::Strong instead
of ScriptValue.
(Inspector::InspectorDebuggerAgent::currentCallFrames): Ditto.
* inspector/agents/InspectorDebuggerAgent.h: Ditto.
* runtime/ConsoleClient.cpp:
(JSC::ConsoleClient::printConsoleMessageWithArguments): Ditto.
(JSC::ConsoleClient::clear): Use ScriptArguments::create and pass an empty vector
instead of calling a separate createEmpty function.

* runtime/VM.cpp:
(JSC::VM::createLeaked): Deleted.
* runtime/VM.h: Deleted createLeaked.

Source/WebCore:

- removed all use of Deprecated::ScriptValue

- fixed uses of JSC::Strong that can lead to reference cycles in CustomEvent,
  MessageEvent, and PopStateEvent, refactoring to share more code

- removed incorrect use of CachedAttribute on attributes that can change values
  (should have fixed a bug; can we find a way to test this?)

- did a more thorough job of clearing state from events, including clearing
  certain things before dispatching, and clearing more in initKeyboardEvent
  (may have fixed some obscure low-severity bugs; can we find a way to test this?)

- removed "dummy" keyboard events

- reworked code that omits details from error events for security reasons;
  old approach was "sanitizing" the error by removing the details if not
  allowed, new approach is adding the details only if allowed

* Modules/encryptedmedia/NavigatorEME.h: Added forward declaration needed
to compile.

* Modules/indexeddb/IDBCursor.h: Added comment about incorrect use of JSC::Strong.
* Modules/indexeddb/IDBRequest.h: Ditto.
* Modules/paymentrequest/PaymentResponse.h: Ditto.

* WebCore.xcodeproj/project.pbxproj: Added JSValueInWrappedObject.h.

* bindings/js/CommonVM.cpp:
(WebCore::commonVMSlow): Use VM::create instead of VM::createLeaked. Also use
local variable instead of the global.

* bindings/js/DOMWrapperWorld.h: Put the inline bodies of the currentWorld and
worldForDOMObject functions separate from the declarations; long term goal is
that the declarations serve as documentation, and are not interspersed with the
implementations. Changed currentWorld to take a reference instead of a pointer
to ExecState. Added isWorldCompatible function.

* bindings/js/JSCustomElementInterface.cpp:
(WebCore::JSCustomElementInterface::upgradeElement): Use toJSDOMWindow instead
of toJSDOMGlobalObject and added check for null.
(WebCore::JSCustomElementInterface::invokeCallback): Ditto.

* bindings/js/JSCustomEventCustom.cpp:
(WebCore::JSCustomEvent::detail const): Use cachedPropertyValue.
(WebCore::JSCustomEvent::visitAdditionalChildren): Added. Needed now that we are
using JSValueInWrappedObject instead of JSC::Strong.

* bindings/js/JSDOMConvertEventListener.h:
(WebCore::Converter<IDLEventListener<T>>::convert): Pass a reference.
* bindings/js/JSDOMGlobalObject.cpp:
(WebCore::toJSDOMGlobalObject): Ditto.

* bindings/js/JSDOMGlobalObject.cpp:
(WebCore::JSDOMGlobalObject::JSDOMGlobalObject): Moved initialization to nullptr
to the header.
(WebCore::toJSDOMGlobalObject): Deleted.
* bindings/js/JSDOMGlobalObject.h: Updated for the above.

* bindings/js/JSDOMWindowBase.h: Updated includes. Added "DOMWindow.h" but also
expanded the deprecated "JSDOMBinding.h" into all the things it includes.

* bindings/js/JSDOMWindowProxy.cpp:
(WebCore::JSDOMWindowProxy::finishCreation): Tweak argument type to match usage.
(WebCore::JSDOMWindowProxy::create): Moved here from header, rolled in the code
that creates the structure.
(WebCore::JSDOMWindowProxy::setWindow): Take a reference instead of a pointer
or a RefPtr&&.
(WebCore::JSDOMWindowProxy::toWrapped): Use ? : instead of if.
(WebCore::toJS): Pass a reference.
* bindings/js/JSDOMWindowProxy.h: Updated for abvoe changes.

* bindings/js/JSDOMWrapper.cpp:
(WebCore::cloneAcrossWorlds): Added.
* bindings/js/JSDOMWrapper.h: Ditto.

* bindings/js/JSErrorHandler.cpp:
(WebCore::JSErrorHandler::JSErrorHandler): Changed to take a reference.
Marked inline.
(WebCore::JSErrorHandler::create): Moved here from header. No longer inline, but
the constructor is now inline, so same number of levels of function calls, and
less code compiled at the call site and less to compile in the header.
(WebCore::JSErrorHandler::handleEvent): Use toJSDOMWindow instead
of toJSDOMGlobalObject.
* bindings/js/JSErrorHandler.h: Ditto. Also made createJSErrorHandler take
references instead of pointers.

* bindings/js/JSEventListener.cpp:
(WebCore::JSEventListener::create): Moved here from the header.
(WebCore::createEventListenerForEventHandlerAttribute): Updated for change to
currentWorld.
(WebCore::toJSDOMGlobalObject): Moved here from JSDOMGlobalObject.cpp because
this is the only place this function is used now. Also, this was one of four
different overrides and so it was good to delete the other three. Also updated
to take a reference rather than a "must not be null" pointer.
(WebCore::JSEventListener::handleEvent): Coding style tweaks.
(WebCore::JSEventListener::virtualisAttribute const): Deleted. Now isAttribute
is virtual and uses final as needed to remain inline-able and efficient.
(WebCore::JSEventListener::operator== const): Use is<> and downcast<> instead
of JSEventListener::cast.
(WebCore::eventHandlerAttribute):  Updated for change to currentWorld.
(WebCore::setEventHandlerAttribute): Ditto.
(WebCore::setWindowEventHandlerAttribute): Ditto.
(WebCore::setDocumentEventHandlerAttribute): Ditto.

* bindings/js/JSEventListener.h: Moved create functions into the cpp file.
Removed the cast function, since callers can use is<> and downcast<> instead.
Use final rather than override and made isAttribute override the virtual
function in the base class, eliminating virtualIsAttribute.

* bindings/js/JSExtendableMessageEventCustom.cpp:
(WebCore::JSExtendableMessageEvent::data const): Use isWorldCompatible.
Still need to return here and fix the reference cycle for this class.

* bindings/js/JSLazyEventListener.cpp:
(WebCore::eventParameterName): Moved up so it can be used by the constructor.
(WebCore::convertZeroToOne): Added, so that the constructor can fix up text
positions passed in to it as part of initializing a data member.
(WebCore::JSLazyEventListener::JSLazyEventListener): Changed to take
a CreationArguments object instead of lots of separate arguments.
(WebCore::JSLazyEventListener::initializeJSFunction const): Removed unneeded
checks of m_code and m_eventParameterName, both guaranteed not to be null
by the constructor. Tweaked coding style a bit.
(WebCore::JSLazyEventListener::create): Pass CreationArguments object.
* bindings/js/JSLazyEventListener.h: Updated for above changes. Changed the
m_eventParameterName to be a reference since it's always a global string
that is never destroyed.

* bindings/js/JSMessageEventCustom.cpp:
(WebCore::JSMessageEvent::data const): Use cachedPropertyValue and also
updated for the new version of MessageEvent that uses a Variant instead
of a type plus separate functions for each type.
(WebCore::JSMessageEvent::visitAdditionalChildren): Added. Needed now that we are
using JSValueInWrappedObject instead of JSC::Strong.

* bindings/js/JSPopStateEventCustom.cpp:
(WebCore::JSPopStateEvent::state const): Use isWorldCompatible and also updated
to use JSValueInWrappedObject instead of JSC::Strong. Would be nice to share more
code with CustomEvent and MessageEvent, but at the moment they are subtly different.
Changed cacheState from a function to a lambda.
(WebCore::JSPopStateEvent::visitAdditionalChildren): Added. Needed now that we are
using JSValueInWrappedObject instead of JSC::Strong.

* bindings/js/JSValueInWrappedObject.h: Added.

* bindings/js/ScriptCachedFrameData.cpp:
(WebCore::ScriptCachedFrameData::restore): Updated for changes to JSDOMWindowProxy.
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::createWindowProxy): Ditto.
(WebCore::ScriptController::setDOMWindowForWindowProxy): Ditto.

* bindings/js/WorkerScriptController.cpp: Removed include of ScriptValue.h.
(WebCore::WorkerScriptController::evaluate): Reworked to use the new
canIncludeErrorDetails instead of sanitizeScriptError. Added a FIXME about the
strange handling of the error message out argument.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateRuntimeEnableConditionalString): Pass a reference to worldForDOMObject.
(GenerateImplementation): Removed an incorrect comment about a removed error
check that is truly unneeded.
(GenerateAttributeGetterBodyDefinition): Pass a reference to worldForDOMObject.
(GenerateAttributeSetterBodyDefinition): Pass references to createJSErrorHandler
and worldForDOMObject.
(GenerateCallWith): Pass a reference to worldForDOMObject.

* bindings/scripts/test/JS/JSTestGlobalObject.cpp: Updated for above changes.
* bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp: Ditto.
* bindings/scripts/test/JS/JSTestObj.cpp: Ditto.

* dom/CustomEvent.cpp:
(WebCore::CustomEvent::CustomEvent): Marked inline. Removed now unneeded
ExecState argument.
(WebCore::CustomEvent::create): Moved here from header. No longer inline, but
the constructor is now inline, so same number of levels of function calls, and
less code compiled at the call site and less to compile in the header.
(WebCore::CustomEvent::initCustomEvent): Updated to use JSValueInWrappedObject.
(WebCore::CustomEvent::trySerializeDetail): Deleted. Now handled by bindings.
* dom/CustomEvent.h: Updated for the above.
* dom/CustomEvent.idl: Added JSCustomMarkFunction and removed
CallWith=ScriptState.

* dom/Document.cpp:
(WebCore::Document::shouldBypassMainWorldContentSecurityPolicy const):
Updated to pass reference to currentWorld but also rewrote to be more direct.

* dom/Element.cpp:
(WebCore::Element::isKeyboardFocusable const): Take a pointer instead of a
reference to the keyboard event. This function can be called with no event;
before this patch we were using a "dummy event".
* dom/Element.h: Ditto.

* dom/ErrorEvent.cpp:
(WebCore::ErrorEvent::error): Use isWorldCompatible.

* dom/Event.cpp:
(WebCore::Event::create): Moved here from header.
(WebCore::Event::createForBindings): Ditto.
(WebCore::Event::initEvent): Updated to use the name m_canceled instead of
the name m_defaultPrevented.
(WebCore::Event::resetBeforeDispatch): Added. Clears m_defaultHandled so
a value left over from a previous dispatch doesn't affect the next dispatch.

* dom/Event.h: Renamed m_defaultPrevented to m_canceled to match specification
terminology and be slightly clearer. Added resetBeforeDispatch. Removed the
setDefaultPrevented function.

* dom/EventDispatcher.cpp:
(WebCore::EventDispatcher::dispatchEvent): Added call to resetBeforeDispatch.

* dom/EventListener.h: Made isAttribute virtual and got rid of virtualIsAttribute,
which was an alternative to using "final" before we had that in the language.

* dom/EventTarget.cpp:
(WebCore::EventTarget::dispatchEvent): Added call to resetBeforeDispatch.

* dom/KeyboardEvent.cpp:
(WebCore::KeyboardEvent::KeyboardEvent): Removed unneeded code that initializes
m_handledByInputMethod to false; we do that in the class definition now.
(WebCore::KeyboardEvent::create): Moved here from header.
(WebCore::KeyboardEvent::createForBindings): Ditto.
(WebCore::KeyboardEvent::initKeyboardEvent): Added code to reset m_charCode,
m_isComposing, m_keyCode, m_repeat, m_underlyingPlatformEvent, m_which, m_code,
and m_key. These are needed now that we can reuse an existing event; we don't
want them getting out of sync with the other data members.
(WebCore::KeyboardEvent::keyCode const): Updated for name change from m_keyEvent
to m_underlyingPlatformEvent.
(WebCore::KeyboardEvent::charCode const): Ditto.
(WebCore::findKeyboardEvent): Deleted. Was unused.
* dom/KeyboardEvent.h: Updated for the above. Removed KeyboardEvent::createForDummy.

* dom/MessageEvent.cpp:
(WebCore::MessageEvent::MessageEvent): Removed unnneded ExecState argument.
Simplified since m_data is now a Variant.
(WebCore::MessageEvent::create): More of the same.
(WebCore::MessageEvent::initMessageEvent): Ditto.
(WebCore::MessageEvent::trySerializeData): Deleted.
(WebCore::MessageEvent::data const): Deleted.
* dom/MessageEvent.h: Use a Variant.
* dom/MessageEvent.idl: Added JSCustomMarkFunction and removed
CallWith=ScriptState and CachedAttribute.

* dom/MouseEvent.h: Removed obsolete comment.
* dom/MouseEvent.idl: Wrap line differently.

* dom/PopStateEvent.cpp:
(WebCore::PopStateEvent::PopStateEvent): Removed unneeded ExecState argument.
Updated to use JSValueInWrappedObject.
(WebCore::PopStateEvent::create): Ditto.
(WebCore::PopStateEvent::trySerializeState): Ditto.
* dom/PopStateEvent.h: Ditto.
* dom/PopStateEvent.idl: Use JSCustomMarkFunction, and don't use
ConstructorCallWith=ScriptState.

* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::sanitizeScriptError): Deleted.
(WebCore::ScriptExecutionContext::canIncludeErrorDetails): Added.
(WebCore::ScriptExecutionContext::dispatchErrorEvent): Clarify by
using canIncludeErrorDetails instead of sanitizeScriptError.
* dom/ScriptExecutionContext.h: Ditto.

* dom/WheelEvent.cpp:
(WebCore::WheelEvent::WheelEvent): Updated for name change and also to
eliminate m_initializedWithPlatformWheelEvent.
(WebCore::WheelEvent::create): Moved here from header.
(WebCore::WheelEvent::createForBindings): Ditto.
(WebCore::WheelEvent::initWebKitWheelEvent): Renamed from initWheelEvent.
* dom/WheelEvent.h: Renamed initWheelEvent to initWebKitWheelEvent since
there is no standard init function for wheel events and we have this only
for backward compatibility. Got rid of the separate boolean
m_initializedWithPlatformWheelEvent and instead made the renamed
m_wheelEvent, m_underlyingPlatformEvent, optional for when there is no
underlying platform event.

* html/BaseDateAndTimeInputType.cpp:
(WebCore::BaseDateAndTimeInputType::isKeyboardFocusable const): Take a
pointer to the event so we can handle the case where there is no event.
* html/BaseDateAndTimeInputType.h: Ditto.
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::isKeyboardFocusable const): Ditto.
* html/HTMLAnchorElement.h: Ditto.
* html/HTMLAreaElement.cpp:
(WebCore::HTMLAreaElement::isKeyboardFocusable const): Ditto.
* html/HTMLAreaElement.h: Ditto.
* html/HTMLDocument.cpp: Added include of "DOMWindow.h".
* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::isKeyboardFocusable const): Take
pointer to the event.
* html/HTMLFormControlElement.h: Ditto.
* html/HTMLFrameOwnerElement.cpp:
(WebCore::HTMLFrameOwnerElement::isKeyboardFocusable const): Ditto.
* html/HTMLFrameOwnerElement.h: Ditto.
* html/HTMLIFrameElement.h: Ditto.
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::isKeyboardFocusable const): Ditto.
(WebCore::HTMLInputElement::isTextFormControlKeyboardFocusable const): Ditto.
* html/HTMLInputElement.h: Ditto.
* html/HTMLPlugInElement.cpp:
(WebCore::HTMLPlugInElement::isKeyboardFocusable const): Ditto.
* html/HTMLPlugInElement.h: Ditto.
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::isKeyboardFocusable const): Ditto.
* html/HTMLSelectElement.h: Ditto.
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::isKeyboardFocusable const): Ditto.
* html/HTMLTextAreaElement.h: Ditto.
* html/InputType.cpp:
(WebCore::InputType::isKeyboardFocusable const): Ditto.
* html/InputType.h: Ditto.
* html/RadioInputType.cpp:
(WebCore::RadioInputType::isKeyboardFocusable const): Ditto.
* html/RadioInputType.h: Ditto.
* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::isKeyboardFocusable const): Ditto.
* html/TextFieldInputType.h: Ditto.

* inspector/CommandLineAPIHost.cpp:
(WebCore::listenerEntriesFromListenerInfo): Pass reference to currentWorld.
Use is<> and downcast<> instead of JSEventListener::cast.
* inspector/PageScriptDebugServer.cpp:
(WebCore::PageScriptDebugServer::isContentScript const): Pass reference to
currentWorld.
* inspector/agents/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::buildObjectForEventListener):
Use is<> and downcast<> instead of JSEventListener::cast.

* mathml/MathMLElement.cpp:
(WebCore::MathMLElement::isKeyboardFocusable const): Take a
pointer to the event so we can handle the case where there is no event.
* mathml/MathMLElement.h: Ditto.

* page/DOMWindow.cpp:
(WebCore::DOMWindow::dispatchEvent): Added call to resetBeforeDispatch.
All event dispatching paths now need to do this; there are 3.

* page/EventHandler.cpp:
(WebCore::handleWheelEventInAppropriateEnclosingBox): Use the new
underlyingPlatformEvent function, less confusing than calling a function
named wheelEvent() on an object of type WheelEvent. Also, it returns
a const& to std::optional instead of a pointer, so updated for that.
(WebCore::EventHandler::defaultWheelEventHandler): Ditto.
(WebCore::EventHandler::internalKeyEvent): Use preventDefault instead
of setDefaultPrevented(true).
(WebCore::EventHandler::tabsToLinks const): Take a pointer.
(WebCore::EventHandler::defaultArrowEventHandler): Pass a pointer.
(WebCore::EventHandler::defaultTabEventHandler): Ditto.
* page/EventHandler.h: Updated for the above.

* page/EventSource.cpp:
(WebCore::EventSource::dispatchMessageEvent): Pass a reference rather
than a pointer when creating a message event.

* page/FocusController.cpp:
(WebCore::isFocusableElementOrScopeOwner): Use a pointer instead of reference
for keyboard event.
(WebCore::isNonFocusableScopeOwner): Ditto.
(WebCore::isFocusableScopeOwner): Ditto.
(WebCore::shadowAdjustedTabIndex): Ditto.
(WebCore::FocusController::findFocusableElementDescendingIntoSubframes):
Renamed to use simpler terminology than "descending down into frame document".
Changed to take a pointer instead of reference.
(WebCore::FocusController::setInitialFocus): Pass nullptr instead of
using KeyboardEvent::createForDummy.
(WebCore::FocusController::advanceFocus): Pointer instead of reference.
(WebCore::FocusController::advanceFocusInDocumentOrder): Ditto.
(WebCore::FocusController::findFocusableElementAcrossFocusScope): Ditto.
(WebCore::FocusController::findFocusableElementWithinScope): Ditto.
(WebCore::FocusController::nextFocusableElementWithinScope): Ditto.
(WebCore::FocusController::previousFocusableElementWithinScope): Ditto.
(WebCore::FocusController::findFocusableElementOrScopeOwner): Ditto.
(WebCore::FocusController::findElementWithExactTabIndex): Ditto.
(WebCore::nextElementWithGreaterTabIndex): Ditto.
(WebCore::previousElementWithLowerTabIndex): Ditto.
(WebCore::FocusController::nextFocusableElement): Ditto.
(WebCore::FocusController::previousFocusableElement): Ditto.
(WebCore::FocusController::nextFocusableElementOrScopeOwner): Ditto.
(WebCore::FocusController::previousFocusableElementOrScopeOwner): Ditto.
(WebCore::FocusController::findFocusCandidateInContainer): Ditto.
(WebCore::FocusController::advanceFocusDirectionallyInContainer): Ditto.
(WebCore::FocusController::advanceFocusDirectionally): Ditto.
* page/FocusController.h: Updated for the above.

* page/PageConsoleClient.cpp:
(WebCore::objectArgumentAt): Added. Helper to make functions below simpler.
(WebCore::canvasRenderingContext): Factored out logic to get the context
from either a canvas or a canvas rendering context from the functions below.
Also updated to not use ScriptValue and to use auto quite a bit more.
(WebCore::PageConsoleClient::record): Updated to use the functions above.
(WebCore::PageConsoleClient::recordEnd): Ditto.

* page/ios/EventHandlerIOS.mm:
(WebCore::EventHandler::tabsToAllFormControls const): Take a pointer
instead of a reference.
* page/mac/EventHandlerMac.mm:
(WebCore::EventHandler::tabsToAllFormControls const): Ditto.
* page/win/EventHandlerWin.cpp:
(WebCore::EventHandler::tabsToAllFormControls const): Ditto.
* platform/glib/EventHandlerGLib.cpp:
(WebCore::EventHandler::tabsToAllFormControls const): Ditto.
* svg/SVGAElement.cpp:
(WebCore::SVGAElement::isKeyboardFocusable const): Ditto.
* svg/SVGAElement.h: Ditto.

* testing/Internals.cpp:
(WebCore::Internals::isFromCurrentWorld const): Use isWorldCompatible.

Source/WebKit:

* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMWheelEvent.cpp:
(webkit_dom_wheel_event_init_wheel_event): Updated to call initWebKitWheelEvent.

* WebProcess/Plugins/PluginView.cpp: Removed include of ScriptValue.h.

* WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
(WebKit::WebEditorClient::executePendingEditorCommands):
Updated for name change from keyEvent to underlyingPlatformEvent.
(WebKit::WebEditorClient::handleInputMethodKeydown): Ditto.
* WebProcess/WebCoreSupport/wpe/WebEditorClientWPE.cpp:
(WebKit::WebEditorClient::handleKeyboardEvent): Ditto.
(WebKit::WebEditorClient::handleInputMethodKeydown): Ditto.

* WebProcess/WebPage/WebPage.cpp: Removed include of ScriptValue.h.

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::handleEditingKeyboardEvent): Updated for name change from
keyEvent to underlyingPlatformEvent.
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::executeKeypressCommandsInternal): Ditto.
(WebKit::WebPage::handleEditingKeyboardEvent): Ditto.

Source/WebKitLegacy/mac:

* DOM/DOMWheelEvent.mm:
(-[DOMWheelEvent initWheelEvent:wheelDeltaY:view:screenX:screenY:clientX:clientY:ctrlKey:altKey:shiftKey:metaKey:]):
Call initWebKitWheelEvent.

* Plugins/Hosted/NetscapePluginInstanceProxy.mm: Removed include of ScriptValue.h.
* WebCoreSupport/WebInspectorClient.mm: Ditto.
* WebView/WebFrame.mm: Ditto.

* WebView/WebHTMLView.mm:
(-[WebHTMLView _interpretKeyEvent:savingCommands:]): Updated for name change from keyEvent to
underlyingPlatformEvent.
(-[WebHTMLView _handleEditingKeyEvent:]): Ditto.

* WebView/WebScriptWorld.mm:
(+[WebScriptWorld scriptWorldForGlobalContext:]): Pass reference to currentWorld function.

* WebView/WebView.mm: Removed include of ScriptValue.h.

Source/WebKitLegacy/win:

* Plugins/PluginView.cpp: Removed include of ScriptValue.h.
* WebFrame.cpp: Ditto.

* WebScriptWorld.cpp:
(WebScriptWorld::scriptWorldForGlobalContext): Pass reference to currentWorld.

* WebView.cpp: Removed include of ScriptValue.h.
(WebView::handleEditingKeyboardEvent): Updated for name change from
keyEvent to underlyingPlatformEvent.

Source/WTF:

* wtf/text/OrdinalNumber.h: Added som missing const.
* wtf/text/TextPosition.h: Ditto.

LayoutTests:

* fast/dom/reference-cycle-leaks-expected.txt: Expect success for the
CustomEvent, MessageEvent, and PopStateEvent cycle leak checks.

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

19 months agoASSERTION FAILED: vm->currentThreadIsHoldingAPILock() seen with http/tests/paymentreq...
aestes@apple.com [Thu, 8 Feb 2018 04:10:09 +0000 (04:10 +0000)]
ASSERTION FAILED: vm->currentThreadIsHoldingAPILock() seen with http/tests/paymentrequest/payment-request-show-method.https.html
https://bugs.webkit.org/show_bug.cgi?id=182591

Reviewed by Youenn Fablet.

Fixes assertion failures in http/tests/paymentrequest/payment-request-show-method.https.html.

DOMPromise::whenSettled() calls the JSC API without first aquiring the API lock, and
r228195 added a call to whenSettled() where the lock is not guaranteed to be already
acquired.

Fix this by creating a JSLockHolder in DOMPromise::whenSettled().

* bindings/js/JSDOMPromise.cpp:
(WebCore::DOMPromise::whenSettled):

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

19 months agoREGRESSION(r227758): Webpage fails to load due to crash in com.apple.WebKit: WebKit...
commit-queue@webkit.org [Thu, 8 Feb 2018 03:30:34 +0000 (03:30 +0000)]
REGRESSION(r227758): Webpage fails to load due to crash in com.apple.WebKit: WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse + 267
https://bugs.webkit.org/show_bug.cgi?id=182532
<rdar://problem/36414017>

Patch by Antti Koivisto  <antti@apple.com> and Youenn Fablet <youenn@apple.com> on 2018-02-07
Reviewed by Chris Dumez.

No test case, don't know how to make one. The repro involves multipart HTTP streaming and details are hazy.
We were calling a function that was WTFMoved away just a few lines above.

* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):

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

19 months ago[iOS] Skip webgl/webgl-texture-image-buffer-reuse.html
said@apple.com [Thu, 8 Feb 2018 02:32:38 +0000 (02:32 +0000)]
[iOS] Skip webgl/webgl-texture-image-buffer-reuse.html
https://bugs.webkit.org/show_bug.cgi?id=182592

Unreviewed test gardening.

* platform/ios/TestExpectations:

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

19 months agoRemove www1/www2 URLs from service worker tests
commit-queue@webkit.org [Thu, 8 Feb 2018 02:29:57 +0000 (02:29 +0000)]
Remove www1/www2 URLs from service worker tests
https://bugs.webkit.org/show_bug.cgi?id=182548

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

LayoutTests/imported/w3c:

* web-platform-tests/service-workers/service-worker/http-to-https-redirect-and-register.https-expected.txt:
* web-platform-tests/service-workers/service-worker/http-to-https-redirect-and-register.https.html:
* web-platform-tests/service-workers/service-worker/update-bytecheck.https.html:

LayoutTests:

* TestExpectations:

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

19 months agoUnreviewed, rolling out r228243.
ryanhaddad@apple.com [Thu, 8 Feb 2018 02:25:37 +0000 (02:25 +0000)]
Unreviewed, rolling out r228243.

Introduced an assertion failure with API test
FullscreenZoomInitialFrame.WebKit

Reverted changeset:

"Assert that NSApp is not running in the WebProcess."
https://bugs.webkit.org/show_bug.cgi?id=182553
https://trac.webkit.org/changeset/228243

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

19 months agoEvernote device management web view sometimes displays at the wrong scale
timothy_horton@apple.com [Thu, 8 Feb 2018 01:27:04 +0000 (01:27 +0000)]
Evernote device management web view sometimes displays at the wrong scale
https://bugs.webkit.org/show_bug.cgi?id=182590
<rdar://problem/36633687>

Reviewed by Simon Fraser.

Evernote implements the WKWebView's scroll view's delegate method
viewForZoomingInScrollView: and returns nil. This results in
WKScrollView's zoomScale always returning 1, no matter what the
WKContentView's actual scale is. This will result in us never updating
the WKContentView's scale to 1. When loading a page that has a few
scale changes during load but ends up at scale 1, we get stuck at whatever
intermediate scale immediately preceded settling on 1.

Fix this by not forwarding viewForZoomingInScrollView: to the external
WKScrollView delegate; we are in charge of the contents of the scroll
view (including which view scrollView's zoomScale should track), and
overriding viewForZoomingInScrollView: is only ever going to lead to
a broken WebKit.

* UIProcess/ios/WKScrollView.mm:
(shouldForwardScrollViewDelegateMethodToExternalDelegate):
(-[WKScrollViewDelegateForwarder forwardInvocation:]):
(-[WKScrollViewDelegateForwarder forwardingTargetForSelector:]):

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/ios/WKScrollViewDelegate.mm: Renamed from Tools/TestWebKitAPI/Tests/ios/WKScrollViewDelegateCrash.mm.
(-[TestDelegateForScrollView dealloc]):
(TestWebKitAPI::TEST):
(-[WKScrollViewDelegateWithViewForZoomingOverridden viewForZoomingInScrollView:]):
Add a test that failed before the change that ensures that we don't
consult the external delegate for viewForZoomingInScrollView:, and that
we succesfully update the scale even if it matches that of the view
the external delegate returns for viewForZoomingInScrollView:.

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

19 months agoSwitch testRunner.installStatisticsDidModifyDataRecordsCallback() to testRunner.insta...
wilander@apple.com [Thu, 8 Feb 2018 01:25:06 +0000 (01:25 +0000)]
Switch testRunner.installStatisticsDidModifyDataRecordsCallback() to testRunner.installStatisticsDidScanDataRecordsCallback() in two tests
https://bugs.webkit.org/show_bug.cgi?id=182366
<rdar://problem/37094805>

Unreviewed test gardening.

This change is an attempt to make two flaky test cases stable.
It also skips http/tests/resourceLoadStatistics/user-interaction-only-reported-once-within-short-period-of-time.html
because the timestamp resolution of 5 seconds is now so short that we run into timing flakiness.

* http/tests/resourceLoadStatistics/non-prevalent-resource-with-user-interaction.html:
* http/tests/resourceLoadStatistics/non-prevalent-resource-without-user-interaction.html:
* platform/mac-wk2/TestExpectations:
    Removed [ Skip ] entry for http/tests/resourceLoadStatistics/non-prevalent-resource-with-user-interaction.html
    Added [ Skip ] entry for http/tests/resourceLoadStatistics/user-interaction-only-reported-once-within-short-period-of-time.html
* platform/wk2/TestExpectations:
    Now both the above test cases are marked [ Pass ].

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

19 months agoWeb Inspector: replace isAncestor with Node.contains() in LegacyTabBar
mattbaker@apple.com [Thu, 8 Feb 2018 00:58:25 +0000 (00:58 +0000)]
Web Inspector: replace isAncestor with Node.contains() in LegacyTabBar
https://bugs.webkit.org/show_bug.cgi?id=182586

Reviewed by Timothy Hatcher.

* UserInterface/Views/LegacyTabBar.js:

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

19 months ago[Curl] Cookie Database has some warnings when compiled in clang
commit-queue@webkit.org [Thu, 8 Feb 2018 00:39:17 +0000 (00:39 +0000)]
[Curl] Cookie Database has some warnings when compiled in clang
https://bugs.webkit.org/show_bug.cgi?id=182583

Patch by Christopher Reid <chris.reid@sony.com> on 2018-02-07
Reviewed by Alex Christensen.

No new tests, no change in behavior.

Fixing unused-parameter, missing-field-initializers, reorder, and pragma-once-outside-header warnings.

* platform/network/NetworkStorageSession.h:
* platform/network/curl/CookieJarCurlDatabase.cpp:
* platform/network/curl/CookieJarDB.cpp:
* platform/network/curl/NetworkStorageSessionCurl.cpp:

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

19 months agoRemove unused CSSParserContext in CSSParser::parseInlineStyleDeclaration
rniwa@webkit.org [Thu, 8 Feb 2018 00:11:54 +0000 (00:11 +0000)]
Remove unused CSSParserContext in CSSParser::parseInlineStyleDeclaration
https://bugs.webkit.org/show_bug.cgi?id=182587

Reviewed by Simon Fraser.

Removed the code. There is no need to create an unused CSSParserContext in CSSParser.

* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseInlineStyleDeclaration):
* css/parser/CSSParser.h:
* css/parser/CSSParserImpl.cpp:
(WebCore::CSSParserImpl::parseInlineStyleDeclaration):
* css/parser/CSSParserImpl.h:

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

19 months agoAdd missing #if ENABLE(VIDEO_TRACK) after r228201.
ross.kirsling@sony.com [Wed, 7 Feb 2018 23:51:28 +0000 (23:51 +0000)]
Add missing #if ENABLE(VIDEO_TRACK) after r228201.
https://bugs.webkit.org/show_bug.cgi?id=182585

Reviewed by Chris Dumez.

* loader/LinkPreloadResourceClients.h:

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

19 months agoSkip media/modern-media-controls/tracks-support/tracks-support-show-panel-after-dragg...
ryanhaddad@apple.com [Wed, 7 Feb 2018 23:16:42 +0000 (23:16 +0000)]
Skip media/modern-media-controls/tracks-support/tracks-support-show-panel-after-dragging-controls.html.
https://bugs.webkit.org/show_bug.cgi?id=169158

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

19 months ago[Extra zoom mode] Delegate scrolling from the content view to input view controllers
wenson_hsieh@apple.com [Wed, 7 Feb 2018 23:13:49 +0000 (23:13 +0000)]
[Extra zoom mode] Delegate scrolling from the content view to input view controllers
https://bugs.webkit.org/show_bug.cgi?id=182534
<rdar://problem/37276625>

Reviewed by Tim Horton.

Override -_wheelChangedWithEvent: on the content view, and give extra zoomed input view controllers a chance to
handle the event.

* Platform/spi/ios/UIKitSPI.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _wheelChangedWithEvent:]):

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

19 months ago[Extra zoom mode] Implement multiple and single select menus
wenson_hsieh@apple.com [Wed, 7 Feb 2018 23:07:02 +0000 (23:07 +0000)]
[Extra zoom mode] Implement multiple and single select menus
https://bugs.webkit.org/show_bug.cgi?id=182525
<rdar://problem/35143016>

Reviewed by Tim Horton.

Add support for presenting picker views when focusing single or multiple select elements. See changes below for
additional detail.

* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _startAssistingKeyboard]):

Move logic for presenting view controllers when focusing elements out of _startAssistingKeyboard, and into
_startAssistingNode:(...). This is because _startAssistingKeyboard is only invoked for certain types of focused
element types; importantly, this set excludes select elements. Putting the call to present the focused view
controller there also didn't make much since, considering that these new view controllers are not tied to
keyboards in any way.

(-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
(-[WKContentView _stopAssistingNode]):

Dismiss any select menu that is being presented.

(-[WKContentView presentSelectMenuViewController:]):
(-[WKContentView dismissSelectMenuViewController:]):

Introduce idempotent helpers for presenting and dismissing the select menu view controller.

(-[WKContentView presentViewControllerForAssistedNode:]):
(-[WKContentView selectMenu:didSelectItemAtIndex:]):

For single select menus. Called when the user selects a row.

(-[WKContentView didCancelSelectionInSelectMenu:]):
(-[WKContentView numberOfItemsInSelectMenu:]):
(-[WKContentView selectMenu:displayTextForItemAtIndex:]):

Indicates the text value to show at a given index.

(-[WKContentView selectMenu:didCheckItemAtIndex:checked:]):

For multiple select menus, invoked when an item is checked. The `checked` parameter indicates whether or not the
item is now checked.

(-[WKContentView selectMenuSupportsMultipleSelection:]):

Indicates whether this select menu is single-item-only, or allows multiple items to be selected (checked).

(-[WKContentView selectMenu:hasCheckedOptionAtIndex:]):

For multiple select menus. Determines whether an option at the given index is checked.

(-[WKContentView startingIndexForSelectMenu:]):

Determines the index to instantly scroll to when presenting the select menu.

* UIProcess/ios/forms/WKSelectMenuViewController.h: Added.
* UIProcess/ios/forms/WKSelectMenuViewController.mm: Added.

Add new harness files for WKSelectMenuViewController's header and implementation (see WebKitAdditions).

* WebKit.xcodeproj/project.pbxproj:

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

19 months agoImprove NetworkResourceLoader logging to capture redirect cases
bfulgham@apple.com [Wed, 7 Feb 2018 22:53:35 +0000 (22:53 +0000)]
Improve NetworkResourceLoader logging to capture redirect cases
https://bugs.webkit.org/show_bug.cgi?id=182573
<rdar://problem/37316714>

Reviewed by Chris Dumez.

Add logging for cookie partitioning or blocking during redirects.

* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):

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

19 months agoAssert that NSApp is not running in the WebProcess.
pvollan@apple.com [Wed, 7 Feb 2018 22:33:10 +0000 (22:33 +0000)]
Assert that NSApp is not running in the WebProcess.
https://bugs.webkit.org/show_bug.cgi?id=182553
<rdar://problem/37316144>

Reviewed by Simon Fraser.

In WebCore, there are a few places where NSApp is referenced. Since the WebContent process
is no longer using the NSApplication run loop, and NSApp is no longer guaranteed to be
valid, we should make sure that the NSApp is not referenced by the WebContent process or
the Network process, by asserting that the NSApplication event loop is running when NSApp
is referenced. It is still ok for the UIProcess to reference NSApp. Adding these assert
will help catch references to NSApp when the NSApplication run loop is not used.
Also, do not post a fake mouse event in PasteBoard::setDragImage when the NSApplication
run loop is not running, since this is only relevant in WK1.

No new tests, covered by existing tests.

* page/mac/EventHandlerMac.mm:
(WebCore::lastEventIsMouseUp):
(WebCore::EventHandler::sendFakeEventsAfterWidgetTracking):
* platform/mac/PasteboardMac.mm:
(WebCore::Pasteboard::setDragImage):
* platform/mac/WebVideoFullscreenController.mm:
(-[WebVideoFullscreenController windowDidLoad]):
(-[WebVideoFullscreenController updateMenuAndDockForFullscreen]):
* platform/mac/WebWindowAnimation.mm:
(WebCore::WebWindowAnimationDurationFromDuration):

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

19 months agoASSERTION FAILED: m_timeOrigin in Performance::Performance()
commit-queue@webkit.org [Wed, 7 Feb 2018 21:55:23 +0000 (21:55 +0000)]
ASSERTION FAILED: m_timeOrigin in Performance::Performance()
https://bugs.webkit.org/show_bug.cgi?id=182558
<rdar://problem/37297551>

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

Source/WebCore:

Test: http/wpt/fetch/cors-preflight-star.any.serviceworker.html

* loader/CrossOriginPreflightChecker.cpp:
(WebCore::CrossOriginPreflightChecker::startPreflight):

LayoutTests:

Make use of WPT cors-preflight-star.any.js test in service worker.
This test should be removed once WPT will run any.js tests in service workers as well as workers and window.

* http/wpt/service-workers/cors-preflight-star.any.js: Added.
* http/wpt/service-workers/cors-preflight-star.any.serviceworker-expected.txt: Added.
* http/wpt/service-workers/cors-preflight-star.any.serviceworker.html: Added.

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

19 months agoREGRESSION(r226396): File paths are inserted when dropping image files
wenson_hsieh@apple.com [Wed, 7 Feb 2018 21:31:15 +0000 (21:31 +0000)]
REGRESSION(r226396): File paths are inserted when dropping image files
https://bugs.webkit.org/show_bug.cgi?id=182557
<rdar://problem/37294120>

Reviewed by Ryosuke Niwa.

Source/WebCore:

Reverts unintended changes in <http://trac.webkit.org/r226396>. Before r226396, WebContentReader::readFilenames
(a helper function in macOS-specific code) contained logic to create and insert attachment elements if
ENABLE(ATTACHMENT_ELEMENT); otherwise, it would fall back to inserting the visible URL as a text node. Since we
enable the attachment element on all Cocoa platforms via xcconfig files, this was effectively dead code.

However, when r226396 (which moved this out from macOS to Cocoa platform code) refactored this helper function,
it also moved this chunk of code out of the !ENABLE(ATTACHMENT) conditional and into a PLATFORM(MAC) guard,
which means that we now fall back to inserting file paths as text when attachment elements are disabled. To fix
this, we simply remove the (previously) dead code.

A more subtle difference is that we no longer always return true from WebContentReader::readFilePaths. This
means that when we drop files, we no longer skip over the early return in documentFragmentFromDragData when
we've made a fragment, so we read the file path as a URL. To address this, we just restore the pre-macOS 10.13.4
behavior of initializing the document fragment.

Test: modified editing/pasteboard/drag-files-to-editable-element-as-URLs.html.

* editing/WebContentReader.cpp:
(WebCore::WebContentReader::ensureFragment): Deleted.

Remove this helper, as it was only used in WebContentReader::readFilePaths.

* editing/WebContentReader.h:
* editing/cocoa/WebContentReaderCocoa.mm:
(WebCore::WebContentReader::readFilePaths):

Tools:

Tweak some image pasting API tests to ensure that file paths are not inserted when pasting images backed by
file paths on disk.

* TestWebKitAPI/Tests/WebKitCocoa/PasteImage.mm:
(TEST):

LayoutTests:

Tweak an existing layout test that drops a file into a contenteditable, to check that no text is inserted into
the editable element after dropping.

* editing/pasteboard/drag-files-to-editable-element-as-URLs-expected.txt:
* editing/pasteboard/drag-files-to-editable-element-as-URLs.html:

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

19 months agoRestrict Referer to just the origin for third parties in private mode and third parti...
wilander@apple.com [Wed, 7 Feb 2018 20:09:51 +0000 (20:09 +0000)]
Restrict Referer to just the origin for third parties in private mode and third parties ITP blocks cookies for in regular mode
https://bugs.webkit.org/show_bug.cgi?id=182559
<rdar://problem/36990337>

Reviewed by Andy Estes.

Source/WebCore:

Tests: http/tests/resourceLoadStatistics/strip-referrer-to-origin-for-prevalent-subresource-redirects.html
       http/tests/resourceLoadStatistics/strip-referrer-to-origin-for-prevalent-subresource-requests.html
       http/tests/security/strip-referrer-to-origin-for-third-party-redirects-in-private-mode.html
       http/tests/security/strip-referrer-to-origin-for-third-party-requests-in-private-mode.html

* page/SecurityPolicy.cpp:
(WebCore::SecurityPolicy::referrerToOriginString):
    Now exposed within WebCore. This is to make sure we create a proper referrer
    string in WebCore::ResourceRequestBase::setExistingHTTPReferrerToOriginString().
(WebCore::referrerToOriginString): Deleted.
    Used to be internal.
* page/SecurityPolicy.h:
* platform/network/ResourceRequestBase.cpp:
(WebCore::ResourceRequestBase::setExistingHTTPReferrerToOriginString):
    New, exported function used in WebKit. Note that this function does not
    set the referrer if the request has none since before.
* platform/network/ResourceRequestBase.h:

Source/WebKit:

* NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTaskCocoa::isThirdPartyRequest):
    New convenience function. Checks whether the resource shares
    partition with the first party.
(WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
    Now strips the referrer to just the origin for:
    1. All third party requests in private mode.
    2. Third party requests to domains that ITP blocks cookies for.
(WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
    Now strips the referrer in redirects to just the origin for:
    1. All third party requests in private mode.
    2. Third party requests to domains that ITP blocks cookies for.

LayoutTests:

* TestExpectations:
    New tests marked as [ Skip ]. The change only applies to iOS and Mac.
* http/tests/resourceLoadStatistics/resources/echo-referrer.php: Added.
* http/tests/resourceLoadStatistics/strip-referrer-to-origin-for-prevalent-subresource-redirects-expected.txt: Added.
* http/tests/resourceLoadStatistics/strip-referrer-to-origin-for-prevalent-subresource-redirects.html: Added.
* http/tests/resourceLoadStatistics/strip-referrer-to-origin-for-prevalent-subresource-requests-expected.txt: Added.
* http/tests/resourceLoadStatistics/strip-referrer-to-origin-for-prevalent-subresource-requests.html: Added.
* http/tests/security/resources/echo-referrer.php: Added.
* http/tests/security/resources/redirect.php: Added.
* http/tests/security/strip-referrer-to-origin-for-third-party-redirects-in-private-mode-expected.txt: Added.
* http/tests/security/strip-referrer-to-origin-for-third-party-redirects-in-private-mode.html: Added.
* http/tests/security/strip-referrer-to-origin-for-third-party-requests-in-private-mode-expected.txt: Added.
* http/tests/security/strip-referrer-to-origin-for-third-party-requests-in-private-mode.html: Added.
* platform/ios/TestExpectations:
    New tests marked as [ Pass ].
* platform/mac-wk2/TestExpectations:
    New tests marked as [ Pass ].
* platform/wk2/TestExpectations:
    New tests marked as [ Skip ].

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

19 months ago[RenderTreeBuilder] Remove RenderElement::destroyLeftoverChildren.
zalan@apple.com [Wed, 7 Feb 2018 19:52:45 +0000 (19:52 +0000)]
[RenderTreeBuilder] Remove RenderElement::destroyLeftoverChildren.
https://bugs.webkit.org/show_bug.cgi?id=182518
<rdar://problem/37256035>

Reviewed by Antti Koivisto.

Remove leftover children before we call takeChild() on the parent (as opposed to when
we finally call destroy() on the parent).
This patch also explicitly destroys the top level pagination renderers.

Covered by existing tests.

* rendering/RenderElement.cpp:
(WebCore::RenderElement::removeAndDestroyChild):
(WebCore::RenderElement::destroyLeftoverChildren): Deleted.
* rendering/RenderElement.h:
* rendering/RenderObject.cpp:
(WebCore::RenderObject::destroy):
* rendering/updating/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::tearDownRenderers):
(WebCore::RenderTreeUpdater::tearDownLeftoverPaginationRenderersIfNeeded):
* rendering/updating/RenderTreeUpdater.h:

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

19 months agoStyleBench: Attribute selectors and other improvements
antti@apple.com [Wed, 7 Feb 2018 19:33:27 +0000 (19:33 +0000)]
StyleBench: Attribute selectors and other improvements
https://bugs.webkit.org/show_bug.cgi?id=182387

Reviewed by Joseph Pecoraro.

- Add some attributes to elements in all tests
- Add some attribute selectors to stylesheets in all tests
- Also add some * selectors to all stylesheets.
- Add attribute mutation step to all suites
- Make test steps do more mutations (25->100) and reduce the number of steps to keep testing time in check.
  Too fast steps were running into timer resolution limits.

* StyleBench/resources/style-bench.js:
(defaultConfiguration):
(prototype.randomAttributeName):
(prototype.randomAttributeValue):
(prototype.randomAttributeSelector):
(prototype.makeCompoundSelector):
(prototype.makeElement):
(prototype.addClasses):
(prototype.removeClasses):
(prototype.mutateAttributes):
(prototype.async.runForever):
* StyleBench/resources/tests.js:
(makeSteps):
(makeSuite):

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

19 months agoAdjusted test expectations for storage/indexeddb/modern/idbtransaction-objectstore...
jlewis3@apple.com [Wed, 7 Feb 2018 19:28:46 +0000 (19:28 +0000)]
Adjusted test expectations for storage/indexeddb/modern/idbtransaction-objectstore-failures.html.
https://bugs.webkit.org/show_bug.cgi?id=171862

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

19 months agoVersioning.
jmarcell@apple.com [Wed, 7 Feb 2018 19:23:32 +0000 (19:23 +0000)]
Versioning.

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

19 months agoWeb Inspector: Styles: completion popover doesn't hide when switching panels
nvasilyev@apple.com [Wed, 7 Feb 2018 19:01:16 +0000 (19:01 +0000)]
Web Inspector: Styles: completion popover doesn't hide when switching panels
https://bugs.webkit.org/show_bug.cgi?id=182464
<rdar://problem/37202763>

Reviewed by Timothy Hatcher.

Hide completion popover by triggering blur event on the focused text field.
Removing text fields from the DOM tree would hide the completion popovers as well,
but switching sidebar panels doesn't remove them from the DOM.

* UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js:
(WI.SpreadsheetCSSStyleDeclarationEditor.prototype.hidden):
* UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
(WI.SpreadsheetCSSStyleDeclarationSection.prototype.hidden):
* UserInterface/Views/SpreadsheetRulesStyleDetailsPanel.js:
(WI.SpreadsheetRulesStyleDetailsPanel.prototype.hidden):
* UserInterface/Views/SpreadsheetStyleProperty.js:
(WI.SpreadsheetStyleProperty.prototype.hidden):

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

19 months agoLog error when authentication challenge is blocked due to an insecure request
dbates@webkit.org [Wed, 7 Feb 2018 18:56:02 +0000 (18:56 +0000)]
Log error when authentication challenge is blocked due to an insecure request
https://bugs.webkit.org/show_bug.cgi?id=182358

Reviewed by Andy Estes.

Source/WebCore:

Emit an error message to Web Inspector console that explains why an authentication
challenge was blocked so that a developer can fix up their site.

Tests: http/tests/security/mixedContent/insecure-basic-auth-image.https.html
       http/tests/security/mixedContent/secure-page-navigates-to-basic-auth-insecure-page.https.html
       http/tests/security/mixedContent/secure-page-navigates-to-basic-auth-secure-page-via-insecure-redirect.https.html

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::receivedFirstData): Log to the console an error message
if the document we are loading was forbidden from prompting for credentials.
Also removed duplicate assertion to ensure document is non-null and update
call to LinkLoader::loadLinksFromHeader() to use local variable to access
the document we are loading instead of asking the frame for it, again.
(WebCore::FrameLoader::reportAuthenticationChallengeBlocked): Added.
* loader/FrameLoader.h:

* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::init):
(WebCore::ResourceLoader::willSendRequestInternal):
Track the decision to forbid asking for credentials due to Fetch spec. requirements (m_canAskClientForCredentials)
independently from the decision to forbid them due to making an insecure request (m_wasInsecureRequestSeen)
so that we know the reason why we blocked asking for credentials when we receive an authentication challenge.

(WebCore::ResourceLoader::didBlockAuthenticationChallenge): Added.
(WebCore::ResourceLoader::isAllowedToAskUserForCredentials const): Modified code now that we track
whether we have seen an insecure request so far independently from decision to forbid prompting for
credentials due to a Fetch spec. requirement.

(WebCore::ResourceLoader::didReceiveAuthenticationChallenge):
Store a bit whether we have seen an insecure request when loading the resource so far. Disallow
asking for credentials if we have seen an insecure request so far. Once we receive a response

* loader/ResourceLoader.h:
(WebCore::ResourceLoader::wasAuthenticationChallengeBlocked const): Added.
(WebCore::ResourceLoader::wasInsecureRequestSeen const): Added.

Source/WebKit:

Have network process notify the web process when it blocks an authentication challenge.

* NetworkProcess/NetworkLoad.cpp:
(WebKit::NetworkLoad::completeAuthenticationChallenge):
* NetworkProcess/NetworkLoadClient.h:
(WebKit::NetworkLoadClient::didBlockAuthenticationChallenge):
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::didBlockAuthenticationChallenge):
* NetworkProcess/NetworkResourceLoader.h:
* WebProcess/Network/WebResourceLoader.cpp:
(WebKit::WebResourceLoader::didBlockAuthenticationChallenge):
* WebProcess/Network/WebResourceLoader.h:
* WebProcess/Network/WebResourceLoader.messages.in:

LayoutTests:

Add more tests and update expected results of existing tests now that we emit console messages.

Also fixed a typo in LayoutTests/http/tests/security/mixedContent/secure-redirect-to-secure-redirect-to-basic-auth-insecure-image.https.html
so that it tests what it actually claims to test and made the test programmatically load the image
to avoid output flakiness caused by the preload scanner preloading it. The preload scanner performs
mixed content checks and this can cause duplicate mixed content warnings in the test output.

* http/tests/security/mixedContent/insecure-basic-auth-image.https-expected.txt: Added.
* http/tests/security/mixedContent/insecure-basic-auth-image.https.html: Copied from LayoutTests/http/tests/security/mixedContent/secure-redirect-to-secure-redirect-to-basic-auth-insecure-image.https.html.
* http/tests/security/mixedContent/insecure-download-redirects-to-basic-auth-secure-download.https-expected.txt:
* http/tests/security/mixedContent/insecure-image-redirects-to-basic-auth-secure-image-expected.txt:
* http/tests/security/mixedContent/resources/subresource/protected-page.php: Added.
* http/tests/security/mixedContent/resources/subresource2/protected-image.php: Added.
* http/tests/security/mixedContent/secure-page-navigates-to-basic-auth-insecure-page.https-expected.txt: Added.
* http/tests/security/mixedContent/secure-page-navigates-to-basic-auth-insecure-page.https.html: Added.
* http/tests/security/mixedContent/secure-page-navigates-to-basic-auth-secure-page-via-insecure-redirect.https-expected.txt: Added.
* http/tests/security/mixedContent/secure-page-navigates-to-basic-auth-secure-page-via-insecure-redirect.https.html: Added.
* http/tests/security/mixedContent/secure-redirect-to-insecure-redirect-to-basic-auth-secure-image.https-expected.txt:
* http/tests/security/mixedContent/secure-redirect-to-secure-redirect-to-basic-auth-insecure-image.https-expected.txt:
* http/tests/security/mixedContent/secure-redirect-to-secure-redirect-to-basic-auth-insecure-image.https.html:

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

19 months agoIndexedDB in service workers is using a memory backed store
cdumez@apple.com [Wed, 7 Feb 2018 18:51:21 +0000 (18:51 +0000)]
IndexedDB in service workers is using a memory backed store
https://bugs.webkit.org/show_bug.cgi?id=182574
<rdar://problem/37316205>

Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

Rebaseline WPT test that is now passing.

* web-platform-tests/service-workers/service-worker/indexeddb.https-expected.txt:

Source/WebKit:

Make sure we pass a proper WebDatabaseProvider to the ServiceWorkerProcess via
PageConfiguration. Otherwise, we end up using the default EmptyDatabaseProvider
which uses an InProcessIDBServer and a memory-backed store for IndexedDB.

* UIProcess/ServiceWorkerProcessProxy.cpp:
(WebKit::ServiceWorkerProcessProxy::start):
* UIProcess/WebProcessPool.h:
* WebProcess/Storage/WebSWContextManagerConnection.cpp:
(WebKit::WebSWContextManagerConnection::WebSWContextManagerConnection):
(WebKit::WebSWContextManagerConnection::installServiceWorker):
* WebProcess/Storage/WebSWContextManagerConnection.h:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::establishWorkerContextConnectionToStorageProcess):
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:

LayoutTests:

Unskip test that no longer times out.

* TestExpectations:

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

19 months agoRemoved the assertions from VideoFullscreenInterfaceAVKit.mm temporarily to stop...
jlewis3@apple.com [Wed, 7 Feb 2018 18:13:52 +0000 (18:13 +0000)]
Removed the assertions from VideoFullscreenInterfaceAVKit.mm temporarily to stop the resulting crashes during debugging.
https://bugs.webkit.org/show_bug.cgi?id=182527

Unreviewed build fix.

* platform/ios/VideoFullscreenInterfaceAVKit.mm:
(VideoFullscreenInterfaceAVKit::exitFullscreen):
(VideoFullscreenInterfaceAVKit::cleanupFullscreen):

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

19 months ago[WPE] Enable http/wpt/fetch/response-status-text.html
Ms2ger@igalia.com [Wed, 7 Feb 2018 17:18:40 +0000 (17:18 +0000)]
[WPE] Enable http/wpt/fetch/response-status-text.html
https://bugs.webkit.org/show_bug.cgi?id=177872

Unreviewed test gardening.

* platform/wpe/TestExpectations: the test appears to pass since r227900.

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

19 months ago[GTK] Typo in a translatable string
mcatanzaro@igalia.com [Wed, 7 Feb 2018 16:48:32 +0000 (16:48 +0000)]
[GTK] Typo in a translatable string
https://bugs.webkit.org/show_bug.cgi?id=182570

Unreviewed. Fix a typo.

* UIProcess/API/glib/WebKitWebsiteDataManager.cpp:
(webkit_website_data_manager_class_init):

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

19 months ago[WPE] Test gardening
Ms2ger@igalia.com [Wed, 7 Feb 2018 16:13:35 +0000 (16:13 +0000)]
[WPE] Test gardening
https://bugs.webkit.org/show_bug.cgi?id=182568

Unreviewed test gardening.

* platform/wpe/TestExpectations:
  - imported/w3c/web-platform-tests/css/css-shapes/shape-outside/values/shape-margin-001.html: fixed in r226404.
  - imported/w3c/web-platform-tests/css/css-shapes/shape-outside/values/shape-outside-shape-arguments-000.html: fixed in r226404.
  - imported/w3c/web-platform-tests/XMLHttpRequest/getallresponseheaders.htm: fixed in r227900.
  - imported/w3c/web-platform-tests/XMLHttpRequest/status-async.htm: fixed in r227900.
  - imported/w3c/web-platform-tests/XMLHttpRequest/status-basic.htm: fixed in r227900.
  - imported/w3c/web-platform-tests/XMLHttpRequest/status-error.htm: fixed in r227900.
  - svg/custom/filter-update-different-root.html: fixed in r225797.
  - svg/filters/color-space-conversion.svg: fixed in r225797.
  - svg/filters/container-with-filters.svg: fixed in r225797.
  - svg/filters/feComposite-background-rect-control-operators.svg: fixed in r225797.
  - svg/filters/feDisplacementMap-filterUnits.svg: fixed in r225797.
* platform/wpe/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt:
  update for error message change, probably in r227900.

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

19 months ago[GTK] Enable WebKit.GeolocationTransitionTo{High,Low}Accuracy tests
Ms2ger@igalia.com [Wed, 7 Feb 2018 16:09:23 +0000 (16:09 +0000)]
[GTK] Enable WebKit.GeolocationTransitionTo{High,Low}Accuracy tests
https://bugs.webkit.org/show_bug.cgi?id=125068

Unreviewed test gardening.

They do not appear to have failed since we started running them again in r226944.

* TestWebKitAPI/glib/TestExpectations.json:

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

19 months ago[RenderTreeBuilder] Move RenderBlock::removeLeftoverAnonymousBlock to RenderTreeBuilder
zalan@apple.com [Wed, 7 Feb 2018 15:40:52 +0000 (15:40 +0000)]
[RenderTreeBuilder] Move RenderBlock::removeLeftoverAnonymousBlock to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=182510
<rdar://problem/37250037>

Reviewed by Antti Koivisto.

Do not reinvent subtree reparenting.

Covered by existing tests.

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::removeLeftoverAnonymousBlock): Deleted.
* rendering/RenderBlock.h:
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::moveAllChildrenToInternal):
* rendering/RenderBoxModelObject.h:
* rendering/RenderButton.h:
* rendering/RenderElement.cpp:
(WebCore::RenderElement::detachRendererInternal):
(WebCore::RenderElement::attachRendererInternal):
(WebCore::RenderElement::insertChildInternal):
(WebCore::RenderElement::takeChildInternal):
* rendering/RenderElement.h:
* rendering/RenderRuby.h:
* rendering/RenderRubyRun.h:
* rendering/RenderTextControl.h:
* rendering/updating/RenderTreeBuilderBlock.cpp:
(WebCore::RenderTreeBuilder::Block::insertChildIgnoringContinuation):
(WebCore::RenderTreeBuilder::Block::childBecameNonInline):
(WebCore::RenderTreeBuilder::Block::removeLeftoverAnonymousBlock):
* rendering/updating/RenderTreeBuilderBlock.h:

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

19 months ago[GTK] Enable WebKit.InjectedBundleFrameHitTest test
Ms2ger@igalia.com [Wed, 7 Feb 2018 14:47:07 +0000 (14:47 +0000)]
[GTK] Enable WebKit.InjectedBundleFrameHitTest test
https://bugs.webkit.org/show_bug.cgi?id=120303

Unreviewed test gardening.

It does not appear to have failed since we started running it again in r226944.

* TestWebKitAPI/glib/TestExpectations.json:

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

19 months ago[GTK] Enable WebKit.ForceRepaint test
Ms2ger@igalia.com [Wed, 7 Feb 2018 13:53:00 +0000 (13:53 +0000)]
[GTK] Enable WebKit.ForceRepaint test
https://bugs.webkit.org/show_bug.cgi?id=105532

Unreviewed test gardening.

It does not appear to have failed since we started running it again in r226944.

* TestWebKitAPI/glib/TestExpectations.json:

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

19 months ago[JHBuild] Add libva in moduleset
philn@webkit.org [Wed, 7 Feb 2018 11:32:42 +0000 (11:32 +0000)]
[JHBuild] Add libva in moduleset
https://bugs.webkit.org/show_bug.cgi?id=182384

Reviewed by Xabier Rodriguez-Calvar.

* gstreamer/jhbuild.modules: Add libva and disable spurious message output.
* gtk/install-dependencies: Remove libva from dependencies.
* wpe/install-dependencies: Ditto.

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

19 months ago[GTK] Enable WebKit.NewFirstVisuallyNonEmptyLayoutFrames test
Ms2ger@igalia.com [Wed, 7 Feb 2018 11:18:35 +0000 (11:18 +0000)]
[GTK] Enable WebKit.NewFirstVisuallyNonEmptyLayoutFrames test
https://bugs.webkit.org/show_bug.cgi?id=85037

Unreviewed test gardening.

It does not appear to have failed since we started running it again in r226944.

* TestWebKitAPI/glib/TestExpectations.json:

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

19 months agoNit fix for ruby script called through Perl
commit-queue@webkit.org [Wed, 7 Feb 2018 07:19:39 +0000 (07:19 +0000)]
Nit fix for ruby script called through Perl
https://bugs.webkit.org/show_bug.cgi?id=182552

Patch by Leo Balter <leonardo.balter@gmail.com> on 2018-02-06
Reviewed by Yusuke Suzuki.

* BuildSlaveSupport/build.webkit.org-config/steps.py:
(RunTest262Tests):

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

19 months agoRemove WebCore/ForwardingHeaders directory
don.olmstead@sony.com [Wed, 7 Feb 2018 05:20:34 +0000 (05:20 +0000)]
Remove WebCore/ForwardingHeaders directory
https://bugs.webkit.org/show_bug.cgi?id=182347

Reviewed by Keith Miller.

Source/ThirdParty:

* gtest/CMakeLists.txt:
* gtest/include/gtest/internal/gtest-port.h:

Source/WebCore:

No new tests. No change in behavior.

* CMakeLists.txt:
* ForwardingHeaders/bindings/ScriptFunctionCall.h: Removed.
* ForwardingHeaders/bindings/ScriptObject.h: Removed.
* ForwardingHeaders/bindings/ScriptValue.h: Removed.
* ForwardingHeaders/builtins/BuiltinNames.h: Removed.
* ForwardingHeaders/builtins/BuiltinUtils.h: Removed.
* ForwardingHeaders/builtins/JSCBuiltins.h: Removed.
* ForwardingHeaders/bytecode/CodeBlock.h: Removed.
* ForwardingHeaders/bytecode/SpeculatedType.h: Removed.
* ForwardingHeaders/bytecode/UnlinkedFunctionExecutable.h: Removed.
* ForwardingHeaders/debugger/Debugger.h: Removed.
* ForwardingHeaders/domjit/DOMJITAbstractHeap.h: Removed.
* ForwardingHeaders/domjit/DOMJITEffect.h: Removed.
* ForwardingHeaders/domjit/DOMJITGetterSetter.h: Removed.
* ForwardingHeaders/domjit/DOMJITHeapRange.h: Removed.
* ForwardingHeaders/domjit/DOMJITSignature.h: Removed.
* ForwardingHeaders/heap/BlockDirectoryInlines.h: Removed.
* ForwardingHeaders/heap/DeleteAllCodeEffort.h: Removed.
* ForwardingHeaders/heap/FastMallocAlignedMemoryAllocator.h: Removed.
* ForwardingHeaders/heap/GCActivityCallback.h: Removed.
* ForwardingHeaders/heap/GCFinalizationCallback.h: Removed.
* ForwardingHeaders/heap/HandleTypes.h: Removed.
* ForwardingHeaders/heap/Heap.h: Removed.
* ForwardingHeaders/heap/HeapInlines.h: Removed.
* ForwardingHeaders/heap/HeapObserver.h: Removed.
* ForwardingHeaders/heap/IncrementalSweeper.h: Removed.
* ForwardingHeaders/heap/LockDuringMarking.h: Removed.
* ForwardingHeaders/heap/MachineStackMarker.h: Removed.
* ForwardingHeaders/heap/MarkedBlockInlines.h: Removed.
* ForwardingHeaders/heap/MarkingConstraint.h: Removed.
* ForwardingHeaders/heap/RunningScope.h: Removed.
* ForwardingHeaders/heap/SimpleMarkingConstraint.h: Removed.
* ForwardingHeaders/heap/SlotVisitor.h: Removed.
* ForwardingHeaders/heap/SlotVisitorInlines.h: Removed.
* ForwardingHeaders/heap/Strong.h: Removed.
* ForwardingHeaders/heap/StrongInlines.h: Removed.
* ForwardingHeaders/heap/SubspaceInlines.h: Removed.
* ForwardingHeaders/heap/ThreadLocalCache.h: Removed.
* ForwardingHeaders/heap/Weak.h: Removed.
* ForwardingHeaders/heap/WeakInlines.h: Removed.
* ForwardingHeaders/inspector/ConsoleMessage.h: Removed.
* ForwardingHeaders/inspector/ContentSearchUtilities.h: Removed.
* ForwardingHeaders/inspector/IdentifiersFactory.h: Removed.
* ForwardingHeaders/inspector/InjectedScript.h: Removed.
* ForwardingHeaders/inspector/InjectedScriptBase.h: Removed.
* ForwardingHeaders/inspector/InjectedScriptHost.h: Removed.
* ForwardingHeaders/inspector/InjectedScriptManager.h: Removed.
* ForwardingHeaders/inspector/InjectedScriptModule.h: Removed.
* ForwardingHeaders/inspector/InspectorAgentBase.h: Removed.
* ForwardingHeaders/inspector/InspectorAgentRegistry.h: Removed.
* ForwardingHeaders/inspector/InspectorBackendDispatcher.h: Removed.
* ForwardingHeaders/inspector/InspectorBackendDispatchers.h: Removed.
* ForwardingHeaders/inspector/InspectorEnvironment.h: Removed.
* ForwardingHeaders/inspector/InspectorFrontendChannel.h: Removed.
* ForwardingHeaders/inspector/InspectorFrontendDispatchers.h: Removed.
* ForwardingHeaders/inspector/InspectorFrontendRouter.h: Removed.
* ForwardingHeaders/inspector/InspectorProtocolObjects.h: Removed.
* ForwardingHeaders/inspector/InspectorProtocolTypes.h: Removed.
* ForwardingHeaders/inspector/PerGlobalObjectWrapperWorld.h: Removed.
* ForwardingHeaders/inspector/ScriptArguments.h: Removed.
* ForwardingHeaders/inspector/ScriptBreakpoint.h: Removed.
* ForwardingHeaders/inspector/ScriptCallFrame.h: Removed.
* ForwardingHeaders/inspector/ScriptCallStack.h: Removed.
* ForwardingHeaders/inspector/ScriptCallStackFactory.h: Removed.
* ForwardingHeaders/inspector/ScriptDebugListener.h: Removed.
* ForwardingHeaders/inspector/ScriptDebugServer.h: Removed.
* ForwardingHeaders/inspector/agents/InspectorAgent.h: Removed.
* ForwardingHeaders/inspector/agents/InspectorConsoleAgent.h: Removed.
* ForwardingHeaders/inspector/agents/InspectorDebuggerAgent.h: Removed.
* ForwardingHeaders/inspector/agents/InspectorHeapAgent.h: Removed.
* ForwardingHeaders/inspector/agents/InspectorRuntimeAgent.h: Removed.
* ForwardingHeaders/inspector/agents/InspectorScriptProfilerAgent.h: Removed.
* ForwardingHeaders/interpreter/CallFrame.h: Removed.
* ForwardingHeaders/interpreter/FrameTracers.h: Removed.
* ForwardingHeaders/interpreter/ShadowChicken.h: Removed.
* ForwardingHeaders/interpreter/StackVisitor.h: Removed.
* ForwardingHeaders/jit/JITCode.h: Removed.
* ForwardingHeaders/jit/JITMathICForwards.h: Removed.
* ForwardingHeaders/jit/Snippet.h: Removed.
* ForwardingHeaders/jit/SnippetParams.h: Removed.
* ForwardingHeaders/jit/SpillRegistersMode.h: Removed.
* ForwardingHeaders/masm/X86Assembler.h: Removed.
* ForwardingHeaders/parser/ParserError.h: Removed.
* ForwardingHeaders/parser/SourceCode.h: Removed.
* ForwardingHeaders/parser/SourceProvider.h: Removed.
* ForwardingHeaders/parser/SourceProviderCache.h: Removed.
* ForwardingHeaders/profiler/ProfilerDatabase.h: Removed.
* ForwardingHeaders/runtime/ArgList.h: Removed.
* ForwardingHeaders/runtime/ArrayBuffer.h: Removed.
* ForwardingHeaders/runtime/ArrayBufferView.h: Removed.
* ForwardingHeaders/runtime/ArrayPrototype.h: Removed.
* ForwardingHeaders/runtime/AuxiliaryBarrierInlines.h: Removed.
* ForwardingHeaders/runtime/BooleanObject.h: Removed.
* ForwardingHeaders/runtime/CallData.h: Removed.
* ForwardingHeaders/runtime/CatchScope.h: Removed.
* ForwardingHeaders/runtime/CommonIdentifiers.h: Removed.
* ForwardingHeaders/runtime/Completion.h: Removed.
* ForwardingHeaders/runtime/ConfigFile.h: Removed.
* ForwardingHeaders/runtime/ConsoleClient.h: Removed.
* ForwardingHeaders/runtime/ConsoleTypes.h: Removed.
* ForwardingHeaders/runtime/ConstructAbility.h: Removed.
* ForwardingHeaders/runtime/ConstructData.h: Removed.
* ForwardingHeaders/runtime/DataView.h: Removed.
* ForwardingHeaders/runtime/DateInstance.h: Removed.
* ForwardingHeaders/runtime/Error.h: Removed.
* ForwardingHeaders/runtime/ErrorHandlingScope.h: Removed.
* ForwardingHeaders/runtime/ErrorInstance.h: Removed.
* ForwardingHeaders/runtime/ErrorPrototype.h: Removed.
* ForwardingHeaders/runtime/Exception.h: Removed.
* ForwardingHeaders/runtime/ExceptionHelpers.h: Removed.
* ForwardingHeaders/runtime/Float32Array.h: Removed.
* ForwardingHeaders/runtime/Float64Array.h: Removed.
* ForwardingHeaders/runtime/FunctionConstructor.h: Removed.
* ForwardingHeaders/runtime/FunctionExecutable.h: Removed.
* ForwardingHeaders/runtime/FunctionPrototype.h: Removed.
* ForwardingHeaders/runtime/HashMapImpl.h: Removed.
* ForwardingHeaders/runtime/Identifier.h: Removed.
* ForwardingHeaders/runtime/IdentifierInlines.h: Removed.
* ForwardingHeaders/runtime/InitializeThreading.h: Removed.
* ForwardingHeaders/runtime/Int16Array.h: Removed.
* ForwardingHeaders/runtime/Int32Array.h: Removed.
* ForwardingHeaders/runtime/Int8Array.h: Removed.
* ForwardingHeaders/runtime/InternalFunction.h: Removed.
* ForwardingHeaders/runtime/Intrinsic.h: Removed.
* ForwardingHeaders/runtime/IterationKind.h: Removed.
* ForwardingHeaders/runtime/IteratorOperations.h: Removed.
* ForwardingHeaders/runtime/IteratorPrototype.h: Removed.
* ForwardingHeaders/runtime/JSAPIValueWrapper.h: Removed.
* ForwardingHeaders/runtime/JSArray.h: Removed.
* ForwardingHeaders/runtime/JSArrayBuffer.h: Removed.
* ForwardingHeaders/runtime/JSArrayBufferView.h: Removed.
* ForwardingHeaders/runtime/JSCInlines.h: Removed.
* ForwardingHeaders/runtime/JSCJSValue.h: Removed.
* ForwardingHeaders/runtime/JSCJSValueInlines.h: Removed.
* ForwardingHeaders/runtime/JSCallee.h: Removed.
* ForwardingHeaders/runtime/JSCell.h: Removed.
* ForwardingHeaders/runtime/JSCellInlines.h: Removed.
* ForwardingHeaders/runtime/JSDataView.h: Removed.
* ForwardingHeaders/runtime/JSDestructibleObject.h: Removed.
* ForwardingHeaders/runtime/JSDestructibleObjectHeapCellType.h: Removed.
* ForwardingHeaders/runtime/JSExportMacros.h: Removed.
* ForwardingHeaders/runtime/JSFunction.h: Removed.
* ForwardingHeaders/runtime/JSGlobalObject.h: Removed.
* ForwardingHeaders/runtime/JSGlobalObjectInlines.h: Removed.
* ForwardingHeaders/runtime/JSInternalPromise.h: Removed.
* ForwardingHeaders/runtime/JSInternalPromiseDeferred.h: Removed.
* ForwardingHeaders/runtime/JSLock.h: Removed.
* ForwardingHeaders/runtime/JSMap.h: Removed.
* ForwardingHeaders/runtime/JSMapIterator.h: Removed.
* ForwardingHeaders/runtime/JSModuleLoader.h: Removed.
* ForwardingHeaders/runtime/JSModuleRecord.h: Removed.
* ForwardingHeaders/runtime/JSNativeStdFunction.h: Removed.
* ForwardingHeaders/runtime/JSONObject.h: Removed.
* ForwardingHeaders/runtime/JSObject.h: Removed.
* ForwardingHeaders/runtime/JSObjectInlines.h: Removed.
* ForwardingHeaders/runtime/JSPromise.h: Removed.
* ForwardingHeaders/runtime/JSPromiseConstructor.h: Removed.
* ForwardingHeaders/runtime/JSPromiseDeferred.h: Removed.
* ForwardingHeaders/runtime/JSProxy.h: Removed.
* ForwardingHeaders/runtime/JSRunLoopTimer.h: Removed.
* ForwardingHeaders/runtime/JSScriptFetchParameters.h: Removed.
* ForwardingHeaders/runtime/JSScriptFetcher.h: Removed.
* ForwardingHeaders/runtime/JSSegmentedVariableObjectHeapCellType.h: Removed.
* ForwardingHeaders/runtime/JSSet.h: Removed.
* ForwardingHeaders/runtime/JSSetIterator.h: Removed.
* ForwardingHeaders/runtime/JSSourceCode.h: Removed.
* ForwardingHeaders/runtime/JSString.h: Removed.
* ForwardingHeaders/runtime/JSTypedArrays.h: Removed.
* ForwardingHeaders/runtime/JSWithScope.h: Removed.
* ForwardingHeaders/runtime/Lookup.h: Removed.
* ForwardingHeaders/runtime/MapBase.h: Removed.
* ForwardingHeaders/runtime/MapData.h: Removed.
* ForwardingHeaders/runtime/MapDataInlines.h: Removed.
* ForwardingHeaders/runtime/MatchResult.h: Removed.
* ForwardingHeaders/runtime/Microtask.h: Removed.
* ForwardingHeaders/runtime/ObjectConstructor.h: Removed.
* ForwardingHeaders/runtime/ObjectPrototype.h: Removed.
* ForwardingHeaders/runtime/Operations.h: Removed.
* ForwardingHeaders/runtime/PrivateName.h: Removed.
* ForwardingHeaders/runtime/PromiseDeferredTimer.h: Removed.
* ForwardingHeaders/runtime/PropertyNameArray.h: Removed.
* ForwardingHeaders/runtime/Protect.h: Removed.
* ForwardingHeaders/runtime/RegExp.h: Removed.
* ForwardingHeaders/runtime/RegExpObject.h: Removed.
* ForwardingHeaders/runtime/RuntimeFlags.h: Removed.
* ForwardingHeaders/runtime/SamplingProfiler.h: Removed.
* ForwardingHeaders/runtime/ScriptFetchParameters.h: Removed.
* ForwardingHeaders/runtime/ScriptFetcher.h: Removed.
* ForwardingHeaders/runtime/StringObject.h: Removed.
* ForwardingHeaders/runtime/StringPrototype.h: Removed.
* ForwardingHeaders/runtime/Structure.h: Removed.
* ForwardingHeaders/runtime/StructureChain.h: Removed.
* ForwardingHeaders/runtime/StructureInlines.h: Removed.
* ForwardingHeaders/runtime/Symbol.h: Removed.
* ForwardingHeaders/runtime/SymbolTable.h: Removed.
* ForwardingHeaders/runtime/ThrowScope.h: Removed.
* ForwardingHeaders/runtime/TypedArrayController.h: Removed.
* ForwardingHeaders/runtime/TypedArrayInlines.h: Removed.
* ForwardingHeaders/runtime/TypedArrays.h: Removed.
* ForwardingHeaders/runtime/Uint16Array.h: Removed.
* ForwardingHeaders/runtime/Uint32Array.h: Removed.
* ForwardingHeaders/runtime/Uint8Array.h: Removed.
* ForwardingHeaders/runtime/Uint8ClampedArray.h: Removed.
* ForwardingHeaders/runtime/VM.h: Removed.
* ForwardingHeaders/runtime/VMEntryScope.h: Removed.
* ForwardingHeaders/runtime/Watchdog.h: Removed.
* ForwardingHeaders/runtime/WeakGCMap.h: Removed.
* ForwardingHeaders/runtime/WeakGCMapInlines.h: Removed.
* ForwardingHeaders/runtime/WriteBarrier.h: Removed.
* ForwardingHeaders/wasm/WasmModule.h: Removed.
* ForwardingHeaders/wasm/js/JSWebAssemblyModule.h: Removed.
* ForwardingHeaders/yarr/RegularExpression.h: Removed.
* ForwardingHeaders/yarr/Yarr.h: Removed.
* ForwardingHeaders/yarr/YarrInterpreter.h: Removed.
* ForwardingHeaders/yarr/YarrJIT.h: Removed.
* ForwardingHeaders/yarr/YarrPattern.h: Removed.
* Modules/applepay/cocoa/PaymentMerchantSessionCocoa.mm:
* Modules/encryptedmedia/MediaKeyMessageEvent.h:
* Modules/encryptedmedia/MediaKeyMessageEventInit.h:
* Modules/encryptedmedia/MediaKeyStatusMap.h:
* Modules/encryptedmedia/legacy/LegacyCDM.h:
* Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.cpp:
* Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.cpp:
* Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.cpp:
* Modules/encryptedmedia/legacy/WebKitMediaKeySession.h:
* Modules/encryptedmedia/legacy/WebKitMediaKeys.h:
* Modules/fetch/FetchBody.cpp:
* Modules/fetch/FetchRequestInit.h:
* Modules/fetch/FetchResponse.h:
* Modules/indexeddb/IDBCursor.cpp:
* Modules/indexeddb/IDBCursor.h:
* Modules/indexeddb/IDBCursorWithValue.cpp:
* Modules/indexeddb/IDBDatabase.cpp:
* Modules/indexeddb/IDBIndex.cpp:
* Modules/indexeddb/IDBKey.cpp:
* Modules/indexeddb/IDBKeyRange.cpp:
* Modules/indexeddb/IDBObjectStore.cpp:
* Modules/indexeddb/IDBRequest.cpp:
* Modules/indexeddb/IDBRequest.h:
* Modules/indexeddb/client/TransactionOperation.cpp:
* Modules/indexeddb/server/MemoryObjectStore.cpp:
* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
* Modules/mediacontrols/MediaControlsHost.cpp:
* Modules/mediasource/SourceBuffer.cpp:
* Modules/mediastream/RTCDataChannel.cpp:
* Modules/plugins/QuickTimePluginReplacement.mm:
* Modules/webaudio/AsyncAudioDecoder.cpp:
* Modules/webaudio/AudioBuffer.cpp:
* Modules/webaudio/AudioBuffer.h:
* Modules/webaudio/AudioContext.cpp:
* Modules/webaudio/AudioContext.h:
* Modules/webaudio/AudioParam.h:
* Modules/webaudio/AudioParamTimeline.h:
* Modules/webaudio/PeriodicWave.h:
* Modules/webaudio/RealtimeAnalyser.cpp:
* Modules/webaudio/RealtimeAnalyser.h:
* Modules/webaudio/ScriptProcessorNode.cpp:
* Modules/webaudio/WaveShaperProcessor.h:
* Modules/webauthn/AuthenticatorResponse.h:
* Modules/webauthn/PublicKeyCredential.h:
* Modules/websockets/WebSocket.cpp:
* Modules/websockets/WebSocketChannel.cpp:
* Modules/websockets/WorkerThreadableWebSocketChannel.cpp:
* Modules/webvr/VREyeParameters.h:
* Modules/webvr/VRFrameData.h:
* Modules/webvr/VRPose.h:
* Modules/webvr/VRStageParameters.h:
* PlatformWin.cmake:
* bindings/IDLTypes.h:
* bindings/js/BufferSource.h:
* bindings/js/CachedScriptFetcher.h:
* bindings/js/CachedScriptSourceProvider.h:
* bindings/js/CallTracerTypes.h:
* bindings/js/CommonVM.cpp:
* bindings/js/DOMGCOutputConstraint.cpp:
* bindings/js/DOMGCOutputConstraint.h:
* bindings/js/GCController.cpp:
* bindings/js/GCController.h:
* bindings/js/IDBBindingUtilities.cpp:
* bindings/js/JSCallbackData.cpp:
* bindings/js/JSCallbackData.h:
* bindings/js/JSCustomElementInterface.cpp:
* bindings/js/JSCustomElementInterface.h:
* bindings/js/JSCustomEventCustom.cpp:
* bindings/js/JSCustomXPathNSResolver.cpp:
* bindings/js/JSCustomXPathNSResolver.h:
* bindings/js/JSDOMBinding.h:
* bindings/js/JSDOMBuiltinConstructorBase.cpp:
* bindings/js/JSDOMConstructorBase.cpp:
* bindings/js/JSDOMConvertBase.h:
* bindings/js/JSDOMConvertBufferSource.h:
* bindings/js/JSDOMConvertDate.cpp:
* bindings/js/JSDOMConvertInterface.h:
* bindings/js/JSDOMConvertJSON.h:
* bindings/js/JSDOMConvertNumbers.cpp:
* bindings/js/JSDOMConvertNumbers.h:
* bindings/js/JSDOMConvertObject.h:
* bindings/js/JSDOMConvertRecord.h:
* bindings/js/JSDOMConvertSequences.h:
* bindings/js/JSDOMConvertStrings.cpp:
* bindings/js/JSDOMConvertUnion.h:
* bindings/js/JSDOMExceptionHandling.cpp:
* bindings/js/JSDOMExceptionHandling.h:
* bindings/js/JSDOMGlobalObject.cpp:
* bindings/js/JSDOMGlobalObject.h:
* bindings/js/JSDOMGlobalObjectTask.cpp:
* bindings/js/JSDOMGuardedObject.h:
* bindings/js/JSDOMIterator.cpp:
* bindings/js/JSDOMIterator.h:
* bindings/js/JSDOMMapLike.cpp:
* bindings/js/JSDOMMapLike.h:
* bindings/js/JSDOMPromise.cpp:
* bindings/js/JSDOMPromise.h:
* bindings/js/JSDOMPromiseDeferred.cpp:
* bindings/js/JSDOMPromiseDeferred.h:
* bindings/js/JSDOMWindowBase.cpp:
* bindings/js/JSDOMWindowCustom.cpp:
* bindings/js/JSDOMWindowProxy.cpp:
* bindings/js/JSDOMWindowProxy.h:
* bindings/js/JSDOMWrapper.cpp:
* bindings/js/JSDOMWrapper.h:
* bindings/js/JSDOMWrapperCache.cpp:
* bindings/js/JSDOMWrapperCache.h:
* bindings/js/JSDynamicDowncast.h:
* bindings/js/JSErrorHandler.cpp:
* bindings/js/JSEventCustom.cpp:
* bindings/js/JSEventListener.cpp:
* bindings/js/JSEventListener.h:
* bindings/js/JSHTMLElementCustom.cpp:
* bindings/js/JSHistoryCustom.cpp:
* bindings/js/JSIDBCursorWithValueCustom.cpp:
* bindings/js/JSIDBIndexCustom.cpp:
* bindings/js/JSImageDataCustom.cpp:
* bindings/js/JSLazyEventListener.cpp:
* bindings/js/JSLocationCustom.cpp:
* bindings/js/JSMainThreadExecState.h:
* bindings/js/JSMainThreadExecStateInstrumentation.h:
* bindings/js/JSMessageChannelCustom.cpp:
* bindings/js/JSMessageEventCustom.cpp:
* bindings/js/JSNodeIteratorCustom.cpp:
* bindings/js/JSPopStateEventCustom.cpp:
* bindings/js/JSReadableStreamPrivateConstructors.cpp:
* bindings/js/JSTreeWalkerCustom.cpp:
* bindings/js/JSWebGL2RenderingContextCustom.cpp:
* bindings/js/JSWorkerGlobalScopeBase.cpp:
* bindings/js/ReadableStreamDefaultController.cpp:
* bindings/js/ReadableStreamDefaultController.h:
* bindings/js/ScheduledAction.cpp:
* bindings/js/ScheduledAction.h:
* bindings/js/ScriptCachedFrameData.cpp:
* bindings/js/ScriptCachedFrameData.h:
* bindings/js/ScriptController.cpp:
* bindings/js/ScriptController.h:
* bindings/js/ScriptControllerMac.mm:
* bindings/js/ScriptModuleLoader.cpp:
* bindings/js/ScriptModuleLoader.h:
* bindings/js/ScriptSourceCode.h:
* bindings/js/ScriptState.cpp:
* bindings/js/ScriptWrappable.h:
* bindings/js/ScriptWrappableInlines.h:
* bindings/js/SerializedScriptValue.cpp:
* bindings/js/SerializedScriptValue.h:
* bindings/js/StructuredClone.cpp:
* bindings/js/WebCoreBuiltinNames.h:
* bindings/js/WebCoreJSClientData.cpp:
* bindings/js/WebCoreTypedArrayController.cpp:
* bindings/js/WebCoreTypedArrayController.h:
* bindings/js/WorkerScriptController.cpp:
* bindings/js/WorkerScriptController.h:
* bridge/NP_jsobject.cpp:
* bridge/c/CRuntimeObject.cpp:
* bridge/c/c_class.cpp:
* bridge/c/c_instance.cpp:
* bridge/c/c_runtime.cpp:
* bridge/c/c_utility.cpp:
* bridge/c/c_utility.h:
* bridge/jsc/BridgeJSC.cpp:
* bridge/jsc/BridgeJSC.h:
* bridge/npruntime.cpp:
* bridge/objc/ObjCRuntimeObject.mm:
* bridge/objc/WebScriptObject.mm:
* bridge/objc/WebScriptObjectPrivate.h:
* bridge/objc/objc_instance.mm:
* bridge/objc/objc_runtime.h:
* bridge/objc/objc_runtime.mm:
* bridge/objc/objc_utility.h:
* bridge/objc/objc_utility.mm:
* bridge/runtime_array.cpp:
* bridge/runtime_array.h:
* bridge/runtime_method.cpp:
* bridge/runtime_method.h:
* bridge/runtime_object.cpp:
* bridge/runtime_object.h:
* bridge/runtime_root.cpp:
* bridge/runtime_root.h:
* crypto/SubtleCrypto.cpp:
* crypto/SubtleCrypto.h:
* crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:
* crypto/keys/CryptoRsaKeyAlgorithm.h:
* crypto/mac/CryptoKeyRSAMac.cpp:
* crypto/parameters/CryptoAlgorithmEcdsaParams.h:
* crypto/parameters/CryptoAlgorithmHkdfParams.h:
* crypto/parameters/CryptoAlgorithmHmacKeyParams.h:
* crypto/parameters/CryptoAlgorithmPbkdf2Params.h:
* crypto/parameters/CryptoAlgorithmRsaHashedImportParams.h:
* crypto/parameters/CryptoAlgorithmRsaHashedKeyGenParams.h:
* crypto/parameters/CryptoAlgorithmRsaKeyGenParams.h:
* css/CSSFontFaceSource.h:
* css/DOMMatrixReadOnly.cpp:
* css/DOMMatrixReadOnly.h:
* css/FontFace.cpp:
* dom/CustomElementReactionQueue.cpp:
* dom/CustomElementRegistry.cpp:
* dom/CustomEvent.cpp:
* dom/CustomEvent.h:
* dom/Document.cpp:
* dom/Document.h:
* dom/ErrorEvent.cpp:
* dom/ErrorEvent.h:
* dom/LoadableScript.h:
* dom/MessageEvent.cpp:
* dom/MessageEvent.h:
* dom/ModuleFetchParameters.h:
* dom/PopStateEvent.cpp:
* dom/PopStateEvent.h:
* dom/PromiseRejectionEvent.cpp:
* dom/PromiseRejectionEvent.h:
* dom/RejectedPromiseTracker.cpp:
* dom/RejectedPromiseTracker.h:
* dom/ScriptExecutionContext.cpp:
* dom/ScriptExecutionContext.h:
* dom/TextEncoder.cpp:
* dom/TextEncoder.h:
* domjit/DOMJITHelpers.h:
* domjit/DOMJITIDLTypeFilter.h:
* domjit/JSDocumentDOMJIT.cpp:
* domjit/JSNodeDOMJIT.cpp:
* fileapi/BlobBuilder.cpp:
* fileapi/FileReader.cpp:
* fileapi/FileReaderLoader.cpp:
* fileapi/FileReaderSync.cpp:
* html/BaseTextInputType.cpp:
* html/EmailInputType.cpp:
* html/HTMLAllCollection.cpp:
* html/HTMLCanvasElement.cpp:
* html/HTMLImageLoader.cpp:
* html/HTMLMediaElement.cpp:
* html/HTMLPlugInImageElement.cpp:
* html/ImageData.cpp:
* html/ImageData.h:
* html/MediaEncryptedEventInit.h:
* html/WebKitMediaKeyError.h:
* html/canvas/WebGLAny.h:
* html/canvas/WebGLRenderingContext.cpp:
* html/canvas/WebGLRenderingContextBase.cpp:
* html/canvas/WebGLRenderingContextBase.h:
* html/canvas/WebGPUBuffer.cpp:
* html/canvas/WebGPURenderingContext.cpp:
* html/canvas/WebGPURenderingContext.h:
* html/track/DataCue.cpp:
* html/track/DataCue.h:
* inspector/CommandLineAPIHost.cpp:
* inspector/CommandLineAPIHost.h:
* inspector/CommandLineAPIModule.cpp:
* inspector/CommandLineAPIModule.h:
* inspector/InspectorCanvas.cpp:
* inspector/InspectorCanvas.h:
* inspector/InspectorClient.cpp:
* inspector/InspectorController.cpp:
* inspector/InspectorController.h:
* inspector/InspectorDatabaseResource.h:
* inspector/InspectorFrontendClientLocal.cpp:
* inspector/InspectorFrontendHost.cpp:
* inspector/InspectorInstrumentation.cpp:
* inspector/InspectorInstrumentation.h:
* inspector/InspectorOverlay.cpp:
* inspector/InspectorOverlay.h:
* inspector/InspectorShaderProgram.cpp:
* inspector/InspectorShaderProgram.h:
* inspector/InspectorStyleSheet.cpp:
* inspector/InspectorStyleSheet.h:
* inspector/InspectorWebAgentBase.h:
* inspector/InstrumentingAgents.h:
* inspector/PageScriptDebugServer.cpp:
* inspector/PageScriptDebugServer.h:
* inspector/TimelineRecordFactory.cpp:
* inspector/WebInjectedScriptHost.h:
* inspector/WebInjectedScriptManager.h:
* inspector/WorkerInspectorController.cpp:
* inspector/WorkerInspectorController.h:
* inspector/WorkerScriptDebugServer.cpp:
* inspector/WorkerScriptDebugServer.h:
* inspector/WorkerToPageFrontendChannel.h:
* inspector/agents/InspectorApplicationCacheAgent.h:
* inspector/agents/InspectorCSSAgent.cpp:
* inspector/agents/InspectorCSSAgent.h:
* inspector/agents/InspectorCanvasAgent.cpp:
* inspector/agents/InspectorCanvasAgent.h:
* inspector/agents/InspectorDOMAgent.cpp:
* inspector/agents/InspectorDOMAgent.h:
* inspector/agents/InspectorDOMDebuggerAgent.cpp:
* inspector/agents/InspectorDOMDebuggerAgent.h:
* inspector/agents/InspectorDOMStorageAgent.cpp:
* inspector/agents/InspectorDOMStorageAgent.h:
* inspector/agents/InspectorDatabaseAgent.cpp:
* inspector/agents/InspectorDatabaseAgent.h:
* inspector/agents/InspectorIndexedDBAgent.cpp:
* inspector/agents/InspectorIndexedDBAgent.h:
* inspector/agents/InspectorLayerTreeAgent.cpp:
* inspector/agents/InspectorLayerTreeAgent.h:
* inspector/agents/InspectorMemoryAgent.cpp:
* inspector/agents/InspectorMemoryAgent.h:
* inspector/agents/InspectorNetworkAgent.cpp:
* inspector/agents/InspectorNetworkAgent.h:
* inspector/agents/InspectorPageAgent.cpp:
* inspector/agents/InspectorPageAgent.h:
* inspector/agents/InspectorTimelineAgent.cpp:
* inspector/agents/InspectorTimelineAgent.h:
* inspector/agents/InspectorWorkerAgent.h:
* inspector/agents/WebConsoleAgent.cpp:
* inspector/agents/WebConsoleAgent.h:
* inspector/agents/WebDebuggerAgent.h:
* inspector/agents/WebHeapAgent.h:
* inspector/agents/page/PageDebuggerAgent.cpp:
* inspector/agents/page/PageRuntimeAgent.cpp:
* inspector/agents/page/PageRuntimeAgent.h:
* inspector/agents/worker/ServiceWorkerAgent.h:
* inspector/agents/worker/WorkerDebuggerAgent.cpp:
* inspector/agents/worker/WorkerRuntimeAgent.cpp:
* inspector/agents/worker/WorkerRuntimeAgent.h:
* loader/EmptyClients.cpp:
* page/CaptionUserPreferences.cpp:
* page/Chrome.cpp:
* page/ChromeClient.h:
* page/Crypto.cpp:
* page/DOMWindow.cpp:
* page/DOMWindow.h:
* page/Frame.cpp:
* page/OriginThreadLocalCache.h:
* page/PageConsoleClient.cpp:
* page/PageConsoleClient.h:
* page/PageDebuggable.cpp:
* page/PageGroup.cpp:
* page/SettingsBase.h:
* page/UserContentController.cpp:
* page/cocoa/ResourceUsageThreadCocoa.mm:
* page/csp/ContentSecurityPolicy.cpp:
* page/ios/FrameIOS.mm:
* page/linux/ResourceUsageOverlayLinux.cpp:
* page/linux/ResourceUsageThreadLinux.cpp:
* platform/MediaSample.h:
* platform/SerializedPlatformRepresentation.h:
* platform/SharedBuffer.h:
* platform/audio/mac/CARingBuffer.h:
* platform/cocoa/SharedBufferCocoa.mm:
* platform/graphics/ImageBuffer.h:
* platform/graphics/LegacyCDMSession.h:
* platform/graphics/MediaPlayer.h:
* platform/graphics/avfoundation/CDMFairPlayStreaming.cpp:
* platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm:
* platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
* platform/graphics/avfoundation/MediaSampleAVFObjC.h:
* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
* platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
* platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
* platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
* platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
* platform/graphics/cairo/ImageBufferCairo.cpp:
* platform/graphics/cg/ImageBufferDataCG.cpp:
* platform/graphics/cg/ImageBufferDataCG.h:
* platform/graphics/cocoa/GPUDeviceMetal.mm:
* platform/graphics/filters/FEBlend.cpp:
* platform/graphics/filters/FEColorMatrix.cpp:
* platform/graphics/filters/FEComponentTransfer.cpp:
* platform/graphics/filters/FEComposite.cpp:
* platform/graphics/filters/FEConvolveMatrix.cpp:
* platform/graphics/filters/FEDisplacementMap.cpp:
* platform/graphics/filters/FEDropShadow.cpp:
* platform/graphics/filters/FEGaussianBlur.cpp:
* platform/graphics/filters/FELighting.h:
* platform/graphics/filters/FEMorphology.cpp:
* platform/graphics/filters/FETurbulence.cpp:
* platform/graphics/filters/FilterEffect.cpp:
* platform/graphics/filters/FilterEffect.h:
* platform/graphics/gpu/GPUBuffer.h:
* platform/graphics/gpu/GPUDevice.h:
* platform/graphics/iso/ISOBox.cpp:
* platform/graphics/iso/ISOOriginalFormatBox.cpp:
* platform/graphics/iso/ISOProtectionSchemeInfoBox.cpp:
* platform/graphics/iso/ISOSchemeInformationBox.cpp:
* platform/graphics/iso/ISOSchemeTypeBox.cpp:
* platform/graphics/iso/ISOTrackEncryptionBox.cpp:
* platform/graphics/iso/ISOVTTCue.cpp:
* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
* platform/graphics/win/ImageBufferDataDirect2D.cpp:
* platform/graphics/win/ImageBufferDataDirect2D.h:
* platform/ios/wak/WebCoreThread.mm:
* platform/mac/SerializedPlatformRepresentationMac.mm:
* platform/mac/StringUtilities.mm:
* platform/mock/mediasource/MockBox.cpp:
* platform/mock/mediasource/MockSourceBufferPrivate.cpp:
* svg/graphics/SVGImage.cpp:
* testing/GCObservation.cpp:
* testing/GCObservation.h:
* testing/Internals.cpp:
* testing/Internals.h:
* testing/LegacyMockCDM.cpp:
* testing/MockCDMFactory.cpp:
* testing/js/WebCoreTestSupport.cpp:
* workers/Worker.cpp:
* workers/Worker.h:
* workers/WorkerConsoleClient.cpp:
* workers/WorkerConsoleClient.h:
* workers/WorkerGlobalScope.cpp:
* workers/WorkerGlobalScope.h:
* workers/WorkerGlobalScopeProxy.h:
* workers/WorkerInspectorProxy.cpp:
* workers/WorkerMessagingProxy.cpp:
* workers/WorkerThread.h:
* workers/service/ExtendableEvent.cpp:
* workers/service/ServiceWorker.cpp:
* workers/service/ServiceWorker.h:
* workers/service/ServiceWorkerClient.h:
* workers/service/context/ServiceWorkerInspectorProxy.cpp:
* workers/service/context/ServiceWorkerThread.cpp:
* xml/XMLHttpRequest.cpp:

Source/WebKit:

* Platform/mac/StringUtilities.mm:
* Shared/Cocoa/WebKit2InitializeCocoa.mm:
* Shared/WebKit2Initialize.cpp:
* Shared/linux/WebMemorySamplerLinux.cpp:
* Shared/mac/WebMemorySampler.mac.mm:
* UIProcess/WebProcessPool.cpp:
* WebProcess/InjectedBundle/API/APIInjectedBundlePageUIClient.h:
* WebProcess/InjectedBundle/API/glib/WebKitConsoleMessagePrivate.h:
* WebProcess/Plugins/Netscape/NPRuntimeObjectMap.h:
* WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
* WebProcess/Plugins/PluginProcessConnection.cpp:
* WebProcess/Plugins/PluginView.cpp:
* WebProcess/WebPage/WebInspector.h:
* WebProcess/WebPage/WebPage.cpp:
* WebProcess/cocoa/WebProcessCocoa.mm:

Source/WebKitLegacy/ios:

* Misc/WebUIKitSupport.mm:

Source/WebKitLegacy/mac:

* Carbon/CarbonWindowAdapter.mm:
* DOM/WebDOMOperations.mm:
* History/WebBackForwardList.mm:
* History/WebHistoryItem.mm:
* Misc/WebCache.mm:
* Misc/WebElementDictionary.mm:
* Misc/WebIconDatabase.mm:
* Misc/WebStringTruncator.mm:
* Plugins/Hosted/NetscapePluginInstanceProxy.mm:
* Plugins/Hosted/ProxyInstance.mm:
* Plugins/Hosted/ProxyRuntimeObject.mm:
* Plugins/Hosted/WebHostedNetscapePluginView.mm:
* Plugins/WebBaseNetscapePluginView.mm:
* Plugins/WebBasePluginPackage.mm:
* Plugins/WebNetscapePluginStream.mm:
* Plugins/WebNetscapePluginView.mm:
* Plugins/WebPluginController.mm:
* WebCoreSupport/WebEditorClient.mm:
* WebCoreSupport/WebFrameLoaderClient.mm:
* WebCoreSupport/WebInspectorClient.h:
* WebCoreSupport/WebInspectorClient.mm:
* WebView/WebDataSource.mm:
* WebView/WebFrame.mm:
* WebView/WebHTMLRepresentation.mm:
* WebView/WebHTMLView.mm:
* WebView/WebPreferences.mm:
* WebView/WebScriptDebugDelegate.mm:
* WebView/WebScriptDebugger.h:
* WebView/WebTextIterator.mm:
* WebView/WebView.mm:
* WebView/WebViewData.mm:

Source/WebKitLegacy/win:

* Plugins/PluginView.cpp:
* Plugins/PluginViewWin.cpp:
* WebCoreSupport/WebInspectorClient.cpp:
* WebCoreSupport/WebInspectorClient.h:
* WebFrame.cpp:
* WebJavaScriptCollector.cpp:
* WebView.cpp:

Tools:

* WebKitTestRunner/TestController.cpp:

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

19 months agowebkit-patch upload should ask for confirmation before creating a new bug
ross.kirsling@sony.com [Wed, 7 Feb 2018 03:45:59 +0000 (03:45 +0000)]
webkit-patch upload should ask for confirmation before creating a new bug
https://bugs.webkit.org/show_bug.cgi?id=182551

Reviewed by Daniel Bates.

It is quite easy to paste unintended text into the bug number prompt. This creates a junk bug with an uneditable
first comment, which could result in embarrassment or potentially even a proprietary information leak.

* Scripts/webkitpy/tool/commands/upload_unittest.py:
(test_prepare):
* Scripts/webkitpy/tool/steps/promptforbugortitle.py:
(PromptForBugOrTitle):
(PromptForBugOrTitle.options):
(PromptForBugOrTitle.run):

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

19 months agoWeb Inspector: Replace isAncestor and isDescendant with native DOM contains method
webkit@devinrousso.com [Wed, 7 Feb 2018 03:27:00 +0000 (03:27 +0000)]
Web Inspector: Replace isAncestor and isDescendant with native DOM contains method
https://bugs.webkit.org/show_bug.cgi?id=182069

Reviewed by Brian Burg.

* UserInterface/Base/Main.js:
(WI.restoreFocusFromElement):
(WI._mouseDown):
(WI._focusedContentBrowser):
(WI._focusedContentView):
* UserInterface/Base/Utilities.js:
(Node.prototype.traverseNextNode):
(Node.prototype.isAncestor): Deleted.
(Node.prototype.isDescendant): Deleted.
(Node.prototype.isSelfOrAncestor): Deleted.
(Node.prototype.isSelfOrDescendant): Deleted.
* UserInterface/Views/BoxModelDetailsSectionRow.js:
(WI.BoxModelDetailsSectionRow.prototype._handleKeyDown):
* UserInterface/Views/CSSStyleDeclarationSection.js:
(WI.CSSStyleDeclarationSection.prototype._handleSelectorPaste):
* UserInterface/Views/DOMTreeOutline.js:
(WI.DOMTreeOutline.prototype._onmouseout):
* UserInterface/Views/DetailsSection.js:
(WI.DetailsSection.prototype._headerElementClicked):
* UserInterface/Views/EditingSupport.js:
(WI.incrementElementValue):
* UserInterface/Views/LogContentView.js:
(WI.LogContentView.prototype._handleContextMenuEvent):
* UserInterface/Views/ShaderProgramTreeElement.js:
(WI.ShaderProgramTreeElement.prototype.selectOnMouseDown):
* UserInterface/Views/SoftContextMenu.js:
(WI.SoftContextMenu.prototype._menuItemMouseOut):
* UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js:
(WI.SpreadsheetCSSStyleDeclarationEditor.prototype.initialLayout):
* UserInterface/Views/TabBar.js:
(WI.TabBar.prototype.insertTabBarItem):

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

19 months agoWeb Inspector: Elements tab should have "Jump to Layer" functionality
webkit@devinrousso.com [Wed, 7 Feb 2018 03:20:01 +0000 (03:20 +0000)]
Web Inspector: Elements tab should have "Jump to Layer" functionality
https://bugs.webkit.org/show_bug.cgi?id=181800

Reviewed by Joseph Pecoraro.

* Localizations/en.lproj/localizedStrings.js:

* UserInterface/Base/Main.js:
(WI.isShowingElementsTab):
(WI.showLayersTab):
(WI.isShowingLayersTab):

* UserInterface/Views/ContextMenuUtilities.js:
(WI.appendContextMenuItemsForDOMNode):

* UserInterface/Views/LayersTabContentView.js:
(WI.LayersTabContentView.prototype.selectLayerForNode):

* UserInterface/Views/Layers3DContentView.js:
(WI.Layers3DContentView):
(WI.Layers3DContentView.prototype.selectLayerForNode):
(WI.Layers3DContentView.prototype.layout):

* UserInterface/Views/LayerDetailsSidebarPanel.js:
(WI.LayerDetailsSidebarPanel):
(WI.LayerDetailsSidebarPanel.prototype.selectNodeByLayerId):
(WI.LayerDetailsSidebarPanel.prototype._updateDataGrid):

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

19 months agoWeb Inspector: Rename String.prototype.trimEnd to avoid conflicts with native trimEnd
nvasilyev@apple.com [Wed, 7 Feb 2018 03:05:54 +0000 (03:05 +0000)]
Web Inspector: Rename String.prototype.trimEnd to avoid conflicts with native trimEnd
https://bugs.webkit.org/show_bug.cgi?id=182545

Reviewed by Brian Burg.

Source/WebInspectorUI:

Rename:
- trimEnd to truncateEnd
- trimMiddle to truncateMiddle

* UserInterface/Base/Utilities.js:
(String.prototype.trimMiddle): Deleted.
(String.prototype.trimEnd): Deleted.
(String.prototype.truncateMiddle): Added.
(String.prototype.truncateEnd): Added.
Use strict mode. Scrict mode allows `this` to be a primitive (a string, in our case).
In non-strict mode, `this` is always an object. Without the strict mode,
"a".truncateEnd(42) !== "a", because truncateEnd returns a string object.

* UserInterface/Views/DOMTreeElement.js:
(WI.DOMTreeElement.prototype._buildAttributeDOM):
* UserInterface/Views/DOMTreeElementPathComponent.js:
(WI.DOMTreeElementPathComponent):
* UserInterface/Views/SearchResultTreeElement.js:
Remove an obvious comment.

(WI.SearchResultTreeElement.truncateAndHighlightTitle):
* UserInterface/Views/SpreadsheetStyleProperty.js:
(WI.SpreadsheetStyleProperty.prototype._renderValue):

LayoutTests:

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

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

19 months agoRendering SVG images with same size as WebGL texture doesn't work correctly
commit-queue@webkit.org [Wed, 7 Feb 2018 02:51:01 +0000 (02:51 +0000)]
Rendering SVG images with same size as WebGL texture doesn't work correctly
https://bugs.webkit.org/show_bug.cgi?id=182367

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2018-02-06
Reviewed by Dean Jackson.

Source/WebCore:

If am image buffer is created for a webgl texture and then it is reused
for another texture, it has to be cleared before drawing.

Test: webgl/webgl-texture-image-buffer-reuse.html

* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::LRUImageBufferCache::imageBuffer):

LayoutTests:

* webgl/webgl-texture-image-buffer-reuse-expected.html: Added.
* webgl/webgl-texture-image-buffer-reuse.html: Added.

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

19 months agoMarked transitions/transition-display-property.html as flaky.
jlewis3@apple.com [Wed, 7 Feb 2018 01:23:29 +0000 (01:23 +0000)]
Marked transitions/transition-display-property.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=182554

Unreviewed test gardening.

* platform/mac-wk1/TestExpectations:

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

19 months agoUse downcast in createLinkPreloadResourceClient
commit-queue@webkit.org [Wed, 7 Feb 2018 00:32:24 +0000 (00:32 +0000)]
Use downcast in createLinkPreloadResourceClient
https://bugs.webkit.org/show_bug.cgi?id=182488

Patch by Youenn Fablet <youenn@apple.com> on 2018-02-06
Reviewed by Antti Koivisto.

No observable change of behavior.
Add a new link preloader client for text track.

* loader/LinkLoader.cpp:
(WebCore::createLinkPreloadResourceClient):
* loader/LinkPreloadResourceClients.h:

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

19 months agoimported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-respond...
commit-queue@webkit.org [Wed, 7 Feb 2018 00:09:21 +0000 (00:09 +0000)]
imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-respond-with-response-body-with-invalid-chunk.https.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=182541

Patch by Youenn Fablet <youenn@apple.com> on 2018-02-06
Reviewed by Chris Dumez.

Source/WebCore:

Covered by test being no longer flaky.
In case of loading error when getting the response body, we were only reporting
the error if there was a callback set or a ReadableStream already created.
Otherwise, we were just stopping loading and if creating a ReadableStream, we were just returning an empty body.

FetchBodyOwner now stores a loading error.
In case a readable stream is created, it will error it if there is a loading error.
If there is not and the loading failed later on, the stream will be errored using the current code path.

* Modules/cache/DOMCache.cpp:
(WebCore::DOMCache::put):
* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::clone):
(WebCore::FetchResponse::BodyLoader::didFail):
* Modules/fetch/FetchResponse.h:
* workers/service/context/ServiceWorkerFetch.cpp:
(WebCore::ServiceWorkerFetch::processResponse):

LayoutTests:

* TestExpectations:

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

19 months agoLayout Test imported/w3c/web-platform-tests/service-workers/service-worker/fetch...
cdumez@apple.com [Wed, 7 Feb 2018 00:03:06 +0000 (00:03 +0000)]
Layout Test imported/w3c/web-platform-tests/service-workers/service-worker/fetch-waits-for-activate.https.html is a flaky failure on macOS and iOS
https://bugs.webkit.org/show_bug.cgi?id=181392
<rdar://problem/36384136>

Reviewed by Youenn Fablet.

Source/WebKit:

All tasks from the StorageProcess to the WebContent process to update registrations
and service workers state are posted to the runloop. However, the fetch callbacks
do not do so. This means that fetch results might come in out of order with regards
to the registration / service worker state updates. The test was flaky because an
intercepted load would sometimes finish before the task to update the service worker
state to "activated" was processed by the runloop. We address the issue by having
the ServiceWorkerClientFetch callbacks schedule tasks to the runloop too.

* WebProcess/Storage/ServiceWorkerClientFetch.cpp:
(WebKit::ServiceWorkerClientFetch::didReceiveResponse):
(WebKit::ServiceWorkerClientFetch::didReceiveData):
(WebKit::ServiceWorkerClientFetch::didFinish):
(WebKit::ServiceWorkerClientFetch::didFail):
(WebKit::ServiceWorkerClientFetch::didNotHandle):

LayoutTests:

Unskip test that is no longer flaky.

* platform/mac-wk2/TestExpectations:

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

19 months ago[macOS] Correct sandbox violation triggered by Chase.com
bfulgham@apple.com [Tue, 6 Feb 2018 23:16:02 +0000 (23:16 +0000)]
[macOS] Correct sandbox violation triggered by Chase.com
https://bugs.webkit.org/show_bug.cgi?id=182519
<rdar://problem/37121757>

Reviewed by Eric Carlson.

Hitting a sandbox violation when attempting to check status of IOAV*En/Decode support.

* WebProcess/com.apple.WebProcess.sb.in:

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

19 months agoWeb Inspector: protocol generator should automatically deduce the correct include...
bburg@apple.com [Tue, 6 Feb 2018 23:10:52 +0000 (23:10 +0000)]
Web Inspector: protocol generator should automatically deduce the correct include style to use
https://bugs.webkit.org/show_bug.cgi?id=182505

Reviewed by Timothy Hatcher.

Currently the generated imports use a mix of system header imports (powered by forwarding headers)
and framework-style includes. Since forwarding headers are going away, this patch stops
using system header includes for headers that are JavaScriptCore private headers. Instead,
use either a relative include or a framework include.

* inspector/scripts/codegen/generate_cpp_alternate_backend_dispatcher_header.py:
(CppAlternateBackendDispatcherHeaderGenerator.generate_output):
(CppAlternateBackendDispatcherHeaderGenerator):
(CppAlternateBackendDispatcherHeaderGenerator._generate_secondary_header_includes):
* inspector/scripts/codegen/generate_cpp_backend_dispatcher_header.py:
(CppBackendDispatcherHeaderGenerator.generate_output):
(CppBackendDispatcherHeaderGenerator._generate_secondary_header_includes):
* inspector/scripts/codegen/generate_cpp_backend_dispatcher_implementation.py:
(CppBackendDispatcherImplementationGenerator.generate_output):
(CppBackendDispatcherImplementationGenerator._generate_secondary_header_includes):
* inspector/scripts/codegen/generate_cpp_frontend_dispatcher_header.py:
(CppFrontendDispatcherHeaderGenerator.generate_output):
(CppFrontendDispatcherHeaderGenerator._generate_secondary_header_includes):
* inspector/scripts/codegen/generate_cpp_frontend_dispatcher_implementation.py:
(CppFrontendDispatcherImplementationGenerator.generate_output):
(CppFrontendDispatcherImplementationGenerator._generate_secondary_header_includes):
* inspector/scripts/codegen/generate_cpp_protocol_types_header.py:
(CppProtocolTypesHeaderGenerator.generate_output):
(CppProtocolTypesHeaderGenerator._generate_secondary_header_includes):
* inspector/scripts/codegen/generate_cpp_protocol_types_implementation.py:
(CppProtocolTypesImplementationGenerator.generate_output):
(CppProtocolTypesImplementationGenerator._generate_secondary_header_includes):
* inspector/scripts/codegen/generate_objc_backend_dispatcher_header.py:
(ObjCBackendDispatcherHeaderGenerator):
Convert existing header lists to the new entries format, which includes the
allowable target frameworks and the relative path to the header.

* inspector/scripts/codegen/generator.py:
(Generator.generate_includes_from_entries):
Copied from the same in the builtins code generator. It still works great.

* inspector/scripts/tests/all/expected/definitions-with-mac-platform.json-result:
* inspector/scripts/tests/generic/expected/commands-with-async-attribute.json-result:
* inspector/scripts/tests/generic/expected/commands-with-optional-call-return-parameters.json-result:
* inspector/scripts/tests/generic/expected/definitions-with-mac-platform.json-result:
* inspector/scripts/tests/generic/expected/domain-availability.json-result:
* inspector/scripts/tests/generic/expected/domains-with-varying-command-sizes.json-result:
* inspector/scripts/tests/generic/expected/enum-values.json-result:
* inspector/scripts/tests/generic/expected/events-with-optional-parameters.json-result:
* inspector/scripts/tests/generic/expected/generate-domains-with-feature-guards.json-result:
* inspector/scripts/tests/generic/expected/same-type-id-different-domain.json-result:
* inspector/scripts/tests/generic/expected/shadowed-optional-type-setters.json-result:
* inspector/scripts/tests/generic/expected/type-declaration-aliased-primitive-type.json-result:
* inspector/scripts/tests/generic/expected/type-declaration-array-type.json-result:
* inspector/scripts/tests/generic/expected/type-declaration-enum-type.json-result:
* inspector/scripts/tests/generic/expected/type-declaration-object-type.json-result:
* inspector/scripts/tests/generic/expected/type-requiring-runtime-casts.json-result:
* inspector/scripts/tests/generic/expected/type-with-open-parameters.json-result:
* inspector/scripts/tests/generic/expected/worker-supported-domains.json-result:
* inspector/scripts/tests/ios/expected/definitions-with-mac-platform.json-result:
* inspector/scripts/tests/mac/expected/definitions-with-mac-platform.json-result:
Rebaseline.

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

19 months ago[Payment Request] show() should take an optional PaymentDetailsUpdate promise
aestes@apple.com [Tue, 6 Feb 2018 22:49:53 +0000 (22:49 +0000)]
[Payment Request] show() should take an optional PaymentDetailsUpdate promise
https://bugs.webkit.org/show_bug.cgi?id=182538
<rdar://problem/36754552>

Reviewed by Tim Horton.

Source/WebCore:

Taught show() to take an optional promise for a PaymentDetailsUpdate.

Added test cases to http/tests/paymentrequest/payment-request-show-method.https.html.

* Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
(WebCore::ApplePayPaymentHandler::detailsUpdated):

Changed to take a PaymentRequest::UpdateReason instead of a eventType string.

(WebCore::ApplePayPaymentHandler::shippingAddressUpdated):
(WebCore::ApplePayPaymentHandler::shippingOptionUpdated):
(WebCore::ApplePayPaymentHandler::paymentMethodUpdated):
(WebCore::ApplePayPaymentHandler::didAuthorizePayment):
(WebCore::ApplePayPaymentHandler::didSelectShippingMethod):
(WebCore::ApplePayPaymentHandler::didSelectShippingContact):
(WebCore::ApplePayPaymentHandler::didSelectPaymentMethod):

Asserted that only one of the PaymentSession delegates is executing at a time.

* Modules/applepay/paymentrequest/ApplePayPaymentHandler.h:
* Modules/paymentrequest/PaymentHandler.h:

Changed detailsUpdated to take a PaymentRequest::UpdateReason instead of a eventType string.

* Modules/paymentrequest/PaymentRequest.cpp:
(WebCore::PaymentRequest::show):

If there is a details promise, call updateWith() with UpdateReason::ShowDetailsResolved.

(WebCore::PaymentRequest::shippingAddressChanged):
(WebCore::PaymentRequest::shippingOptionChanged):
(WebCore::PaymentRequest::paymentMethodChanged):

Used whenDetailsSettled() to ensure that update events do not start before the show()
details promise settles.

(WebCore::PaymentRequest::updateWith):
(WebCore::PaymentRequest::settleDetailsPromise):

Changed to use a PaymentRequest::UpdateReason instead of a eventType string.

(WebCore::PaymentRequest::whenDetailsSettled):

If there is a details promise, wait for it to settle before executing the callback.

* Modules/paymentrequest/PaymentRequest.h:

Defined enum class UpdateReason.

* Modules/paymentrequest/PaymentRequest.idl:

Updated show() to take an optional Promise<PaymentDetailsUpdate>.

* Modules/paymentrequest/PaymentRequestUpdateEvent.cpp:
(WebCore::PaymentRequestUpdateEvent::updateWith):

Map the event type to a PaymentRequest::UpdateReason.

LayoutTests:

* http/tests/paymentrequest/payment-request-show-method.https-expected.txt:
* http/tests/paymentrequest/payment-request-show-method.https.html:

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

19 months agoAdd WKNavigationDelegate SPI to tell the client when an insecure plug-in is blocked
jeffm@apple.com [Tue, 6 Feb 2018 22:45:24 +0000 (22:45 +0000)]
Add WKNavigationDelegate SPI to tell the client when an insecure plug-in is blocked
https://bugs.webkit.org/show_bug.cgi?id=182540

Reviewed by Alex Christensen.

* UIProcess/API/APILoaderClient.h:
(API::LoaderClient::didBlockInsecurePluginVersion):
Changed to take a dictionary reference.

* UIProcess/API/APINavigationClient.h:
(API::NavigationClient::didBlockInsecurePluginVersion):
Added.

* UIProcess/API/C/WKPage.cpp:
(WKPageSetPageLoaderClient):
Changed didBlockInsecurePluginVersion() to take a dictionary reference.

* UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
Added -_webView:didBlockInsecurePluginVersionWithInfo:.

* UIProcess/Cocoa/NavigationState.h:
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::setNavigationDelegate):
Initialize webViewDidBlockInsecurePluginVersionWithInfo.

(WebKit::NavigationState::NavigationClient::didBlockInsecurePluginVersion):
Added.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didBlockInsecurePluginVersion):
Remove check for PLATFORM(COCOA) (we don't check for this in didFailToInitializePlugin() where we
also use createPluginInformationDictionary()) and ENABLE(NETSCAPE_PLUGIN_API) (we're already inside
an #if ENABLE(NETSCAPE_PLUGIN_API block) and use auto for pluginInformation. Attempt to use the
navigation client before the loader client.

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

19 months agoput_to_scope/get_from_scope should not cache lexical scopes when expecting a global...
keith_miller@apple.com [Tue, 6 Feb 2018 22:42:26 +0000 (22:42 +0000)]
put_to_scope/get_from_scope should not cache lexical scopes when expecting a global object
https://bugs.webkit.org/show_bug.cgi?id=182549
<rdar://problem/36189995>

Reviewed by Saam Barati.

JSTests:

* stress/var-injection-cache-invalidation.js: Added.
(allocateLotsOfThings):
(test):

Source/JavaScriptCore:

Previously, the llint/baseline caching for put_to_scope and
get_from_scope would cache lexical environments when the
varInjectionWatchpoint had been fired for global properties. Code
in the DFG does not follow this same assumption so we could
potentially return the wrong result. Additionally, the baseline
would write barrier the global object rather than the lexical
enviroment object. This patch makes it so that we do not cache
anything other than the global object for when the resolve type is
GlobalPropertyWithVarInjectionChecks or GlobalProperty.

* assembler/MacroAssembler.cpp:
(JSC::MacroAssembler::jitAssert):
* assembler/MacroAssembler.h:
* jit/JITPropertyAccess.cpp:
(JSC::JIT::emit_op_get_from_scope):
(JSC::JIT::emit_op_put_to_scope):
* runtime/CommonSlowPaths.h:
(JSC::CommonSlowPaths::tryCachePutToScopeGlobal):
(JSC::CommonSlowPaths::tryCacheGetFromScopeGlobal):
* runtime/Options.h:

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

19 months agoREGRESSION: WebGL no longer producing a transparent canvas on iOS
dino@apple.com [Tue, 6 Feb 2018 22:23:11 +0000 (22:23 +0000)]
REGRESSION: WebGL no longer producing a transparent canvas on iOS
https://bugs.webkit.org/show_bug.cgi?id=182550
<rdar://problem/37234491>

Reviewed by Eric Carlson.

Due to some weirdness GL_RGBA8 is sometimes different between iOS and
other platforms. Only tell the WebGLLayer that it is opaque when it really
is not transparent.

Covered by existing test: fast/canvas/webgl/context-attributes-alpha

* platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
(WebCore::GraphicsContext3D::setRenderbufferStorageFromDrawable): Look at the context
attributes to decide if we should use an opaque layer.
* platform/graphics/cocoa/WebGLLayer.mm: Ditto.
(-[WebGLLayer initWithGraphicsContext3D:]):

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

19 months ago[WebIDL] Support optional Promise arguments
aestes@apple.com [Tue, 6 Feb 2018 21:45:21 +0000 (21:45 +0000)]
[WebIDL] Support optional Promise arguments
https://bugs.webkit.org/show_bug.cgi?id=182399
<rdar://problem/36754552>

Reviewed by Sam Weinig and Chris Dumez.

Previously, declaring a Promise argument as optional would result in a native type of
std::optional<RefPtr<DOMPromise>>. This is wasteful, since RefPtr can represent an optional
argument by storing nullptr. Further, PassArgumentExpression() assumed Promises were never
optional and tried to pass the argument as a Ref by calling RefPtr::releaseNonNull().

This patch removes the std::optional wrapper around optional Promises and simply passes the
promise as a RefPtr to native code.

* bindings/scripts/CodeGeneratorJS.pm:
(PassArgumentExpression):
(GenerateParametersCheck):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalPromiseBody):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalPromise):
* bindings/scripts/test/TestObj.idl:

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

19 months agoHasServiceWorkerRegistration bit should be sent when creating a new page
commit-queue@webkit.org [Tue, 6 Feb 2018 21:24:09 +0000 (21:24 +0000)]
HasServiceWorkerRegistration bit should be sent when creating a new page
https://bugs.webkit.org/show_bug.cgi?id=182410

Patch by Youenn Fablet <youenn@apple.com> on 2018-02-06
Reviewed by Chris Dumez.

Source/WebCore:

Covered by new API test.

Changed the default value of service workers being registered to false.
Every page created in the process will be responsible to change the value to true,
at which time the value will be kept to true for the lifetime of the process.

* workers/service/ServiceWorkerProvider.h:

Source/WebKit:

Move the bit computation at page creation time.
This allows computing the bit based on the web site data store and not only on the pool configuration.
WebPage uses that bit to activate service worker registration matching for the whole process.

In case there is a service worker process proxy created, the bit is set to true by default.

Bit is computed by checking for database file presence.
This information is cached in a map for efficiency reasons and cleared when a service worker process proxy is created.

* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode const):
(WebKit::WebPageCreationParameters::decode):
* Shared/WebPageCreationParameters.h:
* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::encode const):
(WebKit::WebProcessCreationParameters::decode):
* Shared/WebProcessCreationParameters.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::initializeWebPage):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess):
(WebKit::WebProcessPool::initializeNewWebProcess):
(WebKit::WebProcessPool::mayHaveRegisteredServiceWorkers):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_cpuLimit):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess):

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm:

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

19 months agoMake mixed content basic auth tests more robust
dbates@webkit.org [Tue, 6 Feb 2018 21:00:52 +0000 (21:00 +0000)]
Make mixed content basic auth tests more robust
https://bugs.webkit.org/show_bug.cgi?id=182537

Reviewed by Chris Dumez.

Load the test image programmatically instead of declaratively to avoid output flakiness caused by
the preload scanner preloading the test image. The preload scanner performs mixed content checks
and this can cause duplicate mixed content warnings in the test output.

* http/tests/security/mixedContent/secure-redirect-to-insecure-redirect-to-basic-auth-secure-image.https.html:
* http/tests/security/mixedContent/secure-redirect-to-secure-redirect-to-basic-auth-secure-image.https.html:

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

19 months agoAdd missing #if ENABLE(VIDEO) after r228092.
ross.kirsling@sony.com [Tue, 6 Feb 2018 20:55:08 +0000 (20:55 +0000)]
Add missing #if ENABLE(VIDEO) after r228092.
https://bugs.webkit.org/show_bug.cgi?id=182539

Reviewed by Michael Catanzaro.

* html/ImageBitmap.cpp:

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

19 months ago[Modern Media Controls] Test at media/modern-media-controls/tracks-panel/tracks-panel...
graouts@webkit.org [Tue, 6 Feb 2018 19:36:40 +0000 (19:36 +0000)]
[Modern Media Controls] Test at media/modern-media-controls/tracks-panel/tracks-panel-controls-bar-remains-visible-after-clicking-over-it.html fails
https://bugs.webkit.org/show_bug.cgi?id=182425

Reviewed by Dean Jackson.

Source/WebCore:

This test failed because the controls bar would not hit test at the moment we synthesized a mousemove over the controls bar as the first step towards
synthesizing a click on the controls bar to dismiss the tracks panel. Indeed, it would have "pointer-events" set to "none" until the tracks panel was
dismissed, which would only happen after the click event had been propagated. All we need to do is to ensure that none of the controls within the controls
bar get activated as a result of clicking over them when the tracks panel is visible, so we instead set "pointer-events" to "none" on all children of a
controls bar rather than the controls bar itself, which can thus still hit test.

* Modules/modern-media-controls/controls/media-controls.css:
(.media-controls.shows-tracks-panel > .controls-bar > *,):
(.media-controls.shows-tracks-panel > .controls-bar,): Deleted.

LayoutTests:

Turn the test back on now that it works.

* platform/mac/TestExpectations:

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

19 months agoLayout Test media/modern-media-controls/slider/slider-value.html is flaky
graouts@webkit.org [Tue, 6 Feb 2018 19:20:23 +0000 (19:20 +0000)]
Layout Test media/modern-media-controls/slider/slider-value.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=182515

Reviewed by Dean Jackson.

Ensure we stop printing messages once the test has completed since the bots show that this could happen,
although I couldn't reproduce locally.

* media/modern-media-controls/slider/slider-value.html:

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

19 months agoUnreviewed, unskip readable-byte-streams/detached-buffers.serviceworker.https.html...
cdumez@apple.com [Tue, 6 Feb 2018 18:44:49 +0000 (18:44 +0000)]
Unreviewed, unskip readable-byte-streams/detached-buffers.serviceworker.https.html as it is no longer flaky

* TestExpectations:

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

19 months agoService workers registrations are saved to disk before the install / activation succeeds
cdumez@apple.com [Tue, 6 Feb 2018 18:43:50 +0000 (18:43 +0000)]
Service workers registrations are saved to disk before the install / activation succeeds
https://bugs.webkit.org/show_bug.cgi?id=182535
<rdar://problem/36591485>

Reviewed by Youenn Fablet.

Service workers registrations are saved to disk before the install / activation succeeds.
This means if the browser exits before the install / activation succeeds, we may restore
from disk a registration with an “active” worker which may have never been installed /
activated.

To address the issue, we now delay saving the registration to disk until after the service
worker has been activated.

No new tests, restoration from disk is covered by API tests that still pass.

* workers/service/server/SWServer.cpp:
(WebCore::SWServer::didFinishActivation):
(WebCore::SWServer::installContextData):

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

19 months agoUnreviewed, add bug number of service-worker/fetch-event-respond-with-response-body...
cdumez@apple.com [Tue, 6 Feb 2018 18:41:13 +0000 (18:41 +0000)]
Unreviewed, add bug number of service-worker/fetch-event-respond-with-response-body-with-invalid-chunk.https.html

* TestExpectations:

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

19 months agoUnreviewed, unskip service-worker/about-blank-replacement.https.html as it is no...
cdumez@apple.com [Tue, 6 Feb 2018 18:36:53 +0000 (18:36 +0000)]
Unreviewed, unskip service-worker/about-blank-replacement.https.html as it is no longer flaky

* TestExpectations:

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

19 months agoUnreviewed, unskip service-worker/service-worker-csp-connect.https.html as it is...
cdumez@apple.com [Tue, 6 Feb 2018 18:34:25 +0000 (18:34 +0000)]
Unreviewed, unskip service-worker/service-worker-csp-connect.https.html as it is no longer flaky

* TestExpectations:

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

19 months agoUnreviewed, unskip service-worker/uncontrolled-page.https.html as it no longer seems...
cdumez@apple.com [Tue, 6 Feb 2018 18:32:11 +0000 (18:32 +0000)]
Unreviewed, unskip service-worker/uncontrolled-page.https.html as it no longer seems flaky

* TestExpectations:

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

19 months agoUnreviewed, mark service-worker/windowclient-navigate.https.html as slow instead...
cdumez@apple.com [Tue, 6 Feb 2018 18:26:20 +0000 (18:26 +0000)]
Unreviewed, mark service-worker/windowclient-navigate.https.html as slow instead of flaky

* TestExpectations:

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

19 months agoUnreviewed, unskip service-worker/registration-service-worker-attributes.https.html...
cdumez@apple.com [Tue, 6 Feb 2018 18:18:50 +0000 (18:18 +0000)]
Unreviewed, unskip service-worker/registration-service-worker-attributes.https.html now that it is no longer flaky

* TestExpectations:

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

19 months agoUnreviewed, unskip service-worker/update.https.html now that it is no longer flaky
cdumez@apple.com [Tue, 6 Feb 2018 18:16:14 +0000 (18:16 +0000)]
Unreviewed, unskip service-worker/update.https.html now that it is no longer flaky

* TestExpectations:

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

19 months ago[GTK][WPE] Add dependencies watching lists for WKGTK+ and WPE
agomez@igalia.com [Tue, 6 Feb 2018 16:24:59 +0000 (16:24 +0000)]
[GTK][WPE] Add dependencies watching lists for WKGTK+ and WPE
https://bugs.webkit.org/show_bug.cgi?id=182346

Reviewed by Michael Catanzaro.

Loren, Carlos and Andres are interested on the WKGTK+ dependencies
watchlist since they are running WKGTK+ EWS.

Similarly, Adrian and Carlos are running a WPE EWS.

* Scripts/webkitpy/common/config/watchlist: Added WPEDependencies
  and WebKitGTKDependencies watchlists with the proper people.

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

19 months agoUnreviewed, fix format specifiers added in r228116
mcatanzaro@igalia.com [Tue, 6 Feb 2018 14:50:01 +0000 (14:50 +0000)]
Unreviewed, fix format specifiers added in r228116
https://bugs.webkit.org/show_bug.cgi?id=182456
<rdar://problem/37181006>

* NetworkProcess/cache/CacheStorageEngineConnection.cpp:
(WebKit::CacheStorageEngineConnection::open):
(WebKit::CacheStorageEngineConnection::remove):
(WebKit::CacheStorageEngineConnection::caches):
(WebKit::CacheStorageEngineConnection::retrieveRecords):
(WebKit::CacheStorageEngineConnection::deleteMatchingRecords):
(WebKit::CacheStorageEngineConnection::putRecords):
(WebKit::CacheStorageEngineConnection::reference):
(WebKit::CacheStorageEngineConnection::dereference):

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

19 months agoUnreviewed, canonicalize contributors.json
mcatanzaro@igalia.com [Tue, 6 Feb 2018 13:20:48 +0000 (13:20 +0000)]
Unreviewed, canonicalize contributors.json

After Thibault's addition, automatic checks complain about
contributors.json with:

"[...] Use "validate-committer-lists --canonicalize" to reformat
it. [...]"

Patch by Andres Gomez <agomez@igalia.com> on 2018-02-06

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

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

19 months agoUnreviewed, add Lorenzo Tilve to contributors.json
mcatanzaro@igalia.com [Tue, 6 Feb 2018 13:19:40 +0000 (13:19 +0000)]
Unreviewed, add Lorenzo Tilve to contributors.json

We need to add Loren to the contributors list in order to CC him
in Bugzilla.

Patch by Andres Gomez <agomez@igalia.com> on 2018-02-06

* Scripts/webkitpy/common/config/contributors.json: Added Lorenzo
  Tilve.

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

19 months ago[GTK] fast/events/message-channel-gc-4.html is flaky
commit-queue@webkit.org [Tue, 6 Feb 2018 10:55:31 +0000 (10:55 +0000)]
[GTK] fast/events/message-channel-gc-4.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=182104

Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2018-02-06
Reviewed by Carlos Garcia Campos.

Revert r228001 because RunLoop::current isn't called in GC thread
anymore since r228152.

* wtf/RunLoop.cpp:
(WTF::RunLoop::current): Removed a template argument
CanBeGCThread::True of ThreadSpecific.

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

19 months agoInitialize ImageBitmap::m_bitmapData in the constructor.
Ms2ger@igalia.com [Tue, 6 Feb 2018 09:45:49 +0000 (09:45 +0000)]
Initialize ImageBitmap::m_bitmapData in the constructor.
https://bugs.webkit.org/show_bug.cgi?id=182487

Reviewed by Sam Weinig.

This removes the span of time where an ImageBitmap object would exist
with a null m_bitmapData during its construction.

No new tests: no behavior changes.

* html/ImageBitmap.cpp:
(WebCore::ImageBitmap::create): update signature
(WebCore::ImageBitmap::createPromise): update callers
(WebCore::ImageBitmap::ImageBitmap): update signature
* html/ImageBitmap.h: update signatures

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

19 months agoAvoid unnecessarily constructing RunLoops for GC AutomaticThreads in Connection:...
cdumez@apple.com [Tue, 6 Feb 2018 06:50:24 +0000 (06:50 +0000)]
Avoid unnecessarily constructing RunLoops for GC AutomaticThreads in Connection::sendMessage() after r228001
https://bugs.webkit.org/show_bug.cgi?id=182494
<rdar://problem/37147632>

Reviewed by Ryosuke Niwa.

Somebody fixed a GC crash in r228001 by allowing RunLoop::current() to be called from a
GC thread. However, this is still unnecessarily inefficient. Calling RunLoop::current()
will construct RunLoops for background GC threads (WTF::AutomaticThreads). This patches
updates the IPC code to call isMainThread() instead of RunLoop::isMain() in
Connection::sendMessage(). This should mean the same thing since this code runs in
WebKit2 and should be more efficient as it ends up simply calling pthread_main_np(),
without constructing a RunLoop.

* Platform/IPC/Connection.cpp:
(IPC::Connection::sendMessage):

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

19 months agoRelease assertion in inlineVideoFrame
rniwa@webkit.org [Tue, 6 Feb 2018 05:00:07 +0000 (05:00 +0000)]
Release assertion in inlineVideoFrame
https://bugs.webkit.org/show_bug.cgi?id=182513
<rdar://problem/37159363>

Reviewed by Zalan Bujtas.

Source/WebCore:

The bug was caused by the fact it's not always safe to invoke updateLayout even when isSafeToUpdateStyleOrLayout
on a document of a flattened frame on iOS. isSafeToUpdateStyleOrLayout returns true when the frame view is in
the frame-flattening mode to avoid hitting a release asssertion in updateLayout of the frame. However, it's still
not safe to invoke updateLayout on a parent frame in this case.

As a result, inlineVideoFrame (in Source/WebKit/WebProcess/cocoa/VideoFullscreenManager.mm) invokes updateLayout
even when the top-level document is not safe to update when the video element is in a frame-flattened document.

Fixed this bug by explicitly checking that we still have a live render tree and document hasn't been stopped.
Also replaced other uses of isSafeToUpdateStyleOrLayout by more explicit checks.

* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::updateBackingStore): Made the early exit condition added in r227006 more explicit.
Namely, InspectorDOMAgent::pseudoElementCreated is invoked during style recalc.
* dom/Document.cpp:
(WebCore::isSafeToUpdateStyleOrLayout): Made this local to the file.
(WebCore::Document::updateStyleIfNeeded):
(WebCore::Document::updateLayout):
* dom/Document.h:
* html/MediaElementSession.cpp:
(WebCore::isMainContentForPurposesOfAutoplay): Made the early exit condition added in r227529 more explicit. Don't
update the layout when the render tree had been destroyed or the active DOM objects had been stopped.

Source/WebKit:

Fixed the bug. Don't try to update the layout when there is no live render tree or active DOM objects
had been stopped: i.e. during a document destruction.

* WebProcess/cocoa/VideoFullscreenManager.mm:
(WebKit::inlineVideoFrame):

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

19 months agoCrash in imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap...
commit-queue@webkit.org [Tue, 6 Feb 2018 03:57:32 +0000 (03:57 +0000)]
Crash in imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-origin.sub.html
https://bugs.webkit.org/show_bug.cgi?id=182422
<rdar://problem/37182665>

Patch by Youenn Fablet <youenn@apple.com> on 2018-02-05
Reviewed by Alex Christensen.

Source/WebCore:

Covered by test no longer crashing in Debug mode.
Make sure completionHandler is called on the main thread.

* platform/network/cocoa/WebCoreNSURLSession.mm:
(-[WebCoreNSURLSessionDataTask resource:receivedRedirect:request:completionHandler:]):

LayoutTests:

* platform/mac/TestExpectations:

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

19 months agoGlobal objects should be able to use TLCs to allocate from different blocks from...
fpizlo@apple.com [Tue, 6 Feb 2018 03:50:30 +0000 (03:50 +0000)]
Global objects should be able to use TLCs to allocate from different blocks from each other
https://bugs.webkit.org/show_bug.cgi?id=182227

Source/JavaScriptCore:

Reviewed by JF Bastien.

This uses TLCs to create at least `minimumDistanceBetweenCellsFromDifferenOrigins` bytes of
distance between objects from different origins, using the following combination of things. For
short lets refer to that constant as K.

- Since r227721, LargeAllocation puts K bytes padding at the end of each allocation.

- Since r227718, MarkedBlock puts at least K bytes in its footer.

- Since r227617, global objects can have their own TLCs, which make them allocate from a
  different set of blocks than other global objects. The TLC of a global object comes into
  effect when you enter the VM via that global object.

- With this change, TLCs and blocks both have security origins. A TLC will only use blocks that
  share the same security origin or empty blocks (in which case we zero the block and change
  its security origin).

WebCore determines the TLC-GlobalObject mapping. By default, global objects would simply use
the VM's default TLC. WebCore makes it so that DOM windows (but not worker global objects) get
a TLC based on their document's SecurityOrigin.

* JavaScriptCore.xcodeproj/project.pbxproj:
* Sources.txt:
* heap/BlockDirectory.cpp:
(JSC::BlockDirectory::findBlockForAllocation):
(JSC::BlockDirectory::prepareForAllocation):
* heap/BlockDirectory.h:
* heap/LocalAllocator.cpp:
(JSC::LocalAllocator::LocalAllocator):
(JSC::LocalAllocator::reset):
(JSC::LocalAllocator::~LocalAllocator):
(JSC::LocalAllocator::allocateSlowCase):
(JSC::LocalAllocator::tryAllocateWithoutCollecting):
* heap/LocalAllocator.h:
(JSC::LocalAllocator::tlc const):
* heap/MarkStackMergingConstraint.cpp:
* heap/MarkStackMergingConstraint.h:
* heap/MarkedBlock.cpp:
(JSC::MarkedBlock::Handle::associateWithOrigin):
* heap/MarkedBlock.h:
(JSC::MarkedBlock::Handle::securityOriginToken const):
* heap/SecurityOriginToken.cpp: Added.
(JSC::uniqueSecurityOriginToken):
* heap/SecurityOriginToken.h: Added.
* heap/ThreadLocalCache.cpp:
(JSC::ThreadLocalCache::create):
(JSC::ThreadLocalCache::ThreadLocalCache):
(JSC::ThreadLocalCache::allocateData):
(JSC::ThreadLocalCache::installSlow):
* heap/ThreadLocalCache.h:
(JSC::ThreadLocalCache::securityOriginToken const):
* heap/ThreadLocalCacheInlines.h:
(JSC::ThreadLocalCache::install):
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::JSGlobalObject):
(JSC::JSGlobalObject::createThreadLocalCache):
* runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::threadLocalCache):
(JSC::JSGlobalObject::threadLocalCache const): Deleted.
* runtime/VMEntryScope.cpp:
(JSC::VMEntryScope::VMEntryScope):
(JSC::VMEntryScope::~VMEntryScope):
* runtime/VMEntryScope.h:

Source/WebCore:

Reviewed by Daniel Bates and Chris Dumez.

No new tests because no change in behavior.

Adopt JSC TLC API to put distance between objects from different security origins. WebCore has
a subclass of ThreadLocalCache that supports hash-consing based on the relevant origin data
using the existing SecurityOriginHash. It's Document's job to initiate this, but all of the
logic is in WebCore::OriginThreadLocalCache.

Workers don't opt into this. They just get the VM's default TLC all the time.

* ForwardingHeaders/heap/ThreadLocalCache.h: Added.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSDOMGlobalObject.cpp:
(WebCore::JSDOMGlobalObject::JSDOMGlobalObject):
* bindings/js/JSDOMGlobalObject.h:
* bindings/js/JSDOMWindowBase.cpp:
(WebCore::JSDOMWindowBase::JSDOMWindowBase):
* dom/Document.cpp:
(WebCore::Document::initSecurityContext):
(WebCore::Document::threadLocalCache):
* dom/Document.h:
* page/OriginThreadLocalCache.cpp: Added.
(WebCore::threadLocalCacheMap):
(WebCore::OriginThreadLocalCache::create):
(WebCore::OriginThreadLocalCache::~OriginThreadLocalCache):
(WebCore::OriginThreadLocalCache::OriginThreadLocalCache):
* page/OriginThreadLocalCache.h: Added.
* page/SecurityOrigin.cpp:
(WebCore::SecurityOrigin::passesFileCheck const):
(WebCore::SecurityOrigin::setEnforcesFilePathSeparation):
(WebCore::SecurityOrigin::toString const):
(WebCore::SecurityOrigin::enforceFilePathSeparation): Deleted.
* page/SecurityOrigin.h:
(WebCore::SecurityOrigin::enforcesFilePathSeparation const):

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

19 months ago[WinCairo] Refine WebKitLegacy and WebKit build for wincairo
commit-queue@webkit.org [Tue, 6 Feb 2018 02:29:57 +0000 (02:29 +0000)]
[WinCairo] Refine WebKitLegacy and WebKit build for wincairo
https://bugs.webkit.org/show_bug.cgi?id=182478

Patch by Yousuke Kimoto <yousuke.kimoto@sony.com> on 2018-02-05
Reviewed by Alex Christensen.

.:

* Source/cmake/OptionsWinCairo.cmake: Added a ENABLE_WIN_CAIRO_WEBKIT option to build webkit for wincairo.

Source/WebKit:

Fixed a typo of forwarding header path for InjectedBundle and copying header
method, which should use FLATTENED.

* PlatformWin.cmake: Fix a typo of a forwarding header path for InjectedBundle and use FLATTENED.

Tools:

For TestWebKitAPI, sources related to WebKitLegacy are built
at WebKit build. Those files should be reffered for WebKitLegacy build.

* TestWebKitAPI/PlatformWin.cmake:

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

19 months agoTest gardening after r228044
mmaxfield@apple.com [Tue, 6 Feb 2018 02:27:50 +0000 (02:27 +0000)]
Test gardening after r228044
https://bugs.webkit.org/show_bug.cgi?id=182517

Unreviewed.

* platform/ios/fast/css-generated-content/initial-letter-basic-expected.txt:
* platform/ios/fast/css-generated-content/initial-letter-border-padding-expected.txt:
* platform/ios/fast/css-generated-content/initial-letter-raised-expected.txt:
* platform/ios/fast/css-generated-content/initial-letter-sunken-expected.txt:

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

19 months agoiOS WK2: fast/visual-viewport/resize-event-fired.html crashes with GuardMalloc
simon.fraser@apple.com [Tue, 6 Feb 2018 01:44:06 +0000 (01:44 +0000)]
iOS WK2: fast/visual-viewport/resize-event-fired.html crashes with GuardMalloc
https://bugs.webkit.org/show_bug.cgi?id=182504
rdar://problem/36386435

Reviewed by Wenson Hsieh.

Don't end the test until both the resize handler has been called, and the zoom is complete, to
avoid leaving dangling zoom completion handlers.

* fast/visual-viewport/resize-event-fired.html:
* platform/ios/TestExpectations:

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

19 months agoUnreviewed, fix build using the new ENABLE_ADDRESS_SANITIZER option
mcatanzaro@igalia.com [Tue, 6 Feb 2018 01:21:51 +0000 (01:21 +0000)]
Unreviewed, fix build using the new ENABLE_ADDRESS_SANITIZER option
https://bugs.webkit.org/show_bug.cgi?id=182400
<rdar://problem/37252242>

I failed to properly test a last-minute change.

* Source/cmake/WebKitCompilerFlags.cmake:

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

19 months ago[Win] Release assert failed under NetworkStateNotifier::singleton.
pvollan@apple.com [Tue, 6 Feb 2018 00:49:22 +0000 (00:49 +0000)]
[Win] Release assert failed under NetworkStateNotifier::singleton.
https://bugs.webkit.org/show_bug.cgi?id=182516

Reviewed by Brent Fulgham.

The callback NetworkStateNotifier::addressChangeCallback will always be called on a
worker thread on Windows. Since the method NetworkStateNotifier::singleton() is
called by NetworkStateNotifier::addressChangeCallback, but has to be called on the
on the main thread, the call has to be moved there.

No new tests. I have not been able to reproduce the crash.

* platform/network/win/NetworkStateNotifierWin.cpp:
(WebCore::NetworkStateNotifier::addressChangeCallback):

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

19 months agoWebsiteDataStore::resolveDirectoriesIfNecessary() should not overwrite its resolved...
cdumez@apple.com [Mon, 5 Feb 2018 23:36:51 +0000 (23:36 +0000)]
WebsiteDataStore::resolveDirectoriesIfNecessary() should not overwrite its resolved serviceWorkerRegistrationDirectory  if already set
https://bugs.webkit.org/show_bug.cgi?id=182514

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

* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary):

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

19 months ago[cmake] Fix build with ICU configured without collation support
annulen@yandex.ru [Mon, 5 Feb 2018 23:31:31 +0000 (23:31 +0000)]
[cmake] Fix build with ICU configured without collation support
https://bugs.webkit.org/show_bug.cgi?id=182498

Reviewed by Alex Christensen.

WebKit has CollatorDefault.cpp providing necessary stubs when
UCONFIG_NO_COLLATION is defined, however it is not included in cmake
file list.

* wtf/CMakeLists.txt:

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

19 months ago[iOS] Storage process is using the wrong sandbox profile filename
bfulgham@apple.com [Mon, 5 Feb 2018 23:31:22 +0000 (23:31 +0000)]
[iOS] Storage process is using the wrong sandbox profile filename
https://bugs.webkit.org/show_bug.cgi?id=182500
<rdar://problem/37232614>

Reviewed by David Kilzer.

The iOS entitlements file was still referencing the old Databases sandbox profile, even though the
process has been renamed 'Storage'.

* Configurations/Databases-iOS.entitlements:

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