WebKit-https.git
2 years agoThe test imported/w3c/web-platform-tests/cors/allow-headers.htm is slow on Windows.
pvollan@apple.com [Fri, 28 Jul 2017 17:28:05 +0000 (17:28 +0000)]
The test imported/w3c/web-platform-tests/cors/allow-headers.htm is slow on Windows.

Unreviewed test gardening, mark test as slow.

* platform/win/TestExpectations:

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

2 years agoWeb Inspector: Cleanup unused/invalid parameters for TreeElements
drousso@apple.com [Fri, 28 Jul 2017 17:27:43 +0000 (17:27 +0000)]
Web Inspector: Cleanup unused/invalid parameters for TreeElements
https://bugs.webkit.org/show_bug.cgi?id=173987

Reviewed by Brian Burg.

* UserInterface/Views/TreeElement.js:
* UserInterface/Views/GeneralTreeElement.js:

* UserInterface/Views/ApplicationCacheFrameTreeElement.js:
* UserInterface/Views/BreakpointTreeElement.js:
* UserInterface/Views/CSSStyleSheetTreeElement.js:
* UserInterface/Views/CallFrameTreeElement.js:
* UserInterface/Views/ContentFlowTreeElement.js:
* UserInterface/Views/DOMNodeTreeElement.js:
* UserInterface/Views/DatabaseTableTreeElement.js:
* UserInterface/Views/DatabaseTreeElement.js:
* UserInterface/Views/FolderTreeElement.js:
* UserInterface/Views/FolderizedTreeElement.js:
* UserInterface/Views/FrameTreeElement.js:
* UserInterface/Views/IndexedDatabaseObjectStoreIndexTreeElement.js:
* UserInterface/Views/IndexedDatabaseObjectStoreTreeElement.js:
* UserInterface/Views/IndexedDatabaseTreeElement.js:
* UserInterface/Views/IssueTreeElement.js:
* UserInterface/Views/ObjectTreeBaseTreeElement.js:
* UserInterface/Views/ProfileNodeTreeElement.js:
* UserInterface/Views/ResourceTreeElement.js:
* UserInterface/Views/ScriptTreeElement.js:
* UserInterface/Views/SearchResultTreeElement.js:
* UserInterface/Views/SourceCodeTreeElement.js:
* UserInterface/Views/SourceMapResourceTreeElement.js:
* UserInterface/Views/StorageTreeElement.js:
* UserInterface/Views/TimelineRecordTreeElement.js:
* UserInterface/Views/TypeTreeElement.js:

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

2 years agoREGRESSION(r216944): Fallback fonts erroneously visible when the primary font is...
mmaxfield@apple.com [Fri, 28 Jul 2017 17:06:29 +0000 (17:06 +0000)]
REGRESSION(r216944): Fallback fonts erroneously visible when the primary font is loading
https://bugs.webkit.org/show_bug.cgi?id=174772
<rdar://problem/33267643>

Reviewed by Simon Fraser.

Source/WebCore:

During a font load, we try pretty hard to find a font to use that isn't the
last resort font (which happens to be Times). We do this by iterating through
all the fonts in the font-family list, as well as through all the relevant
@font-face blocks which share the requested font family name.

Unfortunately, if we find one of these fallback fonts, we were simply using it
directly, which means that it was being drawn as visible (because the
visibility setting lives inside the Font object). Instead, we should carry the
invisibility setting from the interstitial font to this used fallback font.

This patch is an extension of r219221, which fixed the problem only for system
fallback fonts. This patch adopts the same methodology to all fallback fonts.

Test: http/tests/webfont/font-loading-system-fallback-visibility-FontRanges.html

* platform/graphics/FontCascadeFonts.cpp:
(WebCore::FontCascadeFonts::glyphDataForVariant):
(WebCore::glyphPageFromFontRanges):
* platform/graphics/FontRanges.cpp:
(WebCore::FontRanges::glyphDataForCharacter):

LayoutTests:

* http/tests/webfont/font-loading-system-fallback-visibility-FontRanges-expected.html: Added.
* http/tests/webfont/font-loading-system-fallback-visibility-FontRanges.html: Added.

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

2 years agoREGRESSION(r125147): Layout Test svg/dom/SVGScriptElement/script-change-externalResou...
pvollan@apple.com [Fri, 28 Jul 2017 16:52:35 +0000 (16:52 +0000)]
REGRESSION(r125147): Layout Test svg/dom/SVGScriptElement/script-change-externalResourcesRequired-while-loading.svg is failing
https://bugs.webkit.org/show_bug.cgi?id=93589

Unreviewed test gardening, this test is also a flaky timeout on Windows.

* platform/win/TestExpectations:

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

2 years agoFix typo in scrollPositionChangedViaDelegatedScrolling
fred.wang@free.fr [Fri, 28 Jul 2017 15:38:04 +0000 (15:38 +0000)]
Fix typo in scrollPositionChangedViaDelegatedScrolling
https://bugs.webkit.org/show_bug.cgi?id=174937

Patch by Frederic Wang <fwang@igalia.cpm> on 2017-07-28
Reviewed by Wenson Hsieh.

Source/WebCore:

No new tests, fix typo in the inUserInteraction parameter.

* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::scrollPositionChangedViaDelegatedScrolling):
* page/scrolling/ScrollingTree.h:

Source/WebKit:

* UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
* UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
(WebKit::ScrollingTreeOverflowScrollingNodeIOS::scrollViewDidScroll):

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

2 years ago[WPE] Implement EventSenderProxy in WTR
csaavedra@igalia.com [Fri, 28 Jul 2017 10:27:03 +0000 (10:27 +0000)]
[WPE] Implement EventSenderProxy in WTR
https://bugs.webkit.org/show_bug.cgi?id=173419

Reviewed by Žan Doberšek.

Add the implementation of EventSenderProxy to the WTR. This
allows us to extend the coverage of the test suite in WKWPE.

.:

* Source/cmake/FindLibxkbcommon.cmake: Added.

Tools:

* WebKitTestRunner/EventSenderProxy.h:
* WebKitTestRunner/PlatformWPE.cmake: Add dependency on
libxkbcommon needed to deal with key events.
* WebKitTestRunner/wpe/EventSenderProxyWPE.cpp:
(WTR::EventSenderProxy::EventSenderProxy):
(WTR::senderButtonToWPEButton):
(WTR::EventSenderProxy::mouseDown):
(WTR::EventSenderProxy::mouseUp):
(WTR::EventSenderProxy::mouseMoveTo):
(WTR::EventSenderProxy::mouseScrollBy):
(WTR::EventSenderProxy::mouseScrollByWithWheelAndMomentumPhases):
(WTR::EventSenderProxy::leapForward):
(WTR::wkEventModifiersToWPE):
(WTR::getXKBKeySymForKeyRef):
(WTR::EventSenderProxy::keyDown):
(WTR::EventSenderProxy::addTouchPoint):
(WTR::EventSenderProxy::updateTouchPoint):
(WTR::EventSenderProxy::setTouchModifier):
(WTR::EventSenderProxy::setTouchPointRadius):
(WTR::EventSenderProxy::getUpdatedTouchEvents):
(WTR::EventSenderProxy::removeUpdatedTouchEvents):
(WTR::EventSenderProxy::prepareAndDispatchTouchEvent):
(WTR::EventSenderProxy::touchStart):
(WTR::EventSenderProxy::touchMove):
(WTR::EventSenderProxy::touchEnd):
(WTR::EventSenderProxy::touchCancel):
(WTR::EventSenderProxy::clearTouchPoints):
(WTR::EventSenderProxy::releaseTouchPoint):
(WTR::EventSenderProxy::cancelTouchPoint):

LayoutTests:

* platform/wpe/TestExpectations: Unskip fast/events tests, marking failures
that are related to features not yet implemented in WPE. Also remove other
tests that are now passing thanks to having event injection.
* platform/wpe/fast/dom/HTMLTableColElement/resize-table-using-col-width-expected.txt: Update.
* platform/wpe/fast/dynamic/layer-hit-test-crash-expected.txt: Update.
* platform/wpe/fast/events/clientXY-in-zoom-and-scroll-expected.txt: Added.
* platform/wpe/ietestcenter/css3/bordersbackgrounds/background-attachment-local-scrolling-expected.txt: Update.

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

2 years agoUnreviewed. Bumping the patch version for WPEWebKit library to 20170728.
zandobersek@gmail.com [Fri, 28 Jul 2017 07:53:17 +0000 (07:53 +0000)]
Unreviewed. Bumping the patch version for WPEWebKit library to 20170728.

* Source/cmake/OptionsWPE.cmake:

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

2 years ago[iOS DnD] [WK1] Snapshots generated using -[DOMRange renderImageForcingBlackText...
wenson_hsieh@apple.com [Fri, 28 Jul 2017 07:31:06 +0000 (07:31 +0000)]
[iOS DnD] [WK1] Snapshots generated using -[DOMRange renderImageForcingBlackText:] are upside down
https://bugs.webkit.org/show_bug.cgi?id=174928
<rdar://problem/33584280>

Reviewed by Tim Horton.

Pulls the implementation of createDragImageForRange out into DragImageIOS, and use TextIndicator to generate a
snapshot instead of FrameSelection's snapshotting utilities. This makes snapshotting a DOMRange behave the same
way as snapshotting a dragged selection.

No way of testing TextIndicator-based snapshotting yet.

* platform/DragImage.cpp:

Guard createDragImageForRange for !PLATFORM(IOS).

* platform/ios/DragImageIOS.mm:
(WebCore::createDragImageForSelection):

Add a FIXME to point out that having an additional context flip inside the UIGraphicsImageRenderer block results
in an upside-down drag image being returned from createDragImageFromImage. This image is being flipped elsewhere
in drag initiation code, which eventually results in the correct orientation; we'll need further investigation
to remove this extraneous flip.

(WebCore::createDragImageForRange):

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

2 years agoASSERTION FAILED: candidate->op() == PhantomCreateRest || candidate->op() == PhantomD...
utatane.tea@gmail.com [Fri, 28 Jul 2017 07:25:57 +0000 (07:25 +0000)]
ASSERTION FAILED: candidate->op() == PhantomCreateRest || candidate->op() == PhantomDirectArguments || candidate->op() == PhantomClonedArguments || candidate->op() == PhantomSpread || candidate->op() == PhantomNewArrayWithSpread
https://bugs.webkit.org/show_bug.cgi?id=174900

Reviewed by Saam Barati.

JSTests:

* stress/arguments-elimination-candidate-listings-should-respect-pseudo-terminals.js: Added.
(sideEffect):
(args):
(test):

Source/JavaScriptCore:

In the arguments elimination phase, due to high cost of AI, we intentionally do not run AI.
Instead, we use ForceOSRExit etc. (pseudo terminals) not to look into unreachable nodes.
The problem is that even transforming phase also checks this pseudo terminals.

    BB1
    1: ForceOSRExit
    2: CreateDirectArguments

    BB2
    3: GetButterfly(@2)
    4: ForceOSRExit

In the above case, @2 is not converted to PhantomDirectArguments. But @3 is processed. And the assertion fires.

In this patch, we do not list candidates up after seeing pseudo terminals in basic blocks.

* dfg/DFGArgumentsEliminationPhase.cpp:

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

2 years agoRemove Web prefix from WebVideoFullscreen and WebPlaybackSession classes.
commit-queue@webkit.org [Fri, 28 Jul 2017 07:25:39 +0000 (07:25 +0000)]
Remove Web prefix from WebVideoFullscreen and WebPlaybackSession classes.
https://bugs.webkit.org/show_bug.cgi?id=174437

Patch by Jeremy Jones <jeremyj@apple.com> on 2017-07-28
Reviewed by Darin Adler.

Source/WebCore:

No new tests because no behavior change.

Remove redundant Web- prefix from classes in WebCore namespace.

* WebCore.xcodeproj/project.pbxproj:
* html/HTMLMediaElement.cpp:
* html/HTMLVideoElement.cpp:
* platform/cocoa/PlaybackSessionInterface.h: Renamed from Source/WebCore/platform/cocoa/WebPlaybackSessionInterface.h.
(WebCore::PlaybackSessionInterface::~PlaybackSessionInterface):
* platform/cocoa/PlaybackSessionModel.h: Renamed from Source/WebCore/platform/cocoa/WebPlaybackSessionModel.h.
(WebCore::PlaybackSessionModel::~PlaybackSessionModel):
(WebCore::PlaybackSessionModelClient::~PlaybackSessionModelClient):
(WebCore::PlaybackSessionModelClient::externalPlaybackChanged):
* platform/cocoa/PlaybackSessionModelMediaElement.h: Renamed from Source/WebCore/platform/cocoa/WebPlaybackSessionModelMediaElement.h.
* platform/cocoa/PlaybackSessionModelMediaElement.mm: Renamed from Source/WebCore/platform/cocoa/WebPlaybackSessionModelMediaElement.mm.
* platform/cocoa/VideoFullscreenChangeObserver.h: Renamed from Source/WebCore/platform/cocoa/WebVideoFullscreenChangeObserver.h.
(WebCore::VideoFullscreenChangeObserver::~VideoFullscreenChangeObserver):
* platform/cocoa/VideoFullscreenModel.h: Renamed from Source/WebCore/platform/cocoa/WebVideoFullscreenModel.h.
(WebCore::VideoFullscreenModel::~VideoFullscreenModel):
(WebCore::VideoFullscreenModelClient::~VideoFullscreenModelClient):
* platform/cocoa/VideoFullscreenModelVideoElement.h: Renamed from Source/WebCore/platform/cocoa/WebVideoFullscreenModelVideoElement.h.
(WebCore::VideoFullscreenModelVideoElement::create):
* platform/cocoa/VideoFullscreenModelVideoElement.mm: Renamed from Source/WebCore/platform/cocoa/WebVideoFullscreenModelVideoElement.mm.
* platform/ios/PlaybackSessionInterfaceAVKit.h: Renamed from Source/WebCore/platform/ios/WebPlaybackSessionInterfaceAVKit.h.
* platform/ios/PlaybackSessionInterfaceAVKit.mm: Renamed from Source/WebCore/platform/ios/WebPlaybackSessionInterfaceAVKit.mm.
* platform/ios/VideoFullscreenInterfaceAVKit.h: Renamed from Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.h.
* platform/ios/VideoFullscreenInterfaceAVKit.mm: Renamed from Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm.
* platform/ios/WebAVPlayerController.h:
* platform/ios/WebAVPlayerController.mm:
* platform/ios/WebVideoFullscreenControllerAVKit.mm:
* platform/mac/PlaybackSessionInterfaceMac.h: Renamed from Source/WebCore/platform/mac/WebPlaybackSessionInterfaceMac.h.
* platform/mac/PlaybackSessionInterfaceMac.mm: Renamed from Source/WebCore/platform/mac/WebPlaybackSessionInterfaceMac.mm.
* platform/mac/VideoFullscreenInterfaceMac.h: Renamed from Source/WebCore/platform/mac/WebVideoFullscreenInterfaceMac.h.
* platform/mac/VideoFullscreenInterfaceMac.mm: Renamed from Source/WebCore/platform/mac/WebVideoFullscreenInterfaceMac.mm.
* platform/mac/WebPlaybackControlsManager.h:
* platform/mac/WebPlaybackControlsManager.mm:

Source/WebKit:

Remove redundant Web- prefix from classes in WebKit namespace.

* DerivedSources.make:
* UIProcess/API/Cocoa/WKWebView.mm:
* UIProcess/Cocoa/PlaybackSessionManagerProxy.h: Renamed from Source/WebKit/UIProcess/Cocoa/WebPlaybackSessionManagerProxy.h.
* UIProcess/Cocoa/PlaybackSessionManagerProxy.messages.in: Renamed from Source/WebKit/UIProcess/Cocoa/WebPlaybackSessionManagerProxy.messages.in.
* UIProcess/Cocoa/PlaybackSessionManagerProxy.mm: Added.
* UIProcess/Cocoa/VideoFullscreenManagerProxy.h: Renamed from Source/WebKit/UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h.
* UIProcess/Cocoa/VideoFullscreenManagerProxy.messages.in: Renamed from Source/WebKit/UIProcess/Cocoa/WebVideoFullscreenManagerProxy.messages.in.
* UIProcess/Cocoa/VideoFullscreenManagerProxy.mm: Renamed from Source/WebKit/UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm.
* UIProcess/Cocoa/WebPlaybackSessionManagerProxy.mm: Removed.
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::updateMediaTouchBar):
* UIProcess/WebPageProxy.cpp:
(WebKit::m_weakPtrFactory):
(WebKit::WebPageProxy::reattachToWebProcess):
(WebKit::WebPageProxy::playbackSessionManager):
(WebKit::WebPageProxy::videoFullscreenManager):
* UIProcess/WebPageProxy.h:
* UIProcess/ios/WebPageProxyIOS.mm:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::playbackSessionManager):
(WebKit::WebPage::videoFullscreenManager):
* WebProcess/WebPage/WebPage.h:
* WebProcess/cocoa/PlaybackSessionManager.h: Renamed from Source/WebKit/WebProcess/cocoa/WebPlaybackSessionManager.h.
* WebProcess/cocoa/PlaybackSessionManager.messages.in: Renamed from Source/WebKit/WebProcess/cocoa/WebPlaybackSessionManager.messages.in.
* WebProcess/cocoa/PlaybackSessionManager.mm: Added.
* WebProcess/cocoa/VideoFullscreenManager.h: Renamed from Source/WebKit/WebProcess/cocoa/WebVideoFullscreenManager.h.
(WebKit::VideoFullscreenInterfaceContext::create):
* WebProcess/cocoa/VideoFullscreenManager.messages.in: Renamed from Source/WebKit/WebProcess/cocoa/WebVideoFullscreenManager.messages.in.
* WebProcess/cocoa/VideoFullscreenManager.mm: Renamed from Source/WebKit/WebProcess/cocoa/WebVideoFullscreenManager.mm.
* WebProcess/cocoa/WebPlaybackSessionManager.mm: Removed.

Source/WebKitLegacy/mac:

Remove redundant Web- prefix from classes in WebKit namespace.

* WebView/WebView.mm:
(-[WebView _setUpPlaybackControlsManagerForMediaElement:]):
* WebView/WebViewData.h:
* WebView/WebViewData.mm:

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

2 years ago[CMake] Re-add the StorageProcess executable target
zandobersek@gmail.com [Fri, 28 Jul 2017 05:49:05 +0000 (05:49 +0000)]
[CMake] Re-add the StorageProcess executable target
https://bugs.webkit.org/show_bug.cgi?id=174929

Reviewed by Carlos Garcia Campos.

Re-add the StorageProcess executable target that was removed in r219960.
Back then it was still named DatabaseProcess, but the name changed in
the following patches.

* CMakeLists.txt:

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

2 years ago[WTF] Drop Thread initialization wait in some platforms by introducing StackBounds...
utatane.tea@gmail.com [Fri, 28 Jul 2017 05:11:19 +0000 (05:11 +0000)]
[WTF] Drop Thread initialization wait in some platforms by introducing StackBounds::newThreadStackBounds(PlatformThreadHandle&)
https://bugs.webkit.org/show_bug.cgi?id=174303

Reviewed by Mark Lam.

Currently, the caller thread of Thread::create() need to wait for completion of the initialization of the target thread.
This is because we need to initialize Thread::m_stack in the target thread. Before this patch, a target thread's
StackBounds can only be retrieved by the target thread itself. However, this potentially causes context-switching between
the caller and the target threads and hurts efficiency of creating threads.

Fortunately, in some platforms (including major platforms except for Windows), we can get StackBounds of a target
thread from a caller thread. This allows us to avoid waiting for completion of thread initialization.

In this patch, we introduce HAVE_STACK_BOUNDS_FOR_NEW_THREAD and StackBounds::newThreadStackBounds. When creating
a new thread, we will use StackBounds::newThreadStackBounds to get StackBounds if possible. As a result, we
do not need to wait for completion of thread initialization to ensure m_stack field of Thread is initialized.

While some documents claim that it is possible on Windows to get the StackBounds of another thread[1], the method relies on
undocumented Windows NT APIs (NtQueryInformationThread, NtReadVirtualMemory etc.). So in this patch, we just
use the conservative approach simply waiting for completion of thread initialization.

[1]: https://stackoverflow.com/questions/3918375/how-to-get-thread-stack-information-on-windows

* wtf/Platform.h:
* wtf/StackBounds.cpp:
(WTF::StackBounds::newThreadStackBounds):
(WTF::StackBounds::currentThreadStackBoundsInternal):
(WTF::StackBounds::initialize): Deleted.
* wtf/StackBounds.h:
(WTF::StackBounds::currentThreadStackBounds):
(WTF::StackBounds::StackBounds):
* wtf/Threading.cpp:
(WTF::Thread::NewThreadContext::NewThreadContext):
(WTF::Thread::entryPoint):
(WTF::Thread::create):
(WTF::Thread::initialize): Deleted.
* wtf/Threading.h:
* wtf/ThreadingPrimitives.h:
* wtf/ThreadingPthreads.cpp:
(WTF::Thread::initializeCurrentThreadEvenIfNonWTFCreated):
(WTF::wtfThreadEntryPoint):
(WTF::Thread::establishHandle):
(WTF::Thread::initializeCurrentThreadInternal):
(WTF::Thread::current):
* wtf/ThreadingWin.cpp:
(WTF::Thread::initializeCurrentThreadEvenIfNonWTFCreated):
(WTF::Thread::initializeCurrentThreadInternal):
(WTF::Thread::current):
* wtf/win/MainThreadWin.cpp:
(WTF::initializeMainThreadPlatform):

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

2 years agoSpeedometer 2.0: Document Angular 4 build process
commit-queue@webkit.org [Fri, 28 Jul 2017 04:44:45 +0000 (04:44 +0000)]
Speedometer 2.0: Document Angular 4 build process
https://bugs.webkit.org/show_bug.cgi?id=174896

Patch by Mathias Bynens <mathias@chromium.org> on 2017-07-27
Reviewed by Ryosuke Niwa.

This patch documents the build process for the Angular 4 example, pins the dependencies (so
that builds are deterministic), and updates the generated files accordingly.

* Speedometer/resources/todomvc/architecture-examples/angular/README.md: Added.
* Speedometer/resources/todomvc/architecture-examples/angular/dist/*: Update per build instructions.
* Speedometer/resources/todomvc/architecture-examples/angular/e2e/app.e2e-spec.ts: Removed unused file.
* Speedometer/resources/todomvc/architecture-examples/angular/e2e/app.po.ts: Removed unused file.
* Speedometer/resources/todomvc/architecture-examples/angular/e2e/tsconfig.e2e.json: Removed unused file.
* Speedometer/resources/todomvc/architecture-examples/angular/package.json: Remove unneeded scripts.
* Speedometer/resources/todomvc/architecture-examples/angular/package-lock.json: Added to pin dependencies.
* Speedometer/resources/todomvc/architecture-examples/angular/src/app/app.component.ts: Updated.
* Speedometer/resources/todomvc/architecture-examples/angular/src/environments/environment.ts: Updated.
* Speedometer/resources/todomvc/architecture-examples/angular/src/index.html: Made title consistent.

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

2 years agoDon't override _allowsMediaDocumentInlinePlayback in MediaDocument with playsinlineAttr.
commit-queue@webkit.org [Fri, 28 Jul 2017 04:41:14 +0000 (04:41 +0000)]
Don't override _allowsMediaDocumentInlinePlayback in MediaDocument with playsinlineAttr.
https://bugs.webkit.org/show_bug.cgi?id=174850
rdar://problem/33449903

Patch by Jeremy Jones <jeremyj@apple.com> on 2017-07-27
Reviewed by Jon Lee.

This change removes playsinlineAttr from MediaDocument so that it doesn't override the setting
from _allowsMediaDocumentInlinePlayback. In its place is an update to requiresFullscreenForVideoPlayback
that implements the details of exactly which media documents are still allowed to play inlne.

Media documents always use a video element; but when there are no video tracks, it has behavior like
an audio element. See media-controller.js isAudio().

This change preserves this behavior with respect to fullscreen requirements for media document by
mirroring the isAudio() check in requiresFullscreenForVideoPlayback.

* html/MediaDocument.cpp:
(WebCore::MediaDocumentParser::createDocumentStructure):
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::requiresFullscreenForVideoPlayback):

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

2 years agoMediaDocument fullscreen pinch gesture should trigger navigate back.
commit-queue@webkit.org [Fri, 28 Jul 2017 04:20:53 +0000 (04:20 +0000)]
MediaDocument fullscreen pinch gesture should trigger navigate back.
https://bugs.webkit.org/show_bug.cgi?id=174914

Patch by Jeremy Jones <jeremyj@apple.com> on 2017-07-27
Reviewed by Jon Lee.

No new tests because only effect is from interaction with platform.

For media documents, pressing the "done" button on fullscreen video navigates back
to the previous page. The same should happen for other gestures that pause playback
when returning to inline. This allows the gesture to have the same behavior as the
button.

* platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
(WebVideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason):

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

2 years agoPart 2 of: Rename DatabaseProcess to StorageProcess.
beidson@apple.com [Fri, 28 Jul 2017 03:32:33 +0000 (03:32 +0000)]
Part 2 of: Rename DatabaseProcess to StorageProcess.
https://bugs.webkit.org/show_bug.cgi?id=174880

Reviewed by Andy Estes.

Source/WebKit:

Rename some more variables, classes, etc. to reflect the change.

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles):

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::grantSandboxExtensionsToStorageProcessForBlobs):
(WebKit::NetworkProcess::didgrantSandboxExtensionsToStorageProcessForBlobs):
(WebKit::NetworkProcess::grantSandboxExtensionsToDatabaseProcessForBlobs): Deleted.
(WebKit::NetworkProcess::didGrantSandboxExtensionsToDatabaseProcessForBlobs): Deleted.
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:

* Shared/ProcessExecutablePath.h:
* Shared/gtk/ProcessExecutablePathGtk.cpp:
(WebKit::executablePathOfStorageProcess):
(WebKit::executablePathOfDatabaseProcess): Deleted.
* Shared/wpe/ProcessExecutablePathWPE.cpp:
(WebKit::executablePathOfStorageProcess):
(WebKit::executablePathOfDatabaseProcess): Deleted.

* StorageProcess/IndexedDB/WebIDBConnectionToClient.cpp:
(WebKit::WebIDBConnectionToClient::putOrAdd):

* StorageProcess/StorageProcess.cpp:
(WebKit::StorageProcess::initializeWebsiteDataStore):
(WebKit::StorageProcess::postStorageTask):
(WebKit::StorageProcess::performNextStorageTask):
(WebKit::StorageProcess::createStorageToWebProcessConnection):
(WebKit::StorageProcess::fetchWebsiteData):
(WebKit::StorageProcess::postDatabaseTask): Deleted.
(WebKit::StorageProcess::performNextDatabaseTask): Deleted.
(WebKit::StorageProcess::createDatabaseToWebProcessConnection): Deleted.
* StorageProcess/StorageProcess.h:
* StorageProcess/StorageProcess.messages.in:
* StorageProcess/mac/StorageProcessMac.mm:
(WebKit::StorageProcess::initializeProcessName):

* UIProcess/API/C/WKContext.cpp:
(WKContextGetDatabaseProcessIdentifier):

* UIProcess/API/Cocoa/WKProcessPool.mm:
(-[WKProcessPool _terminateStorageProcess]):
(-[WKProcessPool _storageProcessIdentifier]):
(-[WKProcessPool _terminateDatabaseProcess]): Deleted.
(-[WKProcessPool _databaseProcessIdentifier]): Deleted.
* UIProcess/API/Cocoa/WKProcessPoolPrivate.h:

* UIProcess/Launcher/ProcessLauncher.h:
* UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp:
(WebKit::ProcessLauncher::launchProcess):
* UIProcess/Launcher/mac/ProcessLauncherMac.mm:
(WebKit::serviceName):
* UIProcess/Launcher/wpe/ProcessLauncherWPE.cpp:
(WebKit::ProcessLauncher::launchProcess):

* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::grantSandboxExtensionsToStorageProcessForBlobs):
(WebKit::NetworkProcessProxy::grantSandboxExtensionsToDatabaseProcessForBlobs): Deleted.
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/Network/NetworkProcessProxy.messages.in:

* UIProcess/Storage/StorageProcessProxy.cpp:
(WebKit::StorageProcessProxy::getLaunchOptions):
(WebKit::StorageProcessProxy::getStorageProcessConnection):
(WebKit::StorageProcessProxy::didClose):
(WebKit::StorageProcessProxy::didCreateStorageToWebProcessConnection):
(WebKit::StorageProcessProxy::didFinishLaunching):
(WebKit::StorageProcessProxy::getDatabaseProcessConnection): Deleted.
(WebKit::StorageProcessProxy::didCreateDatabaseToWebProcessConnection): Deleted.
* UIProcess/Storage/StorageProcessProxy.h:
* UIProcess/Storage/StorageProcessProxy.messages.in:

* UIProcess/WebContextClient.cpp:
(WebKit::WebContextClient::storageProcessDidCrash):
(WebKit::WebContextClient::databaseProcessDidCrash): Deleted.
* UIProcess/WebContextClient.h:

* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::ensureStorageProcessAndWebsiteDataStore):
(WebKit::WebProcessPool::getStorageProcessConnection):
(WebKit::WebProcessPool::storageProcessCrashed):
(WebKit::WebProcessPool::pageAddedToProcess):
(WebKit::WebProcessPool::storageProcessIdentifier):
(WebKit::WebProcessPool::terminateStorageProcess):
(WebKit::WebProcessPool::ensureDatabaseProcessAndWebsiteDataStore): Deleted.
(WebKit::WebProcessPool::getDatabaseProcessConnection): Deleted.
(WebKit::WebProcessPool::databaseProcessCrashed): Deleted.
(WebKit::WebProcessPool::databaseProcessIdentifier): Deleted.
(WebKit::WebProcessPool::terminateDatabaseProcess): Deleted.
* UIProcess/WebProcessPool.h:
(WebKit::WebProcessPool::sendToStorageProcessRelaunchingIfNecessary):
(WebKit::WebProcessPool::sendToDatabaseProcessRelaunchingIfNecessary): Deleted.

* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::getStorageProcessConnection):
(WebKit::WebProcessProxy::getDatabaseProcessConnection): Deleted.
* UIProcess/WebProcessProxy.h:
* UIProcess/WebProcessProxy.messages.in:

* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::fetchDataAndApply):
(WebKit::WebsiteDataStore::removeData):
(WebKit::WebsiteDataStore::storageProcessParameters):
(WebKit::WebsiteDataStore::databaseProcessParameters): Deleted.
* UIProcess/WebsiteData/WebsiteDataStore.h:

* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
(WebKit::WebIDBConnectionToServer::messageSenderConnection):
* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:

* WebProcess/Databases/WebDatabaseProvider.cpp:
(WebKit::WebDatabaseProvider::idbConnectionToServerForSession):

* WebProcess/Storage/WebToStorageProcessConnection.cpp:
(WebKit::WebToStorageProcessConnection::WebToStorageProcessConnection):
(WebKit::WebToStorageProcessConnection::~WebToStorageProcessConnection):
(WebKit::WebToStorageProcessConnection::didReceiveMessage):
(WebKit::WebToStorageProcessConnection::didClose):
(WebKit::WebToStorageProcessConnection::didReceiveInvalidMessage):
(WebKit::WebToStorageProcessConnection::idbConnectionToServerForSession):
(WebKit::WebToDatabaseProcessConnection::WebToDatabaseProcessConnection): Deleted.
(WebKit::WebToDatabaseProcessConnection::~WebToDatabaseProcessConnection): Deleted.
(WebKit::WebToDatabaseProcessConnection::didReceiveMessage): Deleted.
(WebKit::WebToDatabaseProcessConnection::didClose): Deleted.
(WebKit::WebToDatabaseProcessConnection::didReceiveInvalidMessage): Deleted.
(WebKit::WebToDatabaseProcessConnection::idbConnectionToServerForSession): Deleted.
* WebProcess/Storage/WebToStorageProcessConnection.h:
(WebKit::WebToStorageProcessConnection::create):
(WebKit::WebToDatabaseProcessConnection::create): Deleted.
(WebKit::WebToDatabaseProcessConnection::connection): Deleted.

* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::webToStorageProcessConnectionClosed):
(WebKit::WebProcess::webToStorageProcessConnection):
(WebKit::WebProcess::ensureWebToStorageProcessConnection):
(WebKit::WebProcess::webToDatabaseProcessConnectionClosed): Deleted.
(WebKit::WebProcess::webToDatabaseProcessConnection): Deleted.
(WebKit::WebProcess::ensureWebToDatabaseProcessConnection): Deleted.
* WebProcess/WebProcess.h:

Tools:

* TestWebKitAPI/Tests/WebKit2Cocoa/IDBDeleteRecovery.mm:
* TestWebKitAPI/Tests/WebKit2Cocoa/IDBIndexUpgradeToV2.mm:
* TestWebKitAPI/Tests/WebKit2Cocoa/IndexedDBDatabaseProcessKill.mm:
* TestWebKitAPI/Tests/WebKit2Cocoa/IndexedDBMultiProcess.mm:
* TestWebKitAPI/Tests/WebKit2Cocoa/IndexedDBPersistence.mm:
* TestWebKitAPI/Tests/WebKit2Cocoa/ResourceLoadStatistics.mm:
* TestWebKitAPI/Tests/WebKit2Cocoa/WebProcessKillIDBCleanup.mm:
* TestWebKitAPI/Tests/WebKit2Cocoa/WebsiteDataStoreCustomPaths.mm:

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

2 years ago[ES] Add support finally to Promise
gskachkov@gmail.com [Fri, 28 Jul 2017 02:38:41 +0000 (02:38 +0000)]
[ES] Add support finally to Promise
https://bugs.webkit.org/show_bug.cgi?id=174503

Reviewed by Yusuke Suzuki.

Source/JavaScriptCore:

Add support `finally` method to Promise according
to the https://bugs.webkit.org/show_bug.cgi?id=174503
Current spec on STAGE 3
https://github.com/tc39/proposal-promise-finally

* builtins/PromisePrototype.js:
(finally):
(const.valueThunk):
(globalPrivate.getThenFinally):
(const.thrower):
(globalPrivate.getCatchFinally):
* runtime/JSPromisePrototype.cpp:

LayoutTests:

* js/Promise-types-expected.txt:
* js/script-tests/Promise-types.js:

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

2 years agoUpdate lock benchmarks
jfbastien@apple.com [Fri, 28 Jul 2017 02:17:37 +0000 (02:17 +0000)]
Update lock benchmarks
https://bugs.webkit.org/show_bug.cgi?id=174907

Reviewed by Filip Pizlo.

* benchmarks/ConditionSpeedTest.cpp:
(main):
* benchmarks/LockFairnessTest.cpp:
* benchmarks/LockSpeedTest.cpp:
* benchmarks/ToyLocks.h:

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

2 years agoAX: A11Y: Zoom no longer follows keyboard insertion point in safari
n_wang@apple.com [Thu, 27 Jul 2017 23:46:53 +0000 (23:46 +0000)]
AX: A11Y: Zoom no longer follows keyboard insertion point in safari
https://bugs.webkit.org/show_bug.cgi?id=174869

Reviewed by David Kilzer.

There was a recent change by denying XPC services access by default.
In UAZoomChangeFocus we need to send message to HIServices, so let's
allow the connection to XPC services for that.

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

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

2 years agoPart 1 of: Rename DatabaseProcess to StorageProcess.
beidson@apple.com [Thu, 27 Jul 2017 23:08:34 +0000 (23:08 +0000)]
Part 1 of: Rename DatabaseProcess to StorageProcess.
https://bugs.webkit.org/show_bug.cgi?id=174879

Reviewed by Andy Estes.

.:

* Source/cmake/OptionsWPE.cmake:
* Source/cmake/gtksymbols.filter:

Source/WebKit:

This patch is all about renaming source files and renaming the process itself (touching build system files, etc etc).

Some renaming in actual code did result (Some class/struct names, method names, etc)

Part 2 (174880) will go through and update all references in code itself from "Database" to "Storage"

* CMakeLists.txt:
* Configurations/Storage-iOS.entitlements: Renamed from Source/WebKit/Configurations/Databases-iOS.entitlements.
* Configurations/StorageService.xcconfig: Renamed from Source/WebKit/Configurations/DatabaseService.xcconfig.
* Configurations/WebKit.xcconfig:
* DerivedSources.make:
* Platform/ExtraPrivateSymbolsForTAPI.h:
* PlatformGTK.cmake:
* PlatformMac.cmake:
* PlatformWPE.cmake:

* Resources/SandboxProfiles/ios/com.apple.WebKit.Storage.sb: Renamed from Source/WebKit/Resources/SandboxProfiles/ios/com.apple.WebKit.Databases.sb.

* Shared/Storage/StorageProcessCreationParameters.cpp: Renamed from Source/WebKit/Shared/Databases/DatabaseProcessCreationParameters.cpp.
(WebKit::StorageProcessCreationParameters::StorageProcessCreationParameters):
(WebKit::StorageProcessCreationParameters::encode):
(WebKit::StorageProcessCreationParameters::decode):
* Shared/Storage/StorageProcessCreationParameters.h: Renamed from Source/WebKit/Shared/Databases/DatabaseProcessCreationParameters.h.

* StorageProcess/EntryPoint/mac/XPCService/StorageService/Info.plist: Renamed from Source/WebKit/DatabaseProcess/EntryPoint/mac/XPCService/DatabaseService/Info.plist.
* StorageProcess/EntryPoint/mac/XPCService/StorageServiceEntryPoint.mm: Renamed from Source/WebKit/DatabaseProcess/EntryPoint/mac/XPCService/DatabaseServiceEntryPoint.mm.
(StorageServiceInitializer):
* StorageProcess/EntryPoint/unix/StorageProcessMain.cpp: Renamed from Source/WebKit/DatabaseProcess/EntryPoint/unix/DatabaseProcessMain.cpp.
(main):

* StorageProcess/IndexedDB/WebIDBConnectionToClient.cpp: Renamed from Source/WebKit/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp.
* StorageProcess/IndexedDB/WebIDBConnectionToClient.h: Renamed from Source/WebKit/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h.
* StorageProcess/IndexedDB/WebIDBConnectionToClient.messages.in: Renamed from Source/WebKit/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in.

* StorageProcess/StorageProcess.cpp: Renamed from Source/WebKit/DatabaseProcess/DatabaseProcess.cpp.
* StorageProcess/StorageProcess.h: Renamed from Source/WebKit/DatabaseProcess/DatabaseProcess.h.
* StorageProcess/StorageProcess.messages.in: Renamed from Source/WebKit/DatabaseProcess/DatabaseProcess.messages.in.

* StorageProcess/StorageToWebProcessConnection.cpp: Renamed from Source/WebKit/DatabaseProcess/DatabaseToWebProcessConnection.cpp.
* StorageProcess/StorageToWebProcessConnection.h: Renamed from Source/WebKit/DatabaseProcess/DatabaseToWebProcessConnection.h.
* StorageProcess/StorageToWebProcessConnection.messages.in: Renamed from Source/WebKit/DatabaseProcess/DatabaseToWebProcessConnection.messages.in.

* StorageProcess/gtk/StorageProcessMainGtk.cpp: Renamed from Source/WebKit/DatabaseProcess/gtk/DatabaseProcessMainGtk.cpp.
(WebKit::StorageProcessMainUnix):
* StorageProcess/ios/StorageProcessIOS.mm: Renamed from Source/WebKit/DatabaseProcess/ios/DatabaseProcessIOS.mm.
(WebKit::StorageProcess::initializeProcess):
(WebKit::StorageProcess::initializeProcessName):
(WebKit::StorageProcess::initializeSandbox):
* StorageProcess/mac/StorageProcessMac.mm: Renamed from Source/WebKit/DatabaseProcess/mac/DatabaseProcessMac.mm.
(WebKit::StorageProcess::initializeProcess):
(WebKit::StorageProcess::initializeProcessName):
(WebKit::StorageProcess::initializeSandbox):

* StorageProcess/mac/com.apple.WebKit.Databases.sb.in: Copied from Source/WebKit/DatabaseProcess/mac/com.apple.WebKit.Databases.sb.in.
* StorageProcess/mac/com.apple.WebKit.Storage.sb.in: Renamed from Source/WebKit/DatabaseProcess/mac/com.apple.WebKit.Databases.sb.in.

* StorageProcess/unix/StorageProcessMainUnix.h: Renamed from Source/WebKit/DatabaseProcess/unix/DatabaseProcessMainUnix.h.

* UIProcess/Launcher/mac/ProcessLauncherMac.mm:
(WebKit::serviceName):

* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::grantSandboxExtensionsToDatabaseProcessForBlobs):

* UIProcess/Storage/StorageProcessProxy.cpp: Renamed from Source/WebKit/UIProcess/Databases/DatabaseProcessProxy.cpp.
* UIProcess/Storage/StorageProcessProxy.h: Renamed from Source/WebKit/UIProcess/Databases/DatabaseProcessProxy.h.
* UIProcess/Storage/StorageProcessProxy.messages.in: Renamed from Source/WebKit/UIProcess/Databases/DatabaseProcessProxy.messages.in.

* UIProcess/WebContextSupplement.h:
(WebKit::WebContextSupplement::processDidClose):

* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::ensureDatabaseProcessAndWebsiteDataStore):
(WebKit::WebProcessPool::databaseProcessCrashed):
(WebKit::WebProcessPool::pageAddedToProcess):
* UIProcess/WebProcessPool.h:

* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::databaseProcessParameters):
* UIProcess/WebsiteData/WebsiteDataStore.h:

* WebKit.xcodeproj/project.pbxproj:

* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
(WebKit::WebIDBConnectionToServer::WebIDBConnectionToServer):
(WebKit::WebIDBConnectionToServer::~WebIDBConnectionToServer):
* WebProcess/Databases/WebDatabaseProvider.cpp:

* WebProcess/Storage/WebToStorageProcessConnection.cpp: Renamed from Source/WebKit/WebProcess/Databases/WebToDatabaseProcessConnection.cpp.
* WebProcess/Storage/WebToStorageProcessConnection.h: Renamed from Source/WebKit/WebProcess/Databases/WebToDatabaseProcessConnection.h.

* WebProcess/WebProcess.cpp:

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

2 years agoPDF page number indicator is very flashy when scrolling
timothy_horton@apple.com [Thu, 27 Jul 2017 17:06:11 +0000 (17:06 +0000)]
PDF page number indicator is very flashy when scrolling
https://bugs.webkit.org/show_bug.cgi?id=174882
<rdar://problem/23760981>

Reviewed by Andy Estes.

* Platform/spi/ios/UIKitSPI.h:
* UIProcess/ios/WKPDFPageNumberIndicator.mm:
(-[WKPDFPageNumberIndicator initWithFrame:]):
Increase the backdrop rendering resolution to reduce flashiness.
It's still not perfect, but it's quite visibly better.

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

2 years agoAdd ability to only run specific tests in run-javascriptcore-tests.
mark.lam@apple.com [Thu, 27 Jul 2017 16:48:48 +0000 (16:48 +0000)]
Add ability to only run specific tests in run-javascriptcore-tests.
https://bugs.webkit.org/show_bug.cgi?id=174884

Reviewed by Saam Barati.

For example, if we only want to run testapi, we can do so as follows:
    $ run-javascriptcore-tests --testapi

Previously, specifying --testapi effectively does nothing because we run all tests
by default.  Only --no-testapi had the effect of disabling the test set.  This
old behavior for --testapi is not very useful or meaningful.  We're now changing
it to mean that we will only run that test.

With this change, we can also run more than one set of tests.  For example, if we
only want to run testmasm and testair, we can do so as follows:
    $ run-javascriptcore-tests --testmasm --testair

By default, if no specific test option is specified, run-javascriptcore-tests will
run all tests.

Note that the jsc stress tests (--jsc-stress) are a different set of tests than
the mozilla tests (--mozilla-tests) even though both are run via the lower level
run-jsc-stress-tests test harness.  Hence, if you only specify one of the tests,
the other set will not run.  For example, the following only runs the mozilla tests:
    $ run-javascriptcore-tests --mozilla-tests

Note also that --jit-stress-tests is not for choosing a different set of tests.
Instead, it is used for determining whether we run JIT'ed test configurations
on the jsc stress tests and mozilla tests.  As a result, specifying
--jit-stress-tests will not omit other tests.  For example, the following still
runs all tests:
    $ run-javascriptcore-tests --jit-stress-tests

* Scripts/run-javascriptcore-tests:
(defaultStringForTestState):
(enableTestOrNot):
(runJSCStressTests):

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

2 years agoAX: VoiceOver silent or skipping over time values on media player.
commit-queue@webkit.org [Thu, 27 Jul 2017 14:53:04 +0000 (14:53 +0000)]
AX: VoiceOver silent or skipping over time values on media player.
https://bugs.webkit.org/show_bug.cgi?id=174324
<rdar://problem/32021784>

Patch by Aaron Chu <aaron_chu@apple.com> on 2017-07-27
Reviewed by Antoine Quint.

Added role attribute to modern media controls time lable class so that VoiceOver can access the time label when the media is playing.

Source/WebCore:

Test Updated: media/modern-media-controls/time-label/time-label.html
Test Added: media/modern-media-controls/time-label/ios-time-label.html

* Modules/modern-media-controls/controls/time-label.js:

LayoutTests:

Updated time-label.html to test role attribute on mac.
Added ios-time-label.html to run time-label test without testing for role since accessibilityController does not expose a role property on iOS.

* media/modern-media-controls/time-label/ios-time-label-expected.txt: Copied from LayoutTests/media/modern-media-controls/time-label/time-label-expected.txt.
* media/modern-media-controls/time-label/ios-time-label.html: Copied from LayoutTests/media/modern-media-controls/time-label/time-label.html.
* media/modern-media-controls/time-label/time-label-expected.txt:
* media/modern-media-controls/time-label/time-label.html:
* platform/ios-simulator/TestExpectations:
* platform/mac/TestExpectations:

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

2 years agoUnreviewed, build fix for CLoop
utatane.tea@gmail.com [Thu, 27 Jul 2017 13:00:23 +0000 (13:00 +0000)]
Unreviewed, build fix for CLoop
https://bugs.webkit.org/show_bug.cgi?id=171637

* domjit/DOMJITGetterSetter.h:

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

2 years agoHoist DOM binding attribute getter prologue into JavaScriptCore taking advantage...
utatane.tea@gmail.com [Thu, 27 Jul 2017 12:35:49 +0000 (12:35 +0000)]
Hoist DOM binding attribute getter prologue into JavaScriptCore taking advantage of DOMJIT / CheckSubClass
https://bugs.webkit.org/show_bug.cgi?id=171637

Reviewed by Darin Adler.

JSTests:

* stress/domjit-getter-complex-with-incorrect-object.js:
(i.shouldThrow):
* stress/domjit-getter-type-check.js: Copied from JSTests/stress/domjit-getter-complex-with-incorrect-object.js.
(shouldBe):
(i.shouldThrow):

Source/JavaScriptCore:

Each DOM attribute getter has the code to perform ClassInfo check. But it is largely duplicate and causes code bloating.
In this patch, we move ClassInfo check from WebCore to JSC and reduce code size.

We introduce DOMAnnotation which has ClassInfo* and DOMJIT::GetterSetter*. If the getter is not DOMJIT getter, this
DOMJIT::GetterSetter becomes nullptr. We support such a CustomAccessorGetter in all the JIT tiers.

In IC, we drop CheckSubClass completely since IC's Structure check subsumes it. We do not enable this optimization for
op_get_by_id_with_this case yet.
In DFG and FTL, we emit CheckSubClass node. Which is typically removed by CheckStructure leading to CheckSubClass.

And we add DOMAttributeGetterSetter, which is derived class of CustomGetterSetter. It holds DOMAnnotation and perform
ClassInfo check.

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* bytecode/AccessCase.cpp:
(JSC::AccessCase::generateImpl):
* bytecode/GetByIdStatus.cpp:
(JSC::GetByIdStatus::computeForStubInfoWithoutExitSiteFeedback):
* bytecode/GetByIdVariant.cpp:
(JSC::GetByIdVariant::GetByIdVariant):
(JSC::GetByIdVariant::operator=):
(JSC::GetByIdVariant::attemptToMerge):
(JSC::GetByIdVariant::dumpInContext):
* bytecode/GetByIdVariant.h:
(JSC::GetByIdVariant::customAccessorGetter):
(JSC::GetByIdVariant::domAttribute):
(JSC::GetByIdVariant::domJIT): Deleted.
* bytecode/GetterSetterAccessCase.cpp:
(JSC::GetterSetterAccessCase::create):
(JSC::GetterSetterAccessCase::GetterSetterAccessCase):
(JSC::GetterSetterAccessCase::emitDOMJITGetter):
* bytecode/GetterSetterAccessCase.h:
(JSC::GetterSetterAccessCase::domAttribute):
(JSC::GetterSetterAccessCase::customAccessor):
(JSC::GetterSetterAccessCase::domJIT): Deleted.
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::instantiateLexicalVariables):
* create_hash_table:
* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::blessCallDOMGetter):
(JSC::DFG::ByteCodeParser::handleDOMJITGetter):
(JSC::DFG::ByteCodeParser::handleGetById):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGNode.h:
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileCallDOMGetter):
* dfg/DFGSpeculativeJIT.h:
(JSC::DFG::SpeculativeJIT::callCustomGetter):
* domjit/DOMJITGetterSetter.h:
(JSC::DOMJIT::GetterSetter::GetterSetter):
(JSC::DOMJIT::GetterSetter::getter):
(JSC::DOMJIT::GetterSetter::compiler):
(JSC::DOMJIT::GetterSetter::resultType):
(JSC::DOMJIT::GetterSetter::~GetterSetter): Deleted.
(JSC::DOMJIT::GetterSetter::setter): Deleted.
(JSC::DOMJIT::GetterSetter::thisClassInfo): Deleted.
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileCallDOMGetter):
* jit/Repatch.cpp:
(JSC::tryCacheGetByID):
* jsc.cpp:
(WTF::DOMJITGetter::DOMJITAttribute::DOMJITAttribute):
(WTF::DOMJITGetter::DOMJITAttribute::callDOMGetter):
(WTF::DOMJITGetter::customGetter):
(WTF::DOMJITGetter::finishCreation):
(WTF::DOMJITGetterComplex::DOMJITAttribute::DOMJITAttribute):
(WTF::DOMJITGetterComplex::DOMJITAttribute::callDOMGetter):
(WTF::DOMJITGetterComplex::customGetter):
(WTF::DOMJITGetterComplex::finishCreation):
(WTF::DOMJITGetter::DOMJITNodeDOMJIT::DOMJITNodeDOMJIT): Deleted.
(WTF::DOMJITGetter::DOMJITNodeDOMJIT::slowCall): Deleted.
(WTF::DOMJITGetter::domJITNodeGetterSetter): Deleted.
(WTF::DOMJITGetterComplex::DOMJITNodeDOMJIT::DOMJITNodeDOMJIT): Deleted.
(WTF::DOMJITGetterComplex::DOMJITNodeDOMJIT::slowCall): Deleted.
(WTF::DOMJITGetterComplex::domJITNodeGetterSetter): Deleted.
* runtime/CustomGetterSetter.h:
(JSC::CustomGetterSetter::create):
(JSC::CustomGetterSetter::setter):
(JSC::CustomGetterSetter::CustomGetterSetter):
(): Deleted.
* runtime/DOMAnnotation.h: Added.
(JSC::operator==):
(JSC::operator!=):
* runtime/DOMAttributeGetterSetter.cpp: Added.
* runtime/DOMAttributeGetterSetter.h: Copied from Source/JavaScriptCore/runtime/CustomGetterSetter.h.
(JSC::isDOMAttributeGetterSetter):
* runtime/Error.cpp:
(JSC::throwDOMAttributeGetterTypeError):
* runtime/Error.h:
(JSC::throwVMDOMAttributeGetterTypeError):
* runtime/JSCustomGetterSetterFunction.cpp:
(JSC::JSCustomGetterSetterFunction::customGetterSetterFunctionCall):
* runtime/JSObject.cpp:
(JSC::JSObject::putInlineSlow):
(JSC::JSObject::deleteProperty):
(JSC::JSObject::getOwnStaticPropertySlot):
(JSC::JSObject::reifyAllStaticProperties):
(JSC::JSObject::fillGetterPropertySlot):
(JSC::JSObject::findPropertyHashEntry): Deleted.
* runtime/JSObject.h:
(JSC::JSObject::getOwnNonIndexPropertySlot):
(JSC::JSObject::fillCustomGetterPropertySlot):
* runtime/Lookup.cpp:
(JSC::setUpStaticFunctionSlot):
* runtime/Lookup.h:
(JSC::HashTableValue::domJIT):
(JSC::getStaticPropertySlotFromTable):
(JSC::putEntry):
(JSC::lookupPut):
(JSC::reifyStaticProperty):
(JSC::reifyStaticProperties):
Each static property table has a new field ClassInfo*. It indicates that which ClassInfo check DOMAttribute registered in
this static property table requires.

* runtime/ProgramExecutable.cpp:
(JSC::ProgramExecutable::initializeGlobalProperties):
* runtime/PropertyName.h:
* runtime/PropertySlot.cpp:
(JSC::PropertySlot::customGetter):
(JSC::PropertySlot::customAccessorGetter):
* runtime/PropertySlot.h:
(JSC::PropertySlot::domAttribute):
(JSC::PropertySlot::setCustom):
(JSC::PropertySlot::setCacheableCustom):
(JSC::PropertySlot::getValue):
(JSC::PropertySlot::domJIT): Deleted.
* runtime/VM.cpp:
(JSC::VM::VM):
* runtime/VM.h:

Source/WebCore:

We use DOMAttribute. When DOMAttribute is specified, ClassInfo check is performed by JSC side.
So, we can drop ClassInfo check from the actual function.

We also simplify DOMJIT::GetterSetter to make it smaller size.

WebCore size comparison
    Before: 48443292
    After:  48087800 (0.7% reduction)

Speedometer Scores show 0.8% improvement.
    Before: 158.9 +- 0.46
    After:  160.2 +- 0.36

Dromaeo DOM core Scores show 5.8% improvement.
                                Before                   After
    Total Score:         8424.12runs/s ±1.38%     8911.60runs/s ±1.47%
      DOM Attributes    12627.27runs/s ±1.87%    14023.17runs/s ±1.87%
      DOM Modification   1207.82runs/s ±2.48%     1204.21runs/s ±3.05%
      DOM Query         68068.82runs/s ±0.63%    74273.38runs/s ±0.69%
      DOM Traversal      1240.07runs/s ±1.96%     1256.64runs/s ±1.77%

Performance improvement can be explained by the following optimizations.

1. Type checks are typically eliminated in all the JIT tiers. IC / DFG / FTL can
   drop type checks since get_by_id operation already performs a structure check
   which subsumes this type check.
2. Direct getter call by CallDOMGetter without creating IC in DFG and FTL.

* bindings/js/JSDOMAttribute.h:
(WebCore::IDLAttribute::get):
Add CastedThisErrorBehavior::Assert case. When this is specified, we perform casting without using jsDynamicCast.

* bindings/scripts/CodeGeneratorJS.pm:
(IsAcceleratedDOMAttribute):
(GetJSCAttributesForAttribute):
(GenerateHeader):
(GeneratePropertiesHashTable):
(GenerateImplementation):
(GenerateAttributeGetterTrampolineDefinition):
(GenerateAttributeGetterDefinition):
(GenerateCallbackImplementationContent):
(GenerateHashTableValueArray):
(GenerateHashTable):
(GenerateConstructorHelperMethods):
Update CodeGeneratorJS to emit DOMAttribute. And DOMJIT::GetterSetter becomes changed to be smaller size.

* bindings/scripts/test/JS/JSInterfaceName.cpp:
(WebCore::JSInterfaceNamePrototype::finishCreation):
* bindings/scripts/test/JS/JSMapLike.cpp:
(WebCore::JSMapLikePrototype::finishCreation):
* bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
(WebCore::JSReadOnlyMapLikePrototype::finishCreation):
* bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
(WebCore::JSTestActiveDOMObjectPrototype::finishCreation):
(WebCore::jsTestActiveDOMObjectExcitingAttr):
* bindings/scripts/test/JS/JSTestCEReactions.cpp:
(WebCore::JSTestCEReactionsPrototype::finishCreation):
(WebCore::jsTestCEReactionsAttributeWithCEReactions):
(WebCore::jsTestCEReactionsReflectAttributeWithCEReactions):
(WebCore::jsTestCEReactionsStringifierAttribute):
* bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
(WebCore::JSTestCEReactionsStringifierPrototype::finishCreation):
(WebCore::jsTestCEReactionsStringifierValue):
* bindings/scripts/test/JS/JSTestCallTracer.cpp:
(WebCore::JSTestCallTracerPrototype::finishCreation):
(WebCore::jsTestCallTracerTestAttributeInterface):
(WebCore::jsTestCallTracerTestAttributeSpecified):
* bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
(WebCore::JSTestCallbackInterfaceConstructor::initializeProperties):
* bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
(WebCore::JSTestClassWithJSBuiltinConstructorPrototype::finishCreation):
* bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
(WebCore::JSTestCustomConstructorWithNoInterfaceObjectPrototype::finishCreation):
* bindings/scripts/test/JS/JSTestDOMJIT.cpp:
(WebCore::JSTestDOMJITPrototype::finishCreation):
(WebCore::TestDOMJITAnyAttrDOMJIT::TestDOMJITAnyAttrDOMJIT): Deleted.
(WebCore::domJITGetterSetterForTestDOMJITAnyAttr): Deleted.
(WebCore::TestDOMJITBooleanAttrDOMJIT::TestDOMJITBooleanAttrDOMJIT): Deleted.
(WebCore::domJITGetterSetterForTestDOMJITBooleanAttr): Deleted.
(WebCore::TestDOMJITByteAttrDOMJIT::TestDOMJITByteAttrDOMJIT): Deleted.
(WebCore::domJITGetterSetterForTestDOMJITByteAttr): Deleted.
(WebCore::TestDOMJITOctetAttrDOMJIT::TestDOMJITOctetAttrDOMJIT): Deleted.
(WebCore::domJITGetterSetterForTestDOMJITOctetAttr): Deleted.
(WebCore::TestDOMJITShortAttrDOMJIT::TestDOMJITShortAttrDOMJIT): Deleted.
(WebCore::domJITGetterSetterForTestDOMJITShortAttr): Deleted.
(WebCore::TestDOMJITUnsignedShortAttrDOMJIT::TestDOMJITUnsignedShortAttrDOMJIT): Deleted.
(WebCore::domJITGetterSetterForTestDOMJITUnsignedShortAttr): Deleted.
(WebCore::TestDOMJITLongAttrDOMJIT::TestDOMJITLongAttrDOMJIT): Deleted.
(WebCore::domJITGetterSetterForTestDOMJITLongAttr): Deleted.
(WebCore::TestDOMJITUnsignedLongAttrDOMJIT::TestDOMJITUnsignedLongAttrDOMJIT): Deleted.
(WebCore::domJITGetterSetterForTestDOMJITUnsignedLongAttr): Deleted.
(WebCore::TestDOMJITLongLongAttrDOMJIT::TestDOMJITLongLongAttrDOMJIT): Deleted.
(WebCore::domJITGetterSetterForTestDOMJITLongLongAttr): Deleted.
(WebCore::TestDOMJITUnsignedLongLongAttrDOMJIT::TestDOMJITUnsignedLongLongAttrDOMJIT): Deleted.
(WebCore::domJITGetterSetterForTestDOMJITUnsignedLongLongAttr): Deleted.
(WebCore::TestDOMJITFloatAttrDOMJIT::TestDOMJITFloatAttrDOMJIT): Deleted.
(WebCore::domJITGetterSetterForTestDOMJITFloatAttr): Deleted.
(WebCore::TestDOMJITUnrestrictedFloatAttrDOMJIT::TestDOMJITUnrestrictedFloatAttrDOMJIT): Deleted.
(WebCore::domJITGetterSetterForTestDOMJITUnrestrictedFloatAttr): Deleted.
(WebCore::TestDOMJITDoubleAttrDOMJIT::TestDOMJITDoubleAttrDOMJIT): Deleted.
(WebCore::domJITGetterSetterForTestDOMJITDoubleAttr): Deleted.
(WebCore::TestDOMJITUnrestrictedDoubleAttrDOMJIT::TestDOMJITUnrestrictedDoubleAttrDOMJIT): Deleted.
(WebCore::domJITGetterSetterForTestDOMJITUnrestrictedDoubleAttr): Deleted.
(WebCore::TestDOMJITDomStringAttrDOMJIT::TestDOMJITDomStringAttrDOMJIT): Deleted.
(WebCore::domJITGetterSetterForTestDOMJITDomStringAttr): Deleted.
(WebCore::TestDOMJITByteStringAttrDOMJIT::TestDOMJITByteStringAttrDOMJIT): Deleted.
(WebCore::domJITGetterSetterForTestDOMJITByteStringAttr): Deleted.
(WebCore::TestDOMJITUsvStringAttrDOMJIT::TestDOMJITUsvStringAttrDOMJIT): Deleted.
(WebCore::domJITGetterSetterForTestDOMJITUsvStringAttr): Deleted.
(WebCore::TestDOMJITNodeAttrDOMJIT::TestDOMJITNodeAttrDOMJIT): Deleted.
(WebCore::domJITGetterSetterForTestDOMJITNodeAttr): Deleted.
(WebCore::TestDOMJITBooleanNullableAttrDOMJIT::TestDOMJITBooleanNullableAttrDOMJIT): Deleted.
(WebCore::domJITGetterSetterForTestDOMJITBooleanNullableAttr): Deleted.
(WebCore::TestDOMJITByteNullableAttrDOMJIT::TestDOMJITByteNullableAttrDOMJIT): Deleted.
(WebCore::domJITGetterSetterForTestDOMJITByteNullableAttr): Deleted.
(WebCore::TestDOMJITOctetNullableAttrDOMJIT::TestDOMJITOctetNullableAttrDOMJIT): Deleted.
(WebCore::domJITGetterSetterForTestDOMJITOctetNullableAttr): Deleted.
(WebCore::TestDOMJITShortNullableAttrDOMJIT::TestDOMJITShortNullableAttrDOMJIT): Deleted.
(WebCore::domJITGetterSetterForTestDOMJITShortNullableAttr): Deleted.
(WebCore::TestDOMJITUnsignedShortNullableAttrDOMJIT::TestDOMJITUnsignedShortNullableAttrDOMJIT): Deleted.
(WebCore::domJITGetterSetterForTestDOMJITUnsignedShortNullableAttr): Deleted.
(WebCore::TestDOMJITLongNullableAttrDOMJIT::TestDOMJITLongNullableAttrDOMJIT): Deleted.
(WebCore::domJITGetterSetterForTestDOMJITLongNullableAttr): Deleted.
(WebCore::TestDOMJITUnsignedLongNullableAttrDOMJIT::TestDOMJITUnsignedLongNullableAttrDOMJIT): Deleted.
(WebCore::domJITGetterSetterForTestDOMJITUnsignedLongNullableAttr): Deleted.
(WebCore::TestDOMJITLongLongNullableAttrDOMJIT::TestDOMJITLongLongNullableAttrDOMJIT): Deleted.
(WebCore::domJITGetterSetterForTestDOMJITLongLongNullableAttr): Deleted.
(WebCore::TestDOMJITUnsignedLongLongNullableAttrDOMJIT::TestDOMJITUnsignedLongLongNullableAttrDOMJIT): Deleted.
(WebCore::domJITGetterSetterForTestDOMJITUnsignedLongLongNullableAttr): Deleted.
(WebCore::TestDOMJITFloatNullableAttrDOMJIT::TestDOMJITFloatNullableAttrDOMJIT): Deleted.
(WebCore::domJITGetterSetterForTestDOMJITFloatNullableAttr): Deleted.
(WebCore::TestDOMJITUnrestrictedFloatNullableAttrDOMJIT::TestDOMJITUnrestrictedFloatNullableAttrDOMJIT): Deleted.
(WebCore::domJITGetterSetterForTestDOMJITUnrestrictedFloatNullableAttr): Deleted.
(WebCore::TestDOMJITDoubleNullableAttrDOMJIT::TestDOMJITDoubleNullableAttrDOMJIT): Deleted.
(WebCore::domJITGetterSetterForTestDOMJITDoubleNullableAttr): Deleted.
(WebCore::TestDOMJITUnrestrictedDoubleNullableAttrDOMJIT::TestDOMJITUnrestrictedDoubleNullableAttrDOMJIT): Deleted.
(WebCore::domJITGetterSetterForTestDOMJITUnrestrictedDoubleNullableAttr): Deleted.
(WebCore::TestDOMJITDomStringNullableAttrDOMJIT::TestDOMJITDomStringNullableAttrDOMJIT): Deleted.
(WebCore::domJITGetterSetterForTestDOMJITDomStringNullableAttr): Deleted.
(WebCore::TestDOMJITByteStringNullableAttrDOMJIT::TestDOMJITByteStringNullableAttrDOMJIT): Deleted.
(WebCore::domJITGetterSetterForTestDOMJITByteStringNullableAttr): Deleted.
(WebCore::TestDOMJITUsvStringNullableAttrDOMJIT::TestDOMJITUsvStringNullableAttrDOMJIT): Deleted.
(WebCore::domJITGetterSetterForTestDOMJITUsvStringNullableAttr): Deleted.
(WebCore::TestDOMJITNodeNullableAttrDOMJIT::TestDOMJITNodeNullableAttrDOMJIT): Deleted.
(WebCore::domJITGetterSetterForTestDOMJITNodeNullableAttr): Deleted.
* bindings/scripts/test/JS/JSTestDOMJIT.h:
* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
(WebCore::JSTestEventConstructorPrototype::finishCreation):
(WebCore::jsTestEventConstructorAttr1):
(WebCore::jsTestEventConstructorAttr2):
(WebCore::jsTestEventConstructorAttr3):
* bindings/scripts/test/JS/JSTestEventTarget.cpp:
(WebCore::JSTestEventTargetPrototype::finishCreation):
* bindings/scripts/test/JS/JSTestException.cpp:
(WebCore::JSTestExceptionPrototype::finishCreation):
(WebCore::jsTestExceptionName):
* bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
(WebCore::JSTestGenerateIsReachablePrototype::finishCreation):
(WebCore::jsTestGenerateIsReachableASecretAttribute):
* bindings/scripts/test/JS/JSTestGlobalObject.cpp:
(WebCore::jsTestGlobalObjectRegularAttribute):
* bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
(WebCore::JSTestIndexedSetterNoIdentifierPrototype::finishCreation):
* bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
(WebCore::JSTestIndexedSetterThrowingExceptionPrototype::finishCreation):
* bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
(WebCore::JSTestIndexedSetterWithIdentifierPrototype::finishCreation):
* bindings/scripts/test/JS/JSTestInterface.cpp:
(WebCore::JSTestInterfaceConstructor::initializeProperties):
(WebCore::JSTestInterfacePrototype::finishCreation):
(WebCore::jsTestInterfaceImplementsStr1):
(WebCore::jsTestInterfaceImplementsStr2):
(WebCore::jsTestInterfaceImplementsStr3):
(WebCore::jsTestInterfaceImplementsNode):
(WebCore::jsTestInterfaceSupplementalStr1):
(WebCore::jsTestInterfaceSupplementalStr2):
(WebCore::jsTestInterfaceSupplementalStr3):
(WebCore::jsTestInterfaceSupplementalNode):
* bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
(WebCore::JSTestInterfaceLeadingUnderscorePrototype::finishCreation):
(WebCore::jsTestInterfaceLeadingUnderscoreReadonly):
* bindings/scripts/test/JS/JSTestIterable.cpp:
(WebCore::JSTestIterablePrototype::finishCreation):
* bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
(WebCore::JSTestJSBuiltinConstructorPrototype::finishCreation):
(WebCore::jsTestJSBuiltinConstructorTestAttributeCustom):
(WebCore::jsTestJSBuiltinConstructorTestAttributeRWCustom):
* bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
(WebCore::JSTestMediaQueryListListenerPrototype::finishCreation):
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
(WebCore::JSTestNamedAndIndexedSetterNoIdentifierPrototype::finishCreation):
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
(WebCore::JSTestNamedAndIndexedSetterThrowingExceptionPrototype::finishCreation):
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
(WebCore::JSTestNamedAndIndexedSetterWithIdentifierPrototype::finishCreation):
* bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
(WebCore::JSTestNamedConstructorPrototype::finishCreation):
* bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
(WebCore::JSTestNamedDeleterNoIdentifierPrototype::finishCreation):
* bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
(WebCore::JSTestNamedDeleterThrowingExceptionPrototype::finishCreation):
* bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
(WebCore::JSTestNamedDeleterWithIdentifierPrototype::finishCreation):
* bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
(WebCore::JSTestNamedDeleterWithIndexedGetterPrototype::finishCreation):
* bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
(WebCore::JSTestNamedGetterCallWithPrototype::finishCreation):
* bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
(WebCore::JSTestNamedGetterNoIdentifierPrototype::finishCreation):
* bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
(WebCore::JSTestNamedGetterWithIdentifierPrototype::finishCreation):
* bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
(WebCore::JSTestNamedSetterNoIdentifierPrototype::finishCreation):
* bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
(WebCore::JSTestNamedSetterThrowingExceptionPrototype::finishCreation):
* bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
(WebCore::JSTestNamedSetterWithIdentifierPrototype::finishCreation):
* bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
(WebCore::JSTestNamedSetterWithIndexedGetterPrototype::finishCreation):
* bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
(WebCore::JSTestNamedSetterWithIndexedGetterAndSetterPrototype::finishCreation):
* bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
(WebCore::JSTestNamedSetterWithOverrideBuiltinsPrototype::finishCreation):
* bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
(WebCore::JSTestNamedSetterWithUnforgablePropertiesPrototype::finishCreation):
(WebCore::jsTestNamedSetterWithUnforgablePropertiesUnforgeableAttribute):
* bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
(WebCore::JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsPrototype::finishCreation):
(WebCore::jsTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsUnforgeableAttribute):
* bindings/scripts/test/JS/JSTestNode.cpp:
(WebCore::JSTestNodePrototype::finishCreation):
(WebCore::jsTestNodeName):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::JSTestObjConstructor::initializeProperties):
(WebCore::JSTestObjPrototype::finishCreation):
(WebCore::jsTestObjReadOnlyLongAttr):
(WebCore::jsTestObjReadOnlyStringAttr):
(WebCore::jsTestObjReadOnlyTestObjAttr):
(WebCore::jsTestObjEnumAttr):
(WebCore::jsTestObjByteAttr):
(WebCore::jsTestObjOctetAttr):
(WebCore::jsTestObjShortAttr):
(WebCore::jsTestObjClampedShortAttr):
(WebCore::jsTestObjEnforceRangeShortAttr):
(WebCore::jsTestObjUnsignedShortAttr):
(WebCore::jsTestObjLongAttr):
(WebCore::jsTestObjLongLongAttr):
(WebCore::jsTestObjUnsignedLongLongAttr):
(WebCore::jsTestObjStringAttr):
(WebCore::jsTestObjUsvstringAttr):
(WebCore::jsTestObjTestObjAttr):
(WebCore::jsTestObjTestNullableObjAttr):
(WebCore::jsTestObjUnforgeableAttr):
(WebCore::jsTestObjStringAttrTreatingNullAsEmptyString):
(WebCore::jsTestObjUsvstringAttrTreatingNullAsEmptyString):
(WebCore::jsTestObjByteStringAttrTreatingNullAsEmptyString):
(WebCore::jsTestObjStringLongRecordAttr):
(WebCore::jsTestObjUsvstringLongRecordAttr):
(WebCore::jsTestObjStringObjRecordAttr):
(WebCore::jsTestObjStringNullableObjRecordAttr):
(WebCore::jsTestObjDictionaryAttr):
(WebCore::jsTestObjNullableDictionaryAttr):
(WebCore::jsTestObjAnnotatedTypeInUnionAttr):
(WebCore::jsTestObjAnnotatedTypeInSequenceAttr):
(WebCore::jsTestObjImplementationEnumAttr):
(WebCore::jsTestObjXMLObjAttr):
(WebCore::jsTestObjCreate):
(WebCore::jsTestObjReflectedStringAttr):
(WebCore::jsTestObjReflectedUSVStringAttr):
(WebCore::jsTestObjReflectedIntegralAttr):
(WebCore::jsTestObjReflectedUnsignedIntegralAttr):
(WebCore::jsTestObjReflectedBooleanAttr):
(WebCore::jsTestObjReflectedURLAttr):
(WebCore::jsTestObjReflectedUSVURLAttr):
(WebCore::jsTestObjReflectedCustomIntegralAttr):
(WebCore::jsTestObjReflectedCustomBooleanAttr):
(WebCore::jsTestObjReflectedCustomURLAttr):
(WebCore::jsTestObjEnabledAtRuntimeAttribute):
(WebCore::jsTestObjEnabledBySettingAttribute):
(WebCore::jsTestObjTypedArrayAttr):
(WebCore::jsTestObjAttributeWithGetterException):
(WebCore::jsTestObjAttributeWithSetterException):
(WebCore::jsTestObjStringAttrWithGetterException):
(WebCore::jsTestObjStringAttrWithSetterException):
(WebCore::jsTestObjCustomAttr):
(WebCore::jsTestObjOnfoo):
(WebCore::jsTestObjOnwebkitfoo):
(WebCore::jsTestObjWithScriptStateAttribute):
(WebCore::jsTestObjWithCallWithAndSetterCallWithAttribute):
(WebCore::jsTestObjWithScriptExecutionContextAttribute):
(WebCore::jsTestObjWithScriptStateAttributeRaises):
(WebCore::jsTestObjWithScriptExecutionContextAttributeRaises):
(WebCore::jsTestObjWithScriptExecutionContextAndScriptStateAttribute):
(WebCore::jsTestObjWithScriptExecutionContextAndScriptStateAttributeRaises):
(WebCore::jsTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute):
(WebCore::jsTestObjConditionalAttr1):
(WebCore::jsTestObjConditionalAttr2):
(WebCore::jsTestObjConditionalAttr3):
(WebCore::jsTestObjCachedAttribute1):
(WebCore::jsTestObjCachedAttribute2):
(WebCore::jsTestObjAnyAttribute):
(WebCore::jsTestObjObjectAttribute):
(WebCore::jsTestObjContentDocument):
(WebCore::jsTestObjMutablePoint):
(WebCore::jsTestObjStrawberry):
(WebCore::jsTestObjDescription):
(WebCore::jsTestObjId):
(WebCore::jsTestObjHash):
(WebCore::jsTestObjReplaceableAttribute):
(WebCore::jsTestObjNullableDoubleAttribute):
(WebCore::jsTestObjNullableLongAttribute):
(WebCore::jsTestObjNullableBooleanAttribute):
(WebCore::jsTestObjNullableStringAttribute):
(WebCore::jsTestObjNullableLongSettableAttribute):
(WebCore::jsTestObjNullableStringSettableAttribute):
(WebCore::jsTestObjNullableUSVStringSettableAttribute):
(WebCore::jsTestObjNullableByteStringSettableAttribute):
(WebCore::jsTestObjNullableStringValue):
(WebCore::jsTestObjAttribute):
(WebCore::jsTestObjAttributeWithReservedEnumType):
(WebCore::jsTestObjPutForwardsAttribute):
(WebCore::jsTestObjPutForwardsNullableAttribute):
(WebCore::jsTestObjStringifierAttribute):
(WebCore::jsTestObjConditionallyReadWriteAttribute):
(WebCore::jsTestObjConditionalAndConditionallyReadWriteAttribute):
* bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
(WebCore::JSTestOverloadedConstructorsPrototype::finishCreation):
* bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
(WebCore::JSTestOverloadedConstructorsWithSequencePrototype::finishCreation):
* bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
(WebCore::JSTestOverrideBuiltinsPrototype::finishCreation):
* bindings/scripts/test/JS/JSTestPluginInterface.cpp:
(WebCore::JSTestPluginInterfacePrototype::finishCreation):
* bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
(WebCore::JSTestPromiseRejectionEventPrototype::finishCreation):
(WebCore::jsTestPromiseRejectionEventReason):
* bindings/scripts/test/JS/JSTestSerialization.cpp:
(WebCore::JSTestSerializationPrototype::finishCreation):
(WebCore::jsTestSerializationFirstStringAttribute):
(WebCore::jsTestSerializationSecondLongAttribute):
(WebCore::jsTestSerializationThirdUnserializableAttribute):
(WebCore::jsTestSerializationFourthUnrestrictedDoubleAttribute):
(WebCore::jsTestSerializationFifthLongAttribute):
(WebCore::jsTestSerializationSixthTypedefAttribute):
(WebCore::jsTestSerializationSeventhDirectlySerializableAttribute):
(WebCore::jsTestSerializationEighthIndirectlyAttribute):
* bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp:
(WebCore::JSTestSerializationIndirectInheritancePrototype::finishCreation):
* bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
(WebCore::JSTestSerializationInheritPrototype::finishCreation):
(WebCore::jsTestSerializationInheritInheritLongAttribute):
* bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
(WebCore::JSTestSerializationInheritFinalPrototype::finishCreation):
(WebCore::jsTestSerializationInheritFinalFinalLongAttributeFoo):
(WebCore::jsTestSerializationInheritFinalFinalLongAttributeBar):
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
(WebCore::JSTestSerializedScriptValueInterfacePrototype::finishCreation):
(WebCore::jsTestSerializedScriptValueInterfaceValue):
(WebCore::jsTestSerializedScriptValueInterfaceReadonlyValue):
(WebCore::jsTestSerializedScriptValueInterfaceCachedValue):
(WebCore::jsTestSerializedScriptValueInterfacePorts):
(WebCore::jsTestSerializedScriptValueInterfaceCachedReadonlyValue):
* bindings/scripts/test/JS/JSTestStringifier.cpp:
(WebCore::JSTestStringifierPrototype::finishCreation):
* bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
(WebCore::JSTestStringifierAnonymousOperationPrototype::finishCreation):
* bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
(WebCore::JSTestStringifierNamedOperationPrototype::finishCreation):
* bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
(WebCore::JSTestStringifierOperationImplementedAsPrototype::finishCreation):
* bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
(WebCore::JSTestStringifierOperationNamedToStringPrototype::finishCreation):
* bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
(WebCore::JSTestStringifierReadOnlyAttributePrototype::finishCreation):
(WebCore::jsTestStringifierReadOnlyAttributeIdentifier):
* bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
(WebCore::JSTestStringifierReadWriteAttributePrototype::finishCreation):
(WebCore::jsTestStringifierReadWriteAttributeIdentifier):
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
(WebCore::JSTestTypedefsConstructor::initializeProperties):
(WebCore::JSTestTypedefsPrototype::finishCreation):
(WebCore::jsTestTypedefsUnsignedLongLongAttr):
(WebCore::jsTestTypedefsSerializedScriptValue):
(WebCore::jsTestTypedefsAttributeWithClamp):
(WebCore::jsTestTypedefsAttributeWithClampInTypedef):
(WebCore::jsTestTypedefsAttrWithGetterException):
(WebCore::jsTestTypedefsAttrWithSetterException):
(WebCore::jsTestTypedefsStringAttrWithGetterException):
(WebCore::jsTestTypedefsStringAttrWithSetterException):
(WebCore::jsTestTypedefsBufferSourceAttr):
(WebCore::jsTestTypedefsDomTimeStampAttr):
They are binding test rebaselines.

* domjit/DOMJITIDLTypeFilter.h:
* domjit/JSDocumentDOMJIT.cpp:
(WebCore::compileDocumentDocumentElementAttribute):
(WebCore::compileDocumentBodyAttribute):
(WebCore::DocumentDocumentElementDOMJIT::callDOMGetter): Deleted.
(WebCore::DocumentBodyDOMJIT::callDOMGetter): Deleted.
* domjit/JSNodeDOMJIT.cpp:
(WebCore::compileNodeFirstChildAttribute):
(WebCore::compileNodeLastChildAttribute):
(WebCore::compileNodeNextSiblingAttribute):
(WebCore::compileNodePreviousSiblingAttribute):
(WebCore::compileNodeParentNodeAttribute):
(WebCore::compileNodeNodeTypeAttribute):
(WebCore::compileNodeOwnerDocumentAttribute):
(WebCore::NodeFirstChildDOMJIT::callDOMGetter): Deleted.
(WebCore::NodeLastChildDOMJIT::callDOMGetter): Deleted.
(WebCore::NodeNextSiblingDOMJIT::callDOMGetter): Deleted.
(WebCore::NodePreviousSiblingDOMJIT::callDOMGetter): Deleted.
(WebCore::NodeParentNodeDOMJIT::callDOMGetter): Deleted.
(WebCore::NodeNodeTypeDOMJIT::callDOMGetter): Deleted.
(WebCore::NodeOwnerDocumentDOMJIT::callDOMGetter): Deleted.
DOMJIT::GetterSetter becomes smaller constexpr data.

LayoutTests:

* js/dom/dom-getters-type-check-expected.txt: Added.
* js/dom/dom-getters-type-check.html: Added.

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

2 years ago[GStreamer][EME] Not having a key id buffer should not always error
calvaris@igalia.com [Thu, 27 Jul 2017 10:39:21 +0000 (10:39 +0000)]
[GStreamer][EME] Not having a key id buffer should not always error
https://bugs.webkit.org/show_bug.cgi?id=174889

Reviewed by Žan Doberšek.

In r219946 we introduced a hard requirement for a key id buffer
that does not happen for all CDMs.

* platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
(webKitMediaClearKeyDecryptorSetupCipher): Check for key id buffer
and error if we didn't get it.
* platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
(webkitMediaCommonEncryptionDecryptTransformInPlace): Soften the
requirement for key id buffer.

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

2 years ago[GStreamer][EME] Fix phony debug output in player base for supported key system
calvaris@igalia.com [Thu, 27 Jul 2017 10:18:18 +0000 (10:18 +0000)]
[GStreamer][EME] Fix phony debug output in player base for supported key system
https://bugs.webkit.org/show_bug.cgi?id=174888

Reviewed by Žan Doberšek.

The debug output was returning always false because that method
was not checking anything before. Now it is and should reflect it.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::supportsKeySystem):

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

2 years ago[EME][GStreamer] Add barebones CDM interface implementations for ClearKey
zandobersek@gmail.com [Thu, 27 Jul 2017 08:55:09 +0000 (08:55 +0000)]
[EME][GStreamer] Add barebones CDM interface implementations for ClearKey
https://bugs.webkit.org/show_bug.cgi?id=174887

Reviewed by Xabier Rodriguez-Calvar.

Add empty ClearKey derivations of CDMFactory, CDMPrivate and CDMInstance
classes. These will be enhanced as the implementation progresses.

ClearKey is added to CDMInstance::ImplementationType, and the
CDMInstanceClearKey::implementationType() override returns that value.
Type traits specialization for the CDMInstanceClearKey class is also
added, utilizing the CDMInstance::ImplementationType::ClearKey value.

The implementation file is added to the WPE build, along with the
necessary inclusion directory.

* PlatformWPE.cmake:
* platform/encryptedmedia/CDMInstance.h:
* platform/encryptedmedia/clearkey/CDMClearKey.cpp: Added.
(WebCore::CDMFactoryClearKey::createCDM):
(WebCore::CDMFactoryClearKey::supportsKeySystem):
(WebCore::CDMPrivateClearKey::supportsInitDataType):
(WebCore::CDMPrivateClearKey::supportsConfiguration):
(WebCore::CDMPrivateClearKey::supportsConfigurationWithRestrictions):
(WebCore::CDMPrivateClearKey::supportsSessionTypeWithConfiguration):
(WebCore::CDMPrivateClearKey::supportsRobustness):
(WebCore::CDMPrivateClearKey::distinctiveIdentifiersRequirement):
(WebCore::CDMPrivateClearKey::persistentStateRequirement):
(WebCore::CDMPrivateClearKey::distinctiveIdentifiersAreUniquePerOriginAndClearable):
(WebCore::CDMPrivateClearKey::createInstance):
(WebCore::CDMPrivateClearKey::loadAndInitialize):
(WebCore::CDMPrivateClearKey::supportsServerCertificates):
(WebCore::CDMPrivateClearKey::supportsSessions):
(WebCore::CDMPrivateClearKey::supportsInitData):
(WebCore::CDMPrivateClearKey::sanitizeResponse):
(WebCore::CDMPrivateClearKey::sanitizeSessionId):
(WebCore::CDMInstanceClearKey::initializeWithConfiguration):
(WebCore::CDMInstanceClearKey::setDistinctiveIdentifiersAllowed):
(WebCore::CDMInstanceClearKey::setPersistentStateAllowed):
(WebCore::CDMInstanceClearKey::setServerCertificate):
(WebCore::CDMInstanceClearKey::requestLicense):
(WebCore::CDMInstanceClearKey::updateLicense):
(WebCore::CDMInstanceClearKey::loadSession):
(WebCore::CDMInstanceClearKey::closeSession):
(WebCore::CDMInstanceClearKey::removeSessionData):
(WebCore::CDMInstanceClearKey::storeRecordOfKeyUsage):
* platform/encryptedmedia/clearkey/CDMClearKey.h: Added.

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

2 years ago[EME] Allow CDMInstance type traits specialization
zandobersek@gmail.com [Thu, 27 Jul 2017 08:13:55 +0000 (08:13 +0000)]
[EME] Allow CDMInstance type traits specialization
https://bugs.webkit.org/show_bug.cgi?id=174886

Reviewed by Xabier Rodriguez-Calvar.

Allow using the trait-based type casting for the CDMInstance class and its
derivatives. ImplementationType enumeration values are to be used and
returned from the new implementationType() virtual method. This method is
leveraged in the type trait specialization that enables using is<>() and
downcast<>() helpers for CDMInstance objects.

This will allow differentiating between CDMInstance implementations once
the media playback pipeline has to retrieve any key information that's
necessary for playback of encrypted content.

MockCDMInstance class overrides the implementationType() method, returning
the ImplementationType::Mock value. Type trait specializations for this
class aren't added since they're not needed anywhere at this point.

* platform/encryptedmedia/CDMInstance.h:
* testing/MockCDMFactory.h:

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

2 years ago[GCrypt] Key serialization support
zandobersek@gmail.com [Thu, 27 Jul 2017 08:13:02 +0000 (08:13 +0000)]
[GCrypt] Key serialization support
https://bugs.webkit.org/show_bug.cgi?id=173883

Reviewed by Jiewen Tan.

Source/WebCore:

Implement crypto key serialization for platforms that use libgcrypt.

Despite the function names and the existing implementation for the Mac port,
we don't perform the KEK wrapping and unwrapping due to the review feedback
advising against it.

Instead the passed-in key data is simply copied and returned as the result of
the 'wrapping' operation, and similarly the passed-in serialized data is simply
copied and returned as the result of the 'unwrapping' operation.

No new tests -- related tests are now passing and are unskipped.

* crypto/gcrypt/SerializedCryptoKeyWrapGCrypt.cpp:
(WebCore::getDefaultWebCryptoMasterKey):
(WebCore::wrapSerializedCryptoKey):
(WebCore::unwrapSerializedCryptoKey):

LayoutTests:

* platform/wpe/TestExpectations: Unskip the crypto/worker/ tests that
utilize key serialization and are now passing.

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

2 years agoResourceLoadStatistics API tests fail on El Capitan.
beidson@apple.com [Thu, 27 Jul 2017 02:47:20 +0000 (02:47 +0000)]
ResourceLoadStatistics API tests fail on El Capitan.
https://bugs.webkit.org/show_bug.cgi?id=174877

Reviewed by Chris Dumez.

Always install the testing callback.

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

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

2 years agoREGRESSION (r211160): Can't pinch to zoom unlocked encrypted PDFs in WKWebView
timothy_horton@apple.com [Thu, 27 Jul 2017 01:49:44 +0000 (01:49 +0000)]
REGRESSION (r211160): Can't pinch to zoom unlocked encrypted PDFs in WKWebView
https://bugs.webkit.org/show_bug.cgi?id=174881
<rdar://problem/33556312>

Reviewed by Andy Estes.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _hidePasswordView]):
WKPasswordView saves and restores a bunch of scroll view properties, including
those relating to zoom limits. The restoration happens in -[WKPasswordView hide],
which is never called. Instead, the code added in r211160 just calls
removeFromSuperview after unlocking, never restoring the old zoom limits,
causing the then fully unlocked PDF to not be zoomable. Fix this by calling
-hide instead of -removeFromSuperview (which -hide also calls).

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

2 years agoUncaught Exception: undefined is not an object (evaluating 'this._memoryRow.value...
drousso@apple.com [Thu, 27 Jul 2017 00:13:20 +0000 (00:13 +0000)]
Uncaught Exception: undefined is not an object (evaluating 'this._memoryRow.value = Number.bytesToString(this._canvas.memoryCost)')
https://bugs.webkit.org/show_bug.cgi?id=174823

Reviewed by Joseph Pecoraro.

* UserInterface/Views/CanvasDetailsSidebarPanel.js:
(WebInspector.CanvasDetailsSidebarPanel.prototype._refreshIdentitySection):
(WebInspector.CanvasDetailsSidebarPanel.prototype._refreshSourceSection):
(WebInspector.CanvasDetailsSidebarPanel.prototype._refreshAttributesSection):
(WebInspector.CanvasDetailsSidebarPanel.prototype._refreshCSSCanvasSection):
(WebInspector.CanvasDetailsSidebarPanel.prototype._formatMemoryRow):
Early return if the view has not called initialLayout, as the rows might not have been
constructed yet.

* UserInterface/Views/View.js:
(WebInspector.View.prototype.get didInitialLayout): Added.

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

2 years agoImplement new TextMetrics, returned by canvas measureText()
commit-queue@webkit.org [Wed, 26 Jul 2017 23:53:26 +0000 (23:53 +0000)]
Implement new TextMetrics, returned by canvas measureText()
https://bugs.webkit.org/show_bug.cgi?id=82798
Source/WebCore:

<rdar://problem/11159332>

Patch by Arnaud Renevier  <a.renevier@sisa.samsung.com> and Fujii Hironori <Hironori.Fujii@sony.com> on 2017-07-26
Reviewed by Dean Jackson.

The specification: https://html.spec.whatwg.org/multipage/canvas.html#dom-context-2d-measuretext

Add new attributes to TextMetrics.

Add a new method textOffset() of CanvasRenderingContext2D by
extracting from drawTextInternal() to use the same horizontal and
vertical offsets of a text in both drawTextInternal() and
measureText().

Test: fast/canvas/canvas-measureText-2.html

* html/TextMetrics.h:
(WebCore::TextMetrics::actualBoundingBoxLeft):
(WebCore::TextMetrics::setActualBoundingBoxLeft):
(WebCore::TextMetrics::actualBoundingBoxRight):
(WebCore::TextMetrics::setActualBoundingBoxRight):
(WebCore::TextMetrics::fontBoundingBoxAscent):
(WebCore::TextMetrics::setFontBoundingBoxAscent):
(WebCore::TextMetrics::fontBoundingBoxDescent):
(WebCore::TextMetrics::setFontBoundingBoxDescent):
(WebCore::TextMetrics::actualBoundingBoxAscent):
(WebCore::TextMetrics::setActualBoundingBoxAscent):
(WebCore::TextMetrics::actualBoundingBoxDescent):
(WebCore::TextMetrics::setActualBoundingBoxDescent):
(WebCore::TextMetrics::emHeightAscent):
(WebCore::TextMetrics::setEmHeightAscent):
(WebCore::TextMetrics::emHeightDescent):
(WebCore::TextMetrics::setEmHeightDescent):
(WebCore::TextMetrics::hangingBaseline):
(WebCore::TextMetrics::setHangingBaseline):
(WebCore::TextMetrics::alphabeticBaseline):
(WebCore::TextMetrics::setAlphabeticBaseline):
(WebCore::TextMetrics::ideographicBaseline):
(WebCore::TextMetrics::setIdeographicBaseline):
Added getters and setters.
(WebCore::TextMetrics::TextMetrics): Deleted.
* html/TextMetrics.idl: Added new attributes.
* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::FontProxy::fontMetrics):
Changed the return value type to a const reference of FontMetrics
not to copy it.
(WebCore::CanvasRenderingContext2D::FontProxy::width):
Added the second arguemnt of GlyphOverflow type.
(WebCore::CanvasRenderingContext2D::measureText): Calculate and
set the new attributes of TextMetrics.
(WebCore::CanvasRenderingContext2D::textOffset): Extracted from drawTextInternal.
(WebCore::CanvasRenderingContext2D::drawTextInternal): Removed the
offset calculation code and call textOffset.
* html/canvas/CanvasRenderingContext2D.h: Added the method
declaration of textOffset. Change types of fontMetrics and width
methods.
* platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
(WebCore::FontCascade::floatWidthForComplexText): Added a dummy
implementation of calculating GlyphOverflow.

LayoutTests:

Patch by Arnaud Renevier  <a.renevier@sisa.samsung.com> and Fujii Hironori <Hironori.Fujii@sony.com> on 2017-07-26
Reviewed by Dean Jackson.

Create a test that checks that:
     - ascent + descent is greater than zero
     - actualBoundingBoxLeft + actualBoundingBoxRight is somewhere
       quite close to width
     - when baseline is top, emHeightAscent is 0 (respectively
       bottom/emHeightDescent)
     - when baseline is hanging, hangingBaseline in 0 (respectively
       alphabetic and ideographic)
     - order of different vertical measures (for example,
       emHeightAscent is always higher that alphabeticBaseline)

* fast/canvas/canvas-measureText-2-expected.txt: Added.
* fast/canvas/canvas-measureText-2.html: Added.

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

2 years agoWebAssembly: test throwing out of the start function
jfbastien@apple.com [Wed, 26 Jul 2017 23:29:25 +0000 (23:29 +0000)]
WebAssembly: test throwing out of the start function
https://bugs.webkit.org/show_bug.cgi?id=165714
<rdar://problem/29760251>

Reviewed by Keith Miller.

* wasm/assert.js:
* wasm/function-tests/trap-from-start.js: Added.
(StartTraps):
* wasm/function-tests/trap-from-start-async.js: Added.
(async.StartTrapsAsync):

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

2 years agoMarked Multiple imported/w3c/web-platform-tests/ as failing.
jlewis3@apple.com [Wed, 26 Jul 2017 22:57:06 +0000 (22:57 +0000)]
Marked Multiple imported/w3c/web-platform-tests/ as failing.
<rdar://problem/33251388>

Unreviewed test gardening.

* platform/ios-11/TestExpectations:

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

2 years agoRebaselined http/tests/quicklook/top-navigation-blocked-expected.txt.
jlewis3@apple.com [Wed, 26 Jul 2017 22:57:04 +0000 (22:57 +0000)]
Rebaselined http/tests/quicklook/top-navigation-blocked-expected.txt.
https://bugs.webkit.org/show_bug.cgi?id=174755

Unreviewed test gardening.

* platform/ios-11/http/tests/quicklook/top-navigation-blocked-expected.txt:

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

2 years agoRename {Web/UI}Process/Storage to {Web/UI}Process/WebStorage.
beidson@apple.com [Wed, 26 Jul 2017 22:52:39 +0000 (22:52 +0000)]
Rename {Web/UI}Process/Storage to {Web/UI}Process/WebStorage.
https://bugs.webkit.org/show_bug.cgi?id=174871

Reviewed by Chris Dumez.

The standard these directories help implement is the "Web Storage" standard.
"Storage" is too general of a word that we have plans to start using in other contexts soon.

* CMakeLists.txt:
* DerivedSources.make:
* PlatformGTK.cmake:
* PlatformMac.cmake:
* PlatformWPE.cmake:
* WebKit.xcodeproj/project.pbxproj:

* UIProcess/ResourceLoadStatisticsPersistentStorage.cpp: Renamed from Source/WebKit/UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.cpp.
* UIProcess/ResourceLoadStatisticsPersistentStorage.h: Renamed from Source/WebKit/UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.h.
* UIProcess/WebStorage/LocalStorageDatabase.cpp: Renamed from Source/WebKit/UIProcess/Storage/LocalStorageDatabase.cpp.
* UIProcess/WebStorage/LocalStorageDatabase.h: Renamed from Source/WebKit/UIProcess/Storage/LocalStorageDatabase.h.
* UIProcess/WebStorage/LocalStorageDatabaseTracker.cpp: Renamed from Source/WebKit/UIProcess/Storage/LocalStorageDatabaseTracker.cpp.
* UIProcess/WebStorage/LocalStorageDatabaseTracker.h: Renamed from Source/WebKit/UIProcess/Storage/LocalStorageDatabaseTracker.h.
* UIProcess/WebStorage/StorageManager.cpp: Renamed from Source/WebKit/UIProcess/Storage/StorageManager.cpp.
* UIProcess/WebStorage/StorageManager.h: Renamed from Source/WebKit/UIProcess/Storage/StorageManager.h.
* UIProcess/WebStorage/StorageManager.messages.in: Renamed from Source/WebKit/UIProcess/Storage/StorageManager.messages.in.
* UIProcess/WebStorage/ios/LocalStorageDatabaseTrackerIOS.mm: Renamed from Source/WebKit/UIProcess/Storage/ios/LocalStorageDatabaseTrackerIOS.mm.
* UIProcess/ios/ResourceLoadStatisticsPersistentStorageIOS.mm: Renamed from Source/WebKit/UIProcess/Storage/ios/ResourceLoadStatisticsPersistentStorageIOS.mm.

* WebProcess/WebStorage/StorageAreaImpl.cpp: Renamed from Source/WebKit/WebProcess/Storage/StorageAreaImpl.cpp.
* WebProcess/WebStorage/StorageAreaImpl.h: Renamed from Source/WebKit/WebProcess/Storage/StorageAreaImpl.h.
* WebProcess/WebStorage/StorageAreaMap.cpp: Renamed from Source/WebKit/WebProcess/Storage/StorageAreaMap.cpp.
* WebProcess/WebStorage/StorageAreaMap.h: Renamed from Source/WebKit/WebProcess/Storage/StorageAreaMap.h.
* WebProcess/WebStorage/StorageAreaMap.messages.in: Renamed from Source/WebKit/WebProcess/Storage/StorageAreaMap.messages.in.
* WebProcess/WebStorage/StorageNamespaceImpl.cpp: Renamed from Source/WebKit/WebProcess/Storage/StorageNamespaceImpl.cpp.
* WebProcess/WebStorage/StorageNamespaceImpl.h: Renamed from Source/WebKit/WebProcess/Storage/StorageNamespaceImpl.h.
* WebProcess/WebStorage/WebStorageNamespaceProvider.cpp: Renamed from Source/WebKit/WebProcess/Storage/WebStorageNamespaceProvider.cpp.
* WebProcess/WebStorage/WebStorageNamespaceProvider.h: Renamed from Source/WebKit/WebProcess/Storage/WebStorageNamespaceProvider.h.

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

2 years agoMake run-javascriptcore-test run testair, testb3, and testmasm.
mark.lam@apple.com [Wed, 26 Jul 2017 22:15:21 +0000 (22:15 +0000)]
Make run-javascriptcore-test run testair, testb3, and testmasm.
https://bugs.webkit.org/show_bug.cgi?id=174837
<rdar://problem/33522927>

Reviewed by Saam Barati and Filip Pizlo.

1. Refactors code for running testapi so that we can use it to run other tests.
2. Added running of testmasm, testair, testb3.

Note: the existing testapi invocation code does not support remote invocation of
the tests (e.g. on a ARM device).  Hence, the new additions of testmasm, testair,
and testb3 also do not support remote invocation.  If we wish to add remote
invocation support, we should do that in a separate patch.

* Scripts/run-javascriptcore-tests:
(testPath):
(runTest):
(testapiPath): Deleted.

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

2 years agoWeb Inspector: create protocol for recording Canvas contexts
drousso@apple.com [Wed, 26 Jul 2017 21:45:22 +0000 (21:45 +0000)]
Web Inspector: create protocol for recording Canvas contexts
https://bugs.webkit.org/show_bug.cgi?id=174481

Reviewed by Joseph Pecoraro.

Source/JavaScriptCore:

* inspector/protocol/Canvas.json:
 - Add `requestRecording` command to mark the provided canvas as having requested a recording.
 - Add `cancelRecording` command to clear a previously marked canvas and flush any recorded data.
 - Add `recordingFinished` event that is fired once a recording is finished.

* CMakeLists.txt:
* DerivedSources.make:
* inspector/protocol/Recording.json: Added.
 - Add `Type` enum that lists the types of recordings
 - Add `InitialState` type that contains information about the canvas context at the
   beginning of the recording.
 - Add `Frame` type that holds a list of actions that were recorded.
 - Add `Recording` type as the container object of recording data.

* inspector/scripts/codegen/generate_js_backend_commands.py:
(JSBackendCommandsGenerator.generate_domain):
Create an agent for domains with no events or commands.

* inspector/InspectorValues.h:
Make Array `get` public so that values can be retrieved if needed.

Source/WebCore:

Currently, a recording doesn't actually "start" until an action is performed on the context.
This change adds the recording logic, but it does not use it anywhere. Additonal tests will
be added in the patches that add uses:
 - <https://webkit.org/b/174482> Web Inspector: Record actions performed on CanvasRenderingContext2D
 - <https://webkit.org/b/174483> Web Inspector: Record actions performed on WebGLRenderingContext

Test: inspector/model/recording.html

* bindings/scripts/IDLAttributes.json:
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateAttributeGetterBodyDefinition):
(GenerateAttributeSetterBodyDefinition):
(GenerateImplementationFunctionCall):
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/CallTracer.h: Added.
* bindings/js/CallTracer.cpp: Added.
(WebCore::CallTracer::recordCanvasAction):
* bindings/js/CallTracerTypes.h: Added.
* bindings/scripts/test/TestCallTracer.idl: Added.
* bindings/scripts/test/JS/JSTestCallTracer.h: Added.
* bindings/scripts/test/JS/JSTestCallTracer.cpp: Added.

Create new IDL extended attribute called "CallTracingCallback" that will add code to call a
static function on CallTracer with the given extended attribute value as the function name,
the `impl` object as the first parameter, the name of the attribute/operation as the second,
and an optional object that accepts an initializer list of all the parameters as the third.

This function will not be called, however, unless a `callTracingActive` function on the
`impl` object returns true, and this is marked as UNLIKELY.

"CallTracingCallback" can be added to an Interface, in which case it will apply to all
attributes/operations of the generated class, or an individual Attribute/Operation.

* html/canvas/CanvasRenderingContext.h:
(WebCore::CanvasRenderingContext::callTracingActive):
(WebCore::CanvasRenderingContext::setCallTracingActive):

* inspector/InspectorCanvas.h:
* inspector/InspectorCanvas.cpp:
(WebCore::InspectorCanvas::~InspectorCanvas):
(WebCore::InspectorCanvas::resetRecordingData):
(WebCore::InspectorCanvas::hasRecordingData):
(WebCore::InspectorCanvas::recordAction):
(WebCore::InspectorCanvas::releaseInitialState):
(WebCore::InspectorCanvas::releaseFrames):
(WebCore::InspectorCanvas::releaseData):
(WebCore::InspectorCanvas::markNewFrame):
(WebCore::InspectorCanvas::markCurrentFrameIncomplete):
(WebCore::InspectorCanvas::setBufferLimit):
(WebCore::InspectorCanvas::hasBufferSpace):
(WebCore::InspectorCanvas::singleFrame):
(WebCore::InspectorCanvas::setSingleFrame):
(WebCore::InspectorCanvas::indexForData):
(WebCore::buildArrayForAffineTransform):
(WebCore::buildArrayForVector):
(WebCore::InspectorCanvas::buildInitialState):
(WebCore::InspectorCanvas::buildAction):
(WebCore::InspectorCanvas::buildArrayForCanvasGradient):
(WebCore::InspectorCanvas::buildArrayForCanvasPattern):
(WebCore::InspectorCanvas::buildArrayForImageData):

Hold the recording data on the corresponding InspectorCanvas. Recording Frames are
completed when the HTMLCanvasElement paints or a  0_s timer is fired. A recording is not
considered valid until at least one action is performed on the canvas context. Once that
condition is satisfied, canceling the recording will flush the data.

* inspector/InspectorCanvasAgent.h:
* inspector/InspectorCanvasAgent.cpp:
(WebCore::InspectorCanvasAgent::InspectorCanvasAgent):
(WebCore::InspectorCanvasAgent::disable):
(WebCore::InspectorCanvasAgent::requestRecording):
(WebCore::InspectorCanvasAgent::cancelRecording):
(WebCore::InspectorCanvasAgent::recordCanvasAction):
(WebCore::InspectorCanvasAgent::didFinishRecordingCanvasFrame):
(WebCore::InspectorCanvasAgent::canvasDestroyed):
(WebCore::InspectorCanvasAgent::canvasRecordingTimerFired):
(WebCore::InspectorCanvasAgent::clearCanvasData):

* inspector/InspectorInstrumentation.h:
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::recordCanvasAction):
(WebCore::InspectorInstrumentation::recordCanvasActionImpl):
(WebCore::InspectorInstrumentation::didFinishRecordingCanvasFrameImpl):

* html/canvas/CanvasRenderingContext2D.h:
* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::stringForWindingRule):
(WebCore::CanvasRenderingContext2D::stringForImageSmoothingQuality):

* platform/graphics/Gradient.h:
(WebCore::Gradient::stops):

* svg/SVGPathUtilities.h:
* svg/SVGPathUtilities.cpp:
(WebCore::buildStringFromPath):

Source/WebInspectorUI:

Create model objects that effectively mirror the protocol objects sent for Canvas recordings.

* .eslintrc:
* UserInterface/Main.html:
* UserInterface/Test.html:

* UserInterface/Controllers/CanvasManager.js:
(WebInspector.CanvasManager.prototype.recordingFinished):
* UserInterface/Protocol/CanvasObserver.js:
(WebInspector.CanvasObserver.prototype.recordingFinished):

* UserInterface/Models/Recording.js: Added.
(WebInspector.Recording):
(WebInspector.Recording.fromPayload):
(WebInspector.Recording.prototype.get type):
(WebInspector.Recording.prototype.get initialState):
(WebInspector.Recording.prototype.get frames):
(WebInspector.Recording.prototype.get data):
(WebInspector.Recording.prototype.toJSON):

* UserInterface/Models/RecordingAction.js: Added.
(WebInspector.RecordingAction):
(WebInspector.RecordingAction.fromPayload):
(WebInspector.RecordingAction.prototype.get name):
(WebInspector.RecordingAction.prototype.get parameters):
(WebInspector.RecordingAction.prototype.toJSON):

* UserInterface/Models/RecordingFrame.js: Added.
(WebInspector.RecordingFrame):
(WebInspector.RecordingFrame.fromPayload):
(WebInspector.RecordingFrame.prototype.get actions):
(WebInspector.RecordingFrame.prototype.get incomplete):
(WebInspector.RecordingFrame.prototype.toJSON):

LayoutTests:

* inspector/model/recording-expected.txt: Added.
* inspector/model/recording.html: Added.

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

2 years agoRemove duplicate code from Buildbot.js in dashboard
aakash_jain@apple.com [Wed, 26 Jul 2017 21:38:04 +0000 (21:38 +0000)]
Remove duplicate code from Buildbot.js in dashboard
https://bugs.webkit.org/show_bug.cgi?id=174870

Reviewed by Daniel Bates.

* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/Buildbot.js:
(Buildbot.prototype.javaScriptCoreTestFailuresURLForIteration): Remove duplicate code and reuse buildPageURLForIteration() to construct URL.
(Buildbot.prototype.javaScriptCoreTestStdioUrlForIteration): Ditto.
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/resources/MockBuildbot.js:
(MockBuildbot.prototype.javaScriptCoreTestStdioUrlForIteration): Ditto for tests.

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

2 years agoImplement document.elementsFromPoint
commit-queue@webkit.org [Wed, 26 Jul 2017 20:51:26 +0000 (20:51 +0000)]
Implement document.elementsFromPoint
https://bugs.webkit.org/show_bug.cgi?id=153137

Patch by Ali Juma <ajuma@chromium.org> on 2017-07-26
Reviewed by Simon Fraser.

LayoutTests/imported/w3c:

Add tests from upstream pull request https://github.com/w3c/web-platform-tests/pull/6568.

* web-platform-tests/cssom-view/elementsFromPoint-expected.txt: Added.
* web-platform-tests/cssom-view/elementsFromPoint-iframes-expected.txt: Added.
* web-platform-tests/cssom-view/elementsFromPoint-iframes.html: Added.
* web-platform-tests/cssom-view/elementsFromPoint-invalid-cases-expected.txt: Added.
* web-platform-tests/cssom-view/elementsFromPoint-invalid-cases.html: Added.
* web-platform-tests/cssom-view/elementsFromPoint-shadowroot-expected.txt: Added.
* web-platform-tests/cssom-view/elementsFromPoint-shadowroot.html: Added.
* web-platform-tests/cssom-view/elementsFromPoint-simple-expected.txt: Added.
* web-platform-tests/cssom-view/elementsFromPoint-simple.html: Added.
* web-platform-tests/cssom-view/elementsFromPoint-svg-expected.txt: Added.
* web-platform-tests/cssom-view/elementsFromPoint-svg.html: Added.
* web-platform-tests/cssom-view/elementsFromPoint-table-expected.txt: Added.
* web-platform-tests/cssom-view/elementsFromPoint-table.html: Added.
* web-platform-tests/cssom-view/negativeMargins-expected.txt:
* web-platform-tests/cssom-view/resources/elementsFromPoint.js: Added.
(nodeToString.prototype.else):
(nodeListToString):
(assertElementsFromPoint):
(checkElementsFromPointFourCorners):
* web-platform-tests/cssom-view/resources/iframe1.html: Added.
* web-platform-tests/cssom-view/resources/iframe2.html: Added.

Source/WebCore:

This ports Blink's implementation of elementsFromPoint, from the
following patches by Philip Rogers (pdr@chromium.org):
-https://src.chromium.org/viewvc/blink?revision=190686&view=revision
-https://src.chromium.org/viewvc/blink?revision=191240&view=revision
-https://src.chromium.org/viewvc/blink?revision=199214&view=revision

Tests: imported/w3c/web-platform-tests/cssom-view/elementsFromPoint-iframes.html
       imported/w3c/web-platform-tests/cssom-view/elementsFromPoint-invalid-cases.html
       imported/w3c/web-platform-tests/cssom-view/elementsFromPoint-shadowroot.html
       imported/w3c/web-platform-tests/cssom-view/elementsFromPoint-simple.html
       imported/w3c/web-platform-tests/cssom-view/elementsFromPoint-svg.html
       imported/w3c/web-platform-tests/cssom-view/elementsFromPoint-table.html

* dom/DocumentOrShadowRoot.idl:
* dom/TreeScope.cpp:
(WebCore::absolutePointIfNotClipped):
(WebCore::TreeScope::nodeFromPoint):
(WebCore::TreeScope::elementFromPoint):
(WebCore::TreeScope::elementsFromPoint):
* dom/TreeScope.h:
* page/EventHandler.cpp:
(WebCore::EventHandler::hitTestResultAtPoint):
* rendering/EllipsisBox.cpp:
(WebCore::EllipsisBox::nodeAtPoint):
* rendering/HitTestRequest.h:
(WebCore::HitTestRequest::HitTestRequest):
(WebCore::HitTestRequest::resultIsElementList):
(WebCore::HitTestRequest::includesAllElementsUnderPoint):
* rendering/HitTestResult.cpp:
(WebCore::HitTestResult::HitTestResult):
(WebCore::HitTestResult::operator=):
(WebCore::HitTestResult::addNodeToListBasedTestResult):
(WebCore::HitTestResult::append):
(WebCore::HitTestResult::listBasedTestResult):
(WebCore::HitTestResult::mutableListBasedTestResult):
(WebCore::HitTestResult::addNodeToRectBasedTestResult): Deleted.
(WebCore::HitTestResult::rectBasedTestResult): Deleted.
(WebCore::HitTestResult::mutableRectBasedTestResult): Deleted.
* rendering/HitTestResult.h:
* rendering/InlineFlowBox.cpp:
(WebCore::InlineFlowBox::nodeAtPoint):
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::nodeAtPoint):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::nodeAtPoint):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::nodeAtPoint):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::nodeAtPoint):
* rendering/RenderInline.cpp:
(WebCore::RenderInline::hitTestCulledInline):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::hitTestFixedLayersInNamedFlows):
(WebCore::RenderLayer::hitTestLayer):
(WebCore::RenderLayer::hitTestContents):
(WebCore::RenderLayer::hitTestList):
(WebCore::RenderLayer::calculateClipRects):
* rendering/RenderTable.cpp:
(WebCore::RenderTable::nodeAtPoint):
* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::nodeAtPoint):
* rendering/RenderWidget.cpp:
(WebCore::RenderWidget::nodeAtPoint):
* rendering/SimpleLineLayoutFunctions.cpp:
(WebCore::SimpleLineLayout::hitTestFlow):
* rendering/svg/RenderSVGContainer.cpp:
(WebCore::RenderSVGContainer::nodeAtFloatPoint):
* rendering/svg/RenderSVGImage.cpp:
(WebCore::RenderSVGImage::nodeAtFloatPoint):
* rendering/svg/RenderSVGRoot.cpp:
(WebCore::RenderSVGRoot::nodeAtPoint):
* rendering/svg/RenderSVGShape.cpp:
(WebCore::RenderSVGShape::nodeAtFloatPoint):
* rendering/svg/SVGInlineTextBox.cpp:
(WebCore::SVGInlineTextBox::nodeAtPoint):
* testing/Internals.cpp:
(WebCore::Internals::nodesFromRect):

LayoutTests:

* TestExpectations: Unskip a test.

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

2 years agoRemove DATABASE_PROCESS build flag.
beidson@apple.com [Wed, 26 Jul 2017 20:11:38 +0000 (20:11 +0000)]
Remove DATABASE_PROCESS build flag.
https://bugs.webkit.org/show_bug.cgi?id=174868

Reviewed by Andy Estes.

.:

* Source/cmake/OptionsGTK.cmake:
* Source/cmake/OptionsMac.cmake:
* Source/cmake/OptionsWPE.cmake:
* Source/cmake/WebKitFeatures.cmake:

Source/WebKit:

* CMakeLists.txt:
* DatabaseProcess/DatabaseProcess.cpp:
* DatabaseProcess/DatabaseProcess.h:
* DatabaseProcess/DatabaseProcess.messages.in:
* DatabaseProcess/DatabaseToWebProcessConnection.cpp:
* DatabaseProcess/DatabaseToWebProcessConnection.h:
* DatabaseProcess/DatabaseToWebProcessConnection.messages.in:
* DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in:
* DatabaseProcess/gtk/DatabaseProcessMainGtk.cpp:
* DatabaseProcess/ios/DatabaseProcessIOS.mm:
* DatabaseProcess/mac/DatabaseProcessMac.mm:
* DatabaseProcess/unix/DatabaseProcessMainUnix.h:
* Shared/Databases/DatabaseProcessCreationParameters.cpp:
* Shared/Databases/DatabaseProcessCreationParameters.h:
* Shared/ProcessExecutablePath.h:
* Shared/gtk/ProcessExecutablePathGtk.cpp:
(WebKit::executablePathOfDatabaseProcess):
* Shared/wpe/ProcessExecutablePathWPE.cpp:
(WebKit::executablePathOfDatabaseProcess):
* UIProcess/ChildProcessProxy.cpp:
(WebKit::ChildProcessProxy::getLaunchOptions):
* UIProcess/Databases/DatabaseProcessProxy.cpp:
* UIProcess/Databases/DatabaseProcessProxy.h:
* UIProcess/Databases/DatabaseProcessProxy.messages.in:
* UIProcess/Launcher/ProcessLauncher.h:
* UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp:
(WebKit::ProcessLauncher::launchProcess):
* UIProcess/Launcher/mac/ProcessLauncherMac.mm:
(WebKit::serviceName):
* UIProcess/Launcher/wpe/ProcessLauncherWPE.cpp:
(WebKit::ProcessLauncher::launchProcess):
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::grantSandboxExtensionsToDatabaseProcessForBlobs):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::databaseProcessCrashed):
(WebKit::WebProcessPool::databaseProcessIdentifier):
(WebKit::WebProcessPool::terminateDatabaseProcess):
* UIProcess/WebProcessPool.h:
(WebKit::WebProcessPool::sendToDatabaseProcessRelaunchingIfNecessary):
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::getDatabaseProcessConnection):
* UIProcess/WebProcessProxy.h:
* UIProcess/WebProcessProxy.messages.in:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::fetchDataAndApply):
(WebKit::WebsiteDataStore::removeData):
* WebKit2Prefix.h:
* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.messages.in:
* WebProcess/Databases/WebToDatabaseProcessConnection.cpp:
* WebProcess/Databases/WebToDatabaseProcessConnection.h:
* WebProcess/WebProcess.cpp:
* WebProcess/WebProcess.h:

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

2 years ago[GStreamer] Review WebKitWebSource after r219252.
commit-queue@webkit.org [Wed, 26 Jul 2017 20:08:31 +0000 (20:08 +0000)]
[GStreamer] Review WebKitWebSource after r219252.
https://bugs.webkit.org/show_bug.cgi?id=174415

Patch by Charlie Turner <cturner@igalia.com> on 2017-07-26
Reviewed by Carlos Garcia Campos.

Remove ResourceHandleStreamingClient, and flatten the StreamingClient
into CachedResourceStreamingClient (the only implemetation left). They
are no longer required after r219252.

Also remove the locking code. It's not needed now, and what existed
was heavy-handed and missed several cases it was supposed to protect

Covered by existing tests.

* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
(webkit_web_src_init):
(webKitWebSrcDispose):
(webKitWebSrcStop):
(webKitWebSrcStart):
(webKitWebSrcNeedData):
(webKitWebSrcEnoughData):
(webKitWebSrcSeek):
(webKitWebSrcSetMediaPlayer):
(CachedResourceStreamingClient::CachedResourceStreamingClient):
(CachedResourceStreamingClient::~CachedResourceStreamingClient):
(CachedResourceStreamingClient::getOrCreateReadBuffer):
(CachedResourceStreamingClient::responseReceived):
(CachedResourceStreamingClient::dataReceived):
(CachedResourceStreamingClient::loadFinished):
(ResourceHandleStreamingClient::create): Deleted.
(): Deleted.
(StreamingClient::StreamingClient): Deleted.
(StreamingClient::~StreamingClient): Deleted.
(StreamingClient::createReadBuffer): Deleted.
(StreamingClient::handleResponseReceived): Deleted.
(StreamingClient::handleDataReceived): Deleted.
(StreamingClient::handleNotifyFinished): Deleted.
(ResourceHandleStreamingClient::ResourceHandleStreamingClient): Deleted.
(ResourceHandleStreamingClient::~ResourceHandleStreamingClient): Deleted.
(ResourceHandleStreamingClient::cleanupAndStopRunLoop): Deleted.
(ResourceHandleStreamingClient::invalidate): Deleted.
(ResourceHandleStreamingClient::loadFailed): Deleted.
(ResourceHandleStreamingClient::setDefersLoading): Deleted.
(ResourceHandleStreamingClient::getOrCreateReadBuffer): Deleted.
(ResourceHandleStreamingClient::willSendRequest): Deleted.
(ResourceHandleStreamingClient::didReceiveResponse): Deleted.
(ResourceHandleStreamingClient::didReceiveData): Deleted.
(ResourceHandleStreamingClient::didReceiveBuffer): Deleted.
(ResourceHandleStreamingClient::didFinishLoading): Deleted.
(ResourceHandleStreamingClient::didFail): Deleted.
(ResourceHandleStreamingClient::wasBlocked): Deleted.
(ResourceHandleStreamingClient::cannotShowURL): Deleted.

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

2 years agoAdd test to verify certain child processes are not launched as a side effect of enabl...
beidson@apple.com [Wed, 26 Jul 2017 20:00:02 +0000 (20:00 +0000)]
Add test to verify certain child processes are not launched as a side effect of enabling ResourceLoadStatistics.
https://bugs.webkit.org/show_bug.cgi?id=174851

Reviewed by Chris Dumez.

Source/WebKit:

* UIProcess/API/Cocoa/WKProcessPool.mm:
(-[WKProcessPool _databaseProcessIdentifier]):
(-[WKProcessPool _pluginProcessCount]):
* UIProcess/API/Cocoa/WKProcessPoolPrivate.h:

* UIProcess/Plugins/PluginProcessManager.h:
(WebKit::PluginProcessManager::pluginProcesses):

Tools:

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

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

2 years agoRemove WEB_TIMING feature flag
bburg@apple.com [Wed, 26 Jul 2017 18:40:50 +0000 (18:40 +0000)]
Remove WEB_TIMING feature flag
https://bugs.webkit.org/show_bug.cgi?id=174795

Reviewed by Alex Christensen.

.:

* Source/cmake/OptionsWPE.cmake:
* Source/cmake/OptionsWin.cmake:
* Source/cmake/WebKitFeatures.cmake:
* Source/cmake/tools/vsprops/FeatureDefines.props:
* Source/cmake/tools/vsprops/FeatureDefinesCairo.props:

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

* Configurations/FeatureDefines.xcconfig:
* bindings/js/JSPerformanceEntryCustom.cpp:
* dom/Document.cpp:
(WebCore::Document::setReadyState):
(WebCore::Document::finishedParsing):
* dom/Document.h:
(WebCore::Document::timing):
* dom/DocumentTiming.h:
* dom/EventTargetFactory.in:
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::finishedTimingForWorkerLoad):
(WebCore::DocumentThreadableLoader::loadRequest):
* loader/DocumentThreadableLoader.h:
* loader/ResourceTimingInformation.cpp:
* loader/ResourceTimingInformation.h:
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::didFinishLoading):
(WebCore::SubresourceLoader::reportResourceTiming):
* loader/SubresourceLoader.h:
* loader/ThreadableLoaderClient.h:
(WebCore::ThreadableLoaderClient::didFail):
(WebCore::ThreadableLoaderClient::didFinishTiming):
* loader/WorkerThreadableLoader.cpp:
(WebCore::WorkerThreadableLoader::MainThreadBridge::didFinishTiming):
* loader/WorkerThreadableLoader.h:
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::requestResource):
(WebCore::CachedResourceLoader::revalidateResource):
(WebCore::CachedResourceLoader::loadResource):
* loader/cache/CachedResourceLoader.h:
(WebCore::CachedResourceLoader::resourceTimingInformation):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::~DOMWindow):
(WebCore::DOMWindow::resetDOMWindowProperties):
(WebCore::DOMWindow::nowTimestamp):
(WebCore::DOMWindow::removeAllEventListeners):
* page/DOMWindow.h:
* page/GlobalPerformance.idl:
* page/Performance.cpp:
* page/Performance.h:
* page/Performance.idl:
* page/PerformanceEntry.cpp:
* page/PerformanceEntry.h:
* page/PerformanceEntry.idl:
* page/PerformanceMark.h:
* page/PerformanceMark.idl:
* page/PerformanceMeasure.h:
* page/PerformanceMeasure.idl:
* page/PerformanceNavigation.cpp:
* page/PerformanceNavigation.h:
* page/PerformanceNavigation.idl:
* page/PerformanceObserver.cpp:
* page/PerformanceObserver.h:
* page/PerformanceObserver.idl:
* page/PerformanceObserverCallback.h:
* page/PerformanceObserverCallback.idl:
* page/PerformanceObserverEntryList.cpp:
* page/PerformanceObserverEntryList.h:
* page/PerformanceObserverEntryList.idl:
* page/PerformanceResourceTiming.cpp:
* page/PerformanceResourceTiming.h:
* page/PerformanceResourceTiming.idl:
* page/PerformanceTiming.cpp:
* page/PerformanceTiming.h:
* page/PerformanceTiming.idl:
* page/PerformanceUserTiming.cpp:
* page/PerformanceUserTiming.h:
* platform/network/ResourceHandle.h:
* platform/network/ResourceHandleInternal.h:
* platform/network/cf/ResourceHandleCFNet.cpp:
(WebCore::ResourceHandle::start):
* platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse):
* platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
(WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveResponse):
* platform/network/curl/ResourceHandleCurl.cpp:
(WebCore::ResourceHandleInternal::didFinish):
(WebCore::ResourceHandleInternal::calculateWebTimingInformations):
(WebCore::ResourceHandleInternal::dispatchSynchronousJob):
* platform/network/mac/ResourceHandleMac.mm:
(WebCore::ResourceHandle::createNSURLConnection):
* platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
(-[WebCoreResourceHandleAsDelegate connection:didReceiveResponse:]):
* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]):
* platform/network/soup/ResourceHandleSoup.cpp:
(WebCore::restartedCallback):
(WebCore::sendRequestCallback):
(WebCore::createSoupMessageForHandleAndRequest):
(WebCore::ResourceHandle::sendPendingRequest):
* platform/network/soup/SoupNetworkSession.cpp:
(WebCore::SoupNetworkSession::SoupNetworkSession):
* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::WorkerGlobalScope):
(WebCore::WorkerGlobalScope::~WorkerGlobalScope):
(WebCore::WorkerGlobalScope::removeAllEventListeners):
* workers/WorkerGlobalScope.h:

Source/WebCore/PAL:

* Configurations/FeatureDefines.xcconfig:

Source/WebInspectorUI:

Remove fallback for ports that lack WEB_TIMING.

* UserInterface/Base/Utilities.js:
(timestamp): Deleted.
* UserInterface/Protocol/Connection.js:
(InspectorBackend.Connection.prototype._dispatchResponse):
(InspectorBackend.Connection.prototype._dispatchEvent):
(InspectorBackend.Connection.prototype._sendCommandToBackendWithCallback):
(InspectorBackend.Connection.prototype._sendCommandToBackendExpectingPromise):
* UserInterface/Protocol/MessageDispatcher.js:
(WebInspector.dispatchNextQueuedMessageFromBackend):

Source/WebKit:

* Configurations/FeatureDefines.xcconfig:
* NetworkProcess/soup/NetworkDataTaskSoup.cpp:
(WebKit::NetworkDataTaskSoup::NetworkDataTaskSoup):
(WebKit::NetworkDataTaskSoup::createRequest):
(WebKit::NetworkDataTaskSoup::didSendRequest):
(WebKit::NetworkDataTaskSoup::dispatchDidReceiveResponse):
(WebKit::NetworkDataTaskSoup::dispatchDidCompleteWithError):
(WebKit::NetworkDataTaskSoup::continueHTTPRedirection):
(WebKit::NetworkDataTaskSoup::didGetHeaders):
(WebKit::NetworkDataTaskSoup::didRestart):
* NetworkProcess/soup/NetworkDataTaskSoup.h:

Source/WebKitLegacy/mac:

* Configurations/FeatureDefines.xcconfig:

Source/WTF:

* wtf/FeatureDefines.h:

Tools:

* Scripts/webkitperl/FeatureList.pm:
* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:

LayoutTests:

* inspector/formatting/resources/javascript-tests/sample-normal-utilities-expected.js:
(decodeBase64ToBlob):
(timestamp): Deleted.
* inspector/formatting/resources/javascript-tests/sample-normal-utilities.js:
(decodeBase64ToBlob):
(timestamp): Deleted.

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

2 years agoRebaselined multiple fast/css/getComputedStyle.
jlewis3@apple.com [Wed, 26 Jul 2017 18:33:02 +0000 (18:33 +0000)]
Rebaselined multiple fast/css/getComputedStyle.
<rdar://problem/33416054>

Unreviewed test gardening.

* platform/mac-highsierra/fast/css/getComputedStyle/computed-style-expected.txt:
* platform/mac-highsierra/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt:

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

2 years agoUse SandboxExtension::HandleArray when sending extensions for file uploads to the...
bburg@apple.com [Wed, 26 Jul 2017 18:32:45 +0000 (18:32 +0000)]
Use SandboxExtension::HandleArray when sending extensions for file uploads to the web process
https://bugs.webkit.org/show_bug.cgi?id=174828

Reviewed by Tim Horton.

In the previous change I forgot to hoist the HandleArray and message-send out of the
loop, so the code wasn't actually sending fewer messages. That's fixed now.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didChooseFilesForOpenPanelWithDisplayStringAndIcon):
(WebKit::WebPageProxy::didChooseFilesForOpenPanel):

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

2 years agoAdd the ability to change sp and pc to the ARM64 JIT probe.
mark.lam@apple.com [Wed, 26 Jul 2017 18:31:02 +0000 (18:31 +0000)]
Add the ability to change sp and pc to the ARM64 JIT probe.
https://bugs.webkit.org/show_bug.cgi?id=174697
<rdar://problem/33436965>

Reviewed by JF Bastien.

This patch implements the following:

1. The ARM64 probe now supports modifying the pc and sp.

   However, lr is not preserved when modifying the pc because it is used as the
   scratch register for the indirect jump. Hence, the probe handler function
   may not modify both lr and pc in the same probe invocation.

2. Fix probe tests to use bitwise comparison when comparing double register
   values. Otherwise, equivalent nan values will be interpreted as not equivalent.

3. Change the minimum offset increment in testProbeModifiesStackPointer to be
   16 bytes for ARM64.  This is because the ARM64 probe now uses the ldp and stp
   instructions which require 16 byte alignment for their memory access.

* assembler/MacroAssemblerARM64.cpp:
(JSC::arm64ProbeError):
(JSC::MacroAssembler::probe):
(JSC::arm64ProbeTrampoline): Deleted.
* assembler/testmasm.cpp:
(JSC::isSpecialGPR):
(JSC::testProbeReadsArgumentRegisters):
(JSC::testProbeWritesArgumentRegisters):
(JSC::testProbePreservesGPRS):
(JSC::testProbeModifiesStackPointer):
(JSC::testProbeModifiesStackPointerToInsideProbeContextOnStack):
(JSC::testProbeModifiesStackPointerToNBytesBelowSP):

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

2 years agoPressing the Escape key should not be a valid user gesture to enter fullscreen
cdumez@apple.com [Wed, 26 Jul 2017 17:15:31 +0000 (17:15 +0000)]
Pressing the Escape key should not be a valid user gesture to enter fullscreen
https://bugs.webkit.org/show_bug.cgi?id=174864
<rdar://problem/33009088>

Reviewed by Geoffrey Garen.

Source/WebCore:

Pressing the Escape key should not be a valid user gesture to enter fullscreen since this
is the gesture to exit fullscreen already.

Test: fullscreen/requestFullscreen-escape-key.html

* dom/Document.cpp:
(WebCore::Document::requestFullScreenForElement):
* dom/UserGestureIndicator.cpp:
(WebCore::UserGestureIndicator::UserGestureIndicator):
* dom/UserGestureIndicator.h:
(WebCore::UserGestureToken::create):
(WebCore::UserGestureToken::gestureType):
(WebCore::UserGestureToken::UserGestureToken):
* page/EventHandler.cpp:
(WebCore::EventHandler::internalKeyEvent):

Tools:

Add support for eventSender.keyDown('escape') in DRT to match the behavior of
WKTR.

* DumpRenderTree/mac/EventSendingController.mm:
(-[EventSendingController keyDown:withModifiers:withLocation:]):

LayoutTests:

Add layout test coverage.

* fullscreen/requestFullscreen-escape-key-expected.txt: Added.
* fullscreen/requestFullscreen-escape-key.html: Added.

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

2 years agoAX: Incorrect range from index and length in contenteditable with <p> tags
n_wang@apple.com [Wed, 26 Jul 2017 16:53:09 +0000 (16:53 +0000)]
AX: Incorrect range from index and length in contenteditable with <p> tags
https://bugs.webkit.org/show_bug.cgi?id=174856

Reviewed by Chris Fleizach.

Source/WebCore:

When asking for the string inside a text control with a given range, we sometimes get
a wrong string at the line boundary due to a bad plain range to text marker conversion.
To fix this, we should use the exsisting method on text controls to avoid this issue.

Updated the test to test the problematic case.

* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):

LayoutTests:

* accessibility/mac/range-for-contenteditable-newline-expected.txt:
* accessibility/mac/range-for-contenteditable-newline.html:

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

2 years ago[Curl] Bug fix after r219606
commit-queue@webkit.org [Wed, 26 Jul 2017 15:29:29 +0000 (15:29 +0000)]
[Curl] Bug fix after r219606
https://bugs.webkit.org/show_bug.cgi?id=174845

Patch by Daewoong Jang <daewoong.jang@navercorp.com> on 2017-07-26
Reviewed by Alex Christensen.

* platform/network/curl/CurlContext.h:
(WebCore::CurlSList::isEmpty):
* platform/network/curl/ResourceHandleCurl.cpp:
(WebCore::ResourceHandleInternal::didReceiveHeaderLine):
(WebCore::ResourceHandleInternal::headerCallback):

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

2 years agoRemove obsolete failure annotation for bad-charset-alias.html.
commit-queue@webkit.org [Wed, 26 Jul 2017 15:27:13 +0000 (15:27 +0000)]
Remove obsolete failure annotation for bad-charset-alias.html.
https://bugs.webkit.org/show_bug.cgi?id=145048

Patch by Ms2ger <Ms2ger@igalia.com> on 2017-07-26
Reviewed by Carlos Garcia Campos.

This appears to have been fixed in r204850.

* platform/gtk/TestExpectations:

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

2 years ago[EME][GStreamer] Multi-key support in the GStreamer ClearKey decryptor
zandobersek@gmail.com [Wed, 26 Jul 2017 14:33:10 +0000 (14:33 +0000)]
[EME][GStreamer] Multi-key support in the GStreamer ClearKey decryptor
https://bugs.webkit.org/show_bug.cgi?id=174779

Reviewed by Xabier Rodriguez-Calvar.

In the CENC decryptor, the key ID value is retrieved from the info structure
on the GstProtectionMeta object. GstBuffer for that value is retrieved and
passed to the setupCipher() function.

In the ClearKey decryptor (which extends the CENC decryptor), the single
GstBuffer object on the private instance that holds the key value is replaced
with a Vector object that holds pairs of key ID and value GstBuffers. In the
handleKeyResponse() implementation that Vector is emptied and then refilled
with key ID and value pairs that are passed in through the drm-cipher-clearkey
structure that's attached to the GstEvent that signalled new key information.

In the ClearKey decryptor's setupCipher() implementation the passed-in key ID
buffer is used to find a matching key ID and value pair stored on the private
instance. If not found, an error is thrown. If found, the matching key value
is used for decryption.

* platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
(webKitMediaClearKeyDecryptorHandleKeyResponse):
(webKitMediaClearKeyDecryptorSetupCipher):
* platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
(webkitMediaCommonEncryptionDecryptTransformInPlace):
(webKitMediaCommonEncryptionDecryptDefaultSetupCipher):
* platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.h:

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

2 years ago[EME][GStreamer] Handle ClearKey as a supported key system
zandobersek@gmail.com [Wed, 26 Jul 2017 14:31:13 +0000 (14:31 +0000)]
[EME][GStreamer] Handle ClearKey as a supported key system
https://bugs.webkit.org/show_bug.cgi?id=174778

Reviewed by Xabier Rodriguez-Calvar.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::supportsKeySystem):
Return true for the 'org.w3.clearkey' key system when building with
ENCRYPTED_MEDIA enabled. The underlying implementation will follow.

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

2 years agoUnreviewed, minor adjustments to the previous demo.
fred.wang@free.fr [Wed, 26 Jul 2017 14:23:21 +0000 (14:23 +0000)]
Unreviewed, minor adjustments to the previous demo.

Patch by Frederic Wang <fwang@igalia.com> on 2017-07-26

* demos/frames/index.html: Added. Index page for the list of demos.
* demos/frames/sandboxing/index.html: Minor fixes.

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

2 years ago[WPE] Fix a potential crash in the platform pasteboard when reading a string
csaavedra@igalia.com [Wed, 26 Jul 2017 13:52:35 +0000 (13:52 +0000)]
[WPE] Fix a potential crash in the platform pasteboard when reading a string
https://bugs.webkit.org/show_bug.cgi?id=174859

Reviewed by Žan Doberšek.

We shouldn't assume that the wpe_pasteboard_string struct will be
filled in, so initialize it.

* platform/wpe/PlatformPasteboardWPE.cpp:
(WebCore::PlatformPasteboard::readString): Initialize the struct
before passing it to wpe and early return if it's still empty.

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

2 years agoUnreviewed, add demos (frame sandboxing and scrolling) for a blog post.
fred.wang@free.fr [Wed, 26 Jul 2017 13:43:25 +0000 (13:43 +0000)]
Unreviewed, add demos (frame sandboxing and scrolling) for a blog post.

Patch by Frederic Wang <fwang@igalia.com> on 2017-07-26

* demos/frames/sandboxing/am-i-sandboxed.html: Added.
* demos/frames/sandboxing/framebusting-success.html: Added.
* demos/frames/sandboxing/framebusting-without-user-activation.html: Added.
* demos/frames/sandboxing/index.html: Added.
* demos/frames/scrollable-iframes.html: Added.
* demos/frames/scrollingElement.html: Added.

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

2 years agoUnreviewed, added Romain Bellessort to contributors.json.
romain.bellessort@crf.canon.fr [Wed, 26 Jul 2017 13:41:37 +0000 (13:41 +0000)]
Unreviewed, added Romain Bellessort to contributors.json.

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

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

2 years agoUnreviewed. Fix a compiler warning that springs up when
zandobersek@gmail.com [Wed, 26 Jul 2017 13:09:30 +0000 (13:09 +0000)]
Unreviewed. Fix a compiler warning that springs up when
building the WPE port with Clang.

* UIProcess/API/wpe/ScrollGestureController.h:
Let ScrollGestureController be a class, and not a struct.
This fits the usual pattern, and also matches the forward
declaration used in WPE's PageClientImpl.h.

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

2 years agoRemove obsolete failure expectations for 2d.fillStyle.parse.{rgb,rgba}-eof.
commit-queue@webkit.org [Wed, 26 Jul 2017 10:33:22 +0000 (10:33 +0000)]
Remove obsolete failure expectations for 2d.fillStyle.parse.{rgb,rgba}-eof.
https://bugs.webkit.org/show_bug.cgi?id=174857

Patch by Ms2ger <Ms2ger@igalia.com> on 2017-07-26
Reviewed by Žan Doberšek.

These tests started passing in r209666.

* platform/gtk/TestExpectations:

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

2 years agoInsertOrderedList command applied to table cells inserts an extra BR before the table
jfernandez@igalia.com [Wed, 26 Jul 2017 09:48:37 +0000 (09:48 +0000)]
InsertOrderedList command applied to table cells inserts an extra BR before the table
https://bugs.webkit.org/show_bug.cgi?id=174593

Reviewed by Darin Adler.

Source/WebCore:

Don't add BR when pruning empty blocks if it's the start of a paragraph.

The function MoveParagraph is used for several operations and editing
commands, like 'insertOrderedList'. When moving paragraphs we check out
whether we should add a 'br' element to avoid undesired block collapse.

However, we shouldn't do this when destination is the start of a
paragraph.

Tests: editing/inserting/insert-list-in-table-cell-01.html
       editing/inserting/insert-list-in-table-cell-02.html
       editing/inserting/insert-list-in-table-cell-03.html
       editing/inserting/insert-list-in-table-cell-04.html
       editing/inserting/insert-list-in-table-cell-05.html
       editing/inserting/insert-list-in-table-cell-06.html
       editing/inserting/insert-list-in-table-cell-07.html
       editing/inserting/insert-list-in-table-cell-08.html

* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::moveParagraphs):

LayoutTests:

Tests to verify that the insertOrderedList command works as expected when applied
in table cells.

* editing/inserting/insert-list-in-table-cell-01.html: Added.
* editing/inserting/insert-list-in-table-cell-01-expected.txt: Added.
* editing/inserting/insert-list-in-table-cell-02.html: Added.
* editing/inserting/insert-list-in-table-cell-02-expected.txt: Added.
* editing/inserting/insert-list-in-table-cell-03.html: Added.
* editing/inserting/insert-list-in-table-cell-03-expected.txt: Added.
* editing/inserting/insert-list-in-table-cell-04.html: Added.
* editing/inserting/insert-list-in-table-cell-04-expected.txt: Added.
* editing/inserting/insert-list-in-table-cell-05.html: Added.
* editing/inserting/insert-list-in-table-cell-05-expected.txt: Added.
* editing/inserting/insert-list-in-table-cell-06.html: Added.
* editing/inserting/insert-list-in-table-cell-06-expected.txt: Added.
* editing/inserting/insert-list-in-table-cell-07.html: Added.
* editing/inserting/insert-list-in-table-cell-07-expected.txt: Added.
* editing/inserting/insert-list-in-table-cell-08.html: Added.
* editing/inserting/insert-list-in-table-cell-08-expected.txt: Added.

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

2 years agoFix an incorrect check in 2d.missingargs.html.
commit-queue@webkit.org [Wed, 26 Jul 2017 09:22:49 +0000 (09:22 +0000)]
Fix an incorrect check in 2d.missingargs.html.
https://bugs.webkit.org/show_bug.cgi?id=174854

Patch by Ms2ger <Ms2ger@igalia.com> on 2017-07-26
Reviewed by Carlos Garcia Campos.

The check was introduced without explanation in r168302. This change reverts
it to the previous, correct check.

* canvas/philip/tests/2d.missingargs-expected.txt:
* canvas/philip/tests/2d.missingargs.html:
* platform/gtk/TestExpectations:
* platform/ios/TestExpectations:
* platform/mac/canvas/philip/tests/2d.missingargs-expected.txt: Removed.
* platform/wpe/TestExpectations:

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

2 years ago[WPE] Enable KeyboardEvent key and code attributes
csaavedra@igalia.com [Wed, 26 Jul 2017 09:01:34 +0000 (09:01 +0000)]
[WPE] Enable KeyboardEvent key and code attributes
https://bugs.webkit.org/show_bug.cgi?id=174822

Reviewed by Žan Doberšek.

Source/WTF:

There is no reason for this to be disabled from what I see.

* wtf/FeatureDefines.h: Enable KeyboardEvent key and code attributes.

LayoutTests:

* platform/wpe/TestExpectations: Mark
fast/events/constructors/keyboard-event-constructor.html as passing.

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

2 years agoUnreviewed. Fix WebKit2 derived sources directory creation after r219488.
carlosgc@webkit.org [Wed, 26 Jul 2017 08:31:17 +0000 (08:31 +0000)]
Unreviewed. Fix WebKit2 derived sources directory creation after r219488.

The variable is still DERIVED_SOURCES_WEBKIT2_DIR, not DERIVED_SOURCES_WEBKIT_DIR. Build was not really affected
because WebKit2 makefile creates the directory too.

* Source/cmake/WebKitFS.cmake:

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

2 years ago[WPE] WebGL2 support
zandobersek@gmail.com [Wed, 26 Jul 2017 08:26:08 +0000 (08:26 +0000)]
[WPE] WebGL2 support
https://bugs.webkit.org/show_bug.cgi?id=174249

Reviewed by Alex Christensen.

Source/WebCore:

Implement WebGL2 support in GraphicsContext3DCairo for the WPE port, but keep
the implementation specific to libepoxy (which WPE leverages by default).

In the GraphicsContext3D::create() method, we first construct the
GraphicsContext3D object that also ensures a current GL context on this thread.
Only then can we determine through libepoxy whether the underlying GL library
is able to support WebGL2.

For WebGL2, the GLES3 support is required. The initial libepoxy implementation
ensures this only in case of 'non-desktop GL' library of minimum version 3.0.
This effectively translates to the only supported configuration being the
EGL and OpenGL ES 3.0 (or higher) combination. If this cannot be ensured, we
discard the existing GraphicsContext3D object and return null.

WebGL2 can also be supported via OpenGL (i.e. 'desktop GL'), but this hasn't
been tested yet. Implementation will in the future be extended to support that
as required.

In the GraphicsContext3D constructor itself, the ANGLEWebKitBridge constructor
has to now receive the second argument, the desired shader specification that's
used when parsing the provided shaders. This should be SH_WEBGL_SPEC for WebGL1,
and SH_WEBGL2_SPEC for WebGL2.

No new tests -- a small set of existing WebGL2 tests is unskipped and passing.

* platform/graphics/cairo/GraphicsContext3DCairo.cpp:
(WebCore::GraphicsContext3D::create):
(WebCore::GraphicsContext3D::GraphicsContext3D):
* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
Add WebGL2-specific methods to the build.

Tools:

* Scripts/webkitperl/FeatureList.pm:
Enable WebGL2 for WPE when building through build-webkit.

LayoutTests:

* platform/wpe/TestExpectations:
Unskip WebGL2 tests under the webgl/ directory. More tests under fast/canvas/webgl2/
will be unskipped later.

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

2 years agoUnreviewed. Update OptionsGTK.cmake and NEWS for 2.17.5 release.
carlosgc@webkit.org [Wed, 26 Jul 2017 08:15:15 +0000 (08:15 +0000)]
Unreviewed. Update OptionsGTK.cmake and NEWS for 2.17.5 release.

.:

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

Source/WebKit:

* gtk/NEWS: Add release notes for 2.17.5.

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

2 years agoUnreviewed. Fix GTK distcheck.
carlosgc@webkit.org [Wed, 26 Jul 2017 08:13:27 +0000 (08:13 +0000)]
Unreviewed. Fix GTK distcheck.

Source/WebDriver:

Ensure WebDriver derived sources directory is created, WebKitFS.cmake is useless for this.

* PlatformGTK.cmake:

Tools:

* gtk/make-dist.py:
(ensure_version_if_possible): Use the right pkg-config filename, it's webkit2gtk not webkitgtk.

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

2 years agoAX: should dispatch accessibilityPerformPressAction async on MacOS
n_wang@apple.com [Wed, 26 Jul 2017 07:39:01 +0000 (07:39 +0000)]
AX: should dispatch accessibilityPerformPressAction async on MacOS
https://bugs.webkit.org/show_bug.cgi?id=174849

Reviewed by Chris Fleizach.

Source/WebCore:

If performing the accessibility press action results in a modal alert being displayed,
it can cause VoiceOver to hang. To fix it, we should dispatch the action asynchronously.

Updated tests to adapt to this change.

* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper accessibilityPerformPressAction]):
(-[WebAccessibilityObjectWrapper _accessibilityPerformPressAction]):

LayoutTests:

* accessibility/file-upload-button-with-axpress.html:
* accessibility/mac/html5-input-number.html:
* accessibility/mac/search-field-cancel-button.html:
* accessibility/press-target-uses-text-descendant-node.html:
* accessibility/press-targets-center-point.html:
* accessibility/press-works-on-control-types.html:

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

2 years agoIcon loader error on startup
carlosgc@webkit.org [Wed, 26 Jul 2017 06:19:47 +0000 (06:19 +0000)]
Icon loader error on startup
https://bugs.webkit.org/show_bug.cgi?id=174787

Reviewed by Brady Eidson.

Source/WebCore:

This is a regression of the new icon loading, it happens with pages that shouldn't have a favicon, like about
pages. IconController::startLoader() did several checks before starting the load that
DocumentLoader::startIconLoading() is not doing. It checked that the frame is the main one, the document can have
an icon (document url is not empty and not about:blank) and that favicon url is in HTTP family. We should do the
same checks now before starting to load icons.

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::startIconLoading):

Source/WebKit:

Ignore non HTTP favicons in glib API.

* UIProcess/API/glib/WebKitIconLoadingClient.cpp:

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

2 years agoResourceLoadStatistics grandfathering happens much too often.
beidson@apple.com [Wed, 26 Jul 2017 05:44:05 +0000 (05:44 +0000)]
ResourceLoadStatistics grandfathering happens much too often.
<rdar://problem/32655834> and https://bugs.webkit.org/show_bug.cgi?id=174825

Reviewed by Chris Dumez.

Source/WebKit:

The ResourceLoadStatistics grandfathering procedure happens too often.
- With an empty memory store, even though an empty memory store is a perfectly valid state.
- On each launch, even if grandfathering happened on the last launch - because grandfathering
  data would not automatically be saved to disk.
- After clearing all website data, at which point no grandfathering can possibly be relevant
  because there is no data to grandfather.

This patch fixes those cases and adds API tests to verify they remain fixed.

* Shared/WebsiteData/WebsiteDataType.h:

* UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
(+[WKWebsiteDataStore _allWebsiteDataTypesIncludingPrivate]): allWebsiteDataTypes, but even with the private ones.
(-[WKWebsiteDataStore _resourceLoadStatisticsClearInMemoryAndPersistentStore]): If the types being cleared cover all of
  the types that ResourceLoadStatistics care about, don't grandfather afterwards.
(-[WKWebsiteDataStore _resourceLoadStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours:]): Ditto.
(-[WKWebsiteDataStore _setResourceLoadStatisticsTestingCallback:]):
* UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:

* UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.cpp:
(WebKit::ResourceLoadStatisticsPersistentStorage::populateMemoryStoreFromDisk): Don't grandfather if the store read from
  disk is empty (as being empty is perfectly fine), and also log the event of "populated without grandfathering".
* UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.h:

* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::topPrivatelyControlledDomainsWithWebsiteData):

* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::monitoredDataTypes):
(WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
(WebKit::WebResourceLoadStatisticsStore::~WebResourceLoadStatisticsStore):
(WebKit::WebResourceLoadStatisticsStore::removeDataRecords):
(WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData): Schedule a write right away so we don't re-grandfather
  on next launch, and also log the grandfathering event.
(WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent): Takes a ShouldGrandfather flag
  to tell whether or not data should be re-grandfathered after the store is cleared.
(WebKit::WebResourceLoadStatisticsStore::logTestingEvent): Log the event to the testing client.
(WebKit::dataTypesToRemove): Deleted.
* UIProcess/WebResourceLoadStatisticsStore.h:

* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::removeData):
(WebKit::WebsiteDataStore::setResourceLoadStatisticsEnabled):
(WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback): Handles enabling ResourceLoadStatistics both
  with and without a testing callback.
* UIProcess/WebsiteData/WebsiteDataStore.h:

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2Cocoa/EmptyGrandfatheredResourceLoadStatistics.plist: Added.
* TestWebKitAPI/Tests/WebKit2Cocoa/ResourceLoadStatistics.mm: Added.
(TEST):

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

2 years agoSpeedometer 2.0: Document es2015-babel-webpack build process
commit-queue@webkit.org [Wed, 26 Jul 2017 04:42:19 +0000 (04:42 +0000)]
Speedometer 2.0: Document es2015-babel-webpack build process
https://bugs.webkit.org/show_bug.cgi?id=174252

Patch by Mathias Bynens <mathias@qiwi.be> on 2017-07-25
Reviewed by Ryosuke Niwa.

* Speedometer/resources/todomvc/vanilla-examples/es2015-babel-webpack/README.md: Added build docs.
* Speedometer/resources/todomvc/vanilla-examples/es2015-babel-webpack/dist/*: Update generated build files.
* Speedometer/resources/todomvc/vanilla-examples/es2015-babel-webpack/package.json: Remove unused items.
* Speedometer/resources/todomvc/vanilla-examples/es2015-babel-webpack/package-lock.json: Added lockfile.
* Speedometer/resources/todomvc/vanilla-examples/es2015-babel-webpack/src/index.html: Make title consistent.

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

2 years ago[WebIDL] Remove custom bindings for HTMLCanvasElement
weinig@apple.com [Wed, 26 Jul 2017 04:31:40 +0000 (04:31 +0000)]
[WebIDL] Remove custom bindings for HTMLCanvasElement
https://bugs.webkit.org/show_bug.cgi?id=174847

Reviewed by Darin Adler.

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSBindingsAllInOne.cpp:
* bindings/js/JSHTMLCanvasElementCustom.cpp: Removed.
Remove JSHTMLCanvasElementCustom.

* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::getContext):
(WebCore::HTMLCanvasElement::getContext2d):
(WebCore::HTMLCanvasElement::getContextWebGL):
(WebCore::HTMLCanvasElement::getContextWebGPU):
* html/HTMLCanvasElement.h:
* html/HTMLCanvasElement.idl:
Move context picking code to HTMLCanvasElement. Give more
exact types to remaining context getters.

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

2 years agoClean up ExceptionCode enumeration
cdumez@apple.com [Wed, 26 Jul 2017 02:34:56 +0000 (02:34 +0000)]
Clean up ExceptionCode enumeration
https://bugs.webkit.org/show_bug.cgi?id=174812

Reviewed by Darin Adler.

Clean up ExceptionCode enumeration:
- Updated comments to reflect the latest WebIDL specification
- Drop special values given to some exception codes. Those legacy codes are already in the
  table inside DOMException.cpp. This also allows us to drop empty rows in the DOMException
  table
- Drop NoException value in the enumeration and use std::optional<ExceptionCode> when needed
  instead.

* Modules/indexeddb/shared/IDBError.cpp:
(WebCore::IDBError::IDBError):
(WebCore::IDBError::name):
(WebCore::IDBError::message):
* Modules/indexeddb/shared/IDBError.h:
(WebCore::IDBError::code):
(WebCore::IDBError::encode):
(WebCore::IDBError::decode):
* dom/DOMException.cpp:
* dom/ExceptionCode.h:
* fileapi/FileReaderSync.cpp:
(WebCore::errorCodeToException):
(WebCore::FileReaderSync::startLoading):
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::createRequest):
* xml/XMLHttpRequest.h:

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

2 years agoWeb Inspector: Don't output "No message" for multi-value logs like console.log(x, y)
commit-queue@webkit.org [Wed, 26 Jul 2017 02:27:08 +0000 (02:27 +0000)]
Web Inspector: Don't output "No message" for multi-value logs like console.log(x, y)
https://bugs.webkit.org/show_bug.cgi?id=174842

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-07-25
Reviewed by Matt Baker.

* Localizations/en.lproj/localizedStrings.js:
Removed "No message".

* UserInterface/Views/ConsoleMessageView.js:
(WebInspector.ConsoleMessageView.prototype._appendFormattedArguments):
Track whether or not outputting the next parameter will need a divider
in front of it or not.

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

2 years agoWebAssembly: generate smaller binaries
jfbastien@apple.com [Wed, 26 Jul 2017 02:23:01 +0000 (02:23 +0000)]
WebAssembly: generate smaller binaries
https://bugs.webkit.org/show_bug.cgi?id=174818

Reviewed by Filip Pizlo.

This patch reduces generated code size for WebAssembly in 2 ways:

1. Use the ZR register when storing zero on ARM64.
2. Synthesize wasm context lazily.

This leads to a modest size reduction on both x86-64 and ARM64 for
large WebAssembly games, without any performance loss on WasmBench
and TitzerBench.

The reason this works is that these games, using Emscripten,
generate 100k+ tiny functions, and our JIT allocation granule
rounds all allocations up to 32 bytes. There are plenty of other
simple gains to be had, I've filed a follow-up bug at
webkit.org/b/174819

We should further avoid the per-function cost of tiering, which
represents the bulk of code generated for small functions.

* assembler/MacroAssemblerARM64.h:
(JSC::MacroAssemblerARM64::storeZero64):
* assembler/MacroAssemblerX86_64.h:
(JSC::MacroAssemblerX86_64::storeZero64):
* b3/B3LowerToAir.cpp:
(JSC::B3::Air::LowerToAir::createStore): this doesn't make sense
for x86 because it constrains register reuse and codegen in a way
that doesn't affect ARM64 because it has a dedicated zero
register.
* b3/air/AirOpcode.opcodes: add the storeZero64 opcode.
* wasm/WasmB3IRGenerator.cpp:
(JSC::Wasm::B3IRGenerator::instanceValue):
(JSC::Wasm::B3IRGenerator::restoreWasmContext):
(JSC::Wasm::B3IRGenerator::B3IRGenerator):
(JSC::Wasm::B3IRGenerator::materializeWasmContext): Deleted.

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

2 years agoB3 should do LICM
fpizlo@apple.com [Wed, 26 Jul 2017 01:58:36 +0000 (01:58 +0000)]
B3 should do LICM
https://bugs.webkit.org/show_bug.cgi?id=174750

Reviewed by Keith Miller and Saam Barati.

Source/JavaScriptCore:

Added a LICM phase to B3. This phase is called hoistLoopInvariantValues, to conform to the B3 naming
convention for phases (it has to be an imperative). The phase uses NaturalLoops and BackwardsDominators,
so this adds those analyses to B3. BackwardsDominators was already available in templatized form. This
change templatizes DFG::NaturalLoops so that we can just use it.

The LICM phase itself is really simple. We are decently precise with our handling of everything except
the relationship between control dependence and side exits.

Also added a bunch of tests.

This isn't super important. It's perf-neutral on JS benchmarks. FTL already does LICM on DFG SSA IR, and
probably all current WebAssembly content has had LICM done to it. That being said, this is a cheap phase
so it doesn't hurt to have it.

I wrote it because I thought I needed it for bug 174727. It turns out that there's a better way to
handle the problem I had, so I ended up not needed it - but by then I had already written it. I think
it's good to have it because LICM is one of those core compiler phases; every compiler has it
eventually.

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* b3/B3BackwardsCFG.h: Added.
(JSC::B3::BackwardsCFG::BackwardsCFG):
* b3/B3BackwardsDominators.h: Added.
(JSC::B3::BackwardsDominators::BackwardsDominators):
* b3/B3BasicBlock.cpp:
(JSC::B3::BasicBlock::appendNonTerminal):
* b3/B3Effects.h:
* b3/B3EnsureLoopPreHeaders.cpp: Added.
(JSC::B3::ensureLoopPreHeaders):
* b3/B3EnsureLoopPreHeaders.h: Added.
* b3/B3Generate.cpp:
(JSC::B3::generateToAir):
* b3/B3HoistLoopInvariantValues.cpp: Added.
(JSC::B3::hoistLoopInvariantValues):
* b3/B3HoistLoopInvariantValues.h: Added.
* b3/B3NaturalLoops.h: Added.
(JSC::B3::NaturalLoops::NaturalLoops):
* b3/B3Procedure.cpp:
(JSC::B3::Procedure::invalidateCFG):
(JSC::B3::Procedure::naturalLoops):
(JSC::B3::Procedure::backwardsCFG):
(JSC::B3::Procedure::backwardsDominators):
* b3/B3Procedure.h:
* b3/testb3.cpp:
(JSC::B3::generateLoop):
(JSC::B3::makeArrayForLoops):
(JSC::B3::generateLoopNotBackwardsDominant):
(JSC::B3::oneFunction):
(JSC::B3::noOpFunction):
(JSC::B3::testLICMPure):
(JSC::B3::testLICMPureSideExits):
(JSC::B3::testLICMPureWritesPinned):
(JSC::B3::testLICMPureWrites):
(JSC::B3::testLICMReadsLocalState):
(JSC::B3::testLICMReadsPinned):
(JSC::B3::testLICMReads):
(JSC::B3::testLICMPureNotBackwardsDominant):
(JSC::B3::testLICMPureFoiledByChild):
(JSC::B3::testLICMPureNotBackwardsDominantFoiledByChild):
(JSC::B3::testLICMExitsSideways):
(JSC::B3::testLICMWritesLocalState):
(JSC::B3::testLICMWrites):
(JSC::B3::testLICMFence):
(JSC::B3::testLICMWritesPinned):
(JSC::B3::testLICMControlDependent):
(JSC::B3::testLICMControlDependentNotBackwardsDominant):
(JSC::B3::testLICMControlDependentSideExits):
(JSC::B3::testLICMReadsPinnedWritesPinned):
(JSC::B3::testLICMReadsWritesDifferentHeaps):
(JSC::B3::testLICMReadsWritesOverlappingHeaps):
(JSC::B3::testLICMDefaultCall):
(JSC::B3::run):
* dfg/DFGBasicBlock.h:
* dfg/DFGCFG.h:
* dfg/DFGNaturalLoops.cpp: Removed.
* dfg/DFGNaturalLoops.h:
(JSC::DFG::NaturalLoops::NaturalLoops):
(JSC::DFG::NaturalLoop::NaturalLoop): Deleted.
(JSC::DFG::NaturalLoop::header): Deleted.
(JSC::DFG::NaturalLoop::size): Deleted.
(JSC::DFG::NaturalLoop::at): Deleted.
(JSC::DFG::NaturalLoop::operator[]): Deleted.
(JSC::DFG::NaturalLoop::contains): Deleted.
(JSC::DFG::NaturalLoop::index): Deleted.
(JSC::DFG::NaturalLoop::isOuterMostLoop): Deleted.
(JSC::DFG::NaturalLoop::addBlock): Deleted.
(JSC::DFG::NaturalLoops::numLoops): Deleted.
(JSC::DFG::NaturalLoops::loop): Deleted.
(JSC::DFG::NaturalLoops::headerOf): Deleted.
(JSC::DFG::NaturalLoops::innerMostLoopOf): Deleted.
(JSC::DFG::NaturalLoops::innerMostOuterLoop): Deleted.
(JSC::DFG::NaturalLoops::belongsTo): Deleted.
(JSC::DFG::NaturalLoops::loopDepth): Deleted.

Source/WTF:

Moved DFG::NaturalLoops to WTF. The new templatized NaturalLoops<> uses the same Graph abstraction as
Dominators<>. This allows us to add a B3::NaturalLoops for free.

Also made small tweaks to RangeSet, which the LICM uses.

* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/Dominators.h:
* wtf/NaturalLoops.h: Added.
(WTF::NaturalLoop::NaturalLoop):
(WTF::NaturalLoop::graph):
(WTF::NaturalLoop::header):
(WTF::NaturalLoop::size):
(WTF::NaturalLoop::at):
(WTF::NaturalLoop::operator[]):
(WTF::NaturalLoop::contains):
(WTF::NaturalLoop::index):
(WTF::NaturalLoop::isOuterMostLoop):
(WTF::NaturalLoop::dump):
(WTF::NaturalLoop::addBlock):
(WTF::NaturalLoops::NaturalLoops):
(WTF::NaturalLoops::graph):
(WTF::NaturalLoops::numLoops):
(WTF::NaturalLoops::loop):
(WTF::NaturalLoops::headerOf):
(WTF::NaturalLoops::innerMostLoopOf):
(WTF::NaturalLoops::innerMostOuterLoop):
(WTF::NaturalLoops::belongsTo):
(WTF::NaturalLoops::loopDepth):
(WTF::NaturalLoops::loopsOf):
(WTF::NaturalLoops::dump):
* wtf/RangeSet.h:
(WTF::RangeSet::begin):
(WTF::RangeSet::end):
(WTF::RangeSet::addAll):

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

2 years agoGC should be fine with trading blocks between destructor and non-destructor blocks
fpizlo@apple.com [Wed, 26 Jul 2017 01:19:23 +0000 (01:19 +0000)]
GC should be fine with trading blocks between destructor and non-destructor blocks
https://bugs.webkit.org/show_bug.cgi?id=174811

Reviewed by Mark Lam.

Our GC has the ability to trade blocks between MarkedAllocators. A MarkedAllocator is a
size-class-within-a-Subspace. The ability to trade helps reduce memory wastage due to
fragmentation. Prior to this change, this only worked between blocks that did not have destructors.
This was partly a policy decision. But mostly, it was fallout from the way we use the `empty` block
set.

Here's how `empty` used to work. If a block is empty, we don't run destructors. We say that a block
is empty if:

A) It has no live objects and its a non-destructor block, or
B) We just allocated it (so it has no destructors even if it's a destructor block), or
C) We just stole it from another allocator (so it also has no destructors), or
D) We just swept the block and ran all destructors.

Case (A) is for trading blocks. That's how a different MarkedAllocator would know that this is a
block that could be stolen.

Cases (B) and (C) need to be detected for correctness, since otherwise we might try to run
destructors in blocks that have garbage bits. In that case, the isZapped check won't detect that
cells don't need destruction, so without having the `empty` bit we would try to destruct garbage
and crash. Currently, we know that we have cases (B) and (C) when the block is empty.

Case (D) is necessary for detecting which blocks can be removed when we `shrink` the heap.

If we tried to enable trading of blocks between allocators without making any changes to how
`empty` works, then it just would not work. We have to set the `empty` bits of blocks that have no
live objects in order for those bits to be candidates for trading. But if we do that, then our
logic for cases (B-D) will think that the block has no destructible objects. That's bad, since then
our destructors won't run and we'll leak memory.

This change fixes this issue by decoupling the "do I have destructors" question from the "do I have
live objects" question by introducing a new `destructible` bitvector. The GC flags all live blocks
as being destructible at the end. We clear the destructible bit in cases (B-D). Cases (B-C) are
handled entirely by the new destrictible bit, while case (D) is detected by looking for blocks that
are (empty & ~destructible).

Then we can simply remove all destructor-oriented special-casing of the `empty` bit. And we can
remove destructor-oriented special-casing of block trading.

This is a perf-neutral change. We expect most free memory to be in non-destructor blocks anyway,
so this change is more about clean-up than perf. But, this could reduce memory usage in some
pathological cases.

* heap/MarkedAllocator.cpp:
(JSC::MarkedAllocator::findEmptyBlockToSteal):
(JSC::MarkedAllocator::tryAllocateWithoutCollecting):
(JSC::MarkedAllocator::endMarking):
(JSC::MarkedAllocator::shrink):
(JSC::MarkedAllocator::shouldStealEmptyBlocksFromOtherAllocators): Deleted.
* heap/MarkedAllocator.h:
* heap/MarkedBlock.cpp:
(JSC::MarkedBlock::Handle::lastChanceToFinalize):
(JSC::MarkedBlock::Handle::sweep):
* heap/MarkedBlockInlines.h:
(JSC::MarkedBlock::Handle::specializedSweep):
(JSC::MarkedBlock::Handle::finishSweepKnowingSubspace):
(JSC::MarkedBlock::Handle::emptyMode):

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

2 years ago[Apple Pay] Add "carteBancaire" as a supported payment network
aestes@apple.com [Wed, 26 Jul 2017 01:03:29 +0000 (01:03 +0000)]
[Apple Pay] Add "carteBancaire" as a supported payment network
https://bugs.webkit.org/show_bug.cgi?id=174841
<rdar://problem/31935596>

Reviewed by Alex Christensen.

Source/WebCore:

Tests: http/tests/ssl/applepay/ApplePaySession.html
       http/tests/ssl/applepay/ApplePaySessionV3.html

* Modules/applepay/PaymentRequest.cpp:
(WebCore::PaymentRequest::isValidSupportedNetwork):

Source/WebKit:

* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
(WebKit::toSupportedNetwork):

LayoutTests:

* http/tests/ssl/applepay/ApplePaySession-expected.txt:
* http/tests/ssl/applepay/ApplePaySession.html:
* http/tests/ssl/applepay/ApplePaySessionV3.html:

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

2 years agoRemove Broken CompareEq constant folding phase.
keith_miller@apple.com [Wed, 26 Jul 2017 00:45:58 +0000 (00:45 +0000)]
Remove Broken CompareEq constant folding phase.
https://bugs.webkit.org/show_bug.cgi?id=174846
<rdar://problem/32978808>

Reviewed by Saam Barati.

This bug happened when we would get code like the following:

a: JSConst(Undefined)
b: GetLocal(SomeObjectOrUndefined)
...
c: CompareEq(Check:ObjectOrOther:b, Check:ObjectOrOther:a)

constant folding will turn this into:

a: JSConst(Undefined)
b: GetLocal(SomeObjectOrUndefined)
...
c: CompareEq(Check:ObjectOrOther:b, Other:a)

But the SpeculativeJIT/FTL lowering will fail to check b
properly which leads to an assertion failure in the AI.

I'll follow up with a more robust fix later. For now, I'll remove the
case that generates the code. Removing the code appears to be perf
neutral.

* dfg/DFGConstantFoldingPhase.cpp:
(JSC::DFG::ConstantFoldingPhase::foldConstants):

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

2 years agoWeb Inspector: Fix warnings about console.assert lines without semicolons
commit-queue@webkit.org [Wed, 26 Jul 2017 00:45:04 +0000 (00:45 +0000)]
Web Inspector: Fix warnings about console.assert lines without semicolons
https://bugs.webkit.org/show_bug.cgi?id=174840

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-07-25
Reviewed by Brian Burg.

* UserInterface/Views/SettingsTabContentView.js:
(WebInspector.SettingsTabContentView.prototype.set selectedSettingsView):
(WebInspector.SettingsTabContentView.prototype.setSettingsViewVisible):
Add semicolon to assert lines so they can be stripped in optimized builds.

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

2 years agoWeb Inspector: Inline multiple console log values if they are simple
commit-queue@webkit.org [Tue, 25 Jul 2017 23:31:19 +0000 (23:31 +0000)]
Web Inspector: Inline multiple console log values if they are simple
https://bugs.webkit.org/show_bug.cgi?id=174746
<rdar://problem/33469376>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-07-25
Reviewed by Matt Baker.

* UserInterface/Models/IssueMessage.js:
* UserInterface/Protocol/RemoteObject.js:
(WebInspector.RemoteObject.type): Deleted.
Remove this as it isn't as useful as directly checking the type.

* UserInterface/Views/ConsoleMessageView.js:
(WebInspector.ConsoleMessageView.prototype._appendExtraParameters):
(WebInspector.ConsoleMessageView.prototype._appendFormattedArguments):
(WebInspector.ConsoleMessageView.prototype._hasSimpleDisplay):
(WebInspector.ConsoleMessageView.prototype._isStackTrace):
For leading primitive/simple values, display them inline on the console message.

* UserInterface/Views/FormattedValue.js:
(WebInspector.FormattedValue.hasSimpleDisplay):
Provide a helper to determine if a formatted value will be simple.

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

2 years agoMake StyleResolver::isValid{Cue, Region}StyleProperty() static, inline, non-member...
dbates@webkit.org [Tue, 25 Jul 2017 23:06:29 +0000 (23:06 +0000)]
Make StyleResolver::isValid{Cue, Region}StyleProperty() static, inline, non-member functions
https://bugs.webkit.org/show_bug.cgi?id=174827

Reviewed by Simon Fraser.

StyleResolver::isValid{Cue, Region}StyleProperty() access neither instance nor
class data. Moreover, they are private member functions and hence cannot be
used outside of StyleResolver's implementation. So, make these static, inline,
non-member functions.

* css/StyleResolver.cpp:
(WebCore::isValidRegionStyleProperty):
(WebCore::isValidCueStyleProperty):
(WebCore::StyleResolver::CascadedProperties::addMatch):
(WebCore::StyleResolver::isValidRegionStyleProperty): Deleted.
(WebCore::StyleResolver::isValidCueStyleProperty): Deleted.
* css/StyleResolver.h:

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

2 years agoDragged links are blurry on 1x displays.
pvollan@apple.com [Tue, 25 Jul 2017 22:48:56 +0000 (22:48 +0000)]
Dragged links are blurry on 1x displays.
https://bugs.webkit.org/show_bug.cgi?id=174831
<rdar://problem/33519698>

Reviewed by Simon Fraser.

When the width and height of the drag image is a multiple of 2, the drag image is not blurry
on a 1x display. This is a workaround which should be removed when <rdar://problem/33059739>
is fixed.

No new tests, since this is not straightforward to test with a layout test.

* platform/mac/DragImageMac.mm:
(WebCore::LinkImageLayout::LinkImageLayout):

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

2 years agoMarked multiple fast/ tests as crashing on High Sierra WK1.
jlewis3@apple.com [Tue, 25 Jul 2017 21:49:35 +0000 (21:49 +0000)]
Marked multiple fast/ tests as crashing on High Sierra WK1.
<rdar://problem/33522420>

Unreviewed test gardening.

* platform/mac-highsierra-wk1/TestExpectations:

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

2 years agoWeb Inspector: Refactoring: extract async stack trace logic from InspectorInstrumentation
mattbaker@apple.com [Tue, 25 Jul 2017 21:46:42 +0000 (21:46 +0000)]
Web Inspector: Refactoring: extract async stack trace logic from InspectorInstrumentation
https://bugs.webkit.org/show_bug.cgi?id=174738

Reviewed by Brian Burg.

Source/JavaScriptCore:

Move AsyncCallType enum to InspectorDebuggerAgent, which manages async
stack traces. This preserves the call type in JSC, makes the range of
possible call types explicit, and is safer than passing ints.

* inspector/agents/InspectorDebuggerAgent.cpp:
(Inspector::InspectorDebuggerAgent::asyncCallIdentifier):
(Inspector::InspectorDebuggerAgent::didScheduleAsyncCall):
(Inspector::InspectorDebuggerAgent::didCancelAsyncCall):
(Inspector::InspectorDebuggerAgent::willDispatchAsyncCall):
* inspector/agents/InspectorDebuggerAgent.h:

Source/WebCore:

Relocate AsyncCallType from InspectorInstrumentation to the debugger
agent. Plumbing for `requestAnimationFrame` notifications has been added
to PageDebuggerAgent, which is responsible for managing async stack traces.

* dom/ScriptedAnimationController.cpp:
(WebCore::ScriptedAnimationController::registerCallback):
(WebCore::ScriptedAnimationController::cancelCallback):
(WebCore::ScriptedAnimationController::serviceScriptedAnimations):

* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::didInstallTimerImpl):
(WebCore::InspectorInstrumentation::didRemoveTimerImpl):
(WebCore::InspectorInstrumentation::willFireTimerImpl):
(WebCore::InspectorInstrumentation::didRequestAnimationFrameImpl):
(WebCore::InspectorInstrumentation::didCancelAnimationFrameImpl):
(WebCore::InspectorInstrumentation::willFireAnimationFrameImpl):
(): Deleted.
(WebCore::didScheduleAsyncCall): Deleted.

* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::didRequestAnimationFrame):
(WebCore::InspectorInstrumentation::didCancelAnimationFrame):
(WebCore::InspectorInstrumentation::willFireAnimationFrame):
Replaced Frame and Document pointers with references and moved
pointer validation upstream.

* inspector/PageDebuggerAgent.cpp:
(WebCore::PageDebuggerAgent::didRequestAnimationFrame):
(WebCore::PageDebuggerAgent::willFireAnimationFrame):
(WebCore::PageDebuggerAgent::didCancelAnimationFrame):
* inspector/PageDebuggerAgent.h:

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

2 years agoWeb Inspector: Styles: Add a switch for Spreadsheet model style editor to experimenta...
nvasilyev@apple.com [Tue, 25 Jul 2017 21:43:14 +0000 (21:43 +0000)]
Web Inspector: Styles: Add a switch for Spreadsheet model style editor to experimental settings
https://bugs.webkit.org/show_bug.cgi?id=174741
<rdar://problem/33467954>

Reviewed by Brian Burg.

Show a blank panel when Spreadsheet Style Editor is enabled.

* UserInterface/Base/Setting.js:
* UserInterface/Main.html:
* UserInterface/Views/CSSStyleDetailsSidebarPanel.js:
(WebInspector.CSSStyleDetailsSidebarPanel):
(WebInspector.CSSStyleDetailsSidebarPanel.prototype.computedStyleDetailsPanelShowProperty):
* UserInterface/Views/RulesStyleSpreadsheetDetailsPanel.js: Added.
(WebInspector.RulesStyleSpreadsheetDetailsPanel):
(WebInspector.RulesStyleSpreadsheetDetailsPanel.prototype.filterDidChange):
(WebInspector.RulesStyleSpreadsheetDetailsPanel.prototype.scrollToSectionAndHighlightProperty):

* UserInterface/Views/SettingsTabContentView.css:
(.content-view.settings > .settings-view > .container.hidden):
(.content-view.settings > .settings-view > .container-centered):
(.content-view.settings > .settings-view > .container button):
* UserInterface/Views/SettingsTabContentView.js:
(WebInspector.SettingsTabContentView.prototype._createDebugSettingsView):
* UserInterface/Views/SettingsView.js:
(WebInspector.SettingsView.prototype.addCenteredContainer):
(WebInspector.SettingsView):
Show "Reload Web Inspector" button when Spreadsheet Style Editor setting is modified.

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

2 years agoUse SandboxExtension::HandleArray when sending extensions for file uploads to the...
bburg@apple.com [Tue, 25 Jul 2017 21:22:29 +0000 (21:22 +0000)]
Use SandboxExtension::HandleArray when sending extensions for file uploads to the web process
https://bugs.webkit.org/show_bug.cgi?id=174828

Reviewed by Tim Horton.

Send all of the sandbox extension handles in a single message, rather than
one message per extension. Update message name and parameter types to match.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didChooseFilesForOpenPanelWithDisplayStringAndIcon):
(WebKit::WebPageProxy::didChooseFilesForOpenPanel):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::extendSandboxForFilesFromOpenPanel):
(WebKit::WebPage::extendSandboxForFileFromOpenPanel): Deleted.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:

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

2 years agoMarked imported/w3c/web-platform-tests/XMLHttpRequest/send-blob-with-no-mime-type...
jlewis3@apple.com [Tue, 25 Jul 2017 21:12:13 +0000 (21:12 +0000)]
Marked imported/w3c/web-platform-tests/XMLHttpRequest/send-blob-with-no-mime-type.html as failing.
<rdar://problem/33251388>

Unreviewed test gardening.

* platform/mac-highsierra/TestExpectations:

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

2 years agoFix bugs in probe code to change sp on x86, x86_64 and 32-bit ARM.
mark.lam@apple.com [Tue, 25 Jul 2017 20:56:04 +0000 (20:56 +0000)]
Fix bugs in probe code to change sp on x86, x86_64 and 32-bit ARM.
https://bugs.webkit.org/show_bug.cgi?id=174809
<rdar://problem/33504759>

Reviewed by Filip Pizlo.

1. When the probe handler function changes the sp register to point to the
   region of stack in the middle of the ProbeContext on the stack, there is a
   bug where the ProbeContext's register values to be restored can be over-written
   before they can be restored.  This is now fixed.

2. Added more robust probe tests for changing the sp register.

3. Made existing probe tests to ensure that probe handlers were actually called.

4. Added some verification to testProbePreservesGPRS().

5. Change all the probe tests to fail early on discovering an error instead of
   batching till the end of the test.  This helps point a finger to the failing
   issue earlier.

This patch was tested on x86, x86_64, and ARMv7.  ARM64 probe code will be fixed
next in https://bugs.webkit.org/show_bug.cgi?id=174697.

* assembler/MacroAssemblerARM.cpp:
* assembler/MacroAssemblerARMv7.cpp:
* assembler/MacroAssemblerX86Common.cpp:
* assembler/testmasm.cpp:
(JSC::testProbeReadsArgumentRegisters):
(JSC::testProbeWritesArgumentRegisters):
(JSC::testProbePreservesGPRS):
(JSC::testProbeModifiesStackPointer):
(JSC::testProbeModifiesStackPointerToInsideProbeContextOnStack):
(JSC::testProbeModifiesStackPointerToNBytesBelowSP):
(JSC::testProbeModifiesProgramCounter):
(JSC::run):

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

2 years agoRebaselinged the test http/tests/quicklook/top-navigation-blocked.html
jlewis3@apple.com [Tue, 25 Jul 2017 20:55:46 +0000 (20:55 +0000)]
Rebaselinged the test http/tests/quicklook/top-navigation-blocked.html
https://bugs.webkit.org/show_bug.cgi?id=174755

Unreviewed test gardening.

* http/tests/quicklook/top-navigation-blocked-expected.txt:

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

2 years agoFix autoinstaller failing on autoinstall_everything
commit-queue@webkit.org [Tue, 25 Jul 2017 20:50:19 +0000 (20:50 +0000)]
Fix autoinstaller failing on autoinstall_everything
https://bugs.webkit.org/show_bug.cgi?id=174830

Patch by Matthew Stewart <matthew_r_stewart@apple.com> on 2017-07-25
Reviewed by Joseph Pecoraro.

* Scripts/webkitpy/thirdparty/__init__.py:
(AutoinstallImportHook.find_module):
(AutoinstallImportHook.install_chromedriver):
(AutoinstallImportHook.install_geckodriver):
(AutoinstallImportHook._install_chromedriver): Deleted.
(AutoinstallImportHook._install_geckodriver): Deleted.

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

2 years agoFix API tests after r219871.
achristensen@apple.com [Tue, 25 Jul 2017 20:47:00 +0000 (20:47 +0000)]
Fix API tests after r219871.
https://bugs.webkit.org/show_bug.cgi?id=174807

WebKit2.OpenAndCloseWindowAsync and WebKit2.OpenAsyncWithNil API tests are fixed.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::createNewPage):
createNewPageAsync or createNewPage should be called, not both.

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

2 years agoRebaselined missed test.
jlewis3@apple.com [Tue, 25 Jul 2017 18:56:28 +0000 (18:56 +0000)]
Rebaselined missed test.
https://bugs.webkit.org/show_bug.cgi?id=174734

Unreviewed test gardening.

* fast/events/touch/ios/touches-client-coords-after-zoom-expected.txt:

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

2 years agoAsync image decoding for large images should be disabled after the first time a tile...
commit-queue@webkit.org [Tue, 25 Jul 2017 18:53:08 +0000 (18:53 +0000)]
Async image decoding for large images should be disabled after the first time a tile is painted
https://bugs.webkit.org/show_bug.cgi?id=174451
<rdar://problem/31246421>

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2017-07-25
Reviewed by Simon Fraser.

Source/WebCore:

Flashing because of DOM mutation can be fixed by disabling the asynchronous
image decoding after the first time a tile was painted.

We can detect this by consulting the tile repaintCount. If it is zero, then
it is safe to use asynchronous image decoded. If the tile repaintCount is
greater than zero, we are not sure if the renderer rectangle has an image
drawn in it already or not. In this case we have to use the synchronous
image decoding to avoid causing a flash.

Tests: fast/images/async-image-background-change.html
       fast/images/async-image-src-change.html
       http/tests/multipart/multipart-async-image.html

* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlTextTrackContainerElement::createTextTrackRepresentationImage):
* page/FrameView.cpp:
(WebCore::FrameView::willPaintContents):
(WebCore::FrameView::paintContentsForSnapshot):
* page/PageOverlayController.cpp:
(WebCore::PageOverlayController::paintContents):
* page/PageOverlayController.h:
* page/linux/ResourceUsageOverlayLinux.cpp:
* page/mac/ServicesOverlayController.h:
* page/mac/ServicesOverlayController.mm:
(WebCore::ServicesOverlayController::Highlight::paintContents):
* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::draw):
* platform/graphics/BitmapImage.h:
* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::paintGraphicsLayerContents):
* platform/graphics/GraphicsLayer.h:
* platform/graphics/GraphicsLayerClient.h:
(WebCore::GraphicsLayerClient::paintContents):
* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
(WebCore::LayerClient::platformCALayerPaintContents):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::platformCALayerPaintContents):
* platform/graphics/ca/GraphicsLayerCA.h:
* platform/graphics/ca/PlatformCALayer.h:
* platform/graphics/ca/PlatformCALayerClient.h:
(WebCore::PlatformCALayerClient::platformCALayerRepaintCount):
* platform/graphics/ca/TileCoverageMap.cpp:
(WebCore::TileCoverageMap::platformCALayerPaintContents):
* platform/graphics/ca/TileCoverageMap.h:
* platform/graphics/ca/TileGrid.cpp:
(WebCore::TileGrid::platformCALayerPaintContents):
(WebCore::TileGrid::platformCALayerRepaintCount):
* platform/graphics/ca/TileGrid.h:
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
(PlatformCALayer::drawLayerContents):
* platform/graphics/ca/win/PlatformCALayerWin.cpp:
(PlatformCALayer::drawLayerContents):
* platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
(PlatformCALayerWinInternal::displayCallback):
* platform/graphics/ca/win/WebTiledBackingLayerWin.cpp:
(WebTiledBackingLayerWin::displayCallback):
* platform/graphics/mac/WebLayer.mm:
(-[WebLayer drawInContext:]):
(-[WebSimpleLayer drawInContext:]):
* rendering/PaintPhase.h:
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::decodingModeForImageDraw):
* rendering/RenderElement.h:
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::paintLayerContents):
(WebCore::RenderLayer::paintForegroundForFragments):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::paintContents):
* rendering/RenderLayerBacking.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::paintContents):
* rendering/RenderLayerCompositor.h:
* rendering/RenderWidget.cpp:
(WebCore::RenderWidget::paintContents):
* testing/Internals.cpp:
(WebCore::imageFromImageElement):
(WebCore::bitmapImageFromImageElement):
(WebCore::Internals::imageFrameIndex):
(WebCore::Internals::setImageFrameDecodingDuration):
(WebCore::Internals::resetImageAnimation):
(WebCore::Internals::isImageAnimating):
(WebCore::Internals::setClearDecoderAfterAsyncFrameRequestForTesting):
(WebCore::Internals::imageDecodeCount):
(WebCore::Internals::setLargeImageAsyncDecodingEnabledForTesting):
* testing/Internals.h:
* testing/Internals.idl:

Source/WebKit:

* Shared/mac/RemoteLayerBackingStore.mm:
(WebKit::RemoteLayerBackingStore::drawInContext):
* WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
(WebKit::imageForRect):
* WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
(WebKit::InjectedBundleRangeHandle::renderedImage):
* WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
(WebKit::CompositingCoordinator::paintContents):
* WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:

Source/WebKitLegacy/mac:

* WebView/WebFrame.mm:
(-[WebFrame _paintBehaviorForDestinationContext:]):
(-[WebFrame _drawRect:contentsOnly:]):
* WebView/WebHTMLView.mm:
(imageFromRect):

Source/WebKitLegacy/win:

* FullscreenVideoController.cpp:
(FullscreenVideoController::LayerClient::platformCALayerPaintContents):
* WebCoreSupport/AcceleratedCompositingContext.cpp:
(AcceleratedCompositingContext::paintContents):
* WebCoreSupport/AcceleratedCompositingContext.h:

LayoutTests:

To test async image decoding for large images, we have to create the <img>
element dynamically so we can listen to the load and webkitImageFrameReady
events and know reliably when to end the test. But with this patch the async
image decoding for large images will be disabled after the first paint.
That means async image decoding for large images will be disabled always
unless we force the async image decoding till the image is painted for the
first time. We use Internals::setLargeImageAsyncDecodingEnabledForTesting()
to force the async image decoding. So painting an image in this case will
require multiple paints; in all of them the async image decoding will be
enabled. But this is okay because it resembles the case where the <img> is
created from a static <img> tag in the HTML file.

For new tests, where we want to make sure that mutating the DOM will not
cause a flash, async image decoding will be forced till the image is drawn
for the first time. After that the async image decoding is enabled but not
forced.

Disable new tests for WK1 because the async image decoding is always enabled
because tiling does not necessarily exist in WK1 . But eventually the async
image decoding for large images will be always disabled for WK1.

* fast/images/async-image-background-change-expected.html: Added.
* fast/images/async-image-background-change.html: Added.
* fast/images/async-image-background-image-repeated.html:
* fast/images/async-image-background-image.html:
* fast/images/async-image-body-background-image.html:
* fast/images/async-image-multiple-clients-repaint.html:
* fast/images/async-image-src-change-expected.html: Added.
* fast/images/async-image-src-change.html: Added.
* fast/images/resources/green-400x400.png: Added.
* fast/images/resources/red-100x100.png: Added.
* fast/images/resources/red-400x400.png: Added.
* fast/images/sprite-sheet-image-draw.html:
* http/tests/multipart/multipart-async-image-expected.txt: Added.
* http/tests/multipart/multipart-async-image.html: Added.
* platform/ios-wk1/TestExpectations:
* platform/mac-wk1/TestExpectations:

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

2 years agoReplace --runtime with something for both ios-simulator and ios-device
jbedard@apple.com [Tue, 25 Jul 2017 18:28:34 +0000 (18:28 +0000)]
Replace --runtime with something for both ios-simulator and ios-device
https://bugs.webkit.org/show_bug.cgi?id=173775
<rdar://problem/32952164>

Reviewed by Aakash Jain.

Add --version flag for both iOS simulator and iOS device.

* Scripts/webkitpy/layout_tests/run_webkit_tests.py:
(parse_args): Add --version flag and move --no-install.
* Scripts/webkitpy/port/factory.py:
(platform_options): Move --no-intall to run_webkit_tests.py.
* Scripts/webkitpy/port/ios.py:
(IOSPort):
(IOSPort._is_valid_ios_version): Check that the provided version string is legal.
(IOSPort.get_option): If accessing the iOS version, check that it is a valid version string.
* Scripts/webkitpy/port/ios_device.py:
(IOSDevicePort.ios_version): Consult --version flag before checking connected
devices for iOS version.
* Scripts/webkitpy/port/ios_device_unittest.py:
(IOSDeviceTest.make_port): Set --version option so that we can generate test
expectation paths without devices connected.
(IOSDeviceTest.test_additional_platform_directory): Deleted.
(IOSDeviceTest.test_baseline_searchpath): Deleted.
(IOSDeviceTest.test_expectations_ordering): Deleted.
* Scripts/webkitpy/port/ios_simulator.py:
(IOSSimulatorPort.simulator_runtime): If no runtime is specified, use the --version
flag to specify a runtime.
(IOSSimulatorPort.ios_version): First check the --version flag, then the --runtime
flag and then use the default runtime.

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

2 years agoWeb Automation: add support for uploading files
bburg@apple.com [Tue, 25 Jul 2017 18:03:02 +0000 (18:03 +0000)]
Web Automation: add support for uploading files
https://bugs.webkit.org/show_bug.cgi?id=174797
<rdar://problem/28485063>

Reviewed by Joseph Pecoraro.

Source/JavaScriptCore:

* inspector/scripts/generate-inspector-protocol-bindings.py:
(generate_from_specification):
Start generating frontend dispatcher code if the target framework is 'WebKit'.

* inspector/scripts/codegen/generate_cpp_frontend_dispatcher_implementation.py:
(CppFrontendDispatcherImplementationGenerator.generate_output):
Use a framework include for InspectorFrontendRouter.h since this generated code
will be compiled outside of WebCore.framework.

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

Source/WebKit:

The general strategy is to have automation clients set the list of files they want
to select ahead of time. Then, the client simulates a click on the <input type="file"> element.
When that causes WebPageProxy to ask the UI delegate to runOpenPanel, it instead
gives WebAutomationSession a chance to select files if the page is under control of
automation. WebAutomationSession validates its file list and selects the files if valid.

* CMakeLists.txt: Add frontend dispatcher files.
* DerivedSources.make:
Add frontend dispatcher code generator scripts as dependencies of the generated code.
Add generated frontend dispatcher files to the list of output files.

* UIProcess/Automation/Automation.json:
Add a command to set the canned list of files that should be selected when prompted.
If no files are selected, then the effect is as if the user had clicked "cancel" in
the file chooser dialog.

Add an event to signal to the WebDriver service that the file selection request has
been either fulfilled or cancelled. This event is necessary because otherwise remotes
cannot distinguish whether selecting the files failed for some reason, or if the
UIProcess has not yet selected the files and sent them to the web content process.
In either case, the input element's "files" attribute would return an empty FileList.

* UIProcess/Automation/WebAutomationSession.h:
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::WebAutomationSession):
Add the frontend dispatcher for Automation domain. This is named m_domainNotifier since
m_domainDispatcher is already being used for the backend command dispatcher.

(WebKit::WebAutomationSession::handleRunOpenPanel):
Validate that the files-to-select list has valid entries and select the files if so.
If anything goes wrong, pretend to cancel out of the file chooser. Either way, notify the
frontend with an event that the file chooser was dismissed due to selecting files or cancelling.
Automation protocol clients may implement additional strategies to further restrict
the conditions upon which local files can be uploaded.

(WebKit::WebAutomationSession::setFilesToSelectForFileUpload): Added.
Store the list of files as a vector of strings. The file list is always replaced.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::runOpenPanel):
If the page is under automation, delegating the runOpenPanel is likely to hang
because WebDriver cannot interact directly with the file chooser dialog. Instead,
give WebAutomationSession a chance to select files and don't tell the delegate.

* WebKit.xcodeproj/project.pbxproj:
Add frontend dispatcher files to "Derived Sources" group.

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

2 years ago[WebIDL] Add support for generating timer bindings
weinig@apple.com [Tue, 25 Jul 2017 18:02:57 +0000 (18:02 +0000)]
[WebIDL] Add support for generating timer bindings
https://bugs.webkit.org/show_bug.cgi?id=174766

Reviewed by Darin Adler.

Adds a new non-standard type, ScheduledAction, which stands in for the
standard (DOMString or Function). It would be good to move to that in
future, but for now, this allows for forward momentum on removing custom
bindings.

* WebCore.xcodeproj/project.pbxproj:
Add JSDOMConvertScheduledAction.h.

* bindings/IDLTypes.h:
Add IDLScheduledAction.

* bindings/js/JSDOMConvertScheduledAction.h: Added.
(WebCore::Converter<IDLScheduledAction>::convert):
Add conversion from JSValue -> ScheduledAction. This is moved from the old ScheduledAction
create function.

* bindings/js/JSDOMConvertVariadic.h:
(WebCore::convertVariadicArguments):
(WebCore::Detail::VariadicConverterBase::convert): Deleted.
(WebCore::Detail::VariadicConverterBase<IDLInterface<T>>::convert): Deleted.
* bindings/js/JSDOMConvertBase.h:
* bindings/js/JSDOMConvertAny.h:
(WebCore::VariadicConverter<IDLAny>::convert):
* bindings/js/JSDOMConvertInterface.h:
(WebCore::VariadicConverter<IDLInterface<T>>::convert):
Rename VariadicConverter to VariadicConverterDetails, and remove base class. Rename
VariadicConverterBase to VariadicConverter, and move specializations to the file
containing the base converter for that IDL type

* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::setTimeout): Deleted.
(WebCore::JSDOMWindow::setInterval): Deleted.
* bindings/js/JSWorkerGlobalScopeCustom.cpp:
(WebCore::JSWorkerGlobalScope::setTimeout): Deleted.
(WebCore::JSWorkerGlobalScope::setInterval): Deleted.
Remove custom implementations of setTimeout and setInterval.

* bindings/js/ScheduledAction.cpp:
(WebCore::ScheduledAction::create):
(WebCore::ScheduledAction::ScheduledAction):
(WebCore::ScheduledAction::~ScheduledAction):
(WebCore::ScheduledAction::addArguments):
(WebCore::ScheduledAction::executeFunctionInContext):
* bindings/js/ScheduledAction.h:
(WebCore::ScheduledAction::ScheduledAction): Deleted.
Rework ScheduledAction. Now has two create functions, one for the function
form, one for the string form. These are now called by the Converter. Also,
rather than extracting the arguments directly from the ExecState, allow the
bindings to work as designed, and have the arguments come in as variadic
arguments to setTimeout/setInterval and get added to the ScheduledAction if
needed. Also, move ContentSecurityPolicy check out of construction, and into
setTimeout/setInterval.

* bindings/scripts/CodeGenerator.pm:
(IsBuiltinType):
Add ScheduledAction to the builtin list.

* bindings/scripts/CodeGeneratorJS.pm:
(AddToIncludesForIDLType):
Add the correct include when ScheduledAction is used.

(GenerateParametersCheck):
Remove rule disallowing optional arguments before variadic arguments. That works
just fine.

(GetBaseIDLType):
Add mapping of ScheduledAction -> IDLScheduledAction.

(JSValueToNativeDOMConvertNeedsGlobalObject):
Add ScheduledAction to the list of types that need a global object
for conversion.

* page/WindowOrWorkerGlobalScope.idl:
Update interface to match spec and add FIXMEs for moving to TimerHandler.

* page/DOMWindow.cpp:
(WebCore::DOMWindow::setTimeout):
(WebCore::DOMWindow::setInterval):
* page/DOMWindow.h:
* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::setTimeout):
(WebCore::WorkerGlobalScope::setInterval):
* workers/WorkerGlobalScope.h:
Update for new signatures. WorkerGlobalScope now has to return ExceptionOr<int>
even though it never throws, due to having one IDL file defining these. This is
unfortunate and something we should look at addressing the future.

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

2 years ago[GTK] Unreviewed test gardening
commit-queue@webkit.org [Tue, 25 Jul 2017 17:42:09 +0000 (17:42 +0000)]
[GTK] Unreviewed test gardening
https://bugs.webkit.org/show_bug.cgi?id=174820

Unreviewed gardening.

Patch by Charlie Turner <cturner@igalia.com> on 2017-07-25

* platform/gtk/TestExpectations:

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

2 years agoModernize NavigationAction code
achristensen@apple.com [Tue, 25 Jul 2017 17:17:55 +0000 (17:17 +0000)]
Modernize NavigationAction code
https://bugs.webkit.org/show_bug.cgi?id=174807

Reviewed by Darin Adler.

Mostly just use more move semantics.

* Platform/IPC/HandleMessage.h:
(IPC::callMemberFunctionImpl):
* Shared/API/APIURLRequest.h:
* Shared/NavigationActionData.h:
* UIProcess/API/APINavigation.cpp:
(API::Navigation::Navigation):
* UIProcess/API/APINavigation.h:
(API::Navigation::create):
* UIProcess/API/APINavigationAction.h:
* UIProcess/API/APINavigationClient.h:
(API::NavigationClient::decidePolicyForNavigationAction):
* UIProcess/API/APIPolicyClient.h:
* UIProcess/API/APIUIClient.h:
(API::UIClient::createNewPage):
(API::UIClient::createNewPageAsync):
(API::UIClient::canCreateNewPageAsync):
* UIProcess/API/C/WKPage.cpp:
(WKPageLoadURLRequest):
(WKPageLoadURLRequestWithUserData):
(WKPageSetPageUIClient):
(WKPageSetPageNavigationClient):
* UIProcess/Cocoa/NavigationState.h:
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
* UIProcess/Cocoa/UIDelegate.h:
* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::UIClient::createNewPageCommon):
(WebKit::UIDelegate::UIClient::createNewPage):
(WebKit::UIDelegate::UIClient::canCreateNewPageAsync):
(WebKit::UIDelegate::UIClient::createNewPageAsync):
* UIProcess/WebInspectorProxy.cpp:
(WebKit::decidePolicyForNavigationAction):
* UIProcess/WebNavigationState.cpp:
(WebKit::WebNavigationState::createLoadRequestNavigation):
* UIProcess/WebNavigationState.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::loadRequest):
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
(WebKit::WebPageProxy::decidePolicyForNewWindowAction):
(WebKit::WebPageProxy::createNewPage):
* UIProcess/WebPageProxy.h:

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