WebKit-https.git
2 years agoThick overlines and line-throughs grow in the wrong direction
mmaxfield@apple.com [Tue, 18 Dec 2018 23:38:54 +0000 (23:38 +0000)]
Thick overlines and line-throughs grow in the wrong direction
https://bugs.webkit.org/show_bug.cgi?id=192264

Reviewed by Dean Jackson.

Source/WebCore:

Overlines should grow upward, and line-throughs should stay centered.

Test: fast/css3-text/css3-text-decoration/text-decoration-thicknes-overline-grow-direction.html

* rendering/TextDecorationPainter.cpp:
(WebCore::TextDecorationPainter::paintTextDecoration):
* style/InlineTextBoxStyle.cpp:
(WebCore::visualOverflowForDecorations):

LayoutTests:

I can't figure out a way to test the line-through, so this just tests the overline.

* fast/css3-text/css3-text-decoration/text-decoration-thicknes-overline-grow-direction-expected.html: Added.
* fast/css3-text/css3-text-decoration/text-decoration-thicknes-overline-grow-direction.html: Added.

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

2 years agoFix API test introduced in r239339 on iOS.
achristensen@apple.com [Tue, 18 Dec 2018 23:02:16 +0000 (23:02 +0000)]
Fix API test introduced in r239339 on iOS.
https://bugs.webkit.org/show_bug.cgi?id=192675

* TestWebKitAPI/Tests/WebKitCocoa/SafeBrowsing.mm:
(TEST):
The iOS implementation of the safe browsing warning is a little different.
It does some element creation when it is added to the window so it knows how big it is.
To test these elements, we need to simulate adding it to the window.
A similar technique is done in other iOS API tests, such as SafeBrowsing.ShowWarningSPI.

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

2 years agoJSON.stringify() should throw OOM on StringBuilder overflows.
mark.lam@apple.com [Tue, 18 Dec 2018 22:24:33 +0000 (22:24 +0000)]
JSON.stringify() should throw OOM on StringBuilder overflows.
https://bugs.webkit.org/show_bug.cgi?id=192822
<rdar://problem/46670577>

Reviewed by Saam Barati.

JSTests:

* stress/json-stringify-string-builder-overflow.js: Added.

Source/JavaScriptCore:

* runtime/JSONObject.cpp:
(JSC::Stringifier::stringify):
(JSC::Stringifier::appendStringifiedValue):
(JSC::Stringifier::Holder::appendNextProperty):

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

2 years agoRedeclaration of var over let/const/class should be a syntax error.
ross.kirsling@sony.com [Tue, 18 Dec 2018 22:14:20 +0000 (22:14 +0000)]
Redeclaration of var over let/const/class should be a syntax error.
https://bugs.webkit.org/show_bug.cgi?id=192298

Reviewed by Keith Miller.

JSTests:

* test262.yaml:
* test262/expectations.yaml:
Mark 46 tests as passing.

* stress/block-scope-redeclarations.js:
Add some new tests.

* stress/for-in-invalidate-context-weird-assignments.js:
* stress/for-in-tests.js:
Replace tests for outdated behavior with tests for SyntaxError.

* ChakraCore/test/LetConst/defer3.baseline-jsc:
* ChakraCore/test/LetConst/letvar.baseline-jsc:
Update expectations.

Source/JavaScriptCore:

From https://tc39.github.io/ecma262/#sec-block-static-semantics-early-errors:
It is a Syntax Error if any element of the LexicallyDeclaredNames of StatementList also occurs in the
VarDeclaredNames of StatementList.

Accordingly, this patch ensures that { let x; { var x; } } and { { var x; } let x; } are syntax errors.

For the "var after" scenario:
When checking for existing lexically-declared names, we can't simply check the current var scope;
we need to check *all* enclosing scopes up to (and including) the current var scope. In so doing,
we must also avoid violating the Annex B.3.5 condition that allows `try {} catch (e) { var e; }`.

For the "var before" scenario:
We ensure that lexical scopes always keep track of the vars being hoisted over them; this gives us
a simple way to check the current block's var-declared names prior to making a lexical declaration.

* parser/Parser.cpp:
(JSC::Parser<LexerType>::parseTryStatement):
* parser/Parser.h:
(JSC::Scope::Scope):
(JSC::Scope::setIsSimpleCatchParameterScope): Added.
(JSC::Scope::isSimpleCatchParameterScope): Added.
(JSC::Scope::declareVariable):
(JSC::Scope::addVariableBeingHoisted): Added.
(JSC::Scope::declareLexicalVariable):
(JSC::Scope::hasDeclaredVariable):
(JSC::Scope::hasLexicallyDeclaredVariable): Added.
(JSC::Parser::declareHoistedVariable): Added.
(JSC::Parser::declareVariable):

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

2 years agoSome iOS app crash in FrameLoader::checkCompleted
rniwa@webkit.org [Tue, 18 Dec 2018 22:03:07 +0000 (22:03 +0000)]
Some iOS app crash in FrameLoader::checkCompleted
https://bugs.webkit.org/show_bug.cgi?id=192804
<rdar://problem/44240573>

Reviewed by Tim Horton.

It's possible for the main thread to call into WebCore / UIWebView selectors while Web thread
is trying to send a delegate message. Disable the release assertion while this is happening
so that iOS app would not crash.

Unfortunately no new test as there is no way to easily test UIWebView in iOS,
and this requires a race between the web thread & the main thread.

* dom/ScriptDisallowedScope.h:
(WebCore::ScriptDisallowedScope::InMainThread::isScriptAllowed):
* platform/ios/wak/WebCoreThread.h:
* platform/ios/wak/WebCoreThread.mm:
(WebThreadDelegateMessageScope::WebThreadDelegateMessageScope):
(WebThreadDelegateMessageScope::~WebThreadDelegateMessageScope):
(SendDelegateMessage):

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

2 years agoclang-tidy: Use const reference for MediaTime parameter to prevent object copy
ddkilzer@apple.com [Tue, 18 Dec 2018 21:54:24 +0000 (21:54 +0000)]
clang-tidy: Use const reference for MediaTime parameter to prevent object copy
<https://webkit.org/b/192814>

Reviewed by Mark Lam.

Source/JavaScriptCore:

* runtime/JSCJSValue.h:
(JSC::jsNumber):

Source/WebCore:

* bindings/js/JSDOMConvertNumbers.h:
(WebCore::JSConverter<IDLUnrestrictedDouble>::convert):

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

2 years ago[WebGPU] BindGroupLayout and Device::createBindGroupLayout
justin_fan@apple.com [Tue, 18 Dec 2018 21:51:56 +0000 (21:51 +0000)]
[WebGPU] BindGroupLayout and Device::createBindGroupLayout
https://bugs.webkit.org/show_bug.cgi?id=192817

Reviewed by Dean Jackson.

Update bind-group-layouts to test new functionality.

Source/WebCore:

Implement the emtpy WebGPUBindGroupLayout interface, and enable creation via WebGPUDevice::createBindGroupLayout:
* Modules/webgpu/WebGPUBindGroupLayout.cpp: Added.
(WebCore::WebGPUBindGroupLayout::create):
(WebCore::WebGPUBindGroupLayout::WebGPUBindGroupLayout):
* Modules/webgpu/WebGPUBindGroupLayout.h: Added.
* Modules/webgpu/WebGPUBindGroupLayout.idl: Added. Empty interface for now.
* Modules/webgpu/WebGPUDevice.cpp:
(WebCore::WebGPUDevice::createBindGroupLayout const): Added.
* Modules/webgpu/WebGPUDevice.h:
* Modules/webgpu/WebGPUDevice.idl:
* platform/graphics/gpu/GPUBindGroupLayout.cpp: Added.
(WebCore::GPUBindGroupLayout::tryCreate):
(WebCore::GPUBindGroupLayout::GPUBindGroupLayout):
* platform/graphics/gpu/GPUBindGroupLayout.h: Added.
* platform/graphics/gpu/GPUDevice.cpp:
(WebCore::GPUDevice::tryCreateBindGroupLayout const): Added.
* platform/graphics/gpu/GPUDevice.h:

Add files and symbols to project:
* CMakeLists.txt:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:

Missing includes that were previously provided via UnifiedSources:
* platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h:
* platform/sql/SQLiteFileSystem.h:

LayoutTests:

* webgpu/bind-group-layouts-expected.txt:
* webgpu/bind-group-layouts.html:

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

2 years agoUnreviewed test gardening after r239306 and r239338.
ryanhaddad@apple.com [Tue, 18 Dec 2018 21:51:06 +0000 (21:51 +0000)]
Unreviewed test gardening after r239306 and r239338.

Move test compositing/contents-format baselines for Mojave into platform/mac, add new baselines for High Sierra and earlier.

* platform/mac-highsierra-wk1/compositing/contents-format/subpixel-antialiased-text-enabled-expected.txt: Copied from LayoutTests/platform/mac-wk1/compositing/contents-format/subpixel-antialiased-text-enabled-expected.txt.
* platform/mac-highsierra/compositing/contents-format/subpixel-antialiased-nested-layer-expected.txt: Copied from LayoutTests/platform/mac-mojave/compositing/contents-format/subpixel-antialiased-nested-layer-expected.txt.
* platform/mac-highsierra/compositing/contents-format/subpixel-antialiased-text-configs-antialiasing-style-expected.txt: Copied from LayoutTests/platform/mac/compositing/contents-format/subpixel-antialiased-text-configs-antialiasing-style-expected.txt.
* platform/mac-highsierra/compositing/contents-format/subpixel-antialiased-text-configs-expected.txt: Copied from LayoutTests/platform/mac/compositing/contents-format/subpixel-antialiased-text-configs-expected.txt.
* platform/mac-highsierra/compositing/contents-format/subpixel-antialiased-text-enabled-expected.txt: Copied from LayoutTests/platform/mac/compositing/contents-format/subpixel-antialiased-text-enabled-expected.txt.
* platform/mac-highsierra/compositing/contents-format/subpixel-antialiased-text-images-expected.txt: Copied from LayoutTests/platform/mac/compositing/contents-format/subpixel-antialiased-text-images-expected.txt.
* platform/mac-highsierra/compositing/contents-format/subpixel-antialiased-text-traversal-expected.txt: Copied from LayoutTests/platform/mac/compositing/contents-format/subpixel-antialiased-text-traversal-expected.txt.
* platform/mac-highsierra/compositing/contents-format/subpixel-antialiased-text-visibility-expected.txt: Copied from LayoutTests/platform/mac/compositing/contents-format/subpixel-antialiased-text-visibility-expected.txt.
* platform/mac-mojave-wk1/compositing/contents-format/subpixel-antialiased-text-enabled-expected.txt: Removed.
* platform/mac-mojave/compositing/contents-format/subpixel-antialiased-text-configs-antialiasing-style-expected.txt: Removed.
* platform/mac-mojave/compositing/contents-format/subpixel-antialiased-text-configs-expected.txt: Removed.
* platform/mac-mojave/compositing/contents-format/subpixel-antialiased-text-enabled-expected.txt: Removed.
* platform/mac-mojave/compositing/contents-format/subpixel-antialiased-text-images-expected.txt: Removed.
* platform/mac-mojave/compositing/contents-format/subpixel-antialiased-text-traversal-expected.txt: Removed.
* platform/mac-mojave/compositing/contents-format/subpixel-antialiased-text-visibility-expected.txt: Removed.
* platform/mac-wk1/compositing/contents-format/subpixel-antialiased-text-enabled-expected.txt:
* platform/mac/compositing/contents-format/subpixel-antialiased-nested-layer-expected.txt: Renamed from LayoutTests/platform/mac-mojave/compositing/contents-format/subpixel-antialiased-nested-layer-expected.txt.
* platform/mac/compositing/contents-format/subpixel-antialiased-text-configs-antialiasing-style-expected.txt:
* platform/mac/compositing/contents-format/subpixel-antialiased-text-configs-expected.txt:
* platform/mac/compositing/contents-format/subpixel-antialiased-text-enabled-expected.txt:
* platform/mac/compositing/contents-format/subpixel-antialiased-text-images-expected.txt:
* platform/mac/compositing/contents-format/subpixel-antialiased-text-traversal-expected.txt:
* platform/mac/compositing/contents-format/subpixel-antialiased-text-visibility-expected.txt:

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

2 years agoMake ReadableStreamXX constructs use PrivateIdentifier
youenn@apple.com [Tue, 18 Dec 2018 21:41:34 +0000 (21:41 +0000)]
Make ReadableStreamXX constructs use PrivateIdentifier
https://bugs.webkit.org/show_bug.cgi?id=192771

Reviewed by Chris Dumez.

PrivateIdentifier is a better name for making sure a given construct does not show up in the global scope.
Covered by existing binding tests.

* Modules/streams/ReadableByteStreamController.idl:
* Modules/streams/ReadableStreamBYOBReader.idl:
* Modules/streams/ReadableStreamBYOBRequest.idl:
* Modules/streams/ReadableStreamDefaultController.idl:
* Modules/streams/ReadableStreamDefaultReader.idl:
* bindings/scripts/CodeGeneratorJS.pm:
(NeedsConstructorProperty):
* bindings/scripts/preprocess-idls.pl:
(shouldExposeInterface):
* bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp: Removed.
* bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h: Removed.
* bindings/scripts/test/TestCustomConstructor.idl: Removed.

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

2 years agoHTTPS Upgrade: Scripts / preprocessing necessary to create new database in future
commit-queue@webkit.org [Tue, 18 Dec 2018 20:59:53 +0000 (20:59 +0000)]
HTTPS Upgrade: Scripts / preprocessing necessary to create new database in future
https://bugs.webkit.org/show_bug.cgi?id=192612
<rdar://problem/46651207>

Patch by Vivek Seth <v_seth@apple.com> on 2018-12-18
Reviewed by Andy Estes.

* Configurations/WebKit.xcconfig:
* DerivedSources.make:
* Scripts/generate-https-upgrade-database.sh: Added.
* WebKit.xcodeproj/project.pbxproj:

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

2 years agoSynchronous media query evaluation could destroy current Frame/FrameView.
zalan@apple.com [Tue, 18 Dec 2018 20:09:32 +0000 (20:09 +0000)]
Synchronous media query evaluation could destroy current Frame/FrameView.
https://bugs.webkit.org/show_bug.cgi?id=192781
<rdar://problem/34416793>

Reviewed by Chris Dumez.

Source/WebCore:

Protect Frame and FrameView when coming back from printing and check if the current Frame/FrameView/FrameLoader objects are still valid.

Test: printing/print-with-media-query-destory.html

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::finishedLoading):
* page/Frame.cpp:
(WebCore::Frame::setPrinting):
* page/FrameView.cpp:
(WebCore::FrameView::forceLayoutForPagination):

LayoutTests:

* printing/print-with-media-query-destory-expected.txt: Added.
* printing/print-with-media-query-destory.html: Added.

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

2 years agoUnreviewed, fix the 32-bit watchOS build after r239314
wenson_hsieh@apple.com [Tue, 18 Dec 2018 19:45:24 +0000 (19:45 +0000)]
Unreviewed, fix the 32-bit watchOS build after r239314

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _zoomToFocusRect:selectionRect:insideFixed:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]):

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

2 years agoWeb Inspector: Layers: increase default column width for other localizations
drousso@apple.com [Tue, 18 Dec 2018 19:43:55 +0000 (19:43 +0000)]
Web Inspector: Layers: increase default column width for other localizations
https://bugs.webkit.org/show_bug.cgi?id=192812
<rdar://problem/46628625>

Reviewed by Brian Burg.

* UserInterface/Views/LayerDetailsSidebarPanel.js:
(WI.LayerDetailsSidebarPanel.prototype._buildDataGrid):
* UserInterface/Views/LayerTreeDetailsSidebarPanel.js:
(WI.LayerTreeDetailsSidebarPanel.prototype._buildDataGridSection):

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

2 years agowebkitpy: Ignore device type for test when using --force
jbedard@apple.com [Tue, 18 Dec 2018 19:42:55 +0000 (19:42 +0000)]
webkitpy: Ignore device type for test when using --force
https://bugs.webkit.org/show_bug.cgi?id=192786
<rdar://problem/46794894>

Reviewed by Daniel Bates.

It is sometimes the case that a contributor will wish to run a test on a specific device,
despite expectations which indicate a test should not be run on that device.

* Scripts/webkitpy/layout_tests/run_webkit_tests.py:
(parse_args):
* Scripts/webkitpy/port/device_port.py:
(DevicePort.default_child_processes): Strip device type information when using --force.
(DevicePort.setup_test_run): Only allow incomplete match when using --force.

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

2 years agoWeb Inspector: m3u8 content not shown, it should be text
joepeck@webkit.org [Tue, 18 Dec 2018 19:18:44 +0000 (19:18 +0000)]
Web Inspector: m3u8 content not shown, it should be text
https://bugs.webkit.org/show_bug.cgi?id=192731
<rdar://problem/46747728>

Reviewed by Devin Rousso.

Source/WebCore:

* inspector/NetworkResourcesData.cpp:
(WebCore::NetworkResourcesData::setResourceContent):
Don't clobber data if setting empty content on a resource that has content.

* inspector/agents/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::shouldTreatAsText):
Additional non-"text/" mime types that can be treated as text.

* platform/MIMETypeRegistry.cpp:
(WebCore::MIMETypeRegistry::isTextMediaPlaylistMIMEType):
* platform/MIMETypeRegistry.h:
Detect media playlist mime types that are text (m3u8/m3u).

Source/WebInspectorUI:

* UserInterface/Base/MIMETypeUtilities.js:
(WI.shouldTreatMIMETypeAsText):
Support m3u8/m3u files as text.

LayoutTests:

* inspector/unit-tests/mimetype-utilities-expected.txt:
* inspector/unit-tests/mimetype-utilities.html:
Tests for shouldTreatMIMETypeAsText.

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

2 years agoRemove <meta http-equiv=set-cookie> support
dbates@webkit.org [Tue, 18 Dec 2018 19:17:15 +0000 (19:17 +0000)]
Remove <meta http-equiv=set-cookie> support
https://bugs.webkit.org/show_bug.cgi?id=185077
<rdar://problem/41791397>

Reviewed by Brent Fulgham.

Source/WebCore:

Remove support for the HTTP-equiv. pragma Set-Cookie to set a cookie. In <https://github.com/whatwg/html/pull/3649>
the HTML living standard was ammended to define this pragma as no-op. Chrome and Edge have also
removed support for this pragma and Firefox has an open bug to remove it.

* dom/Document.cpp:
(WebCore::Document::processHttpEquiv): Emit a message that the Set-Cookie pragma is obsolete and
was ignored instead of setting the cookie.
* html/parser/XSSAuditor.cpp:
(WebCore::isDangerousHTTPEquiv): We no longer need to consider the Set-Cookie pragma
as dangerous and erase attribute http-equiv when we find it because we no longer honor
this pragma.

LayoutTests:

Update test now that we no longer consider the HTTP equiv. pragma Set-Cookie as
dangerous (since it is ignored).

* http/tests/security/xssAuditor/cookie-injection-expected.txt:

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

2 years agoCSS Typed OM should expose attributeStyleMap
justin_michaud@apple.com [Tue, 18 Dec 2018 18:51:05 +0000 (18:51 +0000)]
CSS Typed OM should expose attributeStyleMap
https://bugs.webkit.org/show_bug.cgi?id=192671

Reviewed by Ryosuke Niwa.

LayoutTests/imported/w3c:

* web-platform-tests/css/css-properties-values-api/typedom.tentative-expected.txt:
* web-platform-tests/css/css-properties-values-api/unit-cycles-expected.txt:

Source/WebCore:

Exposes element.attributeStyleMap, adds a stub for the StylePropertyMap class, and updates the existing
TypedOMCSSImageValue to not require a RenderObject so that it can still work inside attributeStyleMap.

Test: css-typedom/attributeStyleMap.html

* CMakeLists.txt:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:
* css/ElementCSSInlineStyle.idl:
* css/typedom/StylePropertyMap.h: Copied from Source/WebCore/css/typedom/StylePropertyMapReadOnly.h.
* css/typedom/StylePropertyMap.idl: Copied from Source/WebCore/css/typedom/StylePropertyMapReadOnly.idl.
* css/typedom/StylePropertyMapReadOnly.cpp: Added.
(WebCore::StylePropertyMapReadOnly::reifyValue):
(WebCore::StylePropertyMapReadOnly::customPropertyValueOrDefault):
* css/typedom/StylePropertyMapReadOnly.h:
(WebCore::StylePropertyMapReadOnly::create): Deleted.
(WebCore::StylePropertyMapReadOnly::get const): Deleted.
(WebCore::StylePropertyMapReadOnly::StylePropertyMapReadOnly): Deleted.
* css/typedom/StylePropertyMapReadOnly.idl:
* css/typedom/TypedOMCSSImageValue.h:
* dom/Element.cpp:
(WebCore::Element::attributeStyleMap):
(WebCore::Element::setAttributeStyleMap):
* dom/Element.h:
* dom/ElementRareData.cpp:
* dom/ElementRareData.h:
(WebCore::ElementRareData::attributeStyleMap):
(WebCore::ElementRareData::setAttributeStyleMap):
* dom/StyledElement.cpp:
(WebCore::StyledElement::ensureAttributeStyleMap):
* dom/StyledElement.h:
* html/canvas/CanvasRenderingContext2DBase.cpp:
(WebCore::size):
(WebCore::CanvasRenderingContext2DBase::drawImage):
* platform/graphics/CustomPaintImage.cpp:
(WebCore::extractComputedProperty):
(WebCore::CustomPaintImage::doCustomPaint):

LayoutTests:

* css-typedom/attributeStyleMap-expected.txt: Added.
* css-typedom/attributeStyleMap.html: Added.
* css-typedom/sameobject-expected.txt: Added.
* css-typedom/sameobject.html: Added.
* fast/css-custom-paint/properties.html:
* platform/ios-wk1/TestExpectations:
* platform/ios-wk2/js/dom/dom-static-property-for-in-iteration-expected.txt: Added.
* platform/mac-wk1/TestExpectations:
* platform/mac-wk2/js/dom/dom-static-property-for-in-iteration-expected.txt: Added.
* platform/win/TestExpectations:

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

2 years agoUnreviewed. Appease a build error where we weren't using a variable defined in an...
sbarati@apple.com [Tue, 18 Dec 2018 18:40:28 +0000 (18:40 +0000)]
Unreviewed. Appease a build error where we weren't using a variable defined in an "if"

* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):

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

2 years agoWKWebView has old URL while displaying SafeBrowsing interstitial, for link-click...
achristensen@apple.com [Tue, 18 Dec 2018 18:26:33 +0000 (18:26 +0000)]
WKWebView has old URL while displaying SafeBrowsing interstitial, for link-click navigations
https://bugs.webkit.org/show_bug.cgi?id=192675

Reviewed by Geoffrey Garen.

Source/WebKit:

When a safe browsing warning is being shown, WKWebView.URL should be the unsafe website, not the safe website before it.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _showSafeBrowsingWarningWithTitle:warning:details:completionHandler:]):
(-[WKWebView _showSafeBrowsingWarningWithURL:title:warning:details:completionHandler:]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/Cocoa/SafeBrowsingWarningCocoa.mm:
(WebKit::SafeBrowsingWarning::SafeBrowsingWarning):
* UIProcess/SafeBrowsingWarning.h:
(WebKit::SafeBrowsingWarning::create):
(WebKit::SafeBrowsingWarning::url const):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::decidePolicyForNavigationAction):

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/SafeBrowsing.mm:
(goBack):
(TEST):
(visitUnsafeSite):
(-[SafeBrowsingHelper observeValueForKeyPath:ofObject:change:context:]):
(-[SafeBrowsingHelper webView:runJavaScriptAlertPanelWithMessage:initiatedByFrame:completionHandler:]):

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

2 years agoFix test failure after r239306.
simon.fraser@apple.com [Tue, 18 Dec 2018 17:11:50 +0000 (17:11 +0000)]
Fix test failure after r239306.

Need Mojave WK1 results for this test.

* platform/mac-mojave-wk1/compositing/contents-format/subpixel-antialiased-text-enabled-expected.txt: Added.

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

2 years agoCalling setValue() while typing should invoke -textDidChangeInTextField in the inject...
wenson_hsieh@apple.com [Tue, 18 Dec 2018 15:37:10 +0000 (15:37 +0000)]
Calling setValue() while typing should invoke -textDidChangeInTextField in the injected bundle
https://bugs.webkit.org/show_bug.cgi?id=192785
<rdar://problem/45321184>

Reviewed by Tim Horton.

Source/WebCore:

Makes a minor adjustment in `TextFieldInputType::setValue` to consider value changes as "user editing", if we're
currently processing a keystroke from the user. This is useful for certain private clients, such as Safari, that
need to know when the user is typing in a text form control, but the page is preventing default text insertion
behavior and instead updating values programmatically.

Test: fast/forms/call-text-did-change-in-text-field-when-typing.html

* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::setValue):

LayoutTests:

Add a test to verify that:
1. When typing in a focused field, the injected bundle method is invoked.
2. When changing the value of the focused field under non-typing user interaction, the method isn't invoked.
3. When changing the value of the focused field programmatically without user gesture, the method isn't invoked.

* TestExpectations:
* fast/forms/call-text-did-change-in-text-field-when-typing-expected.txt: Added.
* fast/forms/call-text-did-change-in-text-field-when-typing.html: Added.
* platform/wk2/TestExpectations:

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

2 years ago[LFC][BFC][MarginCollapsing] Implement marginBeforeCollapsesWithParentMarginAfter
zalan@apple.com [Tue, 18 Dec 2018 15:30:25 +0000 (15:30 +0000)]
[LFC][BFC][MarginCollapsing] Implement marginBeforeCollapsesWithParentMarginAfter
https://bugs.webkit.org/show_bug.cgi?id=192801

Reviewed by Antti Koivisto.

* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithParentMarginAfter):

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

2 years ago[LFC][BFC][MarginCollapsing] Implement marginAfterCollapsesWithSiblingMarginBeforeWit...
zalan@apple.com [Tue, 18 Dec 2018 15:28:47 +0000 (15:28 +0000)]
[LFC][BFC][MarginCollapsing] Implement marginAfterCollapsesWithSiblingMarginBeforeWithClearance
https://bugs.webkit.org/show_bug.cgi?id=192799

Reviewed by Antti Koivisto.

* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithSiblingMarginBeforeWithClearance):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginAfter):

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

2 years ago[LFC][BFC][MarginCollapsing] Implement marginAfterCollapsesWithParentMarginBefore
zalan@apple.com [Tue, 18 Dec 2018 15:27:09 +0000 (15:27 +0000)]
[LFC][BFC][MarginCollapsing] Implement marginAfterCollapsesWithParentMarginBefore
https://bugs.webkit.org/show_bug.cgi?id=192798

Reviewed by Antti Koivisto.

* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginAfterFromLastChild):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginBefore):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginAfter):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfter):

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

2 years agoRegression(r239182) SuspendedPage's process reuse for link navigation optimization...
cdumez@apple.com [Tue, 18 Dec 2018 15:26:50 +0000 (15:26 +0000)]
Regression(r239182) SuspendedPage's process reuse for link navigation optimization sometimes broken
https://bugs.webkit.org/show_bug.cgi?id=192772

Reviewed by Antti Koivisto.

Source/WebKit:

With r239182, if the page in the previous process would fail to enter PageCache, we would destroy
the corresponding SuspendedPageProxy, which would potentially terminate the process. This would
regress performance when trying to navigate back in history to that page. This would also regress
performance when link-navigating to the same domain as we would have previously reused the suspended
page's process for such navigation.

Address the issue by keeping the SuspendedPageProxy alive even if the WebPage fails to suspend.
When trying to reuse a SuspendedPageProxy, if the page failed to suspend, reuse its process but
not the suspended page itself.

* UIProcess/SuspendedPageProxy.cpp:
(WebKit::SuspendedPageProxy::~SuspendedPageProxy):
(WebKit::SuspendedPageProxy::waitUntilReadyToUnsuspend):
(WebKit::SuspendedPageProxy::unsuspend):
(WebKit::SuspendedPageProxy::didSuspend):
(WebKit::SuspendedPageProxy::didFailToSuspend):
(WebKit::SuspendedPageProxy::loggingString const):
* UIProcess/SuspendedPageProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::swapToWebProcess):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::processForNavigationInternal):

Tools:

Add API test coverage.

* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:

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

2 years ago[LFC][BFC][MarginCollapsing] Expand marginsCollapseThrough collapsing logic
zalan@apple.com [Tue, 18 Dec 2018 15:25:32 +0000 (15:25 +0000)]
[LFC][BFC][MarginCollapsing] Expand marginsCollapseThrough collapsing logic
https://bugs.webkit.org/show_bug.cgi?id=192794

Reviewed by Antti Koivisto.

* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginsCollapseThrough):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBefore):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfter):

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

2 years ago[LFC][BFC][MarginCollapsing] Expand marginAfterCollapsesWithNextSibling and marginBef...
zalan@apple.com [Tue, 18 Dec 2018 15:23:47 +0000 (15:23 +0000)]
[LFC][BFC][MarginCollapsing] Expand marginAfterCollapsesWithNextSibling and marginBeforeCollapsesWithPreviousSibling collapsing logic
https://bugs.webkit.org/show_bug.cgi?id=192791

Reviewed by Antti Koivisto.

* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithPreviousSibling):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithNextSibling):

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

2 years ago[LFC][BFC][MarginCollapsing] Expand marginAfterCollapsesWithParentMarginAfter and...
zalan@apple.com [Tue, 18 Dec 2018 15:19:21 +0000 (15:19 +0000)]
[LFC][BFC][MarginCollapsing] Expand marginAfterCollapsesWithParentMarginAfter and marginBeforeCollapsesWithParentMarginBefore collapsing logic
https://bugs.webkit.org/show_bug.cgi?id=192787

Reviewed by Antti Koivisto.

* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::hasClearance):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithParentMarginBefore):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithSiblingMarginBeforeWithClearance):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginBefore):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginAfter):

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

2 years agoUnreviewed, JHBuild GTK build fix attempt
philn@webkit.org [Tue, 18 Dec 2018 13:00:36 +0000 (13:00 +0000)]
Unreviewed, JHBuild GTK build fix attempt

* gtk/jhbuild.modules: There's no libffi in this moduleset anymore.
There's no ninja module either, it should be provided by the host system.

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

2 years agoSkip the stress/elidable-new-object-roflcopter-then-exit.js test on 32-bit.
mark.lam@apple.com [Tue, 18 Dec 2018 08:16:14 +0000 (08:16 +0000)]
Skip the stress/elidable-new-object-roflcopter-then-exit.js test on 32-bit.
https://bugs.webkit.org/show_bug.cgi?id=191374
<rdar://problem/46525447>

Reviewed by Yusuke Suzuki.

This test runs too slow on 32-bit, and is not relevant for non-JIT builds.

* stress/elidable-new-object-roflcopter-then-exit.js:

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

2 years agoSkip the stress/materialized-regexp-has-correct-last-index-set-by-match.js test on...
mark.lam@apple.com [Tue, 18 Dec 2018 07:58:59 +0000 (07:58 +0000)]
Skip the stress/materialized-regexp-has-correct-last-index-set-by-match.js test on 32-bit.
https://bugs.webkit.org/show_bug.cgi?id=192019
<rdar://problem/46525456>

Reviewed by Yusuke Suzuki.

The test runs too slow on 32-bit.

* stress/materialized-regexp-has-correct-last-index-set-by-match.js:

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

2 years agoSkip the stress/materialize-regexp-cyclic-regexp.js test on 32-bit.
mark.lam@apple.com [Tue, 18 Dec 2018 07:51:24 +0000 (07:51 +0000)]
Skip the stress/materialize-regexp-cyclic-regexp.js test on 32-bit.
https://bugs.webkit.org/show_bug.cgi?id=191373
<rdar://problem/46525458>

Reviewed by Yusuke Suzuki.

The test is already slow running with a JIT on 64-bit.  It will always timeout
on 32-bit without a JIT.

* stress/materialize-regexp-cyclic-regexp.js:

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

2 years agoArray unshift/shift should not race against the AI in the compiler thread.
mark.lam@apple.com [Tue, 18 Dec 2018 06:56:51 +0000 (06:56 +0000)]
Array unshift/shift should not race against the AI in the compiler thread.
https://bugs.webkit.org/show_bug.cgi?id=192795
<rdar://problem/46724263>

Reviewed by Saam Barati.

JSTests:

* stress/array-unshift-should-not-race-against-compiler-thread.js: Added.

Source/JavaScriptCore:

The Array unshift and shift operations for ArrayStorage type arrays are protected
using the cellLock.  The AbstractInterpreter's foldGetByValOnConstantProperty()
function does grab the cellLock before reading a value from the array's ArrayStorage,
but does not get the array butterfly under the protection of the cellLock.

This is insufficient and racy.  For ArrayStorage type arrays, the fetching of the
butterfly also needs to be protected by the cellLock.  The unshift / shift
operations can move values around in the butterfly.  Hence, the fact that AI has
fetched a butterfly pointer (while ensuring no structure change) is insufficient
to guarantee that the values in the butterfly haven't shifted.

Having AI hold the cellLock the whole time (from before fetching the butterfly
till after reading the value from it) eliminates this race.  Note: we only need
to do this for ArrayStorage type arrays.

Note also that though AI is holding the cellLock in this case, we still need to
ensure that the array structure hasn't changed around the fetching of the butterfly.
This is because operations other than unshift and shift are guarded by this
protocol, and not the cellLock.

* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* runtime/JSArray.cpp:
(JSC::JSArray::unshiftCountSlowCase):

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

2 years ago[JSC] Optimize Object.keys by caching own keys results in StructureRareData
yusukesuzuki@slowstart.org [Tue, 18 Dec 2018 06:54:49 +0000 (06:54 +0000)]
[JSC] Optimize Object.keys by caching own keys results in StructureRareData
https://bugs.webkit.org/show_bug.cgi?id=190047

Reviewed by Saam Barati.

JSTests:

* stress/object-keys-cached-zero.js: Added.
(shouldBe):
(test):
* stress/object-keys-changed-attribute.js: Added.
(shouldBe):
(test):
* stress/object-keys-changed-index.js: Added.
(shouldBe):
(test):
* stress/object-keys-changed.js: Added.
(shouldBe):
(test):
* stress/object-keys-indexed-non-cache.js: Added.
(shouldBe):
(test):
* stress/object-keys-overrides-get-property-names.js: Added.
(shouldBe):
(test):
(noInline):

Source/JavaScriptCore:

Object.keys is one of the most frequently used function in web-tooling-benchmarks (WTB).
Object.keys is dominant in lebab of WTB, and frequently called in babel and others.
Since our Structure knows the shape of JSObject, we can cache the result of Object.keys
in Structure (StructureRareData) as we cache JSPropertyNameEnumerator in StructureRareData.

This patch caches the result of Object.keys in StructureRareData. The cached array is created
as JSImmutableButterfly. And Object.keys creates CoW from this data. Currently, the lifetime
strategy of this JSImmutableButterfly is the same to cached JSPropertyNameEnumerator. It is
referenced from Structure, and collected when Structure is collected.

This improves several benchmarks in SixSpeed.

                                baseline                  patched

    object-assign.es5      350.1710+-3.6303     ^    226.0368+-4.7558        ^ definitely 1.5492x faster
    for-of-object.es6      269.1941+-3.3430     ^    127.9317+-2.3875        ^ definitely 2.1042x faster

And it improves WTB lebab by 11.8%.

    Before: lebab:  6.10 runs/s
    After:  lebab:  6.82 runs/s

* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleIntrinsicCall):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGConstantFoldingPhase.cpp:
(JSC::DFG::ConstantFoldingPhase::foldConstants):
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGNode.cpp:
(JSC::DFG::Node::convertToNewArrayBuffer):
* dfg/DFGNode.h:
* dfg/DFGNodeType.h:
* dfg/DFGOperations.cpp:
* dfg/DFGOperations.h:
* dfg/DFGPredictionPropagationPhase.cpp:
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileObjectKeys):
* dfg/DFGSpeculativeJIT.h:
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* ftl/FTLAbstractHeapRepository.h:
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileNode):
(JSC::FTL::DFG::LowerDFGToB3::compileObjectKeys):
* runtime/Butterfly.h:
(JSC::ContiguousData::Data::setStartingValue):
* runtime/Intrinsic.cpp:
(JSC::intrinsicName):
* runtime/Intrinsic.h:
* runtime/JSImmutableButterfly.h:
(JSC::JSImmutableButterfly::JSImmutableButterfly):
We set JSEmpty to the underlying butterfly storage if indexing type is Contiguous.
Otherwise, JSImmutableButterfly is half-baked one until all the storage is filled with some meaningful values, it leads to crash
if half-baked JSImmutableButterfly is exposed to GC.
* runtime/ObjectConstructor.cpp:
(JSC::ownPropertyKeys):
* runtime/Structure.cpp:
(JSC::Structure::canCachePropertyNameEnumerator const):
* runtime/Structure.h:
* runtime/StructureInlines.h:
(JSC::Structure::setCachedOwnKeys):
(JSC::Structure::cachedOwnKeys const):
(JSC::Structure::cachedOwnKeysIgnoringSentinel const):
(JSC::Structure::canCacheOwnKeys const):
* runtime/StructureRareData.cpp:
(JSC::StructureRareData::visitChildren):
(JSC::StructureRareData::cachedPropertyNameEnumerator const): Deleted.
(JSC::StructureRareData::setCachedPropertyNameEnumerator): Deleted.
* runtime/StructureRareData.h:
* runtime/StructureRareDataInlines.h:
(JSC::StructureRareData::cachedPropertyNameEnumerator const):
(JSC::StructureRareData::setCachedPropertyNameEnumerator):
(JSC::StructureRareData::cachedOwnKeys const):
(JSC::StructureRareData::cachedOwnKeysIgnoringSentinel const):
(JSC::StructureRareData::cachedOwnKeysConcurrently const):
(JSC::StructureRareData::setCachedOwnKeys):
(JSC::StructureRareData::previousID const): Deleted.
* runtime/VM.cpp:
(JSC::VM::VM):

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

2 years ago[Mac] Layout Test http/wpt/webauthn/public-key-credential-create-success-hid.https...
jiewen_tan@apple.com [Tue, 18 Dec 2018 06:37:28 +0000 (06:37 +0000)]
[Mac] Layout Test http/wpt/webauthn/public-key-credential-create-success-hid.https.html and http/wpt/webauthn/public-key-credential-get-success-hid.https.html are flaky
https://bugs.webkit.org/show_bug.cgi?id=192061

Reviewed by Dewei Zhu.

Source/WebKit:

Part 3.

Add some additional temporary logging info to determine if the timer is working as expected.
Once the bug is determined and fixed, we should remove all logging added in this patch.

* UIProcess/WebAuthentication/AuthenticatorManager.cpp:
(WebKit::AuthenticatorManager::respondReceived):
(WebKit::AuthenticatorManager::initTimeOutTimer):
(WebKit::AuthenticatorManager::timeOutTimerFired):
* UIProcess/WebAuthentication/Mock/MockAuthenticatorManager.cpp:
(WebKit::MockAuthenticatorManager::respondReceivedInternal):

LayoutTests:

Add a time out value.

* http/wpt/webauthn/public-key-credential-create-success-hid.https.html:

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

2 years agoEnable HTTP and HTTPS proxies on iOS and make it a property of the NSURLSession
sbarati@apple.com [Tue, 18 Dec 2018 06:33:58 +0000 (06:33 +0000)]
Enable HTTP and HTTPS proxies on iOS and make it a property of the NSURLSession
https://bugs.webkit.org/show_bug.cgi?id=192374
<rdar://problem/46506286>

Reviewed by Alex Christensen.

Source/WebCore/PAL:

* pal/spi/cf/CFNetworkSPI.h:
Remove the now-unused SPI declaration.

Source/WebKit:

This patch makes it so that we can use HTTP/HTTPS proxies on iOS as well.
To enable on iOS, you can do something like:
$ defaults write -g WebKit2HTTPProxy -string "http://localhost:8080"
$ defaults write -g WebKit2HTTPSProxy -string "http://localhost:8080"

This patch also changes the Proxy to be enabled on a per NSURLSession
basis instead of a per process basis.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::initializeNetworkProcess):
* NetworkProcess/NetworkSessionCreationParameters.cpp:
(WebKit::NetworkSessionCreationParameters::privateSessionParameters):
(WebKit::NetworkSessionCreationParameters::encode const):
(WebKit::NetworkSessionCreationParameters::decode):
* NetworkProcess/NetworkSessionCreationParameters.h:
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::proxyDictionary):
(WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
* NetworkProcess/mac/NetworkProcessMac.mm:
(WebKit::NetworkProcess::platformInitializeNetworkProcess):
(WebKit::overrideSystemProxies): Deleted.
* UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
(-[WKWebsiteDataStore _initWithConfiguration:]):
* UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
* UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:
(-[_WKWebsiteDataStoreConfiguration httpProxy]):
(-[_WKWebsiteDataStoreConfiguration setHTTPProxy:]):
(-[_WKWebsiteDataStoreConfiguration httpsProxy]):
(-[_WKWebsiteDataStoreConfiguration setHTTPSProxy:]):
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeNetworkProcess):
* UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
(WebKit::WebsiteDataStore::parameters):
* UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp:
(WebKit::WebsiteDataStoreConfiguration::copy):
* UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h:
(WebKit::WebsiteDataStoreConfiguration::httpProxy const):
(WebKit::WebsiteDataStoreConfiguration::setHTTPProxy):
(WebKit::WebsiteDataStoreConfiguration::httpsProxy const):
(WebKit::WebsiteDataStoreConfiguration::setHTTPSProxy):

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

2 years agoTap highlights should not be shown on iOSMac
wenson_hsieh@apple.com [Tue, 18 Dec 2018 06:30:34 +0000 (06:30 +0000)]
Tap highlights should not be shown on iOSMac
https://bugs.webkit.org/show_bug.cgi?id=192797
<rdar://problem/46793995>

Reviewed by Tim Horton.

WKWebViews in iOSMac should avoid painting tap highlights, since tap highlights are not present in the rest of
the macOS platform. Simply disable this functionality by bailing in `-[WKContentView _showTapHighlight]`.

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

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

2 years ago[Win][Clang] Fix compilation warnings WebCore/platform/graphics directory
Hironori.Fujii@sony.com [Tue, 18 Dec 2018 05:49:32 +0000 (05:49 +0000)]
[Win][Clang] Fix compilation warnings WebCore/platform/graphics directory
https://bugs.webkit.org/show_bug.cgi?id=192752

Reviewed by Don Olmstead.

No new tests, no behavior changes.

* platform/graphics/win/DIBPixelData.cpp:
Enclosed bitmapType and bitmapPixelsPerMeter with #ifndef NDEBUG.
* platform/graphics/win/FontPlatformDataWin.cpp:
(WebCore::FontPlatformData::openTypeTable const): Use ASSERT_UNUSED instead of ASSERT.
* platform/graphics/win/GraphicsContextWin.cpp: Removed unused variable 'deg2rad'.
* platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
Removed unused soft links MFCreateSampleGrabberSinkActivate, MFCreateMemoryBuffer and MFCreateSample.
(WebCore::MediaPlayerPrivateMediaFoundation::MediaPlayerPrivateMediaFoundation):
Reorder the initializer list.
(WebCore::MediaPlayerPrivateMediaFoundation::seek): Use ASSERT_UNUSED instead of ASSERT.
(WebCore::MediaPlayerPrivateMediaFoundation::setAllChannelVolumes): Ditto.
(WebCore::MediaPlayerPrivateMediaFoundation::createSession): Ditto.
(WebCore::MediaPlayerPrivateMediaFoundation::endSession): Ditto.
(WebCore::MediaPlayerPrivateMediaFoundation::onCreatedMediaSource): Ditto.
(WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::paintCurrentFrame): Added default case.
* platform/graphics/win/SimpleFontDataCairoWin.cpp:
(WebCore::Font::platformBoundsForGlyph const): Use inner braces to initialize subobjects of MAT2.
* platform/graphics/win/SimpleFontDataWin.cpp: Removed unused 'cSmallCapsFontSizeMultiplier'.
(WebCore::Font::initGDIFont): Use inner braces to initialize subobjects of MAT2.
(WebCore::Font::boundsForGDIGlyph const): Ditto.
(WebCore::Font::widthForGDIGlyph const): Ditto.
* platform/graphics/win/UniscribeController.cpp:
(WebCore::UniscribeController::UniscribeController):
Reorder the initializer list.
(WebCore::UniscribeController::offsetForPosition): Use parentheses to combine && and ||.
(WebCore::UniscribeController::shapeAndPlaceItem): Removed unused 'glyphCount'.

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

2 years ago[MediaStream] A stream's first video frame should be rendered
eric.carlson@apple.com [Tue, 18 Dec 2018 05:31:22 +0000 (05:31 +0000)]
[MediaStream] A stream's first video frame should be rendered
https://bugs.webkit.org/show_bug.cgi?id=192629
<rdar://problem/46664353>

Reviewed by Youenn Fablet.

Source/WebCore:

Test: fast/mediastream/media-stream-renders-first-frame.html

* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayers):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::currentDisplayMode const):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateDisplayMode):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::play):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::currentReadyState):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::characteristicsChanged):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::checkSelectedVideoTrack):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::paintCurrentFrameInContext):
* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::size const):
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::processNewFrame):
* platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
(WebCore::RealtimeIncomingVideoSourceCocoa::processNewSample):

LayoutTests:

* fast/mediastream/MediaStream-video-element-displays-buffer.html: Updated.
* fast/mediastream/MediaStream-video-element-video-tracks-disabled-then-enabled-expected.txt: Ditto.
* fast/mediastream/MediaStream-video-element-video-tracks-disabled-then-enabled.html: Ditto.
* fast/mediastream/media-stream-renders-first-frame-expected.txt: Added.
* fast/mediastream/media-stream-renders-first-frame.html: Added.
* http/tests/media/media-stream/getusermedia-with-canvas-expected.txt: Removed.
* http/tests/media/media-stream/getusermedia-with-canvas.html: Removed.

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

2 years agoUnreviewed, fix the iOSMac engineering build again
wenson_hsieh@apple.com [Tue, 18 Dec 2018 05:23:10 +0000 (05:23 +0000)]
Unreviewed, fix the iOSMac engineering build again

After r239311, `WebProcessProxy::fullKeyboardAccessEnabled` in `WebProcessProxyIOS.mm` attempts to use
`WKFullKeyboardAccessWatcher`, which is guarded by `ENABLE(FULL_KEYBOARD_ACCESS)`. However, on iOSMac,
`ENABLE(FULL_KEYBOARD_ACCESS)` is 0. Fix the build by putting access to `WKFullKeyboardAccessWatcher` behind
`ENABLE(FULL_KEYBOARD_ACCESS)`.

* UIProcess/ios/WebProcessProxyIOS.mm:
(WebKit::WebProcessProxy::fullKeyboardAccessEnabled):

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

2 years agoUnreviewed, fix the iOSMac engineering build
wenson_hsieh@apple.com [Tue, 18 Dec 2018 04:39:35 +0000 (04:39 +0000)]
Unreviewed, fix the iOSMac engineering build

`generateRequestID()` is only invoked from code under `ENABLE(MEDIA_STREAM)`; move it under this guard to avoid
an unused function warning.

* UIProcess/UserMediaPermissionRequestManagerProxy.cpp:

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

2 years agoBindings generator should support Conditional= along with CachedAttribute
justin_michaud@apple.com [Tue, 18 Dec 2018 04:17:58 +0000 (04:17 +0000)]
Bindings generator should support Conditional= along with CachedAttribute
https://bugs.webkit.org/show_bug.cgi?id=192721

Reviewed by Ryosuke Niwa.

Fix a bug where specifying both attributes causes compilation errors because the compile-time
condition is not included in the derived code.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjCachedAttribute3Getter):
(WebCore::jsTestObjCachedAttribute3):
(WebCore::JSTestObj::visitChildren):
* bindings/scripts/test/JS/JSTestObj.h:
* bindings/scripts/test/TestObj.idl:

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

2 years agoclang-tidy: Fix unnecessary object copy in CPUMonitor::setCPULimit()
ddkilzer@apple.com [Tue, 18 Dec 2018 04:09:50 +0000 (04:09 +0000)]
clang-tidy: Fix unnecessary object copy in CPUMonitor::setCPULimit()
<https://webkit.org/b/192707>
<rdar://problem/46734926>

Reviewed by Daniel Bates.

Source/WebCore:

* platform/CPUMonitor.cpp:
(WebCore::CPUMonitor::setCPULimit):
* platform/CPUMonitor.h:
(WebCore::CPUMonitor::setCPULimit):
- Change parameter to const reference to fix unnecessary copies.

Source/WebKit:

* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::updateCPUMonitorState):
- Pass m_cpuLimit directly since getting its value causes an
  identical std::optional<double> to be created unnecessarily.

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

2 years ago[iOS] Focusing a large editable element always scrolls to the top of the element
wenson_hsieh@apple.com [Tue, 18 Dec 2018 04:04:44 +0000 (04:04 +0000)]
[iOS] Focusing a large editable element always scrolls to the top of the element
https://bugs.webkit.org/show_bug.cgi?id=192745
<rdar://problem/46758445>

Reviewed by Tim Horton.

Source/WebKit:

Currently, when focusing form controls or editable elements, we try to scroll such that the focused element rect
is centered within the visible area. In the case of very large focusable elements whose dimensions exceed the
width or height of the visible area, we instead scroll such that the top left point of the element is at the top
left corner of the visible area.

However, this results in unnecessary scrolling if the top of the element is already near the top of the visible
area. For WebKit2-based rich text editors that have an editable body element with a top content inset that
contains additional content, this means we will always scroll the additional content away when focusing the
editable body.

To avoid this behavior, adjust focused element zooming logic for editable elements that are too large to be
centered in the visible area, such that we only scroll the top left position of the focused element to the top
half or top right of the visible area, respectively. This reduces the amount of scrolling when focusing large
editable elements, while still making it clear which element is being focused.

* Platform/spi/ios/UIKitSPI.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _zoomToFocusRect:selectionRect:insideFixed:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]):

Make some small adjustments to improve the readability of this method by using `clampTo` instead of clamping
values by comparing and setting values.

Also, fix an existing bug wherein focusable elements that are meant to be centered within the visible area are
currently offset by half the difference between the bottom inset amount and the top inset amount, in the case
where the `_obscuredInsets` SPI is used to specify content insets for the web view (i.e., MobileSafari).

* UIProcess/API/Cocoa/WKWebViewInternal.h:

Make a couple of arguments `const FloatRect&` instead of just `FloatRect`.

LayoutTests:

Add a new layout test to verify that we don't scroll unnecessarily when focusing a tall editable element, whose
top offset is already near the top of the viewport.

* editing/selection/ios/no-scrolling-when-focusing-large-editable-area-expected.txt: Added.
* editing/selection/ios/no-scrolling-when-focusing-large-editable-area.html: Added.

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

2 years agooffsetLeft and offsetParent should adjust across shadow boundaries
rniwa@webkit.org [Tue, 18 Dec 2018 03:52:53 +0000 (03:52 +0000)]
offsetLeft and offsetParent should adjust across shadow boundaries
https://bugs.webkit.org/show_bug.cgi?id=157437
<rdar://problem/26154021>

Reviewed by Simon Fraser.

Source/WebCore:

Update the WebKit's treatment of shadow boundaries in offsetLeft, offsetTop, and offsetParent to match
the latest discussion in CSS WG. See https://github.com/w3c/webcomponents/issues/497
and https://github.com/w3c/webcomponents/issues/763

The latest consensus is to use the retargeting algorithm (https://dom.spec.whatwg.org/#retarget).
In practice, this would mean that we need to keep walking up the offset parent ancestors until we find
the one which is in the same tree as a shadow-inclusive ancestor of the context object.

For example, if a node (the context object of offsetTop, offsetLeft, offsetParent) was assigned to a slot
inside a shadow tree and its offset parent was in the shadow tree, we need to walk up to its offset parent,
then its offset parent, etc... until we find the offset parent in the same tree as the context object.

Note it's possible that the context object is inside a shadow tree which does not have its own offset parent.
(e.g. all elements have position: static) For this reason, we need to consider not just offset parent in
the same tree as the context object but as well as any offset parent which is in its ancestor trees.

Test: fast/shadow-dom/offsetParent-across-shadow-boundaries.html

* dom/Element.cpp:
(WebCore::adjustOffsetForZoomAndSubpixelLayout): Extracted to share code between offsetLeft and offsetTop.
(WebCore::collectAncestorTreeScopeAsHashSet): Added.
(WebCore::Element::offsetLeftForBindings): Added. Sums up offsetLeft's until it finds the first offset parent
which is a shadow-including ancestor (https://dom.spec.whatwg.org/#concept-shadow-including-ancestor).
(WebCore::Element::offsetLeft): Now uses adjustOffsetForZoomAndSubpixelLayout.
(WebCore::Element::offsetTopForBindings): Added. Like offsetLeftForBindings, this function sums up offsetTop's
until it finds the first offset parent which is a shadow-including ancestor.
(WebCore::Element::offsetTop): Now uses adjustOffsetForZoomAndSubpixelLayout.
(WebCore::Element::offsetParentForBindings): Renamed from bindingsOffsetParent to be consistent with other
functions meant to be used for bindings code.
* dom/Element.h:
* html/HTMLElement.idl:

Source/WebKit:

Use *forBindings variants of offsetLeft, offsetTop, and offsetParent.

* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElementGtk.cpp:
(webkit_dom_element_get_offset_left):
(webkit_dom_element_get_offset_top):
(webkit_dom_element_get_offset_parent):

Source/WebKitLegacy/mac:

Use *forBindings variants of offsetLeft, offsetTop, and offsetParent.

* DOM/DOMElement.mm:
(-[DOMElement offsetLeft]):
(-[DOMElement offsetTop]):
(-[DOMElement offsetParent]):

LayoutTests:

Added a W3C style testharness.js test.

* fast/shadow-dom/offsetParent-across-shadow-boundaries-expected.txt: Added.
* fast/shadow-dom/offsetParent-across-shadow-boundaries.html: Added.

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

2 years agoWeb Inspector: Canvas: path view is misaligned
drousso@apple.com [Tue, 18 Dec 2018 02:45:05 +0000 (02:45 +0000)]
Web Inspector: Canvas: path view is misaligned
https://bugs.webkit.org/show_bug.cgi?id=192761

Reviewed by Joseph Pecoraro.

* UserInterface/Views/RecordingContentView.css:
(.content-view:not(.tab).recording :matches(img, canvas)):
(.content-view:not(.tab).recording canvas.path):

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

2 years agoSome builds are broken after r239262
cfleizach@apple.com [Tue, 18 Dec 2018 02:25:25 +0000 (02:25 +0000)]
Some builds are broken after r239262
https://bugs.webkit.org/show_bug.cgi?id=192777

Reviewed by Simon Fraser.

Source/WebKit:

* Platform/spi/ios/AccessibilitySupportSPI.h:
* UIProcess/Cocoa/WKFullKeyboardAccessWatcher.h:
* UIProcess/Cocoa/WKFullKeyboardAccessWatcher.mm:
(platformIsFullKeyboardAccessEnabled):
(-[WKFullKeyboardAccessWatcher init]):
Fix the build by being more clear about when it's OK to use AccessibilitySupport.

Source/WTF:

* wtf/Platform.h:

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

2 years agoAllow passing nil as session state to [WKWebView _restoreSessionState:]
cdumez@apple.com [Tue, 18 Dec 2018 02:17:26 +0000 (02:17 +0000)]
Allow passing nil as session state to [WKWebView _restoreSessionState:]
https://bugs.webkit.org/show_bug.cgi?id=192789
<rdar://problem/46755277>

Reviewed by Alex Christensen.

Source/WebKit:

Allow passing nil as session state to [WKWebView _restoreSessionState:] instead of crashing.

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

Tools:

Add API test coverage.

* TestWebKitAPI/Tests/WebKit/WKBackForwardList.mm:
(TEST):

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

2 years agoDon't use more expensive layer backing store formats when subpixel text antialiasing...
simon.fraser@apple.com [Tue, 18 Dec 2018 01:45:47 +0000 (01:45 +0000)]
Don't use more expensive layer backing store formats when subpixel text antialiasing is not enabled
https://bugs.webkit.org/show_bug.cgi?id=192780
rdar://problem/43394387

Reviewed by Tim Horton.
Source/WebCore:

macOS Mojave disabled text subpixel antialiasing by default, so we no longer need to use the
memory-hungry "linear glyph mask" CALayer backing store formats for non-opaque with text in them.

Add FontCascade::isSubpixelAntialiasingAvailable() which reports whether subpixel antialiasing is available,
and consult it when making decisions that affect layer backing store format.

Tested by new results for existing tests.

* platform/graphics/FontCascade.cpp:
(WebCore::FontCascade::isSubpixelAntialiasingAvailable):
* platform/graphics/FontCascade.h:
* platform/graphics/cocoa/FontCascadeCocoa.mm:
(WebCore::FontCascade::isSubpixelAntialiasingAvailable): CGFontRenderingGetFontSmoothingDisabled() isn't super cheap, so fetch
it once.
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateAfterDescendants):
* testing/Internals.cpp:
(WebCore::Internals::setFontSmoothingEnabled): Remove a WebCore::

Source/WebCore/PAL:

Add CGFontRenderingGetFontSmoothingDisabled().

* pal/spi/cg/CoreGraphicsSPI.h:

Tools:

No need to set "AppleFontSmoothing" defaults for WK2.

* WebKitTestRunner/InjectedBundle/mac/InjectedBundleMac.mm:
(WTR::InjectedBundle::platformInitialize):

LayoutTests:

New macOS Mojave and later results.

* platform/mac-mojave/compositing/contents-format/subpixel-antialiased-nested-layer-expected.txt: Added.
* platform/mac-mojave/compositing/contents-format/subpixel-antialiased-text-configs-antialiasing-style-expected.txt: Added.
* platform/mac-mojave/compositing/contents-format/subpixel-antialiased-text-configs-expected.txt: Added.
* platform/mac-mojave/compositing/contents-format/subpixel-antialiased-text-enabled-expected.txt: Added.
* platform/mac-mojave/compositing/contents-format/subpixel-antialiased-text-images-expected.txt: Added.
* platform/mac-mojave/compositing/contents-format/subpixel-antialiased-text-traversal-expected.txt: Added.
* platform/mac-mojave/compositing/contents-format/subpixel-antialiased-text-visibility-expected.txt: Added.

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

2 years agoFix occasional null-dereference crash in WebPageProxy::didReceiveServerRedirectForPro...
commit-queue@webkit.org [Tue, 18 Dec 2018 01:32:34 +0000 (01:32 +0000)]
Fix occasional null-dereference crash in WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame
https://bugs.webkit.org/show_bug.cgi?id=192744
<rdar://problem/45842668>

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

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame):
Things happen.  Navigations can be null.  If they are, we shouldn't dereference pointers to them.

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

2 years agoSamplingProfiler's isValidFramePointer() should reject address at stack origin.
mark.lam@apple.com [Tue, 18 Dec 2018 01:21:07 +0000 (01:21 +0000)]
SamplingProfiler's isValidFramePointer() should reject address at stack origin.
https://bugs.webkit.org/show_bug.cgi?id=192779
<rdar://problem/46775869>

Reviewed by Saam Barati.

JSTests:

* stress/sampling-profiler-should-not-sample-beyond-stack-bounds.js: Added.

Source/JavaScriptCore:

isValidFramePointer() was previously treating the address at StackBounds::origin()
as valid stack memory.  This is not true.  StackBounds::origin() is actually the
first address beyond valid stack memory. This is now fixed.

* runtime/SamplingProfiler.cpp:
(JSC::FrameWalker::isValidFramePointer):

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

2 years agowebkitpy: Handle case where stdout and stderr don't accept unicode
jbedard@apple.com [Tue, 18 Dec 2018 00:12:06 +0000 (00:12 +0000)]
webkitpy: Handle case where stdout and stderr don't accept unicode
https://bugs.webkit.org/show_bug.cgi?id=192775
<rdar://problem/46497303>

Reviewed by Stephanie Lewis.

* Scripts/webkitpy/layout_tests/views/metered_stream.py:
(MeteredStream.write): If unicode cannot be written to the stream, replace unicode
characters with '?'.
* Scripts/webkitpy/layout_tests/views/metered_stream_unittest.py:
(RegularTest.test_stream_with_encoding):

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

2 years agoUnreviewed test gardening, address a syntax error in a new test.
ryanhaddad@apple.com [Mon, 17 Dec 2018 23:37:27 +0000 (23:37 +0000)]
Unreviewed test gardening, address a syntax error in a new test.

* stress/out-of-frame-stack-accesses-due-to-probe-based-osr-exits.js:

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

2 years agoUnreviewed, revert recent CrashReporterClient build fixes as they are no longer needed.
cdumez@apple.com [Mon, 17 Dec 2018 23:29:01 +0000 (23:29 +0000)]
Unreviewed, revert recent CrashReporterClient build fixes as they are no longer needed.

* Platform/cocoa/WKCrashReporter.mm:

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

2 years agoAdd "-o/--output" option to startup.py and new_tab.py benchmark scripts to save the...
commit-queue@webkit.org [Mon, 17 Dec 2018 23:06:47 +0000 (23:06 +0000)]
Add "-o/--output" option to startup.py and new_tab.py benchmark scripts to save the results in json format.
https://bugs.webkit.org/show_bug.cgi?id=192385

Patch by Suresh Koppisetty <skoppisetty@apple.com> on 2018-12-17
Reviewed by Ryosuke Niwa.

Sample json output for new tab benchmark script after running for 2 iterations and 2 groups. Values are in milliseconds.
{
        "NewTabBenchmark": {
                "metrics": {
                        "Time": {
                                "current": [
                                        [
                                                410.2939453125,
                                                307.81494140625
                                        ],
                                        [
                                                340.616943359375,
                                                265.94384765625
                                        ]
                                ]
                        }
                }
        }
}

Sample json output for startup time benchmark script after running for 2 iterations. Values are in milliseconds.
{
        "StartupBenchmark": {
                "metrics": {
                        "Time": {
                                "current": [
                                        [
                                                1415.2099609375,
                                                1439.552978515625
                                        ]
                                ]
                        }
                }
        }
}

* LaunchTime/launch_time.py:
* LaunchTime/new_tab.py:
(NewTabBenchmark.get_test_name):
* LaunchTime/startup.py:
(StartupBenchmark.get_test_name):

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

2 years agoImport FeedbackServer only if "-f/--feedback-in-browser" option is enabled.
commit-queue@webkit.org [Mon, 17 Dec 2018 23:01:44 +0000 (23:01 +0000)]
Import FeedbackServer only if "-f/--feedback-in-browser" option is enabled.
https://bugs.webkit.org/show_bug.cgi?id=192378

Patch by Suresh Koppisetty <skoppisetty@apple.com> on 2018-12-17
Reviewed by Ryosuke Niwa.

FeedbackServer currently depends on Tornado-5.1, which further adds
dependency of "singledispatch", "backports-abc" and "futures" python libraries.
Importing FeedbackServer only if "-f/--feedback-in-browser" option is enabled
will let us run the benchmark scripts without installing any new python libraries.

* LaunchTime/launch_time.py:
* LaunchTime/new_tab.py:

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

2 years agoRollout r235411
commit-queue@webkit.org [Mon, 17 Dec 2018 23:00:41 +0000 (23:00 +0000)]
Rollout r235411
https://bugs.webkit.org/show_bug.cgi?id=192778
<rdar://46789485>

Disabling access to CoreServices is causing a performance
regression in process launch time.  See <rdar://46141878>

Patch by Suresh Koppisetty <skoppisettyt@apple.com> on 2018-12-17
Reviewed by Alex Christensen.

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

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

2 years agoSuppress ASAN on valid stack accesses in Probe-based OSRExit::executeOSRExit().
mark.lam@apple.com [Mon, 17 Dec 2018 22:46:50 +0000 (22:46 +0000)]
Suppress ASAN on valid stack accesses in Probe-based OSRExit::executeOSRExit().
https://bugs.webkit.org/show_bug.cgi?id=192776
<rdar://problem/46772368>

Reviewed by Keith Miller.

JSTests:

* stress/out-of-frame-stack-accesses-due-to-probe-based-osr-exits.js: Added.

Source/JavaScriptCore:

1. Add some asanUnsafe methods to the Register class.
2. Update the probe-based OSRExit::executeOSRExit() to use these asanUnsafe methods.

* dfg/DFGOSRExit.cpp:
(JSC::DFG::OSRExit::executeOSRExit):
* interpreter/Register.h:
(JSC::Register::asanUnsafeUnboxedInt32 const):
(JSC::Register::asanUnsafeUnboxedInt52 const):
(JSC::Register::asanUnsafeUnboxedStrictInt52 const):
(JSC::Register::asanUnsafeUnboxedDouble const):
(JSC::Register::asanUnsafeUnboxedCell const):

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

2 years agoMake DocumentMarker::allMarkers() constexpr
dbates@webkit.org [Mon, 17 Dec 2018 21:47:53 +0000 (21:47 +0000)]
Make DocumentMarker::allMarkers() constexpr
https://bugs.webkit.org/show_bug.cgi?id=192634

Reviewed by Simon Fraser.

The result of DocumentMarker::allMarkers() can be computed at compile time. We should annotate
it constexpr to do just that.

* dom/DocumentMarker.h:
(WebCore::DocumentMarker::allMarkers):

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

2 years ago[WebGPU] Implement WebGPUBindGroupLayoutDescriptor and its supporting dictionaries
justin_fan@apple.com [Mon, 17 Dec 2018 21:34:18 +0000 (21:34 +0000)]
[WebGPU] Implement WebGPUBindGroupLayoutDescriptor and its supporting dictionaries
https://bugs.webkit.org/show_bug.cgi?id=192726

Reviewed by Myles C. Maxfield.

Source/WebCore:

Test: webgpu/bind-group-layouts.html
Implement the WebGPUBindGroupLayoutDescriptor struct and its sub-structs:
* Modules/streams/WebGPUBindGroupLayoutDescriptor.h: Added.
* Modules/streams/WebGPUBindGroupLayoutDescriptor.idl: Added.
* Modules/webgpu/WebGPUBindGroupLayoutBinding.h: Added.
* Modules/webgpu/WebGPUBindGroupLayoutBinding.idl: Added.
* Modules/webgpu/WebGPUShaderStageBit.h: Added.
* Modules/webgpu/WebGPUShaderStageBit.idl: Added.
* platform/graphics/gpu/GPUBindGroupLayoutBinding.h: Added.
* platform/graphics/gpu/GPUBindGroupLayoutDescriptor.h: Added.

Add the new symbols and files to the project:
* CMakeLists.txt:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:

Small FIXME update for later:
* platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
(WebCore::GPURenderPassEncoder::setVertexBuffers):

LayoutTests:

Add simple test to ensure a WebGPUBindGroupLayoutDescriptor can be created.

* webgpu/bind-group-layouts-expected.txt: Added.
* webgpu/bind-group-layouts.html: Added.

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

2 years agoFix stale assertion in attemptToForceStringArrayModeByToStringConversion().
mark.lam@apple.com [Mon, 17 Dec 2018 21:32:39 +0000 (21:32 +0000)]
Fix stale assertion in attemptToForceStringArrayModeByToStringConversion().
https://bugs.webkit.org/show_bug.cgi?id=192770
<rdar://problem/46449037>

Reviewed by Keith Miller.

JSTests:

* stress/force-string-arrayMode-on-originalNonArray-array-class.js: Added.

Source/JavaScriptCore:

This assertion was added before Array::OriginalNonArray was introduced.  It just
needs to be updated to allow for Array::OriginalNonArray.

* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::attemptToForceStringArrayModeByToStringConversion):

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

2 years agoWeb Inspector: Audit: add plural result strings
drousso@apple.com [Mon, 17 Dec 2018 21:16:30 +0000 (21:16 +0000)]
Web Inspector: Audit: add plural result strings
https://bugs.webkit.org/show_bug.cgi?id=192769
<rdar://problem/46628680>

Reviewed by Brian Burg.

* UserInterface/Views/AuditTestContentView.js:
(WI.AuditTestContentView.prototype.showNoResultDataPlaceholder):

* UserInterface/Views/AuditTestGroupContentView.js:
(WI.AuditTestGroupContentView.prototype.layout):

* Localizations/en.lproj/localizedStrings.js:

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

2 years agoWeb Inspector: Settings: add singular "space" UIString
drousso@apple.com [Mon, 17 Dec 2018 21:15:39 +0000 (21:15 +0000)]
Web Inspector: Settings: add singular "space" UIString
https://bugs.webkit.org/show_bug.cgi?id=192766
<rdar://problem/46776948>

Reviewed by Brian Burg.

* UserInterface/Views/SettingEditor.js:
(WI.SettingEditor):
(WI.SettingEditor.prototype.get label):
(WI.SettingEditor.prototype.set label): Added.

* UserInterface/Views/SettingsTabContentView.js:
(WI.SettingsTabContentView.prototype._createGeneralSettingsView):
(WI.SettingsTabContentView.prototype._createGeneralSettingsView.addSpacesSetting): Added.
(WI.SettingsTabContentView.prototype._createGeneralSettingsView.addSpacesSetting.updateLabel): Added.

* Localizations/en.lproj/localizedStrings.js:

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

2 years agoSupport concatenating StringView with other string types
dbates@webkit.org [Mon, 17 Dec 2018 20:36:31 +0000 (20:36 +0000)]
Support concatenating StringView with other string types
https://bugs.webkit.org/show_bug.cgi?id=177566

Reviewed by Darin Adler.

Source/WTF:

Add operator+ overloads to StringOperators.h to support concatenating a StringView with
other string types (e.g. String). This lets a person write more naturally looking code:

stringView + string

Instead of:

makeString(stringView, string)

* wtf/text/StringOperators.h:
(WTF::operator+): Added various operator+ overloads.

Tools:

Add some tests to ensure we do not regress the number of allocations needed when performing
string concatenation with string views.

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

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

2 years agoUnreviewed WPE build fix after r239277.
zandobersek@gmail.com [Mon, 17 Dec 2018 20:21:08 +0000 (20:21 +0000)]
Unreviewed WPE build fix after r239277.

* UIProcess/API/C/WKContext.cpp:
(WKContextClearCurrentModifierStateForTesting):
Use the WebKit:: namespace specifier as it is used across this file.

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

2 years agoUnreviewed build fix.
zalan@apple.com [Mon, 17 Dec 2018 20:18:18 +0000 (20:18 +0000)]
Unreviewed build fix.

Source/WebCore:

* page/ios/FrameIOS.mm:
(WebCore::Frame::interpretationsForCurrentRoot const):

Source/WebKitLegacy/ios:

* WebCoreSupport/WebVisiblePosition.mm:
(-[WebVisiblePosition enclosingRangeWithDictationPhraseAlternatives:]):
(-[WebVisiblePosition enclosingRangeWithCorrectionIndicator]):

Source/WebKitLegacy/mac:

* WebView/WebFrame.mm:
(-[WebFrame getDictationResultRanges:andMetadatas:]):

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

2 years agoReproducible ASSERTion failure when toggling layer borders with find-in-page up
zalan@apple.com [Mon, 17 Dec 2018 19:42:55 +0000 (19:42 +0000)]
Reproducible ASSERTion failure when toggling layer borders with find-in-page up
https://bugs.webkit.org/show_bug.cgi?id=192762
<rdar://problem/46676873>

Reviewed by Simon Fraser.

Source/WebCore:

DocumentMarkerController::markersFor() should take a reference instead of a Node*.

Test: editing/document-marker-null-check.html

* dom/DocumentMarkerController.cpp:
(DocumentMarkerController::hasMarkers):
* dom/DocumentMarkerController.h:
* editing/AlternativeTextController.cpp:
(WebCore::AlternativeTextController::respondToChangedSelection):
* editing/Editor.cpp:
(WebCore::Editor::selectionStartHasMarkerFor const):
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::collectMarkedTextsForDocumentMarkers const):
* rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::paint):
* rendering/RenderText.cpp:
(WebCore::RenderText::draggedContentRangesBetweenOffsets const):
* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::canUseForWithReason):
* testing/Internals.cpp:
(WebCore::Internals::markerCountForNode):

LayoutTests:

* editing/document-marker-null-check-expected.txt: Added.
* editing/document-marker-null-check.html: Added.

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

2 years agoUnreviewed, rolling out r239265 and r239274.
commit-queue@webkit.org [Mon, 17 Dec 2018 19:22:20 +0000 (19:22 +0000)]
Unreviewed, rolling out r239265 and r239274.
https://bugs.webkit.org/show_bug.cgi?id=192765

unorm_normalize is deprecated, and broke an internal build
(Requested by Truitt on #webkit).

Reverted changesets:

"[GTK][WPE] Need a function to convert internal URI to display
("pretty") URI"
https://bugs.webkit.org/show_bug.cgi?id=174816
https://trac.webkit.org/changeset/239265

"Fix the Apple Internal Mac build with a newer SDK"
https://trac.webkit.org/changeset/239274

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

2 years agoImplement UIScriptController::toggleCapsLock() for iOS
dbates@webkit.org [Mon, 17 Dec 2018 19:19:25 +0000 (19:19 +0000)]
Implement UIScriptController::toggleCapsLock() for iOS
https://bugs.webkit.org/show_bug.cgi?id=191815

Reviewed by Andy Estes.

Source/WebCore/PAL:

Add HID usage enumerator for the Caps Lock key.

* pal/spi/cocoa/IOKitSPI.h:

Source/WebKit:

Add test infrastructure to clear the current modifier state. We will use this to ensure that
the caps lock state does not persist between tests.

* UIProcess/API/C/WKContext.cpp:
(WKContextClearCurrentModifierStateForTesting): Added.
* UIProcess/API/C/WKContextPrivate.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::clearCurrentModifierStateForTesting): Added.
* UIProcess/WebProcessPool.h:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::clearCurrentModifierStateForTesting): Added.
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:

Tools:

Add support for toggling the caps lock state in WebKitTestRunner on iOS.

* TestRunnerShared/UIScriptContext/UIScriptController.h:
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetStateToConsistentValues): Clear the current modifier state
before running a test. This ensures that the caps lock state does not persist between
tests should a test enable caps lock and not disable it.
* WebKitTestRunner/ios/HIDEventGenerator.mm:
(hidUsageCodeForCharacter): Map "capsLock" to the Caps Lock key usage code.
* WebKitTestRunner/ios/UIScriptControllerIOS.mm:
(WTR::createUIPhysicalKeyboardEvent): Modified to take the keyboard input flags to use to
create the event. Also substituted NSString* for const String& as the data type for the first
two parameters to avoid conversions in the implementation of UIScriptController::toggleCapsLock()
below.
(WTR::UIScriptController::keyDown): Update as needed due to changes to prototype of createUIPhysicalKeyboardEvent().
(WTR::UIScriptController::toggleCapsLock): Dispatch a UIEvent to toggle caps lock.

LayoutTests:

Add iOS-specific results for some of the tests. We need to continue to skip the caps
lock tests on iOS until we have the fix for <rdar://problem/44930119>.

* fast/forms/password-scrolled-after-caps-lock-toggled.html: Replace input.focus() with
UIHelper.activateElement(input) to make it work on iOS and update logic accordingly.
Compensate for the fact that one less character than the size of the input is visible in
a password field on iOS.
* fast/repaint/placeholder-after-caps-lock-hidden.html: Replace input.focus() with
UIHelper.activateElement(input) to make it work on iOS and update logic accordingly.
* platform/ios-wk2/TestExpectations:
* platform/ios-wk2/fast/forms/password-scrolled-after-caps-lock-toggled-expected.txt: Added.
* platform/ios-wk2/fast/repaint/placeholder-after-caps-lock-hidden-expected.txt: Added.

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

2 years agoREGRESSION (r239262): Fix broken builds prior to Mojave
ddkilzer@apple.com [Mon, 17 Dec 2018 19:17:11 +0000 (19:17 +0000)]
REGRESSION (r239262): Fix broken builds prior to Mojave
<https://bugs.webkit.org/show_bug.cgi?id=192373>
<rdar://problem/46462670>

* UIProcess/Cocoa/WKFullKeyboardAccessWatcher.mm:
Wrap header in ENABLE(ACCESSIBILITY_EVENTS) to fix the build.

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

2 years ago[iOS] Remove -[WebEvent initWithKeyEventType:...:characterSet:]
dbates@webkit.org [Mon, 17 Dec 2018 18:58:52 +0000 (18:58 +0000)]
[iOS] Remove -[WebEvent initWithKeyEventType:...:characterSet:]
https://bugs.webkit.org/show_bug.cgi?id=192633

Reviewed by Wenson Hsieh.

Source/WebCore:

UIKit has long adopted the newer -[WebEvent initWithKeyEventType:] initializer that takes an
input manager hint. We no longer need to keep the variant -[WebEvent initWithKeyEventType:...:characterSet:]
for binary compatibility.

* platform/ios/WebEvent.h:
* platform/ios/WebEvent.mm:
(-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:withFlags:keyCode:isTabKey:characterSet:]): Deleted.

Source/WebKit:

Update code to use the modern initializer.

* UIProcess/ios/WKWebEvent.mm:
(-[WKWebEvent initWithEvent:]):

Tools:

Update code to use the modern initializer.

* DumpRenderTree/mac/EventSendingController.mm:
(-[EventSendingController keyDown:withModifiers:withLocation:]):

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

2 years agoFix the Apple Internal Mac build with a newer SDK
dbates@webkit.org [Mon, 17 Dec 2018 18:56:24 +0000 (18:56 +0000)]
Fix the Apple Internal Mac build with a newer SDK

* wtf/URLHelpers.cpp:
(WTF::URLHelpers::userVisibleURL):

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

2 years agoUnreviewed, rolling out r239254.
jlewis3@apple.com [Mon, 17 Dec 2018 18:45:16 +0000 (18:45 +0000)]
Unreviewed, rolling out r239254.

This broke the Windows 10 Debug build

Reverted changeset:

"Replace many uses of String::format with more type-safe
alternatives"
https://bugs.webkit.org/show_bug.cgi?id=192742
https://trac.webkit.org/changeset/239254

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

2 years ago[Web Animations] Remove the redundant m_scheduledMicrotask from WebAnimation
graouts@webkit.org [Mon, 17 Dec 2018 17:51:57 +0000 (17:51 +0000)]
[Web Animations] Remove the redundant m_scheduledMicrotask from WebAnimation
https://bugs.webkit.org/show_bug.cgi?id=192758

Reviewed by Dean Jackson.

We tracked whether we had a pending microtask twice so we remove the m_scheduledMicrotask flag as m_finishNotificationStepsMicrotaskPending
gives us enough information as it is. Additionally, we remove the scheduleMicrotaskIfNeeded() and performMicrotask() functions since there is
less bookkeeping to perform.

No new test since there is no user-observable change.

* animation/WebAnimation.cpp:
(WebCore::WebAnimation::updateFinishedState):
(WebCore::WebAnimation::scheduleMicrotaskIfNeeded): Deleted.
(WebCore::WebAnimation::performMicrotask): Deleted.
* animation/WebAnimation.h:

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

2 years ago[Web Animations] Ensure we don't update an animation's finished state twice when...
graouts@webkit.org [Mon, 17 Dec 2018 17:49:55 +0000 (17:49 +0000)]
[Web Animations] Ensure we don't update an animation's finished state twice when updating animations
https://bugs.webkit.org/show_bug.cgi?id=192757

Reviewed by Dean Jackson.

When animations are udpated and DocumentTimeline::updateAnimationsAndSendEvents() is called, we used to update an animation's finished state
twice since we'd do it once when calling tick() and once again when calling resolve() in the ensuing style invalidation. We now keep track of
whether we've already updated an animation's finished state during animation update in the call to tick() and avoid updating in the immediate
next call to resolve(), unless any of the timing properties have changed in the meantime.

No new test since there is no user-observable change.

* animation/WebAnimation.cpp:
(WebCore::WebAnimation::timingDidChange):
(WebCore::WebAnimation::tick):
(WebCore::WebAnimation::resolve):
* animation/WebAnimation.h:

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

2 years agoREGRESSION (r233268): Elements animated in from offscreen sometimes don't display
simon.fraser@apple.com [Mon, 17 Dec 2018 17:10:44 +0000 (17:10 +0000)]
REGRESSION (r233268): Elements animated in from offscreen sometimes don't display
https://bugs.webkit.org/show_bug.cgi?id=192725
rdar://problem/46011418

Reviewed by Antoine Quint.

Source/WebCore:

There were two problems with backing store attachment and animation.

First, animations are an input into the "backing store attached" logic, so when they change
we should set the CoverageRectChanged bit on GraphicsLayerCA.

Secondly, when an ancestor has unknown animation extent, all its descendants need to
get backing store, so we need to set childCommitState.ancestorWithTransformAnimationIntersectsCoverageRect when
the current layer has no animation extent.

Tests: compositing/backing/animate-into-view-with-descendant.html
       compositing/backing/animate-into-view.html

* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::addAnimation):
(WebCore::GraphicsLayerCA::removeAnimation):
(WebCore::GraphicsLayerCA::recursiveCommitChanges):

LayoutTests:

* compositing/backing/animate-into-view-expected.txt: Added.
* compositing/backing/animate-into-view-with-descendant-expected.txt: Added.
* compositing/backing/animate-into-view-with-descendant.html: Added.
* compositing/backing/animate-into-view.html: Added.
* platform/ios/compositing/backing/animate-into-view-expected.txt: Added.
* platform/ios/compositing/backing/animate-into-view-with-descendant-expected.txt: Added.

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

2 years ago[LFC][BFC][MarginCollapsing] Unify margin collapse function naming
zalan@apple.com [Mon, 17 Dec 2018 15:44:55 +0000 (15:44 +0000)]
[LFC][BFC][MarginCollapsing] Unify margin collapse function naming
https://bugs.webkit.org/show_bug.cgi?id=192747

Reviewed by Antti Koivisto.

Rename some margin collapse getters.

* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginBefore):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginAfter):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginBefore):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginAfter):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginBeforeFromFirstChild):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginAfterFromLastChild):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithParentMarginAfter):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithParentMarginBefore):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginAfter):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithPreviousSibling):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithNextSibling):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginsCollapseThrough):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBefore):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfter):
(WebCore::Layout::isMarginBeforeCollapsedWithSibling): Deleted.
(WebCore::Layout::isMarginAfterCollapsedWithSibling): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBeforeCollapsedWithParent): Deleted.
(WebCore::Layout::isMarginAfterCollapsedThrough): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginAfterCollapsedWithParent): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBeforeCollapsedWithParentMarginAfter): Deleted.

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

2 years agoclang-tidy: loop variable is copied but only used as const reference in WebCore,...
ddkilzer@apple.com [Mon, 17 Dec 2018 14:22:41 +0000 (14:22 +0000)]
clang-tidy: loop variable is copied but only used as const reference in WebCore, WebKit, Tools
<https://webkit.org/b/192751>
<rdar://problem/46771623>

Reviewed by Daniel Bates.

Change loop variables to const references to avoid unnecessary
copies.

Source/WebCore:

* Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
(WebCore::IDBServer::MemoryBackingStoreTransaction::abort):
* Modules/indexeddb/server/MemoryObjectStore.cpp:
(WebCore::IDBServer::MemoryObjectStore::populateIndexWithExistingRecords):
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::maybeNotifyConnectionsOfVersionChange):
* Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::objectStoreIdentifiers):
* Modules/indexeddb/shared/IDBDatabaseInfo.cpp:
(WebCore::IDBDatabaseInfo::IDBDatabaseInfo):
(WebCore::IDBDatabaseInfo::loggingString const):
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::removeSamplesFromTrackBuffer):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::targetElementForActiveDescendant const):
* accessibility/AccessibilityTableRow.cpp:
(WebCore::AccessibilityTableRow::headerObject):
* animation/KeyframeEffect.cpp:
(WebCore::KeyframeEffect::computedNeedsForcedLayout):
* crypto/keys/CryptoKeyRSA.cpp:
(WebCore::CryptoKeyRSA::importJwk):
(WebCore::CryptoKeyRSA::exportJwk const):
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::OrderedNamedLinesCollector::appendLines const):
* dom/DataTransfer.cpp:
(WebCore::readURLsFromPasteboardAsString):
* dom/TreeScope.cpp:
(WebCore::TreeScope::elementsFromPoint):
* html/track/WebVTTParser.cpp:
(WebCore::WebVTTParser::checkAndStoreRegion):
* inspector/agents/InspectorTimelineAgent.cpp:
(WebCore::InspectorTimelineAgent::setInstruments):
* page/Page.cpp:
(WebCore::Page::updateIntersectionObservations):
* page/TextIndicator.cpp:
(WebCore::estimatedBackgroundColorForRange):
* page/animation/KeyframeAnimation.cpp:
(WebCore::KeyframeAnimation::computeLayoutDependency):
* platform/graphics/DisplayRefreshMonitorManager.cpp:
(WebCore::DisplayRefreshMonitorManager::displayWasUpdated):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::moveOrCopyAnimations):
(WebCore::GraphicsLayerCA::updateAnimations):
(WebCore::GraphicsLayerCA::isRunningTransformAnimation const):
* platform/graphics/mac/ImageMac.mm:
(WebCore::BitmapImage::tiffRepresentation):
* rendering/HitTestResult.cpp:
(WebCore::HitTestResult::append):
* testing/Internals.cpp:
(WebCore::Internals::acceleratedAnimationsForElement):

Source/WebKit:

* NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
(WebKit::WebSWServerConnection::~WebSWServerConnection):
* Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
(WebKit::RemoteLayerTreeTransaction::encode const):
* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
(WebKit::toNSErrors):
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::setFilesToSelectForFileUpload):
(WebKit::WebAutomationSession::performKeyboardInteractions):
(WebKit::WebAutomationSession::performInteractionSequence):
* UIProcess/Plugins/PluginProcessManager.cpp:
(WebKit::PluginProcessManager::getPluginProcess):
* UIProcess/ResourceLoadStatisticsMemoryStore.cpp:
(WebKit::ResourceLoadStatisticsMemoryStore::removeDataRecords):
(WebKit::ResourceLoadStatisticsMemoryStore::shouldRemoveDataRecords const):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::serializedAttachmentDataForIdentifiers):
* UIProcess/WebStorage/LocalStorageDatabaseTracker.cpp:
(WebKit::LocalStorageDatabaseTracker::deleteAllDatabases):
(WebKit::LocalStorageDatabaseTracker::origins const):
(WebKit::LocalStorageDatabaseTracker::originDetails):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_shouldAttachDrawingAreaOnPageTransition):
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::didUpdateActivityStateTimerFired):

Tools:

* DumpRenderTree/mac/DumpRenderTreePasteboard.mm:
(-[LocalPasteboard pasteboardItems]):

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

2 years ago[GTK][WPE] Need a function to convert internal URI to display ("pretty") URI
Ms2ger@igalia.com [Mon, 17 Dec 2018 14:08:46 +0000 (14:08 +0000)]
[GTK][WPE] Need a function to convert internal URI to display ("pretty") URI
https://bugs.webkit.org/show_bug.cgi?id=174816

Reviewed by Michael Catanzaro.

Source/WebCore:

Tests: enabled fast/url/user-visible/.

* testing/Internals.cpp:
(WebCore::Internals::userVisibleString): Enable method on all platforms.

Source/WebKit:

Add webkit_uri_for_display for GTK and WPE.

* PlatformGTK.cmake:
* PlatformWPE.cmake:
* SourcesGTK.txt:
* SourcesWPE.txt:
* UIProcess/API/glib/WebKitURIUtilities.cpp: Added.
(webkit_uri_for_display):
* UIProcess/API/gtk/WebKitURIUtilities.h: Added.
* UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
* UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
* UIProcess/API/gtk/webkit2.h:
* UIProcess/API/wpe/WebKitURIUtilities.h: Added.
* UIProcess/API/wpe/docs/wpe-0.1-sections.txt:
* UIProcess/API/wpe/docs/wpe-docs.sgml:
* UIProcess/API/wpe/webkit.h:

Source/WTF:

Translate userVisibleString and dependent code into platform-neutral C++
in wtf/URLHelpers.{h,cpp}.

* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/URLHelpers.cpp: Added.
(WTF::URLHelpers::loadIDNScriptWhiteList):
(WTF::URLHelpers::isArmenianLookalikeCharacter):
(WTF::URLHelpers::isArmenianScriptCharacter):
(WTF::URLHelpers::isASCIIDigitOrValidHostCharacter):
(WTF::URLHelpers::isLookalikeCharacter):
(WTF::URLHelpers::whiteListIDNScript):
(WTF::URLHelpers::initializeDefaultIDNScriptWhiteList):
(WTF::URLHelpers::allCharactersInIDNScriptWhiteList):
(WTF::URLHelpers::isSecondLevelDomainNameAllowedByTLDRules):
(WTF::URLHelpers::isRussianDomainNameCharacter):
(WTF::URLHelpers::allCharactersAllowedByTLDRules):
(WTF::URLHelpers::mapHostName):
(WTF::URLHelpers::collectRangesThatNeedMapping):
(WTF::URLHelpers::applyHostNameFunctionToMailToURLString):
(WTF::URLHelpers::applyHostNameFunctionToURLString):
(WTF::URLHelpers::mapHostNames):
(WTF::URLHelpers::createStringWithEscapedUnsafeCharacters):
(WTF::URLHelpers::userVisibleURL):
* wtf/URLHelpers.h: Added.
* wtf/cocoa/NSURLExtras.mm:
(WTF::URLHelpers::loadIDNScriptWhiteList):
(WTF::decodePercentEscapes):
(WTF::decodeHostName):
(WTF::encodeHostName):
(WTF::URLWithUserTypedString):
(WTF::userVisibleString):

Tools:

Add tests for userVisibleString() and (for GTK and WPE) webkit_uri_for_display().

* TestWebKitAPI/CMakeLists.txt:
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WTF/URLHelpers.cpp: Added.
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKitGLib/TestWebKitURIUtilities.cpp: Added.
(testURIForDisplayUnaffected):
(testURIForDisplayAffected):
(beforeAll):
(afterAll):
* TestWebKitAPI/glib/CMakeLists.txt:

LayoutTests:

* TestExpectations: Enable fast/url/user-visible/.

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

2 years ago[WPE] Add API to notify about frame displayed view backend callback
carlosgc@webkit.org [Mon, 17 Dec 2018 13:31:27 +0000 (13:31 +0000)]
[WPE] Add API to notify about frame displayed view backend callback
https://bugs.webkit.org/show_bug.cgi?id=192224

Reviewed by Michael Catanzaro.

Source/WebKit:

Add API to add a callback to the view to be called when the view backend notifies that a frame has been
displayed.

* UIProcess/API/glib/WebKitWebView.cpp:
(FrameDisplayedCallback::FrameDisplayedCallback):
(FrameDisplayedCallback::~FrameDisplayedCallback):
(webkit_web_view_add_frame_displayed_callback):
(webkit_web_view_remove_frame_displayed_callback):
* UIProcess/API/wpe/WebKitWebView.h:
* UIProcess/API/wpe/docs/wpe-0.1-sections.txt:

Tools:

Add a test case to check the new API.

* TestWebKitAPI/Tests/WebKitGLib/TestWebKitWebView.cpp:
(testWebViewFrameDisplayed):
(beforeAll):
* wpe/jhbuild.modules: Bump WPEBackend-fdo to 1.1.0.

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

2 years agoAX: Support keyboard access preference for iOS in WebKit
cfleizach@apple.com [Mon, 17 Dec 2018 00:44:23 +0000 (00:44 +0000)]
AX: Support keyboard access preference for iOS in WebKit
https://bugs.webkit.org/show_bug.cgi?id=192373
<rdar://problem/46462670>

Reviewed by Tim Horton.

* Platform/spi/ios/AccessibilitySupportSPI.h:
* PlatformMac.cmake:
* SourcesCocoa.txt:
* UIProcess/Cocoa/WKFullKeyboardAccessWatcher.h: Added.
* UIProcess/Cocoa/WKFullKeyboardAccessWatcher.mm: Added.
(platformIsFullKeyboardAccessEnabled):
(-[WKFullKeyboardAccessWatcher notifyAllProcessPools]):
(-[WKFullKeyboardAccessWatcher retrieveKeyboardUIModeFromPreferences:]):
(-[WKFullKeyboardAccessWatcher init]):
(+[WKFullKeyboardAccessWatcher fullKeyboardAccessEnabled]):
* UIProcess/ios/WebProcessProxyIOS.mm:
(WebKit::WebProcessProxy::fullKeyboardAccessEnabled):
* UIProcess/mac/WKFullKeyboardAccessWatcher.h: Removed.
* UIProcess/mac/WKFullKeyboardAccessWatcher.mm: Removed.
* WebKit.xcodeproj/project.pbxproj:

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

2 years agoUnreviewed follow up after r239260
aperez@igalia.com [Sun, 16 Dec 2018 22:29:13 +0000 (22:29 +0000)]
Unreviewed follow up after r239260
https://bugs.webkit.org/show_bug.cgi?id=192714
<rdar://problem/46762407>

* Platform/win/SharedMemoryWin.cpp:
(WebKit::SharedMemory::allocate): Use PAGE_READWRITE directly instead
of going through the protectAttribute() function, which is removed
because it is now unused.

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

2 years agoUnify SharedMemory factory functions
aperez@igalia.com [Sun, 16 Dec 2018 19:39:38 +0000 (19:39 +0000)]
Unify SharedMemory factory functions
https://bugs.webkit.org/show_bug.cgi?id=192714

Reviewed by Darin Adler.

This unifies SharedMemory so in the following way, across platforms:

- SharedMemory::create() is removed, to avoid ambiguity.
- SharedMemory::allocate() always allocates a new block of shared memory.
- SharedMemory::wrapMap() always creates a SharedMemory object which refers to an
  existing region of memory resulting from memory-mapping a file.

* NetworkProcess/cache/NetworkCacheDataCocoa.mm:
(WebKit::NetworkCache::Data::tryCreateSharedMemory const): Use SharedMemory::wrapMap().
* Platform/SharedMemory.h: Remove the definition of SharedMemory::create(), and make
SharedMemory::wrapMap() available on OS(DARWIN) as well.
* Platform/cocoa/SharedMemoryCocoa.cpp:
(WebKit::SharedMemory::wrapMap): Renamed from ::create().
* Platform/unix/SharedMemoryUnix.cpp:
(WebKit::SharedMemory::allocate): Renamed from ::create().
* Platform/win/SharedMemoryWin.cpp:
(WebKit::SharedMemory::allocate): Renamed from ::create()
* UIProcess/API/APIContentRuleListStore.cpp:
(API::createExtension): Use NetworkCache::Data::tryCreateSharedMemory() instead of
SharedMemory::create().

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

2 years agoUnreviewed build fix after r239253
aperez@igalia.com [Sun, 16 Dec 2018 12:05:46 +0000 (12:05 +0000)]
Unreviewed build fix after r239253

* gtk/jhbuild.modules: Fix typo in libpsl dependency name.

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

2 years ago[meta][WebKit] Remove using namespace WebCore and WebKit in the global scope for...
cfleizach@apple.com [Sun, 16 Dec 2018 07:25:21 +0000 (07:25 +0000)]
[meta][WebKit] Remove using namespace WebCore and WebKit in the global scope for unified source builds
https://bugs.webkit.org/show_bug.cgi?id=192449
<rdar://problem/46595508>

Reviewed by Darin Adler.

Part 7: Files in UIProcess/API

* UIProcess/API/APIContentRuleListStore.cpp:
* UIProcess/API/APIHitTestResult.cpp:
* UIProcess/API/APINavigation.cpp:
* UIProcess/API/APIOpenPanelParameters.cpp:
* UIProcess/API/APIPageConfiguration.cpp:
* UIProcess/API/C/WKApplicationCacheManager.cpp:
(WKApplicationCacheManagerGetTypeID):
(WKApplicationCacheManagerGetApplicationCacheOrigins):
(WKApplicationCacheManagerDeleteEntriesForOrigin):
(WKApplicationCacheManagerDeleteAllEntries):
* UIProcess/API/C/WKAuthenticationDecisionListener.cpp:
(WKAuthenticationDecisionListenerGetTypeID):
(WKAuthenticationDecisionListenerUseCredential):
(WKAuthenticationDecisionListenerCancel):
(WKAuthenticationDecisionListenerRejectProtectionSpaceAndContinue):
* UIProcess/API/C/WKBackForwardListItemRef.cpp:
(WKBackForwardListItemGetTypeID):
(WKBackForwardListItemCopyURL):
(WKBackForwardListItemCopyTitle):
(WKBackForwardListItemCopyOriginalURL):
* UIProcess/API/C/WKContext.cpp:
(WKContextGetTypeID):
(WKContextCreate):
(WKContextCreateWithInjectedBundlePath):
(WKContextCreateWithConfiguration):
(WKContextSetClient):
(WKContextSetInjectedBundleClient):
(WKContextSetHistoryClient):
(WKContextSetDownloadClient):
(WKContextSetConnectionClient):
(WKContextDownloadURLRequest):
(WKContextResumeDownload):
(WKContextSetInitializationUserDataForInjectedBundle):
(WKContextPostMessageToInjectedBundle):
(WKContextGetGlobalStatistics):
(WKContextAddVisitedLink):
(WKContextClearVisitedLinks):
(WKContextSetCacheModel):
(WKContextGetCacheModel):
(WKContextSetMaximumNumberOfProcesses):
(WKContextGetMaximumNumberOfProcesses):
(WKContextSetAlwaysUsesComplexTextCodePath):
(WKContextSetShouldUseFontSmoothing):
(WKContextSetAdditionalPluginsDirectory):
(WKContextRefreshPlugIns):
(WKContextRegisterURLSchemeAsEmptyDocument):
(WKContextRegisterURLSchemeAsSecure):
(WKContextRegisterURLSchemeAsBypassingContentSecurityPolicy):
(WKContextRegisterURLSchemeAsCachePartitioned):
(WKContextRegisterURLSchemeAsCanDisplayOnlyIfCanRequest):
(WKContextSetDomainRelaxationForbiddenForURLScheme):
(WKContextSetCanHandleHTTPSServerTrustEvaluation):
(WKContextSetPrewarmsProcessesAutomatically):
(WKContextSetCustomWebContentServiceBundleIdentifier):
(WKContextSetDiskCacheSpeculativeValidationEnabled):
(WKContextPreconnectToServer):
(WKContextGetCookieManager):
(WKContextGetWebsiteDataStore):
(WKContextGetGeolocationManager):
(WKContextGetMediaSessionFocusManager):
(WKContextGetNotificationManager):
(WKContextStartMemorySampler):
(WKContextStopMemorySampler):
(WKContextAllowSpecificHTTPSCertificateForHost):
(WKContextDisableProcessTermination):
(WKContextEnableProcessTermination):
(WKContextSetHTTPPipeliningEnabled):
(WKContextWarmInitialProcess):
(WKContextGetStatistics):
(WKContextGetStatisticsWithOptions):
(WKContextJavaScriptConfigurationFileEnabled):
(WKContextSetJavaScriptConfigurationFileEnabled):
(WKContextGarbageCollectJavaScriptObjects):
(WKContextSetJavaScriptGarbageCollectorTimerEnabled):
(WKContextUseTestingNetworkSession):
(WKContextSetAllowsAnySSLCertificateForWebSocketTesting):
(WKContextSetAllowsAnySSLCertificateForServiceWorkerTesting):
(WKContextClearCachedCredentials):
(WKContextCopyPlugInAutoStartOriginHashes):
(WKContextSetPlugInAutoStartOriginHashes):
(WKContextSetPlugInAutoStartOriginsFilteringOutEntriesAddedAfterTime):
(WKContextSetPlugInAutoStartOrigins):
(WKContextSetInvalidMessageFunction):
(WKContextSetMemoryCacheDisabled):
(WKContextSetFontWhitelist):
(WKContextTerminateNetworkProcess):
(WKContextTerminateServiceWorkerProcess):
(WKContextGetNetworkProcessIdentifier):
(WKContextAddSupportedPlugin):
(WKContextClearSupportedPlugins):
(WKContextSetIDBPerOriginQuota):
* UIProcess/API/C/WKPage.cpp:
(WKPageLoadURLWithShouldOpenExternalURLsPolicy):
(WKPageLoadURLWithUserData):
(WKPageLoadURLRequestWithUserData):
(WKPageSetPaginationMode):
(WKPageGetPaginationMode):
(WKPageSetPageLoaderClient):
(WKPageSetPagePolicyClient):
* UIProcess/API/C/cg/WKIconDatabaseCG.cpp:

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

2 years agoUnreviewed, suppress warnings in Linux
yusukesuzuki@slowstart.org [Sun, 16 Dec 2018 06:12:53 +0000 (06:12 +0000)]
Unreviewed, suppress warnings in Linux

Source/bmalloc:

* bmalloc/Gigacage.cpp:

Source/JavaScriptCore:

* jsc.cpp:
(jscmain):

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

2 years agoNull pointer dereference in JSC::WriteBarrierBase()
yusukesuzuki@slowstart.org [Sun, 16 Dec 2018 05:49:01 +0000 (05:49 +0000)]
Null pointer dereference in JSC::WriteBarrierBase()
https://bugs.webkit.org/show_bug.cgi?id=191252

Reviewed by Keith Miller.

Source/JavaScriptCore:

JSPromiseDeferred::create can return nullptr and an exception if stack overflow happens.
We would like to make it RELEASE_ASSERT since the current module mechanism is not immune
to stack overflow.

This patch renames JSPromiseDeferred::create to JSPromiseDeferred::tryCreate to tell that
it can return nullptr. And we insert error checks or assertions after this call.

* jsc.cpp:
(GlobalObject::moduleLoaderImportModule):
(GlobalObject::moduleLoaderFetch):
* runtime/Completion.cpp:
(JSC::rejectPromise):
* runtime/JSGlobalObjectFunctions.cpp:
(JSC::globalFuncImportModule):
* runtime/JSInternalPromiseDeferred.cpp:
(JSC::JSInternalPromiseDeferred::tryCreate):
(JSC::JSInternalPromiseDeferred::create): Deleted.
* runtime/JSInternalPromiseDeferred.h:
* runtime/JSModuleLoader.cpp:
(JSC::JSModuleLoader::importModule):
(JSC::JSModuleLoader::resolve):
(JSC::JSModuleLoader::fetch):
(JSC::moduleLoaderParseModule):
* runtime/JSPromise.h:
* runtime/JSPromiseDeferred.cpp:
(JSC::JSPromiseDeferred::tryCreate):
* runtime/JSPromiseDeferred.h:
* wasm/js/WebAssemblyPrototype.cpp:
(JSC::webAssemblyCompileFunc):
(JSC::webAssemblyInstantiateFunc):
(JSC::webAssemblyCompileStreamingInternal):
(JSC::webAssemblyInstantiateStreamingInternal):

Source/WebCore:

* bindings/js/JSCustomElementRegistryCustom.cpp:
(WebCore::JSCustomElementRegistry::whenDefined):
* bindings/js/JSDOMPromiseDeferred.cpp:
(WebCore::createDeferredPromise):
* bindings/js/JSDOMPromiseDeferred.h:
(WebCore::DeferredPromise::create):
(WebCore::callPromiseFunction):
* bindings/js/JSDOMWindowBase.cpp:
(WebCore::JSDOMWindowBase::moduleLoaderFetch):
(WebCore::JSDOMWindowBase::moduleLoaderImportModule):
* bindings/js/ScriptModuleLoader.cpp:
(WebCore::ScriptModuleLoader::fetch):
(WebCore::rejectPromise):

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

2 years agoUse warning-ignoring macros more consistently and simply
darin@apple.com [Sun, 16 Dec 2018 00:21:25 +0000 (00:21 +0000)]
Use warning-ignoring macros more consistently and simply
https://bugs.webkit.org/show_bug.cgi?id=192743

Reviewed by Mark Lam.

Source/JavaScriptCore:

* dfg/DFGSpeculativeJIT64.cpp: Use IGNORE_WARNINGS_BEGIN/END instead of
IGNORE_CLANG_WARNINGS_BEGIN/END. Other callsites are using the non-clang-specific
one for this warning, "implicit-fallthrough", and it seems there is no special
need to use the clang-specific one here.
* llint/LLIntData.cpp: Ditto, but here it's "missing-noreturn"."
* tools/CodeProfiling.cpp: Ditto.

Source/WebCore:

* bridge/objc/WebScriptObject.mm: Use IGNORE_WARNINGS_BEGIN rather than
IGNORE_CLANG_WARNINGS_BEGIN here. There is no need to compile Objective-C++
files like this one with non-clang compilers, and no need to worry about
them when choosing the macro.

* crypto/mac/CryptoKeyRSAMac.cpp:
(WebCore::getPublicKeyComponents): Use ALLOW_DEPRECATED_DECLARATIONS_BEGIN/END.

* css/makeprop.pl: Use IGNORE_WARNINGS_BEGIN/END, obviating the need for
the "unknown-pragmas" trick, which the macro should take care of.
* css/makevalues.pl: Ditto.
* platform/ColorData.gperf: Ditto.

* platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
(WebCore::CDMSessionAVStreamSession::update): Use IGNORE_WARNINGS_BEGIN/END
(see rationale above for Objective-C++).

* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::videoPlaybackQualityMetrics): Use
ALLOW_NEW_API_WITHOUT_GUARDS_BEGIN/END.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::videoPlaybackQualityMetrics): Ditto.

* platform/ios/DragImageIOS.mm: Use IGNORE_WARNINGS_BEGIN/END
(see rationale above for Objective-C++).

* platform/ios/VideoFullscreenInterfaceAVKit.mm:
(-[WebAVPlayerViewController setWebKitOverrideRouteSharingPolicy:routingContextUID:]):
Use ALLOW_NEW_API_WITHOUT_GUARDS_BEGIN/END.

* platform/mac/WebPlaybackControlsManager.mm: Use IGNORE_WARNINGS_BEGIN/END
(see rationale above for Objective-C++).

* platform/network/cocoa/ResourceResponseCocoa.mm:
(WebCore::ResourceResponse::platformCertificateInfo const): Use
ALLOW_DEPRECATED_DECLARATIONS_BEGIN/END.

Source/WebCore/PAL:

* pal/spi/cocoa/AVKitSPI.h: Use IGNORE_WARNINGS_BEGIN instead of
IGNORE_CLANG_WARNINGS_BEGIN; there is no special need to accomodate
non-clang compilers here.

Source/WebKit:

* UIProcess/ios/WKDrawingView.mm:
(-[WKDrawingView initWithEmbeddedViewID:webPageProxy:]):
Use ALLOW_DEPRECATED_DECLARATIONS_BEGIN/END.
* UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
(-[WKFullScreenWindowController _EVOrganizationName]): Ditto.

* WebProcess/WebCoreSupport/WebAlternativeTextClient.h: Use
IGNORE_WARNINGS_BEGIN/END instead of IGNORE_CLANG_WARNINGS_BEGIN/END
because there is no need to accomodate non-clang compilers here.
Also use #pragma once, add a missing "explicit", and fix conditionals.

Source/WebKitLegacy/mac:

* DOM/DOM.mm: Use IGNORE_WARNINGS_BEGIN/END instead of
IGNORE_CLANG_WARNINGS_BEGIN since there is no need to accomodate non-clang
compilers in Objective-C++ code.

* WebCoreSupport/WebAlternativeTextClient.h: Use IGNORE_WARNINGS_BEGIN/END
instead of IGNORE_CLANG_WARNINGS_BEGIN/END because there is no need to
accomodate non-clang compilers here. Also use #pragma once, add a missing
"explicit" and fix conditionals.

Source/WTF:

* wtf/Assertions.h: Use IGNORE_WARNINGS_BEGIN rather than
IGNORE_CLANG_WARNINGS_BEGIN since we don't need special handling for
non-clang compilers, in part since the code is already inside
#if COMPILER(CLANG), but also because it would be harmless to ignore this
warning on non-clang; we should almost never use IGNORE_CLANG_WARNINGS_BEGIN.

Tools:

* DumpRenderTree/TestNetscapePlugIn/main.cpp:
(handleEventCarbon): Use ALLOW_DEPRECATED_DECLARATIONS_BEGIN/END.
* DumpRenderTree/mac/TextInputControllerMac.m:
(-[TextInputController interpretKeyEvents:withSender:]): Use
IGNORE_WARNINGS_BEGIN/END.
* WebKitTestRunner/mac/EventSenderProxy.mm:
(WTR::EventSenderProxy::mouseForceClick): Use
IGNORE_NULL_CHECK_WARNINGS_BEGIN/END.
(WTR::EventSenderProxy::startAndCancelMouseForceClick): Ditto.
(WTR::EventSenderProxy::mouseForceDown): Ditto.
(WTR::EventSenderProxy::mouseForceUp): Ditto.
(WTR::EventSenderProxy::mouseForceChanged): Ditto.

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

2 years agoReplace many uses of String::format with more type-safe alternatives
darin@apple.com [Sun, 16 Dec 2018 00:09:32 +0000 (00:09 +0000)]
Replace many uses of String::format with more type-safe alternatives
https://bugs.webkit.org/show_bug.cgi?id=192742

Reviewed by Mark Lam.

Source/JavaScriptCore:

* inspector/InjectedScriptBase.cpp:
(Inspector::InjectedScriptBase::makeCall): Use makeString.
(Inspector::InjectedScriptBase::makeAsyncCall): Ditto.
* inspector/InspectorBackendDispatcher.cpp:
(Inspector::BackendDispatcher::getPropertyValue): Ditto.
* inspector/agents/InspectorConsoleAgent.cpp:
(Inspector::InspectorConsoleAgent::enable): Ditto.
* jsc.cpp:
(FunctionJSCStackFunctor::operator() const): Ditto.

* runtime/IntlDateTimeFormat.cpp:
(JSC::IntlDateTimeFormat::initializeDateTimeFormat): Use string concatenation.
* runtime/IntlObject.cpp:
(JSC::canonicalizeLocaleList): Ditto.

Source/WebCore:

A while back, String::format was more efficient than string concatenation,
but that is no longer true, and we should prefer String::number, makeString,
or concatenation with the "+" operator to String::format for new code.

This is not as good for programmers who are fond of printf formatting
style, and in some cases it's a little harder to read the strings
interspersed with variables rather than a format string, but it's better
in a few ways:

- more efficient (I didn't measure the difference, but it's definitely
  slower to use String::Format which calls vsnprintf twice than to use
  the WTF code)
- works in a type-safe way without a need to use a format specifier such
  as "%" PRIu64 or "%tu" making it much easier to avoid problems due to
  subtle differences between platforms
- allows us to use StringView in some cases to sidestep the need to
  allocate temporary WTF::String objects
- does not require converting each WTF::String to a C string, allowing
  us to remove many cases of ".utf8().data()" and similar expressions,
  eliminating the allocation of temporary WTF::CString objects

This patch covers a batch of easiest-to-convert call sites.
Later patches will allow us to deprecate or remove String::format.

* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::addRecord): Use makeString.
* Modules/indexeddb/shared/IDBCursorInfo.cpp:
(WebCore::IDBCursorInfo::loggingString const): Ditto.
* Modules/indexeddb/shared/IDBGetAllRecordsData.cpp:
(WebCore::IDBGetAllRecordsData::loggingString const): Ditto.
* Modules/indexeddb/shared/IDBGetRecordData.cpp:
(WebCore::IDBGetRecordData::loggingString const): Ditto.
* Modules/indexeddb/shared/IDBIndexInfo.cpp:
(WebCore::IDBIndexInfo::loggingString const): Ditto.
(WebCore::IDBIndexInfo::condensedLoggingString const): Ditto.
* Modules/indexeddb/shared/IDBIterateCursorData.cpp:
(WebCore::IDBIterateCursorData::loggingString const): Ditto.
* Modules/indexeddb/shared/IDBObjectStoreInfo.cpp:
(WebCore::IDBObjectStoreInfo::condensedLoggingString const): Ditto.
* Modules/indexeddb/shared/IDBResourceIdentifier.cpp:
(WebCore::IDBResourceIdentifier::loggingString const): Ditto.
* Modules/webdatabase/Database.cpp:
(WebCore::formatErrorMessage): Ditto.
* Modules/webdatabase/SQLError.h:
(WebCore::SQLError::create): Ditto.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation): Use makeString.

* bindings/scripts/test/JS/JSInterfaceName.cpp:
* bindings/scripts/test/JS/JSMapLike.cpp:
* bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
* bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
* bindings/scripts/test/JS/JSTestCEReactions.cpp:
* bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
* bindings/scripts/test/JS/JSTestCallTracer.cpp:
* bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
* bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
* bindings/scripts/test/JS/JSTestDOMJIT.cpp:
* bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
* bindings/scripts/test/JS/JSTestEventTarget.cpp:
* bindings/scripts/test/JS/JSTestException.cpp:
* bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
* bindings/scripts/test/JS/JSTestGlobalObject.cpp:
* bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
* bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
* bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
* bindings/scripts/test/JS/JSTestInterface.cpp:
* bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
* bindings/scripts/test/JS/JSTestIterable.cpp:
* bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
* bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
* bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
* bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
* bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
* bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
* bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
* bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
* bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
* bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
* bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
* bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
* bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
* bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
* bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
* bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
* bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
* bindings/scripts/test/JS/JSTestNode.cpp:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
* bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
* bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
* bindings/scripts/test/JS/JSTestPluginInterface.cpp:
* bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
* bindings/scripts/test/JS/JSTestSerialization.cpp:
* bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp:
* bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
* bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
* bindings/scripts/test/JS/JSTestStringifier.cpp:
* bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
* bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
* bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
* bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
* bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
* bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
Updated expected results.

Source/WebCore/PAL:

* pal/FileSizeFormatter.cpp:
(fileSizeDescription): Use makeString.

Source/WebKit:

* Shared/WebMemorySampler.cpp:
(WebKit::WebMemorySampler::writeHeaders): Use makeString.

* UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
(WebKit::LocalAuthenticator::makeCredential): Use string concatentation.

* UIProcess/WebInspectorUtilities.cpp:
(WebKit::inspectorPageGroupIdentifierForPage): Use makeString.
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::processDidFinishLaunching): Ditto.
(WebKit::WebProcessPool::startMemorySampler): Ditto.

Source/WTF:

* wtf/WorkQueue.cpp:
(WTF::WorkQueue::concurrentApply): Use makeString.

* wtf/dtoa.cpp:
(WTF::dtoa): Use sprintf instead of String::format in the comments,
since these functions have nothing to do with WTF::String.

Tools:

* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::cacheTestRunnerCallback): Use makeString.
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::didReceiveAuthenticationChallenge): Use makeString.
(WTR::TestController::downloadDidFail): Use an ASCIILiteral via the _s syntax.

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

2 years ago[WPE][GTK] Add libpsl to JHBuild module sets
aperez@igalia.com [Sat, 15 Dec 2018 23:01:37 +0000 (23:01 +0000)]
[WPE][GTK] Add libpsl to JHBuild module sets
https://bugs.webkit.org/show_bug.cgi?id=192740

Reviewed by Michael Catanzaro.

* gtk/jhbuild.modules: Add libpsl module.
* wpe/jhbuild.modules: Ditto.

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

2 years agoMake RTCRtpSender.setParameters to activate specific encodings
youenn@apple.com [Sat, 15 Dec 2018 17:40:26 +0000 (17:40 +0000)]
Make RTCRtpSender.setParameters to activate specific encodings
https://bugs.webkit.org/show_bug.cgi?id=192732

Reviewed by Eric Carlson.

Source/ThirdParty/libwebrtc:

* Configurations/libwebrtc.iOS.exp:
* Configurations/libwebrtc.iOSsim.exp:
* Configurations/libwebrtc.mac.exp:

Source/WebCore:

The conversion between libwebrtc and WebCore is lossy for send parameters.
Libwebrtc checking the differences of values, call to setParameters will often fail.

Given some parameters cannot be exposed, the sender backend keeps the
current set of parameters when gathered and reuses them when parameters are set.

For encodings, we only change activate/maxBitRate/maxFrameRate as
these are the most important parameters to be able to modify.

Covered by added tests in webrtc/video.html.

* Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp:
(WebCore::LibWebRTCRtpSenderBackend::getParameters const):
(WebCore::LibWebRTCRtpSenderBackend::setParameters):
* Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h:
* Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp:
(WebCore::fromRTCRtpSendParameters):
(WebCore::fromRTCEncodingParameters): Deleted.
* Modules/mediastream/libwebrtc/LibWebRTCUtils.h:

LayoutTests:

* webrtc/video-expected.txt:
* webrtc/video.html:

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

2 years agoWeb Inspector: Styles: toggling selected properties may cause data corruption
nvasilyev@apple.com [Sat, 15 Dec 2018 10:03:19 +0000 (10:03 +0000)]
Web Inspector: Styles: toggling selected properties may cause data corruption
https://bugs.webkit.org/show_bug.cgi?id=192396
<rdar://problem/46478383>

Reviewed by Devin Rousso.

Source/WebInspectorUI:

Uncommenting a property after a commented out property used to insert an unnecessary semicolon,
and not updating ranges of the following properties.

For example:

    /* color: red; */
    /* font-size: 12px */

Uncommenting `font-size` would result in something like this:

    /* color: red; */; font-size: 12px
                     ^
                     unnecessary semicolon

Now the semicolon doesn't get inserted and the white space is preserved better:

    /* color: red; */
    font-size: 12px

* UserInterface/Models/CSSProperty.js:
(WI.CSSProperty.prototype._updateOwnerStyleText):
(WI.CSSProperty.prototype._appendSemicolonIfNeeded): Removed.
(WI.CSSProperty.prototype._prependSemicolonIfNeeded): Added.

* UserInterface/Views/SpreadsheetStyleProperty.js:
(WI.SpreadsheetStyleProperty.prototype.remove):
(WI.SpreadsheetStyleProperty.prototype.update):
(WI.SpreadsheetStyleProperty.prototype._handleNameChange):
(WI.SpreadsheetStyleProperty.prototype._handleValueChange):
Style declaration should be locked while editing. Add asserts to ensure this.

LayoutTests:

* inspector/css/add-css-property-expected.txt: Added.
* inspector/css/add-css-property.html: Added.
Test adding new properties.

* inspector/css/modify-css-property-expected.txt:
* inspector/css/modify-css-property.html:
Test commenting out and uncommenting CSS properties.

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

2 years agoAdd a style checker rule for Xcode version macros use
ap@apple.com [Sat, 15 Dec 2018 07:51:56 +0000 (07:51 +0000)]
Add a style checker rule for Xcode version macros use
https://bugs.webkit.org/show_bug.cgi?id=192703

Reviewed by Alex Christensen.

* Scripts/webkitpy/style/checkers/cpp.py:
(check_os_version_checks):
(process_line):
(CppChecker):
* Scripts/webkitpy/style/checkers/cpp_unittest.py:
(WebKitStyleTest.test_os_version_checks):

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

2 years agoVerify size is valid in USE_SYSTEM_MALLOC version of tryAllocateZeroedVirtualPages
darin@apple.com [Sat, 15 Dec 2018 07:48:18 +0000 (07:48 +0000)]
Verify size is valid in USE_SYSTEM_MALLOC version of tryAllocateZeroedVirtualPages
https://bugs.webkit.org/show_bug.cgi?id=192738
rdar://problem/37502342

Reviewed by Mark Lam.

* wtf/Gigacage.cpp:
(Gigacage::tryAllocateZeroedVirtualPages): Added a RELEASE_ASSERT just
like the one in tryLargeZeroedMemalignVirtual in bmalloc.

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

2 years agoLiteralParser has a bunch of uses of String::format with untrusted data
darin@apple.com [Sat, 15 Dec 2018 07:42:38 +0000 (07:42 +0000)]
LiteralParser has a bunch of uses of String::format with untrusted data
https://bugs.webkit.org/show_bug.cgi?id=108883
rdar://problem/13666409

Reviewed by Mark Lam.

* runtime/LiteralParser.cpp:
(JSC::LiteralParser<CharType>::Lexer::lex): Use makeString instead of String::format.
(JSC::LiteralParser<CharType>::Lexer::lexStringSlow): Ditto.
(JSC::LiteralParser<CharType>::parse): Ditto.

* runtime/LiteralParser.h:
(JSC::LiteralParser::getErrorMessage): Use string concatenation instead of
String::format.

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

2 years agoWeb Inspector: Avoid creating and evaluating in the InspectorOverlay page on iOS...
commit-queue@webkit.org [Sat, 15 Dec 2018 04:30:41 +0000 (04:30 +0000)]
Web Inspector: Avoid creating and evaluating in the InspectorOverlay page on iOS as it is unused
https://bugs.webkit.org/show_bug.cgi?id=192724
<rdar://problem/46745911>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2018-12-14
Reviewed by Devin Rousso.

iOS never installs the InspectorOverlay page as a page overlay.
It also uses its own node highlighting painting. Avoid any work
and resources associated with the overlay page for iOS.

* inspector/InspectorOverlay.cpp:
(WebCore::InspectorOverlay::paint):
(WebCore::InspectorOverlay::update):
(WebCore::InspectorOverlay::overlayPage):
(WebCore::evaluateCommandInOverlay):

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

2 years agoWeb Inspector: REGRESSION(r238599): Uncaught Exception: TypeError: null is not an...
mattbaker@apple.com [Sat, 15 Dec 2018 03:34:54 +0000 (03:34 +0000)]
Web Inspector: REGRESSION(r238599): Uncaught Exception: TypeError: null is not an object (evaluating 'treeElement.listItemElement.classList')
https://bugs.webkit.org/show_bug.cgi?id=192090
<rdar://problem/46318614>

Reviewed by Devin Rousso.

* UserInterface/Views/TreeOutline.js:
(WI.TreeOutline.prototype.selectionControllerSelectionDidChange):
Check that `listItemElement` is valid before accessing it to update class
names. The selection can change before the TreeElement has been attached.

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

2 years agoGigacage runway should immediately follow the primitive cage
keith_miller@apple.com [Sat, 15 Dec 2018 03:05:59 +0000 (03:05 +0000)]
Gigacage runway should immediately follow the primitive cage
https://bugs.webkit.org/show_bug.cgi?id=192733

Reviewed by Saam Barati.

This patch makes sure that the Gigacage runway is always
immediately after the primitive cage. Since writing outside the
primitive gigacage is likely to be more dangerous than the JSValue
cage. The ordering of the cages is still random however.

* bmalloc/Gigacage.cpp:
(Gigacage::ensureGigacage):

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

2 years agoCallFrame::convertToStackOverflowFrame() needs to keep the top CodeBlock alive.
mark.lam@apple.com [Sat, 15 Dec 2018 02:28:17 +0000 (02:28 +0000)]
CallFrame::convertToStackOverflowFrame() needs to keep the top CodeBlock alive.
https://bugs.webkit.org/show_bug.cgi?id=192717
<rdar://problem/46660677>

Reviewed by Saam Barati.

JSTests:

* stress/regress-192717.js: Added.

Source/JavaScriptCore:

When throwing a StackOverflowError, we convert the topCallFrame into a
StackOverflowFrame.  Previously, we would nullify the codeBlock field in the frame
because a StackOverflowFrame is only a sentinel and doesn't really correspond to
any CodeBlocks.  However, this is a problem because the topCallFrame may be the
only remaining place that references the CodeBlock that the stack overflow is
triggered in.  The way we handle exceptions in JIT code is to return (from the
runtime operation function throwing the exception) to the JIT code to check for
the exception and if needed, do some clean up before jumping to the exception
handling thunk.  As a result, we need to keep that JIT code alive, which means we
need to keep its CodeBlock alive.  We only need to keep this CodeBlock alive until
we've unwound (in terms of exception handling) out of it.

We fix this issue by storing the CodeBlock to keep alive in the StackOverflowFrame
for the GC to scan while the frame is still on the stack.

We removed the call to convertToStackOverflowFrame() in
lookupExceptionHandlerFromCallerFrame() because it is redundant.
lookupExceptionHandlerFromCallerFrame() will only every be called after
a StackOverFlowError has been thrown.  Hence, the top frame is already
guaranteed to be a StackOverflowFrame, and there should always be a
StackOverFlowError exception pending.  We added assertions for these
instead.

* interpreter/CallFrame.cpp:
(JSC::CallFrame::convertToStackOverflowFrame):
* interpreter/CallFrame.h:
* jit/JITOperations.cpp:
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
* runtime/CommonSlowPaths.cpp:
(JSC::SLOW_PATH_DECL):
* runtime/CommonSlowPaths.h:
(JSC::CommonSlowPaths::codeBlockFromCallFrameCallee):
(JSC::CommonSlowPaths::arityCheckFor):
* runtime/VM.h:
(JSC::VM::exceptionForInspection const):

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

2 years agoMediaRecorderPrivateAVFImpl should have a Ref<MediaRecorderPrivateWriter> as member
youenn@apple.com [Sat, 15 Dec 2018 01:07:18 +0000 (01:07 +0000)]
MediaRecorderPrivateAVFImpl should have a Ref<MediaRecorderPrivateWriter> as member
https://bugs.webkit.org/show_bug.cgi?id=192720

Reviewed by Eric Carlson.

Source/WebCore:

Make sure that MediaRecorderPrivateAVFImpl takes a Ref<MediaRecorderPrivateWriter> as member,
as the latter is a ref counted object.
Made some refactoring to return early in case of error.

Also made sure that in the case of a MediaRecorder stopped by a track removal in the recorded stream
the MediaRecorder will stop listening for its tracks.
Otherwise, the tracks will continue calling the MediaRecorder even after it is dead.

Test: http/wpt/mediarecorder/MediaRecorder-onremovetrack.html

* Modules/mediarecorder/MediaRecorder.cpp:
(WebCore::MediaRecorder::didAddOrRemoveTrack):
(WebCore::MediaRecorder::setNewRecordingState): Deleted.
* Modules/mediarecorder/MediaRecorder.h:
* platform/mediarecorder/MediaRecorderPrivateAVFImpl.cpp:
(WebCore::MediaRecorderPrivateAVFImpl::create):
(WebCore::MediaRecorderPrivateAVFImpl::MediaRecorderPrivateAVFImpl):
(WebCore::MediaRecorderPrivateAVFImpl::sampleBufferUpdated):
(WebCore::MediaRecorderPrivateAVFImpl::audioSamplesAvailable):
(WebCore::MediaRecorderPrivateAVFImpl::stopRecording):
(WebCore::MediaRecorderPrivateAVFImpl::fetchData):
* platform/mediarecorder/MediaRecorderPrivateAVFImpl.h:
* platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h:
* platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm:
(WebCore::MediaRecorderPrivateWriter::create):
(WebCore::MediaRecorderPrivateWriter::MediaRecorderPrivateWriter):
(WebCore::MediaRecorderPrivateWriter::appendAudioSampleBuffer):
(WebCore::MediaRecorderPrivateWriter::setupWriter): Deleted.

LayoutTests:

* http/wpt/mediarecorder/MediaRecorder-onremovetrack-expected.txt: Added.
* http/wpt/mediarecorder/MediaRecorder-onremovetrack.html: Added.

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