WebKit-https.git
2 years agoRemove unnecessary `const double` method arguments
commit-queue@webkit.org [Wed, 28 Jun 2017 17:16:54 +0000 (17:16 +0000)]
Remove unnecessary `const double` method arguments
https://bugs.webkit.org/show_bug.cgi?id=173925

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

Addressing post-landing feedback from webkit.org/b/173858.

* Modules/mediacontrols/MediaControlsHost.cpp:
(WebCore::MediaControlsHost::formattedStringForDuration):
* Modules/mediacontrols/MediaControlsHost.h:
* rendering/RenderTheme.h:
(WebCore::RenderTheme::mediaControlsFormattedStringForDuration):
* rendering/RenderThemeCocoa.h:

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

2 years agoMark the GraphicsContext as accelerated when the WebHTMLView's layer is drawing async...
simon.fraser@apple.com [Wed, 28 Jun 2017 16:57:06 +0000 (16:57 +0000)]
Mark the GraphicsContext as accelerated when the WebHTMLView's layer is drawing asynchronously
https://bugs.webkit.org/show_bug.cgi?id=173899
rdar://problem/32994474

Reviewed by Tim Horton.

When the WebHTMLView is layer-backed, and -drawsAsynchronously on its layer is YES,
then mark the GraphicsContext that WebCore is using for drawing as accelerated, so
that ImageBuffer::createCompatibleBuffer() creates appropriately matched buffers.

Also clean up WebFrame a little, sharing code that checks whether the WebFrame's
documentView is a WebHTMLView.

* WebView/WebFrame.mm:
(-[WebFrame _webHTMLDocumentView]):
(-[WebFrame _paintBehaviorForDestinationContext:]):
(-[WebFrame _drawRect:contentsOnly:]):
(-[WebFrame setTimeoutsPaused:]):
(-[WebFrame prepareForPause]):
(-[WebFrame resumeFromPause]):
(-[WebFrame resetTextAutosizingBeforeLayout]):
* WebView/WebHTMLView.mm:
(-[WebHTMLView drawLayer:inContext:]):
(-[WebHTMLView _web_isDrawingIntoAcceleratedLayer]):
* WebView/WebHTMLViewInternal.h:

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

2 years agoUnreviewed, rolling out r218373.
zalan@apple.com [Wed, 28 Jun 2017 16:45:14 +0000 (16:45 +0000)]
Unreviewed, rolling out r218373.

Output is not right

Reverted changeset:

"Use WTFLogAlways for debug logging so that it shows up in
device system logs"
https://bugs.webkit.org/show_bug.cgi?id=173450
http://trac.webkit.org/changeset/218373

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

2 years ago[GTK] Some web pages disappear immediately after rendering
carlosgc@webkit.org [Wed, 28 Jun 2017 16:32:49 +0000 (16:32 +0000)]
[GTK] Some web pages disappear immediately after rendering
https://bugs.webkit.org/show_bug.cgi?id=173768

Reviewed by Xabier Rodriguez-Calvar.

This is happening with websites having a "hidden" class in HTML tag when a media element is added. In the GTK+
port the media controls CSS contains the following code:

.hidden {
    display: none !important;
}

That causes the whole HTML document to become display: none. That's why we just render a white page, and also
the reason why it only happens with the GTK+ port and only with some specific websites. We should limit the
scope of the hidden class to the media control elements.

* css/mediaControlsGtk.css:
(audio::-webkit-media-controls-panel.hidden,):
(audio::-webkit-media-controls-panel div.mute-box.hidden,):
(audio::-webkit-media-controls-current-time-display.hidden,):
(audio::-webkit-media-controls-timeline.hidden,):
(audio::-webkit-media-controls-toggle-closed-captions-button, video::-webkit-media-controls-toggle-closed-captions-button):
(audio::-webkit-media-controls-toggle-closed-captions-button.hidden,):
(video::-webkit-media-controls-closed-captions-container.hidden):
(audio::-webkit-media-controls-fullscreen-button.hidden,):
(.hidden): Deleted.

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

2 years agoMedia controls volume glyph does not have the correct material
graouts@webkit.org [Wed, 28 Jun 2017 16:05:58 +0000 (16:05 +0000)]
Media controls volume glyph does not have the correct material
https://bugs.webkit.org/show_bug.cgi?id=173918
<rdar://problem/33012697>

Reviewed by Eric Carlson.

Source/WebCore:

Test: media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-mute-button-in-bottom-or-top-right-controls-bar.html

All buttons were hosted in a ControlsBar save for the MuteButton, so we now host it in a controls bar as well
to ensure compositing is similar to all other buttons.

* Modules/modern-media-controls/controls/inline-media-controls.css:
(.media-controls.inline > .controls-bar.top-right):
(.media-controls.inline > button.mute): Deleted.
* Modules/modern-media-controls/controls/inline-media-controls.js:
(InlineMediaControls):
(InlineMediaControls.prototype.layout):
(InlineMediaControls.prototype._addTopRightBarWithMuteButtonToChildren):
* Modules/modern-media-controls/controls/macos-inline-media-controls.js:
(MacOSInlineMediaControls.prototype.handleEvent):

LayoutTests:

Add a new test to check the mute button is correctly hosted in the top-right controls bar
when width becomes scarce.

* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-mute-button-in-bottom-or-top-right-controls-bar-expected.txt: Added.
* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-mute-button-in-bottom-or-top-right-controls-bar.html: Added.
* platform/mac/TestExpectations:

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

2 years agoUnreviewed, rolling out r218869.
cdumez@apple.com [Wed, 28 Jun 2017 15:55:51 +0000 (15:55 +0000)]
Unreviewed, rolling out r218869.

Broke the iOS build

Reverted changeset:

"Ensure that computed new stack pointer values do not
underflow."
https://bugs.webkit.org/show_bug.cgi?id=173700
http://trac.webkit.org/changeset/218869

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

2 years agoUnreviewed, rolling out r218873.
cdumez@apple.com [Wed, 28 Jun 2017 15:54:56 +0000 (15:54 +0000)]
Unreviewed, rolling out r218873.

Broke the iOS build

Reverted changeset:

"Gardening: CLoop build fix."
https://bugs.webkit.org/show_bug.cgi?id=173700
http://trac.webkit.org/changeset/218873

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

2 years ago[GTK] LayoutTest webaudio/silent-audio-interrupted-in-background.html makes its subse...
commit-queue@webkit.org [Wed, 28 Jun 2017 14:24:16 +0000 (14:24 +0000)]
[GTK] LayoutTest webaudio/silent-audio-interrupted-in-background.html makes its subsequent test flaky crash
https://bugs.webkit.org/show_bug.cgi?id=173916

Unreviewed test gardening.

Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2017-06-28

* platform/gtk/TestExpectations: Marked it Skip.

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

2 years agoGardening: CLoop build fix.
mark.lam@apple.com [Wed, 28 Jun 2017 12:35:05 +0000 (12:35 +0000)]
Gardening: CLoop build fix.
https://bugs.webkit.org/show_bug.cgi?id=173700
<rdar://problem/32926032>

Not reviewed.

* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::LLINT_SLOW_PATH_DECL):

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

2 years agoFix typo in comment: WordResult => WorkResult
ddkilzer@apple.com [Wed, 28 Jun 2017 11:23:39 +0000 (11:23 +0000)]
Fix typo in comment: WordResult => WorkResult

* wtf/AutomaticThread.h:

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

2 years agoAvoid double thread dispatch in WebsiteDataStore::fetchDataForTopPrivatelyControlledD...
cdumez@apple.com [Wed, 28 Jun 2017 07:34:41 +0000 (07:34 +0000)]
Avoid double thread dispatch in WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains()
https://bugs.webkit.org/show_bug.cgi?id=173904

Reviewed by Brent Fulgham.

Avoid double thread dispatch in WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains().
It calls fetchData() which dispatches to the main queue, then fetchDataForTopPrivatelyControlledDomains()
dispatches to the background queue. It should be possible to get fetchData() to dispatch directly
on the right queue.

* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::fetchData):
(WebKit::WebsiteDataStore::fetchDataAndApply):
(WebKit::WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains):
* UIProcess/WebsiteData/WebsiteDataStore.h:

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

2 years agoREGRESSION(r218799): [GTK][WPE] Critical warning at exit
carlosgc@webkit.org [Wed, 28 Jun 2017 07:20:23 +0000 (07:20 +0000)]
REGRESSION(r218799): [GTK][WPE] Critical warning at exit
https://bugs.webkit.org/show_bug.cgi?id=173907

Reviewed by Konstantin Tokarev.

GLib-GObject-CRITICAL **: g_object_unref: assertion 'G_IS_OBJECT (object)' failed

This is now always happening when closing the MeiniBrowser and it's causing a lot of unit tests to fail. In
r218799, GRefPtrGtk.h include was removed from PasteboardHelper.h that contains a GRefPtr<GtkTargetList>. The
targets are destroyed at exit, but now trying to use g_object_unref instead of gtk_target_list_unref(). I've
found two more cases like this in r218799, that removes GUniquePtrSoup.h from ResourceHandleInternal.h and
ResourceRequest.h that have GUniquePtr<SoupBuffer> and GUniquePtr<SoupURI>.

Fixes several GTK+ and WPE unit tests.

* platform/gtk/PasteboardHelper.h: Bring back GRefPtrGtk.h.
* platform/network/ResourceHandleInternal.h: Bring back GUniquePtrSoup.h.
* platform/network/soup/ResourceRequest.h: Ditto.

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

2 years agoEnsure that computed new stack pointer values do not underflow.
mark.lam@apple.com [Wed, 28 Jun 2017 07:11:57 +0000 (07:11 +0000)]
Ensure that computed new stack pointer values do not underflow.
https://bugs.webkit.org/show_bug.cgi?id=173700
<rdar://problem/32926032>

Reviewed by Filip Pizlo and Saam Barati.

1. Added a RELEASE_ASSERT to BytecodeGenerator::generate() to ensure that
   m_numCalleeLocals is sane.

2. Added underflow checks in LLInt code and VarargsFrame code.

3. Introduce minimumReservedZoneSize, which is hardcoded to 16K.
   Ensure that Options::reservedZoneSize() is at least minimumReservedZoneSize.
   Ensure that Options::softReservedZoneSize() is at least greater than
   Options::reservedZoneSize() by minimumReservedZoneSize.

4. Ensure that stack checks emitted by JIT tiers include an underflow check if
   and only if the max size of the frame is greater than Options::reservedZoneSize().

   By design, we are guaranteed to have at least Options::reservedZoneSize() bytes
   of memory at the bottom (end) of the stack.  This means that, at any time, the
   frame pointer must be at least Options::reservedZoneSize() bytes away from the
   end of the stack.  Hence, if the max frame size is less than
   Options::reservedZoneSize(), there's no way that frame pointer - max
   frame size can underflow, and we can elide the underflow check.

   Note that we use Options::reservedZoneSize() instead of
   Options::softReservedZoneSize() for determine if we need an underflow check.
   This is because the softStackLimit that is used for stack checks can be set
   based on Options::reservedZoneSize() during error handling (e.g. when creating
   strings for instantiating the Error object).  Hence, the guaranteed minimum of
   distance between the frame pointer and the end of the stack is
   Options::reservedZoneSize() and nor Options::softReservedZoneSize().

   Note also that we ensure that Options::reservedZoneSize() is at least
   minimumReservedZoneSize (i.e. 16K).  In typical deployments,
   Options::reservedZoneSize() may be larger.  Using Options::reservedZoneSize()
   instead of minimumReservedZoneSize gives us more chances to elide underflow
   checks.

* JavaScriptCore.xcodeproj/project.pbxproj:
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::generate):
* dfg/DFGGraph.cpp:
(JSC::DFG::Graph::requiredRegisterCountForExecutionAndExit):
* dfg/DFGJITCompiler.cpp:
(JSC::DFG::JITCompiler::compile):
(JSC::DFG::JITCompiler::compileFunction):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::lower):
* jit/JIT.cpp:
(JSC::JIT::compileWithoutLinking):
* jit/SetupVarargsFrame.cpp:
(JSC::emitSetupVarargsFrameFastCase):
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
* llint/LowLevelInterpreter.asm:
* llint/LowLevelInterpreter32_64.asm:
* llint/LowLevelInterpreter64.asm:
* runtime/MinimumReservedZoneSize.h: Added.
* runtime/Options.cpp:
(JSC::recomputeDependentOptions):
* runtime/VM.cpp:
(JSC::VM::updateStackLimits):
* wasm/WasmB3IRGenerator.cpp:
(JSC::Wasm::B3IRGenerator::B3IRGenerator):
* wasm/js/WebAssemblyFunction.cpp:
(JSC::callWebAssemblyFunction):

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

2 years agoWebAssembly: running out of executable memory should throw OoM
jfbastien@apple.com [Wed, 28 Jun 2017 06:42:13 +0000 (06:42 +0000)]
WebAssembly: running out of executable memory should throw OoM
https://bugs.webkit.org/show_bug.cgi?id=171537
<rdar://problem/32963338>

Reviewed by Saam Barati.

JSTests:

* wasm.yaml:
* wasm/lowExecutableMemory/executable-memory-oom.js: Added.
(const.invoke):
(failCount.0.catch):
(failCount.0.module.undefined.catch):
* wasm/lowExecutableMemory/exports-oom.js: Added.
(const.type):
(const.params):
(const.randomProgram):
(failCount.0.catch):
(failCount.0.module.undefined.catch):
* wasm/lowExecutableMemory/imports-oom.js: Added.
(const.type):
(const.params):
(const.randomProgram):
(f.imports.push):
(failCount.0.catch):
(failCount.0.module.undefined.catch):

Source/JavaScriptCore:

Both on first compile with BBQ as well as on tier-up with OMG,
running out of X memory shouldn't cause the entire program to
terminate. An exception will do when compiling initial code (since
we don't have any other fallback at the moment), and refusal to
tier up will do as well (it'll just be slower).

This is useful because programs which generate huge amounts of
code simply look like crashes, which developers report to
us. Getting a JavaScript exception instead is much clearer.

* jit/ExecutableAllocator.cpp:
(JSC::ExecutableAllocator::allocate):
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::shouldJIT):
* runtime/Options.h:
* wasm/WasmBBQPlan.cpp:
(JSC::Wasm::BBQPlan::prepare):
(JSC::Wasm::BBQPlan::complete):
* wasm/WasmBinding.cpp:
(JSC::Wasm::wasmToJs):
(JSC::Wasm::wasmToWasm):
* wasm/WasmBinding.h:
* wasm/WasmOMGPlan.cpp:
(JSC::Wasm::OMGPlan::work):
* wasm/js/JSWebAssemblyCodeBlock.cpp:
(JSC::JSWebAssemblyCodeBlock::JSWebAssemblyCodeBlock):
* wasm/js/JSWebAssemblyCodeBlock.h:
* wasm/js/JSWebAssemblyInstance.cpp:
(JSC::JSWebAssemblyInstance::finalizeCreation):

Tools:

* Scripts/run-jsc-stress-tests: add a configuration which runs the
tests under limited executable memory and avoids non-WebAssembly
code generation so that we more reliably run out of executable
memory in WebAssembly.

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

2 years agoJITStubRoutine::passesFilter should use isJITPC
sbarati@apple.com [Wed, 28 Jun 2017 06:23:23 +0000 (06:23 +0000)]
JITStubRoutine::passesFilter should use isJITPC
https://bugs.webkit.org/show_bug.cgi?id=173906

Reviewed by JF Bastien.

This patch makes JITStubRoutine use the isJITPC abstraction defined
inside ExecutableAllocator.h. Before, JITStubRoutine was using a
hardcoded platform size constant. This means it'd do the wrong thing
if Options::jitMemoryReservationSize() was larger than the defined
constant for that platform. This patch also removes a bunch of
dead code in that file.

* jit/ExecutableAllocator.cpp:
* jit/ExecutableAllocator.h:
* jit/JITStubRoutine.h:
(JSC::JITStubRoutine::passesFilter):
(JSC::JITStubRoutine::canPerformRangeFilter): Deleted.
(JSC::JITStubRoutine::filteringStartAddress): Deleted.
(JSC::JITStubRoutine::filteringExtentSize): Deleted.

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

2 years agoFix some stale comments in Wasm code base
sbarati@apple.com [Wed, 28 Jun 2017 05:45:59 +0000 (05:45 +0000)]
Fix some stale comments in Wasm code base
https://bugs.webkit.org/show_bug.cgi?id=173814

Reviewed by Mark Lam.

* wasm/WasmBinding.cpp:
(JSC::Wasm::wasmToJs):
* wasm/WasmOMGPlan.cpp:
(JSC::Wasm::runOMGPlanForIndex):

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

2 years ago[ResourceLoadStatistics] Update minimumTimeBetweeenDataRecordsRemoval to 1 hour inste...
cdumez@apple.com [Wed, 28 Jun 2017 05:14:24 +0000 (05:14 +0000)]
[ResourceLoadStatistics] Update minimumTimeBetweeenDataRecordsRemoval to 1 hour instead of 1 minute
https://bugs.webkit.org/show_bug.cgi?id=173895
<rdar://problem/32984366>

Reviewed by Brent Fulgham.

Update minimumTimeBetweeenDataRecordsRemoval to 1 hour instead of 1 minute to save battery.
Also port code to modern time types.

Source/WebCore:

* loader/ResourceLoadObserver.cpp:
(WebCore::reduceTimeResolution):
(WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
(WebCore::ResourceLoadObserver::setTimeToLiveUserInteraction):
(WebCore::ResourceLoadObserver::setTimeToLiveCookiePartitionFree):
(WebCore::ResourceLoadObserver::setMinimumTimeBetweeenDataRecordsRemoval):
(WebCore::ResourceLoadObserver::setReducedTimestampResolution):
(WebCore::ResourceLoadObserver::setGrandfatheringTime):
* loader/ResourceLoadObserver.h:
* loader/ResourceLoadStatistics.h:
(WebCore::ResourceLoadStatistics::mostRecentUserInteractionTime):
* loader/ResourceLoadStatisticsStore.cpp:
(WebCore::ResourceLoadStatisticsStore::createEncoderFromData):
(WebCore::ResourceLoadStatisticsStore::readDataFromDecoder):
(WebCore::shouldPartitionCookies):
(WebCore::ResourceLoadStatisticsStore::setTimeToLiveUserInteraction):
(WebCore::ResourceLoadStatisticsStore::setTimeToLiveCookiePartitionFree):
(WebCore::ResourceLoadStatisticsStore::setMinimumTimeBetweeenDataRecordsRemoval):
(WebCore::ResourceLoadStatisticsStore::setGrandfatheringTime):
(WebCore::ResourceLoadStatisticsStore::hasHadRecentUserInteraction):
(WebCore::ResourceLoadStatisticsStore::topPrivatelyControlledDomainsToRemoveWebsiteDataFor):
(WebCore::ResourceLoadStatisticsStore::handleFreshStartWithEmptyOrNoStore):
(WebCore::ResourceLoadStatisticsStore::shouldRemoveDataRecords):
(WebCore::ResourceLoadStatisticsStore::dataRecordsBeingRemoved):
* loader/ResourceLoadStatisticsStore.h:

Source/WebKit2:

* UIProcess/API/C/WKResourceLoadStatisticsManager.cpp:
(WKResourceLoadStatisticsManagerSetTimeToLiveUserInteraction):
(WKResourceLoadStatisticsManagerSetTimeToLiveCookiePartitionFree):
(WKResourceLoadStatisticsManagerSetMinimumTimeBetweeenDataRecordsRemoval):
(WKResourceLoadStatisticsManagerSetGrandfatheringTime):
* UIProcess/WebResourceLoadStatisticsManager.cpp:
(WebKit::WebResourceLoadStatisticsManager::setTimeToLiveUserInteraction):
(WebKit::WebResourceLoadStatisticsManager::setTimeToLiveCookiePartitionFree):
(WebKit::WebResourceLoadStatisticsManager::setMinimumTimeBetweeenDataRecordsRemoval):
(WebKit::WebResourceLoadStatisticsManager::setGrandfatheringTime):
* UIProcess/WebResourceLoadStatisticsManager.h:
* UIProcess/WebResourceLoadStatisticsStore.h:

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

2 years agoPort HysteresisActivity to Seconds type
cdumez@apple.com [Wed, 28 Jun 2017 05:06:03 +0000 (05:06 +0000)]
Port HysteresisActivity to Seconds type
https://bugs.webkit.org/show_bug.cgi?id=173902

Reviewed by Simon Fraser.

Source/WebCore:

* platform/HysteresisActivity.h:
(WebCore::HysteresisActivity::HysteresisActivity):
(WebCore::HysteresisActivity::stop):
* platform/ios/WebSQLiteDatabaseTrackerClient.mm:

Source/WebKit2:

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

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

2 years agoBuild fix for PAL
jbedard@apple.com [Wed, 28 Jun 2017 04:52:09 +0000 (04:52 +0000)]
Build fix for PAL
https://bugs.webkit.org/show_bug.cgi?id=173896

Reviewed by Myles C. Maxfield.

* PAL.xcodeproj/project.pbxproj: Ensure that the SRCROOT is WebCore/PAL and not
just WebCore.

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

2 years agoWeb Inspector: Cleanup RemoteObject tests
joepeck@webkit.org [Wed, 28 Jun 2017 04:23:48 +0000 (04:23 +0000)]
Web Inspector: Cleanup RemoteObject tests
https://bugs.webkit.org/show_bug.cgi?id=173885

Reviewed by Matt Baker.

* inspector/model/remote-object-dom.html: Added.
* inspector/model/remote-object-expected.txt:
* inspector/model/remote-object.html:
Split out DOM results (which differ across ports and features).

* inspector/model/resources/remote-object-utilities.js:
(TestPage.registerInitializer.window.runSteps):
This should have been a continue not a return.

* platform/mac/inspector/model/remote-object-dom-expected.txt: Added.
* platform/mac/inspector/model/remote-object-expected.txt: Removed.
Platform expectations are now limited to just the DOM test.

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

2 years ago[ESnext] Implement Object Rest - Implementing Object Rest Destructuring
ticaiolima@gmail.com [Wed, 28 Jun 2017 03:05:47 +0000 (03:05 +0000)]
[ESnext] Implement Object Rest - Implementing Object Rest Destructuring
https://bugs.webkit.org/show_bug.cgi?id=167962

Reviewed by Saam Barati.

JSTests:

* stress/object-rest-deconstruct.js: Added.
(let.assert):
(let.assertPropDescriptor):
(catch):
(get 3):
(foo):
(let.src.get y):
(let.src.set y):
(let.gen):

Source/JavaScriptCore:

Object Rest/Spread Destructing proposal is in stage 3[1] and this
Patch is a prototype implementation of it. A simple change over the
parser was necessary to support the new '...' token on Object Pattern
destruction rule. In the bytecode generator side, We changed the
bytecode generated on ObjectPatternNode::bindValue to store in an
set the identifiers of already destructured properties, following spec draft
section[2], and then pass it as excludedNames to CopyDataProperties.
The rest destructuring calls copyDataProperties to perform the
copy of rest properties in rhs.

We also implemented CopyDataProperties as private JS global operation
on builtins/GlobalOperations.js following it's specification on [3].
It is implemented using Set object to verify if a property is on
excludedNames to keep this algorithm with O(n + m) complexity, where n
= number of source's own properties and m = excludedNames.length.

In this implementation we aren't using excludeList as constant if
destructuring pattern contains computed property, i.e. we can
just determine the key to be excluded at runtime. If we can define all
identifiers in the pattern in compile time, we then create a
constant JSSet. This approach gives a good performance improvement,
since we allocate the excludeSet just once, reducing GC pressure.

[1] - https://github.com/tc39/proposal-object-rest-spread
[2] - https://tc39.github.io/proposal-object-rest-spread/#Rest-RuntimeSemantics-PropertyDestructuringAssignmentEvaluation
[3] - https://tc39.github.io/proposal-object-rest-spread/#AbstractOperations-CopyDataProperties

* builtins/BuiltinNames.h:
* builtins/GlobalOperations.js:
(globalPrivate.copyDataProperties):
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::finishCreation):
* bytecompiler/NodesCodegen.cpp:
(JSC::ObjectPatternNode::bindValue):
* parser/ASTBuilder.h:
(JSC::ASTBuilder::appendObjectPatternEntry):
(JSC::ASTBuilder::appendObjectPatternRestEntry):
(JSC::ASTBuilder::setContainsObjectRestElement):
* parser/Nodes.h:
(JSC::ObjectPatternNode::appendEntry):
(JSC::ObjectPatternNode::setContainsRestElement):
* parser/Parser.cpp:
(JSC::Parser<LexerType>::parseDestructuringPattern):
(JSC::Parser<LexerType>::parseProperty):
* parser/SyntaxChecker.h:
(JSC::SyntaxChecker::operatorStackPop):
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
* runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::asyncFunctionStructure):
(JSC::JSGlobalObject::setStructure): Deleted.
* runtime/JSGlobalObjectFunctions.cpp:
(JSC::privateToObject):
* runtime/JSGlobalObjectFunctions.h:
* runtime/ObjectConstructor.cpp:
(JSC::ObjectConstructor::finishCreation):
* runtime/SetPrototype.cpp:
(JSC::SetPrototype::finishCreation):

Source/WTF:

* wtf/HashSet.h:
(WTF::=):

LayoutTests:

* js/parser-syntax-check-expected.txt:
* js/script-tests/parser-syntax-check.js:

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

2 years agoMove WebsiteDataRecord processing off-thread in WebsiteDataStore::fetchDataForTopPriv...
cdumez@apple.com [Wed, 28 Jun 2017 01:47:15 +0000 (01:47 +0000)]
Move WebsiteDataRecord processing off-thread in WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains()
https://bugs.webkit.org/show_bug.cgi?id=173882
<rdar://problem/32984366>

Reviewed by Darin Adler.

Move WebsiteDataRecord processing off-thread in WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains()
as we have data showing it is slow and hangs the UIProcess' main thread.

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

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

2 years agoUnreviewed, unmark workers/bomb.html flakiness after r218856
utatane.tea@gmail.com [Wed, 28 Jun 2017 01:09:03 +0000 (01:09 +0000)]
Unreviewed, unmark workers/bomb.html flakiness after r218856

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

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

2 years ago[WK2][macOS] Expand sandbox to allow access to the CoreMedia volume control endpoint
bfulgham@apple.com [Wed, 28 Jun 2017 01:06:53 +0000 (01:06 +0000)]
[WK2][macOS] Expand sandbox to allow access to the CoreMedia volume control endpoint
https://bugs.webkit.org/show_bug.cgi?id=173898
<rdar://problem/32930754>

Reviewed by Ryosuke Niwa.

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

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

2 years agoMediaPlayerPrivate m_private may not yet be created when setPrivateBrowsingMode is...
commit-queue@webkit.org [Wed, 28 Jun 2017 01:04:29 +0000 (01:04 +0000)]
MediaPlayerPrivate m_private may not yet be created when setPrivateBrowsingMode is called.
https://bugs.webkit.org/show_bug.cgi?id=173893
rdar://problem/32986872

Patch by Jeremy Jones <jeremyj@apple.com> on 2017-06-27
Reviewed by Ryosuke Niwa.

No new tests because no reproducable case.

setPrivateBrowsingMode can be called on MediaPlayer before the MediaPlayerPrivate is created.
The value should only be pushed down the m_private if it has been created.

* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::setPrivateBrowsingMode):

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

2 years ago[JSC] Do not touch VM after notifying Ready in DFG::Worklist
utatane.tea@gmail.com [Wed, 28 Jun 2017 00:46:50 +0000 (00:46 +0000)]
[JSC] Do not touch VM after notifying Ready in DFG::Worklist
https://bugs.webkit.org/show_bug.cgi?id=173888

Reviewed by Saam Barati.

After notifying Plan::Ready and releasing Worklist lock, VM can be destroyed.
Thus, Plan::vm() can return a destroyed VM. Do not touch it.
This causes occasional SEGV / assertion failures in workers/bomb test.

* dfg/DFGWorklist.cpp:

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

2 years ago[iOS DnD] Support dragging out of contenteditable areas without a prior selection
wenson_hsieh@apple.com [Wed, 28 Jun 2017 00:36:31 +0000 (00:36 +0000)]
[iOS DnD] Support dragging out of contenteditable areas without a prior selection
https://bugs.webkit.org/show_bug.cgi?id=173854
<rdar://problem/32236827>

Reviewed by Ryosuke Niwa and Tim Horton.

Source/WebCore:

Allows elements to be dragged from contenteditable areas for both WebKit1 and WebKit2 iOS. There are two main
changes in WebCore: move the touch point adjustment code into EventHandler::tryToBeginDataInteractionAtPoint, so
that the clientPosition specified will be adjusted to an appropriate clickable node if needed. This is necessary
because UIWebDocumentView and WKContentView no longer send adjusted points to WebCore when requesting drag
start. See <https://bugs.webkit.org/show_bug.cgi?id=173855> for a followup regarding the globalPosition and
clientPositions passed in to the MouseEvents when performing a drag or synthetic click.

Secondly, image elements in Mail's contenteditable area are not draggable unless the heuristic in
DragController::draggableElement is tweaked to not reject image dragging across the board if the
loadsImagesAutomatically setting is turned off. Instead, even if images are not automatically loaded, allow the
image drag to commence if the image renderer already has a cached image.

Test: DataInteractionTests.DragImageFromContentEditable

* page/DragController.cpp:
(WebCore::imageElementIsDraggable):
(WebCore::DragController::draggableElement):
* page/ios/EventHandlerIOS.mm:
(WebCore::EventHandler::tryToBeginDataInteractionAtPoint):

Source/WebKit/mac:

Vends some information from the DragItem passed into -[WebView _startDrag:] through the WebView as SPI for
WebKit1 clients. No behavior change with these changes alone -- see <rdar://problem/32991062> for more detail.

* WebView/WebView.mm:
(-[WebView _startDrag:]):
(-[WebView _dragSourceAction]):
(-[WebView _draggedLinkTitle]):
(-[WebView _draggedLinkURL]):
(-[WebView _draggedElementBounds]):
(-[WebView _endedDataInteraction:global:]):
* WebView/WebViewData.h:
* WebView/WebViewPrivate.h:

Source/WebKit2:

Instead of allowing a drag to occur only if a position information request discovers a clickable node, remove
the position information request entirely and just call into WebCore to try and begin the drag. Currently, the
position information request serves two purposes:
1. To adjust the hit-test location to account for nearby clickable nodes.
2. To obtain information about the content being dragged.

The first requirement is fulfilled by performing the drag location adjustment in WebCore instead (see
ChangeLogs for more detail). The second requirement is fulfilled by refactoring in
https://bugs.webkit.org/show_bug.cgi?id=173832 to fold all information relevant to starting a drag into the
DragItem struct, and then propagating the DragItem struct. The relevant information from the position
information update is now populated when the UI process receives the drag start response.

* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _startDrag:item:]):
(-[WKContentView computeClientAndGlobalPointsForDropSession:outClientPoint:outGlobalPoint:]):
(-[WKContentView _dragInteraction:prepareForSession:completion:]):
(-[WKContentView _api_dropInteraction:sessionDidEnter:]):
(-[WKContentView _api_dropInteraction:sessionDidUpdate:]):
(positionInformationMayStartDataInteraction): Deleted.

Tools:

Adds a new test to check that an image can be dragged out of a contenteditable and dropped.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2Cocoa/contenteditable-and-target.html: Added.
* TestWebKitAPI/Tests/ios/DataInteractionTests.mm:
(TestWebKitAPI::TEST):

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

2 years agoMarked http/tests/loading/resourceLoadStatistics/telemetry-generation.html as flaky.
jlewis3@apple.com [Tue, 27 Jun 2017 23:55:27 +0000 (23:55 +0000)]
Marked http/tests/loading/resourceLoadStatistics/telemetry-generation.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=173499

Unreviewed test gardening.

* platform/wk2/TestExpectations:

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

2 years ago[Modern Media Controls] Accessibility labels should be formatted using NSDateComponen...
commit-queue@webkit.org [Tue, 27 Jun 2017 23:48:22 +0000 (23:48 +0000)]
[Modern Media Controls] Accessibility labels should be formatted using NSDateComponentsFormatter
https://bugs.webkit.org/show_bug.cgi?id=173858
<rdar://problem/32643171>

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

Source/WebCore:

We shouldn't be manually trying to create a formatted string for media controls and instead rely
on NSDateComponentsFormatter to perform this task for us. So we remove the ad-hoc code in the JS
media controls code and instead add a new MediaControlsHost method to format durations which calls
into RenderTheme to provide a formatted duration string relevant to the current platform and locale.

* English.lproj/modern-media-controls-localized-strings.js:
* Modules/mediacontrols/MediaControlsHost.cpp:
(WebCore::MediaControlsHost::formattedStringForDuration):
* Modules/mediacontrols/MediaControlsHost.h:
* Modules/mediacontrols/MediaControlsHost.idl:
* Modules/modern-media-controls/controls/slider.js:
(Slider.prototype.set inputAccessibleLabel):
* Modules/modern-media-controls/controls/time-label.js:
(TimeLabel.prototype.commitProperty):
* Modules/modern-media-controls/main.js:
(createControls):
(formattedStringForDuration):
(formatTimeToString): Deleted.
* rendering/RenderTheme.h:
(WebCore::RenderTheme::mediaControlsFormattedStringForDuration):
* rendering/RenderThemeCocoa.h:
* rendering/RenderThemeCocoa.mm:
(WebCore::RenderThemeCocoa::mediaControlsFormattedStringForDuration):

LayoutTests:

* media/modern-media-controls/scrubber/scrubber-has-correct-ax-label-expected.txt:
* media/modern-media-controls/scrubber/scrubber-has-correct-ax-label.html:

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

2 years agor218647 causes getUserMedia to fail on some machines
eric.carlson@apple.com [Tue, 27 Jun 2017 23:40:07 +0000 (23:40 +0000)]
r218647 causes getUserMedia to fail on some machines
https://bugs.webkit.org/show_bug.cgi?id=173894

Reviewed by Youenn Fablet.

* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::isFrameRateSupported): Change frame rate epsilon from 0.00001
to 0.001.

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

2 years agoPlacard icons act like buttons (can get keyboard focus and shows up in VoiceOver)
commit-queue@webkit.org [Tue, 27 Jun 2017 23:29:22 +0000 (23:29 +0000)]
Placard icons act like buttons (can get keyboard focus and shows up in VoiceOver)
https://bugs.webkit.org/show_bug.cgi?id=173891
<rdar://problem/33011855>

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

Source/WebCore:

Ensure that we disable buttons inside placards as they're only decorative and should
not be interactive.

* Modules/modern-media-controls/controls/placard.js:
(Placard.):

LayoutTests:

Update the Placard test to check that its <button> is disabled.

* media/modern-media-controls/placard/placard-expected.txt:
* media/modern-media-controls/placard/placard.html:

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

2 years agoUpdate boringssl to c8ff30cbe716c72279a6f6a9d7d7d0d4091220fa
achristensen@apple.com [Tue, 27 Jun 2017 23:05:07 +0000 (23:05 +0000)]
Update boringssl to c8ff30cbe716c72279a6f6a9d7d7d0d4091220fa
https://bugs.webkit.org/show_bug.cgi?id=173676

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

* Configurations/boringssl.xcconfig: Enabling ASM.
* Source/third_party/boringssl/BUILD.generated.gni:
* Source/third_party/boringssl: Updated folder according new revision.
* WebKit/patch-boringssl: Added, needed to fix some files to disable warnings.
* libwebrtc.xcodeproj/project.pbxproj:

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

2 years agoRefresh usrsctp to Source/ThirdParty/libwebrtc/WebKit/patch-usrsctp and libsrtp to...
achristensen@apple.com [Tue, 27 Jun 2017 22:54:19 +0000 (22:54 +0000)]
Refresh usrsctp to Source/ThirdParty/libwebrtc/WebKit/patch-usrsctp and libsrtp to ccf84786f8ef803cb9c75e919e5a3976b9f5a67
https://bugs.webkit.org/show_bug.cgi?id=173673

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

* Source/third_party/libsrtp/README.chromium:
* Source/third_party/libsrtp/srtp/srtp.c:
(srtp_stream_init_keys):
(srtp_calc_aead_iv_srtcp):
(srtp_protect_rtcp_aead):
(srtp_unprotect_rtcp_aead):
* Source/third_party/libsrtp/test/srtp_driver.c:
(srtp_validate_encrypted_extensions_headers_gcm):
* Source/third_party/usrsctp/usrsctplib/.gitignore: Added.
* Source/third_party/usrsctp/usrsctplib/CMakeLists.txt:
* Source/third_party/usrsctp/usrsctplib/Makefile.am:
* Source/third_party/usrsctp/usrsctplib/README.md:
* Source/third_party/usrsctp/usrsctplib/configure.ac:
* Source/third_party/usrsctp/usrsctplib/programs/CMakeLists.txt:
* Source/third_party/usrsctp/usrsctplib/programs/Makefile.am:
* Source/third_party/usrsctp/usrsctplib/programs/client.c:
(main):
* Source/third_party/usrsctp/usrsctplib/programs/datachan_serv.c:
(main):
* Source/third_party/usrsctp/usrsctplib/programs/ekr_loop_offload.c: Added.
(handle_packets):
* Source/third_party/usrsctp/usrsctplib/programs/test_timer.c: Added.
(main):
* Source/third_party/usrsctp/usrsctplib/usrsctp.pc.in: Added.
* Source/third_party/usrsctp/usrsctplib/usrsctplib/CMakeLists.txt:
* Source/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_asconf.c:
* Source/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_asconf.h:
* Source/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_auth.c:
* Source/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_auth.h:
* Source/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_bsd_addr.c:
* Source/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_bsd_addr.h:
* Source/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_cc_functions.c:
(sctp_cwnd_update_after_fr):
(sctp_hs_cwnd_update_after_fr):
(sctp_htcp_cwnd_update_after_fr):
* Source/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_constants.h:
* Source/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_crc32.c:
* Source/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_crc32.h:
* Source/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_header.h:
* Source/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_indata.c:
(sctp_build_readq_entry):
(sctp_place_control_in_stream):
(sctp_abort_in_reasm):
(sctp_queue_data_to_stream):
(sctp_build_readq_entry_from_ctl):
(sctp_handle_old_unordered_data):
(sctp_inject_old_unordered_data):
(sctp_deliver_reasm_check):
(sctp_add_chk_to_control):
(sctp_queue_data_for_reasm):
(sctp_find_reasm_entry):
(sctp_process_a_data_chunk):
(sctp_sack_check):
(sctp_process_segment_range):
(sctp_check_for_revoked):
* Source/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_indata.h:
* Source/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_input.c:
(sctp_process_init):
(sctp_process_cookie_existing):
* Source/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_input.h:
* Source/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_output.c:
* Source/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_output.h:
* Source/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_pcb.c:
* Source/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_pcb.h:
* Source/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_peeloff.h:
* Source/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_ss_functions.c:
(sctp_ss_rr_add):
(sctp_ss_fcfs_select):
* Source/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_structs.h:
* Source/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_sysctl.c:
* Source/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_timer.c:
(sctp_recover_sent_list):
* Source/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_uio.h:
* Source/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_usrreq.c:
(sctp_init):
(sctp_pathmtu_adjustment):
* Source/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_var.h:
* Source/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctputil.c:
(sctp_log_strm_del):
(sctp_init_asoc):
(sctp_notify_send_failed):
(sctp_notify_send_failed2):
* Source/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctputil.h:
* Source/third_party/usrsctp/usrsctplib/usrsctplib/netinet6/sctp6_usrreq.c:
* Source/third_party/usrsctp/usrsctplib/usrsctplib/netinet6/sctp6_var.h:
* Source/third_party/usrsctp/usrsctplib/usrsctplib/user_mbuf.c:
(m_get):
(mbuf_initialize):
* Source/third_party/usrsctp/usrsctplib/usrsctplib/user_mbuf.h:
* Source/third_party/usrsctp/usrsctplib/usrsctplib/user_socket.c:
* Source/third_party/usrsctp/usrsctplib/usrsctplib/usrsctp.h:
* WebKit/patch-usrsctp: Added.

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

2 years agoRemove an inaccurate comment inside DFGClobberize.h
sbarati@apple.com [Tue, 27 Jun 2017 22:43:20 +0000 (22:43 +0000)]
Remove an inaccurate comment inside DFGClobberize.h
https://bugs.webkit.org/show_bug.cgi?id=163874

Reviewed by Filip Pizlo.

The comment said that Clobberize may or may not be sound if run prior to
doing type inference. This is not correct, though. Clobberize *must* be sound
prior do doing type inference since we use it inside the BytecodeParser, which
is the very first thing the DFG does.

* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):

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

2 years agoDisable m_temporarilyAllowingInlinePlaybackAfterFullscreen on pause
commit-queue@webkit.org [Tue, 27 Jun 2017 22:39:21 +0000 (22:39 +0000)]
Disable m_temporarilyAllowingInlinePlaybackAfterFullscreen on pause
https://bugs.webkit.org/show_bug.cgi?id=173843
rdar://problem/32982431

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

Source/WebCore:

Test: media/media-fullscreen-pause-inline.html

Some pages may not have a fullscreen button, so disabled m_temporarilyAllowingInlinePlaybackAfterFullscreen on pause.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::pause):

LayoutTests:

Some pages may not have a fullscreen button, so disabled m_temporarilyAllowingInlinePlaybackAfterFullscreen on pause.

* media/media-fullscreen-pause-inline-expected.txt: Added.
* media/media-fullscreen-pause-inline.html: Added.
* platform/mac-wk2/TestExpectations:

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

2 years ago[iOS] Avoid taking / releasing process assertions too quickly due to database activity
cdumez@apple.com [Tue, 27 Jun 2017 21:49:04 +0000 (21:49 +0000)]
[iOS] Avoid taking / releasing process assertions too quickly due to database activity
https://bugs.webkit.org/show_bug.cgi?id=173879
<rdar://problem/32412701>

Reviewed by Antti Koivisto.

Source/WebCore:

Add HysteresisActivity to WebSQLiteDatabaseTrackerClient to avoid taking / releasing
process assertion too quickly due to database activity.

* platform/ios/WebSQLiteDatabaseTrackerClient.h:
* platform/ios/WebSQLiteDatabaseTrackerClient.mm:
(WebCore::WebSQLiteDatabaseTrackerClient::WebSQLiteDatabaseTrackerClient):
(WebCore::WebSQLiteDatabaseTrackerClient::willBeginFirstTransaction):
(WebCore::WebSQLiteDatabaseTrackerClient::didFinishLastTransaction):
(WebCore::WebSQLiteDatabaseTrackerClient::hysteresisUpdated):

Source/WebKit2:

Specify an activity name when taking the process assertion to facilitate
debugging in the future. It took me a while to figure out this assertion
was the one that was too aggressive because it was anonymous.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _setUpSQLiteDatabaseTrackerClient]):

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

2 years agoFunction constructor needs to follow the spec and validate parameters and body indepe...
sbarati@apple.com [Tue, 27 Jun 2017 21:37:46 +0000 (21:37 +0000)]
Function constructor needs to follow the spec and validate parameters and body independently
https://bugs.webkit.org/show_bug.cgi?id=173303
<rdar://problem/32732526>

Reviewed by Keith Miller.

JSTests:

* ChakraCore/test/Function/FuncBodyES5.baseline-jsc:
* stress/function-constructor-semantics.js: Added.
(assert):
(hasSyntaxError):
(foo):
(async.foo):
(testError):
(testOK.toString):
(toString):

LayoutTests/imported/w3c:

* web-platform-tests/html/webappapis/scripting/events/inline-event-handler-ordering-expected.txt:
* web-platform-tests/html/webappapis/scripting/events/invalid-uncompiled-raw-handler-compiled-late-expected.txt:
* web-platform-tests/html/webappapis/scripting/processing-model-2/compile-error-in-attribute-expected.txt:
* web-platform-tests/html/webappapis/scripting/processing-model-2/compile-error-in-body-onerror-expected.txt:

Source/JavaScriptCore:

The Function constructor must check the arguments and body strings
independently for syntax errors. People rely on this specified behavior
to verify that a particular string is a valid function body. We used
to check these things strings concatenated together, instead of
independently. For example, this used to be valid: `Function("/*", "*/){")`.
However, we should throw a syntax error here since "(/*)" is not a valid
parameter list, and "*/){" is not a valid body.

To implement the specified behavior, we check the syntax independently of
both the body and the parameter list. To check that the parameter list has
valid syntax, we check that it is valid if in a function with an empty body.
To check that the body has valid syntax, we check it is valid in a function
with an empty parameter list.

* runtime/FunctionConstructor.cpp:
(JSC::constructFunctionSkippingEvalEnabledCheck):

LayoutTests:

* fast/dom/attribute-event-listener-errors-expected.txt:
* fast/events/attribute-listener-deletion-crash-expected.txt:
* fast/events/window-onerror-syntax-error-in-attr-expected.txt:
* js/dom/invalid-syntax-for-function-expected.txt:

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

2 years agoUsing public logging for WebRTC release logging
commit-queue@webkit.org [Tue, 27 Jun 2017 21:35:25 +0000 (21:35 +0000)]
Using public logging for WebRTC release logging
https://bugs.webkit.org/show_bug.cgi?id=173881

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

No change of behavior.

* Modules/mediastream/PeerConnectionBackend.cpp:
(WebCore::PeerConnectionBackend::createOfferSucceeded):
(WebCore::PeerConnectionBackend::createOfferFailed):
(WebCore::PeerConnectionBackend::createAnswerSucceeded):
(WebCore::PeerConnectionBackend::createAnswerFailed):
(WebCore::PeerConnectionBackend::setLocalDescriptionFailed):
(WebCore::PeerConnectionBackend::setRemoteDescriptionFailed):
(WebCore::PeerConnectionBackend::addIceCandidateFailed):
(WebCore::PeerConnectionBackend::newICECandidate):
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::queuedSetLocalDescription):
(WebCore::RTCPeerConnection::queuedSetRemoteDescription):
(WebCore::RTCPeerConnection::queuedAddIceCandidate):
(WebCore::RTCPeerConnection::updateIceGatheringState):
(WebCore::RTCPeerConnection::updateIceConnectionState):
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::OnStatsDelivered):

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

2 years ago[PAL] Add symbol export macros for PAL
don.olmstead@sony.com [Tue, 27 Jun 2017 21:30:01 +0000 (21:30 +0000)]
[PAL] Add symbol export macros for PAL
https://bugs.webkit.org/show_bug.cgi?id=171519

Reviewed by Konstantin Tokarev.

Source/WebCore:

No new tests. No change in behavior.

* CMakeLists.txt:
* config.h:
* platform/PlatformExportMacros.h:

Source/WebCore/PAL:

No new tests. No change in behavior.

* Configurations/CopyPALHeaders.xcconfig: Added.
* PAL.xcodeproj/project.pbxproj:
* config.h:
* pal/ExportMacros.h: Copied from Source/WebCore/platform/PlatformExportMacros.h.
* pal/PlatformWin.cmake:
* pal/crypto/CryptoDigest.h:

Source/WebKit2:

* config.h:

Tools:

* DumpRenderTree/config.h:
* TestWebKitAPI/CMakeLists.txt:
* TestWebKitAPI/config.h:
* WebKitTestRunner/config.h:

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

2 years agoProcessLauncherMac could leak a xpc connection when the process had failed to launch
rniwa@webkit.org [Tue, 27 Jun 2017 21:23:22 +0000 (21:23 +0000)]
ProcessLauncherMac could leak a xpc connection when the process had failed to launch
https://bugs.webkit.org/show_bug.cgi?id=173865

Reviewed by Antti Koivisto.

Explicitly cancel the XPC connection even When the process launch had failed to avoid a leak.

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

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

2 years agoResource Load Statistics: Add telemetry
wilander@apple.com [Tue, 27 Jun 2017 21:10:24 +0000 (21:10 +0000)]
Resource Load Statistics: Add telemetry
https://bugs.webkit.org/show_bug.cgi?id=173499
<rdar://problem/32826094>

Reviewed by Brent Fulgham.

Source/WebCore:

Test: http/tests/loading/resourceLoadStatistics/telemetry-generation.html

* loader/ResourceLoadObserver.cpp:
(WebCore::ResourceLoadObserver::fireTelemetryHandler):
    Test infrastructure.
* loader/ResourceLoadObserver.h:
* loader/ResourceLoadStatisticsStore.cpp:
(WebCore::ResourceLoadStatisticsStore::setFireTelemetryCallback):
(WebCore::ResourceLoadStatisticsStore::fireTelemetryHandler):
    Test infrastructure.
(WebCore::ResourceLoadStatisticsStore::sortedPrevalentResourceTelemetry):
    Convenience function for telemetry.
* loader/ResourceLoadStatisticsStore.h:
    Added struct WebCore::PrevalentResourceTelemetry.
* page/DiagnosticLoggingKeys.cpp:
(WebCore::DiagnosticLoggingKeys::resourceLoadStatisticsTelemetryKey):
    Added.
* page/DiagnosticLoggingKeys.h:

Source/WebKit2:

* PlatformGTK.cmake:
    Added UIProcess/WebResourceLoadStatisticsTelemetry.cpp
* PlatformMac.cmake:
    Added UIProcess/WebResourceLoadStatisticsTelemetry.cpp
* PlatformWPE.cmake:
    Added UIProcess/WebResourceLoadStatisticsTelemetry.cpp
* UIProcess/API/C/WKResourceLoadStatisticsManager.cpp:
(WKResourceLoadStatisticsManagerFireTelemetryHandler):
(WKResourceLoadStatisticsManagerSetNotifyPagesWhenTelemetryWasCaptured):
    Test infrastructure.
* UIProcess/API/C/WKResourceLoadStatisticsManager.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::notifyPageStatisticsTelemetryFinished):
    Test infrastructure.
* UIProcess/WebProcessProxy.h:
* UIProcess/WebResourceLoadStatisticsManager.cpp:
(WebKit::WebResourceLoadStatisticsManager::fireTelemetryHandler):
(WebKit::WebResourceLoadStatisticsManager::setNotifyPagesWhenTelemetryWasCaptured):
(WebKit::WebResourceLoadStatisticsManager::resetToConsistentState):
    Test infrastructure.
* UIProcess/WebResourceLoadStatisticsManager.h:
* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
    Configures a timer for telemetry capture. Fires 5 seconds after launch
    and then every 24 hours.
(WebKit::WebResourceLoadStatisticsStore::setNotifyPagesWhenDataRecordsWereScanned):
    Variable renamed notifyPages -> notifyPagesWhenDataRecordsWereScanned.
(WebKit::WebResourceLoadStatisticsStore::removeDataRecords):
    Variable renamed notifyPages -> notifyPagesWhenDataRecordsWereScanned.
(WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords):
    Variable renamed notifyPages -> notifyPagesWhenDataRecordsWereScanned.
(WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver):
    Variable renamed notifyPages -> notifyPagesWhenDataRecordsWereScanned.
(WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData):
    Variable renamed notifyPages -> notifyPagesWhenDataRecordsWereScanned.
(WebKit::WebResourceLoadStatisticsStore::telemetryTimerFired):
     Calls WebResourceLoadStatisticsTelemetry::calculateAndSubmit().
* UIProcess/WebResourceLoadStatisticsStore.h:
* UIProcess/WebResourceLoadStatisticsTelemetry.cpp: Added.
(WebKit::numberOfResourcesWithUserInteraction):
(WebKit::median):
(WebKit::nonEphemeralWebPageProxy):
(WebKit::submitTopList):
(WebKit::submitTopLists):
(WebKit::notifyPages):
(WebKit::WebResourceLoadStatisticsTelemetry::calculateAndSubmit):
(WebKit::WebResourceLoadStatisticsTelemetry::setNotifyPagesWhenTelemetryWasCaptured):
* UIProcess/WebResourceLoadStatisticsTelemetry.h: Added.
* WebKit2.xcodeproj/project.pbxproj:

Tools:

Adds three new testRunner functions:
- installStatisticsDidRunTelemetryCallback()
- statisticsFireTelemetryHandler()
- setStatisticsNotifyPagesWhenTelemetryWasCaptured()

* WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
* WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::InjectedBundle::didReceiveMessageToPage):
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::installStatisticsDidRunTelemetryCallback):
(WTR::TestRunner::statisticsDidRunTelemetryCallback):
(WTR::TestRunner::statisticsFireTelemetryHandler):
(WTR::TestRunner::setStatisticsNotifyPagesWhenTelemetryWasCaptured):
* WebKitTestRunner/InjectedBundle/TestRunner.h:
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetStateToConsistentValues):
(WTR::TestController::statisticsFireTelemetryHandler):
(WTR::TestController::setStatisticsNotifyPagesWhenTelemetryWasCaptured):
* WebKitTestRunner/TestController.h:
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle):

LayoutTests:

* http/tests/loading/resourceLoadStatistics/telemetry-generation-expected.txt: Added.
* http/tests/loading/resourceLoadStatistics/telemetry-generation.html: Added.
* platform/wk2/TestExpectations:
    Enabled here since ResourceLoadStatistics is WK2-only.

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

2 years agoAdd missing includes to fix compilation error on FreeBSD
commit-queue@webkit.org [Tue, 27 Jun 2017 21:06:04 +0000 (21:06 +0000)]
Add missing includes to fix compilation error on FreeBSD
https://bugs.webkit.org/show_bug.cgi?id=172919

Patch by Ting-Wei Lan <lantw44@gmail.com> on 2017-06-27
Reviewed by Mark Lam.

Source/JavaScriptCore:

* API/JSRemoteInspector.h:
* API/tests/GlobalContextWithFinalizerTest.cpp:
* API/tests/TypedArrayCTest.cpp:

Source/WebCore:

No new tests needed.

* crypto/gcrypt/CryptoKeyECGCrypt.cpp:
* platform/audio/ReverbAccumulationBuffer.cpp:

Source/WebKit2:

* UIProcess/API/C/WKContextPrivate.h:
* UIProcess/API/C/WKPagePrivate.h:
* UIProcess/ProcessAssertion.h:

Tools:

* ImageDiff/cairo/PlatformImageCairo.cpp:

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

2 years agoWeb Inspector: no discoverable way to dismiss the split console
mattbaker@apple.com [Tue, 27 Jun 2017 21:01:54 +0000 (21:01 +0000)]
Web Inspector: no discoverable way to dismiss the split console
https://bugs.webkit.org/show_bug.cgi?id=167034
<rdar://problem/30023436>

Reviewed by Devin Rousso.

This patch adds an Xcode-style toggle button to the left of the
split console navigation bar. Additionally, the split console code
has been broken out into it's own class to reduce the clutter in
Main.js/css, and simplify future console maintenance.

* Localizations/en.lproj/localizedStrings.js:

* UserInterface/Base/Main.js:
(WebInspector.loaded):
Replace the "split" ContentBrowser with a new ConsoleDrawer class,
which encapsulates the drawer height setting and resize behavior.
(WebInspector.contentLoaded):
The console drawer manages its own height.

* UserInterface/Images/HideConsoleDrawer.svg: Added.
* UserInterface/Images/ShowConsoleDrawer.svg: Added.
Console drawer toggle button images. Styled after corresponding Xcode button.

* UserInterface/Main.html:

* UserInterface/Views/ConsoleDrawer.css: Added.
Moved old #split-content-browser styles over from Main.css.
(.console-drawer):
(.console-drawer > .navigation-bar):
(.console-drawer > .navigation-bar > .item.button:not(.clear-log)):
Make button spacing less cramped.
(.console-drawer > .navigation-bar > .item:not(.flexible-space)):
(.console-drawer > .navigation-bar > :matches(.item.button, .log-scope-bar)):
(.console-drawer > .navigation-bar > .item > .glyph,):

* UserInterface/Views/ConsoleDrawer.js: Added.
New class responsible for console drawer expand / collapse and resizer
dragging, which was previously part of Main.js. The console drawer toolbar
now has a toggle button, debugging controls, and a call frames path item.
The "Show Console Tab" button has been removed.

(WebInspector.ConsoleDrawer):
(WebInspector.ConsoleDrawer.prototype.get collapsed):
(WebInspector.ConsoleDrawer.prototype.set collapsed):
(WebInspector.ConsoleDrawer.prototype.get height):
(WebInspector.ConsoleDrawer.prototype.shown):
(WebInspector.ConsoleDrawer.prototype.layout):
(WebInspector.ConsoleDrawer.prototype._consoleResizerMouseDown.dockedResizerDrag):
(WebInspector.ConsoleDrawer.prototype._consoleResizerMouseDown.dockedResizerDragEnd):
(WebInspector.ConsoleDrawer.prototype._consoleResizerMouseDown):
(WebInspector.ConsoleDrawer.prototype._restoreDrawerHeight):
(WebInspector.ConsoleDrawer.prototype._updateDrawerHeight):
(WebInspector.ConsoleDrawer.prototype._selectedTabContentViewDidChange):
When switching to a tab that doesn't support showing the console drawer,
hide it without altering the collapsed state.

* UserInterface/Views/LogContentView.js:
(WebInspector.LogContentView.prototype.get navigationItems):

* UserInterface/Views/Main.css:
Renamed #split-content-browser to #console-drawer, and moved related
styles to ConsoleDrawer.css.

(#split-content-browser): Deleted.
(#split-content-browser > .navigation-bar): Deleted.
(#split-content-browser > .navigation-bar :matches(.find-banner, .find-banner + .divider)): Deleted.
(#split-content-browser > .navigation-bar .item): Deleted.
(#split-content-browser > .navigation-bar .item:not(.flexible-space)): Deleted.
(#split-content-browser .hierarchical-path-component.log-icon .icon): Deleted.
(#split-content-browser .hierarchical-path-component.log-icon .title): Deleted.
(#split-content-browser .hierarchical-path-component.log-icon select): Deleted.
(#split-content-browser > .navigation-bar > :matches(.hierarchical-path, .log-scope-bar)): Deleted.
(#split-content-browser > .navigation-bar > .log-scope-bar > li): Deleted.

* UserInterface/Views/QuickConsole.js:
(WebInspector.QuickConsole):
(WebInspector.QuickConsole.prototype._toggleOrFocus):
(WebInspector.QuickConsole.prototype._updateStyles):
Update top border style in response to change in selected TabBrowser
tab or the console drawer collapsed state.

(WebInspector.QuickConsole.prototype.consoleLogVisibilityChanged): Deleted.
(WebInspector.QuickConsole.prototype.set keyboardShortcutDisabled): Deleted.

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

2 years agoAdd RenderEmbeddedObject::getReplacementTextGeometry helper.
zalan@apple.com [Tue, 27 Jun 2017 19:52:00 +0000 (19:52 +0000)]
Add RenderEmbeddedObject::getReplacementTextGeometry helper.
https://bugs.webkit.org/show_bug.cgi?id=173847

Reviewed by Simon Fraser.

...and remove getReplacementTextGeometry's redundant return value.

No change in functionality.

* rendering/RenderEmbeddedObject.cpp:
(WebCore::RenderEmbeddedObject::paintReplaced):
(WebCore::RenderEmbeddedObject::getReplacementTextGeometry):
(WebCore::RenderEmbeddedObject::unavailablePluginIndicatorBounds):
(WebCore::RenderEmbeddedObject::isInUnavailablePluginIndicator):
* rendering/RenderEmbeddedObject.h:

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

2 years agoRefactor drag start codepaths to plumb a DragItem to client layers
wenson_hsieh@apple.com [Tue, 27 Jun 2017 19:11:34 +0000 (19:11 +0000)]
Refactor drag start codepaths to plumb a DragItem to client layers
https://bugs.webkit.org/show_bug.cgi?id=173832
Work towards <rdar://problem/32236827>

Reviewed by Ryosuke Niwa and Tim Horton.

Source/WebCore:

Refactor drag start logic in WebCore to set up a DragItem and propagate it to WebDragClient. No change in behavior.

* loader/EmptyClients.cpp:
* page/DragClient.h:
* page/DragController.cpp:
(WebCore::DragController::startDrag):
(WebCore::DragController::doImageDrag):
(WebCore::DragController::doSystemDrag):

Refactor to pass along a DragItem. Also, remove unused drag image anchor computation.

* page/DragController.h:
* platform/DragImage.h:
* platform/DragItem.h:

Add additional information needed to begin a drag on iOS.

(WebCore::DragItem::encode):
(WebCore::DragItem::decode):

Add IPC serialization/deserialization support for DragItem.

* platform/PasteboardWriterData.cpp:
(WebCore::PasteboardWriterData::isEmpty):
* platform/PasteboardWriterData.h:

Source/WebKit/mac:

Refactor code used to start a drag in WebKit1 to plumb a single DragItem from DragController to the client layer
in WebDragClient that contains all the information needed to begin a drag. Also renames _setDataInteractionData:
to _startDrag: to match logic used to start a drag on other platforms.

No behavior change -- the same information should be propagated to AppKit and UIKit when beginning a drag, only
through the DragItem struct.

* WebCoreSupport/WebDragClient.h:
* WebCoreSupport/WebDragClient.mm:
(WebDragClient::startDrag):
(WebDragClient::dragSourceActionMaskForPoint):
(WebDragClient::willPerformDragSourceAction):
(WebDragClient::beginDrag):
* WebView/WebView.mm:
(-[WebView _startDrag:]):
(-[WebView _setDataInteractionData:textIndicator:atClientPosition:anchorPoint:action:]): Deleted.
* WebView/WebViewInternal.h:

Source/WebKit/win:

Adjust for changes to WebDragClient::startDrag by pulling information out of DragItem.

* WebCoreSupport/WebDragClient.cpp:
(WebDragClient::startDrag):
* WebCoreSupport/WebDragClient.h:

Source/WebKit2:

Add support for serializing a DragItem over IPC. This encodes and decodes all members of DragItem except for the
PasteboardWriterData and the DragImage's image. The DragItem is sent over to the UI process in
WebDragClient::startDrag via the WebPageProxy::startDrag IPC message (renamed from WebPageProxy::setDragImage)
which now takes a DragItem.

* UIProcess/Cocoa/WebPageProxyCocoa.mm:
(WebKit::WebPageProxy::startDrag):
(WebKit::WebPageProxy::setDragImage): Deleted.
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:

Rename SetDragImage to StartDrag and refactor to receive only a DragItem and shareable bitmap handle.

* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::startDrag):
(WebKit::PageClientImpl::startDataInteractionWithImage): Deleted.
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _startDrag:item:]):
(-[WKContentView _startDataInteractionWithImage:withIndicatorData:atClientPosition:anchorPoint:action:]): Deleted.

Rename startDataInteractionWithImage to startDrag.

* UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::startDrag):
(WebKit::WebPageProxy::setDragImage): Deleted.
* WebProcess/WebCoreSupport/WebDragClient.cpp:
(WebKit::WebDragClient::startDrag):
* WebProcess/WebCoreSupport/WebDragClient.h:
* WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp:
(WebKit::WebDragClient::startDrag):
* WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
(WebKit::WebDragClient::startDrag):

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

2 years agoWeb Inspector: Crash generating object preview for ArrayIterator
joepeck@webkit.org [Tue, 27 Jun 2017 17:43:03 +0000 (17:43 +0000)]
Web Inspector: Crash generating object preview for ArrayIterator
https://bugs.webkit.org/show_bug.cgi?id=173754
<rdar://problem/32859012>

Reviewed by Saam Barati.

Source/JavaScriptCore:

When Inspector generates an object preview for an ArrayIterator instance it made
a "clone" of the original ArrayIterator instance by constructing a new object with
the instance's structure. However, user code could have modified that instance's
structure, such as adding / removing properties. The `return` property had special
meaning, and our clone did not fill that slot. This approach is brittle in that
we weren't satisfying the expectations of an object with a particular Structure,
and the original goal of having Web Inspector peek values of built-in Iterators
was to avoid observable behavior.

This tightens Web Inspector's Iterator preview to only peek values if the
Iterators would actually be non-observable. It also builds an ArrayIterator
clone like a regular object construction.

* inspector/JSInjectedScriptHost.cpp:
(Inspector::cloneArrayIteratorObject):
Build up the Object from scratch with a new ArrayIterator prototype.

(Inspector::JSInjectedScriptHost::iteratorEntries):
Only clone and peek iterators if it would not be observable.
Also update iteration to be more in line with IterationOperations, such as when
we call iteratorClose.

* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::JSGlobalObject):
(JSC::JSGlobalObject::init):
* runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::stringIteratorProtocolWatchpoint):
* runtime/JSGlobalObjectInlines.h:
(JSC::JSGlobalObject::isStringPrototypeIteratorProtocolFastAndNonObservable):
Add a StringIterator WatchPoint in line with the Array/Map/Set iterator watchpoints.

* runtime/JSMap.cpp:
(JSC::JSMap::isIteratorProtocolFastAndNonObservable):
(JSC::JSMap::canCloneFastAndNonObservable):
* runtime/JSMap.h:
* runtime/JSSet.cpp:
(JSC::JSSet::isIteratorProtocolFastAndNonObservable):
(JSC::JSSet::canCloneFastAndNonObservable):
* runtime/JSSet.h:
Promote isIteratorProtocolFastAndNonObservable to a method.

* runtime/JSObject.cpp:
(JSC::canDoFastPutDirectIndex):
* runtime/JSTypeInfo.h:
(JSC::TypeInfo::isArgumentsType):
Helper to detect if an Object is an Arguments type.

LayoutTests:

* platform/mac/inspector/model/remote-object-expected.txt:
* inspector/model/remote-object-expected.txt:
* inspector/model/remote-object.html:
Test generating a preview for an ArrayIterator that has had a `return` property added to it.

* inspector/model/remote-object-mutated-iterators-expected.txt: Added.
* inspector/model/remote-object-mutated-iterators.html: Added.
Test generating a preview for different iterators after the IteratorPrototypes have been mutated.

* inspector/model/resources/remote-object-utilities.js: Added.
(runInBrowserTest):
(TestPage.registerInitializer):
(TestPage.registerInitializer.checkComplete):
(TestPage.registerInitializer.window.runSteps):
Share code for remote-object dump tests.

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

2 years agoSome tests to verify forbidden frame navigation time out
fred.wang@free.fr [Tue, 27 Jun 2017 15:59:48 +0000 (15:59 +0000)]
Some tests to verify forbidden frame navigation time out
https://bugs.webkit.org/show_bug.cgi?id=173657

Patch by Frederic Wang <fwang@igalia.com> on 2017-06-27
Reviewed by Chris Dumez.

LayoutTests/imported/w3c:

* web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_allow_top_navigation-2-expected.txt: Update the text expectation to PASS.
* web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_allow_top_navigation_by_user_activation_without_user_gesture-expected.txt: Ditto.
* web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_navigate_ancestor-1-expected.txt: Ditto.
* web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-3-expected.txt: Add the security error until bug 173162 is fixed.
* web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping-3-expected.txt: Ditto.

Source/WebCore:

Currently some tests try and perform a forbidden frame navigation and verify the
corresponding console error. However, WebKit does not raise any exception for such error so
the tests have to wait until the timeout limit to complete, which makes execution slow.
This patch modifies the setters of window.location for which such error may happen in order
to raise an exception so the tests behave as expected.

No new tests, already covered by existing tests.

* page/Location.cpp: Adjust Location::setLocation to return a security exception and pass it
to the callers.
(WebCore::Location::setHref): Adjust function to possibly return an exception.
(WebCore::Location::setProtocol): Ditto.
(WebCore::Location::setHost): Ditto.
(WebCore::Location::setHostname): Ditto.
(WebCore::Location::setPort): Ditto.
(WebCore::Location::setPathname): Ditto.
(WebCore::Location::setSearch): Ditto.
(WebCore::Location::setHash): Ditto.
(WebCore::Location::assign): Ditto.
(WebCore::Location::setLocation): FrameLoader::findFrameForNavigation is really only used
to verify whether navigating m_frame is permitted so it is more simple and clearer to do it
directly. When navigation is not permitted, this function now raises a security exception.
* page/Location.h: Modify some setters to return an ExceptionOr<void>.
* page/Location.idl: Allow some setters to raise an exception.

LayoutTests:

* fast/frames/sandboxed-iframe-navigation-top-denied-expected.txt: Add the security error.
* http/tests/security/frameNavigation/inactive-function-in-popup-navigate-child.html: Adjust
the test to catch and dump the exception and complete immediately.
* http/tests/security/frameNavigation/inactive-function-in-popup-navigate-child-expected.txt:
Add the dumped security error exception.

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

2 years ago[iOS DnD] [WK2] WKWebView does not handle drag sessions that exit and re-enter
wenson_hsieh@apple.com [Tue, 27 Jun 2017 14:49:20 +0000 (14:49 +0000)]
[iOS DnD] [WK2] WKWebView does not handle drag sessions that exit and re-enter
https://bugs.webkit.org/show_bug.cgi?id=173856
<rdar://problem/32957100>

Reviewed by Ryosuke Niwa.

Upon exiting a WKContentView, the dropSession tracked by _dataInteractionState is not cleared out. If the drag
session re-enters the WKWebView, a _different_ UIDropSession is sent to the drop delegate, causing us to bail
from handling the session altogether in -dropInteraction:canHandleSession:. To fix this, we need to clear out
the dropSession when the drag session exits the view.

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

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

2 years agoLayoutTest webrtc/datachannel/multiple-connections.html is a flaky timeout
commit-queue@webkit.org [Tue, 27 Jun 2017 14:47:29 +0000 (14:47 +0000)]
LayoutTest webrtc/datachannel/multiple-connections.html is a flaky timeout
https://bugs.webkit.org/show_bug.cgi?id=173853

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

* webrtc/datachannel/multiple-connections.html:

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

2 years ago[GTK] Layout Test webrtc/video.html issues "stack smashing detected"
commit-queue@webkit.org [Tue, 27 Jun 2017 06:41:51 +0000 (06:41 +0000)]
[GTK] Layout Test webrtc/video.html issues "stack smashing detected"
https://bugs.webkit.org/show_bug.cgi?id=173862

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

Tests: webrtc/video.html

Passing a bool variable to g_object_get causes out-of-bound write.
gboolean should be used, which is 4 bytes while bool is one byte.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::muted): Use gboolean instead of bool.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.cpp:
(WebCore::MediaPlayerPrivateGStreamerOwr::trackEnded): Ditto.

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

2 years agoRegExpPrototype.js builtin uses for-of iteration which is almost certainly incorrect
sbarati@apple.com [Tue, 27 Jun 2017 05:49:43 +0000 (05:49 +0000)]
RegExpPrototype.js builtin uses for-of iteration which is almost certainly incorrect
https://bugs.webkit.org/show_bug.cgi?id=173740

Reviewed by Mark Lam.

JSTests:

* stress/regexp-prototype-replace-builtin-should-not-use-for-of.js: Added.
(Array.prototype.Symbol.iterator):

Source/JavaScriptCore:

The builtin was using for-of iteration to iterate over an internal
list in its algorithm. For-of iteration is observable via user code
in the global object, so this approach was wrong as it would break if
a user changed the Array iteration protocol in some way.

* builtins/RegExpPrototype.js:
(replace):

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

2 years agoWebsiteDataStore::fetchDataForTopPrivatelyControlledDomains() is inefficient
cdumez@apple.com [Tue, 27 Jun 2017 03:33:12 +0000 (03:33 +0000)]
WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains() is inefficient
https://bugs.webkit.org/show_bug.cgi?id=173850

Reviewed by Ryosuke Niwa.

Source/WebCore:

* loader/ResourceLoadStatisticsStore.cpp:
(WebCore::ResourceLoadStatisticsStore::updateStatisticsForRemovedDataRecords):
* loader/ResourceLoadStatisticsStore.h:

Source/WebKit2:

Update WebsiteDataRecord::matchesTopPrivatelyControlledDomain() to rely on
SecurityOriginData::host rather than SecurityOriginData::securityOrigin()->host().
SecurityOriginData::securityOrigin() is expensive and it seems unnecessary to call
it here since we already have the host.

Also update WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains() to return
domains as a HashSet rather than a Vector to avoid having duplicate domains.

* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores):
* UIProcess/WebProcessProxy.h:
* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::removeDataRecords):
* UIProcess/WebsiteData/WebsiteDataRecord.cpp:
(WebKit::WebsiteDataRecord::matchesTopPrivatelyControlledDomain):
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains):
(WebKit::WebsiteDataStore::removeDataForTopPrivatelyControlledDomains):
* UIProcess/WebsiteData/WebsiteDataStore.h:

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

2 years agoREGRESSION (AsyncImageDecoding): A tab with the WWDC keynote paused is killed for...
antti@apple.com [Tue, 27 Jun 2017 03:28:00 +0000 (03:28 +0000)]
REGRESSION (AsyncImageDecoding): A tab with the WWDC keynote paused is killed for using excessive power (Image thrashing)
https://bugs.webkit.org/show_bug.cgi?id=173804
<rdar://problem/32623745>

Reviewed by Simon Fraser.

Source/WebCore:

When under memory pressure MemoryCache::singleton().pruneLiveResources(true) is called inFrameView::didPaintContents()
after top level paint. We end up decoding and pruning bitmaps repeatedly for each tile, which is not great.

Situation gets worse with async decoding. Painting now doesn’t actually decode the image, it just starts the decoding.
When it completes we trigger another paint to get the bits to the tiles. The paint for the first tile then calls
pruneLiveResources and loses the bitmap and the second tile triggers another round of async decoding. We have code
that prevents pruning of visible images but non-visible images in tiling area can hit this bug easily.

Test: fast/images/low-memory-decode.html

* page/FrameView.cpp:
(WebCore::FrameView::willPaintContents):
(WebCore::FrameView::didPaintContents):

    Eliminate synchronous pruning during painting. This is an obsolete mechanism from early iOS times.

* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::imageFrameAvailableAtIndex):
(WebCore::BitmapImage::decodeCountForTesting):

    Testing support.

* platform/graphics/BitmapImage.h:
* testing/Internals.cpp:
(WebCore::Internals::imageDecodeCount):
* testing/Internals.h:
* testing/Internals.idl:

LayoutTests:

* fast/images/low-memory-decode-expected.txt: Added.
* fast/images/low-memory-decode.html: Added.

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

2 years agoMarked media/media-source/media-source-paint-to-canvas.html as flaky.
jlewis3@apple.com [Tue, 27 Jun 2017 00:26:27 +0000 (00:26 +0000)]
Marked media/media-source/media-source-paint-to-canvas.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=173565

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

2 years agoMarked animations/play-state-suspend.html as flaky.
jlewis3@apple.com [Mon, 26 Jun 2017 23:47:15 +0000 (23:47 +0000)]
Marked animations/play-state-suspend.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=173726

Unreviewed test gardening.

* platform/ios-wk2/TestExpectations:

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

2 years agoSkip a test on 32-bit platforms since we run out of address space.
sbarati@apple.com [Mon, 26 Jun 2017 23:39:49 +0000 (23:39 +0000)]
Skip a test on 32-bit platforms since we run out of address space.

Rubber stamped by Mark Lam.

* stress/dont-reserve-huge-capacity-lexer.js:

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

2 years agoInvalidate WebVideoFullscreenManager when WebPage is destroyed.
commit-queue@webkit.org [Mon, 26 Jun 2017 22:36:45 +0000 (22:36 +0000)]
Invalidate WebVideoFullscreenManager when WebPage is destroyed.
https://bugs.webkit.org/show_bug.cgi?id=173835
rdar://problem/32969161

Patch by Jeremy Jones <jeremyj@apple.com> on 2017-06-26
Reviewed by Jer Noble.

WebVideoFullscreenManager has a pointer to WebPage, and even null checks it in a few places,
but the only place it is nulled out is in the destructor. This allows a dangling reference.

This changes invalidates that reference when WebPage is destructed and adds nullchecks
or asserts throughout WebVideoFullscreenManager as appropriate.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::~WebPage):
* WebProcess/cocoa/WebVideoFullscreenManager.h:
(WebKit::WebVideoFullscreenManager::invalidate):
* WebProcess/cocoa/WebVideoFullscreenManager.mm:
(WebKit::WebVideoFullscreenManager::~WebVideoFullscreenManager):
(WebKit::WebVideoFullscreenManager::enterVideoFullscreenForVideoElement):
(WebKit::WebVideoFullscreenManager::exitVideoFullscreenForVideoElement):
(WebKit::WebVideoFullscreenManager::exitVideoFullscreenToModeWithoutAnimation):
(WebKit::WebVideoFullscreenManager::hasVideoChanged):
(WebKit::WebVideoFullscreenManager::videoDimensionsChanged):
(WebKit::WebVideoFullscreenManager::didSetupFullscreen):
(WebKit::WebVideoFullscreenManager::didEnterFullscreen):
(WebKit::WebVideoFullscreenManager::didCleanupFullscreen):
(WebKit::WebVideoFullscreenManager::fullscreenMayReturnToInline):

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

2 years agoDisable diagnostic logging in ephemeral sessions
cdumez@apple.com [Mon, 26 Jun 2017 21:09:33 +0000 (21:09 +0000)]
Disable diagnostic logging in ephemeral sessions
https://bugs.webkit.org/show_bug.cgi?id=173849
<rdar://problem/32987341>

Reviewed by Geoffrey Garen.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::setDiagnosticLoggingClient):
Construct a dummy logging client if the page's session is ephemeral.

(WebKit::WebPageProxy::logDiagnosticMessage):
(WebKit::WebPageProxy::logDiagnosticMessageWithResult):
(WebKit::WebPageProxy::logDiagnosticMessageWithValue):
(WebKit::WebPageProxy::logDiagnosticMessageWithEnhancedPrivacy):
Slight cleanup to make the code look a bit safer.

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

2 years agoRenamed DumpRegisterFunctor to DumpReturnVirtualPCFunctor.
mark.lam@apple.com [Mon, 26 Jun 2017 20:17:50 +0000 (20:17 +0000)]
Renamed DumpRegisterFunctor to DumpReturnVirtualPCFunctor.
https://bugs.webkit.org/show_bug.cgi?id=173848

Reviewed by JF Bastien.

This functor only dumps the return VirtualPC.

* interpreter/Interpreter.cpp:
(JSC::DumpReturnVirtualPCFunctor::DumpReturnVirtualPCFunctor):
(JSC::Interpreter::dumpRegisters):
(JSC::DumpRegisterFunctor::DumpRegisterFunctor): Deleted.
(JSC::DumpRegisterFunctor::operator()): Deleted.

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

2 years agoCrash in JSC::Lexer<unsigned char>::setCode
sbarati@apple.com [Mon, 26 Jun 2017 19:34:21 +0000 (19:34 +0000)]
Crash in JSC::Lexer<unsigned char>::setCode
https://bugs.webkit.org/show_bug.cgi?id=172754

Reviewed by Mark Lam.

JSTests:

* stress/dont-reserve-huge-capacity-lexer.js: Added.
(catch):

Source/JavaScriptCore:

The lexer was asking one of its buffers to reserve initial space that
was O(text size in bytes). For large sources, this would end up causing
the vector to overflow and crash. This patch changes this code be like
the Lexer's other buffers and to only reserve a small starting buffer.

* parser/Lexer.cpp:
(JSC::Lexer<T>::setCode):

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

2 years agoImageFrameCache::startAsyncDecodingQueue() unsafely passes Strings across threads
cdumez@apple.com [Mon, 26 Jun 2017 19:13:56 +0000 (19:13 +0000)]
ImageFrameCache::startAsyncDecodingQueue() unsafely passes Strings across threads
https://bugs.webkit.org/show_bug.cgi?id=173842

Reviewed by Simon Fraser.

The URL string was passed across thread without isolated copy.

* platform/graphics/ImageFrameCache.cpp:
(WebCore::ImageFrameCache::startAsyncDecodingQueue):

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

2 years agoUnreviewed, rolling out r218783.
jbedard@apple.com [Mon, 26 Jun 2017 18:51:21 +0000 (18:51 +0000)]
Unreviewed, rolling out r218783.

Causing accessibility/mac/setting-attributes-is-
asynchronous.html to crash consistently on mac-wk2 Debug

Reverted changeset:

"AX: Cannot call setValue() on contenteditable or ARIA text
controls"
https://bugs.webkit.org/show_bug.cgi?id=173520
http://trac.webkit.org/changeset/218783

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

2 years ago[WTF] Drop Thread::create(obsolete things) API since we can use lambda
utatane.tea@gmail.com [Mon, 26 Jun 2017 18:19:36 +0000 (18:19 +0000)]
[WTF] Drop Thread::create(obsolete things) API since we can use lambda
https://bugs.webkit.org/show_bug.cgi?id=173825

Reviewed by Saam Barati.

Source/JavaScriptCore:

* jsc.cpp:
(startTimeoutThreadIfNeeded):
(timeoutThreadMain): Deleted.

Source/WebCore:

No behavior change.

* Modules/indexeddb/server/IDBServer.cpp:
(WebCore::IDBServer::IDBServer::IDBServer):
(WebCore::IDBServer::IDBServer::databaseThreadEntry): Deleted.
* Modules/indexeddb/server/IDBServer.h:
* Modules/webaudio/AsyncAudioDecoder.cpp:
(WebCore::AsyncAudioDecoder::AsyncAudioDecoder):
(WebCore::AsyncAudioDecoder::threadEntry): Deleted.
* Modules/webaudio/AsyncAudioDecoder.h:
* Modules/webaudio/OfflineAudioDestinationNode.cpp:
(WebCore::OfflineAudioDestinationNode::startRendering):
(WebCore::OfflineAudioDestinationNode::offlineRenderEntry): Deleted.
* Modules/webaudio/OfflineAudioDestinationNode.h:
* Modules/webdatabase/DatabaseThread.cpp:
(WebCore::DatabaseThread::start):
(WebCore::DatabaseThread::databaseThreadStart): Deleted.
* Modules/webdatabase/DatabaseThread.h:
* bindings/js/GCController.cpp:
(WebCore::collect):
(WebCore::GCController::gcTimerFired):
(WebCore::GCController::garbageCollectOnAlternateThreadForDebugging):
* loader/icon/IconDatabase.cpp:
(WebCore::IconDatabase::open):
(WebCore::IconDatabase::iconDatabaseSyncThreadStart): Deleted.
* loader/icon/IconDatabase.h:
* page/ResourceUsageThread.cpp:
(WebCore::ResourceUsageThread::createThreadIfNeeded):
(WebCore::ResourceUsageThread::threadCallback): Deleted.
* page/ResourceUsageThread.h:
* page/scrolling/ScrollingThread.cpp:
(WebCore::ScrollingThread::createThreadIfNeeded):
(WebCore::ScrollingThread::threadCallback): Deleted.
(WebCore::ScrollingThread::threadBody): Deleted.
* page/scrolling/ScrollingThread.h:
* platform/audio/HRTFDatabaseLoader.cpp:
(WebCore::HRTFDatabaseLoader::loadAsynchronously):
(WebCore::databaseLoaderEntry): Deleted.
* platform/audio/HRTFDatabaseLoader.h:
* platform/audio/ReverbConvolver.cpp:
(WebCore::ReverbConvolver::ReverbConvolver):
(WebCore::backgroundThreadEntry): Deleted.
* platform/audio/ReverbConvolver.h:
(WebCore::ReverbConvolver::useBackgroundThreads):
* platform/network/cf/LoaderRunLoopCF.cpp:
(WebCore::loaderRunLoop):
(WebCore::runLoaderThread): Deleted.
* platform/network/curl/CurlManager.cpp:
(WebCore::CurlManager::startThreadIfNeeded):
(WebCore::CurlManager::workerThread):
* platform/network/curl/CurlManager.h:
* workers/WorkerThread.cpp:
(WebCore::WorkerThread::start):
(WebCore::WorkerThread::workerThreadStart): Deleted.
* workers/WorkerThread.h:

Source/WebKit:

* Storage/StorageThread.cpp:
(WebCore::StorageThread::start):
(WebCore::StorageThread::threadEntryPointCallback): Deleted.
* Storage/StorageThread.h:

Source/WTF:

Thread::create(ThreadFunction, void* data, const char* name) is a bit old API.
Since we have C++ lambda, the above API is simply unnecessary. And C++ lambda
based one is better since the above API needs casting data to and from void*.

* wtf/Function.h:
Avoid ambiguity.
* wtf/ParallelJobsGeneric.cpp:
(WTF::ParallelEnvironment::ThreadPrivate::tryLockFor):
(WTF::ParallelEnvironment::ThreadPrivate::workerThread): Deleted.
* wtf/ParallelJobsGeneric.h:
* wtf/Threading.cpp:
* wtf/ThreadingWin.cpp:
(WTF::createThread):

Tools:

* DumpRenderTree/JavaScriptThreading.cpp:
(runJavaScriptThread):
(startJavaScriptThreads):
* DumpRenderTree/mac/DumpRenderTree.mm:
(runThread):
(runPthread):
(testThreadIdentifierMap):

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

2 years ago[TestWebKitAPI] Fix false-positive bad release warnings found by clang static analyzer
ddkilzer@apple.com [Mon, 26 Jun 2017 18:02:39 +0000 (18:02 +0000)]
[TestWebKitAPI] Fix false-positive bad release warnings found by clang static analyzer
<https://webkit.org/b/173837>

Reviewed by Geoffrey Garen.

The clang static analyzer can't reason about objects that are
assigned to a delegate as +1 retained, and then released
later in a different method when the delegate is cleared.

Instead, use a common idiom where the object setting the
delegate retains it as an instance variable on initialization.
Then the same object clears the delegate and releases its
instance variable during teardown.

Also add EXPECT_TRUE() tests to make sure the delegate objects
match before teardown.

* TestWebKitAPI/Tests/mac/FullscreenZoomInitialFrame.mm:
(TestWebKitAPI::FullscreenZoomInitialFrame::initializeView):
(TestWebKitAPI::FullscreenZoomInitialFrame::teardownView):
* TestWebKitAPI/Tests/mac/PageVisibilityStateWithWindowChanges.mm:
(TestWebKitAPI::PageVisibilityStateWithWindowChanges::initializeView):
(TestWebKitAPI::PageVisibilityStateWithWindowChanges::teardownView):

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

2 years ago[GCrypt] Properly initialize libgcrypt before using it
zandobersek@gmail.com [Mon, 26 Jun 2017 18:01:22 +0000 (18:01 +0000)]
[GCrypt] Properly initialize libgcrypt before using it
https://bugs.webkit.org/show_bug.cgi?id=173589

Reviewed by Michael Catanzaro.

Initialize libgcrypt in the Unix-specific main() entrypoint. This is early enough
to ensure no other libgcrypt API function is invoked and to also ensure this is
done in a thread-safe manner.

Initialization is initiated through the gcry_check_version() call. 16 kilobytes of
secure memory is pre-allocated before we mark the initialization as complete, as
recommended by the libgcrypt documentation.

* WebProcess/EntryPoint/unix/WebProcessMain.cpp:
(main):

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

2 years agoWhen Mission Control closes fullscreen window, allow media element to update its...
commit-queue@webkit.org [Mon, 26 Jun 2017 18:00:40 +0000 (18:00 +0000)]
When Mission Control closes fullscreen window, allow media element to update its state.
https://bugs.webkit.org/show_bug.cgi?id=173671
rdar://problem/32892671

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

When Mission Control closes element fullscreen without an animation, we need to notify the
media element that fullscreen has exited.

Without this change, the page still behaves like the element is in fullscreen.

* UIProcess/mac/WKFullScreenWindowController.mm:
(-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]):
(-[WKFullScreenWindowController finishedExitFullScreenAnimation:]):

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

2 years ago[iOS DnD] [WK2] Beginning a drag session should prevent clicking via long press
wenson_hsieh@apple.com [Mon, 26 Jun 2017 17:54:38 +0000 (17:54 +0000)]
[iOS DnD] [WK2] Beginning a drag session should prevent clicking via long press
https://bugs.webkit.org/show_bug.cgi?id=173838

Reviewed by Tim Horton.

After r218579, WebKit no longer attempts to replace out-of-the-box UIKit long-press/drag lift disambiguation by
firing events immediately. However, this means that dragging will defer the highlight long press gesture
recognizer until dragging ends rather than cancel it immediately, which causes WKContentView to dispatch a
synthetic click immediately upon lift. To fix this, we should bail out of the highlight long press gesture when
beginning a drag.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _dragInteraction:prepareForSession:completion:]):

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

2 years agoMake webrtc/video-replace-track-to-null.html more robust
commit-queue@webkit.org [Mon, 26 Jun 2017 17:52:46 +0000 (17:52 +0000)]
Make webrtc/video-replace-track-to-null.html more robust
https://bugs.webkit.org/show_bug.cgi?id=173834

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

* webrtc/video-replace-track-to-null.html:

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

2 years ago[TestWebKitAPI] REGRESSION (r218750): Fix leak of NSURLResponse in WKURLSchemeHandler...
ddkilzer@apple.com [Mon, 26 Jun 2017 17:48:36 +0000 (17:48 +0000)]
[TestWebKitAPI] REGRESSION (r218750): Fix leak of NSURLResponse in WKURLSchemeHandler-1.mm
<https://webkit.org/b/173836>

Reviewed by Brady Eidson.

* TestWebKitAPI/Tests/WebKit2Cocoa/WKURLSchemeHandler-1.mm:
(-[RedirectSchemeHandler webView:startURLSchemeTask:]): Use
adoptNS() to fix the leak.  Also use auto/adoptNS() for other
objects in this test.

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

2 years ago[ATK] Add support for aria-details and aria-errormessage
jdiggs@igalia.com [Mon, 26 Jun 2017 16:45:34 +0000 (16:45 +0000)]
[ATK] Add support for aria-details and aria-errormessage
https://bugs.webkit.org/show_bug.cgi?id=172588

Reviewed by Chris Fleizach.

Source/WebCore:

Add methods to retrieve elements referenced by or referencing the new
aria-details and aria-errormessage attributes. Include aria-details and
aria-errormessage in AccessibilityObject::supportsARIAAttributes() to ensure
elements with these attributes will be included in the accessibility tree.

New test cases added to accessibility/gtk/relation-types.html.

* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::supportsARIAAttributes):
(WebCore::AccessibilityObject::ariaDetailsElements):
(WebCore::AccessibilityObject::ariaDetailsReferencingElements):
(WebCore::AccessibilityObject::ariaErrorMessageElements):
(WebCore::AccessibilityObject::ariaErrorMessageReferencingElements):
* accessibility/AccessibilityObject.h:
* accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
(setAtkRelationSetFromCoreObject):
* html/HTMLAttributeNames.in:

Tools:

Add additional methods to test ARIA properties which are exposed via
AtkRelation. Also bump minimum versions of at-spi2-core and at-spi2-atk
to versions which support the details and error-message relation types.

* WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h:
(WTR::AccessibilityUIElement::ariaDetailsElementAtIndex):
(WTR::AccessibilityUIElement::ariaDetailsReferencingElementAtIndex):
(WTR::AccessibilityUIElement::ariaErrorMessageElementAtIndex):
(WTR::AccessibilityUIElement::ariaErrorMessageReferencingElementAtIndex):
* WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl:
* WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:
(WTR::AccessibilityUIElement::ariaDetailsElementAtIndex):
(WTR::AccessibilityUIElement::ariaDetailsReferencingElementAtIndex):
(WTR::AccessibilityUIElement::ariaErrorMessageElementAtIndex):
(WTR::AccessibilityUIElement::ariaErrorMessageReferencingElementAtIndex):
* gtk/jhbuild.modules:

LayoutTests:

Add new test cases to relation-types.html.

* accessibility/gtk/relation-types-expected.txt:
* accessibility/gtk/relation-types.html:

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

2 years ago[WPE][GCrypt] Unreviewed gardening
csaavedra@igalia.com [Mon, 26 Jun 2017 14:12:34 +0000 (14:12 +0000)]
[WPE][GCrypt] Unreviewed gardening

After r218744, land new expectations for AES-CFB tests.
* platform/wpe/crypto/subtle/aes-cbc-cfb-decrypt-malformed-parameters-expected.txt: Added.
* platform/wpe/crypto/subtle/aes-cbc-cfb-encrypt-malformed-parameters-expected.txt: Added.
* platform/wpe/crypto/subtle/aes-export-key-malformed-parameters-expected.txt: Added.
* platform/wpe/crypto/subtle/aes-generate-key-malformed-parameters-expected.txt: Added.
* platform/wpe/crypto/subtle/aes-import-key-malformed-parameters-expected.txt: Added.

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

2 years agoUnreviewed. Add libfii to GTK+ install dependencies script.
carlosgc@webkit.org [Mon, 26 Jun 2017 09:30:36 +0000 (09:30 +0000)]
Unreviewed. Add libfii to GTK+ install dependencies script.

* gtk/install-dependencies:

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

2 years ago[Win] Update expectations for layout tests.
pvollan@apple.com [Mon, 26 Jun 2017 09:02:36 +0000 (09:02 +0000)]
[Win] Update expectations for layout tests.
https://bugs.webkit.org/show_bug.cgi?id=172437

Unreviewed test gardening, update test expectations for failing tests.

* platform/win/TestExpectations:

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

2 years agoUnreviewed, add missing header for CLoop
annulen@yandex.ru [Mon, 26 Jun 2017 08:47:09 +0000 (08:47 +0000)]
Unreviewed, add missing header for CLoop

* runtime/SymbolTable.cpp:

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

2 years agoUnreviewed, add missing header icncludes
annulen@yandex.ru [Mon, 26 Jun 2017 08:23:49 +0000 (08:23 +0000)]
Unreviewed, add missing header icncludes

Source/JavaScriptCore:

* parser/Lexer.h:

Source/WebKit2:

* WebProcess/soup/WebKitSoupRequestInputStream.cpp:

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

2 years agoRemove excessive headers from WebCore/{Modules,animation,crypto,domjit}
annulen@yandex.ru [Mon, 26 Jun 2017 08:13:53 +0000 (08:13 +0000)]
Remove excessive headers from WebCore/{Modules,animation,crypto,domjit}
https://bugs.webkit.org/show_bug.cgi?id=173824

Reviewed by Darin Adler.

No new tests needed.

* Modules/credentials/CredentialCreationOptions.h:
* Modules/credentials/PasswordCredential.h:
* Modules/fetch/FetchBody.h:
* Modules/fetch/FetchBodyOwner.h:
* Modules/gamepad/GamepadManager.h:
* Modules/geolocation/Coordinates.h:
* Modules/geolocation/Geoposition.h:
* Modules/indexeddb/IDBActiveDOMObject.h:
* Modules/indexeddb/IDBCursor.h:
* Modules/indexeddb/IDBDatabase.h:
* Modules/indexeddb/IDBDatabaseIdentifier.h:
* Modules/indexeddb/IDBObjectStore.cpp:
* Modules/indexeddb/IDBObjectStore.h:
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
* Modules/indexeddb/server/UniqueIDBDatabase.h:
* Modules/indexeddb/shared/InProcessIDBServer.h:
* Modules/indexeddb/shared/IndexKey.h:
* Modules/mediacontrols/MediaControlsHost.h:
* Modules/mediasession/WebMediaSessionManager.h:
* Modules/mediasource/SourceBufferList.h:
* Modules/mediasource/VideoPlaybackQuality.h:
* Modules/notifications/Notification.h:
* Modules/quota/WorkerNavigatorStorageQuota.h:
* Modules/webaudio/AudioBasicProcessorNode.h:
* Modules/webaudio/AudioContext.h:
* Modules/webaudio/AudioDestinationNode.h:
* Modules/webaudio/AudioParamTimeline.h:
* Modules/webaudio/ConvolverNode.cpp:
* Modules/webaudio/MediaStreamAudioSource.h:
* Modules/webaudio/MediaStreamAudioSourceNode.h:
* Modules/webaudio/PannerNode.h:
* Modules/webaudio/PeriodicWave.h:
* Modules/webaudio/ScriptProcessorNode.h:
* Modules/webdatabase/DatabaseManager.h:
* Modules/webdatabase/DatabaseTask.h:
* Modules/webdatabase/SQLTransaction.h:
* Modules/webdatabase/SQLTransactionBackend.h:
* Modules/webdatabase/SQLTransactionStateMachine.h:
* Modules/websockets/ThreadableWebSocketChannelClientWrapper.h:
* Modules/websockets/WebSocketDeflater.h:
* Modules/websockets/WorkerThreadableWebSocketChannel.h:
* animation/AnimationEffect.h:
* crypto/CryptoKeyPair.h:
* crypto/parameters/CryptoAlgorithmEcdhKeyDeriveParams.h:
* dom/ScriptExecutionContext.h:
* domjit/DOMJITHelpers.h:
* domjit/DOMJITIDLConvert.h:
* domjit/DOMJITIDLType.h:

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

2 years ago[GTK] Unreviewed, added missing includes to fix debug build
annulen@yandex.ru [Mon, 26 Jun 2017 07:57:25 +0000 (07:57 +0000)]
[GTK] Unreviewed, added missing includes to fix debug build

Source/WebCore:

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:

Source/WebKit2:

* NetworkProcess/NetworkSession.cpp:

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

2 years agoinitializeThreading() [first] causes WTFCrash due to maxSingleAllocationSize not...
utatane.tea@gmail.com [Sun, 25 Jun 2017 21:41:51 +0000 (21:41 +0000)]
initializeThreading() [first] causes WTFCrash due to maxSingleAllocationSize not being initialized
https://bugs.webkit.org/show_bug.cgi?id=173720

Reviewed by Mark Lam.

When using std::numeric_limits<size_t>::max() for global variable's initialization,
it seems that it invokes static constructor to initialize this in VC++.
We avoid this edge case by introducing a workaround using SIZE_MAX here.

When I perform git-grep, there is only one site (this) using std::numeric_limits<>::xxx()
to initialize global variable.

* wtf/FastMalloc.cpp:

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

2 years agoRemove excessive headers from WebCore/platform
annulen@yandex.ru [Sun, 25 Jun 2017 20:35:34 +0000 (20:35 +0000)]
Remove excessive headers from WebCore/platform
https://bugs.webkit.org/show_bug.cgi?id=173822

Reviewed by Tim Horton.

Source/WebCore:

No new tests needed.

* html/ColorInputType.h:
* html/MediaElementSession.h:
* page/SecurityOriginData.cpp:
* platform/CalculationValue.cpp:
* platform/CalculationValue.h:
* platform/ColorChooserClient.h:
* platform/ContentType.h:
* platform/LogMacros.h:
* platform/PODRedBlackTree.h:
* platform/PasteboardStrategy.h:
* platform/PlatformPasteboard.h:
* platform/PopupMenuStyle.h:
* platform/ScrollAnimator.h:
* platform/Theme.h:
* platform/ThreadGlobalData.h:
* platform/animation/AnimationList.h:
* platform/audio/AudioArray.h:
* platform/audio/AudioChannel.h:
* platform/audio/DynamicsCompressor.h:
* platform/audio/DynamicsCompressorKernel.h:
* platform/audio/FFTFrame.h:
* platform/audio/HRTFDatabaseLoader.cpp:
* platform/audio/HRTFDatabaseLoader.h:
* platform/audio/HRTFElevation.h:
* platform/audio/MultiChannelResampler.h:
* platform/audio/PlatformMediaSession.h:
* platform/audio/ReverbConvolver.h:
* platform/audio/ReverbConvolverStage.cpp:
* platform/graphics/ANGLEWebKitBridge.h:
* platform/graphics/BitmapImage.h:
* platform/graphics/CrossfadeGeneratedImage.h:
* platform/graphics/FloatPolygon.h:
* platform/graphics/FloatSizeHash.h:
* platform/graphics/Font.h:
* platform/graphics/FontMetrics.h:
* platform/graphics/FontPlatformData.h:
* platform/graphics/FontRanges.h:
* platform/graphics/FontTaggedSettings.h:
* platform/graphics/GraphicsContext3D.h:
* platform/graphics/GraphicsContext3DPrivate.h:
* platform/graphics/GraphicsLayerClient.h:
* platform/graphics/Image.cpp:
* platform/graphics/ImageFrame.h:
* platform/graphics/ImageFrameCache.h:
* platform/graphics/ImageSource.h:
* platform/graphics/IntRectHash.h:
* platform/graphics/IntSizeHash.h:
* platform/graphics/MediaPlaybackTargetClient.h:
* platform/graphics/Pattern.h:
* platform/graphics/PlatformTimeRanges.h:
* platform/graphics/TextRun.h:
* platform/graphics/TiledBacking.h:
* platform/graphics/cairo/FontCustomPlatformData.h:
* platform/graphics/filters/FEConvolveMatrix.h:
* platform/graphics/filters/FELighting.h:
* platform/graphics/filters/SourceAlpha.h:
* platform/graphics/gstreamer/GStreamerUtilities.h:
* platform/graphics/gstreamer/InbandMetadataTextTrackPrivateGStreamer.h:
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
* platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h:
* platform/graphics/harfbuzz/HarfBuzzShaper.h:
* platform/graphics/opengl/Extensions3DOpenGL.h:
* platform/graphics/texmap/GraphicsLayerTextureMapper.h:
* platform/graphics/texmap/TextureMapperBackingStore.h:
* platform/graphics/texmap/TextureMapperGL.cpp:
* platform/graphics/texmap/TextureMapperGL.h:
* platform/graphics/texmap/TextureMapperPlatformLayerProxy.h:
* platform/graphics/texmap/TextureMapperTile.h:
* platform/graphics/texmap/coordinated/Tile.h:
* platform/graphics/texmap/coordinated/TiledBackingStore.h:
* platform/graphics/transforms/TransformState.h:
* platform/gtk/PasteboardHelper.h:
* platform/gtk/ScrollbarThemeGtk.h:
* platform/image-decoders/ImageDecoder.h:
* platform/network/BlobData.h:
* platform/network/BlobDataFileReference.h:
* platform/network/ResourceHandle.h:
* platform/network/ResourceHandleInternal.h:
* platform/network/SocketStreamHandleClient.h:
* platform/network/soup/ResourceRequest.h:
* platform/network/soup/SocketStreamHandleImpl.h:
* platform/network/soup/SoupNetworkSession.h:
* platform/sql/SQLiteFileSystem.h:
* platform/text/LocaleICU.h:

Source/WebKit2:

* WebProcess/WebCoreSupport/SessionStateConversion.cpp:

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

2 years agoUnreviewed, rolling out r215190.
mcatanzaro@igalia.com [Sun, 25 Jun 2017 19:56:06 +0000 (19:56 +0000)]
Unreviewed, rolling out r215190.

Broke product select element on GNOME Bugzilla

Reverted changeset:

"[GTK] Misplaced right click menu on web page due to
deprecated gtk_menu_popup()"
https://bugs.webkit.org/show_bug.cgi?id=170553
http://trac.webkit.org/changeset/215190

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

2 years ago[GTK][WPE] Unreviewed, fix typo in translatable string
mcatanzaro@igalia.com [Sun, 25 Jun 2017 18:20:53 +0000 (18:20 +0000)]
[GTK][WPE] Unreviewed, fix typo in translatable string

Thanks to Yuri Chornoivan for reporting this typo.

* UIProcess/API/glib/WebKitWebView.cpp:
(webkit_web_view_class_init):

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

2 years ago[GTK] [l10n] Updated Ukrainian translation of WebKitGTK+
mcatanzaro@igalia.com [Sun, 25 Jun 2017 18:18:48 +0000 (18:18 +0000)]
[GTK] [l10n] Updated Ukrainian translation of WebKitGTK+
https://bugs.webkit.org/show_bug.cgi?id=173823

Patch by Yuri Chornoivan <yurchor@ukr.net> on 2017-06-25
Rubber-stamped by Michael Catanzaro.

* uk.po:

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

2 years agoRemove use of mock webrtc backend factory at injected bundle reset time
commit-queue@webkit.org [Sun, 25 Jun 2017 18:06:06 +0000 (18:06 +0000)]
Remove use of mock webrtc backend factory at injected bundle reset time
https://bugs.webkit.org/show_bug.cgi?id=173817

Patch by Youenn Fablet <youenn@apple.com> on 2017-06-25
Reviewed by Darin Adler.

Source/WebCore:

* testing/Internals.cpp:
(WebCore::Internals::resetToConsistentState): Resetting the peer connection backend.
* testing/MockLibWebRTCPeerConnection.cpp: Doing some clean-up
(WebCore::useRealRTCPeerConnectionFactory):
(WebCore::MockLibWebRTCPeerConnectionFactory::MockLibWebRTCPeerConnectionFactory):
(WebCore::MockLibWebRTCPeerConnectionFactory::CreatePeerConnection):
(WebCore::MockLibWebRTCPeerConnectionFactory::CreateVideoTrack):
(WebCore::MockLibWebRTCPeerConnectionFactory::CreateAudioTrack):
* testing/MockLibWebRTCPeerConnection.h:

LayoutTests:

Making some tests less flaky.

* TestExpectations:
* fast/mediastream/RTCPeerConnection-media-setup-two-dialogs-expected.txt:
* platform/mac/webrtc/captureCanvas-webrtc-software-encoder.html:
* webrtc/audio-peer-connection-webaudio.html:
* webrtc/captureCanvas-webrtc.html:
* webrtc/datachannel/bufferedAmountLowThreshold-default-expected.txt: Added.
* webrtc/datachannel/bufferedAmountLowThreshold-default.html: Added.
* webrtc/datachannel/bufferedAmountLowThreshold-expected.txt:
* webrtc/datachannel/bufferedAmountLowThreshold.html:
* webrtc/routines.js:
* webrtc/video-replace-muted-track.html:
* webrtc/video-unmute.html:

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

2 years agoRemove excessive headers from JavaScriptCore
annulen@yandex.ru [Sun, 25 Jun 2017 17:40:30 +0000 (17:40 +0000)]
Remove excessive headers from JavaScriptCore
https://bugs.webkit.org/show_bug.cgi?id=173812

Reviewed by Darin Adler.

Source/JavaScriptCore:

* API/APIUtils.h:
* assembler/LinkBuffer.cpp:
* assembler/MacroAssemblerCodeRef.cpp:
* b3/air/AirLiveness.h:
* b3/air/AirLowerAfterRegAlloc.cpp:
* bindings/ScriptValue.cpp:
* bindings/ScriptValue.h:
* bytecode/AccessCase.cpp:
* bytecode/AccessCase.h:
* bytecode/ArrayProfile.h:
* bytecode/BytecodeDumper.h:
* bytecode/BytecodeIntrinsicRegistry.cpp:
* bytecode/BytecodeKills.h:
* bytecode/BytecodeLivenessAnalysis.h:
* bytecode/BytecodeUseDef.h:
* bytecode/CallLinkStatus.h:
* bytecode/CodeBlock.h:
* bytecode/CodeOrigin.h:
* bytecode/ComplexGetStatus.h:
* bytecode/GetByIdStatus.h:
* bytecode/GetByIdVariant.h:
* bytecode/InlineCallFrame.h:
* bytecode/InlineCallFrameSet.h:
* bytecode/Instruction.h:
* bytecode/InternalFunctionAllocationProfile.h:
* bytecode/JumpTable.h:
* bytecode/MethodOfGettingAValueProfile.h:
* bytecode/ObjectPropertyConditionSet.h:
* bytecode/Operands.h:
* bytecode/PolymorphicAccess.h:
* bytecode/PutByIdStatus.h:
* bytecode/SpeculatedType.cpp:
* bytecode/StructureSet.h:
* bytecode/StructureStubInfo.h:
* bytecode/UnlinkedCodeBlock.h:
* bytecode/UnlinkedFunctionExecutable.h:
* bytecode/ValueProfile.h:
* bytecompiler/BytecodeGenerator.cpp:
* bytecompiler/BytecodeGenerator.h:
* bytecompiler/Label.h:
* bytecompiler/StaticPropertyAnalysis.h:
* debugger/DebuggerCallFrame.cpp:
* dfg/DFGAbstractInterpreter.h:
* dfg/DFGAdjacencyList.h:
* dfg/DFGArgumentsUtilities.h:
* dfg/DFGArrayMode.h:
* dfg/DFGArrayifySlowPathGenerator.h:
* dfg/DFGBackwardsPropagationPhase.h:
* dfg/DFGBasicBlock.h:
* dfg/DFGCallArrayAllocatorSlowPathGenerator.h:
* dfg/DFGCallCreateDirectArgumentsSlowPathGenerator.h:
* dfg/DFGCapabilities.h:
* dfg/DFGCommon.h:
* dfg/DFGCommonData.h:
* dfg/DFGDesiredIdentifiers.h:
* dfg/DFGDesiredWatchpoints.h:
* dfg/DFGDisassembler.cpp:
* dfg/DFGDominators.h:
* dfg/DFGDriver.cpp:
* dfg/DFGDriver.h:
* dfg/DFGEdgeDominates.h:
* dfg/DFGFinalizer.h:
* dfg/DFGGenerationInfo.h:
* dfg/DFGJITCompiler.cpp:
* dfg/DFGJITCompiler.h:
* dfg/DFGJITFinalizer.h:
* dfg/DFGLivenessAnalysisPhase.h:
* dfg/DFGMinifiedNode.h:
* dfg/DFGMultiGetByOffsetData.h:
* dfg/DFGNaturalLoops.cpp:
* dfg/DFGNaturalLoops.h:
* dfg/DFGNode.h:
* dfg/DFGOSRAvailabilityAnalysisPhase.h:
* dfg/DFGOSRExit.h:
* dfg/DFGOSRExitCompilationInfo.h:
* dfg/DFGOSRExitCompiler.cpp:
* dfg/DFGOSRExitCompiler.h:
* dfg/DFGOSRExitJumpPlaceholder.h:
* dfg/DFGOperations.cpp:
* dfg/DFGOperations.h:
* dfg/DFGPlan.h:
* dfg/DFGPreciseLocalClobberize.h:
* dfg/DFGPromotedHeapLocation.h:
* dfg/DFGRegisteredStructure.h:
* dfg/DFGRegisteredStructureSet.h:
* dfg/DFGSaneStringGetByValSlowPathGenerator.h:
* dfg/DFGSlowPathGenerator.h:
* dfg/DFGSnippetParams.h:
* dfg/DFGSpeculativeJIT.h:
* dfg/DFGToFTLDeferredCompilationCallback.h:
* dfg/DFGToFTLForOSREntryDeferredCompilationCallback.h:
* dfg/DFGValidate.h:
* dfg/DFGValueSource.h:
* dfg/DFGVariableEvent.h:
* dfg/DFGVariableEventStream.h:
* dfg/DFGWorklist.h:
* domjit/DOMJITCallDOMGetterSnippet.h:
* domjit/DOMJITEffect.h:
* ftl/FTLLink.cpp:
* ftl/FTLLowerDFGToB3.cpp:
* ftl/FTLPatchpointExceptionHandle.h:
* heap/AllocatorAttributes.h:
* heap/CodeBlockSet.h:
* heap/DeferGC.h:
* heap/GCSegmentedArray.h:
* heap/Heap.cpp:
* heap/Heap.h:
* heap/IncrementalSweeper.h:
* heap/ListableHandler.h:
* heap/MachineStackMarker.h:
* heap/MarkedAllocator.h:
* heap/MarkedBlock.cpp:
* heap/MarkedBlock.h:
* heap/MarkingConstraint.h:
* heap/SlotVisitor.cpp:
* heap/SlotVisitor.h:
* inspector/ConsoleMessage.cpp:
* inspector/ConsoleMessage.h:
* inspector/InjectedScript.h:
* inspector/InjectedScriptHost.h:
* inspector/InjectedScriptManager.cpp:
* inspector/JSGlobalObjectInspectorController.cpp:
* inspector/JavaScriptCallFrame.h:
* inspector/ScriptCallStack.h:
* inspector/ScriptCallStackFactory.cpp:
* inspector/ScriptDebugServer.h:
* inspector/agents/InspectorConsoleAgent.h:
* inspector/agents/InspectorDebuggerAgent.cpp:
* inspector/agents/InspectorDebuggerAgent.h:
* inspector/agents/InspectorHeapAgent.cpp:
* inspector/agents/InspectorHeapAgent.h:
* inspector/agents/InspectorRuntimeAgent.h:
* inspector/agents/InspectorScriptProfilerAgent.cpp:
* inspector/agents/InspectorScriptProfilerAgent.h:
* inspector/agents/JSGlobalObjectConsoleAgent.h:
* inspector/agents/JSGlobalObjectDebuggerAgent.cpp:
* inspector/agents/JSGlobalObjectDebuggerAgent.h:
* inspector/agents/JSGlobalObjectRuntimeAgent.h:
* inspector/augmentable/AlternateDispatchableAgent.h:
* interpreter/CLoopStack.h:
* interpreter/CachedCall.h:
* interpreter/CallFrame.h:
* interpreter/Interpreter.cpp:
* interpreter/Interpreter.h:
* jit/AssemblyHelpers.cpp:
* jit/AssemblyHelpers.h:
* jit/CCallHelpers.h:
* jit/CallFrameShuffler.h:
* jit/ExecutableAllocator.h:
* jit/GCAwareJITStubRoutine.h:
* jit/HostCallReturnValue.h:
* jit/ICStats.h:
* jit/JIT.cpp:
* jit/JIT.h:
* jit/JITAddGenerator.h:
* jit/JITCall32_64.cpp:
* jit/JITCode.h:
* jit/JITDisassembler.cpp:
* jit/JITExceptions.cpp:
* jit/JITMathIC.h:
* jit/JITOpcodes.cpp:
* jit/JITOperations.cpp:
* jit/JITOperations.h:
* jit/JITThunks.cpp:
* jit/JITThunks.h:
* jit/JSInterfaceJIT.h:
* jit/PCToCodeOriginMap.h:
* jit/PolymorphicCallStubRoutine.h:
* jit/RegisterSet.h:
* jit/Repatch.h:
* jit/SetupVarargsFrame.h:
* jit/Snippet.h:
* jit/SnippetParams.h:
* jit/ThunkGenerators.h:
* jsc.cpp:
* llint/LLIntCLoop.h:
* llint/LLIntEntrypoint.h:
* llint/LLIntExceptions.h:
* llint/LLIntOfflineAsmConfig.h:
* llint/LLIntSlowPaths.cpp:
* parser/NodeConstructors.h:
* parser/Nodes.cpp:
* parser/Nodes.h:
* parser/Parser.cpp:
* parser/Parser.h:
* parser/ParserTokens.h:
* parser/SourceProviderCacheItem.h:
* profiler/ProfilerBytecodeSequence.h:
* profiler/ProfilerDatabase.cpp:
* profiler/ProfilerDatabase.h:
* profiler/ProfilerOrigin.h:
* profiler/ProfilerOriginStack.h:
* profiler/ProfilerProfiledBytecodes.h:
* profiler/ProfilerUID.h:
* runtime/AbstractModuleRecord.h:
* runtime/ArrayConstructor.h:
* runtime/ArrayConventions.h:
* runtime/ArrayIteratorPrototype.h:
* runtime/ArrayPrototype.h:
* runtime/BasicBlockLocation.h:
* runtime/Butterfly.h:
* runtime/CallData.cpp:
* runtime/CodeCache.h:
* runtime/CommonSlowPaths.cpp:
* runtime/CommonSlowPaths.h:
* runtime/CommonSlowPathsExceptions.cpp:
* runtime/Completion.cpp:
* runtime/ControlFlowProfiler.h:
* runtime/DateInstanceCache.h:
* runtime/ErrorConstructor.h:
* runtime/ErrorInstance.h:
* runtime/ExceptionHelpers.cpp:
* runtime/ExceptionHelpers.h:
* runtime/ExecutableBase.h:
* runtime/FunctionExecutable.h:
* runtime/HasOwnPropertyCache.h:
* runtime/Identifier.h:
* runtime/InternalFunction.h:
* runtime/IntlCollator.cpp:
* runtime/IntlCollatorPrototype.h:
* runtime/IntlDateTimeFormatPrototype.h:
* runtime/IntlNumberFormat.cpp:
* runtime/IntlNumberFormatPrototype.h:
* runtime/IteratorOperations.cpp:
* runtime/JSArray.h:
* runtime/JSArrayBufferPrototype.h:
* runtime/JSCJSValue.h:
* runtime/JSCJSValueInlines.h:
* runtime/JSCell.h:
* runtime/JSFunction.cpp:
* runtime/JSFunction.h:
* runtime/JSGenericTypedArrayViewPrototypeFunctions.h:
* runtime/JSGlobalObject.cpp:
* runtime/JSGlobalObject.h:
* runtime/JSGlobalObjectDebuggable.cpp:
* runtime/JSGlobalObjectDebuggable.h:
* runtime/JSGlobalObjectFunctions.cpp:
* runtime/JSGlobalObjectFunctions.h:
* runtime/JSJob.cpp:
* runtime/JSLock.h:
* runtime/JSModuleLoader.cpp:
* runtime/JSModuleNamespaceObject.h:
* runtime/JSModuleRecord.h:
* runtime/JSObject.cpp:
* runtime/JSObject.h:
* runtime/JSRunLoopTimer.h:
* runtime/JSTemplateRegistryKey.h:
* runtime/JSTypedArrayPrototypes.cpp:
* runtime/JSTypedArrayPrototypes.h:
* runtime/JSTypedArrays.h:
* runtime/LiteralParser.h:
* runtime/MatchResult.h:
* runtime/MemoryStatistics.h:
* runtime/PrivateName.h:
* runtime/PromiseDeferredTimer.h:
* runtime/ProxyObject.h:
* runtime/RegExp.h:
* runtime/SamplingProfiler.cpp:
* runtime/SmallStrings.h:
* runtime/StringPrototype.cpp:
* runtime/StringRecursionChecker.h:
* runtime/Structure.h:
* runtime/SymbolConstructor.h:
* runtime/SymbolPrototype.cpp:
* runtime/SymbolPrototype.h:
* runtime/TypeProfiler.h:
* runtime/TypeProfilerLog.h:
* runtime/TypedArrayType.h:
* runtime/VM.cpp:
* runtime/VM.h:
* runtime/VMEntryScope.h:
* runtime/WeakMapData.h:
* runtime/WriteBarrier.h:
* tools/FunctionOverrides.cpp:
* tools/FunctionOverrides.h:
* wasm/WasmBinding.cpp:
* wasm/js/JSWebAssemblyCodeBlock.h:
* wasm/js/WebAssemblyPrototype.cpp:
* yarr/Yarr.h:
* yarr/YarrJIT.cpp:
* yarr/YarrJIT.h:
* yarr/YarrParser.h:

Source/WebCore:

No new tests needed.

* Modules/indexeddb/IDBObjectStore.cpp:
* bindings/js/JSDOMPromiseDeferred.h:
* bindings/js/JSLazyEventListener.cpp:
* bindings/js/JSMainThreadExecState.h:
* bindings/js/ReadableStreamDefaultController.cpp:
* bindings/js/ScriptGlobalObject.cpp:
* bindings/js/SerializedScriptValue.cpp:
* bridge/NP_jsobject.cpp:
* dom/ScriptExecutionContext.cpp:
* html/HTMLPlugInImageElement.cpp:

Source/WebKit/mac:

* Plugins/Hosted/NetscapePluginInstanceProxy.mm:
* WebView/WebView.mm:

Source/WebKit/win:

* Plugins/PluginPackage.cpp:

Source/WebKit2:

* WebProcess/Plugins/Netscape/NPJSObject.cpp:

Source/WTF:

* wtf/Bag.h:

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

2 years agoRemove excessive headers from WebCore/{rendering,style,svg}
annulen@yandex.ru [Sun, 25 Jun 2017 10:01:54 +0000 (10:01 +0000)]
Remove excessive headers from WebCore/{rendering,style,svg}
https://bugs.webkit.org/show_bug.cgi?id=173773

Reviewed by Darin Adler.

No new tests needed.

* css/StyleBuilderConverter.h:
* editing/TextIterator.cpp:
* rendering/CounterNode.h:
* rendering/FlexibleBoxAlgorithm.h:
* rendering/HitTestLocation.h:
* rendering/HitTestResult.h:
* rendering/HitTestingTransformState.h:
* rendering/OrderIterator.h:
* rendering/RenderButton.h:
* rendering/RenderCombineText.h:
* rendering/RenderFlowThread.h:
* rendering/RenderFullScreen.h:
* rendering/RenderGeometryMap.h:
* rendering/RenderListItem.h:
* rendering/RenderMediaControlElements.cpp:
* rendering/RenderMediaControlElements.h:
* rendering/RenderMediaControls.h:
* rendering/RenderMeter.h:
* rendering/RenderMultiColumnSet.cpp:
* rendering/RenderObject.h:
* rendering/RenderRegion.h:
* rendering/RenderRegionSet.cpp:
* rendering/RenderRegionSet.h:
* rendering/RenderTheme.h:
* rendering/RenderVTTCue.cpp:
* rendering/RenderVTTCue.h:
* rendering/SimpleLineLayoutFunctions.h:
* rendering/SimpleLineLayoutResolver.h:
* rendering/line/BreakingContext.h:
* rendering/line/LineBreaker.h:
* rendering/mathml/MathMLStyle.h:
* rendering/mathml/RenderMathMLOperator.h:
* rendering/mathml/RenderMathMLRoot.h:
* rendering/shapes/RectangleShape.h:
* rendering/style/BasicShapes.h:
* rendering/style/BorderData.h:
* rendering/style/CounterDirectives.h:
* rendering/style/GridArea.h:
* rendering/style/KeyframeList.h:
* rendering/style/RenderStyle.h:
* rendering/style/SVGRenderStyle.h:
* rendering/style/ShapeValue.h:
* rendering/style/StyleCachedImage.h:
* rendering/style/StyleMultiColData.h:
* rendering/style/StyleRareNonInheritedData.h:
* rendering/style/WillChangeData.h:
* rendering/svg/RenderSVGBlock.h:
* rendering/svg/RenderSVGRect.h:
* rendering/svg/RenderSVGResource.h:
* rendering/svg/RenderSVGResourceContainer.h:
* rendering/svg/RenderSVGResourceMarker.h:
* rendering/svg/RenderSVGResourceMasker.h:
* rendering/svg/RenderSVGResourcePattern.h:
* rendering/svg/SVGInlineFlowBox.cpp:
* rendering/svg/SVGInlineTextBox.h:
* rendering/svg/SVGRootInlineBox.h:
* rendering/svg/SVGTextChunk.cpp:
* rendering/svg/SVGTextChunk.h:
* rendering/svg/SVGTextChunkBuilder.cpp:
* rendering/svg/SVGTextLayoutEngine.cpp:
* rendering/svg/SVGTextLayoutEngineSpacing.h:
* style/RenderTreePosition.cpp:
* style/RenderTreePosition.h:
* style/RenderTreeUpdater.h:
* style/StyleFontSizeFunctions.h:
* style/StyleInvalidator.h:
* style/StyleResolveForDocument.h:
* style/StyleScope.h:
* style/StyleTreeResolver.cpp:
* style/StyleTreeResolver.h:
* style/StyleUpdate.h:
* svg/SVGAnimationElement.h:
* svg/SVGFEBlendElement.cpp:
* svg/SVGFEBlendElement.h:
* svg/SVGFEComponentTransferElement.h:
* svg/SVGFEFloodElement.cpp:
* svg/SVGFEFloodElement.h:
* svg/SVGFEImageElement.h:
* svg/SVGFEMergeElement.cpp:
* svg/SVGFEMergeElement.h:
* svg/SVGFEOffsetElement.cpp:
* svg/SVGFEOffsetElement.h:
* svg/SVGFETileElement.cpp:
* svg/SVGFETileElement.h:
* svg/SVGParserUtilities.h:
* svg/SVGPathByteStream.h:
* svg/SVGPathElement.cpp:
* svg/SVGPolyElement.cpp:
* svg/SVGSVGElement.cpp:
* svg/SVGTRefElement.cpp:
* svg/SVGTextPathElement.cpp:
* svg/SVGUseElement.cpp:
* svg/animation/SMILTimeContainer.h:
* svg/graphics/SVGImageCache.h:
* svg/graphics/filters/SVGFilter.h:

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

2 years agoRemove rAf suspension logging
graouts@webkit.org [Sun, 25 Jun 2017 09:22:06 +0000 (09:22 +0000)]
Remove rAf suspension logging
https://bugs.webkit.org/show_bug.cgi?id=173821

Reviewed by Tim Horton.

Now that webkit.org/b/173628 is fixed, we can remove the logging code we added.

* dom/Document.cpp:
(WebCore::Document::requestAnimationFrame):
* dom/ScriptedAnimationController.cpp:
(WebCore::ScriptedAnimationController::suspend):
(WebCore::ScriptedAnimationController::resume):
* page/Page.cpp:
(WebCore::Page::suspendScriptedAnimations):
(WebCore::Page::resumeScriptedAnimations):
(WebCore::Page::setIsVisibleInternal):
* platform/RuntimeApplicationChecks.h:
* platform/cocoa/RuntimeApplicationChecksCocoa.mm:
(WebCore::MacApplication::isDumpRenderTree): Deleted.

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

2 years ago[WK2] Make sure encodeClientTypesAndData() / decodeClientTypesAndData() match exactly
cdumez@apple.com [Sun, 25 Jun 2017 00:07:17 +0000 (00:07 +0000)]
[WK2] Make sure encodeClientTypesAndData() / decodeClientTypesAndData() match exactly
https://bugs.webkit.org/show_bug.cgi?id=173813

Reviewed by Ryosuke Niwa.

Make sure encodeClientTypesAndData() / decodeClientTypesAndData() match exactly. The previous
IPC encoder code would assume types and data vector have the same length. It would first encode
the length of data using |data.size()| but then would encode types.size() values from the
data vector. While there are debug assertions to ensure both vectors have the same size, this
seems unnecessarily fragile in release builds. If both vectors happen to have different sizes,
this will lead to weird IPC bugs.

* Shared/WebCoreArgumentCoders.cpp:
(IPC::encodeClientTypesAndData):
(IPC::decodeClientTypesAndData):

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

2 years ago[JSC] Clean up Object.entries implementation
utatane.tea@gmail.com [Sat, 24 Jun 2017 22:29:22 +0000 (22:29 +0000)]
[JSC] Clean up Object.entries implementation
https://bugs.webkit.org/show_bug.cgi?id=173759

Reviewed by Sam Weinig.

JSTests:

* microbenchmarks/object-entries.js: Added.
(test):

Source/JavaScriptCore:

This patch cleans up Object.entries implementation.
We drop unused private functions. And we merge the
implementation into Object.entries.

It slightly speeds up Object.entries speed.

                             baseline                  patched

    object-entries      148.0101+-5.6627          142.1877+-4.8661          might be 1.0409x faster

* builtins/BuiltinNames.h:
* builtins/ObjectConstructor.js:
(entries):
(globalPrivate.enumerableOwnProperties): Deleted.
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
* runtime/ObjectConstructor.cpp:
(JSC::ownEnumerablePropertyKeys): Deleted.
* runtime/ObjectConstructor.h:

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

2 years ago[WebIDL] Add complete support for stringifier
commit-queue@webkit.org [Sat, 24 Jun 2017 21:47:37 +0000 (21:47 +0000)]
[WebIDL] Add complete support for stringifier
https://bugs.webkit.org/show_bug.cgi?id=173724

Patch by Sam Weinig <sam@webkit.org> on 2017-06-24
Reviewed by Darin Adler.

* bindings/scripts/CodeGeneratorJS.pm:
(AddStringifierOperationIfNeeded):
Update AddStringifierOperationIfNeeded to support stringifier on operations and be more
strict about the allowed types. Also copies over all extended attributes to the synthetic
operation.

* bindings/scripts/IDLParser.pm:
(parseInterfaceMember):
(parseOperationOrReadWriteAttributeOrMaplike):
(parseReadOnlyMember):
(parseStringifier):
(parseStaticMember):
(parseAttributeOrOperationForStringifierOrStatic):
(parseReadWriteAttribute):
(parseAttributeRest):
(parseOperation):
(parseSpecialOperation):
(parseMapLikeProperties):
(parseOperationRest):
(parseAttributeOrOperationOrIterator): Deleted.
(parseQualifier): Deleted.
(parseAttributeOrOperationRest): Deleted.
(parseAttribute): Deleted.
(parseOperationOrIterator): Deleted.
- Update parser to more closely resemble the WebIDL grammar, splitting out parseStringifier and
  parseStaticMember into their own subroutines.
- Move those and parseSerializer, parseStringifier, parseStaticMember, parseIterableRest and a split out
  parseReadOnlyMembers up into parseInterfaceMember to make it clearer that they are top level members
  and match the grammar.
- Rename parseAttributeOrOperationOrIterator to parseOperationOrReadWriteAttributeOrMaplike to match the
  grammar language and make it clear what it does.
- Add parseAttributeOrOperationForStringifierOrStatic which contains most of the logic for parsing stringifiers
  and static members, which have almost identical grammars.
- Remove creator special which no longer exists in the spec.

* css/DOMMatrixReadOnly.idl:
* css/WebKitCSSMatrix.idl:
* dom/Range.idl:
* html/URLSearchParams.idl:
Fix FIXMEs by switching to use stringifier.

* bindings/scripts/test/JS/JSTestStringifier.cpp: Added.
* bindings/scripts/test/JS/JSTestStringifier.h: Added.
* bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp: Added.
* bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.h: Added.
* bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp: Added.
* bindings/scripts/test/JS/JSTestStringifierNamedOperation.h: Added.
* bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp: Added.
* bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.h: Added.
* bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp: Added.
* bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.h: Added.
* bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp: Added.
* bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.h: Added.
* bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp: Added.
* bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.h: Added.
* bindings/scripts/test/TestStringifier.idl: Added.
* bindings/scripts/test/TestStringifierAnonymousOperation.idl: Added.
* bindings/scripts/test/TestStringifierNamedOperation.idl: Added.
* bindings/scripts/test/TestStringifierOperationImplementedAs.idl: Added.
* bindings/scripts/test/TestStringifierOperationNamedToString.idl: Added.
* bindings/scripts/test/TestStringifierReadOnlyAttribute.idl: Added.
* bindings/scripts/test/TestStringifierReadWriteAttribute.idl: Added.
Add new tests.

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

2 years agobmalloc: Add a per-thread line cache
ggaren@apple.com [Sat, 24 Jun 2017 20:14:33 +0000 (20:14 +0000)]
bmalloc: Add a per-thread line cache
https://bugs.webkit.org/show_bug.cgi?id=173552

Reviewed by Darin Adler.

Previously, any thread could allocate out of any page with free lines.
Now, the first thread to free a line in a page owns that page's free
lines until the whole page becomes free.

This patch is a big speedup on multi-threaded benchmarks.
tree_churn --parallel gets 14% faster on a 2-core (4-hyper-core) MacBook
Air and 2.85X faster on 12-core (24-hyper-core) Mac Pro. Other parallel
benchmarks show significant but smaller speedups.

Thread affinity is a great predictor of object lifetime. The per-thread
line cache avoids the pathology of shuffling pages between threads,
turning predictable lifetimes into unpredictable lifetimes, increasing
fragmentation. On tree_churn --parallel, the per-thread line cache
increases free memory found per page scanned by 2.85X.

Free line scanning in fragmented pages is pretty expensive relative to
other allocate / initialize / free operations. According to Instruments,
on tree_churn --parallel, scanning is about 10X more expensive than
freeing. This explains why a 2.85X improvement in scanning efficiency
translates into a 2.85X overall speedup on tree_churn --parallel.

* bmalloc/Allocator.cpp:
(bmalloc::Allocator::refillAllocatorSlowCase): Pass through our line
cache so the Heap can fill it.

* bmalloc/Deallocator.cpp:
(bmalloc::Deallocator::scavenge): Scavenge our line cache.

(bmalloc::Deallocator::processObjectLog): Deleted.

* bmalloc/Deallocator.h:
(bmalloc::Deallocator::lineCache): Added a line cache.

* bmalloc/Heap.cpp:
(bmalloc::Heap::deallocateLineCache): Deallocation function for thread
destruction.

(bmalloc::Heap::allocateSmallPage):
(bmalloc::Heap::deallocateSmallLine):
(bmalloc::Heap::allocateSmallBumpRangesByMetadata):
(bmalloc::Heap::allocateSmallBumpRangesByObject): Consult the new per-thread line
cache for allocation and deallocation.

* bmalloc/Heap.h:
(bmalloc::Heap::allocateSmallBumpRanges):
(bmalloc::Heap::derefSmallLine):

* bmalloc/List.h:
(bmalloc::List::remove): Remove has always been a logically static
operation. Declare it static now so that the Heap can remove a page from
a thread's line cache without holding a direct pointer to the cache.

* bmalloc/SmallPage.h:

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

2 years ago[GTK] Introspection: webkit_web_view_new_with_related_view needs to be marked as...
mcatanzaro@igalia.com [Sat, 24 Jun 2017 15:14:40 +0000 (15:14 +0000)]
[GTK] Introspection: webkit_web_view_new_with_related_view needs to be marked as a constructor
https://bugs.webkit.org/show_bug.cgi?id=173765

Reviewed by Carlos Garcia Campos.

Because the first parameter to this WebKitWebView constructor is itself a WebKitWebView,
the gi-scanner's heuristics decide that it's probably an object method rather than a
constructor, resulting in improper introspection generation. Annotate it with (constructor)
to override this behavior.

* UIProcess/API/gtk/WebKitWebViewGtk.cpp:
* UIProcess/API/wpe/WebKitWebViewWPE.cpp:

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

2 years agoUnreviewed, rolling out r218785.
annulen@yandex.ru [Sat, 24 Jun 2017 10:24:33 +0000 (10:24 +0000)]
Unreviewed, rolling out r218785.
https://bugs.webkit.org/show_bug.cgi?id=173808

This change broke the macOS Sierra build (Requested by
annulen|home on #webkit).

Reverted changeset:

"Removed unused lambda captures from WebKit2"
https://bugs.webkit.org/show_bug.cgi?id=173555
http://trac.webkit.org/changeset/218785

Patch by Commit Queue <commit-queue@webkit.org> on 2017-06-24

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

2 years agoRemoved unused lambda captures from WebKit2
annulen@yandex.ru [Sat, 24 Jun 2017 10:16:41 +0000 (10:16 +0000)]
Removed unused lambda captures from WebKit2
https://bugs.webkit.org/show_bug.cgi?id=173555

Reviewed by Alex Christensen.

* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::fetchWebsiteData):
(WebKit::NetworkProcessProxy::deleteWebsiteData):
(WebKit::NetworkProcessProxy::deleteWebsiteDataForOrigins):
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::fetchWebsiteData):
(WebKit::WebProcessProxy::deleteWebsiteData):
(WebKit::WebProcessProxy::deleteWebsiteDataForOrigins):
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::topPrivatelyControlledDomainsWithWebsiteData):

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

2 years agoRemove Reflect.enumerate
commit-queue@webkit.org [Sat, 24 Jun 2017 08:06:47 +0000 (08:06 +0000)]
Remove Reflect.enumerate
https://bugs.webkit.org/show_bug.cgi?id=173806

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-06-24
Reviewed by Yusuke Suzuki.

JSTests:

* ChakraCore.yaml:
* es6.yaml:
These tests now fail because they use Reflect.enumerate.

* test262.yaml:
This test now passes, it checked that Reflect.enumerate is undefined!

* stress/property-name-enumerator-should-not-look-into-indexed-values-when-it-is-a-dictionary.js:
Convert to for..in which presented the original issue. See bug <https://webkit.org/b/149811>

* stress/reflect-enumerate.js: Removed.
Remove a test solely for Reflect.enumerate.

Source/JavaScriptCore:

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* inspector/JSInjectedScriptHost.cpp:
(Inspector::JSInjectedScriptHost::subtype):
(Inspector::JSInjectedScriptHost::getInternalProperties):
(Inspector::JSInjectedScriptHost::iteratorEntries):
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
(JSC::JSGlobalObject::visitChildren):
* runtime/JSPropertyNameIterator.cpp: Removed.
* runtime/JSPropertyNameIterator.h: Removed.
* runtime/ReflectObject.cpp:
(JSC::reflectObjectEnumerate): Deleted.

Source/WebInspectorUI:

* UserInterface/Models/NativeFunctionParameters.js:

Tools:

* Scripts/run-jsc-stress-tests:

LayoutTests:

* inspector/model/remote-object-expected.txt:
* inspector/model/remote-object.html:
* platform/mac/inspector/model/remote-object-expected.txt:

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

2 years agoAX: Cannot call setValue() on contenteditable or ARIA text controls
cfleizach@apple.com [Sat, 24 Jun 2017 07:14:46 +0000 (07:14 +0000)]
AX: Cannot call setValue() on contenteditable or ARIA text controls
https://bugs.webkit.org/show_bug.cgi?id=173520

Reviewed by Ryosuke Niwa.

Source/WebCore:

Add support for changing the value of a contenteditable and any other aria text control in setValue().

Test: accessibility/mac/set-value-editable-types.html

* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::setValue):

Tools:

Add setValue() method to WKTR (already existed in DRT).

* WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp:
(WTR::AccessibilityUIElement::setValue):
* WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h:
* WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl:
* WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm:
(WTR::AccessibilityUIElement::setValue):

LayoutTests:

* accessibility/mac/set-value-editable-types-expected.txt: Added.
* accessibility/mac/set-value-editable-types.html: Added.

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

2 years agoSwitch VMTraps to use halt instructions rather than breakpoint instructions
keith_miller@apple.com [Sat, 24 Jun 2017 02:54:02 +0000 (02:54 +0000)]
Switch VMTraps to use halt instructions rather than breakpoint instructions
https://bugs.webkit.org/show_bug.cgi?id=173677
Source/JavaScriptCore:

<rdar://problem/32178892>

Reviewed by JF Bastien.

Using the breakpoint instruction for VMTraps caused issues with lldb.
Since we only need some way to stop execution we can, in theory, use
any exceptioning instruction we want. I went with the halt instruction
on X86 since that is the only one byte instruction that does not
breakpoint (in my tests both 0xf1 and 0xd6 produced EXC_BREAKPOINT).
On ARM we use the data cache clearing instruction with the zero register,
which triggers a segmentation fault.

Also, update the platform code to only use signaling VMTraps
on where we have an appropriate instruction (x86 and ARM64).

* API/tests/ExecutionTimeLimitTest.cpp:
(testExecutionTimeLimit):
* assembler/ARM64Assembler.h:
(JSC::ARM64Assembler::replaceWithVMHalt):
(JSC::ARM64Assembler::dataCacheZeroVirtualAddress):
(JSC::ARM64Assembler::replaceWithBkpt): Deleted.
* assembler/ARMAssembler.h:
(JSC::ARMAssembler::replaceWithBkpt): Deleted.
* assembler/ARMv7Assembler.h:
(JSC::ARMv7Assembler::replaceWithBkpt): Deleted.
* assembler/MIPSAssembler.h:
(JSC::MIPSAssembler::replaceWithBkpt): Deleted.
* assembler/MacroAssemblerARM.h:
(JSC::MacroAssemblerARM::replaceWithBreakpoint): Deleted.
* assembler/MacroAssemblerARM64.h:
(JSC::MacroAssemblerARM64::replaceWithVMHalt):
(JSC::MacroAssemblerARM64::replaceWithBreakpoint): Deleted.
* assembler/MacroAssemblerARMv7.h:
(JSC::MacroAssemblerARMv7::storeFence):
(JSC::MacroAssemblerARMv7::replaceWithBreakpoint): Deleted.
* assembler/MacroAssemblerMIPS.h:
(JSC::MacroAssemblerMIPS::replaceWithBreakpoint): Deleted.
* assembler/MacroAssemblerX86Common.h:
(JSC::MacroAssemblerX86Common::replaceWithVMHalt):
(JSC::MacroAssemblerX86Common::replaceWithBreakpoint): Deleted.
* assembler/X86Assembler.h:
(JSC::X86Assembler::replaceWithHlt):
(JSC::X86Assembler::replaceWithInt3): Deleted.
* dfg/DFGJumpReplacement.cpp:
(JSC::DFG::JumpReplacement::installVMTrapBreakpoint):
* runtime/VMTraps.cpp:
(JSC::SignalContext::SignalContext):
(JSC::installSignalHandler):
(JSC::SignalContext::adjustPCToPointToTrappingInstruction): Deleted.
* wasm/WasmFaultSignalHandler.cpp:
(JSC::Wasm::enableFastMemory):

Source/WTF:

<rdar://problem/32178892>

Reviewed by JF Bastien.

Remove the Trap signal handler code since it plays badly with lldb and combine
SIGBUS with SIGSEGV since distiguishing them is generally non-portable.

Also, update the platform code to only use signaling VMTraps
on where we have an appropriate instruction (x86 and ARM64).

* wtf/Platform.h:
* wtf/threads/Signals.cpp:
(WTF::fromMachException):
(WTF::toMachMask):
(WTF::installSignalHandler):
(WTF::jscSignalHandler):
* wtf/threads/Signals.h:
(WTF::toSystemSignal):
(WTF::fromSystemSignal):

Tools:

Reviewed by JF Bastien.

* TestWebKitAPI/Tests/WTF/ThreadMessages.cpp:
(TEST):

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

2 years agoWeb Inspector: Script Timeline bubbles sometimes appear to miss large events
joepeck@webkit.org [Sat, 24 Jun 2017 02:45:51 +0000 (02:45 +0000)]
Web Inspector: Script Timeline bubbles sometimes appear to miss large events
https://bugs.webkit.org/show_bug.cgi?id=173746
<rdar://problem/32950808>

Reviewed by Brian Burg.

* UserInterface/Models/Timeline.js:
(WebInspector.Timeline.prototype.addRecord):
(WebInspector.Timeline.prototype._tryInsertInSortedOrder):
The list of records is assumed to be sorted by the code that draws bubbles
however the order in which we receive them may not be sorted. Make a quick
effort to sort recent records so that as we are drawing the timeline it is
more accurate.

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

2 years agoRemove an unused typedef from WebFrameLoaderClient
timothy_horton@apple.com [Sat, 24 Jun 2017 02:19:06 +0000 (02:19 +0000)]
Remove an unused typedef from WebFrameLoaderClient
https://bugs.webkit.org/show_bug.cgi?id=173795

Reviewed by Simon Fraser.

* WebCoreSupport/WebFrameLoaderClient.h:
This unused typedef in the global namespace conflicts with one in a macOS system header.
Also... it's unused.
Remove it.

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

2 years agofast/events/page-visibility-iframe-delete-test.html is flaky
cdumez@apple.com [Sat, 24 Jun 2017 01:56:51 +0000 (01:56 +0000)]
fast/events/page-visibility-iframe-delete-test.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=173798

Reviewed by Simon Fraser.

Modernize the test and deflake it by not making it rely on a specific order
for the visibilitychange events. The event queues are per documents and there
is therefore no guarantee those events will fire in frame tree order.

* fast/events/page-visibility-iframe-delete-test-expected.txt:
* fast/events/page-visibility-iframe-delete-test.html:

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

2 years agoAttempt to fix an internal build after r218755.
simon.fraser@apple.com [Sat, 24 Jun 2017 01:25:54 +0000 (01:25 +0000)]
Attempt to fix an internal build after r218755.

* bindings/js/JSMainThreadExecStateInstrumentation.h:

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