WebKit-https.git
4 months agoAdd runtime flag for lazy image loading
commit-queue@webkit.org [Thu, 8 Aug 2019 14:55:21 +0000 (14:55 +0000)]
Add runtime flag for lazy image loading
https://bugs.webkit.org/show_bug.cgi?id=199794

Patch by Rob Buis <rbuis@igalia.com> on 2019-08-08
Reviewed by Darin Adler.

Source/WebCore:

Add loading attribute and expose it on HTMLImageElement.

* html/HTMLAttributeNames.in:
* html/HTMLImageElement.idl:
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setLazyImageLoadingEnabled):
(WebCore::RuntimeEnabledFeatures::lazyImageLoadingEnabled const):

Source/WebKit:

Add LazyImageLoading preference.

* Shared/WebPreferences.yaml:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetLazyImageLoadingEnabled):
(WKPreferencesGetLazyImageLoadingEnabled):
* UIProcess/API/C/WKPreferencesRefPrivate.h:

Source/WebKitLegacy/mac:

Set lazyImageLoading runtime flag if preference is set.

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
(-[WebPreferences lazyImageLoadingEnabled]):
(-[WebPreferences setLazyImageLoadingEnabled:]):
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

Source/WebKitLegacy/win:

Set lazyImageLoading runtime flag if preference is set.

* Interfaces/IWebPreferencesPrivate.idl:
* WebPreferenceKeysPrivate.h:
* WebPreferences.cpp:
(WebPreferences::initializeDefaultSettings):
(WebPreferences::lazyImageLoadingEnabled):
(WebPreferences::setLazyImageLoadingEnabled):
* WebPreferences.h:
* WebView.cpp:
(WebView::notifyPreferencesChanged):

Tools:

Set lazyImageLoading preference as part of experimental features. Add
TestOption for lazy image loading.

* DumpRenderTree/TestOptions.cpp:
(TestOptions::TestOptions):
* DumpRenderTree/TestOptions.h:
* DumpRenderTree/mac/DumpRenderTree.mm:
(enableExperimentalFeatures):
(setWebPreferencesForTestOptions):
* DumpRenderTree/win/DumpRenderTree.cpp:
(enableExperimentalFeatures):

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

4 months agoUnreviewed GTK+ gardening. Update expectations after r248403.
magomez@igalia.com [Thu, 8 Aug 2019 14:20:19 +0000 (14:20 +0000)]
Unreviewed GTK+ gardening. Update expectations after r248403.

* platform/gtk/TestExpectations:

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

4 months ago[GTK][WPE] Remove the reference to WebCore::Animation from TextureMapperAnimation
magomez@igalia.com [Thu, 8 Aug 2019 14:13:20 +0000 (14:13 +0000)]
[GTK][WPE] Remove the reference to WebCore::Animation from TextureMapperAnimation
https://bugs.webkit.org/show_bug.cgi?id=200533

Reviewed by Žan Doberšek.

Pass the relevant parameters to TextureMapperAnimation instead of creating a new WebCore::Animation
inside it.

* platform/graphics/texmap/TextureMapperAnimation.cpp:
(WebCore::timingFunctionForAnimationValue):
(WebCore::TextureMapperAnimation::TextureMapperAnimation):
(WebCore::TextureMapperAnimation::apply):
(WebCore::TextureMapperAnimation::isActive const):
* platform/graphics/texmap/TextureMapperAnimation.h:
(WebCore::TextureMapperAnimation::keyframes const):
(WebCore::TextureMapperAnimation::timingFunction const):
(WebCore::TextureMapperAnimation::animation const): Deleted.

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

4 months ago[GTK] WebKitWebProcess crashes when viewing an HTML with a <video> element referencin...
cturner@igalia.com [Thu, 8 Aug 2019 12:08:50 +0000 (12:08 +0000)]
[GTK] WebKitWebProcess crashes when viewing an HTML with a <video> element referencing unknown file
https://bugs.webkit.org/show_bug.cgi?id=200530

Reviewed by Xabier Rodriguez-Calvar.

Not amenable to unit testing.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::fillTimerFired):

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

4 months agoImport lazy loading WPT tests
commit-queue@webkit.org [Thu, 8 Aug 2019 08:20:41 +0000 (08:20 +0000)]
Import lazy loading WPT tests
https://bugs.webkit.org/show_bug.cgi?id=199795

Patch by Rob Buis <rbuis@igalia.com> on 2019-08-08
Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Import lazy loading WPT tests.

* resources/import-expectations.json:
* web-platform-tests/loading/lazyload/iframe-loading-eager.tentative-expected.txt: Added.
* web-platform-tests/loading/lazyload/iframe-loading-eager.tentative.html: Added.
* web-platform-tests/loading/lazyload/iframe-loading-lazy.tentative.html: Added.
* web-platform-tests/loading/lazyload/image-loading-eager.tentative-expected.txt: Added.
* web-platform-tests/loading/lazyload/image-loading-eager.tentative.html: Added.
* web-platform-tests/loading/lazyload/image-loading-lazy.tentative.html: Added.
* web-platform-tests/loading/lazyload/resources/image.png: Added.
* web-platform-tests/loading/lazyload/resources/subframe.html: Added.
* web-platform-tests/loading/lazyload/resources/w3c-import.log: Added.
* web-platform-tests/loading/lazyload/w3c-import.log: Added.

Tools:

Only do loading/ exception for WebKit specific, non WPT tests.

* DumpRenderTree/mac/DumpRenderTree.mm:
(shouldLogFrameLoadDelegates):
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::TestInvocation):

LayoutTests:

Skip the lazy tests for now.

* TestExpectations:
* http/wpt/loading/redirect-headers-expected.txt:

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

4 months ago[WHLSL] Prune unreachable stdlib functions after the Checker runs
sbarati@apple.com [Thu, 8 Aug 2019 06:22:58 +0000 (06:22 +0000)]
[WHLSL] Prune unreachable stdlib functions after the Checker runs
https://bugs.webkit.org/show_bug.cgi?id=200518

Reviewed by Robin Morisset.

We now prune unreachable stdlib functions after the checker runs. We must
do this after the checker runs because that's when we resolve all remaining
function calls. While we can't prune unreachable user code, because we must
still report errors in it, we can prune unreachable standard library code
because we know a priori that it has no errors. This is a 10ms end-to-end
speedup in compute_boids.

* Modules/webgpu/WHLSL/WHLSLPrepare.cpp:
(WebCore::WHLSL::prepareShared):
* Modules/webgpu/WHLSL/WHLSLPruneUnreachableStandardLibraryFunctions.cpp: Added.
(WebCore::WHLSL::pruneUnreachableStandardLibraryFunctions):
* Modules/webgpu/WHLSL/WHLSLPruneUnreachableStandardLibraryFunctions.h: Added.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:

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

4 months agoTurn some ITP threading ASSERTs into RELEASE_ASSERTs
cdumez@apple.com [Thu, 8 Aug 2019 03:31:40 +0000 (03:31 +0000)]
Turn some ITP threading ASSERTs into RELEASE_ASSERTs
https://bugs.webkit.org/show_bug.cgi?id=200521

Reviewed by Ryosuke Niwa.

Turn some ITP threading ASSERTs into RELEASE_ASSERTs to help catch more bugs.

* NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
(WebKit::ResourceLoadStatisticsMemoryStore::ResourceLoadStatisticsMemoryStore):
(WebKit::ResourceLoadStatisticsMemoryStore::isEmpty const):
* NetworkProcess/Classifier/ResourceLoadStatisticsPersistentStorage.cpp:
(WebKit::ResourceLoadStatisticsPersistentStorage::ResourceLoadStatisticsPersistentStorage):
(WebKit::ResourceLoadStatisticsPersistentStorage::~ResourceLoadStatisticsPersistentStorage):
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
(WebKit::WebResourceLoadStatisticsStore::~WebResourceLoadStatisticsStore):
(WebKit::WebResourceLoadStatisticsStore::flushAndDestroyPersistentStore):

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

4 months agoFix construction of `WI.EventBreakpoint` after r248201
drousso@apple.com [Thu, 8 Aug 2019 02:36:33 +0000 (02:36 +0000)]
Fix construction of `WI.EventBreakpoint` after r248201

Reviewed by Joseph Pecoraro.

* UserInterface/Controllers/DOMManager.js:
(WI.DOMManager.prototype.setBreakpointForEventListener):

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

4 months ago[Win][MiniBrowser] Add key accelerators for reload and close window
Hironori.Fujii@sony.com [Thu, 8 Aug 2019 01:34:39 +0000 (01:34 +0000)]
[Win][MiniBrowser] Add key accelerators for reload and close window
https://bugs.webkit.org/show_bug.cgi?id=200497

Reviewed by Brent Fulgham.

Added short cuts Ctrl-W to close window, Ctrl-R to reload.

* MiniBrowser/win/MainWindow.cpp:
(MainWindow::WndProc): Added IDM_CLOSE_WINDOW case.
* MiniBrowser/win/MiniBrowserLib.rc: Added "Close" menu item. Added accelerators.
* MiniBrowser/win/MiniBrowserLibResource.h: Added IDM_CLOSE_WINDOW.

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

4 months agoAdopt non-deprecated CGColorSpace API
commit-queue@webkit.org [Wed, 7 Aug 2019 23:52:20 +0000 (23:52 +0000)]
Adopt non-deprecated CGColorSpace API
https://bugs.webkit.org/show_bug.cgi?id=184358

Patch by Kate Cheney <katherine_cheney@apple.com> on 2019-08-07
Reviewed by Darin Adler.

Source/WebCore:

* platform/ScreenProperties.h:
(WebCore::ScreenData::decode):

We changed the deprecated CGColorSpaceCreateWithICCProfile function to
CGColorSpaceCreateWithICCData.

Source/WebKit:

* Shared/mac/ColorSpaceData.mm:
(WebKit::ColorSpaceData::decode):

We changed the deprecated CGColorSpaceCreateWithICCProfile function to
CGColorSpaceCreateWithICCData.

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

4 months ago[WHLSL] Metal code generation takes a long time uniquing UnnamedTypes
weinig@apple.com [Wed, 7 Aug 2019 23:47:49 +0000 (23:47 +0000)]
[WHLSL] Metal code generation takes a long time uniquing UnnamedTypes
https://bugs.webkit.org/show_bug.cgi?id=200512

Reviewed by Saam Barati.

Instead of using a trie for unnamed type uniquing, use the same technique used
in SynthesizeConstructors and use a HashMap of UnnamedTypeKeys. To make this
profitable, we also need to devirtualize the hash and equality functions on
UnnamedType, instead using an enum + switch. While this change only devirtualizes
the UnnamedType subtree, we should probably do it for the entire AST in a future
change.

* Modules/webgpu/WHLSL/AST/WHLSLArrayReferenceType.h:
* Modules/webgpu/WHLSL/AST/WHLSLArrayType.h:
* Modules/webgpu/WHLSL/AST/WHLSLPointerType.h:
* Modules/webgpu/WHLSL/AST/WHLSLReferenceType.h:
* Modules/webgpu/WHLSL/AST/WHLSLTypeReference.h:
* Modules/webgpu/WHLSL/AST/WHLSLUnnamedType.cpp: Added.
(WebCore::WHLSL::AST::UnnamedType::hash const):
(WebCore::WHLSL::AST::UnnamedType::operator== const):
 * Modules/webgpu/WHLSL/AST/WHLSLUnnamedType.h:
Devirtualize hash, operator== and type predicates.

* Modules/webgpu/WHLSL/AST/WHLSLUnnamedTypeHash.h: Added.
(WebCore::WHLSL::UnnamedTypeKey::UnnamedTypeKey):
* Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.cpp:
(WebCore::WHLSL::UnnamedTypeKey::UnnamedTypeKey): Deleted.
Moved UnnamedTypeKey into it's own header from WHLSLSynthesizeConstructors.cpp

* Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.cpp:
(WebCore::WHLSL::Metal::BaseTypeNameNode::BaseTypeNameNode):
(WebCore::WHLSL::Metal::BaseTypeNameNode::kind):
(WebCore::WHLSL::Metal::BaseTypeNameNode::isReferenceTypeNameNode const):
(WebCore::WHLSL::Metal::BaseTypeNameNode::isPointerTypeNameNode const):
(WebCore::WHLSL::Metal::BaseTypeNameNode::isArrayReferenceTypeNameNode const):
(WebCore::WHLSL::Metal::BaseTypeNameNode::isArrayTypeNameNode const):
Devirtualize BaseTypeNameNode as well. In a future change, we should consider removing
this class entirely and instead mapping directly to a parent/mangled name pair.

(WebCore::WHLSL::Metal::TypeNamer::visit):
(WebCore::WHLSL::Metal::TypeNamer::find):
(WebCore::WHLSL::Metal::TypeNamer::createNameNode):
(WebCore::WHLSL::Metal::parent):
(WebCore::WHLSL::Metal::TypeNamer::insert):
(WebCore::WHLSL::Metal::TypeNamer::emitUnnamedTypeDefinition):
(WebCore::WHLSL::Metal::TypeNamer::emitMetalTypeDefinitions):
(WebCore::WHLSL::Metal::TypeNamer::mangledNameForType):
(WebCore::WHLSL::Metal::findInVector): Deleted.
(WebCore::WHLSL::Metal::find): Deleted.
(WebCore::WHLSL::Metal::TypeNamer::emitAllUnnamedTypeDefinitions): Deleted.
* Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.h:
Switch from a Vector based trie to a HashMap for UnnamedType uniquing. Also
use UnnamedType::Kind where possible with switch statements to clarify code.

* WebCore.xcodeproj/project.pbxproj:
Add new files.

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

4 months agoRemove speculative workaround for upload crash
commit-queue@webkit.org [Wed, 7 Aug 2019 23:36:27 +0000 (23:36 +0000)]
Remove speculative workaround for upload crash
https://bugs.webkit.org/show_bug.cgi?id=200514

Patch by Alex Christensen <achristensen@webkit.org> on 2019-08-07
Reviewed by Geoffrey Garen.

This workaround didn't help anyways, and the crash has been resolved.  Let's clean up.

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

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

4 months agoRegression(r247784) ResourceLoadStatisticsMemoryStore / ResourceLoadStatisticsPersist...
cdumez@apple.com [Wed, 7 Aug 2019 22:29:18 +0000 (22:29 +0000)]
Regression(r247784) ResourceLoadStatisticsMemoryStore / ResourceLoadStatisticsPersistentStorage may get destroyed on the wrong thread
https://bugs.webkit.org/show_bug.cgi?id=200517

Reviewed by Geoffrey Garen.

The issue is that WebResourceLoadStatisticsStore::flushAndDestroyPersistentStore() is null checking
m_persistentStorage and m_statisticsStore on the main thread, even though those members are initialized
and destroyed on the background thread. As a result, if flushAndDestroyPersistentStore() is called *before*
the background task to initialize those members has had a chance to run, then we'd return early without
destroying those members. Later on, the background task would then initialize those data members and we
would then destroy them on the main thread when the WebResourceLoadStatisticsStore is destroyed on the
main thread.

* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::flushAndDestroyPersistentStore):

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

4 months agoLayoutTest inspector/worker/debugger-scripts.html is a flaky failure
commit-queue@webkit.org [Wed, 7 Aug 2019 21:51:16 +0000 (21:51 +0000)]
LayoutTest inspector/worker/debugger-scripts.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=165582

Patch by Yury Semikhatsky <yurys@chromium.org> on 2019-08-07
Reviewed by Joseph Pecoraro.

Unflake the test. Main resource in the worker target is populated asychronously
when the script is parsed and sent to the debugger, so we need to wait for it
before performing further checks.

* inspector/worker/debugger-scripts.html:
* platform/mac/TestExpectations:

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

4 months agoWeb Inspector: Settings: add an Engineering pane to expose useful settings for other...
drousso@apple.com [Wed, 7 Aug 2019 21:49:08 +0000 (21:49 +0000)]
Web Inspector: Settings: add an Engineering pane to expose useful settings for other WebKit engineers
https://bugs.webkit.org/show_bug.cgi?id=200492

Reviewed by Joseph Pecoraro.

Other WebKit engineers might find being able to see internal objects or pause in internal
scripts useful, so we should allow them to do so without having to enable Web Inspector's
debug "mode".

A new "Engineering" pane is added to the Settings Tab:
 - Debugging
    - Show WebKit-internal scripts
    - Pause in WebKit-internal scripts
 - Heap Snapshot
    - Show Internal Objects
    - Show Private Symbols

* UserInterface/Base/Setting.js:
* UserInterface/Views/SettingsTabContentView.js:
(WI.SettingsTabContentView.prototype.initialLayout):
(WI.SettingsTabContentView.prototype._createEngineeringSettingsView): Added.
(WI.SettingsTabContentView.prototype._createDebugSettingsView):

* UserInterface/Base/Main.js:
(WI.resolvedLayoutDirection):
(WI.setLayoutDirection):
* UserInterface/Base/Object.js:

* UserInterface/Protocol/InspectorBackend.js:
(InspectorBackendClass):
(InspectorBackendClass.prototype.set dumpInspectorProtocolMessages):
(InspectorBackendClass.prototype.get dumpInspectorProtocolMessages):
(InspectorBackendClass.prototype.set dumpInspectorTimeStats):
(InspectorBackendClass.prototype.get dumpInspectorTimeStats):
(InspectorBackendClass.prototype.set filterMultiplexingBackendInspectorProtocolMessages):
(InspectorBackendClass.prototype.get filterMultiplexingBackendInspectorProtocolMessages):
* UserInterface/Protocol/RemoteObject.js:
(WI.RemoteObject.prototype.findFunctionSourceCodeLocation):
* UserInterface/Debug/Bootstrap.js:
(WI.runBootstrapOperations):
* UserInterface/Debug/UncaughtExceptionReporter.js:
(handleUncaughtExceptionRecord):
* UserInterface/Models/CSSProperty.js:
(WI.CSSProperty.prototype._updateOwnerStyleText):
* UserInterface/Models/CSSStyleDeclaration.js:
(WI.CSSStyleDeclaration.prototype.update):
* UserInterface/Controllers/DebuggerManager.js:
(WI.DebuggerManager):
(WI.DebuggerManager.prototype.initializeTarget):
(WI.DebuggerManager.prototype.get knownNonResourceScripts):
(WI.DebuggerManager.prototype.debuggerDidPause):
(WI.DebuggerManager.prototype.scriptDidParse):
(WI.DebuggerManager.prototype._handleEngineeringShowInternalScriptsSettingChanged): Added.
(WI.DebuggerManager.prototype._handleEngineeringPauseForInternalScriptsSettingChanged): Added.
(WI.DebuggerManager.prototype._pauseForInternalScriptsDidChange): Deleted.
(WI.DebuggerManager.prototype._debugUIEnabledDidChange): Deleted.
* UserInterface/Views/ConsoleMessageView.js:
(WI.ConsoleMessageView.prototype._appendLocationLink):
* UserInterface/Views/HeapSnapshotDataGridTree.js:
(WI.HeapSnapshotInstancesDataGridTree.prototype.populateTopLevel):
* UserInterface/Views/OpenResourceDialog.js:
(WI.OpenResourceDialog.prototype._addScriptsForTarget):
* UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js:
(WI.SpreadsheetCSSStyleDeclarationEditor):
* UserInterface/Views/StackTraceView.js:
(WI.StackTraceView):
* UserInterface/Views/View.js:
(WI.View.prototype._layoutSubtree):

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

4 months agoWeb Inspector: RTL: content of Variables section should always be LTR
nvasilyev@apple.com [Wed, 7 Aug 2019 21:32:46 +0000 (21:32 +0000)]
Web Inspector: RTL: content of Variables section should always be LTR
https://bugs.webkit.org/show_bug.cgi?id=200481

Reviewed by Devin Rousso.

* UserInterface/Views/ComputedStyleDetailsPanel.js:
(WI.ComputedStyleDetailsPanel.prototype.initialLayout):

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

4 months agoWeb Inspector: Uncaught Exception: TimelineAgent already enabled
drousso@apple.com [Wed, 7 Aug 2019 21:17:36 +0000 (21:17 +0000)]
Web Inspector: Uncaught Exception: TimelineAgent already enabled
https://bugs.webkit.org/show_bug.cgi?id=200513

Reviewed by Joseph Pecoraro.

Source/WebCore:

Call `disable` when the last frontend disconnects, so that if Web Inspector is reopened the
`TimelineAgent` is back to being in a disabled state.

* inspector/agents/InspectorTimelineAgent.cpp:
(WebCore::InspectorTimelineAgent::willDestroyFrontendAndBackend):

Source/WebInspectorUI:

Update some incorrect compatibility comments from r248286.

* UserInterface/Protocol/InspectorFrontendAPI.js:
* UserInterface/Controllers/TimelineManager.js:

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

4 months agoUpdating TestExpectations for editing/pasteboard/paste-does-not-fire-promises-while...
russell_e@apple.com [Wed, 7 Aug 2019 21:12:54 +0000 (21:12 +0000)]
Updating TestExpectations for editing/pasteboard/paste-does-not-fire-promises-while-sanitizing-web-content.html.
rdar://54049321

Unreviewed Test Gardening.

* platform/ios-12/TestExpectations:
* platform/ios/TestExpectations:

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

4 months agoMuted <video> elements can block display from sleeping.
jer.noble@apple.com [Wed, 7 Aug 2019 21:12:03 +0000 (21:12 +0000)]
Muted <video> elements can block display from sleeping.
https://bugs.webkit.org/show_bug.cgi?id=200511

Reviewed by Eric Carlson.

Source/WebCore:

Test: media/video-muted-holds-sleep-assertion.html

Modify the shouldDisableSleep() method to take muting into account.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::shouldDisableSleep const):

LayoutTests:

* media/video-muted-holds-sleep-assertion-expected.txt: Added.
* media/video-muted-holds-sleep-assertion.html: Added.

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

4 months agoTighten WeakPtr threading assertions for GC threads
cdumez@apple.com [Wed, 7 Aug 2019 20:35:11 +0000 (20:35 +0000)]
Tighten WeakPtr threading assertions for GC threads
https://bugs.webkit.org/show_bug.cgi?id=200451

Reviewed by Youenn Fablet.

Make sure our GC threads do not dereference WeakPtr for main thread
objects by tightening our threading assertions in WeakPtr. They are
still allowed to call WeakPtr::get() for now though.

* wtf/WeakPtr.h:
(WTF::WeakPtrImpl::get):
(WTF::WeakPtrImpl::wasConstructedOnMainThread const):
(WTF::WeakPtr::get const):
(WTF::WeakPtr::operator-> const):
(WTF::WeakPtr::operator* const):

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

4 months agoAdd WHLSL and WebGPU to the watchlist file
mmaxfield@apple.com [Wed, 7 Aug 2019 20:32:30 +0000 (20:32 +0000)]
Add WHLSL and WebGPU to the watchlist file
https://bugs.webkit.org/show_bug.cgi?id=200509

Reviewed by Robin Morisset.

* Scripts/webkitpy/common/config/watchlist:

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

4 months ago[WHLSL] Simplify and eliminate redundant work in WHLSLFunctionWriter.cpp
rmorisset@apple.com [Wed, 7 Aug 2019 19:58:15 +0000 (19:58 +0000)]
[WHLSL] Simplify and eliminate redundant work in WHLSLFunctionWriter.cpp
https://bugs.webkit.org/show_bug.cgi?id=200460

Reviewed by Myles Maxfield.

2 trivial simplifications:
- Replace FunctionDeclarationWriter by a standalone function, there was no reason to make it a subclass of Visitor
- Avoid an exponential blow-up in the computation of reachable functions.

I have way too much noise on my system (swings back and forth between 7 and 12ms for this phase) to measure a performance win,
but since this patch simplifies things without adding complexity I think it is worth it.

No new test as there is no functional change intended.

* Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp:
(WebCore::WHLSL::Metal::declareFunction):
(WebCore::WHLSL::Metal::FunctionDefinitionWriter::FunctionDefinitionWriter):
(WebCore::WHLSL::Metal::RenderFunctionDefinitionWriter::RenderFunctionDefinitionWriter):
(WebCore::WHLSL::Metal::ComputeFunctionDefinitionWriter::ComputeFunctionDefinitionWriter):
(WebCore::WHLSL::Metal::sharedMetalFunctions):
(WebCore::WHLSL::Metal::metalFunctions):

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

4 months agoUnreviewed build fix after r248317 -- disable XCBuild because it
krollin@apple.com [Wed, 7 Aug 2019 19:50:04 +0000 (19:50 +0000)]
Unreviewed build fix after r248317 -- disable XCBuild because it
breaks incremental builds.

* Scripts/webkitdirs.pm:
(canUseXCBuild):

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

4 months ago[WHLSL] checkRecursion, checkTextureReferences, and EscapedVariableCollector should...
sbarati@apple.com [Wed, 7 Aug 2019 19:48:29 +0000 (19:48 +0000)]
[WHLSL] checkRecursion, checkTextureReferences, and EscapedVariableCollector should skip stdlib functions
https://bugs.webkit.org/show_bug.cgi?id=200510

Reviewed by Myles C. Maxfield.

We can skip walking the stdlib part of the AST in various semantic checking phases:
- checkRecursion: the stdlib does not have recursion
- checkTextureReferences: the stdlib does not have references to textures
- EscapedVariableCollector: this is used inside preserveVariableLifetimes, and
  the stdlib never escapes any variables.

This patch speeds up checkRecursion, checkTextureReferences, and preserveVariableLifetimes
by about 1ms each, leading to a 3ms compile time speedup in compute_boids.

* Modules/webgpu/WHLSL/WHLSLCheckTextureReferences.cpp:
(WebCore::WHLSL::TextureReferencesChecker::visit):
* Modules/webgpu/WHLSL/WHLSLPreserveVariableLifetimes.cpp:
(WebCore::WHLSL::preserveVariableLifetimes):
(WebCore::WHLSL::EscapedVariableCollector::escapeVariableUse): Deleted.
(WebCore::WHLSL::EscapedVariableCollector::takeEscapedVariables): Deleted.
* Modules/webgpu/WHLSL/WHLSLRecursionChecker.cpp:

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

4 months agoContext menu on a universal link produces a blank preview
dino@apple.com [Wed, 7 Aug 2019 19:43:51 +0000 (19:43 +0000)]
Context menu on a universal link produces a blank preview
https://bugs.webkit.org/show_bug.cgi?id=200485
<rdar://problem/53699620>

Reviewed by Tim Horton.

Use the umbrella #import.

* pal/spi/cocoa/LaunchServicesSPI.h:

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

4 months agoContext menu on a universal link produces a blank preview
dino@apple.com [Wed, 7 Aug 2019 19:05:43 +0000 (19:05 +0000)]
Context menu on a universal link produces a blank preview
https://bugs.webkit.org/show_bug.cgi?id=200485
<rdar://problem/53699620>

Reviewed by Dean Jackson.

Source/WebCore/PAL:

Define iTunesStoreURL from CoreServices.

* pal/spi/cocoa/LaunchServicesSPI.h:

Source/WebKit:

If the context menu is activated on an iTunesStore URL, pass it
on to DataDetectors, who should know how to handle it.

Two drive-by fixes:
- make it clear that early returns do not produce a value. Instead call the
  completion handler first, then return.
- The new API DataDetectors case doesn't need to worry about hiding link previews
  as DataDetectors itself will handle that.

* UIProcess/ios/WKContentViewInteraction.mm: If the URL is an iTunesStoreURL
(as defined by CoreServices), let DataDetectors handle it.
(-[WKContentView assignLegacyDataForContextMenuInteraction]):
(-[WKContentView continueContextMenuInteraction:]):
(-[WKContentView continueContextMenuInteractionWithDataDetectors:]): New method to
use DataDetectors if possible.

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

4 months agoUpdating TestExpectations for Two Failing Layout Tests.
russell_e@apple.com [Wed, 7 Aug 2019 18:23:31 +0000 (18:23 +0000)]
Updating TestExpectations for Two Failing Layout Tests.
rdar://53779679

Unreviewed Test Gardening.

* platform/ios-12/TestExpectations:
* platform/ios/TestExpectations:

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

4 months ago[WHLSL] cache results of argumentTypeForAndOverload inside Checker
sbarati@apple.com [Wed, 7 Aug 2019 18:13:57 +0000 (18:13 +0000)]
[WHLSL] cache results of argumentTypeForAndOverload inside Checker
https://bugs.webkit.org/show_bug.cgi?id=200462

Reviewed by Robin Morisset.

When I profiled the time we spent in the checker, it turned out that
argumentTypeForAndOverload is one of the most expensive functions. If
we just cache the results of that function, we can avoid 99% of the
duplicate allocations that function does in compute_boids. This patch
is a ~4ms speedup in the checker on compute_boids.

* Modules/webgpu/WHLSL/WHLSLCheckDuplicateFunctions.cpp:
* Modules/webgpu/WHLSL/WHLSLChecker.cpp:
(WebCore::WHLSL::AndOverloadTypeKey::AndOverloadTypeKey):
(WebCore::WHLSL::AndOverloadTypeKey::isEmptyValue const):
(WebCore::WHLSL::AndOverloadTypeKey::isHashTableDeletedValue const):
(WebCore::WHLSL::AndOverloadTypeKey::hash const):
(WebCore::WHLSL::AndOverloadTypeKey::operator== const):
(WebCore::WHLSL::AndOverloadTypeKey::Hash::hash):
(WebCore::WHLSL::AndOverloadTypeKey::Hash::equal):
(WebCore::WHLSL::AndOverloadTypeKey::Traits::isEmptyValue):
(WebCore::WHLSL::Checker::argumentTypeForAndOverload):
(WebCore::WHLSL::Checker::finishVisiting):
(WebCore::WHLSL::argumentTypeForAndOverload): Deleted.

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

4 months agoRemove IDBDatabaseIdentifier::m_sessionID
youenn@apple.com [Wed, 7 Aug 2019 18:05:12 +0000 (18:05 +0000)]
Remove IDBDatabaseIdentifier::m_sessionID
https://bugs.webkit.org/show_bug.cgi?id=200489

Reviewed by Darin Adler.

IDBDatabaseIdentifier can be created without a valid session ID.
Its session ID is only used in NetworkProcess where it can be retrieved from the IDBServer.
In WebProcess, session ID is also known from the IDB connection.
Update SQLiteIDBBackingStore to store a session ID which is given from its IDBServer.
No observable change of behavior.

* Modules/indexeddb/IDBDatabaseIdentifier.cpp:
(WebCore::IDBDatabaseIdentifier::IDBDatabaseIdentifier):
(WebCore::IDBDatabaseIdentifier::isolatedCopy const):
* Modules/indexeddb/IDBDatabaseIdentifier.h:
(WebCore::IDBDatabaseIdentifier::hash const):
(WebCore::IDBDatabaseIdentifier::databaseName const):
(WebCore::IDBDatabaseIdentifier::encode const):
(WebCore::IDBDatabaseIdentifier::decode):
(WebCore::IDBDatabaseIdentifier::sessionID const): Deleted.
* Modules/indexeddb/IDBFactory.cpp:
(WebCore::IDBFactory::openInternal):
(WebCore::IDBFactory::deleteDatabase):
* Modules/indexeddb/server/IDBServer.cpp:
(WebCore::IDBServer::IDBServer::createBackingStore):
* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::SQLiteIDBBackingStore):
(WebCore::IDBServer::SQLiteIDBBackingStore::getBlobRecordsForObjectStoreRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::getRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::getAllObjectStoreRecords):
(WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedGetIndexRecordForOneKey):
* Modules/indexeddb/server/SQLiteIDBBackingStore.h:
(WebCore::IDBServer::SQLiteIDBBackingStore::sessionID const):
* Modules/indexeddb/server/SQLiteIDBCursor.cpp:
(WebCore::IDBServer::SQLiteIDBCursor::internalFetchNextRecord):

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

4 months agoFix thread safety issue under JSHistory::visitAdditionalChildren()
cdumez@apple.com [Wed, 7 Aug 2019 17:31:10 +0000 (17:31 +0000)]
Fix thread safety issue under JSHistory::visitAdditionalChildren()
https://bugs.webkit.org/show_bug.cgi?id=200504

Reviewed by Darin Adler.

JSHistory::visitAdditionalChildren() is called from a GC thread and was calling
History::cachedState() whose implementation goes deep into WebCore
(FrameLoader / HistoryController). Among other things, it null checks m_window
which is a WeakPtr and then later dereferences it to get the Frame object, which
is not safe from the non-main thread.

To address the issue, introduce a simpler cachedStateForGC() getter which is
thread safe, and use it in JSHistory::visitAdditionalChildren().

* bindings/js/JSHistoryCustom.cpp:
(WebCore::JSHistory::visitAdditionalChildren):
* page/History.h:

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

4 months agoRebase inspector generator tests.
drousso@apple.com [Wed, 7 Aug 2019 17:25:26 +0000 (17:25 +0000)]
Rebase inspector generator tests.

Rubber-stamped by Brian Burg.

* inspector/scripts/tests/all/expected/definitions-with-mac-platform.json-result:
* inspector/scripts/tests/generic/expected/commands-with-async-attribute.json-result:
* inspector/scripts/tests/generic/expected/commands-with-optional-call-return-parameters.json-result:
* inspector/scripts/tests/generic/expected/events-with-optional-parameters.json-result:
* inspector/scripts/tests/generic/expected/generate-domains-with-feature-guards.json-result:
* inspector/scripts/tests/generic/expected/shadowed-optional-type-setters.json-result:
* inspector/scripts/tests/generic/expected/type-declaration-object-type.json-result:
* inspector/scripts/tests/generic/expected/type-requiring-runtime-casts.json-result:
* inspector/scripts/tests/generic/expected/type-with-open-parameters.json-result:
* inspector/scripts/tests/mac/expected/definitions-with-mac-platform.json-result:

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

4 months agoAllow clients to toggle a text input field between being viewable and having characte...
commit-queue@webkit.org [Wed, 7 Aug 2019 17:24:19 +0000 (17:24 +0000)]
Allow clients to toggle a text input field between being viewable and having characters hidden while maintaining
a yellow auto-filled appearance
https://bugs.webkit.org/show_bug.cgi?id=200037
rdar://problem/51900961

Patch by Priyanka Agarwal <pagarwal999@apple.com> on 2019-08-07
Reviewed by Daniel Bates.

Source/WebCore:

Tests: fast/forms/auto-fill-button/hide-auto-fill-strong-password-viewable-treatment-when-form-is-reset.html
       fast/forms/auto-fill-button/input-strong-password-viewable.html

* css/CSSSelector.cpp:
(WebCore::CSSSelector::selectorText const):
Adding CSSSelector case for new pseudo class of AutofillStrongPasswordViewable.

* css/CSSSelector.h: Added PseudoClassAutofillStrongPasswordViewable

* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::checkOne const): Added handling for SelectorChecker.cpp

* css/SelectorCheckerTestFunctions.h:
(WebCore::isAutofilledStrongPasswordViewable):
Checking if the element is an input element and considered to be
AutoFilled and Viewable. Returns a boolean accordingly.

* css/SelectorPseudoClassAndCompatibilityElementMap.in:
Add -webkit-autofill-strong-password-viewable css class.

* css/html.css:
(input:-webkit-autofill, input:-webkit-autofill-strong-password, input:-webkit-autofill-strong-password-viewable):
(input:-webkit-autofill-strong-password-viewable):
(input:-webkit-autofill, input:-webkit-autofill-strong-password): Deleted. Updated to include viewable pseudo class.

* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::addPseudoClassType):
Add case handling for PseudoClassAutofillStrongPasswordViewable.

* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::HTMLInputElement):
Add boolean m_isAutoFilledAndViewable for representing if the
input element is both AutoFilled and should be viewable.
Don't update the viewable treatment in setValueFromRenderer() because even if the user makes edits to the input field
the visual treatment should still be applied.

(WebCore::HTMLInputElement::resignStrongPasswordAppearance):
Updates boolean representing if input element is autofilled and viewable to false.

(WebCore::HTMLInputElement::reset):
Updates boolean representing if input element is autofilled and viewable to false.

(WebCore::HTMLInputElement::setAutoFilledAndViewable):
Setter function for the boolean of m_isAutoFilledAndViewable.

* html/HTMLInputElement.h:
(WebCore::HTMLInputElement::isAutoFilledAndViewable const):
Creating boolean value for m_isAutoFilledAndViewable.

* testing/Internals.cpp:
(WebCore::Internals::setAutoFilledAndViewable): Adding for testing purposes.
* testing/Internals.h: Adding for testing purposes.
* testing/Internals.idl:

Source/WebKit:

* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.h:
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm:
(-[WKWebProcessPlugInNodeHandle HTMLInputElementIsAutoFilledAndViewable]):
Accessor function for boolean which represents if the input element is autofilled and viewable.

(-[WKWebProcessPlugInNodeHandle setHTMLInputElementIsAutoFilledAndViewable:]):
Setter function for boolean which represents if the input element is autofilled and viewable.

* WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp:
(WKBundleNodeHandleSetHTMLInputElementAutoFilledAndViewable):
Accessor function for boolean which represents if the input element is autofilled and viewable.

       * WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h:
Creating function declaration for boolean setter.

* WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
Accessor function for boolean which represents if the input element is autofilled and viewable.

(WebKit::InjectedBundleNodeHandle::isHTMLInputElementAutoFilledAndViewable const):
Setter function for boolean which represents if the input element is autofilled and viewable.

(WebKit::InjectedBundleNodeHandle::setHTMLInputElementAutoFilledAndViewable):
Setter function for boolean which represents if the input element is autofilled and viewable.

* WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h:
Adding setter and getter functions for the boolean which represents if the input element is autofilled
and viewable.

Source/WebKitLegacy/mac:

* DOM/WebDOMOperations.mm:
(-[DOMHTMLInputElement _isAutoFilledAndViewable]):
(-[DOMHTMLInputElement _setAutoFilledAndViewable:]):
* DOM/WebDOMOperationsPrivate.h:

LayoutTests:

* fast/forms/auto-fill-button/hide-auto-fill-strong-password-viewable-treatment-when-form-is-reset.html: Added.
Test for when the form is reset to no longer be autofilled.

* fast/forms/auto-fill-button/input-strong-password-viewable.html: Added.
Test for when the form is set to being autofilled and viewable.

* fast/forms/auto-fill-button/resources/process-auto-fill-button-type-and-invoke-runTest.js:
(window.onload): Javascript used by test to set the element to be autofilled and viewable added

* platform/mac/fast/forms/auto-fill-button/hide-auto-fill-strong-password-viewable-treatment-when-form-is-reset-expected.txt: Added.
* platform/mac/fast/forms/auto-fill-button/input-strong-password-viewable-expected.txt:

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

4 months agoAdd more threading assertions to ITP code
cdumez@apple.com [Wed, 7 Aug 2019 17:22:38 +0000 (17:22 +0000)]
Add more threading assertions to ITP code
https://bugs.webkit.org/show_bug.cgi?id=200505

Reviewed by Brent Fulgham.

Add more threading assertions to ITP code to help catch bugs and protect against future bad usage.

* NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
(WebKit::ResourceLoadStatisticsMemoryStore::isEmpty const):
(WebKit::ResourceLoadStatisticsMemoryStore::setPersistentStorage):
(WebKit::ResourceLoadStatisticsMemoryStore::incrementRecordsDeletedCountForDomains):
(WebKit::ResourceLoadStatisticsMemoryStore::classifyPrevalentResources):
(WebKit::ResourceLoadStatisticsMemoryStore::syncStorageIfNeeded):
(WebKit::ResourceLoadStatisticsMemoryStore::syncStorageImmediately):
(WebKit::ResourceLoadStatisticsMemoryStore::grandfatherDataForDomains):
(WebKit::ResourceLoadStatisticsMemoryStore::ensurePrevalentResourcesForDebugMode):
* NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp:
(WebKit::ResourceLoadStatisticsStore::statisticsEpirationTime const):
(WebKit::ResourceLoadStatisticsStore::mergeOperatingDates):
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::hasStorageAccessForFrame):
(WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
(WebKit::WebResourceLoadStatisticsStore::grantStorageAccess):
(WebKit::WebResourceLoadStatisticsStore::applicationWillTerminate):
(WebKit::WebResourceLoadStatisticsStore::logFrameNavigation):
(WebKit::WebResourceLoadStatisticsStore::logWebSocketLoading):
(WebKit::WebResourceLoadStatisticsStore::logSubresourceLoading):
(WebKit::WebResourceLoadStatisticsStore::logSubresourceRedirect):
(WebKit::WebResourceLoadStatisticsStore::hasHadUserInteraction):
(WebKit::WebResourceLoadStatisticsStore::removePrevalentDomains):
(WebKit::WebResourceLoadStatisticsStore::networkSession):
(WebKit::WebResourceLoadStatisticsStore::invalidateAndCancel):
(WebKit::WebResourceLoadStatisticsStore::sendDiagnosticMessageWithValue const):
(WebKit::WebResourceLoadStatisticsStore::notifyPageStatisticsTelemetryFinished const):

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

4 months agoUnreviewed, rolling out r248330.
ryanhaddad@apple.com [Wed, 7 Aug 2019 17:19:08 +0000 (17:19 +0000)]
Unreviewed, rolling out r248330.

Breaks internal builds.

Reverted changeset:

"Context menu on a universal link produces a blank preview"
https://bugs.webkit.org/show_bug.cgi?id=200485
https://trac.webkit.org/changeset/248330

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

4 months agoDeclarations and implementations of findCaret(Min|Max)imumOffset have inconsistent...
wenson_hsieh@apple.com [Wed, 7 Aug 2019 17:17:05 +0000 (17:17 +0000)]
Declarations and implementations of findCaret(Min|Max)imumOffset have inconsistent signatures
https://bugs.webkit.org/show_bug.cgi?id=200503

Reviewed by Darin Adler.

No change in behavior.

* rendering/SimpleLineLayoutFunctions.h:

Update these function declarations to take "const RenderText&", which matches the signatures of their inline
implementations below.

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

4 months agoExtra space inserted at start of line when inserting a newline in Mail compose
wenson_hsieh@apple.com [Wed, 7 Aug 2019 16:23:52 +0000 (16:23 +0000)]
Extra space inserted at start of line when inserting a newline in Mail compose
https://bugs.webkit.org/show_bug.cgi?id=200490
<rdar://problem/53501354>

Reviewed by Antti Koivisto.

Source/WebCore:

This started happening after r244494, which deferred editor state computation until the next layer tree flush
when changing selection. After inserting a paragraph, the act of computing an editor state ensured that the text
node containing the caret drops out of simple line layout, while grabbing the characters near the selection
(i.e., calling charactersAroundPosition). This meant that when we subsequently ask positionAfterSplit whether it
isRenderedCharacter() at the end of the command, we are guaranteed to have line boxes, so we get a meaningful
answer and avoid inserting an extra non-breaking space.

However, after r244494, we defer the editor state computation until the end of the edit command; this means that
we may not have line boxes for positionAfterSplit's text node renderer, due to remaining in simple line layout.
In turn, this means that we end up hitting the assertion in containsRenderedCharacterOffset in debug builds; on
release builds, we simply return false from containsRenderedCharacterOffset, which causes us to insert an extra
space.

To fix this, we educate RenderText::containsRenderedCharacterOffset about simple line layout.

Test: editing/inserting/insert-paragraph-in-designmode-document.html

* rendering/RenderText.cpp:
(WebCore::RenderText::containsRenderedCharacterOffset const):
(WebCore::RenderText::containsCaretOffset const):

Changed to use SimpleLineLayout::containsOffset.

* rendering/SimpleLineLayoutFunctions.h:
(WebCore::SimpleLineLayout::containsOffset):

I first contrasted the behavior of RenderTextLineBoxes::containsOffset in the cases where the OffsetType is
CaretOffset or CharacterOffset, and found that the only interesting differences were:

1. The caret offset type case has special handling for line breaks.
2. Both offset types have handling for reversed text.
3. The end offset of a line box contains a caret offset, but not a character offset.

For the purposes of OffsetType CharacterOffset, (1) is irrelevant; furthermore, (2) is already not handled by
logic in containsCaretOffset(). Thus, the only major difference in the CharacterOffset case should be (3), which
we handle by only allowing the case where the given offset is equal to the very end of a text run for caret
offsets, and not character offsets.

(WebCore::SimpleLineLayout::containsCaretOffset): Deleted.

Renamed to just containsOffset.

LayoutTests:

Add a new test to verify that inserting a newline in the middle of text in a document with designMode "on"
doesn't insert an extra space at the beginning of the newly inserted line.

* editing/inserting/insert-paragraph-in-designmode-document-expected.txt: Added.
* editing/inserting/insert-paragraph-in-designmode-document.html: Added.

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

4 months agoASSERT that a sessionID is valid when encoding it
youenn@apple.com [Wed, 7 Aug 2019 16:08:58 +0000 (16:08 +0000)]
ASSERT that a sessionID is valid when encoding it
https://bugs.webkit.org/show_bug.cgi?id=199302

Reviewed by Darin Adler.

Source/WebCore:

For IDBValue, instead of encoding an invalid session ID, encode a boolean that tells there is no sessionID.
For IDBRequestData, keep track of whether there is an IDBDatabaseIdentifier
and encode/decode accordingly to not encode an invalid sessionID.
No observable change of behavior.

* Modules/indexeddb/IDBValue.h:
(WebCore::IDBValue::sessionID const):
(WebCore::IDBValue::encode const):
(WebCore::IDBValue::decode):
* Modules/indexeddb/shared/IDBRequestData.cpp:
(WebCore::IDBRequestData::isolatedCopy):
* Modules/indexeddb/shared/IDBRequestData.h:
(WebCore::IDBRequestData::databaseIdentifier const):
(WebCore::IDBRequestData::decode):

Source/WebCore/PAL:

ASSERT that a sessionID is valid at encoding/decoding time.

* pal/SessionID.h:
(PAL::SessionID::encode const):
(PAL::SessionID::decode):

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

4 months ago[LFC] Rename FormattingContext::layoutOutOfFlowDescendants to layoutOutOfFlowContent
zalan@apple.com [Wed, 7 Aug 2019 15:32:55 +0000 (15:32 +0000)]
[LFC] Rename FormattingContext::layoutOutOfFlowDescendants to layoutOutOfFlowContent
https://bugs.webkit.org/show_bug.cgi?id=200502
<rdar://problem/54032534>

Reviewed by Antti Koivisto.

The layoutOutOfFlowDescendants name is not entirely accurate. In a formatting context we only
lay out the out-of-flow boxes that actually belong to the current formatting context.

<div style="float: left">
  <div id=outer style="position: absolute">
    <div id=inner style="position: absolute"></div>
  </div>
</div>

The float's formatting context only lays out the outer absolutely positioned box. The inner box
(which is also an out-of-flow descendant of the float box) is taken care of by the outer box.

* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::layoutOutOfFlowContent const):
(WebCore::Layout::FormattingContext::validateGeometryConstraintsAfterLayout const):
(WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const): Deleted.
* layout/FormattingContext.h:
* layout/LayoutState.cpp:
(WebCore::Layout::LayoutState::layoutFormattingContextSubtree):
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):

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

4 months ago[LFC] Introduce Layout::Phase class
zalan@apple.com [Wed, 7 Aug 2019 14:23:54 +0000 (14:23 +0000)]
[LFC] Introduce Layout::Phase class
https://bugs.webkit.org/show_bug.cgi?id=200473
<rdar://problem/53996061>

Reviewed by Antti Koivisto.

It helps to check whether we could run certain actions like layout while constructing the tree.

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* layout/LayoutState.h:
* layout/floats/FloatingContext.cpp:
* layout/inlineformatting/InlineLine.cpp:
* layout/layouttree/LayoutBox.cpp:
(WebCore::Layout::Box::establishesFormattingContext const):
(WebCore::Layout::Box::containingBlock const):
(WebCore::Layout::Box::formattingContextRoot const):
* layout/layouttree/LayoutTreeBuilder.cpp:
(WebCore::Layout::TreeBuilder::createLayoutTree):

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

4 months agoHigh number of cache miss on localTimeOffset
ticaiolima@gmail.com [Wed, 7 Aug 2019 12:41:01 +0000 (12:41 +0000)]
High number of cache miss on localTimeOffset
https://bugs.webkit.org/show_bug.cgi?id=200444

Reviewed by Darin Adler.

This patch is separating the `LocalTimeOffsetCache` for each
`WTF::TimeType` to avoid constant cache miss on pathological cases
where `gregorianDateTimeToMS` and `msToGregorianDateTime` are
intercaleted with `inputTimeType ==  WTF::LocalTime`. Such case
happens during execution of Facebook Messenger
(https://www.messenger.com).

* runtime/JSDateMath.cpp:
(JSC::localTimeOffset):
(JSC::gregorianDateTimeToMS):
* runtime/VM.cpp:
(JSC::VM::resetDateCache):
* runtime/VM.h:
(JSC::LocalTimeOffsetCache::LocalTimeOffsetCache):
(JSC::LocalTimeOffsetCache::reset):

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

4 months agocontext-attributes-alpha-depth-stencil-antialias fails on WPE WebKit
commit-queue@webkit.org [Wed, 7 Aug 2019 10:44:17 +0000 (10:44 +0000)]
context-attributes-alpha-depth-stencil-antialias fails on WPE WebKit
https://bugs.webkit.org/show_bug.cgi?id=200434

Patch by Chris Lord <clord@igalia.com> on 2019-08-07
Reviewed by Žan Doberšek.

This patch fixes 16-bit surfaces being used for FBOs with no
alpha component when using the GLES implementation of GraphicsContext3D.

* platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp:
(WebCore::GraphicsContext3D::reshapeFBOs):
Use GL_UNSIGNED_BYTE instead of GL_UNSIGNED_SHORT_5_6_5 for surfaces with no alpha.

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

4 months ago[WHLSL] Make resolveFunction in Checker faster
sbarati@apple.com [Wed, 7 Aug 2019 04:17:29 +0000 (04:17 +0000)]
[WHLSL] Make resolveFunction in Checker faster
https://bugs.webkit.org/show_bug.cgi?id=200287

Reviewed by Robin Morisset.

This patch makes compute_boids faster by making function overload
resolution faster inside the Checker. It's a ~6ms speedup in the
checker. The main idea is to limit the number of overloads we need
to look for by using a hash table that describes a function's type
instead of just using a hash table keyed by a function's name.

The interesting implementation detail here is we must construct entries
in the hash table such that they still allow constants to be resolved to
various types. This means that the key in the hash table must normalize
the vector of types it uses to express a function's identity. The normalization
rules are:
- int => float
- uint => float
- T* => float*
- T[] => float*

The first two rules are because int constants can be matched against
the float and uint types. The latter two rules are because the null
literal can be matched against any pointer or any array reference
(we pick float* arbitrarily). Even though it seems like these
normalization rules would drastically broaden the efficacy of the hash
table, we still see a 100x reduction in the number of overloads we must
resolve inside compute_boids. We go from having to resolve 400,000
overloads to just resolving 4,000.

* Modules/webgpu/WHLSL/WHLSLChecker.cpp:
(WebCore::WHLSL::FunctionKey::FunctionKey):
(WebCore::WHLSL::FunctionKey::isEmptyValue const):
(WebCore::WHLSL::FunctionKey::isHashTableDeletedValue const):
(WebCore::WHLSL::FunctionKey::hash const):
(WebCore::WHLSL::FunctionKey::operator== const):
(WebCore::WHLSL::FunctionKey::Hash::hash):
(WebCore::WHLSL::FunctionKey::Hash::equal):
(WebCore::WHLSL::FunctionKey::Traits::isEmptyValue):
(WebCore::WHLSL::Checker::Checker):
(WebCore::WHLSL::Checker::wrappedFloatType):
(WebCore::WHLSL::Checker::genericPointerType):
(WebCore::WHLSL::Checker::normalizedTypeForFunctionKey):
(WebCore::WHLSL::Checker::resolveFunction):
(WebCore::WHLSL::Checker::finishVisiting):
(WebCore::WHLSL::Checker::visit):
(WebCore::WHLSL::resolveFunction): Deleted.

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

4 months ago[iPadOS] slides.google.com: tapping near cursor in a slide title focuses the speaker...
rniwa@webkit.org [Wed, 7 Aug 2019 03:15:19 +0000 (03:15 +0000)]
[iPadOS] slides.google.com: tapping near cursor in a slide title focuses the speaker notes
https://bugs.webkit.org/show_bug.cgi?id=200216

Reviewed by Wenson Hsieh.

Source/WebKit:

The bug was caused by a race condition between Google slides removing inputmode="none" from the hidden
content editable and updating the focused region upon receiving a pointerup event, which happens after
the Google slides had already updated its page layout & coordinates based on new visual viewport with
the software keyboard's boudning rect taken into account.

Delay bringing up the software keyboard for a inputmode change until all touches are released.

In the future, we could consider also delaying the software keyboard to be brought in general until
touchend / pointerup events are dispatched but this is rather risky since that could affact random
other websites while Google suites is the only major site to make use of inputmode="none".

This patch also reverts r243044, which was added for Google slides, since it's no longer needed and
interferes with this patch by adding another way to bring up the software keyboard.

Note: Adjusting touchend / pointerup coordinates while the keyboard is being brought up doesn't work
because the page had already updated the layout by then based on new visual viewport size.

Test: fast/forms/ios/inputmode-change-update-keyboard-after-pointerup.html

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::handleTouchEventSynchronously): Call didReleaseAllTouchPoints when all
touches are released.
(WebKit::WebPageProxy::handleTouchEventAsynchronously): Ditto.
(WebKit::WebPageProxy::handleTouchEvent): Ditto.
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::didReleaseAllTouchPoints): Added for non-iOS platforms.
(WebKit::WebPageProxy::m_pendingInputModeChange): Added. Used when inputmode is changed while
there is an on-going touch interaction.
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::elementDidFocus): Clear m_pendingInputModeChange when a new element is focused.
(WebKit::WebPageProxy::elementDidBlur): Ditto for bluring.
(WebKit::WebPageProxy::focusedElementDidChangeInputMode): Don't bring up the software keyboard now if
there are on-going touches by exiting early after setting m_pendingInputModeChange.
(WebKit::WebPageProxy::didReleaseAllTouchPoints): Bring up the software keyboard if inputmode
had changed from "none" to something else.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::dispatchTouchEvent): Removed the code added by r243044.

LayoutTests:

Added a new regression test and removed the one added for r243044.

* fast/events/touch/ios/show-keyboard-after-preventing-touchstart-expected.txt: Removed.
* fast/events/touch/ios/show-keyboard-after-preventing-touchstart.html: Removed.
* fast/forms/ios/inputmode-change-update-keyboard-after-pointerup-expected.txt: Added.
* fast/forms/ios/inputmode-change-update-keyboard-after-pointerup.html: Added.
* fast/forms/ios/inputmode-change-update-keyboard.html: Fixed the test for manual testing.

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

4 months ago[JSC] sampling-profiler can see garbage Wasm::Callee* pointer which is HashTable...
ysuzuki@apple.com [Wed, 7 Aug 2019 02:48:07 +0000 (02:48 +0000)]
[JSC] sampling-profiler can see garbage Wasm::Callee* pointer which is HashTable deleted / empty values
https://bugs.webkit.org/show_bug.cgi?id=200494

Reviewed by Saam Barati.

The sampling-profiler can see a garbage pointer which is like Wasm::Callee*. This can be filtered by HashSet<Callee*>.
But this is safe only when the garbage pointer is not deleted / empty values. We saw occasional crash with JetStream2/tsf-wasm.
This patch filters out these values with `HashSet<Callee*>::isValidValue`.

* wasm/WasmCalleeRegistry.h:
(JSC::Wasm::CalleeRegistry::isValidCallee):

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

4 months agoASSERTION FAILED: m_observers.isEmpty() if WKPageSetPageStateClient is used
Hironori.Fujii@sony.com [Wed, 7 Aug 2019 01:44:55 +0000 (01:44 +0000)]
ASSERTION FAILED: m_observers.isEmpty() if WKPageSetPageStateClient is used
https://bugs.webkit.org/show_bug.cgi?id=200465

Reviewed by Alex Christensen.

Source/WebKit:

PageLoadState::Observer should be removed before destructing
WebPageProxy.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::~WebPageProxy): Call
setPageLoadStateObserver with nullptr to remove
PageLoadState::Observer.

Tools:

* TestWebKitAPI/Tests/WebKit/PageLoadState.cpp:
(TestWebKitAPI::WebKit.PageLoadState): Set PageStateClient before
finishing the test.
* TestWebKitAPI/win/PlatformWebViewWin.cpp:
(TestWebKitAPI::PlatformWebView::~PlatformWebView): Release m_view.

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

4 months agoFix 32-bit Linux build after r248282
commit-queue@webkit.org [Wed, 7 Aug 2019 01:16:22 +0000 (01:16 +0000)]
Fix 32-bit Linux build after r248282
https://bugs.webkit.org/show_bug.cgi?id=200491

Patch by Loïc Yhuel <loic.yhuel@softathome.com> on 2019-08-06
Reviewed by Youenn Fablet.

minInterToneGapMs must be a size_t like interToneGap for std::max call.
The other constants are updated for consistency, even if the compiler
was able to cast them automatically.

* Modules/mediastream/RTCDTMFSender.cpp:

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

4 months agoAdd release assertions to help catch a bug in our WebProcessCache implementation
cdumez@apple.com [Wed, 7 Aug 2019 00:33:34 +0000 (00:33 +0000)]
Add release assertions to help catch a bug in our WebProcessCache implementation
https://bugs.webkit.org/show_bug.cgi?id=200483

Reviewed by Geoffrey Garen.

Add release assertions to help catch a bug in our WebProcessCache implementation. We
have evidence (rdar://problem/53962494) that we have processes with a page which
starts a provisional load while the process is in the WebProcessCache. This should
not be possible.

* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::setIsInProcessCache):
(WebKit::WebProcessProxy::addExistingWebPage):

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

4 months agoContext menu on a universal link produces a blank preview
dino@apple.com [Wed, 7 Aug 2019 00:17:24 +0000 (00:17 +0000)]
Context menu on a universal link produces a blank preview
https://bugs.webkit.org/show_bug.cgi?id=200485
<rdar://problem/53699620>

Reviewed by Dean Jackson.

Source/WebCore/PAL:

Define iTunesStoreURL from CoreServices.

* pal/spi/cocoa/LaunchServicesSPI.h:

Source/WebKit:

If the context menu is activated on an iTunesStore URL, pass it
on to DataDetectors, who should know how to handle it.

Two drive-by fixes:
- make it clear that early returns do not produce a value. Instead call the
  completion handler first, then return.
- The new API DataDetectors case doesn't need to worry about hiding link previews
  as DataDetectors itself will handle that.

* UIProcess/ios/WKContentViewInteraction.mm: If the URL is an iTunesStoreURL
(as defined by CoreServices), let DataDetectors handle it.
(-[WKContentView assignLegacyDataForContextMenuInteraction]):
(-[WKContentView continueContextMenuInteraction:]):
(-[WKContentView continueContextMenuInteractionWithDataDetectors:]): New method to
use DataDetectors if possible.

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

4 months agoAvoid unnecessary ResourceRequest copy under NetworkResourceLoader::isCrossOriginPref...
cdumez@apple.com [Wed, 7 Aug 2019 00:06:59 +0000 (00:06 +0000)]
Avoid unnecessary ResourceRequest copy under NetworkResourceLoader::isCrossOriginPrefetch()
https://bugs.webkit.org/show_bug.cgi?id=200478

Reviewed by Youenn Fablet.

* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::isCrossOriginPrefetch const):

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

4 months agoWeb Inspector: Show radius values in box model metrics view
drousso@apple.com [Tue, 6 Aug 2019 23:46:22 +0000 (23:46 +0000)]
Web Inspector: Show radius values in box model metrics view
https://bugs.webkit.org/show_bug.cgi?id=160993
<rdar://problem/27919035>

Reviewed by Brian Burg.

* UserInterface/Views/BoxModelDetailsSectionRow.js:
(WI.BoxModelDetailsSectionRow.prototype._getPropertyValue): Added.
(WI.BoxModelDetailsSectionRow.prototype._getPropertyValueAsPx):
(WI.BoxModelDetailsSectionRow.prototype._getBox):
(WI.BoxModelDetailsSectionRow.prototype._getComponentPrefix): Added.
(WI.BoxModelDetailsSectionRow.prototype._getComponentSuffix):
(WI.BoxModelDetailsSectionRow.prototype._updateMetrics):
(WI.BoxModelDetailsSectionRow.prototype._updateMetrics.createBoxPartElement):
(WI.BoxModelDetailsSectionRow.prototype._updateMetrics.createContentAreaElement):
(WI.BoxModelDetailsSectionRow.prototype._applyUserInput):
(WI.BoxModelDetailsSectionRow.prototype._applyUserInput.inspectedPage_node_toggleInlineStyleProperty):
* UserInterface/Views/BoxModelDetailsSectionRow.css:
(.details-section .row.box-model .box): Added.
(.details-section .row.box-model .box > .label): Added.
(.details-section .row.box-model .box.position): Added.
(.details-section .row.box-model .box.margin): Added.
(.details-section .row.box-model:not(.hovered) .box.margin, .details-section .row.box-model .box.margin.active): Added.
(.details-section .row.box-model .box.border): Added.
(.details-section .row.box-model:not(.hovered) .box.border, .details-section .row.box-model .box.border.active): Added.
(.details-section .row.box-model .box.border > .label): Added.
(.details-section .row.box-model .box.border.has-top-left-radius, .details-section .row.box-model .box.border.has-top-left-radius .box): Added.
(.details-section .row.box-model .box.border.has-top-right-radius, .details-section .row.box-model .box.border.has-top-right-radius .box): Added.
(.details-section .row.box-model .box.border.has-bottom-right-radius, .details-section .row.box-model .box.border.has-bottom-right-radius .box): Added.
(.details-section .row.box-model .box.border.has-bottom-left-radius, .details-section .row.box-model .box.border.has-bottom-left-radius .box): Added.
(.details-section .row.box-model .box.padding): Added.
(.details-section .row.box-model:not(.hovered) .box.padding, .details-section .row.box-model .box.padding.active): Added.
(.details-section .row.box-model .box.content): Added.
(.details-section .row.box-model:not(.hovered) .box.content, .details-section .row.box-model .box.content.active): Added.
(.details-section .row.box-model :matches(.top, .right, .bottom, .left)): Added.
(.details-section .row.box-model :matches(.top, .right, .bottom, .left):not(.editing), .details-section .row.box-model :matches(.top-left, .top-right, .bottom-right, .bottom-left)): Added.
(.details-section .row.box-model :matches(.top-left, .top-right, .bottom-right, .bottom-left)): Added.
(.details-section .row.box-model :matches(.top-left, .top-right)): Added.
(.details-section .row.box-model :matches(.bottom-left, .bottom-right):not(.editing)): Added.
(.details-section .row.box-model :matches(.bottom-left, .bottom-right).editing): Added.
(.details-section .row.box-model :matches(.top-left, .bottom-left):not(.editing)): Added.
(.details-section .row.box-model :matches(.top-left, .bottom-left).editing): Added.
(.details-section .row.box-model :matches(.top-right, .bottom-right):not(.editing)): Added.
(.details-section .row.box-model :matches(.top-right, .bottom-right).editing): Added.
(@media (prefers-color-scheme: dark) .details-section .row.box-model .box): Added.
(@media (prefers-color-scheme: dark) .details-section .row.box-model:not(.hovered) .box:matches(.margin, .border, .padding, .content), .details-section .row.box-model .box.active:matches(.margin, .border, .padding, .content)): Added.
(@media (prefers-color-scheme: dark) .details-section .row.box-model .box.margin): Added.
(@media (prefers-color-scheme: dark) .details-section .row.box-model .box.border): Added.
(.details-section .row.box-model :matches(.position, .margin, .border, .padding, .content)): Deleted.
(.details-section .row.box-model .position): Deleted.
(.details-section .row.box-model .margin): Deleted.
(.details-section .row.box-model:not(.hovered) .margin, .details-section .row.box-model .margin.active): Deleted.
(.details-section .row.box-model .border): Deleted.
(.details-section .row.box-model:not(.hovered) .border, .details-section .row.box-model .border.active): Deleted.
(.details-section .row.box-model .padding): Deleted.
(.details-section .row.box-model:not(.hovered) .padding, .details-section .row.box-model .padding.active): Deleted.
(.details-section .row.box-model .content): Deleted.
(.details-section .row.box-model:not(.hovered) .content, .details-section .row.box-model .content.active): Deleted.
(.details-section .row.box-model :matches(.content span, .top, .right, .bottom, .left)): Deleted.
(.details-section .row.box-model :matches(.right, .left)): Deleted.
(.details-section .row.box-model:not(.hovered) :matches(.margin, .border, .padding, .content), .details-section .row.box-model .active:matches(.margin, .border, .padding, .content)): Deleted.

* UserInterface/Models/CSSProperty.js:
(WI.CSSProperty.prototype.update):
Ensure that the `_value` is updated whenever the `_rawValue` is updated.

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

4 months agoUnreviewed, rolling out r248289.
commit-queue@webkit.org [Tue, 6 Aug 2019 23:38:03 +0000 (23:38 +0000)]
Unreviewed, rolling out r248289.
https://bugs.webkit.org/show_bug.cgi?id=200488

Broke internal builds (Requested by drousso on #webkit).

Reverted changeset:

"Web Inspector: Styles: show @supports CSS groupings"
https://bugs.webkit.org/show_bug.cgi?id=200419
https://trac.webkit.org/changeset/248289

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

4 months agoMake JSC memory benchmark available on OpenSource
msaboff@apple.com [Tue, 6 Aug 2019 23:24:26 +0000 (23:24 +0000)]
Make JSC memory benchmark available on OpenSource
https://bugs.webkit.org/show_bug.cgi?id=195012

Reviewed by Saam Barati.

This patch upstreams the RAMification memory benchmark to open source.

The prior RAMification.py driver script in the Internal directory has been moved here
with the device execution code seperated out to a new Internal driver script.
As a result, command line argument parsing as well as acting on the resulting argument
values has changed.  The remote device Runner creates an ArgumentParser object that is
passed through main().  In main(), if we have an ArgumentParser, we use it otherwise we
create one for benchmarking locally.  The arguments object returned from argument
parsing is now passed to the Runner constructor so it can extract the settings appropriate
for that particular runner.

Added some sane argument default values for the JSC command patch and the JetStream2
source directory.

Updated the Lua tests to eliminate the testing harness and its overhead, matching what was
done in the Internal tree.

* JetStream2/LuaJSFight/hello_world.js:
(Benchmark.prototype.runIteration): Deleted.
(Benchmark): Deleted.
* JetStream2/LuaJSFight/list_search.js:
(run): Deleted.
(Benchmark.prototype.runIteration): Deleted.
(Benchmark): Deleted.
* JetStream2/LuaJSFight/lists.js:
(): Deleted.
(Benchmark.prototype.runIteration): Deleted.
(Benchmark): Deleted.
* JetStream2/LuaJSFight/richards.js: Added.
(runRichards):
(Scheduler):
(Scheduler.prototype.addIdleTask):
(Scheduler.prototype.addWorkerTask):
(Scheduler.prototype.addHandlerTask):
(Scheduler.prototype.addDeviceTask):
(Scheduler.prototype.addRunningTask):
(Scheduler.prototype.addTask):
(Scheduler.prototype.schedule):
(Scheduler.prototype.release):
(Scheduler.prototype.holdCurrent):
(Scheduler.prototype.suspendCurrent):
(Scheduler.prototype.queue):
(TaskControlBlock):
(TaskControlBlock.prototype.setRunning):
(TaskControlBlock.prototype.markAsNotHeld):
(TaskControlBlock.prototype.markAsHeld):
(TaskControlBlock.prototype.isHeldOrSuspended):
(TaskControlBlock.prototype.markAsSuspended):
(TaskControlBlock.prototype.markAsRunnable):
(TaskControlBlock.prototype.run):
(TaskControlBlock.prototype.checkPriorityAdd):
(TaskControlBlock.prototype.toString):
(IdleTask):
(IdleTask.prototype.run):
(IdleTask.prototype.toString):
(DeviceTask):
(DeviceTask.prototype.run):
(DeviceTask.prototype.toString):
(WorkerTask):
(WorkerTask.prototype.run):
(WorkerTask.prototype.toString):
(HandlerTask):
(HandlerTask.prototype.run):
(HandlerTask.prototype.toString):
(Packet):
(Packet.prototype.addTo):
(Packet.prototype.toString):
* JetStream2/LuaJSFight/string_lists.js:
(): Deleted.
(Benchmark.prototype.runIteration): Deleted.
(Benchmark): Deleted.
* JetStream2/RAMification.py: Added.
(mean):
(geomean):
(frameworkPathFromExecutablePath):
(parseArgs):
(parseArgs.optStrToBool):
(BaseRunner):
(BaseRunner.__init__):
(BaseRunner.setup):
(BaseRunner.setEnv):
(BaseRunner.unsetEnv):
(BaseRunner.resetForTest):
(BaseRunner.processLine):
(BaseRunner.setReturnCode):
(BaseRunner.getResults):
(LocalRunner):
(LocalRunner.__init__):
(LocalRunner.runOneTest):
(main):
(main.runTestList):
* JetStream2/__init__.py: Added.

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

4 months agoUnreviewed, a build fix after r248308
jiewen_tan@apple.com [Tue, 6 Aug 2019 23:20:43 +0000 (23:20 +0000)]
Unreviewed, a build fix after r248308

Don't use WK_ENGINEERING_CODE_SIGN_IDENTITY for Production build.

* WebKitTestRunner/Configurations/WebKitTestRunner.xcconfig:

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

4 months agoUnreviewed, a build fix after r248319
jiewen_tan@apple.com [Tue, 6 Aug 2019 22:40:16 +0000 (22:40 +0000)]
Unreviewed, a build fix after r248319

Use HAVE(DATA_PROTECTION_KEYCHAIN) instead of HAVE_DATA_PROTECTION_KEYCHAIN.

Source/WebKit:

* UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
(WebKit::LocalAuthenticator::makeCredential):
(WebKit::LocalAuthenticator::continueMakeCredentialAfterUserConsented):
(WebKit::LocalAuthenticator::continueMakeCredentialAfterAttested):
(WebKit::LocalAuthenticator::getAssertion):
(WebKit::LocalAuthenticator::continueGetAssertionAfterUserConsented):

Tools:

* WebKitTestRunner/Configurations/WebKitTestRunner.xcconfig:
* WebKitTestRunner/cocoa/TestControllerCocoa.mm:
(WTR::TestController::addTestKeyToKeychain):
(WTR::TestController::cleanUpKeychain):
(WTR::TestController::keyExistsInKeychain):

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

4 months agoWeb Inspector: allow comments in protocol JSON
drousso@apple.com [Tue, 6 Aug 2019 22:20:31 +0000 (22:20 +0000)]
Web Inspector: allow comments in protocol JSON
https://bugs.webkit.org/show_bug.cgi?id=200104

Reviewed by Brian Burg.

* inspector/scripts/generate-inspector-protocol-bindings.py:
(generate_from_specification.load_specification):

* inspector/scripts/tests/generic/should-strip-comments.json: Added.
* inspector/scripts/tests/generic/expected/should-strip-comments.json-result: Added.

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

4 months agoUnreviewed, a build fix after r248308
jiewen_tan@apple.com [Tue, 6 Aug 2019 22:12:48 +0000 (22:12 +0000)]
Unreviewed, a build fix after r248308

Use kSecUseDataProtectionKeychain for iOS 13 and macOS Catalina or newer.

Source/WebKit:

* UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
(WebKit::LocalAuthenticator::makeCredential):
(WebKit::LocalAuthenticator::continueMakeCredentialAfterUserConsented):
(WebKit::LocalAuthenticator::continueMakeCredentialAfterAttested):
(WebKit::LocalAuthenticator::getAssertion):
(WebKit::LocalAuthenticator::continueGetAssertionAfterUserConsented):

Source/WTF:

* wtf/Platform.h:

Tools:

* WebKitTestRunner/cocoa/TestControllerCocoa.mm:
(WTR::TestController::addTestKeyToKeychain):
(WTR::TestController::cleanUpKeychain):
(WTR::TestController::keyExistsInKeychain):

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

4 months agoUnreviewed, fix internal iOS build after r248308.
cdumez@apple.com [Tue, 6 Aug 2019 22:04:22 +0000 (22:04 +0000)]
Unreviewed, fix internal iOS build after r248308.

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

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

4 months agoEnable XCBuild for `make` and `build-webkit` builds
krollin@apple.com [Tue, 6 Aug 2019 21:57:52 +0000 (21:57 +0000)]
Enable XCBuild for `make` and `build-webkit` builds
https://bugs.webkit.org/show_bug.cgi?id=200476
<rdar://problem/50771065>

Reviewed by Jonathan Bedard.

All projects have now been tested under XCBuild and successfully
build. Enable the use of XCBuild when performing builds with `make` or
`build-webkit` and when using a sufficient version of Xcode. We set
this version to Xcode 11 since Xcode 10 -- even though it supports
XCBuild -- does not support a build facility needed to build WebKit
(Bug 197072, Bug 197116, Bug 197340).

Do not enable XCBuild in the Xcode projects themselves since these
projects may need to be used under older versions of Xcode and there's
no way to make those project changes sensitive to the version of Xcode
being used. This means that builds performed in the Xcode IDE will not
use XCBuild.

* Scripts/webkitdirs.pm:
(canUseXCBuild):

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

4 months agoFix inefficiency in HTTPHeaderMap::set(CFStringRef, const String&)
cdumez@apple.com [Tue, 6 Aug 2019 21:45:32 +0000 (21:45 +0000)]
Fix inefficiency in HTTPHeaderMap::set(CFStringRef, const String&)
https://bugs.webkit.org/show_bug.cgi?id=200475

Reviewed by Darin Adler.

Source/WebCore:

In the case where CFStringGetCStringPtr() succeeds in returning us a pointer
to the CFStringRef underlying characters but it is not a common header, we
would fall back to calling HTTPHeaderMap::set(const String&, const String&)
which would unecessarily call findHTTPHeaderName() again to try and determine
if it is a common header. Avoid this by introducing a new setUncommonHeader()
private method and calling this one instead. Also got rid of some code
duplication at the same time.

* platform/network/HTTPHeaderMap.cpp:
(WebCore::HTTPHeaderMap::set):
(WebCore::HTTPHeaderMap::setUncommonHeader):
* platform/network/HTTPHeaderMap.h:
* platform/network/HTTPParsers.cpp:
(WebCore::parseHTTPHeader):
* testing/MockCDMFactory.cpp:
(WebCore::MockCDMInstance::setServerCertificate):

Source/WTF:

Add convenience constuctor to StringView which takes in a const char*
and an unsigned length, similarly to what we already have for String.

* wtf/URL.cpp:
(WTF::URL::protocolIs const):
(WTF::protocolIsInternal):
* wtf/text/StringView.h:
(WTF::StringView::StringView):
(WTF::StringView::empty):

Tools:

* TestWebKitAPI/Tests/WTF/StringView.cpp:
(TestWebKitAPI::stringViewFromLiteral):
(TestWebKitAPI::stringViewFromUTF8):

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

4 months agoUpdate my status in contributors.json to reviewer.
clopez@igalia.com [Tue, 6 Aug 2019 21:34:08 +0000 (21:34 +0000)]
Update my status in contributors.json to reviewer.

Regained the status after following the procedure for inactive contributors.
See r247136 for further explanation.

* Scripts/webkitpy/common/config/contributors.json:

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

4 months agoUpdating Test Expectations for <rdar://53957264>, <rdar://53946482>, <rdar://53866783>
russell_e@apple.com [Tue, 6 Aug 2019 20:38:47 +0000 (20:38 +0000)]
Updating Test Expectations for <rdar://53957264>, <rdar://53946482>, <rdar://53866783>

Unreviewed Test Gardening.

* platform/ios-12/TestExpectations:
* platform/ios/TestExpectations:

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

4 months agoWeb Inspector: RTL: go-to arrows and expand triangles in Computed panel should match...
nvasilyev@apple.com [Tue, 6 Aug 2019 20:33:16 +0000 (20:33 +0000)]
Web Inspector: RTL: go-to arrows and expand triangles in Computed panel should match their context
https://bugs.webkit.org/show_bug.cgi?id=200449

Reviewed by Joseph Pecoraro.

* UserInterface/Views/ComputedStyleSection.css:
(body[dir=rtl] .computed-style-section .computed-property-item .disclosure-button): Deleted.

* UserInterface/Views/Main.css:
(body[dir=rtl] [dir=ltr] .go-to-arrow): Added.
In the RTL mode, LTR "islands" should have their contents to be still LTR.

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

4 months ago[WHLSL] Remove the auto initialize variables pass
sbarati@apple.com [Tue, 6 Aug 2019 20:31:04 +0000 (20:31 +0000)]
[WHLSL] Remove the auto initialize variables pass
https://bugs.webkit.org/show_bug.cgi?id=200472

Reviewed by Robin Morisset.

From a separation of concerns perspective, it's a bit nicer to make variables
without initializers call their default constructors as a transformation over the AST.
This removes the need for the lowering to need to worry about such things. However,
changing metal lowering to deal with this is trivial. It means we need to change one
line of code in Metal code generation, and we get to remove a ~50 LOC AST pass.
Also, in this case, it saves us from the compile time hit of having to run the
auto initialize variables phase, which takes ~1.2ms on compute_boids.

* Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp:
(WebCore::WHLSL::Metal::FunctionDefinitionWriter::visit):
* Modules/webgpu/WHLSL/WHLSLAutoInitializeVariables.cpp: Removed.
* Modules/webgpu/WHLSL/WHLSLAutoInitializeVariables.h: Removed.
* Modules/webgpu/WHLSL/WHLSLPrepare.cpp:
(WebCore::WHLSL::prepareShared):
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:

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

4 months ago[WebGPU] Fix up demos on and add compute demo to webkit.org/demos
justin_fan@apple.com [Tue, 6 Aug 2019 20:18:43 +0000 (20:18 +0000)]
[WebGPU] Fix up demos on and add compute demo to webkit.org/demos
https://bugs.webkit.org/show_bug.cgi?id=200454

Reviewed by Jon Lee.

Add the compute-blur demo.
Ensure that WebGPU demos will work on upcoming STP release.

* demos/webgpu/compute-blur.html: Added.
* demos/webgpu/css/style.css: Sync with internal demo repository stylesheet.
(body):
(canvas):
(body.error img):
(body.error input):
(#error p):
* demos/webgpu/hello-cube.html:
* demos/webgpu/hello-triangle.html:
* demos/webgpu/index.html:
* demos/webgpu/resources/compute-blur.png: Added.
* demos/webgpu/resources/hello-cube.png:
* demos/webgpu/resources/textured-cube.png: Added.
* demos/webgpu/scripts/compute-blur.js: Added.
(async.init):
(async.loadImage):
(setUpCompute):
(async.computeBlur):
(async.setUniforms):
(createShaderCode):
* demos/webgpu/scripts/hello-triangle.js:
(async.helloTriangle):
* demos/webgpu/textured-cube.html: Renmaed from Websites/webkit.org/demos/webgpu/hello-cube.html.

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

4 months ago[WebAuthN] Enable LocalAuthenticator for macOS
jiewen_tan@apple.com [Tue, 6 Aug 2019 19:54:43 +0000 (19:54 +0000)]
[WebAuthN] Enable LocalAuthenticator for macOS
https://bugs.webkit.org/show_bug.cgi?id=182772
<rdar://problem/43347920>

Reviewed by Brent Fulgham.

Source/WebKit:

This patch enables LocalAuthenticator for macOS. The majority
of this patch is to tweak macOS keychain to use the modern one.

* Configurations/WebKit.xcconfig:
* Platform/spi/Cocoa/DeviceIdentitySPI.h:
* UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
(WebKit::LocalAuthenticatorInternal::toVector):
(WebKit::LocalAuthenticator::makeCredential):
(WebKit::LocalAuthenticator::continueMakeCredentialAfterUserConsented):
(WebKit::LocalAuthenticator::continueMakeCredentialAfterAttested):
(WebKit::LocalAuthenticator::getAssertion):
(WebKit::LocalAuthenticator::continueGetAssertionAfterUserConsented):
* UIProcess/WebAuthentication/Cocoa/LocalConnection.mm:
(WebKit::LocalConnection::getUserConsent const):
(WebKit::LocalConnection::getAttestation const):
* UIProcess/WebAuthentication/Cocoa/LocalService.mm:
(WebKit::LocalService::isAvailable):
* UIProcess/WebAuthentication/Mock/MockLocalConnection.mm:
(WebKit::MockLocalConnection::getAttestation const):
* config.h:

Source/WTF:

* wtf/Platform.h:
Adds HAVE_DEVICE_IDENTITY.
* wtf/spi/cocoa/SecuritySPI.h:
Adds a SPI for telling macOS keychain to use the modern one.

Tools:

Add an entitlement file to WebKitTestRunner such that it can access
the modern macOS keychain.

* WebKitTestRunner/Configurations/WebKitTestRunner.entitlements: Added.
* WebKitTestRunner/Configurations/WebKitTestRunner.xcconfig:
* WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj:
* WebKitTestRunner/cocoa/TestControllerCocoa.mm:
(WTR::TestController::addTestKeyToKeychain):
(WTR::TestController::cleanUpKeychain):
(WTR::TestController::keyExistsInKeychain):

LayoutTests:

Enable existing local authenticator tests for macOS. Since OpenSource bots
don't have the internal setting to include restricted entitlements, tests
will fail on OpenSource bots.

* platform/mac-wk2/TestExpectations:

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

4 months agoWHLSL Metal code generation unnecessarily does string copies by passing partial resul...
weinig@apple.com [Tue, 6 Aug 2019 19:04:00 +0000 (19:04 +0000)]
WHLSL Metal code generation unnecessarily does string copies by passing partial results as Strings
https://bugs.webkit.org/show_bug.cgi?id=200471

Reviewed by Saam Barati.

Avoid string copies by passing a single StringBuilder all the way through Metal code
generation and only converting to a String when passing the constructed shader to Metal
API.

Where possible, use StringView in lieu of String for temporary strings being passed to
the StringBuilder to avoid the allocation overhead of StringImpl.

* Modules/webgpu/WHLSL/AST/WHLSLAddressSpace.h:
(WebCore::WHLSL::AST::toString):
Switch to StringView.

* Modules/webgpu/WHLSL/AST/WHLSLBuiltInSemantic.h:
(WebCore::WHLSL::AST::BuiltInSemantic::toString const):
Switch to StringView.

* Modules/webgpu/WHLSL/AST/WHLSLEntryPointType.h:
(WebCore::WHLSL::AST::toString):
Switch to StringView.

* Modules/webgpu/WHLSL/AST/WHLSLPointerType.h:
Remove unnecessary "private:".

* Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.h:
(WebCore::WHLSL::AST::ResourceSemantic::toString):
Switch to StringView.

* Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.cpp:
(WebCore::WHLSL::Metal::EntryPointScaffolding::emitResourceHelperTypes):
(WebCore::WHLSL::Metal::EntryPointScaffolding::emitResourceSignature):
(WebCore::WHLSL::Metal::EntryPointScaffolding::emitBuiltInsSignature):
(WebCore::WHLSL::Metal::EntryPointScaffolding::emitMangledInputPath):
(WebCore::WHLSL::Metal::EntryPointScaffolding::emitMangledOutputPath):
(WebCore::WHLSL::Metal::EntryPointScaffolding::emitUnpackResourcesAndNamedBuiltIns):
(WebCore::WHLSL::Metal::VertexEntryPointScaffolding::emitHelperTypes):
(WebCore::WHLSL::Metal::VertexEntryPointScaffolding::emitSignature):
(WebCore::WHLSL::Metal::VertexEntryPointScaffolding::emitUnpack):
(WebCore::WHLSL::Metal::VertexEntryPointScaffolding::emitPack):
(WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::emitHelperTypes):
(WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::emitSignature):
(WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::emitUnpack):
(WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::emitPack):
(WebCore::WHLSL::Metal::ComputeEntryPointScaffolding::emitHelperTypes):
(WebCore::WHLSL::Metal::ComputeEntryPointScaffolding::emitSignature):
(WebCore::WHLSL::Metal::ComputeEntryPointScaffolding::emitUnpack):
(WebCore::WHLSL::Metal::ComputeEntryPointScaffolding::emitPack):
(WebCore::WHLSL::Metal::EntryPointScaffolding::resourceHelperTypes): Deleted.
(WebCore::WHLSL::Metal::EntryPointScaffolding::resourceSignature): Deleted.
(WebCore::WHLSL::Metal::EntryPointScaffolding::builtInsSignature): Deleted.
(WebCore::WHLSL::Metal::EntryPointScaffolding::mangledInputPath): Deleted.
(WebCore::WHLSL::Metal::EntryPointScaffolding::mangledOutputPath): Deleted.
(WebCore::WHLSL::Metal::EntryPointScaffolding::unpackResourcesAndNamedBuiltIns): Deleted.
(WebCore::WHLSL::Metal::VertexEntryPointScaffolding::helperTypes): Deleted.
(WebCore::WHLSL::Metal::VertexEntryPointScaffolding::signature): Deleted.
(WebCore::WHLSL::Metal::VertexEntryPointScaffolding::unpack): Deleted.
(WebCore::WHLSL::Metal::VertexEntryPointScaffolding::pack): Deleted.
(WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::helperTypes): Deleted.
(WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::signature): Deleted.
(WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::unpack): Deleted.
(WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::pack): Deleted.
(WebCore::WHLSL::Metal::ComputeEntryPointScaffolding::helperTypes): Deleted.
(WebCore::WHLSL::Metal::ComputeEntryPointScaffolding::signature): Deleted.
(WebCore::WHLSL::Metal::ComputeEntryPointScaffolding::unpack): Deleted.
(WebCore::WHLSL::Metal::ComputeEntryPointScaffolding::pack): Deleted.
* Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.h:
Rather than have scaffolding return strings, pass in StringBuilders everywhere.

* Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp:
(WebCore::WHLSL::Metal::FunctionDefinitionWriter::FunctionDefinitionWriter):
(WebCore::WHLSL::Metal::FunctionDefinitionWriter::visit):
(WebCore::WHLSL::Metal::FunctionDefinitionWriter::emitConstantExpressionString):
(WebCore::WHLSL::Metal::generateMetalFunctionsMapping):
(WebCore::WHLSL::Metal::emitSharedMetalFunctions):
(WebCore::WHLSL::Metal::emitMetalFunctions):
(WebCore::WHLSL::Metal::FunctionDeclarationWriter::FunctionDeclarationWriter): Deleted.
(WebCore::WHLSL::Metal::FunctionDeclarationWriter::toString): Deleted.
(WebCore::WHLSL::Metal::FunctionDefinitionWriter::toString): Deleted.
(WebCore::WHLSL::Metal::FunctionDefinitionWriter::constantExpressionString): Deleted.
(WebCore::WHLSL::Metal::RenderFunctionDefinitionWriter::RenderFunctionDefinitionWriter): Deleted.
(WebCore::WHLSL::Metal::ComputeFunctionDefinitionWriter::ComputeFunctionDefinitionWriter): Deleted.
(WebCore::WHLSL::Metal::sharedMetalFunctions): Deleted.
(WebCore::WHLSL::Metal::metalFunctions): Deleted.
* Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.h:
Rather than returning Strings from function generation functions, pass in StringBuilders everywhere.

* Modules/webgpu/WHLSL/Metal/WHLSLMetalCodeGenerator.cpp:
(WebCore::WHLSL::Metal::metalCodeProlog):
(WebCore::WHLSL::Metal::dumpMetalCodeIfNeeded):
(WebCore::WHLSL::Metal::generateMetalCode):
(WebCore::WHLSL::Metal::generateMetalCodeShared): Deleted.
* Modules/webgpu/WHLSL/Metal/WHLSLMetalCodeGenerator.h:
Switch RenderMetalCode and ComputeMetalCode to contain StringBuilders to allow
delaying conversion to String to the latest point possible.

* Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.cpp:
(WebCore::WHLSL::Metal::TypeNamer::emitMetalTypeDeclarations):
(WebCore::WHLSL::Metal::TypeNamer::emitUnnamedTypeDefinition):
(WebCore::WHLSL::Metal::TypeNamer::emitNamedTypeDefinition):
(WebCore::WHLSL::Metal::TypeNamer::emitAllUnnamedTypeDefinitions):
(WebCore::WHLSL::Metal::TypeNamer::emitMetalTypeDefinitions):
(WebCore::WHLSL::Metal::TypeNamer::emitMetalTypes):
(WebCore::WHLSL::Metal::MetalTypeDeclarationWriter::MetalTypeDeclarationWriter): Deleted.
(WebCore::WHLSL::Metal::MetalTypeDeclarationWriter::toString): Deleted.
(WebCore::WHLSL::Metal::MetalTypeDeclarationWriter::visit): Deleted.
(WebCore::WHLSL::Metal::TypeNamer::metalTypeDeclarations): Deleted.
(WebCore::WHLSL::Metal::TypeNamer::metalTypeDefinitions): Deleted.
(WebCore::WHLSL::Metal::TypeNamer::metalTypes): Deleted.
* Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.h:
Rather than returning Strings from function generation functions, pass in StringBuilders everywhere.

* Modules/webgpu/WHLSL/WHLSLParser.cpp:
(WebCore::WHLSL::Parser::parseResourceSemantic):
Remove use of _str, which allocates a String, and just use a StringView directly.

* Modules/webgpu/WHLSL/WHLSLPrepare.h:
Switch RenderPrepareResult and ComputePrepareResult to contain StringBuilders to allow
delaying conversion to String to the latest point possible.

* platform/graphics/gpu/cocoa/GPUComputePipelineMetal.mm:
(WebCore::trySetFunctions):
* platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
(WebCore::trySetFunctions):
Convert StringBuilders to String at the last moment necessary. Adds a FIXME to improve
in the future by adding direct conversion from StringBuilder to NSString to avoid another
copy.

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

4 months agoUnreviewed, drop change to TestExpectations that landed accidentally with r248276.
cdumez@apple.com [Tue, 6 Aug 2019 17:57:45 +0000 (17:57 +0000)]
Unreviewed, drop change to TestExpectations that landed accidentally with r248276.

* platform/wk2/TestExpectations:

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

4 months ago[results.webkit.org Timeline] Performance improvements
commit-queue@webkit.org [Tue, 6 Aug 2019 17:56:57 +0000 (17:56 +0000)]
[results.webkit.org Timeline] Performance improvements
https://bugs.webkit.org/show_bug.cgi?id=200406

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

1. Unhook the scroll event when a series/axis have been removed from the container
2. Fix the axis's cache data structure out of sync.
3. Use position:sticky to reduce the scrolling blink when update the presenter's transform
4. Use intersection observer to detect if the canvas on screen or not, if a canvas is not on the screen, we do nothing, this will eliminate render requests we send out.

* resultsdbpy/resultsdbpy/view/static/library/js/Ref.js:
(Signal.prototype.removeListener):
(prototype.stopAction): Unregsiter an action handler
(Ref):
(Ref.prototype.apply):
(Ref.prototype.destory):
* resultsdbpy/resultsdbpy/view/static/library/js/components/BaseComponents.js:
(ApplyNewChildren):
* resultsdbpy/resultsdbpy/view/static/library/js/components/TimelineComponents.js:
(Timeline.CanvasSeriesComponent):

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

4 months ago[Win] Fix AppleWin build
pvollan@apple.com [Tue, 6 Aug 2019 17:37:39 +0000 (17:37 +0000)]
[Win] Fix AppleWin build
https://bugs.webkit.org/show_bug.cgi?id=200455

Reviewed by Alex Christensen.

* CMakeLists.txt:
Source/JavaScriptCore:

* shell/CMakeLists.txt:

Source/WebKitLegacy:

* PlatformWin.cmake:
* WebKitLegacy.vcxproj/WebKitLegacy.proj:

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

4 months ago[WHLSL] Reduce the number of variables that make it into the global struct by skippin...
sbarati@apple.com [Tue, 6 Aug 2019 17:37:08 +0000 (17:37 +0000)]
[WHLSL] Reduce the number of variables that make it into the global struct by skipping stdlib functions and internal uses of MakePointerExpression/MakeArrayReference
https://bugs.webkit.org/show_bug.cgi?id=200463

Reviewed by Myles C. Maxfield.

This patch makes it so that we put fewer variables in the global struct.
This decreases end-to-end running time in compute_boids by 30% (with p = 0.0001).

We achieve this in two ways:
1. We track if each function is user code or "standard library" code. We also
count native functions as the standard library. We know a priori that the
standard library never escapes any variables. So the preserve variable
lifetimes phase skips analyzing all standard library functions and also
skips passing the global struct to any standard library functions.

2. We internally emit MakePointerExpression/MakeArrayReferenceExpression nodes in
the compiler in various phases. We sometimes emit these nodes in such a way
that we know that this address-of expression does not cause the variable to
escape. We now mark each address-of expressions as either:
- Conservatively escaping. We conservatively do this for all user code.
- Not escaping. This means that this address-of operation definitely does
not escape the variable. If a variable never has an escaping use, we will
omit putting this variable in the struct.

* Modules/webgpu/WHLSL/AST/WHLSLAddressEscapeMode.h: Added.
* Modules/webgpu/WHLSL/AST/WHLSLFunctionDeclaration.h:
(WebCore::WHLSL::AST::FunctionDeclaration::FunctionDeclaration):
(WebCore::WHLSL::AST::FunctionDeclaration::parsingMode const):
* Modules/webgpu/WHLSL/AST/WHLSLMakeArrayReferenceExpression.h:
(WebCore::WHLSL::AST::MakeArrayReferenceExpression::MakeArrayReferenceExpression):
(WebCore::WHLSL::AST::MakeArrayReferenceExpression::mightEscape const):
* Modules/webgpu/WHLSL/AST/WHLSLMakePointerExpression.h:
(WebCore::WHLSL::AST::MakePointerExpression::MakePointerExpression):
(WebCore::WHLSL::AST::MakePointerExpression::mightEscape const):
* Modules/webgpu/WHLSL/WHLSLChecker.cpp:
(WebCore::WHLSL::resolveWithOperatorAnderIndexer):
(WebCore::WHLSL::resolveWithOperatorLength):
(WebCore::WHLSL::resolveWithReferenceComparator):
* Modules/webgpu/WHLSL/WHLSLParser.cpp:
(WebCore::WHLSL::Parser::parse):
(WebCore::WHLSL::Parser::parseComputeFunctionDeclaration):
(WebCore::WHLSL::Parser::parseVertexOrFragmentFunctionDeclaration):
(WebCore::WHLSL::Parser::parseRegularFunctionDeclaration):
(WebCore::WHLSL::Parser::parseOperatorFunctionDeclaration):
(WebCore::WHLSL::Parser::parsePossiblePrefix):
* Modules/webgpu/WHLSL/WHLSLParser.h:
* Modules/webgpu/WHLSL/WHLSLParsingMode.h: Added.
* Modules/webgpu/WHLSL/WHLSLPrepare.cpp:
(WebCore::WHLSL::prepareShared):
* Modules/webgpu/WHLSL/WHLSLPreserveVariableLifetimes.cpp:
* Modules/webgpu/WHLSL/WHLSLPropertyResolver.cpp:
(WebCore::WHLSL::wrapAnderCallArgument):
(WebCore::WHLSL::modify):
(WebCore::WHLSL::PropertyResolver::visit):
* Modules/webgpu/WHLSL/WHLSLStandardLibraryUtilities.cpp:
(WebCore::WHLSL::includeStandardLibrary):
* Modules/webgpu/WHLSL/WHLSLSynthesizeArrayOperatorLength.cpp:
(WebCore::WHLSL::synthesizeArrayOperatorLength):
* Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.cpp:
(WebCore::WHLSL::synthesizeConstructors):
* Modules/webgpu/WHLSL/WHLSLSynthesizeEnumerationFunctions.cpp:
(WebCore::WHLSL::synthesizeEnumerationFunctions):
* Modules/webgpu/WHLSL/WHLSLSynthesizeStructureAccessors.cpp:
(WebCore::WHLSL::synthesizeStructureAccessors):
* WebCore.xcodeproj/project.pbxproj:

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

4 months agoAdd test for behavior introduced in r248174
jer.noble@apple.com [Tue, 6 Aug 2019 17:34:27 +0000 (17:34 +0000)]
Add test for behavior introduced in r248174
https://bugs.webkit.org/show_bug.cgi?id=200446

Reviewed by Eric Carlson.

Source/WebKit:

Add a new helper struct, FullscreenTouchSecheuristicParameters, and static getter,
iosParameters(), to allow the settings used by WKFullScreenViewController to be tested
in TestWebKitAPI. Make both of the Secheuristic classes privately exported as well.

* UIProcess/ios/fullscreen/FullscreenTouchSecheuristic.cpp:
(WebKit::FullscreenTouchSecheuristic::scoreOfNextTouch):
(WebKit::FullscreenTouchSecheuristic::reset):
(WebKit::FullscreenTouchSecheuristic::distanceScore):
(WebKit::FullscreenTouchSecheuristic::attenuationFactor):
* UIProcess/ios/fullscreen/FullscreenTouchSecheuristic.h:
(WebKit::FullscreenTouchSecheuristic::setParameters):
(WebKit::FullscreenTouchSecheuristic::requiredScore const):
(WebKit::FullscreenTouchSecheuristic::setRampUpSpeed):
(WebKit::FullscreenTouchSecheuristic::setRampDownSpeed):
(WebKit::FullscreenTouchSecheuristic::setXWeight):
(WebKit::FullscreenTouchSecheuristic::setYWeight):
(WebKit::FullscreenTouchSecheuristic::setGamma):
(WebKit::FullscreenTouchSecheuristic::setGammaCutoff):
* UIProcess/ios/fullscreen/FullscreenTouchSecheuristicParameters.cpp: Copied from Source/WebKit/UIProcess/ios/fullscreen/FullscreenTouchSecheuristic.h.
(WebKit::FullscreenTouchSecheuristicParameters::iosParameters):
* UIProcess/ios/fullscreen/FullscreenTouchSecheuristicParameters.h: Copied from Source/WebKit/UIProcess/ios/fullscreen/FullscreenTouchSecheuristic.h.
* UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
(-[WKFullScreenViewController initWithWebView:]):
(-[WKFullScreenViewController _touchDetected:]):
* WebKit.xcodeproj/project.pbxproj:

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/ios/FullscreenTouchSecheuristicTests.cpp: Added.
(WebKit::configureSecheuristic):
(WebKit::TEST):

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

4 months agoAdopt -expectMinimumUpcomingSampleBufferPresentationTime:
jer.noble@apple.com [Tue, 6 Aug 2019 17:05:13 +0000 (17:05 +0000)]
Adopt -expectMinimumUpcomingSampleBufferPresentationTime:
https://bugs.webkit.org/show_bug.cgi?id=200457
<rdar://problem/53961130>

Reviewed by Eric Carlson.

Source/WebCore:

Test: media/media-source/media-source-minimumupcomingpresentationtime.html

Adopt a new API vended by AVSampleBufferDisplayLayer, piped from SourceBuffer down
through SourceBufferPrivate to SourceBufferPrivateAVFObjC. This value should be
reset and updated when new samples are appended.

* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
(WebCore::SourceBuffer::provideMediaData):
(WebCore::SourceBuffer::updateMinimumUpcomingPresentationTime):
(WebCore::SourceBuffer::resetMinimumUpcomingPresentationTime):
(WebCore::SourceBuffer::minimumUpcomingPresentationTimeForTrackID):
(WebCore::SourceBuffer::setMaximumQueueDepthForTrackID):
* Modules/mediasource/SourceBuffer.h:
* platform/graphics/SourceBufferPrivate.h:
(WebCore::SourceBufferPrivate::canSetMinimumUpcomingPresentationTime const):
(WebCore::SourceBufferPrivate::setMinimumUpcomingPresentationTime):
(WebCore::SourceBufferPrivate::clearMinimumUpcomingPresentationTime):
(WebCore::SourceBufferPrivate::enqueuedSamplesForTrackID):
(WebCore::SourceBufferPrivate::minimumUpcomingPresentationTimeForTrackID):
(WebCore::SourceBufferPrivate::setMaximumQueueDepthForTrackID):
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::canSetMinimumUpcomingPresentationTime const):
(WebCore::SourceBufferPrivateAVFObjC::setMinimumUpcomingPresentationTime):
(WebCore::SourceBufferPrivateAVFObjC::clearMinimumUpcomingPresentationTime):
* platform/mock/mediasource/MockSourceBufferPrivate.cpp:
(WebCore::MockSourceBufferPrivate::minimumUpcomingPresentationTimeForTrackID):
(WebCore::MockSourceBufferPrivate::setMaximumQueueDepthForTrackID):
(WebCore::MockSourceBufferPrivate::canSetMinimumUpcomingPresentationTime const):
(WebCore::MockSourceBufferPrivate::setMinimumUpcomingPresentationTime):
(WebCore::MockSourceBufferPrivate::clearMinimumUpcomingPresentationTime):
* platform/mock/mediasource/MockSourceBufferPrivate.h:
* testing/Internals.cpp:
(WebCore::Internals::minimumUpcomingPresentationTimeForTrackID):
(WebCore::Internals::setMaximumQueueDepthForTrackID):
* testing/Internals.h:
* testing/Internals.idl:

LayoutTests:

* media/media-source/media-source-minimumupcomingpresentationtime-expected.txt: Added.
* media/media-source/media-source-minimumupcomingpresentationtime.html: Added.

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

4 months ago[iPad] editing/selection/character-granularity-rect.html is now passing.
russell_e@apple.com [Tue, 6 Aug 2019 16:30:03 +0000 (16:30 +0000)]
[iPad] editing/selection/character-granularity-rect.html is now passing.
<rdar://53468934>

Unreviewed Test Gardening.

* platform/ipad/TestExpectations: Removed expectation for passing test, editing/selection/character-granularity-rect.html

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

4 months agoAdd release assert against InvalidationRuleSet mutation during invalidation
antti@apple.com [Tue, 6 Aug 2019 16:18:05 +0000 (16:18 +0000)]
Add release assert against InvalidationRuleSet mutation during invalidation
https://bugs.webkit.org/show_bug.cgi?id=200467

Reviewed by Chris Dumez.

Try to get a more informative stack for rdar://problem/53413013

* css/DocumentRuleSets.cpp:
(WebCore::DocumentRuleSets::~DocumentRuleSets):
(WebCore::DocumentRuleSets::collectFeatures const):
* css/DocumentRuleSets.h:
* style/AttributeChangeInvalidation.cpp:
(WebCore::Style::AttributeChangeInvalidation::invalidateStyleWithRuleSets):
* style/ClassChangeInvalidation.cpp:
(WebCore::Style::ClassChangeInvalidation::invalidateStyleWithRuleSets):

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

4 months agoREGRESSION: Cannot tap on any buttons on m.naver.com home screen on iPad
antti@apple.com [Tue, 6 Aug 2019 15:37:28 +0000 (15:37 +0000)]
REGRESSION: Cannot tap on any buttons on m.naver.com home screen on iPad
https://bugs.webkit.org/show_bug.cgi?id=200466

Reviewed by Zalan Bujtas.

The page calls preventDefault() for a mouse event generated by a site specific quirk.

* page/Quirks.cpp:
(WebCore::Quirks::shouldDispatchSimulatedMouseEvents const):

Disable the quirk for the "m." subdomain. This is a mobile site that don't need or expect them.

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

4 months agoFileSystem: silent build warning
csaavedra@igalia.com [Tue, 6 Aug 2019 15:01:53 +0000 (15:01 +0000)]
FileSystem: silent build warning

Unreviewed compilation warning fix.

Remove unused parameter in empty method
* wtf/FileSystem.cpp:
(WTF::FileSystemImpl::createTemporaryZipArchive):

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

4 months ago[GLIB] Fix documentation typo
csaavedra@igalia.com [Tue, 6 Aug 2019 14:59:26 +0000 (14:59 +0000)]
[GLIB] Fix documentation typo

Unreviewed.

* UIProcess/API/glib/WebKitWebsiteDataManager.cpp:

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

4 months ago[iPadOS] Unable to increase zoom level on Google using the Aa menu
wenson_hsieh@apple.com [Tue, 6 Aug 2019 14:49:25 +0000 (14:49 +0000)]
[iPadOS] Unable to increase zoom level on Google using the Aa menu
https://bugs.webkit.org/show_bug.cgi?id=200453
<rdar://problem/52278579>

Reviewed by Tim Horton.

Source/WebCore:

Makes a couple of minor adjustments to how layout size scale factor is handled in ViewportConfiguration, to
address some scenarios in which adjusting WKWebView's _viewScale does not have any apparent effect on the page.
See changes below for more detail.

Tests: fast/viewport/ios/non-responsive-viewport-after-changing-view-scale.html
       fast/viewport/ios/responsive-viewport-with-minimum-width-after-changing-view-scale.html

* page/ViewportConfiguration.cpp:
(WebCore::ViewportConfiguration::initialScaleFromSize const):

When the page is either zoomed in or zoomed out using _viewScale, let the specified initial scale take
precedence over the scale computed by fitting the content width to the view width, or the scale computed by
fitting the content height to the view height.

This avoids a scenario in which nothing happens when increasing view scale in a responsively designed web page
that has a fixed minimum width. Before this change, when computing the initial scale at a view scale that would
not allow the entire content width of the page to fit within the viewport, the new initial scale would remain
unchanged if the initial scale in the meta viewport is not also set to 1, because a new initial scale would be
computed in ViewportConfiguration::initialScaleFromSize to accomodate for the entire content width.

Our new behavior allows us to zoom into the page, even if doing so would cause horizontal scrolling.

(WebCore::ViewportConfiguration::updateConfiguration):

When the page is either zoomed in or zoomed out using _viewScale and the default viewport configuration has a
fixed width (e.g. on iPhone), then adjust the width of the default viewport configuration to account for the
_viewScale. For example, the default width of a viewport-less web page is 980px on iPhone; at a view scale of 2,
this would become 490px instead, and at 0.5 view scale, it would become 1960px.

This ensures that on iPhone, for web pages without a meta viewport, changing the view scale still changes the
layout and initial scale of the web page.

* page/ViewportConfiguration.h:
(WebCore::ViewportConfiguration::layoutSizeIsExplicitlyScaled const):

LayoutTests:

Adds a couple of layout tests (with device-specific expectations) to verify that the two scenarios targeted by
this change are fixed.

* fast/viewport/ios/non-responsive-viewport-after-changing-view-scale-expected.txt: Added.
* fast/viewport/ios/non-responsive-viewport-after-changing-view-scale.html: Added.

Verifies that, for a page with no viewport meta tag (where we fall back to a fixed 980px viewport on iPhone),
changing view scale still changes page scale and window size.

* fast/viewport/ios/responsive-viewport-with-minimum-width-after-changing-view-scale-expected.txt: Added.
* fast/viewport/ios/responsive-viewport-with-minimum-width-after-changing-view-scale.html: Added.

Verifies that, for a page with a responsive meta viewport tag containing a fixed-width element that forces a
minimum width for the page, setting the view scale such that the page scrolls horizontally (2.5) doesn't result
in the initial scale being adjusted back to the maximum scale that would accomodate the full contents of the
page (2).

* platform/ipad/fast/viewport/ios/non-responsive-viewport-after-changing-view-scale-expected.txt: Added.
* platform/ipad/fast/viewport/ios/responsive-viewport-with-minimum-width-after-changing-view-scale-expected.txt: Added.

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

4 months agoSource/WebKit:
Hironori.Fujii@sony.com [Tue, 6 Aug 2019 06:47:10 +0000 (06:47 +0000)]
Source/WebKit:
[Win][MiniBrowser][WK2] Unhandled key events should be bubbled up to the parent window
https://bugs.webkit.org/show_bug.cgi?id=200464

Reviewed by Ross Kirsling.

* UIProcess/API/C/WKNativeEvent.h: Define WKNativeEventPtr for WIN32.

Tools:
[MiniBrowser][WK2] Unhandled key events should be bubbled up to the parent window
https://bugs.webkit.org/show_bug.cgi?id=200464

Reviewed by Ross Kirsling.

When WK2 WebView is focused, short cut keys (e.g. Alt-F to open File
menu, Alt-F4 to close window, and etc) don't work.

WK1 WebView doesn't have this issue because it processes key events
properly.

* MiniBrowser/win/WebKitBrowserWindow.cpp:
(WebKitBrowserWindow::WebKitBrowserWindow):
(WebKitBrowserWindow::didNotHandleKeyEvent): Added. Send the
unhandled key events to the main window.
* MiniBrowser/win/WebKitBrowserWindow.h:

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

4 months ago[LFC] Remove out-of-flow descendants from Container
zalan@apple.com [Tue, 6 Aug 2019 05:20:09 +0000 (05:20 +0000)]
[LFC] Remove out-of-flow descendants from Container
https://bugs.webkit.org/show_bug.cgi?id=200430
<rdar://problem/53923980>

Reviewed by Antti Koivisto.

The out-of-flow descendant list is the last "formatting context type" bit in the layout tree.
Let's cached them in the FormattingStates instead for now.

* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
* layout/FormattingContext.h:
* layout/FormattingState.h:
(WebCore::Layout::FormattingState::addOutOfFlowBox):
(WebCore::Layout::FormattingState::outOfFlowBoxes const):
* layout/LayoutState.cpp:
(WebCore::Layout::LayoutState::layoutFormattingContextSubtree):
(WebCore::Layout::LayoutState::createFormattingStateForFormattingRootIfNeeded):
(WebCore::Layout::LayoutState::run):
* layout/LayoutState.h:
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
* layout/layouttree/LayoutBox.h:
* layout/layouttree/LayoutContainer.cpp:
(WebCore::Layout::Container::addOutOfFlowDescendant): Deleted.
* layout/layouttree/LayoutContainer.h:
* layout/layouttree/LayoutTreeBuilder.cpp:
(WebCore::Layout::TreeBuilder::createLayoutTree):
* page/FrameViewLayoutContext.cpp:
(WebCore::layoutUsingFormattingContext):

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

4 months agoWeb Inspector: Styles: show @supports CSS groupings
drousso@apple.com [Tue, 6 Aug 2019 05:04:15 +0000 (05:04 +0000)]
Web Inspector: Styles: show @supports CSS groupings
https://bugs.webkit.org/show_bug.cgi?id=200419

Reviewed by Joseph Pecoraro.

Source/JavaScriptCore:

* inspector/protocol/CSS.json:
Rename `CSSMedia` to `Grouping` and remove the `sourceLine` value, as it was never populated
and wasn't used by Web Inspector.

Source/WebCore:

Test: inspector/css/getMatchedStylesForNode.html

* inspector/InspectorStyleSheet.cpp:
(WebCore::buildArrayForGroupings): Added.
(WebCore::InspectorStyleSheet::buildObjectForRule):
(WebCore::buildMediaObject): Deleted.
(WebCore::fillMediaListChain): Deleted.

* css/MediaList.h:
* css/MediaList.cpp:
(WebCore::MediaQuerySet::MediaQuerySet):
Remove the `lastLine` as it was never set by anyone and wasn't used by Web Inspector.

Source/WebInspectorUI:

* UserInterface/Models/CSSGrouping.js: Renamed from Source/WebInspectorUI/UserInterface/Models/CSSMedia.js.
(WI.CSSGrouping):
(WI.CSSGrouping.prototype.get type):
(WI.CSSGrouping.prototype.get text):
(WI.CSSGrouping.prototype.get sourceCodeLocation):
(WI.CSSGrouping.prototype.get isMedia): Added.
(WI.CSSGrouping.prototype.get isSupports): Added.
(WI.CSSGrouping.prototype.get prefix): Added.

* UserInterface/Models/CSSStyleDeclaration.js:
(WI.CSSStyleDeclaration.prototype.get groupings): Added.
(WI.CSSStyleDeclaration.prototype.generateCSSRuleString):
(WI.CSSStyleDeclaration.prototype.get mediaList): Deleted.

* UserInterface/Models/CSSRule.js:
(WI.CSSRule):
(WI.CSSRule.prototype.get groupings): Added.
(WI.CSSRule.prototype.update):
(WI.CSSRule.prototype._selectorResolved):
(WI.CSSRule.prototype.get mediaList): Deleted.

* UserInterface/Models/DOMNodeStyles.js:
(WI.DOMNodeStyles.prototype._parseRulePayload):
(WI.DOMNodeStyles.prototype.rulesForSelector): Deleted.

* UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
(WI.SpreadsheetCSSStyleDeclarationSection):
(WI.SpreadsheetCSSStyleDeclarationSection.prototype.initialLayout):
(WI.SpreadsheetCSSStyleDeclarationSection.prototype._handleEditorFilterApplied):
(WI.SpreadsheetCSSStyleDeclarationSection.prototype._createMediaHeader): Deleted.
* UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.css:
(.spreadsheet-css-declaration :matches(.header, .header-groupings)): Added.
(.spreadsheet-css-declaration :matches(.header, .header-groupings):first-child): Added.
(.spreadsheet-css-declaration .header-groupings > .grouping): Added.
(.spreadsheet-css-declaration .header-groupings + .header > .selector > .icon): Added.
(.spreadsheet-css-declaration :matches(.header, .header-media)): Deleted.
(.spreadsheet-css-declaration :matches(.header, .header-media):first-child): Deleted.
(.spreadsheet-css-declaration .media-label): Deleted.

* UserInterface/Controllers/CSSManager.js:
(WI.CSSManager.protocolGroupingTypeToEnum): Added.
(WI.CSSManager.protocolMediaSourceToEnum): Deleted.

* UserInterface/Main.html:
* UserInterface/Test.html:

LayoutTests:

* inspector/css/getMatchedStylesForNode.html:
* inspector/css/getMatchedStylesForNode-expected.txt:

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

4 months agoMake Logger::log thread safe so that it can be used from background threads
youenn@apple.com [Tue, 6 Aug 2019 03:45:40 +0000 (03:45 +0000)]
Make Logger::log thread safe so that it can be used from background threads
https://bugs.webkit.org/show_bug.cgi?id=200448

Reviewed by Eric Carlson.

Source/WebCore:

No change of behavior.

* dom/Document.cpp:
(WebCore::crossThreadCopy):
(WebCore::Document::didLogMessage):
Make sure to hop to the main thread if needed.
* platform/mediastream/mac/RealtimeIncomingAudioSourceCocoa.cpp:
(WebCore::RealtimeIncomingAudioSourceCocoa::OnData):
Remove hopping to the main thread.
* platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
(WebCore::RealtimeIncomingVideoSourceCocoa::OnFrame):
Remove hopping to the main thread.

Source/WTF:

Add a lock to ensure calling log is thread-safe.

* wtf/Logger.h:
(WTF::Logger::addObserver):
(WTF::Logger::removeObserver):
(WTF::Logger::log):
(WTF::Logger::observerLock):

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

4 months agoCan't use $0, $1 etc when inspecting Google Docs pages because the content uses these...
drousso@apple.com [Tue, 6 Aug 2019 03:37:44 +0000 (03:37 +0000)]
Can't use $0, $1 etc when inspecting Google Docs pages because the content uses these for function names
https://bugs.webkit.org/show_bug.cgi?id=195834

Reviewed by Joseph Pecoraro.

Allow the user to alias saved results by providing a different prefix (e.g. "$") from within
Web Inspector. When changing the alias, all existing saved results will update to be
reference-able from the new alias.

Source/JavaScriptCore:

* inspector/protocol/Runtime.json:
Add `setSavedResultAlias` command.

* inspector/agents/InspectorRuntimeAgent.h:
* inspector/agents/InspectorRuntimeAgent.cpp:
(Inspector::InspectorRuntimeAgent::setSavedResultAlias): Added.

* inspector/InjectedScriptHost.h:
(Inspector::InjectedScriptHost::setSavedResultAlias): Added.
(Inspector::InjectedScriptHost::savedResultAlias const): Added.
* inspector/JSInjectedScriptHost.h:
* inspector/JSInjectedScriptHost.cpp:
(Inspector::JSInjectedScriptHost::savedResultAlias const): Added.
* inspector/JSInjectedScriptHostPrototype.cpp:
(Inspector::JSInjectedScriptHostPrototype::finishCreation):
(Inspector::jsInjectedScriptHostPrototypeAttributeSavedResultAlias): Added.
Store the saved result alias on the `InjectedScriptHost` since it is a shared object among
all `InjectedScript`.

* inspector/InjectedScriptSource.js:
(BasicCommandLineAPI):

Source/WebCore:

Test: inspector/runtime/setSavedResultAlias.html

* inspector/CommandLineAPIModuleSource.js:
(CommandLineAPI):

Source/WebInspectorUI:

* UserInterface/Controllers/RuntimeManager.js:
(WI.RuntimeManager):
(WI.RuntimeManager.preferredSavedResultPrefix): Added.
(WI.RuntimeManager.prototype.initializeTarget):
* UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js:
(WI.JavaScriptRuntimeCompletionProvider.completionControllerCompletionsNeeded.receivedPropertyNames):

* UserInterface/Base/Setting.js:
* UserInterface/Base/Main.js:
(WI.contentLoaded):
(WI.contentLoaded.updateConsoleSavedResultPrefixCSSVariable): Added.
* UserInterface/Views/ConsoleMessageView.js:
(WI.ConsoleMessageView.prototype.toClipboardString):
(WI.ConsoleMessageView.prototype.removeEventListeners): Added.
(WI.ConsoleMessageView.prototype._appendSavedResultIndex):
(WI.ConsoleMessageView.prototype._appendSavedResultIndex.updateSavedVariableText): Added.
(WI.ConsoleMessageView.prototype._rootPropertyPathForObject):
(WI.ConsoleMessageView.prototype._rootPropertyPathForObject.prefixSavedResultIndex): Added.
* UserInterface/Views/LogContentView.js:
(WI.LogContentView.prototype._sessionStarted):
(WI.LogContentView.prototype._logCleared):
* UserInterface/Views/DOMTreeOutline.css:
(.tree-outline.dom.show-last-selected li.last-selected > span::after):
* UserInterface/Views/QuickConsole.js:
(WI.QuickConsole):
(WI.QuickConsole.prototype.closed):
(WI.QuickConsole.prototype._updateAutomaticExecutionContextPathComponentTooltip): Added.
Listen for changes to the setting that holds the current saved result alias and update any
related UI accordingly.

* UserInterface/Views/SettingsTabContentView.js:
(WI.SettingsTabContentView.prototype._createConsoleSettingsView):
* UserInterface/Views/SettingsTabContentView.css:
(.content-view.settings > .settings-view > .container > .editor-group > .editor input[type="text"]): Added.
* UserInterface/Views/SettingsGroup.js:
(WI.SettingsGroup.prototype.addCustomEditor): Added.
Add an input to the Settings tab that controls the saved result prefix alias. Only allow
[a-zA-Z0-9_$] as values (but [0-9] cannot be used as the start).

* UserInterface/Models/PropertyPath.js:
(WI.PropertyPath.prototype.set pathComponent): Added.
Miscellaneous getters/setters.

* Localizations/en.lproj/localizedStrings.js:

* UserInterface/Test/TestHarness.js:
(TestHarness.prototype.newline): Added.
Convenience function for adding newlines to test results.

LayoutTests:

* inspector/runtime/setSavedResultAlias.html: Added.
* inspector/runtime/setSavedResultAlias-expected.txt: Added.
* http/tests/inspector/dom/cross-domain-inspected-node-access-expected.txt:
* inspector/console/command-line-api-expected.txt:
* inspector/console/command-line-api-exception.html:
* inspector/console/command-line-api-exception-expected.txt:
* inspector/console/command-line-api-exception-nested-catch.html:
* inspector/console/command-line-api-exception-nested-catch-expected.txt:

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

4 months agoWeb Inspector: Timelines: disable related agents when the tab is closed
drousso@apple.com [Tue, 6 Aug 2019 02:21:59 +0000 (02:21 +0000)]
Web Inspector: Timelines: disable related agents when the tab is closed
https://bugs.webkit.org/show_bug.cgi?id=200118

Reviewed by Joseph Pecoraro.

Source/JavaScriptCore:

Rework how `enable`/`disable` is used for timeline-related agents so that events are not sent
and data isn't kept alive when the Timelines tab isn't enabled.

* inspector/protocol/Timeline.json:
Add `enable`/`disable` commands.

* inspector/agents/InspectorHeapAgent.cpp:
(Inspector::InspectorHeapAgent::willDestroyFrontendAndBackend):
(Inspector::InspectorHeapAgent::enable):
(Inspector::InspectorHeapAgent::disable):

Source/WebCore:

Rework how `enable`/`disable` is used for timeline-related agents so that events are not sent
and data isn't kept alive when the Timelines tab isn't enabled.

* inspector/agents/InspectorTimelineAgent.h:
* inspector/agents/InspectorTimelineAgent.cpp:
(WebCore::InspectorTimelineAgent::didCreateFrontendAndBackend):
(WebCore::InspectorTimelineAgent::willDestroyFrontendAndBackend):
(WebCore::InspectorTimelineAgent::enable):
(WebCore::InspectorTimelineAgent::disable):
(WebCore::InspectorTimelineAgent::start):
(WebCore::InspectorTimelineAgent::stop):
(WebCore::InspectorTimelineAgent::internalStart):
(WebCore::InspectorTimelineAgent::internalStop):
(WebCore::InspectorTimelineAgent::startFromConsole):
(WebCore::InspectorTimelineAgent::stopFromConsole):
(WebCore::InspectorTimelineAgent::mainFrameStartedLoading):
(WebCore::InspectorTimelineAgent::startProgrammaticCapture):
(WebCore::InspectorTimelineAgent::stopProgrammaticCapture):
Rename `m_enabled*` to `m_tracking*` to match other timeline-related agents.

* inspector/agents/InspectorMemoryAgent.h:
* inspector/agents/InspectorMemoryAgent.cpp:
(WebCore::InspectorMemoryAgent::didCreateFrontendAndBackend):
(WebCore::InspectorMemoryAgent::willDestroyFrontendAndBackend):
(WebCore::InspectorMemoryAgent::enable):
(WebCore::InspectorMemoryAgent::disable):
(WebCore::InspectorMemoryAgent::didHandleMemoryPressure):

* inspector/InstrumentingAgents.h:
(WebCore::InstrumentingAgents::trackingInspectorTimelineAgent): Added.
(WebCore::InstrumentingAgents::setTrackingInspectorTimelineAgent): Added.
(WebCore::InstrumentingAgents::persistentInspectorTimelineAgent): Added.
(WebCore::InstrumentingAgents::setPersistentInspectorTimelineAgent): Added.
* inspector/InstrumentingAgents.cpp:
(WebCore::InstrumentingAgents::reset):
* inspector/InspectorInstrumentation.h:
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::didInstallTimerImpl):
(WebCore::InspectorInstrumentation::didRemoveTimerImpl):
(WebCore::InspectorInstrumentation::willCallFunctionImpl):
(WebCore::InspectorInstrumentation::willDispatchEventImpl):
(WebCore::InspectorInstrumentation::willDispatchEventOnWindowImpl):
(WebCore::InspectorInstrumentation::willEvaluateScriptImpl):
(WebCore::InspectorInstrumentation::willFireTimerImpl):
(WebCore::InspectorInstrumentation::didInvalidateLayoutImpl):
(WebCore::InspectorInstrumentation::willLayoutImpl):
(WebCore::InspectorInstrumentation::willCompositeImpl):
(WebCore::InspectorInstrumentation::didCompositeImpl):
(WebCore::InspectorInstrumentation::willPaintImpl):
(WebCore::InspectorInstrumentation::didPaintImpl):
(WebCore::InspectorInstrumentation::willRecalculateStyleImpl):
(WebCore::InspectorInstrumentation::didScheduleStyleRecalculationImpl):
(WebCore::InspectorInstrumentation::didCommitLoadImpl):
(WebCore::InspectorInstrumentation::frameStartedLoadingImpl):
(WebCore::InspectorInstrumentation::startConsoleTimingImpl):
(WebCore::InspectorInstrumentation::stopConsoleTimingImpl):
(WebCore::InspectorInstrumentation::consoleTimeStampImpl):
(WebCore::InspectorInstrumentation::startProfilingImpl):
(WebCore::InspectorInstrumentation::stopProfilingImpl):
(WebCore::InspectorInstrumentation::timelineAgentTracking): Added.
(WebCore::InspectorInstrumentation::didRequestAnimationFrameImpl):
(WebCore::InspectorInstrumentation::didCancelAnimationFrameImpl):
(WebCore::InspectorInstrumentation::willFireAnimationFrameImpl):
(WebCore::InspectorInstrumentation::willFireObserverCallbackImpl):
(WebCore::InspectorInstrumentation::retrieveTimelineAgent):
(WebCore::InspectorInstrumentation::timelineAgentEnabled): Deleted.
* bindings/js/JSExecStateInstrumentation.h:
(WebCore::JSExecState::instrumentFunctionInternal):
Rename for clarity/correctness:
 - `inspectorTimelineAgent` => `trackingInspectorTimelineAgent`
 - `persistentInspectorTimelineAgent` => `inspectorTimelineAgent`

Source/WebInspectorUI:

Rework how `enable`/`disable` is used for timeline-related agents so that events are not sent
and data isn't kept alive when the Timelines tab isn't enabled.

* UserInterface/Controllers/TimelineManager.js:
(WI.TimelineManager):
(WI.TimelineManager.prototype.get domains): Added.
(WI.TimelineManager.prototype.activateExtraDomain): Added.
(WI.TimelineManager.prototype.initializeTarget):
(WI.TimelineManager.prototype.reset):
(WI.TimelineManager.prototype.set autoCaptureOnPageLoad):
(WI.TimelineManager.prototype.enable): Added.
(WI.TimelineManager.prototype.disable): Added.
(WI.TimelineManager.prototype.startCapturing):
(WI.TimelineManager.prototype.stopCapturing):
(WI.TimelineManager.prototype.async processJSON):
(WI.TimelineManager.prototype.capturingStarted):
(WI.TimelineManager.prototype.capturingStopped):
(WI.TimelineManager.prototype.autoCaptureStarted):
(WI.TimelineManager.prototype.eventRecorded):
(WI.TimelineManager.prototype.pageDOMContentLoadedEventFired):
(WI.TimelineManager.prototype.pageLoadEventFired):
(WI.TimelineManager.prototype.cpuProfilerTrackingUpdated):
(WI.TimelineManager.prototype.memoryTrackingUpdated):
(WI.TimelineManager.prototype.heapTrackingStarted):
(WI.TimelineManager.prototype.heapTrackingCompleted):
(WI.TimelineManager.prototype.heapSnapshotAdded):
(WI.TimelineManager.prototype._loadNewRecording):
(WI.TimelineManager.prototype._legacyAttemptStartAutoCapturingForFrame):
(WI.TimelineManager.prototype._provisionalLoadStarted):
(WI.TimelineManager.prototype._mainResourceDidChange):
(WI.TimelineManager.prototype._resourceWasAdded):
(WI.TimelineManager.prototype._garbageCollected):
(WI.TimelineManager.prototype._memoryPressure):
(WI.TimelineManager.prototype.scriptProfilerTrackingUpdated):
(WI.TimelineManager.prototype.scriptProfilerTrackingCompleted):
(WI.TimelineManager.prototype._updateAutoCaptureInstruments):
(WI.TimelineManager.prototype._handleDOMNodeDidFireEvent):
(WI.TimelineManager.prototype._handleDOMNodePowerEfficientPlaybackStateChanged):
* UserInterface/Models/Instrument.js:
(WI.Instrument.startLegacyTimelineAgent):
(WI.Instrument.stopLegacyTimelineAgent):

* UserInterface/Controllers/HeapManager.js:
(WI.HeapManager): Added.
(WI.HeapManager.prototype.get domains): Added.
(WI.HeapManager.prototype.activateExtraDomain): Added.
(WI.HeapManager.prototype.initializeTarget):
(WI.HeapManager.prototype.enable): Added.
(WI.HeapManager.prototype.disable): Added.
(WI.HeapManager.prototype.snapshot): Added.
(WI.HeapManager.prototype.getPreview): Added.
(WI.HeapManager.prototype.getRemoteObject): Added.
(WI.HeapManager.prototype.garbageCollected):

* UserInterface/Controllers/MemoryManager.js:
(WI.MemoryManager): Added.
(WI.MemoryManager.prototype.get domains): Added.
(WI.MemoryManager.prototype.activateExtraDomain): Added.
(WI.MemoryManager.prototype.initializeTarget):
(WI.MemoryManager.prototype.enable): Added.
(WI.MemoryManager.prototype.disable): Added.
(WI.MemoryManager.prototype.memoryPressure):

* UserInterface/Views/TimelineTabContentView.js:
(WI.TimelineTabContentView):
(WI.TimelineTabContentView.prototype.closed):

* UserInterface/Models/HeapAllocationsInstrument.js:
(WI.HeapAllocationsInstrument):
(WI.HeapAllocationsInstrument.prototype._takeHeapSnapshot):
* UserInterface/Views/HeapAllocationsTimelineView.js:
(WI.HeapAllocationsTimelineView.prototype._takeHeapSnapshotClicked):
* UserInterface/Views/HeapSnapshotInstanceDataGridNode.js:
(WI.HeapSnapshotInstanceDataGridNode.logHeapSnapshotNode):
(WI.HeapSnapshotInstanceDataGridNode.prototype._populatePreview):
(WI.HeapSnapshotInstanceDataGridNode.prototype._mouseoverHandler.appendPathRow):
Go through the `HeapManager` for `HeapAgent` commands so it can better manage state.

* UserInterface/Test/Test.js:
(WI.contentLoaded):

LayoutTests:

* inspector/timeline/line-column.html:
* inspector/timeline/setInstruments-errors.html:
* inspector/timeline/setInstruments-programmatic-capture.html:

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

4 months ago[Win] Specifying huge font-size causes crashing
Hironori.Fujii@sony.com [Tue, 6 Aug 2019 02:07:06 +0000 (02:07 +0000)]
[Win] Specifying huge font-size causes crashing
https://bugs.webkit.org/show_bug.cgi?id=200340

Reviewed by Don Olmstead.

Source/WebCore:

Covered by existing tests.

* platform/graphics/win/FontPlatformDataWin.cpp:
(WebCore::FontPlatformData::FontPlatformData): Use GetTextFace to
get font face names instead of GetOutlineTextMetrics which returns
null for huge size fonts.

LayoutTests:

* platform/win/TestExpectations:

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

4 months agoWeb Inspector: brotli-compressed resources have "Compressed: No" in Resources details...
nvasilyev@apple.com [Tue, 6 Aug 2019 02:00:03 +0000 (02:00 +0000)]
Web Inspector: brotli-compressed resources have "Compressed: No" in Resources details sidebar
https://bugs.webkit.org/show_bug.cgi?id=200452

Reviewed by Joseph Pecoraro.

* UserInterface/Models/Resource.js:
(WI.Resource.prototype.get compressed):
Add "br" - Brotli content encoding.

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

4 months agoLayoutTests/imported/w3c:
youenn@apple.com [Tue, 6 Aug 2019 00:36:09 +0000 (00:36 +0000)]
LayoutTests/imported/w3c:
Response constructor doesn't throw on disturbed ReadableStream
https://bugs.webkit.org/show_bug.cgi?id=200130
<rdar://problem/53550351>

Reviewed by Alex Christensen.

Update test to use promise_rejects instead of assert_throws.

* web-platform-tests/fetch/api/request/request-init-stream.any-expected.txt:
* web-platform-tests/fetch/api/request/request-init-stream.any.js:
(async.assert_request):
(promise_test.async):
* web-platform-tests/fetch/api/request/request-init-stream.any.worker-expected.txt:
* web-platform-tests/fetch/api/response/response-from-stream.any-expected.txt:
* web-platform-tests/fetch/api/response/response-from-stream.any.worker-expected.txt:

Source/WebCore:
Response constructor doesn't throw on disturbed ReadableStream
https://bugs.webkit.org/show_bug.cgi?id=200130
<rdar://problem/53550351>

Reviewed by Alex Christensen.

Make FetchBody::extract return an exception in error cases.
Update call sites accordingly.
Add the error case as per https://fetch.spec.whatwg.org/#concept-bodyinit-extract, ReadableStream handling.

Covered by updated and rebased tests.

* Modules/beacon/NavigatorBeacon.cpp:
(WebCore::NavigatorBeacon::sendBeacon):
* Modules/fetch/FetchBody.cpp:
(WebCore::FetchBody::extract):
* Modules/fetch/FetchBody.h:
* Modules/fetch/FetchBodyOwner.cpp:
(WebCore::FetchBodyOwner::extractBody):
* Modules/fetch/FetchBodyOwner.h:
* Modules/fetch/FetchRequest.cpp:
(WebCore::FetchRequest::initializeWith):
(WebCore::FetchRequest::setBody):
* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::create):
* Modules/streams/ReadableStreamInternals.js:
(readableStreamPipeTo): fix a case where the promise would be unhandled and would show up in
unhandledrejectionhandler.

LayoutTests:
Support RTCRtpSender.dtmf
https://bugs.webkit.org/show_bug.cgi?id=200431
<rdar://problem/53924833>

Reviewed by Alex Christensen.

Removed cache storage test which is no longer valid.
Removed WK1 expectation that is no longer needed.

* http/wpt/cache-storage/cache-put-stream.https.any.html: Removed.
* http/wpt/cache-storage/cache-put-stream.https.any.js: Removed.
* http/wpt/cache-storage/cache-put-stream.https.any.worker.html: Removed.
* platform/mac-wk1/imported/w3c/web-platform-tests/fetch/api/request/request-init-stream.any-expected.txt: Removed.
* platform/mac-wk2/TestExpectations:

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

4 months agoSupport RTCRtpSender.dtmf
youenn@apple.com [Tue, 6 Aug 2019 00:34:14 +0000 (00:34 +0000)]
Support RTCRtpSender.dtmf
https://bugs.webkit.org/show_bug.cgi?id=200431

Reviewed by Eric Carlson.

LayoutTests/imported/w3c:

* web-platform-tests/webrtc/RTCDTMFSender-insertDTMF.https-expected.txt:
* web-platform-tests/webrtc/RTCDTMFSender-ontonechange-long.https-expected.txt:
* web-platform-tests/webrtc/RTCDTMFSender-ontonechange.https-expected.txt:

Source/WebCore:

Add a new backend interface to RTCDTMFSender and implementation of it using libwebrtc.
Update RTCDTMFSender to use that new backend and make RTCRtpSender return a RTCDTMFSender
conditionally on a newly added runtime flag.
Update RTCDTMFSender implementation based on https://w3c.github.io/webrtc-pc/#peer-to-peer-dtmf.

Covered by rebased tests.

* Modules/mediastream/PeerConnectionBackend.cpp:
(WebCore::PeerConnectionBackend::context const):
(WebCore::PeerConnectionBackend::transceiverFromSender):
* Modules/mediastream/PeerConnectionBackend.h:
* Modules/mediastream/RTCDTMFSender.cpp:
(WebCore::RTCDTMFSender::RTCDTMFSender):
(WebCore::RTCDTMFSender::canInsertDTMF const):
(WebCore::RTCDTMFSender::toneBuffer const):
(WebCore::isToneCharacterInvalid):
(WebCore::RTCDTMFSender::insertDTMF):
(WebCore::RTCDTMFSender::playNextTone):
(WebCore::RTCDTMFSender::onTonePlayed):
(WebCore::RTCDTMFSender::toneTimerFired):
(WebCore::RTCDTMFSender::stop):
(WebCore::RTCDTMFSender::activeDOMObjectName const):
(WebCore::RTCDTMFSender::canSuspendForDocumentSuspension const):
* Modules/mediastream/RTCDTMFSender.h:
* Modules/mediastream/RTCDTMFSender.idl:
* Modules/mediastream/RTCDTMFToneChangeEvent.cpp:
* Modules/mediastream/RTCDTMFToneChangeEvent.h:
* Modules/mediastream/RTCDTMFToneChangeEvent.idl:
* Modules/mediastream/RTCRtpSender.cpp:
(WebCore::RTCRtpSender::dtmf):
(WebCore::RTCRtpSender::currentTransceiverDirection const):
* Modules/mediastream/RTCRtpSender.h:
* Modules/mediastream/RTCRtpSender.idl:
* Modules/mediastream/RTCRtpSenderBackend.h:
* Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp:
(WebCore::LibWebRTCRtpSenderBackend::createDTMFBackend):
* Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* dom/EventNames.in:
* dom/EventTargetFactory.in:
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::webRTCDTMFEnabled const):
(WebCore::RuntimeEnabledFeatures::setWebRTCDTMFEnabled):
* platform/mediastream/RTCDTMFSenderBackend.h: Added.
* platform/mediastream/RTCDTMFSenderHandler.h: Removed.
* platform/mediastream/RTCDTMFSenderHandlerClient.h: Removed.
* platform/mediastream/libwebrtc/LibWebRTCDTMFSenderBackend.cpp: Added.
(WebCore::toWTFString):
(WebCore::LibWebRTCDTMFSenderBackend::LibWebRTCDTMFSenderBackend):
(WebCore::LibWebRTCDTMFSenderBackend::~LibWebRTCDTMFSenderBackend):
(WebCore::LibWebRTCDTMFSenderBackend::canInsertDTMF):
(WebCore::LibWebRTCDTMFSenderBackend::playTone):
(WebCore::LibWebRTCDTMFSenderBackend::tones const):
(WebCore::LibWebRTCDTMFSenderBackend::duration const):
(WebCore::LibWebRTCDTMFSenderBackend::interToneGap const):
(WebCore::LibWebRTCDTMFSenderBackend::OnToneChange):
(WebCore::LibWebRTCDTMFSenderBackend::onTonePlayed):
* platform/mediastream/libwebrtc/LibWebRTCDTMFSenderBackend.h: Added.

Source/WebKit:

* Shared/WebPreferences.yaml:

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

4 months agoiOS 13: Overflow:hidden on body prevents PDF scroll
simon.fraser@apple.com [Tue, 6 Aug 2019 00:31:57 +0000 (00:31 +0000)]
iOS 13: Overflow:hidden on body prevents PDF scroll
https://bugs.webkit.org/show_bug.cgi?id=200435
rdar://problem/53942888

Reviewed by Tim Horton.
Source/WebKit:

When we navigate from an overflow:hidden HTML page to a custom view (like PDF), we need
to make sure that the scroll view is scrollable.

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

Tools:

When we navigate from an overflow:hidden HTML page to a custom view (like PDF), we need
to make sure that the scroll view is scrollable.

* TestWebKitAPI/Tests/ios/ScrollViewScrollabilityTests.mm:
(TestWebKitAPI::TEST):

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

4 months ago[WHLSL] Inline all native function calls
sbarati@apple.com [Tue, 6 Aug 2019 00:03:34 +0000 (00:03 +0000)]
[WHLSL] Inline all native function calls
https://bugs.webkit.org/show_bug.cgi?id=200350

Reviewed by Robin Morisset.

Native functions calls tend to be really small. If we inline in the generated
Metal code, we end up with faster Metal compile times. On compute_boids, this
provides a ~10ms improvement.

* Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp:
(WebCore::WHLSL::Metal::FunctionDefinitionWriter::visit):
(WebCore::WHLSL::Metal::sharedMetalFunctions):
* Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.cpp:
(WebCore::WHLSL::Metal::inlineNativeFunction):
(WebCore::WHLSL::Metal::writeNativeFunction): Deleted.
* Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.h:

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

4 months agoWeb Inspector: Styles: variable swatch not shown for var() with a fallback
drousso@apple.com [Mon, 5 Aug 2019 23:40:40 +0000 (23:40 +0000)]
Web Inspector: Styles: variable swatch not shown for var() with a fallback
https://bugs.webkit.org/show_bug.cgi?id=200237

Reviewed by Joseph Pecoraro.

Source/WebInspectorUI:

* UserInterface/Views/SpreadsheetStyleProperty.js:
(WI.SpreadsheetStyleProperty.prototype._createInlineSwatch):
(WI.SpreadsheetStyleProperty.prototype._replaceSpecialTokens): Added.
(WI.SpreadsheetStyleProperty.prototype._addGradientTokens):
(WI.SpreadsheetStyleProperty.prototype._addColorTokens):
(WI.SpreadsheetStyleProperty.prototype._addTimingFunctionTokens):
(WI.SpreadsheetStyleProperty.prototype._addVariableTokens):
Check to see if there's a fallback value in the `var()` and tokenize it if there is. Mark
the property as invalid if the `var()` doesn't end up resolving to anything.

* UserInterface/Views/InlineSwatch.js:
(WI.InlineSwatch):
(WI.InlineSwatch.prototype.get value):
(WI.InlineSwatch.prototype._updateSwatch):
(WI.InlineSwatch.prototype._handleContextMenuEvent):
(WI.InlineSwatch.prototype._getNextValidHEXFormat.hexMatchesCurrentColor):
(WI.InlineSwatch.prototype._getNextValidHEXFormat):
Allow the `value` to be a function. In that case, use the getter `this.value` instead of the
value `this._value` directly so that the function is invoked.
This is needed for variable swatches because the fallback value could change after the
swatch has been created (e.g. another swatch in a CSS property value that just modifies the
text, rather than re-renders the entire CSS property value).

* UserInterface/Models/CSSStyleDeclaration.js:
(WI.CSSStyleDeclaration.prototype.resolveVariableValue): Added.
Follow the variable chain until an ultimate value is reached.

* UserInterface/Models/CSSKeywordCompletions.js:
(WI.CSSKeywordCompletions.isColorAwareProperty):
(WI.CSSKeywordCompletions.isTimingFunctionAwareProperty): Added.
Limit `cubic-bezier` and `spring` tokens to only be shown for timing function properties.

LayoutTests:

* inspector/css/resolve-variable-value.html: Added.
* inspector/css/resolve-variable-value-expected.txt: Added.

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

4 months agoRealtimeOutgoingAudioSource::pullAudioData is no longer needed
youenn@apple.com [Mon, 5 Aug 2019 23:25:45 +0000 (23:25 +0000)]
RealtimeOutgoingAudioSource::pullAudioData is no longer needed
https://bugs.webkit.org/show_bug.cgi?id=200450

Reviewed by Geoffrey Garen.

No change of behavior, removing base class method declaration.

* platform/mediastream/RealtimeOutgoingAudioSource.h:
(WebCore::RealtimeOutgoingAudioSource::pullAudioData): Deleted.
* platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.h:
* platform/mediastream/mac/RealtimeOutgoingAudioSourceCocoa.h:

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

4 months ago[WHLSL] Add compile time flag to dump metal compile times
sbarati@apple.com [Mon, 5 Aug 2019 23:17:48 +0000 (23:17 +0000)]
[WHLSL] Add compile time flag to dump metal compile times
https://bugs.webkit.org/show_bug.cgi?id=200447

Reviewed by Myles C. Maxfield.

* Modules/webgpu/WHLSL/WHLSLPrepare.h:
* platform/graphics/gpu/cocoa/GPUComputePipelineMetal.mm:
(WebCore::trySetFunctions):
* platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
(WebCore::trySetFunctions):

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

4 months agonavigator.geolocation wrapper should not become GC-collectable once its frame is...
cdumez@apple.com [Mon, 5 Aug 2019 23:00:26 +0000 (23:00 +0000)]
navigator.geolocation wrapper should not become GC-collectable once its frame is detached
https://bugs.webkit.org/show_bug.cgi?id=200436

Reviewed by Darin Adler.

Source/WebCore:

navigator.geolocation wrapper should not become GC-collectable once its frame is detached, given
that it can outlive the frame. Instead, tie the navigator.geolocation wrapper's lifetime to its
Navigator's.

Test: fast/dom/navigator-property-gc-after-frame-detach.html

* Modules/geolocation/Geolocation.cpp:
(WebCore::Geolocation::create):
(WebCore::Geolocation::Geolocation):
(WebCore::Geolocation::navigator):
(WebCore::Geolocation::frame const):
* Modules/geolocation/Geolocation.h:
* Modules/geolocation/Geolocation.idl:
* Modules/geolocation/NavigatorGeolocation.cpp:
(WebCore::NavigatorGeolocation::NavigatorGeolocation):
(WebCore::NavigatorGeolocation::from):
(WebCore::NavigatorGeolocation::geolocation):
(WebCore::NavigatorGeolocation::geolocation const):
* Modules/geolocation/NavigatorGeolocation.h:
* bindings/js/JSNavigatorCustom.cpp:
(WebCore::JSNavigator::visitAdditionalChildren):
* bindings/js/JSWorkerNavigatorCustom.cpp:
(WebCore::JSWorkerNavigator::visitAdditionalChildren):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
* bindings/scripts/IDLAttributes.json:
* page/Navigator.cpp:
(WebCore::Navigator::plugins):
(WebCore::Navigator::mimeTypes):
* page/NavigatorBase.h:
* plugins/DOMMimeTypeArray.cpp:
(WebCore::DOMMimeTypeArray::DOMMimeTypeArray):
* plugins/DOMMimeTypeArray.h:
* plugins/DOMMimeTypeArray.idl:
* plugins/DOMPluginArray.cpp:
(WebCore::DOMPluginArray::DOMPluginArray):
* plugins/DOMPluginArray.h:
* plugins/DOMPluginArray.idl:
* workers/service/ServiceWorkerContainer.h:
* workers/service/ServiceWorkerContainer.idl:

LayoutTests:

Add layout test coverage.

* fast/dom/navigator-property-gc-after-frame-detach-expected.txt: Added.
* fast/dom/navigator-property-gc-after-frame-detach.html: Added.

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

4 months ago[WebIDL] Support partial dictionaries and conditional dictionary members
aestes@apple.com [Mon, 5 Aug 2019 22:52:17 +0000 (22:52 +0000)]
[WebIDL] Support partial dictionaries and conditional dictionary members
https://bugs.webkit.org/show_bug.cgi?id=200441

Reviewed by Alex Christensen.

Added new bindings tests.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateDictionaryImplementationContent):
* bindings/scripts/IDLParser.pm:
(parsePartialDefinition):
(parsePartialInterface): Deleted.
(parsePartialDictionary): Deleted.
* bindings/scripts/generate-bindings.pl:
(generateBindings):
* bindings/scripts/preprocess-idls.pl:
(getPartialNamesFromIDL):
(getPartialInterfaceNameFromIDL): Deleted.
* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
(WebCore::convertDictionary<TestEventConstructor::Init>):
* bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
(WebCore::convertDictionary<DictionaryImplName>):
(WebCore::convertDictionaryToJS):
* bindings/scripts/test/JS/JSTestStandaloneDictionary.h:
* bindings/scripts/test/TestStandaloneDictionary.idl:
* bindings/scripts/test/TestSupplemental.idl:

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

4 months agoWeb Inspector: rename "Stylesheet" to "Style Sheet" to match spec text
drousso@apple.com [Mon, 5 Aug 2019 22:44:10 +0000 (22:44 +0000)]
Web Inspector: rename "Stylesheet" to "Style Sheet" to match spec text
https://bugs.webkit.org/show_bug.cgi?id=200422

Reviewed by Joseph Pecoraro.

Source/JavaScriptCore:

* inspector/protocol/Page.json:

Source/WebCore:

No observable change in functionality.

* inspector/agents/InspectorPageAgent.h:
* inspector/agents/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::resourceTypeJSON):
(WebCore::InspectorPageAgent::inspectorResourceType):

Source/WebInspectorUI:

* Localizations/en.lproj/localizedStrings.js:

* UserInterface/Controllers/CSSManager.js:
(WI.CSSManager.prototype._resourceAdded):
(WI.CSSManager.prototype._resourceTypeDidChange):
(WI.CSSManager.prototype._clearStyleSheetsForResource):
(WI.CSSManager.prototype._updateResourceContent.fetchedStyleSheetContent):
* UserInterface/Models/CSSStyleSheet.js:
(WI.CSSStyleSheet.prototype.get displayName):
* UserInterface/Models/CollectionTypes.js:
(WI.CSSStyleSheetCollection.prototype.get displayName):
* UserInterface/Models/Resource.js:
(WI.Resource.displayNameForType):
(WI.Resource.prototype.get syntheticMIMEType):
* UserInterface/Models/ResourceCollection.js:
(WI.ResourceCollection.prototype.objectIsRequiredType):
* UserInterface/Views/NetworkTableContentView.js:
(WI.NetworkTableContentView):
(WI.NetworkTableContentView.shortDisplayNameForResourceType):
* UserInterface/Views/ResourceClusterContentView.js:
(WI.ResourceClusterContentView.prototype._contentViewForResourceType):
* UserInterface/Views/ResourceSidebarPanel.js:
(WI.ResourceSidebarPanel.prototype.matchTreeElementAgainstCustomFilters.match):
* UserInterface/Views/SourcesNavigationSidebarPanel.js:
(WI.SourcesNavigationSidebarPanel.prototype.matchTreeElementAgainstCustomFilters.match):
* UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
(WI.SpreadsheetCSSStyleDeclarationSection.prototype._save):
(WI.SpreadsheetCSSStyleDeclarationSection.prototype._populateIconElementContextMenu):
* UserInterface/Views/StyleOriginView.js:
(WI.StyleOriginView.prototype.update):
* UserInterface/Views/TextResourceContentView.js:
(WI.TextResourceContentView.prototype._shouldBeEditable):

* UserInterface/Views/CSSStyleSheetTreeElement.js:
(WI.CSSStyleSheetTreeElement):
* UserInterface/Views/ResourceIcons.css:
(:matches(.resource-icon.resource-type-style-sheet, .style-sheet-icon) .icon): Added.
(.source-map-resource.resource-icon.resource-type-style-sheet .icon): Added.
(.large :matches(.resource-icon.resource-type-style-sheet, .style-sheet-icon) .icon): Added.
(.large .source-map-resource.resource-icon.resource-type-style-sheet .icon): Added.
(:matches(.resource-icon.resource-type-stylesheet, .stylesheet-icon) .icon): Deleted.
(.source-map-resource.resource-icon.resource-type-stylesheet .icon): Deleted.
(.large :matches(.resource-icon.resource-type-stylesheet, .stylesheet-icon) .icon): Deleted.
(.large .source-map-resource.resource-icon.resource-type-stylesheet .icon): Deleted.

LayoutTests:

* inspector/unit-tests/resource-collection.html:
* http/tests/inspector/network/resource-mime-type.html:
* http/tests/inspector/network/resource-mime-type-expected.txt:

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

4 months agoResource Load Statistics: Re-introduce latch mode for subresource cookie blocking
wilander@apple.com [Mon, 5 Aug 2019 21:33:51 +0000 (21:33 +0000)]
Resource Load Statistics: Re-introduce latch mode for subresource cookie blocking
https://bugs.webkit.org/show_bug.cgi?id=200395
<rdar://problem/53869611>

Reviewed by Darin Adler.

Back when we had a relaxation of cookie blocking 24 hours after first-party user
interaction, we made sure cookie blocking could be turned on and off in subresource
redirect chains. The 24 hour window is now long gone. This patch simplifies the
cookie blocking so that once a subresource request is denied cookies, any
subsequent redirect of that request will also be denied cookies, regardless of the
classification status of the domains involved. I call it latch mode.

Source/WebKit:

* NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTaskCocoa::blockCookies):
(WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
(WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
(WebKit::NetworkDataTaskCocoa::applyCookieBlockingPolicy): Deleted.

LayoutTests:

* http/tests/resourceLoadStatistics/do-not-remove-blocking-in-redirect-expected.txt: Renamed from LayoutTests/http/tests/resourceLoadStatistics/remove-blocking-in-redirect-expected.txt.
* http/tests/resourceLoadStatistics/do-not-remove-blocking-in-redirect.html: Renamed from LayoutTests/http/tests/resourceLoadStatistics/remove-blocking-in-redirect.html.
    Changed to expect no removal of blocking in the redirect and renamed accordingly.
* platform/ios/TestExpectations:
    Renamed.
* platform/mac-wk2/TestExpectations:
    Renamed.
* platform/wk2/TestExpectations:
    Renamed.

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

4 months agoNew EWS:mac-wk2 status-bubble shows waiting to run tests for all recent bugs
aakash_jain@apple.com [Mon, 5 Aug 2019 21:24:52 +0000 (21:24 +0000)]
New EWS:mac-wk2 status-bubble shows waiting to run tests for all recent bugs
https://bugs.webkit.org/show_bug.cgi?id=200400

Reviewed by Jonathan Bedard.

* BuildSlaveSupport/ews-app/ews/views/statusbubble.py:
(StatusBubble._build_bubble):
(StatusBubble._queue_position):

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

4 months agoJSC: assertion failure in SpeculativeJIT::compileGetByValOnIntTypedArray
msaboff@apple.com [Mon, 5 Aug 2019 20:02:51 +0000 (20:02 +0000)]
JSC: assertion failure in SpeculativeJIT::compileGetByValOnIntTypedArray
https://bugs.webkit.org/show_bug.cgi?id=199997

Reviewed by Saam Barati.

JSTests:

New test.

* stress/typedarray-no-alreadyChecked-assert.js: Added.
(checkIntArray):
(checkFloatArray):

Source/JavaScriptCore:

No need to ASSERT(node->arrayMode().alreadyChecked(...)) in SpeculativeJIT::compileGetByValOnIntTypedArray()
and compileGetByValOnFloatTypedArray() as the abstract interpreter is conservative and can insert a
CheckStructureOrEmpty which will fail the ASSERT as it checks for the SpecType of the array
and not for SpecEmpty.  If we added a check for the SpecEmpty in the ASSERT, there are cases where
it won't be set.

* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileGetByValOnIntTypedArray):
(JSC::DFG::SpeculativeJIT::compileGetByValOnFloatTypedArray):

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

4 months agorun-webkit-tests asserts when the iPhone XR simulator is running
jbedard@apple.com [Mon, 5 Aug 2019 16:42:24 +0000 (16:42 +0000)]
run-webkit-tests asserts when the iPhone XR simulator is running
https://bugs.webkit.org/show_bug.cgi?id=200404
<rdar://problem/53878739>

Reviewed by Dean Jackson.

Support unicode in all logging statements tied to device model.

* Scripts/webkitpy/layout_tests/controllers/manager.py:
(Manager.run):
* Scripts/webkitpy/layout_tests/views/printing.py:
(Printer.print_baseline_search_path):
* Scripts/webkitpy/port/device.py:
(Device.__repr__):
* Scripts/webkitpy/port/device_port.py:
(DevicePort._install):
(DevicePort.setup_test_run):
(DevicePort.clean_up_test_run):
(DevicePort.configuration_for_upload):
* Scripts/webkitpy/port/ios.py:
(IOSPort.default_baseline_search_path):
* Scripts/webkitpy/xcode/device_type.py:
(DeviceType.__str__):
* Scripts/webkitpy/xcode/simulated_device.py:
(SimulatedDeviceManager.populate_available_devices):
(SimulatedDeviceManager._find_available_name):
(SimulatedDeviceManager._get_device_identifier_for_type):
(SimulatedDeviceManager._create_or_find_device_for_request):
(SimulatedDeviceManager._does_fulfill_request):
(SimulatedDeviceManager._wait_until_device_in_state):
(SimulatedDeviceManager._wait_until_device_is_usable):
(SimulatedDeviceManager._boot_device):
(SimulatedDeviceManager.initialize_devices):
(SimulatedDeviceManager.max_supported_simulators):
(SimulatedDeviceManager.swap):
(SimulatedDevice.is_usable):
(SimulatedDevice._shut_down):
(SimulatedDevice._delete):
(SimulatedDevice.launch_app):
(SimulatedDevice.__repr__):

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