WebKit-https.git
2 years agoReduce duplication in the toplevel Makefile
timothy_horton@apple.com [Thu, 2 Nov 2017 23:50:58 +0000 (23:50 +0000)]
Reduce duplication in the toplevel Makefile
https://bugs.webkit.org/show_bug.cgi?id=179204

* Source/Makefile:
Address some post-landing review comments to keep the order of the MODULES correct.

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

2 years agoReduce duplication in the toplevel Makefile
timothy_horton@apple.com [Thu, 2 Nov 2017 23:50:14 +0000 (23:50 +0000)]
Reduce duplication in the toplevel Makefile
https://bugs.webkit.org/show_bug.cgi?id=179204

* Source/Makefile:
Address some post-landing review comments to keep the order of the MODULES correct.

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

2 years agoReduce duplication in the toplevel Makefile
timothy_horton@apple.com [Thu, 2 Nov 2017 23:00:16 +0000 (23:00 +0000)]
Reduce duplication in the toplevel Makefile
https://bugs.webkit.org/show_bug.cgi?id=179204

Reviewed by Simon Fraser.

* Source/Makefile:
Make MODULES additive instead of completely repeated, and only build
libwebrtc where it's needed.

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

2 years agodisplay:contents should work with dynamic table mutations
antti@apple.com [Thu, 2 Nov 2017 22:38:35 +0000 (22:38 +0000)]
display:contents should work with dynamic table mutations
https://bugs.webkit.org/show_bug.cgi?id=179179

Reviewed by Ryosuke Niwa.

Source/WebCore:

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::addChildIgnoringContinuation):

    RenderText with inline text wrapper as beforeChild is now resolved in RenderTreePosition, covering all cases.
    Verify this with assert.

* rendering/RenderElement.cpp:
(WebCore::RenderElement::insertChildInternal):

    Add assertion.

* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::addChild):

    Fix cases where we did unchecked downcasts for anonymous beforeChild.

* style/RenderTreePosition.cpp:
(WebCore::RenderTreePosition::insert):

    When inserting before a text rendeder with an display:contents inline wrapper, use the wrapper as beforeChild.

* style/RenderTreePosition.h:
(WebCore::RenderTreePosition::insert): Deleted.
* style/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::updateRenderTree):
(WebCore::RenderTreeUpdater::renderingParent):

    Add separate helper to get parent frame for the closest rendered (non display:contents) ancestor.

(WebCore::RenderTreeUpdater::renderTreePosition):
(WebCore::RenderTreeUpdater::updateElementRenderer):
(WebCore::RenderTreeUpdater::textRendererIsNeeded):
(WebCore::RenderTreeUpdater::updateTextRenderer):
(WebCore::RenderTreeUpdater::storePreviousRenderer):

    Use it for tracking state related to render tree siblings. With this we compute whitespace nodes
    correctly for display:contents. The test cases end up depending on that.

* style/RenderTreeUpdater.h:

LayoutTests:

* TestExpectations:

These now pass:

imported/w3c/web-platform-tests/css/css-display-3/display-contents-dynamic-table-001-none.html
imported/w3c/web-platform-tests/css/css-display-3/display-contents-dynamic-table-002-none.html

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

2 years agoBump the size of SameAsRenderElement after r224324
timothy_horton@apple.com [Thu, 2 Nov 2017 22:28:14 +0000 (22:28 +0000)]
Bump the size of SameAsRenderElement after r224324

* rendering/RenderElement.cpp:
RenderElement uses one more bit in the bitfield now.

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

2 years agoUnreviewed, rolling out r224353.
ryanhaddad@apple.com [Thu, 2 Nov 2017 22:05:01 +0000 (22:05 +0000)]
Unreviewed, rolling out r224353.

Breaks internal builds.

Reverted changeset:

"Ignore HSTS for partitioned, cross-origin subresource
requests"
https://bugs.webkit.org/show_bug.cgi?id=178993
https://trac.webkit.org/changeset/224353

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

2 years agoInspector should display service worker served responses properly
joepeck@webkit.org [Thu, 2 Nov 2017 22:00:37 +0000 (22:00 +0000)]
Inspector should display service worker served responses properly
https://bugs.webkit.org/show_bug.cgi?id=178597
<rdar://problem/35186111>

Reviewed by Brian Burg.

Source/JavaScriptCore:

* inspector/protocol/Network.json:
Expose a new "service-worker" response source.

Source/WebCore:

Test: http/tests/inspector/network/resource-response-service-worker.html

* inspector/InspectorNetworkAgent.cpp:
(WebCore::responseSource):
Use the new protocol enum.

Source/WebInspectorUI:

* Localizations/en.lproj/localizedStrings.js:
New Service Worker related strings.

* UserInterface/Controllers/HARBuilder.js:
(WI.HARBuilder.entry):
(WI.HARBuilder.timings):
Only output timing data when we have real resource timing data.

(WI.HARBuilder.fetchType):
Output a new string for a Service Worker load in our custom field.

* UserInterface/Models/ResourceTimingData.js:
(WI.ResourceTimingData.prototype.get responseStart):
Fallback further to the responseEnd. This can happen if the response
itself is an error/failure and there was no response, so treat it as
the same as response end.

* UserInterface/Models/Resource.js:
(WI.Resource.responseSourceFromPayload):
(WI.Resource.prototype.updateForRedirectResponse):
(WI.Resource.prototype.updateForResponse):
A fetch response won't change the URL, so if the URL is empty
don't change it from what the request's URL was.

(WI.Resource.prototype.hasResponse):
Failure is like finished. We should likely transition to an "isComplete" method.

* UserInterface/Views/NetworkTableContentView.js:
(WI.NetworkTableContentView.prototype._populateTransferSizeCell):
(WI.NetworkTableContentView.prototype._generateSortComparator):
Output "(service worker)" in the transfer size field, to indicate this came
from a Service worker. Sort such loads together.

* UserInterface/Views/ResourceHeadersContentView.js:
(WI.ResourceHeadersContentView.prototype._responseSourceDisplayString):
(WI.ResourceHeadersContentView.prototype._refreshSummarySection):
Include the Service Worker response source in this details view. Also include
a FIXME, since we would like to link directly to the service worker in the future.

LayoutTests:

* LayoutTests/platform/gtk/TestExpectations:
* LayoutTests/platform/mac-wk1/TestExpectations:
* LayoutTests/platform/win/TestExpectations:
* LayoutTests/platform/wpe/TestExpectations:
Skip Inspector service worker tests on platforms where Service Workers
are not yet supported. For now this is just one test, future tests
specific to Service Workers will go into a directory.

* http/tests/inspector/network/resource-response-service-worker-expected.txt: Added.
* http/tests/inspector/network/resource-response-service-worker.html: Added.
* http/tests/inspector/network/resources/fetch-service-worker.js: Added.
Test for service worker initiated loads.

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

2 years agoEliminate isMainThread() checks in most call sites of NoEventDispatchAssertion
rniwa@webkit.org [Thu, 2 Nov 2017 21:56:30 +0000 (21:56 +0000)]
Eliminate isMainThread() checks in most call sites of NoEventDispatchAssertion
https://bugs.webkit.org/show_bug.cgi?id=179161

Reviewed by Zalan Bujtas.

Introduced NoEventDispatchAssertion::InMainThread which bypasses the expensive isMainThread() check
in order to turn NoEventDispatchAssertion into a release assertion in a separate patch.

Also removed instances of NoEventDispatchAssertion in notifyChildNodeInserted and notifyChildNodeRemoved
and asserted that the caller has instantiated NoEventDispatchAssertion instead.

No new tests since there should be no behavioral changes.

* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::canExecuteScripts):
* dom/Attr.cpp:
* dom/CharacterData.cpp:
* dom/ContainerNode.cpp:
(WebCore::ContainerNode::removeAllChildrenWithScriptAssertion):
(WebCore::ContainerNode::removeNodeWithScriptAssertion):
(WebCore::executeNodeInsertionWithScriptAssertion):
(WebCore::ContainerNode::removeDetachedChildren): Instantiated NoEventDispatchAssertion::InMainThread
so that notifyChildNodeRemoved would be called inside NoEventDispatchAssertion.
(WebCore::ContainerNode::insertBeforeCommon):
(WebCore::ContainerNode::appendChildCommon):
(WebCore::ContainerNode::removeBetween):
(WebCore::dispatchChildInsertionEvents):
(WebCore::dispatchChildRemovalEvents):
* dom/ContainerNodeAlgorithms.cpp:
(WebCore::notifyChildNodeInserted): Assert that the caller has instantiated NoEventDispatchAssertion.
(WebCore::notifyChildNodeRemoved): Ditto.
* dom/Document.cpp:
(WebCore::Document::resolveStyle):
(WebCore::Document::updateStyleIfNeeded):
(WebCore::Document::nodeChildrenWillBeRemoved):
(WebCore::Document::nodeWillBeRemoved):
(WebCore::Document::dispatchWindowEvent): Replaced RELEASE_ASSERT with ASSERT_WITH_SECURITY_IMPLICATION
for clarity since NoEventDispatchAssertion::isEventAllowedInMainThread() always returns true in release
builds right now.
(WebCore::Document::dispatchWindowLoadEvent): Ditto.
(WebCore::Document::applyPendingXSLTransformsTimerFired): Use ASSERT_WITH_SECURITY_IMPLICATION instead
of regular ASSERT.
* dom/Element.cpp:
(WebCore::Element::addShadowRoot): Instantiate NoEventDispatchAssertion::InMainThread to call
notifyChildNodeInserted will it.
(WebCore::Element::attachAttributeNodeIfNeeded):
(WebCore::Element::setAttributeNode): Fixed the indentation.
(WebCore::Element::setAttributeNodeNS): Ditto.
(WebCore::Element::dispatchFocusInEvent):
(WebCore::Element::dispatchFocusOutEvent):
* dom/EventDispatcher.cpp:
(WebCore::EventDispatcher::dispatchEvent):
* dom/NoEventDispatchAssertion.h:
(WebCore::NoEventDispatchAssertion::isEventDispatchAllowedInSubtree): Moved to InMainThread.
(WebCore::NoEventDispatchAssertion::InMainThread): Added.
(WebCore::NoEventDispatchAssertion::InMainThread::InMainThread): Assert that we're in the main thread
instead of exiting early.
(WebCore::NoEventDispatchAssertion::InMainThread::~InMainThread): Ditto.
(WebCore::NoEventDispatchAssertion::InMainThread::isEventDispatchAllowedInSubtree): Moved here.
(WebCore::NoEventDispatchAssertion::InMainThread::isEventAllowed):
* dom/Node.cpp:
(WebCore::Node::dispatchSubtreeModifiedEvent):
(WebCore::Node::dispatchDOMActivateEvent):
* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::canSuspendActiveDOMObjectsForDocumentSuspension):
(WebCore::ScriptExecutionContext::suspendActiveDOMObjects):
(WebCore::ScriptExecutionContext::resumeActiveDOMObjects):
* history/CachedPage.cpp:
(WebCore::CachedPage::restore):
* history/PageCache.cpp:
(WebCore::PageCache::addIfCacheable):
* page/LayoutContext.cpp:
(WebCore::LayoutContext::layout):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollRectToVisible):

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

2 years agoMark http/tests/preload/viewport/meta-viewport-link-headers.php as flaky on iOS.
ryanhaddad@apple.com [Thu, 2 Nov 2017 21:24:56 +0000 (21:24 +0000)]
Mark http/tests/preload/viewport/meta-viewport-link-headers.php as flaky on iOS.
https://bugs.webkit.org/show_bug.cgi?id=178029

Unreviewed test gardening.

* platform/ios/TestExpectations:

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

2 years agoWeb Inspector: Styles Redesign: turn on CSS spreadsheet editor by default
nvasilyev@apple.com [Thu, 2 Nov 2017 20:46:10 +0000 (20:46 +0000)]
Web Inspector: Styles Redesign: turn on CSS spreadsheet editor by default
https://bugs.webkit.org/show_bug.cgi?id=179100
<rdar://problem/35285990>

Reviewed by Brian Burg.

Add a "Legacy Style Editor" checkbox and remove the experimental "Spreadsheet Style Editor" checkbox.

Remove settings of the legacy styles editor:
- Show inline warnings
- Automatically insert newline
- Select text on first click

These settings are not applicable for the spreadsheet styles editor and
now are always enabled for the legacy styles editor.

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Base/Setting.js:
* UserInterface/Views/CSSStyleDeclarationTextEditor.js:
(WI.CSSStyleDeclarationTextEditor):
(WI.CSSStyleDeclarationTextEditor.prototype._handleMouseUp):
(WI.CSSStyleDeclarationTextEditor.):
* UserInterface/Views/CSSStyleDetailsSidebarPanel.js:
(WI.CSSStyleDetailsSidebarPanel):
* UserInterface/Views/SettingsTabContentView.js:
(WI.SettingsTabContentView.prototype._createGeneralSettingsView):
(WI.SettingsTabContentView.prototype._createExperimentalSettingsView):

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

2 years agoIgnore HSTS for partitioned, cross-origin subresource requests
wilander@apple.com [Thu, 2 Nov 2017 20:43:22 +0000 (20:43 +0000)]
Ignore HSTS for partitioned, cross-origin subresource requests
https://bugs.webkit.org/show_bug.cgi?id=178993
<rdar://problem/34962462>

Reviewed by Brent Fulgham and Alex Christensen.

Source/WebCore:

No new tests. HSTS is not supported in layout tests.
Tested manually.

* platform/network/mac/WebCoreURLResponse.mm:
(WebCore::synthesizeRedirectResponseIfNecessary):
    Now also synthesizes a response if
    _schemeWasUpgradedDueToDynamicHSTS is set on the
    request. Because in such cases the scheme might
    have been downgraded and there the two schemes
    match.

Source/WebCore/PAL:

* pal/spi/cf/CFNetworkSPI.h:
    Added
    - (BOOL)_schemeWasUpgradedDueToDynamicHSTS
    - (BOOL)_preventHSTSStorage
    - (BOOL)_ignoreHSTS
    - (void)_setPreventHSTSStorage:(BOOL)preventHSTSStorage
    - (void)_setIgnoreHSTS:(BOOL)ignoreHSTS

Source/WebKit:

* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(downgradeRequest):
    Convenience function to downgrade a request if
    CFNetwork as already upgraded it during
    canonicalization. This allows the rest of
    WebKit's processing to function, such as UIR
    and mixed content blocking.
(updateIgnoreStrictTransportSecuritySettingIfNecessary):
    Adds and removed the ignore request accordingly.
(-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
    Now asks CFNetwork to ignore HSTS on resource loads we
    partition cookies for.
(-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]):
    Now asks CFNetwork to ignore HSTS on resource loads we
    partition cookies for.

Source/WTF:

* wtf/Platform.h:
    Added HAVE_CFNETWORK_IGNORE_HSTS.

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

2 years agoMark two service worker tests as flaky.
ryanhaddad@apple.com [Thu, 2 Nov 2017 20:41:47 +0000 (20:41 +0000)]
Mark two service worker tests as flaky.

Unreviewed test gardening.

* TestExpectations:

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

2 years ago[WinCairo] Add IPC files for wincairo webkit
commit-queue@webkit.org [Thu, 2 Nov 2017 20:18:31 +0000 (20:18 +0000)]
[WinCairo] Add IPC files for wincairo webkit
https://bugs.webkit.org/show_bug.cgi?id=177919

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

* Platform/IPC/Attachment.cpp:
* Platform/IPC/Attachment.h:
(IPC::Attachment::Attachment):
(IPC::Attachment::handle):
* Platform/IPC/Connection.h:
(IPC::Connection::identifierIsNull):
(IPC::Connection::sendWithReply):
* Platform/IPC/win/AttachmentWin.cpp: Added.
(IPC::Attachment::encode const):
(IPC::getDuplicatedHandle):
(IPC::Attachment::decode):
* Platform/IPC/win/ConnectionWin.cpp: Added.
(IPC::Connection::createServerAndClientIdentifiers):
(IPC::Connection::platformInitialize):
(IPC::Connection::platformInvalidate):
(IPC::Connection::readEventHandler):
(IPC::Connection::writeEventHandler):
(IPC::Connection::open):
(IPC::Connection::platformCanSendOutgoingMessages const):
(IPC::Connection::sendOutgoingMessage):
(IPC::Connection::willSendSyncMessage):
(IPC::Connection::didReceiveSyncReply):
* PlatformWin.cmake:

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

2 years agoLayoutState::m_next is really the ancestor state.
zalan@apple.com [Thu, 2 Nov 2017 19:24:42 +0000 (19:24 +0000)]
LayoutState::m_next is really the ancestor state.
https://bugs.webkit.org/show_bug.cgi?id=179187
<rdar://problem/35319525>

Reviewed by Simon Fraser.

No change in functionality.

* rendering/LayoutState.cpp:
(WebCore::LayoutState::LayoutState):
(WebCore::LayoutState::clearPaginationInformation):
(WebCore::LayoutState::propagateLineGridInfo):
(WebCore::LayoutState::establishLineGrid):
* rendering/LayoutState.h:
* rendering/RenderView.h:

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

2 years agoAI does not correctly model the clobber case of ArithClz32
fpizlo@apple.com [Thu, 2 Nov 2017 19:17:25 +0000 (19:17 +0000)]
AI does not correctly model the clobber case of ArithClz32
https://bugs.webkit.org/show_bug.cgi?id=179188

Reviewed by Michael Saboff.

JSTests:

* stress/arith-clz32-effects.js: Added.
(foo):
(valueOf):

Source/JavaScriptCore:

The non-Int32 case clobbers the world because it may call valueOf.

* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):

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

2 years agoFix iOS WebKitLegacy after r224267
achristensen@apple.com [Thu, 2 Nov 2017 19:12:05 +0000 (19:12 +0000)]
Fix iOS WebKitLegacy after r224267
https://bugs.webkit.org/show_bug.cgi?id=179189

Reviewed by Tim Horton.

Use callOnMainThread instead of dispatch_async to work correctly on the web thread.

* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveAuthenticationChallenge:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:canAuthenticateAgainstProtectionSpace:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveData:lengthReceived:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:didSendBodyData:totalBytesWritten:totalBytesExpectedToWrite:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connectionDidFinishLoading:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:didFailWithError:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:willCacheResponse:]):

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

2 years ago[WPE] Add some error reporting during EGL display/context creation
aperez@igalia.com [Thu, 2 Nov 2017 18:55:57 +0000 (18:55 +0000)]
[WPE] Add some error reporting during EGL display/context creation
https://bugs.webkit.org/show_bug.cgi?id=178937

Reviewed by Carlos Alberto Lopez Perez.

Unconditionally log errors using WTFLogAlways during EGL context creation. This
provides a small degree of help for troubleshooting, and while eglGetError() only
returns numeric error codes, it's better than nothing.

No new tests needed.

* platform/graphics/PlatformDisplay.cpp:
(WebCore::PlatformDisplay::initializeEGLDisplay):
* platform/graphics/egl/GLContextEGL.cpp:
(WebCore::GLContextEGL::errorString):
(WebCore::GLContextEGL::lastErrorString):
(WebCore::GLContextEGL::createWindowContext):
(WebCore::GLContextEGL::createPbufferContext):
(WebCore::GLContextEGL::createSurfacelessContext):
(WebCore::GLContextEGL::createContext):
(WebCore::GLContextEGL::createSharingContext):
(WebCore::GLContextEGL::GLContextEGL):
* platform/graphics/egl/GLContextEGL.h:
* platform/graphics/egl/GLContextEGLWPE.cpp:
(WebCore::GLContextEGL::createWPEContext):
* platform/graphics/wpe/PlatformDisplayWPE.cpp:
(WebCore::PlatformDisplayWPE::initialize):

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

2 years agoEarly out selection update when data is not present
megan_gardner@apple.com [Thu, 2 Nov 2017 18:27:13 +0000 (18:27 +0000)]
Early out selection update when data is not present
https://bugs.webkit.org/show_bug.cgi?id=179084

Reviewed by Ryosuke Niwa.

We should early out of a selection update when we do not have the data that is necessary to make that
update. This mostly helps avoid debug asserts, but will be helpful with the selection changes that are
ongoing.

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

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

2 years agoWeb Inspector: Move InspectorAgents into a folder
joepeck@webkit.org [Thu, 2 Nov 2017 18:25:28 +0000 (18:25 +0000)]
Web Inspector: Move InspectorAgents into a folder
https://bugs.webkit.org/show_bug.cgi?id=179132

Reviewed by Devin Rousso.

* CMakeLists.txt:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
Move files around.

* inspector/agents/InspectorApplicationCacheAgent.cpp: Renamed from Source/WebCore/inspector/InspectorApplicationCacheAgent.cpp.
* inspector/agents/InspectorApplicationCacheAgent.h: Renamed from Source/WebCore/inspector/InspectorApplicationCacheAgent.h.
* inspector/agents/InspectorCSSAgent.cpp: Renamed from Source/WebCore/inspector/InspectorCSSAgent.cpp.
* inspector/agents/InspectorCSSAgent.h: Renamed from Source/WebCore/inspector/InspectorCSSAgent.h.
* inspector/agents/InspectorCanvasAgent.cpp: Renamed from Source/WebCore/inspector/InspectorCanvasAgent.cpp.
* inspector/agents/InspectorCanvasAgent.h: Renamed from Source/WebCore/inspector/InspectorCanvasAgent.h.
* inspector/agents/InspectorDOMAgent.cpp: Renamed from Source/WebCore/inspector/InspectorDOMAgent.cpp.
* inspector/agents/InspectorDOMAgent.h: Renamed from Source/WebCore/inspector/InspectorDOMAgent.h.
* inspector/agents/InspectorDOMDebuggerAgent.cpp: Renamed from Source/WebCore/inspector/InspectorDOMDebuggerAgent.cpp.
* inspector/agents/InspectorDOMDebuggerAgent.h: Renamed from Source/WebCore/inspector/InspectorDOMDebuggerAgent.h.
* inspector/agents/InspectorDOMStorageAgent.cpp: Renamed from Source/WebCore/inspector/InspectorDOMStorageAgent.cpp.
* inspector/agents/InspectorDOMStorageAgent.h: Renamed from Source/WebCore/inspector/InspectorDOMStorageAgent.h.
* inspector/agents/InspectorDatabaseAgent.cpp: Renamed from Source/WebCore/inspector/InspectorDatabaseAgent.cpp.
* inspector/agents/InspectorDatabaseAgent.h: Renamed from Source/WebCore/inspector/InspectorDatabaseAgent.h.
* inspector/agents/InspectorIndexedDBAgent.cpp: Renamed from Source/WebCore/inspector/InspectorIndexedDBAgent.cpp.
* inspector/agents/InspectorIndexedDBAgent.h: Renamed from Source/WebCore/inspector/InspectorIndexedDBAgent.h.
* inspector/agents/InspectorLayerTreeAgent.cpp: Renamed from Source/WebCore/inspector/InspectorLayerTreeAgent.cpp.
* inspector/agents/InspectorLayerTreeAgent.h: Renamed from Source/WebCore/inspector/InspectorLayerTreeAgent.h.
* inspector/agents/InspectorMemoryAgent.cpp: Renamed from Source/WebCore/inspector/InspectorMemoryAgent.cpp.
* inspector/agents/InspectorMemoryAgent.h: Renamed from Source/WebCore/inspector/InspectorMemoryAgent.h.
* inspector/agents/InspectorNetworkAgent.cpp: Renamed from Source/WebCore/inspector/InspectorNetworkAgent.cpp.
* inspector/agents/InspectorNetworkAgent.h: Renamed from Source/WebCore/inspector/InspectorNetworkAgent.h.
* inspector/agents/InspectorPageAgent.cpp: Renamed from Source/WebCore/inspector/InspectorPageAgent.cpp.
* inspector/agents/InspectorPageAgent.h: Renamed from Source/WebCore/inspector/InspectorPageAgent.h.
* inspector/agents/InspectorTimelineAgent.cpp: Renamed from Source/WebCore/inspector/InspectorTimelineAgent.cpp.
* inspector/agents/InspectorTimelineAgent.h: Renamed from Source/WebCore/inspector/InspectorTimelineAgent.h.
* inspector/agents/InspectorWorkerAgent.cpp: Renamed from Source/WebCore/inspector/InspectorWorkerAgent.cpp.
* inspector/agents/InspectorWorkerAgent.h: Renamed from Source/WebCore/inspector/InspectorWorkerAgent.h.
* inspector/agents/WebConsoleAgent.cpp: Renamed from Source/WebCore/inspector/WebConsoleAgent.cpp.
* inspector/agents/WebConsoleAgent.h: Renamed from Source/WebCore/inspector/WebConsoleAgent.h.
* inspector/agents/WebDebuggerAgent.cpp: Renamed from Source/WebCore/inspector/WebDebuggerAgent.cpp.
* inspector/agents/WebDebuggerAgent.h: Renamed from Source/WebCore/inspector/WebDebuggerAgent.h.
* inspector/agents/WebHeapAgent.cpp: Renamed from Source/WebCore/inspector/WebHeapAgent.cpp.
* inspector/agents/WebHeapAgent.h: Renamed from Source/WebCore/inspector/WebHeapAgent.h.
* inspector/agents/page/PageConsoleAgent.cpp: Renamed from Source/WebCore/inspector/PageConsoleAgent.cpp.
* inspector/agents/page/PageConsoleAgent.h: Renamed from Source/WebCore/inspector/PageConsoleAgent.h.
* inspector/agents/page/PageDebuggerAgent.cpp: Renamed from Source/WebCore/inspector/PageDebuggerAgent.cpp.
* inspector/agents/page/PageDebuggerAgent.h: Renamed from Source/WebCore/inspector/PageDebuggerAgent.h.
* inspector/agents/page/PageHeapAgent.cpp: Renamed from Source/WebCore/inspector/PageHeapAgent.cpp.
* inspector/agents/page/PageHeapAgent.h: Renamed from Source/WebCore/inspector/PageHeapAgent.h.
* inspector/agents/page/PageRuntimeAgent.cpp: Renamed from Source/WebCore/inspector/PageRuntimeAgent.cpp.
* inspector/agents/page/PageRuntimeAgent.h: Renamed from Source/WebCore/inspector/PageRuntimeAgent.h.
* inspector/agents/worker/WorkerConsoleAgent.cpp: Renamed from Source/WebCore/inspector/WorkerConsoleAgent.cpp.
* inspector/agents/worker/WorkerConsoleAgent.h: Renamed from Source/WebCore/inspector/WorkerConsoleAgent.h.
* inspector/agents/worker/WorkerDebuggerAgent.cpp: Renamed from Source/WebCore/inspector/WorkerDebuggerAgent.cpp.
* inspector/agents/worker/WorkerDebuggerAgent.h: Renamed from Source/WebCore/inspector/WorkerDebuggerAgent.h.
* inspector/agents/worker/WorkerRuntimeAgent.cpp: Renamed from Source/WebCore/inspector/WorkerRuntimeAgent.cpp.
* inspector/agents/worker/WorkerRuntimeAgent.h: Renamed from Source/WebCore/inspector/WorkerRuntimeAgent.h.
Move agents into folders.

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

2 years agoService Worker fetch should transmit headers to its client
commit-queue@webkit.org [Thu, 2 Nov 2017 17:46:48 +0000 (17:46 +0000)]
Service Worker fetch should transmit headers to its client
https://bugs.webkit.org/show_bug.cgi?id=179156

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

Source/WebCore:

Covered by updated tests.

Making resourceResponse getter return a ResourceResponse with the headers of the FetchResponse Headers object.

* Modules/cache/DOMCache.cpp:
(WebCore::DOMCache::toConnectionRecord):
* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::resourceResponse const):
* Modules/fetch/FetchResponse.h:

LayoutTests:

* http/tests/workers/service/basic-fetch.https-expected.txt:
* http/tests/workers/service/resources/basic-fetch-worker.js:
Adding header specific subtest.
* http/tests/workers/service/resources/image-fetch-worker.js:
Updating test so that image does not go in the memory cache.
Otherwise test is flaky when run multiple times on the same runner.

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

2 years agoFix WPT service worker tests using www1 URLs
commit-queue@webkit.org [Thu, 2 Nov 2017 17:46:02 +0000 (17:46 +0000)]
Fix WPT service worker tests using www1 URLs
https://bugs.webkit.org/show_bug.cgi?id=179144

Patch by Youenn Fablet <youenn@apple.com> on 2017-11-02
Reviewed by Sam Weinig.

LayoutTests/imported/w3c:

* web-platform-tests/service-workers/service-worker/fetch-canvas-tainting-cache.https-expected.txt:
* web-platform-tests/service-workers/service-worker/fetch-canvas-tainting.https-expected.txt:
* web-platform-tests/service-workers/service-worker/fetch-cors-xhr.https-expected.txt:
* web-platform-tests/service-workers/service-worker/fetch-response-taint.https-expected.txt:
* web-platform-tests/service-workers/service-worker/resources/test-helpers.sub.js:

LayoutTests:

* TestExpectations:

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

2 years ago[Win] Update test expectations after r224324.
pvollan@apple.com [Thu, 2 Nov 2017 17:45:43 +0000 (17:45 +0000)]
[Win] Update test expectations after r224324.

Unreviewed test gardening.

* platform/win/css1/pseudo/firstletter-expected.txt:
* platform/win/css1/pseudo/multiple_pseudo_elements-expected.txt:
* platform/win/css2.1/t051202-c24-first-lttr-00-b-expected.txt:
* platform/win/css2.1/t051202-c26-psudo-nest-00-c-expected.txt:
* platform/win/css3/selectors3/html/css3-modsel-166-expected.txt:
* platform/win/css3/selectors3/html/css3-modsel-166a-expected.txt:
* platform/win/css3/selectors3/html/css3-modsel-39-expected.txt:
* platform/win/css3/selectors3/html/css3-modsel-39b-expected.txt:
* platform/win/css3/selectors3/xhtml/css3-modsel-166-expected.txt:
* platform/win/css3/selectors3/xhtml/css3-modsel-166a-expected.txt:
* platform/win/css3/selectors3/xhtml/css3-modsel-39-expected.txt:
* platform/win/css3/selectors3/xhtml/css3-modsel-39b-expected.txt:
* platform/win/css3/selectors3/xml/css3-modsel-166-expected.txt:
* platform/win/css3/selectors3/xml/css3-modsel-166a-expected.txt:
* platform/win/css3/selectors3/xml/css3-modsel-39-expected.txt:
* platform/win/css3/selectors3/xml/css3-modsel-39b-expected.txt:
* platform/win/fast/block/lineboxcontain/glyphs-expected.txt:
* platform/win/fast/box-shadow/basic-shadows-expected.txt:
* platform/win/fast/css-generated-content/003-expected.txt:
* platform/win/fast/css-generated-content/007-expected.txt:
* platform/win/fast/css-generated-content/009-expected.txt:
* platform/win/fast/css-generated-content/012-expected.txt:
* platform/win/fast/css-generated-content/first-letter-in-nested-before-table-expected.txt:
* platform/win/fast/css/first-letter-capitalized-expected.txt:
* platform/win/fast/css/first-letter-detach-expected.txt:
* platform/win/fast/css/first-letter-first-line-hover-expected.txt:
* platform/win/fast/css/first-letter-float-expected.txt:
* platform/win/fast/css/first-letter-hover-expected.txt:
* platform/win/fast/css/first-letter-punctuation-expected.txt:
* platform/win/fast/css/first-letter-recalculation-expected.txt:
* platform/win/fast/css/first-letter-visibility-expected.txt:
* platform/win/fast/multicol/shadow-breaking-expected.txt:
* platform/win/fast/ruby/rubyDOM-remove-rt1-expected.txt:
* platform/win/fast/selectors/039-expected.txt:
* platform/win/fast/selectors/039b-expected.txt:
* platform/win/fast/selectors/166a-expected.txt:
* platform/win/fast/text/firstline/002-expected.txt:
* platform/win/fast/text/firstline/003-expected.txt:
* platform/win/ietestcenter/css3/text/textshadow-004-expected.txt:

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

2 years agoUpdate SWServerJobQueue to follow the Service Worker specification more closely
cdumez@apple.com [Thu, 2 Nov 2017 17:38:57 +0000 (17:38 +0000)]
Update SWServerJobQueue to follow the Service Worker specification more closely
https://bugs.webkit.org/show_bug.cgi?id=179147

Reviewed by Youenn Fablet.

Align naming with the specification.

Get rid of unnecessary m_currentJob as the current job is always the first
job in the queue.

Inline some of the tiny methods to simplify code. Those were leftovers from when
we used to have a background thread.

* workers/service/server/SWServer.cpp:
(WebCore::SWServer::scheduleJob):
* workers/service/server/SWServerJobQueue.cpp:
(WebCore::SWServerJobQueue::SWServerJobQueue):
(WebCore::SWServerJobQueue::scriptFetchFinished):
(WebCore::SWServerJobQueue::scriptContextStarted):
(WebCore::SWServerJobQueue::runNextJob):
(WebCore::SWServerJobQueue::runNextJobSynchronously):
(WebCore::SWServerJobQueue::runRegisterJob):
(WebCore::SWServerJobQueue::runUnregisterJob):
(WebCore::SWServerJobQueue::runUpdateJob):
(WebCore::SWServerJobQueue::rejectCurrentJob):
(WebCore::SWServerJobQueue::finishCurrentJob):
* workers/service/server/SWServerJobQueue.h:
(WebCore::SWServerJobQueue::firstJob const):
(WebCore::SWServerJobQueue::lastJob const):
(WebCore::SWServerJobQueue::enqueueJob):
(WebCore::SWServerJobQueue::size const):

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

2 years agoUnreviewed, removed useless semicolon at the end of namespace
annulen@yandex.ru [Thu, 2 Nov 2017 17:24:02 +0000 (17:24 +0000)]
Unreviewed, removed useless semicolon at the end of namespace

* platform/graphics/texmap/BitmapTextureGL.cpp:

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

2 years agoWPE does not build with DragImage.cpp in unified sources.
mcatanzaro@igalia.com [Thu, 2 Nov 2017 17:13:34 +0000 (17:13 +0000)]
WPE does not build with DragImage.cpp in unified sources.
https://bugs.webkit.org/show_bug.cgi?id=178844

Reviewed by Keith Miller.

Add a stub implementation of DragImage for WPE so that we can drop the @no-unify.

* Sources.txt:
* SourcesWPE.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/wpe/DragImageWPE.cpp: Added.
(WebCore::dragImageSize):
(WebCore::deleteDragImage):
(WebCore::scaleDragImage):
(WebCore::dissolveDragImageToFraction):
(WebCore::createDragImageFromImage):
(WebCore::createDragImageIconForCachedImageFilename):
(WebCore::createDragImageForLink):

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

2 years ago[MediaStream] audioTrack.label is always empty on macOS
eric.carlson@apple.com [Thu, 2 Nov 2017 17:00:20 +0000 (17:00 +0000)]
[MediaStream] audioTrack.label is always empty on macOS
https://bugs.webkit.org/show_bug.cgi?id=179175
<rdar://problem/35315438>

Reviewed by Youenn Fablet.

Source/WebCore:

* platform/mediastream/RealtimeMediaSourceSettings.h:
(WebCore::RealtimeMediaSourceSettings::label const): New.
(WebCore::RealtimeMediaSourceSettings::setLabel): Ditto.
(WebCore::RealtimeMediaSourceSettings::encode const): Encode label.
(WebCore::RealtimeMediaSourceSettings::decode): Decode label.

* platform/mediastream/mac/AVMediaCaptureSource.mm:
(WebCore::AVMediaCaptureSource::initializeSettings): Set label.

* platform/mediastream/mac/CoreAudioCaptureSource.cpp:
(WebCore::CoreAudioCaptureSource::settings const): Ditto.

* platform/mock/MockRealtimeMediaSource.cpp:
(WebCore::MockRealtimeMediaSource::initializeSettings): Ditto.

Source/WebKit:

* WebProcess/cocoa/UserMediaCaptureManager.cpp:
(WebKit::UserMediaCaptureManager::createCaptureSource): Pass settings.label to Source constructor.

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

2 years ago[Service Workers] Add initial implementation for try Clear Registration / Clear Regis...
cdumez@apple.com [Thu, 2 Nov 2017 16:58:00 +0000 (16:58 +0000)]
[Service Workers] Add initial implementation for try Clear Registration / Clear Registration algorithms
https://bugs.webkit.org/show_bug.cgi?id=179151

Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

Rebbaseline several WPT tests now that registrations are actually removed.

* web-platform-tests/service-workers/service-worker/multi-globals/url-parsing.https-expected.txt:
* web-platform-tests/service-workers/service-worker/registration-basic.https-expected.txt:
* web-platform-tests/service-workers/service-worker/registration-scope.https-expected.txt:
* web-platform-tests/service-workers/service-worker/serviceworkerobject-scripturl.https-expected.txt:

Source/WebCore:

[Service Workers] Add initial implementation for try Clear Registration / Clear Registration algorithms:
- https://w3c.github.io/ServiceWorker/#try-clear-registration
- https://w3c.github.io/ServiceWorker/#clear-registration

* workers/service/server/SWServerJobQueue.cpp:
(WebCore::SWServerJobQueue::scriptFetchFinished):
(WebCore::SWServerJobQueue::runUnregisterJob):
(WebCore::SWServerJobQueue::tryClearRegistration):
(WebCore::SWServerJobQueue::clearRegistration):
* workers/service/server/SWServerJobQueue.h:

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

2 years agoClear Node renderer pointer when destroying RenderObject
antti@apple.com [Thu, 2 Nov 2017 16:55:26 +0000 (16:55 +0000)]
Clear Node renderer pointer when destroying RenderObject
https://bugs.webkit.org/show_bug.cgi?id=179112

Reviewed by Zalan Bujtas.

Make sure we don't leave renderer pointers behind in Nodes.
This could be done with WeakPtr but that would add extra indirection between DOM and render tree.

* rendering/RenderObject.cpp:
(WebCore::RenderObject::willBeDestroyed):

    Null the node renderer pointer.
    With continuations we have a case where renderer points to a node that has a different renderer.
    This is is ok as we know no node points to a continuation (they should really be anonymous renderers).

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

2 years agoUnreviewed, release throw scope
utatane.tea@gmail.com [Thu, 2 Nov 2017 16:38:38 +0000 (16:38 +0000)]
Unreviewed, release throw scope
https://bugs.webkit.org/show_bug.cgi?id=178726

* dfg/DFGOperations.cpp:

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

2 years agoUnreviewed GTK+ gardening. Adjusting test expectations and rebaseline some
magomez@igalia.com [Thu, 2 Nov 2017 16:35:40 +0000 (16:35 +0000)]
Unreviewed GTK+ gardening. Adjusting test expectations and rebaseline some
tests after r224328.

* platform/gtk/TestExpectations:
* platform/gtk/css1/pseudo/firstletter-expected.png:
* platform/gtk/css1/pseudo/firstletter-expected.txt:
* platform/gtk/css1/pseudo/multiple_pseudo_elements-expected.txt:
* platform/gtk/css2.1/t051202-c24-first-lttr-00-b-expected.png:
* platform/gtk/css2.1/t051202-c24-first-lttr-00-b-expected.txt:
* platform/gtk/css2.1/t051202-c26-psudo-nest-00-c-expected.txt:
* platform/gtk/css3/selectors3/html/css3-modsel-166-expected.png:
* platform/gtk/css3/selectors3/html/css3-modsel-166-expected.txt:
* platform/gtk/css3/selectors3/html/css3-modsel-166a-expected.png:
* platform/gtk/css3/selectors3/html/css3-modsel-166a-expected.txt:
* platform/gtk/css3/selectors3/html/css3-modsel-39-expected.png:
* platform/gtk/css3/selectors3/html/css3-modsel-39-expected.txt:
* platform/gtk/css3/selectors3/html/css3-modsel-39b-expected.png:
* platform/gtk/css3/selectors3/html/css3-modsel-39b-expected.txt:
* platform/gtk/css3/selectors3/xhtml/css3-modsel-166-expected.png:
* platform/gtk/css3/selectors3/xhtml/css3-modsel-166-expected.txt:
* platform/gtk/css3/selectors3/xhtml/css3-modsel-166a-expected.png:
* platform/gtk/css3/selectors3/xhtml/css3-modsel-166a-expected.txt:
* platform/gtk/css3/selectors3/xhtml/css3-modsel-39-expected.png:
* platform/gtk/css3/selectors3/xhtml/css3-modsel-39-expected.txt:
* platform/gtk/css3/selectors3/xhtml/css3-modsel-39b-expected.png:
* platform/gtk/css3/selectors3/xhtml/css3-modsel-39b-expected.txt:
* platform/gtk/css3/selectors3/xml/css3-modsel-166-expected.png:
* platform/gtk/css3/selectors3/xml/css3-modsel-166-expected.txt:
* platform/gtk/css3/selectors3/xml/css3-modsel-166a-expected.png:
* platform/gtk/css3/selectors3/xml/css3-modsel-166a-expected.txt:
* platform/gtk/css3/selectors3/xml/css3-modsel-39-expected.png:
* platform/gtk/css3/selectors3/xml/css3-modsel-39-expected.txt:
* platform/gtk/css3/selectors3/xml/css3-modsel-39b-expected.png:
* platform/gtk/css3/selectors3/xml/css3-modsel-39b-expected.txt:
* platform/gtk/editing/selection/extend-by-word-002-expected.png:
* platform/gtk/editing/selection/extend-by-word-002-expected.txt:
* platform/gtk/fast/block/lineboxcontain/glyphs-expected.png:
* platform/gtk/fast/block/lineboxcontain/glyphs-expected.txt:
* platform/gtk/fast/box-shadow/basic-shadows-expected.png:
* platform/gtk/fast/box-shadow/basic-shadows-expected.txt:
* platform/gtk/fast/css-generated-content/003-expected.png:
* platform/gtk/fast/css-generated-content/003-expected.txt:
* platform/gtk/fast/css-generated-content/007-expected.png:
* platform/gtk/fast/css-generated-content/007-expected.txt:
* platform/gtk/fast/css-generated-content/009-expected.png:
* platform/gtk/fast/css-generated-content/009-expected.txt:
* platform/gtk/fast/css-generated-content/012-expected.png:
* platform/gtk/fast/css-generated-content/012-expected.txt:
* platform/gtk/fast/css-generated-content/first-letter-in-nested-before-table-expected.txt: Added.
* platform/gtk/fast/css-generated-content/initial-letter-basic-expected.png: Added.
* platform/gtk/fast/css-generated-content/initial-letter-basic-expected.txt:
* platform/gtk/fast/css-generated-content/initial-letter-border-padding-expected.png: Added.
* platform/gtk/fast/css-generated-content/initial-letter-border-padding-expected.txt:
* platform/gtk/fast/css-generated-content/initial-letter-clearance-expected.png: Added.
* platform/gtk/fast/css-generated-content/initial-letter-clearance-expected.txt:
* platform/gtk/fast/css-generated-content/initial-letter-descender-expected.png: Added.
* platform/gtk/fast/css-generated-content/initial-letter-descender-expected.txt:
* platform/gtk/fast/css-generated-content/initial-letter-raised-expected.png: Added.
* platform/gtk/fast/css-generated-content/initial-letter-raised-expected.txt:
* platform/gtk/fast/css-generated-content/initial-letter-sunken-expected.png: Added.
* platform/gtk/fast/css-generated-content/initial-letter-sunken-expected.txt:
* platform/gtk/fast/css/first-letter-capitalized-expected.png:
* platform/gtk/fast/css/first-letter-capitalized-expected.txt:
* platform/gtk/fast/css/first-letter-detach-expected.png:
* platform/gtk/fast/css/first-letter-detach-expected.txt:
* platform/gtk/fast/css/first-letter-first-line-hover-expected.png:
* platform/gtk/fast/css/first-letter-first-line-hover-expected.txt:
* platform/gtk/fast/css/first-letter-float-after-float-expected.png:
* platform/gtk/fast/css/first-letter-float-after-float-expected.txt:
* platform/gtk/fast/css/first-letter-float-expected.png:
* platform/gtk/fast/css/first-letter-float-expected.txt:
* platform/gtk/fast/css/first-letter-hover-expected.png:
* platform/gtk/fast/css/first-letter-hover-expected.txt:
* platform/gtk/fast/css/first-letter-punctuation-expected.png:
* platform/gtk/fast/css/first-letter-punctuation-expected.txt:
* platform/gtk/fast/css/first-letter-recalculation-expected.png:
* platform/gtk/fast/css/first-letter-recalculation-expected.txt:
* platform/gtk/fast/css/first-letter-visibility-expected.png:
* platform/gtk/fast/css/first-letter-visibility-expected.txt:
* platform/gtk/fast/dynamic/first-letter-display-change-expected.txt:
* platform/gtk/fast/multicol/shadow-breaking-expected.png:
* platform/gtk/fast/multicol/shadow-breaking-expected.txt:
* platform/gtk/fast/selectors/039-expected.png:
* platform/gtk/fast/selectors/039-expected.txt:
* platform/gtk/fast/selectors/039b-expected.png:
* platform/gtk/fast/selectors/039b-expected.txt:
* platform/gtk/fast/selectors/166a-expected.png:
* platform/gtk/fast/selectors/166a-expected.txt:
* platform/gtk/fast/text/firstline/002-expected.png:
* platform/gtk/fast/text/firstline/002-expected.txt:
* platform/gtk/fast/text/firstline/003-expected.png:
* platform/gtk/fast/text/firstline/003-expected.txt:
* platform/gtk/ietestcenter/css3/text/textshadow-004-expected.txt:
* platform/gtk/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-drawImage-expected.txt:
* platform/gtk/svg/batik/text/smallFonts-expected.txt:

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

2 years agoMark imported/w3c/web-platform-tests/html/semantics/document-metadata/the-meta-elemen...
ryanhaddad@apple.com [Thu, 2 Nov 2017 16:15:08 +0000 (16:15 +0000)]
Mark imported/w3c/web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/parsing.html as flaky on iOS.
https://bugs.webkit.org/show_bug.cgi?id=177322

Unreviewed test gardening.

* platform/ios/TestExpectations:

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

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

Remove overly optimistic non-critical assertion that is hit on WK1 debug.

* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::removeAndDestroyAllContinuations):

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

2 years ago[WPE][JHBuild] Update WPEBackend and WPEBackend-mesa
clopez@igalia.com [Thu, 2 Nov 2017 14:48:07 +0000 (14:48 +0000)]
[WPE][JHBuild] Update WPEBackend and WPEBackend-mesa
https://bugs.webkit.org/show_bug.cgi?id=179169

Reviewed by Michael Catanzaro.

Update WPEBackend and WPEBackend-mesa to last master as of today.

* wpe/jhbuild.modules:

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

2 years agoAdd references to bug 179167 in FIXME comments
fred.wang@free.fr [Thu, 2 Nov 2017 13:56:48 +0000 (13:56 +0000)]
Add references to bug 179167 in FIXME comments
https://bugs.webkit.org/show_bug.cgi?id=179168

Patch by Frederic Wang <fwang@igalia.com> on 2017-11-02
Reviewed by Daniel Bates.

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore/PAL:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit:

* Configurations/FeatureDefines.xcconfig:

Source/WebKitLegacy/mac:

* Configurations/FeatureDefines.xcconfig:

Source/WTF:

* wtf/FeatureDefines.h:

Tools:

* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:

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

2 years agoUnreviewed, fix typos in library names for the GTK+ port.
berto@igalia.com [Thu, 2 Nov 2017 13:41:16 +0000 (13:41 +0000)]
Unreviewed, fix typos in library names for the GTK+ port.

* Source/cmake/OptionsGTK.cmake:

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

2 years agoMark some ietestcenter tests as failing on all platforms.
Ms2ger@igalia.com [Thu, 2 Nov 2017 12:01:15 +0000 (12:01 +0000)]
Mark some ietestcenter tests as failing on all platforms.
https://bugs.webkit.org/show_bug.cgi?id=179166

Unreviewed test gardening.

This makes it a little easier to figure out which failure expectations
are actually platform-specific.

These tests might not be correct; I haven't tried to figure that out.

* TestExpectations:
* platform/gtk/TestExpectations:
* platform/ios/TestExpectations:
* platform/mac/TestExpectations:
* platform/win/TestExpectations:
* platform/wpe/TestExpectations:

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

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

Reviewed by Geoff Garen.

Source/WebCore:

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

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

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

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

(WebCore::RenderBlock::dropAnonymousBoxChild):

    Make a member function.

(WebCore::RenderBlock::takeChild):

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

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

    Track continuations with double linked lists.

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

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

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

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

(WebCore::RenderElement::styleDidChange):

    removeAnonymousWrappersForInlinesIfNecessary is no function of the parent.

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

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

(WebCore::RenderInline::addChildIgnoringContinuation):

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

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

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

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

    Allow anonymous continuations as destroy roots.

(WebCore::RenderObject::removeFromParentAndDestroyCleaningUpAnonymousWrappers):

    Removing a continuation may leave behind unnecessary anonymous sibling wrappers.
    Call removeAnonymousWrappersForInlinesIfNecessary() on parent after removal to get rid of them.
    If takeChild/removeAnonymousWrappersForInlinesIfNecessary leaves us with empty anonymous parent destroy that too.

* rendering/RenderRubyRun.cpp:
(WebCore::RenderRubyRun::takeChild):

    Similar to RenderBlock::takeChild, remove the code that would make the renderer destroy itself.
    Cleaning up RenderRubyRuns is now handled by removeFromParentAndDestroyCleaningUpAnonymousWrappers.

LayoutTests:

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

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

2 years ago[GTK] Test gardening.
Ms2ger@igalia.com [Thu, 2 Nov 2017 09:53:13 +0000 (09:53 +0000)]
[GTK] Test gardening.
https://bugs.webkit.org/show_bug.cgi?id=179164

Unreviewed test gardening.

* platform/gtk/TestExpectations: update for failing tests reported in bug 179113.
* platform/gtk/editing/deleting/delete-br-009-expected.txt: Rebaseline for r224177.
* platform/gtk/fast/css-generated-content/details-summary-before-after-expected.txt: Rebaseline for r223848.
* platform/gtk/http/tests/security/contentSecurityPolicy/1.1/module-scriptnonce-redirect-expected.txt:
  Removed; platform-specific expectations were added unnecessarily due to failures around bug 178340.
* platform/gtk/http/tests/security/module-no-mime-type-expected.txt:
  Removed; platform-specific expectations were added unnecessarily due to failures around bug 178340.

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

2 years agoREGRESSION(r224053): Crash in WebCore::Node::moveTreeToNewScope
rniwa@webkit.org [Thu, 2 Nov 2017 08:58:46 +0000 (08:58 +0000)]
REGRESSION(r224053): Crash in WebCore::Node::moveTreeToNewScope
https://bugs.webkit.org/show_bug.cgi?id=179158

Reviewed by Antti Koivisto.

Call decrementReferencingNodeCount after checking the release assertion
since that could delete oldDocument.

* dom/Node.cpp:
(WebCore::Node::moveTreeToNewScope):

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

2 years agoSource/WebCore:
antti@apple.com [Thu, 2 Nov 2017 08:05:36 +0000 (08:05 +0000)]
Source/WebCore:
First letter text renderer should be anonymous
https://bugs.webkit.org/show_bug.cgi?id=179114

Reviewed by Darin Adler.

Currently both RenderTextFragment and RenderText for first letter point to the same Text node.
There should only be one non-anonymous renderer per node.

* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored const):

    Skip the first letter text renderer instead of the fragment.

* rendering/RenderBoxModelObject.cpp:
(WebCore::firstLetterRemainingTextMap):

    Use WeakPtr.
    Modernize.

(WebCore::RenderBoxModelObject::willBeDestroyed):
(WebCore::RenderBoxModelObject::firstLetterRemainingText const):

    Avoid hash lookup with the new isFirstLetter bit.

(WebCore::RenderBoxModelObject::setFirstLetterRemainingText):

* rendering/RenderElement.cpp:
(WebCore::RenderElement::RenderElement):
* rendering/RenderElement.h:
(WebCore::RenderElement::isFirstLetter const):
(WebCore::RenderElement::setIsFirstLetter):

    Add a bit for more explicit code.

* rendering/RenderTextFragment.cpp:
(WebCore::RenderTextFragment::setText):

    Assert that RenderTextFragment is always the non-anonymous renderer.

* style/RenderTreeUpdaterFirstLetter.cpp:
(WebCore::updateFirstLetterStyle):

    Set the isFirstLetter bit.

(WebCore::createFirstLetterRenderer):

    Set the isFirstLetter bit.
    Remove the old text renderer before adding a new one.

LayoutTests:
First letter renderer should be anonymous
https://bugs.webkit.org/show_bug.cgi?id=179114

Reviewed by Darin Adler.

* fast/dynamic/first-letter-after-list-marker-expected.txt:
* platform/mac/css1/pseudo/firstletter-expected.txt:
* platform/mac/css1/pseudo/multiple_pseudo_elements-expected.txt:
* platform/mac/css2.1/t051202-c24-first-lttr-00-b-expected.txt:
* platform/mac/css2.1/t051202-c26-psudo-nest-00-c-expected.txt:
* platform/mac/css3/selectors3/html/css3-modsel-166-expected.txt:
* platform/mac/css3/selectors3/html/css3-modsel-166a-expected.txt:
* platform/mac/css3/selectors3/html/css3-modsel-39-expected.txt:
* platform/mac/css3/selectors3/html/css3-modsel-39b-expected.txt:
* platform/mac/css3/selectors3/xhtml/css3-modsel-166-expected.txt:
* platform/mac/css3/selectors3/xhtml/css3-modsel-166a-expected.txt:
* platform/mac/css3/selectors3/xhtml/css3-modsel-39-expected.txt:
* platform/mac/css3/selectors3/xhtml/css3-modsel-39b-expected.txt:
* platform/mac/css3/selectors3/xml/css3-modsel-166-expected.txt:
* platform/mac/css3/selectors3/xml/css3-modsel-166a-expected.txt:
* platform/mac/css3/selectors3/xml/css3-modsel-39-expected.txt:
* platform/mac/css3/selectors3/xml/css3-modsel-39b-expected.txt:
* platform/mac/editing/selection/extend-by-word-002-expected.txt:
* platform/mac/fast/block/lineboxcontain/glyphs-expected.txt:
* platform/mac/fast/box-shadow/basic-shadows-expected.txt:
* platform/mac/fast/css-generated-content/003-expected.txt:
* platform/mac/fast/css-generated-content/007-expected.txt:
* platform/mac/fast/css-generated-content/009-expected.txt:
* platform/mac/fast/css-generated-content/012-expected.txt:
* platform/mac/fast/css-generated-content/first-letter-in-nested-before-table-expected.txt:
* platform/mac/fast/css-generated-content/initial-letter-basic-expected.txt:
* platform/mac/fast/css-generated-content/initial-letter-border-padding-expected.txt:
* platform/mac/fast/css-generated-content/initial-letter-clearance-expected.txt:
* platform/mac/fast/css-generated-content/initial-letter-descender-expected.txt:
* platform/mac/fast/css-generated-content/initial-letter-raised-expected.txt:
* platform/mac/fast/css-generated-content/initial-letter-sunken-expected.txt:
* platform/mac/fast/css/first-letter-capitalized-expected.txt:
* platform/mac/fast/css/first-letter-detach-expected.txt:
* platform/mac/fast/css/first-letter-first-line-hover-expected.txt:
* platform/mac/fast/css/first-letter-float-after-float-expected.txt:
* platform/mac/fast/css/first-letter-float-expected.txt:
* platform/mac/fast/css/first-letter-hover-expected.txt:
* platform/mac/fast/css/first-letter-punctuation-expected.txt:
* platform/mac/fast/css/first-letter-recalculation-expected.txt:
* platform/mac/fast/css/first-letter-visibility-expected.txt:
* platform/mac/fast/dynamic/first-letter-display-change-expected.txt:
* platform/mac/fast/multicol/shadow-breaking-expected.txt:
* platform/mac/fast/selectors/039-expected.txt:
* platform/mac/fast/selectors/039b-expected.txt:
* platform/mac/fast/selectors/166a-expected.txt:
* platform/mac/fast/text/firstline/002-expected.txt:
* platform/mac/fast/text/firstline/003-expected.txt:

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

2 years agoRemove ScrollableArea::isTouchScrollable and ScrollableArea::isOverflowScroll
commit-queue@webkit.org [Thu, 2 Nov 2017 05:57:25 +0000 (05:57 +0000)]
Remove ScrollableArea::isTouchScrollable and ScrollableArea::isOverflowScroll
https://bugs.webkit.org/show_bug.cgi?id=179121

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

These functions were introduced in r161589 and r160236 but it seems that they have never
been used.

No new tests, behavior unchanged.

* platform/ScrollableArea.h:
(WebCore::ScrollableArea::isTouchScrollable const): Deleted.
(WebCore::ScrollableArea::isOverflowScroll const): Deleted.
* rendering/RenderLayer.h:

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

2 years ago[Curl] Make the order of scheduler job handling sequential
commit-queue@webkit.org [Thu, 2 Nov 2017 05:55:06 +0000 (05:55 +0000)]
[Curl] Make the order of scheduler job handling sequential
https://bugs.webkit.org/show_bug.cgi?id=179127

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

* platform/network/curl/CurlRequestScheduler.cpp:
(WebCore::CurlRequestScheduler::add):
(WebCore::CurlRequestScheduler::cancel):
(WebCore::CurlRequestScheduler::stopThreadIfNoMoreJobRunning):
(WebCore::CurlRequestScheduler::executeTasks):
(WebCore::CurlRequestScheduler::workerThread):
(WebCore::CurlRequestScheduler::startTransfer):
(WebCore::CurlRequestScheduler::completeTransfer):
(WebCore::CurlRequestScheduler::cancelTransfer):
(WebCore::CurlRequestScheduler::finalizeTransfer):
(WebCore::CurlJobList::isEmpty const): Deleted.
(WebCore::CurlJobList::startJobs): Deleted.
(WebCore::CurlJobList::finishJobs): Deleted.
(WebCore::CurlRequestScheduler::updateJobList): Deleted.
* platform/network/curl/CurlRequestScheduler.h:

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

2 years agoNavigatorBase::onLine() accesses NetworkStateNotifier's singleton in a worker thread
rniwa@webkit.org [Thu, 2 Nov 2017 05:53:05 +0000 (05:53 +0000)]
NavigatorBase::onLine() accesses NetworkStateNotifier's singleton in a worker thread
https://bugs.webkit.org/show_bug.cgi?id=179149
<rdar://problem/35307552>

Reviewed by Jiewen Tan.

Fixed the bug making NavigatorBase::onLine a pure virtual function, and having two separate
implementations for Navigator and WorkerNavigator. The former uses the singleton directly,
and the latter returns the boolean stored in its instance. The boolean value is updated
via WorkerMessagingProxy when the online status changes.

No new tests.

* page/Navigator.cpp:
(WebCore::Navigator::onLine const):
* page/Navigator.h:
* page/NavigatorBase.cpp:
(WebCore::NavigatorBase::onLine): Deleted.
* page/NavigatorBase.h:
* page/WorkerNavigator.cpp:
(WebCore::WorkerNavigator::WorkerNavigator):
(WebCore::WorkerNavigator::onLine const):
* page/WorkerNavigator.h:
* platform/network/NetworkStateNotifier.cpp:
(WebCore::NetworkStateNotifier::singleton):
* workers/DedicatedWorkerGlobalScope.cpp:
(WebCore::DedicatedWorkerGlobalScope::create):
(WebCore::DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope):
* workers/DedicatedWorkerGlobalScope.h:
* workers/DedicatedWorkerThread.cpp:
(WebCore::DedicatedWorkerThread::DedicatedWorkerThread):
(WebCore::DedicatedWorkerThread::createWorkerGlobalScope):
* workers/DedicatedWorkerThread.h:
* workers/Worker.cpp:
(WebCore::Worker::notifyFinished):
* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::WorkerGlobalScope):
(WebCore::WorkerGlobalScope::navigator):
(WebCore::WorkerGlobalScope::setIsOnline):
* workers/WorkerGlobalScope.h:
* workers/WorkerGlobalScopeProxy.h:
* workers/WorkerMessagingProxy.cpp:
(WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
(WebCore::WorkerMessagingProxy::notifyNetworkStateChange):
* workers/WorkerMessagingProxy.h:
* workers/WorkerThread.cpp:
(WebCore::WorkerThreadStartupData::WorkerThreadStartupData):
(WebCore::WorkerThread::WorkerThread):
(WebCore::WorkerThread::workerThread):
* workers/WorkerThread.h:
* workers/service/ServiceWorkerGlobalScope.cpp:
(WebCore::ServiceWorkerGlobalScope::ServiceWorkerGlobalScope):
* workers/service/ServiceWorkerGlobalScope.h:
* workers/service/context/ServiceWorkerThread.cpp:
(WebCore::ServiceWorkerThread::ServiceWorkerThread):
(WebCore::ServiceWorkerThread::createWorkerGlobalScope):
* workers/service/context/ServiceWorkerThread.h:

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

2 years agoLet is<T>() accept RefPtrs
jiewen_tan@apple.com [Thu, 2 Nov 2017 05:43:02 +0000 (05:43 +0000)]
Let is<T>() accept RefPtrs
https://bugs.webkit.org/show_bug.cgi?id=178612
<rdar://problem/35102004>

Reviewed by Ryosuke Niwa.

Source/WebCore:

Get rid of .get() for all is<T>() calls.

No changes in behaviors.

* bindings/js/JSElementCustom.cpp:
(WebCore::createNewElementWrapper):
* bindings/js/JSMediaStreamTrackCustom.cpp:
(WebCore::toJSNewlyCreated):
* bindings/js/JSNodeCustom.cpp:
(WebCore::createWrapperInline):
* bindings/js/JSTextCustom.cpp:
(WebCore::toJSNewlyCreated):
* css/CSSFilterImageValue.cpp:
(WebCore::CSSFilterImageValue::loadSubimages):
* css/CSSFontFaceSet.cpp:
(WebCore::CSSFontFaceSet::matchingFaces):
* css/CSSFontSelector.cpp:
(WebCore::CSSFontSelector::addFontFaceRule):
* css/CSSToStyleMap.cpp:
(WebCore::CSSToStyleMap::mapNinePieceImage):
* css/FontFace.cpp:
(WebCore::FontFace::create):
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::createGridTrackList):
* css/StyleBuilderCustom.h:
(WebCore::StyleBuilderCustom::applyValueCursor):
(WebCore::StyleBuilderCustom::applyValueContent):
(WebCore::StyleBuilderCustom::applyValueWillChange):
* css/StyleProperties.cpp:
(WebCore::StyleProperties::propertyAsColor const):
(WebCore::StyleProperties::propertyAsValueID const):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::createFilterOperations):
* css/TransformFunctions.cpp:
(WebCore::transformsForValue):
* css/ViewportStyleResolver.cpp:
(WebCore::ViewportStyleResolver::getViewportArgumentValue const):
* dom/Document.cpp:
(WebCore::Document::setBodyOrFrameset):
(WebCore::Document::setFocusedElement):
(WebCore::Document::updateHoverActiveState):
* dom/Element.cpp:
(WebCore::Element::setOuterHTML):
* dom/Range.cpp:
(WebCore::Range::insertNode):
* editing/ApplyStyleCommand.cpp:
(WebCore::toIdentifier):
(WebCore::ApplyStyleCommand::applyBlockStyle):
(WebCore::ApplyStyleCommand::surroundNodeRangeWithElement):
* editing/EditingStyle.cpp:
(WebCore::identifierForStyleProperty):
(WebCore::HTMLElementEquivalent::valueIsPresentInStyle const):
(WebCore::EditingStyle::extractFontSizeDelta):
(WebCore::EditingStyle::textDirection const):
(WebCore::textDecorationValueList):
(WebCore::EditingStyle::prepareToApplyAt):
(WebCore::EditingStyle::legacyFontSize const):
(WebCore::EditingStyle::textDirectionForSelection):
(WebCore::StyleChange::StyleChange):
(WebCore::StyleChange::extractTextStyles):
(WebCore::diffTextDecorations):
* html/BaseChooserOnlyDateAndTimeInputType.cpp:
(WebCore::BaseChooserOnlyDateAndTimeInputType::updateAppearance):
* html/FormAssociatedElement.cpp:
(WebCore::FormAssociatedElement::findAssociatedForm):
* html/HTMLAreaElement.cpp:
(WebCore::HTMLAreaElement::imageElement const):
* html/HTMLElement.cpp:
(WebCore::HTMLElement::setOuterText):
(WebCore::HTMLElement::dirAttributeChanged):
* html/HTMLEmbedElement.cpp:
(WebCore::HTMLEmbedElement::rendererIsNeeded):
* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::computeIsDisabledByFieldsetAncestor const):
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::dataList const):
* html/HTMLOptionElement.cpp:
(WebCore::HTMLOptionElement::setText):
(WebCore::HTMLOptionElement::textIndentedToRespectGroupLabel const):
* html/HTMLPlugInElement.cpp:
(WebCore::HTMLPlugInElement::isKeyboardFocusable const):
(WebCore::HTMLPlugInElement::isUserObservable const):
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::selectOption):
* html/HTMLSummaryElement.cpp:
(WebCore::isClickableControl):
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::adjustInnerTextStyle const):
* html/RadioInputType.cpp:
(WebCore::RadioInputType::isKeyboardFocusable const):
* html/parser/HTMLConstructionSite.cpp:
(WebCore::HTMLConstructionSite::attachLater):
(WebCore::HTMLConstructionSite::insertTextNode):
* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlClosedCaptionsTrackListElement::defaultEventHandler):
* html/track/TextTrackList.cpp:
(TextTrackList::append):
* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::setNodeName):
* inspector/PageScriptDebugServer.cpp:
(WebCore::PageScriptDebugServer::setJavaScriptPaused):
* page/FocusController.cpp:
(WebCore::shouldClearSelectionWhenChangingFocusedElement):
* page/FrameView.cpp:
(WebCore::FrameView::hasCustomScrollbars const):
* page/Page.cpp:
(WebCore::Page::pluginViews):
* page/mac/EventHandlerMac.mm:
(WebCore::EventHandler::platformPrepareForWheelEvents):
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::paintFillLayerExtended):
* testing/Internals.cpp:
(WebCore::deferredStyleRulesCountForList):
(WebCore::deferredGroupRulesCountForList):
(WebCore::deferredKeyframesRulesCountForList):

Source/WTF:

Add support for is<T>() for RefPtrs.

* wtf/RefPtr.h:
(WTF::is):

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

2 years ago[curl] Fix build after r224299
commit-queue@webkit.org [Thu, 2 Nov 2017 04:49:10 +0000 (04:49 +0000)]
[curl] Fix build after r224299
https://bugs.webkit.org/show_bug.cgi?id=179155

Unreviewed.

Bug 175597 added the 6th argument of ResourceHandle constructor.
Apply the same change of ResourceHandleCFNet.cpp to
platformLoadResourceSynchronously of ResourceHandleCurl.cpp.

No new tests since there should be no behavioral change other

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

* platform/network/curl/ResourceHandleCurl.cpp:
(WebCore::ResourceHandle::platformLoadResourceSynchronously):
Added the 6th arguemnt shouldContentEncodingSniff.

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

2 years agoFix iOS build after r224312.
simon.fraser@apple.com [Thu, 2 Nov 2017 04:30:38 +0000 (04:30 +0000)]
Fix iOS build after r224312.

* platform/graphics/cocoa/GraphicsContextCocoa.mm:
(WebCore::GraphicsContext::drawFocusRing):

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

2 years agoAdd about page for MotionMark
jonlee@apple.com [Thu, 2 Nov 2017 04:17:36 +0000 (04:17 +0000)]
Add about page for MotionMark
https://bugs.webkit.org/show_bug.cgi?id=179152

Reviewed by Ryosuke Niwa.

* MotionMark/about.html: Added.
* MotionMark/index.html:
* MotionMark/resources/runner/motionmark.css:

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

2 years agoChange Element::didAddUserAgentShadowRoot() to take a reference instead of a pointer
dbates@webkit.org [Thu, 2 Nov 2017 04:13:18 +0000 (04:13 +0000)]
Change Element::didAddUserAgentShadowRoot() to take a reference instead of a pointer
https://bugs.webkit.org/show_bug.cgi?id=179153

Reviewed by Ryosuke Niwa.

Element::didAddUserAgentShadowRoot() is always passed a non-null pointer to the added
ShadowRoot. Therefore we should have didAddUserAgentShadowRoot() take a lvalue reference
to a ShadowRoot.

No functionality changed. So, no new tests.

* dom/Element.cpp:
(WebCore::Element::addShadowRoot):
* dom/Element.h:
(WebCore::Element::didAddUserAgentShadowRoot):
* html/HTMLDetailsElement.cpp:
(WebCore::HTMLDetailsElement::didAddUserAgentShadowRoot):
* html/HTMLDetailsElement.h:
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::didAddUserAgentShadowRoot):
* html/HTMLInputElement.h:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::didAddUserAgentShadowRoot):
* html/HTMLMediaElement.h:
* html/HTMLMeterElement.cpp:
(WebCore::HTMLMeterElement::didAddUserAgentShadowRoot):
* html/HTMLMeterElement.h:
* html/HTMLPlugInElement.cpp:
(WebCore::HTMLPlugInElement::didAddUserAgentShadowRoot):
* html/HTMLPlugInElement.h:
* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::didAddUserAgentShadowRoot):
* html/HTMLPlugInImageElement.h:
* html/HTMLProgressElement.cpp:
(WebCore::HTMLProgressElement::didAddUserAgentShadowRoot):
* html/HTMLProgressElement.h:
* html/HTMLSummaryElement.cpp:
(WebCore::HTMLSummaryElement::didAddUserAgentShadowRoot):
* html/HTMLSummaryElement.h:
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::didAddUserAgentShadowRoot):
* html/HTMLTextAreaElement.h:

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

2 years agoFix up ChangeLog description for r224299 as per <https://bugs.webkit.org/show_bug...
dbates@webkit.org [Thu, 2 Nov 2017 04:03:22 +0000 (04:03 +0000)]
Fix up ChangeLog description for r224299 as per <https://bugs.webkit.org/show_bug.cgi?id=175597#c33>.

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

2 years agoWeb Inspector: consolidate DOMTreeElement contextmenu items into submenus
webkit@devinrousso.com [Thu, 2 Nov 2017 03:34:44 +0000 (03:34 +0000)]
Web Inspector: consolidate DOMTreeElement contextmenu items into submenus
https://bugs.webkit.org/show_bug.cgi?id=178996

Reviewed by Joseph Pecoraro.

* Localizations/en.lproj/localizedStrings.js:

* UserInterface/Views/ContextMenu.js:
(WI.ContextSubMenuItem.prototype.appendItem):
(WI.ContextSubMenuItem.prototype.appendSubMenuItem):
(WI.ContextSubMenuItem.prototype.appendCheckboxItem):
(WI.ContextSubMenuItem.prototype.pushItem):
(WI.ContextSubMenuItem.prototype._pushItem): Deleted.
Made `pushItem` public so that it is possible to create a ContextMenuItem without
immediately adding it to the ContextMenu.

(WI.ContextSubMenuItem.prototype._buildDescriptor):
(WI.ContextMenu.prototype._buildDescriptor):
Filter out submenus that have no items.

* UserInterface/Views/ContextMenuUtilities.js:
(WI.appendContextMenuItemsForDOMNode):
* UserInterface/Views/DOMTreeElement.js:
(WI.DOMTreeElement.prototype.toggleElementVisibility):
(WI.DOMTreeElement.prototype._populateTagContextMenu):
(WI.DOMTreeElement.prototype._populateTextContextMenu):
(WI.DOMTreeElement.prototype._populateNodeContextMenu):
(WI.DOMTreeElement.prototype._populateForcedPseudoStateItems): Deleted.
Add relevant items to the provided submenus and reorder the entire contextmenu for better
readability and consistency.

* UserInterface/Views/DOMTreeOutline.js:
(WI.DOMTreeOutline.prototype.populateContextMenu):
Create submenus for Add, Edit, Copy, and Delete, and pass them to the DOMTreeElement
"populate*ContextMenu" functions so that they can add items to each submenu.

(WI.DOMTreeOutline.prototype._hideElement):
Move to DOMTreeElement so that it can be used by a contextmenu item.

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

2 years agoImplement WKFullscreenWindowController for iOS.
commit-queue@webkit.org [Thu, 2 Nov 2017 03:25:19 +0000 (03:25 +0000)]
Implement WKFullscreenWindowController for iOS.
https://bugs.webkit.org/show_bug.cgi?id=178924
rdar://problem/34697120

Patch by Jeremy Jones <jeremyj@apple.com> on 2017-11-01
Reviewed by Simon Fraser.

Source/JavaScriptCore:

Enable ENABLE_FULLSCREEN_API for iOS.

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

Enable ENABLE_FULLSCREEN_API for iOS.

* Configurations/FeatureDefines.xcconfig:

Source/WebCore/PAL:

Enable ENABLE_FULLSCREEN_API for iOS;

* Configurations/FeatureDefines.xcconfig:

Source/WebKit:

Plumb relevant calls through WKWebView and PageClientImplIOS.

This forms the base implementation for element fullscreen. This will animate an element into fullscreen and back to inline.
It does this by replacing the WKWebView with a placeholder image and presenting the WKWebView with a fullscreen view controller.
This also attempts to preserve UI state of the WKWebView when it is placed back inline.

To enable _WKFullscreenDelegate for iOS, this adds an iOS version of the delegate methods that passes WKWebView instead of NSView.
The iOS version of these functions are renamed to be more specific and disambiguate them from the video fullscreen delegate methods.

This also adds an image asset for the done button.

* Configurations/FeatureDefines.xcconfig:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView hasFullScreenWindowController]):
(-[WKWebView fullScreenWindowController]):
(-[WKWebView closeFullScreenWindowController]):
(-[WKWebView fullScreenPlaceholderView]):
* UIProcess/API/Cocoa/WKWebViewInternal.h:
* UIProcess/API/Cocoa/_WKFullscreenDelegate.h:
* UIProcess/Cocoa/FullscreenClient.h:
* UIProcess/Cocoa/FullscreenClient.mm:
(WebKit::FullscreenClient::FullscreenClient):
(WebKit::FullscreenClient::setDelegate):
(WebKit::FullscreenClient::willEnterFullscreen):
(WebKit::FullscreenClient::didEnterFullscreen):
(WebKit::FullscreenClient::willExitFullscreen):
(WebKit::FullscreenClient::didExitFullscreen):
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::closeFullScreenManager):
(WebKit::PageClientImpl::isFullScreen):
(WebKit::PageClientImpl::enterFullScreen):
(WebKit::PageClientImpl::exitFullScreen):
(WebKit::PageClientImpl::beganEnterFullScreen):
(WebKit::PageClientImpl::beganExitFullScreen):
* UIProcess/ios/WKContentView.mm:
* UIProcess/ios/WKFullScreenWindowControllerIOS.h: Copied from Source/WebKit/UIProcess/API/Cocoa/_WKFullscreenDelegate.h.
* UIProcess/ios/WKFullScreenWindowControllerIOS.mm: Added.
(WebKit::replaceViewWithView):
(WebKit::WKWebViewState::applyTo):
(WebKit::WKWebViewState::store):
(-[_WKTapDelgatingView setTarget:action:]):
(-[_WKTapDelgatingView hitTest:withEvent:]):
(-[_WKFullScreenViewController dealloc]):
(-[_WKFullScreenViewController viewWillTransitionToSize:withTransitionCoordinator:]):
(+[_WKFullScreenViewController configureView:withBackgroundFillOfColor:opacity:filter:]):
(-[_WKFullScreenViewController _updateTransparencyOfVisualEffectView:]):
(-[_WKFullScreenViewController createVisualEffectViewWithFrame:]):
(-[_WKFullScreenViewController loadView]):
(-[_WKFullScreenViewController viewWillAppear:]):
(-[_WKFullScreenViewController viewDidDisappear:]):
(-[_WKFullScreenViewController cancelAction:]):
(-[_WKFullScreenViewController hideCancelButton]):
(-[_WKFullScreenViewController showCancelButton]):
(-[_WKFullScreenViewController setTarget:action:]):
(-[_WKFullScreenViewController prefersStatusBarHidden]):
(-[WKFullscreenAnimationController transitionDuration:]):
(-[WKFullscreenAnimationController animateTransition:]):
(-[WKFullscreenAnimationController animationEnded:]):
(-[WKFullScreenWindowController initWithWebView:page:]):
(-[WKFullScreenWindowController dealloc]):
(-[WKFullScreenWindowController isFullScreen]):
(-[WKFullScreenWindowController webViewPlaceholder]):
(-[WKFullScreenWindowController enterFullScreen]):
(-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]):
(-[WKFullScreenWindowController completedEnterFullScreen]):
(-[WKFullScreenWindowController exitFullScreen]):
(-[WKFullScreenWindowController requestExitFullScreen]):
(-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]):
(-[WKFullScreenWindowController completedExitFullScreen]):
(-[WKFullScreenWindowController close]):
(-[WKFullScreenWindowController _manager]):
(-[WKFullScreenWindowController animationControllerForPresentedController:presentingController:sourceController:]):
(-[WKFullScreenWindowController animationControllerForDismissedController:]):
* WebKit.xcassets/Contents.json: Added.
* WebKit.xcassets/Done.imageset/Contents.json: Added.
* WebKit.xcassets/Done.imageset/Done.pdf: Added.
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/FullScreen/WebFullScreenManager.cpp:
(WebKit::WebFullScreenManager::willEnterFullScreen):
(WebKit::WebFullScreenManager::willExitFullScreen):

Source/WebKitLegacy/mac:

Enable ENABLE_FULLSCREEN_API for iOS. Fix a build error.

* Configurations/FeatureDefines.xcconfig:
* WebView/WebView.mm:
(-[WebView fullScreenPlaceholderView]):

Tools:

Enable ENABLE_FULLSCREEN_API for iOS.

* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:

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

2 years agoMisc display list and other cleanup
simon.fraser@apple.com [Thu, 2 Nov 2017 03:08:53 +0000 (03:08 +0000)]
Misc display list and other cleanup
https://bugs.webkit.org/show_bug.cgi?id=179150

Reviewed by Tim Horton.

Source/WebCore:

A few functions in GraphicsContext would assert when using display lists, because they
had no recording clause. Fix them (ellipse drawing, and focus ring drawing).

Use #pragma once in more places.

Add system trace points for display list recording.

No behavior change for non-display list code.

* platform/graphics/GraphicsContext.cpp:
(WebCore::GraphicsContext::fillEllipse):
(WebCore::GraphicsContext::strokeEllipse):
* platform/graphics/PlatformLayer.h:
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::recursiveCommitChanges):
* platform/graphics/ca/cocoa/WebSystemBackdropLayer.h:
* platform/graphics/ca/cocoa/WebTiledBackingLayer.h:
* platform/graphics/cg/GraphicsContextCG.h:
* platform/graphics/cocoa/GraphicsContextCocoa.mm:
(WebCore::GraphicsContext::drawFocusRing):
* platform/graphics/displaylists/DisplayList.h:
* platform/graphics/displaylists/DisplayListItems.h:
(WebCore::DisplayList::DrawFocusRingPath::create):
(WebCore::DisplayList::DrawFocusRingPath::width const):
(WebCore::DisplayList::DrawFocusRingPath::offset const):
(WebCore::DisplayList::DrawFocusRingPath::DrawFocusRingPath):
(WebCore::DisplayList::DrawFocusRingRects::create):
(WebCore::DisplayList::DrawFocusRingRects::width const):
(WebCore::DisplayList::DrawFocusRingRects::offset const):
(WebCore::DisplayList::DrawFocusRingRects::DrawFocusRingRects):
* platform/graphics/displaylists/DisplayListRecorder.cpp:
(WebCore::DisplayList::Recorder::restore):
(WebCore::DisplayList::Recorder::drawFocusRing):
* platform/graphics/displaylists/DisplayListRecorder.h:
* platform/graphics/displaylists/DisplayListReplayer.h:
* platform/graphics/mac/WebLayer.h:

Source/WTF:

Add system trace points for display list recording.

* wtf/SystemTracing.h:

Tools:

Add system trace points for display list recording.

* Tracing/SystemTracePoints.plist:

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

2 years ago[Win] Fix compile errors in MediaPlayerPrivateAVFoundationCF.cpp
pvollan@apple.com [Thu, 2 Nov 2017 03:00:08 +0000 (03:00 +0000)]
[Win] Fix compile errors in MediaPlayerPrivateAVFoundationCF.cpp
https://bugs.webkit.org/show_bug.cgi?id=179148

Reviewed by Ryosuke Niwa.

* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
(WebCore::MediaPlayerPrivateAVFoundationCF::resolvedURLChanged):

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

2 years agoAdjust RenderElement size assertion to be more accurate
timothy_horton@apple.com [Thu, 2 Nov 2017 01:59:12 +0000 (01:59 +0000)]
Adjust RenderElement size assertion to be more accurate
https://bugs.webkit.org/show_bug.cgi?id=179146

Reviewed by Simon Fraser.

* rendering/RenderElement.cpp:
Alignment rules for bitfields differ on different platforms. If we're
more truthful in our mimicing the layout of RenderElement, we can avoid
the assertion firing on more configurations.

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

2 years agoAdd support to throw OOM if MarkedArgumentBuffer may overflow.
mark.lam@apple.com [Thu, 2 Nov 2017 01:54:43 +0000 (01:54 +0000)]
Add support to throw OOM if MarkedArgumentBuffer may overflow.
https://bugs.webkit.org/show_bug.cgi?id=179092
<rdar://problem/35116160>

Reviewed by Saam Barati.

Source/JavaScriptCore:

The test for overflowing a MarkedArgumentBuffer will run for a ridiculously long
time, which renders it unsuitable for automated tests.  Instead, I've run a
test manually to verify that an OutOfMemoryError will be thrown when an overflow
occurs.

The MarkedArgumentBuffer's destructor will now assert that the client has indeed
checked for an overflow after invoking methods that may result in an overflow i.e.
the destructor checks that MarkedArgumentBuffer::hasOverflowed() has been called.
This is only done on debug builds.

* API/JSObjectRef.cpp:
(JSObjectMakeFunction):
(JSObjectMakeArray):
(JSObjectMakeDate):
(JSObjectMakeRegExp):
(JSObjectCallAsFunction):
(JSObjectCallAsConstructor):
* dfg/DFGOperations.cpp:
* inspector/InjectedScriptManager.cpp:
(Inspector::InjectedScriptManager::createInjectedScript):
* inspector/JSJavaScriptCallFrame.cpp:
(Inspector::JSJavaScriptCallFrame::scopeChain const):
* interpreter/Interpreter.cpp:
(JSC::Interpreter::executeProgram):
* jsc.cpp:
(functionDollarAgentReceiveBroadcast):
* runtime/ArgList.cpp:
(JSC::MarkedArgumentBuffer::slowEnsureCapacity):
(JSC::MarkedArgumentBuffer::expandCapacity):
(JSC::MarkedArgumentBuffer::slowAppend):
* runtime/ArgList.h:
(JSC::MarkedArgumentBuffer::~MarkedArgumentBuffer):
(JSC::MarkedArgumentBuffer::appendWithAction):
(JSC::MarkedArgumentBuffer::append):
(JSC::MarkedArgumentBuffer::appendWithCrashOnOverflow):
(JSC::MarkedArgumentBuffer::hasOverflowed):
(JSC::MarkedArgumentBuffer::setNeedsOverflowCheck):
(JSC::MarkedArgumentBuffer::clearNeedsOverflowCheck):
* runtime/ArrayPrototype.cpp:
* runtime/CommonSlowPaths.cpp:
(JSC::SLOW_PATH_DECL):
* runtime/GetterSetter.cpp:
(JSC::callSetter):
* runtime/IteratorOperations.cpp:
(JSC::iteratorNext):
(JSC::iteratorClose):
* runtime/JSBoundFunction.cpp:
(JSC::boundThisNoArgsFunctionCall):
(JSC::boundFunctionCall):
(JSC::boundThisNoArgsFunctionConstruct):
(JSC::boundFunctionConstruct):
* runtime/JSGenericTypedArrayViewConstructorInlines.h:
(JSC::constructGenericTypedArrayViewFromIterator):
* runtime/JSGenericTypedArrayViewPrototypeFunctions.h:
(JSC::genericTypedArrayViewProtoFuncSlice):
(JSC::genericTypedArrayViewPrivateFuncSubarrayCreate):
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::haveABadTime):
* runtime/JSInternalPromise.cpp:
(JSC::JSInternalPromise::then):
* runtime/JSJob.cpp:
(JSC::JSJobMicrotask::run):
* runtime/JSMapIterator.cpp:
(JSC::JSMapIterator::createPair):
* runtime/JSModuleLoader.cpp:
(JSC::JSModuleLoader::provideFetch):
(JSC::JSModuleLoader::loadAndEvaluateModule):
(JSC::JSModuleLoader::loadModule):
(JSC::JSModuleLoader::linkAndEvaluateModule):
(JSC::JSModuleLoader::requestImportModule):
* runtime/JSONObject.cpp:
(JSC::Stringifier::toJSONImpl):
(JSC::Stringifier::appendStringifiedValue):
(JSC::Walker::callReviver):
* runtime/JSObject.cpp:
(JSC::ordinarySetSlow):
(JSC::callToPrimitiveFunction):
(JSC::JSObject::hasInstance):
* runtime/JSPromise.cpp:
(JSC::JSPromise::initialize):
(JSC::JSPromise::resolve):
* runtime/JSPromiseDeferred.cpp:
(JSC::newPromiseCapability):
(JSC::callFunction):
* runtime/JSSetIterator.cpp:
(JSC::JSSetIterator::createPair):
* runtime/LiteralParser.cpp:
(JSC::LiteralParser<CharType>::parse):
* runtime/MapConstructor.cpp:
(JSC::constructMap):
* runtime/ObjectConstructor.cpp:
(JSC::defineProperties):
* runtime/ProxyObject.cpp:
(JSC::performProxyGet):
(JSC::ProxyObject::performInternalMethodGetOwnProperty):
(JSC::ProxyObject::performHasProperty):
(JSC::ProxyObject::performPut):
(JSC::performProxyCall):
(JSC::performProxyConstruct):
(JSC::ProxyObject::performDelete):
(JSC::ProxyObject::performPreventExtensions):
(JSC::ProxyObject::performIsExtensible):
(JSC::ProxyObject::performDefineOwnProperty):
(JSC::ProxyObject::performGetOwnPropertyNames):
(JSC::ProxyObject::performSetPrototype):
(JSC::ProxyObject::performGetPrototype):
* runtime/ReflectObject.cpp:
(JSC::reflectObjectConstruct):
* runtime/SetConstructor.cpp:
(JSC::constructSet):
* runtime/StringPrototype.cpp:
(JSC::replaceUsingRegExpSearch):
(JSC::replaceUsingStringSearch):
* runtime/WeakMapConstructor.cpp:
(JSC::constructWeakMap):
* runtime/WeakSetConstructor.cpp:
(JSC::constructWeakSet):
* wasm/js/WasmToJS.cpp:
(JSC::Wasm::wasmToJS):

Source/WebCore:

No new tests.  The test for overflowing a MarkedArgumentBuffer will run for a
ridiculously long time, which renders it unsuitable for automated tests.

* Modules/plugins/QuickTimePluginReplacement.mm:
(WebCore::QuickTimePluginReplacement::installReplacement):
* bindings/js/JSCustomElementInterface.cpp:
(WebCore::constructCustomElementSynchronously):
(WebCore::JSCustomElementInterface::upgradeElement):
(WebCore::JSCustomElementInterface::invokeCallback):
* bindings/js/JSCustomXPathNSResolver.cpp:
(WebCore::JSCustomXPathNSResolver::lookupNamespaceURI):
* bindings/js/JSDOMBuiltinConstructorBase.cpp:
(WebCore::JSDOMBuiltinConstructorBase::callFunctionWithCurrentArguments):
* bindings/js/JSDOMConvertSequences.h:
(WebCore::JSConverter<IDLSequence<T>>::convert):
(WebCore::JSConverter<IDLFrozenArray<T>>::convert):
* bindings/js/JSDOMConvertWebGL.cpp:
(WebCore::convertToJSValue):
* bindings/js/JSDOMIterator.h:
(WebCore::jsPair):
(WebCore::iteratorForEach):
* bindings/js/JSDOMMapLike.cpp:
(WebCore::forwardFunctionCallToBackingMap):
(WebCore::forwardForEachCallToBackingMap):
* bindings/js/JSDOMPromiseDeferred.cpp:
(WebCore::DeferredPromise::callFunction):
(WebCore::createRejectedPromiseWithTypeError):
* bindings/js/JSErrorHandler.cpp:
(WebCore::JSErrorHandler::handleEvent):
* bindings/js/JSEventListener.cpp:
(WebCore::JSEventListener::handleEvent):
* bindings/js/JSLazyEventListener.cpp:
(WebCore::JSLazyEventListener::initializeJSFunction const):
* bindings/js/JSPluginElementFunctions.cpp:
(WebCore::callPlugin):
* bindings/js/JSReadableStreamPrivateConstructors.cpp:
(WebCore::constructJSReadableStreamReaderGeneric):
* bindings/js/ReadableStream.cpp:
(WebCore::ReadableStream::create):
(WebCore::ReadableStream::pipeTo):
(WebCore::ReadableStream::tee):
(WebCore::ReadableStream::lock):
(WebCore::checkReadableStream):
* bindings/js/ReadableStreamDefaultController.cpp:
(WebCore::ReadableStreamDefaultController::invoke):
* bindings/js/ScheduledAction.cpp:
(WebCore::ScheduledAction::executeFunctionInContext):
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneSerializer::recordObject):
(WebCore::CloneSerializer::serialize):
(WebCore::CloneDeserializer::readTerminal):
(WebCore::CloneDeserializer::deserialize):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateCallbackImplementationContent):
* bindings/scripts/test/JS/JSTestCallbackFunction.cpp:
(WebCore::JSTestCallbackFunction::handleEvent):
* bindings/scripts/test/JS/JSTestCallbackFunctionRethrow.cpp:
(WebCore::JSTestCallbackFunctionRethrow::handleEvent):
* bindings/scripts/test/JS/JSTestCallbackFunctionWithThisObject.cpp:
(WebCore::JSTestCallbackFunctionWithThisObject::handleEvent):
* bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.cpp:
(WebCore::JSTestCallbackFunctionWithTypedefs::handleEvent):
* bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
(WebCore::JSTestCallbackInterface::callbackWithNoParam):
(WebCore::JSTestCallbackInterface::callbackWithArrayParam):
(WebCore::JSTestCallbackInterface::callbackWithSerializedScriptValueParam):
(WebCore::JSTestCallbackInterface::callbackWithStringList):
(WebCore::JSTestCallbackInterface::callbackWithBoolean):
(WebCore::JSTestCallbackInterface::callbackRequiresThisToPass):
(WebCore::JSTestCallbackInterface::callbackWithAReturnValue):
(WebCore::JSTestCallbackInterface::callbackThatRethrowsExceptions):
(WebCore::JSTestCallbackInterface::callbackThatSkipsInvokeCheck):
(WebCore::JSTestCallbackInterface::callbackWithThisObject):
* bindings/scripts/test/JS/JSTestVoidCallbackFunction.cpp:
(WebCore::JSTestVoidCallbackFunction::handleEvent):
* bridge/NP_jsobject.cpp:
* bridge/objc/WebScriptObject.mm:
(-[WebScriptObject callWebScriptMethod:withArguments:]):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::updateCaptionContainer):
(WebCore::HTMLMediaElement::didAddUserAgentShadowRoot):
(WebCore::HTMLMediaElement::updateMediaControlsAfterPresentationModeChange):
(WebCore::HTMLMediaElement::getCurrentMediaControlsStatus):
* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::didAddUserAgentShadowRoot):
* testing/Internals.cpp:
(WebCore::Internals::cloneArrayBuffer):

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

2 years ago[Apple Pay] Update the enum traits for PaymentError::ContactField
aestes@apple.com [Thu, 2 Nov 2017 00:16:10 +0000 (00:16 +0000)]
[Apple Pay] Update the enum traits for PaymentError::ContactField
https://bugs.webkit.org/show_bug.cgi?id=179145
<rdar://problem/35303108>

Reviewed by Tim Horton.

Account for the values added to PaymentError::ContactField in r220718 and r223580.

* Modules/applepay/ApplePaySessionPaymentRequest.h:

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

2 years agoRemove unused Element::alwaysCreateUserAgentShadowRoot()
dbates@webkit.org [Wed, 1 Nov 2017 23:32:14 +0000 (23:32 +0000)]
Remove unused Element::alwaysCreateUserAgentShadowRoot()
https://bugs.webkit.org/show_bug.cgi?id=179141

Reviewed by Ryosuke Niwa.

In changeset r208135 Element::createShadowRoot() was removed. And Element::createShadowRoot()
was the only caller of Element::alwaysCreateUserAgentShadowRoot(). We should remove
Element::alwaysCreateUserAgentShadowRoot() as it is unused.

* dom/Element.h:
(WebCore::Element::didAddUserAgentShadowRoot):
(WebCore::Element::alwaysCreateUserAgentShadowRoot const): Deleted.
* html/HTMLButtonElement.h:
* html/HTMLFormControlElement.h:
* html/HTMLMediaElement.h:

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

2 years agoDrop running Service Worker Jobs on a background thread
cdumez@apple.com [Wed, 1 Nov 2017 23:24:31 +0000 (23:24 +0000)]
Drop running Service Worker Jobs on a background thread
https://bugs.webkit.org/show_bug.cgi?id=179142

Reviewed by Youenn Fablet.

Drop running Service Worker Jobs on a background thread. We don't really need to
and this simplifies the logic a lot.

* workers/service/server/SWServer.cpp:
(WebCore::SWServer::getRegistration):
(WebCore::SWServer::addRegistration):
(WebCore::SWServer::removeRegistration):
* workers/service/server/SWServerJobQueue.cpp:
(WebCore::SWServerJobQueue::scriptContextStarted):
(WebCore::SWServerJobQueue::startNextJob):
(WebCore::SWServerJobQueue::runRegisterJob):
(WebCore::SWServerJobQueue::runUnregisterJob):
(WebCore::SWServerJobQueue::runUpdateJob):
(WebCore::SWServerJobQueue::finishCurrentJob):
* workers/service/server/SWServerJobQueue.h:

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

2 years agoUnreviewed, try to fix Windows build.
pvollan@apple.com [Wed, 1 Nov 2017 23:11:41 +0000 (23:11 +0000)]
Unreviewed, try to fix Windows build.

* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
(WebCore::MediaPlayerPrivateAVFoundationCF::createAVAssetForURL):

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

2 years agoMark media loading tests as only flaky on Sierra.
achristensen@apple.com [Wed, 1 Nov 2017 23:04:34 +0000 (23:04 +0000)]
Mark media loading tests as only flaky on Sierra.
https://bugs.webkit.org/show_bug.cgi?id=178272

* platform/mac-wk1/TestExpectations:
In r224267 I marked a bunch of tests as flaky on WebKit1.
They are media-related tests, and they are only failing on Sierra WK1,
so mark them as such so we will notice regressions in new operating systems.

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

2 years agoWeb Inspector: Improve UX of Layers tab visualization
ross.kirsling@sony.com [Wed, 1 Nov 2017 22:47:14 +0000 (22:47 +0000)]
Web Inspector: Improve UX of Layers tab visualization
https://bugs.webkit.org/show_bug.cgi?id=178966

Reviewed by Devin Rousso.

* UserInterface/Views/Layers3DContentView.js:
(WI.Layers3DContentView):
(WI.Layers3DContentView.prototype.initialLayout):
(WI.Layers3DContentView.prototype._canvasMouseDown):
(WI.Layers3DContentView.prototype._createLayerGroup): Renamed from _addLayerGroup.
(WI.Layers3DContentView.prototype._updateLayerGroupPosition): Merged into _updateLayers.
Set up zoom and pan.

(WI.Layers3DContentView.prototype._animate):
(WI.Layers3DContentView.prototype._restrictPan):
Restrict pan to bounding box on XY plane.

(WI.Layers3DContentView.prototype.layout):
(WI.Layers3DContentView.prototype._updateDocument):
(WI.Layers3DContentView.prototype._resetCamera):
On new document, throw out all old layers and center the camera on the new document layer.

(WI.Layers3DContentView.prototype.selectLayerById):
(WI.Layers3DContentView.prototype._centerOnSelection):
Recenter the camera when layer group selection is updated programmatically.

(WI.Layers3DContentView.prototype._updateLayers):
(WI.Layers3DContentView.prototype._createLayerMesh):
Fix visual artifact due to "depthWrite" flag.

* UserInterface/Views/LayerDetailsSidebarPanel.js:
(WI.LayerDetailsSidebarPanel.prototype.selectNodeByLayerId):
Suppress selection update event when the data grid selection is updated programmatically.

* UserInterface/Views/DataGridNode.js:
(WI.DataGridNode.prototype.revealAndSelect):
Allow forwarding of select()'s parameter.

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

2 years agoInteger overflow in code generated by LoadVarargs processing in DFG and FTL.
msaboff@apple.com [Wed, 1 Nov 2017 22:35:56 +0000 (22:35 +0000)]
Integer overflow in code generated by LoadVarargs processing in DFG and FTL.
https://bugs.webkit.org/show_bug.cgi?id=179140

Reviewed by Saam Barati.

JSTests:

New regression test.

* stress/regress-179140.js: Added.
(testWithoutFTL):
(testWithFTL):

Source/JavaScriptCore:

Added overflow checks to computation of arg count plus this.

* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileLoadVarargs):

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

2 years agoSplit JobQueue logic out of SWServerRegistration
cdumez@apple.com [Wed, 1 Nov 2017 22:32:42 +0000 (22:32 +0000)]
Split JobQueue logic out of SWServerRegistration
https://bugs.webkit.org/show_bug.cgi?id=179126

Reviewed by Brady Eidson.

Split JobQueue logic out of SWServerRegistration and into a SWServerJobQueue class to match the Service Workers
specification more closely.

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
* workers/service/ServiceWorkerRegistrationData.cpp:
(WebCore::ServiceWorkerRegistrationData::isolatedCopy const):
* workers/service/ServiceWorkerRegistrationData.h:
(WebCore::ServiceWorkerRegistrationData::encode const):
(WebCore::ServiceWorkerRegistrationData::decode):
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::~SWServer):
(WebCore::SWServer::getRegistration):
(WebCore::SWServer::addRegistration):
(WebCore::SWServer::removeRegistration):
(WebCore::SWServer::Connection::scriptContextStarted):
(WebCore::SWServer::scheduleJob):
(WebCore::SWServer::scriptFetchFinished):
(WebCore::SWServer::scriptContextFailedToStart):
(WebCore::SWServer::scriptContextStarted):
* workers/service/server/SWServer.h:
* workers/service/server/SWServerJobQueue.cpp: Added.
(WebCore::SWServerJobQueue::SWServerJobQueue):
(WebCore::SWServerJobQueue::~SWServerJobQueue):
(WebCore::SWServerJobQueue::enqueueJob):
(WebCore::SWServerJobQueue::scriptFetchFinished):
(WebCore::SWServerJobQueue::scriptContextFailedToStart):
(WebCore::SWServerJobQueue::scriptContextStarted):
(WebCore::SWServerJobQueue::startNextJob):
(WebCore::SWServerJobQueue::runRegisterJob):
(WebCore::SWServerJobQueue::runUnregisterJob):
(WebCore::SWServerJobQueue::runUpdateJob):
(WebCore::SWServerJobQueue::rejectWithExceptionOnMainThread):
(WebCore::SWServerJobQueue::resolveWithRegistrationOnMainThread):
(WebCore::SWServerJobQueue::resolveCurrentRegistrationJobOnMainThead):
(WebCore::SWServerJobQueue::resolveWithUnregistrationResultOnMainThread):
(WebCore::SWServerJobQueue::startScriptFetchFromMainThread):
(WebCore::SWServerJobQueue::rejectCurrentJob):
(WebCore::SWServerJobQueue::resolveCurrentRegistrationJob):
(WebCore::SWServerJobQueue::resolveCurrentUnregistrationJob):
(WebCore::SWServerJobQueue::startScriptFetchForCurrentJob):
(WebCore::SWServerJobQueue::finishCurrentJob):
* workers/service/server/SWServerJobQueue.h: Added.
* workers/service/server/SWServerRegistration.cpp:
(WebCore::SWServerRegistration::SWServerRegistration):
(WebCore::SWServerRegistration::~SWServerRegistration):
(WebCore::SWServerRegistration::data const):
* workers/service/server/SWServerRegistration.h:
(WebCore::SWServerRegistration::key const):
(WebCore::SWServerRegistration::isUninstalling const):
(WebCore::SWServerRegistration::setIsUninstalling):
(WebCore::SWServerRegistration::setLastUpdateTime):
(WebCore::SWServerRegistration::updateViaCache const):
(WebCore::SWServerRegistration::setActiveServiceWorkerIdentifier):

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

2 years agoXMLHttpRequest should not sniff content encoding
dbates@webkit.org [Wed, 1 Nov 2017 22:23:41 +0000 (22:23 +0000)]
XMLHttpRequest should not sniff content encoding
https://bugs.webkit.org/show_bug.cgi?id=175597
<rdar://problem/34912624>

Reviewed by Alex Christensen.

Source/WebCore:

Fixes an issue where the body of an HTTP response associated with an XHR request to a .gz file
would be automatically gzipped decompressed if the HTTP response omitted a Content-Encoding HTTP
header. Specifically, such a response would be treated analogous to a response with headers
"Content-Type: application/gzip" and "Content-Encoding: identity". This behavior does not conform
the HTTP 1.1 spec. and breaks Epic Zen Garden, <https://s3.amazonaws.com/mozilla-games/ZenGarden/EpicZenGarden.html>.

On macOS 10.13.2 opt out of content encoding sniffing when making an XHR request. We likely can
selectively opt out of content encoding sniffing for other network requests. This will be done
in subsequent commits to make it straightforward to identify site breakage (if any).

* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::start): Pass content encoding policy.
* loader/ResourceLoader.h:
(WebCore::ResourceLoader::shouldSniffContentEncoding const): Added.
* loader/ResourceLoaderOptions.h:
* loader/appcache/ApplicationCacheGroup.cpp:
(WebCore::ApplicationCacheGroup::createResourceHandle): Enable content encoding sniff to match existing behavior.
* platform/network/BlobResourceHandle.cpp:
(WebCore::BlobResourceHandle::BlobResourceHandle): Ditto. We should look to disable content encoding sniffing in
a subsequent change.
* platform/network/PingHandle.h: Ditto.
* platform/network/ResourceHandle.cpp:
(WebCore::ResourceHandle::ResourceHandle): Modified to take a boolean as to whether to enable content encoding sniffing.
(WebCore::ResourceHandle::create): Ditto.
(WebCore::ResourceHandle::shouldContentEncodingSniff const): Added.
* platform/network/ResourceHandle.h:
* platform/network/ResourceHandleInternal.h:
(WebCore::ResourceHandleInternal::ResourceHandleInternal): Modified to take a boolean as to whether to enable content
encoding sniffing.
* platform/network/cf/ResourceHandleCFNet.cpp:
(WebCore::ResourceHandle::createCFURLConnection): Modified to take a boolean as to whether to enable content encoding
sniffing and apply this policy to the CFMutableURLRequestRef object when building on macOS 10.13.2.
(WebCore::ResourceHandle::start):
(WebCore::ResourceHandle::platformLoadResourceSynchronously): Enable content encoding sniff to match existing behavior.
* platform/network/mac/ResourceHandleMac.mm:
(WebCore::ResourceHandle::applySniffingPoliciesAndStoragePartitionIfNeeded): Added helper function to apply sniffing policies
and storage partition, if applicable.
(WebCore::ResourceHandle::createNSURLConnection): Modified to take a boolean as to whether to enable content encoding
sniffing. Calls adjustNSRequestApplyingPolicies() to apply this policy.
(WebCore::ResourceHandle::start):
(WebCore::ResourceHandle::platformLoadResourceSynchronously): Enable content encoding sniff to match existing behavior.
* platform/network/soup/ResourceHandleSoup.cpp:
(WebCore::ResourceHandle::create): Modified to take a boolean as to whether to enable content encoding sniffing.
(WebCore::ResourceHandle::ResourceHandle): Ditto.
(WebCore::ResourceHandle::releaseForDownload): Pass content encoding policy.
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::createRequest): Do not enable content encoding sniffing for the request.

Source/WebCore/PAL:

Forward declare CFNetwork SPI.

* pal/spi/cf/CFNetworkSPI.h:

Source/WebKit:

Fixes an issue where the body of an HTTP response associated with an XHR request to a .gz file
would be automatically gzipped decompressed if the HTTP response omitted a Content-Encoding HTTP
header. Specifically, such a response would be treated analogous to a response with headers
"Content-Type: application/gzip" and "Content-Encoding: identity". This behavior does not conform
the HTTP 1.1 spec. and breaks Epic Zen Garden, <https://s3.amazonaws.com/mozilla-games/ZenGarden/EpicZenGarden.html>.

On macOS 10.13.2 opt out of content encoding sniffing when making an XHR request. We likely can
selectively opt out of content encoding sniffing for other network requests. This will be done
in subsequent commits to make it straightforward to identify site breakage (if any).

* NetworkProcess/Downloads/Download.cpp:
(WebKit::Download::start): Enable content encoding sniff to match existing behavior.
(WebKit::Download::startWithHandle): Ditto.
* NetworkProcess/NetworkDataTask.cpp:
(WebKit::NetworkDataTask::create): Pass through the content encoding sniffing policy.
* NetworkProcess/NetworkLoad.cpp:
(WebKit::NetworkLoad::NetworkLoad): Ditto.
* NetworkProcess/NetworkLoadParameters.h:
* NetworkProcess/NetworkResourceLoadParameters.cpp:
(WebKit::NetworkResourceLoadParameters::encode const): Encode content encoding sniffing policy.
(WebKit::NetworkResourceLoadParameters::decode): Decode content encoding sniffing policy.
* NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
(WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad): Enable content encoding sniff to match existing
behavior. We should look to disable content encoding sniffing in a subsequent change.
* NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::applySniffingPoliciesAndBindRequestToInferfaceIfNeeded): Added helper function
to apply sniffing policies and bind request to interface, if applicable.
(WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa): Modified to take the content encoding sniffing
policy. Calls applySniffingPoliciesAndBindRequestToInferfaceIfNeeded() to apply this policy. Also use
convenience function URL::isLocalFile() to determine if the URL is a file URL.
* NetworkProcess/soup/NetworkDataTaskSoup.cpp:
(WebKit::NetworkDataTaskSoup::NetworkDataTaskSoup): Pass through the content encoding sniffing policy.
* NetworkProcess/soup/NetworkDataTaskSoup.h:
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess): Pass through the content encoding sniffing policy.
(WebKit::WebLoaderStrategy::loadResourceSynchronously): Enable content encoding sniff to match existing
behavior.

LayoutTests:

Fix up the test http/tests/xmlhttprequest/gzip-content-type-no-content-encoding.html to
actually check that we do not sniff content encoding. CFNetwork only sniffs the URL
for the content encoding when the filename ends with known file extension (e.g. .gz)
and the HTTP response does not specifying a Content-Encoding HTTP header.

* TestExpectations: Skip the test on all platforms. Once <rdar://problem/33822249> ships
then we will enable the test on all platforms that use CFNetwork.
* http/tests/xmlhttprequest/gzip-content-type-no-content-encoding-expected.txt:
* http/tests/xmlhttprequest/gzip-content-type-no-content-encoding.html:
* http/tests/xmlhttprequest/resources/.htaccess: Interpret files with .php.gz extension as PHP files.
* http/tests/xmlhttprequest/resources/gzip-lorem-no-content-encoding.php.gz: Renamed from LayoutTests/http/tests/xmlhttprequest/resources/gzip-lorem-no-content-encoding.php.
* platform/mac/TestExpectations: Mark the test as flaky (Pass Failure) until <rdar://problem/33822249> ships.

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

2 years ago[Performance] Painting <video> to canvas spends a lot of time in URL getting and...
jer.noble@apple.com [Wed, 1 Nov 2017 21:41:59 +0000 (21:41 +0000)]
[Performance] Painting <video> to canvas spends a lot of time in URL getting and parsing
https://bugs.webkit.org/show_bug.cgi?id=179131

Reviewed by Eric Carlson.

Every time a <video> backed by MediaPlayerPrivateAVFoundation is asked to paint, it is first
queried whether it has a single security origin. To do this, the media player asks
AVFoundation what the "resolvedURL" of the asset is. This answer never changes after
metadata is first fetched, so the answer should be cached. To do so, add a m_resolvedURL
ivar to MediaPlayerPrivateAVFoundation, and add a setResolvedURL() and resolvedURLChanged()
method to re-query the value. Also create ivars for the security origin rather than re-
parsing them every time.

Drive-by fix: clean up all the instances where we pass a String rather than a URL (and thus
have to re-parse the URL at each point).

* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
(WebCore::MediaPlayerPrivateAVFoundation::load):
(WebCore::MediaPlayerPrivateAVFoundation::hasSingleSecurityOrigin const):
(WebCore::MediaPlayerPrivateAVFoundation::setResolvedURL):
(WebCore::MediaPlayerPrivateAVFoundation::metadataLoaded):
(WebCore::MediaPlayerPrivateAVFoundation::setPreload):
(WebCore::MediaPlayerPrivateAVFoundation::resolvedURL const): Deleted.
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
(WebCore::MediaPlayerPrivateAVFoundation::resolvedURL const):
* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
(WebCore::MediaPlayerPrivateAVFoundationCF::resolvedURLChanged):
(WebCore::AVFWrapper::createAssetForURL):
(WebCore::MediaPlayerPrivateAVFoundationCF::resolvedURL const): Deleted.
(WebCore::MediaPlayerPrivateAVFoundationCF::hasSingleSecurityOrigin const): Deleted.
* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::canonicalURL):
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL):
(WebCore::MediaPlayerPrivateAVFoundationObjC::sizeChanged):
(WebCore::canonicalURL):
(WebCore::MediaPlayerPrivateAVFoundationObjC::hasSingleSecurityOrigin const): Deleted.

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

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

Reviewed by Antti Koivisto.

Added a missing null check.

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

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

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

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

Reviewed by Chris Dumez.

Source/WebCore:

No new tests (Currently no observable behavior change).

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

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

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

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

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

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

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

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

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

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

Source/WebKit:

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

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

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

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

* TestExpectations:

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

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

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

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

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

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

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

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

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

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

Reviewed by Simon Fraser.

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

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

No new tests since there should be no behavioral change other

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

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

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

Reviewed by Wenson Hsieh.

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

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

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

Reviewed by Geoffrey Garen.

LayoutTests/imported/w3c:

Rebaseline WPT tests.

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

Source/WebCore:

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

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

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

No new tests, rebaselined existing tests.

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

LayoutTests:

Update / rebaseline existing test.

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

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

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

Reviewed by Devin Rousso.

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

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

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

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

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

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

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

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

Source/WebKit:

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

Tools:

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

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

LayoutTests:

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

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

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

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

Reviewed by Sam Weinig.

LayoutTests/imported/w3c:

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

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

Source/WebCore:

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

Update an existing WPT result.

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

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

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

Unreviewed test gardening.

* platform/win/TestExpectations:

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

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

Reviewed by Darin Adler.

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

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

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

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

Reviewed by Saam Barati.

JSTests:

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

Source/JavaScriptCore:

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

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

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

with

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

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

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

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

Source/WebCore:

Use @isObject instead. It is more efficient.

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

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

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

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

Reverted changesets:

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

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

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

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

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

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

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

No new tests (no behaviour change).

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

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

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

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

Source/JavaScriptCore:

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

Source/WebCore:

No new tests since there should be no behavioral change.

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

Source/WTF:

DEFINE_GLOBAL is not used anymore. Remove it.

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

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

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

Reviewed by Saam Barati.

JSTests:

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

Source/JavaScriptCore:

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

This patch's StringSlice node optimizes the following things.

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

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

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

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

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

* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGBackwardsPropagationPhase.cpp:
(JSC::DFG::BackwardsPropagationPhase::propagate):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleIntrinsicCall):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGNodeType.h:
* dfg/DFGOperations.cpp:
* dfg/DFGOperations.h:
* dfg/DFGPredictionPropagationPhase.cpp:
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileStringSlice):
(JSC::DFG::SpeculativeJIT::emitPopulateSliceIndex):
(JSC::DFG::SpeculativeJIT::compileArraySlice):
(JSC::DFG::SpeculativeJIT::compileArrayIndexOf):
* dfg/DFGSpeculativeJIT.h:
(JSC::DFG::SpeculativeJIT::callOperation):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileNode):
(JSC::FTL::DFG::LowerDFGToB3::populateSliceRange):
(JSC::FTL::DFG::LowerDFGToB3::compileArraySlice):
(JSC::FTL::DFG::LowerDFGToB3::compileStringSlice):
* jit/JITOperations.h:
* runtime/Intrinsic.cpp:
(JSC::intrinsicName):
* runtime/Intrinsic.h:
* runtime/StringPrototype.cpp:
(JSC::StringPrototype::finishCreation):

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

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

Reviewed by Carlos Garcia Campos.

* PlatformGTK.cmake:

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

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

Reviewed by Sam Weinig.

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

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

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

Reviewed by Geoff Garen.

Source/WebCore:

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

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

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

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

(WebCore::RenderBlock::dropAnonymousBoxChild):

    Make a member function.

(WebCore::RenderBlock::takeChild):

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

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

    Track continuations with double linked lists.

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

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

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

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

(WebCore::RenderElement::styleDidChange):

    removeAnonymousWrappersForInlinesIfNecessary is no function of the parent.

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

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

(WebCore::RenderInline::addChildIgnoringContinuation):

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

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

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

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

    Allow anonymous continuations as destroy roots.

(WebCore::RenderObject::removeFromParentAndDestroyCleaningUpAnonymousWrappers):

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

LayoutTests:

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

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

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

Reviewed by Michael Saboff.

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

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

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

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

Reviewed by Sam Weinig.

LayoutTests/imported/w3c:

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

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

LayoutTests:

Unskip the 2 tests.

* TestExpectations:

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

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

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

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

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

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

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

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

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

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

Reviewed by Joseph Pecoraro.

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

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

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

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

Reviewed by Brady Eidson.

Source/WebCore:

Covered by existing tests.

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

Source/WebKitLegacy:

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

Tools:

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

LayoutTests:

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

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

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

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

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

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

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

Reverted changeset:

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

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

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

Reviewed by Sam Weinig.

Source/WebCore:

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

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

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

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

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

LayoutTests:

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

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

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

Unreviewed test gardening.

* TestExpectations:

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

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

Reviewed by Simon Fraser.

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore/PAL:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit:

* Configurations/FeatureDefines.xcconfig:

Source/WebKitLegacy/mac:

* Configurations/FeatureDefines.xcconfig:

Tools:

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

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

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

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

* TestExpectations: Marking test as flaky.

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

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

Unreviewed test gardening.

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

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

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

Reviewed by Sam Weinig.

Source/WebCore:

Test: fast/scrolling/unconstrained-scrollto.html

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

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

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

Source/WebKitLegacy/mac:

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

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

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

LayoutTests:

Test that internals.unconstrainedScrollTo() works.

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

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