WebKit-https.git
4 months agoREGRESSION (r243642): Crash in reddit.com page
msaboff@apple.com [Sun, 7 Apr 2019 23:24:45 +0000 (23:24 +0000)]
REGRESSION (r243642): Crash in reddit.com page
https://bugs.webkit.org/show_bug.cgi?id=196684

Reviewed by Geoffrey Garen.

JSTests:

New regression test.

* stress/regexp-nongreedy-charclass-backtracks.js: Added.

Source/JavaScriptCore:

In r243642, the code that saves and restores the count for non-greedy character classes
was inadvertently put inside an if statement.  This code should be generated for all
non-greedy character classes.

* yarr/YarrJIT.cpp:
(JSC::Yarr::YarrGenerator::generateCharacterClassNonGreedy):
(JSC::Yarr::YarrGenerator::backtrackCharacterClassNonGreedy):

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

4 months ago[JSC] CallLinkInfo should clear Callee or CodeBlock even if it is unlinked by jettison
ysuzuki@apple.com [Sun, 7 Apr 2019 19:25:59 +0000 (19:25 +0000)]
[JSC] CallLinkInfo should clear Callee or CodeBlock even if it is unlinked by jettison
https://bugs.webkit.org/show_bug.cgi?id=196683

Reviewed by Saam Barati.

JSTests:

* stress/clear-callee-or-codeblock-in-calllinkinfo-even-cleared-by-jettison.js: Added.
(foo):

Source/JavaScriptCore:

In r243626, we stop repatching CallLinkInfo when the CallLinkInfo is held by jettisoned CodeBlock.
But we still need to clear the Callee or CodeBlock since they are now dead. Otherwise, CodeBlock's
visitWeak eventually accesses this dead cells and crashes because the owner CodeBlock of CallLinkInfo
can be still live.

We also move all repatching operations from CallLinkInfo.cpp to Repatch.cpp for consistency because the
other repatching operations in CallLinkInfo are implemented in Repatch.cpp side.

* bytecode/CallLinkInfo.cpp:
(JSC::CallLinkInfo::setCallee):
(JSC::CallLinkInfo::clearCallee):
* jit/Repatch.cpp:
(JSC::linkFor):
(JSC::revertCall):

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

4 months agoAdded tests for WeakHashSet::computesEmpty and WeakHashSet::computeSize
rniwa@webkit.org [Sun, 7 Apr 2019 03:55:59 +0000 (03:55 +0000)]
Added tests for WeakHashSet::computesEmpty and WeakHashSet::computeSize
https://bugs.webkit.org/show_bug.cgi?id=196669

Reviewed by Geoffrey Garen.

Source/WTF:

Removed the superflous type names from forward declarations, and made WeakHashSet::add
take a const object to match other container types in WTF.

* wtf/WeakHashSet.h:
(WTF::WeakHashSet::add):
* wtf/WeakPtr.h:

Tools:

Added three new unit tests for WeakHashSet.

* TestWebKitAPI/Tests/WTF/WeakPtr.cpp:
(WTF_WeakPtr.WeakHashSetConstObjects):
(WTF_WeakPtr.WeakHashSetComputesEmpty):
(WTF_WeakPtr.WeakHashSetComputeSize):

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

4 months agoREGRESSION(r237196): Web Inspector: Computed panel shouldn't update when it isn't...
nvasilyev@apple.com [Sun, 7 Apr 2019 02:54:58 +0000 (02:54 +0000)]
REGRESSION(r237196): Web Inspector: Computed panel shouldn't update when it isn't visible
https://bugs.webkit.org/show_bug.cgi?id=196667
<rdar://problem/49664912>

Reviewed by Timothy Hatcher.

Explicitly define `hidden` and `shown` methods instead of relying on SidebarPanel's `visible` getter.

* UserInterface/Views/GeneralStyleDetailsSidebarPanel.js:
(WI.GeneralStyleDetailsSidebarPanel.prototype.visibilityDidChange): Deleted.
(WI.GeneralStyleDetailsSidebarPanel.prototype.hidden): Added.
(WI.GeneralStyleDetailsSidebarPanel.prototype.shown): Added.

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

4 months agoHide next and previous form control buttons when WKWebView is editable
wenson_hsieh@apple.com [Sun, 7 Apr 2019 02:25:36 +0000 (02:25 +0000)]
Hide next and previous form control buttons when WKWebView is editable
https://bugs.webkit.org/show_bug.cgi?id=196672
<rdar://problem/35625321>

Reviewed by Tim Horton.

Source/WebKit:

Adopt new UIKit SPI to hide or show next and previous controls in the form accessory view when changing
editability.

Test: KeyboardInputTests.FormNavigationAssistantBarButtonItems

* Platform/spi/ios/UIKitSPI.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _setEditable:]):
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _updateAccessory]):
(-[WKContentView _didChangeWebViewEditability]):

Tools:

Add a new API test.

* TestWebKitAPI/Tests/ios/KeyboardInputTestsIOS.mm:
(-[TestWKWebView lastTrailingBarButtonGroup]):
(TestWebKitAPI::TEST):
* TestWebKitAPI/ios/UIKitSPI.h:

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

4 months agoCombine event and touch action regions into a single class
antti@apple.com [Sat, 6 Apr 2019 16:48:58 +0000 (16:48 +0000)]
Combine event and touch action regions into a single class
https://bugs.webkit.org/show_bug.cgi?id=196644
<rdar://problem/49643614>

Reviewed by Darin Adler.

Source/WebCore:

This patch replaces the existing TouchActionRegion class with the more general EventRegion class.
It collects both the overall event region and the touch action regions. This avoids duplication
and simplifies the code.

The patch also adds serialization support for EventRegion, so touch-action regions gets passed
to the UI process too.

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::setEventRegion):
(WebCore::GraphicsLayer::dumpProperties const):
(WebCore::GraphicsLayer::setTouchActionRegion): Deleted.
* platform/graphics/GraphicsLayer.h:
(WebCore::GraphicsLayer::eventRegion const):
(WebCore::GraphicsLayer::touchActionRegion const): Deleted.
* platform/graphics/Region.cpp:
(WebCore::operator<<):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::setEventRegion):
(WebCore::GraphicsLayerCA::setTouchActionRegion): Deleted.
* platform/graphics/ca/GraphicsLayerCA.h:
* platform/graphics/ca/PlatformCALayer.h:
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
* rendering/EventRegion.cpp: Copied from Source/WebCore/rendering/TouchActionRegion.cpp.
(WebCore::EventRegion::operator== const):
(WebCore::EventRegion::unite):
(WebCore::EventRegion::translate):
(WebCore::EventRegion::uniteTouchActions):
(WebCore::EventRegion::touchActionsForPoint const):
(WebCore::operator<<):
(WebCore::TouchActionRegion::unite): Deleted.
(WebCore::TouchActionRegion::actionsForPoint const): Deleted.
(WebCore::TouchActionRegion::translate): Deleted.
* rendering/EventRegion.h: Copied from Source/WebCore/rendering/TouchActionRegion.h.
(WebCore::EventRegion::isEmpty const):
(WebCore::EventRegion::contains const):
(WebCore::EventRegion::hasTouchActions const):
(WebCore::EventRegion::encode const):
(WebCore::EventRegion::decode):
(WebCore::TouchActionRegion::isEmpty const): Deleted.
(WebCore::TouchActionRegion::operator== const): Deleted.
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paint):
* rendering/PaintInfo.h:
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::paintObject):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::collectEventRegionForFragments):
* rendering/RenderLayer.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateEventRegion):
* rendering/RenderLayerModelObject.cpp:
* rendering/SimpleLineLayoutFunctions.cpp:
(WebCore::SimpleLineLayout::paintFlow):
* rendering/TouchActionRegion.cpp: Removed.
* rendering/TouchActionRegion.h: Removed.

Source/WebKit:

* Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
* Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
(WebKit::RemoteLayerTreeTransaction::LayerProperties::decode):
* UIProcess/RemoteLayerTree/RemoteLayerTreeNode.h:
(WebKit::RemoteLayerTreeNode::eventRegion const):
* UIProcess/RemoteLayerTree/RemoteLayerTreeNode.mm:
(WebKit::RemoteLayerTreeNode::setEventRegion):
* WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp:
(WebKit::PlatformCALayerRemote::setEventRegion):
* WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.h:

LayoutTests:

* pointerevents/ios/touch-action-region-basic-expected.txt:
* pointerevents/ios/touch-action-region-layers-expected.txt:
* pointerevents/ios/touch-action-region-pan-x-y-expected.txt:

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

4 months agoWe should pass minimumEffectiveDeviceWidth to web process on new page creation.
commit-queue@webkit.org [Sat, 6 Apr 2019 03:41:26 +0000 (03:41 +0000)]
We should pass minimumEffectiveDeviceWidth to web process on new page creation.
https://bugs.webkit.org/show_bug.cgi?id=196077
<rdar://problem/49108202>

Patch by Yongjun Zhang <yongjun_zhang@apple.com> on 2019-04-05
Reviewed by Chris Dumez.

Source/WebCore:

If the page doesn't specify it requires to use the device width in viewport tag, we should try to scale down
the page to fit the window width.

Test: fast/viewport/ios/shrink-to-fit-for-page-without-viewport-meta.html

* page/ViewportConfiguration.cpp:
(WebCore::ViewportConfiguration::updateDefaultConfiguration): Also update the minimum layout size
    when the default configuration is changed.
(WebCore::ViewportConfiguration::nativeWebpageParametersWithShrinkToFit): Make sure we fit the content
    to window width.

Source/WebKit:

When a new web view is created, it is possible we don't have the web content process till a load
is requested. This patch stashes minimumEffectiveDeviceWidth in WebPageProxy.cpp and passes that
value down to web process via WebPageCreationParameters when a new process is created, just like
we did for other values like viewportConfigurationLayoutSizeScaleFactor or viewportConfigurationViewLayoutSize.

* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode const): Encode viewportConfigurationMinimumEffectiveDeviceWidth value.
(WebKit::WebPageCreationParameters::decode): Decode viewportConfigurationMinimumEffectiveDeviceWidth value.
* Shared/WebPageCreationParameters.h:
* UIProcess/API/Cocoa/WKWebView.mm: Now that we stash the minimumEffectiveDeviceWidth value in WebPageProxy, we
    don't need the iVar in WKWebView any more.
(-[WKWebView _dispatchSetViewLayoutSize:]): Use _page->minimumEffectiveDeviceWidth().
(-[WKWebView _setViewScale:]): Ditto.
(-[WKWebView _setMinimumEffectiveDeviceWidth:]): Ditto.
(-[WKWebView _minimumEffectiveDeviceWidth]): Ditto.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::creationParameters): Also add viewportConfigurationMinimumEffectiveDeviceWidth to
    web process creation parameter.
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::minimumEffectiveDeviceWidth const): Returns m_viewportConfigurationMinimumEffectiveDeviceWidth.
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::setViewportConfigurationViewLayoutSize): Pass parameters.viewportConfigurationMinimumEffectiveDeviceWidth
    to web process.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage): Take viewportConfigurationMinimumEffectiveDeviceWidth value from the parameter and
    set that to viewport configuration.

Tools:

Add an API test to verify the minimumEffectDeviceWidth is passed to web content process
on new web view.

* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:

LayoutTests:

Add a layout test to verify the page shrinks to fit the window width when ignoreMetaViewport
flag is turned on.

* fast/viewport/ios/shrink-to-fit-for-page-without-viewport-meta-expected.txt: Added.
* fast/viewport/ios/shrink-to-fit-for-page-without-viewport-meta.html: Added.

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

4 months agoMake compare-results understand MotionMark
sbarati@apple.com [Sat, 6 Apr 2019 02:05:11 +0000 (02:05 +0000)]
Make compare-results understand MotionMark
https://bugs.webkit.org/show_bug.cgi?id=196666

Reviewed by Yusuke Suzuki.

* Scripts/compare-results:
(PLT5Results):
(detectMotionMark):
(detectMotionMark1_1):
(motionMarkResults):
(motionMark1_1Results):
(detectBenchmark):
(biggerIsBetter):
(main):

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

4 months ago[JSC] OSRExit recovery for SpeculativeAdd does not consier "A = A + A" pattern
ysuzuki@apple.com [Sat, 6 Apr 2019 01:57:16 +0000 (01:57 +0000)]
[JSC] OSRExit recovery for SpeculativeAdd does not consier "A = A + A" pattern
https://bugs.webkit.org/show_bug.cgi?id=196582

Reviewed by Saam Barati.

JSTests:

* stress/add-overflow-check-with-three-same-registers.js: Added.
(foo):
(Number.prototype.valueOf):
(runWithNumber):

Source/JavaScriptCore:

In DFG, our ArithAdd with overflow is executed speculatively, and we recover the value when overflow flag is set.
The recovery is subtracting the operand from the destination to get the original two operands. Our recovery code
handles A + B = A, A + B = B cases. But it misses A + A = A case (here, A and B are GPRReg). Our recovery code
attempts to produce the original operand by performing A - A, and it always produces zero accidentally.

This patch adds the recovery code for A + A = A case. Because we know that this ArithAdd overflows, and operands were
same values, we can calculate the original operand from the destination value by `((int32_t)value >> 1) ^ 0x80000000`.

We also found that FTL recovery code is dead. We remove them in this patch.

* dfg/DFGOSRExit.cpp:
(JSC::DFG::OSRExit::executeOSRExit):
(JSC::DFG::OSRExit::compileExit):
* dfg/DFGOSRExit.h:
(JSC::DFG::SpeculationRecovery::SpeculationRecovery):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileArithAdd):
* ftl/FTLExitValue.cpp:
(JSC::FTL::ExitValue::dataFormat const):
(JSC::FTL::ExitValue::dumpInContext const):
* ftl/FTLExitValue.h:
(JSC::FTL::ExitValue::isArgument const):
(JSC::FTL::ExitValue::hasIndexInStackmapLocations const):
(JSC::FTL::ExitValue::adjustStackmapLocationsIndexByOffset):
(JSC::FTL::ExitValue::recovery): Deleted.
(JSC::FTL::ExitValue::isRecovery const): Deleted.
(JSC::FTL::ExitValue::leftRecoveryArgument const): Deleted.
(JSC::FTL::ExitValue::rightRecoveryArgument const): Deleted.
(JSC::FTL::ExitValue::recoveryFormat const): Deleted.
(JSC::FTL::ExitValue::recoveryOpcode const): Deleted.
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileNode):
(JSC::FTL::DFG::LowerDFGToB3::preparePatchpointForExceptions):
(JSC::FTL::DFG::LowerDFGToB3::appendOSRExit):
(JSC::FTL::DFG::LowerDFGToB3::exitValueForNode):
(JSC::FTL::DFG::LowerDFGToB3::addAvailableRecovery): Deleted.
* ftl/FTLOSRExitCompiler.cpp:
(JSC::FTL::compileRecovery):

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

4 months ago[Cocoa] Deactivate the audio session before the WebProcess suspends.
jer.noble@apple.com [Sat, 6 Apr 2019 01:08:50 +0000 (01:08 +0000)]
[Cocoa] Deactivate the audio session before the WebProcess suspends.
https://bugs.webkit.org/show_bug.cgi?id=196658

Reviewed by Eric Carlson.

Source/WebCore:

Test: platform/mac/media/audio-session-deactivated-when-suspended.html

Deactivate the audio session when we are notified that the session will suspend.

Drive-by fix: don't try to begin playback when the process is suspended.

* platform/audio/PlatformMediaSessionManager.cpp:
(WebCore::PlatformMediaSessionManager::sessionWillBeginPlayback):
(WebCore::PlatformMediaSessionManager::processWillSuspend):
(WebCore::PlatformMediaSessionManager::processDidResume):
* platform/audio/PlatformMediaSessionManager.h:
(WebCore::PlatformMediaSessionManager::processIsSuspended const):
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::Backup::Backup):
(WebCore::InternalSettings::Backup::restoreTo):
(WebCore::InternalSettings::setShouldDeactivateAudioSession):
* testing/InternalSettings.h:
* testing/InternalSettings.idl:
* testing/Internals.cpp:
(WebCore::Internals::processWillSuspend):
(WebCore::Internals::processDidResume):
* testing/Internals.h:
* testing/Internals.idl:

Source/WebKit:

Notify the PlatformMediaSessionManager when the process suspends or resumes.

* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::actualPrepareToSuspend):
(WebKit::WebProcess::cancelPrepareToSuspend):
(WebKit::WebProcess::processDidResume):

LayoutTests:

* platform/mac/media/audio-session-deactivated-when-suspended-expected.txt: Added.
* platform/mac/media/audio-session-deactivated-when-suspended.html: Added.

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

4 months ago[iOS] Web process gets suspended while holding locked database files
sihui_liu@apple.com [Sat, 6 Apr 2019 01:02:44 +0000 (01:02 +0000)]
[iOS] Web process gets suspended while holding locked database files
https://bugs.webkit.org/show_bug.cgi?id=196519
<rdar://problem/49531797>

Reviewed by Chris Dumez.

Source/WebCore:

Don't use DatabaseTracker singleton before it is initialized.

* Modules/webdatabase/DatabaseTracker.cpp:
(WebCore::DatabaseTracker::isInitialized):
* Modules/webdatabase/DatabaseTracker.h:

Source/WebKit:

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

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

4 months agoClicking "Go Back" from a safe browsing warning from an iframe should navigate the...
achristensen@apple.com [Sat, 6 Apr 2019 00:10:15 +0000 (00:10 +0000)]
Clicking "Go Back" from a safe browsing warning from an iframe should navigate the WKWebView back to the previous page
https://bugs.webkit.org/show_bug.cgi?id=196665
<rdar://45115669>

Reviewed by Geoff Garen.

Source/WebKit:

It is insufficient to just not navigate the subframe.  We must leave the page that contained it.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _showSafeBrowsingWarning:completionHandler:]):
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::showSafeBrowsingWarning):

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/SafeBrowsing.mm:
(goBack):
(+[SimpleLookupContext sharedLookupContext]):
(-[SimpleLookupContext lookUpURL:completionHandler:]):
(TEST):
(+[Simple3LookupContext sharedLookupContext]): Deleted.
(-[Simple3LookupContext lookUpURL:completionHandler:]): Deleted.

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

4 months agoUnreviewed, rolling out r243665.
ryanhaddad@apple.com [Sat, 6 Apr 2019 00:05:32 +0000 (00:05 +0000)]
Unreviewed, rolling out r243665.

Caused iOS JSC tests to exit with an exception.

Reverted changeset:

"Assertion failed in JSC::createError"
https://bugs.webkit.org/show_bug.cgi?id=196305
https://trac.webkit.org/changeset/243665

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

4 months agoMake WeakPtr<Element> possible and deploy it in form associated elements code
rniwa@webkit.org [Sat, 6 Apr 2019 00:03:46 +0000 (00:03 +0000)]
Make WeakPtr<Element> possible and deploy it in form associated elements code
https://bugs.webkit.org/show_bug.cgi?id=196626

Reviewed by Antti Koivisto.

Source/WebCore:

Make Element inherit from CanMakeWeakPtr and deploy WeakPtr<*Element> in FormAssociatedElement and HTMLFormElement.

No new tests sine there should be no behavioral change.

* dom/Element.h:
* html/FormAssociatedElement.cpp:
(WebCore::FormAssociatedElement::FormAssociatedElement):
(WebCore::FormAssociatedElement::insertedIntoAncestor):
(WebCore::FormAssociatedElement::setForm):
(WebCore::FormAssociatedElement::resetFormOwner):
(WebCore::FormAssociatedElement::formAttributeChanged):
* html/FormAssociatedElement.h:
(WebCore::FormAssociatedElement::form const):
* html/HTMLElement.cpp:
(WebCore::HTMLElement::asFormNamedItem):
(WebCore::HTMLElement::asFormAssociatedElement):
* html/HTMLElement.h:
(WebCore::HTMLElement::asFormNamedItem): Deleted.
* html/HTMLFormControlElement.h:
* html/HTMLFormControlsCollection.cpp:
(WebCore::HTMLFormControlsCollection::formImageElements const): Inlined into updateNamedElementCache.
(WebCore::HTMLFormControlsCollection::updateNamedElementCache const):
* html/HTMLFormControlsCollection.h:
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::registerInvalidAssociatedFormControl):
(WebCore::HTMLFormElement::removeInvalidAssociatedFormControlIfNeeded):
(WebCore::HTMLFormElement::registerImgElement):
(WebCore::HTMLFormElement::defaultButton const):
(WebCore::HTMLFormElement::resetDefaultButton):
(WebCore::HTMLFormElement::matchesValidPseudoClass const):
(WebCore::HTMLFormElement::matchesInvalidPseudoClass const):
* html/HTMLFormElement.h:
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::HTMLImageElement):
(WebCore::HTMLImageElement::insertedIntoAncestor):
* html/HTMLImageElement.h:
* html/HTMLInputElement.h:
* html/HTMLMediaElement.h:
* html/HTMLObjectElement.h:
* html/HTMLPictureElement.h:
* html/HTMLSlotElement.h:
* svg/SVGElement.h:

Source/WTF:

Make it possible to call WeakHashSet::remove and WeakHashSet::contains with
a subclass type U of a type T used to define WeakReference<T>.

Also added computesEmpty, which is slightly more efficient than computeSize
when m_set is either empty or when there are non-released weak references in the set.

* wtf/WeakHashSet.h:
(WTF::WeakHashSet::remove):
(WTF::WeakHashSet::contains const):
(WTF::WeakHashSet::computesEmpty const): Added.
* wtf/WeakPtr.h: Added an explicit forward declaration of WeakHashSet to avoid
build failures in GTK+ and WPE ports.

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

4 months agoWeb Inspector: TestSuite test cases should have their own timeout to ensure tests...
drousso@apple.com [Fri, 5 Apr 2019 23:39:16 +0000 (23:39 +0000)]
Web Inspector: TestSuite test cases should have their own timeout to ensure tests fail with output instead of timeout by test runner
https://bugs.webkit.org/show_bug.cgi?id=162814
<rdar://problem/28574102>

Reviewed by Brian Burg.

Source/WebInspectorUI:

A 10s timer is started for every test case added to an async suite. The timer is cleared
when the test finishes, but if the timer fires, the test is forcibly ended with an error.

This timer can be configured by setting a `timeout` value when adding the test case. Values
are expected to be in milliseconds. The value `-1` will prevent a timer from being set.

This change also relaxes the expectation that any individual test case failure will stop the
rest of the suite from running. Since timers are set per test case, it is possible to
recover from a "bad" test case to still run the remaining test cases.

NOTE: there may be unexpected behaviour if a test times out, as the timer doesn't actually
stop the execution of the test, so it may still run and log information, which may appear
"out of nowhere" in the middle of other tests.

* UserInterface/Test/TestSuite.js:
(TestSuite.prototype.get passCount):
(AsyncTestSuite.prototype.runTestCases):
(SyncTestSuite.prototype.runTestCases):

LayoutTests:

* inspector/unit-tests/async-test-suite.html:
* inspector/unit-tests/async-test-suite-expected.txt:
* inspector/unit-tests/sync-test-suite.html:
* inspector/unit-tests/sync-test-suite-expected.txt:

* http/tests/inspector/network/set-resource-caching-disabled-disk-cache-expected.txt:
* inspector/canvas/recording-2d.html:
* inspector/canvas/recording-webgl-snapshots.html:
* inspector/canvas/recording-webgl.html:
* inspector/canvas/resources/shaderProgram-utilities.js:
(TestPage.registerInitializer.whenProgramAdded): Added.
(TestPage.registerInitializer.whenProgramRemoved): Added.
(TestPage.registerInitializer.window.initializeTestSuite):
(TestPage.registerInitializer.window.addSimpleTestCase):
(TestPage.registerInitializer.window.addParentCanvasRemovedTestCase):
(TestPage.registerInitializer.awaitProgramAdded): Added.
(TestPage.registerInitializer.awaitProgramRemoved): Added.
* inspector/console/command-line-api-expected.txt:
* inspector/console/heap-snapshot.html:
* inspector/debugger/async-stack-trace-truncate-expected.txt:
* inspector/debugger/pause-for-internal-scripts-expected.txt:
* inspector/formatting/resources/utilities.js:
(TestPage.registerInitializer.window.addFormattingTests):

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

4 months ago[ews-build] Add configuration and architecture for windows builders
aakash_jain@apple.com [Fri, 5 Apr 2019 23:25:27 +0000 (23:25 +0000)]
[ews-build] Add configuration and architecture for windows builders
https://bugs.webkit.org/show_bug.cgi?id=196660

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-build/config.json:

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

4 months agoUndeprecate WKNavigationData
achristensen@apple.com [Fri, 5 Apr 2019 23:06:46 +0000 (23:06 +0000)]
Undeprecate WKNavigationData
https://bugs.webkit.org/show_bug.cgi?id=196559
<rdar://44927425>

Reviewed by Geoff Garen.

* UIProcess/API/Cocoa/WKNavigationData.h:
It is used to communicate information from FrameLoaderClient::updateGlobalHistory() to the application.
This use in WKBrowsingContextHistoryDelegate is definitely still deprecated, but its use in
WKHistoryDelegatePrivate does not have an adequate replacement yet, so it must remain undeprecated SPI.

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

4 months agoSIGSEGV in JSC::BytecodeGenerator::addStringConstant
ysuzuki@apple.com [Fri, 5 Apr 2019 21:58:32 +0000 (21:58 +0000)]
SIGSEGV in JSC::BytecodeGenerator::addStringConstant
https://bugs.webkit.org/show_bug.cgi?id=196486

Reviewed by Saam Barati.

JSTests:

* stress/arrow-function-and-use-strict-directive.js: Added.
* stress/arrow-function-syntax.js: Added. Checking EOF token handling.
(checkSyntax):
(checkSyntaxError): Currently not using it. But it is useful for testing more things related to arrow function syntax.

Source/JavaScriptCore:

When parsing a FunctionExpression / FunctionDeclaration etc., we use SyntaxChecker for the body of the function because we do not have any interest on the nodes of the body at that time.
The nodes will be parsed with the ASTBuilder when the function itself is parsed for code generation. This works well previously because all the function ends with "}" previously.
SyntaxChecker lexes this "}" token, and parser restores the context back to ASTBuilder and continues parsing.

But now, we have ArrowFunctionExpression without braces `arrow => expr`. Let's consider the following code.

        arrow => expr
        "string!"

We parse arrow function's body with SyntaxChecker. At that time, we lex "string!" token under the SyntaxChecker context. But this means that we may not build string content for this token
since SyntaxChecker may not have interest on string content itself in certain case. After the parser is back to ASTBuilder, we parse "string!" as ExpressionStatement with string constant,
generate StringNode with non-built identifier (nullptr), and we accidentally create StringNode with nullptr.

This patch fixes this problem. The root cause of this problem is that the last token lexed in the previous context is used. We add lexCurrentTokenAgainUnderCurrentContext which will re-lex
the current token under the current context (may be ASTBuilder). This should be done only when the caller's context is different from SyntaxChecker, which avoids unnecessary lexing.
We leverage existing SavePoint mechanism to implement lexCurrentTokenAgainUnderCurrentContext cleanly.

And we also fix the bug in the existing SavePoint mechanism, which is shown in the attached test script. When we save LexerState, we do not save line terminator status. This patch also introduces
lexWithoutClearingLineTerminator, which lex the token without clearing line terminator status.

* parser/ASTBuilder.h:
(JSC::ASTBuilder::createString):
* parser/Lexer.cpp:
(JSC::Lexer<T>::parseMultilineComment):
(JSC::Lexer<T>::lexWithoutClearingLineTerminator): EOF token also should record offset information. This offset information is correctly handled in Lexer::setOffset too.
(JSC::Lexer<T>::lex): Deleted.
* parser/Lexer.h:
(JSC::Lexer::hasLineTerminatorBeforeToken const):
(JSC::Lexer::setHasLineTerminatorBeforeToken):
(JSC::Lexer<T>::lex):
(JSC::Lexer::prevTerminator const): Deleted.
(JSC::Lexer::setTerminator): Deleted.
* parser/Parser.cpp:
(JSC::Parser<LexerType>::allowAutomaticSemicolon):
(JSC::Parser<LexerType>::parseSingleFunction):
(JSC::Parser<LexerType>::parseStatementListItem):
(JSC::Parser<LexerType>::maybeParseAsyncFunctionDeclarationStatement):
(JSC::Parser<LexerType>::parseFunctionInfo):
(JSC::Parser<LexerType>::parseClass):
(JSC::Parser<LexerType>::parseExportDeclaration):
(JSC::Parser<LexerType>::parseAssignmentExpression):
(JSC::Parser<LexerType>::parseYieldExpression):
(JSC::Parser<LexerType>::parseProperty):
(JSC::Parser<LexerType>::parsePrimaryExpression):
(JSC::Parser<LexerType>::parseMemberExpression):
* parser/Parser.h:
(JSC::Parser::nextWithoutClearingLineTerminator):
(JSC::Parser::lexCurrentTokenAgainUnderCurrentContext):
(JSC::Parser::internalSaveLexerState):
(JSC::Parser::restoreLexerState):

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

4 months agoREGRESSION(AppleWebKit/605.1.15): WebDownloadDelegate delegate methods called on...
achristensen@apple.com [Fri, 5 Apr 2019 21:52:51 +0000 (21:52 +0000)]
REGRESSION(AppleWebKit/605.1.15): WebDownloadDelegate delegate methods called on non-main thread
https://bugs.webkit.org/show_bug.cgi?id=190918
<rdar://problem/45603890>

Reviewed by Darin Adler.

Source/WebKitLegacy/mac:

Since we not doing networking on the main thread but WebView is to be used on the main thread,
we need to hop delegate calls to the main thread similarly to how we do it in the non-download
delegate calls in WebCoreResourceHandleAsOperationQueueDelegate.

* Misc/WebDownload.mm:
(-[WebDownloadInternal downloadDidBegin:]):
(-[WebDownloadInternal download:willSendRequest:redirectResponse:]):
(-[WebDownloadInternal download:didReceiveAuthenticationChallenge:]):
(-[WebDownloadInternal download:didReceiveResponse:]):
(-[WebDownloadInternal download:didReceiveDataOfLength:]):
(-[WebDownloadInternal download:shouldDecodeSourceDataOfMIMEType:]):
(-[WebDownloadInternal download:decideDestinationWithSuggestedFilename:]):
(-[WebDownloadInternal download:didCreateDestination:]):
(-[WebDownloadInternal downloadDidFinish:]):
(-[WebDownloadInternal download:didFailWithError:]):

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKitLegacy/mac/DownloadThread.mm: Added.
(-[DownloadThreadChecker webView:decidePolicyForMIMEType:request:frame:decisionListener:]):
(-[DownloadThreadChecker downloadDidBegin:]):
(-[DownloadThreadChecker download:shouldDecodeSourceDataOfMIMEType:]):
(-[DownloadThreadChecker download:decideDestinationWithSuggestedFilename:]):
(-[DownloadThreadChecker download:didCreateDestination:]):
(-[DownloadThreadChecker downloadDidFinish:]):
(TestWebKitAPI::TEST):

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

4 months agoFlaky API Test TestWebKitAPI.WebKit.PerformedActionForURL
achristensen@apple.com [Fri, 5 Apr 2019 21:50:06 +0000 (21:50 +0000)]
Flaky API Test TestWebKitAPI.WebKit.PerformedActionForURL
https://bugs.webkit.org/show_bug.cgi?id=196151

Reviewed by Chris Dumez.

* TestWebKitAPI/Tests/WebKitCocoa/ContentRuleListNotification.mm:
(TEST):
We were assuming that messages were received in a certain order.
Actually wait for all messages to be received before checking results.

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

4 months ago[Mac WK2 iOS Sim] Layout Test imported/w3c/web-platform-tests/webrtc/RTCRtpReceiver...
ryanhaddad@apple.com [Fri, 5 Apr 2019 21:49:29 +0000 (21:49 +0000)]
[Mac WK2 iOS Sim] Layout Test imported/w3c/web-platform-tests/webrtc/RTCRtpReceiver-getSynchronizationSources.https.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=196633

Unreviewed test gardening.

* platform/ios-wk2/TestExpectations: Mark test as flaky.
* platform/mac-wk2/TestExpectations: Ditto.

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

4 months agoRemove AUDIO_TOOLBOX_AUDIO_SESSION
eric.carlson@apple.com [Fri, 5 Apr 2019 21:36:15 +0000 (21:36 +0000)]
Remove AUDIO_TOOLBOX_AUDIO_SESSION
https://bugs.webkit.org/show_bug.cgi?id=196653
<rdar://problem/49652098>

Reviewed by Jer Noble.

Source/WebKitLegacy/mac:

* WebView/WebPreferences.mm:
(-[WebPreferences setAudioSessionCategoryOverride:]):

Source/WTF:

* wtf/Platform.h:

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

4 months ago[JSC] Filter DontEnum properties in ProxyObject::getOwnPropertyNames()
caitp@igalia.com [Fri, 5 Apr 2019 21:28:10 +0000 (21:28 +0000)]
[JSC] Filter DontEnum properties in ProxyObject::getOwnPropertyNames()
https://bugs.webkit.org/show_bug.cgi?id=176810

Reviewed by Saam Barati.

JSTests:

Add tests for the DontEnum filtering, and variations of other tests
take the DontEnum-filtering path.

* stress/proxy-own-keys.js:
(i.catch):
(set assert):
(set add):
(let.set new):
(get let):

Source/JavaScriptCore:

This adds conditional logic following the invariant checks, to perform
filtering in common uses of getOwnPropertyNames.

While this would ideally only be done in JSPropertyNameEnumerator, adding
the filtering to ProxyObject::performGetOwnPropertyNames maintains the
invariant that the EnumerationMode is properly followed.

* runtime/PropertyNameArray.h:
(JSC::PropertyNameArray::reset):
* runtime/ProxyObject.cpp:
(JSC::ProxyObject::performGetOwnPropertyNames):

Source/WebCore:

Previously, there was a comment here indicating uncertainty of whether it
was necessary to filter DontEnum properties explicitly or not. It turns
out that it was necessary in the case of JSC ProxyObjects.

This patch adds DontEnum filtering for ProxyObjects, however we continue
to explicitly filter them in JSDOMConvertRecord, which needs to use the
property descriptor after filtering. This change prevents observably
fetching the property descriptor twice per property.

* bindings/js/JSDOMConvertRecord.h:

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

4 months agoediting/execCommand/print.html is crashing on iOS Debug
sroberts@apple.com [Fri, 5 Apr 2019 21:13:47 +0000 (21:13 +0000)]
editing/execCommand/print.html is crashing on iOS Debug
https://bugs.webkit.org/show_bug.cgi?id=196654

Unreviewed test gardening.

* platform/ios-simulator-wk2/TestExpectations: Skipping test on iOS Debug while waiting for a fix

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

4 months agoUnreviewed manual rollout of r243929
mcatanzaro@igalia.com [Fri, 5 Apr 2019 18:32:43 +0000 (18:32 +0000)]
Unreviewed manual rollout of r243929
https://bugs.webkit.org/show_bug.cgi?id=196626

Source/WebCore:

* dom/Element.h:
* html/FormAssociatedElement.cpp:
(WebCore::FormAssociatedElement::FormAssociatedElement):
(WebCore::FormAssociatedElement::insertedIntoAncestor):
(WebCore::FormAssociatedElement::setForm):
(WebCore::FormAssociatedElement::resetFormOwner):
(WebCore::FormAssociatedElement::formAttributeChanged):
* html/FormAssociatedElement.h:
(WebCore::FormAssociatedElement::form const):
* html/HTMLElement.cpp:
(WebCore::HTMLElement::asFormNamedItem): Deleted.
(WebCore::HTMLElement::asFormAssociatedElement): Deleted.
* html/HTMLElement.h:
(WebCore::HTMLElement::asFormNamedItem):
* html/HTMLFormControlElement.h:
* html/HTMLFormControlsCollection.cpp:
(WebCore:: const):
(WebCore::HTMLFormControlsCollection::updateNamedElementCache const):
* html/HTMLFormControlsCollection.h:
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::registerInvalidAssociatedFormControl):
(WebCore::HTMLFormElement::removeInvalidAssociatedFormControlIfNeeded):
(WebCore::HTMLFormElement::registerImgElement):
(WebCore::HTMLFormElement::defaultButton const):
(WebCore::HTMLFormElement::resetDefaultButton):
(WebCore::HTMLFormElement::matchesValidPseudoClass const):
(WebCore::HTMLFormElement::matchesInvalidPseudoClass const):
* html/HTMLFormElement.h:
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::HTMLImageElement):
(WebCore::HTMLImageElement::insertedIntoAncestor):
* html/HTMLImageElement.h:
* html/HTMLInputElement.h:
* html/HTMLMediaElement.h:
* html/HTMLObjectElement.h:
* html/HTMLPictureElement.h:
* html/HTMLSlotElement.h:
* svg/SVGElement.h:

Source/WTF:

* wtf/WeakHashSet.h:
(WTF::WeakHashSet::remove):
(WTF::WeakHashSet::contains const):
(WTF::WeakHashSet::computesEmpty const): Deleted.

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

4 months agoStop including <AudioToolbox/AudioSession.h>
eric.carlson@apple.com [Fri, 5 Apr 2019 18:21:40 +0000 (18:21 +0000)]
Stop including <AudioToolbox/AudioSession.h>
https://bugs.webkit.org/show_bug.cgi?id=196648
<rdar://problem/39665771>

Reviewed by Jer Noble.

* WebView/WebPreferencesPrivate.h:

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

4 months ago[iOS] Web process gets suspended while holding locked database files
sihui_liu@apple.com [Fri, 5 Apr 2019 18:06:09 +0000 (18:06 +0000)]
[iOS] Web process gets suspended while holding locked database files
https://bugs.webkit.org/show_bug.cgi?id=196519
<rdar://problem/49531797>

Reviewed by Chris Dumez.

Source/WebCore:

We should close all databases and make sure not open new databases when web process is ready to suspend.

* platform/sql/SQLiteDatabase.cpp:
(WebCore::SQLiteDatabase::setIsDatabaseOpeningForbidden):
(WebCore::SQLiteDatabase::open):
* platform/sql/SQLiteDatabase.h:
* platform/sql/SQLiteDatabaseTracker.cpp:
(WebCore::SQLiteDatabaseTracker::setClient):
(WebCore::SQLiteDatabaseTracker::incrementTransactionInProgressCount):
(WebCore::SQLiteDatabaseTracker::decrementTransactionInProgressCount):
(WebCore::SQLiteDatabaseTracker::hasTransactionInProgress):

Source/WebKit:

* Shared/WebSQLiteDatabaseTracker.cpp:
(WebKit::WebSQLiteDatabaseTracker::~WebSQLiteDatabaseTracker):
* Shared/WebSQLiteDatabaseTracker.h:
* WebProcess/WebProcess.cpp:
(WebKit::m_webSQLiteDatabaseTracker):
(WebKit::WebProcess::actualPrepareToSuspend):
(WebKit::WebProcess::processWillSuspendImminently):
(WebKit::WebProcess::cancelPrepareToSuspend):
(WebKit::WebProcess::processDidResume):
* WebProcess/WebProcess.h:

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

4 months agowebkitpy: Don't run subsequent rounds if interrupted
jbedard@apple.com [Fri, 5 Apr 2019 17:14:23 +0000 (17:14 +0000)]
webkitpy: Don't run subsequent rounds if interrupted
https://bugs.webkit.org/show_bug.cgi?id=196646

Reviewed by Aakash Jain.

* Scripts/webkitpy/layout_tests/controllers/manager.py:
(Manager.run): Bail out if interrupted.

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

4 months agoTest sessionStorage in PSON private browsing mode
sihui_liu@apple.com [Fri, 5 Apr 2019 16:30:34 +0000 (16:30 +0000)]
Test sessionStorage in PSON private browsing mode
https://bugs.webkit.org/show_bug.cgi?id=196561

Reviewed by Alex Christensen.

* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:

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

4 months agoUnreviewed, rolling out r243833.
commit-queue@webkit.org [Fri, 5 Apr 2019 15:35:32 +0000 (15:35 +0000)]
Unreviewed, rolling out r243833.
https://bugs.webkit.org/show_bug.cgi?id=196645

This change breaks build of WPE and GTK ports (Requested by
annulen on #webkit).

Reverted changeset:

"[CMake][WTF] Mirror XCode header directories"
https://bugs.webkit.org/show_bug.cgi?id=191662
https://trac.webkit.org/changeset/243833

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

4 months agoJSTests:
caitp@igalia.com [Fri, 5 Apr 2019 13:45:08 +0000 (13:45 +0000)]
JSTests:
[JSC] throw if 'ownKeys' Proxy trap result contains duplicate keys
https://bugs.webkit.org/show_bug.cgi?id=185211

Reviewed by Saam Barati.

This is for the normative spec change in https://github.com/tc39/ecma262/pull/833

This changes several assertions to expect a TypeError to be thrown (in some cases,
changing thee expected message).

* es6/Proxy_ownKeys_duplicates.js:
(handler):
(shouldThrow):
(test):
* stress/Object_static_methods_Object.getOwnPropertyDescriptors-proxy.js:
(shouldThrow):
* stress/proxy-own-keys.js:
(i.catch):
(assert):

LayoutTests/imported/w3c:
[JSC] throw if 'ownKeys' Proxy trap result contains duplicate keys
https://bugs.webkit.org/show_bug.cgi?id=185211

Reviewed by Saam Barati.

This is for the normative spec change in https://github.com/tc39/ecma262/pull/833

Change some test expectations which were previously expected to fail.

* web-platform-tests/fetch/api/headers/headers-record-expected.txt:

Source/JavaScriptCore:
[JSC] throw if ownKeys Proxy trap result contains duplicate keys
https://bugs.webkit.org/show_bug.cgi?id=185211

Reviewed by Saam Barati.

Implements the normative spec change in https://github.com/tc39/ecma262/pull/833

This involves tracking duplicate keys returned from the ownKeys trap in yet
another HashTable, and may incur a minor performance penalty in some cases. This
is not expected to significantly affect web performance.

* runtime/ProxyObject.cpp:
(JSC::ProxyObject::performGetOwnPropertyNames):

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

4 months agoREGRESSION(r240685): Remove duplicate Headers entry for _WKInspectorWindow.h in Xcode...
ddkilzer@apple.com [Fri, 5 Apr 2019 12:42:44 +0000 (12:42 +0000)]
REGRESSION(r240685): Remove duplicate Headers entry for _WKInspectorWindow.h in Xcode project
<https://bugs.webkit.org/show_bug.cgi?id=193951>
<rdar://problem/47621366>

Fixes the following build warnings:
    Warning: Multiple build commands for output file WebKit2_WebKit.roots/BuildRecords/WebKit2_installhdrs/Root/System/Library/Frameworks/WebKit.framework/PrivateHeaders/_WKInspectorWindow.h
    Warning: Multiple build commands for output file WebKit2_WebKit.roots/BuildRecords/WebKit2_installapi/Root/System/Library/Frameworks/WebKit.framework/PrivateHeaders/_WKInspectorWindow.h
    Warning: Multiple build commands for output file WebKit2_WebKit.roots/BuildRecords/WebKit2_install/Root/System/Library/Frameworks/WebKit.framework/PrivateHeaders/_WKInspectorWindow.h

* WebKit.xcodeproj/project.pbxproj: Remove duplicate entry for
_WKInspectorWindow.h.  In r240685, a second Headers entry was
added, but the first one was never removed.

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

4 months agoREGRESSION(r243887): Try to fix Windows builds by including <wtf/IsoMalloc.h>
ddkilzer@apple.com [Fri, 5 Apr 2019 12:25:05 +0000 (12:25 +0000)]
REGRESSION(r243887): Try to fix Windows builds by including <wtf/IsoMalloc.h>

Caused by:
    [WebCore] Put most of derived classes of ScriptWrappable into IsoHeap
    https://bugs.webkit.org/show_bug.cgi?id=196475

* css/CSSComputedStyleDeclaration.h:
* dom/DOMRectReadOnly.h:
* dom/LiveNodeList.h:
* dom/NodeIterator.h:
* dom/TreeWalker.h:
* fileapi/Blob.h:
* fileapi/File.h:
* fileapi/FileList.h:
* html/CachedHTMLCollection.h:
* html/HTMLFormElement.h:
* html/HTMLNameCollection.h:
* html/canvas/GPUBasedCanvasRenderingContext.h:
* page/RemoteDOMWindow.h:

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

4 months ago[WPE] Unreviewed gardening, update unexpected passes
dpino@igalia.com [Fri, 5 Apr 2019 11:30:38 +0000 (11:30 +0000)]
[WPE] Unreviewed gardening, update unexpected passes

* platform/wpe/TestExpectations:

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

4 months agoMake WeakPtr<Element> possible and deploy it in form associated elements code
rniwa@webkit.org [Fri, 5 Apr 2019 08:22:39 +0000 (08:22 +0000)]
Make WeakPtr<Element> possible and deploy it in form associated elements code
https://bugs.webkit.org/show_bug.cgi?id=196626

Reviewed by Antti Koivisto.

Source/WebCore:

Make Element inherit from CanMakeWeakPtr and deploy WeakPtr<*Element> in FormAssociatedElement and HTMLFormElement.

No new tests sine there should be no behavioral change.

* dom/Element.h:
* html/FormAssociatedElement.cpp:
(WebCore::FormAssociatedElement::FormAssociatedElement):
(WebCore::FormAssociatedElement::insertedIntoAncestor):
(WebCore::FormAssociatedElement::setForm):
(WebCore::FormAssociatedElement::resetFormOwner):
(WebCore::FormAssociatedElement::formAttributeChanged):
* html/FormAssociatedElement.h:
(WebCore::FormAssociatedElement::form const):
* html/HTMLElement.cpp:
(WebCore::HTMLElement::asFormNamedItem):
(WebCore::HTMLElement::asFormAssociatedElement):
* html/HTMLElement.h:
(WebCore::HTMLElement::asFormNamedItem): Deleted.
* html/HTMLFormControlElement.h:
* html/HTMLFormControlsCollection.cpp:
(WebCore::HTMLFormControlsCollection::formImageElements const): Inlined into updateNamedElementCache.
(WebCore::HTMLFormControlsCollection::updateNamedElementCache const):
* html/HTMLFormControlsCollection.h:
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::registerInvalidAssociatedFormControl):
(WebCore::HTMLFormElement::removeInvalidAssociatedFormControlIfNeeded):
(WebCore::HTMLFormElement::registerImgElement):
(WebCore::HTMLFormElement::defaultButton const):
(WebCore::HTMLFormElement::resetDefaultButton):
(WebCore::HTMLFormElement::matchesValidPseudoClass const):
(WebCore::HTMLFormElement::matchesInvalidPseudoClass const):
* html/HTMLFormElement.h:
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::HTMLImageElement):
(WebCore::HTMLImageElement::insertedIntoAncestor):
* html/HTMLImageElement.h:
* html/HTMLInputElement.h:
* html/HTMLMediaElement.h:
* html/HTMLObjectElement.h:
* html/HTMLPictureElement.h:
* html/HTMLSlotElement.h:
* svg/SVGElement.h:

Source/WTF:

Make it possible to call WeakHashSet::remove and WeakHashSet::contains with
a subclass type U of a type T used to define WeakReference<T>.

Also added computesEmpty, which is slightly more efficient than computeSize
when m_set is either empty or when there are non-released weak references in the set.

* wtf/WeakHashSet.h:
(WTF::WeakHashSet::remove):
(WTF::WeakHashSet::contains const):
(WTF::WeakHashSet::computesEmpty const): Added.

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

4 months ago[ATK] Use a smart pointer for AccessibilityObject wrapper and remove GTK specific...
carlosgc@webkit.org [Fri, 5 Apr 2019 07:35:24 +0000 (07:35 +0000)]
[ATK] Use a smart pointer for AccessibilityObject wrapper and remove GTK specific code
https://bugs.webkit.org/show_bug.cgi?id=196593
<rdar://problem/49599153>

Reviewed by Michael Catanzaro.

Source/WebCore:

We have specific code for GTK to get/set the wrapper only because we don't use smart pointers. Also use
WebKitAccessible as AccessibilityObjectWrapper instead of generic AtkObject, to enforce wrappers to be
WebKitAccessible instances. This requires a few casts to AtkObject.

* accessibility/AccessibilityObject.h:
(WebCore::AccessibilityObject::setWrapper):
* accessibility/AccessibilityObjectInterface.h:
* accessibility/atk/AXObjectCacheAtk.cpp:
(WebCore::AXObjectCache::detachWrapper):
(WebCore::AXObjectCache::attachWrapper):
(WebCore::notifyChildrenSelectionChange):
(WebCore::AXObjectCache::postPlatformNotification):
(WebCore::AXObjectCache::nodeTextChangePlatformNotification):
(WebCore::AXObjectCache::frameLoadingEventPlatformNotification):
(WebCore::AXObjectCache::platformHandleFocusedUIElementChanged):
* accessibility/atk/AccessibilityObjectAtk.cpp:
* accessibility/atk/WebKitAccessibleInterfaceComponent.cpp:
(webkitAccessibleComponentRefAccessibleAtPoint):
* accessibility/atk/WebKitAccessibleInterfaceHypertext.cpp:
(webkitAccessibleHypertextGetLink):
(webkitAccessibleHypertextGetNLinks):
* accessibility/atk/WebKitAccessibleInterfaceSelection.cpp:
(webkitAccessibleSelectionRefSelection):
* accessibility/atk/WebKitAccessibleInterfaceTable.cpp:
(webkitAccessibleTableRefAt):
(webkitAccessibleTableGetColumnHeader):
(webkitAccessibleTableGetRowHeader):
(webkitAccessibleTableGetCaption):
* accessibility/atk/WebKitAccessibleInterfaceTableCell.cpp:
(convertToGPtrArray):
(webkitAccessibleTableCellGetTable):
* accessibility/atk/WebKitAccessibleInterfaceText.cpp:
(accessibilityObjectLength):
* accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
(setAtkRelationSetFromCoreObject):
(atkParentOfRootObject):
(webkitAccessibleGetParent):
(webkitAccessibleRefChild):
(isTextWithCaret):
* editing/atk/FrameSelectionAtk.cpp:
(WebCore::emitTextSelectionChange):
(WebCore::maybeEmitTextFocusChange):

Source/WebKit:

* WebProcess/WebPage/atk/WebKitWebPageAccessibilityObject.cpp:
(accessibilityRootObjectWrapper): Cast wrapper() as AtkObject.

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

4 months agoSimple iframe scrolling test fails to get a composited scrolling frame in WebKitTestR...
simon.fraser@apple.com [Fri, 5 Apr 2019 06:42:05 +0000 (06:42 +0000)]
Simple iframe scrolling test fails to get a composited scrolling frame in WebKitTestRunnerApp
https://bugs.webkit.org/show_bug.cgi?id=196635

Reviewed by Antti Koivisto.
Source/WebKit:

Remove WKBundleSetAsyncFrameScrollingEnabled().

* WebProcess/InjectedBundle/API/c/WKBundle.cpp:
(WKBundleSetAsyncFrameScrollingEnabled): Deleted.
* WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:

Tools:

InjectedBundle::beginTesting() calling WKBundleSetAsyncFrameScrollingEnabled() makes it impossible
for a test to enable async frame scrolling via:
    <!-- webkit-test-runner [ internal:AsyncFrameScrollingEnabled=true ] -->
so remove it and have TestController::resetPreferencesToConsistentValues() set the default value.

Test: scrollingcoordinator/ios/programmatic-frame-scroll.html

* WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::InjectedBundle::beginTesting):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetPreferencesToConsistentValues):

LayoutTests:

* scrollingcoordinator/ios/programmatic-frame-scroll-expected.html: Added.
* scrollingcoordinator/ios/programmatic-frame-scroll.html: Added.

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

4 months ago[iOS WK2] REGRESSION (r242687): Programmatic scroll of overflow scroll results in...
simon.fraser@apple.com [Fri, 5 Apr 2019 05:18:17 +0000 (05:18 +0000)]
[iOS WK2] REGRESSION (r242687): Programmatic scroll of overflow scroll results in bad rendering
https://bugs.webkit.org/show_bug.cgi?id=195584

Reviewed by Zalan Bujtas.

Source/WebCore:

Push data to the scrolling tree about whether an overflow:scroll scroll was programmatic, by having
RenderLayer::scrollToOffset() call into AsyncScrollingCoordinator::requestScrollPositionUpdate(),
just as we do for frames.

AsyncScrollingCoordinator::requestScrollPositionUpdate() is generalized to take any ScrollableArea.

Fix an assumption in the ScrollingTree that we only care about programmatic scrolls on the root node.
ScrollingTree::commitTreeState() no longer sets isHandlingProgrammaticScroll; instead,
callers of ScrollingTreeScrollingNode::scrollTo() pass a ScrollType. Commit functions pass
ScrollType::Programmatic when handling RequestedScrollPosition changes as necessary.

Programmatic scrolls need to get to the scrolling tree in the UI process so that we update
the tree's notion of scroll position, and trigger actual UIScrollView scrolls (layers may have
already been put in the right locations, but the UI process needs to know that a scroll happened).
However, we need to prevent notifications from programmatic scrolls getting back to the
web process, because this causes jumpiness. This is done via an early return in
RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll().

Tests: scrollingcoordinator/ios/programmatic-overflow-scroll.html
       scrollingcoordinator/ios/programmatic-page-scroll.html

* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate):
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::requestScrollPositionUpdate):
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::commitTreeState):
(WebCore::ScrollingTree::isHandlingProgrammaticScroll): Deleted.
* page/scrolling/ScrollingTree.h:
(WebCore::ScrollingTree::isHandlingProgrammaticScroll const):
(WebCore::ScrollingTree::setIsHandlingProgrammaticScroll):
* page/scrolling/ScrollingTreeScrollingNode.cpp:
(WebCore::ScrollingTreeScrollingNode::scrollBy):
(WebCore::ScrollingTreeScrollingNode::scrollTo):
* page/scrolling/ScrollingTreeScrollingNode.h:
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
(WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateAfterChildren):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollToOffset):
(WebCore::RenderLayer::scrollingNodeID const):
* rendering/RenderLayer.h:
* rendering/RenderMarquee.cpp:
(WebCore::RenderMarquee::timerFired):

Source/WebKit:

Push data to the scrolling tree about whether an overflow:scroll scroll was programmatic, by having
RenderLayer::scrollToOffset() call into AsyncScrollingCoordinator::requestScrollPositionUpdate(),
just as we do for frames.

AsyncScrollingCoordinator::requestScrollPositionUpdate() is generalized to take any ScrollableArea.

Fix an assumption in the ScrollingTree that we only care about programmatic scrolls on the root node.
ScrollingTree::commitTreeState() no longer sets isHandlingProgrammaticScroll; instead,
callers of ScrollingTreeScrollingNode::scrollTo() pass a ScrollType. Commit functions pass
ScrollType::Programmatic when handling RequestedScrollPosition changes as necessary.

Programmatic scrolls need to get to the scrolling tree in the UI process so that we update
the tree's notion of scroll position, and trigger actual UIScrollView scrolls (layers may have
already been put in the right locations, but the UI process needs to know that a scroll happened).
However, we need to prevent notifications from programmatic scrolls getting back to the
web process, because this causes jumpiness. This is done via an early return in
RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll().

* UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
(WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll):
* UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm:
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateAfterChildren): Subframe nodes have
a delegate, and that will take care of the requestedScrollPosition update.
* UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
* UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
(WebKit::ScrollingTreeOverflowScrollingNodeIOS::commitStateAfterChildren):
* UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
(WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateAfterChildren):

LayoutTests:

Testing of programmatic scrolls in frames is prevented by webkit.org/b/196635.

* scrollingcoordinator/ios/programmatic-overflow-scroll-expected.html: Added.
* scrollingcoordinator/ios/programmatic-overflow-scroll.html: Added.
* scrollingcoordinator/ios/programmatic-page-scroll-expected.html: Added.
* scrollingcoordinator/ios/programmatic-page-scroll.html: Added.

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

4 months ago[JSC] makeBoundFunction should not assume incoming "length" value is Int32 because...
ysuzuki@apple.com [Fri, 5 Apr 2019 04:17:44 +0000 (04:17 +0000)]
[JSC] makeBoundFunction should not assume incoming "length" value is Int32 because it performs some calculation in bytecode
https://bugs.webkit.org/show_bug.cgi?id=196631

Reviewed by Saam Barati.

JSTests:

* stress/make-bound-function-should-not-assume-int32-length.js: Added.
(assert):
(test):
(foo):

Source/JavaScriptCore:

makeBoundFunction assumes that "length" argument is always Int32. But this should not be done since this "length" value is calculated in builtin JS code.
DFG may store this value in Double format so that we should not rely on that this value is Int32. This patch fixes makeBoundFunction function to perform
toInt32 operation. We also insert a missing exception check for `JSString::value(ExecState*)` in makeBoundFunction.

* JavaScriptCore.xcodeproj/project.pbxproj:
* Sources.txt:
* interpreter/CallFrameInlines.h:
* runtime/DoublePredictionFuzzerAgent.cpp: Copied from Source/JavaScriptCore/interpreter/CallFrameInlines.h.
(JSC::DoublePredictionFuzzerAgent::DoublePredictionFuzzerAgent):
(JSC::DoublePredictionFuzzerAgent::getPrediction):
* runtime/DoublePredictionFuzzerAgent.h: Copied from Source/JavaScriptCore/interpreter/CallFrameInlines.h.
* runtime/JSGlobalObject.cpp:
(JSC::makeBoundFunction):
* runtime/Options.h:
* runtime/VM.cpp:
(JSC::VM::VM):

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

4 months agoUnreviewed, speculative fix for build failure
ysuzuki@apple.com [Fri, 5 Apr 2019 01:45:12 +0000 (01:45 +0000)]
Unreviewed, speculative fix for build failure
https://bugs.webkit.org/show_bug.cgi?id=196475

* Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.h:

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

4 months agoElement::isFocusable() debug asserts too frequently
rniwa@webkit.org [Fri, 5 Apr 2019 01:09:44 +0000 (01:09 +0000)]
Element::isFocusable() debug asserts too frequently
https://bugs.webkit.org/show_bug.cgi?id=196634

Reviewed by Geoffrey Garen.

Remove the debug assertion for now.

* dom/Element.cpp:
(WebCore::Element::isFocusable const):

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

4 months agoUse a correct LC_RPATH when building with ASan
ap@apple.com [Fri, 5 Apr 2019 00:49:40 +0000 (00:49 +0000)]
Use a correct LC_RPATH when building with ASan
https://bugs.webkit.org/show_bug.cgi?id=196576

Reviewed by David Kilzer.

* asan/asan.xcconfig: As a temporary hack, just force LC_RPATH on all binaries,
so that ../Frameworks is checked. This is simpler and more reliable than updating
each SPC service xcconfig.

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

4 months agoAdd another status-bubble iframe to display results from new EWS
aakash_jain@apple.com [Fri, 5 Apr 2019 00:31:41 +0000 (00:31 +0000)]
Add another status-bubble iframe to display results from new EWS
https://bugs.webkit.org/show_bug.cgi?id=196308

Reviewed by Lucas Forschler.

* js/status-bubble.js:
(handleStatusBubbleMessage): Added URL for new EWS.
(handleStatusBubbleLoadNewEWS): Method to post message to new EWS.
* code-review.js: Added another iframe to display results from new EWS.
* template/en/default/attachment/edit.html.tmpl: Ditto.
* template/en/default/attachment/list.html.tmpl: Ditto.
* template/en/default/attachment/reviewform.html.tmpl: Ditto.

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

4 months agoUnreviewed. Make the test from r243906 catch the thrown exceptions.
sbarati@apple.com [Fri, 5 Apr 2019 00:28:21 +0000 (00:28 +0000)]
Unreviewed. Make the test from r243906 catch the thrown exceptions.

* stress/inferred-types-regex-matches-array.js:

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

4 months agoHave ScrollableArea store a ScrollType for the current scroll
simon.fraser@apple.com [Fri, 5 Apr 2019 00:11:08 +0000 (00:11 +0000)]
Have ScrollableArea store a ScrollType for the current scroll
https://bugs.webkit.org/show_bug.cgi?id=196627

Reviewed by Zalan Bujtas.

Source/WebCore:

RenderLayer had isInUserScroll() which is the opposite of ScrollableArea::inProgrammaticScroll(),
so just have ScrollableArea store a ScrollType.

RenderLayer's scrolling bottleneck, scrollToOffset(), now takes a ScrollType, and pushes
it onto the base class.

AsyncScrollingCoordinator::requestScrollPositionUpdate() can use the incoming scrollType (currently
incorrect for iOS WK2 overflow) rather than deducing a user scroll from ScrollingLayerPositionAction.

No behavior change.

* page/FrameView.cpp:
(WebCore::FrameView::setFrameRect):
(WebCore::FrameView::topContentInsetDidChange):
(WebCore::FrameView::updateLayoutViewport):
(WebCore::FrameView::setScrollPosition):
(WebCore::FrameView::shouldUpdateCompositingLayersAfterScrolling const):
(WebCore::FrameView::setWasScrolledByUser):
* page/FrameViewLayoutContext.cpp:
(WebCore::LayoutScope::LayoutScope):
(WebCore::LayoutScope::~LayoutScope):
* page/ios/FrameIOS.mm:
(WebCore::Frame::overflowScrollPositionChangedForNode):
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate):
(WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
(WebCore::AsyncScrollingCoordinator::reconcileScrollingState):
* platform/ScrollView.cpp:
(WebCore::ScrollView::setScrollPosition):
* platform/ScrollableArea.cpp:
(WebCore::ScrollableArea::ScrollableArea):
* platform/ScrollableArea.h:
(WebCore::ScrollableArea::currentScrollType const):
(WebCore::ScrollableArea::setCurrentScrollType):
(WebCore::ScrollableArea::setIsUserScroll): Deleted.
(WebCore::ScrollableArea::inProgrammaticScroll const): Deleted.
(WebCore::ScrollableArea::setInProgrammaticScroll): Deleted.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::RenderLayer):
(WebCore::RenderLayer::scrollToXPosition):
(WebCore::RenderLayer::scrollToYPosition):
(WebCore::RenderLayer::scrollToOffset):
(WebCore::RenderLayer::scrollTo):
* rendering/RenderLayer.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateScrollOffset):
* rendering/RenderMarquee.cpp:
(WebCore::RenderMarquee::start):

Source/WebKitLegacy/mac:

Send the programmatic scroll type.

* DOM/DOMHTML.mm:
(-[DOMHTMLElement setScrollXOffset:scrollYOffset:adjustForIOSCaret:]):

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

4 months agoB3ReduceStrength should know that Mul distributes over Add and Sub
rmorisset@apple.com [Fri, 5 Apr 2019 00:08:31 +0000 (00:08 +0000)]
B3ReduceStrength should know that Mul distributes over Add and Sub
https://bugs.webkit.org/show_bug.cgi?id=196325
<rdar://problem/49441650>

Reviewed by Saam Barati.

Fix some obviously wrong code that was due to an accidental copy-paste.
It made the entire optimization dead code that never ran.

* b3/B3ReduceStrength.cpp:

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

4 months agoUnreviewed, rolling out r243868.
sroberts@apple.com [Thu, 4 Apr 2019 23:14:50 +0000 (23:14 +0000)]
Unreviewed, rolling out r243868.

Causing timeouts failures on several queues

Reverted changeset:

"[Web Animations] JS wrapper may be deleted while animation is
yet to dispatch its finish event"
https://bugs.webkit.org/show_bug.cgi?id=196118
https://trac.webkit.org/changeset/243868

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

4 months agoUnreviewed, rolling out r243888.
ryanhaddad@apple.com [Thu, 4 Apr 2019 22:51:24 +0000 (22:51 +0000)]
Unreviewed, rolling out r243888.

Introduced layout test crashes.

Reverted changeset:

"[macOS][iOS] Add filter to syscall sandbox rule"
https://bugs.webkit.org/show_bug.cgi?id=196613
https://trac.webkit.org/changeset/243888

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

4 months agoDisable Flaky API Test TestWebKitAPI.WebKit.FocusTextInputContext
aakash_jain@apple.com [Thu, 4 Apr 2019 22:47:15 +0000 (22:47 +0000)]
Disable Flaky API Test TestWebKitAPI.WebKit.FocusTextInputContext
https://bugs.webkit.org/show_bug.cgi?id=196629

Reviewed by Lucas Forschler.

* TestWebKitAPI/Tests/WebKitCocoa/RequestTextInputContext.mm:

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

4 months ago[ews-app] while waiting in queue status-bubble for testers queues should display...
aakash_jain@apple.com [Thu, 4 Apr 2019 22:44:38 +0000 (22:44 +0000)]
[ews-app] while waiting in queue status-bubble for testers queues should display build information from builder queue
https://bugs.webkit.org/show_bug.cgi?id=196618

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-app/ews/views/statusbubble.py:
(StatusBubble): Added QUEUE_TRIGGERS.
(StatusBubble._build_bubble): Get the build from builder if tester has not started the build yet.
(StatusBubble._get_parent_queue): Get the name of the parent (builder) queue.
(StatusBubble.get_latest_build_for_queue): If the queue doesn't have any build yet, return build information from
its parent(builder).

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

4 months ago[ews-app] Status-bubble steps are sometimes displayed in reverse order
aakash_jain@apple.com [Thu, 4 Apr 2019 22:42:43 +0000 (22:42 +0000)]
[ews-app] Status-bubble steps are sometimes displayed in reverse order
https://bugs.webkit.org/show_bug.cgi?id=196625

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-app/ews/views/statusbubble.py:
(StatusBubble._steps_messages): Explicitly specify order_by('uid').

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

4 months agoDisable Flaky API Test TestWebKitAPI.KeyboardInputTests.KeyboardTypeForInput
aakash_jain@apple.com [Thu, 4 Apr 2019 22:11:46 +0000 (22:11 +0000)]
Disable Flaky API Test TestWebKitAPI.KeyboardInputTests.KeyboardTypeForInput
https://bugs.webkit.org/show_bug.cgi?id=196630

Reviewed by Wenson Hsieh.

* TestWebKitAPI/Tests/ios/KeyboardInputTestsIOS.mm:

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

4 months agoPass storage quota parameters from UIProcess to NetworkProcess as part of WebsiteData...
youenn@apple.com [Thu, 4 Apr 2019 22:07:09 +0000 (22:07 +0000)]
Pass storage quota parameters from UIProcess to NetworkProcess as part of WebsiteDataStore parameters
https://bugs.webkit.org/show_bug.cgi?id=196543

Reviewed by Alex Christensen.

Source/WebCore:

Add a default routine to compute a third party quota from a per origin quota.
No change of behavior.

* storage/StorageQuotaManager.h:
(WebCore::StorageQuotaManager::defaultThirdPartyQuotaFromPerOriginQuota):
(WebCore::StorageQuotaManager::defaultThirdPartyQuota):

Source/WebKit:

Renamed methods used to set cache storage quota to be storage generic
since they will apply to all storage.

Pass quota parameters as part of WebsiteDataStoreParameters from UIProcess
to NetworkProcess (start-up time and new WebsiteDataStore time).

Compute on UIProcess the quota for third party origins using the default rule of dividing by 10.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::initializeNetworkProcess):
(WebKit::NetworkProcess::addWebsiteDataStore):
(WebKit::NetworkProcess::initializeStorageQuota):
(WebKit::NetworkProcess::setCacheStorageParameters):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* Shared/WebsiteDataStoreParameters.cpp:
(WebKit::WebsiteDataStoreParameters::encode const):
(WebKit::WebsiteDataStoreParameters::decode):
* Shared/WebsiteDataStoreParameters.h:
* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreSetPerOriginStorageQuota):
(WKWebsiteDataStoreSetCacheStoragePerOriginQuota): Deleted.
* UIProcess/API/C/WKWebsiteDataStoreRef.h:
* UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
(-[WKWebsiteDataStore _perOriginStorageQuota]):
(-[WKWebsiteDataStore _setPerOriginStorageQuota:]):
(-[WKWebsiteDataStore _cacheStoragePerOriginQuota]): Deleted.
(-[WKWebsiteDataStore _setCacheStoragePerOriginQuota:]): Deleted.
* UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::retrieveCacheStorageParameters):
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::parameters):
* UIProcess/WebsiteData/WebsiteDataStore.h:
(WebKit::WebsiteDataStore::perOriginStorageQuota const):
(WebKit::WebsiteDataStore::setPerOriginStorageQuota):
(WebKit::WebsiteDataStore::cacheStoragePerOriginQuota const): Deleted.
(WebKit::WebsiteDataStore::setCacheStoragePerOriginQuota): Deleted.
* UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp:
(WebKit::WebsiteDataStoreConfiguration::copy):
* UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h:
(WebKit::WebsiteDataStoreConfiguration::perOriginStorageQuota):
(WebKit::WebsiteDataStoreConfiguration::setPerOriginStorageQuota):
(WebKit::WebsiteDataStoreConfiguration::cacheStoragePerOriginQuota): Deleted.
(WebKit::WebsiteDataStoreConfiguration::setCacheStoragePerOriginQuota): Deleted.

Tools:

* WebKitTestRunner/TestController.cpp:
(WTR::TestController::generatePageConfiguration):

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

4 months agoUnreviewed, rolling out r243807 and r243824.
commit-queue@webkit.org [Thu, 4 Apr 2019 21:59:02 +0000 (21:59 +0000)]
Unreviewed, rolling out r243807 and r243824.
https://bugs.webkit.org/show_bug.cgi?id=196611

Test added is a flaky timeout on iOS Simulator, 3 tests
unskipped are flaky failures (Requested by ShawnRoberts on
#webkit).

Reverted changesets:

"Blob type cannot be stored correctly in IDB when
IDBObjectStore has autoIncrement and keyPath options"
https://bugs.webkit.org/show_bug.cgi?id=196128
https://trac.webkit.org/changeset/243807

"Follow up fix for r243807: Use MarkedArgumentBuffer instead
of Vector for JSValue"
https://bugs.webkit.org/show_bug.cgi?id=196547
https://trac.webkit.org/changeset/243824

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

4 months agoChanging default website policies shouldn't change default website policies in subseq...
wenson_hsieh@apple.com [Thu, 4 Apr 2019 21:56:38 +0000 (21:56 +0000)]
Changing default website policies shouldn't change default website policies in subsequent navigations
https://bugs.webkit.org/show_bug.cgi?id=196562
<rdar://problem/49573377>

Reviewed by Tim Horton.

Currently, changing the default WKWebpagePreferences object when deciding navigation policy causes the set of
default policies to change in subsequent navigations. Among other things, this prevents clients from passing
a modified version of the default website policies into the decision handler without impacting future
navigations. To fix this, teach API::WebsitePolicies to make a copy of itself, and then use this to pass a copy
of the default website policies to the navigation delegate when deciding navigation policies.

Test: DoNotAllowChangingDefaultWebpagePreferencesInDelegateMethod

* UIProcess/API/APIWebsitePolicies.cpp:
(API::WebsitePolicies::copy const):

Add a helper method to copy a set of website policies.

* UIProcess/API/APIWebsitePolicies.h:
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):

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

4 months agoFix rare crash under collectRelatedCoordinatedScrollingNodes()
simon.fraser@apple.com [Thu, 4 Apr 2019 21:47:29 +0000 (21:47 +0000)]
Fix rare crash under collectRelatedCoordinatedScrollingNodes()
https://bugs.webkit.org/show_bug.cgi?id=196610
rdar://problem/49595426

Reviewed by Zalan Bujtas.

hasCompositedScrollableOverflow() doesn't check whether a layer is composited (it has
to report the right status before layers have been created), so collectRelatedCoordinatedScrollingNodes()
needs to check whether there's backing.

* rendering/RenderLayerCompositor.cpp:
(WebCore::collectRelatedCoordinatedScrollingNodes):

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

4 months agoUnreviewed, build fix for CLoop after r243886
sbarati@apple.com [Thu, 4 Apr 2019 21:39:16 +0000 (21:39 +0000)]
Unreviewed, build fix for CLoop after r243886

* interpreter/Interpreter.cpp:
(JSC::UnwindFunctor::copyCalleeSavesToEntryFrameCalleeSavesBuffer const):
* interpreter/StackVisitor.cpp:
(JSC::StackVisitor::Frame::calleeSaveRegistersForUnwinding):
* interpreter/StackVisitor.h:

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

4 months agocreateRegExpMatchesArray does not respect inferred types
sbarati@apple.com [Thu, 4 Apr 2019 21:13:26 +0000 (21:13 +0000)]
createRegExpMatchesArray does not respect inferred types
https://bugs.webkit.org/show_bug.cgi?id=193287

Reviewed by Yusuke Suzuki.

This checks in the test case for 193287. This issue was discovered by
Samuel Groß of Google Project Zero.

* stress/inferred-types-regex-matches-array.js: Added.

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

4 months agoMove "inProgrammaticScroll" down to ScrollableArea
simon.fraser@apple.com [Thu, 4 Apr 2019 21:10:29 +0000 (21:10 +0000)]
Move "inProgrammaticScroll" down to ScrollableArea
https://bugs.webkit.org/show_bug.cgi?id=196614

Reviewed by Zalan Bujtas.

A future patch will need to update "inProgrammaticScroll" on RenderLayers, so push
inProgrammaticScroll() down to ScrollableArea.

ScrollableArea already has "isScrolledProgrammatically", which I rename to "scrollShouldClearLatchedState"
to reduce confusion. It might be possible to remove this in future with some refactoring.

Sadly we can no longer use SetForScope<> in FrameView after this change so add some manual save/restore code.

* dom/Element.cpp:
(WebCore::Element::setScrollLeft):
(WebCore::Element::setScrollTop):
* page/EventHandler.cpp:
(WebCore::EventHandler::completeWidgetWheelEvent):
(WebCore::EventHandler::handleWheelEvent):
* page/FrameView.cpp:
(WebCore::FrameView::setFrameRect):
(WebCore::FrameView::topContentInsetDidChange):
(WebCore::FrameView::updateLayoutViewport):
(WebCore::FrameView::setScrollPosition):
(WebCore::FrameView::setWasScrolledByUser):
* page/FrameView.h:
* platform/ScrollView.h:
(WebCore::ScrollView::inProgrammaticScroll const): Deleted.
* platform/ScrollableArea.cpp:
(WebCore::ScrollableArea::ScrollableArea):
* platform/ScrollableArea.h:
(WebCore::ScrollableArea::inProgrammaticScroll const):
(WebCore::ScrollableArea::setInProgrammaticScroll):
(WebCore::ScrollableArea::scrollShouldClearLatchedState const):
(WebCore::ScrollableArea::setScrollShouldClearLatchedState):
(WebCore::ScrollableArea::isScrolledProgrammatically const): Deleted.
(WebCore::ScrollableArea::setScrolledProgrammatically): Deleted.

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

4 months agoUnreviewed, rolling out r243898.
commit-queue@webkit.org [Thu, 4 Apr 2019 20:54:02 +0000 (20:54 +0000)]
Unreviewed, rolling out r243898.
https://bugs.webkit.org/show_bug.cgi?id=196624

`#if !ENABLE(C_LOOP) && NUMBER_OF_CALLEE_SAVES_REGISTERS > 0`
does not work well (Requested by yusukesuzuki on #webkit).

Reverted changeset:

"Unreviewed, build fix for CLoop and Windows after r243886"
https://bugs.webkit.org/show_bug.cgi?id=196387
https://trac.webkit.org/changeset/243898

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

4 months agoLeak of UniqueIDBDatabase in network process running layout tests
sihui_liu@apple.com [Thu, 4 Apr 2019 20:53:22 +0000 (20:53 +0000)]
Leak of UniqueIDBDatabase in network process running layout tests
https://bugs.webkit.org/show_bug.cgi?id=196565
<rdar://problem/49346139>

Reviewed by Geoffrey Garen.

UniqueIDBDatabase will null itself after it receives confirmation about connecton close from its clients, but it
is possible that the web process to network process connection closes before servers gets the
confirmDidCloseFromServer. Therefore, we should let UniqueIDBDatabase forget connection when it receives a
conenctionClosedFromClient.

No new test because this bug is caused by race between network receiving conenctionClosedFromClient and
receiving confirmDidCloseFromServer. This is testable by running some existing layout tests in a row with leak
option.

* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::connectionClosedFromClient):
(WebCore::IDBServer::UniqueIDBDatabase::confirmDidCloseFromServer):

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

4 months agoUnreviewed, fix -Wreturn-type warning
mcatanzaro@igalia.com [Thu, 4 Apr 2019 20:51:45 +0000 (20:51 +0000)]
Unreviewed, fix -Wreturn-type warning

* Shared/WebsiteData/WebsiteData.cpp:
(WebKit::WebsiteData::ownerProcess):

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

4 months agoUnreviewed, fix iOS build with recent SDKs.
cdumez@apple.com [Thu, 4 Apr 2019 20:47:45 +0000 (20:47 +0000)]
Unreviewed, fix iOS build with recent SDKs.

* platform/gamepad/cocoa/GameControllerGamepad.mm:
(WebCore::GameControllerGamepad::GameControllerGamepad):

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

4 months ago[macOS] Fix sandbox violations
pvollan@apple.com [Thu, 4 Apr 2019 20:44:50 +0000 (20:44 +0000)]
[macOS] Fix sandbox violations
https://bugs.webkit.org/show_bug.cgi?id=196616
<rdar://problem/49498040>

Reviewed by Brent Fulgham.

Fix some observed sandbox violations in the WebContent process on macOS.

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

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

4 months ago[MediaStream] Host should be able to mute screen capture and camera/microphone indepe...
eric.carlson@apple.com [Thu, 4 Apr 2019 20:44:29 +0000 (20:44 +0000)]
[MediaStream] Host should be able to mute screen capture and camera/microphone independently
https://bugs.webkit.org/show_bug.cgi?id=196555
<rdar://problem/47303865>

Reviewed by Youenn Fablet.

Source/WebCore:

Test: fast/mediastream/media-stream-page-muted.html

* Modules/mediastream/MediaStream.cpp:
(WebCore::MediaStream::MediaStream): Call setCaptureTracksMuted to pass page muted
state to tracks.
(WebCore::MediaStream::startProducingData): Ditto.
(WebCore::MediaStream::setCaptureTracksMuted): New.
* Modules/mediastream/MediaStream.h:

* Modules/mediastream/MediaStreamTrack.cpp:
(WebCore::MediaStreamTrack::MediaStreamTrack): Call setMuted with page muted state.
(WebCore::MediaStreamTrack::setMuted): Set muted according to page state and source type.
(WebCore::MediaStreamTrack::pageMutedStateDidChange): Call setMuted.
(WebCore::MediaStreamTrack::mediaState const): Update for new page state.
* Modules/mediastream/MediaStreamTrack.h:

* page/MediaProducer.h: Split capture muted state into two: camera/microphone and screen.

* page/Page.h:
(WebCore::Page::isMediaCaptureMuted const): Update for state changes.

* platform/mediastream/MediaStreamPrivate.cpp:
(WebCore::MediaStreamPrivate::setCaptureTracksMuted): Deleted.
(WebCore::MediaStreamPrivate::hasCaptureVideoSource const): Deleted.
* platform/mediastream/MediaStreamPrivate.h:

* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::setMuted): Log state.
(WebCore::RealtimeMediaSource::notifyMutedChange): Call notifyMutedObservers on the
next runloop so events aren't dispatched synchronously.

* testing/Internals.cpp:
(WebCore::Internals::setPageMuted): Add new state.

Source/WebKit:

* UIProcess/API/C/WKPagePrivate.h: Add kWKMediaScreenCaptureMuted.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _setPageMuted:]):
(-[WKWebView _setMediaCaptureMuted:]): Deleted, it was unused.
(-[WKWebView _muteMediaCapture]): Deleted, it was unused.
* UIProcess/API/Cocoa/WKWebViewPrivate.h:

* UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
(WebKit::UserMediaPermissionRequestManagerProxy::processUserMediaPermissionValidRequest): Fix
a log comment typo.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::setMediaStreamCaptureMuted): Use the new flag.
(WebKit::WebPageProxy::activateMediaStreamCaptureInPage): Ditto.
(WebKit::WebPageProxy::setMuted): Ditto.
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::isMediaStreamCaptureMuted const): Ditto.

LayoutTests:

* fast/mediastream/media-stream-page-muted-expected.txt: Added.
* fast/mediastream/media-stream-page-muted.html: Added.
* fast/mediastream/media-stream-track-interrupted.html: Read page muted state before
interrupting capture track because the page state now changes immediately.
* fast/mediastream/media-stream-track-muted.html: Ditto, for muting.

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

4 months agoUnreviewed, build fix for CLoop and Windows after r243886
ysuzuki@apple.com [Thu, 4 Apr 2019 20:41:57 +0000 (20:41 +0000)]
Unreviewed, build fix for CLoop and Windows after r243886
https://bugs.webkit.org/show_bug.cgi?id=196387

RegisterAtOffsetList does not exist if ENABLE(ASSEMBLER) is false.

* interpreter/StackVisitor.cpp:
(JSC::StackVisitor::Frame::calleeSaveRegistersForUnwinding):
* interpreter/StackVisitor.h:

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

4 months ago[ews-app] Status bubble should not display skipped buildbot steps
aakash_jain@apple.com [Thu, 4 Apr 2019 20:38:50 +0000 (20:38 +0000)]
[ews-app] Status bubble should not display skipped buildbot steps
https://bugs.webkit.org/show_bug.cgi?id=196584

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-app/ews/views/statusbubble.py:

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

4 months ago[ews-app] configure localhost as BUILDBOT_SERVER_HOST in testing mode
aakash_jain@apple.com [Thu, 4 Apr 2019 20:34:11 +0000 (20:34 +0000)]
[ews-app] configure localhost as BUILDBOT_SERVER_HOST in testing mode
https://bugs.webkit.org/show_bug.cgi?id=196620

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-app/ews/config.py:

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

4 months agoUnreviewed, update r243884 to use macros in Compiler.h instead.
cdumez@apple.com [Thu, 4 Apr 2019 20:34:08 +0000 (20:34 +0000)]
Unreviewed, update r243884 to use macros in Compiler.h instead.

* platform/ios/LegacyTileGrid.mm:
(WebCore::LegacyTileGrid::dropDistantTiles):

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

4 months agoAX: Crash under WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored()
cfleizach@apple.com [Thu, 4 Apr 2019 20:31:34 +0000 (20:31 +0000)]
AX: Crash under WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored()
https://bugs.webkit.org/show_bug.cgi?id=196600
<rdar://problem/49572996>

Reviewed by Joanmarie Diggs.

Audit AX code to not dereference renderer before checking if it's null.
Not clear how to reproduce at this time.

* accessibility/AccessibilityRenderObject.cpp:
(WebCore::webAreaIsPresentational):
(WebCore::AccessibilityRenderObject::layoutCount const):
(WebCore::AccessibilityRenderObject::widget const):

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

4 months agoCompute accurate regions for touch-action
antti@apple.com [Thu, 4 Apr 2019 20:28:46 +0000 (20:28 +0000)]
Compute accurate regions for touch-action
https://bugs.webkit.org/show_bug.cgi?id=196536
<rdar://problem/49516022>

Reviewed by Simon Fraser.

Source/WebCore:

Tests: pointerevents/ios/touch-action-region-basic.html
       pointerevents/ios/touch-action-region-layers.html
       pointerevents/ios/touch-action-region-pan-x-y.html

- Use style system to compute effective touch-action without additional tree walks.
- Compute touch-action region in a fake paint, at the same time with the event region.

This patch doesn't yet use the computed region for anything except test output.

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* css/StyleResolver.cpp:
(WebCore::computeEffectiveTouchActions):
(WebCore::StyleResolver::adjustRenderStyle):

Update RenderStyle::effectiveTouchAction.

* dom/Element.cpp:
(WebCore::Element::computedTouchActions const):

Just get it from the style.

* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::setEventRegion):
(WebCore::GraphicsLayer::setTouchActionRegion):
(WebCore::GraphicsLayer::dumpProperties const):
* platform/graphics/GraphicsLayer.h:
(WebCore::GraphicsLayer::touchActionRegion const):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::setTouchActionRegion):
* platform/graphics/ca/GraphicsLayerCA.h:
* rendering/PaintInfo.h:
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::paintObject):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::collectEventRegionForFragments):
* rendering/RenderLayer.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateConfiguration):

Need to do this for the top compositing layer too.

(WebCore::RenderLayerBacking::updateEventRegion):

Compute touch-action region too.
As a basic optimization avoid doing any extra work if there are no elements with non-default touch-action property.

* rendering/TouchActionRegion.cpp: Added.
(WebCore::toIndex):
(WebCore::toTouchAction):
(WebCore::toString):
(WebCore::TouchActionRegion::unite):
(WebCore::TouchActionRegion::actionsForPoint const):
(WebCore::TouchActionRegion::translate):
(WebCore::operator<<):
* rendering/TouchActionRegion.h: Added.

Class for collecting and maintaining touch-action region.

(WebCore::TouchActionRegion::isEmpty const):
(WebCore::TouchActionRegion::operator== const):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::effectiveTouchActions const):
(WebCore::RenderStyle::setEffectiveTouchActions):

Implement as inherited property for efficiency (touch-action itself is non-inherited).

* rendering/style/StyleRareInheritedData.cpp:
(WebCore::StyleRareInheritedData::StyleRareInheritedData):
(WebCore::StyleRareInheritedData::operator== const):
* rendering/style/StyleRareInheritedData.h:

LayoutTests:

* pointerevents/ios/touch-action-region-basic-expected.txt: Added.
* pointerevents/ios/touch-action-region-basic.html: Added.
* pointerevents/ios/touch-action-region-layers-expected.txt: Added.
* pointerevents/ios/touch-action-region-layers.html: Added.
* pointerevents/ios/touch-action-region-pan-x-y-expected.txt: Added.
* pointerevents/ios/touch-action-region-pan-x-y.html: Added.

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

4 months agoUnreviewed, fix linking error because the build of RTCIceTransport.cpp is handled...
ysuzuki@apple.com [Thu, 4 Apr 2019 20:08:37 +0000 (20:08 +0000)]
Unreviewed, fix linking error because the build of RTCIceTransport.cpp is handled in Xcode project side accidentally
https://bugs.webkit.org/show_bug.cgi?id=196475

We did not have RTCIceTransport.cpp in Sources.txt.

* WebCore.xcodeproj/project.pbxproj:

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

4 months agoVersioning.
alancoon@apple.com [Thu, 4 Apr 2019 20:08:02 +0000 (20:08 +0000)]
Versioning.

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

4 months ago[macOS][iOS] Add filter to syscall sandbox rule
pvollan@apple.com [Thu, 4 Apr 2019 19:13:38 +0000 (19:13 +0000)]
[macOS][iOS] Add filter to syscall sandbox rule
https://bugs.webkit.org/show_bug.cgi?id=196613
<rdar://problem/49531420>

Reviewed by Brent Fulgham.

This will restrict the existing sandbox rule for the syscall.

* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
* WebProcess/com.apple.WebProcess.sb.in:

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

4 months ago[WebCore] Put most of derived classes of ScriptWrappable into IsoHeap
ysuzuki@apple.com [Thu, 4 Apr 2019 19:07:53 +0000 (19:07 +0000)]
[WebCore] Put most of derived classes of ScriptWrappable into IsoHeap
https://bugs.webkit.org/show_bug.cgi?id=196475

Reviewed by Saam Barati.

Source/bmalloc:

Add MAKE_BISO_MALLOCED_IMPL_TEMPLATE, which can be used for explicit specialization for template classes.

* bmalloc/IsoHeap.h:
* bmalloc/IsoHeapInlines.h:

Source/WebCore:

This patch puts most of derived classes of ScriptWrappable into IsoHeap. We do not include derived classes of Event simply
because Internal repository code also inherits it. After watching the result of this patch, we will try Event and its derived
classes into IsoHeap too.

This patch makes the following things IsoHeap-allocated. These classes are listed by using lldb python script.

    1. DOM collections (HTMLCollection etc.)
    2. WebAudio nodes
    3. IDB classes
    4. FileSystem API classes
    5. Canvas contexts
    6. WebRTC classses
    7. XMLHttpRequest related classes
    8. WebSocket related classes
    9. Worker and Worklet related classes
    10. Other misc classes

* Modules/applepay/ApplePaySession.cpp:
* Modules/applepay/ApplePaySession.h:
* Modules/encryptedmedia/MediaKeySession.cpp:
* Modules/encryptedmedia/MediaKeySession.h:
* Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
* Modules/encryptedmedia/legacy/WebKitMediaKeySession.h:
* Modules/entriesapi/DOMFileSystem.cpp:
* Modules/entriesapi/DOMFileSystem.h:
(WebCore::DOMFileSystem::createEntryForFile): Deleted.
(WebCore::DOMFileSystem::name const): Deleted.
* Modules/entriesapi/FileSystemDirectoryEntry.h:
* Modules/entriesapi/FileSystemDirectoryReader.cpp:
* Modules/entriesapi/FileSystemDirectoryReader.h:
* Modules/entriesapi/FileSystemEntry.cpp:
* Modules/entriesapi/FileSystemEntry.h:
* Modules/entriesapi/FileSystemFileEntry.h:
* Modules/geolocation/Geolocation.cpp:
* Modules/geolocation/Geolocation.h:
(WebCore::Geolocation::document const): Deleted.
(WebCore::Geolocation::frame const): Deleted.
(WebCore::Geolocation::resetIsAllowed): Deleted.
(WebCore::Geolocation::isAllowed const): Deleted.
(WebCore::Geolocation::isDenied const): Deleted.
(WebCore::Geolocation::hasListeners const): Deleted.
* Modules/indexeddb/IDBCursor.cpp:
* Modules/indexeddb/IDBCursor.h:
* Modules/indexeddb/IDBCursorWithValue.cpp:
* Modules/indexeddb/IDBCursorWithValue.h:
* Modules/indexeddb/IDBDatabase.cpp:
* Modules/indexeddb/IDBDatabase.h:
(WebCore::IDBDatabase::info const): Deleted.
(WebCore::IDBDatabase::databaseConnectionIdentifier const): Deleted.
(WebCore::IDBDatabase::connectionProxy): Deleted.
(WebCore::IDBDatabase::isClosingOrClosed const): Deleted.
* Modules/indexeddb/IDBKeyRange.cpp:
* Modules/indexeddb/IDBKeyRange.h:
(WebCore::IDBKeyRange::lower const): Deleted.
(WebCore::IDBKeyRange::upper const): Deleted.
(WebCore::IDBKeyRange::lowerOpen const): Deleted.
(WebCore::IDBKeyRange::upperOpen const): Deleted.
* Modules/indexeddb/IDBOpenDBRequest.cpp:
* Modules/indexeddb/IDBOpenDBRequest.h:
* Modules/indexeddb/IDBRequest.cpp:
* Modules/indexeddb/IDBRequest.h:
* Modules/indexeddb/IDBTransaction.cpp:
* Modules/indexeddb/IDBTransaction.h:
(WebCore::IDBTransaction::mode const): Deleted.
(WebCore::IDBTransaction::info const): Deleted.
(WebCore::IDBTransaction::database): Deleted.
(WebCore::IDBTransaction::database const): Deleted.
(WebCore::IDBTransaction::originalDatabaseInfo const): Deleted.
(WebCore::IDBTransaction::isVersionChange const): Deleted.
(WebCore::IDBTransaction::isReadOnly const): Deleted.
(WebCore::IDBTransaction::isFinished const): Deleted.
* Modules/mediarecorder/MediaRecorder.cpp:
* Modules/mediarecorder/MediaRecorder.h:
* Modules/mediasession/MediaRemoteControls.cpp:
* Modules/mediasession/MediaRemoteControls.h:
(WebCore::MediaRemoteControls::create): Deleted.
(WebCore::MediaRemoteControls::previousTrackEnabled const): Deleted.
(WebCore::MediaRemoteControls::nextTrackEnabled const): Deleted.
* Modules/mediasource/MediaSource.cpp:
* Modules/mediasource/MediaSource.h:
* Modules/mediasource/SourceBuffer.cpp:
* Modules/mediasource/SourceBuffer.h:
* Modules/mediasource/SourceBufferList.cpp:
* Modules/mediasource/SourceBufferList.h:
* Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
* Modules/mediastream/CanvasCaptureMediaStreamTrack.h:
* Modules/mediastream/MediaDeviceInfo.cpp:
* Modules/mediastream/MediaDeviceInfo.h:
(WebCore::MediaDeviceInfo::label const): Deleted.
(WebCore::MediaDeviceInfo::deviceId const): Deleted.
(WebCore::MediaDeviceInfo::groupId const): Deleted.
(WebCore::MediaDeviceInfo::kind const): Deleted.
* Modules/mediastream/MediaDevices.cpp:
* Modules/mediastream/MediaDevices.h:
* Modules/mediastream/MediaStream.cpp:
* Modules/mediastream/MediaStream.h:
* Modules/mediastream/MediaStreamTrack.cpp:
* Modules/mediastream/MediaStreamTrack.h:
* Modules/mediastream/RTCDTMFSender.cpp:
* Modules/mediastream/RTCDTMFSender.h:
* Modules/mediastream/RTCDataChannel.cpp:
* Modules/mediastream/RTCDataChannel.h:
* Modules/mediastream/RTCIceCandidate.cpp:
* Modules/mediastream/RTCIceCandidate.h:
(WebCore::RTCIceCandidate::candidate const): Deleted.
(WebCore::RTCIceCandidate::sdpMid const): Deleted.
(WebCore::RTCIceCandidate::sdpMLineIndex const): Deleted.
(WebCore::RTCIceCandidate::setCandidate): Deleted.
* Modules/mediastream/RTCIceTransport.cpp:
* Modules/mediastream/RTCIceTransport.h:
(WebCore::RTCIceTransport::create): Deleted.
(WebCore::RTCIceTransport::state const): Deleted.
(WebCore::RTCIceTransport::setState): Deleted.
(WebCore::RTCIceTransport::gatheringState const): Deleted.
(WebCore::RTCIceTransport::setGatheringState): Deleted.
(WebCore::RTCIceTransport::RTCIceTransport): Deleted.
* Modules/mediastream/RTCPeerConnection.cpp:
* Modules/mediastream/RTCPeerConnection.h:
* Modules/mediastream/RTCRtpReceiver.cpp:
* Modules/mediastream/RTCRtpReceiver.h:
(WebCore::RTCRtpReceiver::create): Deleted.
(WebCore::RTCRtpReceiver::setBackend): Deleted.
(WebCore::RTCRtpReceiver::getParameters): Deleted.
(WebCore::RTCRtpReceiver::getContributingSources const): Deleted.
(WebCore::RTCRtpReceiver::getSynchronizationSources const): Deleted.
(WebCore::RTCRtpReceiver::track): Deleted.
(WebCore::RTCRtpReceiver::backend): Deleted.
* Modules/mediastream/RTCRtpSender.cpp:
* Modules/mediastream/RTCRtpSender.h:
(WebCore::RTCRtpSender::track): Deleted.
(WebCore::RTCRtpSender::trackId const): Deleted.
(WebCore::RTCRtpSender::trackKind const): Deleted.
(WebCore::RTCRtpSender::mediaStreamIds const): Deleted.
(WebCore::RTCRtpSender::setMediaStreamIds): Deleted.
(WebCore::RTCRtpSender::isStopped const): Deleted.
(WebCore::RTCRtpSender::backend): Deleted.
* Modules/mediastream/RTCRtpTransceiver.cpp:
* Modules/mediastream/RTCRtpTransceiver.h:
(WebCore::RTCRtpTransceiver::create): Deleted.
(WebCore::RTCRtpTransceiver::sender): Deleted.
(WebCore::RTCRtpTransceiver::receiver): Deleted.
(WebCore::RTCRtpTransceiver::iceTransport): Deleted.
(WebCore::RTCRtpTransceiver::backend): Deleted.
* Modules/mediastream/RTCSessionDescription.cpp:
* Modules/mediastream/RTCSessionDescription.h:
(WebCore::RTCSessionDescription::type const): Deleted.
(WebCore::RTCSessionDescription::sdp const): Deleted.
(WebCore::RTCSessionDescription::setSdp): Deleted.
* Modules/notifications/Notification.cpp:
* Modules/notifications/Notification.h:
* Modules/paymentrequest/PaymentRequest.cpp:
* Modules/paymentrequest/PaymentRequest.h:
* Modules/paymentrequest/PaymentResponse.cpp:
* Modules/paymentrequest/PaymentResponse.h:
* Modules/speech/SpeechSynthesisUtterance.cpp:
* Modules/speech/SpeechSynthesisUtterance.h:
* Modules/webaudio/AnalyserNode.cpp:
* Modules/webaudio/AnalyserNode.h:
* Modules/webaudio/AudioBasicInspectorNode.cpp:
* Modules/webaudio/AudioBasicInspectorNode.h:
* Modules/webaudio/AudioBasicProcessorNode.cpp:
* Modules/webaudio/AudioBasicProcessorNode.h:
* Modules/webaudio/AudioBufferSourceNode.cpp:
* Modules/webaudio/AudioBufferSourceNode.h:
* Modules/webaudio/AudioContext.cpp:
* Modules/webaudio/AudioContext.h:
* Modules/webaudio/AudioDestinationNode.cpp:
* Modules/webaudio/AudioDestinationNode.h:
* Modules/webaudio/AudioNode.cpp:
* Modules/webaudio/AudioNode.h:
* Modules/webaudio/AudioScheduledSourceNode.cpp:
* Modules/webaudio/AudioScheduledSourceNode.h:
* Modules/webaudio/BiquadFilterNode.cpp:
* Modules/webaudio/BiquadFilterNode.h:
* Modules/webaudio/ChannelMergerNode.cpp:
* Modules/webaudio/ChannelMergerNode.h:
* Modules/webaudio/ChannelSplitterNode.cpp:
* Modules/webaudio/ChannelSplitterNode.h:
* Modules/webaudio/ConvolverNode.cpp:
* Modules/webaudio/ConvolverNode.h:
* Modules/webaudio/DefaultAudioDestinationNode.cpp:
* Modules/webaudio/DefaultAudioDestinationNode.h:
* Modules/webaudio/DelayNode.cpp:
* Modules/webaudio/DelayNode.h:
* Modules/webaudio/DynamicsCompressorNode.cpp:
* Modules/webaudio/DynamicsCompressorNode.h:
* Modules/webaudio/GainNode.cpp:
* Modules/webaudio/GainNode.h:
* Modules/webaudio/MediaElementAudioSourceNode.cpp:
* Modules/webaudio/MediaElementAudioSourceNode.h:
* Modules/webaudio/MediaStreamAudioDestinationNode.cpp:
* Modules/webaudio/MediaStreamAudioDestinationNode.h:
* Modules/webaudio/MediaStreamAudioSourceNode.cpp:
* Modules/webaudio/MediaStreamAudioSourceNode.h:
* Modules/webaudio/OfflineAudioContext.cpp:
* Modules/webaudio/OfflineAudioContext.h:
* Modules/webaudio/OfflineAudioDestinationNode.cpp:
* Modules/webaudio/OfflineAudioDestinationNode.h:
* Modules/webaudio/OscillatorNode.cpp:
* Modules/webaudio/OscillatorNode.h:
* Modules/webaudio/PannerNode.cpp:
* Modules/webaudio/PannerNode.h:
* Modules/webaudio/ScriptProcessorNode.cpp:
* Modules/webaudio/ScriptProcessorNode.h:
* Modules/webaudio/WaveShaperNode.cpp:
* Modules/webaudio/WaveShaperNode.h:
* Modules/webgpu/GPUCanvasContext.cpp:
* Modules/webgpu/GPUCanvasContext.h:
* Modules/websockets/WebSocket.cpp:
* Modules/websockets/WebSocket.h:
* Modules/webvr/VRDisplay.cpp:
* Modules/webvr/VRDisplay.h:
(WebCore::VRDisplay::isPresenting const): Deleted.
(WebCore::VRDisplay::displayName const): Deleted.
(WebCore::VRDisplay::displayId const): Deleted.
(WebCore::VRDisplay::depthNear const): Deleted.
(WebCore::VRDisplay::setDepthNear): Deleted.
(WebCore::VRDisplay::depthFar const): Deleted.
(WebCore::VRDisplay::setDepthFar): Deleted.
(WebCore::VRDisplay::document): Deleted.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* animation/CSSAnimation.cpp:
* animation/CSSAnimation.h:
* animation/CSSTransition.cpp:
* animation/CSSTransition.h:
* animation/DeclarativeAnimation.cpp:
* animation/DeclarativeAnimation.h:
* animation/WebAnimation.cpp:
* animation/WebAnimation.h:
* bindings/js/ScriptWrappable.h:
* css/CSSComputedStyleDeclaration.cpp:
* css/CSSComputedStyleDeclaration.h:
* css/CSSStyleDeclaration.cpp:
(): Deleted.
* css/CSSStyleDeclaration.h:
* css/DOMMatrix.h:
* css/DOMMatrixReadOnly.cpp:
* css/DOMMatrixReadOnly.h:
* css/FontFaceSet.cpp:
* css/FontFaceSet.h:
* css/PropertySetCSSStyleDeclaration.cpp:
* css/PropertySetCSSStyleDeclaration.h:
* css/WebKitCSSMatrix.cpp:
* css/WebKitCSSMatrix.h:
* css/typedom/TypedOMCSSImageValue.cpp: Added.
* css/typedom/TypedOMCSSImageValue.h:
* css/typedom/TypedOMCSSNumericValue.cpp: Added.
* css/typedom/TypedOMCSSNumericValue.h:
* css/typedom/TypedOMCSSStyleValue.cpp: Added.
* css/typedom/TypedOMCSSStyleValue.h:
* css/typedom/TypedOMCSSUnitValue.cpp: Added.
* css/typedom/TypedOMCSSUnitValue.h:
* css/typedom/TypedOMCSSUnparsedValue.cpp: Added.
* css/typedom/TypedOMCSSUnparsedValue.h:
* dom/AbortController.cpp:
* dom/AbortController.h:
* dom/AbortSignal.cpp:
* dom/AbortSignal.h:
* dom/AllDescendantsCollection.cpp: Copied from Source/WebCore/xml/XMLHttpRequestEventTarget.h.
* dom/AllDescendantsCollection.h:
* dom/ChildNodeList.cpp:
* dom/ChildNodeList.h:
* dom/ClassCollection.cpp:
* dom/ClassCollection.h:
* dom/DOMImplementation.cpp:
* dom/DOMImplementation.h:
(WebCore::DOMImplementation::ref): Deleted.
(WebCore::DOMImplementation::deref): Deleted.
(WebCore::DOMImplementation::document): Deleted.
(WebCore::DOMImplementation::hasFeature): Deleted.
* dom/DOMPoint.h:
* dom/DOMPointReadOnly.cpp:
* dom/DOMPointReadOnly.h:
* dom/DOMQuad.cpp:
* dom/DOMQuad.h:
* dom/DOMRect.h:
* dom/DOMRectReadOnly.cpp: Copied from Source/WebCore/dom/DOMPointReadOnly.cpp.
* dom/DOMRectReadOnly.h:
* dom/DataTransferItemList.cpp:
* dom/DataTransferItemList.h:
(WebCore::DataTransferItemList::ref): Deleted.
(WebCore::DataTransferItemList::deref): Deleted.
(WebCore::DataTransferItemList::dataTransfer): Deleted.
(WebCore::DataTransferItemList::hasItems const): Deleted.
(WebCore::DataTransferItemList::items const): Deleted.
* dom/DatasetDOMStringMap.cpp:
* dom/DatasetDOMStringMap.h:
* dom/DocumentParser.h:
* dom/EventTarget.cpp:
* dom/EventTarget.h:
* dom/LiveNodeList.cpp:
* dom/LiveNodeList.h:
* dom/MessageChannel.cpp:
* dom/MessagePort.cpp:
* dom/MessagePort.h:
* dom/NameNodeList.cpp:
* dom/NameNodeList.h:
* dom/NamedNodeMap.cpp:
* dom/NamedNodeMap.h:
(WebCore::NamedNodeMap::NamedNodeMap): Deleted.
(WebCore::NamedNodeMap::element): Deleted.
* dom/NodeIterator.cpp:
* dom/NodeIterator.h:
(WebCore::NodeIterator::detach): Deleted.
(WebCore::NodeIterator::referenceNode const): Deleted.
(WebCore::NodeIterator::pointerBeforeReferenceNode const): Deleted.
* dom/NodeList.cpp: Copied from Source/WebCore/xml/XMLHttpRequestEventTarget.h.
* dom/NodeList.h:
* dom/NodeRareData.cpp:
* dom/ScriptExecutionContext.cpp:
* dom/SimulatedClick.cpp:
* dom/StaticNodeList.cpp:
* dom/StaticNodeList.h:
* dom/TagCollection.cpp:
* dom/TagCollection.h:
* dom/TreeWalker.cpp:
* dom/TreeWalker.h:
(WebCore::TreeWalker::create): Deleted.
(WebCore::TreeWalker::currentNode): Deleted.
(WebCore::TreeWalker::currentNode const): Deleted.
* fileapi/Blob.cpp:
* fileapi/Blob.h:
* fileapi/File.cpp:
* fileapi/File.h:
* fileapi/FileList.cpp:
* fileapi/FileList.h:
(WebCore::FileList::create): Deleted.
(WebCore::FileList::length const): Deleted.
(WebCore::FileList::isEmpty const): Deleted.
(WebCore::FileList::files const): Deleted.
(WebCore::FileList::file const): Deleted.
(WebCore::FileList::FileList): Deleted.
(WebCore::FileList::append): Deleted.
(WebCore::FileList::clear): Deleted.
* fileapi/FileReader.cpp:
* fileapi/FileReader.h:
* html/CachedHTMLCollection.h:
* html/GenericCachedHTMLCollection.cpp:
* html/GenericCachedHTMLCollection.h:
* html/HTMLAllCollection.cpp:
* html/HTMLAllCollection.h:
* html/HTMLCollection.cpp:
* html/HTMLCollection.h:
* html/HTMLFormControlsCollection.cpp:
* html/HTMLFormControlsCollection.h:
* html/HTMLNameCollection.cpp:
* html/HTMLNameCollection.h:
* html/HTMLOptionsCollection.cpp:
* html/HTMLOptionsCollection.h:
* html/HTMLTableRowsCollection.cpp:
* html/HTMLTableRowsCollection.h:
* html/ImageBitmap.cpp:
* html/ImageBitmap.h:
(WebCore::ImageBitmap::isDetached const): Deleted.
(WebCore::ImageBitmap::buffer): Deleted.
(WebCore::ImageBitmap::originClean const): Deleted.
* html/LabelsNodeList.cpp:
* html/LabelsNodeList.h:
* html/MediaController.cpp:
* html/MediaController.h:
* html/OffscreenCanvas.cpp:
* html/OffscreenCanvas.h:
* html/RadioNodeList.cpp:
* html/RadioNodeList.h:
* html/canvas/CanvasRenderingContext.cpp:
* html/canvas/CanvasRenderingContext.h:
* html/canvas/CanvasRenderingContext2D.cpp:
* html/canvas/CanvasRenderingContext2D.h:
* html/canvas/CanvasRenderingContext2DBase.cpp:
* html/canvas/CanvasRenderingContext2DBase.h:
* html/canvas/GPUBasedCanvasRenderingContext.h:
* html/canvas/ImageBitmapRenderingContext.cpp:
* html/canvas/ImageBitmapRenderingContext.h:
* html/canvas/OffscreenCanvasRenderingContext2D.cpp:
* html/canvas/OffscreenCanvasRenderingContext2D.h:
* html/canvas/PaintRenderingContext2D.cpp:
* html/canvas/PaintRenderingContext2D.h:
* html/canvas/PlaceholderRenderingContext.cpp:
* html/canvas/PlaceholderRenderingContext.h:
* html/canvas/WebGL2RenderingContext.cpp:
* html/canvas/WebGL2RenderingContext.h:
* html/canvas/WebGLRenderingContext.cpp:
* html/canvas/WebGLRenderingContext.h:
* html/canvas/WebGLRenderingContextBase.cpp:
* html/canvas/WebGLRenderingContextBase.h:
* html/track/AudioTrackList.h:
* html/track/DataCue.cpp:
* html/track/DataCue.h:
* html/track/InbandDataTextTrack.cpp:
* html/track/InbandDataTextTrack.h:
* html/track/InbandGenericTextTrack.cpp:
* html/track/InbandGenericTextTrack.h:
* html/track/InbandTextTrack.cpp:
* html/track/InbandTextTrack.h:
* html/track/InbandWebVTTTextTrack.cpp:
* html/track/InbandWebVTTTextTrack.h:
* html/track/LoadableTextTrack.cpp:
* html/track/LoadableTextTrack.h:
* html/track/TextTrack.cpp:
* html/track/TextTrack.h:
* html/track/TextTrackCue.cpp:
* html/track/TextTrackCue.h:
* html/track/TextTrackCueGeneric.cpp:
* html/track/TextTrackCueGeneric.h:
* html/track/TextTrackList.cpp:
* html/track/TextTrackList.h:
* html/track/TrackListBase.cpp:
* html/track/TrackListBase.h:
* html/track/VTTCue.cpp:
* html/track/VTTCue.h:
* html/track/VideoTrackList.h:
* loader/appcache/DOMApplicationCache.cpp:
* loader/appcache/DOMApplicationCache.h:
* page/AbstractDOMWindow.cpp:
* page/AbstractDOMWindow.h:
* page/BarProp.cpp:
* page/BarProp.h:
(WebCore::BarProp::create): Deleted.
* page/DOMWindow.cpp:
* page/DOMWindow.h:
* page/EventSource.cpp:
* page/EventSource.h:
* page/History.cpp:
* page/History.h:
* page/Location.cpp:
* page/Location.h:
(WebCore::Location::create): Deleted.
(WebCore::Location::toString const): Deleted.
* page/Navigator.cpp:
* page/Navigator.h:
* page/Performance.cpp:
* page/Performance.h:
* page/RemoteDOMWindow.cpp:
* page/RemoteDOMWindow.h:
* page/Screen.cpp:
* page/Screen.h:
* page/VisualViewport.cpp:
* page/VisualViewport.h:
* plugins/DOMMimeTypeArray.cpp:
* plugins/DOMMimeTypeArray.h:
(WebCore::DOMMimeTypeArray::create): Deleted.
* plugins/DOMPlugin.cpp:
* plugins/DOMPlugin.h:
(WebCore::DOMPlugin::create): Deleted.
* plugins/DOMPluginArray.cpp:
* plugins/DOMPluginArray.h:
(WebCore::DOMPluginArray::create): Deleted.
* storage/Storage.cpp:
* storage/Storage.h:
(WebCore::Storage::area const): Deleted.
* workers/AbstractWorker.cpp:
* workers/AbstractWorker.h:
* workers/DedicatedWorkerGlobalScope.cpp:
* workers/DedicatedWorkerGlobalScope.h:
* workers/Worker.cpp:
* workers/Worker.h:
* workers/WorkerGlobalScope.cpp:
* workers/WorkerGlobalScope.h:
* workers/service/ServiceWorker.cpp:
* workers/service/ServiceWorker.h:
* workers/service/ServiceWorkerContainer.cpp:
* workers/service/ServiceWorkerContainer.h:
* workers/service/ServiceWorkerGlobalScope.cpp:
* workers/service/ServiceWorkerGlobalScope.h:
* workers/service/ServiceWorkerRegistration.cpp:
* workers/service/ServiceWorkerRegistration.h:
* worklets/PaintWorkletGlobalScope.cpp:
* worklets/PaintWorkletGlobalScope.h:
* worklets/Worklet.cpp:
* worklets/Worklet.h:
* worklets/WorkletGlobalScope.cpp:
* worklets/WorkletGlobalScope.h:
* xml/XMLHttpRequest.cpp:
* xml/XMLHttpRequest.h:
* xml/XMLHttpRequestEventTarget.h:
* xml/XMLHttpRequestUpload.cpp:
* xml/XMLHttpRequestUpload.h:
* xml/XPathParser.cpp:

Source/WTF:

* wtf/ForbidHeapAllocation.h:
* wtf/IsoMalloc.h:
* wtf/IsoMallocInlines.h:

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

4 months agoTeach Call ICs how to call Wasm
sbarati@apple.com [Thu, 4 Apr 2019 18:54:16 +0000 (18:54 +0000)]
Teach Call ICs how to call Wasm
https://bugs.webkit.org/show_bug.cgi?id=196387

Reviewed by Filip Pizlo.

JSTests:

* wasm/function-tests/stack-trace.js:

Source/JavaScriptCore:

This patch teaches JS to call Wasm without going through the native thunk.
Currently, we emit a JIT "JS" callee stub which marshals arguments from
JS to Wasm. Like the native version of this, this thunk is responsible
for saving and restoring the VM's current Wasm context. Instead of emitting
an exception handler, we also teach the unwinder how to read the previous
wasm context to restore it as it unwindws past this frame.

This patch is straight forward, and leaves some areas for perf improvement:
- We can teach the DFG/FTL to directly use the Wasm calling convention when
  it knows it's calling a single Wasm function. This way we don't shuffle
  registers to the stack and then back into registers.
- We bail out to the slow path for mismatched arity. I opened a bug to fix
  optimize arity check failures: https://bugs.webkit.org/show_bug.cgi?id=196564
- We bail out to the slow path Double JSValues flowing into i32 arguments.
  We should teach this thunk how to do that conversion directly.

This patch also refactors the code to explicitly have a single pinned size register.
We used pretend in some places that we could have more than one pinned size register.
However, there was other code that just asserted the size was one. This patch just rips
out this code since we never moved to having more than one pinned size register. Doing
this refactoring cleans up the various places where we set up the size register.

This patch is a 50-60% progression on JetStream 2's richards-wasm.

* JavaScriptCore.xcodeproj/project.pbxproj:
* Sources.txt:
* assembler/MacroAssemblerCodeRef.h:
(JSC::MacroAssemblerCodeRef::operator=):
(JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef):
* interpreter/Interpreter.cpp:
(JSC::UnwindFunctor::operator() const):
(JSC::UnwindFunctor::copyCalleeSavesToEntryFrameCalleeSavesBuffer const):
* interpreter/StackVisitor.cpp:
(JSC::StackVisitor::Frame::calleeSaveRegistersForUnwinding):
(JSC::StackVisitor::Frame::calleeSaveRegisters): Deleted.
* interpreter/StackVisitor.h:
* jit/JITOperations.cpp:
* jit/RegisterSet.cpp:
(JSC::RegisterSet::runtimeTagRegisters):
(JSC::RegisterSet::specialRegisters):
(JSC::RegisterSet::runtimeRegisters): Deleted.
* jit/RegisterSet.h:
* jit/Repatch.cpp:
(JSC::linkPolymorphicCall):
* runtime/JSFunction.cpp:
(JSC::getCalculatedDisplayName):
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
(JSC::JSGlobalObject::visitChildren):
* runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::jsToWasmICCalleeStructure const):
* runtime/VM.cpp:
(JSC::VM::VM):
* runtime/VM.h:
* wasm/WasmAirIRGenerator.cpp:
(JSC::Wasm::AirIRGenerator::AirIRGenerator):
(JSC::Wasm::AirIRGenerator::restoreWebAssemblyGlobalState):
(JSC::Wasm::AirIRGenerator::addCallIndirect):
* wasm/WasmB3IRGenerator.cpp:
(JSC::Wasm::B3IRGenerator::B3IRGenerator):
(JSC::Wasm::B3IRGenerator::restoreWebAssemblyGlobalState):
(JSC::Wasm::B3IRGenerator::addCallIndirect):
* wasm/WasmBinding.cpp:
(JSC::Wasm::wasmToWasm):
* wasm/WasmContext.h:
(JSC::Wasm::Context::pointerToInstance):
* wasm/WasmContextInlines.h:
(JSC::Wasm::Context::store):
* wasm/WasmMemoryInformation.cpp:
(JSC::Wasm::getPinnedRegisters):
(JSC::Wasm::PinnedRegisterInfo::get):
(JSC::Wasm::PinnedRegisterInfo::PinnedRegisterInfo):
* wasm/WasmMemoryInformation.h:
(JSC::Wasm::PinnedRegisterInfo::toSave const):
* wasm/WasmOMGPlan.cpp:
(JSC::Wasm::OMGPlan::work):
* wasm/js/JSToWasm.cpp:
(JSC::Wasm::createJSToWasmWrapper):
* wasm/js/JSToWasmICCallee.cpp: Added.
(JSC::JSToWasmICCallee::create):
(JSC::JSToWasmICCallee::createStructure):
(JSC::JSToWasmICCallee::visitChildren):
* wasm/js/JSToWasmICCallee.h: Added.
(JSC::JSToWasmICCallee::function):
(JSC::JSToWasmICCallee::JSToWasmICCallee):
* wasm/js/WebAssemblyFunction.cpp:
(JSC::WebAssemblyFunction::useTagRegisters const):
(JSC::WebAssemblyFunction::calleeSaves const):
(JSC::WebAssemblyFunction::usedCalleeSaveRegisters const):
(JSC::WebAssemblyFunction::previousInstanceOffset const):
(JSC::WebAssemblyFunction::previousInstance):
(JSC::WebAssemblyFunction::jsCallEntrypointSlow):
(JSC::WebAssemblyFunction::visitChildren):
(JSC::WebAssemblyFunction::destroy):
* wasm/js/WebAssemblyFunction.h:
* wasm/js/WebAssemblyFunctionHeapCellType.cpp: Added.
(JSC::WebAssemblyFunctionDestroyFunc::operator() const):
(JSC::WebAssemblyFunctionHeapCellType::WebAssemblyFunctionHeapCellType):
(JSC::WebAssemblyFunctionHeapCellType::~WebAssemblyFunctionHeapCellType):
(JSC::WebAssemblyFunctionHeapCellType::finishSweep):
(JSC::WebAssemblyFunctionHeapCellType::destroy):
* wasm/js/WebAssemblyFunctionHeapCellType.h: Added.
* wasm/js/WebAssemblyPrototype.h:

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

4 months ago[JSC] Pass CodeOrigin to FuzzerAgent
ysuzuki@apple.com [Thu, 4 Apr 2019 18:53:08 +0000 (18:53 +0000)]
[JSC] Pass CodeOrigin to FuzzerAgent
https://bugs.webkit.org/show_bug.cgi?id=196590

Reviewed by Saam Barati.

Pass CodeOrigin instead of bytecodeIndex. CodeOrigin includes richer information (InlineCallFrame*).
We also mask prediction with SpecBytecodeTop in DFGByteCodeParser. The fuzzer can produce any SpeculatedTypes,
but DFGByteCodeParser should only see predictions that can be actually produced from the bytecode execution.

* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::getPredictionWithoutOSRExit):
* runtime/FuzzerAgent.cpp:
(JSC::FuzzerAgent::getPrediction):
* runtime/FuzzerAgent.h:
* runtime/RandomizingFuzzerAgent.cpp:
(JSC::RandomizingFuzzerAgent::getPrediction):
* runtime/RandomizingFuzzerAgent.h:

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

4 months agoUnreviewed, fix iOS build with recent SDKs.
cdumez@apple.com [Thu, 4 Apr 2019 18:45:10 +0000 (18:45 +0000)]
Unreviewed, fix iOS build with recent SDKs.

std::ptr_fun() is deprecated.

* platform/ios/LegacyTileGrid.mm:
(WebCore::LegacyTileGrid::dropDistantTiles):

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

4 months ago[css-grid] Scroll reset position when updating inner html on content
rego@igalia.com [Thu, 4 Apr 2019 17:55:22 +0000 (17:55 +0000)]
[css-grid] Scroll reset position when updating inner html on content
https://bugs.webkit.org/show_bug.cgi?id=191506

Unreviewed gardening.

The problem described in this bug was fixed in r243687 (webkit.org/b/191506).
This test was still marked as Failure but it has been passing since then.

* TestExpectations: Remove fast/css-grid-layout/grid-item-scroll-position.html
as it's passing now.

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

4 months agoscrollingcoordinator/ios/ui-scroll-fixed.html is a flakky failure
sroberts@apple.com [Thu, 4 Apr 2019 17:49:51 +0000 (17:49 +0000)]
scrollingcoordinator/ios/ui-scroll-fixed.html is a flakky failure
https://bugs.webkit.org/show_bug.cgi?id=196612

Unreviewed test gardening.

* platform/ios-simulator-wk2/TestExpectations: Changing expectations for flaky image failure

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

4 months agoService Worker Process does not have the right domain name
youenn@apple.com [Thu, 4 Apr 2019 17:44:16 +0000 (17:44 +0000)]
Service Worker Process does not have the right domain name
https://bugs.webkit.org/show_bug.cgi?id=196585

Reviewed by Chris Dumez.

* Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.mm:
(WebKit::XPCServiceInitializerDelegate::getExtraInitializationData):
Updated extraInitializationData to go from "security-origin" to "registrable-domain".

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

4 months ago[Win] DumpRenderTreeWatchDog.py is not checked into source
pvollan@apple.com [Thu, 4 Apr 2019 17:39:48 +0000 (17:39 +0000)]
[Win] DumpRenderTreeWatchDog.py is not checked into source
https://bugs.webkit.org/show_bug.cgi?id=196567
<rdar://problem/49525901>

Reviewed by Lucas Forschler.

This script is used on Win EWS bots to terminate hanging DRT processes.

* EWSTools/dumprendertreewatchdog.py: Added.

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

4 months ago[macOS WK1] Layout Test webanimations/accelerated-transition-interrupted-on-composite...
commit-queue@webkit.org [Thu, 4 Apr 2019 17:39:32 +0000 (17:39 +0000)]
[macOS WK1] Layout Test webanimations/accelerated-transition-interrupted-on-composited-element.html is a flaky image failure
https://bugs.webkit.org/show_bug.cgi?id=189678
<rdar://problem/44621674>

Patch by Antoine Quint <graouts@apple.com> on 2019-04-04
Reviewed by Dean Jackson.

We make the test sturdier by waiting for two rAFs instead of just one to wait until animations have been updated (one rAF)
and accelerated animations have been committed (two rAFs).

We also use the "transitioncancel" event to determine the transition has been interrupted rather than using a rAF callback.

* webanimations/accelerated-transition-interrupted-on-composited-element.html:

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

4 months agoTemporarily disable delayed WebProcess launch on iOS to address PLT regression
cdumez@apple.com [Thu, 4 Apr 2019 17:36:20 +0000 (17:36 +0000)]
Temporarily disable delayed WebProcess launch on iOS to address PLT regression
https://bugs.webkit.org/show_bug.cgi?id=196604
<rdar://problem/49074131>

Reviewed by Geoffrey Garen.

Temporarily disable delayed WebProcess launch on iOS to address PLT regression. This
is while I figure out how to enable this on iOS without regressed PLT.

* UIProcess/WebProcessPool.h:

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

4 months ago[JSC] We should consider moving UnlinkedFunctionExecutable::m_parentScopeTDZVariables...
ticaiolima@gmail.com [Thu, 4 Apr 2019 17:21:15 +0000 (17:21 +0000)]
[JSC] We should consider moving UnlinkedFunctionExecutable::m_parentScopeTDZVariables to RareData
https://bugs.webkit.org/show_bug.cgi?id=194944

Reviewed by Keith Miller.

JSTests:

* stress/verify-bytecode-generator-cached-variables-under-tdz.js: Added.

Source/JavaScriptCore:

Based on profile data collected on JetStream2, Speedometer 2 and
other benchmarks, it is very rare having non-empty
UnlinkedFunctionExecutable::m_parentScopeTDZVariables.

- Data collected from Speedometer2
    Total number of UnlinkedFunctionExecutable: 39463
    Total number of non-empty parentScopeTDZVars: 428 (~1%)

- Data collected from JetStream2
    Total number of UnlinkedFunctionExecutable: 83715
    Total number of non-empty parentScopeTDZVars: 5285 (~6%)

We also collected numbers on 6 of top 10 Alexia sites.

- Data collected from youtube.com
    Total number of UnlinkedFunctionExecutable: 29599
    Total number of non-empty parentScopeTDZVars: 97 (~0.3%)

- Data collected from twitter.com
    Total number of UnlinkedFunctionExecutable: 23774
    Total number of non-empty parentScopeTDZVars: 172 (~0.7%)

- Data collected from google.com
    Total number of UnlinkedFunctionExecutable: 33209
    Total number of non-empty parentScopeTDZVars: 174 (~0.5%)

- Data collected from amazon.com:
    Total number of UnlinkedFunctionExecutable: 15182
    Total number of non-empty parentScopeTDZVars: 166 (~1%)

- Data collected from facebook.com:
    Total number of UnlinkedFunctionExecutable: 54443
    Total number of non-empty parentScopeTDZVars: 269 (~0.4%)

- Data collected from netflix.com:
    Total number of UnlinkedFunctionExecutable: 39266
    Total number of non-empty parentScopeTDZVars: 97 (~0.2%)

Considering such numbers, this patch is moving `m_parentScopeTDZVariables`
to RareData. This decreases sizeof(UnlinkedFunctionExecutable) by
16 bytes. With this change, now UnlinkedFunctionExecutable constructors
receives an `Optional<VariableEnvironmentMap::Handle>` and only stores
it when `value != WTF::nullopt`. We also changed
UnlinkedFunctionExecutable::parentScopeTDZVariables() and it returns
`VariableEnvironment()` whenever the Executable doesn't have RareData,
or VariableEnvironmentMap::Handle is unitialized. This is required
because RareData is instantiated when any of its field is stored and
we can have an unitialized `Handle` even on cases when parentScopeTDZVariables
is `WTF::nullopt`.

Results on memory usage on JetStrem2 is neutral.

    Mean of memory peak on ToT: 4258633728 bytes (confidence interval: 249720072.95)
    Mean of memory peak on Changes: 4367325184 bytes (confidence interval: 321285583.61)

* builtins/BuiltinExecutables.cpp:
(JSC::BuiltinExecutables::createExecutable):
* bytecode/UnlinkedFunctionExecutable.cpp:
(JSC::UnlinkedFunctionExecutable::UnlinkedFunctionExecutable):
* bytecode/UnlinkedFunctionExecutable.h:
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::getVariablesUnderTDZ):

BytecodeGenerator::getVariablesUnderTDZ now also caches if m_cachedVariablesUnderTDZ
is empty, so we can properly return `WTF::nullopt` without the
reconstruction of a VariableEnvironment to check if it is empty.

* bytecompiler/BytecodeGenerator.h:
(JSC::BytecodeGenerator::makeFunction):
* parser/VariableEnvironment.h:
(JSC::VariableEnvironment::isEmpty const):
* runtime/CachedTypes.cpp:
(JSC::CachedCompactVariableMapHandle::decode const):

It returns an unitialized Handle when there is no
CompactVariableEnvironment. This can happen when RareData is ensured
because of another field.

(JSC::CachedFunctionExecutableRareData::encode):
(JSC::CachedFunctionExecutableRareData::decode const):
(JSC::CachedFunctionExecutable::encode):
(JSC::CachedFunctionExecutable::decode const):
(JSC::UnlinkedFunctionExecutable::UnlinkedFunctionExecutable):
* runtime/CodeCache.cpp:

Instead of creating a dummyVariablesUnderTDZ, we simply pass
WTF::nullopt.

(JSC::CodeCache::getUnlinkedGlobalFunctionExecutable):

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

4 months agoLog the error if VideoProcessing library cannot be dlopen
youenn@apple.com [Thu, 4 Apr 2019 16:52:02 +0000 (16:52 +0000)]
Log the error if VideoProcessing library cannot be dlopen
https://bugs.webkit.org/show_bug.cgi?id=196609

Reviewed by Eric Carlson.

* Source/webrtc/sdk/WebKit/VideoProcessingSoftLink.cpp:
(webrtc::initVideoProcessingVPModuleInitialize):

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

4 months ago[WPE] Unreviewed gardening
dpino@igalia.com [Thu, 4 Apr 2019 16:51:31 +0000 (16:51 +0000)]
[WPE] Unreviewed gardening

Remove tests that are expected to fail but pass.

* platform/wpe/TestExpectations:

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

4 months agoREGRESSION (r236501?): Layout Test compositing/geometry/limit-layer-bounds-opacity...
commit-queue@webkit.org [Thu, 4 Apr 2019 16:38:50 +0000 (16:38 +0000)]
REGRESSION (r236501?): Layout Test compositing/geometry/limit-layer-bounds-opacity-transition.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=190210
<rdar://problem/45045989>

Unreviewed.

The flakiness dashboard shows that this test hasn't been flaky for a few weeks, reverting the flaky expectation.

Patch by Antoine Quint <graouts@apple.com> on 2019-04-04

* platform/mac/TestExpectations:

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

4 months agoUnreviewed, roll out r243858 which made tests time out.
cdumez@apple.com [Thu, 4 Apr 2019 15:44:37 +0000 (15:44 +0000)]
Unreviewed, roll out r243858 which made tests time out.

Disable new API tests on Windows instead.

* TestWebKitAPI/Tests/WebKit/ReloadPageAfterCrash.cpp:
(TestWebKitAPI::TEST):

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

4 months agoCache bytecode for jsc.cpp helpers and fix CachedStringImpl
tzagallo@apple.com [Thu, 4 Apr 2019 15:41:07 +0000 (15:41 +0000)]
Cache bytecode for jsc.cpp helpers and fix CachedStringImpl
https://bugs.webkit.org/show_bug.cgi?id=196409

Reviewed by Saam Barati.

JSTests:

* stress/bytecode-cache-cached-string-impl.js: Added.
(f):
(g):
* stress/bytecode-cache-run-string.js: Added.

Source/JavaScriptCore:

Some of the helpers in jsc.cpp, such as `functionRunString`, were stll using
using `makeSource` instead of `jscSource`, which does not use the ShellSourceProvider
and therefore does not write the bytecode cache to disk.

Changing that revealed a bug in bytecode cache. The Encoder keeps a mapping
of pointers to offsets of already cached objects, in order to avoid caching
the same object twice. Similarly, the Decoder keeps a mapping from offsets
to pointers, in order to avoid creating multiple objects in memory for the
same cached object. The following was happening:
1) A StringImpl* S was cached as CachedPtr<CachedStringImpl> at offset O. We add
an entry in the Encoder mapping that S has already been encoded at O.
2) We cache StringImpl* S again, but now as CachedPtr<CachedUniquedStringImpl>.
We find an entry in the Encoder mapping for S, and return the offset O. However,
the object cached at O is a CachedPtr<CachedStringImpl> (i.e. not Uniqued).

3) When decoding, there are 2 possibilities:
3.1) We find S for the first time through a CachedPtr<CachedStringImpl>. In
this case, everything works as expected since we add an entry in the decoder
mapping from the offset O to the decoded StringImpl* S. The next time we find
S through the uniqued version, we'll return the already decoded S.
3.2) We find S through a CachedPtr<CachedUniquedStringImpl>. Now we have a
problem, since the CachedPtr has the offset of a CachedStringImpl (not uniqued),
which has a different shape and we crash.

We fix this by making CachedStringImpl and CachedUniquedStringImpl share the
same implementation. Since it doesn't matter whether a string is uniqued for
encoding, and we always decode strings as uniqued either way, they can be used
interchangeably.

* jsc.cpp:
(functionRunString):
(functionLoadString):
(functionDollarAgentStart):
(functionCheckModuleSyntax):
(runInteractive):
* runtime/CachedTypes.cpp:
(JSC::CachedUniquedStringImplBase::decode const):
(JSC::CachedFunctionExecutable::rareData const):
(JSC::CachedCodeBlock::rareData const):
(JSC::CachedFunctionExecutable::encode):
(JSC::CachedCodeBlock<CodeBlockType>::encode):
(JSC::CachedUniquedStringImpl::encode): Deleted.
(JSC::CachedUniquedStringImpl::decode const): Deleted.
(JSC::CachedStringImpl::encode): Deleted.
(JSC::CachedStringImpl::decode const): Deleted.

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

4 months ago[Web Animations] JS wrapper may be deleted while animation is yet to dispatch its...
commit-queue@webkit.org [Thu, 4 Apr 2019 14:16:05 +0000 (14:16 +0000)]
[Web Animations] JS wrapper may be deleted while animation is yet to dispatch its finish event
https://bugs.webkit.org/show_bug.cgi?id=196118
<rdar://problem/46614137>

Patch by Antoine Quint <graouts@apple.com> on 2019-04-04
Reviewed by Ryosuke Niwa.

Source/WebCore:

Test: webanimations/js-wrapper-kept-alive.html

We need to teach WebAnimation to keep its JS wrapper alive if it's relevant or could become relevant again by virtue of having a timeline.

* animation/WebAnimation.cpp:
(WebCore::WebAnimation::stop): Drive-by fix for the missing superclass method call.
(WebCore::WebAnimation::hasPendingActivity const):
* animation/WebAnimation.h:

LayoutTests:

Add a test that starts a short animation, sets a custom property on it, registers a "finish" event listener on it and deletes
the sole reference to it in the JS world before triggering garbage collection. Prior to this fix, this test would time out
because the JS wrapper would be garbage-collected prior to the animation completing and thus the event listener would not
be called. To complete successfully, this test checks that it receives the event and its target is the same animation object
that was originally created by checking the custom property is still set.

* legacy-animation-engine/animations/resume-after-page-cache.html:
* webanimations/js-wrapper-kept-alive-expected.txt: Added.
* webanimations/js-wrapper-kept-alive.html: Added.

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

4 months agoUnlinkedCodeBlock constructor from cache should initialize m_didOptimize
tzagallo@apple.com [Thu, 4 Apr 2019 14:15:20 +0000 (14:15 +0000)]
UnlinkedCodeBlock constructor from cache should initialize m_didOptimize
https://bugs.webkit.org/show_bug.cgi?id=196396

Reviewed by Saam Barati.

The UnlinkedCodeBlock constructor in CachedTypes was missing the initialization
for m_didOptimize, which leads to crashes in CodeBlock::thresholdForJIT.

* runtime/CachedTypes.cpp:
(JSC::UnlinkedCodeBlock::UnlinkedCodeBlock):

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

4 months ago[GTK][WPE] Use a timer to request the creation of pending tiles
magomez@igalia.com [Thu, 4 Apr 2019 12:51:43 +0000 (12:51 +0000)]
[GTK][WPE] Use a timer to request the creation of pending tiles
https://bugs.webkit.org/show_bug.cgi?id=196594

Reviewed by Žan Doberšek.

Use a timer to request pending tile creation, as calls to notifyFlushRequired() are discarded
while inside a layer flush.

* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::CoordinatedGraphicsLayer):
(WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly):
(WebCore::CoordinatedGraphicsLayer::updateContentBuffers):
(WebCore::CoordinatedGraphicsLayer::requestPendingTileCreationTimerFired):
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:

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

4 months ago[CoordGraphics] Revalidate need for 'coordinated update completion' in ThreadedCompositor
magomez@igalia.com [Thu, 4 Apr 2019 08:53:36 +0000 (08:53 +0000)]
[CoordGraphics] Revalidate need for 'coordinated update completion' in ThreadedCompositor
https://bugs.webkit.org/show_bug.cgi?id=188839

Reviewed by Žan Doberšek.

Even if a platform layer has changed, don't wait for a main thread callback to finish the
CompositingRunLoop update. It can be finished as soon as we receive the frameComplete signal.

* Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
(WebKit::CompositingRunLoop::scheduleUpdate):
(WebKit::CompositingRunLoop::stopUpdates):
(WebKit::CompositingRunLoop::updateCompleted):
(WebKit::CompositingRunLoop::updateTimerFired):
(WebKit::CompositingRunLoop::compositionCompleted): Deleted.
* Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h:
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
(WebKit::ThreadedCompositor::renderLayerTree):
(WebKit::ThreadedCompositor::sceneUpdateFinished):
(WebKit::ThreadedCompositor::displayRefreshMonitor):
(WebKit::ThreadedCompositor::handleDisplayRefreshMonitorUpdate): Deleted.
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
* WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp:
(WebKit::LayerTreeHost::handleDisplayRefreshMonitorUpdate):

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

4 months ago[ATK] Wrong index passed to AtkObject::children-changed::add signal in AXObjectCache...
carlosgc@webkit.org [Thu, 4 Apr 2019 05:53:30 +0000 (05:53 +0000)]
[ATK] Wrong index passed to AtkObject::children-changed::add signal in AXObjectCache::attachWrapper()
https://bugs.webkit.org/show_bug.cgi?id=196538

Reviewed by Michael Catanzaro.

In most of the cases the parent is not found, probably because the child is not a direct descendant of the
parent returned by parentObjectUnignored(). We need to handle the case of find() returning notFound.

* accessibility/atk/AXObjectCacheAtk.cpp:
(WebCore::AXObjectCache::attachWrapper): Use -1 as the index when find() returns notFound.

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

4 months ago[ATK] Cleanup WebPageAccessibilityObjectAtk
carlosgc@webkit.org [Thu, 4 Apr 2019 05:52:44 +0000 (05:52 +0000)]
[ATK] Cleanup WebPageAccessibilityObjectAtk
https://bugs.webkit.org/show_bug.cgi?id=196537

Reviewed by Michael Catanzaro.

Source/WebKit:

Several changes and cleanups:

 - Add WebKit prefix so that style checker doesn't complain about GObject conventions.
 - Rename the header to remove the Atk prefix to match the cpp file and class name.
 - Use pragma once.
 - Use nullptr instead of 0.
 - Use WEBKIT_DEFINE_TYPE instead of G_DEFINE_TYPE.
 - Return generic AtkObject* from constructor.

* SourcesGTK.txt:
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/atk/WebKitWebPageAccessibilityObject.cpp: Renamed from Source/WebKit/WebProcess/WebPage/atk/WebPageAccessibilityObjectAtk.cpp.
(accessibilityRootObjectWrapper):
(webkitWebPageAccessibilityObjectInitialize):
(webkitWebPageAccessibilityObjectGetIndexInParent):
(webkitWebPageAccessibilityObjectGetNChildren):
(webkitWebPageAccessibilityObjectRefChild):
(webkit_web_page_accessibility_object_class_init):
(webkitWebPageAccessibilityObjectNew):
(webkitWebPageAccessibilityObjectRefresh):
* WebProcess/WebPage/atk/WebKitWebPageAccessibilityObject.h: Added.
* WebProcess/WebPage/atk/WebPageAccessibilityObject.h: Removed.
* WebProcess/WebPage/gtk/WebPageGtk.cpp:
(WebKit::WebPage::platformInitialize):
(WebKit::WebPage::updateAccessibilityTree):

Tools:

Also consider files under atk directories as exceptions for GObject conventions.

* Scripts/webkitpy/style/checkers/cpp.py:
(check_identifier_name_in_declaration):

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

4 months ago[ATK] Set ATK_STATE_TRANSIENT on the atk socket until it's embedded
carlosgc@webkit.org [Thu, 4 Apr 2019 05:51:37 +0000 (05:51 +0000)]
[ATK] Set ATK_STATE_TRANSIENT on the atk socket until it's embedded
https://bugs.webkit.org/show_bug.cgi?id=196535

Reviewed by Michael Catanzaro.

This way the properties are not cached. Right now, if number of children is queried before the socket is
embedded, 0 is returned and cached, so ATs don't see the child even after the socket has been embedded.

* UIProcess/API/gtk/WebKitWebViewBaseAccessible.cpp:
(webkitWebViewBaseAccessibleRefStateSet): Set ATK_STATE_TRANSIENT is the socket is not occupied.
* UIProcess/gtk/WebPageProxyGtk.cpp:
(WebKit::WebPageProxy::bindAccessibilityTree): Unset ATK_STATE_TRANSIENT.

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

4 months ago[ATK] Embed the AtkSocket as soon as we receive the plug ID
carlosgc@webkit.org [Thu, 4 Apr 2019 05:50:22 +0000 (05:50 +0000)]
[ATK] Embed the AtkSocket as soon as we receive the plug ID
https://bugs.webkit.org/show_bug.cgi?id=196534

Reviewed by Michael Catanzaro.

We are currently storing the ID and waiting for the next time get_accessible is called to embed the socket. We
can simply embed the socket when the plug ID is received.

* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseGetAccessible):
* UIProcess/WebPageProxy.h:
* UIProcess/gtk/WebPageProxyGtk.cpp:
(WebKit::WebPageProxy::bindAccessibilityTree):

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

4 months ago[ATK] Don't touch accessibility tree in WebFrameLoaderClient::dispatchDidClearWindowO...
carlosgc@webkit.org [Thu, 4 Apr 2019 05:48:20 +0000 (05:48 +0000)]
[ATK] Don't touch accessibility tree in WebFrameLoaderClient::dispatchDidClearWindowObjectInWorld
https://bugs.webkit.org/show_bug.cgi?id=193914

Reviewed by Michael Catanzaro.

Move it to dispatchDidFinishDocumentLoad, since we know we have the document at that point and we can create the
root accessibility object wrapper.

* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDidFinishDocumentLoad):
(WebKit::WebFrameLoaderClient::dispatchDidClearWindowObjectInWorld):

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

4 months agoUpdate AutoFill field icons to be SVG instead of PNG images.
timothy@apple.com [Thu, 4 Apr 2019 05:47:44 +0000 (05:47 +0000)]
Update AutoFill field icons to be SVG instead of PNG images.
https://bugs.webkit.org/show_bug.cgi?id=196557
rdar://problem/48292514

Reviewed by Tim Horton.

Source/WebCore:

* css/html.css:
(input::-webkit-credentials-auto-fill-button):
(input::-webkit-contacts-auto-fill-button):
(input::-webkit-credit-card-auto-fill-button):

LayoutTests:

* platform/ios/fast/forms/auto-fill-button/input-auto-fill-button-expected.txt:
* platform/mac/fast/forms/auto-fill-button/input-contacts-auto-fill-button-expected.txt:
* platform/win/fast/forms/auto-fill-button/input-auto-fill-button-expected.txt:

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