WebKit-https.git
3 years agoUpstream the WPE port
zandobersek@gmail.com [Tue, 9 May 2017 11:07:57 +0000 (11:07 +0000)]
Upstream the WPE port
https://bugs.webkit.org/show_bug.cgi?id=171110

Reviewed by Alex Christensen.

.:

webkit-dev thread:
https://lists.webkit.org/pipermail/webkit-dev/2017-April/028923.html

* CMakeLists.txt: Add the WPE port identifier.
* Source/cmake/FindLibGBM.cmake: Added.
* Source/cmake/FindWPEBackend-mesa.cmake: Added.
* Source/cmake/FindWPEBackend.cmake: Added.
* Source/cmake/OptionsWPE.cmake: Added.

Source/JavaScriptCore:

* PlatformWPE.cmake: Added.
* shell/PlatformWPE.cmake: Added.

Source/ThirdParty/ANGLE:

* include/EGL/eglplatform.h:
Allow building WPE on platforms that don't provide X11 libraries.

Source/WebCore:

webkit-dev thread:
https://lists.webkit.org/pipermail/webkit-dev/2017-April/028923.html

Existing files mostly changed to properly use PLATFORM(WPE) build guards.
In-file changes removed from this ChangeLog entry for brevity.

* CMakeLists.txt:
* PlatformWPE.cmake: Added.
* accessibility/AccessibilityObject.h:
* accessibility/wpe/AXObjectCacheWPE.cpp: Added.
* accessibility/wpe/AccessibilityObjectWPE.cpp: Copied from Source/WebCore/platform/audio/glib/AudioBusGLib.cpp.
* config.h:
* crypto/keys/CryptoKeyEC.h:
* crypto/keys/CryptoKeyRSA.h:
* editing/Editor.cpp:
* editing/Editor.h:
* editing/wpe/EditorWPE.cpp: Added.
* page/EventHandler.cpp:
* page/wpe/EventHandlerWPE.cpp: Added.
* platform/Cursor.h:
* platform/DragData.h:
* platform/DragImage.h:
* platform/FileSystem.h:
* platform/MainThreadSharedTimer.cpp:
* platform/MainThreadSharedTimer.h:
* platform/Pasteboard.h:
* platform/PasteboardStrategy.h:
* platform/PlatformPasteboard.h:
* platform/SchemeRegistry.cpp:
* platform/Widget.h:
* platform/audio/glib/AudioBusGLib.cpp:
* platform/glib/FileSystemGlib.cpp:
* platform/graphics/ANGLEWebKitBridge.h:
* platform/graphics/GLContext.cpp:
* platform/graphics/GLContext.h:
* platform/graphics/GraphicsContext3D.h:
* platform/graphics/OpenGLESShims.h:
* platform/graphics/PlatformDisplay.cpp:
* platform/graphics/PlatformDisplay.h:
* platform/graphics/egl/GLContextEGL.cpp:
* platform/graphics/egl/GLContextEGL.h:
* platform/graphics/egl/GLContextEGLWPE.cpp: Copied from Source/WebCore/platform/audio/glib/AudioBusGLib.cpp.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
* platform/graphics/wpe/IconWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
* platform/graphics/wpe/ImageWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
* platform/graphics/wpe/PlatformDisplayWPE.cpp: Added.
* platform/graphics/wpe/PlatformDisplayWPE.h: Added.
* platform/wpe/CursorWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
* platform/wpe/LocalizedStringsWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
* platform/wpe/PasteboardWPE.cpp: Added.
* platform/wpe/PlatformKeyboardEventWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
* platform/wpe/PlatformPasteboardWPE.cpp: Added.
* platform/wpe/PlatformScreenWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
* platform/wpe/RenderThemeWPE.cpp: Copied from Source/WebKit2/Shared/NativeWebWheelEvent.h.
* platform/wpe/RenderThemeWPE.h: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
* platform/wpe/ScrollbarThemeWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
* platform/wpe/ScrollbarThemeWPE.h: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
* platform/wpe/SoundWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
* platform/wpe/ThemeWPE.cpp: Added.
* platform/wpe/ThemeWPE.h: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
* platform/wpe/WidgetWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.

Source/WebCore/PAL:

* pal/PlatformWPE.cmake: Added.

Source/WebKit2:

webkit-dev thread:
https://lists.webkit.org/pipermail/webkit-dev/2017-April/028923.html

Existing files changed to properly use PLATFORM(WPE) build guards or other
WPE-specific additions (e.g. pasteboard support).
In-file changes removed from this ChangeLog entry for brevity.

* Platform/IPC/glib/GSocketMonitor.cpp:
* PlatformWPE.cmake: Added.
* Scripts/generate-forwarding-headers.pl:
* Shared/API/c/WKBase.h:
* Shared/API/c/wpe/WKBaseWPE.h: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
* Shared/API/c/wpe/WebKit.h: Added.
* Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
* Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h:
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
* Shared/DrawingAreaInfo.h:
* Shared/NativeWebKeyboardEvent.h:
* Shared/NativeWebMouseEvent.h:
* Shared/NativeWebTouchEvent.h:
* Shared/NativeWebWheelEvent.h:
* Shared/WebCoreArgumentCoders.cpp:
* Shared/WebCoreArgumentCoders.h:
* Shared/WebPreferencesDefinitions.h:
* Shared/wpe/NativeWebKeyboardEventWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
* Shared/wpe/NativeWebMouseEventWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
* Shared/wpe/NativeWebTouchEventWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
* Shared/wpe/NativeWebWheelEventWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
* Shared/wpe/ProcessExecutablePathWPE.cpp: Added.
* Shared/wpe/WebEventFactory.cpp: Added.
* Shared/wpe/WebEventFactory.h: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
* UIProcess/API/C/WKAPICast.h:
* UIProcess/API/C/wpe/WKAPICastWPE.h: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
* UIProcess/API/C/wpe/WKView.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
* UIProcess/API/C/wpe/WKView.h: Copied from Source/WebKit2/Shared/NativeWebWheelEvent.h.
* UIProcess/API/wpe/CompositingManagerProxy.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
* UIProcess/API/wpe/CompositingManagerProxy.h: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
* UIProcess/API/wpe/CompositingManagerProxy.messages.in: Added.
* UIProcess/API/wpe/DrawingAreaProxyWPE.cpp: Added.
* UIProcess/API/wpe/DrawingAreaProxyWPE.h: Copied from Source/WebKit2/Shared/NativeWebWheelEvent.h.
* UIProcess/API/wpe/PageClientImpl.cpp: Added.
* UIProcess/API/wpe/PageClientImpl.h: Added.
* UIProcess/API/wpe/ScrollGestureController.cpp: Added.
* UIProcess/API/wpe/ScrollGestureController.h: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
* UIProcess/API/wpe/WPEView.cpp: Added.
* UIProcess/API/wpe/WPEView.h: Added.
* UIProcess/API/wpe/WPEViewClient.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
* UIProcess/API/wpe/WPEViewClient.h: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
* UIProcess/API/wpe/WebKit2InspectorGResourceBundle.xml: Added.
* UIProcess/ChildProcessProxy.cpp:
* UIProcess/Launcher/ProcessLauncher.h:
* UIProcess/Launcher/wpe/ProcessLauncherWPE.cpp: Added.
* UIProcess/WebInspectorProxy.h:
* UIProcess/WebPasteboardProxy.h:
* UIProcess/WebPasteboardProxy.messages.in:
* UIProcess/WebProcessPool.cpp:
* UIProcess/wpe/TextCheckerWPE.cpp: Added.
* UIProcess/wpe/WebInspectorProxyWPE.cpp: Added.
* UIProcess/wpe/WebPageProxyWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
* UIProcess/wpe/WebPasteboardProxyWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
* UIProcess/wpe/WebPreferencesWPE.cpp: Copied from Source/WebKit2/Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h.
* UIProcess/wpe/WebProcessPoolWPE.cpp: Added.
* WebKit2.xcodeproj/project.pbxproj:
* WebKit2Prefix.h:
* WebProcess/WebCoreSupport/WebEditorClient.cpp:
* WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
* WebProcess/WebCoreSupport/WebPlatformStrategies.h:
* WebProcess/WebCoreSupport/wpe/WebContextMenuClientWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
* WebProcess/WebCoreSupport/wpe/WebEditorClientWPE.cpp: Added.
* WebProcess/WebCoreSupport/wpe/WebPopupMenuWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
* WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
* WebProcess/WebPage/DrawingArea.cpp:
* WebProcess/WebPage/WebPage.cpp:
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/wpe/CompositingManager.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
* WebProcess/WebPage/wpe/CompositingManager.h: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
* WebProcess/WebPage/wpe/DrawingAreaWPE.cpp: Added.
* WebProcess/WebPage/wpe/DrawingAreaWPE.h: Added.
* WebProcess/WebPage/wpe/WebInspectorUIWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
* WebProcess/WebPage/wpe/WebInspectorWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
* WebProcess/WebPage/wpe/WebPageWPE.cpp: Copied from Source/WebKit2/Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h.
* WebProcess/wpe/WebProcessMainWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
* wpe/wpe-webkit.pc.in: Added.

Source/WTF:

* wtf/Platform.h:
* wtf/PlatformWPE.cmake: Added.
* wtf/glib/RunLoopSourcePriority.h:

Tools:

webkit-dev thread:
https://lists.webkit.org/pipermail/webkit-dev/2017-April/028923.html

Add WPE support to various tooling scripts, TestWebKitAPI and WebKitTestRunner.
In-file changes removed from this ChangeLog entry for brevity.

* BuildSlaveSupport/built-product-archive:
* BuildSlaveSupport/test-result-archive:
* CMakeLists.txt:
* ImageDiff/PlatformWPE.cmake: Added.
* Scripts/build-dumprendertree:
* Scripts/build-webkit:
* Scripts/build-webkittestrunner:
* Scripts/update-webkit-libs-jhbuild:
* Scripts/update-webkitwpe-libs: Added.
* Scripts/webkitdirs.pm:
* Scripts/webkitperl/FeatureList.pm:
* Scripts/webkitpy/layout_tests/run_webkit_tests.py:
* Scripts/webkitpy/port/factory.py:
* Scripts/webkitpy/port/wpe.py: Added.
* TestWebKitAPI/PlatformWPE.cmake: Added.
* TestWebKitAPI/wpe/InjectedBundleControllerWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
* TestWebKitAPI/wpe/PlatformUtilitiesWPE.cpp: Added.
* TestWebKitAPI/wpe/main.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
* WebKitTestRunner/InjectedBundle/AccessibilityController.cpp:
* WebKitTestRunner/InjectedBundle/AccessibilityController.h:
* WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp:
* WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h:
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
* WebKitTestRunner/InjectedBundle/TestRunner.h:
* WebKitTestRunner/InjectedBundle/wpe/AccessibilityControllerWPE.cpp: Added.
* WebKitTestRunner/InjectedBundle/wpe/AccessibilityUIElementWPE.cpp: Added.
* WebKitTestRunner/InjectedBundle/wpe/ActivateFontsWPE.cpp: Added.
* WebKitTestRunner/InjectedBundle/wpe/InjectedBundleWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
* WebKitTestRunner/InjectedBundle/wpe/TestRunnerWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
* WebKitTestRunner/PlatformWPE.cmake: Added.
* WebKitTestRunner/PlatformWebView.h:
* WebKitTestRunner/TestController.cpp:
* WebKitTestRunner/wpe/EventSenderProxyWPE.cpp: Added.
* WebKitTestRunner/wpe/HeadlessViewBackend.cpp: Added.
* WebKitTestRunner/wpe/HeadlessViewBackend.h: Copied from Source/WebKit2/Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h.
* WebKitTestRunner/wpe/PlatformWebViewWPE.cpp: Added.
* WebKitTestRunner/wpe/TestControllerWPE.cpp: Added.
* WebKitTestRunner/wpe/main.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
* jhbuild/jhbuild-wrapper:
* wpe/generate-inspector-gresource-manifest.py: Added.
* wpe/jhbuild.modules: Added.
* wpe/jhbuildrc: Added.
* wpe/patches/cairo-egl-device-create-for-egl-surface.patch: Added.
* wpe/patches/fontconfig-C-11-requires-a-space-between-literal-and-identifier.patch: Added.
* wpe/patches/freetype6-2.4.11-truetype-font-height-fix.patch: Added.
* wpe/patches/gdate-suppress-string-format-literal-warning.patch: Added.
* wpe/patches/glib-warning-fix.patch: Added.
* wpe/patches/gst-plugins-bad-0001-dtls-port-to-OpenSSL-1.1.0.patch: Added.
* wpe/patches/gst-plugins-bad-0002-dtlscertificate-Fix-error-checking-in-RSA_generate_k.patch: Added.
* wpe/patches/gst-plugins-good-Revert-qtdemux-expose-streams-with-first-moof-for-fr.patch: Added.
* wpe/patches/gst-plugins-good-use-the-tfdt-decode-time.patch: Added.
* wpe/patches/gstreamer-typefind-Only-push-a-CAPS-event-downstream-if-the-.patch: Added.

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

3 years agoFix property names in ScrollingTreeScrollingNode::dumpProperties
commit-queue@webkit.org [Tue, 9 May 2017 09:41:49 +0000 (09:41 +0000)]
Fix property names in ScrollingTreeScrollingNode::dumpProperties
https://bugs.webkit.org/show_bug.cgi?id=171848

Patch by Frederic Wang <fwang@igalia.com> on 2017-05-09
Reviewed by Gyuyoung Kim.

No new tests, this function is only used for debugging purpose.

* page/scrolling/ScrollingTreeScrollingNode.cpp:
(WebCore::ScrollingTreeScrollingNode::dumpProperties):

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

3 years ago[GTK] Building Webkit2Gtk without OpenGL fails.
carlosgc@webkit.org [Tue, 9 May 2017 07:45:14 +0000 (07:45 +0000)]
[GTK] Building Webkit2Gtk without OpenGL fails.
https://bugs.webkit.org/show_bug.cgi?id=170959

Reviewed by Žan Doberšek.

Source/WebCore:

* platform/graphics/texmap/TextureMapperGC3DPlatformLayer.cpp:
* platform/graphics/texmap/TextureMapperGC3DPlatformLayer.h:
* platform/graphics/texmap/TextureMapperPlatformLayerBuffer.h:

Source/WebKit2:

* UIProcess/gtk/HardwareAccelerationManager.cpp:
(WebKit::HardwareAccelerationManager::HardwareAccelerationManager):

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

3 years ago[AppleWin] CaptureDeviceManager.cpp: error C2813: #import is not supported with /MP
commit-queue@webkit.org [Tue, 9 May 2017 07:37:03 +0000 (07:37 +0000)]
[AppleWin] CaptureDeviceManager.cpp: error C2813: #import is not supported with /MP
https://bugs.webkit.org/show_bug.cgi?id=171849

Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2017-05-09
Reviewed by Per Arne Vollan.

* platform/mediastream/CaptureDeviceManager.cpp: Replaced #import with #include.

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

3 years agoCallLinkInfos belonging to Wasm->JS stubs need to be informed when we clearCode(...
sbarati@apple.com [Tue, 9 May 2017 07:15:01 +0000 (07:15 +0000)]
CallLinkInfos belonging to Wasm->JS stubs need to be informed when we clearCode() from all Executables
https://bugs.webkit.org/show_bug.cgi?id=171707
<rdar://problem/31891649>

Reviewed by Filip Pizlo.

This patch fixes a bug where a Wasm->JS IC call stub would go stale
and point into a CodeBlock no longer owned by any executable. The
problematic scenario is this:

1. We generate the call IC which has a branch on a callee check. This
   callee owns the Executable in question. If the branch succeeds, it
   will call code belonging to a particular CodeBlock associated with
   that Executable.

2. Heap::deleteAllCodeBlocks is called. This leads the Executable to clear
   its various CodeBlock references.

3. Wasm has no idea this happened, so now it has stale ICs that point into
   code from a CodeBlock no longer belonging to an Executable.

This patch fixes the bug by informing all JSWebAssemblyCodeBlocks to unlink
their CallLinkInfo when Heap::deleteAllCodeBlocks is called.

We track all JSWebAssemblyCodeBlocks by creating a new subspace for them.
This allows us to quickly iterate over the live JSWebAssemblyCodeBlocks in the
heap.

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* heap/Heap.cpp:
(JSC::Heap::deleteAllCodeBlocks):
* heap/Subspace.h:
* heap/SubspaceInlines.h:
(JSC::Subspace::forEachLiveCell):
* runtime/VM.cpp:
(JSC::VM::VM):
* runtime/VM.h:
* wasm/js/JSWebAssemblyCodeBlock.cpp:
(JSC::JSWebAssemblyCodeBlock::clearJSCallICs):
* wasm/js/JSWebAssemblyCodeBlock.h:
(JSC::JSWebAssemblyCodeBlock::createStructure): Deleted.
(JSC::JSWebAssemblyCodeBlock::functionImportCount): Deleted.
(JSC::JSWebAssemblyCodeBlock::module): Deleted.
(JSC::JSWebAssemblyCodeBlock::jsEntrypointCalleeFromFunctionIndexSpace): Deleted.
(JSC::JSWebAssemblyCodeBlock::wasmEntrypointLoadLocationFromFunctionIndexSpace): Deleted.
(JSC::JSWebAssemblyCodeBlock::wasmToJsCallStubForImport): Deleted.
(JSC::JSWebAssemblyCodeBlock::offsetOfImportWasmToJSStub): Deleted.
(JSC::JSWebAssemblyCodeBlock::codeBlock): Deleted.
(JSC::JSWebAssemblyCodeBlock::offsetOfImportStubs): Deleted.
(JSC::JSWebAssemblyCodeBlock::allocationSize): Deleted.
(JSC::JSWebAssemblyCodeBlock::importWasmToJSStub): Deleted.
* wasm/js/JSWebAssemblyCodeBlockSubspace.cpp: Added.
(JSC::JSWebAssemblyCodeBlockSubspace::JSWebAssemblyCodeBlockSubspace):
(JSC::JSWebAssemblyCodeBlockSubspace::~JSWebAssemblyCodeBlockSubspace):
(JSC::JSWebAssemblyCodeBlockSubspace::finishSweep):
(JSC::JSWebAssemblyCodeBlockSubspace::destroy):
* wasm/js/JSWebAssemblyCodeBlockSubspace.h: Added.

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

3 years agoRefactor / Clean up DOMWindow.idl
cdumez@apple.com [Tue, 9 May 2017 06:14:32 +0000 (06:14 +0000)]
Refactor / Clean up DOMWindow.idl
https://bugs.webkit.org/show_bug.cgi?id=171843

Reviewed by Ryosuke Niwa.

Refactor / Clean up DOMWindow.idl to match the specification more closely:
- https://html.spec.whatwg.org/#the-window-object

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

* page/DOMWindow.idl:

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

3 years agoSimplify ScrollingStateNode::scrollingStateTreeAsText
commit-queue@webkit.org [Tue, 9 May 2017 05:25:46 +0000 (05:25 +0000)]
Simplify ScrollingStateNode::scrollingStateTreeAsText
https://bugs.webkit.org/show_bug.cgi?id=171802

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

Source/WebCore:

The following simplifications are performed:
- Rely on TextStream's internal value to manage indentation.
- Use TextStream::dumpProperty and << to print simple properties.
- Try and use TextStream::GroupScope for groups.

No new tests, only minor format changes in the dumped tree.

* page/scrolling/ScrollingStateFixedNode.cpp:
(WebCore::ScrollingStateFixedNode::dumpProperties):
* page/scrolling/ScrollingStateFixedNode.h:
* page/scrolling/ScrollingStateFrameScrollingNode.cpp:
(WebCore::ScrollingStateFrameScrollingNode::dumpProperties):
* page/scrolling/ScrollingStateFrameScrollingNode.h:
* page/scrolling/ScrollingStateNode.cpp:
(WebCore::ScrollingStateNode::dumpProperties):
(WebCore::ScrollingStateNode::dump):
(WebCore::ScrollingStateNode::scrollingStateTreeAsText):
* page/scrolling/ScrollingStateNode.h:
* page/scrolling/ScrollingStateOverflowScrollingNode.cpp:
(WebCore::ScrollingStateOverflowScrollingNode::dumpProperties):
* page/scrolling/ScrollingStateOverflowScrollingNode.h:
* page/scrolling/ScrollingStateScrollingNode.cpp:
(WebCore::ScrollingStateScrollingNode::dumpProperties):
* page/scrolling/ScrollingStateScrollingNode.h:
* page/scrolling/ScrollingStateStickyNode.cpp:
(WebCore::ScrollingStateStickyNode::dumpProperties):
* page/scrolling/ScrollingStateStickyNode.h:

LayoutTests:

Update references due to minor format changes in text ouput of scrolling state trees.

* fast/scrolling/ios/remove-scrolling-role-expected.txt:
* fast/visual-viewport/tiled-drawing/zoomed-fixed-scrolled-down-expected.txt:
* fast/visual-viewport/tiled-drawing/zoomed-fixed-scrolled-down-then-up-expected.txt:
* fast/visual-viewport/tiled-drawing/zoomed-fixed-scrolling-layers-state-expected.txt:
* tiled-drawing/scrolling/clamp-out-of-bounds-scrolls-expected.txt:
* tiled-drawing/scrolling/fixed/absolute-inside-fixed-expected.txt:
* tiled-drawing/scrolling/fixed/absolute-inside-out-of-view-fixed-expected.txt:
* tiled-drawing/scrolling/fixed/fixed-in-overflow-expected.txt:
* tiled-drawing/scrolling/fixed/fixed-position-out-of-view-expected.txt:
* tiled-drawing/scrolling/fixed/fixed-position-out-of-view-negative-zindex-expected.txt:
* tiled-drawing/scrolling/fixed/four-bars-expected.txt:
* tiled-drawing/scrolling/fixed/four-bars-with-header-and-footer-expected.txt:
* tiled-drawing/scrolling/fixed/four-bars-zoomed-expected.txt:
* tiled-drawing/scrolling/fixed/negative-scroll-offset-expected.txt:
* tiled-drawing/scrolling/fixed/negative-scroll-offset-in-view-expected.txt:
* tiled-drawing/scrolling/fixed/nested-fixed-expected.txt:
* tiled-drawing/scrolling/fixed/percentage-inside-fixed-expected.txt:
* tiled-drawing/scrolling/frames/coordinated-frame-expected.txt:
* tiled-drawing/scrolling/frames/coordinated-frame-gain-scrolling-ancestor-expected.txt:
* tiled-drawing/scrolling/frames/coordinated-frame-in-fixed-expected.txt:
* tiled-drawing/scrolling/frames/coordinated-frame-lose-scrolling-ancestor-expected.txt:
* tiled-drawing/scrolling/frames/fixed-inside-frame-expected.txt:
* tiled-drawing/scrolling/frames/remove-coordinated-frame-expected.txt:
* tiled-drawing/scrolling/frames/scroll-region-after-frame-layout-expected.txt:
* tiled-drawing/scrolling/scrolling-tree-after-scroll-expected.txt:
* tiled-drawing/scrolling/scrolling-tree-slow-scrolling-expected.txt:
* tiled-drawing/scrolling/sticky/negative-scroll-offset-expected.txt:
* tiled-drawing/scrolling/sticky/sticky-horizontal-expected.txt:
* tiled-drawing/scrolling/sticky/sticky-vertical-expected.txt:

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

3 years agoFollow-up to bug 171710: use more references and reject if either audio or video...
commit-queue@webkit.org [Tue, 9 May 2017 05:14:32 +0000 (05:14 +0000)]
Follow-up to bug 171710: use more references and reject if either audio or video source creation is failing
https://bugs.webkit.org/show_bug.cgi?id=171824

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

Source/WebCore:

Refactoring to use more references.
Only behavioral change is the rejection of the getUserMedia promise if either audio or video source creation is
failing. Previously, if audio source creation was failing, the promise would still resolve if video source was
sucessfully created.

* platform/mediastream/RealtimeMediaSourceCenter.cpp:
(WebCore::RealtimeMediaSourceCenter::audioFactory):
(WebCore::RealtimeMediaSourceCenter::videoFactory):
(WebCore::RealtimeMediaSourceCenter::audioCaptureDeviceManager):
(WebCore::RealtimeMediaSourceCenter::videoCaptureDeviceManager):
* platform/mediastream/RealtimeMediaSourceCenter.h:
(WebCore::RealtimeMediaSourceCenter::defaultAudioFactory): Deleted.
(WebCore::RealtimeMediaSourceCenter::defaultVideoFactory): Deleted.
(WebCore::RealtimeMediaSourceCenter::defaultAudioCaptureDeviceManager): Deleted.
(WebCore::RealtimeMediaSourceCenter::defaultVideoCaptureDeviceManager): Deleted.
* platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
(WebCore::RealtimeMediaSourceCenterMac::createMediaStream):
(WebCore::RealtimeMediaSourceCenterMac::getMediaStreamDevices):
(WebCore::RealtimeMediaSourceCenterMac::bestSourcesForTypeAndConstraints):
(WebCore::RealtimeMediaSourceCenterMac::defaultAudioFactory):
(WebCore::RealtimeMediaSourceCenterMac::defaultVideoFactory):
(WebCore::RealtimeMediaSourceCenterMac::defaultAudioCaptureDeviceManager):
(WebCore::RealtimeMediaSourceCenterMac::defaultVideoCaptureDeviceManager):
* platform/mediastream/mac/RealtimeMediaSourceCenterMac.h:
* platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.h:
* platform/mock/MockRealtimeMediaSourceCenter.cpp:
(WebCore::MockRealtimeMediaSourceCenter::defaultAudioFactory):
(WebCore::MockRealtimeMediaSourceCenter::defaultVideoFactory):
(WebCore::MockRealtimeMediaSourceCenter::defaultAudioCaptureDeviceManager):
(WebCore::MockRealtimeMediaSourceCenter::defaultVideoCaptureDeviceManager):
* platform/mock/MockRealtimeMediaSourceCenter.h:

Source/WebKit2:

* UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
(WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):

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

3 years agoUnreviewed GTK expectations gardening
mcatanzaro@igalia.com [Tue, 9 May 2017 03:59:50 +0000 (03:59 +0000)]
Unreviewed GTK expectations gardening

* platform/gtk/TestExpectations:
* webaudio/codec-tests/wav/24bit-22khz-resample-expected.wav:

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

3 years agoREGRESSION(r213564): Flash video playback failures
bfulgham@apple.com [Tue, 9 May 2017 03:24:53 +0000 (03:24 +0000)]
REGRESSION(r213564): Flash video playback failures
https://bugs.webkit.org/show_bug.cgi?id=171840
<rdar://problem/32041569>

Reviewed by Alexey Proskuryakov.

The sandbox restrictions added in r213564 to prevent access to unused iokit properties
blocked some items needed for Flash video playback. This change relaxes the sandbox
to allow this software to run properly.

* PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:

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

3 years agoDrop [CEReactions] from CharacterData operations
cdumez@apple.com [Tue, 9 May 2017 02:46:26 +0000 (02:46 +0000)]
Drop [CEReactions] from CharacterData operations
https://bugs.webkit.org/show_bug.cgi?id=171813

Reviewed by Ryosuke Niwa.

Drop [CEReactions] from CharacterData operations to match the DOM specification:
- https://dom.spec.whatwg.org/#interface-characterdata

I believe WebKit had this because Attr used to have Text child nodes. Therefore, modifying
those Text child nodes via the CharacterData API could modify the value of an attribute,
requiring us to run attributeChangedCallback for Custom Elements. However, as of
<https://trac.webkit.org/r216259>, Attr can no longer have Text child nodes.

I have also verified that Blink does not have [CEReactions] for those methods.

No new tests, no expected Web-facing behavior change.

* dom/CharacterData.idl:

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

3 years agoReduce PassRefPtr use in WebKit2
achristensen@apple.com [Tue, 9 May 2017 02:22:45 +0000 (02:22 +0000)]
Reduce PassRefPtr use in WebKit2
https://bugs.webkit.org/show_bug.cgi?id=171831

Reviewed by Chris Dumez.

* UIProcess/API/C/WKPageGroup.cpp:
(WKPageGroupCreateWithIdentifier):
* UIProcess/GenericCallback.h:
(WebKit::GenericCallback::create):
(WebKit::CallbackMap::put):
* UIProcess/StatisticsRequest.cpp:
(WebKit::StatisticsRequest::StatisticsRequest):
* UIProcess/StatisticsRequest.h:
(WebKit::StatisticsRequest::create):
* UIProcess/TextChecker.h:
* UIProcess/TextCheckerCompletion.cpp:
(WebKit::TextCheckerCompletion::create):
* UIProcess/TextCheckerCompletion.h:
* UIProcess/WebColorPicker.h:
(WebKit::WebColorPicker::create):
* UIProcess/WebConnectionToWebProcess.cpp:
(WebKit::WebConnectionToWebProcess::create):
* UIProcess/WebConnectionToWebProcess.h:
* UIProcess/WebContextInjectedBundleClient.cpp:
(WebKit::WebContextInjectedBundleClient::getInjectedBundleInitializationUserData):
* UIProcess/WebContextInjectedBundleClient.h:
* UIProcess/WebContextMenuListenerProxy.h:
(WebKit::WebContextMenuListenerProxy::create):
* UIProcess/WebCookieManagerProxy.cpp:
(WebKit::WebCookieManagerProxy::create):
* UIProcess/WebCookieManagerProxy.h:
* UIProcess/WebEditCommandProxy.h:
(WebKit::WebEditCommandProxy::create):
* UIProcess/WebFormSubmissionListenerProxy.h:
(WebKit::WebFormSubmissionListenerProxy::create):
* UIProcess/WebFrameListenerProxy.h:
* UIProcess/WebFrameProxy.h:
(WebKit::WebFrameProxy::create):
* UIProcess/WebFullScreenManagerProxy.cpp:
(WebKit::WebFullScreenManagerProxy::create):
* UIProcess/WebFullScreenManagerProxy.h:
* UIProcess/WebGeolocationManagerProxy.cpp:
(WebKit::WebGeolocationManagerProxy::create):
* UIProcess/WebGeolocationManagerProxy.h:
* UIProcess/WebIconDatabase.cpp:
(WebKit::WebIconDatabase::create):
(WebKit::WebIconDatabase::iconDataForPageURL):
* UIProcess/WebIconDatabase.h:
* UIProcess/WebMediaSessionFocusManager.cpp:
(WebKit::WebMediaSessionFocusManager::create):
* UIProcess/WebMediaSessionFocusManager.h:
* UIProcess/WebOpenPanelResultListenerProxy.h:
(WebKit::WebOpenPanelResultListenerProxy::create):
* UIProcess/WebPageGroup.cpp:
(WebKit::WebPageGroup::create):
* UIProcess/WebPageGroup.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::forceRepaint):
(WebKit::WebPageProxy::computePagesForPrinting):
(WebKit::WebPageProxy::drawRectToImage):
(WebKit::WebPageProxy::drawPagesToPDF):
(WebKit::WebPageProxy::drawPagesForPrinting):
(WebKit::WebPageProxy::callAfterNextPresentationUpdate):
* UIProcess/WebPageProxy.h:
* UIProcess/ios/TextCheckerIOS.mm:
(WebKit::TextChecker::requestCheckingOfString):
* UIProcess/mac/TextCheckerMac.mm:
(WebKit::TextChecker::requestCheckingOfString):
* UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
* UIProcess/mac/WKFullScreenWindowController.mm:
(-[WKFullScreenWindowController finishedExitFullScreenAnimation:]):
* UIProcess/mac/WKPrintingView.mm:
(-[WKPrintingView _preparePDFDataForPrintingOnSecondaryThread]):
(-[WKPrintingView _drawPreview:]):
* WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
(WebKit::NetscapePlugin::loadURL):
(WebKit::NetscapePlugin::manualStreamDidReceiveResponse):
* WebProcess/Plugins/Netscape/NetscapePluginStream.cpp:
(WebKit::NetscapePluginStream::NetscapePluginStream):
* WebProcess/Plugins/Netscape/NetscapePluginStream.h:
(WebKit::NetscapePluginStream::create):
* WebProcess/WebCoreSupport/SessionStateConversion.cpp:
(WebKit::toFormData):

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

3 years agoRemove black background from video layer while in fullscreen.
commit-queue@webkit.org [Tue, 9 May 2017 02:00:05 +0000 (02:00 +0000)]
Remove black background from video layer while in fullscreen.
https://bugs.webkit.org/show_bug.cgi?id=171816

Patch by Jeremy Jones <jeremyj@apple.com> on 2017-05-08
Reviewed by Eric Carlson.

No new tests because no new behavior in DOM.

This changes the background of the video layer to clear when it goes into fullscreen
and back to black when it returns to inline to better facilitate fullsceen animations.

* platform/graphics/avfoundation/objc/VideoFullscreenLayerManager.mm:
(WebCore::VideoFullscreenLayerManager::setVideoLayer):
(WebCore::VideoFullscreenLayerManager::setVideoFullscreenLayer):

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

3 years agoThe Incomplete asynchronously decoded image frame should be decoded every time it...
said@apple.com [Tue, 9 May 2017 01:53:54 +0000 (01:53 +0000)]
The Incomplete asynchronously decoded image frame should be decoded every time it's drawn
https://bugs.webkit.org/show_bug.cgi?id=170836

Reviewed by Tim Horton.

The asynchronously decoded image frames has to be cached to prevent flickering,
but we have to keep requesting new decoding for the incomplete frame every time
it's drawn. This is to avoid drawing an incomplete image frame even after all
its encoded data is received.

* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::draw):
* platform/graphics/ImageFrameCache.cpp:
(WebCore::ImageFrameCache::cacheAsyncFrameNativeImageAtIndex):
(WebCore::ImageFrameCache::requestFrameAsyncDecodingAtIndex):

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

3 years agoGuard DragController::cleanupAfterSystemDrag to only clear drag state on Mac
wenson_hsieh@apple.com [Tue, 9 May 2017 01:45:20 +0000 (01:45 +0000)]
Guard DragController::cleanupAfterSystemDrag to only clear drag state on Mac
https://bugs.webkit.org/show_bug.cgi?id=171771
<rdar://problem/32019149>

Reviewed by Tim Horton.

The call to dragEnded here seems to have been added because a client could override Mac WK1
WebUIDelegate methods to cause this cleanup to never be performed. Since this limitation only
applies to Mac, guard it as such.

* page/mac/DragControllerMac.mm:
(WebCore::DragController::cleanupAfterSystemDrag):

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

3 years agoUnreviewed, rolling out r216262.
commit-queue@webkit.org [Tue, 9 May 2017 01:41:58 +0000 (01:41 +0000)]
Unreviewed, rolling out r216262.
https://bugs.webkit.org/show_bug.cgi?id=171842

"It regressed JetStream on iOS by 7%" (Requested by saamyjoon
on #webkit).

Reverted changeset:

"GCController.cpp's collect() should be Async"
https://bugs.webkit.org/show_bug.cgi?id=171708
http://trac.webkit.org/changeset/216262

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

3 years agotestWasmBoundsCheck and testCallFunctionWithHellaArguments is broken in testb3
sbarati@apple.com [Tue, 9 May 2017 01:35:22 +0000 (01:35 +0000)]
testWasmBoundsCheck and testCallFunctionWithHellaArguments is broken in testb3
https://bugs.webkit.org/show_bug.cgi?id=171392
<rdar://problem/31872222>

Reviewed by Keith Miller.

This patch fixes two bugs. The first one is:
Inside testb3, we were using the wrong WasmBoundsCheckValue constructor.
Everything compiled OK because of implicit casting in C. I've changed one
of the constructors to take arguments in a different order so we don't
run into this problem again.

The second bug was that Air::ShufflePair::inst was assuming that a move
from BigImm to its destination is always valid. This is not the case.
For example, the store, `Move BigImm, Addr` is not allowed. I refactored
the code to be correct by emitting more than one instruction when needeed.

When testing my changes, I ran ARM64 testb3 both in debug and
release. I ran into many pre-existing failures. I've opened
a new bug to fix those here: https://bugs.webkit.org/show_bug.cgi?id=171826

* b3/B3WasmBoundsCheckValue.cpp:
(JSC::B3::WasmBoundsCheckValue::WasmBoundsCheckValue):
* b3/B3WasmBoundsCheckValue.h:
* b3/air/AirEmitShuffle.cpp:
(JSC::B3::Air::ShufflePair::insts):
(JSC::B3::Air::ShufflePair::inst): Deleted.
* b3/air/AirEmitShuffle.h:
* b3/air/AirLowerMacros.cpp:
(JSC::B3::Air::lowerMacros):
* b3/testb3.cpp:
(JSC::B3::testLoadAcq42):
(JSC::B3::testStoreRelAddLoadAcq32):
(JSC::B3::testStoreRelAddLoadAcq8):
(JSC::B3::testStoreRelAddFenceLoadAcq8):
(JSC::B3::testStoreRelAddLoadAcq16):
(JSC::B3::testStoreRelAddLoadAcq64):
(JSC::B3::testSimplePatchpointWithOuputClobbersGPArgs):
(JSC::B3::testCheckMul):
(JSC::B3::testCheckMulMemory):
(JSC::B3::testCheckMul64):
(JSC::B3::testCheckMulFold):
(JSC::B3::testCheckMulFoldFail):
(JSC::B3::testCheckMulArgumentAliasing64):
(JSC::B3::testCheckMulArgumentAliasing32):
(JSC::B3::testCheckMul64SShr):
(JSC::B3::testCallFunctionWithHellaArguments):
(JSC::B3::functionWithHellaArguments2):
(JSC::B3::testCallFunctionWithHellaArguments2):
(JSC::B3::functionWithHellaArguments3):
(JSC::B3::testCallFunctionWithHellaArguments3):
(JSC::B3::testSpillDefSmallerThanUse):
(JSC::B3::testLateRegister):
(JSC::B3::testTerminalPatchpointThatNeedsToBeSpilled):
(JSC::B3::testTerminalPatchpointThatNeedsToBeSpilled2):
(JSC::B3::testMoveConstants):
(JSC::B3::testAtomicWeakCAS):
(JSC::B3::testAtomicStrongCAS):
(JSC::B3::testAtomicXchg):
(JSC::B3::testWasmBoundsCheck):
(JSC::B3::run):
* wasm/WasmB3IRGenerator.cpp:
(JSC::Wasm::B3IRGenerator::emitCheckAndPreparePointer):

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

3 years agoMarked http/tests/security/storage-blocking-loosened-plugin.html as flaky
ryanhaddad@apple.com [Tue, 9 May 2017 00:32:33 +0000 (00:32 +0000)]
Marked http/tests/security/storage-blocking-loosened-plugin.html as flaky
https://bugs.webkit.org/show_bug.cgi?id=171837

Unreviewed test gardening.

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

* platform/mac-wk2/TestExpectations:

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

3 years agoMove offsetParent / offsetLeft / offsetTop / offsetWidth / offsetHeight from Element...
cdumez@apple.com [Tue, 9 May 2017 00:16:18 +0000 (00:16 +0000)]
Move offsetParent / offsetLeft / offsetTop / offsetWidth / offsetHeight from Element to HTMLElement
https://bugs.webkit.org/show_bug.cgi?id=171829

Reviewed by Simon Fraser.

LayoutTests/imported/w3c:

Re-sync Web-Platform-Test after:
- https://github.com/w3c/web-platform-tests/pull/5855

* web-platform-tests/cssom-view/offsetParent_element_test.html:

Source/WebCore:

Move offsetParent / offsetLeft / offsetTop / offsetWidth / offsetHeight from Element to HTMLElement,
as per the specification:
- https://drafts.csswg.org/cssom-view/#extensions-to-the-htmlelement-interface

Both Firefox and Chrome match the specification and also do not have the corresponding API on
SVGElement.

Bug tracking the similar move in Blink (completed over 1 year ago):
- https://bugs.chromium.org/p/chromium/issues/detail?id=463116

Note that for the inner SVG elements like <rect> and <circle> these attributes were returning 0,
because those aren't part of the CSS box model. They did return correct values for the <svg>
element itself, however.

Test: fast/css/htmlelement-offset-properties.html

* dom/Element.idl:
- Drop offset* attributes, now that they are on HTMLElement.

* html/HTMLElement.idl:
- Resync HTMLElement.idl with the specification: https://html.spec.whatwg.org/#htmlelement
  No behavior change besides what's indicated in the Changelog above. Things that do not match
  the spec have been annotated with FIXME comments.
- Add offset* attributes that used to be on Element.

LayoutTests:

* fast/css/htmlelement-offset-properties-expected.txt:
* fast/css/htmlelement-offset-properties.html:
Add layout test coverage.

* editing/pasteboard/drag-link-with-data-transfer-adds-trusted-link-to-pasteboard.html:
* fast/css-grid-layout/grid-item-display.html:
* js/dom/dom-static-property-for-in-iteration-expected.txt:
* mathml/presentation/menclose-notation-no-overlap-expected.txt:
* mathml/presentation/menclose-notation-no-overlap.html:
* platform/mac/inspector/model/remote-object-expected.txt:
* svg/dynamic-updates/resources/SVGTestCase.js:
(clickAt):
* svg/text/inline-text-destroy-attributes-crash.xhtml:
Use getClientBoundingRect() instead of offset* properties for non-HTML elements.

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

3 years agoWeb Inspector: RTL: box model labels have bad alignment
bburg@apple.com [Mon, 8 May 2017 23:41:14 +0000 (23:41 +0000)]
Web Inspector: RTL: box model labels have bad alignment
https://bugs.webkit.org/show_bug.cgi?id=171817

Reviewed by Joseph Pecoraro.

* UserInterface/Views/BoxModelDetailsSectionRow.css:
(.details-section .row.box-model .label):
(body[dir=ltr] .details-section .row.box-model .label):
(body[dir=rtl] .details-section .row.box-model .label):
We can't just use a mirrored leading margin because all the
text here is center-aligned. Just hardcode a reasonable value.

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

3 years agoMarked imported/w3c/web-platform-tests/XMLHttpRequest/timeout-multiple-fetches.html...
ryanhaddad@apple.com [Mon, 8 May 2017 23:39:45 +0000 (23:39 +0000)]
Marked imported/w3c/web-platform-tests/XMLHttpRequest/timeout-multiple-fetches.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=169637

Unreviewed test gardening.

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

* platform/ios-wk2/TestExpectations:

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

3 years agoAdd support for reading and writing settings from UIProcess audio capture
commit-queue@webkit.org [Mon, 8 May 2017 23:31:56 +0000 (23:31 +0000)]
Add support for reading and writing settings from UIProcess audio capture
https://bugs.webkit.org/show_bug.cgi?id=171633

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

Source/WebCore:

Covered by manual testing and existing test sets.

Moving success/failure callbacks for applyConstraints.
Making main RealtimeMediaSource::applyConstraints virtual so that WebProcess source proxies can implement it by
doing an IPC call directly. Doing so for UIProcess CoreAudioCaptureSource.

Adding support for volume to CoreAudioCaptureSource by applying gain post-capturing.
Adding support for toggling echo cancellation in CoreAudioCaptureSource.
Adding support to change echo cancellation and sample rate by scheduling a reconfiguration of the audio unit.
To do so, we stop producing data, delete the audio unit and restart producing data.
Removing CoreAudioCaptureSource::supportedConstraints as it is redundant with
RealtimeMediaSourceSettings::supportedConstraints.

Setting sample rate only to the following values: 8000, 16000, 32000, 44100, 48000.

* Modules/mediastream/MediaStreamTrack.cpp:
(WebCore::MediaStreamTrack::applyConstraints):
* platform/mediastream/MediaStreamTrackPrivate.cpp:
(WebCore::MediaStreamTrackPrivate::applyConstraints):
* platform/mediastream/MediaStreamTrackPrivate.h:
* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::applyConstraints):
* platform/mediastream/RealtimeMediaSource.h:
* platform/mediastream/RealtimeMediaSourceSettings.h:
(WebCore::RealtimeMediaSourceSettings::supportedConstraints):
* platform/mediastream/mac/CoreAudioCaptureSource.cpp:
(WebCore::CoreAudioCaptureSource::~CoreAudioCaptureSource):
(WebCore::CoreAudioCaptureSource::processMicrophoneSamples):
(WebCore::CoreAudioCaptureSource::cleanupAudioUnit):
(WebCore::CoreAudioCaptureSource::createAudioUnit):
(WebCore::CoreAudioCaptureSource::configureAudioUnit):
(WebCore::CoreAudioCaptureSource::startProducingData):
(WebCore::CoreAudioCaptureSource::capabilities):
(WebCore::CoreAudioCaptureSource::settings):
(WebCore::CoreAudioCaptureSource::applySampleRate):
(WebCore::CoreAudioCaptureSource::applyEchoCancellation):
(WebCore::CoreAudioCaptureSource::scheduleReconfiguration):
(WebCore::CoreAudioCaptureSource::cleanupAudioUnits): Deleted.
(WebCore::CoreAudioCaptureSource::setupAudioUnits): Deleted.
* platform/mediastream/mac/CoreAudioCaptureSource.h:

Source/WebKit2:

* UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
(WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):
(WebKit::UserMediaCaptureManagerProxy::applyConstraints):
* UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
* UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in:
* WebProcess/cocoa/UserMediaCaptureManager.cpp:
(WebKit::UserMediaCaptureManager::Source::setSettings):
(WebKit::UserMediaCaptureManager::Source::applyConstraintsSucceeded):
(WebKit::UserMediaCaptureManager::Source::applyConstraintsFailed):
(WebKit::UserMediaCaptureManager::createCaptureSource):
(WebKit::UserMediaCaptureManager::sourceSettingsChanged):
(WebKit::UserMediaCaptureManager::applyConstraints):
(WebKit::UserMediaCaptureManager::applyConstraintsSucceeded):
(WebKit::UserMediaCaptureManager::applyConstraintsFailed):
(WebKit::UserMediaCaptureManager::Source::setMuted): Deleted.
(WebKit::UserMediaCaptureManager::Source::setEnabled): Deleted.
* WebProcess/cocoa/UserMediaCaptureManager.h:
* WebProcess/cocoa/UserMediaCaptureManager.messages.in:

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

3 years agoImplement PlatformWebView::windowSnapshotImage and createBitmapContextFromWebView...
jbedard@apple.com [Mon, 8 May 2017 23:15:00 +0000 (23:15 +0000)]
Implement PlatformWebView::windowSnapshotImage and createBitmapContextFromWebView for iOS devices
https://bugs.webkit.org/show_bug.cgi?id=169421
<rdar://problem/30950171>

Reviewed by Tim Horton.

Tools:

* DumpRenderTree/ios/PixelDumpSupportIOS.mm:
(createBitmapContextFromWebView): Implement for IOSurface.
* WebKitTestRunner/ios/PlatformWebViewIOS.mm:
(WTR::PlatformWebView::windowSnapshotImage): Use snapshot API for device.

LayoutTests:

* platform/ios-device/TestExpectations: Mark compositing tests as failures, this
is due to a bug tracked in https://bugs.webkit.org/show_bug.cgi?id=170772.

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

3 years agoWeb Inspector: Request/Response toggles not working
commit-queue@webkit.org [Mon, 8 May 2017 23:12:29 +0000 (23:12 +0000)]
Web Inspector: Request/Response toggles not working
https://bugs.webkit.org/show_bug.cgi?id=171833
<rdar://problem/31341637>

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

* UserInterface/Views/HierarchicalPathNavigationItem.js:
(WebInspector.HierarchicalPathNavigationItem.set components.let.componentsEqual):
(WebInspector.HierarchicalPathNavigationItem.prototype.set components):
If the new components being set were shallowly equal, then they wouldn't
actually be updated even if ultimately they are different. In this case
the Path Components with values "request" / "response" would not update
between different resources because the path components had equivalent
simple values. Provide a different discriminator (comparisonData) which
can be an object so these path components compare as necessarily different.

* UserInterface/Views/HeapSnapshotClusterContentView.js:
(WebInspector.HeapSnapshotClusterContentView.createPathComponent):
(WebInspector.HeapSnapshotClusterContentView):
* UserInterface/Views/ResourceClusterContentView.js:
(WebInspector.ResourceClusterContentView.createPathComponent):
(WebInspector.ResourceClusterContentView):
(WebInspector.ResourceClusterContentView.prototype._resourceTypeDidChange):
* UserInterface/Views/SVGImageResourceClusterContentView.js:
(WebInspector.SVGImageResourceClusterContentView):
* UserInterface/Views/ScriptClusterTimelineView.js:
(WebInspector.ScriptClusterTimelineView.createPathComponent):
(WebInspector.ScriptClusterTimelineView):
Provide comparisonData for path components cases that would need it.

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

3 years agoExpose a function to get proxy targets
fpizlo@apple.com [Mon, 8 May 2017 22:51:11 +0000 (22:51 +0000)]
Expose a function to get proxy targets
https://bugs.webkit.org/show_bug.cgi?id=171797
<rdar://problem/32027549>

Reviewed by Mark Lam.

This exposes a new private API function, JSObjectGetProxyTarget(), that gets the target of a
proxy. It works with both ProxyObject and JSProxy, but it's primarily intended for use with
JSProxy.

* API/JSObjectRef.cpp:
(JSObjectGetProxyTarget):
* API/JSObjectRefPrivate.h:
* API/tests/JSObjectGetProxyTargetTest.cpp: Added.
(testJSObjectGetProxyTarget):
* API/tests/JSObjectGetProxyTargetTest.h: Added.
* API/tests/testapi.c:
(main):
* JavaScriptCore.xcodeproj/project.pbxproj:
* runtime/ProxyObject.h:
* shell/PlatformWin.cmake:

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

3 years agoop_throw_static_error's use of its first operand should be reflected in DFG BytecodeU...
mark.lam@apple.com [Mon, 8 May 2017 22:24:29 +0000 (22:24 +0000)]
op_throw_static_error's use of its first operand should be reflected in DFG BytecodeUseDef as well.
https://bugs.webkit.org/show_bug.cgi?id=171786
<rdar://problem/32051023>

Reviewed by Saam Barati.

JSTests:

* stress/bug-171786.js: Added.

Source/JavaScriptCore:

* bytecode/BytecodeDumper.cpp:
(JSC::BytecodeDumper<Block>::dumpBytecode):
- Fix BytecodeDumper to dump op_throw_static_error correctly.  Previously,
  it was expecting op1 to always be a constant.  r206870 changed it to take a
  variable string as well.

* bytecode/BytecodeUseDef.h:
(JSC::computeUsesForBytecodeOffset):
- Fix the bug.

* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::parseBlock):
- Move the Phantom of op1 after the ThrowStaticError node, because technically,
  the ThrowStaticError represents op_throw_static_error, and op_throw_static_error
  uses op1.  In practice, this probably doesn't matter, but let's have the code
  accurately communicate the behavior we're expecting.

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

3 years agoDrop non-standard document.implementation.createCSSStyleSheet() API
cdumez@apple.com [Mon, 8 May 2017 22:17:59 +0000 (22:17 +0000)]
Drop non-standard document.implementation.createCSSStyleSheet() API
https://bugs.webkit.org/show_bug.cgi?id=171825

Reviewed by Simon Fraser.

Source/WebCore:

Drop non-standard document.implementation.createCSSStyleSheet() API.

This was never-implemented by Firefox and they actually rejected implementing it:
- Drop non-standard document.implementation.createCSSStyleSheet() API

Blink dropped this API back in 2014 after getting UseCounter data showing this was not used:
- https://bugs.chromium.org/p/chromium/issues/detail?id=363561
- https://groups.google.com/a/chromium.org/forum/#!msg/blink-dev/uDjkuGA9gQs/zytnzJ6WryYJ

The API is not useful in its current state because even though
document.implementation.createCSSStyleSheet() allows you to create a stylesheet, there is
currently no way to associate it with the document.

Test: fast/css/DOMImplementation.createCSSStyleSheet-obsolete.html

* dom/DOMImplementation.idl:

LayoutTests:

* fast/css/DOMImplementation.createCSSStyleSheet-obsolete-expected.txt:
* fast/css/DOMImplementation.createCSSStyleSheet-obsolete.html:
Add layout test coverage.

* fast/dom/StyleSheet/gc-parent-rule-expected.txt:
* fast/dom/StyleSheet/gc-parent-rule.html:
* fast/dom/StyleSheet/gc-parent-stylesheet-expected.txt:
* fast/dom/StyleSheet/gc-parent-stylesheet.html:
Add utility functions to construct a CSSStyleSheet object and use it instead
of document.implementation.createCSSStyleSheet().

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

3 years agoAX: don't expose empty roledescription
jdiggs@igalia.com [Mon, 8 May 2017 22:16:27 +0000 (22:16 +0000)]
AX: don't expose empty roledescription
https://bugs.webkit.org/show_bug.cgi?id=163647

Reviewed by Chris Fleizach.

Source/WebCore:

If the value of aria-roledescription is empty or contains only whitespace
characters, ignore the value. Also strip out leading or trailing whitespace
characters in the value.

No new tests: We already had coverage for an empty aria-roledescription value.
That test was updated to reflect the new behavior. New test cases were added
to cover a value that contains only whitespace characters, and a value with
leading and trailing whitespace characters.

* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::roleDescription):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper roleDescription]):

LayoutTests:

* accessibility/aria-roledescription-expected.txt: New test cases, updated expectations.
* accessibility/aria-roledescription.html: New test cases, updated expectations.
* platform/gtk/accessibility/aria-roledescription-expected.txt: New test cases, updated expectations.

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

3 years agoDrop non-standard Element.scrollByLines() / scrollByPages()
cdumez@apple.com [Mon, 8 May 2017 22:15:14 +0000 (22:15 +0000)]
Drop non-standard Element.scrollByLines() / scrollByPages()
https://bugs.webkit.org/show_bug.cgi?id=171820

Reviewed by Simon Fraser.

Source/WebCore:

Drop non-standard Element.scrollByLines() / scrollByPages().

Those were added a very long time ago (https://trac.webkit.org/changeset/7901/webkit)
for Safari RSS but does not seem to be used anymore.

Blink has already dropped it without issue back in 2014:
- https://bugs.chromium.org/p/chromium/issues/detail?id=398356

Their UseCounter data showed no usage:
- https://www.chromestatus.com/metrics/feature/timeline/popularity/390

Test: fast/css/element-scrollByLines-scrollByPages-obsolete.html

* dom/Element.idl:

Source/WebInspectorUI:

Drop non-standard Element.scrollByLines() / scrollByPages() from
WebInspector code.

* UserInterface/Models/NativeFunctionParameters.js:

LayoutTests:

* LayoutTests/fast/css/element-scrollByLines-scrollByPages-obsolete-expected.txt:
* LayoutTests/fast/css/element-scrollByLines-scrollByPages-obsolete.html:
Add layout test coverage.

* fast/dom/non-numeric-values-numeric-parameters-expected.txt:
* fast/dom/script-tests/non-numeric-values-numeric-parameters.js:
* fast/events/scroll-event-does-not-bubble.html:
* fast/layers/scroll-overflow-no-layer-expected.txt: Renamed from LayoutTests/fast/layers/scrollByLines-overflow-no-layer-expected.txt.
* fast/layers/scroll-overflow-no-layer.html: Renamed from LayoutTests/fast/layers/scrollByLines-overflow-no-layer.html.
Update existing tests to stop relying on the API.

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

3 years agoCoreAudioSharedUnit should own its configuration parameters
commit-queue@webkit.org [Mon, 8 May 2017 22:12:39 +0000 (22:12 +0000)]
CoreAudioSharedUnit should own its configuration parameters
https://bugs.webkit.org/show_bug.cgi?id=171812

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

Covered by manual tests.

Add sampleRate, volume and echoCancellation parameters to the shared audio unit.
Set default values when creating the shared audio unit and use those for the creation of new sources.
Add support for volume.
Add support for disabling echo cancellation.
Check valid sample rates when trying to apply a sample rate.

* platform/mediastream/RealtimeMediaSource.h:
* platform/mediastream/mac/CoreAudioCaptureSource.cpp:
(WebCore::CoreAudioSharedUnit::volume):
(WebCore::CoreAudioSharedUnit::sampleRate):
(WebCore::CoreAudioSharedUnit::enableEchoCancellation):
(WebCore::CoreAudioSharedUnit::setVolume):
(WebCore::CoreAudioSharedUnit::setSampleRate):
(WebCore::CoreAudioSharedUnit::setEnableEchoCancellation):
(WebCore::CoreAudioSharedUnit::CoreAudioSharedUnit):
(WebCore::CoreAudioSharedUnit::setupAudioUnits):
(WebCore::CoreAudioSharedUnit::configureMicrophoneProc):
(WebCore::CoreAudioSharedUnit::configureSpeakerProc):
(WebCore::CoreAudioSharedUnit::processMicrophoneSamples):
(WebCore::CoreAudioCaptureSource::CoreAudioCaptureSource):
(WebCore::CoreAudioCaptureSource::applySampleRate):
(WebCore::CoreAudioCaptureSource::applyEchoCancellation):
* platform/mediastream/mac/CoreAudioCaptureSource.h:

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

3 years agoMarked http/tests/websocket/tests/hybi/workers/close.html is flaky.
ryanhaddad@apple.com [Mon, 8 May 2017 21:51:27 +0000 (21:51 +0000)]
Marked http/tests/websocket/tests/hybi/workers/close.html is flaky.
https://bugs.webkit.org/show_bug.cgi?id=171830

Unreviewed test gardening.

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

* platform/ios-wk2/TestExpectations:

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

3 years agoMark media/modern-media-controls/status-label/status-label-font.html as flaky on...
ryanhaddad@apple.com [Mon, 8 May 2017 21:50:54 +0000 (21:50 +0000)]
Mark media/modern-media-controls/status-label/status-label-font.html as flaky on mac-wk1.
https://bugs.webkit.org/show_bug.cgi?id=171828

Unreviewed test gardening.

* platform/mac-wk1/TestExpectations:

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

3 years agoAX: Setting aria-orientation="horizontal" on a listbox is being overridden on the Mac
jdiggs@igalia.com [Mon, 8 May 2017 20:51:42 +0000 (20:51 +0000)]
AX: Setting aria-orientation="horizontal" on a listbox is being overridden on the Mac
https://bugs.webkit.org/show_bug.cgi?id=171821

Reviewed by Chris Fleizach.

Source/WebCore:

The Mac's AccessibilityObject wrapper was unconditionally returning vertical
as the orientation of listbox. Removing this override causes the author-specified
value to be exposed, with the default/implicit orientation continuing to be vertical.

No new tests. We already have coverage for the default/implicit orientation on a
listbox. A new test case was added to aria-orientation.html so that we would have
coverage for aria-orientation="horizontal" on a listbox.

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

LayoutTests:

* accessibility/aria-orientation-expected.txt: New test case.
* accessibility/aria-orientation.html: New test case.

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

3 years agoWeb Inspector: Make it easy to dynamically show/hide a SettingsView
mattbaker@apple.com [Mon, 8 May 2017 20:49:23 +0000 (20:49 +0000)]
Web Inspector: Make it easy to dynamically show/hide a SettingsView
https://bugs.webkit.org/show_bug.cgi?id=171765
<rdar://problem/32031280>

Reviewed by Brian Burg.

This patch adds SettingsTabContentView.prototype.setSettingsViewVisible,
for dynamically showing/hiding a child view (and its NavigationBar item).
The following new behavior is relevant when more that one child SettingsView
exist in the Settings tab:
 - Hiding the selected view will cause a new view to become selected.
   The previous visible view is selected, if it exists. Otherwise the
   next visible view is used.
 - Showing a view when no views are selected cause the view to be selected.

As the Settings tab currently has only one child view, the behavior above
was tested by adding a handful of vanilla SettingsView objects to the tab
and toggling their visibility.

* UserInterface/Views/NavigationBar.js:
Simplify overloaded parameter `navigationItemOrIdentifierOrIndex`, which
is used in a few places and is always an instance of NavigationItem.

(WebInspector.NavigationBar):
(WebInspector.NavigationBar.prototype.removeNavigationItem):
(WebInspector.NavigationBar.prototype.get selectedNavigationItem):
(WebInspector.NavigationBar.prototype.set selectedNavigationItem):
(WebInspector.NavigationBar.prototype.findNavigationItem):
Lookup a navigation item by its identifier.
(WebInspector.NavigationBar.prototype._findNavigationItem): Deleted.
Replaced overloaded private method with new public method.

* UserInterface/Views/NavigationItem.js:
Cleanup.
(WebInspector.NavigationItem):
(WebInspector.NavigationItem.prototype.get identifier):
(WebInspector.NavigationItem.prototype.get element):
(WebInspector.NavigationItem.prototype.get minimumWidth):
(WebInspector.NavigationItem.prototype.get parentNavigationBar):

* UserInterface/Views/SettingsTabContentView.css:
Use `visibility: hidden` instead of `display: none` when hiding the
NavigationBar, so that the selected view's top position stays the same.

(.content-view.settings):
(.content-view.settings .navigation-bar.invisible):

* UserInterface/Views/SettingsTabContentView.js:
(WebInspector.SettingsTabContentView):
Switch to an array of SettingsViews instead of a map. Fast lookup isn't
a concern due to the small number of items, and having indices simplifies
traversing the previous/next items in `setSettingsViewVisible`.

(WebInspector.SettingsTabContentView.prototype.set selectedSettingsView):
Rename `page` to `settingsView`.
(WebInspector.SettingsTabContentView.prototype.addSettingsView):
(WebInspector.SettingsTabContentView.prototype.setSettingsViewVisible):
Shows/hides the specified view. Hiding the selected SettingsView will
cause another visible view to become selected, if one exists.

(WebInspector.SettingsTabContentView.prototype._updateNavigationBarVisibility):
Helper for updating navigation bar visibility after making a change
to the navigation items.

(WebInspector.SettingsTabContentView.prototype._navigationItemSelected):

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

3 years ago[CG] To decode an image frame asynchronously, pass the native size of the image to...
commit-queue@webkit.org [Mon, 8 May 2017 20:36:31 +0000 (20:36 +0000)]
[CG] To decode an image frame asynchronously, pass the native size of the image to CGImageSourceCreateThumbnailAtIndex() if it's smaller than the sizeForDrawing
https://bugs.webkit.org/show_bug.cgi?id=170864
Source/WebCore:

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

Tests: Existing tests were modified to test this patch.

The maxPixelSize was omitted when calling CGImageSourceCreateThumbnailAtIndex()
for the nativeSize image or when areaOf(nativeSize) < areaOf(sizeForDrawing).
The assumption was if we don't pass maxPixelSize, CG will create an image with the
nativeSize regardless how big this size is. It turns out this is wrong. CG has an
optimization to return a scaled down image if areaOf(nativeSize) is greater than
some maximum value.

This is not what we want for asynchronously image decoding. We want the decoded
frame to have the size we ask for, not some scaled down frame. The fix is to pass
always maxPixelSize to CGImageSourceCreateThumbnailAtIndex(). maxPixelSize will be
equal to maxDimension(sizeForDrawing) if sizeForDrawing is valid it is less than
maxDimension(nativeSize). Otherwise it will be equal to maxDimension(nativeSize).

* platform/graphics/DecodingOptions.h:
* platform/graphics/cg/ImageDecoderCG.cpp:
(WebCore::appendImageSourceOption):
(WebCore::appendImageSourceOptions):
(WebCore::imageSourceAsyncOptions):
(WebCore::ImageDecoder::createFrameImageAtIndex):

LayoutTests:

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

* fast/images/async-image-background-image-repeated-expected.html:
* fast/images/async-image-background-image-repeated.html:
* fast/images/resources/sprite-sheet-red-green-blue.png:
* fast/images/sprite-sheet-image-draw-expected.html:
* fast/images/sprite-sheet-image-draw.html:
Change the sprite image to be 200x33100 instead of 200x2100 and use it in drawing.
If the maxPixelSize is not passed to CGImageSourceCreateThumbnailAtIndex(), the
decoded farme of this image will be 30x5000 pixels (15% of the original size).

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

3 years agoWebKit should default to using sRGB with NSColor conversion instead of device
bdakin@apple.com [Mon, 8 May 2017 20:25:46 +0000 (20:25 +0000)]
WebKit should default to using sRGB with NSColor conversion instead of device
color space
https://bugs.webkit.org/show_bug.cgi?id=171745
-and corresponding-
rdar://problem/28314183

Reviewed by Tim Horton.

Source/WebCore:

* platform/graphics/mac/ColorMac.mm:
(WebCore::makeRGBAFromNSColor):
(WebCore::nsColor):

LayoutTests:

* editing/mac/attributed-string/anchor-element-expected.txt:
* editing/mac/attributed-string/basic-expected.txt:
* editing/mac/attributed-string/comment-cdata-section-expected.txt:
* editing/mac/attributed-string/font-size-expected.txt:
* editing/mac/attributed-string/font-style-variant-effect-expected.txt:
* editing/mac/attributed-string/font-weight-expected.txt:
* editing/mac/attributed-string/letter-spacing-expected.txt:
* editing/mac/attributed-string/text-decorations-expected.txt:
* editing/mac/attributed-string/vertical-align-expected.txt:

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

3 years agoReduce PassRefPtr use
achristensen@apple.com [Mon, 8 May 2017 20:11:29 +0000 (20:11 +0000)]
Reduce PassRefPtr use
https://bugs.webkit.org/show_bug.cgi?id=171809

Reviewed by Chris Dumez.

Source/WebCore:

* platform/graphics/ca/PlatformCALayer.cpp:
(WebCore::PlatformCALayer::createCompatibleLayerOrTakeFromPool):
* platform/graphics/ca/PlatformCALayer.h:
* platform/graphics/ca/TileCoverageMap.cpp:
(WebCore::TileCoverageMap::TileCoverageMap):
* platform/graphics/ca/TileGrid.cpp:
(WebCore::TileGrid::TileGrid):
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
(PlatformCALayerCocoa::create):
(PlatformCALayerCocoa::clone):
(PlatformCALayerCocoa::animationForKey):
(PlatformCALayerCocoa::createCompatibleLayer):

Source/WebKit2:

* PluginProcess/PluginControllerProxy.cpp:
(WebKit::PluginControllerProxy::setInitializationReply):
* PluginProcess/PluginControllerProxy.h:
* PluginProcess/WebProcessConnection.cpp:
(WebKit::WebProcessConnection::destroyPlugin):
(WebKit::WebProcessConnection::createPlugin):
* PluginProcess/WebProcessConnection.h:
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::runOpenPanel):
* WebProcess/WebCoreSupport/WebEditorClient.cpp:
(WebKit::WebEditorClient::registerUndoStep):
* WebProcess/WebPage/VisitedLinkTableController.cpp:
(WebKit::VisitedLinkTableController::getOrCreate):
* WebProcess/WebPage/VisitedLinkTableController.h:
* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::hitTest):
(WebKit::WebFrame::createSelectionSnapshot):
* WebProcess/WebPage/WebFrame.h:
* WebProcess/WebPage/WebOpenPanelResultListener.cpp:
(WebKit::WebOpenPanelResultListener::create):
(WebKit::WebOpenPanelResultListener::WebOpenPanelResultListener):
* WebProcess/WebPage/WebOpenPanelResultListener.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::unapplyEditCommand):
(WebKit::WebPage::reapplyEditCommand):
* WebProcess/WebPage/WebPageGroupProxy.cpp:
(WebKit::WebPageGroupProxy::create):
* WebProcess/WebPage/WebPageGroupProxy.h:
* WebProcess/WebPage/WebUndoStep.cpp:
(WebKit::WebUndoStep::create):
* WebProcess/WebPage/WebUndoStep.h:
(WebKit::WebUndoStep::step):
(WebKit::WebUndoStep::WebUndoStep):
* WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
(WebKit::PlatformCALayerRemote::create):
(WebKit::PlatformCALayerRemote::clone):
(WebKit::PlatformCALayerRemote::animationForKey):
(WebKit::PlatformCALayerRemote::createCompatibleLayer):
* WebProcess/WebPage/mac/PlatformCALayerRemote.h:
* WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.h:
* WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm:
(WebKit::PlatformCALayerRemoteCustom::create):
(WebKit::PlatformCALayerRemoteCustom::clone):

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

3 years agobuildbot: Cleanup simulators after running tests
jbedard@apple.com [Mon, 8 May 2017 20:07:28 +0000 (20:07 +0000)]
buildbot: Cleanup simulators after running tests
https://bugs.webkit.org/show_bug.cgi?id=171679

Reviewed by Aakash Jain.

simctl is partitioned for each user. Since kill-old-processes
is run as root, we need to specify the buildbot user when tearing
down simulators between steps.

* BuildSlaveSupport/build.webkit.org-config/master.cfg:
(KillOldProcesses): Pass buildbot user to kill-old-processes.
* BuildSlaveSupport/kill-old-processes:
(main): Specify the user for simctl if one has been provided.

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

3 years ago[Mac] Audio capture fails when shouldCaptureAudioInUIProcess is set.
jer.noble@apple.com [Mon, 8 May 2017 20:03:46 +0000 (20:03 +0000)]
[Mac] Audio capture fails when shouldCaptureAudioInUIProcess is set.
https://bugs.webkit.org/show_bug.cgi?id=171710

Reviewed by Eric Carlson.

Source/WebCore:

Both the shouldCaptureAudioInUIProcess setting and useAVFoundationAudioCapture setting were trying to set
the audio factory for RealtimeMediaSourceCenter, and were stomping on each others' changes. Change the way
the useAVFoundationAudioCapture works so that it only affects the defaultAudioFactory, allowing that default
to be overridden by the shuoldCaptureAudioInUIProcess setting when it calls setAudioFactory().

* page/Settings.cpp:
(WebCore::Settings::setUseAVFoundationAudioCapture):
* platform/mediastream/RealtimeMediaSourceCenter.cpp:
(WebCore::RealtimeMediaSourceCenter::audioFactory):
(WebCore::RealtimeMediaSourceCenter::videoFactory):
(WebCore::RealtimeMediaSourceCenter::audioCaptureDeviceManager):
(WebCore::RealtimeMediaSourceCenter::videoCaptureDeviceManager):
* platform/mediastream/RealtimeMediaSourceCenter.h:
(WebCore::RealtimeMediaSourceCenter::audioFactory): Deleted.
(WebCore::RealtimeMediaSourceCenter::videoFactory): Deleted.
(WebCore::RealtimeMediaSourceCenter::audioCaptureDeviceManager): Deleted.
(WebCore::RealtimeMediaSourceCenter::videoCaptureDeviceManager): Deleted.
* platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
(WebCore::RealtimeMediaSourceCenterMac::setUseAVFoundationAudioCapture):
(WebCore::RealtimeMediaSourceCenterMac::singleton):
(WebCore::RealtimeMediaSourceCenter::platformCenter):
(WebCore::RealtimeMediaSourceCenterMac::defaultAudioFactory):
(WebCore::RealtimeMediaSourceCenterMac::defaultAudioCaptureDeviceManager):
* platform/mediastream/mac/RealtimeMediaSourceCenterMac.h:

Source/WebKit2:

RealtimeMediaSourceCenterMac's setUseAVFoundationAudioCapture() is now accessed via a singleton.

* UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
(WebKit::UserMediaPermissionRequestManagerProxy::syncWithWebCorePrefs):

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

3 years ago[macOS] com.macromedia.Flash Player ESR.plugin.sb is installed outside of PlugInSandb...
aestes@apple.com [Mon, 8 May 2017 19:57:21 +0000 (19:57 +0000)]
[macOS] com.macromedia.Flash Player ESR.plugin.sb is installed outside of PlugInSandboxProfiles
https://bugs.webkit.org/show_bug.cgi?id=171774

Reviewed by Dan Bernstein.

* WebKit2.xcodeproj/project.pbxproj:

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

3 years agoSpeculative Windows build fix after r216428.
mark.lam@apple.com [Mon, 8 May 2017 19:50:51 +0000 (19:50 +0000)]
Speculative Windows build fix after r216428.
https://bugs.webkit.org/show_bug.cgi?id=171776

Not reviewed.

* wtf/StackTrace.h:

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

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

Reviewed by Chris Dumez.

Source/WebCore:

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

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

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

LayoutTests:

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

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

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

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

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

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

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

Reviewed by Simon Fraser.

Source/WebCore:

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

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

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

LayoutTests:

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

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

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

Reviewed by Zalan Bujtas.

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

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

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

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

Reviewed by Antti Koivisto.

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

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

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

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

Reviewed by Carlos Garcia Campos.

* gtk/install-dependencies:

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

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

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

Source/ThirdParty/libwebrtc:

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

Source/WebCore:

Covered by manual tests.

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

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

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

Broke 70 layout tests on GTK bot

Reverted changeset:

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

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

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

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

Manual testing only since CoreAudioSharedUnit is not mocked.

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

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

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

Reviewed by Zalan Bujtas.

Source/WebCore:

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

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

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

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

LayoutTests:

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

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

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

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

Reviewed by Mark Lam.

It isn't necessary to restrict.

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

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

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

Reviewed by Keith Miller.

Source/JavaScriptCore:

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

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

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

Source/WebCore:

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

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

Source/WTF:

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

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

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

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

Glib uses now Unicode quotes in error messages.

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

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

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

Reviewed by Alex Christensen.

Source/WebCore:

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

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

Test: fast/css/Element-style.html

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

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

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

Source/WebKit/mac:

Build fix.

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

Source/WebKit2:

Build fix.

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

LayoutTests:

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

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

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

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

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

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

Reviewed by Chris Fleizach.

Source/WebCore:

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

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

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

LayoutTests:

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

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

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

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

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

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

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

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

Source/WebCore:

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

Reviewed by Chris Fleizach.

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

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

LayoutTests:

Reviewed by Chris Fleizach.

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

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

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

Reviewed by Simon Fraser.

Source/WebCore:

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

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

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

Source/WebInspectorUI:

* UserInterface/Models/CSSKeywordCompletions.js:

LayoutTests:

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

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

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

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

* platform/gtk/TestExpectations:

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

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

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

        Unreviewed.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

LayoutTests/imported/w3c:

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

Source/WebCore:

There are two problems to fix here:

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

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

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

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

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

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

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

Reviewed by Sam Weinig.

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

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

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

Source/WebKit2:

rdar://problem/31765167

Reviewed by Sam Weinig.

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

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

LayoutTests:

Reviewed by Sam Weinig.

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

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

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

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

Reviewed by Darin Adler.

Drop remaining uses of PassRefPtr in editing code.

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

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

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

Unreviewed. This just adds a test.

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

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

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

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

Source/WebCore:

Covered by existing tests.

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

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

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

Source/WebKit2:

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

LayoutTests:

* platform/ios-wk2/TestExpectations:

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

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

Reviewed by Sam Weinig.

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

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

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

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

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

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

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

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

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

Source/WebCore:

<rdar://problem/18945879>

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

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

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

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

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

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

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

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

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

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

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

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

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

LayoutTests:

<rdar://problem/18945879>

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

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

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

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

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

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

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

Reviewed by Carlos Garcia Campos.

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

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

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

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

Reviewed by Dean Jackson.

Source/WebCore:

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

Test: fast/text/lastResort.html

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

LayoutTests:

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

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

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

Reviewed by Sam Weinig.

Source/WebCore:

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

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

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

LayoutTests:

Add layout test coverage.

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

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

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

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

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

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

Reviewed by Sam Weinig.

Source/WebCore:

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

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

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

Source/WebKit/mac:

Build fix.

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

Source/WebKit2:

GTK build fix.

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

LayoutTests:

Rebaseline a few tests.

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

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

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

Reviewed by Sam Weinig.

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

* page/TextIndicator.h:

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

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

* platform/wk2/TestExpectations:

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

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

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

Source/WebCore:

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

Source/WebKit/win:

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

Source/WebKit2:

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

LayoutTests:

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

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

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

Reviewed by Tim Horton.

Source/WebKit2:

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

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

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

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

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

Tools:

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

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

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

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

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

LayoutTests:

New baseline.

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

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

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

Caused layout test failures

Reverted changeset:

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

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

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

Reviewed by Sam Weinig.

Source/WebCore:

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

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

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

LayoutTests:

Add layout test coverage.

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

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

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

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

* CMakeLists.txt:

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

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

Reviewed by Zalan Bujtas.

Source/WebCore:

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

Test: fast/text/fitzpatrick-combination.html

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

LayoutTests:

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

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

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

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

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

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

Reviewed by Saam Barati.

JSTests:

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

Source/JavaScriptCore:

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

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

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

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

Reviewed by Yusuke Suzuki.

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

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

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

Reviewed by Daniel Bates.

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

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

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

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

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

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

Unreviewed buildfix.

* WebKitTestRunner/cocoa/TestRunnerWKWebView.mm:

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

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

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

No change of behavior, this is mostly style here.

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

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

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

Reviewed by Saam Barati.

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

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

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

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

Reviewed by Michael Catanzaro.

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

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

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

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

Reviewed by Simon Fraser.

Source/WebCore:

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

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

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

LayoutTests:

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

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

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

Reviewed by Filip Pizlo.

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

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

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

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

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

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

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

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

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

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

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

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

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

Reviewed by Tim Horton.

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

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

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

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

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

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

Reviewed by Matt Baker.

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

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

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

Reviewed by Simon Fraser.

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

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

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

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

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

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

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

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

Unreviewed test gardening.

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

* platform/mac-wk2/TestExpectations:

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

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

Reviewed by Saam Barati.

Source/JavaScriptCore:

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

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

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

LayoutTests:

Updated output

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

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

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

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

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

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

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

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

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