WebKit-https.git
6 months agoAllow failures in flaky tests from bug 193657
commit-queue@webkit.org [Wed, 23 Jan 2019 22:15:54 +0000 (22:15 +0000)]
Allow failures in flaky tests from bug 193657
https://bugs.webkit.org/show_bug.cgi?id=193736

Unreviewed test gardening.

Patch by Oriol Brufau <obrufau@igalia.com> on 2019-01-23

* TestExpectations:

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

6 months ago[ews-app] Rename ews model buildermappings to buildermapping
aakash_jain@apple.com [Wed, 23 Jan 2019 21:58:47 +0000 (21:58 +0000)]
[ews-app] Rename ews model buildermappings to buildermapping
https://bugs.webkit.org/show_bug.cgi?id=193729

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-app/ews/models/buildermapping.py: Renamed from Tools/BuildSlaveSupport/ews-app/ews/models/buildermappings.py.
(BuilderMapping): Renamed BuildMappings to BuilderMapping.
* BuildSlaveSupport/ews-app/ews/models/__init__.py: Ditto.

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

6 months agoSwitch NetworkStorageSession portions of ResourceLoadStatistics to Async message...
bfulgham@apple.com [Wed, 23 Jan 2019 21:55:47 +0000 (21:55 +0000)]
Switch NetworkStorageSession portions of ResourceLoadStatistics to Async message passing style
https://bugs.webkit.org/show_bug.cgi?id=193659
<rdar://problem/47433290>

Reviewed by Alex Christensen.

Change the implementations of ResourceLoadStatistics code in NetworkStorageSession to use the
'sendWithAsyncReply' so that more of the code is autogenerated. This should make test runs more
consistent, and should reduce the possibility of bookkeeping errors in the message handling
implementations.

Fix the implementation of NetworkProcessProxy::clearCallbackStates to remove the manually constructed
(and incomplete) message callbacks. These errors are a big reason to move to the auto-generated
'sendWithAsyncReply' implementatoin. Ditto for NetworkProcessProxy::didClose.

This patch also moves an initializaton call (WebsiteDataStore::didCreateNetworkProcess) from
'ensureNetworkProcess' to 'processDidFinishLaunching'. In current code, the call happens before
a connection is established to the network process, causing initialization messages to get dropped
leading to test system flakiness.

Finally: The WK API test code was updated to ensure that completion handlers are always called, even
when built without ENABLE_RESOURCE_LOAD_STATISTICS defined.

* NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
* NetworkProcess/Classifier/ShouldGrandfatherStatistics.h: Added.
* NetworkProcess/Classifier/StorageAccessStatus.h: Added.
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::updatePrevalentDomainsToBlockCookiesFor):
(WebKit::NetworkProcess::setAgeCapForClientSideCookies):
(WebKit::NetworkProcess::scheduleClearInMemoryAndPersistent):
(WebKit::NetworkProcess::hasStorageAccessForFrame):
(WebKit::NetworkProcess::requestStorageAccess):
(WebKit::NetworkProcess::grantStorageAccess):
(WebKit::NetworkProcess::removeAllStorageAccess):
(WebKit::NetworkProcess::setCacheMaxAgeCapForPrevalentResources):
(WebKit::NetworkProcess::resetCacheMaxAgeCapForPrevalentResources):
(WebKit::NetworkProcess::deleteWebsiteData):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStore):
(WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours):
(WKWebsiteDataStoreStatisticsResetToConsistentState):
* UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::clearCallbackStates): Remove incomplete clean-up code that
is now autogenerated.
(WebKit::NetworkProcessProxy::didClose): Ditto.
(WebKit::NetworkProcessProxy::updatePrevalentDomainsToBlockCookiesFor):
(WebKit::NetworkProcessProxy::scheduleClearInMemoryAndPersistent):
(WebKit::NetworkProcessProxy::setAgeCapForClientSideCookies):
(WebKit::NetworkProcessProxy::hasStorageAccessForFrame):
(WebKit::NetworkProcessProxy::requestStorageAccess):
(WebKit::NetworkProcessProxy::grantStorageAccess):
(WebKit::NetworkProcessProxy::removeAllStorageAccess):
(WebKit::NetworkProcessProxy::setCacheMaxAgeCapForPrevalentResources):
(WebKit::NetworkProcessProxy::setCacheMaxAgeCap):
(WebKit::NetworkProcessProxy::resetCacheMaxAgeCapForPrevalentResources):
(WebKit::NetworkProcessProxy::didUpdateBlockCookies): Deleted.
(WebKit::NetworkProcessProxy::didSetAgeCapForClientSideCookies): Deleted.
(WebKit::NetworkProcessProxy::didUpdateRuntimeSettings): Deleted.
(WebKit::NetworkProcessProxy::storageAccessRequestResult): Deleted.
(WebKit::NetworkProcessProxy::storageAccessOperationResult): Deleted.
(WebKit::NetworkProcessProxy::didRemoveAllStorageAccess): Deleted.
(WebKit::NetworkProcessProxy::didSetCacheMaxAgeCapForPrevalentResources): Deleted.
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/Network/NetworkProcessProxy.messages.in:
* UIProcess/WebPageProxy.cpp:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::ensureNetworkProcess): Move WebsiteDataStore 'didCreateNetworkProcess'
to 'processDidFinishLaunching'. Currently the call happens before a connection is established,
causing initialization messages to get dropped.
(WebKit::WebProcessPool::processDidFinishLaunching): Ditto.
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::removeData):
(WebKit::WebsiteDataStore::setMaxStatisticsEntries):
(WebKit::WebsiteDataStore::setPruneEntriesDownTo):
(WebKit::WebsiteDataStore::setGrandfatheringTime):
(WebKit::WebsiteDataStore::setCacheMaxAgeCap):
(WebKit::WebsiteDataStore::setMinimumTimeBetweenDataRecordsRemoval):
(WebKit::WebsiteDataStore::setPrevalentResource):
(WebKit::WebsiteDataStore::setShouldClassifyResourcesBeforeDataRecordsRemoval):
(WebKit::WebsiteDataStore::scheduleClearInMemoryAndPersistent):
(WebKit::WebsiteDataStore::setAgeCapForClientSideCookies):
(WebKit::WebsiteDataStore::setNotifyPagesWhenDataRecordsWereScanned):
(WebKit::WebsiteDataStore::setNotifyPagesWhenTelemetryWasCaptured):
(WebKit::WebsiteDataStore::setTimeToLiveUserInteraction):
(WebKit::WebsiteDataStore::setCacheMaxAgeCapForPrevalentResources):
(WebKit::WebsiteDataStore::setResourceLoadStatisticsDebugMode):
* UIProcess/WebsiteData/WebsiteDataStore.h:
* WebKit.xcodeproj/project.pbxproj:

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

6 months ago[ews-app] Rename ews model steps to step
aakash_jain@apple.com [Wed, 23 Jan 2019 21:52:34 +0000 (21:52 +0000)]
[ews-app] Rename ews model steps to step
https://bugs.webkit.org/show_bug.cgi?id=193697

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-app/ews/models/step.py: Renamed from Tools/BuildSlaveSupport/ews-app/ews/models/steps.py.
(Step): Renamed Steps to Step.

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

6 months agoClean up IndexedDB files between tests
sihui_liu@apple.com [Wed, 23 Jan 2019 21:39:19 +0000 (21:39 +0000)]
Clean up IndexedDB files between tests
https://bugs.webkit.org/show_bug.cgi?id=192796
<rdar://problem/46824999>

Reviewed by Geoffrey Garen.

Source/WebCore:

We should clean up the IndexedDB files between tests to make sure each IDB test is independent of others.

* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore):
(WebCore::IDBServer::UniqueIDBDatabase::transactionCompleted):

Source/WebKit:

* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreRemoveAllIndexedDatabases):
* UIProcess/API/C/WKWebsiteDataStoreRef.h:

Tools:

* DumpRenderTree/mac/DumpRenderTree.mm:
(runTest):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetStateToConsistentValues):
(WTR::RemoveAllIndexedDatabasesCallbackContext::RemoveAllIndexedDatabasesCallbackContext):
(WTR::RemoveAllIndexedDatabasesCallback):
(WTR::TestController::ClearIndexedDatabases):
* WebKitTestRunner/TestController.h:
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle):

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

6 months ago[ews-app] Rename ews model Builds to Build
aakash_jain@apple.com [Wed, 23 Jan 2019 21:37:30 +0000 (21:37 +0000)]
[ews-app] Rename ews model Builds to Build
https://bugs.webkit.org/show_bug.cgi?id=193695

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-app/ews/models/build.py: Renamed from Tools/BuildSlaveSupport/ews-app/ews/models/builds.py.
(Build): Renamed Builds to Build.

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

6 months agowebkitpy: Wait longer when launching WebKitTestRunner
jbedard@apple.com [Wed, 23 Jan 2019 21:28:35 +0000 (21:28 +0000)]
webkitpy: Wait longer when launching WebKitTestRunner
https://bugs.webkit.org/show_bug.cgi?id=193734

Reviewed by Aakash Jain.

* Scripts/webkitpy/port/simulator_process.py:
(SimulatorProcess._start): Increase timeout from 6 seconds to 15 seconds.

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

6 months agoUnreviewed; Revert "Clean up USE(WEB_THREAD)"
conrad_shultz@apple.com [Wed, 23 Jan 2019 21:03:32 +0000 (21:03 +0000)]
Unreviewed; Revert "Clean up USE(WEB_THREAD)"

This reverts commit 24ba8bb9e1dad8679b492d9a2d47da619be85789.
https://bugs.webkit.org/show_bug.cgi?id=193698

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

6 months agoAdd CSS Logical spec to features.json
commit-queue@webkit.org [Wed, 23 Jan 2019 20:54:30 +0000 (20:54 +0000)]
Add CSS Logical spec to features.json
https://bugs.webkit.org/show_bug.cgi?id=193717

Patch by Oriol Brufau <obrufau@igalia.com> on 2019-01-23
Reviewed by Manuel Rego Casasnovas.

* features.json:

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

6 months agoClean up USE(WEB_THREAD)
conrad_shultz@apple.com [Wed, 23 Jan 2019 20:36:37 +0000 (20:36 +0000)]
Clean up USE(WEB_THREAD)
https://bugs.webkit.org/show_bug.cgi?id=193698

Rubber-stamped by Tim Horton.

WebCore:

    * page/CaptionUserPreferencesMediaAF.cpp:
    (WebCore::userCaptionPreferencesChangedNotificationCallback):
    * platform/cf/MainThreadSharedTimerCF.cpp:
    (WebCore::applicationDidBecomeActive):
    * platform/cocoa/ContentFilterUnblockHandlerCocoa.mm:
    (WebCore::dispatchToMainThread):
    * platform/graphics/cocoa/TextTrackRepresentationCocoa.mm:
    (-[WebCoreTextTrackRepresentationCocoaHelper observeValueForKeyPath:ofObject:change:context:]):
    * platform/ios/LegacyTileCache.mm:
    (WebCore::LegacyTileCache::layoutTiles):
    (WebCore::LegacyTileCache::setTilingMode):
    * platform/ios/WebCoreMotionManager.mm:
    (-[WebCoreMotionManager sendAccelerometerData:]):
    (-[WebCoreMotionManager sendMotionData:withHeading:]):
    * platform/ios/WebVideoFullscreenControllerAVKit.mm:
    (VideoFullscreenControllerContext::requestUpdateInlineRect):
    (VideoFullscreenControllerContext::requestVideoContentLayer):
    (VideoFullscreenControllerContext::returnVideoContentLayer):
    (VideoFullscreenControllerContext::didSetupFullscreen):
    (VideoFullscreenControllerContext::willExitFullscreen):
    (VideoFullscreenControllerContext::didExitFullscreen):
    (VideoFullscreenControllerContext::didCleanupFullscreen):
    (VideoFullscreenControllerContext::fullscreenMayReturnToInline):
    (VideoFullscreenControllerContext::requestFullscreenMode):
    (VideoFullscreenControllerContext::setVideoLayerFrame):
    (VideoFullscreenControllerContext::setVideoLayerGravity):
    (VideoFullscreenControllerContext::fullscreenModeChanged):
    (VideoFullscreenControllerContext::play):
    (VideoFullscreenControllerContext::pause):
    (VideoFullscreenControllerContext::togglePlayState):
    (VideoFullscreenControllerContext::toggleMuted):
    (VideoFullscreenControllerContext::setMuted):
    (VideoFullscreenControllerContext::setVolume):
    (VideoFullscreenControllerContext::setPlayingOnSecondScreen):
    (VideoFullscreenControllerContext::beginScrubbing):
    (VideoFullscreenControllerContext::endScrubbing):
    (VideoFullscreenControllerContext::seekToTime):
    (VideoFullscreenControllerContext::fastSeek):
    (VideoFullscreenControllerContext::beginScanningForward):
    (VideoFullscreenControllerContext::beginScanningBackward):
    (VideoFullscreenControllerContext::endScanning):
    (VideoFullscreenControllerContext::selectAudioMediaOption):
    (VideoFullscreenControllerContext::selectLegibleMediaOption):
    (VideoFullscreenControllerContext::duration const):
    (VideoFullscreenControllerContext::currentTime const):
    (VideoFullscreenControllerContext::bufferedTime const):
    (VideoFullscreenControllerContext::isPlaying const):
    (VideoFullscreenControllerContext::playbackRate const):
    (VideoFullscreenControllerContext::seekableRanges const):
    (VideoFullscreenControllerContext::seekableTimeRangesLastModifiedTime const):
    (VideoFullscreenControllerContext::liveUpdateInterval const):
    (VideoFullscreenControllerContext::canPlayFastReverse const):
    (VideoFullscreenControllerContext::audioMediaSelectionOptions const):
    (VideoFullscreenControllerContext::audioMediaSelectedIndex const):
    (VideoFullscreenControllerContext::legibleMediaSelectionOptions const):
    (VideoFullscreenControllerContext::legibleMediaSelectedIndex const):
    (VideoFullscreenControllerContext::externalPlaybackEnabled const):
    (VideoFullscreenControllerContext::externalPlaybackTargetType const):
    (VideoFullscreenControllerContext::externalPlaybackLocalizedDeviceName const):
    (VideoFullscreenControllerContext::wirelessVideoPlaybackDisabled const):
    (VideoFullscreenControllerContext::setUpFullscreen):
    (VideoFullscreenControllerContext::exitFullscreen):
    (VideoFullscreenControllerContext::requestHideAndExitFullscreen):
    (-[WebVideoFullscreenController enterFullscreen:mode:]):
    (-[WebVideoFullscreenController exitFullscreen]):
    (-[WebVideoFullscreenController requestHideAndExitFullscreen]):
    * platform/ios/wak/WAKWindow.mm:
    (-[WAKWindow setVisible:]):
    (-[WAKWindow setScreenScale:]):
    (-[WAKWindow sendEvent:]):
    (-[WAKWindow sendMouseMoveEvent:contentChange:]):
    * platform/network/ios/NetworkStateNotifierIOS.mm:
    (WebCore::NetworkStateNotifier::startObserving):
    * rendering/RenderThemeIOS.mm:
    (WebCore::contentSizeCategoryDidChange):

WebKitLegacy:

    * Misc/WebGeolocationProviderIOS.mm:
    (-[_WebCoreLocationUpdateThreadingProxy geolocationAuthorizationGranted]):
    (-[_WebCoreLocationUpdateThreadingProxy geolocationAuthorizationDenied]):
    (-[_WebCoreLocationUpdateThreadingProxy positionChanged:]):
    (-[_WebCoreLocationUpdateThreadingProxy errorOccurred:]):
    (-[_WebCoreLocationUpdateThreadingProxy resetGeolocation]):
    * WebCoreSupport/WebFixedPositionContent.mm:
    (-[WebFixedPositionContent didFinishScrollingOrZooming]):
    * Misc/WebCache.mm:
    (+[WebCache emptyInMemoryResources]):
    * WebCoreSupport/WebFrameLoaderClient.mm:
    (-[WebFramePolicyListener use]):
    * WebCoreSupport/WebGeolocationClient.mm:
    (-[WebGeolocationPolicyListener allow]):
    (-[WebGeolocationPolicyListener deny]):
    (-[WebGeolocationPolicyListener denyOnlyThisRequest]):
    * WebView/WebFrame.mm:
    (-[WebFrame deviceOrientationChanged]):
    * WebView/WebHTMLView.mm:
    (hardwareKeyboardAvailabilityChangedCallback):
    * WebView/WebView.mm:
    (+[WebView _releaseMemoryNow]):
    (+[WebView willEnterBackgroundWithCompletionHandler:]):
    (-[WebView updateLayoutIgnorePendingStyleSheets]):
    (-[WebView _dispatchUnloadEvent]):
    (-[WebView _close]):
    (-[WebView _preferencesChangedNotification:]):
    (-[WebView _setCustomFixedPositionLayoutRectInWebThread:synchronize:]):
    (-[WebView goBack]):
    (-[WebView goForward]):
    (+[WebView _cacheModelChangedNotification:]):
    (-[WebView stopLoading:]):
    (-[WebView stopLoadingAndClear]):
    (-[WebView reload:]):
    (WebInstallMemoryPressureHandler):

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

6 months ago[iOS] fast/events/touch/ios/hover-when-style-change-is-async.html times out
wenson_hsieh@apple.com [Wed, 23 Jan 2019 20:09:54 +0000 (20:09 +0000)]
[iOS] fast/events/touch/ios/hover-when-style-change-is-async.html times out
https://bugs.webkit.org/show_bug.cgi?id=193182
<rdar://problem/47452154>

Reviewed by Tim Horton.

Source/WebKit:

Fix an existing bug where blurring an element doesn't always un-suppress text interactions.

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

Tools:

This test was timing out because one of its preceding tests (drag-to-autoscroll-in-single-line-editable.html)
long presses and drags to select text, but does not end the touch by lifting up; subsequently, the tap gesture
recognizer isn't fired when simulating a tap in hover-when-style-change-is-async.html.

To fix this, tweak the test runner to make it safe for tests to end while touching the web view without
preventing later tests from recognizing gestures.

* WebKitTestRunner/ios/TestControllerIOS.mm:
(WTR::TestController::platformResetStateToConsistentValues):

Cancel all touches in the UIApplication when resetting to a consistent state between tests.

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

6 months agoWebInspector: Confusingly nested events in the timeline for Mutation Observers
drousso@apple.com [Wed, 23 Jan 2019 19:29:18 +0000 (19:29 +0000)]
WebInspector: Confusingly nested events in the timeline for Mutation Observers
https://bugs.webkit.org/show_bug.cgi?id=192884
<rdar://problem/46854178>

Reviewed by Joseph Pecoraro.

If a microtask event (e.g. `ObserverCallback`) is contained within a `EvaluatedScript`
event, move that microtask event to be a sibling of the `EvaluateScript`, subtracting the
microtask's time taken from the `EvaluateScript`'s time. If there are no other children
after this move, then remove the `EvaluateScript` altogether.

* UserInterface/Controllers/TimelineManager.js:
(WI.TimelineManager.prototype.eventRecorded.fixMicrotaskPlacement): Added.
(WI.TimelineManager.prototype.eventRecorded):
(WI.TimelineManager.prototype._mergeScriptProfileRecords):

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

6 months agoMinor improvements to NetworkProcess
mcatanzaro@igalia.com [Wed, 23 Jan 2019 19:18:59 +0000 (19:18 +0000)]
Minor improvements to NetworkProcess
https://bugs.webkit.org/show_bug.cgi?id=193708

Reviewed by Alex Christensen.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::switchToNewTestingSession): Fix a spelling error.
(WebKit::NetworkProcess::ensureSession): Add useful assertion.
(WebKit::NetworkProcess::defaultStorageSession const): Split into platform functions.
(WebKit::NetworkProcess::destroySession): Add useful assertion.
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/cocoa/NetworkProcessCocoa.mm:
(WebKit::NetworkProcess::platformCreateDefaultStorageSession const):
* NetworkProcess/curl/NetworkProcessCurl.cpp:
(WebKit::NetworkProcess::platformCreateDefaultStorageSession const):
* NetworkProcess/soup/NetworkProcessSoup.cpp:
(WebKit::NetworkProcess::platformCreateDefaultStorageSession const):

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

6 months agoFix the Apple Internal build. See <rdar://problem/47486758>.
dbates@webkit.org [Wed, 23 Jan 2019 19:14:55 +0000 (19:14 +0000)]
Fix the Apple Internal build. See <rdar://problem/47486758>.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView dropInteraction:previewForDroppingItem:withDefault:]):

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

6 months ago[macOS] Sandbox fails to compile
pvollan@apple.com [Wed, 23 Jan 2019 19:13:44 +0000 (19:13 +0000)]
[macOS] Sandbox fails to compile
https://bugs.webkit.org/show_bug.cgi?id=193727
<rdar://problem/47476903>

Reviewed by Brent Fulgham.

Use '(with send-signal SIGKILL)' instead of '(with termination)'.

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

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

6 months agoWeb Inspector: Network Waterfall column should redraw when adding/removing new columns
commit-queue@webkit.org [Wed, 23 Jan 2019 18:46:56 +0000 (18:46 +0000)]
Web Inspector: Network Waterfall column should redraw when adding/removing new columns
https://bugs.webkit.org/show_bug.cgi?id=193696
<rdar://problem/47464149>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2019-01-23
Reviewed by Devin Rousso.

* UserInterface/Views/TableColumn.js:
(WI.TableColumn.prototype.get needsReloadOnResize):
* UserInterface/Views/NetworkTableContentView.js:
(WI.NetworkTableContentView.prototype.initialLayout):
Mark the waterfall column as sensitive to any resizes.

* UserInterface/Views/Table.js:
(WI.Table.prototype.showColumn):
(WI.Table.prototype.hideColumn):
Update column widths and reload any columns that may be sensitive to resizes.

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

6 months agoREGRESSION (r240243): CrashTracer: WebKitTestRunnerApp at com.apple.WebKit: WebKit...
bfulgham@apple.com [Wed, 23 Jan 2019 18:44:34 +0000 (18:44 +0000)]
REGRESSION (r240243): CrashTracer: WebKitTestRunnerApp at com.apple.WebKit: WebKit::WebResourceLoadStatisticsStore::sendDiagnosticMessageWithValue const + 32
https://bugs.webkit.org/show_bug.cgi?id=193723
<rdar://problem/47476802>

Reviewed by David Kilzer.

The new code added in r240243 could attempt to submit telemetry after the relevant
WebResourceLoadStatisticsStore was destroyed. We should guard against this possibility.

* NetworkProcess/Classifier/WebResourceLoadStatisticsTelemetry.cpp:
(WebKit::WebResourceLoadStatisticsTelemetry::calculateAndSubmit):

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

6 months agoREGRESSION (r240292): Attempt to fix WinCairo build
ddkilzer@apple.com [Wed, 23 Jan 2019 18:39:37 +0000 (18:39 +0000)]
REGRESSION (r240292): Attempt to fix WinCairo build

* platform/network/curl/CurlResourceHandleDelegate.cpp:
(WebCore::handleCookieHeaders): Remove argument to
NetworkingContext::storageSession().

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

6 months agoAX: [GTK] Layout test accessibility/set-selected-editable.html is failing
commit-queue@webkit.org [Wed, 23 Jan 2019 18:00:18 +0000 (18:00 +0000)]
AX: [GTK] Layout test accessibility/set-selected-editable.html is failing
https://bugs.webkit.org/show_bug.cgi?id=193623

Patch by Eric Liang <ericliang@apple.com> on 2019-01-23
Reviewed by Michael Catanzaro.

AXSelected attribute behavior on GTK is different. Skipped.

* platform/gtk/TestExpectations:

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

6 months ago[PSON] Flash on back navigation on Mac
antti@apple.com [Wed, 23 Jan 2019 17:43:02 +0000 (17:43 +0000)]
[PSON] Flash on back navigation on Mac
https://bugs.webkit.org/show_bug.cgi?id=193716
<rdar://problem/47148458>

Reviewed by Chris Dumez.

We close the page immediately if we fail to suspend. Layers disappear and we get a flash.

* UIProcess/SuspendedPageProxy.cpp:
(WebKit::SuspendedPageProxy::didProcessRequestToSuspend):

Remove the suspended page (so closing it on web process side) if the suspension fails.
Skip this if we are using web process side compositing on Mac.

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

On Mac, remove failed SuspendedPageProxy when entering compositing mode. At this point we don't need it to keep layers alive.

* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::removeFailedSuspendedPagesForPage):
* UIProcess/WebProcessPool.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::suspendForProcessSwap):

Don't close the page on suspension failure.

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

6 months agoIntroduce UndoStep::label() and adopt it in WebKitLegacy and WebKit
wenson_hsieh@apple.com [Wed, 23 Jan 2019 17:30:05 +0000 (17:30 +0000)]
Introduce UndoStep::label() and adopt it in WebKitLegacy and WebKit
https://bugs.webkit.org/show_bug.cgi?id=193706
<rdar://problem/44807048>

Reviewed by Ryosuke Niwa.

Source/WebCore:

Refactors some existing logic when registering undoable actions, such that we propagate the undoable action's
label string instead of the EditAction to the client layer. This will help make handling of CustomUndoStep's
undo/redo label simpler, as the client layer won't need to worry about managing an EditAction and undo/redo
label simultaneously. There should be no change in behavior.

* editing/CompositeEditCommand.cpp:
(WebCore::EditCommandComposition::label const):
* editing/CompositeEditCommand.h:
* editing/CustomUndoStep.cpp:
(WebCore::CustomUndoStep::label const):
* editing/CustomUndoStep.h:
* editing/EditAction.cpp:
(WebCore::undoRedoLabel):
(WebCore::nameForUndoRedo): Deleted.
* editing/EditAction.h:

Rename nameForUndoRedo to undoRedoLabel, and remove the WEBCORE_EXPORT since it's no longer needed in WebKit or
WebKitLegacy.

* editing/UndoStep.h:

Add UndoStep::label(). While EditCommandComposition implements this by mapping its EditAction to a
localized string, CustomUndoStep implements this by returning the undoable action label provided by script.

Source/WebKit:

* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::registerEditCommand):
* UIProcess/WebEditCommandProxy.cpp:
(WebKit::WebEditCommandProxy::WebEditCommandProxy):
* UIProcess/WebEditCommandProxy.h:

Drive-by tweak: make WebEditCommandProxy's backpointer to its WebPageProxy a WeakPtr instead of a raw pointer.
Additionally, call clear() instead of setting m_page to 0 upon invalidation. Also, turn the WebPageProxy*
argument into a WebPageProxy&, since the WebPageProxy must exist when it creates a new WebEditCommandProxy.

(WebKit::WebEditCommandProxy::create):
(WebKit::WebEditCommandProxy::label const):
(WebKit::WebEditCommandProxy::invalidate):
(WebKit::WebEditCommandProxy::editAction const): Deleted.

Adjust UI-side logic to just handle the undo/redo label, rather than map the edit action to a localized string.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::registerEditCommandForUndo):
(WebKit::WebPageProxy::resetState):

Tweak this to use std::exchange instead of copying all the WebEditCommandProxy RefPtrs into a separate Vector
and then iterating over the Vector.

* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:

Adjust this so that we only send the undo/redo label over IPC, rather than the edit action type.

* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::registerEditCommand):
* WebProcess/WebCoreSupport/WebEditorClient.cpp:
(WebKit::WebEditorClient::registerUndoStep):

Source/WebKitLegacy/mac:

Use UndoStep::label().

* WebCoreSupport/WebEditorClient.h:
* WebCoreSupport/WebEditorClient.mm:
(-[WebUndoStep initWithUndoStep:]):
(+[WebUndoStep stepWithUndoStep:]):
(WebEditorClient::registerUndoOrRedoStep):
(WebEditorClient::registerUndoStep):
(WebEditorClient::registerRedoStep):

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

6 months ago[SOUP] Remove libsoup cruft from WebProcess
mcatanzaro@igalia.com [Wed, 23 Jan 2019 17:26:50 +0000 (17:26 +0000)]
[SOUP] Remove libsoup cruft from WebProcess
https://bugs.webkit.org/show_bug.cgi?id=193710

Reviewed by Carlos Garcia Campos.

SoupNetworkSession is no longer accessible from the web process because it's owned
(indirectly) by NetworkProcess after r240292. It doesn't make sense to have any libsoup
code under WebProcess anymore. The current libsoup code consists of (a) unused stuff to be
removed, (b) stuff unrelated to libsoup, which should move to a WebProcessGLib.cpp, and (c)
WebKitSoupRequestInputStream, which is only used by NetworkProcess and should move there

* NetworkProcess/soup/WebKitSoupRequestInputStream.cpp: Renamed from Source/WebKit/WebProcess/soup/WebKitSoupRequestInputStream.cpp.
(AsyncReadData::AsyncReadData):
(webkitSoupRequestInputStreamReadAsyncResultComplete):
(webkitSoupRequestInputStreamPendingReadAsyncComplete):
(webkitSoupRequestInputStreamHasDataToRead):
(webkitSoupRequestInputStreamIsWaitingForData):
(webkitSoupRequestInputStreamReadAsync):
(webkitSoupRequestInputStreamReadFinish):
(webkitSoupRequestInputStreamFinalize):
(webkit_soup_request_input_stream_init):
(webkit_soup_request_input_stream_class_init):
(webkitSoupRequestInputStreamNew):
(webkitSoupRequestInputStreamAddData):
(webkitSoupRequestInputStreamDidFailWithError):
(webkitSoupRequestInputStreamFinished):
* NetworkProcess/soup/WebKitSoupRequestInputStream.h: Renamed from Source/WebKit/WebProcess/soup/WebKitSoupRequestInputStream.h.
* SourcesGTK.txt:
* SourcesWPE.txt:
* UIProcess/soup/WebProcessPoolSoup.cpp:
(WebKit::WebProcessPool::setNetworkProxySettings): Don't send message to web processes.
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:
* WebProcess/glib/WebProcessGLib.cpp: Renamed from Source/WebKit/WebProcess/soup/WebProcessSoup.cpp.
(WebKit::WebProcess::platformSetCacheModel):
(WebKit::WebProcess::platformInitializeWebProcess):
(WebKit::WebProcess::platformTerminate):

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

6 months ago[SOUP] Clean up NetworkStorageSession
mcatanzaro@igalia.com [Wed, 23 Jan 2019 17:24:19 +0000 (17:24 +0000)]
[SOUP] Clean up NetworkStorageSession
https://bugs.webkit.org/show_bug.cgi?id=193707

Reviewed by Carlos Garcia Campos.

Source/WebCore:

A NetworkStorageSession now always has a SoupNetworkSession, so we can remove a lot of
complexity that is no longer needed. getOrCreateSoupNetworkSession can go away because we
know the session has always already been created. The soupNetworkSession getter can now
return a reference rather than a pointer, because it will never be NULL except after it has
been cleared with clearSoupNetworkSession (renamed), and that should only happen immediately
before process termination after nothing else is using it. Cookie jar syncing can also go
away; the NetworkStorageSession can now rely on the SoupNetworkSession to exist and just
use its cookie jar.

* platform/network/NetworkStorageSession.h:
(WebCore::NetworkStorageSession::soupNetworkSession const): Deleted.
* platform/network/soup/DNSResolveQueueSoup.cpp:
(WebCore::DNSResolveQueueSoup::updateIsUsingProxy):
(WebCore::DNSResolveQueueSoup::platformResolve):
(WebCore::DNSResolveQueueSoup::resolve):
* platform/network/soup/NetworkStorageSessionSoup.cpp:
(WebCore::NetworkStorageSession::NetworkStorageSession):
(WebCore::NetworkStorageSession::~NetworkStorageSession):
(WebCore::NetworkStorageSession::soupNetworkSession const):
(WebCore::NetworkStorageSession::clearSoupNetworkSession):
(WebCore::NetworkStorageSession::cookieStorage const):
(WebCore::NetworkStorageSession::setCookieStorage):
(WebCore::NetworkStorageSession::getOrCreateSoupNetworkSession const): Deleted.
(WebCore::NetworkStorageSession::clearSoupNetworkSessionAndCookieStorage): Deleted.
* platform/network/soup/SocketStreamHandleImplSoup.cpp:
(WebCore::SocketStreamHandleImpl::create):

Source/WebKit:

Restore an important call to clearSoupNetworkSession that was removed in r240292. Also,
adapt to NetworkStorageSessions API changes.

* NetworkProcess/CustomProtocols/soup/LegacyCustomProtocolManagerSoup.cpp:
(WebKit::LegacyCustomProtocolManager::registerScheme):
* NetworkProcess/soup/NetworkProcessMainSoup.cpp:
* NetworkProcess/soup/NetworkProcessSoup.cpp:
(WebKit::NetworkProcess::userPreferredLanguagesChanged):
(WebKit::NetworkProcess::setNetworkProxySettings):
* NetworkProcess/soup/NetworkSessionSoup.cpp:
(WebKit::NetworkSessionSoup::soupSession const):

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

6 months agowebkitpy: Use correct config for --iphone-simulator and --ipad-simulator
jbedard@apple.com [Wed, 23 Jan 2019 17:23:29 +0000 (17:23 +0000)]
webkitpy: Use correct config for --iphone-simulator and --ipad-simulator
https://bugs.webkit.org/show_bug.cgi?id=193722
<rdar://problem/47481475>

Reviewed by Lucas Forschler.

iPhone and iPad ports should both use the iOS config.

* Scripts/webkitpy/port/ios_simulator.py:
(IPhoneSimulatorPort.__init__):
(IPadSimulatorPort.__init__):

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

6 months ago[GTK] Crash when browsing inspector:// uri without port set
philn@webkit.org [Wed, 23 Jan 2019 16:48:04 +0000 (16:48 +0000)]
[GTK] Crash when browsing inspector:// uri without port set
https://bugs.webkit.org/show_bug.cgi?id=193721

Reviewed by Michael Catanzaro.

* UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp:
(WebKit::RemoteInspectorProtocolHandler::handleRequest): Return
back to caller after setting the error, if no port was provided
along with the inspector URL.

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

6 months ago[LFC][BFC] computeStaticPosition should include estimated computation as well.
zalan@apple.com [Wed, 23 Jan 2019 16:29:53 +0000 (16:29 +0000)]
[LFC][BFC] computeStaticPosition should include estimated computation as well.
https://bugs.webkit.org/show_bug.cgi?id=193719

Reviewed by Antti Koivisto.

Consolidate all static position (non-estimated, estimated) computation in BlockFormattingContext::computeStaticPosition.
It requires to compute width/horizontal margin first, since vertical top estimation needs valid horizontal widths (margin-top: 5% is computed using
the containing block's width).
This is also in preparation for moving 'clear' positioning to computeStaticPosition.

* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::layout const):
(WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
(WebCore::Layout::BlockFormattingContext::computeStaticPosition const):
(WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPosition const):
(WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPositionForAncestors const):
(WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPositionForFormattingRoot const):
(WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPositionForFloatClear const):
(WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const):
(WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
(WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
(WebCore::Layout::BlockFormattingContext::adjustedVerticalPositionAfterMarginCollapsing const):
(WebCore::Layout::BlockFormattingContext::computeEstimatedMarginBefore const): Deleted.
(WebCore::Layout::BlockFormattingContext::computeEstimatedMarginBeforeForAncestors const): Deleted.
(WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForFormattingRootIfNeeded const): Deleted.
* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::staticPosition):
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithFirstInFlowChildMarginBefore):

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

6 months agoCompositing updates need to reparent scrolling tree nodes with a changed ancestor
simon.fraser@apple.com [Wed, 23 Jan 2019 16:11:50 +0000 (16:11 +0000)]
Compositing updates need to reparent scrolling tree nodes with a changed ancestor
https://bugs.webkit.org/show_bug.cgi?id=193699

Reviewed by Frédéric Wang.

Source/WebCore:

Now that compositing updates are incremental and may not do a full layer walk,
we need to ensure that when a scrolling tree node is removed, we traverse to all
descendant layers whose scrolling tree nodes refer to the removed node as their parent.

To achieve this, add a RenderLayer dirty bit for "NeedsScrollingTreeUpdate" which
ensures that the updateBackingAndHierarchy part of the compositing update traverses
layers with the bit set.

Adjust the compositing logging to make the legend easier to read.

Tests: scrollingcoordinator/reparent-across-compositing-layers.html
       scrollingcoordinator/reparent-with-layer-removal.html

* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::childrenOfNode const):
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::childrenOfNode const):
* rendering/RenderLayer.cpp:
(WebCore::outputPaintOrderTreeLegend):
(WebCore::outputPaintOrderTreeRecursive):
* rendering/RenderLayer.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateBackingAndHierarchy):
(WebCore::RenderLayerCompositor::detachScrollCoordinatedLayer):

LayoutTests:

* platform/ios-wk2/scrollingcoordinator/reparent-across-compositing-layers-expected.txt: Added.
* platform/ios-wk2/scrollingcoordinator/reparent-with-layer-removal-expected.txt: Added.
* scrollingcoordinator/reparent-across-compositing-layers-expected.txt: Added.
* scrollingcoordinator/reparent-across-compositing-layers.html: Added.
* scrollingcoordinator/reparent-with-layer-removal-expected.txt: Added.
* scrollingcoordinator/reparent-with-layer-removal.html: Added.

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

6 months ago[JSC] Duplicate global variables: JSC::opcodeLengths
ddkilzer@apple.com [Wed, 23 Jan 2019 15:40:55 +0000 (15:40 +0000)]
[JSC] Duplicate global variables: JSC::opcodeLengths
<https://webkit.org/b/193714>
<rdar://problem/47340200>

Reviewed by Mark Lam.

* bytecode/Opcode.cpp:
(JSC::opcodeLengths): Move array implementation here and mark
const.
* bytecode/Opcode.h:
(JSC::opcodeLengths): Change to extern declaration.

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

6 months ago[css-logical] Implement flow-relative inset properties
commit-queue@webkit.org [Wed, 23 Jan 2019 15:04:50 +0000 (15:04 +0000)]
[css-logical] Implement flow-relative inset properties
https://bugs.webkit.org/show_bug.cgi?id=189441

Patch by Oriol Brufau <obrufau@igalia.com> on 2019-01-23
Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

Enable the CSSLogicalEnabled flag in the test for logical insets, and
update its expectations. It still has some failures because sideways
writing modes have not been implemented yet
(https://bugs.webkit.org/show_bug.cgi?id=166941).

* web-platform-tests/css/css-logical/logical-box-inset-expected.txt:
* web-platform-tests/css/css-logical/logical-box-inset.html:

Source/WebCore:

Implement 'inset', 'inset-block', 'inset-block-start', 'inset-block-end',
'inset-inline', 'inset-inline-start' and 'inset-inline-end' CSS properties
behind the CSSLogicalEnabled runtime flag.

Tests: imported/w3c/web-platform-tests/css/css-logical/logical-box-inset.html
       webexposed/css-properties-behind-flags.html

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::isLayoutDependent):
(WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
* css/CSSProperties.json:
* css/CSSProperty.cpp:
(WebCore::CSSProperty::resolveDirectionAwareProperty):
(WebCore::CSSProperty::isDirectionAwareProperty):
* css/StyleProperties.cpp:
(WebCore::StyleProperties::getPropertyValue const):
(WebCore::StyleProperties::asText const):
* css/parser/CSSParserFastPaths.cpp:
(WebCore::isSimpleLengthPropertyID):
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseSingleValue):
(WebCore::CSSPropertyParser::parseShorthand):

LayoutTests:

Check that the new CSS properties are disabled behind runtime flags
and are not exposed.

* webexposed/css-properties-behind-flags-expected.txt:
* webexposed/css-properties-behind-flags.html:

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

6 months ago[css-grid] Properly handle static positions of abspos inside grid items
commit-queue@webkit.org [Wed, 23 Jan 2019 12:44:49 +0000 (12:44 +0000)]
[css-grid] Properly handle static positions of abspos inside grid items
https://bugs.webkit.org/show_bug.cgi?id=193657

Patch by Oriol Brufau <obrufau@igalia.com> on 2019-01-23
Reviewed by Javier Fernandez.

LayoutTests/imported/w3c:

Import test changes from WPT.
Various orthogonal tests still fail because of https://bugs.webkit.org/show_bug.cgi?id=189513
Some other tests also fail because of https://bugs.webkit.org/show_bug.cgi?id=193656

* resources/import-expectations.json:
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-001-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-001.html: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-002-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-002.html: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-003-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-003.html: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-004-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-004.html: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-005-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-005.html: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-006-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-006.html: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-007-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-007.html: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-008-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-008.html: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-009-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-009.html: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-010-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-010.html: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-011-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-011.html: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-012-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-012.html: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-013-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-013.html: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-014-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-014.html: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-015-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-015.html: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-016-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-016.html: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-001-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-001.html: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-002-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-002.html: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-003-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-003.html: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-004-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-004.html: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-005-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-005.html: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-006-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-006.html: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-007-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-007.html: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-008-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-008.html: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-009-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-009.html: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-010-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-010.html: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-011-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-011.html: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-012-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-012.html: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-013-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-013.html: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-014-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-014.html: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-015-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-015.html: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-016-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-016.html: Added.
* web-platform-tests/css/css-grid/abspos/support/positioned-grid-descendants.css: Added.
(.grid):
(.abspos):
(.orthogonal):
(.grid > :nth-child(1) > .abspos):
(.grid > :nth-child(2) > .abspos):
* web-platform-tests/css/css-grid/abspos/support/positioned-grid-descendants.js: Added.
(export.runTests):
* web-platform-tests/css/css-grid/abspos/support/w3c-import.log:
* web-platform-tests/css/css-grid/abspos/w3c-import.log:

Source/WebCore:

Rename findChildLogicalPosition to setLogicalPositionForChild and let it set the position.
Add setLogicalOffsetForChild like setLogicalPositionForChild but just for one offset,
and only if it's needed (not for abspos descentants in their static position).
Add logicalOffsetForChild that finds the value to be set by the functions above.
Rename existing logicalOffsetForChild to logicalOffsetForOutOfFlowChild.

Tests: imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-001.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-002.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-003.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-004.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-005.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-006.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-007.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-008.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-009.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-010.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-011.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-012.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-013.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-014.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-015.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-016.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-001.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-002.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-003.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-004.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-005.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-006.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-007.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-008.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-009.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-010.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-011.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-012.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-013.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-014.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-015.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-016.html

* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::layoutGridItems):
(WebCore::RenderGrid::layoutPositionedObject):
(WebCore::RenderGrid::logicalOffsetForOutOfFlowChild const):
(WebCore::RenderGrid::gridAreaPositionForOutOfFlowChild const):
(WebCore::RenderGrid::setLogicalPositionForChild const):
(WebCore::RenderGrid::setLogicalOffsetForChild const):
(WebCore::RenderGrid::logicalOffsetForChild const):
* rendering/RenderGrid.h:

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

6 months agoSwitch remaining CoreMedia soft-linking in WebKit over to CoreMediaSoftLink.{cpp,h}
ddkilzer@apple.com [Wed, 23 Jan 2019 11:58:15 +0000 (11:58 +0000)]
Switch remaining CoreMedia soft-linking in WebKit over to CoreMediaSoftLink.{cpp,h}
<https://webkit.org/b/193694>
<rdar://problem/47464025>

Reviewed by Tim Horton.

Source/WebCore/PAL:

* pal/cf/CoreMediaSoftLink.cpp:
- Export kCMTimeZero soft-link.
* pal/cf/CoreMediaSoftLink.h:
- Update kCMTimeZero macro to use PAL namespace for use in
  WebKit.framework.

Source/WebKit:

* Shared/ios/WebIconUtilities.mm:
- Switch to using CoreMediaSoftLink.{h,mm} in PAL.

Source/WTF:

* wtf/win/SoftLinking.h:
(SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT):
- Implement for Windows.
(SOFT_LINK_CONSTANT_FOR_SOURCE):
- Define using SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT().

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

6 months agoUpdate MIME type parser
commit-queue@webkit.org [Wed, 23 Jan 2019 11:32:55 +0000 (11:32 +0000)]
Update MIME type parser
https://bugs.webkit.org/show_bug.cgi?id=180526

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

LayoutTests/imported/w3c:

Update improved test expectations.

* web-platform-tests/xhr/overridemimetype-blob-expected.txt:

Source/WebCore:

Add an enum to allow two modes of MIME type parsing, one mode
to keep supporting RFC2045 as before, and one mode to support
the updated MIME parser from mimesniff [1]. Mimesniff support
brings the following changes:
- allows parameter names without matching =value.
- skips whitespace after subtype, parameter value and before
  parameter name.
- lower cases MIME type and parameter name.
- parameter names parsed before are discarded.

The old mode is still used by CDM.cpp and MIMEHeader.cpp.

[1] https://mimesniff.spec.whatwg.org/

* Modules/encryptedmedia/CDM.cpp:
(WebCore::CDM::getSupportedCapabilitiesForAudioVideoType):
* platform/network/MIMEHeader.cpp:
(WebCore::MIMEHeader::parseHeader):
* platform/network/ParsedContentType.cpp:
(WebCore::DummyParsedContentType::setContentType const):
(WebCore::DummyParsedContentType::setContentTypeParameter const):
(WebCore::isQuotedStringTokenCharacter):
(WebCore::isTokenCharacter):
(WebCore::parseToken):
(WebCore::containsNonTokenCharacters):
(WebCore::parseQuotedString):
(WebCore::isNotForwardSlash):
(WebCore::isNotSemicolon):
(WebCore::isNotSemicolonOrEqualSign):
(WebCore::parseContentType):
(WebCore::isValidContentType):
(WebCore::ParsedContentType::ParsedContentType):
(WebCore::ParsedContentType::setContentType):
(WebCore::isNonTokenCharacter):
(WebCore::isNonQuotedStringTokenCharacter):
(WebCore::ParsedContentType::setContentTypeParameter):
* platform/network/ParsedContentType.h:

Test: web-platform-tests/xhr/overridemimetype-blob.html

Tools:

Add unit tests for both parse modes of ParsedContentType.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebCore/ParsedContentType.cpp: Added.
(TestWebKitAPI::TEST):

LayoutTests:

Adjust test expectation.

* http/tests/xmlhttprequest/post-blob-content-type-async-expected.txt:
* http/tests/xmlhttprequest/post-blob-content-type-sync-expected.txt:
* http/tests/xmlhttprequest/post-blob-content-type-tests.js:

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

6 months ago[GLIB] Remote Inspector: no data displayed
carlosgc@webkit.org [Wed, 23 Jan 2019 10:12:56 +0000 (10:12 +0000)]
[GLIB] Remote Inspector: no data displayed
https://bugs.webkit.org/show_bug.cgi?id=193569

Reviewed by Michael Catanzaro.

Release the remote inspector mutex before using RemoteConnectionToTarget in RemoteInspector::setup() to avoid a
deadlock.

* inspector/remote/glib/RemoteInspectorGlib.cpp:
(Inspector::RemoteInspector::receivedSetupMessage):
(Inspector::RemoteInspector::setup):

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

6 months agoUnreviewed, fix initial global lexical binding epoch
ysuzuki@apple.com [Wed, 23 Jan 2019 06:21:41 +0000 (06:21 +0000)]
Unreviewed, fix initial global lexical binding epoch
https://bugs.webkit.org/show_bug.cgi?id=193603
<rdar://problem/47380869>

JSTests:

* stress/global-lexical-binding-epoch-should-be-correct-one.js: Added.
(f1.f2.f3.f4):
(f1.f2.f3):
(f1.f2):
(f1):

Source/JavaScriptCore:

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::finishCreation):

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

6 months agoIntroduce CustomUndoStep.h and CustomUndoStep.cpp
wenson_hsieh@apple.com [Wed, 23 Jan 2019 06:10:45 +0000 (06:10 +0000)]
Introduce CustomUndoStep.h and CustomUndoStep.cpp
https://bugs.webkit.org/show_bug.cgi?id=193704
<rdar://problem/44807048>

Reviewed by Ryosuke Niwa.

This patch is more work in progress towards supporting `UndoManager.addItem()`. Here, we introduce a helper
class, CustomUndoStep, that holds a weak reference to a script-defined UndoItem. See below for more details.

No change in behavior.

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* editing/CustomUndoStep.cpp:
(WebCore::CustomUndoStep::CustomUndoStep):

Subclass UndoStep.

(WebCore::CustomUndoStep::unapply):
(WebCore::CustomUndoStep::reapply):

If possible, invoke the UndoItem's undo and redo handlers.

(WebCore::CustomUndoStep::isValid const):
* editing/CustomUndoStep.h:
* editing/EditingStyle.cpp:
* editing/InsertEditableImageCommand.cpp:
(WebCore::InsertEditableImageCommand::doApply):

Unified build fixes.

* page/UndoItem.h:

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

6 months agoREGRESSION(r239612) Crash at runtime due to broken DFG assumption
ysuzuki@apple.com [Wed, 23 Jan 2019 05:55:08 +0000 (05:55 +0000)]
REGRESSION(r239612) Crash at runtime due to broken DFG assumption
https://bugs.webkit.org/show_bug.cgi?id=193709
<rdar://problem/47363838>

Unreviewed, rollout to watch the tests.

JSTests:

* stress/object-tostring-changed-proto.js: Removed.
* stress/object-tostring-changed.js: Removed.
* stress/object-tostring-misc.js: Removed.
* stress/object-tostring-other.js: Removed.
* stress/object-tostring-untyped.js: Removed.

Source/JavaScriptCore:

* JavaScriptCore.xcodeproj/project.pbxproj:
* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleIntrinsicCall):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
(JSC::DFG::FixupPhase::fixupObjectToString): Deleted.
* dfg/DFGNodeType.h:
* dfg/DFGOperations.cpp:
* dfg/DFGOperations.h:
* dfg/DFGPredictionPropagationPhase.cpp:
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileObjectToString): Deleted.
* dfg/DFGSpeculativeJIT.h:
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* ftl/FTLAbstractHeapRepository.h:
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileNode):
(JSC::FTL::DFG::LowerDFGToB3::compileToStringOrCallStringConstructorOrStringValueOf):
(JSC::FTL::DFG::LowerDFGToB3::compileObjectToString): Deleted.
* runtime/Intrinsic.cpp:
(JSC::intrinsicName):
* runtime/Intrinsic.h:
* runtime/ObjectPrototype.cpp:
(JSC::ObjectPrototype::finishCreation):
(JSC::objectProtoFuncToString):
* runtime/ObjectPrototype.h:
* runtime/ObjectPrototypeInlines.h: Removed.
* runtime/StructureRareData.h:

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

6 months agoAdding a child to a ScrollingStateNode needs to trigger a tree state commit
simon.fraser@apple.com [Wed, 23 Jan 2019 05:42:06 +0000 (05:42 +0000)]
Adding a child to a ScrollingStateNode needs to trigger a tree state commit
https://bugs.webkit.org/show_bug.cgi?id=193682

Reviewed by Zalan Bujtas.

Source/WebCore:

Scrolling tree mutations that re-arrange nodes (e.g. node reordering when z-index changes)
need to trigger scrolling tree updates, and currently do not.

Fix by adding a "ChildNodes" dirty bit to ScrollingStateNode. There isn't any code that consults
this flag when committing the scrolling tree because we always eagerly traverse children, but
we could use it to optimize later. The important part is that we use it to trigger a tree update.

Can't test via z-reordering until webkit.org/b/192529 is fixed.

Tests: scrollingcoordinator/gain-scrolling-node-parent.html
       scrollingcoordinator/lose-scrolling-node-parent.html

* page/scrolling/ScrollingStateNode.cpp:
(WebCore::ScrollingStateNode::appendChild):
(WebCore::ScrollingStateNode::insertChild):
(WebCore::ScrollingStateNode::removeChildAtIndex):
* page/scrolling/ScrollingStateNode.h:
* page/scrolling/ScrollingStateTree.cpp:
(WebCore::ScrollingStateTree::attachNode):

LayoutTests:

* platform/ios/scrollingcoordinator/gain-scrolling-node-parent-expected.txt: Added.
* platform/ios/scrollingcoordinator/lose-scrolling-node-parent-expected.txt: Added.
* scrollingcoordinator/gain-scrolling-node-parent-expected.txt: Added.
* scrollingcoordinator/gain-scrolling-node-parent.html: Added.
* scrollingcoordinator/lose-scrolling-node-parent-expected.txt: Added.
* scrollingcoordinator/lose-scrolling-node-parent.html: Added.

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

6 months agoRegression(r240178) Some API tests are crashing
cdumez@apple.com [Wed, 23 Jan 2019 05:30:09 +0000 (05:30 +0000)]
Regression(r240178) Some API tests are crashing
https://bugs.webkit.org/show_bug.cgi?id=193680

Reviewed by Alex Christensen.

r240178 made sure that userScripts / scriptMessageHandlers / contentExtensions are always
properly populated in the WebPageCreationParameters. This was needed in case we need to
reconstruct the WebUserContentController on the WebProcess side. However, this caused a
regression in the case we reuse a process where the WebUserContentController still exists
(because it was kept alive, e.g. by the WebPageGroup). In that case, we would add duplicate
entries to the existing WebUserContentController instance because its "add" methods did not
have duplicate checks. To address the issue, this patch adds duplicate checks to the
WebUserContentController "add" methods.

* WebProcess/UserContent/WebUserContentController.cpp:
(WebKit::WebUserContentController::addUserScriptMessageHandlerInternal):
(WebKit::WebUserContentController::removeUserScriptMessageHandlerInternal):
(WebKit::WebUserContentController::addUserScriptInternal):
(WebKit::WebUserContentController::removeUserScriptInternal):
(WebKit::WebUserContentController::addUserStyleSheetInternal):
(WebKit::WebUserContentController::removeUserStyleSheetInternal):
(WebKit::WebUserContentController::forEachUserMessageHandler const):
* WebProcess/UserContent/WebUserContentController.h:

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

6 months agoMake scrollingcoordinator tests only run on iOS/macOS WK2
simon.fraser@apple.com [Wed, 23 Jan 2019 05:20:36 +0000 (05:20 +0000)]
Make scrollingcoordinator tests only run on iOS/macOS WK2
https://bugs.webkit.org/show_bug.cgi?id=193690

Reviewed by Zalan Bujtas.

scrollingcoordinator is only active in WK2, and both WPE and WinCairo skip this directory
already, so skip it at the top level, and re-enable for mac-wk2 and ios-wk2.

Also do some cleanup after tiled-drawing/ios was removed on 1/18.

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

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

6 months agoWeb Inspector: InspectorInstrumentation::willEvaluateScript should include column...
drousso@apple.com [Wed, 23 Jan 2019 04:51:45 +0000 (04:51 +0000)]
Web Inspector: InspectorInstrumentation::willEvaluateScript should include column number
https://bugs.webkit.org/show_bug.cgi?id=116191
<rdar://problem/13905910>

Reviewed by Joseph Pecoraro.

Source/WebCore:

Test inspector/timeline/line-column.html

* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::evaluateInWorld):
(WebCore::ScriptController::evaluateModule):

* bindings/js/JSExecStateInstrumentation.h:
(WebCore::JSExecState::instrumentFunctionInternal):

* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::willCallFunction):
(WebCore::InspectorInstrumentation::willEvaluateScript):
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::willCallFunctionImpl):
(WebCore::InspectorInstrumentation::willEvaluateScriptImpl):

* inspector/agents/InspectorTimelineAgent.h:
* inspector/agents/InspectorTimelineAgent.cpp:
(WebCore::InspectorTimelineAgent::willCallFunction):
(WebCore::InspectorTimelineAgent::willEvaluateScript):

* inspector/TimelineRecordFactory.h:
* inspector/TimelineRecordFactory.cpp:
(WebCore::TimelineRecordFactory::createFunctionCallData):
(WebCore::TimelineRecordFactory::createEvaluateScriptData):

* bindings/js/ScriptSourceCode.h:
(WebCore::ScriptSourceCode::startColumn const): Added.

Source/WebInspectorUI:

* UserInterface/Controllers/TimelineManager.js:
(WI.TimelineManager.prototype._processRecord):

LayoutTests:

* inspector/timeline/line-column.html: Added.
* inspector/timeline/line-column-expected.txt: Added.

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

6 months agoResync libwebrtc with latest M72 branch
youenn@apple.com [Wed, 23 Jan 2019 04:42:54 +0000 (04:42 +0000)]
Resync libwebrtc with latest M72 branch
https://bugs.webkit.org/show_bug.cgi?id=193693
LayoutTests/imported/w3c:

<rdar://problem/47463803>

Reviewed by Eric Carlson.

* web-platform-tests/webrtc/RTCRtpTransceiver.https-expected.txt:

Source/ThirdParty/libwebrtc:

Reviewed by Eric Carlson.

Update libwebrtc up to latest M72 branch to fix some identified issues:
- Bad bandwidth estimation in case of multiple transceivers
- mid handling for legacy endpoints
- msid handling for updating mediastreams accordingly.

* Source/webrtc/modules/congestion_controller/goog_cc/delay_based_bwe.cc:
* Source/webrtc/modules/congestion_controller/goog_cc/delay_based_bwe.h:
* Source/webrtc/modules/congestion_controller/goog_cc/goog_cc_network_control.cc:
* Source/webrtc/modules/congestion_controller/goog_cc/goog_cc_network_control_unittest.cc:
* Source/webrtc/modules/congestion_controller/send_side_congestion_controller_unittest.cc:
* Source/webrtc/pc/jsepsessiondescription_unittest.cc:
* Source/webrtc/pc/mediasession.cc:
* Source/webrtc/pc/mediasession_unittest.cc:
* Source/webrtc/pc/peerconnection.cc:
* Source/webrtc/pc/peerconnection.h:
* Source/webrtc/pc/peerconnection_jsep_unittest.cc:
* Source/webrtc/pc/peerconnection_media_unittest.cc:
* Source/webrtc/pc/peerconnection_rtp_unittest.cc:
* Source/webrtc/pc/sessiondescription.cc:
* Source/webrtc/pc/sessiondescription.h:
* Source/webrtc/pc/webrtcsdp.cc:
* Source/webrtc/pc/webrtcsdp_unittest.cc:
* Source/webrtc/system_wrappers/include/metrics.h:
* Source/webrtc/video/BUILD.gn:

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

6 months agoAnalyzing a chart that does not exist should not halt whole run-analysis script.
dewei_zhu@apple.com [Wed, 23 Jan 2019 04:28:57 +0000 (04:28 +0000)]
Analyzing a chart that does not exist should not halt whole run-analysis script.
https://bugs.webkit.org/show_bug.cgi?id=193563

Reviewed by Ryosuke Niwa.

Halting whole run-analysis script while there is any invalid chart specified in Manifest makes the script fragile.
Run-analysis is also responsible for adding retry and sending notification which should not be block by this error.
Skipping analyzing the corresponding configuration seems reasonable.

* public/v3/models/measurement-set.js:
(MeasurementSet.prototype._ensureClusterPromise): Only add callback when callback is specified.
This will help to fix 'UnhandledPromiseRejectionWarning' while running the test.
* tools/js/measurement-set-analyzer.js:
(MeasurementSetAnalyzer.prototype.async._analyzeMeasurementSet): Catch the exception while failing to fetch a measurement set and skip the analysis for this config.
* unit-tests/measurement-set-analyzer-tests.js: Added unit tests for this.

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

6 months agoWeb Inspector: expose Audit and Recording versions to the frontend
drousso@apple.com [Wed, 23 Jan 2019 04:17:06 +0000 (04:17 +0000)]
Web Inspector: expose Audit and Recording versions to the frontend
https://bugs.webkit.org/show_bug.cgi?id=193262
<rdar://problem/47130684>

Reviewed by Joseph Pecoraro.

Source/JavaScriptCore:

* inspector/protocol/Audit.json:
* inspector/protocol/Recording.json:
Add `version` values.

* inspector/scripts/codegen/models.py:
(Protocol.parse_domain):
(Domain.__init__):
(Domain.version): Added.
(Domains):

* inspector/scripts/codegen/generator.py:
(Generator.version_for_domain): Added.

* inspector/scripts/codegen/generate_cpp_protocol_types_header.py:
(CppProtocolTypesHeaderGenerator.generate_output):
(CppProtocolTypesHeaderGenerator._generate_versions): Added.

* inspector/scripts/codegen/generate_js_backend_commands.py:
(JSBackendCommandsGenerator.should_generate_domain):
(JSBackendCommandsGenerator.generate_domain):

* inspector/scripts/tests/generic/version.json: Added.
* inspector/scripts/tests/generic/expected/version.json-result: Added.

* 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/definitions-with-mac-platform.json-result:
* inspector/scripts/tests/generic/expected/domain-availability.json-result:
* inspector/scripts/tests/generic/expected/domains-with-varying-command-sizes.json-result:
* inspector/scripts/tests/generic/expected/enum-values.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/same-type-id-different-domain.json-result:
* inspector/scripts/tests/generic/expected/shadowed-optional-type-setters.json-result:
* inspector/scripts/tests/generic/expected/type-declaration-aliased-primitive-type.json-result:
* inspector/scripts/tests/generic/expected/type-declaration-array-type.json-result:
* inspector/scripts/tests/generic/expected/type-declaration-enum-type.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/ios/expected/definitions-with-mac-platform.json-result:
* inspector/scripts/tests/mac/expected/definitions-with-mac-platform.json-result:

Source/WebCore:

Tests: inspector/audit/version.html
       inspector/recording/version.html

* inspector/agents/InspectorCanvasAgent.cpp:
(WebCore::InspectorCanvasAgent::didFinishRecordingCanvasFrame):

Source/WebInspectorUI:

* UserInterface/Protocol/InspectorBackend.js:
(InspectorBackendClass.prototype.registerVersion): Added.

* UserInterface/Models/AuditTestCase.js:
* UserInterface/Models/Recording.js:
(WI.Recording.fromPayload):
Add Interface version values.

LayoutTests:

* inspector/audit/version.html: Added.
* inspector/audit/version-expected.txt: Added.
* inspector/recording/version.html: Added.
* inspector/recording/version-expected.txt: Added.

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

6 months agoUnreviewed attempt to fix GTK/WPE bots
mcatanzaro@igalia.com [Wed, 23 Jan 2019 04:06:56 +0000 (04:06 +0000)]
Unreviewed attempt to fix GTK/WPE bots
https://bugs.webkit.org/show_bug.cgi?id=193580
<rdar://problem/47457742>

Doesn't make sense to clear the storage session right after creating it. This should fix
network process crash on startup under G_DEBUG=fatal-criticals due to the storage session
not having a cookie jar.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::NetworkProcess):

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

6 months agoCancel Web Touches Properly so that long presses on YouTube links do not incorrectly...
megan_gardner@apple.com [Wed, 23 Jan 2019 02:12:08 +0000 (02:12 +0000)]
Cancel Web Touches Properly so that long presses on YouTube links do not incorrectly trigger a load
https://bugs.webkit.org/show_bug.cgi?id=193687
<rdar://problem/47056717>

Reviewed by Tim Horton.

Cancel web gestures when a long press is recognized.

* Platform/spi/ios/UIKitSPI.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _cancelWebGestureRecognizer]):
(-[WKContentView _longPressRecognized:]):

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

6 months agoAdd some bindings-related bookkeeping to UndoManager and UndoItem
wenson_hsieh@apple.com [Wed, 23 Jan 2019 02:06:53 +0000 (02:06 +0000)]
Add some bindings-related bookkeeping to UndoManager and UndoItem
https://bugs.webkit.org/show_bug.cgi?id=193111
<rdar://problem/44807048>

Reviewed by Ryosuke Niwa.

This patch is work in progress towards supporting `UndoManager.addItem()`. Here, we add helper methods to
UndoItem and UndoManager which later patches will exercise, as well as introduce some custom bindings to
properly handle the case where UndoItems are given anonymous JavaScript functions (see below for more details).

No new tests, because there is no script-observable change in behavior yet. When `addItems()` is hooked up, I
will write a test to verify that the undo and redo JavaScript functions survive garbage collection.

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSUndoItemCustom.cpp:
(WebCore::JSUndoItem::visitAdditionalChildren):

Have each JSUndoItem visit its undo and redo callback functions to ensure that the JavaScript wrapper objects
for these functions are not garbage collected underneath the item.

(WebCore::JSUndoItemOwner::isReachableFromOpaqueRoots):

Consider the undo item wrapper reachable from opaque roots if it is associated with its UndoManager's Document.
This ensures that if script isn't holding on to a reference to the wrapper (for instance, by calling
`UndoManager.addItem(new UndoItem({ ... }))`), we still protect the corresponding JSUndoItem as long as the
UndoManager's Document is alive. In the case where the undo item is not associated with a document, either (1)
script is keeping a reference to it, in which case it will be trivially reachable, or (2) script won't be able
to observe the destruction of the wrapper anyways (e.g. calling `new UndoItem({ ... })` by itself).

* dom/Document.cpp:
(WebCore::Document::prepareForDestruction):

Invalidate all undo items when the document is about to go away.

* page/UndoItem.cpp:
(WebCore::UndoItem::setUndoManager):
(WebCore::UndoItem::invalidate):
(WebCore::UndoItem::isValid const):

Add a few helpers, to be used in a future patch. We consider an UndoItem valid if it has been added to an
UndoManager, and is thus associated with a document.

(WebCore::UndoItem::document const):
* page/UndoItem.h:
* page/UndoItem.idl:
* page/UndoManager.cpp:
(WebCore::UndoManager::UndoManager):
(WebCore::UndoManager::addItem):

Have an UndoManager keep its UndoItems alive. These UndoItems remain in this set until either the document will
be destroyed, or the corresponding undo action is no longer needed because the platform undo stack has changed
(this latter behavior is yet to be implemented).

(WebCore::UndoManager::removeItem):
(WebCore::UndoManager::removeAllItems):
* page/UndoManager.h:
(WebCore::UndoManager::UndoManager): Deleted.
* page/scrolling/ScrollingTreeScrollingNode.cpp:

Unified build fix.

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

6 months agoWeb Inspector: Styles: refactor properties/allProperties/visibleProperties/allVisible...
nvasilyev@apple.com [Wed, 23 Jan 2019 01:46:01 +0000 (01:46 +0000)]
Web Inspector: Styles: refactor properties/allProperties/visibleProperties/allVisibleProperties
https://bugs.webkit.org/show_bug.cgi?id=193615

Reviewed by Devin Rousso.

Source/WebInspectorUI:

Remove unused visibleProperties.

Rename:
- properties to enabledProperties;
- allProperties to properties;
- allVisibleProperties to visibleProperties.

* UserInterface/Models/CSSProperty.js:
(WI.CSSProperty.prototype._prependSemicolonIfNeeded):
(WI.CSSProperty):
* UserInterface/Models/CSSStyleDeclaration.js:
(WI.CSSStyleDeclaration):
(WI.CSSStyleDeclaration.prototype.get enabledProperties):
(WI.CSSStyleDeclaration.prototype.get properties):
(WI.CSSStyleDeclaration.prototype.propertyForName):
(WI.CSSStyleDeclaration.prototype.newBlankProperty):
(WI.CSSStyleDeclaration.prototype.shiftPropertiesAfter):
(WI.CSSStyleDeclaration.prototype._rangeAfterPropertyAtIndex):
* UserInterface/Models/DOMNodeStyles.js:
(WI.DOMNodeStyles.prototype._parseStylePropertyPayload):
(WI.DOMNodeStyles.prototype._markOverriddenProperties):
(WI.DOMNodeStyles.prototype._associateRelatedProperties):
(WI.DOMNodeStyles.prototype._isPropertyFoundInMatchingRules):
(WI.DOMNodeStyles):
* UserInterface/Views/BoxModelDetailsSectionRow.js:
(WI.BoxModelDetailsSectionRow.prototype._updateMetrics):
* UserInterface/Views/ComputedStyleDetailsPanel.js:
(WI.ComputedStyleDetailsPanel.prototype._computePropertyTraces):
* UserInterface/Views/ComputedStyleSection.js:
(WI.ComputedStyleSection.prototype.get propertiesToRender):
* UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js:
(WI.SpreadsheetCSSStyleDeclarationEditor.prototype.get propertiesToRender):
* UserInterface/Views/SpreadsheetRulesStyleDetailsPanel.js:
(WI.SpreadsheetRulesStyleDetailsPanel.prototype.layout):
* UserInterface/Views/SpreadsheetStyleProperty.js:
(WI.SpreadsheetStyleProperty.prototype.updateStatus):

LayoutTests:

Rename:
- properties to enabledProperties;
- allProperties to properties.

* inspector/css/css-property-expected.txt:
* inspector/css/css-property.html:
* inspector/css/force-page-appearance.html:
* inspector/css/matched-style-properties.html:
* inspector/css/modify-css-property.html:
* inspector/css/shadow-scoped-style.html:

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

6 months ago[WinCairo][WebKitTestRunner] Null dereference of GraphicsContext::m_data in GraphicsC...
Hironori.Fujii@sony.com [Wed, 23 Jan 2019 01:13:44 +0000 (01:13 +0000)]
[WinCairo][WebKitTestRunner] Null dereference of GraphicsContext::m_data in GraphicsContext::releaseWindowsContext
https://bugs.webkit.org/show_bug.cgi?id=193664

Reviewed by Brent Fulgham.

WinCairo WebKitTestRunner always crash on openning test cases of
HTMLMeterElement.

If GraphicsContext::getWindowsContext retruned null HDC,
LocalWindowsContext shouldn't release the null HDC.

Covered by existing tests.

* platform/graphics/win/LocalWindowsContext.h:
(WebCore::LocalWindowsContext::~LocalWindowsContext):
Release m_hdc only if it isn't null.

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

6 months agoLayout test storage/indexeddb/open-during-transaction-private.html is failing
sihui_liu@apple.com [Wed, 23 Jan 2019 01:11:29 +0000 (01:11 +0000)]
Layout test storage/indexeddb/open-during-transaction-private.html is failing
https://bugs.webkit.org/show_bug.cgi?id=193600

Reviewed by Brady Eidson.

Make sure the second request is finished before the third one so that test ends properly.

* storage/indexeddb/open-during-transaction-expected.txt:
* storage/indexeddb/open-during-transaction-private-expected.txt:
* storage/indexeddb/resources/open-during-transaction.js:
(tryOpens.openreq3.onsuccess):
(tryOpens.openreq2.onsuccess):
(tryOpens):

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

6 months agoFix an internal build failure after r240292
achristensen@apple.com [Wed, 23 Jan 2019 00:43:18 +0000 (00:43 +0000)]
Fix an internal build failure after r240292
https://bugs.webkit.org/show_bug.cgi?id=193580

Rubber-stamped by Wenson Hsieh.

* SourcesCocoa.txt:
* UIProcess/mac/WebContextMenuProxyMac.mm:
(-[WKMenuTarget forwardContextMenuAction:]):
* WebKit.xcodeproj/project.pbxproj:
It was apparently unclear to the compiler sometimes which "state" selector to use, and this apparently mattered.
Tell the compiler to use the NSMenuItem selector, but at runtime it doesn't matter.

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

6 months agoUnreviewed, fix -Wsign-compare warning
mcatanzaro@igalia.com [Wed, 23 Jan 2019 00:37:30 +0000 (00:37 +0000)]
Unreviewed, fix -Wsign-compare warning
https://bugs.webkit.org/show_bug.cgi?id=188697
<rdar://problem/46105624>

* css/StyleProperties.cpp:
(WebCore::StyleProperties::asText const):

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

6 months agoWeb Inspector: Audit: provide a way to get related Accessibility properties for a...
drousso@apple.com [Wed, 23 Jan 2019 00:32:59 +0000 (00:32 +0000)]
Web Inspector: Audit: provide a way to get related Accessibility properties for a given node
https://bugs.webkit.org/show_bug.cgi?id=193227
<rdar://problem/46787862>

Reviewed by Joseph Pecoraro.

Source/WebCore:

Test: inspector/audit/run-accessibility.html

* inspector/InspectorAuditAccessibilityObject.idl:
* inspector/InspectorAuditAccessibilityObject.h:
* inspector/InspectorAuditAccessibilityObject.cpp:
(WebCore::InspectorAuditAccessibilityObject::getComputedProperties): Added.

LayoutTests:

* inspector/audit/run-accessibility.html:
* inspector/audit/run-accessibility-expected.txt:

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

6 months agoUnreviewed, fix -Wunused-but-set-variable warning
mcatanzaro@igalia.com [Wed, 23 Jan 2019 00:32:24 +0000 (00:32 +0000)]
Unreviewed, fix -Wunused-but-set-variable warning
https://bugs.webkit.org/show_bug.cgi?id=193660
<rdar://problem/47433602>

* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::removeData):

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

6 months agoRemove an iOS quirk where iframe renderers are identified as "RenderPartObject" in...
simon.fraser@apple.com [Wed, 23 Jan 2019 00:24:04 +0000 (00:24 +0000)]
Remove an iOS quirk where iframe renderers are identified as "RenderPartObject" in layout test results
https://bugs.webkit.org/show_bug.cgi?id=193692

Reviewed by Zalan Bujtas.

Source/WebCore:

Remove the iOS-specific renderName() implementation.

* rendering/RenderIFrame.h:

LayoutTests:

Replace all instances of "RenderPartObject" with "RenderIFrame".

* platform/ios-wk1/editing/pasteboard/4631972-expected.txt:
* platform/ios-wk1/editing/pasteboard/subframe-dragndrop-1-expected.txt:
* platform/ios-wk1/editing/selection/iframe-expected.txt:
* platform/ios-wk1/editing/selection/select-all-iframe-expected.txt:
* platform/ios-wk1/fast/overflow/scrollRevealButton-expected.txt:
* platform/ios-wk1/fast/text/selection-hard-linebreak-expected.txt:
* platform/ios-wk2/compositing/iframes/compositing-for-scrollable-iframe-expected.txt:
* platform/ios-wk2/editing/pasteboard/4631972-expected.txt:
* platform/ios-wk2/editing/pasteboard/subframe-dragndrop-1-expected.txt:
* platform/ios-wk2/editing/selection/select-all-iframe-expected.txt:
* platform/ios-wk2/fast/forms/basic-textareas-expected.txt:
* platform/ios-wk2/fast/forms/tabbing-input-iframe-expected.txt:
* platform/ios-wk2/fast/forms/targeted-frame-submission-expected.txt:
* platform/ios-wk2/fast/frames/flattening/iframe-flattening-out-of-view-and-scroll-expected.txt:
* platform/ios-wk2/fast/frames/flattening/iframe-flattening-out-of-view-scroll-and-relayout-expected.txt:
* platform/ios-wk2/fast/frames/onlyCommentInIFrame-expected.txt:
* platform/ios-wk2/fast/overflow/scrollRevealButton-expected.txt:
* platform/ios-wk2/fast/replaced/border-radius-clip-expected.txt:
* platform/ios/compositing/iframes/composited-iframe-alignment-expected.txt:
* platform/ios/compositing/iframes/compositing-for-scrollable-iframe-expected.txt:
* platform/ios/compositing/iframes/iframe-copy-on-scroll-expected.txt:
* platform/ios/compositing/iframes/iframe-in-composited-layer-expected.txt:
* platform/ios/css2.1/20110323/absolute-replaced-height-004-expected.txt:
* platform/ios/css2.1/20110323/absolute-replaced-height-005-expected.txt:
* platform/ios/css2.1/20110323/absolute-replaced-height-007-expected.txt:
* platform/ios/css2.1/20110323/absolute-replaced-height-011-expected.txt:
* platform/ios/css2.1/20110323/absolute-replaced-height-012-expected.txt:
* platform/ios/css2.1/20110323/absolute-replaced-height-014-expected.txt:
* platform/ios/css2.1/20110323/absolute-replaced-height-018-expected.txt:
* platform/ios/css2.1/20110323/absolute-replaced-height-019-expected.txt:
* platform/ios/css2.1/20110323/absolute-replaced-height-021-expected.txt:
* platform/ios/css2.1/20110323/absolute-replaced-height-025-expected.txt:
* platform/ios/css2.1/20110323/absolute-replaced-height-026-expected.txt:
* platform/ios/css2.1/20110323/absolute-replaced-height-028-expected.txt:
* platform/ios/css2.1/20110323/absolute-replaced-height-032-expected.txt:
* platform/ios/css2.1/20110323/absolute-replaced-height-033-expected.txt:
* platform/ios/css2.1/20110323/absolute-replaced-height-035-expected.txt:
* platform/ios/css2.1/20110323/block-replaced-height-004-expected.txt:
* platform/ios/css2.1/20110323/block-replaced-height-005-expected.txt:
* platform/ios/css2.1/20110323/block-replaced-height-007-expected.txt:
* platform/ios/css2.1/20110323/float-replaced-height-004-expected.txt:
* platform/ios/css2.1/20110323/float-replaced-height-005-expected.txt:
* platform/ios/css2.1/20110323/float-replaced-height-007-expected.txt:
* platform/ios/css2.1/20110323/inline-block-replaced-height-004-expected.txt:
* platform/ios/css2.1/20110323/inline-block-replaced-height-005-expected.txt:
* platform/ios/css2.1/20110323/inline-block-replaced-height-007-expected.txt:
* platform/ios/css2.1/20110323/inline-replaced-height-004-expected.txt:
* platform/ios/css2.1/20110323/inline-replaced-height-005-expected.txt:
* platform/ios/css2.1/20110323/inline-replaced-height-007-expected.txt:
* platform/ios/editing/execCommand/find-after-replace-expected.txt:
* platform/ios/editing/execCommand/paste-1-expected.txt:
* platform/ios/editing/pasteboard/drag-image-to-contenteditable-in-iframe-expected.txt:
* platform/ios/editing/pasteboard/image-in-iframe-expected.txt:
* platform/ios/editing/pasteboard/paste-2-expected.txt:
* platform/ios/editing/selection/4776665-expected.txt:
* platform/ios/editing/selection/4960137-expected.txt:
* platform/ios/editing/selection/4975120-expected.txt:
* platform/ios/editing/selection/drag-in-iframe-expected.txt:
* platform/ios/editing/selection/drag-to-contenteditable-iframe-expected.txt:
* platform/ios/editing/selection/iframe-expected.txt:
* platform/ios/fast/block/basic/013-expected.txt:
* platform/ios/fast/block/positioning/window-height-change-expected.txt:
* platform/ios/fast/css/line-height-overflow-expected.txt:
* platform/ios/fast/css/resize-corner-tracking-transformed-iframe-expected.txt:
* platform/ios/fast/css3-text/css3-text-decoration/text-decoration-line-scaled-expected.txt:
* platform/ios/fast/dom/Window/open-existing-pop-up-blocking-expected.txt:
* platform/ios/fast/flexbox/016-expected.txt:
* platform/ios/fast/forms/basic-textareas-expected.txt:
* platform/ios/fast/forms/tabbing-input-iframe-expected.txt:
* platform/ios/fast/forms/targeted-frame-submission-expected.txt:
* platform/ios/fast/frames/001-expected.txt:
* platform/ios/fast/frames/flattening/iframe-flattening-fixed-height-expected.txt:
* platform/ios/fast/frames/flattening/iframe-flattening-fixed-width-and-height-expected.txt:
* platform/ios/fast/frames/flattening/iframe-flattening-fixed-width-and-height-no-scrolling-expected.txt:
* platform/ios/fast/frames/flattening/iframe-flattening-fixed-width-expected.txt:
* platform/ios/fast/frames/flattening/iframe-flattening-nested-expected.txt:
* platform/ios/fast/frames/flattening/iframe-flattening-offscreen-expected.txt:
* platform/ios/fast/frames/flattening/iframe-flattening-out-of-view-and-scroll-expected.txt:
* platform/ios/fast/frames/flattening/iframe-flattening-out-of-view-expected.txt:
* platform/ios/fast/frames/flattening/iframe-flattening-out-of-view-scroll-and-relayout-expected.txt:
* platform/ios/fast/frames/flattening/iframe-flattening-simple-expected.txt:
* platform/ios/fast/frames/frameElement-iframe-expected.txt:
* platform/ios/fast/frames/iframe-option-crash-expected.txt:
* platform/ios/fast/frames/iframe-scrolling-attribute-expected.txt:
* platform/ios/fast/frames/iframe-with-frameborder-expected.txt:
* platform/ios/fast/frames/onlyCommentInIFrame-expected.txt:
* platform/ios/fast/frames/take-focus-from-iframe-expected.txt:
* platform/ios/fast/images/favicon-as-image-expected.txt:
* platform/ios/fast/overflow/scrollRevealButton-expected.txt:
* platform/ios/fast/regions/repaint/line-flow-with-floats-in-regions-expected.txt:
* platform/ios/fast/replaced/007-expected.txt:
* platform/ios/fast/replaced/border-radius-clip-expected.txt:
* platform/ios/fast/replaced/percent-height-in-anonymous-block-in-table-expected.txt:
* platform/ios/fast/replaced/replaced-breaking-expected.txt:
* platform/ios/fast/table/quote-text-around-iframe-expected.txt:
* platform/ios/fast/text-autosizing/ios/contenteditable-expected.txt:
* platform/ios/http/tests/loading/simple-subframe-expected.txt:
* platform/ios/http/tests/local/file-url-sent-as-referer-expected.txt:
* platform/ios/http/tests/misc/favicon-as-image-expected.txt:
* platform/ios/http/tests/misc/frame-access-during-load-expected.txt:
* platform/ios/http/tests/misc/iframe404-expected.txt:
* platform/ios/http/tests/multipart/invalid-image-data-standalone-expected.txt:
* platform/ios/http/tests/security/contentSecurityPolicy/sandbox-empty-in-http-header-inherited-by-subframe-expected.txt:
* platform/ios/imported/w3c/web-platform-tests/html/dom/dynamic-markup-insertion/document-write/nested-document-write-2-expected.txt:
* platform/ios/ios/fast/fixed/frame-with-fixed-expected.txt:
* platform/ios/svg/custom/embedding-external-svgs-expected.txt:
* platform/ios/svg/hixie/rendering-model/003-expected.txt:
* platform/ios/tables/mozilla/bugs/bug131020-expected.txt:
* platform/ios/tables/mozilla/bugs/bug137388-1-expected.txt:
* platform/ios/tables/mozilla/bugs/bug137388-2-expected.txt:
* platform/ios/tables/mozilla/bugs/bug137388-3-expected.txt:
* platform/ios/tables/mozilla/bugs/bug38916-expected.txt:
* platform/ios/tables/mozilla/bugs/bug4527-expected.txt:
* platform/ios/tables/mozilla/bugs/bug50695-2-expected.txt:
* platform/ios/webarchive/loading/cache-expired-subresource-expected.txt:

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

6 months agoUnreviewed, further build fixes after r240292
mcatanzaro@igalia.com [Wed, 23 Jan 2019 00:19:13 +0000 (00:19 +0000)]
Unreviewed, further build fixes after r240292
https://bugs.webkit.org/show_bug.cgi?id=193580
<rdar://problem/47457742>

Oops.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::defaultStorageSession const):

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

6 months agoDynamic changes in the style attributes of an SVGElement do no affect the <use> instances
commit-queue@webkit.org [Wed, 23 Jan 2019 00:13:41 +0000 (00:13 +0000)]
Dynamic changes in the style attributes of an SVGElement do no affect the <use> instances
https://bugs.webkit.org/show_bug.cgi?id=193647

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

Source/WebCore:

Changing a style attribute of an SVGELement needs to call invalidateInstances().

Tests: svg/custom/svg-use-style-dynamic-change-invalidate.svg

* svg/SVGElement.cpp:
(WebCore::SVGElement::attributeChanged):

LayoutTests:

* svg/custom/svg-use-style-dynamic-change-invalidate-expected.svg: Added.
* svg/custom/svg-use-style-dynamic-change-invalidate.svg: Added.

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

6 months agoUnreviewed, further build fixes after r240292
mcatanzaro@igalia.com [Wed, 23 Jan 2019 00:10:19 +0000 (00:10 +0000)]
Unreviewed, further build fixes after r240292
https://bugs.webkit.org/show_bug.cgi?id=193580
<rdar://problem/47457742>

This builds for libsoup. Doesn't work, but at least builds.

Also, speculative fixes for curl.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::defaultStorageSession const):

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

6 months ago[ews-app] fetch loop should not stop on network issues
aakash_jain@apple.com [Wed, 23 Jan 2019 00:04:23 +0000 (00:04 +0000)]
[ews-app] fetch loop should not stop on network issues
https://bugs.webkit.org/show_bug.cgi?id=193666

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-app/ews/fetcher.py:
(FetchLoop.run): Ensure that fetch loop doesn't exit on any exception.

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

6 months agoUnreviewed, further build fixes after r240292
mcatanzaro@igalia.com [Tue, 22 Jan 2019 23:50:39 +0000 (23:50 +0000)]
Unreviewed, further build fixes after r240292
https://bugs.webkit.org/show_bug.cgi?id=193580
<rdar://problem/47457742>

Still not working yet.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::NetworkProcess):
* UIProcess/API/APIHTTPCookieStore.h:

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

6 months ago[iOS] Multiple WKWebViewAutofillTests are flaky failures
wenson_hsieh@apple.com [Tue, 22 Jan 2019 23:21:45 +0000 (23:21 +0000)]
[iOS] Multiple WKWebViewAutofillTests are flaky failures
https://bugs.webkit.org/show_bug.cgi?id=189165
<rdar://problem/47433765>

Reviewed by Tim Horton.

These tests are currently flaky because they expect an invocation of "Element.blur()" in the web process to
immediately dispatch an IPC message to notify the UI process that the element has been blurred. In particular,
the -textInputHasAutofillContext helper assumes that waiting for the next remote layer tree commit in the UI
process in sufficient to ensure that any previous action that blurred the focused element in the web process
would make its way to the UI process by the time the layer tree commit is finished.

However, WebPage::elementDidBlur sends its IPC message to the UI process asynchronously, using callOnMainThread.
This means that if a layer tree flush was already scheduled in the web process before the element was blurred,
the element blur IPC message to the UI process will lose the race against the layer tree commit, and the test
will fail because it asks for -_autofillContext too early.

To fix this, we tweak these tests to actually wait until the intended input session change triggered by script
is handled in the UI process.

* TestWebKitAPI/Tests/ios/WKWebViewAutofillTests.mm:

Tweak some of these tests to wait for input session changes before checking for the presence of an autofill
context. The only exception is an existing test that doesn't allow programmatic focus to begin input sessions
by default; to fix this test, we simply wait for _WKInputDelegate to be invoked, instead of waiting for a new
input session.

(-[AutofillTestView textInputHasAutofillContext]):

Remove the incorrect presentation update here. This helper now assumes that the UI process is up to date.

* TestWebKitAPI/cocoa/TestWKWebView.h:
* TestWebKitAPI/cocoa/TestWKWebView.mm:
(nextInputSessionChangeCount):

Monotonically increasing identifier that's incremented whenever an input session is started in the UI process.
This includes changing the focused element from one to another.

(-[TestWKWebView initWithFrame:configuration:addToWindow:]):
(-[TestWKWebView didStartFormControlInteraction]):
(-[TestWKWebView didEndFormControlInteraction]):
(-[TestWKWebView evaluateJavaScriptAndWaitForInputSessionToChange:]):

Add a helper to evaluate JavaScript and wait for this script to cause some change in the input session. This
handles three cases: (1) changing focus from an element that doesn't require an input session to one that does,
(2) changing focus between elements that require input sessions, and (3) changing focus from an input session
that doesn't require an input session to one that doesn't.

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

6 months agocheck-webkit-style reports false-positive whitespace/init warning in C++ initializati...
ddkilzer@apple.com [Tue, 22 Jan 2019 22:51:19 +0000 (22:51 +0000)]
check-webkit-style reports false-positive whitespace/init warning in C++ initialization parameters
<https://webkit.org/b/193676>

Reviewed by Alexey Proskuryakov.

* Scripts/webkitpy/style/checkers/cpp.py:
(check_member_initialization_list):
- Don't report missing whitespace around colon if the colon at
  the start of the line is formatted correctly.
* Scripts/webkitpy/style/checkers/cpp_unittest.py:
(WebKitStyleTest.test_member_initialization_list):
- Add a test for a missing permutation of existing tests.
- Add a test this false-positive.
- Add blank lines between subtests to make them easier to read.

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

6 months ago[iOS] Flash when swiping back to Google search result page
antti@apple.com [Tue, 22 Jan 2019 22:31:36 +0000 (22:31 +0000)]
[iOS] Flash when swiping back to Google search result page
https://bugs.webkit.org/show_bug.cgi?id=193668
<rdar://problem/47071684>

Reviewed by Simon Fraser.

If the google page is scrolled, there is sometimes a short flash.

When restoring the page state we also restore exposedContentRect which is used to determine
which part of the page to create layers for. Scroll position is restored by the UI process
later so we rely on this to get the right layers for the initial view update.

A viewport configuration update may sometimes trample over the restored exposedContentRect,
moving it to top left. In this case the initial layer tree unfreeze commit may not have
layers to cover the actual visible view position.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::didCommitLoad):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::restorePageState):

Set a bit to indicate we have already restored the exposedContentRect.

(WebKit::WebPage::viewportConfigurationChanged):

Only reset exposedContentRect if wasn't already set by restorePageState.

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

6 months agoFix more builds.
achristensen@apple.com [Tue, 22 Jan 2019 22:10:51 +0000 (22:10 +0000)]
Fix more builds.

Source/WebCore:

* platform/network/curl/CurlResourceHandleDelegate.cpp:
(WebCore::handleCookieHeaders):
(WebCore::CurlResourceHandleDelegate::curlDidReceiveResponse):

Source/WebKit:

* SourcesCocoa.txt:
* WebKit.xcodeproj/project.pbxproj:

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

6 months agoAnother build fix after r240292
mcatanzaro@igalia.com [Tue, 22 Jan 2019 22:04:56 +0000 (22:04 +0000)]
Another build fix after r240292
https://bugs.webkit.org/show_bug.cgi?id=193580
<rdar://problem/47457742>

Unreviewed, still not enough to fix soup builds, but closer.

* UIProcess/API/APIHTTPCookieStore.h:

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

6 months agoFix some builds after r240292
achristensen@apple.com [Tue, 22 Jan 2019 21:52:10 +0000 (21:52 +0000)]
Fix some builds after r240292
https://bugs.webkit.org/show_bug.cgi?id=193580

Source/WebCore:

* platform/network/curl/ResourceHandleCurl.cpp:
(WebCore::ResourceHandle::createCurlRequest):
(WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
(WebCore::ResourceHandle::receivedCredential):
(WebCore::ResourceHandle::getCredential):

Source/WebKit:

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::switchToNewTestingSession):
* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::Cache::retrieve):

Source/WebKitLegacy:

* WebCoreSupport/NetworkStorageSessionMap.cpp:

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

6 months agoAutomation.computeElementLayout should return visual viewport-aware coordinates
bburg@apple.com [Tue, 22 Jan 2019 21:45:07 +0000 (21:45 +0000)]
Automation.computeElementLayout should return visual viewport-aware coordinates
https://bugs.webkit.org/show_bug.cgi?id=193598
<rdar://problem/35325644>

Unreviewed, restore a mistakenly-deleted line whose absence causes hangs.

* Shared/CoordinateSystem.h:

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

6 months agoUnreviewed, skip all resource load statistics tests on GTK
mcatanzaro@igalia.com [Tue, 22 Jan 2019 21:34:34 +0000 (21:34 +0000)]
Unreviewed, skip all resource load statistics tests on GTK

We don't have this feature enabled yet, so shouldn't be running the tests. Yet.

* platform/gtk/TestExpectations:

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

6 months agoMove NetworkStorageSession ownership to NetworkProcess
achristensen@apple.com [Tue, 22 Jan 2019 21:28:28 +0000 (21:28 +0000)]
Move NetworkStorageSession ownership to NetworkProcess
https://bugs.webkit.org/show_bug.cgi?id=193580

Reviewed by Geoff Garen.

Source/WebCore:

NetworkStorageSessions used to be owned by a process-global map living in WebCore.
This patch moves the ownership to the WebKit/WebKitLegacy layer.
In WebKitLegacy they are still owned by a process-global map for compatibility.
In WebKit they are owned by a map owned by the NetworkProcess object.
There were three non-NetworkProcess uses of NetworkStorageSessions which have been dealt with thusly:
1. The WebProcess used to clear credentials from a NetworkStorageSession.  Since this was the only use
of a NetworkStorageSession in the WebProcess we can conclude there were no credentials to clear,
so this code was removed with no change in behavior.
2. The WebProcess used NetworkStorageSessions to get persistent credentials.  This was turned
into a static method that does the same thing.  We should audit these calls and decide if we really want them.
3. The UIProcess used NetworkStorageSessions in APIHTTPCookieStore to interact with the default cookie
storage on Cocoa platforms.  This has been replaced by functions that do the same thing directly.

* platform/network/CredentialStorage.h:
* platform/network/NetworkStorageSession.cpp:
(WebCore::NetworkStorageSession::processMayUseCookieAPI):
(WebCore::NetworkStorageSession::globalSessionMap): Deleted.
(WebCore::NetworkStorageSession::storageSession): Deleted.
(WebCore::NetworkStorageSession::destroySession): Deleted.
(WebCore::NetworkStorageSession::forEach): Deleted.
* platform/network/NetworkStorageSession.h:
* platform/network/cf/NetworkStorageSessionCFNet.cpp:
(WebCore::NetworkStorageSession::createCFStorageSessionForIdentifier):
(WebCore::createCFStorageSessionForIdentifier): Deleted.
(WebCore::defaultNetworkStorageSession): Deleted.
(WebCore::NetworkStorageSession::switchToNewTestingSession): Deleted.
(WebCore::NetworkStorageSession::defaultStorageSession): Deleted.
(WebCore::NetworkStorageSession::ensureSession): Deleted.
* platform/network/cf/SocketStreamHandleImplCFNet.cpp:
(WebCore::SocketStreamHandleImpl::getStoredCONNECTProxyCredentials):
* platform/network/cocoa/CookieStorageObserver.h:
* platform/network/curl/NetworkStorageSessionCurl.cpp:
(WebCore::defaultSession): Deleted.
(WebCore::NetworkStorageSession::defaultStorageSession): Deleted.
(WebCore::NetworkStorageSession::ensureSession): Deleted.
(WebCore::NetworkStorageSession::switchToNewTestingSession): Deleted.
* platform/network/soup/NetworkStorageSessionSoup.cpp:
(WebCore::NetworkStorageSession::clearSoupNetworkSessionAndCookieStorage):
(WebCore::defaultSession): Deleted.
(WebCore::NetworkStorageSession::defaultStorageSession): Deleted.
(WebCore::NetworkStorageSession::ensureSession): Deleted.
(WebCore::NetworkStorageSession::switchToNewTestingSession): Deleted.

Source/WebKit:

* NetworkProcess/Cookies/WebCookieManager.cpp:
(WebKit::WebCookieManager::WebCookieManager):
(WebKit::WebCookieManager::getHostnamesWithCookies):
(WebKit::WebCookieManager::deleteCookiesForHostname):
(WebKit::WebCookieManager::deleteAllCookies):
(WebKit::WebCookieManager::deleteCookie):
(WebKit::WebCookieManager::deleteAllCookiesModifiedSince):
(WebKit::WebCookieManager::getAllCookies):
(WebKit::WebCookieManager::getCookies):
(WebKit::WebCookieManager::setCookie):
(WebKit::WebCookieManager::setCookies):
(WebKit::WebCookieManager::startObservingCookieChanges):
(WebKit::WebCookieManager::stopObservingCookieChanges):
* NetworkProcess/Cookies/WebCookieManager.h:
* NetworkProcess/Cookies/mac/WebCookieManagerMac.mm:
(WebKit::WebCookieManager::platformSetHTTPCookieAcceptPolicy):
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::storageSession):
(WebKit::NetworkConnectionToWebProcess::cookiesForDOM):
(WebKit::NetworkConnectionToWebProcess::setCookiesFromDOM):
(WebKit::NetworkConnectionToWebProcess::cookiesEnabled):
(WebKit::NetworkConnectionToWebProcess::cookieRequestHeaderFieldValue):
(WebKit::NetworkConnectionToWebProcess::getRawCookies):
(WebKit::NetworkConnectionToWebProcess::deleteCookie):
(WebKit::NetworkConnectionToWebProcess::removeStorageAccessForFrame):
(WebKit::NetworkConnectionToWebProcess::removeStorageAccessForAllFramesOnPage):
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::initializeNetworkProcess):
(WebKit::NetworkProcess::clearCachedCredentials):
(WebKit::NetworkProcess::switchToNewTestingSession):
(WebKit::NetworkProcess::ensureSession):
(WebKit::NetworkProcess::storageSession const):
(WebKit::NetworkProcess::defaultStorageSession const):
(WebKit::NetworkProcess::forEachNetworkStorageSession):
(WebKit::NetworkProcess::destroySession):
(WebKit::NetworkProcess::updatePrevalentDomainsToBlockCookiesFor):
(WebKit::NetworkProcess::setAgeCapForClientSideCookies):
(WebKit::NetworkProcess::hasStorageAccessForFrame):
(WebKit::NetworkProcess::getAllStorageAccessEntries):
(WebKit::NetworkProcess::grantStorageAccess):
(WebKit::NetworkProcess::removeAllStorageAccess):
(WebKit::NetworkProcess::removePrevalentDomains):
(WebKit::NetworkProcess::setCacheMaxAgeCapForPrevalentResources):
(WebKit::NetworkProcess::resetCacheMaxAgeCapForPrevalentResources):
(WebKit::NetworkProcess::fetchWebsiteData):
(WebKit::NetworkProcess::deleteWebsiteData):
(WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::validateCacheEntryForMaxAgeCapValidation):
(WebKit::NetworkResourceLoader::logCookieInformation const):
* NetworkProcess/NetworkSession.cpp:
(WebKit::NetworkSession::networkStorageSession const):
* NetworkProcess/NetworkStorageSessionProvider.h:
* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::makeUseDecision):
(WebKit::NetworkCache::Cache::retrieve):
(WebKit::NetworkCache::Cache::makeEntry):
(WebKit::NetworkCache::Cache::makeRedirectEntry):
(WebKit::NetworkCache::Cache::update):
* NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
(WebKit::NetworkCache::SpeculativeLoad::willSendRedirectedRequest):
* NetworkProcess/cocoa/NetworkProcessCocoa.mm:
(WebKit::NetworkProcess::platformSyncAllCookies):
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
(-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]):
(-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
(WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
* NetworkProcess/mac/RemoteNetworkingContext.mm:
(WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
* SourcesCocoa.txt:
* UIProcess/API/APIHTTPCookieStore.cpp:
(API::HTTPCookieStore::~HTTPCookieStore):
(API::HTTPCookieStore::cookies):
(API::HTTPCookieStore::setCookie):
(API::HTTPCookieStore::deleteCookie):
(API::HTTPCookieStore::registerObserver):
(API::HTTPCookieStore::unregisterObserver):
(API::HTTPCookieStore::registerForNewProcessPoolNotifications):
(API::HTTPCookieStore::flushDefaultUIProcessCookieStore):
(API::HTTPCookieStore::getAllDefaultUIProcessCookieStoreCookies):
(API::HTTPCookieStore::setCookieInDefaultUIProcessCookieStore):
(API::HTTPCookieStore::deleteCookieFromDefaultUIProcessCookieStore):
(API::HTTPCookieStore::startObservingChangesToDefaultUIProcessCookieStore):
(API::HTTPCookieStore::stopObservingChangesToDefaultUIProcessCookieStore):
* UIProcess/API/APIHTTPCookieStore.h:
* UIProcess/API/Cocoa/APIHTTPCookieStoreCocoa.mm: Added.
(API::HTTPCookieStore::flushDefaultUIProcessCookieStore):
(API::HTTPCookieStore::getAllDefaultUIProcessCookieStoreCookies):
(API::HTTPCookieStore::setCookieInDefaultUIProcessCookieStore):
(API::HTTPCookieStore::deleteCookieFromDefaultUIProcessCookieStore):
(API::HTTPCookieStore::startObservingChangesToDefaultUIProcessCookieStore):
(API::HTTPCookieStore::stopObservingChangesToDefaultUIProcessCookieStore):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::clearCachedCredentials):
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::getAuthenticationInfo):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::deleteWebsiteData):
(WebKit::WebProcess::clearCachedCredentials): Deleted.
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:

Source/WebKitLegacy:

* WebCoreSupport/NetworkStorageSessionMap.cpp: Added.
(defaultNetworkStorageSession):
(globalSessionMap):
(NetworkStorageSessionMap::storageSession):
(NetworkStorageSessionMap::defaultStorageSession):
(NetworkStorageSessionMap::switchToNewTestingSession):
(NetworkStorageSessionMap::ensureSession):
(NetworkStorageSessionMap::destroySession):
* WebCoreSupport/NetworkStorageSessionMap.h: Added.
* WebCoreSupport/PageStorageSessionProvider.h:
* WebKitLegacy.xcodeproj/project.pbxproj:

Source/WebKitLegacy/mac:

* Misc/WebCache.mm:
(+[WebCache clearCachedCredentials]):
* Misc/WebDownload.mm:
(-[WebDownloadInternal download:didReceiveAuthenticationChallenge:]):
* Plugins/WebBaseNetscapePluginView.mm:
(WebKit::getAuthenticationInfo):
* WebCoreSupport/WebFrameNetworkingContext.mm:
(WebFrameNetworkingContext::ensurePrivateBrowsingSession):
(WebFrameNetworkingContext::destroyPrivateBrowsingSession):
(WebFrameNetworkingContext::storageSession const):
* WebView/WebPreferences.mm:
(+[WebPreferences _switchNetworkLoaderToNewTestingSession]):
(+[WebPreferences _clearNetworkLoaderSession]):
(+[WebPreferences _setCurrentNetworkLoaderSessionCookieAcceptPolicy:]):

Source/WebKitLegacy/win:

* WebCoreSupport/WebFrameNetworkingContext.cpp:
(WebFrameNetworkingContext::setCookieAcceptPolicyForAllContexts):
(WebFrameNetworkingContext::ensurePrivateBrowsingSession):
(WebFrameNetworkingContext::destroyPrivateBrowsingSession):
(WebFrameNetworkingContext::storageSession const):
* WebDownloadCFNet.cpp:
(WebDownload::didReceiveAuthenticationChallenge):
* WebPreferences.cpp:
(WebPreferences::clearNetworkLoaderSession):
(WebPreferences::switchNetworkLoaderToNewTestingSession):

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

6 months ago[build.webkit.org] Unit-test failure after r237113
aakash_jain@apple.com [Tue, 22 Jan 2019 21:25:06 +0000 (21:25 +0000)]
[build.webkit.org] Unit-test failure after r237113
https://bugs.webkit.org/show_bug.cgi?id=193669

Reviewed by Michael Catanzaro.

* BuildSlaveSupport/build.webkit.org-config/factories.py:
(Factory.__init__): Properly check for --no-experimental-features flag when additionalArguments has
multiple or zero flags.

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

6 months agoWeb Inspector: Network Table appears broken after filter - rows look collapsed
commit-queue@webkit.org [Tue, 22 Jan 2019 21:23:31 +0000 (21:23 +0000)]
Web Inspector: Network Table appears broken after filter - rows look collapsed
https://bugs.webkit.org/show_bug.cgi?id=192730
<rdar://problem/46853158>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2019-01-22
Reviewed by Devin Rousso.

* UserInterface/Views/Table.js:
(WI.Table.prototype._applyColumnWidthsToColumnsIfNeeded):
Affect the filler row like the other applyColumnWidths calls since this
now may be the initial call to size visible columns.

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

6 months ago[macOS] Adjust logging policy in WebKit's sandbox
pvollan@apple.com [Tue, 22 Jan 2019 21:22:34 +0000 (21:22 +0000)]
[macOS] Adjust logging policy in WebKit's sandbox
https://bugs.webkit.org/show_bug.cgi?id=193454

Reviewed by Brent Fulgham.

Add a rule to initially deny all calls, since the default is to allow every call.
Later rules allow syscalls that we determined are needed for proper WebKit function.
This reduces the API surface available to attackers.

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

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

6 months ago[iOS] WebKit should handle shift state changes when using the software keyboard
dbates@webkit.org [Tue, 22 Jan 2019 21:15:35 +0000 (21:15 +0000)]
[iOS] WebKit should handle shift state changes when using the software keyboard
https://bugs.webkit.org/show_bug.cgi?id=191475
<rdar://problem/45949246>

Reviewed by Brent Fulgham.

Implement UIKit SPI to be notified of shift state changes to the software keyboard
and dispatch a synthetic keydown or keyup event for either the Shift key or Caps Lock
key.

A side benefit of this change is that we now show and hide the caps lock indicator
in a focused password field when caps lock is enabled or disabled using the software
keyboard, respectively.

* Platform/spi/ios/UIKitSPI.h: Expose more SPI.
* SourcesCocoa.txt:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView modifierFlagsDidChangeFrom:to:]): Create a synthetic flags changed
web event based on the state change and dispatch it.
(-[WKContentView _didHandleKeyEvent:eventWasHandled:]): Early return if the event
was a synethic flags change event so that we do not notify UIKit about this event
as it does not know anything about such synthetic events.
* UIProcess/ios/WKSyntheticFlagsChangedWebEvent.h: Added.
* UIProcess/ios/WKSyntheticFlagsChangedWebEvent.mm: Added.
(-[WKSyntheticFlagsChangedWebEvent initWithKeyCode:modifiers:keyDown:]):
(-[WKSyntheticFlagsChangedWebEvent initWithCapsLockState:]):
(-[WKSyntheticFlagsChangedWebEvent initWithShiftState:]):
* WebKit.xcodeproj/project.pbxproj:

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

6 months ago[iOS] Interpret text key commands on keydown and app key commands on keypress
dbates@webkit.org [Tue, 22 Jan 2019 20:59:48 +0000 (20:59 +0000)]
[iOS] Interpret text key commands on keydown and app key commands on keypress
https://bugs.webkit.org/show_bug.cgi?id=192897
<rdar://problem/46857378>

Reviewed by Brent Fulgham.

Source/WebKit:

Adopt SPI to interpret text key commands and app key commands independently on keydown (isCharEvent
is false) and keypress (isCharEvent is true), respectively.

* Platform/spi/ios/UIKitSPI.h: Add more SPI.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _interpretKeyEvent:isCharEvent:]):

Source/WebKitLegacy/ios:

Add stubs for SPI.

* DefaultDelegates/WebDefaultUIKitDelegate.m:
(-[WebDefaultUIKitDelegate handleKeyTextCommandForCurrentEvent]): Added.
(-[WebDefaultUIKitDelegate handleKeyAppCommandForCurrentEvent]): Added.
(-[WebDefaultUIKitDelegate handleKeyCommandForCurrentEvent]): Deleted.
* WebView/WebUIKitDelegate.h:

Source/WebKitLegacy/mac:

Adopt SPI to interpret text key commands and app key commands independently on keydown (isCharEvent
is false) and keypress (isCharEvent is true), respectively.

* WebView/WebHTMLView.mm:
(-[WebHTMLView _handleEditingKeyEvent:]):

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

6 months agoWeb Inspector: Audit: provide a way to get related Accessibility nodes for a given...
drousso@apple.com [Tue, 22 Jan 2019 20:52:53 +0000 (20:52 +0000)]
Web Inspector: Audit: provide a way to get related Accessibility nodes for a given node
https://bugs.webkit.org/show_bug.cgi?id=193225
<rdar://problem/46799956>

Reviewed by Joseph Pecoraro.

Source/WebCore:

Test: inspector/audit/run-accessibility.html

* inspector/InspectorAuditAccessibilityObject.idl:
* inspector/InspectorAuditAccessibilityObject.h:
* inspector/InspectorAuditAccessibilityObject.cpp:
(WebCore::InspectorAuditAccessibilityObject::getActiveDescendant): Added.
(WebCore::addChildren): Added.
(WebCore::InspectorAuditAccessibilityObject::getChildNodes): Added.
(WebCore::InspectorAuditAccessibilityObject::getControlledNodes): Added.
(WebCore::InspectorAuditAccessibilityObject::getFlowedNodes): Added.
(WebCore::InspectorAuditAccessibilityObject::getMouseEventNode): Added.
(WebCore::InspectorAuditAccessibilityObject::getOwnedNodes): Added.
(WebCore::InspectorAuditAccessibilityObject::getParentNode): Added.
(WebCore::InspectorAuditAccessibilityObject::getSelectedChildNodes): Added.

LayoutTests:

* inspector/audit/run-accessibility.html:
* inspector/audit/run-accessibility-expected.txt:

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

6 months agoC strings in ClientCertificateAuthenticationXPCConstants.h are duplicated
ddkilzer@apple.com [Tue, 22 Jan 2019 20:49:55 +0000 (20:49 +0000)]
C strings in ClientCertificateAuthenticationXPCConstants.h are duplicated
<https://webkit.org/b/193607>
<rdar://problem/47334613>

Reviewed by Alex Christensen.

* Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm:
(WebKit::AuthenticationManager::initializeConnection):
* UIProcess/Authentication/cocoa/AuthenticationChallengeProxyCocoa.mm:
(WebKit::AuthenticationChallengeProxy::sendClientCertificateCredentialOverXpc):
- Update name of constants.

* Shared/Authentication/cocoa/ClientCertificateAuthenticationXPCConstants.cpp: Copied from Source/WebKit/Shared/Authentication/cocoa/ClientCertificateAuthenticationXPCConstants.h.
* Shared/Authentication/cocoa/ClientCertificateAuthenticationXPCConstants.h:
- Put constant values in a namespace, and move values to
  ClientCertificateAuthenticationXPCConstants.cpp.

* SourcesCocoa.txt:
* UnifiedSources-input.xcfilelist:
* WebKit.xcodeproj/project.pbxproj:
- Add ClientCertificateAuthenticationXPCConstants.cpp.

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

6 months ago[JSC] Intl constructors should fit in sizeof(InternalFunction)
ysuzuki@apple.com [Tue, 22 Jan 2019 20:33:37 +0000 (20:33 +0000)]
[JSC] Intl constructors should fit in sizeof(InternalFunction)
https://bugs.webkit.org/show_bug.cgi?id=193661

Reviewed by Mark Lam.

Previously all the Intl constructors have their own subspace. This is because these constructors have different size from InternalFunction.
But it is too costly approach in terms of the memory usage since these constructors are only one per JSGlobalObject. This patch attempts to
reduce the memory size consumed by these Intl objects by holding instance structures in IntlObject instead of in each Intl constructors.
So that we can make sizeof(Intl constructors) == sizeof(InternalFunction) and drop costly subspaces. Since this patch drops subspaces in VM,
it also significantly reduces the sizeof(VM), from 76696 to 74680.

This patch also includes the preparation for making Intl properties lazy. But currently it is not possible since @Collator reference exists
in builtin code.

* CMakeLists.txt:
* DerivedSources.make:
* runtime/IntlCollatorConstructor.cpp:
(JSC::IntlCollatorConstructor::create):
(JSC::IntlCollatorConstructor::finishCreation):
(JSC::constructIntlCollator):
(JSC::callIntlCollator):
(JSC::IntlCollatorConstructor::visitChildren): Deleted.
* runtime/IntlCollatorConstructor.h:
* runtime/IntlDateTimeFormatConstructor.cpp:
(JSC::IntlDateTimeFormatConstructor::create):
(JSC::IntlDateTimeFormatConstructor::finishCreation):
(JSC::constructIntlDateTimeFormat):
(JSC::callIntlDateTimeFormat):
(JSC::IntlDateTimeFormatConstructor::visitChildren): Deleted.
* runtime/IntlDateTimeFormatConstructor.h:
* runtime/IntlNumberFormatConstructor.cpp:
(JSC::IntlNumberFormatConstructor::create):
(JSC::IntlNumberFormatConstructor::finishCreation):
(JSC::constructIntlNumberFormat):
(JSC::callIntlNumberFormat):
(JSC::IntlNumberFormatConstructor::visitChildren): Deleted.
* runtime/IntlNumberFormatConstructor.h:
* runtime/IntlObject.cpp:
(JSC::createCollatorConstructor):
(JSC::createNumberFormatConstructor):
(JSC::createDateTimeFormatConstructor):
(JSC::createPluralRulesConstructor):
(JSC::IntlObject::create):
(JSC::IntlObject::finishCreation):
(JSC::IntlObject::visitChildren):
* runtime/IntlObject.h:
* runtime/IntlPluralRulesConstructor.cpp:
(JSC::IntlPluralRulesConstructor::create):
(JSC::IntlPluralRulesConstructor::finishCreation):
(JSC::constructIntlPluralRules):
(JSC::IntlPluralRulesConstructor::visitChildren): Deleted.
* runtime/IntlPluralRulesConstructor.h:
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
(JSC::JSGlobalObject::visitChildren):
* runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::intlObject const):
* runtime/VM.cpp:
(JSC::VM::VM):
* runtime/VM.h:

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

6 months agoSwitch remaining QuickLook soft-linking in WebCore, WebKit over to QuickLookSoftLink...
ddkilzer@apple.com [Tue, 22 Jan 2019 20:12:37 +0000 (20:12 +0000)]
Switch remaining QuickLook soft-linking in WebCore, WebKit over to QuickLookSoftLink.{cpp,h}
<https://webkit.org/b/193654>
<rdar://problem/47430290>

Reviewed by Alex Christensen.

- Moves QuickLookSoftLink.{h,mm} to PAL.
- Adds soft-link to 3 classes to consolidate QuickLook.framework
  soft-linking.
- Updates existing source to work with above changes.

Source/WebCore:

* SourcesCocoa.txt:
* UnifiedSources-input.xcfilelist:
* WebCore.xcodeproj/project.pbxproj:
- Remove QuickLookSoftLink.{h,mm} due to move to PAL.

* platform/ios/QuickLook.mm:
(WebCore::QLPreviewGetSupportedMIMETypesSet):
(WebCore::registerQLPreviewConverterIfNeeded):
- Update for QuickLookSoftLink.{h,mm} move to PAL.

* platform/network/ios/PreviewConverter.mm:
(WebCore::optionsWithPassword):
(WebCore::PreviewConverter::PreviewConverter):
- Switch to using QuickLookSoftLink.{h,mm} in PAL.

* platform/network/ios/WebCoreURLResponseIOS.mm:
(WebCore::adjustMIMETypeIfNecessary):
- Update for QuickLookSoftLink.{h,mm} move to PAL.

Source/WebCore/PAL:

* PAL.xcodeproj/project.pbxproj:
- Add QuickLookSoftLink.{h,mm} due to move from WebCore.

* pal/ios/QuickLookSoftLink.h: Renamed from Source/WebCore/platform/ios/QuickLookSoftLink.h.
* pal/ios/QuickLookSoftLink.mm: Renamed from Source/WebCore/platform/ios/QuickLookSoftLink.mm.
- Add 3 classes for soft-linking.
- Change namespace from WebCore to PAL.

Source/WebKit:

* UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
(-[_WKPreviewControllerDataSource previewController:previewItemAtIndex:]):
(WebKit::SystemPreviewController::start):
* UIProcess/ios/WKSystemPreviewView.mm:
(-[WKSystemPreviewView web_setContentProviderData:suggestedFilename:]):
- Switch to using QuickLookSoftLink.{h,mm} in PAL.

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

6 months agoFix the position of layers nested inside of composited overflow-scroll
simon.fraser@apple.com [Tue, 22 Jan 2019 19:55:00 +0000 (19:55 +0000)]
Fix the position of layers nested inside of composited overflow-scroll
https://bugs.webkit.org/show_bug.cgi?id=193642

Reviewed by Antti Koivisto and Sam Weinig.
Source/WebCore:

Remove an iOS #ifdef so that layers inside composited overflow gets the correct
positions on macOS too.

Test: compositing/geometry/fixed-inside-overflow-scroll.html

* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::computeParentGraphicsLayerRect const):

LayoutTests:

Ref test. Black bar obscures the area that's different because of overlay/non-overlay
scrollbar differences between macOS and iOS.

* compositing/geometry/fixed-inside-overflow-scroll-expected.html: Added.
* compositing/geometry/fixed-inside-overflow-scroll.html: Added.

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

6 months agoWeb Inspector: Audit: use plural strings for Passed, Failed, and Unsupported
drousso@apple.com [Tue, 22 Jan 2019 19:54:05 +0000 (19:54 +0000)]
Web Inspector: Audit: use plural strings for Passed, Failed, and Unsupported
https://bugs.webkit.org/show_bug.cgi?id=193675
<rdar://problem/46628680>

Reviewed by Joseph Pecoraro.

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

* Localizations/en.lproj/localizedStrings.js:

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

6 months agoUnreviewed. Rollout r240223. It regressed JetStream2 by 1%.
sbarati@apple.com [Tue, 22 Jan 2019 19:41:10 +0000 (19:41 +0000)]
Unreviewed. Rollout r240223. It regressed JetStream2 by 1%.

JSTests:

* stress/arith-abs-to-arith-negate-range-optimizaton.js:
(testUncheckedBetweenIntMinInclusiveAndZeroExclusive):
(testUncheckedLessThanZero):
(testUncheckedLessThanOrEqualZero):
* stress/movhint-backwards-propagation-must-merge-use-as-value-add.js: Removed.
* stress/movhint-backwards-propagation-must-merge-use-as-value.js: Removed.

Source/JavaScriptCore:

* dfg/DFGBackwardsPropagationPhase.cpp:
(JSC::DFG::BackwardsPropagationPhase::propagate):

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

6 months ago[GTK] Build fix for Ubuntu LTS 16.04
csaavedra@igalia.com [Tue, 22 Jan 2019 19:06:42 +0000 (19:06 +0000)]
[GTK] Build fix for Ubuntu LTS 16.04
https://bugs.webkit.org/show_bug.cgi?id=193672

Unreviewed build fix.

* html/canvas/CanvasStyle.h: Add default copy constructor for
CMYKAColor struct.

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

6 months agoUnreviewed, restore bytecode cache-related JSC options deleted in r240254
tzagallo@apple.com [Tue, 22 Jan 2019 18:33:18 +0000 (18:33 +0000)]
Unreviewed, restore bytecode cache-related JSC options deleted in r240254
https://bugs.webkit.org/show_bug.cgi?id=192782

The JSC options were committed as part of r240210, which got rolled out in
r240224. However, the options got re-landed in r240248  and then deleted
again in 240254 (immediately before the caching code code landed in 240255)

* runtime/Options.h:

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

6 months agoLeak of NSMutableArray (128 bytes) in com.apple.WebKit.WebContent running WebKit...
ddkilzer@apple.com [Tue, 22 Jan 2019 18:15:00 +0000 (18:15 +0000)]
Leak of NSMutableArray (128 bytes) in com.apple.WebKit.WebContent running WebKit layout tests
<https://webkit.org/b/193673>
<rdar://problem/47448241>

Reviewed by Dean Jackson.

* platform/graphics/gpu/cocoa/GPUBindGroupLayoutMetal.mm:
(WebCore::appendArgumentToArray): Use adoptNS() to fix the leak.

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

6 months agoCache bytecode to disk
tzagallo@apple.com [Tue, 22 Jan 2019 18:00:14 +0000 (18:00 +0000)]
Cache bytecode to disk
https://bugs.webkit.org/show_bug.cgi?id=192782
<rdar://problem/46084932>

Reviewed by Keith Miller.

Source/JavaScriptCore:

Add the logic to serialize and deserialize the new JSC bytecode. For now,
the cache is only used for tests.

Each class that can be serialized has a counterpart in CachedTypes, which
handles the decoding and encoding. When decoding, the cached objects are
mmap'd from disk, but only used for creating instances of the respective
in-memory version of each object. Ideally, the mmap'd objects should be
used at runtime in the future.

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* Sources.txt:
* builtins/BuiltinNames.cpp:
(JSC::BuiltinNames::BuiltinNames):
* builtins/BuiltinNames.h:
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::setConstantIdentifierSetRegisters):
* bytecode/CodeBlock.h:
* bytecode/HandlerInfo.h:
(JSC::UnlinkedHandlerInfo::UnlinkedHandlerInfo):
* bytecode/InstructionStream.h:
* bytecode/UnlinkedCodeBlock.h:
(JSC::UnlinkedCodeBlock::addSetConstant):
(JSC::UnlinkedCodeBlock::constantIdentifierSets):
* bytecode/UnlinkedEvalCodeBlock.h:
* bytecode/UnlinkedFunctionCodeBlock.h:
* bytecode/UnlinkedFunctionExecutable.h:
* bytecode/UnlinkedGlobalCodeBlock.h:
(JSC::UnlinkedGlobalCodeBlock::UnlinkedGlobalCodeBlock):
* bytecode/UnlinkedMetadataTable.h:
* bytecode/UnlinkedModuleProgramCodeBlock.h:
* bytecode/UnlinkedProgramCodeBlock.h:
* interpreter/Interpreter.cpp:
* jsc.cpp:
(functionQuit):
(runJSC):
* parser/SourceCode.h:
* parser/SourceCodeKey.h:
(JSC::SourceCodeKey::operator!= const):
* parser/UnlinkedSourceCode.h:
* parser/VariableEnvironment.h:
* runtime/CachedTypes.cpp: Added.
(JSC::Encoder::Allocation::buffer const):
(JSC::Encoder::Allocation::offset const):
(JSC::Encoder::Allocation::Allocation):
(JSC::Encoder::Encoder):
(JSC::Encoder::vm):
(JSC::Encoder::malloc):
(JSC::Encoder::offsetOf):
(JSC::Encoder::cachePtr):
(JSC::Encoder::offsetForPtr):
(JSC::Encoder::release):
(JSC::Encoder::Page::Page):
(JSC::Encoder::Page::malloc):
(JSC::Encoder::Page::buffer const):
(JSC::Encoder::Page::size const):
(JSC::Encoder::Page::getOffset const):
(JSC::Encoder::allocateNewPage):
(JSC::Decoder::Decoder):
(JSC::Decoder::~Decoder):
(JSC::Decoder::vm):
(JSC::Decoder::offsetOf):
(JSC::Decoder::cacheOffset):
(JSC::Decoder::addFinalizer):
(JSC::encode):
(JSC::decode):
(JSC::VariableLengthObject::buffer const):
(JSC::VariableLengthObject::allocate):
(JSC::CachedPtr::encode):
(JSC::CachedPtr::decode const):
(JSC::CachedPtr::operator-> const):
(JSC::CachedPtr::get const):
(JSC::CachedRefPtr::encode):
(JSC::CachedRefPtr::decode const):
(JSC::CachedWriteBarrier::encode):
(JSC::CachedWriteBarrier::decode const):
(JSC::CachedVector::encode):
(JSC::CachedVector::decode const):
(JSC::CachedPair::encode):
(JSC::CachedPair::decode const):
(JSC::CachedHashMap::encode):
(JSC::CachedHashMap::decode const):
(JSC::CachedUniquedStringImpl::encode):
(JSC::CachedUniquedStringImpl::decode const):
(JSC::CachedStringImpl::encode):
(JSC::CachedStringImpl::decode const):
(JSC::CachedString::encode):
(JSC::CachedString::decode const):
(JSC::CachedIdentifier::encode):
(JSC::CachedIdentifier::decode const):
(JSC::CachedOptional::encode):
(JSC::CachedOptional::decode const):
(JSC::CachedOptional::decodeAsPtr const):
(JSC::CachedSimpleJumpTable::encode):
(JSC::CachedSimpleJumpTable::decode const):
(JSC::CachedStringJumpTable::encode):
(JSC::CachedStringJumpTable::decode const):
(JSC::CachedCodeBlockRareData::encode):
(JSC::CachedCodeBlockRareData::decode const):
(JSC::CachedBitVector::encode):
(JSC::CachedBitVector::decode const):
(JSC::CachedHashSet::encode):
(JSC::CachedHashSet::decode const):
(JSC::CachedConstantIdentifierSetEntry::encode):
(JSC::CachedConstantIdentifierSetEntry::decode const):
(JSC::CachedVariableEnvironment::encode):
(JSC::CachedVariableEnvironment::decode const):
(JSC::CachedArray::encode):
(JSC::CachedArray::decode const):
(JSC::CachedScopedArgumentsTable::encode):
(JSC::CachedScopedArgumentsTable::decode const):
(JSC::CachedSymbolTableEntry::encode):
(JSC::CachedSymbolTableEntry::decode const):
(JSC::CachedSymbolTable::encode):
(JSC::CachedSymbolTable::decode const):
(JSC::CachedImmutableButterfly::encode):
(JSC::CachedImmutableButterfly::decode const):
(JSC::CachedRegExp::encode):
(JSC::CachedRegExp::decode const):
(JSC::CachedTemplateObjectDescriptor::encode):
(JSC::CachedTemplateObjectDescriptor::decode const):
(JSC::CachedBigInt::encode):
(JSC::CachedBigInt::decode const):
(JSC::CachedJSValue::encode):
(JSC::CachedJSValue::decode const):
(JSC::CachedInstructionStream::encode):
(JSC::CachedInstructionStream::decode const):
(JSC::CachedMetadataTable::encode):
(JSC::CachedMetadataTable::decode const):
(JSC::CachedSourceOrigin::encode):
(JSC::CachedSourceOrigin::decode const):
(JSC::CachedTextPosition::encode):
(JSC::CachedTextPosition::decode const):
(JSC::CachedSourceProviderShape::encode):
(JSC::CachedSourceProviderShape::decode const):
(JSC::CachedStringSourceProvider::encode):
(JSC::CachedStringSourceProvider::decode const):
(JSC::CachedWebAssemblySourceProvider::encode):
(JSC::CachedWebAssemblySourceProvider::decode const):
(JSC::CachedSourceProvider::encode):
(JSC::CachedSourceProvider::decode const):
(JSC::CachedUnlinkedSourceCodeShape::encode):
(JSC::CachedUnlinkedSourceCodeShape::decode const):
(JSC::CachedSourceCode::encode):
(JSC::CachedSourceCode::decode const):
(JSC::CachedFunctionExecutable::firstLineOffset const):
(JSC::CachedFunctionExecutable::lineCount const):
(JSC::CachedFunctionExecutable::unlinkedFunctionNameStart const):
(JSC::CachedFunctionExecutable::unlinkedBodyStartColumn const):
(JSC::CachedFunctionExecutable::unlinkedBodyEndColumn const):
(JSC::CachedFunctionExecutable::startOffset const):
(JSC::CachedFunctionExecutable::sourceLength const):
(JSC::CachedFunctionExecutable::parametersStartOffset const):
(JSC::CachedFunctionExecutable::typeProfilingStartOffset const):
(JSC::CachedFunctionExecutable::typeProfilingEndOffset const):
(JSC::CachedFunctionExecutable::parameterCount const):
(JSC::CachedFunctionExecutable::features const):
(JSC::CachedFunctionExecutable::sourceParseMode const):
(JSC::CachedFunctionExecutable::isInStrictContext const):
(JSC::CachedFunctionExecutable::hasCapturedVariables const):
(JSC::CachedFunctionExecutable::isBuiltinFunction const):
(JSC::CachedFunctionExecutable::isBuiltinDefaultClassConstructor const):
(JSC::CachedFunctionExecutable::constructAbility const):
(JSC::CachedFunctionExecutable::constructorKind const):
(JSC::CachedFunctionExecutable::functionMode const):
(JSC::CachedFunctionExecutable::scriptMode const):
(JSC::CachedFunctionExecutable::superBinding const):
(JSC::CachedFunctionExecutable::derivedContextType const):
(JSC::CachedFunctionExecutable::name const):
(JSC::CachedFunctionExecutable::ecmaName const):
(JSC::CachedFunctionExecutable::inferredName const):
(JSC::CachedCodeBlock::instructions const):
(JSC::CachedCodeBlock::thisRegister const):
(JSC::CachedCodeBlock::scopeRegister const):
(JSC::CachedCodeBlock::globalObjectRegister const):
(JSC::CachedCodeBlock::sourceURLDirective const):
(JSC::CachedCodeBlock::sourceMappingURLDirective const):
(JSC::CachedCodeBlock::usesEval const):
(JSC::CachedCodeBlock::isStrictMode const):
(JSC::CachedCodeBlock::isConstructor const):
(JSC::CachedCodeBlock::hasCapturedVariables const):
(JSC::CachedCodeBlock::isBuiltinFunction const):
(JSC::CachedCodeBlock::superBinding const):
(JSC::CachedCodeBlock::scriptMode const):
(JSC::CachedCodeBlock::isArrowFunctionContext const):
(JSC::CachedCodeBlock::isClassContext const):
(JSC::CachedCodeBlock::wasCompiledWithDebuggingOpcodes const):
(JSC::CachedCodeBlock::constructorKind const):
(JSC::CachedCodeBlock::derivedContextType const):
(JSC::CachedCodeBlock::evalContextType const):
(JSC::CachedCodeBlock::hasTailCalls const):
(JSC::CachedCodeBlock::lineCount const):
(JSC::CachedCodeBlock::endColumn const):
(JSC::CachedCodeBlock::numVars const):
(JSC::CachedCodeBlock::numCalleeLocals const):
(JSC::CachedCodeBlock::numParameters const):
(JSC::CachedCodeBlock::features const):
(JSC::CachedCodeBlock::parseMode const):
(JSC::CachedCodeBlock::codeType const):
(JSC::CachedCodeBlock::rareData const):
(JSC::CachedProgramCodeBlock::encode):
(JSC::CachedProgramCodeBlock::decode const):
(JSC::CachedModuleCodeBlock::encode):
(JSC::CachedModuleCodeBlock::decode const):
(JSC::CachedEvalCodeBlock::encode):
(JSC::CachedEvalCodeBlock::decode const):
(JSC::CachedFunctionCodeBlock::encode):
(JSC::CachedFunctionCodeBlock::decode const):
(JSC::UnlinkedFunctionCodeBlock::UnlinkedFunctionCodeBlock):
(JSC::UnlinkedCodeBlock::UnlinkedCodeBlock):
(JSC::CachedCodeBlock<CodeBlockType>::decode const):
(JSC::UnlinkedProgramCodeBlock::UnlinkedProgramCodeBlock):
(JSC::UnlinkedModuleProgramCodeBlock::UnlinkedModuleProgramCodeBlock):
(JSC::UnlinkedEvalCodeBlock::UnlinkedEvalCodeBlock):
(JSC::CachedFunctionExecutable::encode):
(JSC::CachedFunctionExecutable::decode const):
(JSC::UnlinkedFunctionExecutable::UnlinkedFunctionExecutable):
(JSC::CachedCodeBlock<CodeBlockType>::encode):
(JSC::CachedSourceCodeKey::encode):
(JSC::CachedSourceCodeKey::decode const):
(JSC::CacheEntry::encode):
(JSC::CacheEntry:: const):
(JSC:: const):
(JSC::encodeCodeBlock):
(JSC::decodeCodeBlockImpl):
* runtime/CachedTypes.h: Copied from Source/JavaScriptCore/bytecode/UnlinkedGlobalCodeBlock.h.
(JSC::decodeCodeBlock):
* runtime/CodeCache.cpp:
(JSC::CodeCacheMap::pruneSlowCase):
(JSC::CodeCache::getUnlinkedGlobalCodeBlock):
(JSC::CodeCache::getUnlinkedGlobalFunctionExecutable):
(JSC::CodeCache::write):
* runtime/CodeCache.h:
(JSC::CodeCacheMap::begin):
(JSC::CodeCacheMap::end):
(JSC::CodeCacheMap::fetchFromDiskImpl):
(JSC::CodeCacheMap::findCacheAndUpdateAge):
(JSC::writeCodeBlock):
* runtime/JSBigInt.cpp:
* runtime/JSBigInt.h:
* runtime/Options.cpp:
(JSC::recomputeDependentOptions):
* runtime/RegExp.h:
* runtime/ScopedArgumentsTable.h:
* runtime/StackFrame.h:
* runtime/StructureInlines.h:
* runtime/SymbolTable.h:

Source/WTF:

BitVectors have to be friends with JSC::CacheBitVector to allow
serializing its buffer as part of the bytecode cache encoding.

* wtf/BitVector.h:

Tools:

Add test helper to execute bytecode-cache tests: it executes each test
twice, the first with JSC_diskCachePath set to a temporary directory
and second with JSC_forceDiskCache=true (in addition to the cache path)
to guarantee that only the disk cache is being used and no new
UnlinkedCodeBlocks are being created.

* Scripts/jsc-stress-test-helpers/bytecode-cache-test-helper.sh: Added.
* Scripts/run-jsc-stress-tests:

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

6 months ago[JSC] Invalidate old scope operations using global lexical binding epoch
commit-queue@webkit.org [Tue, 22 Jan 2019 17:48:08 +0000 (17:48 +0000)]
[JSC] Invalidate old scope operations using global lexical binding epoch
https://bugs.webkit.org/show_bug.cgi?id=193603
<rdar://problem/47380869>

Patch by Yusuke Suzuki <ysuzuki@apple.com> on 2019-01-22
Reviewed by Saam Barati.

JSTests:

* stress/let-lexical-binding-shadow-existing-global-property-ftl.js:
* stress/scope-operation-cache-global-property-before-deleting.js: Added.
(shouldThrow):
(bar):
* stress/scope-operation-cache-global-property-bump-counter.js: Added.
(shouldBe):
(get1):
(get2):
(get1If):
(get2If):
* stress/scope-operation-cache-global-property-even-if-it-fails.js: Added.
(shouldThrow):
(foo):

Source/JavaScriptCore:

Even if the global lexical binding does not shadow the global property at that time, we need to clear the cached information in
scope related operations since we may have a global property previously. Consider the following example,

    foo = 0;
    function get() { return foo; }
    print(get()); // 0
    print(get()); // 0
    delete globalThis.foo;
    $.evalScript(`const foo = 42;`);
    print(get()); // Should be 42, but it returns 0 if the cached information in get() is not cleared.

To invalidate the cache easily, we introduce global lexical binding epoch. It is bumped every time we introduce a new lexical binding
into JSGlobalLexicalEnvironment, since that name could shadow the global property name previously. In op_resolve_scope, we first check
the epoch stored in the metadata, and go to slow path if it is not equal to the current epoch. Our slow path code convert the scope
operation to the appropriate one even if the resolve type is not UnresolvedProperty type. After updating the resolve type of the bytecode,
we update the cached epoch to the current one, so that we can use the cached information as long as we stay in the same epoch.

In op_get_from_scope and op_put_to_scope, we do not use this epoch since Structure check can do the same thing instead. If op_resolve_type
is updated by the epoch, and if it starts returning JSGlobalLexicalEnvironment instead JSGlobalObject, obviously the structure check fails.
And in the slow path, we update op_get_from_scope and op_put_to_scope appropriately.

So, the metadata for scope related bytecodes are eventually updated to the appropriate one. In DFG and FTL, we use the watchpoint based approach.
In DFG and FTL, we concurrently attempt to get the watchpoint for the lexical binding and look into it by using `isStillValid()` to avoid
infinite compile-and-fail loop.

When the global lexical binding epoch overflows we iterate all the live CodeBlock and update the op_resolve_scope's epoch. Even if the shadowing
happens, it is OK if we bump the epoch, since op_resolve_scope will return JSGlobalLexicalEnvironment instead of JSGlobalObject, and following
structure check in op_put_to_scope and op_get_from_scope fail. We do not need to update op_get_from_scope and op_put_to_scope because of the same
reason.

* bytecode/BytecodeList.rb:
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::finishCreation):
(JSC::CodeBlock::notifyLexicalBindingUpdate):
(JSC::CodeBlock::notifyLexicalBindingShadowing): Deleted.
* bytecode/CodeBlock.h:
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::parseBlock):
* dfg/DFGDesiredGlobalProperties.cpp:
(JSC::DFG::DesiredGlobalProperties::isStillValidOnMainThread):
* dfg/DFGDesiredGlobalProperties.h:
* dfg/DFGGraph.cpp:
(JSC::DFG::Graph::watchGlobalProperty):
* dfg/DFGGraph.h:
* dfg/DFGPlan.cpp:
(JSC::DFG::Plan::isStillValidOnMainThread):
* jit/JITPropertyAccess.cpp:
(JSC::JIT::emit_op_resolve_scope):
* jit/JITPropertyAccess32_64.cpp:
(JSC::JIT::emit_op_resolve_scope):
* llint/LowLevelInterpreter32_64.asm:
* llint/LowLevelInterpreter64.asm:
* runtime/CommonSlowPaths.cpp:
(JSC::SLOW_PATH_DECL):
* runtime/CommonSlowPaths.h:
(JSC::CommonSlowPaths::tryCachePutToScopeGlobal):
(JSC::CommonSlowPaths::tryCacheGetFromScopeGlobal):
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::bumpGlobalLexicalBindingEpoch):
(JSC::JSGlobalObject::getReferencedPropertyWatchpointSet):
(JSC::JSGlobalObject::ensureReferencedPropertyWatchpointSet):
(JSC::JSGlobalObject::notifyLexicalBindingShadowing): Deleted.
* runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::globalLexicalBindingEpoch const):
(JSC::JSGlobalObject::globalLexicalBindingEpochOffset):
(JSC::JSGlobalObject::addressOfGlobalLexicalBindingEpoch):
* runtime/Options.cpp:
(JSC::correctOptions):
(JSC::Options::initialize):
(JSC::Options::setOptions):
(JSC::Options::setOptionWithoutAlias):
* runtime/Options.h:
* runtime/ProgramExecutable.cpp:
(JSC::ProgramExecutable::initializeGlobalProperties):

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

6 months ago[LFC][Floats] Decouple clearance computation and margin collapsing reset.
zalan@apple.com [Tue, 22 Jan 2019 17:25:59 +0000 (17:25 +0000)]
[LFC][Floats] Decouple clearance computation and margin collapsing reset.
https://bugs.webkit.org/show_bug.cgi?id=193670

Reviewed by Antti Koivisto.

Move margin collapsing reset logic from FloatingContext to BlockFormattingContext. It's the BlockFormattingContext's job to do.
This is also in preparation for adding clear to static position.

* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::mapTopToAncestor):
(WebCore::Layout::FormattingContext::mapTopLeftToAncestor): Deleted.
* layout/FormattingContext.h:
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const):
* layout/floats/FloatingContext.cpp:
(WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
* layout/floats/FloatingContext.h:

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

6 months agoMinor refactoring of the scrolling code
fred.wang@free.fr [Tue, 22 Jan 2019 16:59:15 +0000 (16:59 +0000)]
Minor refactoring of the scrolling code
https://bugs.webkit.org/show_bug.cgi?id=192398

Unreviewed build fix.

Patch by Frederic Wang <fwang@igalia.com> on 2019-01-22

* page/scrolling/ScrollingTreeScrollingNode.cpp: Add missing header.

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

6 months ago[css-logical] Implement flow-relative margin, padding and border shorthands
commit-queue@webkit.org [Tue, 22 Jan 2019 09:52:48 +0000 (09:52 +0000)]
[css-logical] Implement flow-relative margin, padding and border shorthands
https://bugs.webkit.org/show_bug.cgi?id=188697

Patch by Oriol Brufau <obrufau@igalia.com> on 2019-01-22
Reviewed by Simon Fraser and Antti Koivisto.

LayoutTests/imported/w3c:

Import tests from the WPT test suite for CSS Logical Properties and Values,
and enable the CSSLogicalEnabled runtime flag for them.

They still have some failures because sideways writing modes have not been
implemented yet (https://bugs.webkit.org/show_bug.cgi?id=166941).

* web-platform-tests/css/css-logical/logical-box-border-color-expected.txt:
* web-platform-tests/css/css-logical/logical-box-border-color.html:
* web-platform-tests/css/css-logical/logical-box-border-shorthands-expected.txt:
* web-platform-tests/css/css-logical/logical-box-border-shorthands.html:
* web-platform-tests/css/css-logical/logical-box-border-style-expected.txt:
* web-platform-tests/css/css-logical/logical-box-border-style.html:
* web-platform-tests/css/css-logical/logical-box-border-width-expected.txt:
* web-platform-tests/css/css-logical/logical-box-border-width.html:
* web-platform-tests/css/css-logical/logical-box-inset-expected.txt:
* web-platform-tests/css/css-logical/logical-box-inset.html:
* web-platform-tests/css/css-logical/logical-box-margin-expected.txt:
* web-platform-tests/css/css-logical/logical-box-margin.html:
* web-platform-tests/css/css-logical/logical-box-padding-expected.txt:
* web-platform-tests/css/css-logical/logical-box-padding.html:
* web-platform-tests/css/css-logical/logical-box-size.html:
* web-platform-tests/css/css-logical/resources/test-box-properties.js:
(export.createBoxPropertyGroup):
(export.createSizingPropertyGroup):
(export.runTests.set test):
(export.runTests):
* web-platform-tests/css/css-logical/resources/test-shared.js: Added.
(export.testCSSValues):
(export.testComputedValues):
(export.makeDeclaration):
* web-platform-tests/css/css-logical/resources/w3c-import.log:

Source/WebCore:

Tests: imported/w3c/web-platform-tests/css/css-logical/logical-box-border-color.html
       imported/w3c/web-platform-tests/css/css-logical/logical-box-border-shorthands.html
       imported/w3c/web-platform-tests/css/css-logical/logical-box-border-style.html
       imported/w3c/web-platform-tests/css/css-logical/logical-box-border-width.html
       imported/w3c/web-platform-tests/css/css-logical/logical-box-margin.html
       imported/w3c/web-platform-tests/css/css-logical/logical-box-padding.html
       webexposed/css-properties-behind-flags.html

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
Allow the new properties to serialize their computed value.

(WebCore::ComputedStyleExtractor::getCSSPropertyValuesFor2SidesShorthand):
(WebCore::ComputedStyleExtractor::getCSSPropertyValuesFor4SidesShorthand):
* css/CSSComputedStyleDeclaration.h:
Rename getCSSPropertyValuesForSidesShorthand to getCSSPropertyValuesFor4SidesShorthand,
and add analogous getCSSPropertyValuesFor2SidesShorthand for serializing 2-sided
shorthands.

* css/CSSProperties.json:
Add the new properties behind the CSSLogicalEnabled runtime flag.

* css/CSSStyleDeclaration.cpp:
(WebCore::CSSStyleDeclaration::supportedPropertyNames const):
Prevent CSS properties disabled behind a runtime flag from being exposed in
style declarations.

* css/StyleProperties.cpp:
(WebCore::StyleProperties::getPropertyValue const):
Allow the new properties to serialize their specified value.

(WebCore::StyleProperties::get2Values const):
Add get2Values, analogous to get4Values, for serializing 2-sided shorthands.

(WebCore::StyleProperties::borderPropertyValue const):
Allow borderPropertyValue to serialize arbitrary multi-sided border shorthands
corresponding to width, style and color.

(WebCore::MutableStyleProperties::setProperty):
Prevent CSS properties disabled behind a runtime flag from being set a value.

(WebCore::StyleProperties::asText const):
Allow the new properties to be serialized in cssText.
Prevent CSS shorthands disabled behind a runtime flag from appearing in cssText,
and serialize the longhands instead. Note that there could be another shorthand
available which is enabled, but a proper solution would require bug 190496.

* css/StyleProperties.h:
Update declarations of borderPropertyValue and get2Values.

* css/makeprop.pl:
(addProperty):
Add isEnabledCSSProperty function for checking that a CSS property is not
disabled behind a runtime flag.

* css/parser/CSSPropertyParser.cpp:
(WebCore::cssPropertyID):
Prevent CSS properties disabled behind a runtime flag from being exposed in
computed styles.

(WebCore::CSSPropertyParser::addProperty):
Prevent CSS properties disabled behind a runtime flag from being set a value.

(WebCore::CSSPropertyParser::consumeBorder):
Change consumeBorder to provide the caller with the parsed values instead of
setting properties. Then the caller can decide to which properties the values
should be set, and whether border-image should be reset or not.

(WebCore::CSSPropertyParser::consume2ValueShorthand):
(WebCore::CSSPropertyParser::consume4ValueShorthand):
Rename consume4Values to consume4ValueShorthand, and add analogous
consume2ValueShorthand for parsing shorthands with two longhands.

(WebCore::CSSPropertyParser::parseShorthand):
Allow the new properties to be parsed.

* css/parser/CSSPropertyParser.h:
Update declarations of consumeBorder, consume2ValueShorthand and
consume4ValueShorthand.

* inspector/agents/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::getSupportedCSSProperties):
Prevent CSS properties disabled behind a runtime flag from being exposed in
the CSS inspector tool.

* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setCSSLogicalEnabled):
(WebCore::RuntimeEnabledFeatures::cssLogicalEnabled const):
Add the CSSLogicalEnabled runtime flag.

Source/WebKit:

Add a CSSLogicalEnabled runtime flag.

* Shared/WebPreferences.yaml:

Source/WebKitLegacy/mac:

Add CSSLogicalEnabled runtime flag.

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

Tools:

* DumpRenderTree/TestOptions.cpp:
(TestOptions::TestOptions):
* DumpRenderTree/TestOptions.h:
* DumpRenderTree/mac/DumpRenderTree.mm:
(setWebPreferencesForTestOptions):
Allow tests to enable the CSSLogicalEnabled flag in WK1.

* Scripts/webkitpy/style/checkers/jsonchecker.py:
(JSONCSSPropertiesChecker.check_codegen_properties):
Allow CSS property definitions to have a 'runtime-flag' parameter which
disables the property when the specified runtime flag is disabled.

LayoutTests:

Add tests checking that CSS properties disabled behind runtime flags
are not exposed.

* webexposed/css-properties-behind-flags-expected.txt: Added.
* webexposed/css-properties-behind-flags.html: Added.

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

6 months agoEnable CSSOMViewScrollingAPI
commit-queue@webkit.org [Tue, 22 Jan 2019 09:07:00 +0000 (09:07 +0000)]
Enable CSSOMViewScrollingAPI
https://bugs.webkit.org/show_bug.cgi?id=189472

Patch by Frederic Wang <fwang@igalia.com> on 2019-01-22
Reviewed by Simon Fraser.

This patch enables the CSSOMViewScrollingAPI option by default. This feature has already been
enabled in tests since r235855. Basically, this change fixes an old compatibility issue
regarding which scrolling element correspond to the viewport in standard mode (WebKit uses
document.body while Gecko/Edge/Chromium use document.documentElement as described in the
CSSOM View specification). WebKit developers writing tests can use document.scrollingElement
for that purpose, so that they work independently of whether the option is enabled.

[1] https://lists.webkit.org/pipermail/webkit-dev/2018-January/029857.html

* Shared/WebPreferences.yaml: Enable by default and remove "experimental" category in
accordance with the new policy. Instead, keep an internal flag only for developers.

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

6 months ago[iOS] Handle hit testing for subframes
antti@apple.com [Tue, 22 Jan 2019 06:50:49 +0000 (06:50 +0000)]
[iOS] Handle hit testing for subframes
https://bugs.webkit.org/show_bug.cgi?id=192303

Reviewed by Frédéric Wang.

Source/WebCore:

Don't set delegatesScrolling bit for subframes on iOS. It is meant for top level application
controlled scrolling. This fixes coordinate conversions for subframes and makes events work.

Test by Frederic Wang.

Test: fast/scrolling/ios/hit-testing-iframe.html

* platform/ScrollView.cpp:
(WebCore::ScrollView::managesScrollbars const):

Add a function that tells if the scrollview should deal with scrollbars at all
This is always false on iOS and not connected to delegatesScrolling bit.

(WebCore::ScrollView::updateScrollbars):
* platform/ScrollView.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::shouldCompositeOverflowControls const):

Source/WebKit:

* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):

Only set delegatesScrolling for the main frame.

LayoutTests:

Test by Frederic Wang.

* fast/scrolling/ios/hit-testing-iframe-expected.html: Added.
* fast/scrolling/ios/hit-testing-iframe.html: Added.

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

6 months agoUnreviewed, roll out r240220 due to date-format-xparb regression
yusukesuzuki@slowstart.org [Tue, 22 Jan 2019 05:28:35 +0000 (05:28 +0000)]
Unreviewed, roll out r240220 due to date-format-xparb regression
https://bugs.webkit.org/show_bug.cgi?id=193603

JSTests:

* stress/let-lexical-binding-shadow-existing-global-property-ftl.js:
* stress/scope-operation-cache-global-property-before-deleting.js: Removed.
* stress/scope-operation-cache-global-property-bump-counter.js: Removed.
* stress/scope-operation-cache-global-property-even-if-it-fails.js: Removed.

Source/JavaScriptCore:

* bytecode/BytecodeList.rb:
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::notifyLexicalBindingShadowing):
(JSC::CodeBlock::notifyLexicalBindingUpdate): Deleted.
* bytecode/CodeBlock.h:
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::parseBlock):
* dfg/DFGDesiredGlobalProperties.cpp:
(JSC::DFG::DesiredGlobalProperties::isStillValidOnMainThread):
* dfg/DFGDesiredGlobalProperties.h:
* dfg/DFGGraph.cpp:
(JSC::DFG::Graph::watchGlobalProperty): Deleted.
* dfg/DFGGraph.h:
* dfg/DFGPlan.cpp:
(JSC::DFG::Plan::isStillValidOnMainThread):
* jit/JITPropertyAccess.cpp:
(JSC::JIT::emit_op_resolve_scope):
* jit/JITPropertyAccess32_64.cpp:
(JSC::JIT::emit_op_resolve_scope):
* llint/LowLevelInterpreter32_64.asm:
* llint/LowLevelInterpreter64.asm:
* runtime/CommonSlowPaths.cpp:
(JSC::SLOW_PATH_DECL):
* runtime/CommonSlowPaths.h:
(JSC::CommonSlowPaths::tryCachePutToScopeGlobal):
(JSC::CommonSlowPaths::tryCacheGetFromScopeGlobal):
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::notifyLexicalBindingShadowing):
(JSC::JSGlobalObject::getReferencedPropertyWatchpointSet):
(JSC::JSGlobalObject::ensureReferencedPropertyWatchpointSet):
(JSC::JSGlobalObject::bumpGlobalLexicalBindingEpoch): Deleted.
* runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::globalLexicalBindingEpoch const): Deleted.
(JSC::JSGlobalObject::globalLexicalBindingEpochOffset): Deleted.
(JSC::JSGlobalObject::addressOfGlobalLexicalBindingEpoch): Deleted.
* runtime/Options.cpp:
(JSC::Options::initialize):
(JSC::Options::setOptions):
(JSC::Options::setOptionWithoutAlias):
(JSC::correctOptions): Deleted.
* runtime/Options.h:
* runtime/ProgramExecutable.cpp:
(JSC::ProgramExecutable::initializeGlobalProperties):

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

6 months agoUnreviewed test fix after r240243
bfulgham@apple.com [Tue, 22 Jan 2019 01:55:47 +0000 (01:55 +0000)]
Unreviewed test fix after r240243
Nhttps://bugs.webkit.org/show_bug.cgi?id=193660
<rdar://problem/47433602>

The new ResourceLoadStatistics section of 'removeData' was incrementing the
pending callback count before deciding whether to send a message to delete
data. This left the count out-of-balance leading to the operation never
completing.

This patch also prevents sending a second message to the NetworkProcess
requesting data be deleted if the message was already sent in an earlier
section of the method (e.g., as typically happens when all website data
is being deleted).

* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::removeData):

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

6 months ago[JSC] StrictModeTypeErrorFunction is no longer used
commit-queue@webkit.org [Tue, 22 Jan 2019 01:30:05 +0000 (01:30 +0000)]
[JSC] StrictModeTypeErrorFunction is no longer used
https://bugs.webkit.org/show_bug.cgi?id=193662

Patch by Yusuke Suzuki <ysuzuki@apple.com> on 2019-01-21
Reviewed by Mark Lam.

StrictModeTypeErrorFunction is no longer used. This patch drops it. Furthermore, it also allows us to drop
strictModeTypeErrorFunctionSpace from VM.

* runtime/Error.cpp:
(JSC::StrictModeTypeErrorFunction::destroy): Deleted.
* runtime/Error.h:
(): Deleted.
* runtime/VM.cpp:
(JSC::VM::VM):
* runtime/VM.h:

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

6 months ago[GTK][WPE] libgcrypt-1.7.6 can't be compiled on Ubuntu 18.10
Hironori.Fujii@sony.com [Tue, 22 Jan 2019 01:18:28 +0000 (01:18 +0000)]
[GTK][WPE] libgcrypt-1.7.6 can't be compiled on Ubuntu 18.10
https://bugs.webkit.org/show_bug.cgi?id=193643

Reviewed by Michael Catanzaro.

* gtk/jhbuild.modules: Bumped to libgcrypt-1.8.4.
* wpe/jhbuild.modules: Ditto.

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

6 months agoDoesGC rule is wrong for nodes with BigIntUse
ticaiolima@gmail.com [Mon, 21 Jan 2019 23:57:25 +0000 (23:57 +0000)]
DoesGC rule is wrong for nodes with BigIntUse
https://bugs.webkit.org/show_bug.cgi?id=193652

Reviewed by Saam Barati.

JSTests:

* stress/big-int-value-op-update-gc-rules.js: Added.
(assert):
(doesGCAdd):
(doesGCSub):
(doesGCDiv):
(doesGCMul):
(doesGCBitAnd):
(doesGCBitOr):
(doesGCBitXor):

Source/JavaScriptCore:

Former rule was that ValueOp does not GC. However this is wrong, since
these operations can trigger GC and mess up memory management. In the end, this
will generate wrong code because we will have wrong GC epoch value during
Store Barrier Insertion phase.
We changed this to consider BigIntUse for such nodes and properly return true when
they are BigIntUse.

* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):

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

6 months agoImplement message handlers for NetworkProcess-based ResourceLoadStatistics
bfulgham@apple.com [Mon, 21 Jan 2019 22:28:04 +0000 (22:28 +0000)]
Implement message handlers for NetworkProcess-based ResourceLoadStatistics
https://bugs.webkit.org/show_bug.cgi?id=193556
<rdar://problem/47368501>

Reviewed by Alex Christensen.

Source/WebCore:

This patch adds a new observer callback used to message the NetworkProcess when
user interaction events are received. This is needed when the ResourceLoadStatistics
data is not being managed by the UIProcess.

Tested by existing ResourceLoadStatistics and storageAccess tests.

* loader/ResourceLoadObserver.cpp:
(WebCore::ResourceLoadObserver::setLogUserInteractionNotificationCallback):
(WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
* loader/ResourceLoadObserver.h:
* platform/network/cocoa/NetworkStorageSessionCocoa.mm:
(WebCore::NetworkStorageSession::setCookiesFromDOM):

Source/WebKit:

This patch adds a number of sibling methods for tracking ResourceLoadStatistics when the
observations are being handled in the NetworkProcess, rather than the UIProcess. The
original versions of these methods will be removed as part of Bug 193303.

* NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
(WebKit::ResourceLoadStatisticsMemoryStore::removeDataRecords):
(WebKit::ResourceLoadStatisticsMemoryStore::processStatisticsAndDataRecords):
(WebKit::ResourceLoadStatisticsMemoryStore::grandfatherExistingWebsiteData):
* NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h:
(WebKit::ResourceLoadStatisticsMemoryStore::store const):
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::setNotifyPagesWhenDataRecordsWereScanned):
(WebKit::WebResourceLoadStatisticsStore::setNotifyPagesWhenTelemetryWasCaptured):
(WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
(WebKit::WebResourceLoadStatisticsStore::setPrevalentResourceForDebugMode):
(WebKit::WebResourceLoadStatisticsStore::scheduleStatisticsAndDataRecordsProcessing):
(WebKit::WebResourceLoadStatisticsStore::hasStorageAccess):
(WebKit::WebResourceLoadStatisticsStore::callHasStorageAccessForFrameHandler):
(WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
(WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
(WebKit::WebResourceLoadStatisticsStore::clearUserInteraction):
(WebKit::WebResourceLoadStatisticsStore::hasHadUserInteraction):
(WebKit::WebResourceLoadStatisticsStore::setLastSeen):
(WebKit::WebResourceLoadStatisticsStore::setPrevalentResource):
(WebKit::WebResourceLoadStatisticsStore::setVeryPrevalentResource):
(WebKit::WebResourceLoadStatisticsStore::isPrevalentResource):
(WebKit::WebResourceLoadStatisticsStore::isVeryPrevalentResource):
(WebKit::WebResourceLoadStatisticsStore::isRegisteredAsSubresourceUnder):
(WebKit::WebResourceLoadStatisticsStore::isRegisteredAsSubFrameUnder):
(WebKit::WebResourceLoadStatisticsStore::isRegisteredAsRedirectingTo):
(WebKit::WebResourceLoadStatisticsStore::clearPrevalentResource):
(WebKit::WebResourceLoadStatisticsStore::setGrandfathered):
(WebKit::WebResourceLoadStatisticsStore::isGrandfathered):
(WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameOrigin):
(WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameOrigin):
(WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectTo):
(WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectFrom):
(WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectTo):
(WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectFrom):
(WebKit::WebResourceLoadStatisticsStore::setTimeToLiveUserInteraction):
(WebKit::WebResourceLoadStatisticsStore::logTestingEvent):
(WebKit::WebResourceLoadStatisticsStore::notifyResourceLoadStatisticsProcessed):
(WebKit::WebResourceLoadStatisticsStore::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores):
(WebKit::WebResourceLoadStatisticsStore::topPrivatelyControlledDomainsWithWebsiteData):
(WebKit::WebResourceLoadStatisticsStore::sendDiagnosticMessageWithValue const):
(WebKit::WebResourceLoadStatisticsStore::notifyPageStatisticsTelemetryFinished const):
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
* NetworkProcess/Classifier/WebResourceLoadStatisticsTelemetry.cpp:
(WebKit::submitTopList):
(WebKit::submitTopLists):
(WebKit::notifyPages):
(WebKit::WebResourceLoadStatisticsTelemetry::calculateAndSubmit):
(WebKit::nonEphemeralWebPageProxy): Deleted.
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::logUserInteraction):
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::dumpResourceLoadStatistics):
(WebKit::NetworkProcess::isGrandfathered):
(WebKit::NetworkProcess::isPrevalentResource):
(WebKit::NetworkProcess::isVeryPrevalentResource):
(WebKit::NetworkProcess::setGrandfathered):
(WebKit::NetworkProcess::setPrevalentResource):
(WebKit::NetworkProcess::setPrevalentResourceForDebugMode):
(WebKit::NetworkProcess::setVeryPrevalentResource):
(WebKit::NetworkProcess::clearPrevalentResource):
(WebKit::NetworkProcess::submitTelemetry):
(WebKit::NetworkProcess::scheduleCookieBlockingUpdate):
(WebKit::NetworkProcess::scheduleClearInMemoryAndPersistent):
(WebKit::NetworkProcess::resetParametersToDefaultValues):
(WebKit::NetworkProcess::scheduleStatisticsAndDataRecordsProcessing):
(WebKit::NetworkProcess::setNotifyPagesWhenDataRecordsWereScanned):
(WebKit::NetworkProcess::setNotifyPagesWhenTelemetryWasCaptured):
(WebKit::NetworkProcess::setSubframeUnderTopFrameOrigin):
(WebKit::NetworkProcess::isRegisteredAsRedirectingTo):
(WebKit::NetworkProcess::isRegisteredAsSubFrameUnder):
(WebKit::NetworkProcess::setSubresourceUnderTopFrameOrigin):
(WebKit::NetworkProcess::setSubresourceUniqueRedirectTo):
(WebKit::NetworkProcess::setSubresourceUniqueRedirectFrom):
(WebKit::NetworkProcess::isRegisteredAsSubresourceUnder):
(WebKit::NetworkProcess::setTopFrameUniqueRedirectTo):
(WebKit::NetworkProcess::setTopFrameUniqueRedirectFrom):
(WebKit::NetworkProcess::setLastSeen):
(WebKit::NetworkProcess::hasStorageAccess):
(WebKit::NetworkProcess::requestStorageAccess):
(WebKit::NetworkProcess::grantStorageAccess):
(WebKit::NetworkProcess::logUserInteraction):
(WebKit::NetworkProcess::hadUserInteraction):
(WebKit::NetworkProcess::clearUserInteraction):
(WebKit::NetworkProcess::setGrandfatheringTime):
(WebKit::NetworkProcess::setMaxStatisticsEntries):
(WebKit::NetworkProcess::setMinimumTimeBetweenDataRecordsRemoval):
(WebKit::NetworkProcess::setPruneEntriesDownTo):
(WebKit::NetworkProcess::setTimeToLiveUserInteraction):
(WebKit::NetworkProcess::setShouldClassifyResourcesBeforeDataRecordsRemoval):
(WebKit::NetworkProcess::setResourceLoadStatisticsEnabled):
(WebKit::NetworkProcess::setResourceLoadStatisticsDebugMode):
(WebKit::NetworkProcess::resetCacheMaxAgeCapForPrevalentResources):
(WebKit::NetworkProcess::deleteWebsiteData):
(WebKit::filterForTopLevelDomains):
(WebKit::NetworkProcess::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores):
(WebKit::NetworkProcess::topPrivatelyControlledDomainsWithWebsiteData):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* NetworkProcess/NetworkSession.cpp:
(WebKit::NetworkSession::setResourceLoadStatisticsEnabled):
(WebKit::NetworkSession::notifyResourceLoadStatisticsProcessed):
(WebKit::NetworkSession::logDiagnosticMessageWithValue):
(WebKit::NetworkSession::notifyPageStatisticsTelemetryFinished):
(WebKit::NetworkSession::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores):
(WebKit::NetworkSession::topPrivatelyControlledDomainsWithWebsiteData):
(WebKit::NetworkSession::enableResourceLoadStatistics): Deleted.
* NetworkProcess/NetworkSession.h:
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreSetResourceLoadStatisticsDebugModeWithCompletionHandler):
(WKWebsiteDataStoreSetResourceLoadStatisticsPrevalentResourceForDebugMode):
(WKWebsiteDataStoreSetStatisticsLastSeen):
(WKWebsiteDataStoreSetStatisticsPrevalentResource):
(WKWebsiteDataStoreSetStatisticsVeryPrevalentResource):
(WKWebsiteDataStoreDumpResourceLoadStatistics):
(WKWebsiteDataStoreIsStatisticsPrevalentResource):
(WKWebsiteDataStoreIsStatisticsVeryPrevalentResource):
(WKWebsiteDataStoreIsStatisticsRegisteredAsSubresourceUnder):
(WKWebsiteDataStoreIsStatisticsRegisteredAsSubFrameUnder):
(WKWebsiteDataStoreIsStatisticsRegisteredAsRedirectingTo):
(WKWebsiteDataStoreSetStatisticsHasHadUserInteraction):
(WKWebsiteDataStoreIsStatisticsHasHadUserInteraction):
(WKWebsiteDataStoreSetStatisticsGrandfathered):
(WKWebsiteDataStoreIsStatisticsGrandfathered):
(WKWebsiteDataStoreSetStatisticsSubframeUnderTopFrameOrigin):
(WKWebsiteDataStoreSetStatisticsSubresourceUnderTopFrameOrigin):
(WKWebsiteDataStoreSetStatisticsSubresourceUniqueRedirectTo):
(WKWebsiteDataStoreSetStatisticsSubresourceUniqueRedirectFrom):
(WKWebsiteDataStoreSetStatisticsTopFrameUniqueRedirectTo):
(WKWebsiteDataStoreSetStatisticsTopFrameUniqueRedirectFrom):
(WKWebsiteDataStoreSetStatisticsTimeToLiveUserInteraction):
(WKWebsiteDataStoreStatisticsProcessStatisticsAndDataRecords):
(WKWebsiteDataStoreStatisticsUpdateCookieBlocking):
(WKWebsiteDataStoreStatisticsSubmitTelemetry):
(WKWebsiteDataStoreSetStatisticsNotifyPagesWhenDataRecordsWereScanned):
(WKWebsiteDataStoreSetStatisticsShouldClassifyResourcesBeforeDataRecordsRemoval):
(WKWebsiteDataStoreSetStatisticsNotifyPagesWhenTelemetryWasCaptured):
(WKWebsiteDataStoreSetStatisticsMinimumTimeBetweenDataRecordsRemoval):
(WKWebsiteDataStoreSetStatisticsGrandfatheringTime):
(WKWebsiteDataStoreSetStatisticsMaxStatisticsEntries):
(WKWebsiteDataStoreSetStatisticsPruneEntriesDownTo):
(WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStore):
(WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours):
(WKWebsiteDataStoreStatisticsResetToConsistentState):
* UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
(-[WKWebsiteDataStore _setResourceLoadStatisticsTestingCallback:]):
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::clearCallbackStates):
(WebKit::NetworkProcessProxy::didClose):
(WebKit::nonEphemeralWebPageProxy):
(WebKit::NetworkProcessProxy::logGlobalDiagnosticMessageWithValue):
(WebKit::NetworkProcessProxy::dumpResourceLoadStatistics):
(WebKit::NetworkProcessProxy::didDumpResourceLoadStatistics):
(WebKit::NetworkProcessProxy::updatePrevalentDomainsToBlockCookiesFor):
(WebKit::NetworkProcessProxy::didUpdateBlockCookies):
(WebKit::NetworkProcessProxy::isPrevalentResource):
(WebKit::NetworkProcessProxy::isPrevalentResourceResult):
(WebKit::NetworkProcessProxy::isVeryPrevalentResource):
(WebKit::NetworkProcessProxy::setPrevalentResource):
(WebKit::NetworkProcessProxy::setPrevalentResourceForDebugMode):
(WebKit::NetworkProcessProxy::setVeryPrevalentResource):
(WebKit::NetworkProcessProxy::didSetResourceLoadStatisticData):
(WebKit::NetworkProcessProxy::setLastSeen):
(WebKit::NetworkProcessProxy::clearPrevalentResource):
(WebKit::NetworkProcessProxy::scheduleCookieBlockingUpdate):
(WebKit::NetworkProcessProxy::didScheduleCookieBlockingUpdate):
(WebKit::NetworkProcessProxy::scheduleClearInMemoryAndPersistent):
(WebKit::NetworkProcessProxy::didScheduleStatisticsProcessing):
(WebKit::NetworkProcessProxy::scheduleStatisticsAndDataRecordsProcessing):
(WebKit::NetworkProcessProxy::logUserInteraction):
(WebKit::NetworkProcessProxy::hasHadUserInteraction):
(WebKit::NetworkProcessProxy::didHaveUserInteraction):
(WebKit::NetworkProcessProxy::clearUserInteraction):
(WebKit::NetworkProcessProxy::setAgeCapForClientSideCookies):
(WebKit::NetworkProcessProxy::didSetAgeCapForClientSideCookies):
(WebKit::NetworkProcessProxy::setTimeToLiveUserInteraction):
(WebKit::NetworkProcessProxy::didUpdateRuntimeSettings):
(WebKit::NetworkProcessProxy::setNotifyPagesWhenTelemetryWasCaptured):
(WebKit::NetworkProcessProxy::setNotifyPagesWhenDataRecordsWereScanned):
(WebKit::NetworkProcessProxy::setSubframeUnderTopFrameOrigin):
(WebKit::NetworkProcessProxy::isRegisteredAsRedirectingTo):
(WebKit::NetworkProcessProxy::didIsRegisteredAsRedirectingTo):
(WebKit::NetworkProcessProxy::isRegisteredAsSubFrameUnder):
(WebKit::NetworkProcessProxy::didIsRegisteredAsSubFrameUnder):
(WebKit::NetworkProcessProxy::setSubresourceUnderTopFrameOrigin):
(WebKit::NetworkProcessProxy::isRegisteredAsSubresourceUnder):
(WebKit::NetworkProcessProxy::didIsRegisteredAsSubresourceUnder):
(WebKit::NetworkProcessProxy::setSubresourceUniqueRedirectTo):
(WebKit::NetworkProcessProxy::setSubresourceUniqueRedirectFrom):
(WebKit::NetworkProcessProxy::setTopFrameUniqueRedirectTo):
(WebKit::NetworkProcessProxy::setTopFrameUniqueRedirectFrom):
(WebKit::NetworkProcessProxy::isGrandfathered):
(WebKit::NetworkProcessProxy::didIsGrandfathered):
(WebKit::NetworkProcessProxy::setGrandfathered):
(WebKit::NetworkProcessProxy::hasStorageAccess):
(WebKit::NetworkProcessProxy::requestStorageAccess):
(WebKit::NetworkProcessProxy::grantStorageAccess):
(WebKit::NetworkProcessProxy::storageAccessRequestResult):
(WebKit::NetworkProcessProxy::storageAccessOperationResult):
(WebKit::NetworkProcessProxy::didRemoveAllStorageAccess):
(WebKit::NetworkProcessProxy::didSetCacheMaxAgeCapForPrevalentResources):
(WebKit::NetworkProcessProxy::setCacheMaxAgeCap):
(WebKit::NetworkProcessProxy::setGrandfatheringTime):
(WebKit::NetworkProcessProxy::setMaxStatisticsEntries):
(WebKit::NetworkProcessProxy::setMinimumTimeBetweenDataRecordsRemoval):
(WebKit::NetworkProcessProxy::setPruneEntriesDownTo):
(WebKit::NetworkProcessProxy::setShouldClassifyResourcesBeforeDataRecordsRemoval):
(WebKit::NetworkProcessProxy::setResourceLoadStatisticsDebugMode):
(WebKit::NetworkProcessProxy::resetParametersToDefaultValues):
(WebKit::NetworkProcessProxy::submitTelemetry):
(WebKit::NetworkProcessProxy::notifyResourceLoadStatisticsProcessed):
(WebKit::NetworkProcessProxy::notifyWebsiteDataDeletionForTopPrivatelyOwnedDomainsFinished):
(WebKit::NetworkProcessProxy::notifyWebsiteDataScanForTopPrivatelyControlledDomainsFinished):
(WebKit::NetworkProcessProxy::notifyResourceLoadStatisticsTelemetryFinished):
(WebKit::NetworkProcessProxy::didLogUserInteraction): Deleted.
(WebKit::NetworkProcessProxy::didResetCacheMaxAgeCapForPrevalentResources): Deleted.
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/Network/NetworkProcessProxy.messages.in:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::nonEphemeralWebPageProxy):
* UIProcess/WebPageProxy.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::ensureNetworkProcess):
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::notifyWebsiteDataScanForTopPrivatelyControlledDomainsFinished):
(WebKit::WebProcessProxy::notifyWebsiteDataDeletionForTopPrivatelyOwnedDomainsFinished):
* UIProcess/WebProcessProxy.h:
* UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
(WebKit::WebsiteDataStore::parameters):
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::removeData):
(WebKit::WebsiteDataStore::setMaxStatisticsEntries):
(WebKit::WebsiteDataStore::setPruneEntriesDownTo):
(WebKit::WebsiteDataStore::setGrandfatheringTime):
(WebKit::WebsiteDataStore::setCacheMaxAgeCap):
(WebKit::WebsiteDataStore::setMinimumTimeBetweenDataRecordsRemoval):
(WebKit::WebsiteDataStore::dumpResourceLoadStatistics):
(WebKit::WebsiteDataStore::isPrevalentResource):
(WebKit::WebsiteDataStore::setPrevalentResource):
(WebKit::WebsiteDataStore::setPrevalentResourceForDebugMode):
(WebKit::WebsiteDataStore::isVeryPrevalentResource):
(WebKit::WebsiteDataStore::setVeryPrevalentResource):
(WebKit::WebsiteDataStore::setShouldClassifyResourcesBeforeDataRecordsRemoval):
(WebKit::WebsiteDataStore::setSubframeUnderTopFrameOrigin):
(WebKit::WebsiteDataStore::isRegisteredAsSubFrameUnder):
(WebKit::WebsiteDataStore::setSubresourceUnderTopFrameOrigin):
(WebKit::WebsiteDataStore::isRegisteredAsSubresourceUnder):
(WebKit::WebsiteDataStore::setSubresourceUniqueRedirectTo):
(WebKit::WebsiteDataStore::setSubresourceUniqueRedirectFrom):
(WebKit::WebsiteDataStore::setTopFrameUniqueRedirectTo):
(WebKit::WebsiteDataStore::setTopFrameUniqueRedirectFrom):
(WebKit::WebsiteDataStore::isRegisteredAsRedirectingTo):
(WebKit::WebsiteDataStore::clearPrevalentResource):
(WebKit::WebsiteDataStore::resetParametersToDefaultValues):
(WebKit::WebsiteDataStore::submitTelemetry):
(WebKit::WebsiteDataStore::scheduleClearInMemoryAndPersistent):
(WebKit::WebsiteDataStore::scheduleCookieBlockingUpdate):
(WebKit::WebsiteDataStore::scheduleStatisticsAndDataRecordsProcessing):
(WebKit::WebsiteDataStore::updatePrevalentDomainsToBlockCookiesFor):
(WebKit::WebsiteDataStore::setAgeCapForClientSideCookies):
(WebKit::WebsiteDataStore::setLastSeen):
(WebKit::WebsiteDataStore::setNotifyPagesWhenDataRecordsWereScanned):
(WebKit::WebsiteDataStore::setNotifyPagesWhenTelemetryWasCaptured):
(WebKit::WebsiteDataStore::hasStorageAccessForFrameHandler):
(WebKit::WebsiteDataStore::getAllStorageAccessEntries):
(WebKit::WebsiteDataStore::grantStorageAccessHandler):
(WebKit::WebsiteDataStore::removeAllStorageAccessHandler):
(WebKit::WebsiteDataStore::removePrevalentDomains):
(WebKit::WebsiteDataStore::hasStorageAccess):
(WebKit::WebsiteDataStore::requestStorageAccess):
(WebKit::WebsiteDataStore::grantStorageAccess):
(WebKit::WebsiteDataStore::setTimeToLiveUserInteraction):
(WebKit::WebsiteDataStore::logUserInteraction):
(WebKit::WebsiteDataStore::hasHadUserInteraction):
(WebKit::WebsiteDataStore::clearUserInteraction):
(WebKit::WebsiteDataStore::isGrandfathered):
(WebKit::WebsiteDataStore::setGrandfathered):
(WebKit::WebsiteDataStore::setCacheMaxAgeCapForPrevalentResources):
(WebKit::WebsiteDataStore::resetCacheMaxAgeCapForPrevalentResources):
(WebKit::WebsiteDataStore::webPageWasAdded):
(WebKit::WebsiteDataStore::webPageWasInvalidated):
(WebKit::WebsiteDataStore::webProcessWillOpenConnection):
(WebKit::WebsiteDataStore::webPageWillOpenConnection):
(WebKit::WebsiteDataStore::webPageDidCloseConnection):
(WebKit::WebsiteDataStore::webProcessDidCloseConnection):
(WebKit::WebsiteDataStore::isAssociatedProcessPool const):
(WebKit::WebsiteDataStore::processPools const):
(WebKit::WebsiteDataStore::resourceLoadStatisticsEnabled const):
(WebKit::WebsiteDataStore::setResourceLoadStatisticsEnabled):
(WebKit::WebsiteDataStore::setResourceLoadStatisticsDebugMode):
(WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):
(WebKit::WebsiteDataStore::logTestingEvent):
* UIProcess/WebsiteData/WebsiteDataStore.h:
(WebKit::WebsiteDataStore::setStatisticsTestingCallback):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess):

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

6 months ago[JSC] Lazily initialize JSModuleLoader
yusukesuzuki@slowstart.org [Mon, 21 Jan 2019 22:01:16 +0000 (22:01 +0000)]
[JSC] Lazily initialize JSModuleLoader
https://bugs.webkit.org/show_bug.cgi?id=193646

Reviewed by Keith Miller and Saam Barati.

Lazily initialize JSModuleLoader so that we do not need to initialize it until we need modules.

* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
(JSC::JSGlobalObject::visitChildren):
* runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::moduleLoader const):

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

6 months ago[JSC] sub op with 0 should be optimized
yusukesuzuki@slowstart.org [Mon, 21 Jan 2019 20:50:59 +0000 (20:50 +0000)]
[JSC] sub op with 0 should be optimized
https://bugs.webkit.org/show_bug.cgi?id=190751

Reviewed by Mark Lam.

LLInt sometimes emit `subp 0, %rxx`. For example, `maxFrameExtentForSlowPathCall` is 0 in X86_64, ARM64, and ARM64E.
So `subp maxFrameExtentForSlowPathCall sp` becomes `subp 0, %rsp`. While `addp 0, %rsp` is removed in offlineasm,
sub operation does not have such an optimization. This patch applies the same optimization to sub operation already
done in add operation. Since the CPU flags changed in offlineasm's these operations are not considered (if these flags
are required, we use special branch operations instead), this optimization is sane.

One problem is that zero-extension of the 32bit register in 64bit architecture. If the instruction emission is skipped,
this won't be happen. Currently, we align our sub to add operation: we skip emission in this case.

* offlineasm/arm64.rb:
* offlineasm/x86.rb:

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

6 months ago[LFC][Floats] Take float top position into account when computing containing block...
zalan@apple.com [Mon, 21 Jan 2019 20:15:53 +0000 (20:15 +0000)]
[LFC][Floats] Take float top position into account when computing containing block height.
https://bugs.webkit.org/show_bug.cgi?id=193655

Reviewed by Antti Koivisto.

Source/WebCore:

When computing the containing block height, we take the first in-flow child's top position and use it as the base position.
However when the first in-flow child clears a previous sibling, its vertical position is not necessarily the correct base for
computing the containing block's height. Let's take the relevant floats into account as well.

Test: fast/block/float/float-first-child-and-clear-sibling.html

* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::contentHeightForFormattingContextRoot):
* layout/floats/FloatingContext.cpp:
(WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
* layout/floats/FloatingState.cpp:
(WebCore::Layout::FloatingState::top const):
* layout/floats/FloatingState.h:

Tools:

* LayoutReloaded/misc/LFC-passing-tests.txt:

LayoutTests:

* fast/block/float/float-first-child-and-clear-sibling-expected.html: Added.
* fast/block/float/float-first-child-and-clear-sibling.html: Added.

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

6 months agoREGRESSION (r240237): Revert changes to WebCore Xcode project
ddkilzer@apple.com [Mon, 21 Jan 2019 19:51:59 +0000 (19:51 +0000)]
REGRESSION (r240237): Revert changes to WebCore Xcode project

* WebCore.xcodeproj/project.pbxproj: Revert changes that were
fixed in r240135.  Darin's patch must have been made prior to
r240135.

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