WebKit-https.git
12 months ago[Datalist] Add button to TextFieldInputs with a datalist
commit-queue@webkit.org [Thu, 26 Jul 2018 23:12:23 +0000 (23:12 +0000)]
[Datalist] Add button to TextFieldInputs with a datalist
https://bugs.webkit.org/show_bug.cgi?id=187741

Patch by Aditya Keerthi <akeerthi@apple.com> on 2018-07-26
Reviewed by Tim Horton.

Source/WebCore:

TextFieldInputs that have an associated datalist element should be drawn as
combo boxes. However, we cannot use NSComboBox for this control, as NSComboBox
is not height-resizable. Furthermore, the input should also be able to contain
additional elements, such as the stepper for type=number and the cancel button
for type=search. For these reasons, we draw a button at the end of the input,
mimicking appearance of a combo box.

The list-button -webkit-appearance value was added to display the new button.

Tests: fast/forms/datalist/datalist-searchinput-appearance.html
       fast/forms/datalist/datalist-textinput-appearance.html

* Resources/ListButtonArrow.png: Added.
* Resources/ListButtonArrow@2x.png: Added.
* WebCore.xcodeproj/project.pbxproj:
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
* css/CSSProperties.json:
* css/CSSValueKeywords.in:
* css/html.css:
(input::-webkit-list-button):
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::dataListButtonElement const):
(WebCore::HTMLInputElement::isShowingList const):
* html/HTMLInputElement.h:
* html/InputType.h:
(WebCore::InputType::dataListButtonElement const):
(WebCore::InputType::isShowingList const):
* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::needsContainer const):
(WebCore::TextFieldInputType::createShadowSubtree):
(WebCore::TextFieldInputType::destroyShadowSubtree):
(WebCore::TextFieldInputType::listAttributeTargetChanged):
(WebCore::TextFieldInputType::dataListButtonElement const):
(WebCore::TextFieldInputType::dataListButtonElementWasClicked):
(WebCore::TextFieldInputType::didCloseSuggestions):
(WebCore::TextFieldInputType::isShowingList const):
* html/TextFieldInputType.h:
* html/shadow/DataListButtonElement.cpp: Added.
(WebCore::DataListButtonElement::create):
(WebCore::DataListButtonElement::DataListButtonElement):
(WebCore::DataListButtonElement::~DataListButtonElement):
(WebCore::DataListButtonElement::defaultEventHandler):
* html/shadow/DataListButtonElement.h: Added.
* platform/ThemeTypes.h:
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::adjustStyle):
(WebCore::RenderTheme::adjustListButtonStyle const):
* rendering/RenderTheme.h:
* rendering/RenderThemeMac.h:
* rendering/RenderThemeMac.mm:
(-[WebListButtonCell drawWithFrame:inView:]):
(WebCore::RenderThemeMac::paintListButtonForInput):
(WebCore::RenderThemeMac::adjustListButtonStyle const):
(WebCore::RenderThemeMac::paintTextField):
(WebCore::RenderThemeMac::paintSearchField):
(WebCore::RenderThemeMac::paintSearchFieldCancelButton):
(WebCore::RenderThemeMac::listButton const):

Source/WebCore/PAL:

* pal/spi/cocoa/NSColorSPI.h: Added NSColorGetUserAccentColor().

Source/WebInspectorUI:

Add keyword completion for 'list-button'.

* UserInterface/External/CodeMirror/css.js:
* UserInterface/Models/CSSKeywordCompletions.js:

LayoutTests:

Added tests to verify appearance of TextFieldInputs with a datalist.

* fast/forms/datalist/datalist-searchinput-appearance.html: Added.
* fast/forms/datalist/datalist-textinput-appearance.html: Added.
* platform/mac/fast/forms/datalist/datalist-searchinput-appearance-expected.png: Added.
* platform/mac/fast/forms/datalist/datalist-searchinput-appearance-expected.txt: Added.
* platform/mac/fast/forms/datalist/datalist-textinput-appearance-expected.png: Added.
* platform/mac/fast/forms/datalist/datalist-textinput-appearance-expected.txt: Added.

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

12 months ago[ews-build] Add build step to run API Tests
aakash_jain@apple.com [Thu, 26 Jul 2018 22:51:39 +0000 (22:51 +0000)]
[ews-build] Add build step to run API Tests
https://bugs.webkit.org/show_bug.cgi?id=188079

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-build/steps.py:
(TestWithFailureCount): Common class for various tests with failure count.
(TestWithFailureCount.start): Configure Buildbot's logobserver.
(TestWithFailureCount.commandComplete): Updates the failure count.
(TestWithFailureCount.evaluateCommand): Set the step status appropriately.
(TestWithFailureCount.getResultSummary): Set the step summary appropriately.
(RunAPITests): Build step to run API tests.
(RunAPITests.countFailures): Count the failures by parsing the output.
* BuildSlaveSupport/ews-build/steps_unittest.py: Added unit-tests.

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

12 months ago[Web Animations] Accelerated animations don't respect a positive delay value
graouts@webkit.org [Thu, 26 Jul 2018 22:16:28 +0000 (22:16 +0000)]
[Web Animations] Accelerated animations don't respect a positive delay value
https://bugs.webkit.org/show_bug.cgi?id=186930
<rdar://problem/41393393>

Reviewed by Dean Jackson.

Source/WebCore:

Test: webanimations/accelerated-animation-with-delay.html

We would mistakenly clear the list of pending accelerated actions in KeyframeEffectReadOnly::applyPendingAcceleratedActions()
even if we failed to proceed because of the target element's renderer not being composited yet. Now, we clear the list after
we've established we can apply them, and if we can't we inform the animation with a call to acceleratedStateDidChange() which
will in turn call into the document timeline so that we may consider these animations on the next tick.

For this to work correctly we must make a change to DocumentTimeline::applyPendingAcceleratedAnimations() which only cleared
its list of pending accelerated animations _after_ iterating through them, which would be problematic since we would now add
animations to this list. That list is now copied and cleared prior to iterating through its members.

We also fix the naming of the m_pendingAcceleratedActions copy in KeyframeEffectReadOnly::applyPendingAcceleratedActions()
to have a more similar name.

* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::applyPendingAcceleratedAnimations):
* animation/KeyframeEffectReadOnly.cpp:
(WebCore::KeyframeEffectReadOnly::applyPendingAcceleratedActions):

LayoutTests:

Creating a new test that runs an accelerated animation on a non-positioned element with a small
positive delay. Prior to this patch, the element would move slightly when the delay elapses but
wouldn't animate towards the target value. With this patch, it animatea correctly. To check
that it does animate, we add a cache over the element except for the first 25px which is the area
within which it might have moved prior to this patch. This way the test only passes if the element
is fully hidden by the cache.

* webanimations/accelerated-animation-with-delay-expected.html: Added.
* webanimations/accelerated-animation-with-delay.html: Added.

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

12 months agoString(View) should have a splitAllowingEmptyEntries function instead of a flag parameter
ross.kirsling@sony.com [Thu, 26 Jul 2018 22:00:03 +0000 (22:00 +0000)]
String(View) should have a splitAllowingEmptyEntries function instead of a flag parameter
https://bugs.webkit.org/show_bug.cgi?id=187963

Reviewed by Alex Christensen.

Source/JavaScriptCore:

* inspector/InspectorBackendDispatcher.cpp:
(Inspector::BackendDispatcher::dispatch):
* jsc.cpp:
(ModuleName::ModuleName):
(resolvePath):
* runtime/IntlObject.cpp:
(JSC::canonicalizeLanguageTag):
(JSC::removeUnicodeLocaleExtension):
Update split/splitAllowingEmptyEntries usage.

Source/WebCore:

* Modules/applepay/cocoa/PaymentContactCocoa.mm:
(WebCore::convert):
* Modules/cache/DOMCache.cpp:
(WebCore::hasResponseVaryStarHeaderValue):
* Modules/cache/DOMCacheEngine.cpp:
(WebCore::DOMCacheEngine::queryCacheMatch):
* Modules/mediastream/PeerConnectionBackend.cpp:
(WebCore::filterICECandidate):
(WebCore::PeerConnectionBackend::filterSDP const):
* Modules/websockets/WebSocketHandshake.cpp:
(WebCore::WebSocketHandshake::checkResponseHeaders):
* accessibility/AccessibilityObject.h:
(WebCore::AccessibilityObject::determineARIADropEffects):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::determineARIADropEffects):
* accessibility/AccessibilityRenderObject.h:
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
* editing/cocoa/DataDetection.mm:
(WebCore::DataDetection::shouldCancelDefaultAction):
* editing/markup.cpp:
(WebCore::fillContainerFromString):
(WebCore::createFragmentFromText):
* html/EmailInputType.cpp:
(WebCore::EmailInputType::typeMismatchFor const):
(WebCore::EmailInputType::sanitizeValue const):
* html/HTMLInputElement.cpp:
(WebCore::parseAcceptAttribute):
* html/ValidationMessage.cpp:
(WebCore::ValidationMessage::setMessageDOMAndStartTimer):
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::compileShader):
* inspector/agents/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::nodeForPath):
* loader/FormSubmission.cpp:
(WebCore::encodingFromAcceptCharset):
* loader/ResourceTiming.cpp:
(WebCore::passesTimingAllowCheck):
* page/WindowFeatures.cpp:
(WebCore::parseDisabledAdaptations):
(WebCore::parseDialogFeaturesMap):
* platform/URL.cpp:
(WebCore::isIPv4Address):
(WebCore::isIPv6Address):
* platform/graphics/GLContext.cpp:
(WebCore::GLContext::version):
* platform/graphics/freetype/FontCacheFreeType.cpp:
(WebCore::patternToFamilies):
* platform/graphics/gstreamer/GStreamerCommon.cpp:
(WebCore::extractGStreamerOptionsFromCommandLine):
* platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
(WebCore::Extensions3DOpenGLCommon::Extensions3DOpenGLCommon):
(WebCore::Extensions3DOpenGLCommon::initializeAvailableExtensions):
* platform/gtk/PasteboardHelper.cpp:
(WebCore::PasteboardHelper::fillSelectionData):
* platform/gtk/SelectionData.cpp:
(WebCore::SelectionData::setURIList):
* platform/network/CacheValidation.cpp:
(WebCore::collectVaryingRequestHeaders):
* platform/network/HTTPParsers.cpp:
(WebCore::filenameFromHTTPContentDisposition):
(WebCore::parseXFrameOptionsHeader):
(WebCore::parseAccessControlExposeHeadersAllowList):
* platform/network/curl/CookieUtil.cpp:
(WebCore::CookieUtil::parseCookieHeader):
* platform/network/curl/CurlCacheEntry.cpp:
(WebCore::CurlCacheEntry::loadResponseHeaders):
* platform/network/curl/CurlCacheManager.cpp:
(WebCore::CurlCacheManager::loadIndex):
* platform/network/soup/CookieJarSoup.cpp:
(WebCore::setCookiesFromDOM):
* svg/SVGAnimationElement.cpp:
(WebCore::SVGAnimationElement::parseAttribute):
* svg/SVGToOTFFontConversion.cpp:
(WebCore::SVGToOTFFontConverter::appendOS2Table):
* svg/animation/SVGSMILElement.cpp:
(WebCore::SVGSMILElement::parseBeginOrEnd):
* testing/MockCDMFactory.cpp:
(WebCore::MockCDM::sanitizeResponse const):
(WebCore::MockCDMInstance::updateLicense):
Update split/splitAllowingEmptyEntries usage.

Source/WebDriver:

* WebDriverService.cpp:
(WebDriver::WebDriverService::findCommand):
* glib/WebDriverServiceGLib.cpp:
(WebDriver::parseVersion):
Update split/splitAllowingEmptyEntries usage.

Source/WebKit:

* NetworkProcess/cache/CacheStorageEngineCache.cpp:
(WebKit::CacheStorage::updateVaryInformation):
* NetworkProcess/capture/NetworkCaptureManager.cpp:
(WebKit::NetworkCapture::Manager::fuzzyMatchURLs):
* Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
(WebKit::getPluginInfoFromPropertyLists):
(WebKit::PluginVersion::parse):
* Shared/Plugins/Netscape/unix/NetscapePluginModuleUnix.cpp:
(WebKit::NetscapePluginModule::parseMIMEDescription):
* Shared/Plugins/unix/PluginSearchPath.cpp:
(WebKit::pluginsDirectories):
* Shared/mac/ChildProcessMac.mm:
(WebKit::ChildProcess::initializeSandbox):
* UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp:
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::fileCanBeAcceptedForUpload):
* UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
(WebKit::ProcessLauncher::launchProcess):
* UIProcess/Launcher/mac/ProcessLauncherMac.mm:
(WebKit::ProcessLauncher::launchProcess):
* UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:
(WebKit::PluginProcessProxy::scanPlugin):
* WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
(WebKit::isTransparentSilverlightBackgroundValue):
Update split/splitAllowingEmptyEntries usage.

Source/WebKitLegacy/win:

* Plugins/PluginPackageWin.cpp:
(WebCore::PluginPackage::fetchInfo):
Update split/splitAllowingEmptyEntries usage.

Source/WTF:

* wtf/Assertions.cpp:
Update split/splitAllowingEmptyEntries usage.

* wtf/text/StringView.h:
(WTF::StringView::splitAllowingEmptyEntries const):
* wtf/text/WTFString.cpp:
(WTF::String::splitInternal const):
(WTF::String::split const):
(WTF::String::splitAllowingEmptyEntries const):
* wtf/text/WTFString.h:
(WTF::String::split const):
Introduce splitAllowingEmptyEntries instead of boolean or enum parameter.

Tools:

* TestWebKitAPI/Tests/WTF/WTFString.cpp:
Add tests for String::split and String::splitAllowingEmptyEntries.

* TestWebKitAPI/Tests/WTF/StringView.cpp:
* WebKitTestRunner/TestController.cpp:
(WTR::updateTestOptionsFromTestHeader):
Update split/splitAllowingEmptyEntries usage.

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

12 months ago[Curl] Test gardening
Basuke.Suzuki@sony.com [Thu, 26 Jul 2018 21:50:02 +0000 (21:50 +0000)]
[Curl] Test gardening
https://bugs.webkit.org/show_bug.cgi?id=188076

Unreviewed test gardening.

Mark diskcache test "Failure" for upcoming fix:
- https://bugs.webkit.org/show_bug.cgi?id=188069.

* platform/wincairo/TestExpectations:
  - http/tests/cache/disk-cache/disk-cache-302-status-code.html [ Failure ]

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

12 months agoFix assertions introduced in r234210
achristensen@apple.com [Thu, 26 Jul 2018 21:44:05 +0000 (21:44 +0000)]
Fix assertions introduced in r234210
https://bugs.webkit.org/show_bug.cgi?id=188074

Reviewed by Chris Dumez.

There is a client that uses WKFramePolicyListenerUseWithPolicies to send website policies as
a response to the WKPageNavigationClient's decidePolicyForNavigationResponse.  That is wasting
effort to generate policies that don't change anything. Once that client adopts WKWebView
they won't be able to do this any more, so temporarily remove the assertion.
Also, make the assertion about process swapping a release assert to prevent that client
from adopting WKFramePolicyListenerUseInNewProcessWithPolicies for navigation responses.
It should only be used for navigation actions.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::decidePolicyForNewWindowAction):
(WebKit::WebPageProxy::decidePolicyForResponse):

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

12 months agoAX: nothing returned for various previous text marker APIs from one div/p node to...
n_wang@apple.com [Thu, 26 Jul 2018 21:34:27 +0000 (21:34 +0000)]
AX: nothing returned for various previous text marker APIs from one div/p node to another
https://bugs.webkit.org/show_bug.cgi?id=188071

Reviewed by Chris Fleizach.

Source/WebCore:

TextIterator is emitting an extra '\n' at the end of the <p> node and there's no
corresponding text node in the DOM tree, so we are not able to handle that for
text markers. Fixed it by ignoring the extra '\n' and anchor the text marker to
the previous child text node.

Test: accessibility/mac/text-marker-p-tags.html

* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::traverseToOffsetInRange):

LayoutTests:

* accessibility/mac/text-marker-p-tags-expected.txt: Added.
* accessibility/mac/text-marker-p-tags.html: Added.
* accessibility/mac/text-marker-string-for-document-range-expected.txt:

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

12 months agoRemove unused/undefined String::appendInternal
commit-queue@webkit.org [Thu, 26 Jul 2018 21:32:00 +0000 (21:32 +0000)]
Remove unused/undefined String::appendInternal
https://bugs.webkit.org/show_bug.cgi?id=188063

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

* wtf/text/WTFString.h:
String::appendInternal is declared in WTFString.h, but is never used
and and never even defined. Remove it.

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

12 months agoUnreviewed, rolling out r234181 and r234189.
commit-queue@webkit.org [Thu, 26 Jul 2018 21:11:11 +0000 (21:11 +0000)]
Unreviewed, rolling out r234181 and r234189.
https://bugs.webkit.org/show_bug.cgi?id=188075

These are not needed right now (Requested by thorton on
#webkit).

Reverted changesets:

"Enable Web Content Filtering on watchOS"
https://bugs.webkit.org/show_bug.cgi?id=187979
https://trac.webkit.org/changeset/234181

"HAVE(PARENTAL_CONTROLS) should be true on watchOS"
https://bugs.webkit.org/show_bug.cgi?id=187985
https://trac.webkit.org/changeset/234189

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

12 months agoUse the Page's appearance when converting pasteboard attributed strings.
timothy@apple.com [Thu, 26 Jul 2018 20:30:08 +0000 (20:30 +0000)]
Use the Page's appearance when converting pasteboard attributed strings.
https://bugs.webkit.org/show_bug.cgi?id=188067
rdar://problem/42632246

Reviewed by Wenson Hsieh.

Source/WebCore:

* editing/cocoa/WebContentReaderCocoa.mm:
(WebCore::createFragment): Create a LocalDefaultSystemAppearance based on the Page.

Source/WebKitLegacy/mac:

* WebCoreSupport/WebEditorClient.mm:
(_WebCreateFragment): Create a LocalDefaultSystemAppearance based on the Page.

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

12 months agoarrayProtoPrivateFuncConcatMemcpy() should handle copying from an Undecided type...
mark.lam@apple.com [Thu, 26 Jul 2018 19:49:23 +0000 (19:49 +0000)]
arrayProtoPrivateFuncConcatMemcpy() should handle copying from an Undecided type array.
https://bugs.webkit.org/show_bug.cgi?id=188065
<rdar://problem/42515726>

Reviewed by Saam Barati.

JSTests:

* stress/regress-188065.js: Added.

Source/JavaScriptCore:

* runtime/ArrayPrototype.cpp:
(JSC::clearElement):
(JSC::copyElements):
(JSC::arrayProtoPrivateFuncConcatMemcpy):

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

12 months agoERROR: Unhandled web process message 'WebPage:SetUseDarkAppearance' when browsing...
cdumez@apple.com [Thu, 26 Jul 2018 19:49:09 +0000 (19:49 +0000)]
ERROR: Unhandled web process message 'WebPage:SetUseDarkAppearance' when browsing in dark mode
https://bugs.webkit.org/show_bug.cgi?id=188028

Reviewed by Wenson Hsieh.

The issue was that the WebViewImpl constructor was calling setUseDarkAppearance() *before* calling
initializeWebPage(), which would cause us to send IPC the WebContent process for a pageID that does
not exist on WebProcess side yet.

To address the issue, the WebViewImpl constructor no longer calls setUseDarkAppearance() and WebPageProxy
no longer holds a flag indicates is dark appearance is used. Instead, the WebPageProxy asks the WebView
for the value whenever it needs to, via the PageClient.

* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::WebViewImpl):
(WebKit::WebViewImpl::effectiveAppearanceDidChange):
(WebKit::WebViewImpl::setUseDarkAppearance): Deleted.
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::creationParameters):
(WebKit::WebPageProxy::useDarkAppearance const):
(WebKit::WebPageProxy::effectiveAppearanceDidChange):
(WebKit::WebPageProxy::showPlaybackTargetPicker):
(WebKit::WebPageProxy::setUseDarkAppearance): Deleted.
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::useDarkAppearance const): Deleted.
* UIProcess/mac/PageClientImplMac.h:
* UIProcess/mac/PageClientImplMac.mm:
(WebKit::PageClientImpl::effectiveAppearanceIsDark const):

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

12 months agoLayout Test webgl/2.0.0/conformance2/glsl3/compound-assignment-type-combination.html...
david_fenton@apple.com [Thu, 26 Jul 2018 17:50:04 +0000 (17:50 +0000)]
Layout Test webgl/2.0.0/conformance2/glsl3/compound-assignment-type-combination.html is timing out on mac Debug
https://bugs.webkit.org/show_bug.cgi?id=188061

Unreviewed test gardening.

Marked test as [ Slow ].

* platform/mac/TestExpectations:

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

12 months agoRemove a forward protocol declaration of '_WKWebViewPrintProvider'
sihui_liu@apple.com [Thu, 26 Jul 2018 17:04:52 +0000 (17:04 +0000)]
Remove a forward protocol declaration of '_WKWebViewPrintProvider'
https://bugs.webkit.org/show_bug.cgi?id=188012
<rdar://problem/42309526>

Reviewed by Darin Adler.

@procotol() expressions emit invalid protocol metadata when used with forward @protocol declarations.
Clang is going to make it an error for using a forward-declared protocol in a @protocol expression, so
we need to stop doing this.

* UIProcess/API/Cocoa/WKWebViewInternal.h:

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

12 months agoSwitching tabs should not close PiP window
eric.carlson@apple.com [Thu, 26 Jul 2018 17:03:39 +0000 (17:03 +0000)]
Switching tabs should not close PiP window
https://bugs.webkit.org/show_bug.cgi?id=188054
<rdar://problem/41212379>

Reviewed by Jon Lee.

No new tests, fixes an existing test.

Prior to r233926, calling VideoFullscreenInterfaceMac::requestHideAndExitFullscreen was a noop.
In r233926 it was updated to close the PiP window and was called from the PIPViewControllerDelegate
selectors to close the PiP window. requestHideAndExitFullscreen is also called from
WebPageProxy::viewDidLeaveWindow when the web view is removed from it window, so switching
tabs also closed the PiP window. Revert the changes to requestHideAndExitFullscreen, and add
a new method that is only used by the delegate to exit PiP.

* platform/mac/VideoFullscreenInterfaceMac.h:
(WebCore::VideoFullscreenInterfaceMac::requestHideAndExitFullscreen): Make this an empty,
do-nothing method.
* platform/mac/VideoFullscreenInterfaceMac.mm:
(-[WebVideoFullscreenInterfaceMacObjC pipShouldClose:]): Call requestHideAndExitPiP.
(-[WebVideoFullscreenInterfaceMacObjC pipActionStop:]): Ditto.
(WebCore::VideoFullscreenInterfaceMac::requestHideAndExitPiP): Renamed from requestHideAndExitFullscreen.
(WebCore::VideoFullscreenInterfaceMac::requestHideAndExitFullscreen): Deleted.

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

12 months agoUnreviewed, update TestExpectations for macOS WK1.
ryanhaddad@apple.com [Thu, 26 Jul 2018 17:02:30 +0000 (17:02 +0000)]
Unreviewed, update TestExpectations for macOS WK1.

* platform/mac-wk1/TestExpectations:

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

12 months agoDisable Dark Mode in the Plugin process to avoid rendering issues
cdumez@apple.com [Thu, 26 Jul 2018 16:59:17 +0000 (16:59 +0000)]
Disable Dark Mode in the Plugin process to avoid rendering issues
https://bugs.webkit.org/show_bug.cgi?id=188059
<rdar://problem/42369281>

Reviewed by Tim Horton.

Plugins generally do not support dark mode and this causes rendering issues so
disable dark mode in the plugin process.

* PluginProcess/mac/PluginProcessMac.mm:
(WebKit::PluginProcess::platformInitializePluginProcess):

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

12 months agoWebSiteData-related methods should take in CompletionHandlers instead of Functions
cdumez@apple.com [Thu, 26 Jul 2018 16:15:30 +0000 (16:15 +0000)]
WebSiteData-related methods should take in CompletionHandlers instead of Functions
https://bugs.webkit.org/show_bug.cgi?id=188027

Reviewed by Alex Christensen.

WebSiteData-related methods should take in CompletionHandlers instead of Functions since
they are need to be called and are only called once.

* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::fetchWebsiteData):
(WebKit::NetworkProcessProxy::deleteWebsiteData):
(WebKit::NetworkProcessProxy::deleteWebsiteDataForOrigins):
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/Plugins/PluginProcessProxy.cpp:
(WebKit::PluginProcessProxy::fetchWebsiteData):
(WebKit::PluginProcessProxy::deleteWebsiteData):
(WebKit::PluginProcessProxy::deleteWebsiteDataForHostNames):
* UIProcess/Plugins/PluginProcessProxy.h:
* UIProcess/Storage/StorageProcessProxy.cpp:
(WebKit::StorageProcessProxy::fetchWebsiteData):
(WebKit::StorageProcessProxy::deleteWebsiteData):
(WebKit::StorageProcessProxy::deleteWebsiteDataForOrigins):
* UIProcess/Storage/StorageProcessProxy.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores):
(WebKit::WebProcessProxy::topPrivatelyControlledDomainsWithWebsiteData):
(WebKit::WebProcessProxy::fetchWebsiteData):
(WebKit::WebProcessProxy::deleteWebsiteData):
(WebKit::WebProcessProxy::deleteWebsiteDataForOrigins):
* UIProcess/WebProcessProxy.h:

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

12 months agoJSC: Intl API should ignore encoding when parsing BCP 47 language tag from ISO 15897...
commit-queue@webkit.org [Thu, 26 Jul 2018 16:01:04 +0000 (16:01 +0000)]
JSC: Intl API should ignore encoding when parsing BCP 47 language tag from ISO 15897 locale string (passed via LANG)
https://bugs.webkit.org/show_bug.cgi?id=167991

Patch by Andy VanWagoner <andy@vanwagoner.family> on 2018-07-26
Reviewed by Michael Catanzaro.

Source/JavaScriptCore:

Improved the conversion of ICU locales to BCP47 tags, using their preferred method.
Checked locale.isEmpty() before returning it from defaultLocale, so there should be
no more cases where you might have an invalid locale come back from resolveLocale.

* runtime/IntlObject.cpp:
(JSC::convertICULocaleToBCP47LanguageTag):
(JSC::defaultLocale):
(JSC::lookupMatcher):
* runtime/IntlObject.h:
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::intlCollatorAvailableLocales):
(JSC::JSGlobalObject::intlDateTimeFormatAvailableLocales):
(JSC::JSGlobalObject::intlNumberFormatAvailableLocales):
(JSC::JSGlobalObject::intlPluralRulesAvailableLocales):

LayoutTests:

Replaced expecting throwing a runtime error to avoid a crash, with testing for good default locale fallback behavior.

* js/intl-default-locale-expected.txt: Added.
* js/intl-default-locale.html: Added.
* js/intl-invalid-locale-crash-expected.txt: Removed.
* js/intl-invalid-locale-crash.html: Removed.
* platform/win/TestExpectations:

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

12 months ago[GTK][WPE] Improve the way request displayRefresh notifications
magomez@igalia.com [Thu, 26 Jul 2018 15:44:46 +0000 (15:44 +0000)]
[GTK][WPE] Improve the way request displayRefresh notifications
https://bugs.webkit.org/show_bug.cgi?id=188005

Reviewed by Žan Doberšek.

Add a new interface ThreadedDisplayRefreshMonitor::Client and use it to pipe the the
requestDisplayRefreshMonitorUpdate and handleDisplayRefreshMonitorUpdate to the
ThreadedCoordinatedLayerTreeHost.

In response to requestDisplayRefreshMonitorUpdate, the LayerTreeHost will force a layer
flush that in the end causes a repaint, which generates the requested display refresh
event.

In response to handleDisplayRefreshMonitorUpdate, the call to renderNextFrame will happen,
and if the DisplayRefreshMonitor has been rescheduled, renderNextFrame will also force
a new layer flush, causing the repaint that will generate the display refreh event.

* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
(WebKit::ThreadedCompositor::create):
(WebKit::ThreadedCompositor::ThreadedCompositor):
(WebKit::m_displayRefreshMonitor):
(WebKit::ThreadedCompositor::handleDisplayRefreshMonitorUpdate):
(WebKit::ThreadedCompositor::requestDisplayRefreshMonitorUpdate): Deleted.
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.cpp:
(WebKit::ThreadedDisplayRefreshMonitor::ThreadedDisplayRefreshMonitor):
(WebKit::ThreadedDisplayRefreshMonitor::requestRefreshCallback):
(WebKit::ThreadedDisplayRefreshMonitor::dispatchDisplayRefreshCallback):
(WebKit::ThreadedDisplayRefreshMonitor::invalidate):
(WebKit::ThreadedDisplayRefreshMonitor::displayRefreshCallback):
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.h:
(WebKit::ThreadedDisplayRefreshMonitor::create):
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
(WebKit::CoordinatedLayerTreeHost::renderNextFrame):
(WebKit::CoordinatedLayerTreeHost::flushLayersAndForceRepaint):
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
* WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
(WebKit::ThreadedCoordinatedLayerTreeHost::ThreadedCoordinatedLayerTreeHost):
(WebKit::ThreadedCoordinatedLayerTreeHost::requestDisplayRefreshMonitorUpdate):
(WebKit::ThreadedCoordinatedLayerTreeHost::handleDisplayRefreshMonitorUpdate):
* WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:

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

12 months agoImprove WebGPU implementation, including using Metal Objective-C protocols more simpl...
darin@apple.com [Thu, 26 Jul 2018 15:42:53 +0000 (15:42 +0000)]
Improve WebGPU implementation, including using Metal Objective-C protocols more simply and correctly
https://bugs.webkit.org/show_bug.cgi?id=187333

Reviewed by Sam Weinig.

Source/WebCore:

- Used a new OBJC_PROTOCOL macro to handle things in the Metal API that are protocols.
  The code previously had used OBJC_CLASS, but that created unrelated classes.
  Fixing this allows removing many typecasts that were in the existing code, makes it
  ARC-compatible, and also allowed the compiler to detect a couple mistakes where we
  were calling methods that don't exist.

- Eliminated use of separate heap-allocated, reference-counted objects to
  hold pointers to Metal objects.

- Reduced the use of the WebGPU wrappers to pass around arguments inside the code.
  They are now used only as part of the DOM binding; the inner GPU objects are used
  whenever possible. This cuts down the number of separate functions needed a bit,
  since we don't always need accessors for the things inside the wrappers.

- Used references rather than pointers in many cases.

- Took out three kinds of null checks: 1) Unneeded ones since Objective-C has the
  "do nothing and return 0" behavior for methods without return values and that return
  integer scalars. 2) Checks that aren't needed because the code has clear, invariant
  guarantees that the pointer won't be null. 3) The simplest variant of (2), checks
  that can be obviated by using reference types instead of pointer types.

- For Metal-specific functions and data members, used the function name metal() and
  the data member name m_metal rather than longer wordier names with the word "platform"
  in them. We could use "platform" if these objects were platform-specific objects used
  in a cross-platform way that needed a common name. But in this case it's clearer to
  call them "metal" since we are dropping down to the metal with Metal API, and
  shared platform-independent code will not be accessing these.

- Fixed the common mistake of using "unsigned long" in our C++ code to match IDL.
  The "unsigned long" type in IDL correponds to the "unsigned" type in WebKit code.

- Used "const" more in the GPU functions that are wrappers around Metal objects to
  reflect the fact that these have semantics of smart pointers; most operations can be
  done without changing which object is pointed to. This allows us to use const
  references to pass things around without reference count churn.

- Reduced includes.

- Added "explicit" keywords where appropriate.

- Removed unused functions. In particular, removed non-Metal stub versions of the
  functions in the GPU classes: the right way to start a new port is to clone the
  Metal-specific files and turn the into stubs if needed, it does not make it
  significantly more convenient to have stubs in the platform independent files,
  especially ones that are not compiled for any platform.

- Removed most the WEBCORE_EXPORT in the GPU headers; left only what's needed to
  support testing with TestWebKitAPI.

- Fixed two storage leaks in GPUDevice by adding missing adoptNS.

* PlatformMac.cmake: Moved files from platform/graphics/cocoa to platform/graphics/metal.
* SourcesCocoa.txt: Ditto.
* WebCore.xcodeproj/project.pbxproj: Ditto. Fixed paths on some files and groups/directories.
Made the platform files that abstract GPU all be "project" visible, not "private", since
they don't need to be visible outside WebCore. Removed reference to FontSelectionKeywordValues.h,
which does not seem to be a source file, a derived source file, or mentioned in any change log.

* bindings/js/JSWebGPURenderPassAttachmentDescriptorCustom.cpp:
(WebCore::toJSNewlyCreated): Create the correct wrapper for a
WebGPURenderPassDepthAttachmentDescriptor. The old code would instead
create a WebGPURenderPassAttachmentDescriptor wrapper, which can't be
used to access the clearDepth attribute.

* html/canvas/WebGPUBuffer.cpp:
(WebCore::WebGPUBuffer::create): Use more references rather than pointers for things
that are never null. Added comment about possibly returning null on failure in future.
(WebCore::WebGPUBuffer::WebGPUBuffer): Updated to store the GPUBuffer inside the class
instead of in a separate reference counted object.
* html/canvas/WebGPUBuffer.h: Ditto.

* html/canvas/WebGPUCommandBuffer.cpp:
(WebCore::WebGPUCommandBuffer::create): Use references and lower level types.
(WebCore::WebGPUCommandBuffer::WebGPUCommandBuffer): Store the GPUCommandBuffer
inside the class.
(WebCore::WebGPUCommandBuffer::commit): Removed unneeded null checks.
(WebCore::WebGPUCommandBuffer::presentDrawable): Ditto.
(WebCore::WebGPUCommandBuffer::createRenderCommandEncoderWithDescriptor):
Removed unneeded local variable.
(WebCore::WebGPUCommandBuffer::createComputeCommandEncoder): Ditto.
(WebCore::WebGPUCommandBuffer::completed): Store the DOMPromiseProxy in this
class, not in GPUCommandBuffer.
* html/canvas/WebGPUCommandBuffer.h: Ditto.

* html/canvas/WebGPUCommandQueue.cpp:
(WebCore::WebGPUCommandQueue::create): Use references and lower level types.
(WebCore::WebGPUCommandQueue::WebGPUCommandQueue): Store the GPUCommandQueue
inside the class.
(WebCore::WebGPUCommandQueue::createCommandBuffer): Ditto.
* html/canvas/WebGPUCommandQueue.h: Ditto.
* html/canvas/WebGPUCommandQueue.idl: The return value of createCommandBuffer
is no longer nullable.

* html/canvas/WebGPUComputeCommandEncoder.cpp:
(WebCore::WebGPUComputeCommandEncoder::create): More of the same.
(WebCore::WebGPUComputeCommandEncoder::WebGPUComputeCommandEncoder): Ditto.
(WebCore::WebGPUComputeCommandEncoder::setComputePipelineState): Ditto.
(WebCore::WebGPUComputeCommandEncoder::setBuffer): Ditto.
(WebCore::WebGPUComputeCommandEncoder::dispatch): Ditto.
(WebCore::WebGPUComputeCommandEncoder::endEncoding): Ditto.
* html/canvas/WebGPUComputeCommandEncoder.h: Ditto.

* html/canvas/WebGPUComputePipelineState.cpp:
(WebCore::WebGPUComputePipelineState::create): More of the same.
(WebCore::WebGPUComputePipelineState::WebGPUComputePipelineState): Ditto.
* html/canvas/WebGPUComputePipelineState.h: Ditto.

* html/canvas/WebGPUDepthStencilDescriptor.cpp:
(WebCore::WebGPUDepthStencilDescriptor::create): More of the same.
(WebCore::WebGPUDepthStencilDescriptor::depthWriteEnabled const): Ditto.
(WebCore::WebGPUDepthStencilDescriptor::setDepthWriteEnabled): Ditto.
(WebCore::WebGPUDepthStencilDescriptor::depthCompareFunction const): Ditto.
(WebCore::WebGPUDepthStencilDescriptor::setDepthCompareFunction): Ditto.
* html/canvas/WebGPUDepthStencilDescriptor.h: Ditto. Also fixed a bug
where m_depthCompareFunction was uninitialized in newly created objects.

* html/canvas/WebGPUDepthStencilState.cpp:
(WebCore::WebGPUDepthStencilState::create): More of the same.
(WebCore::WebGPUDepthStencilState::WebGPUDepthStencilState): Ditto.
(WebCore::WebGPUDepthStencilState::label const): Ditto.
(WebCore::WebGPUDepthStencilState::setLabel): Ditto.
* html/canvas/WebGPUDepthStencilState.h: Ditto.

* html/canvas/WebGPUDrawable.cpp:
(WebCore::WebGPUDrawable::create): More of the same.
(WebCore::WebGPUDrawable::WebGPUDrawable): Ditto.
* html/canvas/WebGPUDrawable.h: Ditto.

* html/canvas/WebGPUEnums.cpp: Removed some stray const.
* html/canvas/WebGPUEnums.h: Ditto.

* html/canvas/WebGPUFunction.cpp:
(WebCore::WebGPUFunction::create): More of the same.
(WebCore::WebGPUFunction::WebGPUFunction): Ditto.
* html/canvas/WebGPUFunction.h: Ditto.

* html/canvas/WebGPULibrary.cpp:
(WebCore::WebGPULibrary::create): More of the same.
(WebCore::WebGPULibrary::WebGPULibrary): Ditto.
(WebCore::WebGPULibrary::functionNames const): Ditto.
(WebCore::WebGPULibrary::functionWithName const): Ditto.
* html/canvas/WebGPULibrary.h: Ditto.

* html/canvas/WebGPUObject.cpp:
(WebCore::WebGPUObject::WebGPUObject):
(WebCore::WebGPUObject::deleteObject): Deleted this unused function.
We can bring it back later if we find we need it the way we did with the
WebGL implementation, but currently it's a never-called stub. Also
deleted the isDeleted and m_deleted for the same reason.
* html/canvas/WebGPUObject.h: Ditto.

* html/canvas/WebGPURenderCommandEncoder.cpp:
(WebCore::WebGPURenderCommandEncoder::create): More of the same.
(WebCore::WebGPURenderCommandEncoder::WebGPURenderCommandEncoder): Ditto.
(WebCore::WebGPURenderCommandEncoder::setRenderPipelineState): Ditto.
(WebCore::WebGPURenderCommandEncoder::setDepthStencilState): Ditto.
(WebCore::WebGPURenderCommandEncoder::setVertexBuffer): Ditto.
(WebCore::WebGPURenderCommandEncoder::setFragmentBuffer): Ditto.
(WebCore::WebGPURenderCommandEncoder::drawPrimitives): Ditto.
(WebCore::WebGPURenderCommandEncoder::endEncoding): Ditto.
* html/canvas/WebGPURenderCommandEncoder.h: Ditto.

* html/canvas/WebGPURenderPassAttachmentDescriptor.cpp:
(WebCore::WebGPURenderPassAttachmentDescriptor::WebGPURenderPassAttachmentDescriptor):
More of the same.
(WebCore::WebGPURenderPassAttachmentDescriptor::loadAction const): Ditto.
(WebCore::WebGPURenderPassAttachmentDescriptor::setLoadAction): Ditto.
(WebCore::WebGPURenderPassAttachmentDescriptor::storeAction const): Ditto.
(WebCore::WebGPURenderPassAttachmentDescriptor::setStoreAction): Ditto.
(WebCore::WebGPURenderPassAttachmentDescriptor::texture const): Ditto.
(WebCore::WebGPURenderPassAttachmentDescriptor::setTexture): Ditto.
* html/canvas/WebGPURenderPassAttachmentDescriptor.h: Ditto.

* html/canvas/WebGPURenderPassColorAttachmentDescriptor.cpp:
(WebCore::WebGPURenderPassColorAttachmentDescriptor::create): More of the same.
(WebCore::WebGPURenderPassColorAttachmentDescriptor::WebGPURenderPassColorAttachmentDescriptor): Ditto.
(WebCore::WebGPURenderPassColorAttachmentDescriptor::descriptor const): Ditto.
(WebCore::WebGPURenderPassColorAttachmentDescriptor::clearColor const): Ditto.
(WebCore::WebGPURenderPassColorAttachmentDescriptor::setClearColor): Ditto.
* html/canvas/WebGPURenderPassColorAttachmentDescriptor.h: Ditto.

* html/canvas/WebGPURenderPassDepthAttachmentDescriptor.cpp:
(WebCore::WebGPURenderPassDepthAttachmentDescriptor::create): More of the same.
(WebCore::WebGPURenderPassDepthAttachmentDescriptor::WebGPURenderPassDepthAttachmentDescriptor): Ditto.
(WebCore::WebGPURenderPassDepthAttachmentDescriptor::clearDepth const): Ditto.
(WebCore::WebGPURenderPassDepthAttachmentDescriptor::setClearDepth): Ditto.
(WebCore::WebGPURenderPassDepthAttachmentDescriptor::descriptor const): Ditto.
* html/canvas/WebGPURenderPassDepthAttachmentDescriptor.h: Ditto.

* html/canvas/WebGPURenderPassDescriptor.cpp:
(WebCore::WebGPURenderPassDescriptor::create): More of the same.
(WebCore::WebGPURenderPassDescriptor::depthAttachment): Ditto.
(WebCore::WebGPURenderPassDescriptor::colorAttachments): Ditto.
* html/canvas/WebGPURenderPassDescriptor.h: Ditto.

* html/canvas/WebGPURenderPipelineColorAttachmentDescriptor.cpp:
(WebCore::WebGPURenderPipelineColorAttachmentDescriptor::create): More of the same.
(WebCore::WebGPURenderPipelineColorAttachmentDescriptor::WebGPURenderPipelineColorAttachmentDescriptor): Ditto.
(WebCore::WebGPURenderPipelineColorAttachmentDescriptor::pixelFormat const): Ditto.
(WebCore::WebGPURenderPipelineColorAttachmentDescriptor::setPixelFormat): Ditto.
* html/canvas/WebGPURenderPipelineColorAttachmentDescriptor.h: Ditto.

* html/canvas/WebGPURenderPipelineDescriptor.cpp:
(WebCore::WebGPURenderPipelineDescriptor::create): More of the same.
(WebCore::WebGPURenderPipelineDescriptor::vertexFunction const): Ditto.
(WebCore::WebGPURenderPipelineDescriptor::setVertexFunction): Ditto.
(WebCore::WebGPURenderPipelineDescriptor::fragmentFunction const): Ditto.
(WebCore::WebGPURenderPipelineDescriptor::setFragmentFunction): Ditto.
(WebCore::WebGPURenderPipelineDescriptor::colorAttachments): Ditto.
(WebCore::WebGPURenderPipelineDescriptor::depthAttachmentPixelFormat const): Ditto.
(WebCore::WebGPURenderPipelineDescriptor::setDepthAttachmentPixelFormat): Ditto.
(WebCore::WebGPURenderPipelineDescriptor::reset): Ditto.
* html/canvas/WebGPURenderPipelineDescriptor.h: Ditto.

* html/canvas/WebGPURenderPipelineState.cpp:
(WebCore::WebGPURenderPipelineState::create): More of the same.
(WebCore::WebGPURenderPipelineState::WebGPURenderPipelineState): Ditto.
(WebCore::WebGPURenderPipelineState::label const): Ditto.
(WebCore::WebGPURenderPipelineState::setLabel): Ditto.
* html/canvas/WebGPURenderPipelineState.h: Ditto.

* html/canvas/WebGPURenderingContext.cpp:
(WebCore::WebGPURenderingContext::create): More of the same.
(WebCore::WebGPURenderingContext::WebGPURenderingContext): Ditto.
(WebCore::WebGPURenderingContext::initializeNewContext): Ditto.
(WebCore::WebGPURenderingContext::platformLayer const): Ditto.
(WebCore::WebGPURenderingContext::markLayerComposited): Ditto.
(WebCore::WebGPURenderingContext::reshape): Ditto.
(WebCore::WebGPURenderingContext::createLibrary): Ditto.
(WebCore::WebGPURenderingContext::createRenderPipelineState): Ditto.
(WebCore::WebGPURenderingContext::createDepthStencilState): Ditto.
(WebCore::WebGPURenderingContext::createComputePipelineState): Ditto.
(WebCore::WebGPURenderingContext::createCommandQueue): Ditto.
(WebCore::WebGPURenderingContext::nextDrawable): Ditto.
(WebCore::WebGPURenderingContext::createBuffer): Ditto.
(WebCore::WebGPURenderingContext::createTexture): Ditto.
* html/canvas/WebGPURenderingContext.h: Made many functions final and
private.
* html/canvas/WebGPURenderingContext.idl: The return value of most of
the create functions are no longer nullable.

* html/canvas/WebGPUSize.h: Use "unsigned" instead of "unsigned long".

* html/canvas/WebGPUTexture.cpp:
(WebCore::WebGPUTexture::createFromDrawableTexture): More of the same.
(WebCore::WebGPUTexture::create): Ditto.
(WebCore::WebGPUTexture::WebGPUTexture): Ditto.
* html/canvas/WebGPUTexture.h: Ditto.

* html/canvas/WebGPUTextureDescriptor.cpp:
(WebCore::WebGPUTextureDescriptor::create): More of the same.
(WebCore::WebGPUTextureDescriptor::WebGPUTextureDescriptor): Ditto.
(WebCore::WebGPUTextureDescriptor::width const): Ditto.
(WebCore::WebGPUTextureDescriptor::setWidth): Ditto.
(WebCore::WebGPUTextureDescriptor::height const): Ditto.
(WebCore::WebGPUTextureDescriptor::setHeight): Ditto.
(WebCore::WebGPUTextureDescriptor::sampleCount const): Ditto.
(WebCore::WebGPUTextureDescriptor::setSampleCount): Ditto.
(WebCore::WebGPUTextureDescriptor::textureType const): Ditto.
(WebCore::WebGPUTextureDescriptor::setTextureType): Ditto.
(WebCore::WebGPUTextureDescriptor::storageMode const): Ditto.
(WebCore::WebGPUTextureDescriptor::setStorageMode): Ditto.
(WebCore::WebGPUTextureDescriptor::usage const): Ditto.
(WebCore::WebGPUTextureDescriptor::setUsage): Ditto.
* html/canvas/WebGPUTextureDescriptor.h: Ditto.

* platform/graphics/metal/GPUBufferMetal.mm: Moved from "cocoa" directory.
(WebCore::GPUBuffer::GPUBuffer): Simplify code using references and the
"metal" naming.

* platform/graphics/metal/GPUCommandBufferMetal.mm:
(WebCore::GPUCommandBuffer::GPUCommandBuffer): Take a function to be called as the
completed handler and set it up.
(WebCore::GPUCommandBuffer::presentDrawable const): Ditto.
(WebCore::GPUCommandBuffer::commit const): Ditto.
(WebCore::GPUCommandBuffer::addCompletedHandler): Deleted.

* platform/graphics/metal/GPUCommandQueueMetal.mm:
(WebCore::GPUCommandQueue::GPUCommandQueue): Ditto. Also rewrote label handling a bit.
(WebCore::GPUCommandQueue::label const): Ditto.
(WebCore::GPUCommandQueue::setLabel const): Ditto.

* platform/graphics/metal/GPUComputeCommandEncoderMetal.mm:
(WebCore::GPUComputeCommandEncoder::GPUComputeCommandEncoder): Ditto.
(WebCore::GPUComputeCommandEncoder::setComputePipelineState const): Ditto.
(WebCore::GPUComputeCommandEncoder::setBuffer const): Ditto.
(WebCore::GPUComputeCommandEncoder::dispatch const): Ditto.
(WebCore::GPUComputeCommandEncoder::endEncoding const): Ditto.

* platform/graphics/metal/GPUComputePipelineStateMetal.mm:
(WebCore::GPUComputePipelineState::GPUComputePipelineState): Ditto.

* platform/graphics/metal/GPUDepthStencilDescriptorMetal.mm:
(WebCore::GPUDepthStencilDescriptor::GPUDepthStencilDescriptor): Ditto.
(WebCore::GPUDepthStencilDescriptor::depthWriteEnabled const): Ditto.
(WebCore::GPUDepthStencilDescriptor::setDepthWriteEnabled const): Ditto.
(WebCore::GPUDepthStencilDescriptor::depthCompareFunction const): Ditto.
(WebCore::GPUDepthStencilDescriptor::setDepthCompareFunction const): Ditto.

* platform/graphics/metal/GPUDepthStencilStateMetal.mm:
(WebCore::GPUDepthStencilState::GPUDepthStencilState): Ditto.
(WebCore::GPUDepthStencilState::label const): Ditto.
(WebCore::GPUDepthStencilState::setLabel const): Ditto. This is one of the
functions that was calling a method that does not exist. Added a comment.

* platform/graphics/metal/GPUDeviceMetal.mm:
(WebCore::GPUDevice::GPUDevice): Ditto. Also fixed two storage leaks where
we neglected to do adoptNS on the result of MTLCreateSystemDefaultDevice and
on the result of -[[WebGPULayer alloc] initWithGPUDevice:].
(WebCore::GPUDevice::reshape const): Ditto.
(WebCore::GPUDevice::platformLayer const): Ditto.
(WebCore::GPUDevice::operator! const): Ditto.

* platform/graphics/metal/GPUDrawableMetal.mm:
(WebCore::GPUDrawable::GPUDrawable): Ditto.
(WebCore::GPUDrawable::release): Ditto.
(WebCore::GPUDrawable::metal const): Ditto.
(WebCore::GPUDrawable::texture const): Ditto.

* platform/graphics/metal/GPUFunctionMetal.mm:
(WebCore::GPUFunction::GPUFunction): Ditto.
(WebCore::GPUFunction::name const): Ditto.
(WebCore::GPUFunction::metal const): Ditto.
(WebCore::GPUFunction::operator! const): Ditto.

* platform/graphics/metal/GPULibraryMetal.mm:
(WebCore::GPULibrary::GPULibrary): Ditto.
(WebCore::GPULibrary::label const): Ditto.
(WebCore::GPULibrary::setLabel const): Ditto.
(WebCore::GPULibrary::functionNames const): Ditto.
(WebCore::GPULibrary::metal const): Ditto.

* platform/graphics/metal/GPURenderCommandEncoderMetal.mm:
(WebCore::GPURenderCommandEncoder::GPURenderCommandEncoder): Ditto.
(WebCore::GPURenderCommandEncoder::setRenderPipelineState const): Ditto.
(WebCore::GPURenderCommandEncoder::setDepthStencilState const): Ditto.
(WebCore::GPURenderCommandEncoder::setVertexBuffer const): Ditto.
(WebCore::GPURenderCommandEncoder::setFragmentBuffer const): Ditto.
(WebCore::GPURenderCommandEncoder::drawPrimitives const): Ditto.
(WebCore::GPURenderCommandEncoder::endEncoding const): Ditto.

* platform/graphics/metal/GPURenderPassAttachmentDescriptorMetal.mm:
(WebCore::GPURenderPassAttachmentDescriptor::GPURenderPassAttachmentDescriptor): Ditto.
(WebCore::GPURenderPassAttachmentDescriptor::loadAction const): Ditto.
(WebCore::GPURenderPassAttachmentDescriptor::setLoadAction const): Ditto.
(WebCore::GPURenderPassAttachmentDescriptor::storeAction const): Ditto.
(WebCore::GPURenderPassAttachmentDescriptor::setStoreAction const): Ditto.
(WebCore::GPURenderPassAttachmentDescriptor::setTexture const): Ditto.

* platform/graphics/metal/GPURenderPassColorAttachmentDescriptorMetal.mm:
(WebCore::GPURenderPassColorAttachmentDescriptor::GPURenderPassColorAttachmentDescriptor): Ditto.
(WebCore::GPURenderPassColorAttachmentDescriptor::clearColor const): Ditto.
(WebCore::GPURenderPassColorAttachmentDescriptor::setClearColor const): Ditto.
(WebCore::GPURenderPassColorAttachmentDescriptor::metal const): Ditto.

* platform/graphics/metal/GPURenderPassDepthAttachmentDescriptorMetal.mm:
(WebCore::GPURenderPassDepthAttachmentDescriptor::GPURenderPassDepthAttachmentDescriptor): Ditto.
(WebCore::GPURenderPassDepthAttachmentDescriptor::clearDepth const): Ditto.
(WebCore::GPURenderPassDepthAttachmentDescriptor::setClearDepth const): Ditto.
(WebCore::GPURenderPassDepthAttachmentDescriptor::metal const): Ditto.

* platform/graphics/metal/GPURenderPassDescriptorMetal.mm:
(WebCore::GPURenderPassDescriptor::GPURenderPassDescriptor): Ditto.
(WebCore::GPURenderPassDescriptor::colorAttachments const): Ditto.
(WebCore::GPURenderPassDescriptor::depthAttachment const): Ditto.
(WebCore::GPURenderPassDescriptor::metal const): Ditto.

* platform/graphics/metal/GPURenderPipelineColorAttachmentDescriptorMetal.mm:
(WebCore::GPURenderPipelineColorAttachmentDescriptor::GPURenderPipelineColorAttachmentDescriptor): Ditto.
(WebCore::GPURenderPipelineColorAttachmentDescriptor::pixelFormat const): Ditto.
(WebCore::GPURenderPipelineColorAttachmentDescriptor::setPixelFormat const): Ditto.
(WebCore::GPURenderPipelineColorAttachmentDescriptor::metal const): Ditto.

* platform/graphics/metal/GPURenderPipelineDescriptorMetal.mm:
(WebCore::GPURenderPipelineDescriptor::GPURenderPipelineDescriptor): Ditto.
(WebCore::GPURenderPipelineDescriptor::depthAttachmentPixelFormat const): Ditto.
(WebCore::GPURenderPipelineDescriptor::setDepthAttachmentPixelFormat const): Ditto.
(WebCore::GPURenderPipelineDescriptor::setVertexFunction const): Ditto.
(WebCore::GPURenderPipelineDescriptor::setFragmentFunction const): Ditto.
(WebCore::GPURenderPipelineDescriptor::colorAttachments const): Ditto.
(WebCore::GPURenderPipelineDescriptor::reset const): Ditto.
(WebCore::GPURenderPipelineDescriptor::metal const): Ditto.

* platform/graphics/metal/GPURenderPipelineStateMetal.mm:
(WebCore::GPURenderPipelineState::GPURenderPipelineState): Ditto.
(WebCore::GPURenderPipelineState::label const): Ditto.
(WebCore::GPURenderPipelineState::setLabel const): Ditto. This is one of the
functions that was calling a method that does not exist. Added a comment.
(WebCore::GPURenderPipelineState::metal const): Ditto.

* platform/graphics/metal/GPUTextureDescriptorMetal.mm:
(WebCore::GPUTextureDescriptor::GPUTextureDescriptor): Ditto.
(WebCore::GPUTextureDescriptor::width const): Ditto.
(WebCore::GPUTextureDescriptor::setWidth const): Ditto.
(WebCore::GPUTextureDescriptor::height const): Ditto.
(WebCore::GPUTextureDescriptor::setHeight const): Ditto.
(WebCore::GPUTextureDescriptor::sampleCount const): Ditto.
(WebCore::GPUTextureDescriptor::setSampleCount const): Ditto.
(WebCore::GPUTextureDescriptor::textureType const): Ditto.
(WebCore::GPUTextureDescriptor::setTextureType const): Ditto.
(WebCore::GPUTextureDescriptor::storageMode const): Ditto.
(WebCore::GPUTextureDescriptor::setStorageMode const): Ditto.
(WebCore::GPUTextureDescriptor::usage const): Ditto.
(WebCore::GPUTextureDescriptor::setUsage const): Ditto.
(WebCore::GPUTextureDescriptor::metal const): Ditto.

* platform/graphics/metal/GPUTextureMetal.mm:
(WebCore::GPUTexture::GPUTexture): Ditto.
(WebCore::GPUTexture::width const): Ditto.
(WebCore::GPUTexture::height const): Ditto.
(WebCore::GPUTexture::metal const): Ditto.

* platform/graphics/gpu/GPUBuffer.cpp: Removed unused stubs.
(WebCore::GPUBuffer::length const): Moved this function here since it has
a useful platform-independent implementation.

* platform/graphics/gpu/GPUBuffer.h: Use OBJC_PROTOCOL for MTLBuffer.
Did the other thigs mentioned above: USE(METAL), remove WEBCORE_EXPORT,
no longer be RefCounted, etc.

* platform/graphics/gpu/GPUCommandBuffer.cpp: Ditto.
* platform/graphics/gpu/GPUCommandBuffer.h: Ditto. Use OBJC_PROTOCOL
for MTLCommandBuffer.

* platform/graphics/gpu/GPUCommandQueue.cpp: Ditto.
* platform/graphics/gpu/GPUCommandQueue.h: Ditto. Use OBJC_PROTOCOL for
MTLCommandQueue.

* platform/graphics/gpu/GPUComputeCommandEncoder.cpp: Ditto.
* platform/graphics/gpu/GPUComputeCommandEncoder.h: Ditto. Use OBJC_PROTOCOL for
MTLComputeCommandEncoder.

* platform/graphics/gpu/GPUComputePipelineState.cpp: Ditto.
* platform/graphics/gpu/GPUComputePipelineState.h: Ditto. Use OBJC_PROTOCOL for
MTLComputePipelineState.

* platform/graphics/gpu/GPUDepthStencilDescriptor.cpp: Ditto.
* platform/graphics/gpu/GPUDepthStencilDescriptor.h: Ditto.

* platform/graphics/gpu/GPUDepthStencilState.cpp: Ditto.
* platform/graphics/gpu/GPUDepthStencilState.h: Ditto. Use OBJC_PROTOCOL for
MTLDepthStencilState.

* platform/graphics/gpu/GPUDevice.cpp: Ditto.
* platform/graphics/gpu/GPUDevice.h: Ditto. Use OBJC_PROTOCOL for MTLDevice.

* platform/graphics/gpu/GPUDrawable.cpp: Ditto.
* platform/graphics/gpu/GPUDrawable.h: Ditto. Use OBJC_PROTOCOL for
MTLDrawable and MTLTexture.

* platform/graphics/gpu/GPUEnums.h: Tweaked formatting.

* platform/graphics/gpu/GPUFunction.cpp: Ditto.
* platform/graphics/gpu/GPUFunction.h: Ditto. Use OBJC_PROTOCOL for
MTLFunction.

* platform/graphics/gpu/GPULibrary.cpp: Ditto.
* platform/graphics/gpu/GPULibrary.h: Ditto. Use OBJC_PROTOCOL for
MTLLibrary.

* platform/graphics/gpu/GPURenderCommandEncoder.cpp: Ditto.
* platform/graphics/gpu/GPURenderCommandEncoder.h: Ditto.
Use OBJC_PROTOCOL for MTLRenderCommandEncoder.

* platform/graphics/gpu/GPURenderPassAttachmentDescriptor.cpp: Ditto.
* platform/graphics/gpu/GPURenderPassAttachmentDescriptor.h: Ditto.

* platform/graphics/gpu/GPURenderPassColorAttachmentDescriptor.cpp: Ditto.
* platform/graphics/gpu/GPURenderPassColorAttachmentDescriptor.h: Ditto.

* platform/graphics/gpu/GPURenderPassDepthAttachmentDescriptor.cpp: Ditto.
* platform/graphics/gpu/GPURenderPassDepthAttachmentDescriptor.h: Ditto.

* platform/graphics/gpu/GPURenderPassDescriptor.cpp: Ditto.
* platform/graphics/gpu/GPURenderPassDescriptor.h: Ditto.

* platform/graphics/gpu/GPURenderPipelineColorAttachmentDescriptor.cpp: Ditto.
* platform/graphics/gpu/GPURenderPipelineColorAttachmentDescriptor.h: Ditto.

* platform/graphics/gpu/GPURenderPipelineDescriptor.cpp: Ditto.
* platform/graphics/gpu/GPURenderPipelineDescriptor.h: Ditto.

* platform/graphics/gpu/GPURenderPipelineState.cpp: Ditto.
* platform/graphics/gpu/GPURenderPipelineState.h: Ditto. Use OBJC_PROTOCOL
for MTLRenderPipelineState.

* platform/graphics/gpu/GPUSize.h: Use "unsigned" instead of "unsigned long".

* platform/graphics/gpu/GPUTexture.cpp: Ditto.
* platform/graphics/gpu/GPUTexture.h: Ditto. Use OBJC_PROTOCOL for
MTLTexture.

* platform/graphics/gpu/GPUTextureDescriptor.cpp: Ditto.
* platform/graphics/gpu/GPUTextureDescriptor.h: Ditto.

Source/WTF:

* wtf/Compiler.h: Added OBJC_PROTOCOL, a macro for convieniently treating an
Objective-C protocol in a way that lets it be mentioned in a C++ source file.
This is the rough equivalent of OBJC_CLASS, but for protocols.

* wtf/Platform.h: Added USE(METAL), alongside USE(OPENGL) and the like.
Now used in the WebGPU platform layer to guard the Metal-specific code.

Tools:

* TestWebKitAPI/Tests/WebCore/mac/GPUBuffer.mm: Updated.
* TestWebKitAPI/Tests/WebCore/mac/GPUCommandQueue.mm: Updated.
* TestWebKitAPI/Tests/WebCore/mac/GPUDevice.mm: Updated.
* TestWebKitAPI/Tests/WebCore/mac/GPUFunction.mm: Updated.
* TestWebKitAPI/Tests/WebCore/mac/GPULibrary.mm: Updated.

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

12 months agoUnreviewed GTK+ and WPE gardening after r234252.
magomez@igalia.com [Thu, 26 Jul 2018 15:16:37 +0000 (15:16 +0000)]
Unreviewed GTK+ and WPE gardening after r234252.

* platform/gtk/TestExpectations:
* platform/gtk/fast/overflow/line-clamp-expected.png:
* platform/gtk/fast/overflow/line-clamp-expected.txt:
* platform/wpe/TestExpectations:

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

12 months ago[LFC][Floating] Add skeleton for basic positioning.
zalan@apple.com [Thu, 26 Jul 2018 14:30:39 +0000 (14:30 +0000)]
[LFC][Floating] Add skeleton for basic positioning.
https://bugs.webkit.org/show_bug.cgi?id=187974

Reviewed by Antti Koivisto.

Add floating boxes to an empty floating context.

* layout/FloatingContext.cpp:
(WebCore::Layout::FloatingContext::FloatingContext):
(WebCore::Layout::FloatingContext::computePosition):
* layout/FloatingContext.h:
(WebCore::Layout::FloatingContext::floatingState const):
(WebCore::Layout::FloatingContext::layoutContext const):
* layout/FloatingState.cpp:
(WebCore::Layout::FloatingState::FloatingState):
(WebCore::Layout::FloatingState::append):
* layout/FloatingState.h:
(WebCore::Layout::FloatingState::create):
(WebCore::Layout::FloatingState::isEmpty const):
(WebCore::Layout::FloatingState::layoutContext const):
* layout/FormattingState.h:
* layout/LayoutContext.cpp:
(WebCore::Layout::LayoutContext::establishedFormattingState):
* layout/LayoutContext.h:
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::layout const):
(WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
(WebCore::Layout::BlockFormattingContext::computeFloatingPosition const):
* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockInvalidation.cpp:
(WebCore::Layout::invalidationStopsAtFormattingContextBoundary):
* layout/layouttree/LayoutBox.cpp:
(WebCore::Layout::Box::isLeftFloatingPositioned const):
(WebCore::Layout::Box::isRightFloatingPositioned const):
* layout/layouttree/LayoutBox.h:

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

12 months ago[LFC][BFC] Do not try to access containing block's height during descendant height...
zalan@apple.com [Thu, 26 Jul 2018 14:25:51 +0000 (14:25 +0000)]
[LFC][BFC] Do not try to access containing block's height during descendant height computation
https://bugs.webkit.org/show_bug.cgi?id=187970

Reviewed by Antti Koivisto.

Mostly becasue in BFC, we compute the descendents' height first so the containing block's height is probably not computed yet.

* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedHeightAndMargin):
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):

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

12 months agoUnreviewed, add bug references into FIXME comments for CSSOM View API
fred.wang@free.fr [Thu, 26 Jul 2018 14:07:23 +0000 (14:07 +0000)]
Unreviewed, add bug references into FIXME comments for CSSOM View API

Patch by Frederic Wang <fwang@igalia.com> on 2018-07-26

* dom/Element.idl:
* page/ScrollToOptions.idl:

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

12 months ago[LFC][BFC] assert-not-implemented-yet on inflow non-replaced height when style is...
zalan@apple.com [Thu, 26 Jul 2018 13:45:33 +0000 (13:45 +0000)]
[LFC][BFC] assert-not-implemented-yet on inflow non-replaced height when style is not fixed/auto.
https://bugs.webkit.org/show_bug.cgi?id=187969

Reviewed by Antti Koivisto.

Assert on unsupported height types when computing inflow non-replaced height.

* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):

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

12 months agoREGRESSION(r234248) [Win] testapi.c: nonstandard extension used: non-constant aggrega...
Hironori.Fujii@sony.com [Thu, 26 Jul 2018 09:30:22 +0000 (09:30 +0000)]
REGRESSION(r234248) [Win] testapi.c: nonstandard extension used: non-constant aggregate initializer
https://bugs.webkit.org/show_bug.cgi?id=188040

Unreviewed build fix for AppleWin port.

* API/tests/testapi.c: Disabled warning C4204.
(testMarkingConstraintsAndHeapFinalizers): Added an explicit void* cast for weakRefs.

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

12 months ago[WTF] Coverity scan issues
tpopela@redhat.com [Thu, 26 Jul 2018 09:00:09 +0000 (09:00 +0000)]
[WTF] Coverity scan issues
https://bugs.webkit.org/show_bug.cgi?id=186800

Reviewed by Brent Fulgham.

* wtf/CheckedArithmetic.h: Swap the operands to multiply().
* wtf/ThreadSpecific.h: Initialize the m_key variable.
* wtf/dtoa.cpp: Initialize the next variable.

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

12 months ago[Web Animations] REGRESSION: transition added immediately after element creation...
graouts@webkit.org [Thu, 26 Jul 2018 08:33:31 +0000 (08:33 +0000)]
[Web Animations] REGRESSION: transition added immediately after element creation doesn't work
https://bugs.webkit.org/show_bug.cgi?id=187942

Reviewed by Dean Jackson.

Source/WebCore:

Tests: webanimations/accelerated-transition-by-removing-property.html
       webanimations/partly-accelerated-transition-by-removing-property.html

The Style::TreeResolver::createAnimatedElementUpdate() function expected a flag to be set that indicates that
running animations on an element should yield a change in composited state for that element's layer. We did not
have code accounting for this flag in the Web Animations engine. We now have a resolveAnimationsForElement()
method on DocumentTimeline which looks at all animations resolved on the element and see if all of them are
running accelerated and whether at least one of them is pending. In that case, we set the shouldRecompositeLayer
flag in createAnimatedElementUpdate() to true which guarantees the element's layer will have a backing when
we attempt to start the animation in KeyframeEffectReadOnly::applyPendingAcceleratedActions() where we would
have previously failed to have layer-backed renderer to perform an accelerated animation on (under certain
circumstances, see test).

* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::resolveAnimationsForElement):
* animation/DocumentTimeline.h:
* animation/KeyframeEffectReadOnly.h:
(WebCore::KeyframeEffectReadOnly::hasPendingAcceleratedAction const):
* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::createAnimatedElementUpdate):

LayoutTests:

Creating a new test that runs a transition based on an explicit value being removed in favor
of the implicit value of a property that can be accelerated. To check that we indeed run the
animation, we have a cache that covers the entire range of interpolated values except for the
start and end values and wait 100ms after creating the transition to end the test. Prior to this
patch, the element would be at its start value and a 1px red line would show to the right of the
cache. With this patch, the red line is hidden by the cache as it's animated.

We also add a test that checks that we do not create a composited layer when several transitions,
with only one being potentially accelerated, target the same element.

* webanimations/accelerated-transition-by-removing-property-expected.html: Added.
* webanimations/accelerated-transition-by-removing-property.html: Added.
* webanimations/partly-accelerated-transition-by-removing-property-expected.txt: Added.
* webanimations/partly-accelerated-transition-by-removing-property.html: Added.

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

12 months ago[Curl] Test gardening
Basuke.Suzuki@sony.com [Thu, 26 Jul 2018 08:04:03 +0000 (08:04 +0000)]
[Curl] Test gardening
https://bugs.webkit.org/show_bug.cgi?id=188034

Unreviewed WinCairo gardening.

Add expected file.

* http/tests/xmlhttprequest/resources/print-referer.php: Added.
* http/tests/xmlhttprequest/simple-sync-expected.txt: Added.
* http/tests/xmlhttprequest/simple-sync.html:

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

12 months ago[JSC API] We should support the symbol type in our C/Obj-C API
Hironori.Fujii@sony.com [Thu, 26 Jul 2018 07:38:26 +0000 (07:38 +0000)]
[JSC API] We should support the symbol type in our C/Obj-C API
https://bugs.webkit.org/show_bug.cgi?id=175836

Unreviewed build fix for Windows port.

r234227 introduced a compilation error unresolved external symbol
"int __cdecl testCAPIViaCpp(void)" in testapi for Windows ports.

Windows ports are compiling testapi.c as C++ by using /TP switch.

* API/tests/testapi.c:
(main): Removed `::` prefix of ::SetErrorMode Windows API.
(dllLauncherEntryPoint): Converted into C style.
* shell/PlatformWin.cmake: Do not use /TP switch for testapi.c

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

12 months ago[Curl] Test gardening
Basuke.Suzuki@sony.com [Thu, 26 Jul 2018 03:34:57 +0000 (03:34 +0000)]
[Curl] Test gardening
https://bugs.webkit.org/show_bug.cgi?id=188034

Unreviewed WinCairo gardening.

* httpxmlhttprequest/simple-sync.html: Added.
* platform/wincairo/TestExpectations:

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

12 months ago[JSC API] We should support the symbol type in our C/Obj-C API
keith_miller@apple.com [Thu, 26 Jul 2018 02:32:25 +0000 (02:32 +0000)]
[JSC API] We should support the symbol type in our C/Obj-C API
https://bugs.webkit.org/show_bug.cgi?id=175836

Reviewed by Filip Pizlo.

This patch makes the following API additions:
1) Test if a JSValue/JSValueRef is a symbol via any of the methods API are able to test for the types of other JSValues.
2) Create a symbol on both APIs.
3) Get/Set/Delete/Define property now take ids in the Obj-C API.
4) Add Get/Set/Delete in the C API.

We can do 3 because it is both binary and source compatable with
the existing API. I added (4) because the current property access
APIs only have the ability to get Strings. It was possible to
merge symbols into JSStringRef but that felt confusing and exposes
implementation details of our engine. The new functions match the
same meaning that they have in JS, thus should be forward
compatible with any future language extensions.

Lastly, this patch adds the same availability preproccessing phase
in WebCore to JavaScriptCore, which enables TBA features for
testing on previous releases.

* API/APICast.h:
* API/JSBasePrivate.h:
* API/JSContext.h:
* API/JSContextPrivate.h:
* API/JSContextRef.h:
* API/JSContextRefInternal.h:
* API/JSContextRefPrivate.h:
* API/JSManagedValue.h:
* API/JSObjectRef.cpp:
(JSObjectHasPropertyKey):
(JSObjectGetPropertyKey):
(JSObjectSetPropertyKey):
(JSObjectDeletePropertyKey):
* API/JSObjectRef.h:
* API/JSRemoteInspector.h:
* API/JSTypedArray.h:
* API/JSValue.h:
* API/JSValue.mm:
(+[JSValue valueWithNewSymbolFromDescription:inContext:]):
(performPropertyOperation):
(-[JSValue valueForProperty:valueForProperty:]):
(-[JSValue setValue:forProperty:setValue:forProperty:]):
(-[JSValue deleteProperty:deleteProperty:]):
(-[JSValue hasProperty:hasProperty:]):
(-[JSValue defineProperty:descriptor:defineProperty:descriptor:]):
(-[JSValue isSymbol]):
(-[JSValue objectForKeyedSubscript:]):
(-[JSValue setObject:forKeyedSubscript:]):
(-[JSValue valueForProperty:]): Deleted.
(-[JSValue setValue:forProperty:]): Deleted.
(-[JSValue deleteProperty:]): Deleted.
(-[JSValue hasProperty:]): Deleted.
(-[JSValue defineProperty:descriptor:]): Deleted.
* API/JSValueRef.cpp:
(JSValueGetType):
(JSValueIsSymbol):
(JSValueMakeSymbol):
* API/JSValueRef.h:
* API/WebKitAvailability.h:
* API/tests/CurrentThisInsideBlockGetterTest.mm:
* API/tests/CustomGlobalObjectClassTest.c:
* API/tests/DateTests.mm:
* API/tests/JSExportTests.mm:
* API/tests/JSNode.c:
* API/tests/JSNodeList.c:
* API/tests/Node.c:
* API/tests/NodeList.c:
* API/tests/minidom.c:
* API/tests/testapi.c:
(main):
* API/tests/testapi.cpp: Added.
(APIString::APIString):
(APIString::~APIString):
(APIString::operator JSStringRef):
(APIContext::APIContext):
(APIContext::~APIContext):
(APIContext::operator JSGlobalContextRef):
(APIVector::APIVector):
(APIVector::~APIVector):
(APIVector::append):
(testCAPIViaCpp):
(TestAPI::evaluateScript):
(TestAPI::callFunction):
(TestAPI::functionReturnsTrue):
(TestAPI::check):
(TestAPI::checkJSAndAPIMatch):
(TestAPI::interestingObjects):
(TestAPI::interestingKeys):
(TestAPI::run):
* API/tests/testapi.mm:
(testObjectiveCAPIMain):
* JavaScriptCore.xcodeproj/project.pbxproj:
* config.h:
* postprocess-headers.sh:
* shell/CMakeLists.txt:
* testmem/testmem.mm:

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

12 months agoAllow ActiveDOMObject's canSuspend / suspend / resume overrides to destroy ActiveDOMO...
cdumez@apple.com [Thu, 26 Jul 2018 01:29:11 +0000 (01:29 +0000)]
Allow ActiveDOMObject's canSuspend / suspend / resume overrides to destroy ActiveDOMObjects
https://bugs.webkit.org/show_bug.cgi?id=188025

Reviewed by Alex Christensen.

Apply the same logic as in ScriptExecutionContext::stopActiveDOMObjects() to support destruction of
ActiveDOMObjects while we're calling ActiveDOMObject's canSuspend / suspend / resume overrides.

We copy m_activeDOMObjects into a Vector and iterate over the copy instead of m_activeDOMObjects.
Since ActiveDOMObject is not RefCounted or CanMakeWeakPtr, we verify that the raw pointer is still
valid by checking if m_activeDOMObjects still contains it, as we iterate. This is safe as the
ActiveDOMObject destructor removes the object from ScriptExecutionContext::m_activeDOMObjects.
New ActiveDOMObjects with the same pointer value cannot be created while we iterate as we already
prevent the construction of new ActiveDOMObjects while we iterate via RELEASE_ASSERT().

* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::canSuspendActiveDOMObjectsForDocumentSuspension):
(WebCore::ScriptExecutionContext::forEachActiveDOMObject const):
(WebCore::ScriptExecutionContext::suspendActiveDOMObjects):
(WebCore::ScriptExecutionContext::resumeActiveDOMObjects):
(WebCore::ScriptExecutionContext::stopActiveDOMObjects):
(WebCore::ScriptExecutionContext::willDestroyActiveDOMObject):
* dom/ScriptExecutionContext.h:

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

12 months agoSystems with no NSScreens hitting assertion in rendererIDForDisplay when creating...
commit-queue@webkit.org [Thu, 26 Jul 2018 00:34:10 +0000 (00:34 +0000)]
Systems with no NSScreens hitting assertion in rendererIDForDisplay when creating WebGL context
https://bugs.webkit.org/show_bug.cgi?id=188023
<rdar://problem/42476622>

Patch by Justin Fan <justin_fan@apple.com> on 2018-07-25
Reviewed by Simon Fraser.

On systems with no NSScreens, PlatformScreenMac's screenData map is not populated; rendererIDForDisplay
will thus hit an assertion rather than returning 0. Removing the assertion for now.

Covered by existing tests.

* platform/mac/PlatformScreenMac.mm:
(WebCore::rendererIDForDisplay):

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

12 months ago[macOS] Update sandboxes for revised OpenCL calls and streaming media
bfulgham@apple.com [Thu, 26 Jul 2018 00:29:56 +0000 (00:29 +0000)]
[macOS] Update sandboxes for revised OpenCL calls and streaming media
https://bugs.webkit.org/show_bug.cgi?id=188013
<rdar://problem/42594262>

Reviewed by Eric Carlson.

Testing logs from recent Mojave builds shows that OpenCL is checking more CPU-specific values as part of WebKit
painting operations. We need to allow these checks in the sandbox to support these more optimized drawing operations.

I also corrected some sandbox violations I found while investigating streaming media issues.

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

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

12 months agoBuild fix after r234215. Unreviewed.
zalan@apple.com [Thu, 26 Jul 2018 00:29:23 +0000 (00:29 +0000)]
Build fix after r234215. Unreviewed.

* rendering/RenderTheme.cpp:

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

12 months ago[ews-build] Add build steps DownloadBuiltProduct and ExtractBuiltProduct
aakash_jain@apple.com [Thu, 26 Jul 2018 00:22:54 +0000 (00:22 +0000)]
[ews-build] Add build steps DownloadBuiltProduct and ExtractBuiltProduct
https://bugs.webkit.org/show_bug.cgi?id=188031

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-build/steps.py:
(DownloadBuiltProduct): Added build step DownloadBuiltProduct.
(ExtractBuiltProduct): Added build step ExtractBuiltProduct.
* BuildSlaveSupport/ews-build/steps_unittest.py: Added unit-tests.

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

12 months agoWeb Inspector: Dark Mode: Breakpoint editor in JS debugger has inconsistent background
nvasilyev@apple.com [Thu, 26 Jul 2018 00:19:45 +0000 (00:19 +0000)]
Web Inspector: Dark Mode: Breakpoint editor in JS debugger has inconsistent background
https://bugs.webkit.org/show_bug.cgi?id=188026

Reviewed by Matt Baker.

* UserInterface/Views/DarkMode.css:
(@media (prefers-dark-interface)):
(.edit-breakpoint-popover-condition):
(.breakpoint-action-eval-editor):

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

12 months ago[ews-build] Add build step UploadBuiltProduct
aakash_jain@apple.com [Wed, 25 Jul 2018 23:15:23 +0000 (23:15 +0000)]
[ews-build] Add build step UploadBuiltProduct
https://bugs.webkit.org/show_bug.cgi?id=188016

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-build/steps.py:
(UploadBuiltProduct): Added build step UploadBuiltProduct.
* BuildSlaveSupport/ews-build/steps_unittest.py: Added unit-test.

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

12 months ago[ews-build] Add build step ArchiveBuiltProduct
aakash_jain@apple.com [Wed, 25 Jul 2018 23:03:21 +0000 (23:03 +0000)]
[ews-build] Add build step ArchiveBuiltProduct
https://bugs.webkit.org/show_bug.cgi?id=188014

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-build/steps.py:
(ArchiveBuiltProduct): Added build step ArchiveBuiltProduct.
* BuildSlaveSupport/ews-build/steps_unittest.py: Added unit-tests.

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

12 months agoMask AVBackgroundView to the corner radius.
commit-queue@webkit.org [Wed, 25 Jul 2018 22:51:23 +0000 (22:51 +0000)]
Mask AVBackgroundView to the corner radius.
https://bugs.webkit.org/show_bug.cgi?id=187976
rdar://problem/41810866

Patch by Jeremy Jones <jeremyj@apple.com> on 2018-07-25
Reviewed by Jon Lee.

This changes sets the appropriate mask to the layer so the corners look correct.

* UIProcess/ios/fullscreen/WKFullscreenStackView.mm:
(-[WKFullscreenStackView init]):

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

12 months agoREGRESSION(r227577) Text on TV & Movies page doesn't wrap properly in iTunes
zalan@apple.com [Wed, 25 Jul 2018 22:44:48 +0000 (22:44 +0000)]
REGRESSION(r227577) Text on TV & Movies page doesn't wrap properly in iTunes
https://bugs.webkit.org/show_bug.cgi?id=188018
<rdar://problem/42517520>

Reviewed by Dean Jackson.

Source/WebCore:

Manual rollout of r227577.

Test: fast/overflow/line-clamp-with-text-shadow.html

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
* css/CSSProperties.json:
* css/StyleBuilderCustom.h:
(WebCore::StyleBuilderCustom::applyValueWebkitLinesClamp): Deleted.
* css/parser/CSSParserContext.cpp:
(WebCore::CSSParserContext::CSSParserContext):
* css/parser/CSSParserContext.h:
(WebCore::CSSParserContextHash::hash):
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseSingleValue):
(WebCore::consumeLinesClamp): Deleted.
* page/Settings.yaml:
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::willCreateColumns const):
(WebCore::getHeightForLineCount):
(WebCore::RenderBlockFlow::heightForLineCount):
(WebCore::RenderBlockFlow::layoutExcludedChildren):
(WebCore::RenderBlockFlow::logicalHeightForLineCount): Deleted.
(WebCore::RenderBlockFlow::logicalHeightExcludingLineCount): Deleted.
* rendering/RenderBlockFlow.h:
* rendering/RenderDeprecatedFlexibleBox.cpp:
(WebCore::RenderDeprecatedFlexibleBox::applyLineClamp):
* rendering/RenderFragmentContainer.cpp:
(WebCore::RenderFragmentContainer::pageLogicalHeightForOffset const): Deleted.
* rendering/RenderFragmentContainer.h:
* rendering/RenderFragmentedFlow.cpp:
(WebCore::RenderFragmentedFlow::validateFragments):
(WebCore::RenderFragmentedFlow::pageLogicalHeightForOffset const):
(WebCore::RenderFragmentedFlow::pageRemainingLogicalHeightForOffset const):
* rendering/RenderFragmentedFlow.h:
* rendering/RenderLinesClampFlow.cpp: Removed.
* rendering/RenderLinesClampFlow.h: Removed.
* rendering/RenderLinesClampSet.cpp: Removed.
* rendering/RenderLinesClampSet.h: Removed.
* rendering/RenderMultiColumnFlow.cpp:
(WebCore::RenderMultiColumnFlow::isColumnSpanningDescendant const): Deleted.
(WebCore::RenderMultiColumnFlow::createMultiColumnSet): Deleted.
* rendering/RenderMultiColumnFlow.h:
(WebCore::RenderMultiColumnFlow::multiColumnBlockFlow const): Deleted.
(WebCore::RenderMultiColumnFlow::hasColumnSpanner const): Deleted.
(WebCore::RenderMultiColumnFlow::findColumnSpannerPlaceholder const): Deleted.
(WebCore::RenderMultiColumnFlow::columnCount const): Deleted.
(WebCore::RenderMultiColumnFlow::columnWidth const): Deleted.
(WebCore::RenderMultiColumnFlow::columnHeightAvailable const): Deleted.
(WebCore::RenderMultiColumnFlow::setColumnHeightAvailable): Deleted.
(WebCore::RenderMultiColumnFlow::inBalancingPass const): Deleted.
(WebCore::RenderMultiColumnFlow::setInBalancingPass): Deleted.
(WebCore::RenderMultiColumnFlow::needsHeightsRecalculation const): Deleted.
(WebCore::RenderMultiColumnFlow::setNeedsHeightsRecalculation): Deleted.
(WebCore::RenderMultiColumnFlow::shouldRelayoutForPagination const): Deleted.
(WebCore::RenderMultiColumnFlow::setColumnCountAndWidth): Deleted.
(WebCore::RenderMultiColumnFlow::progressionIsInline const): Deleted.
(WebCore::RenderMultiColumnFlow::setProgressionIsInline): Deleted.
(WebCore::RenderMultiColumnFlow::progressionIsReversed const): Deleted.
(WebCore::RenderMultiColumnFlow::setProgressionIsReversed): Deleted.
(WebCore::RenderMultiColumnFlow::spannerMap): Deleted.
* rendering/RenderMultiColumnSet.cpp:
(WebCore::RenderMultiColumnSet::collectLayerFragments):
(WebCore::RenderMultiColumnSet::columnTranslationForOffset const):
* rendering/RenderMultiColumnSet.h:
(WebCore::RenderMultiColumnSet::multiColumnBlockFlow const): Deleted.
(WebCore::RenderMultiColumnSet::multiColumnFlow const): Deleted.
(WebCore::RenderMultiColumnSet::logicalTopInFragmentedFlow const): Deleted.
(WebCore::RenderMultiColumnSet::logicalBottomInFragmentedFlow const): Deleted.
(WebCore::RenderMultiColumnSet::logicalHeightInFragmentedFlow const): Deleted.
(WebCore::RenderMultiColumnSet::computedColumnCount const): Deleted.
(WebCore::RenderMultiColumnSet::computedColumnWidth const): Deleted.
(WebCore::RenderMultiColumnSet::computedColumnHeight const): Deleted.
(WebCore::RenderMultiColumnSet::columnHeightComputed const): Deleted.
(WebCore::RenderMultiColumnSet::setComputedColumnWidthAndCount): Deleted.
(WebCore::RenderMultiColumnSet::updateMinimumColumnHeight): Deleted.
(WebCore::RenderMultiColumnSet::minimumColumnHeight const): Deleted.
(WebCore::RenderMultiColumnSet::forcedBreaksCount const): Deleted.
(WebCore::RenderMultiColumnSet::hasBeenFlowed const): Deleted.
(WebCore::RenderMultiColumnSet::skipLayerFragmentCollectionForColumn const): Deleted.
(WebCore::RenderMultiColumnSet::customBlockProgressionAdjustmentForColumn const): Deleted.
(WebCore::RenderMultiColumnSet::ContentRun::ContentRun): Deleted.
(WebCore::RenderMultiColumnSet::ContentRun::assumedImplicitBreaks const): Deleted.
(WebCore::RenderMultiColumnSet::ContentRun::assumeAnotherImplicitBreak): Deleted.
(WebCore::RenderMultiColumnSet::ContentRun::breakOffset const): Deleted.
(WebCore::RenderMultiColumnSet::ContentRun::columnLogicalHeight const): Deleted.
* rendering/RenderObject.h:
(WebCore::RenderObject::isRenderLinesClampFlow const): Deleted.
(WebCore::RenderObject::isRenderLinesClampSet const): Deleted.
* rendering/style/LineClampValue.h:
(WebCore::LinesClampValue::LinesClampValue): Deleted.
(WebCore::LinesClampValue::isNone const): Deleted.
(WebCore::LinesClampValue::operator== const): Deleted.
(WebCore::LinesClampValue::operator!= const): Deleted.
(WebCore::LinesClampValue::start const): Deleted.
(WebCore::LinesClampValue::end const): Deleted.
(WebCore::LinesClampValue::center const): Deleted.
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::lineClamp const):
(WebCore::RenderStyle::setLineClamp):
(WebCore::RenderStyle::initialLineClamp):
(WebCore::RenderStyle::hasInlineColumnAxis const):
(WebCore::RenderStyle::linesClamp const): Deleted.
(WebCore::RenderStyle::hasLinesClamp const): Deleted.
(WebCore::RenderStyle::setLinesClamp): Deleted.
(WebCore::RenderStyle::initialLinesClamp): Deleted.
* rendering/style/StyleRareNonInheritedData.cpp:
(WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
(WebCore::StyleRareNonInheritedData::operator== const):
* rendering/style/StyleRareNonInheritedData.h:
* rendering/updating/RenderTreeBuilderMultiColumn.cpp:
(WebCore::isValidColumnSpanner):
(WebCore::RenderTreeBuilder::MultiColumn::createFragmentedFlow):
(WebCore::RenderTreeBuilder::MultiColumn::processPossibleSpannerDescendant):

Source/WebKit:

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

LayoutTests:

* fast/block/lines-clamp-advanced-expected.html: Removed.
* fast/block/lines-clamp-advanced-rl-expected.html: Removed.
* fast/block/lines-clamp-advanced-rl.html: Removed.
* fast/block/lines-clamp-advanced.html: Removed.
* fast/block/lines-clamp-basic-expected.html: Removed.
* fast/block/lines-clamp-basic-rl-expected.html: Removed.
* fast/block/lines-clamp-basic-rl.html: Removed.
* fast/block/lines-clamp-basic.html: Removed.
* fast/css/lines-clamp-parsing-expected.txt: Removed.
* fast/css/lines-clamp-parsing.html: Removed.
* fast/overflow/line-clamp-with-text-shadow-expected.html: Added.
* fast/overflow/line-clamp-with-text-shadow.html: Added.
* platform/ios-simulator-wk2/fast/overflow/line-clamp-expected.txt: Removed.

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

12 months agoFix the build.
timothy_horton@apple.com [Wed, 25 Jul 2018 21:38:21 +0000 (21:38 +0000)]
Fix the build.

* UIProcess/mac/ServicesController.mm:
(WebKit::hasCompatibleServicesForItems):
I can't even.

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

12 months agoCrashing on some builds that don't have async NSSharingService API
timothy_horton@apple.com [Wed, 25 Jul 2018 20:56:12 +0000 (20:56 +0000)]
Crashing on some builds that don't have async NSSharingService API
https://bugs.webkit.org/show_bug.cgi?id=188015
<rdar://problem/42593935>

Reviewed by Eric Carlson.

* UIProcess/mac/ServicesController.mm:
(WebKit::hasCompatibleServicesForItems):

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

12 months agoLayout Test media/audio-concurrent-supported.html is a flaky failure.
david_fenton@apple.com [Wed, 25 Jul 2018 20:46:11 +0000 (20:46 +0000)]
Layout Test media/audio-concurrent-supported.html is a flaky failure.
https://bugs.webkit.org/show_bug.cgi?id=188017

Unreviewed test gardening.

* platform/ios-simulator-wk2/TestExpectations:

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

12 months agonavigator.userAgent may return outdated value after webView.customUserAgent is set
cdumez@apple.com [Wed, 25 Jul 2018 20:33:17 +0000 (20:33 +0000)]
navigator.userAgent may return outdated value after webView.customUserAgent is set
https://bugs.webkit.org/show_bug.cgi?id=188009
<rdar://problem/42566456>

Reviewed by Alex Christensen.

Source/WebCore:

Invalidate the navigator.userAgent cache whenever the user agent gets changed to avoid exposing
outdated values to JavaScript.

* page/Navigator.cpp:
(WebCore::Navigator::userAgentChanged):
* page/Navigator.h:
* page/NavigatorID.idl:
* page/Page.cpp:
(WebCore::Page::userAgentChanged):
* page/Page.h:

Source/WebKit:

Let the page know when the user agent changes.

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

Source/WebKitLegacy/mac:

Let the page know when the user agent changes.

* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):
(-[WebView setApplicationNameForUserAgent:]):
(-[WebView _invalidateUserAgentCache]):
(-[WebView setCustomUserAgent:]):
* WebView/WebViewInternal.h:

Tools:

Add API test coverage.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKitCocoa/CustomUserAgent.mm: Added.
(TEST):

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

12 months agoUse CompletionHandler for policy decisions
achristensen@apple.com [Wed, 25 Jul 2018 18:32:00 +0000 (18:32 +0000)]
Use CompletionHandler for policy decisions
https://bugs.webkit.org/show_bug.cgi?id=187975

Reviewed by Chris Dumez.

* UIProcess/WebFramePolicyListenerProxy.cpp:
(WebKit::WebFramePolicyListenerProxy::WebFramePolicyListenerProxy):
(WebKit::WebFramePolicyListenerProxy::use):
(WebKit::WebFramePolicyListenerProxy::download):
(WebKit::WebFramePolicyListenerProxy::ignore):
(WebKit::WebFramePolicyListenerProxy::receivedPolicyDecision): Deleted.
(WebKit::WebFramePolicyListenerProxy::setNavigation): Deleted.
* UIProcess/WebFramePolicyListenerProxy.h:
(WebKit::WebFramePolicyListenerProxy::create):
(WebKit::WebFramePolicyListenerProxy::policyListenerType const): Deleted.
(WebKit::WebFramePolicyListenerProxy::listenerID const): Deleted.
(): Deleted.
* UIProcess/WebFrameProxy.cpp:
(WebKit::WebFrameProxy::setUpPolicyListenerProxy):
(WebKit::WebFrameProxy::receivedPolicyDecision): Deleted.
(WebKit::WebFrameProxy::activePolicyListenerProxy): Deleted.
(WebKit::WebFrameProxy::changeWebsiteDataStore): Deleted.
* UIProcess/WebFrameProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::receivedPolicyDecision):
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
(WebKit::WebPageProxy::decidePolicyForNewWindowAction):
(WebKit::WebPageProxy::decidePolicyForResponse):
* UIProcess/WebPageProxy.h:

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

12 months agoUnreviewed, rolling out r234196.
commit-queue@webkit.org [Wed, 25 Jul 2018 18:04:51 +0000 (18:04 +0000)]
Unreviewed, rolling out r234196.
https://bugs.webkit.org/show_bug.cgi?id=188011

broke API tests (Requested by alexchristensen on #webkit).

Reverted changeset:

"Use CompletionHandler for policy decisions"
https://bugs.webkit.org/show_bug.cgi?id=187975
https://trac.webkit.org/changeset/234196

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

12 months ago[INTL] Call Typed Array elements toLocaleString with locale and options
commit-queue@webkit.org [Wed, 25 Jul 2018 17:54:17 +0000 (17:54 +0000)]
[INTL] Call Typed Array elements toLocaleString with locale and options
https://bugs.webkit.org/show_bug.cgi?id=185796

Patch by Andy VanWagoner <andy@vanwagoner.family> on 2018-07-25
Reviewed by Keith Miller.

JSTests:

Remove now passing TypedArray toLocaleString expectation.

* test262/expectations.yaml:

Source/JavaScriptCore:

Improve ECMA 402 compliance of typed array toLocaleString, passing along
the locale and options to element toLocaleString calls.

* builtins/TypedArrayPrototype.js:
(toLocaleString):

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

12 months agoUnreviewed, rolling out r234187.
david_fenton@apple.com [Wed, 25 Jul 2018 17:10:10 +0000 (17:10 +0000)]
Unreviewed, rolling out r234187.

the layout test added with this change is flaky on the bots

Reverted changeset:

"Animation stops with object-fit:contain on an animated 2d
canvas"
https://bugs.webkit.org/show_bug.cgi?id=187840
https://trac.webkit.org/changeset/234187

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

12 months ago[INTL] Intl constructor lengths should be configurable
commit-queue@webkit.org [Wed, 25 Jul 2018 17:02:28 +0000 (17:02 +0000)]
[INTL] Intl constructor lengths should be configurable
https://bugs.webkit.org/show_bug.cgi?id=187960

Patch by Andy VanWagoner <andy@vanwagoner.family> on 2018-07-25
Reviewed by Saam Barati.

JSTests:

Removed fixed length expectations, and updated Intl.Locale expectations
that error differently since r234127.

* test262/expectations.yaml:

Source/JavaScriptCore:

Removed DontDelete from Intl constructor lengths.
Fixed DateTimeFormat formatToParts length.

* runtime/IntlCollatorConstructor.cpp:
(JSC::IntlCollatorConstructor::finishCreation):
* runtime/IntlDateTimeFormatConstructor.cpp:
(JSC::IntlDateTimeFormatConstructor::finishCreation):
* runtime/IntlDateTimeFormatPrototype.cpp:
(JSC::IntlDateTimeFormatPrototype::finishCreation):
* runtime/IntlNumberFormatConstructor.cpp:
(JSC::IntlNumberFormatConstructor::finishCreation):
* runtime/IntlPluralRulesConstructor.cpp:
(JSC::IntlPluralRulesConstructor::finishCreation):

LayoutTests:

Expect DateTimeFormat formatToParts length to be 1.

* js/intl-datetimeformat-expected.txt:
* js/script-tests/intl-datetimeformat.js:

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

12 months ago[Flatpak] Pass more environment variables to sandbox
cturner@igalia.com [Wed, 25 Jul 2018 16:59:12 +0000 (16:59 +0000)]
[Flatpak] Pass more environment variables to sandbox
https://bugs.webkit.org/show_bug.cgi?id=188002

Reviewed by Michael Catanzaro.

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

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

12 months agoTurn assertion preventing removal of ActiveDOMObjects while we iterate over them...
cdumez@apple.com [Wed, 25 Jul 2018 16:12:43 +0000 (16:12 +0000)]
Turn assertion preventing removal of ActiveDOMObjects while we iterate over them into a RELEASE_ASSERT
https://bugs.webkit.org/show_bug.cgi?id=187978

Reviewed by Eric Carlson.

Turn assertion preventing removal of ActiveDOMObjects while we iterate over them into a RELEASE_ASSERT.
If code does this, this leads to hard to investigate crashes such as rdar://problem/42160890. With a
release assertion, we would find the culprits right away. The assertion guarding against addition of
ActiveDOMObjects while we iterate is already a RELEASE_ASSERT.

* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::canSuspendActiveDOMObjectsForDocumentSuspension):
(WebCore::ScriptExecutionContext::suspendActiveDOMObjects):
(WebCore::ScriptExecutionContext::resumeActiveDOMObjects):
(WebCore::ScriptExecutionContext::willDestroyActiveDOMObject):
* dom/ScriptExecutionContext.h:

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

12 months agoUse CompletionHandler for policy decisions
commit-queue@webkit.org [Wed, 25 Jul 2018 16:07:55 +0000 (16:07 +0000)]
Use CompletionHandler for policy decisions
https://bugs.webkit.org/show_bug.cgi?id=187975

Patch by Alex Christensen <achristensen@webkit.org> on 2018-07-25
Reviewed by Chris Dumez.

* UIProcess/WebFramePolicyListenerProxy.cpp:
(WebKit::WebFramePolicyListenerProxy::WebFramePolicyListenerProxy):
(WebKit::WebFramePolicyListenerProxy::use):
(WebKit::WebFramePolicyListenerProxy::download):
(WebKit::WebFramePolicyListenerProxy::ignore):
(WebKit::WebFramePolicyListenerProxy::receivedPolicyDecision): Deleted.
(WebKit::WebFramePolicyListenerProxy::setNavigation): Deleted.
* UIProcess/WebFramePolicyListenerProxy.h:
(WebKit::WebFramePolicyListenerProxy::create):
(WebKit::WebFramePolicyListenerProxy::policyListenerType const): Deleted.
(WebKit::WebFramePolicyListenerProxy::listenerID const): Deleted.
(): Deleted.
* UIProcess/WebFrameProxy.cpp:
(WebKit::WebFrameProxy::setUpPolicyListenerProxy):
(WebKit::WebFrameProxy::receivedPolicyDecision): Deleted.
(WebKit::WebFrameProxy::activePolicyListenerProxy): Deleted.
(WebKit::WebFrameProxy::changeWebsiteDataStore): Deleted.
* UIProcess/WebFrameProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::receivedPolicyDecision):
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
(WebKit::WebPageProxy::decidePolicyForNewWindowAction):
(WebKit::WebPageProxy::decidePolicyForResponse):
* UIProcess/WebPageProxy.h:

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

12 months ago[macOS] PluginProcess needs TCC entitlements for media capture
bfulgham@apple.com [Wed, 25 Jul 2018 15:47:43 +0000 (15:47 +0000)]
[macOS] PluginProcess needs TCC entitlements for media capture
https://bugs.webkit.org/show_bug.cgi?id=187981
<rdar://problem/42433634>

Reviewed by Chris Dumez.

The changes needed in Bug 185526 are also needed for the plugin process, or else the UIProcess
(e.g., Safari) is not able to pass the user's camera/microphone access permission to the plugin process.

This patch has the following changes:

1. Rename "WebContent-OSX-restricted.entitlements" to "WebContent-or-Plugin-OSX-restricted.entitlements"
2. Rename "process-webcontent-entitlements.sh" to "process-webcontent-or-plugin-entitlements.sh"
3. Add a run-script step to the Plugin.64 and Plugin.32 builds to add the relevant entitlements.
4. Silence some Flash plugin sandbox exceptions triggered after activating the camera.

* Configurations/WebContent-or-Plugin-OSX-restricted.entitlements: Renamed from Source/WebKit/Configurations/WebContent-OSX-restricted.entitlements.
* Resources/PlugInSandboxProfiles/com.macromedia.Flash Player ESR.plugin.sb: Address sandbox violations needed by camera use.
* Resources/PlugInSandboxProfiles/com.macromedia.Flash Player.plugin.sb: Ditto.
* Scripts/process-webcontent-or-plugin-entitlements.sh: Renamed from Source/WebKit/Scripts/process-webcontent-entitlements.sh.
* WebKit.xcodeproj/project.pbxproj: Update for renaming, and perform entitlement steps on Plugin process.

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

12 months ago[GTK][WPE] Unreviewed test gardening
Ms2ger@igalia.com [Wed, 25 Jul 2018 15:43:44 +0000 (15:43 +0000)]
[GTK][WPE] Unreviewed test gardening
https://bugs.webkit.org/show_bug.cgi?id=188003

Unreviewed test gardening.

* platform/gtk/TestExpectations:
  - webgl/2.0.0/conformance2/glsl3/: skip while we disable WebGL2 support
  - media/video-restricted-invisible-autoplay-allowed-when-visible.html: mark as flaky
  - compositing/backing/backing-store-attachment-fill-forwards-animation.html: mark as failing
  - http/tests/security/canvas-remote-read-remote-video-hls.html: mark as failing
* platform/wpe/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/addition-per-property-expected.txt:
  Update for r233935.

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

12 months ago[WPE] Switch ViewBackend to using wpe_view_backend_exportable_fdo_egl APIs
zandobersek@gmail.com [Wed, 25 Jul 2018 13:26:05 +0000 (13:26 +0000)]
[WPE] Switch ViewBackend to using wpe_view_backend_exportable_fdo_egl APIs
https://bugs.webkit.org/show_bug.cgi?id=187997

Reviewed by Carlos Garcia Campos.

Instead of the raw wpe_view_backend_exportable_fdo API, switch to using
the EGL-oriented API that simply serves EGLImageKHR objects instead of
raw buffer resources. This allows us not to wrangle with creating and
managing lifetime of the same EGLImageKHR by ourselves.

ViewBackend now defines a wpe_view_backend_exportable_fdo_egl_client
struct and uses wpe_view_backend_exportable_fdo_egl_create() to create
the exportable object. This means that for each frame we're served an
EGLImageKHR object that is passed on to the displayBuffer()
implementation.

HeadlessViewBackend now just manages the pending and committed image
objects. Width and height values used during pixel data retrieval are
gathered from the ViewBackend's size that was specified when
constructed.

WindowViewBackend similarly only manages the committed image object,
not having to create an equivalent EGLImageKHR object from the raw
buffer resource anymore.

Unused EGL entrypoints in both HeadlessViewBackend and WindowViewBackend
classes are removed, and destructors for both classes are made virtual.

The WPEBackend-fdo version is bumped in order to have the EGL-specific
export API available.

* flatpak/org.webkit.WPE.yaml:
* wpe/backends/HeadlessViewBackend.cpp:
(WPEToolingBackends::HeadlessViewBackend::HeadlessViewBackend):
(WPEToolingBackends::HeadlessViewBackend::~HeadlessViewBackend):
(WPEToolingBackends::HeadlessViewBackend::createSnapshot):
(WPEToolingBackends::HeadlessViewBackend::performUpdate):
(WPEToolingBackends::HeadlessViewBackend::displayBuffer):
* wpe/backends/HeadlessViewBackend.h:
* wpe/backends/ViewBackend.cpp:
(WPEToolingBackends::ViewBackend::initialize):
* wpe/backends/ViewBackend.h:
* wpe/backends/WindowViewBackend.cpp:
(WPEToolingBackends::WindowViewBackend::WindowViewBackend):
(WPEToolingBackends::WindowViewBackend::~WindowViewBackend):
(WPEToolingBackends::WindowViewBackend::displayBuffer):
* wpe/backends/WindowViewBackend.h:
* wpe/jhbuild.modules:

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

12 months agoCorrectly close the variable argument list
tpopela@redhat.com [Wed, 25 Jul 2018 07:11:21 +0000 (07:11 +0000)]
Correctly close the variable argument list
https://bugs.webkit.org/show_bug.cgi?id=186758

Reviewed by Michael Catanzaro.

The argcCopy is not ended when we early return. Also don't call
va_end() on args because it's closed in caller.

* wtf/text/WTFString.cpp:
(WTF::createWithFormatAndArguments):

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

12 months agorunJITThreadLimitTests is failing
Hironori.Fujii@sony.com [Wed, 25 Jul 2018 05:29:42 +0000 (05:29 +0000)]
runJITThreadLimitTests is failing
https://bugs.webkit.org/show_bug.cgi?id=187886
<rdar://problem/42561966>

Unreviewed build fix for MSVC.

MSVC doen't support ternary operator without second operand.

* dfg/DFGWorklist.cpp:
(JSC::DFG::getNumberOfDFGCompilerThreads):
(JSC::DFG::getNumberOfFTLCompilerThreads):

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

12 months agoHAVE(PARENTAL_CONTROLS) should be true on watchOS
timothy_horton@apple.com [Wed, 25 Jul 2018 05:16:56 +0000 (05:16 +0000)]
HAVE(PARENTAL_CONTROLS) should be true on watchOS
https://bugs.webkit.org/show_bug.cgi?id=187985
<rdar://problem/42559346>

Reviewed by Andy Estes.

* wtf/Platform.h:

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

12 months agoREGRESSION (r219757): Accessing response getter of XHR instance from IFRAME sets...
cdumez@apple.com [Wed, 25 Jul 2018 04:47:39 +0000 (04:47 +0000)]
REGRESSION (r219757): Accessing response getter of XHR instance from IFRAME sets constructor to Object from the IFRAME
https://bugs.webkit.org/show_bug.cgi?id=187411
<rdar://problem/41920593>

Reviewed by Sam Weinig.

Source/WebCore:

Update JSXMLHttpRequest::response() to use the XMLHttpRequest's global object exec when constructing a JSONObject
for the response instead of the caller's exec.

Test: http/tests/xmlhttprequest/xhr-response-constructor-subframe.html

* bindings/js/JSXMLHttpRequestCustom.cpp:
(WebCore::JSXMLHttpRequest::response const):

LayoutTests:

Add layout test coverage. I have verified locally that it passes in Chromium as well.

* http/tests/xmlhttprequest/resources/data.json: Added.
* http/tests/xmlhttprequest/resources/xhr-response-constructor-iframe.html: Added.
* http/tests/xmlhttprequest/xhr-response-constructor-subframe-expected.txt: Added.
* http/tests/xmlhttprequest/xhr-response-constructor-subframe.html: Added.

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

12 months agoAnimation stops with object-fit:contain on an animated 2d canvas
simon.fraser@apple.com [Wed, 25 Jul 2018 04:09:47 +0000 (04:09 +0000)]
Animation stops with object-fit:contain on an animated 2d canvas
https://bugs.webkit.org/show_bug.cgi?id=187840

Reviewed by Zalan Bujtas.
Source/WebCore:

If a canvas has object-fit: cover or contain, repaints need to mapped through
the rect that is used to position the canvas in the element bounds, which is replacedContentRect().

Add a version of replacedContentRect() that doesn't require passing the intrinsicSize() since
all but RenderVideo just pass the RenderReplaced's intrinsicSize.

Test: fast/repaint/canvas-object-fit.html

* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::didDraw):
* rendering/RenderHTMLCanvas.cpp:
(WebCore::RenderHTMLCanvas::paintReplaced):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::updateInnerContentRect):
(WebCore::RenderImage::paintReplaced):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::contentsBox const):
* rendering/RenderReplaced.h:
(WebCore::RenderReplaced::replacedContentRect const):
* rendering/shapes/ShapeOutsideInfo.cpp:
(WebCore::ShapeOutsideInfo::createShapeForImage const):

LayoutTests:

* fast/repaint/canvas-object-fit-expected.txt: Added.
* fast/repaint/canvas-object-fit.html: Added.

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

12 months ago[Curl] Add support for wss:// websockets
Basuke.Suzuki@sony.com [Wed, 25 Jul 2018 03:31:52 +0000 (03:31 +0000)]
[Curl] Add support for wss:// websockets
https://bugs.webkit.org/show_bug.cgi?id=172630

Reviewed by Fujii Hironori.

Source/WebCore:

To support secure WebSocket connection, it is almost rewritten by using existing
backend for CurlHandle to handle TLS connection and proxy support.

Test: http/tests/websocket/tests/hybi/simple-wss.html

* platform/network/curl/CurlContext.cpp:
(WebCore::CurlSocketHandle::CurlSocketHandle):
(WebCore::CurlSocketHandle::connect):
(WebCore::CurlSocketHandle::send):
(WebCore::CurlSocketHandle::receive):
(WebCore::CurlSocketHandle::wait):
* platform/network/curl/CurlContext.h:
* platform/network/curl/SocketStreamHandleImpl.h:
(WebCore::SocketStreamHandleImpl::SocketData::SocketData): Deleted.
* platform/network/curl/SocketStreamHandleImplCurl.cpp:
(WebCore::SocketStreamHandleImpl::SocketStreamHandleImpl):
(WebCore::SocketStreamHandleImpl::~SocketStreamHandleImpl):
(WebCore::SocketStreamHandleImpl::platformSendInternal):
(WebCore::SocketStreamHandleImpl::platformClose):
(WebCore::SocketStreamHandleImpl::threadEntryPoint):
(WebCore::SocketStreamHandleImpl::handleError):
(WebCore::SocketStreamHandleImpl::stopThread):
(WebCore::createCopy): Deleted.
(WebCore::SocketStreamHandleImpl::readData): Deleted.
(WebCore::SocketStreamHandleImpl::sendData): Deleted.
(WebCore::SocketStreamHandleImpl::waitForAvailableData): Deleted.
(WebCore::SocketStreamHandleImpl::startThread): Deleted.
(WebCore::SocketStreamHandleImpl::didReceiveData): Deleted.
(WebCore::SocketStreamHandleImpl::didOpenSocket): Deleted.

LayoutTests:

Pass simple-wss.html.

* platform/wincairo/TestExpectations:

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

12 months agoRevert back to using phys_footprint to calculate isUnderMemoryPressure()
sbarati@apple.com [Wed, 25 Jul 2018 02:09:46 +0000 (02:09 +0000)]
Revert back to using phys_footprint to calculate isUnderMemoryPressure()
https://bugs.webkit.org/show_bug.cgi?id=187919
<rdar://problem/42552888>

Reviewed by Simon Fraser.

Currently on iOS, bmalloc will run the scavenger more frequently when it detects
that the process is under memory pressure. However, it only uses bmalloc's
own footprint as a percentage of the HW available memory to determine if
the process is under memory pressure. This is a change I recently made
in an effort to run the scavenger less when bmalloc wasn't contributing
to the dirty footprint in the process. However, this fails to run the
scavenger eagerly when the process in question has a heap split
between a lot of dirty bmalloc memory as well as a lot of dirty memory
from elsewhere. We also have evidence that we may have increased jetsams
in the Web Content process. Since my original change was not a measurable
speedup, this patch reverts isUnderMemoryPressure() to its previous
behavior of using phys_footprint to determine if 75% of the available
HW memory is being used.

* bmalloc/AvailableMemory.cpp:
(bmalloc::memoryStatus):

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

12 months agoUnreviewed, rolling out r234183.
commit-queue@webkit.org [Wed, 25 Jul 2018 01:53:41 +0000 (01:53 +0000)]
Unreviewed, rolling out r234183.
https://bugs.webkit.org/show_bug.cgi?id=187983

cause regression in Kraken gaussian blur and desaturate
(Requested by yusukesuzuki on #webkit).

Reverted changeset:

"[JSC] Record CoW status in ArrayProfile"
https://bugs.webkit.org/show_bug.cgi?id=187949
https://trac.webkit.org/changeset/234183

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

12 months ago[JSC] Record CoW status in ArrayProfile
utatane.tea@gmail.com [Wed, 25 Jul 2018 00:41:10 +0000 (00:41 +0000)]
[JSC] Record CoW status in ArrayProfile
https://bugs.webkit.org/show_bug.cgi?id=187949

Reviewed by Saam Barati.

JSTests:

* stress/array-profile-should-record-copy-on-write.js: Added.
(shouldBe):
(test1):
(test2):
(test3):

Source/JavaScriptCore:

Once CoW array is converted to non-CoW array, subsequent operations are done for this non-CoW array.
Even though these operations are performed onto both CoW and non-CoW arrays in the code, array profiles
in these code typically record only non-CoW arrays since array profiles hold only one StructureID recently
seen. This results emitting CheckStructure for non-CoW arrays in DFG, and it soon causes OSR exits due to
CoW arrays.

In this patch, we record CoW status in ArrayProfile separately to construct more appropriate DFG::ArrayMode
speculation. To do so efficiently, we store union of seen IndexingMode in ArrayProfile.

This patch removes one of Kraken/stanford-crypto-aes's OSR exit reason, and improves the performance by 6-7%.

                              baseline                  patched

stanford-crypto-aes        60.893+-1.346      ^      57.412+-1.298         ^ definitely 1.0606x faster
stanford-crypto-ccm        62.124+-1.992             58.921+-1.844           might be 1.0544x faster

* bytecode/ArrayProfile.cpp:
(JSC::ArrayProfile::briefDescriptionWithoutUpdating):
* bytecode/ArrayProfile.h:
(JSC::asArrayModes):
We simplify asArrayModes instead of giving up Int8ArrayMode - Float64ArrayMode contiguous sequence.

(JSC::ArrayProfile::ArrayProfile):
(JSC::ArrayProfile::addressOfObservedIndexingModes):
(JSC::ArrayProfile::observedIndexingModes const):
Currently, our macro assembler and offlineasm only support `or32` / `ori` operation onto addresses.
So storing the union of seen IndexingMode in `unsigned` instead.

* dfg/DFGArrayMode.cpp:
(JSC::DFG::ArrayMode::fromObserved):
* dfg/DFGArrayMode.h:
(JSC::DFG::ArrayMode::withProfile const):
* jit/JITCall.cpp:
(JSC::JIT::compileOpCall):
* jit/JITCall32_64.cpp:
(JSC::JIT::compileOpCall):
* jit/JITInlines.h:
(JSC::JIT::emitArrayProfilingSiteWithCell):
* llint/LowLevelInterpreter.asm:
* llint/LowLevelInterpreter32_64.asm:
* llint/LowLevelInterpreter64.asm:

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

12 months agoRemove support for the double type from WHLSL
commit-queue@webkit.org [Wed, 25 Jul 2018 00:21:18 +0000 (00:21 +0000)]
Remove support for the double type from WHLSL
https://bugs.webkit.org/show_bug.cgi?id=187977

Patch by Thomas Denney <tdenney@apple.com> on 2018-07-24
Reviewed by Myles C. Maxfield.

* WebGPUShadingLanguageRI/All.js: Removed DoubleLiteral.js and DoubleLiteralType.js include.
* WebGPUShadingLanguageRI/DoubleLiteral.js: Removed.
* WebGPUShadingLanguageRI/DoubleLiteralType.js: Removed.
* WebGPUShadingLanguageRI/Intrinsics.js: Removed double arithmetic functions.
* WebGPUShadingLanguageRI/Parse.js:
(parseTerm): Removed parsing of double literals.
* WebGPUShadingLanguageRI/SPIRV.html: Removed DoubleLiteral.js and DoubleLiteralType.js include.
* WebGPUShadingLanguageRI/SPIRVCodegen.js: Removed double type logic.
* WebGPUShadingLanguageRI/StandardLibrary.js: Removed double type declarations.
* WebGPUShadingLanguageRI/Test.html: Removed DoubleLiteral.js and DoubleLiteralType.js include.
* WebGPUShadingLanguageRI/Test.js: Removed tests that test doubles or ported them to use floats.
* WebGPUShadingLanguageRI/index.html: Removed DoubleLiteral.js and DoubleLiteralType.js include.

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

12 months agoEnable Web Content Filtering on watchOS
timothy_horton@apple.com [Wed, 25 Jul 2018 00:18:32 +0000 (00:18 +0000)]
Enable Web Content Filtering on watchOS
https://bugs.webkit.org/show_bug.cgi?id=187979
<rdar://problem/42559346>

Reviewed by Wenson Hsieh.

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore/PAL:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit:

* Configurations/FeatureDefines.xcconfig:

Source/WebKitLegacy/mac:

* Configurations/FeatureDefines.xcconfig:

Tools:

* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:

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

12 months agoDon't modify Options when setting JIT thread limits
tzagallo@apple.com [Tue, 24 Jul 2018 23:42:23 +0000 (23:42 +0000)]
Don't modify Options when setting JIT thread limits
https://bugs.webkit.org/show_bug.cgi?id=187886

Reviewed by Filip Pizlo.

Previously, when setting the JIT thread limit prior to the worklist
initialization, it'd be set via Options, which didn't work if Options
hadn't been initialized yet. Change it to use a static variable in the
Worklist instead.

* API/JSVirtualMachine.mm:
(+[JSVirtualMachine setNumberOfDFGCompilerThreads:]):
(+[JSVirtualMachine setNumberOfFTLCompilerThreads:]):
* API/tests/testapi.mm:
(testObjectiveCAPIMain):
* dfg/DFGWorklist.cpp:
(JSC::DFG::getNumberOfDFGCompilerThreads):
(JSC::DFG::getNumberOfFTLCompilerThreads):
(JSC::DFG::setNumberOfDFGCompilerThreads):
(JSC::DFG::setNumberOfFTLCompilerThreads):
(JSC::DFG::ensureGlobalDFGWorklist):
(JSC::DFG::ensureGlobalFTLWorklist):
* dfg/DFGWorklist.h:

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

12 months agoMove-constructing NeverDestroyed should move construct underlying object instead...
dbates@webkit.org [Tue, 24 Jul 2018 23:29:50 +0000 (23:29 +0000)]
Move-constructing NeverDestroyed should move construct underlying object instead of copy constructing it
https://bugs.webkit.org/show_bug.cgi?id=187971

Reviewed by Saam Barati.

Source/WTF:

Fixes an issue where move constructing a NeverDestroyed<T> would always copy construct T into
the destination storage buffer regardless of whether T is move constructable. For example:

{
    static NeverDestroyed<T> x;
    static NeverDestroyed<T> y { WTFMove(x) }; // currently makes a copy of x's T even if T is move constructable
}

Currently the NeverDestroyed<T> instantiates T into the destination storage buffer by WTFMove()ing
the NeverDestroyed<T> into it, implicitly converting it to const T& by way of const T& conversion
operator. As a result the compiler picks the copy constructor for T to invoke instead of evaluating
whether T can be move constructed. Instead we should explicitly WTFMove() the underlying T so that
the compiler can choose to either move-construct T or copy construct it.

A side benefit of this change it is now possible to invoke makeNeverDestroyed() with the result
of a function that returns a move-only type (e.g. RenderStyle):

static auto sharedStyle = makeNeverDestroyed([] {
    auto style = RenderStyle::create();
    ...
    return style;
}());

* wtf/NeverDestroyed.h:
(WTF::NeverDestroyed::NeverDestroyed):

Tools:

Add unit tests to cover move constructing a NeverDestroyed with a non-const and const data type
as well as invoking makeNeverDestroyed() with the result of a function that returns a move-only
data type.

* TestWebKitAPI/CMakeLists.txt:
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WTF/MoveOnlyLifecycleLogger.cpp: Added.
(TestWebKitAPI::MoveOnlyLifecycleLogger::MoveOnlyLifecycleLogger):
(TestWebKitAPI::MoveOnlyLifecycleLogger::~MoveOnlyLifecycleLogger):
(TestWebKitAPI::MoveOnlyLifecycleLogger::operator=):
(TestWebKitAPI::MoveOnlyLifecycleLogger::setName):
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WTF/MoveOnlyLifecycleLogger.h: Added.
* TestWebKitAPI/Tests/WTF/NeverDestroyed.cpp:
(TestWebKitAPI::TEST):

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

12 months agoRefactoring: make DFG::Plan a class.
mark.lam@apple.com [Tue, 24 Jul 2018 23:14:12 +0000 (23:14 +0000)]
Refactoring: make DFG::Plan a class.
https://bugs.webkit.org/show_bug.cgi?id=187968

Reviewed by Saam Barati.

This patch makes all the DFG::Plan fields private, and provide accessor methods
for them.  This makes it easier to reason about how these fields are used and
modified.

* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleCall):
(JSC::DFG::ByteCodeParser::handleVarargsCall):
(JSC::DFG::ByteCodeParser::handleInlining):
(JSC::DFG::ByteCodeParser::handleIntrinsicCall):
(JSC::DFG::ByteCodeParser::handleDOMJITGetter):
(JSC::DFG::ByteCodeParser::handleModuleNamespaceLoad):
(JSC::DFG::ByteCodeParser::handleGetById):
(JSC::DFG::ByteCodeParser::handlePutById):
(JSC::DFG::ByteCodeParser::parseBlock):
(JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry):
(JSC::DFG::ByteCodeParser::parseCodeBlock):
(JSC::DFG::ByteCodeParser::parse):
* dfg/DFGCFAPhase.cpp:
(JSC::DFG::CFAPhase::run):
(JSC::DFG::CFAPhase::injectOSR):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGCommonData.cpp:
(JSC::DFG::CommonData::notifyCompilingStructureTransition):
* dfg/DFGCommonData.h:
* dfg/DFGConstantFoldingPhase.cpp:
(JSC::DFG::ConstantFoldingPhase::foldConstants):
* dfg/DFGDriver.cpp:
(JSC::DFG::compileImpl):
* dfg/DFGFinalizer.h:
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
(JSC::DFG::FixupPhase::fixupCompareStrictEqAndSameValue):
* dfg/DFGGraph.cpp:
(JSC::DFG::Graph::Graph):
(JSC::DFG::Graph::watchCondition):
(JSC::DFG::Graph::inferredTypeFor):
(JSC::DFG::Graph::requiredRegisterCountForExit):
(JSC::DFG::Graph::registerFrozenValues):
(JSC::DFG::Graph::registerStructure):
(JSC::DFG::Graph::registerAndWatchStructureTransition):
(JSC::DFG::Graph::assertIsRegistered):
* dfg/DFGGraph.h:
(JSC::DFG::Graph::compilation):
(JSC::DFG::Graph::identifiers):
(JSC::DFG::Graph::watchpoints):
* dfg/DFGJITCompiler.cpp:
(JSC::DFG::JITCompiler::JITCompiler):
(JSC::DFG::JITCompiler::link):
(JSC::DFG::JITCompiler::compile):
(JSC::DFG::JITCompiler::compileFunction):
(JSC::DFG::JITCompiler::disassemble):
* dfg/DFGJITCompiler.h:
(JSC::DFG::JITCompiler::addWeakReference):
* dfg/DFGJITFinalizer.cpp:
(JSC::DFG::JITFinalizer::finalize):
(JSC::DFG::JITFinalizer::finalizeFunction):
(JSC::DFG::JITFinalizer::finalizeCommon):
* dfg/DFGOSREntrypointCreationPhase.cpp:
(JSC::DFG::OSREntrypointCreationPhase::run):
* dfg/DFGPhase.cpp:
(JSC::DFG::Phase::beginPhase):
* dfg/DFGPhase.h:
(JSC::DFG::runAndLog):
* dfg/DFGPlan.cpp:
(JSC::DFG::Plan::Plan):
(JSC::DFG::Plan::computeCompileTimes const):
(JSC::DFG::Plan::reportCompileTimes const):
(JSC::DFG::Plan::compileInThread):
(JSC::DFG::Plan::compileInThreadImpl):
(JSC::DFG::Plan::isStillValid):
(JSC::DFG::Plan::reallyAdd):
(JSC::DFG::Plan::notifyCompiling):
(JSC::DFG::Plan::notifyReady):
(JSC::DFG::Plan::finalizeWithoutNotifyingCallback):
(JSC::DFG::Plan::finalizeAndNotifyCallback):
(JSC::DFG::Plan::key):
(JSC::DFG::Plan::checkLivenessAndVisitChildren):
(JSC::DFG::Plan::finalizeInGC):
(JSC::DFG::Plan::isKnownToBeLiveDuringGC):
(JSC::DFG::Plan::cancel):
(JSC::DFG::Plan::cleanMustHandleValuesIfNecessary):
* dfg/DFGPlan.h:
(JSC::DFG::Plan::canTierUpAndOSREnter const):
(JSC::DFG::Plan::vm const):
(JSC::DFG::Plan::codeBlock):
(JSC::DFG::Plan::mode const):
(JSC::DFG::Plan::osrEntryBytecodeIndex const):
(JSC::DFG::Plan::mustHandleValues const):
(JSC::DFG::Plan::threadData const):
(JSC::DFG::Plan::compilation const):
(JSC::DFG::Plan::finalizer const):
(JSC::DFG::Plan::setFinalizer):
(JSC::DFG::Plan::inlineCallFrames const):
(JSC::DFG::Plan::watchpoints):
(JSC::DFG::Plan::identifiers):
(JSC::DFG::Plan::weakReferences):
(JSC::DFG::Plan::transitions):
(JSC::DFG::Plan::recordedStatuses):
(JSC::DFG::Plan::willTryToTierUp const):
(JSC::DFG::Plan::setWillTryToTierUp):
(JSC::DFG::Plan::tierUpInLoopHierarchy):
(JSC::DFG::Plan::tierUpAndOSREnterBytecodes):
(JSC::DFG::Plan::stage const):
(JSC::DFG::Plan::callback const):
(JSC::DFG::Plan::setCallback):
* dfg/DFGPlanInlines.h:
(JSC::DFG::Plan::iterateCodeBlocksForGC):
* dfg/DFGPreciseLocalClobberize.h:
(JSC::DFG::PreciseLocalClobberizeAdaptor::readTop):
* dfg/DFGPredictionInjectionPhase.cpp:
(JSC::DFG::PredictionInjectionPhase::run):
* dfg/DFGSafepoint.cpp:
(JSC::DFG::Safepoint::Safepoint):
(JSC::DFG::Safepoint::~Safepoint):
(JSC::DFG::Safepoint::begin):
* dfg/DFGSafepoint.h:
* dfg/DFGSpeculativeJIT.h:
(JSC::DFG::SpeculativeJIT::TrustedImmPtr::weakPointer):
(JSC::DFG::SpeculativeJIT::TrustedImmPtr::weakPoisonedPointer):
* dfg/DFGStackLayoutPhase.cpp:
(JSC::DFG::StackLayoutPhase::run):
* dfg/DFGStrengthReductionPhase.cpp:
(JSC::DFG::StrengthReductionPhase::handleNode):
* dfg/DFGTierUpCheckInjectionPhase.cpp:
(JSC::DFG::TierUpCheckInjectionPhase::run):
* dfg/DFGTypeCheckHoistingPhase.cpp:
(JSC::DFG::TypeCheckHoistingPhase::disableHoistingAcrossOSREntries):
* dfg/DFGWorklist.cpp:
(JSC::DFG::Worklist::isActiveForVM const):
(JSC::DFG::Worklist::compilationState):
(JSC::DFG::Worklist::waitUntilAllPlansForVMAreReady):
(JSC::DFG::Worklist::removeAllReadyPlansForVM):
(JSC::DFG::Worklist::completeAllReadyPlansForVM):
(JSC::DFG::Worklist::visitWeakReferences):
(JSC::DFG::Worklist::removeDeadPlans):
(JSC::DFG::Worklist::removeNonCompilingPlansForVM):
* dfg/DFGWorklistInlines.h:
(JSC::DFG::Worklist::iterateCodeBlocksForGC):
* ftl/FTLCompile.cpp:
(JSC::FTL::compile):
* ftl/FTLFail.cpp:
(JSC::FTL::fail):
* ftl/FTLJITFinalizer.cpp:
(JSC::FTL::JITFinalizer::finalizeCommon):
* ftl/FTLLink.cpp:
(JSC::FTL::link):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileMultiPutByOffset):
(JSC::FTL::DFG::LowerDFGToB3::buildExitArguments):
(JSC::FTL::DFG::LowerDFGToB3::addWeakReference):
* ftl/FTLState.cpp:
(JSC::FTL::State::State):

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

12 months agoUnreviewed, rolling out r233496 and r233571.
cdumez@apple.com [Tue, 24 Jul 2018 23:13:21 +0000 (23:13 +0000)]
Unreviewed, rolling out r233496 and r233571.

Likely cause of <rdar://problem/42160890> and
<rdar://problem/42329658> as ActiveDOMObjects can now be
constructed / destroyed while we are iterating over them.

Reverted changesets:

"Nullptr crash accessing Document in
GenericEventQueue::dispatchOneEvent()"
https://bugs.webkit.org/show_bug.cgi?id=187284
https://trac.webkit.org/changeset/233496

"REGRESSION(r233496): macOS Sierra hits debug assertions in
TrackListBase::suspend"
https://bugs.webkit.org/show_bug.cgi?id=187378
https://trac.webkit.org/changeset/233571

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

12 months agoMinor changes to the WHLSL interpreter to support the new compiler
commit-queue@webkit.org [Tue, 24 Jul 2018 23:08:26 +0000 (23:08 +0000)]
Minor changes to the WHLSL interpreter to support the new compiler
https://bugs.webkit.org/show_bug.cgi?id=187728

Patch by Thomas Denney <tdenney@apple.com> on 2018-07-24
Reviewed by Myles C. Maxfield.

This bug contains small changes that are make minor changes to the
behaviour of the existing interpreter (the tests are unaffected and all
still pass).

* WebGPUShadingLanguageRI/EnumType.js:
(EnumType.prototype.get isEnum): Property added to EnumType and Type
* WebGPUShadingLanguageRI/Evaluator.js: Correct typo
* WebGPUShadingLanguageRI/Func.js:
(Func.prototype.get isEntryPoint): Add boolean property
* WebGPUShadingLanguageRI/FuncInstantiator.js:
(FuncInstantiator.prototype.get instances): Public accessor for existing
private field
* WebGPUShadingLanguageRI/FunctionLikeBlock.js: Refactored the class so
that it directly wraps a Func instance (therefore the only interface
change is to the constructor and the addition of the func accessor).
This change allows the de-inlining of functions.
(FunctionLikeBlock):
(FunctionLikeBlock.prototype.get func):
(FunctionLikeBlock.prototype.get returnType):
(FunctionLikeBlock.prototype.get parameters):
(FunctionLikeBlock.prototype.get body):
* WebGPUShadingLanguageRI/Inliner.js: Use the new FunctionLikeBlock
constructor
(Inliner.prototype.visitCallExpression):
(Inliner):
* WebGPUShadingLanguageRI/Intrinsics.js: Migrate the swizzle operators
to native functions (with additional support in StandardLibrary.js).
This reduces first-time compile-time from around 4s to around 0.1s.
(Intrinsics):
* WebGPUShadingLanguageRI/Lexer.js: Ensure that the parsing of multiline
comments completes correctly
(Lexer.prototype.next):
(Lexer):
* WebGPUShadingLanguageRI/MakeArrayRefExpression.js: Addition of type
property, which is based on the type of the lValue and the semantics of
the language (the @ operator yields an array reference with the thread
scope).
(MakeArrayRefExpression):
(MakeArrayRefExpression.prototype.get type):
* WebGPUShadingLanguageRI/NativeFunc.js: Add setter/getter for
implementationData to support swizzle operator change
(NativeFunc.prototype.get implementationData):
(NativeFunc.prototype.set implementationData):
* WebGPUShadingLanguageRI/Rewriter.js: Use new FunctionLikeBlock
constructor
(Rewriter.prototype.visitFunctionLikeBlock):
* WebGPUShadingLanguageRI/StandardLibrary.js:
(_generateSwizzle): Deleted.
* WebGPUShadingLanguageRI/SwizzleOp.js: Introduces a new class for
carrying metadata about swizzle operators so that they are implemented
as native functions rather than generated at compile time.
(SwizzleOp):
(SwizzleOp.prototype.get outSize):
(SwizzleOp.prototype.get components):
(SwizzleOp.prototype.get inSize):
(SwizzleOp.prototype.toString):
(SwizzleOp.allSwizzleOperators.):
(SwizzleOp.allSwizzleOperators):
* WebGPUShadingLanguageRI/StandardLibrary.js: +        (SwizzleOp):
(SwizzleOp.prototype.get outSize):
(SwizzleOp.prototype.get components):
(SwizzleOp.prototype.get inSize):
(SwizzleOp.prototype.toString):
(generateSwizzles):
(_generateSwizzle): Deleted.
* WebGPUShadingLanguageRI/Type.js: Addition of isEnum property, as
above.
(Type.prototype.get isEnum):

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

12 months agoUnreviewed WPE/GTK gardening.
tsaunier@gnome.org [Tue, 24 Jul 2018 21:50:00 +0000 (21:50 +0000)]
Unreviewed WPE/GTK gardening.

Disabled newly added webrtc tests that depend on implementing WebAudioSourceProviderGStreamer.

Namely:
  webrtc/peer-connection-createMediaStreamDestination.html

* platform/gtk/TestExpectations:
* platform/wpe/TestExpectations:

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

12 months ago[Datalist][macOS] Display suggestions for input[type=color]
commit-queue@webkit.org [Tue, 24 Jul 2018 21:46:36 +0000 (21:46 +0000)]
[Datalist][macOS] Display suggestions for input[type=color]
https://bugs.webkit.org/show_bug.cgi?id=187794

Patch by Aditya Keerthi <akeerthi@apple.com> on 2018-07-24
Reviewed by Tim Horton.

Source/WebCore:

* html/ColorInputType.cpp:
(WebCore::ColorInputType::shouldRespectListAttribute):

Source/WebCore/PAL:

Added methods to enable customization of NSPopoverColorWell.

* PAL.xcodeproj/project.pbxproj:
* pal/spi/mac/NSColorWellSPI.h: Added.
* pal/spi/mac/NSPopoverColorWellSPI.h: Added.
* pal/spi/mac/NSPopoverSPI.h:

Source/WebKit:

An input[type=color] element that has an associated datalist element should
display the color values provided. We now support 1-12 suggested colors, that
will be displayed at the top of the color selection popover. If no suggestions
are specified we keep the existing default colors.

Created an NSPopoverColorWell subclass that allows custom colors to be specified
in the form of an NSColorList.

Also fixed a bug where an additional color well was displayed when clicking on
the input element.

* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<Color>::decode):
* Shared/WebCoreArgumentCoders.h:
* UIProcess/API/gtk/PageClientImpl.cpp:
(WebKit::PageClientImpl::createColorPicker):
* UIProcess/API/gtk/PageClientImpl.h:
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::showColorPicker):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::createColorPicker):
* UIProcess/mac/PageClientImplMac.h:
* UIProcess/mac/PageClientImplMac.mm:
(WebKit::PageClientImpl::createColorPicker):
* UIProcess/mac/WebColorPickerMac.h:
* UIProcess/mac/WebColorPickerMac.mm:
(WebKit::WebColorPickerMac::create):
(WebKit::WebColorPickerMac::WebColorPickerMac):
(WebKit::WebColorPickerMac::showColorPicker):
(+[WKPopoverColorWell _colorPopoverCreateIfNecessary:]):
(-[WKPopoverColorWell _showPopover]):
(-[WKPopoverColorWell setSuggestedColors:]):
(-[WKColorPopoverMac initWithFrame:inView:]):
(-[WKColorPopoverMac setAndShowPicker:withColor:suggestions:]):
(-[WKColorPanelMac setAndShowPicker:withColor:suggestions:]):
* WebProcess/WebCoreSupport/WebColorChooser.cpp:
(WebKit::WebColorChooser::WebColorChooser):
(WebKit::WebColorChooser::reattachColorChooser):

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

12 months agoMake VM::canUseJIT an inlined function
sbarati@apple.com [Tue, 24 Jul 2018 21:42:20 +0000 (21:42 +0000)]
Make VM::canUseJIT an inlined function
https://bugs.webkit.org/show_bug.cgi?id=187583

Reviewed by Mark Lam.

We know the answer to this query in initializeThreading after initializing
the executable allocator. This patch makes it so that we just hold this value
in a static variable and have an inlined function that just returns the value
of that static variable.

* runtime/InitializeThreading.cpp:
(JSC::initializeThreading):
* runtime/VM.cpp:
(JSC::VM::computeCanUseJIT):
(JSC::VM::canUseJIT): Deleted.
* runtime/VM.h:
(JSC::VM::canUseJIT):

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

12 months agoMark http/tests/workers/service/serviceworkerclients-matchAll.https.html as flaky.
ryanhaddad@apple.com [Tue, 24 Jul 2018 20:29:58 +0000 (20:29 +0000)]
Mark http/tests/workers/service/serviceworkerclients-matchAll.https.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=183705

Unreviewed test gardening.

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

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

12 months agoModernize NavigationState
achristensen@apple.com [Tue, 24 Jul 2018 20:14:32 +0000 (20:14 +0000)]
Modernize NavigationState
https://bugs.webkit.org/show_bug.cgi?id=187966

Reviewed by Andy Estes.

Don't ignore switch warnings any more.
Use BlockPtr.

* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
(WebKit::NavigationState::NavigationClient::decidePolicyForNavigationResponse):

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

12 months agoRemove WebFramePolicyListenerProxy::changeWebsiteDataStore
achristensen@apple.com [Tue, 24 Jul 2018 20:11:44 +0000 (20:11 +0000)]
Remove WebFramePolicyListenerProxy::changeWebsiteDataStore
https://bugs.webkit.org/show_bug.cgi?id=187967

Reviewed by Andy Estes.

We need to call WebFrameProxy::changeWebsiteDataStore if the _WKWebsitePolicies has a WKWebsiteDataStore.
We're doing that in a weird way that is not in the right layer.  Inside the call to WebFramePolicyListenerProxy::use
we can inform the frame if there's a new WebsiteDataStore.

No change in behavior, as verified by the WebKit.WebsitePoliciesDataStore API test.
This is a step towards using lambdas in WebFramePolicyListenerProxy.

* UIProcess/API/APINavigationClient.h:
(API::NavigationClient::decidePolicyForNavigationAction):
(API::NavigationClient::decidePolicyForNavigationResponse):
* UIProcess/API/APIPolicyClient.h:
(API::PolicyClient::decidePolicyForNavigationAction):
(API::PolicyClient::decidePolicyForNewWindowAction):
(API::PolicyClient::decidePolicyForResponse):
* UIProcess/API/C/WKFramePolicyListener.cpp:
(WKFramePolicyListenerUse):
(WKFramePolicyListenerUseInNewProcess):
(useWithPolicies):
* UIProcess/API/C/WKPage.cpp:
(WKPageSetPagePolicyClient):
(WKPageSetPageNavigationClient):
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
(WebKit::NavigationState::NavigationClient::decidePolicyForNavigationResponse):
* UIProcess/WebFramePolicyListenerProxy.cpp:
(WebKit::WebFramePolicyListenerProxy::use):
(WebKit::WebFramePolicyListenerProxy::changeWebsiteDataStore): Deleted.
* UIProcess/WebFramePolicyListenerProxy.h:
* UIProcess/WebPageProxy.cpp:
* UIProcess/mac/PageClientImplMac.mm:

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

12 months agoUnreviewed, rolling out r234121.
ryanhaddad@apple.com [Tue, 24 Jul 2018 19:57:36 +0000 (19:57 +0000)]
Unreviewed, rolling out r234121.

Caused perf test failures.

Reverted changeset:

"We should cache the compiled sandbox profile in a data vault"
https://bugs.webkit.org/show_bug.cgi?id=184991
https://trac.webkit.org/changeset/234121

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

12 months ago[Web Animations] Add an ASSERT() to check the contract that a CSSTransition has a...
graouts@webkit.org [Tue, 24 Jul 2018 19:35:36 +0000 (19:35 +0000)]
[Web Animations] Add an ASSERT() to check the contract that a CSSTransition has a valid effect in setTimingProperties()
https://bugs.webkit.org/show_bug.cgi?id=187954

Reviewed by Dean Jackson.

* animation/CSSTransition.cpp:
(WebCore::CSSTransition::setTimingProperties):

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

12 months ago[Web Animations] Crash when setting an animation style on an existing animation that...
graouts@webkit.org [Tue, 24 Jul 2018 19:32:10 +0000 (19:32 +0000)]
[Web Animations] Crash when setting an animation style on an existing animation that had its effect set to null
https://bugs.webkit.org/show_bug.cgi?id=187953

Reviewed by Dean Jackson.

Source/WebCore:

Test: webanimations/setting-css-animation-timing-property-via-style-after-clearing-effect.html

Ensure that we have a valid effect before proceeding to update its timing.

* animation/CSSAnimation.cpp:
(WebCore::CSSAnimation::syncPropertiesWithBackingAnimation):

LayoutTests:

Add a new test that sets an animation property via style after setting the initial animation's effect to null.

* webanimations/setting-css-animation-timing-property-via-style-after-clearing-effect-expected.txt: Added.
* webanimations/setting-css-animation-timing-property-via-style-after-clearing-effect.html: Added.

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

12 months ago[MediaStream] Restructure getDisplayMedia classes
eric.carlson@apple.com [Tue, 24 Jul 2018 19:31:03 +0000 (19:31 +0000)]
[MediaStream] Restructure getDisplayMedia classes
https://bugs.webkit.org/show_bug.cgi?id=187905
<rdar://problem/42500215>

Unreviewed build fix.

* platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:

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

12 months ago[Web Animations] Crash when setting "animation: none" after clearing an animation...
graouts@webkit.org [Tue, 24 Jul 2018 19:30:36 +0000 (19:30 +0000)]
[Web Animations] Crash when setting "animation: none" after clearing an animation's effect
https://bugs.webkit.org/show_bug.cgi?id=187952

Reviewed by Dean Jackson.

Source/WebCore:

Test: webanimations/setting-css-animation-none-after-clearing-effect.html

We need to ensure that the animation we're trying to remove has not had its effect cleared via the
Web Animations API since its creation before trying to check its phase.

* animation/AnimationTimeline.cpp:
(WebCore::AnimationTimeline::cancelOrRemoveDeclarativeAnimation):

LayoutTests:

Add a new test that checks that setting "animation: none" on an element that previously had a valid
CSS animation and for which the effect was set to null does not crash.

* webanimations/setting-css-animation-none-after-clearing-effect-expected.txt: Added.
* webanimations/setting-css-animation-none-after-clearing-effect.html: Added.

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

12 months ago[Web Animations] Crash accessing CSSAnimation::bindingsCurrentTime when effect has...
graouts@webkit.org [Tue, 24 Jul 2018 19:28:41 +0000 (19:28 +0000)]
[Web Animations] Crash accessing CSSAnimation::bindingsCurrentTime when effect has been set to null
https://bugs.webkit.org/show_bug.cgi?id=187950
<rdar://problem/42515747>

Reviewed by Dean Jackson.

Source/WebCore:

Test: webanimations/accessing-current-time-after-clearing-css-animation-effect.html

While a CSSAnimation has an effect created for it by the implementation, the developer may yet manipulate
its effect via the Web Animations API and set it to null. As such, we must not assume it's always non-null.

* animation/CSSAnimation.cpp:
(WebCore::CSSAnimation::bindingsCurrentTime const):

LayoutTests:

Add a new test where we check that the current time of a CSSAnimation can be accessed after setting its effect to null.

* webanimations/accessing-current-time-after-clearing-css-animation-effect-expected.txt: Added.
* webanimations/accessing-current-time-after-clearing-css-animation-effect.html: Added.

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

12 months agoPlacate exception check verification after recent changes.
mark.lam@apple.com [Tue, 24 Jul 2018 19:02:03 +0000 (19:02 +0000)]
Placate exception check verification after recent changes.
https://bugs.webkit.org/show_bug.cgi?id=187961
<rdar://problem/42545394>

Reviewed by Saam Barati.

* runtime/IntlObject.cpp:
(JSC::intlNumberOption):

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

12 months ago[LFC][IFC] BlockContainer::establishesInlineFormattingContext should only check the...
zalan@apple.com [Tue, 24 Jul 2018 18:48:25 +0000 (18:48 +0000)]
[LFC][IFC] BlockContainer::establishesInlineFormattingContext should only check the first inflow child.
https://bugs.webkit.org/show_bug.cgi?id=187965

Reviewed by Antti Koivisto.

* layout/layouttree/LayoutBlockContainer.cpp:
(WebCore::Layout::BlockContainer::establishesInlineFormattingContext const):

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

12 months ago[Cocoa] Stop crashing in lastResortFallbackFont()
mmaxfield@apple.com [Tue, 24 Jul 2018 18:34:24 +0000 (18:34 +0000)]
[Cocoa] Stop crashing in lastResortFallbackFont()
https://bugs.webkit.org/show_bug.cgi?id=187936

Reviewed by Jon Lee.

CoreText can get into a state where both Times and Lucida Grande are inaccessible.
Instead of crashing, we should use the real LastResort, which is backed by a section
in the .rodata of the CoreText dylib, and as such should always exist.

* platform/graphics/FontCache.cpp:
(WebCore::FontCache::fontForFamily):
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::FontCache::lastResortFallbackFont):

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

12 months agoWKUIDelegate needs an alternate decideDatabaseQuotaForSecurityOrigin method that...
jeffm@apple.com [Tue, 24 Jul 2018 17:47:25 +0000 (17:47 +0000)]
WKUIDelegate needs an alternate decideDatabaseQuotaForSecurityOrigin method that provides the database name and display name
https://bugs.webkit.org/show_bug.cgi?id=187567

Reviewed by Alex Christensen.

* UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
Declare alternate decideDatabaseQuotaForSecurityOrigin method, copying the existing FIXME comment
from the old method.

* UIProcess/Cocoa/UIDelegate.h:
Add flag for new delegate method.

* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::setDelegate):
Initialize new flag.

(WebKit::UIDelegate::UIClient::exceededDatabaseQuota):
Prefer the new UIDelegate method that takes the database name and display name, falling back to the
existing method if the client doesn't implement it.

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

12 months ago[WinCairo] Add support to WebView for setting tooltips
stephan.szabo@sony.com [Tue, 24 Jul 2018 17:40:12 +0000 (17:40 +0000)]
[WinCairo] Add support to WebView for setting tooltips
https://bugs.webkit.org/show_bug.cgi?id=187930

Reviewed by Fujii Hironori.

* UIProcess/win/PageClientImpl.cpp:
(WebKit::PageClientImpl::toolTipChanged): Set tooltip on WebView
* UIProcess/win/WebView.cpp:
(WebKit::WebView::setToolTip): Add support for updating the
tooltip text in Windows.
* UIProcess/win/WebView.h:

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

12 months agoDisable some vestibular trigger animations when prefers-reduced-motion is active.
jond@apple.com [Tue, 24 Jul 2018 17:31:18 +0000 (17:31 +0000)]
Disable some vestibular trigger animations when prefers-reduced-motion is active.
https://bugs.webkit.org/show_bug.cgi?id=186529

Reviewed by Dean Jackson.

* wp-content/themes/webkit/style.css:
(@media (prefers-reduced-motion)): Added to honor reduced motion settings.
(article,): Added to only use fade-in animation and prevent motion.

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

12 months agoReduce getters/setters in WebFramePolicyListenerProxy
achristensen@apple.com [Tue, 24 Jul 2018 17:27:15 +0000 (17:27 +0000)]
Reduce getters/setters in WebFramePolicyListenerProxy
https://bugs.webkit.org/show_bug.cgi?id=187830

Reviewed by Dean Jackson.

This is a step towards making it a lambda, which has no getters or setters.
No change in behavior.

setApplyPolicyInNewProcessIfPossible can be replaced by passing another parameter.
This bit was just piggy-backing on the WebFramePolicyListenerProxy.

isMainFrame was only used in an assert, which has a corresponding ObjC exception in
NavigationState::NavigationClient::decidePolicyForNavigationAction for the one relevant client.

* UIProcess/API/C/WKFramePolicyListener.cpp:
(WKFramePolicyListenerUseInNewProcess):
(useWithPolicies):
(WKFramePolicyListenerUseWithPolicies):
(WKFramePolicyListenerUseInNewProcessWithPolicies):
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
* UIProcess/WebFramePolicyListenerProxy.cpp:
(WebKit::WebFramePolicyListenerProxy::receivedPolicyDecision):
(WebKit::WebFramePolicyListenerProxy::use):
(WebKit::WebFramePolicyListenerProxy::download):
(WebKit::WebFramePolicyListenerProxy::ignore):
(WebKit::WebFramePolicyListenerProxy::isMainFrame const): Deleted.
* UIProcess/WebFramePolicyListenerProxy.h:
(WebKit::WebFramePolicyListenerProxy::setApplyPolicyInNewProcessIfPossible): Deleted.
(WebKit::WebFramePolicyListenerProxy::applyPolicyInNewProcessIfPossible const): Deleted.
* UIProcess/WebFrameProxy.cpp:
(WebKit::WebFrameProxy::receivedPolicyDecision):
* UIProcess/WebFrameProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::receivedPolicyDecision):
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
* UIProcess/WebPageProxy.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::processForNavigation):
(WebKit::WebProcessPool::processForNavigationInternal):
* UIProcess/WebProcessPool.h:

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

12 months agoRemove WebFramePolicyListenerProxy::invalidate
achristensen@apple.com [Tue, 24 Jul 2018 17:25:25 +0000 (17:25 +0000)]
Remove WebFramePolicyListenerProxy::invalidate
https://bugs.webkit.org/show_bug.cgi?id=187833

Reviewed by Dean Jackson.

When we're invalidating the listener, calling ignore instead will at worst cause
an ignored message to be sent.  The load will be cancelled either way.
Removing the invalidate method gets it closer to being a lambda.

* UIProcess/WebFramePolicyListenerProxy.cpp:
(WebKit::WebFramePolicyListenerProxy::invalidate): Deleted.
* UIProcess/WebFramePolicyListenerProxy.h:
* UIProcess/WebFrameProxy.cpp:
(WebKit::WebFrameProxy::webProcessWillShutDown):
(WebKit::WebFrameProxy::setUpPolicyListenerProxy):

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

12 months ago[Flatpak] Add openh264 as needed by WebRTC
commit-queue@webkit.org [Tue, 24 Jul 2018 16:43:30 +0000 (16:43 +0000)]
[Flatpak] Add openh264 as needed by WebRTC
https://bugs.webkit.org/show_bug.cgi?id=187956

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

* flatpak/org.webkit.WebKit.yaml:

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

12 months agoCannot view PDF's on my.gov.au: "Refused to load https://my.gov.au/attachment/viewAtt...
dbates@webkit.org [Tue, 24 Jul 2018 16:29:03 +0000 (16:29 +0000)]
Cannot view PDF's on my.gov.au: "Refused to load https://my.gov.au/attachment/viewAttachment because it
appears in neither the object-src directive nor the default-src directive of the Content Security Policy"
https://bugs.webkit.org/show_bug.cgi?id=187870
<rdar://problem/41190880>

Reviewed by Dean Jackson.

Source/WebCore:

Fixes an issue where opening attachments on my.gov.au would show a "Blocked Plug-in" message.

Opening an attachment on my.gov.au opens a same-origin plugin document in a child window. Currently
same-origin plugin documents inherit their CSP policy from their opener. If the opener's CSP policy
disallows embedding plugins then the plugin document would be blocked from loading a plugin. For now
we relax the inheritance model such that we only inherit the plugin-types and report-uri directives
from the opener.

Developers that want to block plugin content from being loaded in a same-origin child window must now
serve such plugin content with a CSP policy that includes "object-src 'none'". This matches the behavior
described in the second Note in section object-src of the CSP 3 spec: <https://w3c.github.io/webappsec-csp/#directive-object-src>
(Editor's Draft, 10 July 2018). It also makes the behavior in WebKit more closely aligned with the
behavior of Chrome and Firefox.

Tests: http/tests/security/contentSecurityPolicy/same-origin-plugin-document-allowed-in-child-window.html
       http/tests/security/contentSecurityPolicy/same-origin-plugin-document-blocked-in-child-window-report.php
       http/tests/security/contentSecurityPolicy/same-origin-plugin-document-with-csp-blocked-in-child-window.html

* dom/Document.cpp:
(WebCore::Document::initContentSecurityPolicy): For plugin documents that have an opener call ContentSecurityPolicy::createPolicyForPluginDocumentFrom()
to only inherit the plugin-types and report-uri directives from its opener's CSP policy. Otherwise, call ContentSecurityPolicy::copyStateFrom()
to inherit all directives from the owner frame as we do now.
* page/csp/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::createPolicyForPluginDocumentFrom): Create a new policy from the specified policy
inheriting only the plugin-types and report-uri directives.
* page/csp/ContentSecurityPolicy.h: Define a new PolicyFrom enumerator, InheritedForPluginDocument, for plugin documents
loaded in a child window.
* page/csp/ContentSecurityPolicyDirectiveList.cpp:
(WebCore::ContentSecurityPolicyDirectiveList::parse): When policyFrom is InheritedForPluginDocument then only
recognize the plugin-types and report-uri directives when parsing the policy.

LayoutTests:

Add new tests and fix up the existing test http/tests/security/contentSecurityPolicy/same-origin-plugin-document-blocked-in-child-window.html
so that still tests a scenario where a same-origin plugin document loaded in a child window is blocked from
loading its plugin now that that "object-src: 'none'" is no longer inherited by the plugin document.

* http/tests/plugins/resources/plugin-document-alert-and-notify-done.pl:
* http/tests/security/contentSecurityPolicy/resources/checkDidSameOriginChildWindowLoad.js: Added.
(checkDidSameOriginChildWindowLoadAndNotifyDone):
(checkDidLoad):
* http/tests/security/contentSecurityPolicy/same-origin-plugin-document-allowed-in-child-window-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/same-origin-plugin-document-allowed-in-child-window.html: Added.
* http/tests/security/contentSecurityPolicy/same-origin-plugin-document-blocked-in-child-window-expected.txt:
* http/tests/security/contentSecurityPolicy/same-origin-plugin-document-blocked-in-child-window-report-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/same-origin-plugin-document-blocked-in-child-window-report.php: Added.
* http/tests/security/contentSecurityPolicy/same-origin-plugin-document-blocked-in-child-window.html:
* http/tests/security/contentSecurityPolicy/same-origin-plugin-document-with-csp-blocked-in-child-window-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/same-origin-plugin-document-with-csp-blocked-in-child-window.html: Added.
* platform/ios/TestExpectations: Skip the included tests as we do not support plugins on iOS.
* platform/win/TestExpectations: Skip the included tests as plugins do not seem to work on Windows. We currently skip many
(if not all) plugin tests on Windows despite <rdar://problem/5074411> being marked as Closed (why?).

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

12 months agoRename Document::firstPartyForSameSiteCookies() to siteForCookies()
dbates@webkit.org [Tue, 24 Jul 2018 16:27:25 +0000 (16:27 +0000)]
Rename Document::firstPartyForSameSiteCookies() to siteForCookies()
https://bugs.webkit.org/show_bug.cgi?id=187892

Reviewed by Dean Jackson.

Standardize on the spec. language "site for cookies" for the names of the setter and getter
on Document. The latest description of Same-Site cookies is in <https://httpwg.org/http-extensions/rfc6265bis.html>.

No functionality changed. So, no new tests.

* dom/Document.h:
(WebCore::Document::siteForCookies const):
(WebCore::Document::setSiteForCookies):
(WebCore::Document::firstPartyForSameSiteCookies const): Deleted.
(WebCore::Document::setFirstPartyForSameSiteCookies): Deleted.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::setFirstPartyForCookies):
(WebCore::FrameLoader::addSameSiteInfoToRequestIfNeeded):
* workers/service/context/ServiceWorkerThreadProxy.cpp:
(WebCore::createPageForServiceWorker):
* xml/XSLTProcessor.cpp:
(WebCore::XSLTProcessor::createDocumentFromSource):

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

12 months agoWebCore::URL::hostIsIPAddress needs a Windows implementation
ross.kirsling@sony.com [Tue, 24 Jul 2018 15:15:34 +0000 (15:15 +0000)]
WebCore::URL::hostIsIPAddress needs a Windows implementation
https://bugs.webkit.org/show_bug.cgi?id=187859

Reviewed by Fujii Hironori.

Source/WebCore:

* platform/URL.cpp:
(WebCore::isIPv4Address): Added.
(WebCore::isIPv6Address): Added.
(WebCore::URL::hostIsIPAddress):
Turn this stub into a platform-agnostic default implementation.

Tools:

* TestWebKitAPI/Tests/WebCore/URL.cpp:
Check for a few other ways an IP address could be invalid.

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

12 months ago[MediaStream] Restructure getDisplayMedia classes
eric.carlson@apple.com [Tue, 24 Jul 2018 15:04:43 +0000 (15:04 +0000)]
[MediaStream] Restructure getDisplayMedia classes
https://bugs.webkit.org/show_bug.cgi?id=187905

Reviewed by Dean Jackson.

No new tests, no functional changes.

* platform/mediastream/CaptureDeviceManager.h:
(WebCore::CaptureDeviceManager::refreshCaptureDevices): Deleted, no need for it to be a
virtual method.
* platform/mediastream/mac/AVCaptureDeviceManager.h:

* platform/mediastream/gstreamer/GStreamerCaptureDeviceManager.h: refreshCaptureDevices is
no longer virtual.

* platform/mediastream/mac/DisplayCaptureManagerCocoa.cpp:
(WebCore::DisplayCaptureManagerCocoa::captureDevices):
(WebCore::DisplayCaptureManagerCocoa::updateDisplayCaptureDevices): Moved functionality
to ScreenDisplayCaptureSourceMac.
(WebCore::DisplayCaptureManagerCocoa::screenCaptureDeviceWithPersistentID): Ditto.
(WebCore::displayReconfigurationCallBack): Deleted, moved to ScreenDisplayCaptureSourceMac.
(WebCore::DisplayCaptureManagerCocoa::~DisplayCaptureManagerCocoa): Deleted.
(WebCore::DisplayCaptureManagerCocoa::refreshCaptureDevices): Deleted.
* platform/mediastream/mac/DisplayCaptureManagerCocoa.h:

* platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
(WebCore::roundUpToMacroblockMultiple): Moved from ScreenDisplayCaptureSourceMac.
(WebCore::DisplayCaptureSourceCocoa::applySize): Ditto.
(WebCore::DisplayCaptureSourceCocoa::sampleBufferFromPixelBuffer): Ditto.
(WebCore::DisplayCaptureSourceCocoa::pixelBufferFromIOSurface): Ditto.
* platform/mediastream/mac/DisplayCaptureSourceCocoa.h:

* platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h:
* platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
(WebCore::updateDisplayID):
(WebCore::ScreenDisplayCaptureSourceMac::createDisplayStream): Fix log message.
(WebCore::ScreenDisplayCaptureSourceMac::startDisplayStream): Ditto.
(WebCore::ScreenDisplayCaptureSourceMac::applySize): Update for base class changes.
(WebCore::ScreenDisplayCaptureSourceMac::applyFrameRate): Ditto.
(WebCore::ScreenDisplayCaptureSourceMac::frameAvailable): Ditto.
(WebCore::ScreenDisplayCaptureSourceMac::screenCaptureDeviceWithPersistentID): Moved from
DisplayCaptureManagerCocoa.
(WebCore::ScreenDisplayCaptureSourceMac::screenCaptureDevices): Ditto.
(WebCore::roundUpToMacroblockMultiple): Moved to DisplayCaptureSourceCocoa.
(WebCore::ScreenDisplayCaptureSourceMac::updateDisplayID): Ditto.
(WebCore::ScreenDisplayCaptureSourceMac::sampleBufferFromPixelBuffer): Ditto.
(WebCore::ScreenDisplayCaptureSourceMac::pixelBufferFromIOSurface): Ditto.

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

12 months ago[LFC] Move geometry data structures to a dedicated file
zalan@apple.com [Tue, 24 Jul 2018 14:47:55 +0000 (14:47 +0000)]
[LFC] Move geometry data structures to a dedicated file
https://bugs.webkit.org/show_bug.cgi?id=187939

Reviewed by Antti Koivisto.

* WebCore.xcodeproj/project.pbxproj:
* layout/FormattingContext.h:
(WebCore::Layout::FormattingContext::Geometry::Position::operator LayoutPoint const): Deleted.
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
(WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedHeightAndMargin):
(WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin):
(WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowVerticalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry):
(WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin):
(WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::computedBorder):
(WebCore::Layout::FormattingContext::Geometry::computedPadding):
(WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedHorizontalMarginValue):
(WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedVerticalMarginValue):
* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::staticPosition):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowPositionedPosition):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin):
* layout/displaytree/DisplayBox.h:
(WebCore::Display::Box::setHorizontalMargin):
(WebCore::Display::Box::setVerticalMargin):
(WebCore::Display::Box::setVerticalNonCollapsedMargin):
(WebCore::Display::Box::setBorder):
(WebCore::Display::Box::setPadding):

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