WebKit-https.git
63 min ago[WebGPU] Implement errors for GPURenderPipeline creation master
justin_fan@apple.com [Wed, 24 Jul 2019 01:42:37 +0000 (01:42 +0000)]
[WebGPU] Implement errors for GPURenderPipeline creation
https://bugs.webkit.org/show_bug.cgi?id=200046

Reviewed by Myles C. Maxfield.

Source/WebCore:

Replacing error logging in GPURenderPipeline creation with GPUError generation.
Update GPUErrorScopes to re-use an error message prefix for less boiler-plate.

Test: webgpu/render-pipeline-errors.html

* Modules/webgpu/WebGPUDevice.cpp:
(WebCore::WebGPUDevice::createRenderPipeline const):
* Modules/webgpu/WebGPURenderPipelineDescriptor.cpp:
(WebCore::WebGPURenderPipelineDescriptor::tryCreateGPURenderPipelineDescriptor const):
* Modules/webgpu/WebGPURenderPipelineDescriptor.h:
* platform/graphics/gpu/GPUDevice.cpp:
(WebCore::GPUDevice::tryCreateRenderPipeline const):
* platform/graphics/gpu/GPUDevice.h:
* platform/graphics/gpu/GPUErrorScopes.cpp:
(WebCore::GPUErrorScopes::generatePrefixedError):
* platform/graphics/gpu/GPUErrorScopes.h:
(WebCore::GPUErrorScopes::setErrorPrefix):
* platform/graphics/gpu/GPURenderPipeline.h:
* platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
(WebCore::tryCreateMtlDepthStencilState):
(WebCore::trySetVertexInput):
(WebCore::trySetColorStates):
(WebCore::trySetMetalFunctions):
(WebCore::trySetFunctions):
(WebCore::convertRenderPipelineDescriptor):
(WebCore::tryCreateMtlRenderPipelineState):
(WebCore::GPURenderPipeline::tryCreate):
(WebCore::GPURenderPipeline::GPURenderPipeline):

LayoutTests:

Add test to cover reproducible render pipeline creation errors.

* webgpu/js/webgpu-functions.js:
(runTestsWithDevice):
* webgpu/render-pipeline-errors-expected.txt: Added.
* webgpu/render-pipeline-errors.html: Added.

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

72 min ago[webkitperl] prepare-ChangeLog_unittest/parser_unittests.pl is failing on Windows...
Hironori.Fujii@sony.com [Wed, 24 Jul 2019 01:33:44 +0000 (01:33 +0000)]
[webkitperl] prepare-ChangeLog_unittest/parser_unittests.pl is failing on Windows Perl
https://bugs.webkit.org/show_bug.cgi?id=199927

Reviewed by Alex Christensen.

convertAbsolutepathToWebKitPath was failing to convert paths on
Windows Perl due to path separators mismatch.

Renamed convertAbsolutepathToWebKitPath to
convertAbsolutePathToRelativeUnixPath, and changed it to replace
paths to relative Unix paths.

* Scripts/webkitperl/prepare-ChangeLog_unittest/parser_unittests.pl:
(convertAbsolutePathToRelativeUnixPath): Added.
(convertAbsolutepathToWebKitPath): Deleted.

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

117 min agoFix iOS API test after r247759
achristensen@apple.com [Wed, 24 Jul 2019 00:48:14 +0000 (00:48 +0000)]
Fix iOS API test after r247759
https://bugs.webkit.org/show_bug.cgi?id=200045

* TestWebKitAPI/Tests/WebKitCocoa/WKProcessPoolConfiguration.mm:
(TEST):
In the iOS simulator, the WebProcess was being started before we were setting the value on the WKProcessPool.
To fix this, set the value on the WKProcessPool before making the WKWebView.  This makes the test always pass on Mac and iOS.

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

2 hours agoRemove rest of NavigatorContentUtils support
krollin@apple.com [Wed, 24 Jul 2019 00:24:20 +0000 (00:24 +0000)]
Remove rest of NavigatorContentUtils support
https://bugs.webkit.org/show_bug.cgi?id=200052
<rdar://problem/53467357>

Reviewed by Alex Christensen.

Bug 196070 removes most of the support for the never-used
NavigatorContentUtils facility. However, there were still a couple of
left-over references after that change. This patch sweeps those up.

PerformanceTests:

* StitchMarker/wtf/FeatureDefines.h:

Source/WTF:

* wtf/FeatureDefines.h:

Tools:

* Scripts/webkitperl/FeatureList.pm:

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

2 hours agoWeb Inspector: Styles: Command-X should cut selected properties
nvasilyev@apple.com [Wed, 24 Jul 2019 00:20:39 +0000 (00:20 +0000)]
Web Inspector: Styles: Command-X should cut selected properties
https://bugs.webkit.org/show_bug.cgi?id=199341

Reviewed by Devin Rousso.

Implement cutting of selected CSS properties in the style editor.
Unify cutting and copying logic wherever possible.

* UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js:
(WI.SpreadsheetCSSStyleDeclarationEditor.prototype.initialLayout):
(WI.SpreadsheetCSSStyleDeclarationEditor.prototype.placeTextCaretInFocusedProperty): Added.
Cut/copy events could only fire on SpreadsheetCSSStyleDeclarationEditor element if it
has selection inside of it. Placing text caret at the beginning of the focused property
ensures that.

(WI.SpreadsheetCSSStyleDeclarationEditor.prototype.spreadsheetStylePropertyCopy): Deleted.
(WI.SpreadsheetCSSStyleDeclarationEditor.prototype._handleKeyDown):
(WI.SpreadsheetCSSStyleDeclarationEditor.prototype._copySelectedProperties): Added.
(WI.SpreadsheetCSSStyleDeclarationEditor.prototype._removeSelectedProperties): Added.
* UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
(WI.SpreadsheetCSSStyleDeclarationSection.prototype._stopSelection):
* UserInterface/Views/SpreadsheetStyleProperty.js:
Remove old copying logic.

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

2 hours agoMove javaScriptConfigurationDirectory SPI from _WKProcessPoolConfiguration to WKProce...
achristensen@apple.com [Wed, 24 Jul 2019 00:08:06 +0000 (00:08 +0000)]
Move javaScriptConfigurationDirectory SPI from _WKProcessPoolConfiguration to WKProcessPoolPrivate to make it runtime switchable
https://bugs.webkit.org/show_bug.cgi?id=200045

Reviewed by Mark Lam.

Source/WebKit:

This allows me to maintain the status quo in Safari.

* UIProcess/API/APIProcessPoolConfiguration.cpp:
(API::ProcessPoolConfiguration::copy):
* UIProcess/API/APIProcessPoolConfiguration.h:
* UIProcess/API/Cocoa/WKProcessPool.mm:
(-[WKProcessPool _javaScriptConfigurationDirectory]):
(-[WKProcessPool _setJavaScriptConfigurationDirectory:]):
* UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
(-[_WKProcessPoolConfiguration javaScriptConfigurationDirectory]): Deleted.
(-[_WKProcessPoolConfiguration setJavaScriptConfigurationDirectory:]): Deleted.
* UIProcess/WebProcessPool.cpp:
(WebKit::legacyWebsiteDataStoreConfiguration):
(WebKit::WebProcessPool::sendWebProcessDataStoreParameters):
* UIProcess/WebProcessPool.h:

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/WKProcessPoolConfiguration.mm:
(TEST):

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

2 hours agoImageDecoderDirect2D::hotSpot() should return WTF::nullopt instead of default constru...
annulen@yandex.ru [Wed, 24 Jul 2019 00:04:47 +0000 (00:04 +0000)]
ImageDecoderDirect2D::hotSpot() should return WTF::nullopt instead of default constructed value
https://bugs.webkit.org/show_bug.cgi?id=200055

Reviewed by Brent Fulgham.

* platform/graphics/win/ImageDecoderDirect2D.cpp:
(WebCore::ImageDecoderDirect2D::hotSpot const):

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

2 hours agoUnreviewed, rolling out r247745.
russell_e@apple.com [Wed, 24 Jul 2019 00:03:10 +0000 (00:03 +0000)]
Unreviewed, rolling out r247745.

This broke API test
TestWebKitAPI.WKProcessPool.JavaScriptConfiguration as
indicated by EWS

Reverted changeset:

"Move javaScriptConfigurationDirectory SPI from
_WKProcessPoolConfiguration to WKProcessPoolPrivate to make it
runtime switchable"
https://bugs.webkit.org/show_bug.cgi?id=200045
https://trac.webkit.org/changeset/247745

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

2 hours agoLong press hint has half blue shape in Feedly.com
timothy_horton@apple.com [Wed, 24 Jul 2019 00:02:05 +0000 (00:02 +0000)]
Long press hint has half blue shape in Feedly.com
https://bugs.webkit.org/show_bug.cgi?id=200053
<rdar://problem/53323369>

Reviewed by Simon Fraser.

No new tests, because TextIndicator snapshots are not yet testable.

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::paintForegroundForFragments):
Paint ChildBlockBackgrounds when painting selection AND backgrounds;
only exclude it when doing a selection-only paint.

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

3 hours agoAX: CrashTracer: com.apple.WebKit.WebContent at WebKit: WebKit::WebSpeechSynthesisCli...
cfleizach@apple.com [Tue, 23 Jul 2019 23:24:58 +0000 (23:24 +0000)]
AX: CrashTracer: com.apple.WebKit.WebContent at WebKit: WebKit::WebSpeechSynthesisClient::speak
https://bugs.webkit.org/show_bug.cgi?id=199988

Reviewed by Per Arne Vollan.

Source/WebCore:

Implement the reset state to cancel current speech jobs.

* Modules/speech/SpeechSynthesis.cpp:
(WebCore::SpeechSynthesis::startSpeakingImmediately):
(WebCore::SpeechSynthesis::cancel):
* platform/PlatformSpeechSynthesizer.h:
* platform/ios/PlatformSpeechSynthesizerIOS.mm:
(WebCore::PlatformSpeechSynthesizer::resetState):
* platform/mac/PlatformSpeechSynthesizerMac.mm:
(WebCore::PlatformSpeechSynthesizer::resetState):

Source/WebKit:

Improvements to WebSpeechSynthesis to avoid crashing and improve correctness.
- Reset and cancel speech jobs on page close or reload (otherwise the synthesizer keeps talking after your page is gone)
- Have a separate speech finish callback mechanism, use the start speaking callback when the synthesizer tells us.
- Move an assert on utterance state to only apply when we use the in process synthesizer.

* UIProcess/Cocoa/WebPageProxyCocoa.mm:
(WebKit::WebPageProxy::didStartSpeaking):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::reload):
(WebKit::WebPageProxy::resetState):
(WebKit::WebPageProxy::resetSpeechSynthesizer):
(WebKit::WebPageProxy::speechSynthesisSetFinishedCallback):
(WebKit::WebPageProxy::speechSynthesisSpeak):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebProcess/WebCoreSupport/WebSpeechSynthesisClient.cpp:
(WebKit::WebSpeechSynthesisClient::speak):

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

3 hours agoEnable HAVE_APP_LINKS_WITH_ISENABLED for entire iOS family
krollin@apple.com [Tue, 23 Jul 2019 23:01:26 +0000 (23:01 +0000)]
Enable HAVE_APP_LINKS_WITH_ISENABLED for entire iOS family
https://bugs.webkit.org/show_bug.cgi?id=200040
<rdar://problem/53457670>

Reviewed by Tim Horton.

This feature was enabled for just iOS, but should be enabled for tvOS
and watchOS, too.

* wtf/Platform.h:

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

4 hours agoGet rid of unnecessary callback aggregators in WebResourceLoadStatisticsStore
cdumez@apple.com [Tue, 23 Jul 2019 21:56:34 +0000 (21:56 +0000)]
Get rid of unnecessary callback aggregators in WebResourceLoadStatisticsStore
https://bugs.webkit.org/show_bug.cgi?id=200042

Reviewed by Brent Fulgham.

Only 1 asynchronous function is called so there is nothing to "aggregate".

* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::scheduleCookieBlockingUpdate):
(WebKit::WebResourceLoadStatisticsStore::scheduleCookieBlockingUpdateForDomains):
(WebKit::WebResourceLoadStatisticsStore::scheduleClearBlockingStateForDomains):

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

4 hours agoWeb Inspector: Display "Resource has no content" for about:blank iframes instead...
nvasilyev@apple.com [Tue, 23 Jul 2019 21:50:59 +0000 (21:50 +0000)]
Web Inspector: Display "Resource has no content" for about:blank iframes instead of an error
https://bugs.webkit.org/show_bug.cgi?id=198029

Reviewed by Devin Rousso.

Display "about:blank" in the middle of the content view when selecting "about:blank" resources.
Previoulsly, we showed a misleading "An error occurred trying to load the resource" error
message.

* UserInterface/Models/CSSStyleSheet.js:
(WI.CSSStyleSheet.prototype.requestContentFromBackend):
* UserInterface/Models/Resource.js:
(WI.Resource.prototype.requestContentFromBackend):
* UserInterface/Models/Script.js:
(WI.Script.prototype.requestContentFromBackend):
* UserInterface/Models/SourceCode.js:
(WI.SourceCode.generateSpecialContentForURL):
(WI.SourceCode.prototype._processContent):
(WI.SourceCode):
* UserInterface/Views/ResourceContentView.js:
(WI.ResourceContentView.prototype._contentAvailable):

* UserInterface/Views/SourceCodeTextEditor.js:
(WI.SourceCodeTextEditor.prototype._contentAvailable):
(WI.SourceCodeTextEditor.prototype._showMessage):
* UserInterface/Views/TextResourceContentView.js:
(WI.TextResourceContentView.prototype._contentDidPopulate):
Display empty text editor when it has no content instead of "Resource has no content" message.

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

4 hours ago[iOS] Tapping the search field on a search results page on zillow.com shows and immed...
zalan@apple.com [Tue, 23 Jul 2019 21:49:00 +0000 (21:49 +0000)]
[iOS] Tapping the search field on a search results page on zillow.com shows and immediately dismisses the keyboard
https://bugs.webkit.org/show_bug.cgi?id=200044
<rdar://problem/53103732>

Reviewed by Wenson Hsieh.

Source/WebCore:

1. The keyboard gets dismissed as the result of scroll event.
2. The (horizontal)scroll event is initiated by WebKit as we try to re-center the content.
3. The content gets off-centered as the result of the newly constructed drop-down menu which slightly sticks out of the document to the right (layout overflows).

It works with shipping version of iOS because _zoomToFocusRect operates on stale viewport information (see r244494 for the progression).
This patch applies a site specific quirk to restore shipping behavior.

* page/Quirks.cpp:
(WebCore::Quirks::shouldAvoidScrollingWhenFocusedContentIsVisible const):
* page/Quirks.h:

Source/WebKit:

* Shared/FocusedElementInformation.cpp:
(WebKit::FocusedElementInformation::encode const):
(WebKit::FocusedElementInformation::decode):
* Shared/FocusedElementInformation.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _zoomToFocusRect:selectionRect:insideFixed:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]):
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _elementDidBlur]):
(-[WKContentView _shouldAvoidScrollingWhenFocusedContentIsVisible]):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::getFocusedElementInformation):

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

5 hours agoMove javaScriptConfigurationDirectory SPI from _WKProcessPoolConfiguration to WKProce...
achristensen@apple.com [Tue, 23 Jul 2019 21:05:00 +0000 (21:05 +0000)]
Move javaScriptConfigurationDirectory SPI from _WKProcessPoolConfiguration to WKProcessPoolPrivate to make it runtime switchable
https://bugs.webkit.org/show_bug.cgi?id=200045

Reviewed by Mark Lam.

Source/WebKit:

This allows me to maintain the status quo in Safari.

* UIProcess/API/APIProcessPoolConfiguration.cpp:
(API::ProcessPoolConfiguration::copy):
* UIProcess/API/APIProcessPoolConfiguration.h:
* UIProcess/API/Cocoa/WKProcessPool.mm:
(-[WKProcessPool _javaScriptConfigurationDirectory]):
(-[WKProcessPool _setJavaScriptConfigurationDirectory:]):
* UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
(-[_WKProcessPoolConfiguration javaScriptConfigurationDirectory]): Deleted.
(-[_WKProcessPoolConfiguration setJavaScriptConfigurationDirectory:]): Deleted.
* UIProcess/WebProcessPool.cpp:
(WebKit::legacyWebsiteDataStoreConfiguration):
(WebKit::WebProcessPool::sendWebProcessDataStoreParameters):
* UIProcess/WebProcessPool.h:

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/WKProcessPoolConfiguration.mm:
(TEST):

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

6 hours agoCanvasRenderingContext2D.setTransfrom() reads only the aliases attributes of DOMMatri...
commit-queue@webkit.org [Tue, 23 Jul 2019 20:39:25 +0000 (20:39 +0000)]
CanvasRenderingContext2D.setTransfrom() reads only the aliases attributes of DOMMatrix2DInit
https://bugs.webkit.org/show_bug.cgi?id=199850

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2019-07-23
Reviewed by Simon Fraser.

Source/WebCore:

The validateAndFixup step of DOMMatrix2DInit sets the matrix attributes
(m** fields) from the aliases attributes (a, b, c, d, e, f) if the former
ones do not exist and the later ones exist. See
https://www.w3.org/TR/geometry-1/#dommatrixinit-dictionary and
DOMMatrixReadOnly::validateAndFixup(DOMMatrix2DInit& init).

Since CanvasRenderingContext2DBase::setTransform() validates and fixes
the input DOMMatrix2DInit, it should rely on matrix attributes.

Test: fast/canvas/setTransfrom-aliases-transform.html

* html/canvas/CanvasRenderingContext2DBase.cpp:
(WebCore::CanvasRenderingContext2DBase::setTransform):

LayoutTests:

* fast/canvas/setTransfrom-aliases-transform-expected.html: Added.
* fast/canvas/setTransfrom-aliases-transform.html: Added.

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

6 hours agoFix crashes in ScrollingStateNode::insertChild()
simon.fraser@apple.com [Tue, 23 Jul 2019 19:50:17 +0000 (19:50 +0000)]
Fix crashes in ScrollingStateNode::insertChild()
https://bugs.webkit.org/show_bug.cgi?id=200023
rdar://problem/53265378

Reviewed by Darin Adler.

Crash data suggest that ScrollingStateNode::insertChild() can be passed an index that
is larger than the size of the vector, causing crashes.

Fix defensively by falling back to append() if the passed index is equal to or larger
than the size of the children vector.

* page/scrolling/ScrollingStateNode.cpp:
(WebCore::ScrollingStateNode::insertChild):

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

7 hours agoAdd SPI for setting media cache and key location on _WKWebsiteDataStoreConfiguration
achristensen@apple.com [Tue, 23 Jul 2019 19:32:48 +0000 (19:32 +0000)]
Add SPI for setting media cache and key location on _WKWebsiteDataStoreConfiguration
https://bugs.webkit.org/show_bug.cgi?id=199972

Reviewed by Jer Noble.

Source/WebKit:

This is a step towards removing WebsiteDataStore::legacyDefaultDataStoreConfiguration
I added a unit test for the media cache location,
but the media key location can't reasonably be unit tested in an open source project.

* UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
(-[WKWebsiteDataStore _initWithConfiguration:]):
* UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
* UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:
(-[_WKWebsiteDataStoreConfiguration mediaCacheDirectory]):
(-[_WKWebsiteDataStoreConfiguration setMediaCacheDirectory:]):
(-[_WKWebsiteDataStoreConfiguration mediaKeysStorageDirectory]):
(-[_WKWebsiteDataStoreConfiguration setMediaKeysStorageDirectory:]):

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/WebsiteDataStoreCustomPaths.mm:
(TEST):

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

7 hours agoLong press hint of AirPods buy buttons are tall and narrow during animation
timothy_horton@apple.com [Tue, 23 Jul 2019 19:06:30 +0000 (19:06 +0000)]
Long press hint of AirPods buy buttons are tall and narrow during animation
https://bugs.webkit.org/show_bug.cgi?id=200036
<rdar://problem/53145697>

Reviewed by Wenson Hsieh.

Source/WebCore:

New test: fast/text-indicator/text-indicator-with-tiny-child.html

* dom/Range.cpp:
(WebCore::Range::borderAndTextRects const):
* dom/Range.h:
Add a BoundingRectBehavior that ignores 1x1 and smaller rects.

* page/TextIndicator.cpp:
(WebCore::absoluteBoundingRectForRange):
Enable IgnoreTinyRects.

LayoutTests:

* fast/text-indicator/text-indicator-with-tiny-child-expected.txt: Added.
* fast/text-indicator/text-indicator-with-tiny-child.html: Added.

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

9 hours agoSometimes we miss removable CheckInBounds
justin_michaud@apple.com [Tue, 23 Jul 2019 17:24:13 +0000 (17:24 +0000)]
Sometimes we miss removable CheckInBounds
https://bugs.webkit.org/show_bug.cgi?id=200018

Reviewed by Saam Barati.

JSTests:

* microbenchmarks/typed-array-sum.js: Added.
(doTest):

Source/JavaScriptCore:

We failed to remove the CheckInBounds bounds because we did not see that the index was nonnegative. This is because we do not see the relationship between the two
separate zero constants that appear in the IR for the given test case. This patch re-adds the hack to de-duplicate m_zero that was removed in
<https://trac.webkit.org/changeset/241228/webkit>.

* dfg/DFGIntegerRangeOptimizationPhase.cpp:

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

11 hours ago[WTF] Add DataMutex and MainThreadData wrappers
aboya@igalia.com [Tue, 23 Jul 2019 14:51:29 +0000 (14:51 +0000)]
[WTF] Add DataMutex and MainThreadData wrappers
https://bugs.webkit.org/show_bug.cgi?id=199831

Reviewed by Alex Christensen.

Source/WTF:

This patch adds two new wrapper classes:

DataMutex<T> stores an instance of T in a private member along with a
mutex. In order to use its fields, users need to instantiate a
DataMutex<T>::LockedWrapper instance in the stack. This class uses
RAII to lock and unlock the mutex in construction and destruction
respectively, and by using the arrow operator lets the user access T's
members.

This way, DataMutex<T> prevents most instances of accidental access to
data fields that should only be read and modified in an atomic matter.

Still, both the Lock and the LockHolder are exposed once the user has
taken the lock so that special cases such as waiting for a condition
variable or performing an early unlock are doable.

MainThreadData<T> is another wrapper class, in this case for data
fields that should only be accessed from the main thread. In this
case, it works similar to a smart pointer, except that (1) there is no
actual memory indirection, T is stored directly inside
MainThreadData<T> and (2) attempts to use the -> or * operator have an
isMainThread() assertion.

Together, these two wrapper classes make it easier to write
multi-threaded code in a safer, more self-documented way by letting
the author group data into structures that have certain access safety
requirements.

These structures were originally part of the new GStreamer
WebKitMediaSrc rework patch: https://bugs.webkit.org/show_bug.cgi?id=199719

* wtf/CMakeLists.txt:
* wtf/DataMutex.h: Added.
(WTF::DataMutex::DataMutex):
(WTF::DataMutex::LockedWrapper::LockedWrapper):
(WTF::DataMutex::LockedWrapper::operator->):
(WTF::DataMutex::LockedWrapper::operator*):
(WTF::DataMutex::LockedWrapper::mutex):
(WTF::DataMutex::LockedWrapper::lockHolder):
* wtf/MainThreadData.h: Added.
(WTF::MainThreadData::MainThreadData):
(WTF::MainThreadData::operator->):
(WTF::MainThreadData::operator*):

Tools:

Added a very simple test that checks that DataMutex<T> indeed takes
the lock and indeed holds data.

* TestWebKitAPI/CMakeLists.txt:
* TestWebKitAPI/Tests/WTF/DataMutex.cpp: Added.
(TestWebKitAPI::TEST):

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

11 hours ago[macOS 10.15] Web process crashes when attempting to show the font panel via Font...
wenson_hsieh@apple.com [Tue, 23 Jul 2019 14:47:37 +0000 (14:47 +0000)]
[macOS 10.15] Web process crashes when attempting to show the font panel via Font > Show Fonts
https://bugs.webkit.org/show_bug.cgi?id=200021
<rdar://problem/53301325>

Reviewed by Ryosuke Niwa.

Source/WebCore:

In macOS 10.15, attempting to access ~/Library/FontCollections/ from the web process causes a Sandbox violation
and a subsequent crash. This can be triggered by trying to show the font panel via Font > Show Fonts in the
context menu after right clicking.

In the (near) future, we should fix this by moving logic to show the font panel, color panel and styles panel
from the Editor in the web process to the UI process in WebKit2. However, for the time being, we can just work
around this by adding a new EditorClient hook to determine whether to allow the font panel to show; this returns
true in the legacy macOS WebKit port, and false everywhere else.

Test: editing/mac/style/do-not-crash-when-showing-font-panel.html

* editing/mac/EditorMac.mm:
(WebCore::Editor::showFontPanel):
* loader/EmptyClients.cpp:
* page/EditorClient.h:

Source/WebKit:

Always return false from canShowFontPanel in WebKit2.

* WebProcess/WebCoreSupport/WebEditorClient.h:

Source/WebKitLegacy/mac:

Implement a new editing client hook. In WebKit1, this always returns true on macOS and false on iOS.

* WebCoreSupport/WebEditorClient.h:

Source/WebKitLegacy/win:

Implement a new editing client hook.

* WebCoreSupport/WebEditorClient.h:

Tools:

Add support for grabbing the child menu items of a context menu item.

* WebKitTestRunner/InjectedBundle/EventSendingController.cpp:
(WTR::getMenuItemChildrenCallback):

LayoutTests:

Add a new layout test to verify that attempting to show the font panel doesn't crash the web process in WebKit2.
This test is skipped in WebKit1, since EventSender::contextClick() in WebKit1 only returns an array of strings
corresponding to the titles of each menu item.

* editing/mac/style/do-not-crash-when-showing-font-panel-expected.txt: Added.
* editing/mac/style/do-not-crash-when-showing-font-panel.html: Added.
* platform/mac-wk1/TestExpectations:

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

17 hours agoUnreviewed. Update OptionsGTK.cmake and NEWS for 2.25.3 release
carlosgc@webkit.org [Tue, 23 Jul 2019 09:09:18 +0000 (09:09 +0000)]
Unreviewed. Update OptionsGTK.cmake and NEWS for 2.25.3 release

.:

* Source/cmake/OptionsGTK.cmake: Bump version numbers

Source/WebKit:

* gtk/NEWS: Add release notes for 2.25.3.

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

19 hours agoWebKit should strip away system font names from the pasted content
rniwa@webkit.org [Tue, 23 Jul 2019 07:21:29 +0000 (07:21 +0000)]
WebKit should strip away system font names from the pasted content
https://bugs.webkit.org/show_bug.cgi?id=199975
<rdar://problem/53336353>

Reviewed by Darin Adler.

Source/WebCore:

Cocoa HTML Writer sometimes generate system font names such as ".AppleSystemUIFont", ".SFUI-Regular", and ".SF UI Mono".
We need to strip away these font names upon paste to avoid these font names falling back to Times New Roman.

Added the code to strip these font names away in EditingStyle::mergeStyleFromRulesForSerialization, which is used by
StylizedMarkupAccumulator to generate HTML during copy. This works because WebContentReader::readWebArchive invokes
sanitizeMarkupWithArchive which inserts the pasteboard content into a temporary document then re-serializes back to HTML
using StylizedMarkupAccumulator before the actual pasting happens.

This approach has a few benefits over stripping away these font names in ReplaceSelectionCommand:

1. It would only affect clients that opts-in to copy & paste sanitization. e.g. it won't affect legacy WebKit clients
and those that opt out of pasteboard content sanitization.

2. It preserves font names such as ".SF Blah" that a website may insert as some kind of house keeping purposes if ever.
While we don't have any evidence that there is any such a website but it's a real risk nonetheless. The copy side fix would
only affect cross-site and cross-app pasting, which is rare and less likely to affect real user scenarios.

3. It avoids exposing bogus .Apple* or .SF* font names to websites that directly use event.clipboardData.getData.
Indeed stripping away bogus markup like this is one of the key features / benefit of using copy & paste sanitization.

Test: editing/pasteboard/paste-cocoa-writer-markup-with-system-fonts.html

* editing/EditingStyle.cpp:
(WebCore::usesForbiddenSystemFontAsOnlyFontFamilyName): Added.
(WebCore::EditingStyle::mergeStyleFromRulesForSerialization): Added the code to remove font-family property when needed.
* platform/graphics/FontCache.h:
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::isSystemFont): Moved.
(WebCore::FontCache::isSystemFontForbiddenForEditing): Added.
* platform/graphics/freetype/FontCacheFreeType.cpp:
(WebCore::FontCache::isSystemFontForbiddenForEditing): Added. Always returns false.
* platform/graphics/win/FontCacheWin.cpp:
(WebCore::FontCache::isSystemFontForbiddenForEditing): Ditto.

Tools:

Added a test to strip away system font names such as ".AppleSystemUIFont", ".SFUI-Regular", and ".SF UI Mono".

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKitCocoa/PasteHTML.mm:
* TestWebKitAPI/Tests/WebKitCocoa/cocoa-writer-markup-with-system-fonts.html: Added.

LayoutTests:

Added a test for ClipboardData.getData returning the original markup and execCommand('insertHTML', ~)
not stripping away system font names.

* editing/pasteboard/paste-cocoa-writer-markup-with-system-fonts-expected.txt: Added.
* editing/pasteboard/paste-cocoa-writer-markup-with-system-fonts.html: Added.

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

19 hours ago[GTK] Emoji chooser is misplaced after scrolling
carlosgc@webkit.org [Tue, 23 Jul 2019 07:11:42 +0000 (07:11 +0000)]
[GTK] Emoji chooser is misplaced after scrolling
https://bugs.webkit.org/show_bug.cgi?id=199996

Reviewed by Michael Catanzaro.

Convert caret rectangle coordinates to root view.

* WebProcess/WebPage/gtk/WebPageGtk.cpp:
(WebKit::WebPage::showEmojiPicker):

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

23 hours agoWeb Inspector: Uncaught Exception: Breakpoint at specified location already exists.
drousso@apple.com [Tue, 23 Jul 2019 03:45:28 +0000 (03:45 +0000)]
Web Inspector: Uncaught Exception: Breakpoint at specified location already exists.
https://bugs.webkit.org/show_bug.cgi?id=197034
<rdar://problem/50049004>

Reviewed by Joseph Pecoraro.

When "adjusting" a `WI.Breakpoint` (e.g. removing and then re-adding with a different
configuration), make sure to only re-add the `WI.Breakpoint` to the `WI.Target` it was just
removed from, rather to all `WI.targets`.

Since we iterate over `WI.targets` in both `WI.DebuggerManager.prototype._setBreakpoint` and
`WI.DebuggerManager.prototype._removeBreakpoint`, we ended up iterating `WI.targets` twice.

Each time the `WI.Breakpoint` is removed from a `WI.Target`, pass the `WI.Target` to the
`callback` given to `WI.DebuggerManager.prototype._removeBreakpoint`, so that the eventual
call to `WI.DebuggerManager.prototype._setBreakpoint` can reuse it as the `specificTarget`,
instead of iterating `WI.targets` (meaning we only iterate it once).

* UserInterface/Controllers/DebuggerManager.js:
(WI.DebuggerManager.prototype.addBreakpoint):
(WI.DebuggerManager.prototype._removeBreakpoint.didRemoveBreakpoint):
(WI.DebuggerManager.prototype._breakpointDisplayLocationDidChange):
(WI.DebuggerManager.prototype._breakpointEditablePropertyDidChange):

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

24 hours ago[bmalloc] Each IsoPage gets 1MB VA because VMHeap::tryAllocateLargeChunk rounds up
ysuzuki@apple.com [Tue, 23 Jul 2019 02:43:11 +0000 (02:43 +0000)]
[bmalloc] Each IsoPage gets 1MB VA because VMHeap::tryAllocateLargeChunk rounds up
https://bugs.webkit.org/show_bug.cgi?id=200024

Reviewed by Saam Barati.

Source/bmalloc:

When we allocate IsoHeap's page, we reused VMHeap::tryAllocateLargeChunk. However, this function is originally designed
to be used for Large allocation in bmalloc (e.g. allocating Chunk in bmalloc). As a result, this function rounds up the
requested size with 1MB (bmalloc::chunkSize). As a result, all IsoHeap's 16KB page gets 1MB VA while it just uses 16KB of
the allocated region. This leads to VA exhaustion since IsoHeap now uses 64x VA than we expected!

This patch fixes the above VA exhaustion issue by allocating a page by using tryVMAllocate. When allocating a page, we start
using a VM tag for IsoHeap. We discussed at e-mail and we decided reusing a VM tag previously assigned to CLoop Stack since
this is less profitable. Since this tag is not Malloc-related tag, Leaks tool can scan memory region conservatively without
registering allocated region into Zone, which was previously done in VMHeap and that's why we reused VMHeap for IsoHeap.

* bmalloc/BVMTags.h:
* bmalloc/IsoPage.cpp:
(bmalloc::IsoPageBase::allocatePageMemory):
* bmalloc/IsoTLS.cpp:
(bmalloc::IsoTLS::ensureEntries):
* bmalloc/VMAllocate.h:
(bmalloc::vmAllocate):

Source/JavaScriptCore:

Discussed and we decided to use this VM tag for IsoHeap instead of CLoop stack.

* interpreter/CLoopStack.cpp:
(JSC::CLoopStack::CLoopStack):

Source/WebCore:

Changed how we interpret VM tags. Add IsoHeap VM tag support, and rename WebAssembly tag
to Gigacage tag.

* page/ResourceUsageData.h:
* page/ResourceUsageOverlay.h:
* page/cocoa/ResourceUsageOverlayCocoa.mm:
(WebCore::HistoricResourceUsageData::HistoricResourceUsageData):
* page/cocoa/ResourceUsageThreadCocoa.mm:
(WebCore::displayNameForVMTag):
(WebCore::categoryForVMTag):

Source/WTF:

Start using a VM tag for IsoHeap instead of CLoop Stack.

* wtf/OSAllocator.h:
* wtf/VMTags.h:

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

24 hours agoTurn off Wasm fast memory on iOS
sbarati@apple.com [Tue, 23 Jul 2019 02:24:47 +0000 (02:24 +0000)]
Turn off Wasm fast memory on iOS
https://bugs.webkit.org/show_bug.cgi?id=200016
<rdar://problem/53417726>

Reviewed by Yusuke Suzuki.

We turned them on when we disabled Gigacage on iOS. However, we re-enabled
Gigacage on iOS, but forgot to turn wasm fast memories back off.

* runtime/Options.h:

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

24 hours agoFix WebView iframe rendering in macOS Catalina
simon.fraser@apple.com [Tue, 23 Jul 2019 02:08:20 +0000 (02:08 +0000)]
Fix WebView iframe rendering in macOS Catalina
https://bugs.webkit.org/show_bug.cgi?id=200022
rdar://problem/49102040

Reviewed by Darin Adler.
Source/WebKitLegacy/mac:

Adapt to internal NSView method renames in Catalina.

* WebView/WebHTMLView.mm:
(-[WebHTMLView _recursive:displayRectIgnoringOpacity:inContext:stopAtLayerBackedViews:_recursive:displayRectIgnoringOpacity:inContext:shouldChangeFontReferenceColor:stopAtLayerBackedViews:_recursive:displayRectIgnoringOpacity:inContext:shouldChangeFontReferenceColor:_recursive:displayRectIgnoringOpacity:inContext:topView:]):
(-[WebHTMLView _recursive:displayRectIgnoringOpacity:inContext:shouldChangeFontReferenceColor:stopAtLayerBackedViews:_recursive:displayRectIgnoringOpacity:inContext:shouldChangeFontReferenceColor:_recursive:displayRectIgnoringOpacity:inContext:topView:]): Deleted.

LayoutTests:

New test for rendering of overlapping iframes, defects when we fail to setAsideSubviews
in WebView.

* fast/frames/frames-not-double-painted-expected.html: Added.
* fast/frames/frames-not-double-painted.html: Added.

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

26 hours agoUnreviewed, follow-up fix for tls->size() access
ysuzuki@apple.com [Tue, 23 Jul 2019 00:18:36 +0000 (00:18 +0000)]
Unreviewed, follow-up fix for tls->size() access
https://bugs.webkit.org/show_bug.cgi?id=200019

* bmalloc/IsoTLS.cpp:
(bmalloc::IsoTLS::ensureEntries):
(bmalloc::IsoTLS::destructor):

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

26 hours ago[ews-build] EWS fails to parse multi-line full_results.json
aakash_jain@apple.com [Tue, 23 Jul 2019 00:16:18 +0000 (00:16 +0000)]
[ews-build] EWS fails to parse multi-line full_results.json
https://bugs.webkit.org/show_bug.cgi?id=199992

Reviewed by Alexey Proskuryakov.

* BuildSlaveSupport/ews-build/layout_test_failures.py:
(LayoutTestFailures.results_from_string): Concatenate content into single line.
* BuildSlaveSupport/ews-build/steps_unittest.py:
(test_parse_results_json_with_newlines): Unit-test to cover this scenario.

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

26 hours ago[bmalloc] IsoTLS is not deallocated in TLS destructor
ysuzuki@apple.com [Tue, 23 Jul 2019 00:09:36 +0000 (00:09 +0000)]
[bmalloc] IsoTLS is not deallocated in TLS destructor
https://bugs.webkit.org/show_bug.cgi?id=200019

Reviewed by Mark Lam.

TLS destructor for IsoTLS needs to deallocate memory used for IsoTLS itself.
While we are correctly deallocating old IsoTLS when extending it to the new one,
we lack deallocation when the thread is destroyed. IsoTLS is per-thread, so we
should destroy IsoTLS when a thread finishes.

* bmalloc/IsoTLS.cpp:
(bmalloc::IsoTLS::ensureEntries):
(bmalloc::IsoTLS::destructor):

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

26 hours agoEnable CSSOMViewScrollingAPIEnabled in WebKit1
simon.fraser@apple.com [Tue, 23 Jul 2019 00:07:38 +0000 (00:07 +0000)]
Enable CSSOMViewScrollingAPIEnabled in WebKit1
https://bugs.webkit.org/show_bug.cgi?id=200008
rdar://problem/53409062

Reviewed by Tim Horton.

Default WebKitCSSOMViewScrollingAPIEnabledPreferenceKey to YES, so that
CSSOMViewScrollingAPIEnabled is on for both WebKit1 and WebKit2.

DumpRenderTree already turns this preference on, so this change is not
detected by tests.

* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):

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

26 hours agoFix inspector override conversion in InspectorPageAgent::overrideSetting
youenn@apple.com [Tue, 23 Jul 2019 00:01:04 +0000 (00:01 +0000)]
Fix inspector override conversion in InspectorPageAgent::overrideSetting
https://bugs.webkit.org/show_bug.cgi?id=200017

Reviewed by Devin Rousso.

Covered by inspector/page/overrideSetting-MockCaptureDevicesEnabled.html
which should not fail on bots not having cameras

* inspector/agents/InspectorPageAgent.cpp:
(WebCore::toOptionalBool):
(WebCore::InspectorPageAgent::overrideSetting):
Previously, the conversion for the mock capture value was implicit from a bool pointer to an optional.
Make an explicit conversion as done for regular settings.

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

26 hours agoresultsdbpy: Handle case where the previous commit doesn't have the changelog
jbedard@apple.com [Mon, 22 Jul 2019 23:47:16 +0000 (23:47 +0000)]
resultsdbpy: Handle case where the previous commit doesn't have the changelog
https://bugs.webkit.org/show_bug.cgi?id=200015

Reviewed by Aakash Jain.

* resultsdbpy/resultsdbpy/model/repository.py:
(WebKitRepository.commit_for_id.diff_changelogs): Allow the previous_response to be None.

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

27 hours agoUnreviewed non-unified build fix.
ross.kirsling@sony.com [Mon, 22 Jul 2019 23:25:48 +0000 (23:25 +0000)]
Unreviewed non-unified build fix.

Source/JavaScriptCore:

* runtime/CachedTypes.h:

Source/WebCore:

* Modules/webdatabase/DatabaseContext.h:
* html/HTMLDialogElement.cpp:
* html/HTMLScriptElement.cpp:
* inspector/agents/InspectorDatabaseAgent.cpp:
* workers/service/server/SWServerWorker.cpp:
* workers/service/server/SWServerWorker.h:
* worklets/WorkletGlobalScope.cpp:
* worklets/WorkletGlobalScope.h:

Source/WebKit:

* NetworkProcess/NetworkCORSPreflightChecker.h:
* NetworkProcess/NetworkLoadChecker.h:
* UIProcess/API/C/WKContext.cpp:
* UIProcess/API/C/WKPageConfigurationRef.cpp:
* UIProcess/Downloads/DownloadProxy.cpp:
* UIProcess/WebPageInjectedBundleClient.cpp:
* UIProcess/WebPreferences.cpp:
* WebProcess/Network/WebSocketChannel.cpp:
(WebKit::PendingMessage::PendingMessage):

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

27 hours agoRemove Staging for scrolling bug
megan_gardner@apple.com [Mon, 22 Jul 2019 23:09:03 +0000 (23:09 +0000)]
Remove Staging for scrolling bug
https://bugs.webkit.org/show_bug.cgi?id=199894

Reviewed by Wenson Hsieh.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKUIWKTextInteractionAssistant scrollSelectionToVisible]): Deleted.

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

27 hours ago[JSC] Make DFG Local CSE and AI conservative for huge basic block
ysuzuki@apple.com [Mon, 22 Jul 2019 23:07:11 +0000 (23:07 +0000)]
[JSC] Make DFG Local CSE and AI conservative for huge basic block
https://bugs.webkit.org/show_bug.cgi?id=199929
<rdar://problem/49309924>

Reviewed by Filip Pizlo.

In CNN page, the main thread hangs several seconds. On less-powerful devices (like iPhone7), it hangs for ~11 seconds. This is not an acceptable behavior.
The reason of this is that the DFG compiler takes too long time in the compilation for a particular function. It takes 8765 ms even in powerful x64 machine!
DFG compiler is concurrent one. However, when GC requires all the peripheral threads to be stopped, the main thread needs to wait for the DFG compiler's stop.
DFG compiler stops at GC safepoints, and they are inserted between DFG phases. So, if some of DFG phases take very long time, the main thread is blocked during that.
As a result, the main thread is blocked due to this pathological compilation.

By measuring the time taken in each DFG phase, we found that our AI and CSE phase have a problem having quadratic complexity for # of DFG nodes in a basic block.
In this patch, we add a threshold for # of DFG nodes in a basic block. If a basic block exceeds this threshold, we use conservative but O(1) algorithm for AI and Local CSE phase.
We did not add this threshold for Global CSE since FTL has another bytecode cost threshold which prevents us from compiling the large functions. But on the other hand,
DFG should compile them because DFG is intended to be a fast compiler even for a bit larger CodeBlock.

We first attempted to reduce the threshold for DFG compilation. We are using 100000 bytecode cost for DFG compilation and it is very large. However, we found that bytecode cost
is not the problem in CNN page. The problematic function has 67904 cost, and it takes 8765 ms in x64 machine. However, JetStream2/octane-zlib has 61949 function and it only takes
~400 ms. This difference comes from the # of DFG nodes in a basic block. The problematic function has 43297 DFG nodes in one basic block and it makes AI and Local CSE super time-consuming.
Rather than relying on the bytecode cost which a bit indirectly related to this pathological compile-time, we should look into # of DFG nodes in a basic block which is more directly
related to this problem. And we also found that 61949's Octane-zlib function is very critical for performance. This fact makes a bit hard to pick a right threshold: 67904 causes the problem,
and 61949 must be compiled. This is why this patch is introducing conservative analysis instead of adjusting the threshold for DFG.

This patch has two changes.

1. DFG AI has structure transition tracking which has quadratic complexity

Structure transition tracking takes very long time since its complexity is O(N^2) where N is # of DFG nodes in a basic block.
CNN has very pathological script and it shows 43297 DFG nodes. We should reduce the complexity of this algorithm.
For now, we just say "structures are clobbered" if # of DFG nodes in a basic block exceeds the threshold (20000).
We could improve the current algorithm from O(N^2) to O(2N) without being conservative, and I'm tracking this in [1].

2. DFG Local CSE has quadratic complexity

Local CSE's clobbering iterates all the impure heap values to remove the clobbered one. Since # of impure heap values tend to be proportional to # of DFG nodes we visited,
each CSE for a basic block gets O(N^2) complexity. To avoid this, we introduce HugeMap. This has the same interface to LargeMap and SmallMap in CSE, but its clobbering
implementation just clears the map completely. We can further make this O(N) without introducing conservative behavior by using epochs. For now, we do not see such a huge basic block in
JetStream2 and Speedometer2 so I'll track it in a separate bug[2].

This patch reduces the compilation time from ~11 seconds to ~200 ms.

[1]: https://bugs.webkit.org/show_bug.cgi?id=199959
[2]: https://bugs.webkit.org/show_bug.cgi?id=200014

* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::observeTransition):
(JSC::DFG::AbstractInterpreter<AbstractStateType>::observeTransitions):
* dfg/DFGCSEPhase.cpp:
* runtime/Options.h:

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

28 hours ago[iOS] [WK1] UIWebView always jumps to the top left corner when scrolling to reveal...
wenson_hsieh@apple.com [Mon, 22 Jul 2019 22:14:48 +0000 (22:14 +0000)]
[iOS] [WK1] UIWebView always jumps to the top left corner when scrolling to reveal the selection
https://bugs.webkit.org/show_bug.cgi?id=200013
<rdar://problem/52526901>

Reviewed by Simon Fraser.

Source/WebCore:

After <https://trac.webkit.org/r244141>, we no longer attempt to scroll to reveal the text selection in
UIWebView after changing the selection, due to how we use the legacy document view rect in legacy WebKit when
computing the visual viewport. This causes the viewRect in RenderLayer::scrollRectToVisible to be the same size
as the content size, which then causes us to always scroll to the origin when revealing the selection.

To make selection revealing work again in legacy WebKit, conditionally restore the old behavior of using the
unobscured content rect as the view rect, only in the case where scrolling is delegated and the platform widget
is present.

Test: WebKitLegacy.ScrollToRevealSelection

* page/FrameView.cpp:
(WebCore::FrameView::viewRectExpandedByContentInsets const):
(WebCore::FrameView::visualViewportRectExpandedByContentInsets const): Deleted.

Additionally rename visualViewportRectExpandedByContentInsets to viewRectExpandedByContentInsets, to reflect the
fact that this may either be the visual viewport rect or unobscured content rect.

* page/FrameView.h:
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollRectToVisible):

Tools:

Add a new API test to verify that inserting text in UIWebView causes the document to scroll.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKitLegacy/ios/ScrollToRevealSelection.mm: Added.
(-[LegacyLoadingDelegate webViewDidFinishLoad:]):
(-[LegacyLoadingDelegate waitForDidFinishLoad]):
* TestWebKitAPI/ios/UIKitSPI.h:

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

28 hours agoCorrect web audio-related crash in seed reports
bfulgham@apple.com [Mon, 22 Jul 2019 22:02:58 +0000 (22:02 +0000)]
Correct web audio-related crash in seed reports
https://bugs.webkit.org/show_bug.cgi?id=200009
<rdar://problem/51565203>

Reviewed by Per Arne Vollan.

Source/WebCore:

Update the 'createMix' method to do proper return value checking so that
we can clear the result of MTAudioProcessingTapCreate if the create operation
failed.

* platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
(WebCore::AudioSourceProviderAVFObjC::createMix):

Source/WebKit:

Revise the iOS sandbox to allow the WebContent process to communicate with
the 'com.apple.coremedia.audioprocessingtap.xpc' service, which is needed by
some types of WebAudio.

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

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

30 hours agoWebKit SPI fix for [ClickyOrb] Audio continues playing after dismissing a video previ...
dino@apple.com [Mon, 22 Jul 2019 20:38:52 +0000 (20:38 +0000)]
WebKit SPI fix for [ClickyOrb] Audio continues playing after dismissing a video preview in Safari
https://bugs.webkit.org/show_bug.cgi?id=200011
<rdar://problem/53409457>

Reviewed by Tim Horton.

Don't check for the SPI @selector(_webView:contextMenuDidEndForElement:)
on the WKUIDelegate so that clients that got caught implementing the
SPI before moving to the real API can still clean-up state. In other words,
don't force a client that only implements that method to move completely
to the new API.

* UIProcess/ios/WKContentViewInteraction.mm:
(needsDeprecatedPreviewAPI):

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

30 hours agoPrewarmed font does not find any matches
pvollan@apple.com [Mon, 22 Jul 2019 20:24:05 +0000 (20:24 +0000)]
Prewarmed font does not find any matches
https://bugs.webkit.org/show_bug.cgi?id=200007

Reviewed by Brent Fulgham.

Prewarming the font name 'SF Pro Text' does not find any matches. The font name ".SF NS Text/Display"
should be used instead. Also add 'Lucida Grande' to the list of prewarmed font, since it is used as
fallback font in many cases.

No new tests, covered by existing tests.

* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::fontFamiliesForPrewarming):

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

30 hours agoMake sure the player underlying volume is correctly set after creating a new player
youenn@apple.com [Mon, 22 Jul 2019 20:03:05 +0000 (20:03 +0000)]
Make sure the player underlying volume is correctly set after creating a new player
https://bugs.webkit.org/show_bug.cgi?id=199974
<rdar://problem/52762559>

Reviewed by Eric Carlson.

Source/WebCore:

When creating a player before starting to play, the volume might not be correctly initialized.
Fix that by updating the volume like done for rate and muted state.
A future refactoring should probably move that code in MediaPlayer.

Add an internal API to query the volume value from the underlying player.

Test: http/tests/media/audio-volume-zero.html

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::updateVolume):
(WebCore::HTMLMediaElement::updatePlayState):
(WebCore::HTMLMediaElement::effectiveVolume const):
(WebCore::HTMLMediaElement::effectiveMuted const):
* html/HTMLMediaElement.h:
* testing/Internals.cpp:
(WebCore::Internals::privatePlayerVolume):
* testing/Internals.h:
* testing/Internals.idl:
* testing/Internals.mm:
(WebCore::Internals::privatePlayerVolume):

LayoutTests:

* http/tests/media/128kbps-44khz.mp3: Added.
* http/tests/media/audio-volume-zero-expected.txt: Added.
* http/tests/media/audio-volume-zero.html: Added.

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

30 hours agoWeb Inspector: Page: mark any WebCore::Setting inspector override as UNLIKELY
drousso@apple.com [Mon, 22 Jul 2019 19:46:05 +0000 (19:46 +0000)]
Web Inspector: Page: mark any WebCore::Setting inspector override as UNLIKELY
https://bugs.webkit.org/show_bug.cgi?id=199925

Reviewed by Joseph Pecoraro.

* Scripts/SettingsTemplates/Settings.cpp.erb:

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

31 hours agoLocalization: change fps to FPS
drousso@apple.com [Mon, 22 Jul 2019 19:39:17 +0000 (19:39 +0000)]
Localization: change fps to FPS
<rdar://problem/53342508>

Rubber-stamped by Joseph Pecoraro.

* UserInterface/Views/RenderingFrameTimelineOverviewGraph.js:
(WI.RenderingFrameTimelineOverviewGraph.prototype._updateDividers.createDividerAtPosition):

* Localizations/en.lproj/localizedStrings.js:

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

31 hours agoREGRESSION(rUnknown): YouTube playback pauses when switching to a new tab
jer.noble@apple.com [Mon, 22 Jul 2019 19:38:05 +0000 (19:38 +0000)]
REGRESSION(rUnknown): YouTube playback pauses when switching to a new tab
https://bugs.webkit.org/show_bug.cgi?id=199971
<rdar://problem/51951218>

Reviewed by Alex Christensen.

Source/WebKit:

When we get a message notifying us that the view has been removed from the window, we unconditionally
ask the fullscreen manager to exit fullscreen, which has the side effect (on iOS) of pausing the video
unconditionally. Only ask the fullscreen manager to exit fullscreen if there is actually a video in
fullscreen mode.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::viewDidLeaveWindow):

Tools:

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

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

31 hours ago[ews-build] Add an EWS to run services tests
aakash_jain@apple.com [Mon, 22 Jul 2019 19:16:34 +0000 (19:16 +0000)]
[ews-build] Add an EWS to run services tests
https://bugs.webkit.org/show_bug.cgi?id=199994

Reviewed by Jonathan Bedard.

* BuildSlaveSupport/ews-build/config.json: Added Services-EWS configuration.
* BuildSlaveSupport/ews-build/factories.py: Added ServicesFactory.
* BuildSlaveSupport/ews-build/steps.py:
(CheckPatchRelevance): Run this EWS only for patches with changes in relevant files.
(RunEWSUnitTests): Build step to run EWS unit-tests.
(RunEWSBuildbotCheckConfig): Build step to run buildbot checkconfig command.
* BuildSlaveSupport/ews-build/steps_unittest.py: Added unit-tests.
* BuildSlaveSupport/ews-app/ews/views/statusbubble.py: Added services status-bubble.

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

31 hours agoMake sure to unref captured lambda variables given to _strictTrustEvaluate in the...
youenn@apple.com [Mon, 22 Jul 2019 18:51:31 +0000 (18:51 +0000)]
Make sure to unref captured lambda variables given to _strictTrustEvaluate in the main thread
https://bugs.webkit.org/show_bug.cgi?id=199948

Reviewed by Alex Christensen.

Use a weak pointer instead of a Ref for the NetworkSession.
Add a null check in processServerTrustEvaluation for extra safety if we decide to remove the data task NetworkSession ref.
Make sure to move the NetworkDataTask ref in the completion handler so that the unrefing is done in the main thread.

* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(processServerTrustEvaluation):
(-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):

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

32 hours agoDisable MediaRecorder for legacy WebKit
youenn@apple.com [Mon, 22 Jul 2019 18:19:38 +0000 (18:19 +0000)]
Disable MediaRecorder for legacy WebKit
https://bugs.webkit.org/show_bug.cgi?id=200001
<rdar://problem/53400030>

Reviewed by Eric Carlson.

Source/WebKitLegacy/mac:

Disable MediaRecorder by default in legacy WebKit.
Add SPI to set/get this preference.

* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
(-[WebPreferences _mediaRecorderEnabled]):
(-[WebPreferences _setMediaRecorderEnabled:]):
* WebView/WebPreferencesPrivate.h:

Tools:

Enable MediaRecorder for testing purposes.

* DumpRenderTree/mac/DumpRenderTree.mm:
(createWebViewAndOffscreenWindow):

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

32 hours agoresults.webkit.org: Timeline header is too small
jbedard@apple.com [Mon, 22 Jul 2019 18:18:26 +0000 (18:18 +0000)]
results.webkit.org: Timeline header is too small
https://bugs.webkit.org/show_bug.cgi?id=199955

Reviewed by Aakash Jain.

* resultsdbpy/resultsdbpy/view/static/css/timeline.css:
(.timeline>.header): Make timeline header larder to fit configuration names.

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

32 hours agoNeed to skip test cache directory data vault for non internal build
commit-queue@webkit.org [Mon, 22 Jul 2019 18:16:02 +0000 (18:16 +0000)]
Need to skip test cache directory data vault for non internal build
https://bugs.webkit.org/show_bug.cgi?id=199951

Patch by Zhifei Fang <zhifei_fang@apple.com> on 2019-07-22
Reviewed by Alexey Proskuryakov.

* API/tests/testapi.mm:
(testBytecodeCacheValidation): "Cache directory `/private/tmp` is not a data vault" this error message will only be created for internal build see JSScript.mm:97

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

32 hours agoDon't always look for a JSC configuration file after r247685
achristensen@apple.com [Mon, 22 Jul 2019 18:12:14 +0000 (18:12 +0000)]
Don't always look for a JSC configuration file after r247685
https://bugs.webkit.org/show_bug.cgi?id=199917

* UIProcess/API/APIProcessPoolConfiguration.cpp:
(API::ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration):
(API::ProcessPoolConfiguration::ProcessPoolConfiguration):
ProcessPoolConfiguration's javaScriptConfigurationDirectory wasn't used before r247685,
which made it always look for a file with 'JavaScriptCoreDebug' in its name.  I had assumed
m_javaScriptConfigurationDirectory would default to a null string, but it was defaulting to
defaultJavaScriptConfigurationDirectory.  Make it a null string instead.

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

32 hours agoMake some constructors explicit
simon.fraser@apple.com [Mon, 22 Jul 2019 18:05:16 +0000 (18:05 +0000)]
Make some constructors explicit
https://bugs.webkit.org/show_bug.cgi?id=199981

Reviewed by Daniel Bates.

Make explicit public constructors of objects that take POD or String& arguments,
to reduce the changes of the compiler doing implicit conversions.

Source/WebCore:

* Modules/indexeddb/server/IndexValueEntry.h:
* Modules/indexeddb/server/IndexValueStore.h:
* Modules/indexeddb/shared/IDBDatabaseInfo.h:
* Modules/webdatabase/ChangeVersionData.h:
(WebCore::ChangeVersionData::ChangeVersionData):
* Modules/webdatabase/OriginLock.h:
* Modules/websockets/WebSocketExtensionParser.h:
(WebCore::WebSocketExtensionParser::WebSocketExtensionParser):
* bindings/js/ScriptCachedFrameData.h:
* contentextensions/URLFilterParser.cpp:
(WebCore::ContentExtensions::PatternParser::PatternParser):
* css/parser/CSSTokenizer.h:
* css/parser/SizesAttributeParser.h:
* dom/SpaceSplitString.cpp:
(WebCore::TokenIsEqualToCStringTokenProcessor::TokenIsEqualToCStringTokenProcessor):
* html/FormController.cpp:
(WebCore::SavedFormState::appendControlState):
(WebCore::SavedFormState::takeControlState):
* loader/ProgressTracker.cpp:
(WebCore::ProgressItem::ProgressItem):
* page/DragController.cpp:
(WebCore::DragController::DragController):
(WebCore::DragController::performDragOperation):
* page/DragController.h:
* page/animation/CSSPropertyAnimation.cpp:
(WebCore::AnimationPropertyWrapperBase::AnimationPropertyWrapperBase):
* page/ios/DOMTimerHoldingTank.h:
(WebCore::DeferDOMTimersForScope::DeferDOMTimersForScope):
* platform/CountedUserActivity.h:
(WebCore::CountedUserActivity::CountedUserActivity):
* platform/audio/DirectConvolver.h:
* platform/audio/DownSampler.h:
* platform/audio/DynamicsCompressorKernel.h:
* platform/audio/EqualPowerPanner.h:
* platform/audio/MultiChannelResampler.h:
* platform/audio/ReverbAccumulationBuffer.h:
* platform/audio/ReverbInputBuffer.h:
* platform/audio/SincResampler.cpp:
* platform/audio/UpSampler.h:
* platform/audio/ios/AudioFileReaderIOS.h:
* platform/audio/mac/AudioFileReaderMac.h:
* platform/audio/mac/AudioSessionMac.cpp:
(WebCore::AudioSessionPrivate::AudioSessionPrivate):
* platform/cf/KeyedDecoderCF.h:
* platform/graphics/WidthIterator.cpp:
(WebCore::OriginalAdvancesForCharacterTreatedAsSpace::OriginalAdvancesForCharacterTreatedAsSpace):
* platform/graphics/cocoa/FontCacheCoreText.h:
(WebCore::SynthesisPair::SynthesisPair):
* platform/graphics/displaylists/DisplayListItems.h:
(WebCore::DisplayList::DrawingItem::DrawingItem):
* platform/network/cf/ResourceRequest.h:
(WebCore::ResourceRequest::ResourceRequest):
* platform/text/TextCodecICU.h:
* rendering/RenderTableSection.h:
(WebCore::CellSpan::CellSpan):
* rendering/shapes/RasterShape.cpp:
* rendering/shapes/RasterShape.h:
(WebCore::RasterShapeIntervals::RasterShapeIntervals):
* testing/MockLibWebRTCPeerConnection.h:
(WebCore::MockLibWebRTCIceCandidate::MockLibWebRTCIceCandidate):

Source/WebCore/PAL:

* pal/system/cocoa/SleepDisablerCocoa.cpp:
(PAL::SleepDisablerCocoa::SleepDisablerCocoa):
* pal/system/cocoa/SleepDisablerCocoa.h:

Source/WebKit:

* Platform/Module.h:
* WebProcess/WebPage/WebInspector.cpp:
(WebKit::WebInspector::openInNewTab):

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

33 hours ago[iOS] REGRESSION (r241734): Autocorrection highlight should hide when field becomes...
dbates@webkit.org [Mon, 22 Jul 2019 17:34:55 +0000 (17:34 +0000)]
[iOS] REGRESSION (r241734): Autocorrection highlight should hide when field becomes defocused
https://bugs.webkit.org/show_bug.cgi?id=199807
<rdar://problem/52760259>

Fix a bad merge of r247653. svn-apply was way too forgiving. The original patch touched
the non-existent function, -_didCommitLoadForMainFrame in WKContentViewInteraction.mm. Because
that didn't exist, svn-apply patched up -clearSelection.

* UIProcess/ios/WKContentView.h:
* UIProcess/ios/WKContentView.mm:
(-[WKContentView _didCommitLoadForMainFrame]): Deleted; moved to WKContentViewInteraction.mm
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView clearSelection]): Remove code that should be in -_didCommitLoadForMainFrame.
(-[WKContentView _didCommitLoadForMainFrame]): Moved from WKContentView.mm

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

33 hours agoAdd SPI to _WKWebsiteDataStoreConfiguration for configuring application cache storage...
achristensen@apple.com [Mon, 22 Jul 2019 17:21:09 +0000 (17:21 +0000)]
Add SPI to _WKWebsiteDataStoreConfiguration for configuring application cache storage location
https://bugs.webkit.org/show_bug.cgi?id=199954

Reviewed by Geoff Garen.

Source/WebKit:

This is a step towards removing WebsiteDataStore::legacyDefaultDataStoreConfiguration
Covered by a new API test.

* UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
(-[WKWebsiteDataStore _initWithConfiguration:]):
* UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
* UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:
(-[_WKWebsiteDataStoreConfiguration applicationCacheDirectory]):
(-[_WKWebsiteDataStoreConfiguration setApplicationCacheDirectory:]):
(-[_WKWebsiteDataStoreConfiguration applicationCacheFlatFileSubdirectoryName]):
(-[_WKWebsiteDataStoreConfiguration setApplicationCacheFlatFileSubdirectoryName:]):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::sendWebProcessDataStoreParameters):
* UIProcess/WebsiteData/WebsiteDataStore.h:
(WebKit::WebsiteDataStore::applicationCacheFlatFileSubdirectoryName const):

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/WebsiteDataStoreCustomPaths.mm:
(TEST):

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

33 hours agoAdd SPI _WKProcessPoolConfiguration.javaScriptConfigurationDirectory
achristensen@apple.com [Mon, 22 Jul 2019 17:19:29 +0000 (17:19 +0000)]
Add SPI _WKProcessPoolConfiguration.javaScriptConfigurationDirectory
https://bugs.webkit.org/show_bug.cgi?id=199917

Reviewed by Sam Weinig.

Source/WebKit:

* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
(-[_WKProcessPoolConfiguration javaScriptConfigurationDirectory]):
(-[_WKProcessPoolConfiguration setJavaScriptConfigurationDirectory:]):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::sendWebProcessDataStoreParameters):

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/WKProcessPoolConfiguration.mm:
(TEST):

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

33 hours ago[ Mojave Debug WK1 ] Layout Test imported/blink/storage/indexeddb/blob-basics-metadat...
tsavell@apple.com [Mon, 22 Jul 2019 16:59:03 +0000 (16:59 +0000)]
[ Mojave Debug WK1 ] Layout Test imported/blink/storage/indexeddb/blob-basics-metadata.html is Timing out (200002)
https://bugs.webkit.org/show_bug.cgi?id=200002

Unreviewed test gardening.

* platform/mac-wk1/TestExpectations:

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

34 hours ago[ews-build] ReRunWebKitTests should use similar logic for evaluateCommand as RunWebKi...
aakash_jain@apple.com [Mon, 22 Jul 2019 15:48:36 +0000 (15:48 +0000)]
[ews-build] ReRunWebKitTests should use similar logic for evaluateCommand as RunWebKitTests
https://bugs.webkit.org/show_bug.cgi?id=199980

Reviewed by Jonathan Bedard.

* BuildSlaveSupport/ews-build/steps.py:
(ReRunWebKitTests.evaluateCommand): Updatd to use similar logic as RunWebKitTests.
* BuildSlaveSupport/ews-build/steps_unittest.py:
(TestRunWebKitTests): Modified to make it generic so as to re-use tests.
(TestReRunWebKitTests): Run all TestRunWebKitTests unit-tests for ReRunWebKitTests as well.

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

36 hours ago[webkitpy] Add an unit test for setting up the driver environment without starting it.
clopez@igalia.com [Mon, 22 Jul 2019 14:25:00 +0000 (14:25 +0000)]
[webkitpy] Add an unit test for setting up the driver environment without starting it.
https://bugs.webkit.org/show_bug.cgi?id=199945

Reviewed by Michael Catanzaro.

This adds an unit test for the change implemented in r247663.

* Scripts/webkitpy/port/driver_unittest.py:
(DriverTest.test_setup_environ_base_vars):
(DriverTest):
(DriverTest.test_setup_environ_without_starting_driver):

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

36 hours agoRemove some unneeded code in MathOperator
commit-queue@webkit.org [Mon, 22 Jul 2019 13:47:52 +0000 (13:47 +0000)]
Remove some unneeded code in MathOperator
https://bugs.webkit.org/show_bug.cgi?id=199935

Patch by Rob Buis <rbuis@igalia.com> on 2019-07-22
Reviewed by Frédéric Wang.

Remove unused method.

No new tests, not changing behavior.

* rendering/mathml/MathOperator.h:

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

41 hours ago[SOUP] WebSockets: use new api to send text messages
carlosgc@webkit.org [Mon, 22 Jul 2019 08:47:02 +0000 (08:47 +0000)]
[SOUP] WebSockets: use new api to send text messages
https://bugs.webkit.org/show_bug.cgi?id=199936

Reviewed by Michael Catanzaro.

New API allows to include null character in text messages.

* NetworkProcess/soup/WebSocketTaskSoup.cpp:
(WebKit::WebSocketTask::didReceiveMessageCallback): Pass data size to String::fromUTF8().
(WebKit::WebSocketTask::sendString): Use soup_websocket_connection_send_message() instead of
soup_websocket_connection_send_text() when available. Also use
StrictConversionReplacingUnpairedSurrogatesWithFFFD options when converting to UTF-8.

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

47 hours ago[iOS] [WebKit2] Add limited support for -isPosition:atBoundary:inDirection: in WKCont...
wenson_hsieh@apple.com [Mon, 22 Jul 2019 03:35:38 +0000 (03:35 +0000)]
[iOS] [WebKit2] Add limited support for -isPosition:atBoundary:inDirection: in WKContentView
https://bugs.webkit.org/show_bug.cgi?id=199993
<rdar://problem/49523528>

Reviewed by Beth Dakin.

Source/WebKit:

Add support for -isPosition:atBoundary:inDirection:, only in the cases where the given position is the start or
and position and the given granularity is UITextGranularityParagraph.

Test: EditorStateTests.ParagraphBoundary

* Shared/EditorState.cpp:
(WebKit::EditorState::PostLayoutData::encode const):
(WebKit::EditorState::PostLayoutData::decode):
* Shared/EditorState.h:

Add a couple of bits to indicate whether the selection start or end positions are at paragraph boundaries.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView isPosition:atBoundary:inDirection:]):

Implement this to return selectionStartIsAtParagraphBoundary or selectionEndIsAtParagraphBoundary.

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::platformEditorState const):

Tools:

Add a new API test to verify the behavior of -isPosition:atBoundary:inDirection:.

* TestWebKitAPI/Tests/WebKitCocoa/EditorStateTests.mm:
(TestWebKitAPI::TEST):
* TestWebKitAPI/cocoa/TestWKWebView.h:

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

2 days agoAdd DataListButtonElement.cpp to unified sources
annulen@yandex.ru [Sun, 21 Jul 2019 22:59:38 +0000 (22:59 +0000)]
Add DataListButtonElement.cpp to unified sources
https://bugs.webkit.org/show_bug.cgi?id=199989

Reviewed by Michael Catanzaro.

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:

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

2 days agoAdd accessibilityInsertText for text insertion in edit fields.
commit-queue@webkit.org [Sun, 21 Jul 2019 22:15:19 +0000 (22:15 +0000)]
Add accessibilityInsertText for text insertion in edit fields.
https://bugs.webkit.org/show_bug.cgi?id=199973

Patch by Andres Gonzalez <andresg_22@apple.com> on 2019-07-21
Reviewed by Chris Fleizach.

Renamed accessibilityInsertText to _accessibilityInsertText.

Source/WebCore:

* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper _accessibilityInsertText:]):
(-[WebAccessibilityObjectWrapper accessibilityInsertText:]): Deleted.
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper _accessibilityInsertText:]):
(-[WebAccessibilityObjectWrapper accessibilityInsertText:]): Deleted.

Tools:

* DumpRenderTree/ios/AccessibilityUIElementIOS.mm:
(AccessibilityUIElement::insertText):
* DumpRenderTree/mac/AccessibilityUIElementMac.mm:
(AccessibilityUIElement::insertText):
* WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm:
(WTR::AccessibilityUIElement::insertText):
* WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm:
(WTR::AccessibilityUIElement::insertText):

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

2 days ago[WHLSL] Checker needs to setError() when a property access node can't commit its...
sbarati@apple.com [Sun, 21 Jul 2019 18:35:50 +0000 (18:35 +0000)]
[WHLSL] Checker needs to setError() when a property access node can't commit its base type
https://bugs.webkit.org/show_bug.cgi?id=199978

Reviewed by Dean Jackson.

Source/WebCore:

Test: webgpu/whlsl/null-array-property-access.html

* Modules/webgpu/WHLSL/WHLSLChecker.cpp:
(WebCore::WHLSL::Checker::finishVisiting):

LayoutTests:

* webgpu/whlsl/null-array-property-access-expected.txt: Added.
* webgpu/whlsl/null-array-property-access.html: Added.

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

2 days ago[WHLSL] Return the zero-value enum in the enum-from-integer constructor when the...
sbarati@apple.com [Sun, 21 Jul 2019 18:31:53 +0000 (18:31 +0000)]
[WHLSL] Return the zero-value enum in the enum-from-integer constructor when the integer is not a valid enum value
https://bugs.webkit.org/show_bug.cgi?id=199853

Reviewed by Dean Jackson.

Source/WebCore:

Test: webgpu/whlsl/enum-integer-constructor.html

* Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.cpp:
(WebCore::WHLSL::Metal::writeNativeFunction):

LayoutTests:

* webgpu/whlsl/enum-integer-constructor-expected.txt: Added.
* webgpu/whlsl/enum-integer-constructor.html: Added.

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

2 days ago[iOS] Fast and complex text codepaths disagree about how to lay out bopomofo with...
mmaxfield@apple.com [Sun, 21 Jul 2019 17:23:54 +0000 (17:23 +0000)]
[iOS] Fast and complex text codepaths disagree about how to lay out bopomofo with tone marks
https://bugs.webkit.org/show_bug.cgi?id=199912
<rdar://problem/52182454>

Reviewed by Simon Fraser.

Source/WebCore:

This is because CoreText has special composition rules for CJK languages, which we don't have in our simple
text codepath. Rather than implementing the composition rules in WebKit, we can simply disable them in
CoreText.

Test: fast/text/international/system-language/composition.html

* platform/graphics/mac/SimpleFontDataCoreText.cpp:
(WebCore::Font::getCFStringAttributes const):

Source/WebCore/PAL:

* pal/spi/cocoa/CoreTextSPI.h:

LayoutTests:

* css3/font-feature-font-face-local-expected.html:
* css3/font-feature-font-face-local.html:
* editing/mac/selection/word-thai-expected.txt:
* editing/mac/selection/word-thai.html:
* fast/text/international/system-language/composition-expected.txt: Added.
* fast/text/international/system-language/composition.html: Added.
* platform/ios/fast/text/crash-complex-text-surrogate-expected.txt:
* svg/custom/glyph-selection-arabic-forms-expected.txt:

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

2 days agoSpeed up HashTable decoding by reserving capacity and avoiding rehashing
cdumez@apple.com [Sun, 21 Jul 2019 03:53:31 +0000 (03:53 +0000)]
Speed up HashTable decoding by reserving capacity and avoiding rehashing
https://bugs.webkit.org/show_bug.cgi?id=199982

Reviewed by Saam Barati.

Source/WebKit:

Use HashMap::reserveInitialCapacity() in the HashMap IPC decoder for
performance. I measured a ~35% improvement when decoding a very large
HashMap of Strings (~160k entries) in the context of the
StorageManager::GetValues IPC.

* Platform/IPC/ArgumentCoders.h:
* Shared/API/c/WKDictionary.cpp:
(WKDictionaryCreate):

Source/WTF:

Introduce reserveInitialCapacity() on HashMap to reserve capacity on a
HashMap and cut down on rehashing cost when possible.

* wtf/HashMap.h:
* wtf/HashTable.h:
(WTF::HashTable::reserveInitialCapacity):

* wtf/persistence/PersistentCoders.h:
Use HashMap::reserveInitialCapacity() in the HashMap persistent decoder for
performance.

Tools:

Add API test coverage.

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

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

3 days agoMicro-optimize HashMap & String IPC decoding
cdumez@apple.com [Sun, 21 Jul 2019 01:04:07 +0000 (01:04 +0000)]
Micro-optimize HashMap & String IPC decoding
https://bugs.webkit.org/show_bug.cgi?id=199967

Reviewed by Geoffrey Garen.

The legacy HashMap decoder (returning a boolean) was failing to WTFMove()
the key & value when calling HashMap::add(). The modern decoder (returning
an Optional) was properly using WTFMove(). Rewrite the legacy HashMap decoder
to call the modern one to reduce code duplication and to get this optimization.

Also, encode HashMap::size() as a uint32_t instead of a uint64_t since
HashMap::size() returns an 'unsigned int' type. Finally, update the modern
decoder to WTFMove(hashMap) when returning. Because the function returns an
Optional<HashMap> and not a HashMap, I do not believe we get return value
optimization (RVO).

Do similar changes to String IPC coders.

* Platform/IPC/ArgumentCoders.cpp:
(IPC::decodeStringText):
(IPC::ArgumentCoder<String>::decode):
* Platform/IPC/ArgumentCoders.h:

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

3 days agoAdd accessibilityInsertText for text insertion in edit fields.
commit-queue@webkit.org [Sat, 20 Jul 2019 22:04:10 +0000 (22:04 +0000)]
Add accessibilityInsertText for text insertion in edit fields.
https://bugs.webkit.org/show_bug.cgi?id=199973

Patch by Andres Gonzalez <andresg_22@apple.com> on 2019-07-20
Reviewed by Chris Fleizach.

Source/WebCore:

Tests: accessibility/insert-newline.html
       accessibility/ios-simulator/insert-newline.html

Accessibility clients like VoiceOver and Voice Control were entering
text in text fields by replacing the entire content of the field
(SetValue) and then setting the insertion point to the appropriate
offset (SetSelectedTextRange). accessibilityInsertText gives a simpler
interface to clients to insert text at the insertion point location.
In addition, this provides a workaround for the issue encountered with
the previous method when inserting a linebreak.

* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::insertText):
* accessibility/AccessibilityObject.h:
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper accessibilityInsertText:]):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper accessibilityInsertText:]):

Tools:

Glue code to run new LayoutTests.
* WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h:
* WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl:
* WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:
(WTR::AccessibilityUIElement::insertText):
* WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm:
(WTR::AccessibilityUIElement::insertText):
* WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm:
(WTR::AccessibilityUIElement::insertText):
* WebKitTestRunner/InjectedBundle/win/AccessibilityUIElementWin.cpp:
(WTR::AccessibilityUIElement::insertText):

LayoutTests:

Tests for inserting a newline in the middle of a text line and checking
that the insertion point and text ranges are correct.
* accessibility/insert-newline-expected.txt: Added.
* accessibility/insert-newline.html: Added.
* accessibility/ios-simulator/insert-newline-expected.txt: Added.
* accessibility/ios-simulator/insert-newline.html: Added.

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

3 days agoREGRESSION(r246033/r246496): [GTK] Kinetic scrolling doesn't work
commit-queue@webkit.org [Sat, 20 Jul 2019 20:11:06 +0000 (20:11 +0000)]
REGRESSION(r246033/r246496): [GTK] Kinetic scrolling doesn't work
https://bugs.webkit.org/show_bug.cgi?id=199322

Patch by Alexander Mikhaylenko <exalm7659@gmail.com> on 2019-07-20
Reviewed by Michael Catanzaro.

Source/WebCore:

Check ENABLE(KINETIC_SCROLLING) instead of ENABLE(ASYNC_SCROLLING) for kinetic scrolling.

* platform/PlatformWheelEvent.h:
* platform/generic/ScrollAnimatorGeneric.cpp:
(WebCore::ScrollAnimatorGeneric::handleWheelEvent):
* platform/gtk/PlatformWheelEventGtk.cpp:
(WebCore::PlatformWheelEvent::PlatformWheelEvent):

Source/WebKit:

Check ENABLE(KINETIC_SCROLLING) instead of ENABLE(ASYNC_SCROLLING) when setting wheel event phase and momentum phase.

* Shared/WebEventConversion.cpp:
(WebKit::WebKit2PlatformWheelEvent::WebKit2PlatformWheelEvent):

Source/WTF:

Introduce ENABLE_KINETIC_SCROLLING to explicitly always have kinetic scrolling on GTK.

* wtf/Platform.h:

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

3 days ago[LFC][TFC] Introduce table formatting context.
zalan@apple.com [Sat, 20 Jul 2019 18:53:57 +0000 (18:53 +0000)]
[LFC][TFC] Introduce table formatting context.
https://bugs.webkit.org/show_bug.cgi?id=199979
<rdar://problem/53346292>

Reviewed by Antti Koivisto.

Add the basic class structure for the table formatting context.
https://www.w3.org/TR/CSS22/tables.html

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* layout/FormattingState.h:
(WebCore::Layout::FormattingState::isTableFormattingState const):
* layout/tableformatting/TableFormattingContext.cpp: Added.
(WebCore::Layout::TableFormattingContext::TableFormattingContext):
(WebCore::Layout::TableFormattingContext::layout const):
* layout/tableformatting/TableFormattingContext.h: Added.
* layout/tableformatting/TableFormattingState.cpp: Added.
(WebCore::Layout::TableFormattingState::TableFormattingState):
(WebCore::Layout::TableFormattingState::~TableFormattingState):
* layout/tableformatting/TableFormattingState.h: Added.
* layout/tableformatting/TableInvalidation.cpp: Added.
(WebCore::Layout::TableInvalidation::invalidate):
* layout/tableformatting/TableInvalidation.h: Added.

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

3 days ago[LFC][IFC] Add support for mid-word break.
zalan@apple.com [Sat, 20 Jul 2019 18:52:15 +0000 (18:52 +0000)]
[LFC][IFC] Add support for mid-word break.
https://bugs.webkit.org/show_bug.cgi?id=199976
<rdar://problem/53337349>

Reviewed by Antti Koivisto.

Introduce leading and trailing InlineTextItem to support incoming and outgoing partial content.
TextUtil::split is a straight copy of SimpleLineLayout::split.

* layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
(WebCore::Layout::inlineItemWidth):
(WebCore::Layout::LineLayout::close):
(WebCore::Layout::LineLayout::placeInlineItem):
(WebCore::Layout::LineLayout::layout):
* layout/inlineformatting/InlineTextItem.cpp:
(WebCore::Layout::InlineTextItem::split const):
(WebCore::Layout::InlineTextItem::split): Deleted.
* layout/inlineformatting/InlineTextItem.h:
(WebCore::Layout::InlineTextItem::inlineBox const):
* layout/inlineformatting/text/TextUtil.cpp:
(WebCore::Layout::TextUtil::split):
* layout/inlineformatting/text/TextUtil.h:

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

3 days ago[Text autosizing] Do not nuke the style on dynamicViewportSizeUpdate
zalan@apple.com [Sat, 20 Jul 2019 13:47:11 +0000 (13:47 +0000)]
[Text autosizing] Do not nuke the style on dynamicViewportSizeUpdate
https://bugs.webkit.org/show_bug.cgi?id=199718
<rdar://problem/53344961>

Reviewed by Simon Fraser.

Source/WebCore:

When the page scale changes (e.g. as the result of shink to fit mode) we need to visit all the text content on the page and check whether they need to be boosted.
Currently we call setNeedsRecalcStyleInAllFrames() to accomplish it. Unfortunatelly setNeedsRecalcStyleInAllFrames destroys all the style information which means that the
subsequent styleResolve() needs to start from scratch.
This patch addresses this issue by directly adjusting the computed style information when text boosting is required and schedules layout accordingly. We also trigger this style adjusting
on a timer so that rapid dynamicViewportSizeUpdate() calls won't trigger redundant layouts.

* css/StyleResolver.cpp:
(WebCore::hasTextChild):
(WebCore::StyleResolver::adjustRenderStyleForTextAutosizing):
(WebCore::hasTextChildren): Deleted.
* css/StyleResolver.h:
* page/FrameView.h:
* page/Page.cpp:
(WebCore::Page::invalidateTextAutoSizeInAllFrames):
* page/Page.h:

Source/WebKit:

* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_textAutoSizingAdjustmentTimer):
(WebKit::WebPage::close):
(WebKit::WebPage::didCommitLoad):
(WebKit::WebPage::textAutoSizingAdjustmentTimerFired):
(WebKit::m_shrinkToFitContentTimer): Deleted.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::dynamicViewportSizeUpdate):
(WebKit::WebPage::resetIdempotentTextAutosizingIfNeeded):
(WebKit::WebPage::resetTextAutosizing):
(WebKit::WebPage::viewportConfigurationChanged):

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

3 days ago[WHLSL] Make enums work
sbarati@apple.com [Sat, 20 Jul 2019 12:40:22 +0000 (12:40 +0000)]
[WHLSL] Make enums work
https://bugs.webkit.org/show_bug.cgi?id=199634

Reviewed by Robin Morisset.

Source/WebCore:

This patch makes enums work. There were a couple changes needed to do this work:
1. In the metal codegen, we were emitting code like "EnumType.EnumValue"
instead of "EnumType::EnumValue".

2. Inside the enumeration declaration AST node, we track enums in a HashMap
because we need to look up names of enum values in that map in parts of the
compiler. However, HashMap is not ordered but we were relying on the iteration
order of it to generate the default values of enums. E.g, in: "enum { Foo = 10, Bar }",
Bar should be 11. However, there was no guarantee that we iterated over Bar
after Foo. Instead, we just track the default values as we parse an enum
inside of the parser. This allows us to continue to keep using HashMap without
also adding an auxiliary data structure (or using more memory in some way) to
track the order of the enum elements.

I've also filed a patch to do follow-up work on implementing the correct
operational behavior when constructing an enum from its underlying type when
the underlying value does not match any enum value:
https://bugs.webkit.org/show_bug.cgi?id=199853

Tests: webgpu/whlsl/enums-2.html
       webgpu/whlsl/enums.html

* Modules/webgpu/WHLSL/AST/WHLSLEnumerationMember.h:
(WebCore::WHLSL::AST::EnumerationMember::EnumerationMember):
(WebCore::WHLSL::AST::EnumerationMember::value):
(WebCore::WHLSL::AST::EnumerationMember::setValue): Deleted.
* Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp:
(WebCore::WHLSL::Metal::FunctionDefinitionWriter::visit):
(WebCore::WHLSL::Metal::FunctionDefinitionWriter::constantExpressionString):
* Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.cpp:
(WebCore::WHLSL::Metal::TypeNamer::emitNamedTypeDefinition):
* Modules/webgpu/WHLSL/WHLSLASTDumper.cpp:
(WebCore::WHLSL::ASTDumper::visit):
* Modules/webgpu/WHLSL/WHLSLChecker.cpp:
(WebCore::WHLSL::Checker::visit):
* Modules/webgpu/WHLSL/WHLSLParser.cpp:
(WebCore::WHLSL::Parser::parseEnumerationDefinition):
(WebCore::WHLSL::Parser::parseEnumerationMember):
* Modules/webgpu/WHLSL/WHLSLParser.h:
* Modules/webgpu/WHLSL/WHLSLVisitor.cpp:
(WebCore::WHLSL::Visitor::visit):

LayoutTests:

* webgpu/whlsl/enums-2-expected.txt: Added.
* webgpu/whlsl/enums-2.html: Added.
* webgpu/whlsl/enums-expected.txt: Added.
* webgpu/whlsl/enums.html: Added.

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

4 days agoMove webkit.css to opensource to support resultsdbpy's frontend
commit-queue@webkit.org [Sat, 20 Jul 2019 02:01:56 +0000 (02:01 +0000)]
Move webkit.css to opensource to support resultsdbpy's frontend
https://bugs.webkit.org/show_bug.cgi?id=199957

Patch by Zhifei Fang <zhifei_fang@apple.com> on 2019-07-19
Reviewed by Jonathan Bedard.

* resultsdbpy/resultsdbpy/view/static/library/css/docs.yaml: Added.
* resultsdbpy/resultsdbpy/view/static/library/css/generate-webkit-css-docs: Added.
* resultsdbpy/resultsdbpy/view/static/library/css/index.html: Added.
* resultsdbpy/resultsdbpy/view/static/library/css/webkit.css: Added.

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

4 days agoMove Ref.js to WebKit to support resultsdbpy's frontend
commit-queue@webkit.org [Sat, 20 Jul 2019 01:15:26 +0000 (01:15 +0000)]
Move Ref.js to WebKit to support resultsdbpy's frontend
https://bugs.webkit.org/show_bug.cgi?id=199956

Patch by Zhifei Fang <zhifei_fang@apple.com> on 2019-07-19
Reviewed by Jonathan Bedard.

* resultsdbpy/resultsdbpy/view/static/js/drawer.js:
* resultsdbpy/resultsdbpy/view/static/js/search.js:
* resultsdbpy/resultsdbpy/view/static/js/timeline.js:
* resultsdbpy/resultsdbpy/view/static/library/js/Ref.js: Added.
* resultsdbpy/resultsdbpy/view/static/library/js/Utils.js: Added.
* resultsdbpy/resultsdbpy/view/static/library/js/components/BaseComponents.js: Added.
* resultsdbpy/resultsdbpy/view/static/library/js/components/TimelineComponents.js: Added.
* resultsdbpy/resultsdbpy/view/templates/base.html:
* resultsdbpy/resultsdbpy/view/templates/commits.html:
* resultsdbpy/resultsdbpy/view/templates/documentation.html:
* resultsdbpy/resultsdbpy/view/templates/search.html:
* resultsdbpy/resultsdbpy/view/templates/suite_results.html:
* resultsdbpy/resultsdbpy/view/view_routes.py:

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

4 days ago[webkitpy] Allow the testrunner driver to setup the environment completely without...
clopez@igalia.com [Sat, 20 Jul 2019 00:55:51 +0000 (00:55 +0000)]
[webkitpy] Allow the testrunner driver to setup the environment completely without needing to start the server process.
https://bugs.webkit.org/show_bug.cgi?id=199945

Reviewed by Michael Catanzaro.

Refactor the code to create the Driver temporal directories inside Driver._setup_environ_for_driver().
This allows external callers to setup the environment for running tests by calling that method without needing to start the server process.
When this callers finish testing, it is enough with calling either Driver.stop() or Driver._delete_temporal_directories().

* Scripts/webkitpy/port/driver.py:
(Driver._setup_environ_for_driver):
(Driver._create_temporal_directories):
(Driver):
(Driver._start):
(Driver._delete_temporal_directories):
(Driver.stop):
* Scripts/webkitpy/w3c/wpt_runner.py: Not needed anymore to start the driver since this doesnt need the server process running.
(main):
* Scripts/webkitpy/webdriver_tests/webdriver_test_runner.py: Ditto.
(WebDriverTestRunner.__init__):
* glib/api_test_runner.py:
(TestRunner._setup_testing_environment): Ditto.

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

4 days agoRemote WebInspector should enable mock capture devices in UIProcess if doing it in...
youenn@apple.com [Sat, 20 Jul 2019 00:55:16 +0000 (00:55 +0000)]
Remote WebInspector should enable mock capture devices in UIProcess if doing it in WebProcess
https://bugs.webkit.org/show_bug.cgi?id=199924
<rdar://problem/50552067>

Reviewed by Devin Rousso.

Source/WebCore:

Add necessary API to set mock capture devices override.
In case of desynchronization between webprocess and uiprocess, make sure to return early
and fail capture instead of crashing.

* inspector/InspectorClient.h:
(WebCore::InspectorClient::setMockCaptureDevicesEnabled):
* inspector/agents/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::disable):
(WebCore::InspectorPageAgent::overrideSetting):
* platform/mock/MockRealtimeMediaSourceCenter.cpp:

Source/WebKit:

Add IPC plumbery to pass inspector override value for mock capture devices.
Add an override in UserMediaPermissionRequestManagerProxy so that the value stays in sync with web inspector.
The override will be removed when web inspector goes away.

* UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
(WebKit::UserMediaPermissionRequestManagerProxy::syncWithWebCorePrefs const):
* UIProcess/UserMediaPermissionRequestManagerProxy.h:
(WebKit::UserMediaPermissionRequestManagerProxy::setMockCaptureDevicesEnabledOverride):
* UIProcess/WebInspectorProxy.cpp:
(WebKit::WebInspectorProxy::setMockCaptureDevicesEnabled):
* UIProcess/WebInspectorProxy.h:
* UIProcess/WebInspectorProxy.messages.in:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::setMockCaptureDevicesEnabledOverride):
* UIProcess/WebPageProxy.h:
* WebProcess/WebCoreSupport/WebInspectorClient.cpp:
(WebKit::WebInspectorClient::setMockCaptureDevicesEnabled):
* WebProcess/WebCoreSupport/WebInspectorClient.h:
* WebProcess/WebPage/WebInspector.cpp:
(WebKit::WebInspector::setMockCaptureDevicesEnabled):
* WebProcess/WebPage/WebInspector.h:

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

4 days agofast/scrolling/ipad/* tests running on Mac
jbedard@apple.com [Sat, 20 Jul 2019 00:40:25 +0000 (00:40 +0000)]
fast/scrolling/ipad/* tests running on Mac
https://bugs.webkit.org/show_bug.cgi?id=199969
<rdar://problem/52531653>

Unreviewed test gardening.

* TestExpectations: Skip fast/scrolling/ipad on all platforms.
* platform/ios/TestExpectations: Move to generic TestExpectations.

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

4 days agoWeb Content process gets stuck suspended after navigating away from a system preview
timothy_horton@apple.com [Fri, 19 Jul 2019 23:10:00 +0000 (23:10 +0000)]
Web Content process gets stuck suspended after navigating away from a system preview
https://bugs.webkit.org/show_bug.cgi?id=199965
<rdar://problem/53109004>

Reviewed by Dean Jackson.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _isBackground]):
* UIProcess/ios/WKSystemPreviewView.h:
* UIProcess/ios/WKSystemPreviewView.mm:
(-[WKSystemPreviewView web_initWithFrame:webView:mimeType:]):
(-[WKSystemPreviewView web_isBackground]):
Apply the fix from r193481 to WKSystemPreviewView as well, having it
become a WKApplicationStateTrackingView and plumbing that through
to our is-background machinery.

We really, really should instead have WKWebView itself be the application
state tracking view, but that is a bigger change (and has some implications
for full-screen video and whatnot).

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

4 days agoProvide correct names for UIContextMenuInteraction API replacements
dino@apple.com [Fri, 19 Jul 2019 22:50:17 +0000 (22:50 +0000)]
Provide correct names for UIContextMenuInteraction API replacements
https://bugs.webkit.org/show_bug.cgi?id=199966

Reviewed by Tim Horton.

We had some old incorrect names for replacements to SPI. While
here, I reordered and expanded the documentation for the new API.

* UIProcess/API/Cocoa/WKUIDelegate.h:
* UIProcess/API/Cocoa/WKUIDelegatePrivate.h:

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

4 days ago[iOS WK2] Allow scrolling interaction on frames and oveflow scroll even when the...
simon.fraser@apple.com [Fri, 19 Jul 2019 22:49:32 +0000 (22:49 +0000)]
[iOS WK2] Allow scrolling interaction on frames and oveflow scroll even when the main frame is rubber-banding
https://bugs.webkit.org/show_bug.cgi?id=199963
rdar://problem/52897797

Reviewed by Tim Horton.

Adopt UIKit SPI to allow for scrolling of inner UIScrollViews when the outer one is still rubber-banding.

* Platform/spi/ios/UIKitSPI.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
* UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
(WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateAfterChildren):

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

4 days ago[Apple Pay] Log less in PaymentCoordinator::shouldEnableApplePayAPIs()
aestes@apple.com [Fri, 19 Jul 2019 22:30:47 +0000 (22:30 +0000)]
[Apple Pay] Log less in PaymentCoordinator::shouldEnableApplePayAPIs()
https://bugs.webkit.org/show_bug.cgi?id=199958

Reviewed by Tim Horton.

Only log when APIs are disabled due to user scripts.

* Modules/applepay/PaymentCoordinator.cpp:
(WebCore::PaymentCoordinator::shouldEnableApplePayAPIs const):

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

4 days ago[iOS] REGRESSION (r241734): Autocorrection highlight should hide when field becomes...
dbates@webkit.org [Fri, 19 Jul 2019 21:58:15 +0000 (21:58 +0000)]
[iOS] REGRESSION (r241734): Autocorrection highlight should hide when field becomes defocused
https://bugs.webkit.org/show_bug.cgi?id=199807
<rdar://problem/52760259>

Reviewed by Wenson Hsieh.

Sometimes the correction highlight may not hide when defocusing an editable field.
This occurs only when a person pressed a key in a non-editable element beforehand.
We need to reset some state to force a re-computation of whether a keyboard is still
needed whenever an element is defocused (blurred in web paralance).

Following r241734 both editable and non-editable key events are handled using the same
code path. This is accomplished by having WKContentView's -_requiresKeyboardWhenFirstResponder
return YES to tell UIKit it needs a keyboard even when there is no editable element focused.
As a result UIKit retains all the keyboard state, including keeping the correction highlight
visible. Prior to r241734 WKContentView's -_requiresKeyboardWhenFirstResponder would not return
YES when a non-editable element was focused and hence UIKit would tear down the keyboard
and its state, including the correction highlight. In r245154, we made keyboard instantiate
for a focused non-editable element lazy as a performance optimization. Although r245154
kept the r241734 behavior (just made it lazy) it re-wrote the code in such a way that we
can utilize it as a hook to fix this bug. In particular, we now clear the bit about a
seen keydown in a non-editable element whenever we are defocusing an editable element
before we reload the input views, as part of hiding the keyboard. On the reload, UIKit
will call -_requiresKeyboardWhenFirstResponder, WebKit will respond with NO now that
a non-editable element is focused and hence UIKit will do what it did pre r241734: tear
down the keyboard.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _didCommitLoadForMainFrame]): Clear the bit about a seen keydown here
so that we don't keep the keyboard around on a new page commit. This includes the case
when the same page is reloaded. There is not much advantage to keeping the keyboard
around across reloads and not doing so will reduce our memory footprint.
(-[WKContentView _elementDidBlur]): Clear the same bit as well when defocusing an
editable element. This will cause UIKit to tear down the keyboard on reload removing
the correction highlight.

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

4 days agoAdd a menu item to toggle between showing and hiding link previews
dino@apple.com [Fri, 19 Jul 2019 21:17:50 +0000 (21:17 +0000)]
Add a menu item to toggle between showing and hiding link previews
https://bugs.webkit.org/show_bug.cgi?id=199940
<rdar://problem/53032288>

Reviewed by Beth Dakin.

Source/WebCore:

New strings for Show/Hide Link Previews.

* en.lproj/Localizable.strings:

Source/WebKit:

Add a new _WKElementAction that toggles the display of link previews
in context menus, and add it to the default set of actions we provide
for links.

When a UIAction is created from this new _WKElementAction type,
it can be identified by WKElementActionTypeToggleShowLinkPreviewsIdentifier.
This allows us to check a UIMenu provided by a delegate to make sure
that they have provided the toggle menu item. If they haven't, we add it
back.

The preference for showing links is moved from kCFPreferencesAnyApplication
to standard user defaults, so that it can be set no matter what the
hosting application is.

* UIProcess/API/Cocoa/_WKElementAction.h: New action type.
* UIProcess/API/Cocoa/_WKElementAction.mm:
(+[_WKElementAction _elementActionWithType:customTitle:assistant:]):
(+[_WKElementAction imageForElementActionType:]): Use eye.fill for now.
I'll need to check with HI to see if there is a more appropriate glyph.
(elementActionTypeToUIActionIdentifier):
(uiActionIdentifierToElementActionType):

* UIProcess/ios/WKActionSheetAssistant.mm: Add the toggle action to
the default set.
(-[WKActionSheetAssistant defaultActionsForLinkSheet:]):

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _registerPreview]): No need to listen for CFPreferences
notifications any more.
(-[WKContentView _unregisterPreview]):
(menuWithShowLinkPreviewAction): New method that adds the UIAction
for toggling previews to a UIMenu if necessary.
(-[WKContentView assignLegacyDataForContextMenuInteraction]):
(-[WKContentView _contextMenuInteraction:configurationForMenuAtLocation:completion:]):
(-[WKContentView _showLinkPreviewsPreferenceChanged:]): Deleted.
(titleForMenu): Deleted. URL text previews will be provided separately.

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

4 days ago[iOS] Entering 2FA code on idmsa.apple.com causes unexpected scrolling
wenson_hsieh@apple.com [Fri, 19 Jul 2019 19:55:20 +0000 (19:55 +0000)]
[iOS] Entering 2FA code on idmsa.apple.com causes unexpected scrolling
https://bugs.webkit.org/show_bug.cgi?id=199949
<rdar://problem/49944428>

Reviewed by Tim Horton and Megan Gardner.

Source/WebKit:

Since at least iOS 11, -[UIScrollView _adjustForAutomaticKeyboardInfo:animated:lastAdjustment:] adjusts the
scroll view's content offset to account for updated keyboard bottom insets. In WebKit, we call this method
whenever keyboard geometry changes (based on system notifications, such as UIKeyboardWillHideNotification).

When switching between focused form fields, we hide the keyboard for the previous focused element prior to
showing the keyboard for the newly focused element. This means that we will actually dismiss the keyboard in the
process of changing the focused element, which posts keyboard geometry notifications, which causes us to scroll
WKScrollView.

On iOS 12, this would be immediately followed by re-presenting the keyboard for the new focused element, which
causes us to adjust the scroll view back to its original position right away; this means that the scrolling that
happens as a result of adjusting for the keyboard insets after dismissal doesn't result in any visible change.

However, on iOS 13, after r239441 and r244546, we now defer scrolling and zooming to reveal the focused element
until later; this means the scrolling that happens as a result of initially dismissing the keyboard now causes a
consistent jump in the scroll view's scroll position (whereas on iOS 12, this only happens rarely, and the jump
is also less noticeable).

To mitigate this, we detect the case where we're moving focus from one element to another; if we're about to
show a keyboard for the newly focused element, then we should avoid scrolling as a result of the impending
"keyboard will hide" notification.

Test: fast/forms/ios/no-scrolling-when-moving-focus-between-adjacent-fields.html

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _keyboardChangedWithInfo:adjustScrollView:]):
(-[WKWebView _keyboardWillHide:]):
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(shouldShowKeyboardForElement):

Add a helper to determine whether we're focusing an element which presents a "keyboard" (i.e. a UIKit input
view, as opposed to modal select pickers, modal date pickers, or fields with inputmode="none", for which we
don't show an input view).

(-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:activityStateChanges:userObject:]):
(-[WKContentView shouldIgnoreKeyboardWillHideNotification]):

LayoutTests:

Add a new layout test to verify that moving focus between horizontally adjacent form controls doesn't induce
vertical scrolling.

* fast/forms/ios/no-scrolling-when-moving-focus-between-adjacent-fields-expected.txt: Added.
* fast/forms/ios/no-scrolling-when-moving-focus-between-adjacent-fields.html: Added.

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

4 days agoLinks stop working after long-pressing a link (WK1)
commit-queue@webkit.org [Fri, 19 Jul 2019 19:47:54 +0000 (19:47 +0000)]
Links stop working after long-pressing a link (WK1)
https://bugs.webkit.org/show_bug.cgi?id=199952
<rdar://problem/52291860>

Patch by Antoine Quint <graouts@apple.com> on 2019-07-19
Reviewed by Wenson Hsieh.

Source/WebCore:

Test: fast/events/touch/ios/click-after-long-press.html

When EventHandler::tryToBeginDragAtPoint() is called, we must reset m_mousePressed to false so that
WebChromeClientIOS::observedContentChange() is called by EventHandler::mousePressed() when we would
process the next tap after a drag interaction.

* page/ios/EventHandlerIOS.mm:
(WebCore::EventHandler::tryToBeginDragAtPoint):

LayoutTests:

* fast/events/touch/ios/click-after-long-press-expected.txt: Added.
* fast/events/touch/ios/click-after-long-press.html: Added.

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

4 days agoIndexedDB: error in starting version change transaction may be neglected
sihui_liu@apple.com [Fri, 19 Jul 2019 18:06:09 +0000 (18:06 +0000)]
IndexedDB: error in starting version change transaction may be neglected
https://bugs.webkit.org/show_bug.cgi?id=199818
<rdar://problem/52925738>

Reviewed by Brady Eidson.

For version change transaction, IDBServer didn't wait the result of beginTransaction on the background thread
before giving the IDBClient the result of open request. In this case, beginTransaction may fail to update the
DatabaseVersion in database file or set m_originalDatabaseInfoBeforeVersionChange, but the transaction was
marked as started. When we later set m_databaseInfo with m_originalDatabaseInfoBeforeVersionChange,
m_databaseInfo could become nullptr.

To write a test for this, we will need to simulate an SQLite error. I manually tested this by crafting the
SQLiteStatement in beginTransaction, making it an invalid statement, and verified that error event, instead of
ungradeneeded event is dispatched to the IDBRequest.

* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::startVersionChangeTransaction):
(WebCore::IDBServer::UniqueIDBDatabase::performStartVersionChangeTransaction):
(WebCore::IDBServer::UniqueIDBDatabase::didPerformStartVersionChangeTransaction):
(WebCore::IDBServer::UniqueIDBDatabase::immediateCloseForUserDelete):
(WebCore::IDBServer::UniqueIDBDatabase::beginTransactionInBackingStore): Deleted.
* Modules/indexeddb/server/UniqueIDBDatabase.h:

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

4 days agoRebase fast/forms/ios/typing-in-input-in-iframe.html after r244141
commit-queue@webkit.org [Fri, 19 Jul 2019 16:56:00 +0000 (16:56 +0000)]
Rebase fast/forms/ios/typing-in-input-in-iframe.html after r244141
https://bugs.webkit.org/show_bug.cgi?id=199875
<rdar://problem/50060561>

Patch by Alex Christensen <achristensen@webkit.org> on 2019-07-19
Reviewed by Megan Gardner.

With r247571 and its justification, we need to rebase another test.

* fast/forms/ios/typing-in-input-in-iframe-expected.txt:
* fast/forms/ios/typing-in-input-in-iframe.html:

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

4 days ago[ews-app] EWS status-bubbles are sometimes multi-row with scroll-bar
aakash_jain@apple.com [Fri, 19 Jul 2019 15:58:05 +0000 (15:58 +0000)]
[ews-app] EWS status-bubbles are sometimes multi-row with scroll-bar
https://bugs.webkit.org/show_bug.cgi?id=199939

Reviewed by Jonathan Bedard.

* code-review.js: Disable scrolling.

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

4 days ago[ews-build] Display pre-existing Layout test failure names in the build summary
aakash_jain@apple.com [Fri, 19 Jul 2019 15:54:29 +0000 (15:54 +0000)]
[ews-build] Display pre-existing Layout test failure names in the build summary
https://bugs.webkit.org/show_bug.cgi?id=199941

Reviewed by Jonathan Bedard.

* BuildSlaveSupport/ews-build/steps.py:
(AnalyzeLayoutTestsResults.report_pre_existing_failures):

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

4 days agoUnable to bring up custom media controls on iOS for video.sina.cn
commit-queue@webkit.org [Fri, 19 Jul 2019 15:51:39 +0000 (15:51 +0000)]
Unable to bring up custom media controls on iOS for video.sina.cn
https://bugs.webkit.org/show_bug.cgi?id=199889
<rdar://problem/51883919>

Unreviewed test gardening.

This new test can only run on Internal bots.

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

* platform/ios/TestExpectations:

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

4 days ago[LFC][IFC] Add partial content handling
zalan@apple.com [Fri, 19 Jul 2019 13:35:42 +0000 (13:35 +0000)]
[LFC][IFC] Add partial content handling
https://bugs.webkit.org/show_bug.cgi?id=199930

Reviewed by Antti Koivisto.

Move the actual inline item placement to a dedicated functions. This enables us to
construct a dedicated InlineItem for the partial content and pass it in to this function.

<span>The quick brown fox jumps over the lazy dog</span> <- inline content
[The][ ][quick][ ][brown][ ][fox][ ][jumps][ ][over][ ][the][ ][lazy][ ][dog] <- InlineItems

Line breaking:
[The][ ][qu]
[ick] <- Partial InlineItem (position: 6 length: 3) from [quick] (position: 4 length: 5)

* layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
(WebCore::Layout::LineLayout::close):
(WebCore::Layout::LineLayout::placeInlineItem):
(WebCore::Layout::LineLayout::layout):
(WebCore::Layout::LineInput::LineInput):
(WebCore::Layout::InlineFormattingContext::InlineLayout::layout const):
(WebCore::Layout::InlineFormattingContext::InlineLayout::computedIntrinsicWidth const):
* layout/inlineformatting/InlineTextItem.cpp:
(WebCore::Layout::InlineTextItem::split):
* layout/inlineformatting/InlineTextItem.h:

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

4 days ago[GStreamer] Flush get_range calls during PAUSED->READY in WebKitWebSource
cturner@igalia.com [Fri, 19 Jul 2019 11:43:34 +0000 (11:43 +0000)]
[GStreamer] Flush get_range calls during PAUSED->READY in WebKitWebSource
https://bugs.webkit.org/show_bug.cgi?id=199934

Reviewed by Xabier Rodriguez-Calvar.

Unit testing not applicable.

* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
(webKitWebSrcChangeState): A well-behaved element should unblock streaming threads
during a PAUSED->READY transition, so do that here.

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

4 days ago[GTK][WPE] run-webkit-tests should run with a temporal homedir
clopez@igalia.com [Fri, 19 Jul 2019 09:56:43 +0000 (09:56 +0000)]
[GTK][WPE] run-webkit-tests should run with a temporal homedir
https://bugs.webkit.org/show_bug.cgi?id=199738

Reviewed by Michael Catanzaro.

Run the tests with an empty homedir that is created inside the driver tmpdir.
The driver tmpdir is a random directory created for each test runner that is purged after the run.

This is done to ensure that the test results are not affected by the user settings of any library.

* Scripts/webkitpy/port/driver.py:
(Driver._setup_environ_for_driver):
* Scripts/webkitpy/port/driver_unittest.py:
(DriverTest.test_setup_environ_base_vars):
(DriverTest):
(DriverTest.test_create_temporal_home_dir):

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

4 days agoRemove some unneeded code in MathOperator
commit-queue@webkit.org [Fri, 19 Jul 2019 09:11:35 +0000 (09:11 +0000)]
Remove some unneeded code in MathOperator
https://bugs.webkit.org/show_bug.cgi?id=199935

Patch by Rob Buis <rbuis@igalia.com> on 2019-07-19
Reviewed by Frédéric Wang.

The initialize method is unneeded since the member
variables all use default initialization.

No new tests, not changing behavior.

* rendering/mathml/MathOperator.cpp:
(WebCore::MathOperator::MathOperator):
(WebCore::MathOperator::GlyphAssemblyData::initialize): Deleted.

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

4 days agoRemove pywebsockets from thirdparty
commit-queue@webkit.org [Fri, 19 Jul 2019 08:34:57 +0000 (08:34 +0000)]
Remove pywebsockets from thirdparty
https://bugs.webkit.org/show_bug.cgi?id=199710

Patch by Carlos Garcia Campos <cgarcia@igalia.com> on 2019-07-19
Reviewed by Jonathan Bedard.

Tools:

We have a very old version of pywebsocket in webkitpy thirdparty, but we are also importing pywebsocket as part
of wpt tools. We can simply use the wpt one for all websocket tests and remove the old copy from sources.

* Scripts/webkitpy/layout_tests/servers/websocket_server.py:
(PyWebSocket._prepare_config): Use pywebsocket from imported w3c tools directory.
* Scripts/webkitpy/thirdparty/mod_pywebsocket/COPYING: Removed.
* Scripts/webkitpy/thirdparty/mod_pywebsocket/__init__.py: Removed.
* Scripts/webkitpy/thirdparty/mod_pywebsocket/_stream_base.py: Removed.
* Scripts/webkitpy/thirdparty/mod_pywebsocket/_stream_hixie75.py: Removed.
* Scripts/webkitpy/thirdparty/mod_pywebsocket/_stream_hybi.py: Removed.
* Scripts/webkitpy/thirdparty/mod_pywebsocket/common.py: Removed.
* Scripts/webkitpy/thirdparty/mod_pywebsocket/dispatch.py: Removed.
* Scripts/webkitpy/thirdparty/mod_pywebsocket/extensions.py: Removed.
* Scripts/webkitpy/thirdparty/mod_pywebsocket/handshake/__init__.py: Removed.
* Scripts/webkitpy/thirdparty/mod_pywebsocket/handshake/_base.py: Removed.
* Scripts/webkitpy/thirdparty/mod_pywebsocket/handshake/hybi.py: Removed.
* Scripts/webkitpy/thirdparty/mod_pywebsocket/handshake/hybi00.py: Removed.
* Scripts/webkitpy/thirdparty/mod_pywebsocket/headerparserhandler.py: Removed.
* Scripts/webkitpy/thirdparty/mod_pywebsocket/http_header_util.py: Removed.
* Scripts/webkitpy/thirdparty/mod_pywebsocket/memorizingfile.py: Removed.
* Scripts/webkitpy/thirdparty/mod_pywebsocket/msgutil.py: Removed.
* Scripts/webkitpy/thirdparty/mod_pywebsocket/mux.py: Removed.
* Scripts/webkitpy/thirdparty/mod_pywebsocket/standalone.py: Removed.
* Scripts/webkitpy/thirdparty/mod_pywebsocket/stream.py: Removed.
* Scripts/webkitpy/thirdparty/mod_pywebsocket/util.py: Removed.

LayoutTests:

Update two tests that timeout with the new pywebsocket version, because the server doesn't close the connection
after handshake.AbortedByUserException(). Simply assume onopen to be called a success in handshake like other
tests using handshake.AbortedByUserException() do.

* http/tests/websocket/tests/hybi/handshake-ok-with-legacy-sec-websocket-response-headers-expected.txt:
* http/tests/websocket/tests/hybi/handshake-ok-with-legacy-sec-websocket-response-headers.html:
* http/tests/websocket/tests/hybi/handshake-ok-with-legacy-websocket-response-headers-expected.txt:
* http/tests/websocket/tests/hybi/handshake-ok-with-legacy-websocket-response-headers.html:

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

4 days agoWeb Inspector: Issues toggling multiple breakpoints on one line
drousso@apple.com [Fri, 19 Jul 2019 07:39:12 +0000 (07:39 +0000)]
Web Inspector: Issues toggling multiple breakpoints on one line
https://bugs.webkit.org/show_bug.cgi?id=199918

Reviewed by Joseph Pecoraro.

* UserInterface/Views/SourceCodeTextEditor.js:
(WI.SourceCodeTextEditor):
(WI.SourceCodeTextEditor.prototype.close):
(WI.SourceCodeTextEditor.prototype.textEditorGutterContextMenu):
(WI.SourceCodeTextEditor.prototype.textEditorUpdatedFormatting):
(WI.SourceCodeTextEditor.prototype._handleFormatterDidChange): Added.
Listen for `WI.SourceCode.Event.FormatterDidChange` events as there may be multiple content
views for the same `WI.SourceCode`. Previously, if there were, only the active one would
properly update it's "line -> column -> breakpoint" mapping, causing an error to be thrown
when the non-active content views tried to retrieve the breakpoint for the new line/column.

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

4 days agoFix warning when importing WebKit in Swift
commit-queue@webkit.org [Fri, 19 Jul 2019 03:08:28 +0000 (03:08 +0000)]
Fix warning when importing WebKit in Swift
https://bugs.webkit.org/show_bug.cgi?id=199914
<rdar://problem/52854930>

Patch by Alex Christensen <achristensen@webkit.org> on 2019-07-18
Reviewed by Wenson Hsieh.

* UIProcess/API/Cocoa/NSAttributedString.h:
Declare NSAttributedString and update a swift name.
This fix was proposed by Argyrios Kyrtzidis.

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