WebKit-https.git
3 years agoAdd support for recognizing data interaction gestures in WebKit2
wenson_hsieh@apple.com [Thu, 26 Jan 2017 20:58:08 +0000 (20:58 +0000)]
Add support for recognizing data interaction gestures in WebKit2
https://bugs.webkit.org/show_bug.cgi?id=167444

Reviewed by Beth Dakin.

Source/WebCore:

Minor tweaks to pasteboard code to support data interaction.

* WebCore.xcodeproj/project.pbxproj:
* platform/PlatformPasteboard.h:
* platform/ios/PasteboardIOS.mm:
(WebCore::Pasteboard::read):
* platform/ios/PlatformPasteboardIOS.mm:
(WebCore::PlatformPasteboard::PlatformPasteboard):

If the pasteboard is the special data interaction type, use the shared item provider pasteboard; otherwise,
fall back to the general pasteboard.

(WebCore::PlatformPasteboard::getTypes):

Actually populate the list of available types using available pasteboardTypes.

(WebCore::PlatformPasteboard::write):

Add UTF8 plaintext type (kUTTypeUTF8PlainText) when vending data representations of rich text.

* platform/ios/WebItemProviderPasteboard.mm:
(-[WebItemProviderPasteboard setItems:]):
(-[WebItemProviderPasteboard dataForPasteboardType:inItemSet:]):
(-[WebItemProviderPasteboard valuesForPasteboardType:inItemSet:]):

Move off of deprecated methods when retrieving and supplying data to the item provider pasteboard.

* platform/spi/ios/UIKitSPI.h:

Source/WebKit2:

Adds a new data interaction gesture recognizer, responsible for determining when to begin data interaction. This
is a new long press gesture recognizer that fires simultaneously with the existing long press gesture
recognizers (for performing long-press actions, and for showing the tap highlight).

Also tweaks logic for determining whether selection gesture recognizers should fire to account for data
interaction -- in particular, we don't want selection gesture recognizers to cause the current selection to
change while data interaction is possible. See -hasSelectablePositionAtPoint and -pointIsInAssistedNode for
more details.

* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::didPerformDataInteractionControllerOperation):
(WebKit::PageClientImpl::startDataInteractionWithImage):
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _createAndConfigureLongPressGestureRecognizer]):
(-[WKContentView setupInteraction]):
(-[WKContentView cleanupInteraction]):
(-[WKContentView _removeDefaultGestureRecognizers]):
(-[WKContentView _addDefaultGestureRecognizers]):
(-[WKContentView resignFirstResponder]):
(-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
(-[WKContentView gestureRecognizerShouldBegin:]):
(-[WKContentView hasSelectablePositionAtPoint:]):
(-[WKContentView pointIsInDataInteractionContent:]):
(-[WKContentView pointIsInAssistedNode:]):

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

3 years agoNotify clients when the user plays media otherwise prevented from autoplaying
commit-queue@webkit.org [Thu, 26 Jan 2017 20:41:13 +0000 (20:41 +0000)]
Notify clients when the user plays media otherwise prevented from autoplaying
https://bugs.webkit.org/show_bug.cgi?id=167390

Patch by Matt Rajca <mrajca@apple.com> on 2017-01-26
Reviewed by Alex Christensen.

Source/WebCore:

The API is tested.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::playInternal):
* page/ChromeClient.h:

Source/WebKit2:

* UIProcess/API/APIUIClient.h:
(API::UIClient::didPlayMediaPreventedFromPlayingWithoutUserGesture):
* UIProcess/API/C/WKPage.cpp:
(WKPageSetPageUIClient):
* UIProcess/API/C/WKPageUIClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didPlayMediaPreventedFromPlayingWithoutUserGesture):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::didPlayMediaPreventedFromPlayingWithoutUserGesture):
* WebProcess/WebCoreSupport/WebChromeClient.h:

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2/autoplay-with-controls.html: Added.
* TestWebKitAPI/Tests/WebKit2/js-play-with-controls.html: Added.
* TestWebKitAPI/Tests/WebKit2Cocoa/WebsitePolicies.mm:
(didPlayMediaPreventedFromPlayingWithoutUserGesture):
(TEST):
* TestWebKitAPI/cocoa/TestWKWebView.h:
* TestWebKitAPI/cocoa/TestWKWebView.mm:
(-[TestWKWebViewHostWindow _mouseUpAtPoint:]):
(-[TestWKWebView waitForLoad]):
(-[TestWKWebView mouseUpAtPoint:]):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::createOtherPage):
(WTR::TestController::createWebViewWithOptions):

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

3 years ago[GStreamer] ASSERTION FAILED: !g_object_is_floating(ptr) in adoptGRef(GstContext...
eocanha@igalia.com [Thu, 26 Jan 2017 20:39:57 +0000 (20:39 +0000)]
[GStreamer] ASSERTION FAILED: !g_object_is_floating(ptr) in adoptGRef(GstContext* ptr)
https://bugs.webkit.org/show_bug.cgi?id=167458

Reviewed by Xabier Rodriguez-Calvar.

GstContext is a mini_object, not a GObject. Therefore it shouldn't (and can't) be checked for floatingness.

* platform/graphics/gstreamer/GRefPtrGStreamer.cpp:
(WTF::adoptGRef): Removed incorrect assertion.

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

3 years agoOSR entry: delay outer-loop compilation when at inner-loop
jfbastien@apple.com [Thu, 26 Jan 2017 19:52:35 +0000 (19:52 +0000)]
OSR entry: delay outer-loop compilation when at inner-loop
https://bugs.webkit.org/show_bug.cgi?id=167149

Reviewed by Filip Pizlo.

JSTests:

Try to be mean to OSR entry by using nested loops, and having
non-int32 types or truly varying types.

Mandelbrot currently never tiers up to FTL because it exits too
many times before this. That shouldn't happen because it's just
numbers and int32s. I'll file a bug to fix this.

* microbenchmarks/mandelbrot.js: Added.
(mandelbrot):
(printable):
* microbenchmarks/nonude.js: Added.
(Array.prototype.remove):
(const.u):
(const.load):
(const.scan):
(const.main):

Source/JavaScriptCore:

As of https://bugs.webkit.org/show_bug.cgi?id=155217 OSR
compilation can be kicked off for an entry into an outer-loop,
while executing an inner-loop. This is desirable because often the
codegen from an inner-entry isn't as good as the codegen from an
outer-entry, but execution from an inner-loop is often pretty hot
and likely to kick off compilation. This approach provided nice
speedups on Kraken because we'd select to enter to the outer-loop
very reliably, which reduces variability (the inner-loop was
selected roughly 1/5 times from my unscientific measurements).

When compilation starts we take a snapshot of the JSValues at the
current execution state using OSR's recovery mechanism. These
values are passed to the compiler and are used as way to perform
type profiling, and could be used to observe cell types as well as
to perform predictions such as through constant propagation.

It's therefore desired to enter from the outer-loop when we can,
but we need to be executing from that location to capture the
right JSValues, otherwise we're confusing the compiler and giving
it inaccurate JSValues which can lead it to predict the wrong
things, leading to suboptimal code or recompilation due to
misprediction, or in super-corner-cases a crash.

These effects are pretty hard to measure: Fil points out that
marsalis-osr-entry really needs mustHandleValues (the JSValues
from the point of execution) because right now it just happens to
correctly guess int32. I tried removing mustHandleValues entirely
and saw no slowdowns, but our benchmarks probably aren't
sufficient to reliably find issues, sometimes because we happen to
have sufficient mitigations.

DFG tier-up was added here:
https://bugs.webkit.org/show_bug.cgi?id=112838

* JavaScriptCore.xcodeproj/project.pbxproj:
* dfg/DFGJITCode.h:
* dfg/DFGJITCompiler.cpp:
(JSC::DFG::JITCompiler::JITCompiler):
* dfg/DFGOSREntry.cpp:
(JSC::DFG::prepareOSREntry):
* dfg/DFGOSREntry.h:
(JSC::DFG::prepareOSREntry):
* dfg/DFGOperations.cpp:
* dfg/DFGOperations.h:
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGTierUpEntryTrigger.h: Copied from Source/JavaScriptCore/ftl/FTLOSREntry.h.
* dfg/DFGToFTLForOSREntryDeferredCompilationCallback.cpp:
(JSC::DFG::ToFTLForOSREntryDeferredCompilationCallback::ToFTLForOSREntryDeferredCompilationCallback):
(JSC::DFG::Ref<ToFTLForOSREntryDeferredCompilationCallback>ToFTLForOSREntryDeferredCompilationCallback::create):
(JSC::DFG::ToFTLForOSREntryDeferredCompilationCallback::compilationDidBecomeReadyAsynchronously):
(JSC::DFG::ToFTLForOSREntryDeferredCompilationCallback::compilationDidComplete):
* dfg/DFGToFTLForOSREntryDeferredCompilationCallback.h:
* ftl/FTLOSREntry.cpp:
(JSC::FTL::prepareOSREntry):
* ftl/FTLOSREntry.h:
* jit/JITOperations.cpp:

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

3 years agoDon't use _CFBundleCreateUnique on Yosemite, it's not available there
andersca@apple.com [Thu, 26 Jan 2017 19:50:14 +0000 (19:50 +0000)]
Don't use _CFBundleCreateUnique on Yosemite, it's not available there
https://bugs.webkit.org/show_bug.cgi?id=167459
rdar://problem/30181179

Reviewed by Beth Dakin.

* Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
(WebKit::NetscapePluginModule::getPluginInfo):

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

3 years agoSimple line layout: Add support for -webkit-hyphenate-limit-after and -webkit-hyphena...
zalan@apple.com [Thu, 26 Jan 2017 19:36:27 +0000 (19:36 +0000)]
Simple line layout: Add support for -webkit-hyphenate-limit-after and -webkit-hyphenate-limit-before
https://bugs.webkit.org/show_bug.cgi?id=167439
<rdar://problem/30180184>

Reviewed by Antti Koivisto.

Source/WebCore:

Implement pre and post hyphen length constrains for simple line layout.

Tests: fast/text/simple-line-layout-hyphen-limit-after.html
       fast/text/simple-line-layout-hyphen-limit-before.html

* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::canUseForStyle):
(WebCore::SimpleLineLayout::printReason):
* rendering/SimpleLineLayoutTextFragmentIterator.cpp:
(WebCore::SimpleLineLayout::TextFragmentIterator::Style::Style): Same as normal line layout default values.
(WebCore::SimpleLineLayout::TextFragmentIterator::lastHyphenPosition):
* rendering/SimpleLineLayoutTextFragmentIterator.h:

LayoutTests:

* fast/text/simple-line-layout-hyphen-limit-after.html: Added.
* fast/text/simple-line-layout-hyphen-limit-before-expected.html: Added.
* fast/text/simple-line-layout-hyphen-limit-before.html: Added.
* platform/mac/fast/text/hyphenate-limit-before-after-expected.txt: progression.

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

3 years agoAdd SPI for updating WebsitePolicies
commit-queue@webkit.org [Thu, 26 Jan 2017 19:25:12 +0000 (19:25 +0000)]
Add SPI for updating WebsitePolicies
https://bugs.webkit.org/show_bug.cgi?id=167040

Patch by Alex Christensen <achristensen@webkit.org> on 2017-01-26
Reviewed by Brady Eidson.

In r209558 we added a way to send a WebsitePolicies structure to the WebProcess during navigation.
If the UIProcess wants to update these policies on a WKWebView while a page is open, we will
need to have SPI for doing so. This adds such SPI, but it's not hooked up to change functionality yet.

* UIProcess/API/C/WKPage.cpp:
(WKPageUpdateWebsitePolicies):
* UIProcess/API/C/WKPage.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _updateWebsitePolicies:]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::updateWebsitePolicies):
* UIProcess/WebPageProxy.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updateWebsitePolicies):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:

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

3 years agoGamepad support shows wrong values for PS4 controllers (D-pad is missing).
beidson@apple.com [Thu, 26 Jan 2017 19:21:39 +0000 (19:21 +0000)]
Gamepad support shows wrong values for PS4 controllers (D-pad is missing).
<rdar://problem/29578619> and https://bugs.webkit.org/show_bug.cgi?id=165588

Reviewed by Alex Christensen.

No new tests (Currently unable to test HID backend directly)

DPads report their HID type as "a button", but their HID usage is "Hatswitch".
This patch adds a new element type that maps a "hatswitch" value to 4 additional buttons.

* platform/gamepad/mac/HIDGamepad.cpp:
(WebCore::HIDGamepad::initElements):
(WebCore::HIDGamepad::initElementsFromArray):
(WebCore::HIDGamepad::maybeAddButton):
(WebCore::HIDGamepad::maybeAddDPad):
(WebCore::HIDGamepad::maybeAddAxis):
(WebCore::fillInButtonValues):
(WebCore::HIDGamepad::valueChanged):

* platform/gamepad/mac/HIDGamepad.h:
(WebCore::HIDGamepadElement::isDPad):
(WebCore::HIDGamepadDPad::HIDGamepadDPad):
(WebCore::HIDGamepadDPad::normalizedValue):

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

3 years agoMarking swipe/main-frame-pinning-requirement.html as flaky on El Capitan.
ryanhaddad@apple.com [Thu, 26 Jan 2017 18:55:34 +0000 (18:55 +0000)]
Marking swipe/main-frame-pinning-requirement.html as flaky on El Capitan.
https://bugs.webkit.org/show_bug.cgi?id=161887

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

3 years agoMarking media/modern-media-controls/tracks-support/tracks-support-click-track-in...
ryanhaddad@apple.com [Thu, 26 Jan 2017 18:49:57 +0000 (18:49 +0000)]
Marking media/modern-media-controls/tracks-support/tracks-support-click-track-in-panel.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=165319

Unreviewed test gardening.

* platform/mac-wk1/TestExpectations:
* platform/mac/TestExpectations:

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

3 years agoMarking inspector/heap/gc.html as slow on macOS debug.
ryanhaddad@apple.com [Thu, 26 Jan 2017 18:49:55 +0000 (18:49 +0000)]
Marking inspector/heap/gc.html as slow on macOS debug.
https://bugs.webkit.org/show_bug.cgi?id=167408

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

3 years ago[Modern Media Controls] Hiding controls, changing their width and showing them again...
commit-queue@webkit.org [Thu, 26 Jan 2017 14:58:10 +0000 (14:58 +0000)]
[Modern Media Controls] Hiding controls, changing their width and showing them again shows an incorrect layout
https://bugs.webkit.org/show_bug.cgi?id=167160
<rdar://problem/29612318>

Patch by Antoine Quint <graouts@apple.com> on 2017-01-26
Reviewed by Dean Jackson.

Source/WebCore:

When we toggle visibility of the controls bar, we notify the hosting media controls and in the case of the
macOS inline media controls, we update the controls layout which would have failed to run last time it tried
due to the controls bar being hidden.

Test: media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-resize-with-hidden-controls-bar.html

* Modules/modern-media-controls/controls/controls-bar.js:
(ControlsBar.prototype.set visible):
* Modules/modern-media-controls/controls/macos-inline-media-controls.js:
(MacOSInlineMediaControls.prototype.controlsBarVisibilityDidChange):
* Modules/modern-media-controls/controls/media-controls.js:
(MediaControls.prototype.controlsBarVisibilityDidChange):

LayoutTests:

Add a new test that creates media controls at a given width, hides the controls bar, increases the width, makes
the controls bar visible again, and checks that the layout was correctly updated as a result.

* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-resize-with-hidden-controls-bar-expected.txt: Added.
* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-resize-with-hidden-controls-bar.html: Added.

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

3 years ago[Mac][cmake] Unreviewed speculative buildfix after r211161.
ossy@webkit.org [Thu, 26 Jan 2017 10:52:20 +0000 (10:52 +0000)]
[Mac][cmake] Unreviewed speculative buildfix after r211161.
https://bugs.webkit.org/show_bug.cgi?id=167294

* PlatformMac.cmake:

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

3 years agoCrash when setting custom scale factor.
pvollan@apple.com [Thu, 26 Jan 2017 10:09:07 +0000 (10:09 +0000)]
Crash when setting custom scale factor.
https://bugs.webkit.org/show_bug.cgi?id=167369

Reviewed by Sam Weinig.

Source/WebKit/mac:

Add null pointer check.

* WebView/WebView.mm:
(-[WebView _setCustomBackingScaleFactor:]):

Source/WebKit/win:

Add null pointer check.

* WebView.cpp:
(WebView::setCustomBackingScaleFactor):

Tools:

Added API test.

* TestWebKitAPI/PlatformWin.cmake:
* TestWebKitAPI/Tests/WebKit/win/ScaleWebView.cpp: Added.
(TestWebKitAPI::WebKitCreateInstance):
(TestWebKitAPI::ScaleWebView::SetUp):
(TestWebKitAPI::ScaleWebView::TearDown):
(TestWebKitAPI::TEST_F):

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

3 years agoImageBufferCairo: cairo_image_surface should use bmalloc-allocated memory
zandobersek@gmail.com [Thu, 26 Jan 2017 09:21:46 +0000 (09:21 +0000)]
ImageBufferCairo: cairo_image_surface should use bmalloc-allocated memory
https://bugs.webkit.org/show_bug.cgi?id=165751

Reviewed by Carlos Garcia Campos.

Allocate the underlying memory for cairo_image_surface objects through FastMalloc.
This way we can steer such large allocations away from the default libc allocator.

Objects of this class can create Cairo surfaces that need as much as 4MB of memory
for the underlying pixel buffer. Allocating such objects through the default
libc allocator can lead to increased memory usage because of non-optimal allocation
strategy in libc. In contrast, bmalloc performs large allocations by directly using
mmap() to reserve the necessary memory.

The improvements can be significant. On nytimes.com, with the threaded version of
the CoordinatedGraphics system, the memory consumption can drop by roughly 20%.

* platform/graphics/cairo/ImageBufferCairo.cpp:
(WebCore::ImageBuffer::ImageBuffer): Zero-allocate the necessary memory via FastMalloc.
Tie that memory lifetime to the lifetime of the surface by using
cairo_surface_set_user_data() with the specific user data key.

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

3 years ago[Threaded Compositor] Update also the contents size when creating the threaded compositor
carlosgc@webkit.org [Thu, 26 Jan 2017 09:19:48 +0000 (09:19 +0000)]
[Threaded Compositor] Update also the contents size when creating the threaded compositor
https://bugs.webkit.org/show_bug.cgi?id=167452

Reviewed by Žan Doberšek.

In r210954 we ensured that the threaded compositor and the viewport controller were created with the initial web
page size. If we don't update the contents size, the visible rectangle will be empty and tiles won't be created
until contentsSizeDidChange is called. It's even possible, when entering AC mode on demand, that we create the
layer tree host after the contents size changed, in which case nothing is rendered unless we resize the window.

* WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
(WebKit::ThreadedCoordinatedLayerTreeHost::ThreadedCoordinatedLayerTreeHost):

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

3 years ago[GTK] WebProcess from WebKitGtk+ 2.15.3 SIGSEVs in WebCore::GraphicsContext3D::drawAr...
magomez@igalia.com [Thu, 26 Jan 2017 09:05:01 +0000 (09:05 +0000)]
[GTK] WebProcess from WebKitGtk+ 2.15.3 SIGSEVs in WebCore::GraphicsContext3D::drawArrays(unsigned int, int, int) at Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:740
https://bugs.webkit.org/show_bug.cgi?id=167296

Reviewed by Sergio Villar Senin.

Use a VBO to pass the vertex data when using the stencil for clipping. Passing a custom array without
using an VBO is deprecated when using OpenGL >= 3.0 and a Core profile.

No behaviour change, no new tests.

* platform/graphics/texmap/TextureMapperGL.cpp:
(WebCore::TextureMapperGL::beginClip):

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

3 years ago[Mac][cmake] Fix the build after r211160
ossy@webkit.org [Thu, 26 Jan 2017 08:55:34 +0000 (08:55 +0000)]
[Mac][cmake] Fix the build after r211160
https://bugs.webkit.org/show_bug.cgi?id=167451

Unreviewed buildfix.

* UIProcess/API/Cocoa/WKWebView.mm:

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

3 years agorun-benchmark nests MotionMark results by the suite name twice
rniwa@webkit.org [Thu, 26 Jan 2017 04:55:32 +0000 (04:55 +0000)]
run-benchmark nests MotionMark results by the suite name twice
https://bugs.webkit.org/show_bug.cgi?id=164948

Reviewed by Said Abou-Hallawa.

Use a single level MotionMark now that this is the name of the benchmark,
and we no longer have tests that aren't part of the MotionMark suite.

* Scripts/webkitpy/benchmark_runner/data/patches/MotionMark.patch:

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

3 years agoCrash under DOMSelection::deleteFromDocument()
rniwa@webkit.org [Thu, 26 Jan 2017 04:50:01 +0000 (04:50 +0000)]
Crash under DOMSelection::deleteFromDocument()
https://bugs.webkit.org/show_bug.cgi?id=167232

Reviewed by Chris Dumez.

Source/WebCore:

The crash was caused by DOMSelection's deleteFromDocument() mutating contents inside the user-agent
shadow tree of an input element when the text field is readonly. Fixed the bug by exiting early
whenever the selection is inside a shadow tree since getSelection().getRangeAt(0) always returns
a range outside the input element or any shadow tree for that matter.

New behavior matches that of Gecko. The working draft spec of which I'm the editor states that
deleteFromDocument() must invoke Range's deleteContents() on the associated range, which is
the collapsed range returned by getSelection().getRangeAt(0) in the spec:
https://www.w3.org/TR/2016/WD-selection-api-20160921/#widl-Selection-deleteFromDocument-void
And Range's deleteContents() immediately terminates in step 1 when start and end are identical:
https://dom.spec.whatwg.org/commit-snapshots/6b7621282c2e3b222ac585650e484abf4c0a416b/

Note that Range's DOM mutating methods are not available inside an user-agent shadow tree because
WebKit never returns a Range whose end boundary points are inside the tree to author scripts.
Editing commands (ones executable from document.execCommand) that mutate DOM like this check whether
the content is editable or not. Since VisibleSelection's validate() function makes sure the selection
is either entirely within or outside of an root editable element (editing host in the W3C spec lingo),
editing commands should never mutate a random node inside an user-agent shadow tree.

Test: editing/selection/deleteFromDocument-shadow-tree-crash.html

* page/DOMSelection.cpp:
(WebCore::DOMSelection::deleteFromDocument):

LayoutTests:

Based on a patch by Chris Dumez. Add a regression test and rebaseline a Blink test as WebKit's
new behavior matches that of Gecko instead of Blink.

* editing/selection/deleteFromDocument-shadow-tree-crash-expected.txt: Added.
* editing/selection/deleteFromDocument-shadow-tree-crash.html: Added.
* imported/blink/editing/selection/deleteFromDocument-crash-expected.html:

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

3 years agoUnreviewed, rolling out r211193.
ryanhaddad@apple.com [Thu, 26 Jan 2017 04:24:10 +0000 (04:24 +0000)]
Unreviewed, rolling out r211193.

This change broke internal builds.

Reverted changeset:

"Notify clients when the user plays media otherwise prevented
from autoplaying"
https://bugs.webkit.org/show_bug.cgi?id=167390
http://trac.webkit.org/changeset/211193

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

3 years agoAdd infrastructure to support data interaction in WebKit2
wenson_hsieh@apple.com [Thu, 26 Jan 2017 04:22:05 +0000 (04:22 +0000)]
Add infrastructure to support data interaction in WebKit2
https://bugs.webkit.org/show_bug.cgi?id=167443

Reviewed by Simon Fraser.

Source/WebCore:

Adds support in WebCore to determine whether there is interactive data at a given position. No new tests, since
there should be no behavior change yet.

* page/EventHandler.h:
* page/Page.cpp:
(WebCore::Page::hasDataInteractionAtPosition):
* page/Page.h:

Source/WebKit2:

Adds plumbing for two new XPC messages: WebPageProxy::DidPerformDataInteractionControllerOperation and
WebPage::RequestStartDataInteraction. Additionally, adds a new field to InteractionInformationAtPosition that
indicates whether or not there is data to interact with at a given location.

This patch only adds infrastructure, and does not change any behavior.

* Shared/ios/InteractionInformationAtPosition.h:
* Shared/ios/InteractionInformationAtPosition.mm:
(WebKit::InteractionInformationAtPosition::encode):
(WebKit::InteractionInformationAtPosition::decode):
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::didPerformDataInteractionControllerOperation):
(WebKit::PageClientImpl::startDataInteractionWithImage):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::didPerformDataInteractionControllerOperation):
(WebKit::requestStartDataInteraction):
* UIProcess/mac/PageClientImpl.h:
* UIProcess/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::didPerformDataInteractionControllerOperation):
(WebKit::PageClientImpl::startDataInteractionWithImage):
* WebProcess/WebPage/WebPage.cpp:
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::requestStartDataInteraction):
(WebKit::WebPage::getPositionInformation):

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

3 years agoMarking media/modern-media-controls/airplay-support/airplay-support.html as flaky.
ryanhaddad@apple.com [Thu, 26 Jan 2017 04:19:00 +0000 (04:19 +0000)]
Marking media/modern-media-controls/airplay-support/airplay-support.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=167442

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

3 years agoStop inheriting from UIWebScrollView, just use UIScrollView
timothy_horton@apple.com [Thu, 26 Jan 2017 04:05:25 +0000 (04:05 +0000)]
Stop inheriting from UIWebScrollView, just use UIScrollView
https://bugs.webkit.org/show_bug.cgi?id=167440
<rdar://problem/7729691>

Reviewed by Simon Fraser.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView scrollViewWillBeginDragging:]):
* UIProcess/ios/WKScrollView.h:
* UIProcess/ios/WKScrollView.mm:
(-[WKScrollView initWithFrame:]): Deleted.
(-[WKScrollView setDecelerationRate:]): Deleted.
Inherit directly from UIScrollView, no need for UIWebScrollView.
Set the few settings we care about directly.
This has the side effect of reducing the default rate of scroll deceleration.

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

3 years agoModernize editable-text component and add tests
rniwa@webkit.org [Thu, 26 Jan 2017 04:00:41 +0000 (04:00 +0000)]
Modernize editable-text component and add tests
https://bugs.webkit.org/show_bug.cgi?id=167398

Reviewed by Yusuke Suzuki.

Modernized EditableText component to use the action feature added in r210938.

* browser-tests/editable-text-tests.js: Added. Added tests for EditableText component.
(.waitToRender):
* browser-tests/index.html:
* public/v3/components/base.js:
(ComponentBase.prototype.dispatchAction): Return the result from the callback.
* public/v3/components/editable-text.js:
(EditableText): Removed a bunch of instance variables that are no longer needed.
(EditableText.prototype.didConstructShadowTree): Added. Add event listeners on the Edit/Save button and the host.
(EditableText.prototype.editedText): Return the text field's value directly.
(EditableText.prototype.text): Added.
(EditableText.prototype.setText): Call enqueueToRender automatically instead of relying on the parent component
to do so in _startedEditingCallback, which has been removed.
(EditableText.prototype.render): Modernized the code.
(EditableText.prototype._didClick): No longer prevents the default action manually since that's automatically done
in createEventHandler. Handle the case where the update action is not handled.
(EditableText.prototype._endEditingMode): Renamed from _didUpdate.
(EditableText.htmlTemplate): Added ids on various elements in the shadow tree.
(EditableText.cssTemplate): Updated the CSS selectors per above change.
* public/v3/main.js:
(main): Fixed a typo.
* public/v3/pages/analysis-task-page.js:
(AnalysisTaskPage): Use the action listener instead of manually setting callbacks.
(AnalysisTaskPage.prototype._createTestGroupListItem): Ditto.
(AnalysisTaskPage.prototype._didStartEditingTaskName): Deleted.

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

3 years agoWebAssembly JS API: coerce return values from imports
sbarati@apple.com [Thu, 26 Jan 2017 02:38:41 +0000 (02:38 +0000)]
WebAssembly JS API: coerce return values from imports
https://bugs.webkit.org/show_bug.cgi?id=165480
<rdar://problem/29760318>

Reviewed by Yusuke Suzuki.

JSTests:

* wasm/function-tests/function-import-return-value.js: Added.
(import.Builder.from.string_appeared_here.import.as.assert.from.string_appeared_here.const.tests.x.assert.eq):
(import.Builder.from.string_appeared_here.import.as.assert.from.string_appeared_here.const.tests.Math.fround):
(import.Builder.from.string_appeared_here.import.as.assert.from.string_appeared_here.let.type.of.Reflect.ownKeys):
(test.1):
(assert.truthy):
(assert.throws):

Source/JavaScriptCore:

This patch does proper coercion for all possible
JSValue return types from an imported function.

It also adds the spec-compliant code to throw an exception
when calling an import that has an i64 parameter or return
value.

* jit/AssemblyHelpers.cpp:
(JSC::AssemblyHelpers::emitJumpIfException):
* jit/AssemblyHelpers.h:
* wasm/WasmB3IRGenerator.cpp:
* wasm/WasmBinding.cpp:
(JSC::Wasm::wasmToJs):

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

3 years agojsc.cpp should have the $.agent stuff for testing SAB
fpizlo@apple.com [Thu, 26 Jan 2017 02:34:30 +0000 (02:34 +0000)]
jsc.cpp should have the $.agent stuff for testing SAB
https://bugs.webkit.org/show_bug.cgi?id=167431

Reviewed by Saam Barati.

JSTests:

Add a very basic test of Atomics using $.agent. This is based on
LayoutTests/workers/sab/simple.html.

* stress/lars-sab-workers.js: Added.
(startWorker):
(resources):
(wake):
(else):

Source/JavaScriptCore:

This adds some stuff that the SAB branch of test262 needs. None of this is exposed except for our
own tests and the SAB branch of test262. We now pass all of the Atomics tests in the SAB branch
of test262.

* jsc.cpp:
(Message::releaseContents):
(Message::index):
(GlobalObject::finishCreation):
(GlobalObject::addFunction):
(Message::Message):
(Message::~Message):
(Worker::Worker):
(Worker::~Worker):
(Worker::send):
(Worker::receive):
(Worker::current):
(Worker::currentWorker):
(Workers::Workers):
(Workers::~Workers):
(Workers::broadcast):
(Workers::report):
(Workers::tryGetReport):
(Workers::getReport):
(Workers::singleton):
(functionDollarCreateRealm):
(functionDollarDetachArrayBuffer):
(functionDollarEvalScript):
(functionDollarAgentStart):
(functionDollarAgentReceiveBroadcast):
(functionDollarAgentReport):
(functionDollarAgentSleep):
(functionDollarAgentBroadcast):
(functionDollarAgentGetReport):
(functionWaitForReport):
(checkException):
(runWithScripts):
(runJSC):
(jscmain):
* runtime/JSArrayBuffer.h:

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

3 years agoNotify clients when the user plays media otherwise prevented from autoplaying
commit-queue@webkit.org [Thu, 26 Jan 2017 02:18:00 +0000 (02:18 +0000)]
Notify clients when the user plays media otherwise prevented from autoplaying
https://bugs.webkit.org/show_bug.cgi?id=167390

Patch by Matt Rajca <mrajca@apple.com> on 2017-01-25
Reviewed by Alex Christensen.

Source/WebCore:

The API is tested.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::playInternal):
* page/ChromeClient.h:

Source/WebKit2:

* UIProcess/API/APIUIClient.h:
(API::UIClient::didPlayMediaPreventedFromPlayingWithoutUserGesture):
* UIProcess/API/C/WKPage.cpp:
(WKPageSetPageUIClient):
* UIProcess/API/C/WKPageUIClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didPlayMediaPreventedFromPlayingWithoutUserGesture):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::didPlayMediaPreventedFromPlayingWithoutUserGesture):
* WebProcess/WebCoreSupport/WebChromeClient.h:

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2/autoplay-with-controls.html: Added.
* TestWebKitAPI/Tests/WebKit2/js-play-with-controls.html: Added.
* TestWebKitAPI/Tests/WebKit2Cocoa/WebsitePolicies.mm:
(didPlayMediaPreventedFromPlayingWithoutUserGesture):
(TEST):
* TestWebKitAPI/cocoa/TestWKWebView.h:
* TestWebKitAPI/cocoa/TestWKWebView.mm:
(-[TestWKWebViewHostWindow _mouseUpAtPoint:]):
(-[TestWKWebView waitForLoad]):
(-[TestWKWebView mouseUpAtPoint:]):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::createOtherPage):
(WTR::TestController::createWebViewWithOptions):

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

3 years agoRefactor drag and drop implementation on Mac
wenson_hsieh@apple.com [Thu, 26 Jan 2017 02:01:29 +0000 (02:01 +0000)]
Refactor drag and drop implementation on Mac
https://bugs.webkit.org/show_bug.cgi?id=167427

Reviewed by Enrica Casucci.

Source/WebCore:

Refactors some code around drag and drop on Mac, and cleans up some other related code as needed. This patch
should result in no behavior change.

* dom/DataTransfer.cpp:
* page/EventHandler.cpp:
* page/ios/EventHandlerIOS.mm:
(WebCore::EventHandler::eventLoopHandleMouseDragged):
* page/mac/EventHandlerMac.mm:
* platform/DragImage.cpp:
* platform/Pasteboard.h:
* platform/ios/DragImageIOS.mm:
* platform/ios/PasteboardIOS.mm:
* platform/mac/DragDataMac.mm:
(rtfPasteboardType):
(rtfdPasteboardType):
(stringPasteboardType):
(urlPasteboardType):
(htmlPasteboardType):
(colorPasteboardType):
(pdfPasteboardType):
(tiffPasteboardType):
(WebCore::DragData::DragData):
(WebCore::DragData::containsColor):
(WebCore::DragData::containsFiles):
(WebCore::DragData::numberOfFiles):
(WebCore::DragData::asFilenames):
(WebCore::DragData::containsPlainText):
(WebCore::DragData::containsCompatibleContent):
(WebCore::DragData::containsPromise):
(WebCore::DragData::asURL):
* platform/mac/DragImageMac.mm:

Source/WebKit/mac:

Refactor some WebKit1 code on the Mac pertaining to drag and drop. See WebCore ChangeLog for more details.

* Misc/WebNSPasteboardExtras.h:
* WebCoreSupport/WebDragClient.mm:
* WebView/WebFrame.mm:
* WebView/WebFrameInternal.h:
* WebView/WebHTMLView.mm:
* WebView/WebView.mm:
(-[WebView initSimpleHTMLDocumentWithStyle:frame:preferences:groupName:]):

Source/WebKit2:

See WebCore ChangeLog for more details.

* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<DragData>::encode):
(IPC::ArgumentCoder<DragData>::decode):
* UIProcess/Cocoa/WebPageProxyCocoa.mm:
* WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:

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

3 years ago[WebRTC] Add support for incoming and outgoing libwebrtc audio tracks
commit-queue@webkit.org [Thu, 26 Jan 2017 01:43:44 +0000 (01:43 +0000)]
[WebRTC] Add support for incoming and outgoing libwebrtc audio tracks
https://bugs.webkit.org/show_bug.cgi?id=167438

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

RealtimeIncomingAudioSource consumes audio buffers given by libwebrtc.
RealtimeOutgoingAudioSource consumes audio buffers from WebCore tracks (capture typically) and feeds libwebrtc with them.
To be covered by Layout/mock tests once LibWebRTC peer connection will be added.
These are only skeletons right now, the conversion between WebCore and LibWebRTC data is not yet implemented.

* WebCore.xcodeproj/project.pbxproj:
* platform/mediastream/mac/RealtimeIncomingAudioSource.cpp: Added.
(WebCore::RealtimeIncomingAudioSource::create):
(WebCore::RealtimeIncomingAudioSource::RealtimeIncomingAudioSource):
(WebCore::RealtimeIncomingAudioSource::OnData):
(WebCore::RealtimeIncomingAudioSource::startProducingData):
(WebCore::RealtimeIncomingAudioSource::stopProducingData):
(WebCore::RealtimeIncomingAudioSource::capabilities):
(WebCore::RealtimeIncomingAudioSource::settings):
(WebCore::RealtimeIncomingAudioSource::supportedConstraints):
(WebCore::RealtimeIncomingAudioSource::addObserver):
(WebCore::RealtimeIncomingAudioSource::removeObserver):
(WebCore::RealtimeIncomingAudioSource::start):
(WebCore::RealtimeIncomingAudioSource::audioSourceProvider):
* platform/mediastream/mac/RealtimeIncomingAudioSource.h: Added.
* platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp: Added.
(WebCore::RealtimeOutgoingAudioSource::sourceHasMoreMediaData):
* platform/mediastream/mac/RealtimeOutgoingAudioSource.h: Added.

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

3 years agomodern-media-test gardening.
ryanhaddad@apple.com [Thu, 26 Jan 2017 01:01:12 +0000 (01:01 +0000)]
modern-media-test gardening.

Unreviewed test gardening.

* platform/mac-wk1/TestExpectations:
* platform/mac/TestExpectations:

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

3 years agoRebaseline fast/forms/ios/ipad/focus-input-via-button.html.
ryanhaddad@apple.com [Thu, 26 Jan 2017 01:01:08 +0000 (01:01 +0000)]
Rebaseline fast/forms/ios/ipad/focus-input-via-button.html.

Unreviewed test gardening.

* fast/forms/ios/ipad/focus-input-via-button-expected.txt:

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

3 years ago[WebRTC] Add support for libwebrtc video incoming and outgoing video tracks
commit-queue@webkit.org [Thu, 26 Jan 2017 00:31:51 +0000 (00:31 +0000)]
[WebRTC] Add support for libwebrtc video incoming and outgoing video tracks
https://bugs.webkit.org/show_bug.cgi?id=167432

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

Not covered by tests right now, this will be covered by layout/mock tests.
RealtimeIncomingVideoSource consumes video frames given by libwebrtc.
RealtimeOutgoingVideoSource consumes video frames from WebCore tracks (capture typically) and feeds libwebrtc with them.

* platform/mediastream/mac/RealtimeIncomingVideoSource.cpp: Added.
(WebCore::RealtimeIncomingVideoSource::create):
(WebCore::RealtimeIncomingVideoSource::RealtimeIncomingVideoSource):
(WebCore::RealtimeIncomingVideoSource::startProducingData):
(WebCore::RealtimeIncomingVideoSource::stopProducingData):
(WebCore::RealtimeIncomingVideoSource::OnFrame):
(WebCore::RealtimeIncomingVideoSource::processNewSample):
(WebCore::drawImage):
(WebCore::RealtimeIncomingVideoSource::currentFrameImage):
(WebCore::RealtimeIncomingVideoSource::paintCurrentFrameInContext):
(WebCore::RealtimeIncomingVideoSource::capabilities):
(WebCore::RealtimeIncomingVideoSource::settings):
(WebCore::RealtimeIncomingVideoSource::supportedConstraints):
* platform/mediastream/mac/RealtimeIncomingVideoSource.h: Added.
* platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp: Added.
(WebCore::RealtimeOutgoingVideoSource::RealtimeOutgoingVideoSource):
(WebCore::RealtimeOutgoingVideoSource::GetStats):
(WebCore::RealtimeOutgoingVideoSource::AddOrUpdateSink):
(WebCore::RealtimeOutgoingVideoSource::RemoveSink):
(WebCore::RealtimeOutgoingVideoSource::sourceHasMoreMediaData):
* platform/mediastream/mac/RealtimeOutgoingVideoSource.h: Added.

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

3 years agoTry to fix the Mac CMake build after r211160.
aestes@apple.com [Thu, 26 Jan 2017 00:24:19 +0000 (00:24 +0000)]
Try to fix the Mac CMake build after r211160.

* PlatformMac.cmake:

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

3 years agoIntroduce an item-provider-based pasteboard wrapper
wenson_hsieh@apple.com [Wed, 25 Jan 2017 23:50:12 +0000 (23:50 +0000)]
Introduce an item-provider-based pasteboard wrapper
https://bugs.webkit.org/show_bug.cgi?id=167410

Reviewed by Enrica Casucci.

Source/WebCore:

Introduces WebItemProviderPasteboard, a pasteboard-like object backed by a number of item providers. No new
tests, since there is no behavior change.

* WebCore.xcodeproj/project.pbxproj:
* platform/ios/AbstractPasteboard.h: Copied from Source/WebCore/platform/spi/ios/UIKitSPI.h.
* platform/ios/WebItemProviderPasteboard.h: Copied from Source/WebCore/platform/spi/ios/UIKitSPI.h.
* platform/ios/WebItemProviderPasteboard.mm: Added.
(isRichTextType):
(isStringType):
(isURLType):
(isColorType):
(isImageType):
(+[WebItemProviderPasteboard sharedInstance]):
(-[WebItemProviderPasteboard init]):
(-[WebItemProviderPasteboard dealloc]):
(-[WebItemProviderPasteboard pasteboardTypes]):
(-[WebItemProviderPasteboard setItemProviders:]):
(-[WebItemProviderPasteboard numberOfItems]):
(-[WebItemProviderPasteboard setItems:]):
(-[WebItemProviderPasteboard dataForPasteboardType:inItemSet:]):
(-[WebItemProviderPasteboard valuesForPasteboardType:inItemSet:]):
(-[WebItemProviderPasteboard changeCount]):
(-[WebItemProviderPasteboard itemProviderAtIndex:]):
* platform/spi/ios/UIKitSPI.h:

Source/WTF:

Adds an additional feature flag.

* wtf/FeatureDefines.h:

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

3 years ago[ios-simulator] API test WebKit2.WebsitePoliciesAutoplayEnabled timing out
commit-queue@webkit.org [Wed, 25 Jan 2017 23:43:01 +0000 (23:43 +0000)]
[ios-simulator] API test WebKit2.WebsitePoliciesAutoplayEnabled timing out
https://bugs.webkit.org/show_bug.cgi?id=167385

Patch by Matt Rajca <mrajca@apple.com> on 2017-01-25
Reviewed by Alex Christensen.

* TestWebKitAPI/Tests/WebKit2/autoplay-check.html: Avoid arbitrary timeouts in favor of promises.
* TestWebKitAPI/Tests/WebKit2/autoplay-no-audio-check.html:
* TestWebKitAPI/Tests/WebKit2Cocoa/WebsitePolicies.mm:
(TEST): Allow inline (rather than full screen) media playback on iOS.

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

3 years agoRemoved leftovers of pre-2015 VisualStudio support
annulen@yandex.ru [Wed, 25 Jan 2017 23:37:26 +0000 (23:37 +0000)]
Removed leftovers of pre-2015 VisualStudio support
https://bugs.webkit.org/show_bug.cgi?id=167434

Reviewed by Alex Christensen.

Source/WebCore:

No new tests needed.

* platform/graphics/filters/FEConvolveMatrix.cpp: Replaced MSC_VER
usage with COMPILER(MSVC)

Source/WTF:

* wtf/Compiler.h:
* wtf/Platform.h:
* wtf/StringExtras.h:

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

3 years agoUse #pragma once in a few places
aestes@apple.com [Wed, 25 Jan 2017 23:20:45 +0000 (23:20 +0000)]
Use #pragma once in a few places
https://bugs.webkit.org/show_bug.cgi?id=167435

Reviewed by Alex Christensen.

* UIProcess/PageClient.h:
* UIProcess/ios/PageClientImplIOS.h:
* WebProcess/WebCoreSupport/ios/WebQuickLookHandleClient.h:

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

3 years agoFixing typos in r211161
commit-queue@webkit.org [Wed, 25 Jan 2017 23:14:38 +0000 (23:14 +0000)]
Fixing typos in r211161
https://bugs.webkit.org/show_bug.cgi?id=167433

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

* platform/mediastream/libwebrtc/LibWebRTCProvider.h:

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

3 years agoREGRESSION(r203110): LayoutTest http/tests/preload/single_download_preload_runner...
yoav@yoav.ws [Wed, 25 Jan 2017 22:51:54 +0000 (22:51 +0000)]
REGRESSION(r203110): LayoutTest http/tests/preload/single_download_preload_runner.html timing out
https://bugs.webkit.org/show_bug.cgi?id=159678

Move the single_download_preload test to be in a single document rather than a frame, as the frame based version was timing out.
I suspect that recent changes to handling of feature flags resulted in feature flags turned off for frames, which caused this test
to fail. As the frame doesn't seem required in this case, we can fold the entire test to a single document.
On top of that, I added per resource verification for the number of requests, which makes the test clearer, and avoided verifying
result for resource types that are currently failing/flaky.

Reviewed by Alex Christensen

* TestExpectations: Removed the timeout expectation for the test.
* http/tests/preload/single_download_preload-expected.txt: Renamed from LayoutTests/http/tests/preload/single_download_preload_runner-expected.txt.
* http/tests/preload/single_download_preload.html: Renamed from LayoutTests/http/tests/preload/resources/single_download_preload.html as well as fixed.
* http/tests/preload/single_download_preload_runner.html: Removed.
* http/tests/resources/dummy.xml: Added.
* http/tests/resources/test.oga: Added.
* platform/mac/TestExpectations: Removed the timeout expectation for the test.

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

3 years agoDisable Download attribute support on iOS
cdumez@apple.com [Wed, 25 Jan 2017 22:44:15 +0000 (22:44 +0000)]
Disable Download attribute support on iOS
https://bugs.webkit.org/show_bug.cgi?id=167337
<rdar://problem/30154148>

Reviewed by Alexey Proskuryakov.

Disable Download attribute support on iOS as it currently does not work.

* wtf/FeatureDefines.h:

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

3 years agoARM/ARM64 stress/atomics-store-return.js fails
fpizlo@apple.com [Wed, 25 Jan 2017 22:42:22 +0000 (22:42 +0000)]
ARM/ARM64 stress/atomics-store-return.js fails
<rdar://problem/30192652>

Reviewed by Michael Saboff.

The problem was relying on double->int casts for anything. We need to use toInt32().

* runtime/AtomicsObject.cpp:
(JSC::atomicsFuncCompareExchange):
(JSC::atomicsFuncExchange):
(JSC::atomicsFuncStore):

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

3 years agoFix a typo in TestExpectations.
ryanhaddad@apple.com [Wed, 25 Jan 2017 22:36:48 +0000 (22:36 +0000)]
Fix a typo in TestExpectations.

Unreviewed test gardening.

* TestExpectations:

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

3 years ago[QuickLook] Display a WKPasswordView when a document is password-protected
aestes@apple.com [Wed, 25 Jan 2017 22:31:24 +0000 (22:31 +0000)]
[QuickLook] Display a WKPasswordView when a document is password-protected
https://bugs.webkit.org/show_bug.cgi?id=167407
<rdar://problem/28544527>

Reviewed by Alex Christensen.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _hidePasswordView]): Added an early return if there is no _passwordView.
* UIProcess/PageClient.h: Declared requestPasswordForQuickLookDocument().
(WebKit::PageClient::didStartProvisionalLoadForMainFrame): Added an no-op base class
implementation.
(WebKit::PageClient::didFailProvisionalLoadForMainFrame): Ditto.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didStartProvisionalLoadForFrame): Called
PageClient::didStartProvisionalLoadForMainFrame() if frame is the main frame.
(WebKit::WebPageProxy::didFailProvisionalLoadForFrame): Ditto for
PageClient::didFailProvisionalLoadForMainFrame().
* UIProcess/WebPageProxy.h: Declared didRequestPasswordForQuickLookDocumentInMainFrame().
* UIProcess/WebPageProxy.messages.in: Added message
DidRequestPasswordForQuickLookDocumentInMainFrame.
* UIProcess/ios/PageClientImplIOS.h: Overrode requestPasswordForQuickLookDocument(),
didStartProvisionalLoadForMainFrame(), and didFailProvisionalLoadForMainFrame().
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::didStartProvisionalLoadForMainFrame): Called
-[WKWebView _hidePasswordView].
(WebKit::PageClientImpl::didFailProvisionalLoadForMainFrame): Ditto.
(WebKit::PageClientImpl::didCommitLoadForMainFrame): Ditto.
(WebKit::PageClientImpl::requestPasswordForQuickLookDocument): If there is already a
password view, assert that it is for the same fileName. Call
-[WKPasswordView showPasswordFailureAlert] and update the userDidEnterPassword block.
Otherwise, call -[WKWebView _showPasswordViewWithDocumentName:passwordHandler:].
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::didRequestPasswordForQuickLookDocumentInMainFrame): Called
PageClient::requestPasswordForQuickLookDocument() with a completion handler that send
message WebPage::DidReceivePasswordForQuickLookDocument.
* WebProcess/WebCoreSupport/ios/WebQuickLookHandleClient.cpp:
(WebKit::passwordCallbacks): Stores a map of page IDs to completion handler functions.
(WebKit::WebQuickLookHandleClient::~WebQuickLookHandleClient): Removes the current page ID
from passwordCallbacks().
(WebKit::WebQuickLookHandleClient::didRequestPassword): Asserts there is no current function
for this page ID in passwordCallbacks(), adds completionHandler to passwordCallbacks(), and
sends message WebPageProxy::DidRequestPasswordForQuickLookDocumentInMainFrame.
(WebKit::WebQuickLookHandleClient::didReceivePassword): Asserts there is a function for this
page ID in passwordCallbacks(), takes the completionHandler from passwordCallbacks(), and
calls it with the received password.
* WebProcess/WebCoreSupport/ios/WebQuickLookHandleClient.h: Declared didReceivePassword()
and overrode supportsPasswordEntry() and didRequestPassword().
* WebProcess/WebPage/WebPage.h: Declared didReceivePasswordForQuickLookDocument().
* WebProcess/WebPage/WebPage.messages.in: Added message
DidReceivePasswordForQuickLookDocument.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::didReceivePasswordForQuickLookDocument): Called
WebQuickLookHandleClient::didReceivePassword() with the received password and current page ID.

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

3 years agoRevert r210882, removing support for background-repeat-x/y
simon.fraser@apple.com [Wed, 25 Jan 2017 22:05:02 +0000 (22:05 +0000)]
Revert r210882, removing support for background-repeat-x/y
https://bugs.webkit.org/show_bug.cgi?id=167223

Reviewed by Myles C. Maxfield.

Followup from r211149; I missed part of the patch when committing.

* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isKeywordPropertyID):

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

3 years agoMarking fast/backgrounds/background-repeat-x-y-parse.html as failing.
ryanhaddad@apple.com [Wed, 25 Jan 2017 21:09:26 +0000 (21:09 +0000)]
Marking fast/backgrounds/background-repeat-x-y-parse.html as failing.
https://bugs.webkit.org/show_bug.cgi?id=167428

Unreviewed test gardening.

* TestExpectations:

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

3 years ago[WebRTC] Introduce libwebrtc abstraction for WK1/WK2 implementations
achristensen@apple.com [Wed, 25 Jan 2017 21:00:11 +0000 (21:00 +0000)]
[WebRTC] Introduce libwebrtc abstraction for WK1/WK2 implementations
https://bugs.webkit.org/show_bug.cgi?id=167294

Source/WebCore:

Patch by Youenn Fablet <youennf@gmail.com> on 2017-01-25
Reviewed by Alex Christensen.

Introducing LibWebRTCMacros.h which should be included before any libwebrtc header.

Introducing LibWebRTCProvider as the abstraction allowing to suport WK1 and WK2 libwebrtc-based WebRTC endpoints.
It  will create a libwebrtc peerconnection object differently in WK1 and WK2 as networking will be done differently.

LibWebRTCUtils contains routines used by WK1 and WK2 RTC providers to create the libwebrtc peerconnection object
and implement the necessary functionalities for it.

Updating PageConfiguration accordingly.

* WebCore.xcodeproj/project.pbxproj:
* page/Page.cpp:
(WebCore::Page::Page):
* page/Page.h:
(WebCore::Page::libWebRTCProvider):
* page/PageConfiguration.cpp:
(WebCore::PageConfiguration::PageConfiguration):
* page/PageConfiguration.h:
* platform/mediastream/libwebrtc/LibWebRTCMacros.h: Added.
* platform/mediastream/libwebrtc/LibWebRTCProvider.h: Added.
* platform/mediastream/libwebrtc/LibWebRTCUtils.cpp: Added.
(WebCore::staticFactoryAndThreads):
(WebCore::ThreadMessageData::ThreadMessageData):
(WebCore::PeerConnectionFactoryAndThreads::OnMessage):
(WebCore::callOnWebRTCNetworkThread):
(WebCore::initializePeerConnectionFactoryAndThreads):
(WebCore::initializeLibWebRTCInternalsWithSocketServer):
(WebCore::peerConnectionFactory):
(WebCore::createPeerConnection):
* platform/mediastream/libwebrtc/LibWebRTCUtils.h: Added.
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::dataChanged):

Source/WebKit/mac:

Patch by Youenn Fablet <youennf@gmail.com> on 2017-01-24
Reviewed by Alex Christensen.

* WebView/WebView.mm:
(-[WebView _commonInitializationWithFrameName:groupName:]):

Source/WebKit/win:

Patch by Youenn Fablet <youennf@gmail.com> on 2017-01-24
Reviewed by Alex Christensen.

* WebView.cpp:
(WebView::initWithFrame):

Source/WebKit2:

Patch by Youenn Fablet <youennf@gmail.com> on 2017-01-25
Reviewed by Alex Christensen.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_userInterfaceLayoutDirection):

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

3 years ago[iOS] Move WKPDFView's password view to WKWebView
aestes@apple.com [Wed, 25 Jan 2017 20:48:41 +0000 (20:48 +0000)]
[iOS] Move WKPDFView's password view to WKWebView
https://bugs.webkit.org/show_bug.cgi?id=167401

Reviewed by Tim Horton.

r210943 moved the PDF password view into the new class WKPasswordView but left it as a
subview of the WKPDFView. To show the password view for Web content, my original plan was to
teach WKContentView to host its own password view, but this turned out not to work. Since
QuickLook needs to unlock a document before determining its preview's MIME type, we have to
ask for a password during provisional navigation, but if the still-committed document is a
PDF then the WKContentView will not be in the view hierarchy.

To ensure password view visibility, this patch moves the ownership of WKPasswordView to
WKWebView and creates an internal API for showing and hiding it. When
-_showPasswordViewWithDocumentName:passwordHandler: is called, WKWebView inserts a new
WKPasswordView as a subview of the scroll view and hides the current content view. The
password view is removed and the current content view is unhidden by -_hidePasswordView.

This also fixes a bug in WKPDFView where a PDF document is laid out incorrectly if the view
size changes while the password view is displayed.

* UIProcess/API/Cocoa/WKWebView.mm: Declared _passwordView.
(-[WKWebView _processDidExit]): Hid the password view.
(-[WKWebView _didCommitLayerTree:]): Ignored if not showing the standard content view.
(-[WKWebView _restorePageScrollPosition:scrollOrigin:previousObscuredInset:scale:]): Ditto.
(-[WKWebView _restorePageStateToUnobscuredCenter:scale:]): Ditto.
(-[WKWebView usesStandardContentView]): Changed to return false if _passwordView is non-nil.
(-[WKWebView _updateContentRectsWithState:]): Updated _passwordView's frame with the current
bounds size.
(-[WKWebView _showPasswordViewWithDocumentName:passwordHandler:]): Created a WKPasswordView,
called -showInScrollView:, and hid _currentContentView.
(-[WKWebView _hidePasswordView]): Removed _passwordView from its superview, set
_passwordView to nil, and unhid _currentContentView.
(-[WKWebView _passwordView]): Returned _passwordView.
(-[WKWebView _beginAnimatedResizeWithUpdates:]): Called -usesStandardContentView instead of
checking for a non-nil _customContentView when deciding whether to do a non-animated resize.
* UIProcess/API/Cocoa/WKWebViewInternal.h:
* UIProcess/ios/WKPDFView.mm: Removed _passwordView.
(-[WKPDFView web_setMinimumSize:]): Set m_minimumSize and updated the frame size even when a
password view is displayed.
(-[WKPDFView _computePageAndDocumentFrames]): Removed password view code.
(-[WKPDFView _showPasswordEntryField]): Ditto.
(-[WKPDFView _passwordViewFrame]): Deleted.
* UIProcess/ios/WKPasswordView.h:
* UIProcess/ios/WKPasswordView.mm:
(-[WKPasswordView initWithFrame:documentName:]): Stored a copy of documentName in
_documentName.
(-[WKPasswordView documentName]): Added. Returns _documentName.
(-[WKPasswordView showInScrollView:]): Renamed from displayInContentView:. Started saving
zoomScale and contentSize.
(-[WKPasswordView hide]): Started restoring zoomeScale and contentSize.
(-[WKPasswordView showPasswordFailureAlert]): Renamed from -displayPasswordFailureAlert.
(-[WKPasswordView displayInContentView:]): Renamed to -showInScrollView:
(-[WKPasswordView displayPasswordFailureAlert]): Renamed to -showPasswordFailureAlert.

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

3 years agoAdd support for named pasteboards, pasteboard strategies and platform pasteboards
wenson_hsieh@apple.com [Wed, 25 Jan 2017 20:16:17 +0000 (20:16 +0000)]
Add support for named pasteboards, pasteboard strategies and platform pasteboards
https://bugs.webkit.org/show_bug.cgi?id=167404

Reviewed by Enrica Casucci.

Source/WebCore:

Refactors some pasteboard-related code to plumb the name of the pasteboard across from WebCore to the client
layer. No new tests, because there should be no change in behavior.

* platform/DragData.h:
* platform/Pasteboard.h:
* platform/PasteboardStrategy.h:
* platform/PlatformPasteboard.h:
* platform/ios/PasteboardIOS.mm:
(WebCore::Pasteboard::Pasteboard):
(WebCore::Pasteboard::write):
(WebCore::Pasteboard::writePlainText):
(WebCore::Pasteboard::read):
(WebCore::Pasteboard::hasData):
(WebCore::Pasteboard::clear):
(WebCore::Pasteboard::readString):
(WebCore::Pasteboard::writeString):
(WebCore::Pasteboard::types):

Source/WebKit/mac:

Adds pasteboard name as an argument to pasteboard-related WebPlatformStrategy methods.

* WebCoreSupport/WebPlatformStrategies.h:
* WebCoreSupport/WebPlatformStrategies.mm:
(WebPlatformStrategies::writeToPasteboard):
(WebPlatformStrategies::getPasteboardItemsCount):
(WebPlatformStrategies::readBufferFromPasteboard):
(WebPlatformStrategies::readURLFromPasteboard):
(WebPlatformStrategies::readStringFromPasteboard):

Source/WebKit2:

Adds support for delivering the pasteboard name to the UI process when writing to or reading from the pasteboard.

* UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
(WebKit::WebPasteboardProxy::writeWebContentToPasteboard):
(WebKit::WebPasteboardProxy::writeImageToPasteboard):
(WebKit::WebPasteboardProxy::writeStringToPasteboard):
(WebKit::WebPasteboardProxy::readStringFromPasteboard):
(WebKit::WebPasteboardProxy::readURLFromPasteboard):
(WebKit::WebPasteboardProxy::readBufferFromPasteboard):
(WebKit::WebPasteboardProxy::getPasteboardItemsCount):
* UIProcess/WebPasteboardProxy.h:
* UIProcess/WebPasteboardProxy.messages.in:
* WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
(WebKit::WebPlatformStrategies::writeToPasteboard):
(WebKit::WebPlatformStrategies::getPasteboardItemsCount):
(WebKit::WebPlatformStrategies::readBufferFromPasteboard):
(WebKit::WebPlatformStrategies::readURLFromPasteboard):
(WebKit::WebPlatformStrategies::readStringFromPasteboard):
* WebProcess/WebCoreSupport/WebPlatformStrategies.h:

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

3 years agomodern-media-tests LayoutTest gardening.
ryanhaddad@apple.com [Wed, 25 Jan 2017 20:04:30 +0000 (20:04 +0000)]
modern-media-tests LayoutTest gardening.
https://bugs.webkit.org/show_bug.cgi?id=167396

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

3 years agoLoadWebLocalizedStrings method should be moved in correct file
aakash_jain@apple.com [Wed, 25 Jan 2017 20:02:00 +0000 (20:02 +0000)]
LoadWebLocalizedStrings method should be moved in correct file
https://bugs.webkit.org/show_bug.cgi?id=167393

Reviewed by Alexey Proskuryakov.

Source/WebKit/ios:

* Misc/WebUIKitSupport.mm:
(LoadWebLocalizedStringsTimerCallback): Moved from WebLocalizableStrings.mm
(LoadWebLocalizedStrings): Moved from WebLocalizableStrings.mm

Source/WebKit/mac:

* Misc/WebLocalizableStrings.h: Deleted LoadWebLocalizedStrings method.
* Misc/WebLocalizableStrings.mm:
(LoadWebLocalizedStringsTimerCallback): Deleted, moved to WebUIKitSupport.mm
(LoadWebLocalizedStrings): Deleted, moved to WebUIKitSupport.mm

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

3 years agoTest result gardening for ios-simulator.
ryanhaddad@apple.com [Wed, 25 Jan 2017 19:14:18 +0000 (19:14 +0000)]
Test result gardening for ios-simulator.

Unreviewed test gardening.

* fast/events/touch/ios/block-without-overflow-scroll-and-passive-observer-on-block-scrolling-state-expected.txt:
* fast/events/touch/ios/block-without-overflow-scroll-and-passive-observer-on-document-scrolling-state-expected.txt:
* fast/events/touch/ios/block-without-overflow-scroll-scrolling-state-expected.txt:
* fast/events/touch/ios/tap-with-active-touch-end-listener-expected.txt:

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

3 years agoLayoutTest media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscre...
commit-queue@webkit.org [Wed, 25 Jan 2017 18:32:05 +0000 (18:32 +0000)]
LayoutTest media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-buttons-containers-styles.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=167253

Patch by Antoine Quint <graouts@apple.com> on 2017-01-25
Reviewed by Jon Lee.

Source/WebCore:

An IconButton loads its image asynchronously and waits for its load to obtain metrics. Once that happens,
its layout delegate needs to be notified that it needs a new layout. The test was a flaky failure because
the images would sometime load prior to layout, and sometime after, which would cause a failure. The test
is now robust with a controls layout happening after all buttons had loaded.

* Modules/modern-media-controls/controls/icon-button.js:
(IconButton.prototype._updateImage):
(IconButton):

LayoutTests:

This test should no longer be flaky, so let's not mark it as such anymore.

* platform/mac-wk1/TestExpectations:

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

3 years agoFix the !HAVE(ACCESSIBILITY) build by properly instantiating AXObjectCache member...
timothy@hatcher.name [Wed, 25 Jan 2017 18:26:52 +0000 (18:26 +0000)]
Fix the !HAVE(ACCESSIBILITY) build by properly instantiating AXObjectCache member timers.

* accessibility/AXObjectCache.h:
(WebCore::AXObjectCache::AXObjectCache):

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

3 years agoRevert r210882, removing support for background-repeat-x/y
simon.fraser@apple.com [Wed, 25 Jan 2017 18:00:49 +0000 (18:00 +0000)]
Revert r210882, removing support for background-repeat-x/y
https://bugs.webkit.org/show_bug.cgi?id=167223

Reviewed by Myles Maxfield.

Fix the layout tests.

fast/backgrounds/background-repeat-x-y.html was mistakenly removed in r211060 so
remove its expected. Fix the parsing test.

* fast/backgrounds/background-repeat-x-y-expected.html: Removed.
* fast/backgrounds/background-repeat-x-y-parse-expected.txt:
* fast/backgrounds/background-repeat-x-y-parse.html:

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

3 years agoMeasure how common it is for content to deal with WebGL context loss
cdumez@apple.com [Wed, 25 Jan 2017 17:51:13 +0000 (17:51 +0000)]
Measure how common it is for content to deal with WebGL context loss
https://bugs.webkit.org/show_bug.cgi?id=166866
<rdar://problem/30171195>

Reviewed by Alex Christensen.

Add diagnostic logging to measure how common it is for sites to handle
WebGL context loss via the webglcontextlost & webglcontextrestored
events.

* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::WebGLRenderingContextBase):
(WebCore::WebGLRenderingContextBase::checkForContextLossHandling):
* html/canvas/WebGLRenderingContextBase.h:
* page/DiagnosticLoggingKeys.cpp:
(WebCore::DiagnosticLoggingKeys::noKey):
(WebCore::DiagnosticLoggingKeys::yesKey):
(WebCore::DiagnosticLoggingKeys::handlesContextLossKey):
* page/DiagnosticLoggingKeys.h:

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

3 years agoAdd a hook to include additional feature defines
wenson_hsieh@apple.com [Wed, 25 Jan 2017 17:48:54 +0000 (17:48 +0000)]
Add a hook to include additional feature defines
https://bugs.webkit.org/show_bug.cgi?id=167403

Reviewed by Enrica Casucci.

* wtf/Platform.h: Include AdditionalFeatureDefines.h, if it exists.

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

3 years agoRevert r210882, removing support for background-repeat-x/y
simon.fraser@apple.com [Wed, 25 Jan 2017 17:42:44 +0000 (17:42 +0000)]
Revert r210882, removing support for background-repeat-x/y
https://bugs.webkit.org/show_bug.cgi?id=167223

Reviewed by Myles Maxfield.
Source/WebCore:

CSSPropertyBackgroundRepeatX and CSSPropertyBackgroundRepeatY only exist to make it easier
to parse CSSPropertyBackgroundRepeat as if it were a shorthand; they were never intended to
be web-exposed. r210882 mistakenly expose them to the web, so undo that patch, and annotate
the properties in CSSProperties.json with a flag which indicates their special status.

In addition, remove background-repeat-x/y from the list of properties allowed in video cues,
since these are not valid properties.

* css/CSSProperties.json:
* css/StyleResolver.cpp:
(WebCore::StyleResolver::isValidCueStyleProperty):
* css/makeprop.pl:
(addProperty):
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isKeywordPropertyID):

LayoutTests:

Modify the test to check that background-repeat-x and background-repeat-y are not parsed.

* fast/backgrounds/background-repeat-x-y-parse-expected.txt:
* fast/backgrounds/background-repeat-x-y-parse.html:

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

3 years agoFlaky Test: imported/w3c/web-platform-tests/html/browsers/history/the-location-interf...
commit-queue@webkit.org [Wed, 25 Jan 2017 17:38:24 +0000 (17:38 +0000)]
Flaky Test: imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location-protocol-setter-non-broken.html
https://bugs.webkit.org/show_bug.cgi?id=167380

Unreviewed.

Patch by Youenn Fablet <youenn@apple.com> on 2017-01-25

* TestExpectations: Marking test as flaky.

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

3 years ago[GTK] Icon Database should be in private browsing mode for ephemeral web views
carlosgc@webkit.org [Wed, 25 Jan 2017 17:02:58 +0000 (17:02 +0000)]
[GTK] Icon Database should be in private browsing mode for ephemeral web views
https://bugs.webkit.org/show_bug.cgi?id=167414

Reviewed by Michael Catanzaro.

Source/WebKit2:

This is already done by WebProcessPool for the legacy private session setting, but only checking the setting and not
whether there are ephemeral web pages or not.

* UIProcess/API/gtk/WebKitWebContext.cpp:
(webkitWebContextEnableIconDatabasePrivateBrowsingIfNeeded): Enable icon database private browsing if there's
any ephemeral web view.
(webkitWebContextDisableIconDatabasePrivateBrowsingIfNeeded): Disable icon database private browsing if there
aren't ephemeral web views anymore.
(webkit_web_context_set_favicon_database_directory): Enable icon database private browsing if the web context is ephemeral.
(webkitWebContextCreatePageForWebView): Call webkitWebContextEnableIconDatabasePrivateBrowsingIfNeeded().
(webkitWebContextWebViewDestroyed): Call webkitWebContextDisableIconDatabasePrivateBrowsingIfNeeded().
* UIProcess/API/gtk/WebKitWebView.cpp:
(webkitWebViewDispose): Ensure webkitWebContextWebViewDestroyed is called only once.

Tools:

Add a test case to check ephemeral web views don't write favicons to the database.

* TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitFaviconDatabase.cpp:
(ephemeralViewLoadChanged):
(testPrivateBrowsing):
(testFaviconDatabase):

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

3 years ago[GTK] Add a private browsing mode to MiniBrowser
carlosgc@webkit.org [Wed, 25 Jan 2017 16:56:00 +0000 (16:56 +0000)]
[GTK] Add a private browsing mode to MiniBrowser
https://bugs.webkit.org/show_bug.cgi?id=167413

Reviewed by Michael Catanzaro.

Add -p/--private command line option to create a private instance. Also add CTRL+SHIFT+P shortcut to create
private windows, even on non-private instances.

* MiniBrowser/gtk/BrowserWindow.c:
(webViewTitleChanged): Add [Private] to title window for private windows.
(webViewCreate): Pass web context to browser_window_new.
(openPrivateWindow): Create a new ephemeral web view and add it to a new window.
(browserWindowFinalize): Disconnect web context signal handlers.
(browser_window_init): Add shortcut for opening private window.
(browser_window_new): It now receives the context and connect to download-started here.
(browser_window_get_web_context): Return the context.
* MiniBrowser/gtk/BrowserWindow.h:
* MiniBrowser/gtk/main.c:
(createBrowserTab): Create the web view for the window web context.
(aboutDataScriptMessageReceivedCallback): Do not use the default web context, but the window one.
(aboutDataHandleRequest): Ditto.
(aboutURISchemeRequestCallback): Ditto.
(main): Create ephemeral web context if private command line option is used.

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

3 years ago[GTK] UIProcess from WebKitGtk+ 2.15.x SIGSEGVs because of X Error BadDamage in WebKi...
carlosgc@webkit.org [Wed, 25 Jan 2017 16:54:28 +0000 (16:54 +0000)]
[GTK] UIProcess from WebKitGtk+ 2.15.x SIGSEGVs because of X Error BadDamage in WebKit::AcceleratedBackingStoreX11::update(WebKit::LayerTreeContext const&) () at Source/WebKit2/UIProcess/gtk/AcceleratedBackingStoreX11.cpp:145
https://bugs.webkit.org/show_bug.cgi?id=165656

Reviewed by Michael Catanzaro.

Source/WebCore:

Also return the base error code from PlatformDisplayX11::supportsXDamage().

* platform/graphics/x11/PlatformDisplayX11.cpp:
(WebCore::PlatformDisplayX11::supportsXDamage):
* platform/graphics/x11/PlatformDisplayX11.h:

Source/WebKit2:

We are incorrectly handling BadDamage errors because the BadDamage value we pass to the XErrorTrapper is not
the actual error code used by X11. Since XDamage is an extension, it has its own errors and a base error
code. We need to use the base error code we get when calling XDamageQueryExtension to pass the right error code
to the XErrorTrapper.

* UIProcess/gtk/AcceleratedBackingStoreX11.cpp:
(WebKit::AcceleratedBackingStoreX11::create): Get also the damage base error.
(WebKit::xDamageErrorCode): Helper to get the actual error code.
(WebKit::AcceleratedBackingStoreX11::~AcceleratedBackingStoreX11): Use xDamageErrorCode().
(WebKit::AcceleratedBackingStoreX11::update): Ditto.

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

3 years agoUnreviewed. Fix 32 bit build after r211140.
carlosgc@webkit.org [Wed, 25 Jan 2017 14:34:27 +0000 (14:34 +0000)]
Unreviewed. Fix 32 bit build after r211140.

Include glib-object.h instead of forward declaring GType.

* platform/network/soup/SoupNetworkSession.h:

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

3 years ago[GTK] The inspector is broken when AC support is disabled
magomez@igalia.com [Wed, 25 Jan 2017 13:26:01 +0000 (13:26 +0000)]
[GTK] The inspector is broken when AC support is disabled
https://bugs.webkit.org/show_bug.cgi?id=165237

Reviewed by Carlos Garcia Campos.

Source/WebCore:

Ensure that PageOverlayController destroys its root GraphicsLayers when leaving AC. They
will be recreated if we enter AC again, avoiding a crash because the layers don't belong to
the appropriate compositor. Also, don't append the document overlay layers if we are not
in compositing mode.

No new tests added.

* page/PageOverlayController.cpp:
(WebCore::PageOverlayController::willDetachRootLayer):
* page/PageOverlayController.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
(WebCore::RenderLayerCompositor::detachRootLayer):

Source/WebKit2:

WebInspector must not use PageOverlays or GraphicsLayers when AC is not avaialable.

No new tests added.

* WebProcess/WebCoreSupport/WebInspectorClient.cpp:
(WebKit::WebInspectorClient::highlight):
(WebKit::WebInspectorClient::showPaintRect):

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

3 years ago[SOUP] Custom protocols don't work in private browsing mode
carlosgc@webkit.org [Wed, 25 Jan 2017 12:22:54 +0000 (12:22 +0000)]
[SOUP] Custom protocols don't work in private browsing mode
https://bugs.webkit.org/show_bug.cgi?id=167236

Reviewed by Sergio Villar Senin.

Source/WebCore:

Add static method to set the global custom protocols request type and setup method to add the feature to the session.

* platform/network/soup/SoupNetworkSession.cpp:
(WebCore::SoupNetworkSession::SoupNetworkSession):
(WebCore::SoupNetworkSession::setCustomProtocolRequestType):
(WebCore::SoupNetworkSession::setupCustomProtocols):
* platform/network/soup/SoupNetworkSession.h:

Source/WebKit2:

We only register them in the default session, they should be registered in all existing sessions, and also on
newly created ones.

* NetworkProcess/CustomProtocols/soup/CustomProtocolManagerSoup.cpp:
(WebKit::CustomProtocolManager::registerProtocolClass): Set the WEBKIT_TYPE_SOUP_REQUEST_GENERIC as type for
custom protocols.
(WebKit::CustomProtocolManager::registerScheme): Use g_type_class_peek instead of g_type_class_ref since we know
the class was already created in registerProtocolClass(). Setup custom protocols in all existing sessions.

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

3 years agocollectMatchingElementsInFlatTree should not find elements inside an user agent shado...
rniwa@webkit.org [Wed, 25 Jan 2017 09:11:52 +0000 (09:11 +0000)]
collectMatchingElementsInFlatTree should not find elements inside an user agent shadow tree
https://bugs.webkit.org/show_bug.cgi?id=167409

Reviewed by Antti Koivisto.

Source/JavaScriptCore:

Added matchingElementInFlatTree as a common identifier since it's required in the bindings code.

* runtime/CommonIdentifiers.h:

Source/WebCore:

The bug was caused by collectMatchingElementsInFlatTree including elements inside an user agent shadow tree
even though it shouldn't. Fixed the bug by checking that condition.

Also added matchingElementInFlatTree to find the first element matching a selector as opposed to all,
again, only exposed in a world which forces all shadow trees to be accessible.

* page/DOMWindow.cpp:
(WebCore::selectorQueryInFrame):
(WebCore::DOMWindow::collectMatchingElementsInFlatTree):
(WebCore::DOMWindow::matchingElementInFlatTree):
* page/DOMWindow.h:
* page/DOMWindow.idl:

Tools:

Added a test case for collectMatchingElementsInFlatTree not finding elements inside an user agent shadow tree
as well as tests for the newly added matchingElementInFlatTree.

* TestWebKitAPI/Tests/WebKit2/InjectedBundleMakeAllShadowRootsOpen.cpp:
(TestWebKitAPI::runJavaScriptAlert):
* TestWebKitAPI/Tests/WebKit2/InjectedBundleMakeAllShadowRootsOpen_Bundle.cpp:
(TestWebKitAPI::InjectedBundleMakeAllShadowRootOpenTest::initialize):
* TestWebKitAPI/Tests/WebKit2/closed-shadow-tree-test.html:

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

3 years ago[GTK] Add API to create ephemeral web views and deprecate the private browsing setting
carlosgc@webkit.org [Wed, 25 Jan 2017 08:01:08 +0000 (08:01 +0000)]
[GTK] Add API to create ephemeral web views and deprecate the private browsing setting
https://bugs.webkit.org/show_bug.cgi?id=167370

Reviewed by Michael Catanzaro.

Source/WebKit2:

Add API to create ephemeral WebKitWebView, WebKitWebsiteDataManager and WebKitWebContext.

* UIProcess/API/gtk/WebKitSettings.cpp:
(webKitSettingsSetProperty): Ignore deprecation warnings.
(webKitSettingsGetProperty): Ditto.
(webkit_settings_class_init): Mark WebKitSettings:enable-private-browsing as deprecated.
* UIProcess/API/gtk/WebKitSettings.h:
* UIProcess/API/gtk/WebKitWebContext.cpp:
(webkit_web_context_new_ephemeral): Create an ephemeral WebKitWebContext. This is just a convenient method to
create a WebKitWebContext with an ephemeral WebKitWebsiteDataManager without having to deal with the manager.
(webkit_web_context_is_ephemeral): Return whether the context is ephemeral.
(webkitWebContextCreatePageForWebView): Configure page with the web view WebKitWebsiteDataManager if it has one.
* UIProcess/API/gtk/WebKitWebContext.h:
* UIProcess/API/gtk/WebKitWebView.cpp:
(webkitWebViewConstructed): Check if the WebView is or should be ephemeral and create a non persistent website
data manager if it's an ephemeral web view in a non ephemeral web context.
(webkitWebViewSetProperty): Add setter for is-ephemeral property.
(webkitWebViewGetProperty): Add getter for is-ephemeral property.
(webkit_web_view_class_init): Add is-ephemeral property.
(webkitWebViewHandleAuthenticationChallenge): Check also whether web view is ephemeral.
(webkitWebViewGetWebsiteDataManager): Helper private to return the web view data manager.
(webkit_web_view_new_with_context): Also set is-ephemeral property depending on the context.
(webkit_web_view_is_ephemeral): Return whether the view is ephemeral.
* UIProcess/API/gtk/WebKitWebView.h:
* UIProcess/API/gtk/WebKitWebViewPrivate.h:
* UIProcess/API/gtk/WebKitWebsiteDataManager.cpp:
(webkitWebsiteDataManagerGetProperty): Add setter for is-ephemeral property.
(webkitWebsiteDataManagerSetProperty): Add getter for is-ephemeral property.
(webkit_website_data_manager_class_init): Add is-ephemeral property.
(webkit_website_data_manager_new_ephemeral): Create a new ephemeral WebKitWebsiteDataManager.
(webkit_website_data_manager_is_ephemeral): Return whether the website data manager is ephemeral.
(webkit_website_data_manager_get_base_data_directory): Return nullptr if manager is ephemeral.
(webkit_website_data_manager_get_base_cache_directory): Ditto.
(webkit_website_data_manager_get_local_storage_directory): Ditto.
(webkit_website_data_manager_get_disk_cache_directory): Ditto.
(webkit_website_data_manager_get_offline_application_cache_directory): Ditto.
(webkit_website_data_manager_get_indexeddb_directory): Ditto.
(webkit_website_data_manager_get_websql_directory): Ditto.
* UIProcess/API/gtk/WebKitWebsiteDataManager.h:
* UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: Add new symbols.

Tools:

Add several test cases of ephemeral web views.

* TestWebKitAPI/Tests/WebKit2Gtk/TestAuthentication.cpp:
(testWebViewAuthenticationStorage):
* TestWebKitAPI/Tests/WebKit2Gtk/TestCookieManager.cpp:
(ephemeralViewloadChanged):
(testCookieManagerEphemeral):
(beforeAll):
* TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitSettings.cpp:
(testWebKitSettings):
* TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitWebContext.cpp:
(testWebContextEphemeral):
(ephemeralViewloadChanged):
(testWebContextProxySettings):
(beforeAll):
* TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitWebView.cpp:
(ephemeralViewloadChanged):
(testWebViewEphemeral):
(beforeAll):
* TestWebKitAPI/Tests/WebKit2Gtk/TestWebsiteData.cpp:
(ephemeralViewloadChanged):
(testWebsiteDataEphemeral):
(beforeAll):

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

3 years agoREGRESSION (r208902): URLWithUserTypedString returns nil with file URLs
achristensen@apple.com [Wed, 25 Jan 2017 07:49:49 +0000 (07:49 +0000)]
REGRESSION (r208902): URLWithUserTypedString returns nil with file URLs
https://bugs.webkit.org/show_bug.cgi?id=167402
Source/WebCore:

<rdar://problem/29896656>

Reviewed by Ryosuke Niwa.

Covered by a new API test.

* platform/mac/WebCoreNSURLExtras.mm:
(WebCore::mapHostNameWithRange):
uidna_IDNToASCII succeeds when length is 0.
uidna_nameToASCII fails when length is 0.
This causes bad things to happen with file URLs, which have no host, so their host length is 0.
This makes us match behavior before r208902.

Tools:

Reviewed by Ryosuke Niwa.

* TestWebKitAPI/Tests/WebCore/cocoa/URLExtras.mm:
(TestWebKitAPI::TEST):

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

3 years agoLayoutTest media/modern-media-controls/airplay-support/airplay-support.html is failing
graouts@webkit.org [Wed, 25 Jan 2017 06:30:23 +0000 (06:30 +0000)]
LayoutTest media/modern-media-controls/airplay-support/airplay-support.html is failing
https://bugs.webkit.org/show_bug.cgi?id=164323

Reviewed by Jon Lee.

Make media/modern-media-controls/airplay-support/airplay-support.html more robust by following
the same pattern used in media/airplay-target-availability.html which proved to be robust.

* media/modern-media-controls/airplay-support/airplay-support.html:
* platform/mac/TestExpectations:

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

3 years agoAdd simple line layout toggle to MiniBrowser
zalan@apple.com [Wed, 25 Jan 2017 05:02:56 +0000 (05:02 +0000)]
Add simple line layout toggle to MiniBrowser
https://bugs.webkit.org/show_bug.cgi?id=167405

Reviewed by Andreas Kling.

Source/WebKit/mac:

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
(-[WebPreferences simpleLineLayoutEnabled]):
(-[WebPreferences setSimpleLineLayoutEnabled:]):
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

Source/WebKit2:

* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _simpleLineLayoutEnabled]):
(-[WKPreferences _setSimpleLineLayoutEnabled:]):
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:

Tools:

* MiniBrowser/mac/SettingsController.h:
* MiniBrowser/mac/SettingsController.m:
(-[SettingsController _populateMenu]):
(-[SettingsController validateMenuItem:]):
(-[SettingsController toggleSimpleLineLayoutEnabled:]):
(-[SettingsController simpleLineLayoutEnabled]):
* MiniBrowser/mac/WK1BrowserWindowController.m:
(-[WK1BrowserWindowController didChangeSettings]):
* MiniBrowser/mac/WK2BrowserWindowController.m:
(-[WK2BrowserWindowController didChangeSettings]):

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

3 years agoWKR does not include my nick when commit-queue lands my patch
commit-queue@webkit.org [Wed, 25 Jan 2017 04:25:51 +0000 (04:25 +0000)]
WKR does not include my nick when commit-queue lands my patch
https://bugs.webkit.org/show_bug.cgi?id=167388

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-01-24
Reviewed by Ryosuke Niwa.

* Scripts/webkitpy/tool/commands/newcommitbot.py:
(NewCommitBot._summarize_commit_log):
* Scripts/webkitpy/tool/commands/newcommitbot_unittest.py:
Perform nickname insertion before grabbing "Patch by" details.
This way we can include the nickname with the full name.

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

3 years agoFold USER_TIMING into WEB_TIMING and make it a RuntimeEnabledFeature
commit-queue@webkit.org [Wed, 25 Jan 2017 04:23:27 +0000 (04:23 +0000)]
Fold USER_TIMING into WEB_TIMING and make it a RuntimeEnabledFeature
https://bugs.webkit.org/show_bug.cgi?id=167394

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-01-24
Reviewed by Ryosuke Niwa.

.:

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

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:
* runtime/CommonIdentifiers.h:

Source/WebCore:

All of the Performance Timing specifications are highly coupled.
So let make WEB_TIMING encompass them all:

    - High Resolution Time (window.performance)
    - Performance Timeline (PerformanceEntry, PerformanceObserver)
    - Navigation Timing ("navigation" entries)
    - Resource Timing ("resource" entries)
    - User Timing ("mark" / "measure" entries)

We can then turn on and off individual pieces as runtime features,
such as Resource Timing, User Timing, and Performance Observer.

* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
Add User Timing files that are now included in WEB_TIMING builds.

* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setUserTimingEnabled):
(WebCore::RuntimeEnabledFeatures::userTimingEnabled):
Add a runtime feature for user timing. Disabled by default.

* Configurations/FeatureDefines.xcconfig:
* PAL/Configurations/FeatureDefines.xcconfig:
* bindings/js/JSPerformanceEntryCustom.cpp:
(WebCore::toJSNewlyCreated):
* page/Performance.cpp:
(WebCore::Performance::getEntries):
(WebCore::Performance::getEntriesByType):
(WebCore::Performance::getEntriesByName):
(WebCore::Performance::mark):
(WebCore::Performance::clearMarks):
(WebCore::Performance::measure):
(WebCore::Performance::clearMeasures):
(WebCore::Performance::webkitMark): Deleted.
(WebCore::Performance::webkitClearMarks): Deleted.
(WebCore::Performance::webkitMeasure): Deleted.
(WebCore::Performance::webkitClearMeasures): Deleted.
* page/Performance.h:
* page/Performance.idl:
* page/PerformanceMark.h:
* page/PerformanceMark.idl:
* page/PerformanceMeasure.h:
* page/PerformanceMeasure.idl:
* page/PerformanceUserTiming.cpp:
* page/PerformanceUserTiming.h:
Convert USER_TIMING to WEB_TIMING.
Drop webkit prefixed legacy names.

Source/WebKit/mac:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit2:

* Configurations/FeatureDefines.xcconfig:

Source/WTF:

* wtf/FeatureDefines.h:

Tools:

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

LayoutTests:

* platform/gtk/fast/dom/Window/window-properties-performance-expected.txt:
Although this test is skipped on gtk, update the results.

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

3 years agoLayoutTest media/modern-media-controls/placard-support/placard-support-airplay.html...
commit-queue@webkit.org [Wed, 25 Jan 2017 02:59:59 +0000 (02:59 +0000)]
LayoutTest media/modern-media-controls/placard-support/placard-support-airplay.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=164298

Patch by Antoine Quint <graouts@apple.com> on 2017-01-24
Reviewed by Jon Lee.

Make media/modern-media-controls/placard-support/placard-support-airplay.html more robust by
following the same pattern used in media/airplay-target-availability.html which proved to be robust.

* media/modern-media-controls/placard-support/placard-support-airplay-expected.txt:
* media/modern-media-controls/placard-support/placard-support-airplay.html:
* platform/mac/TestExpectations:

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

3 years agoLayoutTest media/modern-media-controls/tracks-panel/tracks-panel-hide.html is a flaky...
commit-queue@webkit.org [Wed, 25 Jan 2017 02:59:11 +0000 (02:59 +0000)]
LayoutTest media/modern-media-controls/tracks-panel/tracks-panel-hide.html is a flaky timeout
https://bugs.webkit.org/show_bug.cgi?id=167311

Patch by Antoine Quint <graouts@apple.com> on 2017-01-24
Reviewed by Dean Jackson.

Source/WebCore:

Ensure we have a chance to start the transition (on the next frame) before registering for an event
tracking its completion.

* Modules/modern-media-controls/controls/tracks-panel.js:
(TracksPanel.prototype.hide):

LayoutTests:

This test should no longer be flaky, so let's no mark it as such anymore.

* platform/mac/TestExpectations:

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

3 years agoWork around a crash when running media/modern-media-controls/pip-support/pip-support...
commit-queue@webkit.org [Wed, 25 Jan 2017 02:56:40 +0000 (02:56 +0000)]
Work around a crash when running media/modern-media-controls/pip-support/pip-support-enabled.html
https://bugs.webkit.org/show_bug.cgi?id=167381

Patch by Antoine Quint <graouts@apple.com> on 2017-01-24
Reviewed by Dean Jackson.

The test at media/modern-media-controls/pip-support/pip-support-enabled.html would crash because the test that
preceded it, media/modern-media-controls/pip-support/pip-support-click.html, would not exit the PiP presentation mode
before exiting the test. We now exit PiP before proceeding to the next test which avoid hitting the assertion
and the crash in Debug builds.

* media/modern-media-controls/pip-support/pip-support-click.html:
* platform/mac-wk1/TestExpectations:

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

3 years agoAtomics.store should return the int-converted value according to toInteger
fpizlo@apple.com [Wed, 25 Jan 2017 02:52:51 +0000 (02:52 +0000)]
Atomics.store should return the int-converted value according to toInteger
https://bugs.webkit.org/show_bug.cgi?id=167399

Reviewed by Saam Barati.
JSTests:

* stress/atomics-add-uint32.js: Added.
* stress/atomics-store-return.js: Fix the test to match what the spec wants.

Source/JavaScriptCore:

I keep getting this wrong, but I think I've finally done it right. What we want is for
Atomics.store to return the value it was passed after toInteger, which doesn't clip the value to
any kind of range. It does get truncated to double.

This changes the code to pass those "integers" as doubles. It doesn't matter that this is slow,
since all of these code paths are slow due to their need to check everything. We'll take care of
that by making them intrinsic later.

* runtime/AtomicsObject.cpp:
(JSC::atomicsFuncAdd):
(JSC::atomicsFuncAnd):
(JSC::atomicsFuncCompareExchange):
(JSC::atomicsFuncExchange):
(JSC::atomicsFuncLoad):
(JSC::atomicsFuncOr):
(JSC::atomicsFuncStore):
(JSC::atomicsFuncSub):
(JSC::atomicsFuncXor):

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

3 years ago[JSC] Optimize Number#toString with Int52
utatane.tea@gmail.com [Wed, 25 Jan 2017 02:40:52 +0000 (02:40 +0000)]
[JSC] Optimize Number#toString with Int52
https://bugs.webkit.org/show_bug.cgi?id=167303

Reviewed by Sam Weinig.

JSTests:

* stress/to-string-with-int52.js: Added.
(shouldBe):

Source/JavaScriptCore:

In kraken crypto-sha256-iterative, we frequently call Number.prototype.toString with
Int52. In that case, toString handles it in the generic double path. But we should
have a fast path for this since it can be represented in int64_t.

The stanford-crypto-sha256-iterative shows 1.6% performance improvement (on Linux machine hanayamata).

    Collected 100 samples per benchmark/VM, with 100 VM invocations per benchmark. Emitted a call to gc() between
    sample measurements. Used 1 benchmark iteration per VM invocation for warm-up. Used the jsc-specific preciseTime()
    function to get microsecond-level timing. Reporting benchmark execution times with 95% confidence intervals in
    milliseconds.

                                               baseline                  patched

    stanford-crypto-sha256-iterative        32.853+-0.075      ^      32.325+-0.055         ^ definitely 1.0163x faster

* runtime/JSCJSValue.h:
* runtime/NumberPrototype.cpp:
(JSC::int52ToStringWithRadix):
(JSC::toStringWithRadix):

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

3 years ago[WebRTC] Use HAVE_PTHREAD_COND_TIMEDWAIT_RELATIVE for libwebrtc
commit-queue@webkit.org [Wed, 25 Jan 2017 02:18:01 +0000 (02:18 +0000)]
[WebRTC] Use HAVE_PTHREAD_COND_TIMEDWAIT_RELATIVE for libwebrtc
https://bugs.webkit.org/show_bug.cgi?id=167353

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

Source/ThirdParty/libwebrtc:

* CMakeLists.txt:

Tools:

* Scripts/webkitpy/libwebrtc/generate_cmake.py:
(CMakeGenerator.initialize_targets):

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

3 years ago[iOS WK2] Avoid IOSurface readback for snapshot creation
simon.fraser@apple.com [Wed, 25 Jan 2017 01:44:09 +0000 (01:44 +0000)]
[iOS WK2] Avoid IOSurface readback for snapshot creation
https://bugs.webkit.org/show_bug.cgi?id=167397
rdar://problem/30174873

Reviewed by Tim Horton.

Source/WebCore:

Export sinkIntoImage().

* platform/graphics/cocoa/IOSurface.h:

Source/WebKit2:

Use IOSurface::sinkIntoImage() for snapshots, to avoid GPU readback.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):

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

3 years agoBug 167392: REGRESSION(r210531): Relax same-volume display requirement for iOS
bfulgham@apple.com [Wed, 25 Jan 2017 01:43:21 +0000 (01:43 +0000)]
Bug 167392: REGRESSION(r210531): Relax same-volume display requirement for iOS
https://bugs.webkit.org/show_bug.cgi?id=167392
<rdar://problem/30074665>

Reviewed by Brady Eidson.

Source/WebCore:

* page/SecurityOrigin.cpp:
(WebCore::SecurityOrigin::canDisplay): Exclude the new check when building on iOS.

LayoutTests:

Rebaseline two tests for ios-simulator, now that they exclude the cross-volume file check..

* platform/ios-simulator/fast/xmlhttprequest: Added.
* platform/ios-simulator/fast/xmlhttprequest/xmlhttprequest-nonexistent-file-expected.txt: Added.
* platform/ios-simulator/storage: Added.
* platform/ios-simulator/storage/domstorage: Added.
* platform/ios-simulator/storage/domstorage/sessionstorage: Added.
* platform/ios-simulator/storage/domstorage/sessionstorage/blocked-file-access-expected.txt: Added.

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

3 years agoInferredTypeTable entry manipulation is not TOCTOU race safe
msaboff@apple.com [Wed, 25 Jan 2017 01:04:26 +0000 (01:04 +0000)]
InferredTypeTable entry manipulation is not TOCTOU race safe
https://bugs.webkit.org/show_bug.cgi?id=167344

Reviewed by Filip Pizlo.

Made the accesses to table values safe from Time of Check,
Time of Use races with local temporary values.

Fixed point that we set an entry in the table to access the
current table entry instead of using the local entry.  In that case,
we reload the now changed entry.

* runtime/InferredTypeTable.cpp:
(JSC::InferredTypeTable::visitChildren):
(JSC::InferredTypeTable::get):
(JSC::InferredTypeTable::willStoreValue):
(JSC::InferredTypeTable::makeTop):

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

3 years agoWKR should not confuse Miguel Gomez with Andres Gomez
mcatanzaro@igalia.com [Wed, 25 Jan 2017 00:55:10 +0000 (00:55 +0000)]
WKR should not confuse Miguel Gomez with Andres Gomez
https://bugs.webkit.org/show_bug.cgi?id=167389

Reviewed by Lucas Forschler.

Andres's email is a substring of Miguel's, causing WKR to credit Miguel's commits to
"mAndres Gomez". Fix this.

* Scripts/webkitpy/tool/commands/newcommitbot.py:
(NewCommitBot._summarize_commit_log): Be stricter about matching emails. SVN logs include a
space on each side of the email address, so expect both spaces to be there before
considering the email for replacement.
* Scripts/webkitpy/tool/commands/newcommitbot_unittest.py: Add a test.

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

3 years agoAtomics.store should return the int-converted value, not the value that it stored
fpizlo@apple.com [Wed, 25 Jan 2017 00:53:48 +0000 (00:53 +0000)]
Atomics.store should return the int-converted value, not the value that it stored
https://bugs.webkit.org/show_bug.cgi?id=167395

Reviewed by Saam Barati.
JSTests:

* stress/atomics-store-return.js: Added.

Source/JavaScriptCore:

Previously the code was based around passing a lambda that operated over the native type of the
operation (so for example int8_t if we were doing things to Int8Arrays). But to support this
behavior of store, we need it to be able to control how it converts its result to JSValue and it
needs to see its argument as an int32_t. It turns out that it's easy for all of the functions in
AtomicsObject.cpp to also adopt this protocol since the conversion to JSValue is just jsNumber()
from the native type in those cases, and the conversion from int32_t is done for free in
std::atomic.

* runtime/AtomicsObject.cpp:
(JSC::atomicsFuncAdd):
(JSC::atomicsFuncAnd):
(JSC::atomicsFuncCompareExchange):
(JSC::atomicsFuncExchange):
(JSC::atomicsFuncLoad):
(JSC::atomicsFuncOr):
(JSC::atomicsFuncStore):
(JSC::atomicsFuncSub):
(JSC::atomicsFuncXor):

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

3 years agoScript gets touch events even after navigation swipe begins
timothy_horton@apple.com [Wed, 25 Jan 2017 00:49:33 +0000 (00:49 +0000)]
Script gets touch events even after navigation swipe begins
https://bugs.webkit.org/show_bug.cgi?id=167383
<rdar://problem/22938927>

Reviewed by Simon Fraser.

* Platform/spi/ios/UIKitSPI.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _isNavigationSwipeGestureRecognizer:]):
* UIProcess/API/Cocoa/WKWebViewInternal.h:
* UIProcess/Cocoa/ViewGestureController.h:
* UIProcess/ios/ViewGestureControllerIOS.mm:
(-[WKSwipeTransitionController isNavigationSwipeGestureRecognizer:]):
(WebKit::ViewGestureController::isNavigationSwipeGestureRecognizer):
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView gestureRecognizer:shouldRequireFailureOfGestureRecognizer:]):
Require the navigation swipe gesture recognizer to fail before the
UIWebTouchEventsGestureRecognizer can recognize. This way, the page
doesn't get touch events during the swipe, which previously led to
e.g. carousels scrolling while swiping.

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

3 years agoAdd memory footprint reporting using diagnostic logging.
akling@apple.com [Wed, 25 Jan 2017 00:15:00 +0000 (00:15 +0000)]
Add memory footprint reporting using diagnostic logging.
<https://webkit.org/b/167285>
<rdar://problem/30151767>

Reviewed by Chris Dumez.

Add some basic logging of physical memory footprint post-load and post-backgrounding.
The logging works similarly to the CPU usage logging, though with slightly longer
delays to allow the measurement to stabilize.

* page/DiagnosticLoggingKeys.cpp:
(WebCore::DiagnosticLoggingKeys::memoryUsageKey):
(WebCore::DiagnosticLoggingKeys::memoryUsageToDiagnosticLoggingKey):
* page/DiagnosticLoggingKeys.h:
* page/PerformanceLogging.cpp:
(WebCore::PerformanceLogging::physicalFootprint):
* page/PerformanceLogging.h:
* page/PerformanceMonitor.cpp:
(WebCore::PerformanceMonitor::PerformanceMonitor):
(WebCore::PerformanceMonitor::didFinishLoad):
(WebCore::PerformanceMonitor::activityStateChanged):
(WebCore::PerformanceMonitor::measurePostLoadMemoryUsage):
(WebCore::PerformanceMonitor::measurePostBackgroundingMemoryUsage):
* page/PerformanceMonitor.h:
* page/Settings.h:
(WebCore::Settings::isPostLoadMemoryUsageMeasurementEnabled):
(WebCore::Settings::isPostBackgroundingMemoryUsageMeasurementEnabled):
* page/cocoa/PerformanceLoggingCocoa.mm:
(WebCore::PerformanceLogging::physicalFootprint):

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

3 years agoMarking macos-inline-media-controls/macos-inline-media-controls-buttons-styles.html...
ryanhaddad@apple.com [Wed, 25 Jan 2017 00:09:09 +0000 (00:09 +0000)]
Marking macos-inline-media-controls/macos-inline-media-controls-buttons-styles.html as flaky on macOS WK1.
https://bugs.webkit.org/show_bug.cgi?id=163598

Unreviewed test gardening.

* platform/mac-wk1/TestExpectations:

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

3 years agoRemove always true unsafePluginPastingEnabled setting
commit-queue@webkit.org [Tue, 24 Jan 2017 23:49:34 +0000 (23:49 +0000)]
Remove always true unsafePluginPastingEnabled setting
https://bugs.webkit.org/show_bug.cgi?id=167360

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-01-24
Reviewed by Andreas Kling.

Source/WebCore:

Setting added by Chromium and never used by other ports.

* dom/ScriptableDocumentParser.cpp:
(WebCore::ScriptableDocumentParser::ScriptableDocumentParser):
* page/Settings.in:

LayoutTests:

* editing/pasteboard/paste-noplugin-expected.txt: Removed.
* editing/pasteboard/paste-noplugin-xhtml-expected.txt: Removed.
* editing/pasteboard/paste-noplugin-xhtml.xhtml: Removed.
* editing/pasteboard/paste-noplugin.html: Removed.
* platform/efl/TestExpectations:
* platform/wk2/TestExpectations:

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

3 years agoWhen Safari reloads pages with Flash objects after Flash is installed, placeholders...
andersca@apple.com [Tue, 24 Jan 2017 23:25:38 +0000 (23:25 +0000)]
When Safari reloads pages with Flash objects after Flash is installed, placeholders don't paint (but do work!)
https://bugs.webkit.org/show_bug.cgi?id=167391
rdar://problem/29857388

Reviewed by Sam Weinig.

* page/Page.cpp:
(WebCore::Page::refreshPlugins):
Remove an unused variable.

* plugins/PluginInfoProvider.cpp:
(WebCore::PluginInfoProvider::refresh):
Make sure to call refreshPlugins(). Instead of reloading subframes, just reload all the main frames with
subframes that contain plug-ins.

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

3 years ago-0 is a valid array index and AtomicsObject should know this
fpizlo@apple.com [Tue, 24 Jan 2017 23:24:35 +0000 (23:24 +0000)]
-0 is a valid array index and AtomicsObject should know this
https://bugs.webkit.org/show_bug.cgi?id=167386

Reviewed by Mark Lam.

JSTests:

* stress/atomics-neg-zero.js: Added.

Source/JavaScriptCore:

* runtime/AtomicsObject.cpp: The bug title really says it all.

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

3 years agoUnreviewed, rolling out r211091.
commit-queue@webkit.org [Tue, 24 Jan 2017 22:40:40 +0000 (22:40 +0000)]
Unreviewed, rolling out r211091.
https://bugs.webkit.org/show_bug.cgi?id=167384

introduces a subtle bug in InferredTypeTable, huge
Octane/deltablue regression (Requested by pizlo on #webkit).

Reverted changeset:

"InferredTypeTable entry manipulation is not TOCTOU race safe"
https://bugs.webkit.org/show_bug.cgi?id=167344
http://trac.webkit.org/changeset/211091

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

3 years agoEnable the stochastic space-time scheduler on the larger multicores
fpizlo@apple.com [Tue, 24 Jan 2017 22:07:34 +0000 (22:07 +0000)]
Enable the stochastic space-time scheduler on the larger multicores
https://bugs.webkit.org/show_bug.cgi?id=167382
<rdar://problem/30173375>

Rubber stamped by Saam Barati

This looks like a 1.3% JetStream speed-up thanks to a 28% splay-latency improvement. This new
scheduler seems to prevent all of the same pathologies as the old one prevented. But instead of
periodically suspending the mutator, this new one will only suspend after an iteration of the
constraint fixpoint. The length of that suspension length is random with the distribution being
governed by mutatorUtilization. Once resumed, the mutator gets to run unimpeded until draining
stalls.

I'm enabling it on platforms as I benchmark those platforms. It's possible that we will want to
use a different scheduler on different platforms.

* runtime/Options.cpp:
(JSC::overrideDefaults):

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

3 years agoJSArray::tryCreateUninitialized should be called JSArray::tryCreateForInitializationP...
msaboff@apple.com [Tue, 24 Jan 2017 21:54:59 +0000 (21:54 +0000)]
JSArray::tryCreateUninitialized should be called JSArray::tryCreateForInitializationPrivate
https://bugs.webkit.org/show_bug.cgi?id=167334

Rubber-stamped by Filip Pizlo.

* dfg/DFGOperations.cpp:
* ftl/FTLOperations.cpp:
(JSC::FTL::operationMaterializeObjectInOSR):
* runtime/ArrayPrototype.cpp:
(JSC::arrayProtoFuncSplice):
(JSC::arrayProtoPrivateFuncConcatMemcpy):
* runtime/CommonSlowPaths.cpp:
(JSC::SLOW_PATH_DECL):
* runtime/JSArray.cpp:
(JSC::JSArray::tryCreateForInitializationPrivate):
(JSC::JSArray::fastSlice):
(JSC::JSArray::tryCreateUninitialized): Deleted.
* runtime/JSArray.h:
(JSC::JSArray::tryCreateForInitializationPrivate):
(JSC::constructArray):
(JSC::constructArrayNegativeIndexed):
(JSC::JSArray::tryCreateUninitialized): Deleted.
* runtime/RegExpMatchesArray.cpp:
(JSC::createEmptyRegExpMatchesArray):
* runtime/RegExpMatchesArray.h:
(JSC::createRegExpMatchesArray):

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

3 years agoClean up Performance IDL interfaces so they are easier to read
commit-queue@webkit.org [Tue, 24 Jan 2017 21:45:13 +0000 (21:45 +0000)]
Clean up Performance IDL interfaces so they are easier to read
https://bugs.webkit.org/show_bug.cgi?id=167378

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-01-24
Reviewed by Sam Weinig.

* page/Performance.idl:
* page/PerformanceEntry.idl:
* page/PerformanceMark.idl:
* page/PerformanceMeasure.idl:
Update spec links and use a typedef to match specs.

* page/PerformanceResourceTiming.cpp:
(WebCore::PerformanceResourceTiming::workerStart):
* page/PerformanceResourceTiming.h:
* page/PerformanceResourceTiming.idl:
Add the workerStart property which always returns 0 for non-workers.

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

3 years agoSimple line layout: Add support for hyphen: auto.
zalan@apple.com [Tue, 24 Jan 2017 21:38:20 +0000 (21:38 +0000)]
Simple line layout: Add support for hyphen: auto.
https://bugs.webkit.org/show_bug.cgi?id=167297
<rdar://problem/30119463>

Reviewed by Antti Koivisto.

Source/WebCore:

Implement hyphen: auto for simple line layout.

Tests: fast/text/simple-line-hyphens-with-text-align.html
       fast/text/simple-line-hyphens-with-word-letter-spacing.html

* platform/text/Hyphenation.h:
(WebCore::enoughWidthForHyphenation):
* rendering/RenderTreeAsText.cpp:
(WebCore::writeSimpleLine):
(WebCore::write):
* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::canUseForStyle):
(WebCore::SimpleLineLayout::LineState::appendFragmentAndCreateRunIfNeeded): Inherit the hyphen attribute from the
run-to-be-appended. Ensure that we don't append additional runs when the last run has hyphen.
(WebCore::SimpleLineLayout::splitFragmentToFitLine): Before calling into the lastHyphenPosition() we need to
ensure that the hyphen would surely fit (even on the splitting position).
(WebCore::SimpleLineLayout::createLineRuns): Probe hypenation for overhanging non-whitespace runs.
(WebCore::SimpleLineLayout::printReason):
* rendering/SimpleLineLayout.h:
(WebCore::SimpleLineLayout::Run::Run):
* rendering/SimpleLineLayoutFlowContents.h:
(WebCore::SimpleLineLayout::FlowContents::Segment::toSegmentPosition):
(WebCore::SimpleLineLayout::FlowContents::Segment::toRenderPosition):
* rendering/SimpleLineLayoutResolver.cpp:
(WebCore::SimpleLineLayout::RunResolver::Run::Run):
(WebCore::SimpleLineLayout::RunResolver::Run::constructStringForHyphenIfNeeded):
(WebCore::SimpleLineLayout::RunResolver::Run::text):
* rendering/SimpleLineLayoutResolver.h:
(WebCore::SimpleLineLayout::RunResolver::Run::hasHyphen):
* rendering/SimpleLineLayoutTextFragmentIterator.cpp:
(WebCore::SimpleLineLayout::TextFragmentIterator::Style::Style):
(WebCore::SimpleLineLayout::TextFragmentIterator::nextBreakablePosition):
(WebCore::SimpleLineLayout::TextFragmentIterator::nextNonWhitespacePosition):
(WebCore::SimpleLineLayout::TextFragmentIterator::textWidth):
(WebCore::SimpleLineLayout::TextFragmentIterator::lastHyphenPosition): We only check the actual run for hyphenation ignoring
the neighboring runs. This might need to be changed in the future.
(WebCore::SimpleLineLayout::TextFragmentIterator::runWidth):
* rendering/SimpleLineLayoutTextFragmentIterator.h:
(WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::TextFragment):
(WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::hasHyphen):
(WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::operator==):
(WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::split):
(WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::splitWithHyphen):
* rendering/line/BreakingContext.h:
(WebCore::tryHyphenating):

LayoutTests:

* fast/text/simple-line-hyphens-with-text-align-expected.html: Added.
* fast/text/simple-line-hyphens-with-text-align.html: Added.
* fast/text/simple-line-hyphens-with-word-letter-spacing-expected.html: Added.
* fast/text/simple-line-hyphens-with-word-letter-spacing.html: Added.

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

3 years agoPass down website autoplay policies to media elements
commit-queue@webkit.org [Tue, 24 Jan 2017 21:03:42 +0000 (21:03 +0000)]
Pass down website autoplay policies to media elements
https://bugs.webkit.org/show_bug.cgi?id=167355

Patch by Matt Rajca <mrajca@apple.com> on 2017-01-24
Reviewed by Alex Christensen.

Source/WebCore:

Autoplay policies can be specified at the global web view preferences level or on a per-page
basis during navigation. This patch ensures that policies specified on a per-page basis hold
precedence over global policies. If no policies are specified during navigation, global
policies are used. A WebsiteAutoplayPolicy::Default option has been added to let clients
explicitly specify web view defaults should be used.

* dom/Document.cpp:
(WebCore::Document::audioPlaybackRequiresUserGesture):
(WebCore::Document::videoPlaybackRequiresUserGesture):
* dom/Document.h:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::HTMLMediaElement):
(WebCore::HTMLMediaElement::playInternal):
* loader/DocumentLoader.h:
(WebCore::DocumentLoader::audioPlaybackRequiresUserGesture):
(WebCore::DocumentLoader::setAudioPlaybackRequiresUserGesture):
(WebCore::DocumentLoader::videoPlaybackRequiresUserGesture):
(WebCore::DocumentLoader::setVideoPlaybackRequiresUserGesture):

Source/WebKit2:

Autoplay policies can be specified at the global web view preferences level or on a per-page
basis during navigation. This patch ensures that policies specified on a per-page basis hold
precedence over global policies. If no policies are specified during navigation, global
policies are used. A WebsiteAutoplayPolicy::Default option has been added to let clients
explicitly specify web view defaults should be used.

* Shared/WebsitePolicies.h:
* UIProcess/API/C/WKWebsitePolicies.cpp:
(WKWebsitePoliciesGetAutoplayPolicy):
(WKWebsitePoliciesSetAutoplayPolicy):
* UIProcess/API/C/WKWebsitePolicies.h:
* UIProcess/API/Cocoa/_WKWebsitePolicies.h:
* UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
(-[_WKWebsitePolicies setAutoplayPolicy:]):
(-[_WKWebsitePolicies autoplayPolicy]):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2/autoplay-check.html: Renamed from Tools/TestWebKitAPI/Tests/WebKit2/autoplayCheck.html to match our naming conventions.
* TestWebKitAPI/Tests/WebKit2/autoplay-no-audio-check.html: Added.
* TestWebKitAPI/Tests/WebKit2/test-without-audio-track.mp4: Added.
* TestWebKitAPI/Tests/WebKit2Cocoa/WebsitePolicies.mm:
(-[AutoplayPoliciesDelegate _webView:decidePolicyForNavigationAction:decisionHandler:]):
(TEST):

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

3 years agoMore modern-media-controls LayoutTest gardening.
ryanhaddad@apple.com [Tue, 24 Jan 2017 20:49:12 +0000 (20:49 +0000)]
More modern-media-controls LayoutTest gardening.

Unreviewed test gardening.

* platform/mac-wk1/TestExpectations:
* platform/mac/TestExpectations:

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

3 years agoAX: Speak Selection does not work in an iframe
n_wang@apple.com [Tue, 24 Jan 2017 20:44:38 +0000 (20:44 +0000)]
AX: Speak Selection does not work in an iframe
https://bugs.webkit.org/show_bug.cgi?id=166794
<rdar://problem/29913013>

Reviewed by Chris Fleizach.

Source/WebKit2:

Making sure WebPage::getSelectionOrContentsAsString() is getting the
selection content in the right frame.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _accessibilityRetrieveSpeakSelectionContent]):
(-[WKWebView _accessibilityDidGetSpeakSelectionContent:]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView accessibilityRetrieveSpeakSelectionContent]):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::getSelectionOrContentsAsString):

Tools:

* DumpRenderTree/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::retrieveSpeakSelectionContent):
(WTR::UIScriptController::accessibilitySpeakSelectionContent):
* TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl:
* TestRunnerShared/UIScriptContext/UIScriptController.cpp:
(WTR::UIScriptController::retrieveSpeakSelectionContent):
(WTR::UIScriptController::accessibilitySpeakSelectionContent):
* TestRunnerShared/UIScriptContext/UIScriptController.h:
* WebKitTestRunner/cocoa/TestRunnerWKWebView.h:
* WebKitTestRunner/cocoa/TestRunnerWKWebView.mm:
(-[TestRunnerWKWebView dealloc]):
(-[TestRunnerWKWebView _accessibilityDidGetSpeakSelectionContent:]):
(-[TestRunnerWKWebView accessibilityRetrieveSpeakSelectionContentWithCompletionHandler:]):
* WebKitTestRunner/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::retrieveSpeakSelectionContent):
(WTR::UIScriptController::accessibilitySpeakSelectionContent):

LayoutTests:

* accessibility/ios-simulator/speak-selection-content-expected.txt: Added.
* accessibility/ios-simulator/speak-selection-content.html: Added.
* platform/ios-simulator-wk1/TestExpectations:

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

3 years agoMake _WKFullscreenDelegate available to users of the WebKit2 C-API.
jer.noble@apple.com [Tue, 24 Jan 2017 19:55:56 +0000 (19:55 +0000)]
Make _WKFullscreenDelegate available to users of the WebKit2 C-API.
https://bugs.webkit.org/show_bug.cgi?id=165255

Reviewed by Anders Carlsson.

Add a getter and setter to WKPagePrivate allowing clients to set/get the
_WKFullscreenDelegate associated with the page.

* UIProcess/API/C/mac/WKPagePrivateMac.h:
* UIProcess/API/C/mac/WKPagePrivateMac.mm:
(WKPageSetFullscreenDelegate):
(WKPageGetFullscreenDelegate):

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

3 years agomodern-media-controls LayoutTest gardening.
ryanhaddad@apple.com [Tue, 24 Jan 2017 19:09:38 +0000 (19:09 +0000)]
modern-media-controls LayoutTest gardening.
https://bugs.webkit.org/show_bug.cgi?id=167266

Unreviewed test gardening.

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

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

3 years agoRemove always true selectionIncludesAltImageText setting
joepeck@webkit.org [Tue, 24 Jan 2017 19:08:42 +0000 (19:08 +0000)]
Remove always true selectionIncludesAltImageText setting
https://bugs.webkit.org/show_bug.cgi?id=167358

Reviewed by Alex Christensen.

Source/WebCore:

* editing/Editor.cpp:
(WebCore::Editor::selectedTextForDataTransfer):
* page/Settings.in:

LayoutTests:

* editing/pasteboard/copy-image-with-alt-text-expected.txt:
* editing/pasteboard/copy-image-with-alt-text.html:
* platform/efl/TestExpectations:

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