WebKit-https.git
2 years ago[WinCairo] httpd service install needs to precede server start
commit-queue@webkit.org [Mon, 9 Jul 2018 19:20:12 +0000 (19:20 +0000)]
[WinCairo] httpd service install needs to precede server start
https://bugs.webkit.org/show_bug.cgi?id=187283

Patch by Ross Kirsling <rkirsling@gmail.com> on 2018-07-09
Reviewed by Daniel Bates.

* Scripts/webkitpy/port/base.py:
(Port.check_build):
Remove unused parameter `needs_http`.

(Port.check_sys_deps):
(Port.start_http_server):
Move `check_httpd` call.

* Scripts/webkitpy/port/win.py:
(WinPort.check_httpd): Added.
(WinCairoPort.check_httpd): Deleted.
Move `httpd -k install` logic to common Windows location.

* Scripts/webkitpy/layout_tests/controllers/manager.py:
(Manager._set_up_run):
* Scripts/webkitpy/performance_tests/perftestsrunner.py:
* Scripts/webkitpy/port/gtk.py:
(GtkPort.check_sys_deps):
* Scripts/webkitpy/port/ios_simulator.py:
(IOSSimulatorPort.check_sys_deps):
* Scripts/webkitpy/port/mock_drt.py:
(MockDRTPort.check_build):
(MockDRTPort.check_sys_deps):
* Scripts/webkitpy/port/port_testcase.py:
(PortTestCase.integration_test_check_sys_deps):
(test_check_build):
* Scripts/webkitpy/port/test.py:
* Scripts/webkitpy/port/wpe.py:
(WPEPort.check_sys_deps):
* Scripts/webkitpy/tool/commands/perfalizer.py:
(PerfalizerTask.run):
Remove `needs_http` arguments.

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

2 years ago[WebCore] Annotate classes with WTF_MAKE_FAST_ALLOCATED as much as possible
utatane.tea@gmail.com [Mon, 9 Jul 2018 19:08:41 +0000 (19:08 +0000)]
[WebCore] Annotate classes with WTF_MAKE_FAST_ALLOCATED as much as possible
https://bugs.webkit.org/show_bug.cgi?id=187474

Reviewed by Mark Lam.

When opening cnn.com, debugger says that so many objects in WebCore are allocated
from system allocator. This patch attempts to annotate these found classes with
WTF_MAKE_FAST_ALLOCATED.

We also annotate WebAudio classes with `final` to make WebAudio class hierarchy solid.

No behavior change.

* Modules/indexeddb/IDBIndex.h:
* Modules/indexeddb/IDBObjectStore.h:
* Modules/indexeddb/client/IDBConnectionProxy.h:
* Modules/mediastream/UserMediaController.h:
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
* Modules/webaudio/AsyncAudioDecoder.h:
* Modules/webaudio/AudioListener.h:
(WebCore::AudioListener::create): Deleted.
(WebCore::AudioListener::setPosition): Deleted.
(WebCore::AudioListener::position const): Deleted.
(WebCore::AudioListener::setOrientation): Deleted.
(WebCore::AudioListener::orientation const): Deleted.
(WebCore::AudioListener::setUpVector): Deleted.
(WebCore::AudioListener::upVector const): Deleted.
(WebCore::AudioListener::setVelocity): Deleted.
(WebCore::AudioListener::velocity const): Deleted.
(WebCore::AudioListener::setDopplerFactor): Deleted.
(WebCore::AudioListener::dopplerFactor const): Deleted.
(WebCore::AudioListener::setSpeedOfSound): Deleted.
(WebCore::AudioListener::speedOfSound const): Deleted.
* Modules/webaudio/AudioNode.h:
* Modules/webaudio/AudioNodeInput.h:
(WebCore::AudioNodeInput::node const): Deleted.
* Modules/webaudio/AudioNodeOutput.h:
* Modules/webaudio/AudioParam.h:
(WebCore::AudioParam::create): Deleted.
(WebCore::AudioParam::name const): Deleted.
(WebCore::AudioParam::minValue const): Deleted.
(WebCore::AudioParam::maxValue const): Deleted.
(WebCore::AudioParam::defaultValue const): Deleted.
(WebCore::AudioParam::units const): Deleted.
(WebCore::AudioParam::resetSmoothedValue): Deleted.
(WebCore::AudioParam::setSmoothingConstant): Deleted.
(WebCore::AudioParam::setValueAtTime): Deleted.
(WebCore::AudioParam::linearRampToValueAtTime): Deleted.
(WebCore::AudioParam::exponentialRampToValueAtTime): Deleted.
(WebCore::AudioParam::setTargetAtTime): Deleted.
(WebCore::AudioParam::setValueCurveAtTime): Deleted.
(WebCore::AudioParam::cancelScheduledValues): Deleted.
(WebCore::AudioParam::hasSampleAccurateValues): Deleted.
(WebCore::AudioParam::AudioParam): Deleted.
* Modules/webaudio/AudioParamTimeline.h:
* Modules/webaudio/AudioProcessingEvent.h:
(WebCore::AudioProcessingEvent::create): Deleted.
(WebCore::AudioProcessingEvent::createForBindings): Deleted.
(WebCore::AudioProcessingEvent::inputBuffer): Deleted.
(WebCore::AudioProcessingEvent::outputBuffer): Deleted.
(WebCore::AudioProcessingEvent::playbackTime const): Deleted.
* Modules/webaudio/BiquadDSPKernel.h:
(WebCore::BiquadDSPKernel::BiquadDSPKernel): Deleted.
(WebCore::BiquadDSPKernel::biquadProcessor): Deleted.
* Modules/webaudio/BiquadFilterNode.h:
(WebCore::BiquadFilterNode::create): Deleted.
(WebCore::BiquadFilterNode::frequency): Deleted.
(WebCore::BiquadFilterNode::q): Deleted.
(WebCore::BiquadFilterNode::gain): Deleted.
(WebCore::BiquadFilterNode::detune): Deleted.
(WebCore::BiquadFilterNode::biquadProcessor): Deleted.
* Modules/webaudio/BiquadProcessor.h:
(WebCore::BiquadProcessor::filterCoefficientsDirty const): Deleted.
(WebCore::BiquadProcessor::hasSampleAccurateValues const): Deleted.
(WebCore::BiquadProcessor::parameter1): Deleted.
(WebCore::BiquadProcessor::parameter2): Deleted.
(WebCore::BiquadProcessor::parameter3): Deleted.
(WebCore::BiquadProcessor::parameter4): Deleted.
(WebCore::BiquadProcessor::type const): Deleted.
* Modules/webaudio/ChannelMergerNode.h:
* Modules/webaudio/ChannelSplitterNode.h:
* Modules/webaudio/DelayDSPKernel.h:
(WebCore::DelayDSPKernel::maxDelayTime const): Deleted.
(WebCore::DelayDSPKernel::setDelayFrames): Deleted.
(WebCore::DelayDSPKernel::delayProcessor): Deleted.
* Modules/webaudio/DelayNode.h:
* Modules/webaudio/DelayProcessor.h:
(WebCore::DelayProcessor::delayTime const): Deleted.
(WebCore::DelayProcessor::maxDelayTime): Deleted.
* Modules/webaudio/DynamicsCompressorNode.h:
(WebCore::DynamicsCompressorNode::create): Deleted.
(WebCore::DynamicsCompressorNode::threshold): Deleted.
(WebCore::DynamicsCompressorNode::knee): Deleted.
(WebCore::DynamicsCompressorNode::ratio): Deleted.
(WebCore::DynamicsCompressorNode::attack): Deleted.
(WebCore::DynamicsCompressorNode::release): Deleted.
(WebCore::DynamicsCompressorNode::reduction): Deleted.
* Modules/webaudio/GainNode.h:
(WebCore::GainNode::create): Deleted.
(WebCore::GainNode::gain): Deleted.
* Modules/webaudio/MediaElementAudioSourceNode.h:
(WebCore::MediaElementAudioSourceNode::mediaElement): Deleted.
* Modules/webaudio/MediaStreamAudioDestinationNode.h:
(WebCore::MediaStreamAudioDestinationNode::stream): Deleted.
* Modules/webaudio/MediaStreamAudioSourceNode.h:
(WebCore::MediaStreamAudioSourceNode::mediaStream): Deleted.
* Modules/webaudio/OfflineAudioCompletionEvent.h:
(WebCore::OfflineAudioCompletionEvent::renderedBuffer): Deleted.
* Modules/webaudio/OfflineAudioDestinationNode.h:
(WebCore::OfflineAudioDestinationNode::create): Deleted.
* Modules/webaudio/PannerNode.h:
(WebCore::PannerNode::create): Deleted.
(WebCore::PannerNode::panningModel const): Deleted.
(WebCore::PannerNode::position const): Deleted.
(WebCore::PannerNode::setPosition): Deleted.
(WebCore::PannerNode::orientation const): Deleted.
(WebCore::PannerNode::setOrientation): Deleted.
(WebCore::PannerNode::velocity const): Deleted.
(WebCore::PannerNode::setVelocity): Deleted.
(WebCore::PannerNode::refDistance): Deleted.
(WebCore::PannerNode::setRefDistance): Deleted.
(WebCore::PannerNode::maxDistance): Deleted.
(WebCore::PannerNode::setMaxDistance): Deleted.
(WebCore::PannerNode::rolloffFactor): Deleted.
(WebCore::PannerNode::setRolloffFactor): Deleted.
(WebCore::PannerNode::coneInnerAngle const): Deleted.
(WebCore::PannerNode::setConeInnerAngle): Deleted.
(WebCore::PannerNode::coneOuterAngle const): Deleted.
(WebCore::PannerNode::setConeOuterAngle): Deleted.
(WebCore::PannerNode::coneOuterGain const): Deleted.
(WebCore::PannerNode::setConeOuterGain): Deleted.
(WebCore::PannerNode::distanceGain): Deleted.
(WebCore::PannerNode::coneGain): Deleted.
* Modules/webaudio/PeriodicWave.h:
(WebCore::PeriodicWave::rateScale const): Deleted.
(WebCore::PeriodicWave::periodicWaveSize const): Deleted.
(WebCore::PeriodicWave::sampleRate const): Deleted.
(WebCore::PeriodicWave::numberOfRanges const): Deleted.
* Modules/webaudio/RealtimeAnalyser.h:
* Modules/webaudio/ScriptProcessorNode.h:
(WebCore::ScriptProcessorNode::bufferSize const): Deleted.
(WebCore::ScriptProcessorNode::doubleBufferIndex const): Deleted.
(WebCore::ScriptProcessorNode::swapBuffers): Deleted.
* Modules/webaudio/WaveShaperDSPKernel.h:
(WebCore::WaveShaperDSPKernel::waveShaperProcessor): Deleted.
* Modules/webaudio/WaveShaperProcessor.h:
(WebCore::WaveShaperProcessor::curve): Deleted.
(WebCore::WaveShaperProcessor::oversample const): Deleted.
* dom/MessagePort.h:
* html/FormAssociatedElement.h:
* loader/LinkPreloadResourceClients.h:
* page/WheelEventDeltaFilter.h:
* page/mac/WheelEventDeltaFilterMac.h:
* platform/RemoteCommandListener.h:
* platform/audio/AudioDSPKernel.h:
* platform/audio/AudioProcessor.h:
* platform/audio/PlatformMediaSession.h:
* platform/graphics/avfoundation/objc/VideoFullscreenLayerManagerObjC.h:
* platform/mediastream/libwebrtc/LibWebRTCAudioModule.h:
* platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.h:
* workers/service/ServiceWorkerContainer.h:

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

2 years agoShrink RenderSVGShape
simon.fraser@apple.com [Mon, 9 Jul 2018 18:42:25 +0000 (18:42 +0000)]
Shrink RenderSVGShape
https://bugs.webkit.org/show_bug.cgi?id=187459

Reviewed by Zalan Bujtas.

Shrink RenderSVGShape from 328 to 320 bytes by moving the bits before the AffineTransform,
which is 16-byte aligned. This saves 9.6KB on nytimes.com.

* rendering/svg/RenderSVGShape.h:

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

2 years agoShrink CSSFontFace
simon.fraser@apple.com [Mon, 9 Jul 2018 18:41:31 +0000 (18:41 +0000)]
Shrink CSSFontFace
https://bugs.webkit.org/show_bug.cgi?id=187456

Reviewed by Anders Carlsson.

Shrink CSSFontFace by 56 bytes, from 288 to 256 bytes, mostly by defining enums as 8-bit,
but also re-ordering the member variables. There are over 400 of these objects on nytimes.com,
so this saves about 22KB.

* css/CSSFontFace.cpp:
(WebCore::CSSFontFace::CSSFontFace):
* css/CSSFontFace.h:
* platform/text/TextFlags.h:
* rendering/style/RenderStyleConstants.h:

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

2 years agoCheck that LayerTreeHost was created before use
commit-queue@webkit.org [Mon, 9 Jul 2018 18:21:01 +0000 (18:21 +0000)]
Check that LayerTreeHost was created before use
https://bugs.webkit.org/show_bug.cgi?id=187404

Patch by Stephan Szabo <stephan.szabo@sony.com> on 2018-07-09
Reviewed by Žan Doberšek.

* WebProcess/WebPage/AcceleratedDrawingArea.cpp:
(WebKit::AcceleratedDrawingArea::enterAcceleratedCompositingMode):

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

2 years ago[WTF] Annotate RunLoop::Timer fast-allocated
utatane.tea@gmail.com [Mon, 9 Jul 2018 17:54:23 +0000 (17:54 +0000)]
[WTF] Annotate RunLoop::Timer fast-allocated
https://bugs.webkit.org/show_bug.cgi?id=187473

Reviewed by Saam Barati.

It is allocated by std::unique_ptr for MemoryPressureHandler. And it uses system malloc now.

* wtf/RunLoop.h:

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

2 years ago[JSC] Make some data members of UnlinkedCodeBlock private
utatane.tea@gmail.com [Mon, 9 Jul 2018 17:09:43 +0000 (17:09 +0000)]
[JSC] Make some data members of UnlinkedCodeBlock private
https://bugs.webkit.org/show_bug.cgi?id=187467

Reviewed by Mark Lam.

This patch makes m_numVars, m_numCalleeLocals, and m_numParameters of UnlinkedCodeBlock private.
We also remove m_numCapturedVars since it is no longer used.

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::CodeBlock):
* bytecode/CodeBlock.h:
* bytecode/UnlinkedCodeBlock.cpp:
(JSC::UnlinkedCodeBlock::UnlinkedCodeBlock):
* bytecode/UnlinkedCodeBlock.h:

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

2 years ago[JSC] Optimize layout of AccessCase / ProxyableAccessCase to reduce size of Proxyable...
utatane.tea@gmail.com [Mon, 9 Jul 2018 17:08:17 +0000 (17:08 +0000)]
[JSC] Optimize layout of AccessCase / ProxyableAccessCase to reduce size of ProxyableAccessCase
https://bugs.webkit.org/show_bug.cgi?id=187465

Reviewed by Keith Miller.

ProxyableAccessCase is allocated so frequently and it is persisted so long. Reducing the size
of ProxyableAccessCase can reduce the footprint of many web sites including nytimes.com.

This patch uses a bit complicated layout to reduce ProxyableAccessCase. We add unused bool member
in AccessCase's padding, and use it in ProxyableAccessCase. By doing so, we can reduce the size
of ProxyableAccessCase from 56 to 48. And it also reduces the size of GetterSetterAccessCase
from 104 to 96 since it inherits ProxyableAccessCase.

* bytecode/AccessCase.h:
(JSC::AccessCase::viaProxy const):
(JSC::AccessCase::AccessCase):
* bytecode/ProxyableAccessCase.cpp:
(JSC::ProxyableAccessCase::ProxyableAccessCase):
* bytecode/ProxyableAccessCase.h:

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

2 years agoMark animations/needs-layout.html as flaky on iOS.
ryanhaddad@apple.com [Mon, 9 Jul 2018 16:47:14 +0000 (16:47 +0000)]
Mark animations/needs-layout.html as flaky on iOS.
https://bugs.webkit.org/show_bug.cgi?id=187388

Unreviewed test gardening.

* platform/ios-wk2/TestExpectations:

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

2 years agoUnreviewed, rolling out r233612.
commit-queue@webkit.org [Mon, 9 Jul 2018 16:41:10 +0000 (16:41 +0000)]
Unreviewed, rolling out r233612.
https://bugs.webkit.org/show_bug.cgi?id=187475

Revision caused the api test LinkColorWithSystemAppearance to
fail on all systems. (Requested by Truitt on #webkit).

Reverted changeset:

"Semantic colors don't update when accessibility Increase
Contrast mode is enabled."
https://bugs.webkit.org/show_bug.cgi?id=187425
https://trac.webkit.org/changeset/233612

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

2 years agoWebDriver: hang in Selenium test alerts_tests.py::testShouldHandleAlertOnPageBeforeUnload
bburg@apple.com [Mon, 9 Jul 2018 16:30:37 +0000 (16:30 +0000)]
WebDriver: hang in Selenium test alerts_tests.py::testShouldHandleAlertOnPageBeforeUnload
https://bugs.webkit.org/show_bug.cgi?id=187418
<rdar://problem/41909520>

Unreviewed build fix for Sierra.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::runBeforeUnloadConfirmPanel):
According to some compilers, the local 'automationSession' is unused. Change this
to just convert the return value to boolean rather than assign to an unused local.

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

2 years ago[Flatpak] Unreviewed, switch to https for the gst-libav tarball.
philn@webkit.org [Mon, 9 Jul 2018 15:18:08 +0000 (15:18 +0000)]
[Flatpak] Unreviewed, switch to https for the gst-libav tarball.

* flatpak/org.webkit.WebKit.yaml:

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

2 years ago[Flatpak] HTTP layout tests broken due to missing CGI.pm in the sandbox
commit-queue@webkit.org [Mon, 9 Jul 2018 12:45:03 +0000 (12:45 +0000)]
[Flatpak] HTTP layout tests broken due to missing CGI.pm in the sandbox
https://bugs.webkit.org/show_bug.cgi?id=187384

Patch by Thibault Saunier <tsaunier@igalia.com> on 2018-07-09
Reviewed by Philippe Normand.

And make it usable inside the sandbox even when
perl is launched "tainted" (as the PERL5LIB won't
work otherwise).

* flatpak/flatpakutils.py:
(WebkitFlatpak.run_in_sandbox):
* flatpak/org.webkit.WebKit.yaml:

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

2 years ago[WPE][GTK] Mount /dev/shm on /run/shm in sandbox
commit-queue@webkit.org [Mon, 9 Jul 2018 08:56:31 +0000 (08:56 +0000)]
[WPE][GTK] Mount /dev/shm on /run/shm in sandbox
https://bugs.webkit.org/show_bug.cgi?id=187400

Patch by Thibault Saunier <tsaunier@igalia.com> on 2018-07-09
Reviewed by Philippe Normand.

This is where it is expected to be when it is a symlink,
without mounting it the websocket python server can't work
inside the sandbox.

* flatpak/flatpakutils.py:
(WebkitFlatpak.run_in_sandbox):

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

2 years ago[GStreamer] Remove useless workaround
philn@webkit.org [Mon, 9 Jul 2018 08:15:30 +0000 (08:15 +0000)]
[GStreamer] Remove useless workaround
https://bugs.webkit.org/show_bug.cgi?id=186921

Reviewed by Xabier Rodriguez-Calvar.

In bug 67407 a workaround was added for GStreamer 0.10. With 1.x
the media/video-reverse-play-duration.html test passes without any
workaround needed. The other test mentioned in that bug was
removed, it seems.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::playbackPosition const):
Removed early return, position queries shouldn't be avoided on EOS
because the pipeline is in READY state, not NULL.
(WebCore::MediaPlayerPrivateGStreamer::currentMediaTime const):

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

2 years agoOptimize packing of RenderSVGViewportContainer
simon.fraser@apple.com [Mon, 9 Jul 2018 05:57:01 +0000 (05:57 +0000)]
Optimize packing of RenderSVGViewportContainer
https://bugs.webkit.org/show_bug.cgi?id=187458

Reviewed by Zalan Bujtas.

Shrink RenderSVGViewportContainer from 296 bytes to 280 bytes, saving about 6KB on nytimes.com.

* rendering/svg/RenderSVGContainer.cpp:
(WebCore::RenderSVGContainer::RenderSVGContainer):
* rendering/svg/RenderSVGContainer.h:
* rendering/svg/RenderSVGViewportContainer.h:

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

2 years agoShrink RenderTableSection
simon.fraser@apple.com [Mon, 9 Jul 2018 05:35:38 +0000 (05:35 +0000)]
Shrink RenderTableSection
https://bugs.webkit.org/show_bug.cgi?id=187457

Reviewed by Zalan Bujtas.

Shrink RenderTableSection from 344 to 336 bytes, saving about 3.6KB on nytimes.com.

* rendering/RenderTableSection.h:

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

2 years agoOptimize packing of RootInlineBox
simon.fraser@apple.com [Mon, 9 Jul 2018 05:09:21 +0000 (05:09 +0000)]
Optimize packing of RootInlineBox
https://bugs.webkit.org/show_bug.cgi?id=187430

Reviewed by Zalan Bujtas.

In InlineBox, move the m_logicalWidth float up next to the m_expansion float with m_topLeft next; this
avoids padding of 4 bytes after this float.

In InlineFlowBox, move the bitfields before the pointers so they can snug up into the
4 bytes after m_expansion in the base class.

The comment about m_lineBreakPos's padding in RootInlineBox is wrong; just move it to the end
to avoid padding before the m_lineBreakObj pointer.

Make m_logicalWidth private and have derived classes use the accessor.

Make EllipsisBox 4 bytes smaller too.

* rendering/EllipsisBox.cpp:
(WebCore::EllipsisBox::EllipsisBox):
(WebCore::EllipsisBox::paintMarkupBox):
(WebCore::EllipsisBox::nodeAtPoint):
* rendering/EllipsisBox.h:
* rendering/InlineBox.h:
(WebCore::InlineBox::InlineBox):
* rendering/InlineFlowBox.cpp:
* rendering/InlineFlowBox.h:
(WebCore::InlineFlowBox::InlineFlowBox):
(WebCore::InlineFlowBox::frameRectIncludingLineHeight const):
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::localSelectionRect const):
(WebCore::InlineTextBox::paint):
(WebCore::InlineTextBox::paintPlatformDocumentMarker):
(WebCore::InlineTextBox::paintMarkedTextBackground):
(WebCore::InlineTextBox::paintCompositionUnderline const):
* rendering/RootInlineBox.cpp:
(WebCore::RootInlineBox::RootInlineBox):
* rendering/RootInlineBox.h:

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

2 years agoUnreviewed, build fix for debug builds after r233630
utatane.tea@gmail.com [Mon, 9 Jul 2018 04:37:24 +0000 (04:37 +0000)]
Unreviewed, build fix for debug builds after r233630
https://bugs.webkit.org/show_bug.cgi?id=187441

* jit/JIT.cpp:
(JSC::JIT::frameRegisterCountFor):
* llint/LLIntEntrypoint.cpp:
(JSC::LLInt::frameRegisterCountFor):

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

2 years ago[Web Animations] A number of tests report an incorrect computed offset
commit-queue@webkit.org [Mon, 9 Jul 2018 04:10:41 +0000 (04:10 +0000)]
[Web Animations] A number of tests report an incorrect computed offset
https://bugs.webkit.org/show_bug.cgi?id=187410
<rdar://problem/41905790>

Patch by Antoine Quint <graouts@apple.com> on 2018-07-08
Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

Mark 16 new WPT progressions.

* web-platform-tests/web-animations/interfaces/Animatable/animate-expected.txt:
* web-platform-tests/web-animations/interfaces/KeyframeEffect/constructor-expected.txt:
* web-platform-tests/web-animations/interfaces/KeyframeEffect/processing-a-keyframes-argument-001-expected.txt:
* web-platform-tests/web-animations/interfaces/KeyframeEffect/setKeyframes-expected.txt:

Source/WebCore:

While we would correctly avoid computing missing offsets when processing the first keyframe following the last
keyframes with a specified offset, we were forgetting to update the index of the last keyframe with a specified
offset which meant we would accidentally override a specified offset with an automically-computed one.

* animation/KeyframeEffectReadOnly.cpp:
(WebCore::computeMissingKeyframeOffsets):

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

2 years agorun-benchmark should run ARES-6 1.0.1
fpizlo@apple.com [Sun, 8 Jul 2018 23:18:47 +0000 (23:18 +0000)]
run-benchmark should run ARES-6 1.0.1
https://bugs.webkit.org/show_bug.cgi?id=187452

Reviewed by Sam Weinig.

We forgot to update this when we released 1.0.1!

* Scripts/webkitpy/benchmark_runner/data/plans/ares6.plan:

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

2 years ago[JSC] Optimize layout of CodeBlock to reduce padding
utatane.tea@gmail.com [Sun, 8 Jul 2018 17:59:25 +0000 (17:59 +0000)]
[JSC] Optimize layout of CodeBlock to reduce padding
https://bugs.webkit.org/show_bug.cgi?id=187441

Reviewed by Mark Lam.

Arrange the order of members to reduce the size of CodeBlock from 552 to 544.
We also make SourceCodeRepresentation 1 byte since CodeBlock has a vector of this,
Vector<SourceCodeRepresentation> m_constantsSourceCodeRepresentation.

We also move m_numCalleeLocals and m_numVars from `public` to `private` in CodeBlock.

* bytecode/BytecodeDumper.cpp:
(JSC::BytecodeDumper<Block>::dumpBlock):
* bytecode/BytecodeUseDef.h:
(JSC::computeDefsForBytecodeOffset):
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::CodeBlock):
* bytecode/CodeBlock.h:
(JSC::CodeBlock::numVars const):
* bytecode/UnlinkedCodeBlock.h:
(JSC::UnlinkedCodeBlock::numVars const):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::ByteCodeParser):
(JSC::DFG::ByteCodeParser::flushForTerminalImpl):
(JSC::DFG::ByteCodeParser::handleRecursiveTailCall):
(JSC::DFG::ByteCodeParser::inlineCall):
(JSC::DFG::ByteCodeParser::handleGetById):
(JSC::DFG::ByteCodeParser::handlePutById):
(JSC::DFG::ByteCodeParser::parseBlock):
* dfg/DFGGraph.h:
(JSC::DFG::Graph::forAllLocalsLiveInBytecode):
* dfg/DFGOSREntrypointCreationPhase.cpp:
(JSC::DFG::OSREntrypointCreationPhase::run):
* dfg/DFGVariableEventStream.cpp:
(JSC::DFG::VariableEventStream::reconstruct const):
* ftl/FTLOSREntry.cpp:
(JSC::FTL::prepareOSREntry):
* ftl/FTLState.cpp:
(JSC::FTL::State::State):
* interpreter/Interpreter.cpp:
(JSC::Interpreter::dumpRegisters):
* jit/JIT.cpp:
(JSC::JIT::frameRegisterCountFor):
* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_enter):
* jit/JITOpcodes32_64.cpp:
(JSC::JIT::emit_op_enter):
* jit/JITOperations.cpp:
* llint/LLIntEntrypoint.cpp:
(JSC::LLInt::frameRegisterCountFor):
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::traceFunctionPrologue):
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
* runtime/JSCJSValue.h:

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

2 years ago[JSC] Optimize padding of UnlinkedCodeBlock to shrink
utatane.tea@gmail.com [Sun, 8 Jul 2018 17:39:55 +0000 (17:39 +0000)]
[JSC] Optimize padding of UnlinkedCodeBlock to shrink
https://bugs.webkit.org/show_bug.cgi?id=187448

Reviewed by Saam Barati.

Source/JavaScriptCore:

We optimize the size of CodeType and TriState. And we arrange the layout of UnlinkedCodeBlock.
These optimizations reduce the size of UnlinkedCodeBlock from 304 to 288.

* bytecode/CodeType.h:
* bytecode/UnlinkedCodeBlock.cpp:
(JSC::UnlinkedCodeBlock::UnlinkedCodeBlock):
* bytecode/UnlinkedCodeBlock.h:
(JSC::UnlinkedCodeBlock::codeType const):
(JSC::UnlinkedCodeBlock::didOptimize const):
(JSC::UnlinkedCodeBlock::setDidOptimize):
* bytecode/VirtualRegister.h:

Source/WTF:

* wtf/TriState.h:

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

2 years agoDOMMatrix.invertSelf() returns garbage values for a non-invertible matrix
ddkilzer@apple.com [Sun, 8 Jul 2018 16:58:29 +0000 (16:58 +0000)]
DOMMatrix.invertSelf() returns garbage values for a non-invertible matrix
<https://webkit.org/b/187446>
<rdar://problem/41853187>

Reviewed by Daniel Bates.

Source/WebCore:

Test: http/wpt/css/geometry/DOMMatrix-invertSelf.html

* css/DOMMatrix.cpp:
(WebCore::DOMMatrix::invertSelf): Add missing `else`, and
restructure to use positive logic.

LayoutTests:

* http/wpt/css/geometry/DOMMatrix-invertSelf-expected.txt: Add.
* http/wpt/css/geometry/DOMMatrix-invertSelf.html: Add.
* http/wpt/css/geometry/support/dommatrix-test-util.js: Copy from
  LayoutTests/imported/w3c/web-platform-tests/css/geometry/support/dommatrix-test-util.js.

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

2 years ago[JSC] Optimize padding of InferredTypeTable by using cellLock
utatane.tea@gmail.com [Sun, 8 Jul 2018 16:41:14 +0000 (16:41 +0000)]
[JSC] Optimize padding of InferredTypeTable by using cellLock
https://bugs.webkit.org/show_bug.cgi?id=187447

Reviewed by Mark Lam.

Use cellLock() in InferredTypeTable to guard changes of internal structures.
This is the same usage to SparseArrayValueMap. By using cellLock(), we can
reduce the size of InferredTypeTable from 40 to 32.

* runtime/InferredTypeTable.cpp:
(JSC::InferredTypeTable::visitChildren):
(JSC::InferredTypeTable::get):
(JSC::InferredTypeTable::willStoreValue):
(JSC::InferredTypeTable::makeTop):
* runtime/InferredTypeTable.h:
Using enum class and using. And remove `isEmpty()` since it is not used.

* runtime/Structure.h:

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

2 years ago[JSC] Optimize layout of SourceProvider to reduce padding
utatane.tea@gmail.com [Sun, 8 Jul 2018 12:29:08 +0000 (12:29 +0000)]
[JSC] Optimize layout of SourceProvider to reduce padding
https://bugs.webkit.org/show_bug.cgi?id=187440

Reviewed by Mark Lam.

Arrange members of SourceProvider to reduce the size from 80 to 72.

* parser/SourceProvider.cpp:
(JSC::SourceProvider::SourceProvider):
* parser/SourceProvider.h:

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

2 years agoPropertyTable::skipDeletedEntries() should guard against iterating past the table...
mark.lam@apple.com [Sun, 8 Jul 2018 09:54:51 +0000 (09:54 +0000)]
PropertyTable::skipDeletedEntries() should guard against iterating past the table end.
https://bugs.webkit.org/show_bug.cgi?id=187444
<rdar://problem/41282849>

Reviewed by Saam Barati.

PropertyTable supports C++ iteration by offering begin() and end() methods, and
an iterator class.  The begin() methods and the iterator operator++() method uses
PropertyTable::skipDeletedEntries() to skip over deleted entries in the table.
However, PropertyTable::skipDeletedEntries() does not prevent the iteration
pointer from being incremented past the end of the table.  As a result, we can
iterate past the end of the table.  Note that the C++ iteration protocol tests
for the iterator not being equal to the end() value.  It does not do a <= test.
If the iterator ever shoots past end, the loop will effectively not terminate.

This issue can manifest if and only if the last entry in the table is a deleted
one, and the key field of the PropertyMapEntry shaped space at the end of the
table (the one beyond the last) contains a 1 (i.e. PROPERTY_MAP_DELETED_ENTRY_KEY)
value.

No test because manifesting this issue requires uncontrollable happenstance where
memory just beyond the end of the table looks like a deleted entry.

* runtime/PropertyMapHashTable.h:
(JSC::PropertyTable::begin):
(JSC::PropertyTable::end):
(JSC::PropertyTable::begin const):
(JSC::PropertyTable::end const):
(JSC::PropertyTable::skipDeletedEntries):

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

2 years agoWPT importer should create dummy HTML files for *.window.js script files
youenn@apple.com [Sat, 7 Jul 2018 22:29:08 +0000 (22:29 +0000)]
WPT importer should create dummy HTML files for *.window.js script files
https://bugs.webkit.org/show_bug.cgi?id=187426

Reviewed by Ryosuke Niwa.

Some WPT tests use *.window.js tests, which should be accessed as *.window.html.
Do the same strategy as done for worker.js/any.js files.

* Scripts/webkitpy/w3c/test_importer.py:
(TestImporter.write_html_files_for_templated_js_tests):

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

2 years agoIntroduce a layout milestone to track when the document contains a large number of...
wenson_hsieh@apple.com [Sat, 7 Jul 2018 21:05:45 +0000 (21:05 +0000)]
Introduce a layout milestone to track when the document contains a large number of rendered characters
https://bugs.webkit.org/show_bug.cgi?id=187412
<rdar://problem/41744338>

Reviewed by Ryosuke Niwa.

Source/WebCore:

Implements a new layout milestone: `DidRenderSignificantAmountOfText`. This is similar to the existing
`DidFirstVisuallyNonEmptyLayout` milestone, but with a few important additional constraints:

• The minimum threshold of rendered characters is much larger (3000 instead of 200).
• The mean length of a text node must be large (at least 50).

This is a (computationally) lightweight heuristic intended to estimate the likelihood that a page is capable of
being presented in Reader mode. In many article-like pages, the average length of a text node is significantly
longer than other types of pages; thus, on pages where the average length of a text node is very large *and*
there is a large quantity of text, we can use this as a cue to opportunistically detect and enter Safari reader
mode on watchOS.

Test: RenderingProgressTests.DidRenderSignificantAmountOfText

* page/FrameView.cpp:
(WebCore::FrameView::reset):

Clear out new state members that keep track of whether the significant rendered text milestone has been met.

(WebCore::elementOverflowRectIsLargerThanThreshold):

Factor out logic to grab the overflow height of an element into a separate helper function.

(WebCore::FrameView::qualifiesAsVisuallyNonEmpty const):
(WebCore::FrameView::updateSignificantRenderedTextMilestoneIfNeeded):

Determines whether to fire this new milestone after the next layout pass is finished. The logic here is similar
to the logic in qualifiesAsVisuallyNonEmpty, requiring that there are not still pending stylesheets in the head
and that the document height is at least a minimum threshold. However, unlike the first visually non-empty
layout, this milestone is never guaranteed to fire.

(WebCore::FrameView::fireLayoutRelatedMilestonesIfNeeded):
* page/FrameView.h:
(WebCore::FrameView::incrementVisuallyNonEmptyCharacterCount):
* page/LayoutMilestones.h:

Source/WebKit:

Add plumbing for the new significant rendered text layout milestone in the modern WebKit client layer. See
WebCore/ChangeLog for more details.

* Shared/API/Cocoa/_WKRenderingProgressEvents.h:
* Shared/API/Cocoa/_WKRenderingProgressEventsInternal.h:
(renderingProgressEvents):
* Shared/API/c/WKPageLoadTypes.h:
* Shared/API/c/WKSharedAPICast.h:
(WebKit::toWKLayoutMilestones):
(WebKit::toLayoutMilestones):
* UIProcess/API/Cocoa/WKWebView.mm:
(layoutMilestones):

Tools:

Add a new API test to check that we observe the new rendering milestone in an article-like document.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKitCocoa/significant-text-milestone.html: Added.
* TestWebKitAPI/Tests/ios/RenderingProgressTests.mm:
(TEST):

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

2 years ago[JSC] Optimize layout of SymbolTable to reduce padding
utatane.tea@gmail.com [Sat, 7 Jul 2018 20:46:28 +0000 (20:46 +0000)]
[JSC] Optimize layout of SymbolTable to reduce padding
https://bugs.webkit.org/show_bug.cgi?id=187437

Reviewed by Mark Lam.

Arrange the layout of SymbolTable to reduce the size from 88 to 72.

* runtime/SymbolTable.h:

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

2 years ago[JSC] Optimize layout of RegExp to reduce padding
utatane.tea@gmail.com [Sat, 7 Jul 2018 20:29:31 +0000 (20:29 +0000)]
[JSC] Optimize layout of RegExp to reduce padding
https://bugs.webkit.org/show_bug.cgi?id=187438

Reviewed by Mark Lam.

Reduce the size of RegExp from 168 to 144.

* runtime/RegExp.cpp:
(JSC::RegExp::RegExp):
* runtime/RegExp.h:
* runtime/RegExpKey.h:
* yarr/YarrErrorCode.h:

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

2 years ago[JSC] Optimize layout of ValueProfile to reduce padding
utatane.tea@gmail.com [Sat, 7 Jul 2018 20:29:01 +0000 (20:29 +0000)]
[JSC] Optimize layout of ValueProfile to reduce padding
https://bugs.webkit.org/show_bug.cgi?id=187439

Reviewed by Mark Lam.

Reduce the size of ValueProfile from 40 to 32 by reordering members.

* bytecode/ValueProfile.h:
(JSC::ValueProfileBase::ValueProfileBase):

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

2 years agoREGRESSION (r233561): MobileMail crashes when replying to an email
simon.fraser@apple.com [Sat, 7 Jul 2018 17:50:54 +0000 (17:50 +0000)]
REGRESSION (r233561): MobileMail crashes when replying to an email
https://bugs.webkit.org/show_bug.cgi?id=187436
rdar://problem/41931915

Reviewed by Alan Bujtas.

r233561 added a RELEASE_ASSERT(isMainThread()) in this function. This is fine most of the time,
until Mail spawns a WebThread for mail compose, at which point the meaning of isMainThread changes
and the RELEASE_ASSERT fires.

For now, just remove the RELEASE_ASSERT.

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

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

2 years agoiOS port should define HAVE_RUNLOOP_TIMER
ddkilzer@apple.com [Sat, 7 Jul 2018 16:20:30 +0000 (16:20 +0000)]
iOS port should define HAVE_RUNLOOP_TIMER
<https://webkit.org/b/187370>

Reviewed by Simon Fraser.

* wtf/Platform.h:
(HAVE_DTRACE): Remove unused macro since r200568.
(HAVE_RUNLOOP_TIMER): Define for PLATFORM(COCOA), not just
PLATFORM(MAC).  Alphabetize macros.

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

2 years agodump-class-layout reports wrong padding in many cases
simon.fraser@apple.com [Sat, 7 Jul 2018 15:52:49 +0000 (15:52 +0000)]
dump-class-layout reports wrong padding in many cases
https://bugs.webkit.org/show_bug.cgi?id=185801

Reviewed by Dan Bates.

Enhance dump-class-layout, fixing bugs and adding unit tests. This also includes
the patch from bug 187141.

Move the code that uses lldb to fetch the class layout to its own module,
lldb_dump_class_layout.py, so it can be unit tested. Change this code
to build up a data structure for the class. This is necessary since correct
padding computation is easier with second traversal over the data structure.

Try to deal with the empty base class optimization, which is necessary to report
correct padding in classes using std::unique_ptr, and correctly handle virtual base classes.

The ClassLayoutBase class knows how to test for equality and generate a string
or string list representation of itself. The derived ClassLayout class knows
how to build up the class layout using the lldb Python bindings.

Finally we wrap the lldb debugger instance in LLDBDebuggerInstance so that we don't
have to make a new one for each unit test. The tests have to run serially.

Add to lldbWebKitTester a .cpp file that contains a set of C++ classes to unit-test
dump-class-layout.

* Scripts/dump-class-layout:
(main):
* lldb/dump_class_layout_unittest.py:
(destroy_cached_debug_session):
(TestDumpClassLayout):
(TestDumpClassLayout.setUpClass):
(TestDumpClassLayout.setUp):
(TestDumpClassLayout.serial_test_BasicClassLayout):
(serial_test_PaddingBetweenClassMembers):
(serial_test_BoolPaddingClass):
(serial_test_ClassWithEmptyClassMembers):
(serial_test_SimpleVirtualClass):
(serial_test_SimpleVirtualClassWithNonVirtualBase):
(serial_test_InterleavedVirtualNonVirtual):
(serial_test_ClassWithTwoVirtualBaseClasses):
(serial_test_ClassWithClassMembers):
(serial_test_ClassWithBitfields):
(serial_test_ClassWithUniquePtrs):
(serial_test_ClassWithOptionals):
(TestDumpClassLayout.test_BasicClassLayout): Deleted.
* lldb/lldbWebKitTester/DumpClassLayoutTesting.cpp:
(EmptyClass::doStuff):
(VirtualBaseClass::~VirtualBaseClass):
(VirtualBaseClass2::~VirtualBaseClass2):
(SimpleVirtualClass::~SimpleVirtualClass):
(SimpleVirtualClass::doStuff):
(SimpleVirtualClassWithNonVirtualBase::~SimpleVirtualClassWithNonVirtualBase):
(SimpleVirtualClassWithNonVirtualBase::doStuff):
(avoidClassDeadStripping):
* lldb/lldb_dump_class_layout.py:
(ansi_colors):
(ClassLayoutBase):
(ClassLayoutBase.__init__):
(ClassLayoutBase.__ne__):
(ClassLayoutBase.__eq__):
(ClassLayoutBase._to_string_recursive):
(ClassLayoutBase.as_string_list):
(ClassLayoutBase.as_string):
(ClassLayoutBase.dump):
(ClassLayoutExpected):
(ClassLayoutExpected.__init__):
(ClassLayout):
(ClassLayout.__init__):
(ClassLayout._has_polymorphic_base_class):
(ClassLayout._parse):
(ClassLayout._probably_has_empty_base_class_optimization):
(ClassLayout._compute_padding_recursive):
(ClassLayout._compute_padding):
(LLDBDebuggerInstance):
(LLDBDebuggerInstance.__init__):
(LLDBDebuggerInstance.__del__):
(LLDBDebuggerInstance._get_first_file_architecture):
(LLDBDebuggerInstance.layout_for_classname):
(ClassLayoutDumper): Deleted.
(ClassLayoutDumper.__init__): Deleted.
(ClassLayoutDumper._get_first_file_architecture): Deleted.
(ClassLayoutDumper.verify_type): Deleted.
(ClassLayoutDumper.verify_type_recursive): Deleted.
(ClassLayoutDumper._class_layout_as_string): Deleted.
(ClassLayoutDumper.dump_to_string): Deleted.
(ClassLayoutDumper.dump): Deleted.

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

2 years ago[linux] ASSERT: Using an alternative signal stack is not supported. Consider disablin...
utatane.tea@gmail.com [Sat, 7 Jul 2018 07:10:20 +0000 (07:10 +0000)]
[linux] ASSERT: Using an alternative signal stack is not supported. Consider disabling the concurrent GC.
https://bugs.webkit.org/show_bug.cgi?id=187297

Reviewed by Mark Lam.

This patch relaxes the JSC's limitation: accepting an alternative signal stack mechanism.

* wtf/ThreadingPthreads.cpp:
(WTF::getApproximateStackPointer):
Fix approximate stack pointer function to make it valid.

(WTF::Thread::signalHandlerSuspendResume):
Use StackBounds::contains to check whether the given stack pointer is in range of StackBounds.
If it is out of range, it seems that this stack pointer is pointing an alternative signal stack.

(WTF::Thread::suspend):
Repeatedly retry suspension by using Thread::yield().

(WTF::isOnAlternativeSignalStack): Deleted.

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

2 years agoSemantic colors don't update when accessibility Increase Contrast mode is enabled.
timothy@apple.com [Sat, 7 Jul 2018 03:43:04 +0000 (03:43 +0000)]
Semantic colors don't update when accessibility Increase Contrast mode is enabled.
https://bugs.webkit.org/show_bug.cgi?id=187425
rdar://problem/39948240

Reviewed by Tim Horton.

Source/WebCore:

Added a listener for the accessibility change notification to invalidate our color caches.

Removed calls to RenderTheme::singleton().platformColorsDidChange() in Page, since that
ended up calling Page::updateStyleForAllPagesAfterGlobalChangeInEnvironment multiple times.
Instead, changed the functions to use the new instance version instead.

* page/Page.cpp:
(WebCore::Page::updateStyleAfterChangeInEnvironment): Added. Gives Page a direct way to do this work
per instance instead of on all pages (since appearance can be difference per view).
(WebCore::Page::updateStyleForAllPagesAfterGlobalChangeInEnvironment): Call updateStyleAfterChangeInEnvironment.
(WebCore::Page::setUseSystemAppearance): Call updateStyleAfterChangeInEnvironment.
(WebCore::Page::setUseDarkAppearance): Added. Call updateStyleAfterChangeInEnvironment.
* page/Page.h:
(WebCore::Page::setUseDarkAppearance): Moved to the implementation file.
* platform/mac/LocalDefaultSystemAppearance.mm:
(WebCore::LocalDefaultSystemAppearance::LocalDefaultSystemAppearance): Removed recursive check since it was interfering
with the setting of m_usingDarkAppearance and causing the wrong color cache to be used.
(WebCore::LocalDefaultSystemAppearance::~LocalDefaultSystemAppearance): Ditto.
* rendering/RenderThemeMac.mm:
(-[WebCoreRenderThemeNotificationObserver init]): Listen for NSWorkspaceAccessibilityDisplayOptionsDidChangeNotification.
(-[WebCoreRenderThemeNotificationObserver systemColorsDidChange:]): Removed assert since multiple notifications are used now.

Source/WebKit:

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]): Moved call to setUseDarkAppearance to WebViewImpl.
(-[WKWebView _setUseSystemAppearance:]): No need to call setUseDarkAppearance here anymore.
(-[WKWebView viewDidChangeEffectiveAppearance]): Added. This is the proper NSView method to use.
(-[WKWebView _effectiveAppearanceIsDark]): Deleted.
(-[WKWebView effectiveAppearanceDidChange]): Deleted. This method is a deprecated name.
* UIProcess/API/mac/WKView.mm:
(-[WKView viewDidChangeEffectiveAppearance]): Added. This is the proper NSView method to use.
(-[WKView _setUseSystemAppearance:]): No need to call setUseDarkAppearance here anymore.
(-[WKView _effectiveAppearanceIsDark]): Deleted.
(-[WKView effectiveAppearanceDidChange]): Deleted. This method is a deprecated name.
* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::WebViewImpl): Call setUseDarkAppearance before page config is sent in initializeWebPage.
(WebKit::WebViewImpl::effectiveAppearanceDidChange): Added.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::setUseDarkAppearance): WebCore::Page::setUseDarkAppearance now handles the style changes.
The RenderTheme color caches also don't need cleared with platformColorsDidChange(), since we cache light
and dark colors seperatly in RenderThemeMac.

Source/WebKitLegacy/mac:

* WebView/WebView.mm:
(-[WebView _commonInitializationWithFrameName:groupName:]): Removed call to
_updateDefaultAppearance, which called setUseDarkAppearance. There is already
a call in this method to setUseDarkAppearance.
(-[WebView _setUseSystemAppearance:]): Just call the page, not setUseDarkAppearance.
(-[WebView viewDidChangeEffectiveAppearance]): Added. This is the proper NSView method to use.
(-[WebView _updateDefaultAppearance]): Deleted.
(-[WebView effectiveAppearanceDidChange]): Deleted. This method is a deprecated name.

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

2 years agoMake ReasonForSuspension enum class
rniwa@webkit.org [Sat, 7 Jul 2018 02:56:20 +0000 (02:56 +0000)]
Make ReasonForSuspension enum class
https://bugs.webkit.org/show_bug.cgi?id=187405

Reviewed by Zalan Bujtas.

Made ReasonForSuspension an enum class instead of enum and moved out of ActiveDOMObject.

* Modules/geolocation/Geolocation.cpp:
(WebCore::Geolocation::suspend):
* Modules/websockets/WebSocket.cpp:
(WebCore::WebSocket::suspend):
* dom/ActiveDOMObject.h:
* dom/Document.cpp:
(WebCore::Document::didBecomeCurrentDocumentInFrame):
(WebCore::Document::suspendActiveDOMObjects):
(WebCore::Document::resumeActiveDOMObjects):
(WebCore::Document::suspend):
(WebCore::Document::resume):
(WebCore::Document::suspendScheduledTasks):
(WebCore::Document::resumeScheduledTasks):
* dom/Document.h:
* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::suspendActiveDOMObjects):
(WebCore::ScriptExecutionContext::resumeActiveDOMObjects):
* dom/ScriptExecutionContext.h:
(WebCore::ScriptExecutionContext::reasonForSuspendingActiveDOMObjects const):
* history/CachedFrame.cpp:
(WebCore::CachedFrameBase::restore):
(WebCore::CachedFrame::CachedFrame):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::suspend):
* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::suspend):
* inspector/PageScriptDebugServer.cpp:
(WebCore::PageScriptDebugServer::setJavaScriptPaused):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::commitProvisionalLoad):
* page/Frame.cpp:
(WebCore::Frame::suspendActiveDOMObjectsAndAnimations):
(WebCore::Frame::resumeActiveDOMObjectsAndAnimations):
* page/PageGroupLoadDeferrer.cpp:
(WebCore::PageGroupLoadDeferrer::PageGroupLoadDeferrer):
(WebCore::PageGroupLoadDeferrer::~PageGroupLoadDeferrer):
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::suspend):

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

2 years ago[WinCairo] WebKit MiniBrowser crashes when attempting to navigate to certain URLs
chris.reid@sony.com [Sat, 7 Jul 2018 02:24:35 +0000 (02:24 +0000)]
[WinCairo] WebKit MiniBrowser crashes when attempting to navigate to certain URLs
https://bugs.webkit.org/show_bug.cgi?id=187167

Reviewed by Alex Christensen.

A null byte was written past the end of the buffer causing the crash.
Some of the heap allocated buffers were also not getting deleted.

* MiniBrowser/win/WebKitBrowserWindow.cpp:

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

2 years agolibWebRTC GetThreadCpuTimeNanos() leaks mach_ports
youenn@apple.com [Sat, 7 Jul 2018 00:48:04 +0000 (00:48 +0000)]
libWebRTC GetThreadCpuTimeNanos() leaks mach_ports
https://bugs.webkit.org/show_bug.cgi?id=187403
<rdar://problem/41741599>

Reviewed by Simon Fraser.

* Source/webrtc/rtc_base/cpu_time.cc: Call mach_port_deallocate to
to ensure mach_port is deleted.
* libwebrtc.xcodeproj/project.pbxproj: Stop compiling this file since
this is not used except by libwebrtc tests.

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

2 years agoWeb Inspector: Dark Mode: resource search field has white text on white background
nvasilyev@apple.com [Sat, 7 Jul 2018 00:44:29 +0000 (00:44 +0000)]
Web Inspector: Dark Mode: resource search field has white text on white background
https://bugs.webkit.org/show_bug.cgi?id=187423

Reviewed by Timothy Hatcher.

Match the colors of sidebar filter fields.

* UserInterface/Views/DarkMode.css:
(@media (prefers-dark-interface)):
(.find-banner > input[type="search"]):

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

2 years agoAX: add a subrole for meter elements on macOS
n_wang@apple.com [Sat, 7 Jul 2018 00:34:40 +0000 (00:34 +0000)]
AX: add a subrole for meter elements on macOS
https://bugs.webkit.org/show_bug.cgi?id=187409
<rdar://problem/41905702>

Reviewed by Chris Fleizach.

Source/WebCore:

Test: accessibility/mac/meter-subrole.html

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

LayoutTests:

* accessibility/mac/meter-subrole-expected.txt: Added.
* accessibility/mac/meter-subrole.html: Added.
* platform/mac/accessibility/roles-exposed-expected.txt:

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

2 years agoFor <video> element, use video fullscreen instead of element fullscreen.
commit-queue@webkit.org [Sat, 7 Jul 2018 00:15:26 +0000 (00:15 +0000)]
For <video> element, use video fullscreen instead of element fullscreen.
https://bugs.webkit.org/show_bug.cgi?id=186093
rdar://problem/40144751

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

Some pages use webkitRequestFullscreen directly on the video element, without any custom controls.
This will prevent native fullscreeen presentation mode conrols from being used.

This change makes webkitRequestFullscreen on a video element call webKitSetPresentationMode.

* dom/Element.h:
* html/HTMLVideoElement.cpp:
(WebCore::HTMLVideoElement::webkitRequestFullscreen):
* html/HTMLVideoElement.h:

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

2 years agoWebRTC MediaStreamTrack Enable / Disable causes video delay / lag
youenn@apple.com [Fri, 6 Jul 2018 23:47:00 +0000 (23:47 +0000)]
WebRTC MediaStreamTrack Enable / Disable causes video delay / lag
https://bugs.webkit.org/show_bug.cgi?id=186889
<rdar://problem/41370285>

Reviewed by Eric Carlson.

Source/WebCore:

Libwebrtc expects a continuous flow of calls for audio data since the API
does not provide any possiblity to give timestamps.

We were optimizing previously when a source is muted so that we would not transmit audio data.
This breaks synchronization between audio and video frames (which are timestamped).

This patch reverts the optimization and instead makes sure to send zeros for silenced audio tracks.

This requires MediaStreamTrackPrivate to send audio data even if disabled,
so that RealtimeOutgoingAudioSource will continue sending zeros at the correct pace.
This also requires WebAudioSourceProviderAVFObjC to exit early if its track is disabled.

Covered by existing tests.
Manual testing shows that synchronization is kept.

* platform/mediastream/MediaStreamTrackPrivate.cpp:
(WebCore::MediaStreamTrackPrivate::audioSamplesAvailable):
* platform/mediastream/RealtimeOutgoingAudioSource.cpp:
(WebCore::RealtimeOutgoingAudioSource::RealtimeOutgoingAudioSource):
(WebCore::RealtimeOutgoingAudioSource::initializeConverter):
(WebCore::RealtimeOutgoingAudioSource::stop):
(WebCore::RealtimeOutgoingAudioSource::sourceMutedChanged):
(WebCore::RealtimeOutgoingAudioSource::sourceEnabledChanged):
(WebCore::RealtimeOutgoingAudioSource::handleMutedIfNeeded): Deleted.
* platform/mediastream/RealtimeOutgoingAudioSource.h:
(WebCore::RealtimeOutgoingAudioSource::pullAudioData):
(WebCore::RealtimeOutgoingAudioSource::isSilenced const):
(WebCore::RealtimeOutgoingAudioSource::sendSilence): Deleted.
* platform/mediastream/mac/RealtimeOutgoingAudioSourceCocoa.cpp:
(WebCore::RealtimeOutgoingAudioSourceCocoa::pullAudioData):
(WebCore::RealtimeOutgoingAudioSourceCocoa::handleMutedIfNeeded): Deleted.
(WebCore::RealtimeOutgoingAudioSourceCocoa::sendSilence): Deleted.
* platform/mediastream/mac/RealtimeOutgoingAudioSourceCocoa.h:
* platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm:
(WebCore::WebAudioSourceProviderAVFObjC::audioSamplesAvailable):

LayoutTests:

Test is no longer valid since we are now sending 0 bytes for audio tracks.

* webrtc/audio-muted-stats2-expected.txt: Removed.
* webrtc/audio-muted-stats2.html: Removed.

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

2 years agoSkip imported/w3c/web-platform-tests/infrastructure/assumptions/html-elements.html...
ryanhaddad@apple.com [Fri, 6 Jul 2018 23:40:07 +0000 (23:40 +0000)]
Skip imported/w3c/web-platform-tests/infrastructure/assumptions/html-elements.html on debug.
https://bugs.webkit.org/show_bug.cgi?id=187093

Unreviewed test gardening.

* TestExpectations:

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

2 years agoMake RealtimeOutgoingVideoSource use DestructionThread::Main
youenn@apple.com [Fri, 6 Jul 2018 23:30:22 +0000 (23:30 +0000)]
Make RealtimeOutgoingVideoSource use DestructionThread::Main
https://bugs.webkit.org/show_bug.cgi?id=187402

Reviewed by Chris Dumez.

No change of behavior.

* platform/mediastream/RealtimeOutgoingVideoSource.h:

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

2 years agoAdd release assertions to try and catch a possible HashMap corruption in NetworkConne...
cdumez@apple.com [Fri, 6 Jul 2018 23:26:09 +0000 (23:26 +0000)]
Add release assertions to try and catch a possible HashMap corruption in NetworkConnectionToWebProcess
https://bugs.webkit.org/show_bug.cgi?id=187417

Reviewed by Ryosuke Niwa.

Add assertions to make sure we:
- Always use NetworkConnectionToWebProcess::m_networkResourceLoaders from the main thread
- Never use a 0 identifier as key for NetworkConnectionToWebProcess::m_networkResourceLoaders

We see crashes (rdar://problem/39265927) that only seem to make sense if this HashMap was
somehow getting corrupted. Let's try and catch the most common reasons for HashMap corruption.

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::didCleanupResourceLoader):
(WebKit::NetworkConnectionToWebProcess::didReceiveMessage):
(WebKit::NetworkConnectionToWebProcess::scheduleResourceLoad):
(WebKit::NetworkConnectionToWebProcess::performSynchronousLoad):
(WebKit::NetworkConnectionToWebProcess::removeLoadIdentifier):
(WebKit::NetworkConnectionToWebProcess::setDefersLoading):
(WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload):
* WebProcess/Network/WebResourceLoader.cpp:
(WebKit::WebResourceLoader::messageSenderDestinationID):

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

2 years agoWebDriver: hang in Selenium test alerts_tests.py::testShouldHandleAlertOnPageBeforeUnload
bburg@apple.com [Fri, 6 Jul 2018 23:11:02 +0000 (23:11 +0000)]
WebDriver: hang in Selenium test alerts_tests.py::testShouldHandleAlertOnPageBeforeUnload
https://bugs.webkit.org/show_bug.cgi?id=187418
<rdar://problem/41909520>

Reviewed by Timothy Hatcher.

Per the W3C specification, “User prompts that are spawned from beforeunload event handlers,
are dismissed implicitly upon navigation or close window, regardless of the defined user prompt handler.”

This behavior differs from legacy Selenium behavior where (as in the test) it's expected that
a test can accept or dismiss a beforeunload alert manually.

Prior to this patch, beforeunload alerts hang because Safari uses a nested modal run loop, which does
not process incoming Automation messages, so there was no way for the test to manually dismiss
the alert.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::runBeforeUnloadConfirmPanel):
Don't show beforeunload alerts for pages being controlled by automation.

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

2 years agoThis test is flaky. This unreviewed patch is my attempt to make it less so.
beidson@apple.com [Fri, 6 Jul 2018 22:54:38 +0000 (22:54 +0000)]
This test is flaky. This unreviewed patch is my attempt to make it less so.

* storage/indexeddb/modern/opendatabase-after-storage-crash.html:

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

2 years agoASSERTION FAILED: contextConnection under WebCore::SWServer::terminateWorkerInternal
cdumez@apple.com [Fri, 6 Jul 2018 22:23:56 +0000 (22:23 +0000)]
ASSERTION FAILED: contextConnection under WebCore::SWServer::terminateWorkerInternal
https://bugs.webkit.org/show_bug.cgi?id=187348
<rdar://problem/41853270>

Reviewed by Youenn Fablet.

Make sure we mark corresponding SWServerWorkers as terminated when we terminate a
Service Worker context connection once it is no longer needed.

* StorageProcess/StorageProcess.cpp:
(WebKit::StorageProcess::swContextConnectionMayNoLongerBeNeeded):

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

2 years agoLayout Test imported/w3c/web-platform-tests/IndexedDB/interfaces.any.worker.html...
david_fenton@apple.com [Fri, 6 Jul 2018 22:22:06 +0000 (22:22 +0000)]
Layout Test imported/w3c/web-platform-tests/IndexedDB/interfaces.any.worker.html is flaky.
https://bugs.webkit.org/show_bug.cgi?id=187372

Unreviewed test gardening.

Added [ Slow ] to the existing [ Pass Timeout ] expectation.

* platform/mac-wk1/TestExpectations:

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

2 years agoMake HTMLMediaElement::remove*Track take a Ref<>&&
rniwa@webkit.org [Fri, 6 Jul 2018 22:19:19 +0000 (22:19 +0000)]
Make HTMLMediaElement::remove*Track take a Ref<>&&
https://bugs.webkit.org/show_bug.cgi?id=187407

Reviewed by Zalan Bujtas.

Make these functions take Ref<>&& since they can delete track objects.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::removeAudioTrack):
(WebCore::HTMLMediaElement::removeTextTrack):
(WebCore::HTMLMediaElement::removeVideoTrack):
(WebCore::HTMLMediaElement::forgetResourceSpecificTracks):
* html/HTMLMediaElement.h:

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

2 years agoRebaseline accessibility/ios-simulator/strong-password-field.html after r233578.
ryanhaddad@apple.com [Fri, 6 Jul 2018 21:50:10 +0000 (21:50 +0000)]
Rebaseline accessibility/ios-simulator/strong-password-field.html after r233578.

Unreviewed test gardening.

* accessibility/ios-simulator/strong-password-field-expected.txt:

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

2 years ago[WPE][GTK] Build php zlib plugin and enable sockets in flatpak
commit-queue@webkit.org [Fri, 6 Jul 2018 21:28:59 +0000 (21:28 +0000)]
[WPE][GTK] Build php zlib plugin and enable sockets in flatpak
https://bugs.webkit.org/show_bug.cgi?id=187401

Patch by Thibault Saunier <tsaunier@igalia.com> on 2018-07-06
Reviewed by Philippe Normand.

* flatpak/org.webkit.WebKit.yaml:

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

2 years agoLayout Test imported/w3c/web-platform-tests/WebCryptoAPI/generateKey/successes_RSA...
david_fenton@apple.com [Fri, 6 Jul 2018 20:37:34 +0000 (20:37 +0000)]
Layout Test imported/w3c/web-platform-tests/WebCryptoAPI/generateKey/successes_RSA-PSS.https.any.worker.html is flaky timeout.
https://bugs.webkit.org/show_bug.cgi?id=187408

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

2 years ago[iOS] WKPDFView should show the Data Detectors sheet when long-pressing a URL that...
aestes@apple.com [Fri, 6 Jul 2018 20:13:22 +0000 (20:13 +0000)]
[iOS] WKPDFView should show the Data Detectors sheet when long-pressing a URL that Data Detectors can handle
https://bugs.webkit.org/show_bug.cgi?id=187396
<rdar://problem/41786980>

Reviewed by Dan Bernstein.

If a URL can be presented by Data Detectors, show the Data Detectors sheet instead
of the link sheet. Also implement the optional WKActionSheetAssistantDelegate
method that asks the UI delegate for its data detection context.

* UIProcess/ios/WKPDFView.mm:
(-[WKPDFView _showActionSheetForURL:atLocation:withAnnotationRect:]):
(-[WKPDFView dataDetectionContextForActionSheetAssistant:]):

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

2 years ago[Web Animations] Make WPT test at interfaces/KeyframeEffect/processing-a-keyframes...
graouts@webkit.org [Fri, 6 Jul 2018 19:39:42 +0000 (19:39 +0000)]
[Web Animations] Make WPT test at interfaces/KeyframeEffect/processing-a-keyframes-argument-002.html pass reliably
https://bugs.webkit.org/show_bug.cgi?id=186502
<rdar://problem/41000229>l

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

Mark WPT progression.

* web-platform-tests/web-animations/interfaces/KeyframeEffect/processing-a-keyframes-argument-002-expected.txt:

Source/WebCore:

Ensure we only attempt to convert defined objects or we risk to throw errors in valid situations.

* animation/KeyframeEffectReadOnly.cpp:
(WebCore::processKeyframeLikeObject):

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

2 years agoWebResourceLoadStatisticsStore::callHasStorageAccessForFrameHandler() should take...
cdumez@apple.com [Fri, 6 Jul 2018 19:33:06 +0000 (19:33 +0000)]
WebResourceLoadStatisticsStore::callHasStorageAccessForFrameHandler() should take in a CompletionHandler
https://bugs.webkit.org/show_bug.cgi?id=187392

Reviewed by Youenn Fablet.

* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::callHasStorageAccessForFrameHandler):
* UIProcess/WebResourceLoadStatisticsStore.h:

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

2 years ago[ews-build] EWS should run javascriptcore tests
aakash_jain@apple.com [Fri, 6 Jul 2018 19:24:59 +0000 (19:24 +0000)]
[ews-build] EWS should run javascriptcore tests
https://bugs.webkit.org/show_bug.cgi?id=187365

Reviewed by David Kilzer.

* BuildSlaveSupport/ews-build/steps.py: Added step to run JavaScriptCoreTests.
* BuildSlaveSupport/ews-build/steps_unittest.py: Added unit-tests.
* BuildSlaveSupport/ews-build/factories.py:

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

2 years ago[Web Animations] Make WPT test at interfaces/Animation/finish.html pass reliably
graouts@webkit.org [Fri, 6 Jul 2018 18:43:57 +0000 (18:43 +0000)]
[Web Animations] Make WPT test at interfaces/Animation/finish.html pass reliably
https://bugs.webkit.org/show_bug.cgi?id=186496
<rdar://problem/41000179>

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

Mark a WPT progression.

* web-platform-tests/web-animations/interfaces/Animation/finish-expected.txt:

Source/WebCore:

We used to only resolve animations that had a target element, but animations need not have a target and their
current time should still advance so that their finished promise may resolve. We now maintain a list of animations
without targets and we iterate through them as well as animations with targets in DocumentTimeline::updateAnimations().

* animation/AnimationTimeline.cpp:
(WebCore::AnimationTimeline::addAnimation):
(WebCore::AnimationTimeline::removeAnimation):
(WebCore::AnimationTimeline::animationWasAddedToElement):
(WebCore::AnimationTimeline::animationWasRemovedFromElement):
* animation/AnimationTimeline.h:
(WebCore::AnimationTimeline:: const):
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::updateAnimations):
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::resolve):
* animation/WebAnimation.h:

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

2 years ago[Web Animations] Make WPT test at interfaces/Animation/finished.html pass reliably
graouts@webkit.org [Fri, 6 Jul 2018 18:37:21 +0000 (18:37 +0000)]
[Web Animations] Make WPT test at interfaces/Animation/finished.html pass reliably
https://bugs.webkit.org/show_bug.cgi?id=186497
<rdar://problem/41000193>

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

Mark WPT progression.

* web-platform-tests/web-animations/interfaces/Animation/finished-expected.txt:

Source/WebCore:

We need to ensure the finished state is updated as a result of any timing property changing.

* animation/AnimationEffectReadOnly.cpp:
(WebCore::AnimationEffectReadOnly::timingDidChange):
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::effectTimingPropertiesDidChange):
* animation/WebAnimation.h:

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

2 years ago[Web Animations] Using a Web Animation leaks the Document
graouts@webkit.org [Fri, 6 Jul 2018 18:31:12 +0000 (18:31 +0000)]
[Web Animations] Using a Web Animation leaks the Document
https://bugs.webkit.org/show_bug.cgi?id=187088
<rdar://problem/41392046>

Reviewed by Darin Adler.

Source/WebCore:

Test: webanimations/leak-document-with-web-animation.html

We need to ensure that any remaining animation is cleared when the DocumentTimeline is detached from its Document.
We rename WebAnimation::prepareAnimationForRemoval() to WebAnimation::remove() since it really actively disassociates
the animation from its timeline.

An earlier version of this patch (r233349) was rolled out due to crashes caught in the ASan configuration. The following
changes were made to make it safe:

- We protect the DocumentAnimationScheduler instance in displayRefreshFired() against code that might run in a
requestAnimationFrame() callback that would trigger the object to be deleted.

- We protect the WebAnimation instance in remove() against setEffectInternal() or setTimelineInternal() potentially
causing the object to be deleted. Similar protections were addede to setEffect() and setTimeline().

- We changed ~DocumentTimeline() to a default implementation to ensure it calls ~DisplayRefreshMonitorClient()
to avoid callbacks after the object has been marked for deletion.

* animation/AnimationTimeline.cpp:
(WebCore::AnimationTimeline::removeAnimationsForElement): We no longer need the call to removeAnimation()
since the new WebAnimation::remove() method will also set the timeline to null which will eventually call
removeAnimation() on the disassociated timeline.
* animation/DeclarativeAnimation.cpp:
(WebCore::DeclarativeAnimation::remove):
(WebCore::DeclarativeAnimation::prepareAnimationForRemoval): Deleted.
* animation/DeclarativeAnimation.h:
* animation/DocumentAnimationScheduler.cpp:
(WebCore::DocumentAnimationScheduler::displayRefreshFired):
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::detachFromDocument): Call remove() on all known animations.
(WebCore::DocumentTimeline::~DocumentTimeline): Deleted.
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::remove): Set the timeline to null to fully disassociate this animation from its timeline.
(WebCore::WebAnimation::setEffect):
(WebCore::WebAnimation::setEffectInternal):
(WebCore::WebAnimation::setTimeline): Factor the internal timeline-association code out of this JS API method so
that we can call this code without any JS-facing implications.
(WebCore::WebAnimation::setTimelineInternal):
(WebCore::WebAnimation::prepareAnimationForRemoval): Deleted.
* animation/WebAnimation.h:

LayoutTests:

* webanimations/leak-document-with-web-animation-expected.txt: Added.
* webanimations/leak-document-with-web-animation.html: Added.
* webanimations/resources/web-animation-leak-iframe.html: Added.

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

2 years ago[iOS] Assertion failure in WebProcessProxy::allProcesses() (isMainThread())
cdumez@apple.com [Fri, 6 Jul 2018 18:25:59 +0000 (18:25 +0000)]
[iOS] Assertion failure in WebProcessProxy::allProcesses() (isMainThread())
https://bugs.webkit.org/show_bug.cgi?id=187394

Reviewed by Dan Bernstein.

Use RunLoop::isMain() instead of isMainThread() in the assertion to fix issues for
applications using both WebKit and WebKitLegacy.

* UIProcess/WebProcessProxy.cpp:

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

2 years agoLayout Test editing/selection/navigation-clears-editor-state.html is flaky
sbarati@apple.com [Fri, 6 Jul 2018 17:44:35 +0000 (17:44 +0000)]
Layout Test editing/selection/navigation-clears-editor-state.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=187389

Reviewed by Mark Lam.

* editing/selection/navigation-clears-editor-state.html:
Make the test's internal time out mechanism longer since
it's being hit on the bots.

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

2 years agoAX: setValue on text controls should send out key events
n_wang@apple.com [Fri, 6 Jul 2018 17:29:55 +0000 (17:29 +0000)]
AX: setValue on text controls should send out key events
https://bugs.webkit.org/show_bug.cgi?id=186690
<rdar://problem/41169985>

Reviewed by Chris Fleizach.

Editor's clearText function will also dispatch the InputEvent. In the test,
we need to make sure each test case finishes handling all the input events
before moving to the next test case.

* accessibility/mac/set-value-editable-dispatch-events-expected.txt:
* accessibility/mac/set-value-editable-dispatch-events.html:

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

2 years agoLayout Test imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap...
ryanhaddad@apple.com [Fri, 6 Jul 2018 17:29:28 +0000 (17:29 +0000)]
Layout Test imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-origin.sub.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=187393

Unreviewed test gardening.

Patch by Truitt Savell <tsavell@apple.com> on 2018-07-06

* TestExpectations:

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

2 years agoRemove Strong Confirmation Password button
dbates@webkit.org [Fri, 6 Jul 2018 16:29:40 +0000 (16:29 +0000)]
Remove Strong Confirmation Password button
https://bugs.webkit.org/show_bug.cgi?id=187306
<rdar://problem/41795185>

Reviewed by Sam Weinig.

Remove support for the Strong Confirmation Password button because we never made use of it.

Source/WebCore:

* English.lproj/Localizable.strings:
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper _accessibilityIsStrongPasswordField]):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
* html/HTMLInputElement.h:
(WebCore::HTMLInputElement::hasAutoFillStrongPasswordButton const):
* html/HTMLTextFormControlElement.h:
* html/TextFieldInputType.cpp:
(WebCore::autoFillButtonTypeToAccessibilityLabel):
(WebCore::autoFillButtonTypeToAutoFillButtonText):
(WebCore::autoFillButtonTypeToAutoFillButtonPseudoClassName):
(WebCore::isAutoFillButtonTypeChanged):
* platform/LocalizedStrings.cpp:
(WebCore::AXAutoFillStrongConfirmationPasswordLabel): Deleted.
* platform/LocalizedStrings.h:
* rendering/RenderTextControlSingleLine.cpp:
(WebCore::RenderTextControlSingleLine::layout):
* testing/Internals.cpp:
(WebCore::toAutoFillButtonType):
(WebCore::toInternalsAutoFillButtonType):
* testing/Internals.h:
* testing/Internals.idl:

Source/WebKit:

* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm:
(toAutoFillButtonType):
(toWKAutoFillButtonType):
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandlePrivate.h:
* WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp:
(toAutoFillButtonType):
(toWKAutoFillButtonType):
* WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h:

LayoutTests:

* accessibility/ios-simulator/strong-password-field-expected.txt:
* accessibility/ios-simulator/strong-password-field.html:
* fast/forms/auto-fill-button/auto-fill-strong-password-button-when-maxlength-changes-expected.html:
* fast/forms/auto-fill-button/auto-fill-strong-password-button-when-maxlength-changes.html:
* fast/forms/auto-fill-button/auto-fill-strong-password-button-when-minlength-changes-expected.html:
* fast/forms/auto-fill-button/auto-fill-strong-password-button-when-minlength-changes.html:
* fast/forms/auto-fill-button/hide-auto-fill-strong-password-button-when-form-is-reset-expected.html:
* fast/forms/auto-fill-button/hide-auto-fill-strong-password-button-when-form-is-reset.html:
* fast/forms/auto-fill-button/hide-auto-fill-strong-password-button-when-value-changes-expected.html:
* fast/forms/auto-fill-button/hide-auto-fill-strong-password-button-when-value-changes.html:
* fast/forms/auto-fill-button/hide-strong-password-when-field-type-changes-expected.html:
* fast/forms/auto-fill-button/hide-strong-password-when-field-type-changes.html:
* fast/forms/auto-fill-button/input-autofilled-disabled-strong-password-auto-fill-button-expected.html: Removed.
* fast/forms/auto-fill-button/input-autofilled-disabled-strong-password-auto-fill-button.html: Removed.
* fast/forms/auto-fill-button/input-autofilled-readonly-strong-password-auto-fill-button-expected.html: Removed.
* fast/forms/auto-fill-button/input-autofilled-readonly-strong-password-auto-fill-button.html: Removed.
* fast/forms/auto-fill-button/input-disabled-strong-password-and-strong-confirmation-password-auto-fill-buttons-expected.html:
* fast/forms/auto-fill-button/input-disabled-strong-password-and-strong-confirmation-password-auto-fill-buttons.html:
* fast/forms/auto-fill-button/input-readonly-strong-password-and-strong-confirmation-password-auto-fill-buttons-expected.html:
* fast/forms/auto-fill-button/input-readonly-strong-password-and-strong-confirmation-password-auto-fill-buttons.html:
* fast/forms/auto-fill-button/input-strong-confirmation-password-auto-fill-button.html: Removed.
* fast/forms/auto-fill-button/last-auto-fill-button-type-expected.txt:
* fast/forms/auto-fill-button/last-auto-fill-button-type.html:
* platform/gtk/TestExpectations:
* platform/gtk/fast/forms/auto-fill-button/input-strong-confirmation-password-auto-fill-button-expected.txt: Removed.
* platform/ios/fast/forms/auto-fill-button/input-strong-confirmation-password-auto-fill-button-expected.txt: Removed.
* platform/mac/fast/forms/auto-fill-button/input-strong-confirmation-password-auto-fill-button-expected.txt: Removed.
* platform/win/TestExpectations:
* platform/win/fast/forms/auto-fill-button/input-strong-confirmation-password-auto-fill-button-expected.txt: Removed.
* platform/wincairo/fast/forms/auto-fill-button/input-strong-confirmation-password-auto-fill-button-expected.txt: Removed.

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

2 years agoWTF's internal std::optional implementation should abort() on bad optional access
fred.wang@free.fr [Fri, 6 Jul 2018 11:49:39 +0000 (11:49 +0000)]
WTF's internal std::optional implementation should abort() on bad optional access
https://bugs.webkit.org/show_bug.cgi?id=186536

Patch by Frederic Wang <fwang@igalia.com> on 2018-07-06
Reviewed by Michael Catanzaro.

Currently, some ports built with recent compilers will cause the program to abort when one
tries to access the value of an unset std:optional (i.e. std::nullopt) as specified by C++17.
However, most ports still use WTF's internal std::optional implementation, which does not
verify illegal access. Hence it's not possible for developers working on these ports to
detect issues like bugs #186189, #186535, #186752, #186753, #187139, #187145, #187243 or
#187382.
WTF's version of std::optional was introduced in bug #164199 but it was not possible to
verify the availability of the value inside constexpr member functions because the assert
might involve asm declarations. This commit introduces a new ASSERT_UNDER_CONSTEXPR_CONTEXT
macro (a simplified version of ASSERT that can be used in constexpr context) and uses it in
WTF's implementation of std::optional.

* wtf/Assertions.h: Define ASSERT_UNDER_CONSTEXPR_CONTEXT as a version of ASSERT that can be
used in constexpr context (in particular avoids asm declarations).
* wtf/Optional.h:
(std::optional::operator ->): Add an assert to ensure the optional value is available.
(std::optional::operator *): Ditto.
(std::optional::value const): Ditto.
(std::optional::value): Ditto.
(std::optional<T::value const): Ditto.

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

2 years ago[GTK][WPE] REGRESSION(r233111): Test /webkit/WebKitUserContentManager/script-message...
carlosgc@webkit.org [Fri, 6 Jul 2018 10:51:33 +0000 (10:51 +0000)]
[GTK][WPE] REGRESSION(r233111): Test /webkit/WebKitUserContentManager/script-message-received fails
https://bugs.webkit.org/show_bug.cgi?id=187383

Reviewed by Žan Doberšek.

This is actually a problem in the test itself. The problem is that we run js, connect to message-received and
quite the main loop when the message is received, which happens before the run js operation has been
completed. The test finishes early and since r233111 an IPC message is still pending (I guess the run js
callback) and the web page is still protected. Just adding a run loop operation before finishing the test would
fix it. We should wait for the js run to complete, instead of the message.

* TestWebKitAPI/Tests/WebKitGLib/TestWebKitUserContentManager.cpp:
(UserScriptMessageTest::scriptMessageReceived):
(UserScriptMessageTest::waitUntilMessageReceived):
(UserScriptMessageTest::runJavaScriptFinished):
(UserScriptMessageTest::postMessageAndWaitUntilReceived):

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

2 years ago[GTK][WPE] REGRESSION(r233239): proxy settings not applied after r233239
commit-queue@webkit.org [Fri, 6 Jul 2018 10:38:46 +0000 (10:38 +0000)]
[GTK][WPE] REGRESSION(r233239): proxy settings not applied after r233239
https://bugs.webkit.org/show_bug.cgi?id=187381

Patch by Carlos Garcia Campos <cgarcia@igalia.com> on 2018-07-06
Reviewed by Yusuke Suzuki.

This is because the static variable for proxy settings was replaced by a NeverDestroyed, but the function is not
returning a reference, but a copy. This is causing several unit tests to fail.

* platform/network/soup/SoupNetworkSession.cpp:
(WebCore::proxySettings):

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

2 years ago[Crash] Illegal use of uninitialized std::optional value in WebCore::AnimationBase...
commit-queue@webkit.org [Fri, 6 Jul 2018 10:10:50 +0000 (10:10 +0000)]
[Crash] Illegal use of uninitialized std::optional value in WebCore::AnimationBase::updateStateMachine
https://bugs.webkit.org/show_bug.cgi?id=187382

Patch by Frederic Wang <fwang@igalia.com> on 2018-07-06
Reviewed by Carlos Garcia Campos.

WebCore::AnimationBase::updateStateMachine has two potential places where the use of an
uninitialized std:optional value is possible and one of them is hit when using Google drive.
Since that old animation code is going to be removed soon, we just quickly patch this issue
via value_or() so that we can restore the ASSERT added in bug 186536.

No new tests, code is going to be removed soon.

* page/animation/AnimationBase.cpp:
(WebCore::AnimationBase::updateStateMachine): Use value_or(0) to avoid potential crashes.

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

2 years agoRename HTMLTreeBuilder::didCreateCustomOrCallbackElement
commit-queue@webkit.org [Fri, 6 Jul 2018 07:48:51 +0000 (07:48 +0000)]
Rename HTMLTreeBuilder::didCreateCustomOrCallbackElement
https://bugs.webkit.org/show_bug.cgi?id=187317

Patch by Frederic Wang <fwang@igalia.com> on 2018-07-06
Reviewed by Ryosuke Niwa.

This function is called with a new custom element or the fallback HTMLUnknownElement element
so we rename it didCreateCustomOrFallbackElement.

No new tests, behavior unchanged.

* html/parser/HTMLDocumentParser.cpp:
(WebCore::HTMLDocumentParser::runScriptsForPausedTreeBuilder):
* html/parser/HTMLTreeBuilder.cpp:
(WebCore::HTMLTreeBuilder::didCreateCustomOrFallbackElement):
(WebCore::HTMLTreeBuilder::didCreateCustomOrCallbackElement): Deleted.
* html/parser/HTMLTreeBuilder.h:

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

2 years agoREGRESSION(r233496): macOS Sierra hits debug assertions in TrackListBase::suspend
rniwa@webkit.org [Fri, 6 Jul 2018 07:37:50 +0000 (07:37 +0000)]
REGRESSION(r233496): macOS Sierra hits debug assertions in TrackListBase::suspend
https://bugs.webkit.org/show_bug.cgi?id=187378
<rdar://problem/41878885>

Reviewed by Eric Carlson.

These assertions were wrong since inline debugger, alert, etc... can suspend active DOM objects without
calling canSuspendForDocumentSuspension. Fixed the bug by removing the assertion and instead suspending
and resuming the generic event queue.

* Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::suspend):
(WebCore::MediaSource::resume):
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::suspend):
(WebCore::SourceBuffer::resume):
* Modules/mediasource/SourceBufferList.cpp:
(WebCore::SourceBufferList::suspend):
(WebCore::SourceBufferList::resume):
* html/track/TrackListBase.cpp:
(WebCore::TrackListBase::suspend):
(WebCore::TrackListBase::resume):

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

2 years agoUnreviewed GTK gardening. Remove platform expectations for imported/w3c/web-platform...
carlosgc@webkit.org [Fri, 6 Jul 2018 06:28:44 +0000 (06:28 +0000)]
Unreviewed GTK gardening. Remove platform expectations for imported/w3c/web-platform-tests/web-animations/interfaces/Animatable/animate-no-browsing-context.html

Since r233512 we are getting the same results as other ports.

* platform/gtk/imported/w3c/web-platform-tests/web-animations/interfaces/Animatable/animate-no-browsing-context-expected.txt: Removed.

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

2 years agoMeasurementSet should merge last four segments into two if values are identical.
dewei_zhu@apple.com [Fri, 6 Jul 2018 05:57:48 +0000 (05:57 +0000)]
MeasurementSet should merge last four segments into two if values are identical.
https://bugs.webkit.org/show_bug.cgi?id=187311

Reviewed by Ryosuke Niwa.

If last four segments has the same value, MeasurmentSet should merge them.

* public/v3/models/measurement-set.js: Added the logic to conditionally merge last segments.
(MeasurementSet.prototype.fetchSegmentation):
* unit-tests/measurement-set-tests.js: Added a unit test for this change.

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

2 years agoREGRESSION (r230843): Flash doesn't work; Produces blue box on page
youenn@apple.com [Fri, 6 Jul 2018 05:50:17 +0000 (05:50 +0000)]
REGRESSION (r230843): Flash doesn't work; Produces blue box on page
https://bugs.webkit.org/show_bug.cgi?id=187346
<rdar://problem/41773974>

Reviewed by Ryosuke Niwa.

Source/WebCore:

Introduce clearPagesPluginData used by WebProcess when a plugin policy changes.
Add a new internals API to get the plugin count as navigator.plugin is filtering plugins.

Test: http/tests/plugins/plugin-allow-then-reload.html

* plugins/PluginData.h:
* plugins/PluginInfoProvider.cpp:
(WebCore::PluginInfoProvider::clearPagesPluginData):
* plugins/PluginInfoProvider.h:
* testing/Internals.cpp:
(WebCore::Internals::pluginCount):
* testing/Internals.h:
* testing/Internals.idl:

Source/WebKit:

Reset page plugins when the load client policies are updated.
This will ensure that pages will rebuild their plugin lists based on the new policies.

* WebProcess/Plugins/WebPluginInfoProvider.cpp:
(WebKit::WebPluginInfoProvider::setPluginLoadClientPolicy):
(WebKit::WebPluginInfoProvider::clearPluginClientPolicies):

Tools:

* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetStateToConsistentValues):
(WTR::TestController::setBlockAllPlugins):
When not blocked, set the load policy to allow once.
* WebKitTestRunner/TestController.h:

LayoutTests:

Skip new test on WK1 since it does not have the ability to block plugins.

* http/tests/plugins/plugin-allow-then-reload-expected.txt: Added.
* http/tests/plugins/plugin-allow-then-reload.html: Added.
* platform/mac-wk1/TestExpectations:

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

2 years agoIndexedDB operations in a Page fail after a StorageProcess crash.
beidson@apple.com [Fri, 6 Jul 2018 05:48:35 +0000 (05:48 +0000)]
IndexedDB operations in a Page fail after a StorageProcess crash.
<rdar://problem/41626526> and https://bugs.webkit.org/show_bug.cgi?id=187123

Reviewed by Alex Christensen.

Source/WebCore:

Test: storage/indexeddb/modern/opendatabase-after-storage-crash.html

When the connection to a StorageProcess goes away, explicitly tell all of the WebPages
in the WebProcess about it.

This puts Documents/Workers in an error mode where requests fail instead of timeout.
It also clears the Page's connection so *new* Documents and Workers will get a fresh
new connection that works.

* Modules/indexeddb/client/IDBConnectionToServer.cpp:
(WebCore::IDBClient::IDBConnectionToServer::callResultFunctionLater):
(WebCore::IDBClient::IDBConnectionToServer::deleteDatabase):
(WebCore::IDBClient::IDBConnectionToServer::openDatabase):
(WebCore::IDBClient::IDBConnectionToServer::createObjectStore):
(WebCore::IDBClient::IDBConnectionToServer::deleteObjectStore):
(WebCore::IDBClient::IDBConnectionToServer::renameObjectStore):
(WebCore::IDBClient::IDBConnectionToServer::clearObjectStore):
(WebCore::IDBClient::IDBConnectionToServer::createIndex):
(WebCore::IDBClient::IDBConnectionToServer::deleteIndex):
(WebCore::IDBClient::IDBConnectionToServer::renameIndex):
(WebCore::IDBClient::IDBConnectionToServer::putOrAdd):
(WebCore::IDBClient::IDBConnectionToServer::getRecord):
(WebCore::IDBClient::IDBConnectionToServer::getAllRecords):
(WebCore::IDBClient::IDBConnectionToServer::getCount):
(WebCore::IDBClient::IDBConnectionToServer::deleteRecord):
(WebCore::IDBClient::IDBConnectionToServer::openCursor):
(WebCore::IDBClient::IDBConnectionToServer::iterateCursor):
(WebCore::IDBClient::IDBConnectionToServer::establishTransaction):
(WebCore::IDBClient::IDBConnectionToServer::commitTransaction):
(WebCore::IDBClient::IDBConnectionToServer::didFinishHandlingVersionChangeTransaction):
(WebCore::IDBClient::IDBConnectionToServer::abortTransaction):
(WebCore::IDBClient::IDBConnectionToServer::didFireVersionChangeEvent):
(WebCore::IDBClient::IDBConnectionToServer::confirmDidCloseFromServer):
(WebCore::IDBClient::IDBConnectionToServer::connectionToServerLost):
(WebCore::IDBClient::IDBConnectionToServer::openDBRequestCancelled):
(WebCore::IDBClient::IDBConnectionToServer::databaseConnectionPendingClose):
(WebCore::IDBClient::IDBConnectionToServer::databaseConnectionClosed):
(WebCore::IDBClient::IDBConnectionToServer::abortOpenAndUpgradeNeeded):
(WebCore::IDBClient::IDBConnectionToServer::getAllDatabaseNames):
* Modules/indexeddb/client/IDBConnectionToServer.h:

* Modules/indexeddb/shared/IDBError.h:
(WebCore::IDBError::serverConnectionLostError):

* page/Page.cpp:
(WebCore::Page::setSessionID):
(WebCore::Page::idbConnection):
(WebCore::Page::optionalIDBConnection):
(WebCore::Page::clearIDBConnection):
* page/Page.h:

Source/WebKit:

When the connection to a StorageProcess goes away, explicitly tell all of the WebPages
in the WebProcess about it.

This puts Documents/Workers in an error mode where requests fail instead of timeout.
It also clears the Page's connection so *new* Documents and Workers will get a fresh
new connection that works.

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

* UIProcess/API/Cocoa/WKProcessPool.mm:
(-[WKProcessPool _terminateStorageProcess]):

* UIProcess/Storage/StorageProcessProxy.cpp:
(WebKit::StorageProcessProxy::terminateForTesting):
* UIProcess/Storage/StorageProcessProxy.h:

* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::terminateStorageProcessForTesting):
(WebKit::WebProcessPool::terminateStorageProcess): Deleted.
* UIProcess/WebProcessPool.h:

* WebProcess/Storage/WebToStorageProcessConnection.cpp:
(WebKit::WebToStorageProcessConnection::didClose):
* WebProcess/Storage/WebToStorageProcessConnection.h:
(WebKit::WebToStorageProcessConnection::existingIDBConnectionToServerForIdentifier):

* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::webToStorageProcessConnectionClosed):

LayoutTests:

* storage/indexeddb/modern/opendatabase-after-storage-crash.html: Added.

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

2 years agoAddress two possible causes of missing tiles in iOS Safari, and add logging to gather...
simon.fraser@apple.com [Fri, 6 Jul 2018 04:56:40 +0000 (04:56 +0000)]
Address two possible causes of missing tiles in iOS Safari, and add logging to gather more data about other possible causes
https://bugs.webkit.org/show_bug.cgi?id=187376
rdar://problem/40941118

Reviewed by Tim Horton.

We have continual reports of users experiencing missing tiles in MobileSafari, where loading a page
shows the tiles at the top, but we don't render new tiles as the user scrolls down. This is consistent
with failing to dispatch visible content rect updates via -[WKWebView _updateVisibleContentRects].

This patch addresses two possible (but unlikely) causes. First, it resets _currentlyAdjustingScrollViewInsetsForKeyboard
after a web process crash. Second, it catches exceptions thrown by [webView _updateVisibleContentRects]
and resets _hasScheduledVisibleRectUpdate.

This patch also adds release logging that fires if over 1s has elapsed between scheduling
a visible content rect update and trying to re-schedule, and logging for all reasons that
-_updateVisibleContentRects returns early.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
(-[WKWebView _processDidExit]):
(-[WKWebView _addUpdateVisibleContentRectPreCommitHandler]):
(-[WKWebView _scheduleVisibleContentRectUpdateAfterScrollInView:]):
(-[WKWebView _updateVisibleContentRects]):

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

2 years agoYoutube video pages crash after a couple of minutes
rniwa@webkit.org [Fri, 6 Jul 2018 03:20:20 +0000 (03:20 +0000)]
Youtube video pages crash after a couple of minutes
https://bugs.webkit.org/show_bug.cgi?id=187316

Reviewed by Antti Koivisto.

Source/WebCore:

The crash was caused by HTMLMediaElement::stopWithoutDestroyingMediaPlayer invoking updatePlaybackControlsManager,
which traverses all media players across different documents including the one in the main frame while its iframe
is getting removed (to update the Touch Bar's media control).

Fixed the bug by making this code async in both stopWithoutDestroyingMediaPlayer and ~HTMLMediaElement. To do this,
this patch moves the timer to update the playback controls manager from HTMLMediaElement to Page since scheduling
a timer owned by HTMLMediaElement in its destructor wouldn't work as the timer would get destructed immediately.

Also replaced the call to clientWillPausePlayback by a call to stopSession in stopWithoutDestroyingMediaPlayer
since the former also updates the layout synchronously via updateNowPlayingInfo; the latter function schedules
a timer via scheduleUpdateNowPlayingInfo instead.

Test: media/remove-video-best-media-element-in-main-frame-crash.html

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::~HTMLMediaElement): Call scheduleUpdatePlaybackControlsManager now that timer has been
moved to Page.
(WebCore::HTMLMediaElement::bestMediaElementForShowingPlaybackControlsManager): Made this return a RefPtr instead of
a raw pointer while we're at it.
(WebCore::HTMLMediaElement::clearMediaPlayer): Call scheduleUpdatePlaybackControlsManager.
(WebCore::HTMLMediaElement::stopWithoutDestroyingMediaPlayer): Ditto. Also invoke stopSession instead of
clientWillPausePlayback on MediaSession since clientWillPausePlayback will synchronously try to update the layout.
(WebCore::HTMLMediaElement::contextDestroyed):
(WebCore::HTMLMediaElement::stop):
(WebCore::HTMLMediaElement::schedulePlaybackControlsManagerUpdate): Renamed from scheduleUpdatePlaybackControlsManager.
(WebCore::HTMLMediaElement::updatePlaybackControlsManager): Moved to Page::playbackControlsManagerUpdateTimerFired.
* html/HTMLMediaElement.h:
* page/Page.cpp:
(WebCore::Page::Page):
(WebCore::Page::schedulePlaybackControlsManagerUpdate): Added.
(WebCore::Page::playbackControlsManagerUpdateTimerFired): Moved from HTMLMediaElement::updatePlaybackControlsManager.
* page/Page.h:
* testing/Internals.cpp:
(WebCore::Internals::bestMediaElementForShowingPlaybackControlsManager):
* testing/Internals.h:

LayoutTests:

Added a regression test to remove an iframe with a video while there is a main content
which is eligible to be shown in the Touch Bar.

* media/remove-video-best-media-element-in-main-frame-crash-expected.txt: Added.
* media/remove-video-best-media-element-in-main-frame-crash.html: Added.

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

2 years agoREGRESSION(r233496): Crash in WebCore::VideoTrack::clearClient()
rniwa@webkit.org [Fri, 6 Jul 2018 02:32:52 +0000 (02:32 +0000)]
REGRESSION(r233496): Crash in WebCore::VideoTrack::clearClient()
https://bugs.webkit.org/show_bug.cgi?id=187377

Reviewed by Simon Fraser.

Clear m_client of an audio track or a video track before removing it from the list
since TrackListBase::m_inbandTracks may hold the last ref to the track.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::removeAudioTrack):
(WebCore::HTMLMediaElement::removeVideoTrack):

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

2 years agoREGRESSION(r233495) [cairo] drawGlyphsShadow should use the fast path for zero blur...
Hironori.Fujii@sony.com [Fri, 6 Jul 2018 01:56:48 +0000 (01:56 +0000)]
REGRESSION(r233495) [cairo] drawGlyphsShadow should use the fast path for zero blur-radius
https://bugs.webkit.org/show_bug.cgi?id=187336

Reviewed by Carlos Garcia Campos.

Source/WebCore:

drawGlyphsShadow has a fast path to draw a shadow without a shadow
layer. Since r233495, it is not used for zero blur-radius shadow.

In Bug 187244, I changed ShadowState::isRequired not to check
blur-radius is zero. This is not a right fix.

This change reverts r233495.

No new tests (Covered by existing tests).

* platform/graphics/cairo/CairoOperations.cpp:
(WebCore::Cairo::ShadowState::isRequired const): Return false if
'blur' is zero.
(WebCore::Cairo::fillRectWithRoundedHole): Use
ShadowState::isVisible instead of ShadowState::isRequired to check
a shadow should be drawn.

LayoutTests:

* platform/gtk/TestExpectations: Unmarked fast/text/multiple-text-shadow-overflow-layout-rect.html.

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

2 years ago[mac-wk1] Layout Test editing/selection/navigation-clears-editor-state.html is a...
sbarati@apple.com [Fri, 6 Jul 2018 01:35:31 +0000 (01:35 +0000)]
[mac-wk1] Layout Test editing/selection/navigation-clears-editor-state.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=187309

Reviewed by Mark Lam.

Try to make this test less flaky by making percents threshold of freed
objects smaller.

* editing/selection/navigation-clears-editor-state-expected.txt:
* editing/selection/navigation-clears-editor-state.html:

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

2 years agoLayout Test http/tests/workers/service/basic-messageport.html is flaky
youenn@apple.com [Fri, 6 Jul 2018 00:43:20 +0000 (00:43 +0000)]
Layout Test http/tests/workers/service/basic-messageport.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=182630

Reviewed by Alex Christensen.

Test is flaky due to a race between serviceWorkerClient.postMessage and MessagePort.postMessage.
Both are going through UIProcess but MessagePort events are grabbed asynchronously.
Fixed the test to not expect order between these two message exchange channels.

* http/tests/workers/service/basic-messageport-expected.txt:
* http/tests/workers/service/resources/basic-messageport.js:
(channel.port1.onmessage):
(then):
* platform/mac-wk2/TestExpectations:

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

2 years agoiPad: Scrolling with hardware keyboard while SELECT popover is visible scrolls the...
commit-queue@webkit.org [Fri, 6 Jul 2018 00:40:22 +0000 (00:40 +0000)]
iPad: Scrolling with hardware keyboard while SELECT popover is visible scrolls the page, detaches popover
https://bugs.webkit.org/show_bug.cgi?id=187363
<rdar://problem/41106306>

Patch by Olivia Barnett <obarnett@apple.com> on 2018-07-05
Reviewed by Tim Horton.

Added extra check to prevent keyboard scrolling when the select box is open.

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

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

2 years agoRename and flip the meaning of defaultAppearance to be useDarkAppearance.
timothy@apple.com [Fri, 6 Jul 2018 00:38:10 +0000 (00:38 +0000)]
Rename and flip the meaning of defaultAppearance to be useDarkAppearance.
https://bugs.webkit.org/show_bug.cgi?id=187369
rdar://problem/41870420

Reviewed by Tim Horton.

Source/WebCore:

* Modules/mediasession/WebMediaSessionManager.cpp:
(WebCore::WebMediaSessionManager::showPlaybackTargetPicker):
* css/MediaQueryEvaluator.cpp:
(WebCore::prefersDarkInterfaceEvaluate):
* css/StyleColor.h:
* dom/Document.cpp:
(WebCore::Document::useDarkAppearance const):
(WebCore::Document::styleColorOptions const):
(WebCore::Document::useDefaultAppearance const): Deleted.
* dom/Document.h:
* inspector/InspectorOverlay.cpp:
(WebCore::InspectorOverlay::paint):
* page/Page.cpp:
(WebCore::Page::useDarkAppearance const):
(WebCore::Page::defaultAppearance const): Deleted.
* page/Page.h:
(WebCore::Page::setUseDarkAppearance):
(WebCore::Page::setDefaultAppearance): Deleted.
* platform/Theme.h:
* platform/graphics/MediaPlaybackTargetPicker.h:
* platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h:
* platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
(WebCore::MediaPlaybackTargetPickerMac::showPlaybackTargetPicker):
* platform/mac/DragImageMac.mm:
(WebCore::createDragImageForLink):
* platform/mac/LocalDefaultSystemAppearance.h:
* platform/mac/LocalDefaultSystemAppearance.mm:
(WebCore::LocalDefaultSystemAppearance::LocalDefaultSystemAppearance):
* platform/mac/ThemeMac.h:
* platform/mac/ThemeMac.mm:
(WebCore::ThemeMac::paint):
* platform/mock/MediaPlaybackTargetPickerMock.cpp:
(WebCore::MediaPlaybackTargetPickerMock::showPlaybackTargetPicker):
* platform/mock/MediaPlaybackTargetPickerMock.h:
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::resolveStyleForMarkedText):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::paintContents):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::paintContents):
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::paint):
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::documentViewFor const):
(WebCore::RenderThemeMac::platformActiveSelectionBackgroundColor const):
(WebCore::RenderThemeMac::platformInactiveSelectionBackgroundColor const):
(WebCore::RenderThemeMac::supportsSelectionForegroundColors const):
(WebCore::RenderThemeMac::platformActiveSelectionForegroundColor const):
(WebCore::RenderThemeMac::platformInactiveSelectionForegroundColor const):
(WebCore::RenderThemeMac::platformActiveListBoxSelectionBackgroundColor const):
(WebCore::RenderThemeMac::platformInactiveListBoxSelectionBackgroundColor const):
(WebCore::RenderThemeMac::platformActiveListBoxSelectionForegroundColor const):
(WebCore::RenderThemeMac::platformInactiveListBoxSelectionForegroundColor const):
(WebCore::RenderThemeMac::platformActiveTextSearchHighlightColor const):
(WebCore::RenderThemeMac::colorCache const):
(WebCore::RenderThemeMac::systemColor const):
(WebCore::RenderThemeMac::paintCellAndSetFocusedElementNeedsRepaintIfNecessary):
(WebCore::RenderThemeMac::paintSliderThumb):
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::draw):

Source/WebKit:

* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode const):
(WebKit::WebPageCreationParameters::decode):
* Shared/WebPageCreationParameters.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _effectiveAppearanceIsDark]):
(-[WKWebView _initializeWithConfiguration:]):
(-[WKWebView _setUseSystemAppearance:]):
(-[WKWebView effectiveAppearanceDidChange]):
(-[WKWebView _defaultAppearance]): Deleted.
* UIProcess/API/mac/WKView.mm:
(-[WKView _effectiveAppearanceIsDark]):
(-[WKView effectiveAppearanceDidChange]):
(-[WKView _setUseSystemAppearance:]):
(-[WKView _defaultAppearance]): Deleted.
(-[WKView _setDefaultAppearance:]): Deleted.
* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::effectiveAppearanceIsDark):
(WebKit::WebViewImpl::setUseDarkAppearance):
(WebKit::WebViewImpl::useDefaultAppearance): Deleted.
(WebKit::WebViewImpl::setDefaultAppearance): Deleted.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::creationParameters):
(WebKit::WebPageProxy::setUseDarkAppearance):
(WebKit::WebPageProxy::showPlaybackTargetPicker):
(WebKit::WebPageProxy::setDefaultAppearance): Deleted.
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::useDarkAppearance const):
(WebKit::WebPageProxy::defaultAppearance const): Deleted.
* UIProcess/mac/WKPrintingView.mm:
(-[WKPrintingView drawRect:]):
* WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
(WebKit::InjectedBundleRangeHandle::renderedImage):
* WebProcess/Plugins/PDF/PDFPlugin.mm:
(WebKit::PDFPlugin::paintControlForLayerInContext):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_credentialsMessenger):
(WebKit::WebPage::drawRect):
(WebKit::WebPage::setUseDarkAppearance):
(WebKit::WebPage::setDefaultAppearance): Deleted.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:

Source/WebKitLegacy/mac:

* WebView/WebMediaPlaybackTargetPicker.mm:
(WebMediaPlaybackTargetPicker::showPlaybackTargetPicker):
* WebView/WebView.mm:
(-[WebView _commonInitializationWithFrameName:groupName:]):
(-[WebView _effectiveAppearanceIsDark]):
(-[WebView _updateDefaultAppearance]):
(-[WebView _defaultAppearance]): Deleted.

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

2 years agoLayoutTest imported/w3c/web-platform-tests/IndexedDB/interfaces.any.worker.html is...
david_fenton@apple.com [Fri, 6 Jul 2018 00:25:04 +0000 (00:25 +0000)]
LayoutTest imported/w3c/web-platform-tests/IndexedDB/interfaces.any.worker.html is flaky.
https://bugs.webkit.org/show_bug.cgi?id=187372

Unreviewed test gardening.

* platform/mac-wk1/TestExpectations:

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

2 years agoBuild fix (r233547): Disable IsoHeaps when Gigacage is off
ddkilzer@apple.com [Fri, 6 Jul 2018 00:19:57 +0000 (00:19 +0000)]
Build fix (r233547): Disable IsoHeaps when Gigacage is off
<https://webkit.org/b/187160>

* bmalloc/PerThread.cpp: Add #if !HAVE_PTHREAD_MACHDEP_H/#endif
around variables only used when that macro is 0.  Include what
you use: Cache.h and Heap.h.
* bmalloc/PerThread.h: Include <memory> for std::once_flag.

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

2 years agoUnreviewed, rolling out r233539.
commit-queue@webkit.org [Thu, 5 Jul 2018 23:24:53 +0000 (23:24 +0000)]
Unreviewed, rolling out r233539.
https://bugs.webkit.org/show_bug.cgi?id=187368

Changes made for youtube crashes has caused 15 api failures
(Requested by Truitt on #webkit).

Reverted changeset:

"Youtube video pages crash after a couple of minutes"
https://bugs.webkit.org/show_bug.cgi?id=187316
https://trac.webkit.org/changeset/233539

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

2 years agoREGRESSION: ASSERT under WebAutomationSessionProxy::computeElementLayout when element...
bburg@apple.com [Thu, 5 Jul 2018 23:17:40 +0000 (23:17 +0000)]
REGRESSION: ASSERT under WebAutomationSessionProxy::computeElementLayout when elementInViewClientCenterPoint returns nullopt
https://bugs.webkit.org/show_bug.cgi?id=187367
<rdar://problem/41861346>

Reviewed by Timothy Hatcher.

* WebProcess/Automation/WebAutomationSessionProxy.cpp:
(WebKit::WebAutomationSessionProxy::computeElementLayout):
There's no reason to unwrap this optional, as the IPC argument type is std::optional<IntPoint>.

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

2 years agoDisable IsoHeaps when Gigacage is off
msaboff@apple.com [Thu, 5 Jul 2018 23:12:04 +0000 (23:12 +0000)]
Disable IsoHeaps when Gigacage is off
https://bugs.webkit.org/show_bug.cgi?id=187160

Reviewed by Saam Barati.

Updated determineMallocFallbackState to base enabling of Iso Heaps on Gigacage
being enabled.  We do this because if Gigacage is disabled, it may be due to lack
of address space.

To work around a compiler issue uncovered by the change above, I added explicit
instantiation of PerThread's static variables.  Defined the same explicit
instantiated static variables with export scope in the new file PerThread.cpp
to eliminate separate variables allocations in each linked framework / library.

* CMakeLists.txt:
* bmalloc.xcodeproj/project.pbxproj:
* bmalloc/IsoTLS.cpp:
(bmalloc::IsoTLS::determineMallocFallbackState):
* bmalloc/PerThread.cpp: Added.
* bmalloc/PerThread.h:

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

2 years agoUpstream hover gesture implementation
timothy_horton@apple.com [Thu, 5 Jul 2018 22:28:17 +0000 (22:28 +0000)]
Upstream hover gesture implementation
https://bugs.webkit.org/show_bug.cgi?id=187366

Reviewed by Wenson Hsieh.

* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView setupInteraction]):
(-[WKContentView cleanupInteraction]):
(-[WKContentView _removeDefaultGestureRecognizers]):
(-[WKContentView _addDefaultGestureRecognizers]):
(-[WKContentView _hoverGestureRecognizerChanged:]):

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

2 years agoUpdate Element API to use qualifiedName instead of name/localName where applicable
cdumez@apple.com [Thu, 5 Jul 2018 22:20:39 +0000 (22:20 +0000)]
Update Element API to use qualifiedName instead of name/localName where applicable
https://bugs.webkit.org/show_bug.cgi?id=187347

Reviewed by Darin Adler.

Update Element API to use qualifiedName instead of name/localName where applicable. Naming
is now consistent with the IDL and the specification:
- https://dom.spec.whatwg.org/#element

Our implementation properly deals with qualified names already, even though the parameters
were named localName.

* dom/Element.cpp:
(WebCore::Element::getAttribute const):
(WebCore::Element::toggleAttribute):
(WebCore::Element::setAttribute):
(WebCore::Element::removeAttribute):
(WebCore::Element::getAttributeNode):
(WebCore::Element::hasAttribute const):
* dom/Element.h:

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

2 years agoFix some -Wdocumentation warnings in WebKit
timothy_horton@apple.com [Thu, 5 Jul 2018 22:20:08 +0000 (22:20 +0000)]
Fix some -Wdocumentation warnings in WebKit
https://bugs.webkit.org/show_bug.cgi?id=187318

Reviewed by Dan Bernstein.

Fix most of the -Wdocumentation warnings in WebKit. The remaining
ones are slightly mysterious, so we can't turn the warning on yet.

* Configurations/BaseTarget.xcconfig:
Define U_HIDE_DEPRECATED_API. It's defined in all other WebKit projects,
and the doc comments in the deprecated ICU API have some errors.

* UIProcess/API/Cocoa/WKUIDelegate.h:
* UIProcess/API/Cocoa/WKWebView.h:
* UIProcess/API/Cocoa/WKWebsiteDataStore.h:
Adjust comments or parameter names to be consistent with each other.

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

2 years agoVersioning.
kocsen_chung@apple.com [Thu, 5 Jul 2018 21:51:25 +0000 (21:51 +0000)]
Versioning.

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

2 years agoUnreviewed, rolling out r233417 and r233418.
commit-queue@webkit.org [Thu, 5 Jul 2018 21:46:35 +0000 (21:46 +0000)]
Unreviewed, rolling out r233417 and r233418.
https://bugs.webkit.org/show_bug.cgi?id=187364

Introduced an occasional crash on Google Drive (Requested by
rniwa on #webkit).

Reverted changesets:

"WTF's internal std::optional implementation should abort() on
bad optional access"
https://bugs.webkit.org/show_bug.cgi?id=186536
https://trac.webkit.org/changeset/233417

"WTF's internal std::optional implementation should abort() on
bad optional access"
https://bugs.webkit.org/show_bug.cgi?id=186536
https://trac.webkit.org/changeset/233418

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

2 years agoProgramExecutable may be collected as we checkSyntax on it
sbarati@apple.com [Thu, 5 Jul 2018 21:35:09 +0000 (21:35 +0000)]
ProgramExecutable may be collected as we checkSyntax on it
https://bugs.webkit.org/show_bug.cgi?id=187359
<rdar://problem/41832135>

Reviewed by Mark Lam.

The bug was we were passing in a reference to the SourceCode field on ProgramExecutable as
the ProgramExecutable itself may be collected. The fix here is to make a copy
of the field instead of passing in a reference inside of ParserError::toErrorObject.

No new tests here as this was already caught by our iOS JSC testers.

* parser/ParserError.h:
(JSC::ParserError::toErrorObject):

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

2 years agoYoutube video pages crash after a couple of minutes
rniwa@webkit.org [Thu, 5 Jul 2018 21:02:47 +0000 (21:02 +0000)]
Youtube video pages crash after a couple of minutes
https://bugs.webkit.org/show_bug.cgi?id=187316

Reviewed by Antti Koivisto.

Source/WebCore:

The crash was caused by HTMLMediaElement::stopWithoutDestroyingMediaPlayer invoking updatePlaybackControlsManager,
which traverses all media players across different documents including the one in the main frame while its iframe
is getting removed (to update the Touch Bar's media control).

Fixed the bug by making this code async in both stopWithoutDestroyingMediaPlayer and ~HTMLMediaElement. To do this,
this patch moves the timer to update the playback controls manager from HTMLMediaElement to Page since scheduling
a timer owned by HTMLMediaElement in its destructor wouldn't work as the timer would get destructed immediately.

Also replaced the call to clientWillPausePlayback by a call to stopSession in stopWithoutDestroyingMediaPlayer
since the former also updates the layout synchronously via updateNowPlayingInfo; the latter function schedules
a timer via scheduleUpdateNowPlayingInfo instead.

Test: media/remove-video-best-media-element-in-main-frame-crash.html

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::~HTMLMediaElement): Call scheduleUpdatePlaybackControlsManager now that timer has been
moved to Page.
(WebCore::HTMLMediaElement::bestMediaElementForShowingPlaybackControlsManager): Made this return a RefPtr instead of
a raw pointer while we're at it.
(WebCore::HTMLMediaElement::clearMediaPlayer): Call scheduleUpdatePlaybackControlsManager.
(WebCore::HTMLMediaElement::stopWithoutDestroyingMediaPlayer): Ditto. Also invoke stopSession instead of
clientWillPausePlayback on MediaSession since clientWillPausePlayback will synchronously try to update the layout.
(WebCore::HTMLMediaElement::contextDestroyed):
(WebCore::HTMLMediaElement::stop):
(WebCore::HTMLMediaElement::scheduleUpdatePlaybackControlsManager):
(WebCore::HTMLMediaElement::updatePlaybackControlsManager): Moved to Page::schedulePlaybackControlsManagerUpdate.
* html/HTMLMediaElement.h:
* page/Page.cpp:
(WebCore::Page::schedulePlaybackControlsManagerUpdate): Added.
* page/Page.h:
* testing/Internals.cpp:
(WebCore::Internals::bestMediaElementForShowingPlaybackControlsManager):
* testing/Internals.h:

Source/WebKitLegacy/mac:

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

LayoutTests:

Added a regression test to remove an iframe with a video while there is a main content
which is eligible to be shown in the Touch Bar.

* media/remove-video-best-media-element-in-main-frame-crash-expected.txt: Added.
* media/remove-video-best-media-element-in-main-frame-crash.html: Added.

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

2 years agoRegression(r232886): WebsiteDataStore objects may get destroyed on a background thread
cdumez@apple.com [Thu, 5 Jul 2018 20:41:48 +0000 (20:41 +0000)]
Regression(r232886): WebsiteDataStore objects may get destroyed on a background thread
https://bugs.webkit.org/show_bug.cgi?id=187356
<rdar://problem/41854555>

Reviewed by Geoffrey Garen.

As of r232886, CallbackAggregators in WebsiteDataStore hold a Ref<> to their WebsiteDataStore. This
is an issue because CallbackAggregator objects can get destroyed on a background thread and may be
the last ones holding a ref to the data store. When this happens, the WebsiteDataStore would get
destroyed on a background store and potentially cause crashes. Note that even if the callback
aggregator would not be the last one to hold a ref to the store, it still would not be safe to deref
the store on the background thread since WebsiteDataStore is not ThreadSafeRefCounted.

To address the issue, this patch updates the CallbackAggregators' destructor to deref their data
store member on the main thread. Note that we could also have WebsiteDataStore subclass
ThreadSafeRefCounted<T, DestructionThread::Main> but the data store technically does not need to
be ThreadSafeRefCounted at the moment.

* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::WebsiteDataStore):
(WebKit::WebsiteDataStore::~WebsiteDataStore):
(WebKit::WebsiteDataStore::fetchDataAndApply):
(WebKit::WebsiteDataStore::removeData):

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

2 years agoDo not assume that hypen's width can be computed using the simplified text measure...
zalan@apple.com [Thu, 5 Jul 2018 20:28:54 +0000 (20:28 +0000)]
Do not assume that hypen's width can be computed using the simplified text measure codepath.
https://bugs.webkit.org/show_bug.cgi?id=187352
<rdar://problem/40821283>

Reviewed by Simon Fraser.

Source/WebCore:

Just because the text content is qualified for simplified text measure, it does not necessarily mean the hyphen is simple enough as well.

Test: fast/text/hyphen-is-complex-crash.html

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

LayoutTests:

* fast/text/hyphen-is-complex-crash-expected.txt: Added.
* fast/text/hyphen-is-complex-crash.html: Added.

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

2 years ago[macOS] REGRESSION: Development WebContent service has restricted entitlements, rende...
mitz@apple.com [Thu, 5 Jul 2018 19:45:27 +0000 (19:45 +0000)]
[macOS] REGRESSION: Development WebContent service has restricted entitlements, rendering it useless for development
https://bugs.webkit.org/show_bug.cgi?id=187355

Reviewed by Anders Carlsson.

* Configurations/WebContentService.Development.xcconfig: Set WK_USE_RESTRICTED_ENTITLEMENTS
  to NO for the Development service.

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