Timeline



Sep 27, 2019:

8:40 PM Changeset in webkit [250479] by ysuzuki@apple.com
  • 9 edits
    1 add in trunk

[JSC] Keep JSString::value(ExecState*)'s result as String instead of const String&
https://bugs.webkit.org/show_bug.cgi?id=202330

Reviewed by Saam Barati.

JSTests:

  • stress/to-lower-case-gc-stress.js: Added.

Source/JavaScriptCore:

In toLocaleLowerCase and toLocaleUpperCase, we get const String& from JSString* and use it.
But if this string is newly created one in toLocaleLowerCase and toLocaleUpperCase (like, passing a number, and number.toString() is called
in C++), after getting const String&, our C++ code potentially does not have any reference to the owner of this const String&. So, this
JSString* can be collected by GC, while const String& is used. This makes const String& destroyed, and causes crash.

In this patch, we receive it as String instead of const String& to ref it. This ensures that this string is live even if the owner is collected.
I grepped the source code and make this changes conservatively to places which looks dangerous. And I added error checks more after calling value(exec).

In this patch, I didn't introduce the change like that: JSString::value(ExecState*) returns String instead of const String&. Some of places are
really performance sensitive and we want to use the current behavior when we can ensure the owners are alive. We could figure out these points, and we
can change the default behavior of JSString::value function to returning String. But for now, I plan it as a future work.

  • dfg/DFGOperations.cpp:
  • jsc.cpp:

(GlobalObject::moduleLoaderImportModule):

  • runtime/DateConstructor.cpp:

(JSC::constructDate):

  • runtime/JSCJSValueInlines.h:

(JSC::JSValue::equalSlowCaseInline):

  • runtime/RegExpMatchesArray.h:

(JSC::createRegExpMatchesArray):

  • runtime/StringPrototype.cpp:

(JSC::toLocaleCase):
(JSC::stringProtoFuncToLocaleLowerCase):
(JSC::stringProtoFuncToLocaleUpperCase):

  • tools/JSDollarVM.cpp:

(JSC::functionCreateBuiltin):

6:21 PM Changeset in webkit [250478] by Alan Coon
  • 4 edits in branches/safari-608-branch/Source/WebCore

Cherry-pick r250441. rdar://problem/55801089

[iOS] Vimeo fails to AirPlay in desktop mode
https://bugs.webkit.org/show_bug.cgi?id=202322

Reviewed by Eric Carlson.

Add a Quirk which opts Vimeo out of the preload=auto restriction, and allows their
second video element containing a HLS stream to correctly start AirPlaying when the
system route changes.

  • html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::finishInitialization):
  • page/Quirks.cpp: (WebCore::Quirks::needsPreloadAutoQuirk const):
  • page/Quirks.h:

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

6:20 PM Changeset in webkit [250477] by Alan Coon
  • 2 edits in branches/safari-608-branch/Source/JavaScriptCore

Cherry-pick r250440. rdar://problem/55800893

OSR exit shouldn't bother updating get_by_id array profiles that have changed modes
https://bugs.webkit.org/show_bug.cgi?id=202324
<rdar://problem/52669110>

Reviewed by Yusuke Suzuki.

This is an optimization that avoids polluting the array profile.

  • dfg/DFGOSRExit.cpp: (JSC::DFG::OSRExit::executeOSRExit): (JSC::DFG::OSRExit::compileExit):

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

6:20 PM Changeset in webkit [250476] by Alan Coon
  • 3 edits
    2 adds in branches/safari-608-branch

Cherry-pick r250432. rdar://problem/55801091

[iOS]: When inserting a photo and then inserting auto-corrected text, the photo is removed
https://bugs.webkit.org/show_bug.cgi?id=202294

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2019-09-27
Reviewed by Wenson Hsieh.

Source/WebKit:

WebPage::applyAutocorrectionInternal() calls wordRangeFromPosition() to
calculate the range of the word to be replaced with the auto-corrected
word. But if the text of the range does not match the original text,
applyAutocorrectionInternal() tries to correct the range by moving it
forward such that the length of the text range matches the length of the
original text.

Another case, which should correct the range also, is: the range does not
have a text but it is not collapsed. In this case, we should set the range
back to the selection range so non-text nodes is removed.

  • WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::applyAutocorrectionInternal):

LayoutTests:

  • fast/events/ios/autocorrect-after-image-expected.txt: Added.
  • fast/events/ios/autocorrect-after-image.html: Added.

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

6:00 PM Changeset in webkit [250475] by Alan Coon
  • 1 copy in tags/Safari-608.2.40.1.1

Tag Safari-608.2.40.1.1.

5:59 PM Changeset in webkit [250474] by Alan Coon
  • 1 delete in tags/Safari-608.2.40.1.1

Delete tag.

5:55 PM Changeset in webkit [250473] by Alan Coon
  • 1 copy in tags/Safari-608.2.30.1.1

Tag Safari-608.2.30.1.1.

5:49 PM Changeset in webkit [250472] by Alan Coon
  • 9 edits in branches/safari-608.2.40.1-branch/Source/WebKit

Perform changes to match Safari-608.2.11.1.9 content.

This reverts commit r250166.

5:36 PM Changeset in webkit [250471] by Alan Coon
  • 2 edits in branches/safari-608.2.30.1-branch/Source/WebCore

Cherry-pick r250459. rdar://problem/55797569

[Win] Crash under FontCache::lastResortFallbackFont
https://bugs.webkit.org/show_bug.cgi?id=202325
<rdar://problem/47856730>

Reviewed by Brent Fulgham.

As demonstrated by crash reports, there seems to be cases where we are not able to create a last resort fallback font
on Windows. If all attempts to create a fallback font fail, create a font from the default UI font.

No new tests. I have not been able to reproduce this issue.

  • platform/graphics/win/FontCacheWin.cpp: (WebCore::FontCache::lastResortFallbackFont):

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

5:34 PM Changeset in webkit [250470] by Alan Coon
  • 9 edits in branches/safari-608.2.30.1-branch/Source/WebKit

Perform changes to match Safari-608.2.11.1.9 content.

This commit reverts r250166.

5:22 PM Changeset in webkit [250469] by Alan Coon
  • 1 copy in tags/Safari-608.2.40.1.1

Tag Safari-608.2.40.1.1.

4:51 PM Changeset in webkit [250468] by Alan Coon
  • 7 edits in branches/safari-608.2.40.1-branch/Source

Versioning.

4:41 PM Changeset in webkit [250467] by Alan Coon
  • 1 copy in branches/safari-608.2.40.1-branch

New branch.

3:53 PM Changeset in webkit [250466] by Alan Coon
  • 2 edits in branches/safari-608-branch/Source/WebCore

Cherry-pick r250459. rdar://problem/55797570

[Win] Crash under FontCache::lastResortFallbackFont
https://bugs.webkit.org/show_bug.cgi?id=202325
<rdar://problem/47856730>

Reviewed by Brent Fulgham.

As demonstrated by crash reports, there seems to be cases where we are not able to create a last resort fallback font
on Windows. If all attempts to create a fallback font fail, create a font from the default UI font.

No new tests. I have not been able to reproduce this issue.

  • platform/graphics/win/FontCacheWin.cpp: (WebCore::FontCache::lastResortFallbackFont):

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

3:45 PM Changeset in webkit [250465] by Dewei Zhu
  • 15 edits
    1 add in trunk/Websites/perf.webkit.org

Provide build request status description information on dashboard.
https://bugs.webkit.org/show_bug.cgi?id=199810

Reviewed by Ryosuke Niwa.

Add build request status description to show detailed information for a build and show it in dashboard.
Update SQL for existing instance:

ALTER TABLE build_requests ADD COLUMN IF NOT EXISTS request_status_description varchar(1024) DEFAULT NULL;

  • ReadMe.md: Updated instructions for initializing a database to include running 'migrate-database.sql'.
  • init-database.sql: Added request_status_description column.
  • migrate-database.sql: A file stores migration SQL for existing instance.
  • public/api/build-requests.php: Added support for updating request_status_description.
  • public/include/build-requests-fetcher.php: Exposed statusDescription to API.
  • public/v3/components/test-group-revision-table.js: Added UI for showing build request status detail.

(TestGroupRevisionTable.prototype._renderTable):
(TestGroupRevisionTable.prototype._buildDescriptionCell):
(TestGroupRevisionTable.cssTemplate):

  • public/v3/components/warning-icon.js: Extended warning icon to be able to customize information on hover.

(WarningIcon):
(WarningIcon.prototype.render):

  • public/v3/components/button-base.js: Added a instance method to set button title.

(ButtonBase.prototype.setButtonTitle):

  • public/v3/models/build-request.js: Added 'statusDescription' field.

(BuildRequest):
(BuildRequest.prototype.updateSingleton):
(BuildRequest.prototype.statusDescription):

  • server-tests/api-build-requests-tests.js: Fixed unit tests.
  • server-tests/resources/mock-data.js:

(MockData.set mockTestSyncConfigWithSingleBuilder): Added 'status_description' in buildbot mock data.
(MockData.sampleBuildData):

  • server-tests/resources/test-server.js:

(TestServer.prototype.initDatabase): Added code to execute 'migrate-database.sql' on initialization.

  • server-tests/tools-sync-buildbot-integration-tests.js: Added unit tests.
  • tools/js/buildbot-syncer.js: Added 'statusDescription' field to 'BuildbotBuildEntry'.

(BuildbotBuildEntry.prototype.initialize):
(BuildbotBuildEntry.prototype.statusDescription):

  • tools/js/buildbot-triggerable.js:

(BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers):

  • unit-tests/buildbot-syncer-tests.js: Added test code for BuildbotBuildEntry.statusDescription.
3:42 PM Changeset in webkit [250464] by Chris Dumez
  • 13 edits
    2 adds in trunk

Pages using WebGLRenderingContext fail to enter the back/forward cache
https://bugs.webkit.org/show_bug.cgi?id=202318
<rdar://problem/55783612>

Reviewed by Tim Horton.

Source/WebCore:

Allow pages with a WebGLRenderingContext to enter the back/forward cache by updating the
implementation to use SuspendableTimers to fire JS events. This guarantees that no events
will be fired (and thus no JS will run) while in the page cache.

This was preventing some of the pages on weather.com and facebook.com from entering the
back/forward cache.

Test: fast/canvas/webgl/canvas-webgl-page-cache.html

  • dom/DocumentEventQueue.cpp:
  • html/canvas/WebGLRenderingContextBase.cpp:

(WebCore::WebGLRenderingContextBase::WebGLRenderingContextBase):
(WebCore::WebGLRenderingContextBase::canSuspendForDocumentSuspension const):
(WebCore::WebGLRenderingContextBase::suspend):
(WebCore::WebGLRenderingContextBase::resume):
(WebCore::WebGLRenderingContextBase::dispatchContextLostEvent):
(WebCore::WebGLRenderingContextBase::maybeRestoreContext):
(WebCore::WebGLRenderingContextBase::dispatchContextChangedNotification):
(WebCore::WebGLRenderingContextBase::dispatchContextChangedEvent):

  • html/canvas/WebGLRenderingContextBase.h:
  • page/DOMTimer.cpp:

(WebCore::DOMTimer::DOMTimer):

  • page/DOMTimer.h:
  • page/SuspendableTimer.cpp:

(WebCore::SuspendableTimerBase::SuspendableTimerBase):
(WebCore::SuspendableTimerBase::hasPendingActivity const):
(WebCore::SuspendableTimerBase::stop):
(WebCore::SuspendableTimerBase::suspend):
(WebCore::SuspendableTimerBase::resume):
(WebCore::SuspendableTimerBase::canSuspendForDocumentSuspension const):
(WebCore::SuspendableTimerBase::didStop):
(WebCore::SuspendableTimerBase::cancel):
(WebCore::SuspendableTimerBase::startRepeating):
(WebCore::SuspendableTimerBase::startOneShot):
(WebCore::SuspendableTimerBase::repeatInterval const):
(WebCore::SuspendableTimerBase::augmentFireInterval):
(WebCore::SuspendableTimerBase::augmentRepeatInterval):
(WebCore::SuspendableTimer::activeDOMObjectName const):

  • page/SuspendableTimer.h:

Source/WebKitLegacy/win:

  • WebView.cpp:

(WindowCloseTimer::WindowCloseTimer):
(WindowCloseTimer::contextDestroyed):

  • WebView.h:

LayoutTests:

Add layout test coverage.

  • fast/canvas/webgl/canvas-webgl-page-cache-expected.txt: Added.
  • fast/canvas/webgl/canvas-webgl-page-cache.html: Added.
3:15 PM Changeset in webkit [250463] by Adrian Perez de Castro
  • 8 edits in trunk/Source

[GTK][WPE] Fixes for non-unified builds after r249714
https://bugs.webkit.org/show_bug.cgi?id=202304

Reviewed by Youenn Fablet.

Source/WebCore:

No new tests needed.

  • Modules/websockets/WorkerThreadableWebSocketChannel.cpp: Add missing inclusion of Frame.h

to make the compiler stop complaining about Frame being used without being defined.

  • inspector/InspectorShaderProgram.h: Add missing inclusion of wtf/Variant.h, where

WTF::Monostate is defined; and prefixed the usage with its namespace.

Source/WebKit:

  • NetworkProcess/NetworkLoadChecker.h: Add missing inclusion of the pal/SessionID.h header.
  • NetworkProcess/NetworkResourceLoadMap.cpp: Add missing inclusion of the

NetworkResourceLoader.h header.

  • UIProcess/API/C/WKWebsiteDataStoreConfigurationRef.cpp:

(WKWebsiteDataStoreConfigurationCreate): Add missing namespace to usage of the
WebKit::IsPersistent::Yes value.

  • UIProcess/WebPageProxy.cpp: Add missing inclusion of the LegacyGlobalSettings.h header.
3:15 PM Changeset in webkit [250462] by commit-queue@webkit.org
  • 8 edits
    2 adds in trunk

Support accessibility for <figure> element on iOS.
https://bugs.webkit.org/show_bug.cgi?id=202272
<rdar://problem/54789907>

Patch by Andres Gonzalez <Andres Gonzalez> on 2019-09-27
Reviewed by Chris Fleizach.

Source/WebCore:

Test: accessibility/ios-simulator/figure-element.html

Added a role description for the <figure> element.

  • accessibility/AccessibilityObject.cpp:

(WebCore::AccessibilityObject::roleDescription const):

Tools:

Implemented titleUIElement and roleDescription properties for <figure> elements on iOS.

  • WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm:

(WTR::AccessibilityUIElement::titleUIElement):
(WTR::AccessibilityUIElement::roleDescription):

LayoutTests:

  • accessibility/ios-simulator/figure-element-expected.txt: Added.
  • accessibility/ios-simulator/figure-element.html: Added.
2:56 PM Changeset in webkit [250461] by timothy_horton@apple.com
  • 4 edits in trunk/Source/WebKit

Adopt new UIWebGeolocationPolicyDecider SPI to pass a view instead of a window
https://bugs.webkit.org/show_bug.cgi?id=202329
<rdar://problem/25963823>

Reviewed by Wenson Hsieh.

  • Platform/spi/ios/UIKitSPI.h:
  • UIProcess/ios/WKGeolocationProviderIOS.mm:

(-[WKGeolocationProviderIOS geolocationAuthorizationGranted]):

  • UIProcess/ios/WKGeolocationProviderIOSObjCSecurityOrigin.mm:

(WebKit::decidePolicyForGeolocationRequestFromOrigin):
Switch to newer SPI that takes a UIView instead of a UIWindow, so that
UIWebGeolocationPolicyDecider can find the correct presenting view controller.

2:52 PM Changeset in webkit [250460] by Alan Bujtas
  • 5 edits in trunk/Source

[iPadOS] Can’t use RalphLauren.com on iPad because hover menus don’t stay up
https://bugs.webkit.org/show_bug.cgi?id=202331
<rdar://problem/55629493>

Reviewed by Tim Horton.

Source/WebCore:

Unfortunately the top level menu items now are ARIA labelled as 'buttons' and that triggers the fast path on content observation.
This patch introduces a quirk on ralphLauren.com to ignore the ARIA labels when checking whether the target node should always click through.

  • page/Quirks.cpp:

(WebCore::Quirks::shouldIgnoreAriaForFastPathContentObservationCheck const):

  • page/Quirks.h:

Source/WebKit:

  • WebProcess/WebPage/ios/WebPageIOS.mm:

(WebKit::WebPage::handleSyntheticClick):
(WebKit::nodeTriggersFastPath): Deleted.

2:05 PM Changeset in webkit [250459] by pvollan@apple.com
  • 2 edits in trunk/Source/WebCore

[Win] Crash under FontCache::lastResortFallbackFont
https://bugs.webkit.org/show_bug.cgi?id=202325
<rdar://problem/47856730>

Reviewed by Brent Fulgham.

As demonstrated by crash reports, there seems to be cases where we are not able to create a last resort fallback font
on Windows. If all attempts to create a fallback font fail, create a font from the default UI font.

No new tests. I have not been able to reproduce this issue.

  • platform/graphics/win/FontCacheWin.cpp:

(WebCore::FontCache::lastResortFallbackFont):

1:57 PM Changeset in webkit [250458] by achristensen@apple.com
  • 20 edits in trunk

Move shouldUseTestingNetworkSession from NetworkProcessCreationParameters to NetworkSessionCreationParameters
https://bugs.webkit.org/show_bug.cgi?id=202327

Reviewed by Tim Horton.

Source/WebKit:

  • NetworkProcess/NetworkProcess.cpp:

(WebKit::NetworkProcess::initializeNetworkProcess):
(WebKit::NetworkProcess::ensureSession):

  • NetworkProcess/NetworkProcess.h:
  • NetworkProcess/NetworkProcessCreationParameters.cpp:

(WebKit::NetworkProcessCreationParameters::encode const):
(WebKit::NetworkProcessCreationParameters::decode):

  • NetworkProcess/NetworkProcessCreationParameters.h:
  • NetworkProcess/NetworkSession.cpp:

(WebKit::NetworkSession::NetworkSession):

  • NetworkProcess/NetworkSessionCreationParameters.cpp:

(WebKit::NetworkSessionCreationParameters::encode const):
(WebKit::NetworkSessionCreationParameters::decode):

  • NetworkProcess/NetworkSessionCreationParameters.h:
  • NetworkProcess/cocoa/NetworkProcessCocoa.mm:

(WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):

  • NetworkProcess/curl/RemoteNetworkingContextCurl.cpp:

(WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):

  • NetworkProcess/mac/RemoteNetworkingContext.mm:

(WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):

  • NetworkProcess/soup/RemoteNetworkingContextSoup.cpp:

(WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):

  • UIProcess/API/C/WKWebsiteDataStoreConfigurationRef.cpp:

(WKWebsiteDataStoreConfigurationSetPerOriginStorageQuota):
(WKWebsiteDataStoreConfigurationSetNetworkCacheSpeculativeValidationEnabled):
(WKWebsiteDataStoreConfigurationGetTestingSessionEnabled):
(WKWebsiteDataStoreConfigurationSetTestingSessionEnabled):

  • UIProcess/API/C/WKWebsiteDataStoreConfigurationRef.h:
  • UIProcess/WebProcessPool.cpp:

(WebKit::WebProcessPool::ensureNetworkProcess):

  • UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:

(WebKit::WebsiteDataStore::parameters):

  • UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp:

(WebKit::WebsiteDataStoreConfiguration::copy):

  • UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h:

(WebKit::WebsiteDataStoreConfiguration::testingSessionEnabled const):
(WebKit::WebsiteDataStoreConfiguration::setTestingSessionEnabled):

Tools:

  • WebKitTestRunner/TestController.cpp:

(WTR::TestController::websiteDataStore):

1:55 PM Changeset in webkit [250457] by achristensen@apple.com
  • 6 edits in trunk/Source/WebKit

Move legacy custom protocol registration from process pool to NetworkProcessProxy
https://bugs.webkit.org/show_bug.cgi?id=202315

Reviewed by Tim Horton.

Legacy custom protocol registration is a global thing, which is why it's legacy and we're trying to get rid of it.
In the meantime, we don't want it to be in the set of things the NetworkProcess depends on the WebProcessPool for, which should be an empty set.

  • UIProcess/WebProcessPool.cpp:

(WebKit::WebProcessPool::ensureNetworkProcess):
(WebKit::WebProcessPool::registerGlobalURLSchemeAsHavingCustomProtocolHandlers):
(WebKit::WebProcessPool::unregisterGlobalURLSchemeAsHavingCustomProtocolHandlers):
(WebKit::WebProcessPool::registerSchemeForCustomProtocol): Deleted.
(WebKit::WebProcessPool::unregisterSchemeForCustomProtocol): Deleted.

  • UIProcess/WebProcessPool.h:
1:49 PM Changeset in webkit [250456] by achristensen@apple.com
  • 5 edits in trunk/Source/WebKit

Layout Test http/tests/cache-storage/cache-records-persistency.https.html is failing
https://bugs.webkit.org/show_bug.cgi?id=202323

Reviewed by Tim Horton.

This reverts most of r250351.
It turns out NetworkProcessProxy::addSession has some side effects in the UIProcess that are useful for NetworkProcess resumption after crashes. Let's keep that.

  • NetworkProcess/NetworkProcess.cpp:

(WebKit::NetworkProcess::initializeNetworkProcess):

  • NetworkProcess/NetworkProcessCreationParameters.cpp:

(WebKit::NetworkProcessCreationParameters::encode const):
(WebKit::NetworkProcessCreationParameters::decode):

  • NetworkProcess/NetworkProcessCreationParameters.h:
  • UIProcess/WebProcessPool.cpp:

(WebKit::WebProcessPool::ensureNetworkProcess):

1:38 PM Changeset in webkit [250455] by jiewen_tan@apple.com
  • 2 edits in trunk/Source/WebCore

Unreviewed, rolling out r250397.

caused failure on iOS 13

Reverted changeset:

"REGRESSION: [ Catalina WK2 ] http/wpt/webauthn/public-key-
credential-create-success-u2f.https.html is failing"
https://bugs.webkit.org/show_bug.cgi?id=201620
https://trac.webkit.org/changeset/250397

1:25 PM Changeset in webkit [250454] by Alan Coon
  • 4 edits in branches/safari-608-branch

Cherry-pick r250401. rdar://problem/55770702

ContextMenu on a link in an email no longer shows web preview
https://bugs.webkit.org/show_bug.cgi?id=201120
<rdar://54353617>

Reviewed by Wenson Hsieh.

Source/WebKit:

Only go down the image path if we are not also a link.

  • UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView continueContextMenuInteraction:]):

Tools:

Test context menus on a link that is also an image.

  • TestWebKitAPI/Tests/WebKitCocoa/ContextMenus.mm: (contextMenuWebViewDriver): (-[TestContextMenuImageWithoutConfigurationUIDelegate webView:contextMenuConfigurationForElement:completionHandler:]): (-[TestContextMenuImageWithoutConfigurationUIDelegate webView:contextMenuWillPresentForElement:]): (-[TestContextMenuImageWithoutConfigurationUIDelegate webView:contextMenuForElement:willCommitWithAnimator:]): (-[TestContextMenuImageWithoutConfigurationUIDelegate webView:contextMenuDidEndForElement:]): (TEST):

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

1:25 PM Changeset in webkit [250453] by Alan Coon
  • 4 edits
    4 adds in branches/safari-608-branch

Cherry-pick r250392. rdar://problem/55770703

[iOS 13] Tapping on a non-editable text selection should toggle callout bar visibility instead of clearing selection
https://bugs.webkit.org/show_bug.cgi?id=202254
<rdar://problem/54410263>

Reviewed by Megan Gardner.

Source/WebKit:

In iOS 13, tapping a text selection should toggle callout bar visibility (i.e. "selection commands" in UIKit).
This currently does not work for non-editable text, since the synthetic click gesture simultaneously fires
alongside the text interaction assistant's non-editable tap gesture, which dispatches a click to the page which
then clears the selection.

To remedy this and match platform behavior, we avoid recognizing clicks that occur over the text selection, but
only in the case where the bounding rect of the text selection doesn't cover a large portion of the visible
content rect of the web view. This ensures that the user doesn't get stuck in a state where it's impossible to
dismiss a very large text selection (e.g. after selecting all the content on the page).

Tests: editing/selection/ios/clear-selection-after-tap-in-large-selected-non-editable-text.html

editing/selection/ios/toggle-callout-bar-after-tap-in-selected-non-editable-text.html

  • UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _shouldToggleSelectionCommandsAfterTapAt:]):

Check the last known selection rects (on _lastSelectionDrawingInfo) to see if the tapped point lies within at
least one of the selection rects.

(-[WKContentView gestureRecognizerShouldBegin:]):

LayoutTests:

  • editing/selection/ios/clear-selection-after-tap-in-large-selected-non-editable-text-expected.txt: Added.
  • editing/selection/ios/clear-selection-after-tap-in-large-selected-non-editable-text.html: Added.

Add a new layout test to verify that when tapping in a text selection that encompasses the entire page, we allow
the tap to dismiss the selection instead of toggling callout bar visibility.

  • editing/selection/ios/toggle-callout-bar-after-tap-in-selected-non-editable-text-expected.txt: Added.
  • editing/selection/ios/toggle-callout-bar-after-tap-in-selected-non-editable-text.html: Added.

Add another layout test to verify that when tapping inside a text selection, the callout bar is toggled, and
when tapping outside the selected text, the selection is dismissed.

  • resources/ui-helper.js: (window.UIHelper.async.waitForSelectionToAppear): (window.UIHelper.async.waitForSelectionToDisappear):

New helper methods to wait for selection rects to appear or disappear.

(window.UIHelper):

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

1:25 PM Changeset in webkit [250452] by Alan Coon
  • 2 edits in branches/safari-608-branch/Tools

Cherry-pick r250391. rdar://problem/55770728

TestWebKitAPI.WebKit.ReloadWithDifferingInitialScale is failing consistently
https://bugs.webkit.org/show_bug.cgi?id=202273

Reviewed by Aakash Jain.

The content width scaling limits added in r250361 prevent this test from scaling down the content width (2000px
wide) to fit the viewport (375px). To avoid this issue, change the content width from 2000px to 1500px, which is
still a very wide content width for a web page.

  • TestWebKitAPI/Tests/WebKitCocoa/ReloadWithDifferingInitialScale.mm:

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

1:25 PM Changeset in webkit [250451] by Alan Coon
  • 2 edits in branches/safari-608-branch/Source/WebKitLegacy/win

Cherry-pick r250374. rdar://problem/55770710

Unreviewed build fix for Windows ports.
https://bugs.webkit.org/show_bug.cgi?id=202125
<rdar://problem/14944104>

  • WebCoreSupport/WebEditorClient.h: Added missing subFrameScrollPositionChanged.

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

1:25 PM Changeset in webkit [250450] by Truitt Savell
  • 2 edits in trunk/LayoutTests

fast/images/async-image-multiple-clients-repaint.html
https://bugs.webkit.org/show_bug.cgi?id=202328

Unreviewed test gardening

  • platform/ios/TestExpectations:
1:25 PM Changeset in webkit [250449] by Alan Coon
  • 13 edits
    2 adds in branches/safari-608-branch

Cherry-pick r250365. rdar://problem/55770710

Update selections after scrolling for iframes and hide selections while iframes and overflow scrolls are scrolling.
https://bugs.webkit.org/show_bug.cgi?id=202125

Reviewed by Tim Horton.

Source/WebCore:

Test: editing/selection/ios/update-selection-after-iframe-scroll.html

When we end scrolling, make sure that iframes get a final update to ensure that the
selection is in the correct position. Pipe that to WebKit/UIProcess via
frame specific plath.

  • loader/EmptyClients.cpp:
  • page/EditorClient.h:
  • page/scrolling/AsyncScrollingCoordinator.cpp: (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):

Source/WebKit:

Add additional calls into UIKit differentiate between main frame scrolling and overflow/iframe scrolling.
Add piping for iframe specific scrolling.

  • Platform/spi/ios/UIKitSPI.h:
  • UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _willStartScrollingOrZooming]): (-[WKContentView _didEndScrollingOrZooming]):
  • WebProcess/WebCoreSupport/WebEditorClient.cpp: (WebKit::WebEditorClient::subFrameScrollPositionChanged):
  • WebProcess/WebCoreSupport/WebEditorClient.h:
  • WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm: (WebKit::WebEditorClient::subFrameScrollPositionChanged):

Source/WebKitLegacy/mac:

Filling out unused functions needed for new fix.

  • WebCoreSupport/WebEditorClient.h:

LayoutTests:

Test that an iframe selection is updated after a scroll is completed.

  • editing/selection/ios/update-selection-after-iframe-scroll-expected.txt: Added.
  • editing/selection/ios/update-selection-after-iframe-scroll.html: Added.

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

1:25 PM Changeset in webkit [250448] by Alan Coon
  • 5 edits
    2 adds in branches/safari-608-branch

Cherry-pick r250361. rdar://problem/55770728

Page temporarily jumps to an excessively small viewport scale while loading usatoday.com
https://bugs.webkit.org/show_bug.cgi?id=202224
<rdar://problem/52906640>

Reviewed by Tim Horton.

Source/WebCore:

On some pages (e.g. usatoday.com), the content width of the page temporarily becomes very large during page
load. This causes a couple of viewport scaling behaviors (notably, the existing shrink-to-fit heuristic in
ViewportConfiguration::initialScaleFromSize, as well as the new iPad-specific content-aware shrink-to-fit
heuristic in WebPage::immediatelyShrinkToFitContent) to cause the page to shrink down excessively in an attempt
to fit all the content to the viewport. This causes a very ugly flash as the page appears zoomed out initially
during page load, before zooming back in.

To fix this, we add some sanity checks to these viewport scaling heuristics. In ViewportConfiguration's
initialScaleFromSize method, in the codepath where an initial scale is not specified, we always scale to fit the
contents of the page; instead, detect the case where the content width is enormous (with a threshold arbitrarily
chosen to be 1920) and fall back to the scaling to fit the viewport's width, if such a width has been explicitly
set. This ensures that we avoid excessive shrinking in the case where content is extremely wide, but also that
we do scale the viewport down to fit all the content in the case where the content isn't extremely wide (e.g. on
daringfireball.com).

See WebKit ChangeLog for more detail.

Test: fast/viewport/ios/shrink-to-fit-large-content-width.html

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

Source/WebKit:

Tweaks the content-aware shrink-to-fit algorithm to bail in the case where the content width is extremely large,
such that it bails instead of attempting to fit the entire content of the page. See WebCore ChangeLog for more
details.

  • WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::immediatelyShrinkToFitContent):

LayoutTests:

Adds a new layout test to verify that when the content width of the page is excessively large and an explicit
viewport width is specified, we don't attempt to zoom out to fit the larger content width, and instead zoom to
fit the explicit viewport width.

  • fast/viewport/ios/shrink-to-fit-large-content-width-expected.txt: Added.
  • fast/viewport/ios/shrink-to-fit-large-content-width.html: Added.

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

1:25 PM Changeset in webkit [250447] by Alan Coon
  • 8 edits
    9 adds in branches/safari-608-branch

Cherry-pick r250315. rdar://problem/55770706

[iPadOs] The second click event is missing on double tap when dblclick handler is not present
https://bugs.webkit.org/show_bug.cgi?id=202006
<rdar://problem/51706828>

Reviewed by Wenson Hsieh.

Source/WebKit:

While double tapping,

  1. the first tap triggers a click event through the normal _singleTapIdentified/_singleTapRecognized codepath.
  2. and the second tap should trigger either a second single click event or a second single click followed by a dblclick event when dblclick handler is present. However the second click is dropped on the floor when the node under the cursor does not have a dblclick handler (see handleDoubleTapForDoubleClickAtPoint()) -so we end up sending one click event.

This patch fixes this case by sending the second tap through the normal single tap flow when the dblclick handler is not present.

  • Shared/ios/InteractionInformationAtPosition.h:
  • Shared/ios/InteractionInformationAtPosition.mm: (WebKit::InteractionInformationAtPosition::encode const): (WebKit::InteractionInformationAtPosition::decode):
  • UIProcess/ios/WKContentViewInteraction.h:
  • UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView setupInteraction]): (-[WKContentView gestureRecognizerShouldBegin:]): (WebKit::WebPage::positionInformation): (WebKit::WebPage::requestPositionInformation):

LayoutTests:

  • fast/events/touch/ios/double-tap-for-two-clicks1-expected.txt: Added.
  • fast/events/touch/ios/double-tap-for-two-clicks1.html: Added.
  • fast/events/touch/ios/double-tap-for-two-clicks2-expected.txt: Added.
  • fast/events/touch/ios/double-tap-for-two-clicks2.html: Added.
  • fast/events/touch/ios/double-tap-for-two-clicks3-expected.txt: Added.
  • fast/events/touch/ios/double-tap-for-two-clicks3.html: Added.
  • fast/events/touch/ios/double-tap-for-two-clicks4-expected.txt: Added.
  • fast/events/touch/ios/double-tap-for-two-clicks4.html: Added.
  • fast/events/touch/ios/doubleclick.html: Added.
  • fast/events/touch/resources/doubleClickContent.html: Added.

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

1:25 PM Changeset in webkit [250446] by Alan Coon
  • 7 edits
    11 adds in branches/safari-608-branch

Cherry-pick r250300. rdar://problem/55770718

Mixed content blocking is bypassed for WebSockets in Workers (159726)
https://bugs.webkit.org/show_bug.cgi?id=159726
<rdar://problem/27326438>

Patch by Kate Cheney <Kate Cheney> on 2019-09-24
Reviewed by Brady Eidson.

Source/WebCore:

Tests: http/tests/websocket/tests/hybi/non-document-mixed-content-blocked-http-with-embedded-https-with-embedded-http.html

http/tests/websocket/tests/hybi/non-document-mixed-content-blocked-http-with-embedded-https.html
http/tests/websocket/tests/hybi/non-document-mixed-content-blocked-https-with-embedded-http-with-embedded-https.https.html
http/tests/websocket/tests/hybi/non-document-mixed-content-blocked.https.html

  • Modules/websockets/WebSocket.cpp: (WebCore::WebSocket::connect):
  • Modules/websockets/WorkerThreadableWebSocketChannel.cpp: (WebCore::WorkerThreadableWebSocketChannel::Bridge::connect):
  • loader/MixedContentChecker.cpp: (WebCore::MixedContentChecker::checkForMixedContentInFrameTree):
  • loader/MixedContentChecker.h: Patch to block insecure WebSocket URL connection attempts by Workers on secure pages. If the URL is ws, and any embedding iframe has protocol https, and the context is a Worker, the connection should be blocked.

I was unable to write a test case to hit the case where a document
does not have a frame and tries to communicate via a worker to
connect to a WebSocket because after removing the subframe from its
parent, the subframe is unable to perform a postMessage to a worker
even in the same script execution to tell the worker to connect
to a WebSocket.

LayoutTests:

Added 4 test cases and 2 html resources utilized by the tests.
The cases test the following:

  1. an https page with a worker trying to connect via ws: url --> fails.
  2. an https page embedded in an http page trying to connect via ws :url (through a worker) --> fails.
  3. an http page embedded in an https page with an http top frame trying to connect via an insecure ws url fails.
  4. an https page embedded in an http page embedded in an https page trying to connect to a ws :url via a worker --> fails.
  • http/tests/websocket/tests/hybi/non-document-mixed-content-blocked-http-with-embedded-https-expected.txt: Added.
  • http/tests/websocket/tests/hybi/non-document-mixed-content-blocked-http-with-embedded-https-with-embedded-http-expected.txt: Added.
  • http/tests/websocket/tests/hybi/non-document-mixed-content-blocked-http-with-embedded-https-with-embedded-http.html: Added.
  • http/tests/websocket/tests/hybi/non-document-mixed-content-blocked-http-with-embedded-https.html: Added.
  • http/tests/websocket/tests/hybi/non-document-mixed-content-blocked-https-with-embedded-http-with-embedded-https.https-expected.txt: Added.
  • http/tests/websocket/tests/hybi/non-document-mixed-content-blocked-https-with-embedded-http-with-embedded-https.https.html: Added.
  • http/tests/websocket/tests/hybi/non-document-mixed-content-blocked.https-expected.txt: Added.
  • http/tests/websocket/tests/hybi/non-document-mixed-content-blocked.https.html: Added.
  • http/tests/websocket/tests/hybi/resources/non-document-mixed-content-blocked-embedded-http.https.html: Added.
  • http/tests/websocket/tests/hybi/resources/non-document-mixed-content-blocked-embedding-https.js: Added. (handleConnect.self.postMessage): (handleConnect): (runTests.ws.onopen): (runTests.ws.onerror): (runTests):
  • http/tests/websocket/tests/hybi/resources/non-document-mixed-content-blocked.html: Added.
  • http/tests/websocket/tests/hybi/resources/non-document-mixed-content-blocked.js: Added. (handleConnect.self.postMessage): (handleConnect): (runTests.ws.onopen): (runTests.ws.onerror): (runTests):
  • http/tests/workers/service/resources/serviceworker-websocket-worker.js: (async.doTest): Updated previous test which was hitting the fix to use a wss url

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

1:25 PM Changeset in webkit [250445] by Alan Coon
  • 3 edits in branches/safari-608-branch/Source/WebCore

Cherry-pick r250290. rdar://problem/55770704

AudioTrackPrivateMediaStreamCocoa does not need to manipulate the audio unit in play/pause methods
https://bugs.webkit.org/show_bug.cgi?id=202097
<rdar://problem/51548144>

Reviewed by Eric Carlson.

Instead of manipulating the audio unit in play/pause methods, it is more convenient to do so in audioSamplesAvailable.
play/pause methods only update boolean values that audioSamplesAvailable will read.
In particular, m_autoPlay and m_isPlaying are no longer modified in the audio thread.

Behavior was racy so difficult to reproduce.

  • platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp: (WebCore::AudioTrackPrivateMediaStreamCocoa::playInternal): (WebCore::AudioTrackPrivateMediaStreamCocoa::pause): (WebCore::AudioTrackPrivateMediaStreamCocoa::audioSamplesAvailable):
  • platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.h:

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

1:25 PM Changeset in webkit [250444] by Alan Coon
  • 2 edits in branches/safari-608-branch/Source/WebKit

Cherry-pick r250197. rdar://problem/55612001

Fix an assertion failure introduced in r250186.

  • UIProcess/Plugins/mac/PluginProcessProxyMac.mm: (WebKit::PluginProcessProxy::platformGetLaunchOptionsWithAttributes): Corrected the assertion.

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

1:25 PM Changeset in webkit [250443] by Alan Coon
  • 4 edits in branches/safari-608-branch/Source/WebKit

Cherry-pick r250186. rdar://problem/55612001

Safari 13 may launch leftover 32-bit plug-in process from Safari 12’s WebKit, which crashes
https://bugs.webkit.org/show_bug.cgi?id=202077
<rdar://problem/55547063>

Reviewed by Sam Weinig.

  • Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm: (WebKit::getPluginArchitecture): Removed support for i386 plug-ins.
  • UIProcess/Launcher/mac/ProcessLauncherMac.mm: (WebKit::serviceName): Assert that the requested process type is not Plugin32.
  • UIProcess/Plugins/mac/PluginProcessProxyMac.mm: (WebKit::PluginProcessProxy::platformGetLaunchOptionsWithAttributes): Assert that the plug-in architecture is x86_64.

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

12:56 PM Changeset in webkit [250442] by Alan Coon
  • 18 edits
    1 copy
    2 adds in branches/safari-608-branch

Apply patch. rdar://problem/55608016

12:48 PM Changeset in webkit [250441] by jer.noble@apple.com
  • 4 edits in trunk/Source/WebCore

[iOS] Vimeo fails to AirPlay in desktop mode
https://bugs.webkit.org/show_bug.cgi?id=202322

Reviewed by Eric Carlson.

Add a Quirk which opts Vimeo out of the preload=auto restriction, and allows their
second video element containing a HLS stream to correctly start AirPlaying when the
system route changes.

  • html/HTMLMediaElement.cpp:

(WebCore::HTMLMediaElement::finishInitialization):

  • page/Quirks.cpp:

(WebCore::Quirks::needsPreloadAutoQuirk const):

  • page/Quirks.h:
12:30 PM Changeset in webkit [250440] by keith_miller@apple.com
  • 2 edits in trunk/Source/JavaScriptCore

OSR exit shouldn't bother updating get_by_id array profiles that have changed modes
https://bugs.webkit.org/show_bug.cgi?id=202324
<rdar://problem/52669110>

Reviewed by Yusuke Suzuki.

This is an optimization that avoids polluting the array profile.

  • dfg/DFGOSRExit.cpp:

(JSC::DFG::OSRExit::executeOSRExit):
(JSC::DFG::OSRExit::compileExit):

12:25 PM Changeset in webkit [250439] by Alan Bujtas
  • 7 edits in trunk/Source/WebCore

[LFC][IFC] Line::close should merge the text runs.
https://bugs.webkit.org/show_bug.cgi?id=202319
<rdar://problem/55785949>

Reviewed by Antti Koivisto.

Now Line::close returns the final Display::Run list.

  • layout/displaytree/DisplayRect.h:

(WebCore::Display::Rect::expandHorizontally):
(WebCore::Display::Rect::expandVertically):
(WebCore::Display::Rect::expand):

  • layout/displaytree/DisplayRun.h:

(WebCore::Display::Run::expandVertically):
(WebCore::Display::Run::expandHorizontally):

  • layout/inlineformatting/InlineFormattingContextLineLayout.cpp:

(WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns):

  • layout/inlineformatting/InlineLine.cpp:

(WebCore::Layout::Line::close):

  • layout/inlineformatting/InlineLine.h:

(WebCore::Layout::Line::Run::displayRun):

12:12 PM Changeset in webkit [250438] by jer.noble@apple.com
  • 2 edits in trunk/Source/WebKit

Unreviewed build-fix: wrap the AssertionServicesSPI.h in an IOS_FAMILY check.

  • WebProcess/cocoa/WebProcessCocoa.mm:
12:09 PM Changeset in webkit [250437] by Chris Dumez
  • 5 edits in trunk

Allow pages served over HTTPS with Cache-Control: no-store header to enter the back/forward cache
https://bugs.webkit.org/show_bug.cgi?id=202314
<rdar://problem/55783482>

Reviewed by Alex Christensen.

Source/WebCore:

Allow pages served over HTTPS with Cache-Control: no-store header to enter the back/forward cache.
This was preventing all pages on Facebook.com to enter the back/forward cache.

No new tests, updated existing test.

  • history/PageCache.cpp:

(WebCore::canCacheFrame):

LayoutTests:

Update existing test to reflect behavior change.

  • http/tests/navigation/https-in-page-cache-expected.txt:
  • http/tests/navigation/resources/https-in-page-cache-1.php:
11:32 AM Changeset in webkit [250436] by commit-queue@webkit.org
  • 13 edits in trunk

Non-standard Error properties should not be enumerable
https://bugs.webkit.org/show_bug.cgi?id=198975

Patch by Alexey Shvayka <Alexey Shvayka> on 2019-09-27
Reviewed by Ross Kirsling.

JSTests:

  • ChakraCore/test/Error/NativeErrors_v4.baseline-jsc: Adjust expectations.
  • microbenchmarks/let-for-in.js: Adjust test.
  • test262/expectations.yaml: Mark 6 test cases as passing.

Source/JavaScriptCore:

Define non-standard Error properties "line", "column", and "sourceURL" as non-enumerable to match other engines.

  • runtime/ErrorInstance.cpp:

(JSC::ErrorInstance::materializeErrorInfoIfNeeded):

LayoutTests:

  • inspector/debugger/resources/exception.js: Introduce stringifyError helper.
  • inspector/debugger/setPauseOnExceptions-all.html:
  • inspector/debugger/setPauseOnExceptions-none.html:
  • inspector/debugger/setPauseOnExceptions-uncaught.html:
  • js/exception-properties-expected.txt:
  • js/script-tests/exception-properties.js:
11:28 AM Changeset in webkit [250435] by Alan Coon
  • 1 edit in branches/safari-608-branch/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm

Unreviewed build fix. rdar://problem/55644650

10:54 AM Changeset in webkit [250434] by Devin Rousso
  • 3 edits in trunk/Source/WebCore

Flaky Test: inspector/canvas/updateShader.html
https://bugs.webkit.org/show_bug.cgi?id=202186
<rdar://problem/55716053>

Reviewed by Joseph Pecoraro.

If the WebGLProgram outlives it's WebGLRenderingContext, the ScriptExecutionContext*
that was provided in the constructor won't be invalidated leading to the bad access crash.

Rather than pass the ScriptExecutionContext* directly, have WebGLProgram inherit from
ContextDestructionObserver so that it can propertly invalidate (and notify Web Inspector)
when the related context is about to be destroyed.

Test: inspector/canvas/updateShader.html

  • html/canvas/WebGLProgram.h:

(WebCore::WebGLProgram::scriptExecutionContext const): Deleted.

  • html/canvas/WebGLProgram.cpp:

(WebCore::WebGLProgram::WebGLProgram):
(WebCore::WebGLProgram::contextDestroyed): Added.

10:45 AM Changeset in webkit [250433] by Alan Coon
  • 1 edit in branches/safari-608-branch/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm

Unreviewed build fix. rdar://problem/55644650

10:33 AM Changeset in webkit [250432] by commit-queue@webkit.org
  • 3 edits
    2 adds in trunk

[iOS]: When inserting a photo and then inserting auto-corrected text, the photo is removed
https://bugs.webkit.org/show_bug.cgi?id=202294

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2019-09-27
Reviewed by Wenson Hsieh.

Source/WebKit:

WebPage::applyAutocorrectionInternal() calls wordRangeFromPosition() to
calculate the range of the word to be replaced with the auto-corrected
word. But if the text of the range does not match the original text,
applyAutocorrectionInternal() tries to correct the range by moving it
forward such that the length of the text range matches the length of the
original text.

Another case, which should correct the range also, is: the range does not
have a text but it is not collapsed. In this case, we should set the range
back to the selection range so non-text nodes is removed.

  • WebProcess/WebPage/ios/WebPageIOS.mm:

(WebKit::WebPage::applyAutocorrectionInternal):

LayoutTests:

  • fast/events/ios/autocorrect-after-image-expected.txt: Added.
  • fast/events/ios/autocorrect-after-image.html: Added.
10:14 AM Changeset in webkit [250431] by wilander@apple.com
  • 6 edits
    2 adds in trunk

Storage Access API: document.hasStorageAccess() should return false by default
https://bugs.webkit.org/show_bug.cgi?id=202281
<rdar://problem/55718526>

Reviewed by Alex Christensen.

document.hasStorageAccess() should return false by default so that it only
returns true if the context has asked for and been granted storage access.

Source/WebKit:

  • NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:

(WebKit::ResourceLoadStatisticsDatabaseStore::hasStorageAccess):

  • NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:

(WebKit::ResourceLoadStatisticsMemoryStore::hasStorageAccess):

LayoutTests:

  • http/tests/storageAccess/has-storage-access-false-by-default-expected.txt: Added.
  • http/tests/storageAccess/has-storage-access-false-by-default.html: Added.
  • platform/ios/TestExpectations:

The new test is marked as [ Pass ].

  • platform/mac-wk2/TestExpectations:

The new test is marked as [ Pass ].

9:56 AM Changeset in webkit [250430] by ysuzuki@apple.com
  • 4 edits
    2 adds in trunk

[JSC] DFG recursive-tail-call optimization should not emit jump to call-frame with varargs
https://bugs.webkit.org/show_bug.cgi?id=202299
<rdar://problem/52669116>

Reviewed by Saam Barati.

JSTests:

  • stress/recursive-tail-call-optimization-should-not-jump-into-call-frame-with-varargs-simple.js: Added.

(foo):
(test):

  • stress/recursive-tail-call-optimization-should-not-jump-into-call-frame-with-varargs.js: Added.

(foo):
(C1.prototype.baz):
(C1):
(bar):
(noInline.bar.goo):
(C2.prototype.baz):
(C2):
(test):

Source/JavaScriptCore:

When converting recursive-tail-call to jump to the upper call frame, we picked call-frame which is spread by LoadVarargs.
This is wrong since this call-frame does not know the exact number of arguments. We are using InlineCallFrame::argumentCountIncludingThis,
but this is maximal argumentCountIncludingThis when InlineCallFrame is Varargs call-frame. Let's see the simple example.

'use strict';
var count = 0;
function foo() {

count--;
if (count === 0)

return 30;

return foo(42, 42); HERE

}

function test() {

count = 100;
return foo(...[42, 42]); THERE

}
noInline(test);

In the above case, currently, we convert HERE's foo call to the jump to the prologue of the foo function inlined by "test". But since foo is called
in a varargs form, "test" emits LoadVarargs, and it also emits SetArgumentMaybe for 1st and 2nd arguments. Since HERE's foo call is actually passing
two arguments, we emit a Phi node which Upsilon is from SetArgumentMaybe and 42 Constant. This is wrong since SetArgumentMaybe should not be used. Later,
SSA conversion phase emits Upsilon with SetArgumentMaybe, and since SetArgumentMaybe is simply removed in SSA conversion phase, it ends up emitting
Upsilon without a child.

We are currently only performing recursive-tail-call optimization when argument count matches. Given this condition, we should not pick varargs CallFrame
as a jump target.

  • dfg/DFGByteCodeParser.cpp:

(JSC::DFG::ByteCodeParser::handleRecursiveTailCall):

  • dfg/DFGSSAConversionPhase.cpp:

(JSC::DFG::SSAConversionPhase::run):

9:49 AM Changeset in webkit [250429] by Alan Bujtas
  • 9 edits in trunk/Source/WebCore

[LFC][IFC] Replace Line::Run's logicalRect/textContext with Display::Run
https://bugs.webkit.org/show_bug.cgi?id=202313
<rdar://problem/55782430>

Reviewed by Antti Koivisto.

Display::Run is a container for logical rect and text context. Let's replace Line::Run's logical rect/text context with Display::Run.

  • layout/Verification.cpp:

(WebCore::Layout::outputMismatchingSimpleLineInformationIfNeeded):
(WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded):

  • layout/displaytree/DisplayRun.h:

(WebCore::Display::Run::logicalRect const):

  • layout/inlineformatting/InlineFormattingContextLineLayout.cpp:

(WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns):
(WebCore::Layout::InlineFormattingContext::InlineLayout::alignRuns const):

  • layout/inlineformatting/InlineFormattingContextQuirks.cpp:

(WebCore::Layout::InlineFormattingContext::Quirks::lineDescentNeedsCollapsing const):

  • layout/inlineformatting/InlineFormattingState.h:

(WebCore::Layout::InlineFormattingState::addInlineRun):

  • layout/inlineformatting/InlineLine.cpp:

(WebCore::Layout::Line::Run::Run):
(WebCore::Layout::Line::isVisuallyEmpty const):
(WebCore::Layout::Line::appendNonBreakableSpace):
(WebCore::Layout::Line::appendTextContent):
(WebCore::Layout::Line::appendNonReplacedInlineBox):
(WebCore::Layout::Line::appendHardLineBreak):

  • layout/inlineformatting/InlineLine.h:

(WebCore::Layout::Line::Run::displayRun const):
(WebCore::Layout::Line::Run::logicalRect const):
(WebCore::Layout::Line::Run::adjustLogicalTop):
(WebCore::Layout::Line::Run::moveVertically):
(WebCore::Layout::Line::Run::moveHorizontally):
(WebCore::Layout::Line::Run::textContext const): Deleted.

  • layout/layouttree/LayoutTreeBuilder.cpp:

(WebCore::Layout::outputInlineRuns):

9:27 AM Changeset in webkit [250428] by jer.noble@apple.com
  • 9 edits in trunk/Source/WebKit

[iOS] Lock screen controls can fail to play web content
https://bugs.webkit.org/show_bug.cgi?id=202279

Reviewed by Chris Dumez.

When playback is paused from the lock screen via Now Playing controls, the WebProcess,
UIProcess, and Network Process will all be suspended. MediaRemote will take an assertion
and wake up the WebProcess when a remote control command to "play" is sent via the Now
Playing controls. However, if a synchronous message to the (suspended) Network or UIProcess
is issued before the notification that the process was unexpectedly unsuspended can be
issued (which will subsequently unsuspend the UIProcess and Network process), we can get
into a deadlocked state where the main thread is blocked on the sync message to a suspended
process.

To work around this problem, move all the processing from ProcessTaskStateObserver to a
WorkQueue / background thread. This requires making the ProcessTaskStateObserver thread-safe,
though its only current client is a Singleton (the WebProcess class), and so the risk of
thread safety issues is currently minimal. Regardless, access to the Client pointer must be
guarded by a Lock, and the Client itself must become ref-counted, so that the
ProcessTaskStateObserver can ref its Client (the WebProcess) during callback processing.

Unfortunately, sendWithAsyncReply() is not thread safe, nor is ProcessAssertion, so instead
just use send() and set a 5-second timeout before expiring the assertion, and just use
BKSProcessStateAssertion directly.

  • Shared/Cocoa/ProcessTaskStateObserver.h:

(WebKit::ProcessTaskStateObserver::Client::ref):
(WebKit::ProcessTaskStateObserver::Client::deref):
(WebKit::ProcessTaskStateObserver::setClient): Deleted.
(WebKit::ProcessTaskStateObserver::client): Deleted.

  • Shared/Cocoa/ProcessTaskStateObserver.mm:

(-[WKProcessTaskStateObserverDelegate process:taskStateDidChange:]):
(WebKit::ProcessTaskStateObserver::create):
(WebKit::ProcessTaskStateObserver::ProcessTaskStateObserver):
(WebKit::ProcessTaskStateObserver::~ProcessTaskStateObserver):
(WebKit::ProcessTaskStateObserver::invalidate):
(WebKit::ProcessTaskStateObserver::client):
(WebKit::ProcessTaskStateObserver::setTaskState):

  • WebProcess/WebProcess.cpp:

(WebKit::m_taskStateObserver):

  • WebProcess/WebProcess.h:
  • UIProcess/Cocoa/WebProcessProxyCocoa.mm:

(WebKit::WebProcessProxy::processWasUnexpectedlyUnsuspended):

  • UIProcess/WebProcessProxy.h:
  • UIProcess/WebProcessProxy.messages.in:
  • WebProcess/cocoa/WebProcessCocoa.mm:

(WebKit::WebProcess::processTaskStateDidChange):

9:25 AM Changeset in webkit [250427] by Truitt Savell
  • 5 edits in trunk/Source/WebCore

Unreviewed, rolling out r250415.

Broke iOS debug testing with 50 crashes and 850 API failure

Reverted changeset:

"ScrollingTreeScrollingNode: use LayerRepresentation for
scroll container, scrolled contents layers"
https://bugs.webkit.org/show_bug.cgi?id=202256
https://trac.webkit.org/changeset/250415

9:07 AM Changeset in webkit [250426] by achristensen@apple.com
  • 20 edits in trunk

Move service worker process termination delay disabling from process pool to website data store
https://bugs.webkit.org/show_bug.cgi?id=202308

Reviewed by Chris Dumez.

Source/WebCore:

  • workers/service/server/SWServer.cpp:

(WebCore::SWServer::SWServer):
(WebCore::SWServer::unregisterServiceWorkerClient):

  • workers/service/server/SWServer.h:

(WebCore::SWServer::disableServiceWorkerProcessTerminationDelay): Deleted.

Source/WebKit:

It's only there for a test, which still works quickly.

  • NetworkProcess/NetworkProcess.cpp:

(WebKit::NetworkProcess::initializeNetworkProcess):
(WebKit::NetworkProcess::addWebsiteDataStore):
(WebKit::NetworkProcess::destroySession):
(WebKit::NetworkProcess::fetchWebsiteData):
(WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomains):
(WebKit::NetworkProcess::registrableDomainsWithWebsiteData):
(WebKit::NetworkProcess::swServerForSession):
(WebKit::NetworkProcess::addServiceWorkerSession):
(WebKit::NetworkProcess::disableServiceWorkerProcessTerminationDelay): Deleted.

  • NetworkProcess/NetworkProcess.h:
  • NetworkProcess/NetworkProcess.messages.in:
  • Shared/WebsiteDataStoreParameters.cpp:

(WebKit::WebsiteDataStoreParameters::encode const):
(WebKit::WebsiteDataStoreParameters::decode):

  • Shared/WebsiteDataStoreParameters.h:
  • UIProcess/API/Cocoa/WKProcessPool.mm:

(-[WKProcessPool _disableServiceWorkerProcessTerminationDelay]): Deleted.

  • UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
  • UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
  • UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:

(-[_WKWebsiteDataStoreConfiguration serviceWorkerProcessTerminationDelayEnabled]):
(-[_WKWebsiteDataStoreConfiguration setServiceWorkerProcessTerminationDelayEnabled:]):

  • UIProcess/WebProcessPool.cpp:

(WebKit::WebProcessPool::ensureNetworkProcess):
(WebKit::WebProcessPool::disableServiceWorkerProcessTerminationDelay): Deleted.

  • UIProcess/WebProcessPool.h:
  • UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:

(WebKit::WebsiteDataStore::parameters):

  • UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp:

(WebKit::WebsiteDataStoreConfiguration::copy):

  • UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h:

(WebKit::WebsiteDataStoreConfiguration::serviceWorkerProcessTerminationDelayEnabled const):
(WebKit::WebsiteDataStoreConfiguration::setServiceWorkerProcessTerminationDelayEnabled):

Tools:

  • TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm:
8:56 AM Changeset in webkit [250425] by Chris Dumez
  • 3 edits
    2 adds in trunk

IDBRequest should not prevent a page from entering the back/forward cache
https://bugs.webkit.org/show_bug.cgi?id=202270
<rdar://problem/55744717>

Reviewed by Youenn Fablet.

Source/WebCore:

Update IDBRequest::canSuspendForDocumentSuspension() to return true instead of
false. IDBRequest can only fire 2 events (error / success) and for both its
merely enqueues the Event to the DocumentEventQueue. The DocumentEventQueue
uses a SuspendableTimer (which will be suspended while the document is in the
page cache) so there is no risk of firing the events (and thus running script)
while in the page cache.

Test: storage/indexeddb/IDBRequest-page-cache.html

  • Modules/indexeddb/IDBRequest.cpp:

(WebCore::IDBRequest::canSuspendForDocumentSuspension const):

LayoutTests:

Add layout test coverage.

  • storage/indexeddb/IDBRequest-page-cache-expected.txt: Added.
  • storage/indexeddb/IDBRequest-page-cache.html: Added.
8:55 AM Changeset in webkit [250424] by achristensen@apple.com
  • 8 edits in trunk/Source/WebKit

Enable and disable ResourceLoadStatistics only by session
https://bugs.webkit.org/show_bug.cgi?id=202298

Reviewed by Chris Dumez.

This is needed to keep per-session things per-session and per-process-pool things per-process-pool.
This was a strange case where we would take the current session's value and apply it globally.
This has no change in behavior because it is globally enabled and disabled by API clients anyways.

  • NetworkProcess/NetworkProcess.cpp:

(WebKit::NetworkProcess::setResourceLoadStatisticsEnabled):

  • NetworkProcess/NetworkProcess.h:
  • NetworkProcess/NetworkProcess.messages.in:
  • UIProcess/API/Cocoa/WKWebView.mm:

(-[WKWebView _initializeWithConfiguration:]):

  • UIProcess/WebProcessPool.cpp:

(WebKit::WebProcessPool::setResourceLoadStatisticsEnabled): Deleted.

  • UIProcess/WebProcessPool.h:
  • UIProcess/WebsiteData/WebsiteDataStore.cpp:

(WebKit::WebsiteDataStore::setResourceLoadStatisticsEnabled):

8:31 AM Changeset in webkit [250423] by Alan Bujtas
  • 5 edits in trunk/Source/WebCore

[LFC][IFC] Remove redundant Line::TextContext member variables
https://bugs.webkit.org/show_bug.cgi?id=202300
<rdar://problem/55769916>

Reviewed by Antti Koivisto.

This is in preparation for using Display::Run in Line::Run instead of Display::Rect + TextContext.

  • layout/inlineformatting/InlineFormattingContextLineLayout.cpp:

(WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns):

  • layout/inlineformatting/InlineFormattingContextQuirks.cpp:

(WebCore::Layout::InlineFormattingContext::Quirks::lineDescentNeedsCollapsing const):

  • layout/inlineformatting/InlineLine.cpp:

(WebCore::Layout::Line::Run::isWhitespace const):
(WebCore::Layout::Line::Run::canBeExtended const):
(WebCore::Layout::Line::isVisuallyEmpty const):
(WebCore::Layout::Line::removeTrailingTrimmableContent):
(WebCore::Layout::Line::trailingTrimmableWidth const):
(WebCore::Layout::Line::appendTextContent):

  • layout/inlineformatting/InlineLine.h:

(WebCore::Layout::Line::Run::isVisuallyEmpty const):
(WebCore::Layout::Line::Run::setVisuallyIsEmpty):
(WebCore::Layout::Line::Run::setTextIsCollapsed): Deleted.

7:34 AM Changeset in webkit [250422] by achristensen@apple.com
  • 21 edits
    2 deletes in trunk

Remove unused WebProcessPool::setCanHandleHTTPSServerTrustEvaluation
https://bugs.webkit.org/show_bug.cgi?id=202285

Reviewed by Youenn Fablet.

Source/WebKit:

The SPI to set this was deprecated in r250377 with a replacement that was adopted in rdar://problem/55731135
I removed a layout test using the old SPI and replaced it with a more precise API test verifying the behavior of the new SPI
before and after the introduction of NSURLSession's _strictTrustEvaluate:queue:completionHandler:

  • NetworkProcess/NetworkProcess.cpp:

(WebKit::NetworkProcess::initializeNetworkProcess):
(WebKit::NetworkProcess::setCanHandleHTTPSServerTrustEvaluation): Deleted.

  • NetworkProcess/NetworkProcess.h:

(WebKit::NetworkProcess::canHandleHTTPSServerTrustEvaluation const): Deleted.

  • NetworkProcess/NetworkProcess.messages.in:
  • NetworkProcess/NetworkProcessCreationParameters.cpp:

(WebKit::NetworkProcessCreationParameters::encode const):
(WebKit::NetworkProcessCreationParameters::decode):

  • NetworkProcess/NetworkProcessCreationParameters.h:
  • NetworkProcess/cocoa/NetworkSessionCocoa.mm:

(-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
(canNSURLSessionTrustEvaluate): Deleted.

  • UIProcess/API/C/WKContext.cpp:

(WKContextSetCanHandleHTTPSServerTrustEvaluation):

  • UIProcess/API/Cocoa/WKProcessPool.mm:

(-[WKProcessPool _setCanHandleHTTPSServerTrustEvaluation:]):

  • UIProcess/WebProcessPool.cpp:

(WebKit::WebProcessPool::ensureNetworkProcess):
(WebKit::WebProcessPool::setCanHandleHTTPSServerTrustEvaluation): Deleted.

  • UIProcess/WebProcessPool.h:

Tools:

  • TestWebKitAPI/Tests/WebKitCocoa/Challenge.mm:

(-[ServerTrustDelegate webView:didFinishNavigation:]):
(-[ServerTrustDelegate webView:didFailProvisionalNavigation:withError:]):
(-[ServerTrustDelegate waitForDidFinishNavigation]):
(-[ServerTrustDelegate waitForDidFailProvisionalNavigationError]):
(-[ServerTrustDelegate authenticationChallengeCount]):
(-[ServerTrustDelegate webView:didReceiveAuthenticationChallenge:completionHandler:]):
(TestWebKitAPI::TEST):

  • WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
  • WebKitTestRunner/InjectedBundle/TestRunner.cpp:

(WTR::TestRunner::setCanHandleHTTPSServerTrustEvaluation): Deleted.
(WTR::TestRunner::canDoServerTrustEvaluationInNetworkProcess): Deleted.
(WTR::TestRunner::serverTrustEvaluationCallbackCallsCount): Deleted.

  • WebKitTestRunner/InjectedBundle/TestRunner.h:
  • WebKitTestRunner/TestController.cpp:

(WTR::TestController::resetStateToConsistentValues):
(WTR::TestController::didReceiveAuthenticationChallenge):
(WTR::TestController::canDoServerTrustEvaluationInNetworkProcess const): Deleted.

  • WebKitTestRunner/TestController.h:

(WTR::TestController::serverTrustEvaluationCallbackCallsCount const): Deleted.

  • WebKitTestRunner/TestInvocation.cpp:

(WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle):

  • WebKitTestRunner/cocoa/TestControllerCocoa.mm:

(WTR::TestController::canDoServerTrustEvaluationInNetworkProcess const): Deleted.

LayoutTests:

  • http/tests/ssl/certificate-validation-expected.txt: Removed.
  • http/tests/ssl/certificate-validation.html: Removed.
7:05 AM Changeset in webkit [250421] by achristensen@apple.com
  • 17 edits in trunk

Remove unused APIProcessPoolConfiguration::diskCacheSpeculativeValidationEnabled
https://bugs.webkit.org/show_bug.cgi?id=202290

Reviewed by Carlos Garcia Campos.

Source/WebKit:

The SPI to set this was deprecated in r250377 with a replacement that was adopted in rdar://problem/55731135

  • NetworkProcess/NetworkProcessCreationParameters.cpp:

(WebKit::NetworkProcessCreationParameters::encode const):
(WebKit::NetworkProcessCreationParameters::decode):

  • NetworkProcess/NetworkProcessCreationParameters.h:
  • NetworkProcess/cocoa/NetworkProcessCocoa.mm:

(WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):

  • UIProcess/API/APIProcessPoolConfiguration.cpp:

(API::ProcessPoolConfiguration::copy):

  • UIProcess/API/APIProcessPoolConfiguration.h:
  • UIProcess/API/C/WKContext.cpp:

(WKContextSetDiskCacheSpeculativeValidationEnabled):

  • UIProcess/API/C/WKWebsiteDataStoreConfigurationRef.cpp:

(WKWebsiteDataStoreConfigurationGetNetworkCacheSpeculativeValidationEnabled):
(WKWebsiteDataStoreConfigurationSetNetworkCacheSpeculativeValidationEnabled):

  • UIProcess/API/C/WKWebsiteDataStoreConfigurationRef.h:
  • UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:

(-[_WKProcessPoolConfiguration diskCacheSpeculativeValidationEnabled]):
(-[_WKProcessPoolConfiguration setDiskCacheSpeculativeValidationEnabled:]):

  • UIProcess/WebProcessPool.cpp:

(WebKit::WebProcessPool::ensureNetworkProcess):

Tools:

  • TestWebKitAPI/Tests/WebKitCocoa/WKProcessPoolConfiguration.mm:

(TEST):

  • WebKitTestRunner/TestController.cpp:

(WTR::TestController::websiteDataStore):
(WTR::TestController::generatePageConfiguration):

3:48 AM Changeset in webkit [250420] by zandobersek@gmail.com
  • 3 edits in trunk/Source/WebCore

[Nicosia] Implement frame scrolling functionality
https://bugs.webkit.org/show_bug.cgi?id=202201

Reviewed by Carlos Garcia Campos.

Implement logic in the ScrollingTreeFrameScrollingNodeNicosia class,
largely following the Mac port's implementation but skipping areas we
don't support or can keep simple, like CSS scroll snap, frame pinning
and more complex wheel event handling through the platform-specific
delegate behavior.

  • page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.cpp:

(WebCore::ScrollingTreeFrameScrollingNodeNicosia::commitStateBeforeChildren):
(WebCore::ScrollingTreeFrameScrollingNodeNicosia::commitStateAfterChildren):
(WebCore::ScrollingTreeFrameScrollingNodeNicosia::handleWheelEvent):
(WebCore::ScrollingTreeFrameScrollingNodeNicosia::adjustedScrollPosition const):
(WebCore::ScrollingTreeFrameScrollingNodeNicosia::currentScrollPositionChanged):
(WebCore::ScrollingTreeFrameScrollingNodeNicosia::repositionScrollingLayers):
(WebCore::ScrollingTreeFrameScrollingNodeNicosia::repositionRelatedLayers):

  • page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.h:
3:36 AM Changeset in webkit [250419] by zandobersek@gmail.com
  • 2 edits in trunk/Source/WebCore

[Nicosia] ScrollingCoordinatorNicosia should handle wheel events coming from the main thread
https://bugs.webkit.org/show_bug.cgi?id=202275

Reviewed by Carlos Garcia Campos.

  • page/scrolling/nicosia/ScrollingCoordinatorNicosia.cpp:

(WebCore::ScrollingCoordinatorNicosia::handleWheelEvent):
Handle wheel events that get rerouted through the main thread,
dispatching them back to the scrolling thread so that they end up
performing the desired scroll if possible.

3:34 AM Changeset in webkit [250418] by zandobersek@gmail.com
  • 8 edits in trunk/Source

[CoordinatedGraphics] support bounds origin
https://bugs.webkit.org/show_bug.cgi?id=198998

Reviewed by Carlos Garcia Campos.

Source/WebCore:

Add bounds-origin support to the CoordinatedGraphics stack. Currently we
take the short-cut implementation of just combining the bounds origin
and the position value and incorporating them into the layer transform
we calculate in TextureMapperLayer.

Additional boilerplate code is added, as required, to relay the
WebCore::GraphicsLayer change of bounds origin to the rendering system.

  • platform/graphics/nicosia/NicosiaPlatformLayer.h:

(Nicosia::CompositionLayer::flushState):

  • platform/graphics/texmap/TextureMapperLayer.cpp:

(WebCore::TextureMapperLayer::computeTransformsRecursive):
(WebCore::TextureMapperLayer::setBoundsOrigin):

  • platform/graphics/texmap/TextureMapperLayer.h:
  • platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:

(WebCore::CoordinatedGraphicsLayer::setBoundsOrigin):
(WebCore::CoordinatedGraphicsLayer::computePositionRelativeToBase):

  • platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:

Source/WebKit:

  • Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:

(WebKit::CoordinatedGraphicsScene::updateSceneState):
Apply bounds origin value to the TextureMapperLayer object.

2:04 AM Changeset in webkit [250417] by youenn@apple.com
  • 6 edits in trunk

Make IsNSURLSessionWebSocketEnabled an experimental flag
https://bugs.webkit.org/show_bug.cgi?id=202135
<rdar://problem/55694721>

Reviewed by Geoff Garen.

Source/WebKit:

Add C API to switch off this feature in WTR.

  • Shared/WebPreferences.yaml:
  • UIProcess/API/C/WKPreferences.cpp:

(WKPreferencesSetIsNSURLSessionWebSocketEnabled):
(WKPreferencesGetIsNSURLSessionWebSocketEnabled):

  • UIProcess/API/C/WKPreferencesRefPrivate.h:

Tools:

  • WebKitTestRunner/TestController.cpp:

(WTR::TestController::resetPreferencesToConsistentValues):
Set preference to false by default.

12:13 AM Changeset in webkit [250416] by jiewen_tan@apple.com
  • 9 edits in trunk

SubFrameSOAuthorizationSession should ensure messages are posted in the right order to the parent frame
https://bugs.webkit.org/show_bug.cgi?id=202061
<rdar://problem/55485666>

Reviewed by Youenn Fablet.

Source/WebKit:

This patch ensures messages that signal the process of SOAuthorization interception are posted in
the right order to the parent frame. Before this patch, there are chances that SOAuthorizationDidCancel
could be posted to the parent before SOAuthorizationDidStart. There are few causes that lead to
this race condition:
1) SubFrameSOAuthorizationSession::beforeStart posts SOAuthorizationDidStart in the next runloop. So
extension could have the chance to invoke SubFrameSOAuthorizationSession::fallBackToWebPathInternal
before SOAuthorizationDidStart is posted.
2) Even if the order is right in the UI process, it is not guaranteed that Web process will strictly
follow the order as the loading process is async.

To fix the issue:
1) SubFrameSOAuthorizationSession::beforeStart now posts SOAuthorizationDidStart in the same runloop.
2) Observer is introduced in FrameLoadState such that SubFrameSOAuthorizationSession could know if
the loading is finished. With this new capacity, SubFrameSOAuthorizationSession can ensure it only
posts next message when the previous message has been posted.

Implementation wise, a deque to queue requests is provided to maintain order.
1) When new request is added to the deque, SubFrameSOAuthorizationSession will only load the request
if it is the only element in the deque. Otherwise, it does nothing.
2) When SubFrameSOAuthorizationSession receives didFinishLoad, it pops the head of the queue and loads
the next request in the queue if any.
The above design should guarantee all requests are loaded in sequence.

  • UIProcess/Cocoa/SOAuthorization/SubFrameSOAuthorizationSession.h:
  • UIProcess/Cocoa/SOAuthorization/SubFrameSOAuthorizationSession.mm:

(WebKit::SubFrameSOAuthorizationSession::SubFrameSOAuthorizationSession):
(WebKit::SubFrameSOAuthorizationSession::~SubFrameSOAuthorizationSession):
(WebKit::SubFrameSOAuthorizationSession::fallBackToWebPathInternal):
(WebKit::SubFrameSOAuthorizationSession::completeInternal):
(WebKit::SubFrameSOAuthorizationSession::beforeStart):
(WebKit::SubFrameSOAuthorizationSession::didFinishLoad):
(WebKit::SubFrameSOAuthorizationSession::appendRequestToLoad):
(WebKit::SubFrameSOAuthorizationSession::loadRequestToFrame):
(WebKit::SubFrameSOAuthorizationSession::loadDataToFrame): Deleted.
(WebKit::SubFrameSOAuthorizationSession::postDidCancelMessageToParent): Deleted.

  • UIProcess/FrameLoadState.cpp:

(WebKit::FrameLoadState::addObserver):
(WebKit::FrameLoadState::removeObserver):
(WebKit::FrameLoadState::didFinishLoad):

  • UIProcess/FrameLoadState.h:

Tools:

Adds tests that check the order of messages posted by SubFrameSOAuthorizationSession.

  • TestWebKitAPI/Tests/WebKitCocoa/TestSOAuthorization.mm:

(-[TestSOAuthorizationScriptMessageHandler userContentController:didReceiveScriptMessage:]):
(resetState):
(TestWebKitAPI::TEST):

Sep 26, 2019:

11:19 PM Changeset in webkit [250415] by zandobersek@gmail.com
  • 5 edits in trunk/Source/WebCore

ScrollingTreeScrollingNode: use LayerRepresentation for scroll container, scrolled contents layers
https://bugs.webkit.org/show_bug.cgi?id=202256

Reviewed by Simon Fraser.

Make the scroll container and scrolled contents layer holders
platform-independent by using the LayerRepresentation as the underlying
type for the two member variables in ScrollingTreeScrollingNode.

  • page/scrolling/ScrollingTreeScrollingNode.cpp:

(WebCore::ScrollingTreeScrollingNode::commitStateBeforeChildren):

  • page/scrolling/ScrollingTreeScrollingNode.h:
  • page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:

(WebCore::ScrollingTreeFrameScrollingNodeMac::repositionScrollingLayers):

  • page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:

(WebCore::ScrollingTreeOverflowScrollingNodeMac::repositionScrollingLayers):

11:17 PM Changeset in webkit [250414] by Chris Dumez
  • 14 edits
    2 adds in trunk

Pages frequently fails to enter the back/forward cache due to pending loads
https://bugs.webkit.org/show_bug.cgi?id=202289
<rdar://problem/55758506>

Reviewed by Geoffrey Garen.

Source/WebCore:

Allow pages to enter the back / forward cache, even if they have pending loads.
Note that these pending loads get cancelled. Also note that we won't enter page
cache unless the 'load' event has been fired in the main frame, since a
HistoryItem would not get created otherwise. This was causing frequent transient
failures to enter the back / forward cache while browsing (e.g. on weather.com).

Test: http/tests/navigation/page-cache-pending-load.html

  • history/PageCache.cpp:

(WebCore::canCacheFrame):

  • loader/CrossOriginPreflightChecker.cpp:
  • loader/CrossOriginPreflightChecker.h:
  • loader/DocumentLoader.cpp:

(WebCore::DocumentLoader::setMainDocumentError):
(WebCore::DocumentLoader::stopLoading):

  • loader/DocumentLoader.h:
  • loader/DocumentThreadableLoader.cpp:
  • loader/DocumentThreadableLoader.h:
  • loader/cache/CachedResource.cpp:
  • loader/cache/CachedResource.h:
  • loader/cache/CachedResourceClient.h:

(WebCore::CachedResourceClient::deprecatedDidReceiveCachedResource):

  • page/DiagnosticLoggingKeys.cpp:

(WebCore::DiagnosticLoggingKeys::mainFrameHasNotFinishedLoadingKey):

  • page/DiagnosticLoggingKeys.h:

LayoutTests:

Add layout test coverage.

  • http/tests/navigation/page-cache-pending-load-expected.txt: Added.
  • http/tests/navigation/page-cache-pending-load.html: Added.
10:13 PM Changeset in webkit [250413] by commit-queue@webkit.org
  • 68 edits
    1 copy
    3 moves
    1 delete in trunk

Resource Load Statistics: Downgrade all third-party referrer headers
https://bugs.webkit.org/show_bug.cgi?id=201353
<rdar://problem/54895650>
Source/WebKit:

Majority of this patch was written by John Wilander <wilander@apple.com>.

Patch by Kate Cheney <Kate Cheney> on 2019-09-26
Reviewed by Brent Fulgham.

When tracking protections are enabled, we should downgrade all third-party
referrers to their origins. Note that this downgrade will be specific to
Cocoa so other ports will have to adopt as they see fit.

Cocoa already does this downgrade in ephemeral sessions (shipping).

The majority of these changes are test infrastructure. The functional
change is in WebKit::NetworkDataTaskCocoa and WebKit::NetworkSession.

  • NetworkProcess/NetworkProcess.cpp:

(WebKit::NetworkProcess::setShouldDowngradeReferrerForTesting):

  • NetworkProcess/NetworkProcess.h:
  • NetworkProcess/NetworkProcess.messages.in:
  • NetworkProcess/NetworkSession.cpp:

(WebKit::NetworkSession::isResourceLoadStatisticsEnabled const):
(WebKit::NetworkSession::setShouldDowngradeReferrerForTesting):
(WebKit::NetworkSession::shouldDowngradeReferrer const):

  • NetworkProcess/NetworkSession.h:
  • NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
  • NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:

(WebKit::NetworkDataTaskCocoa::isThirdPartyRequest const):
(WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
(WebKit::NetworkDataTaskCocoa::restrictRequestReferrerToOriginIfNeeded):
(WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
(WebKit::NetworkDataTaskCocoa::isThirdPartyRequest): Deleted.

  • UIProcess/API/C/WKWebsiteDataStoreRef.cpp:

(WKWebsiteDataStoreSetResourceLoadStatisticsShouldDowngradeReferrerForTesting):
(WKWebsiteDataStoreStatisticsResetToConsistentState):

  • UIProcess/API/C/WKWebsiteDataStoreRef.h:
  • UIProcess/Network/NetworkProcessProxy.cpp:

(WebKit::NetworkProcessProxy::setShouldDowngradeReferrerForTesting):

  • UIProcess/Network/NetworkProcessProxy.h:
  • UIProcess/WebsiteData/WebsiteDataStore.cpp:

(WebKit::WebsiteDataStore::setResourceLoadStatisticsShouldDowngradeReferrerForTesting):

  • UIProcess/WebsiteData/WebsiteDataStore.h:

Tools:

Majority of this patch was written by John Wilander <wilander@apple.com>.

Patch by Kate Cheney <Kate Cheney> on 2019-09-26
Reviewed by Brent Fulgham.

The changes to the TestRunner facilitates an opt-out for test cases
that either test the referrer mechanism explicitly or tests that
rely on the full referrer to be sent.

The new boolean variable and early return in
TestRunner::setStatisticsShouldDowngradeReferrer() prevent the same
event from trying to set multiple TestRunner callbacks.

  • WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
  • WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:

(WTR::InjectedBundle::didReceiveMessageToPage):

  • WebKitTestRunner/InjectedBundle/TestRunner.cpp:

(WTR::TestRunner::setStatisticsShouldDowngradeReferrer):
(WTR::TestRunner::statisticsCallDidSetShouldDowngradeReferrerCallback):

  • WebKitTestRunner/InjectedBundle/TestRunner.h:
  • WebKitTestRunner/TestController.cpp:

(WTR::TestController::setStatisticsShouldDowngradeReferrer):

  • WebKitTestRunner/TestController.h:
  • WebKitTestRunner/TestInvocation.cpp:

(WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle):
(WTR::TestInvocation::didSetShouldDowngradeReferrer):

  • WebKitTestRunner/TestInvocation.h:

LayoutTests:

Majority of this patch was written by John Wilander <wilander@apple.com>

Patch by Kate Cheney <Kate Cheney> on 2019-09-26
Reviewed by Brent Fulgham.

The changes in the two http/tests/resourceLoadStatistics/strip-referrer-to-origin*
tests and the http/tests/navigation/ping-attribute/* tests are for the functional
change. The other changes are to make use of the new
testRunner.setStatisticsShouldDowngradeReferrer() to maintain earlier functionality.

TestRunner::setStatisticsShouldDowngradeReferrer() function is not
supported for mac-wk1, win or wincairo.

  • http/tests/blink/sendbeacon/beacon-cross-origin-expected.txt:
  • http/tests/navigation/ping-attribute/anchor-cross-origin.html:
  • http/tests/navigation/ping-attribute/area-cross-origin.html:
  • http/tests/referrer-policy-script/no-referrer-when-downgrade/cross-origin-http-http.html:
  • http/tests/referrer-policy-script/no-referrer-when-downgrade/cross-origin-http.https.html:
  • http/tests/referrer-policy-script/no-referrer-when-downgrade/same-origin.html:
  • http/tests/referrer-policy-script/no-referrer/cross-origin-http-http.html:
  • http/tests/referrer-policy-script/no-referrer/cross-origin-http.https.html:
  • http/tests/referrer-policy-script/no-referrer/same-origin.html:
  • http/tests/referrer-policy-script/origin-when-cross-origin/cross-origin-http-http.html:
  • http/tests/referrer-policy-script/origin-when-cross-origin/cross-origin-http.https.html:
  • http/tests/referrer-policy-script/origin-when-cross-origin/same-origin.html:
  • http/tests/referrer-policy-script/origin/cross-origin-http-http.html:
  • http/tests/referrer-policy-script/origin/cross-origin-http.https.html:
  • http/tests/referrer-policy-script/origin/same-origin.html:
  • http/tests/referrer-policy-script/same-origin/cross-origin-http-http.html:
  • http/tests/referrer-policy-script/same-origin/cross-origin-http.https.html:
  • http/tests/referrer-policy-script/same-origin/same-origin.html:
  • http/tests/referrer-policy-script/strict-origin-when-cross-origin/cross-origin-http-http.html:
  • http/tests/referrer-policy-script/strict-origin-when-cross-origin/cross-origin-http.https.html:
  • http/tests/referrer-policy-script/strict-origin-when-cross-origin/same-origin.html:
  • http/tests/referrer-policy-script/strict-origin/cross-origin-http-http.html:
  • http/tests/referrer-policy-script/strict-origin/cross-origin-http.https.html:
  • http/tests/referrer-policy-script/strict-origin/same-origin.html:
  • http/tests/referrer-policy-script/unsafe-url/cross-origin-http-http.html:
  • http/tests/referrer-policy-script/unsafe-url/cross-origin-http.https.html:
  • http/tests/referrer-policy-script/unsafe-url/same-origin.html:
  • http/tests/referrer-policy/no-referrer-when-downgrade/cross-origin-http-http.html:
  • http/tests/referrer-policy/no-referrer-when-downgrade/cross-origin-http.https.html:
  • http/tests/referrer-policy/no-referrer-when-downgrade/same-origin.html:
  • http/tests/referrer-policy/unsafe-url/cross-origin-http-http.html:
  • http/tests/referrer-policy/unsafe-url/cross-origin-http.https.html:
  • http/tests/resourceLoadStatistics/strip-referrer-to-origin-for-prevalent-subresource-requests.html: Removed.
  • http/tests/resourceLoadStatistics/strip-referrer-to-origin-for-third-party-redirects-expected.txt: Renamed from LayoutTests/http/tests/resourceLoadStatistics/strip-referrer-to-origin-for-prevalent-subresource-redirects-expected.txt.
  • http/tests/resourceLoadStatistics/strip-referrer-to-origin-for-third-party-redirects.html: Copied from LayoutTests/http/tests/resourceLoadStatistics/strip-referrer-to-origin-for-prevalent-subresource-redirects.html.
  • http/tests/resourceLoadStatistics/strip-referrer-to-origin-for-third-party-requests-expected.txt: Renamed from LayoutTests/http/tests/resourceLoadStatistics/strip-referrer-to-origin-for-prevalent-subresource-requests-expected.txt.
  • http/tests/resourceLoadStatistics/strip-referrer-to-origin-for-third-party-requests.html: Renamed from LayoutTests/http/tests/resourceLoadStatistics/strip-referrer-to-origin-for-prevalent-subresource-redirects.html.
  • http/tests/security/contentSecurityPolicy/report-cross-origin-no-cookies-when-private-browsing-enabled.php:
  • http/tests/security/contentSecurityPolicy/report-cross-origin-no-cookies.php:
  • http/tests/security/referrer-policy-header.html:
  • platform/ios-wk2/TestExpectations:
  • platform/ios/TestExpectations:
  • platform/mac-wk1/TestExpectations:
  • platform/mac-wk2/TestExpectations:
  • platform/win/TestExpectations:
  • platform/wincairo/TestExpectations:
  • platform/wk2/TestExpectations:
  • resources/testharnessreport.js:
  • resources/js-test.js:
8:43 PM Changeset in webkit [250412] by Alan Bujtas
  • 4 edits in trunk/Source/WebCore

[LFC][IFC] Line::Run should have a reference to the associated InlineItem
https://bugs.webkit.org/show_bug.cgi?id=202288
<rdar://problem/55758112>

Reviewed by Antti Koivisto.

It makes it clearer where the type and the layout box come from.

  • layout/inlineformatting/InlineFormattingContextQuirks.cpp:

(WebCore::Layout::InlineFormattingContext::Quirks::lineDescentNeedsCollapsing const):

  • layout/inlineformatting/InlineLine.cpp:

(WebCore::Layout::Line::Run::Run):

  • layout/inlineformatting/InlineLine.h:

(WebCore::Layout::Line::Run::layoutBox const):
(WebCore::Layout::Line::Run::textContext const):
(WebCore::Layout::Line::Run::isText const):
(WebCore::Layout::Line::Run::isBox const):
(WebCore::Layout::Line::Run::isLineBreak const):
(WebCore::Layout::Line::Run::isContainerStart const):
(WebCore::Layout::Line::Run::isContainerEnd const):
(WebCore::Layout::Line::Run::type const): Deleted.

8:23 PM Changeset in webkit [250411] by Alan Bujtas
  • 6 edits in trunk/Source/WebCore

[LFC][IFC] Remove redundant Line::Content
https://bugs.webkit.org/show_bug.cgi?id=202284
<rdar://problem/55757187>

Reviewed by Antti Koivisto.

Line::Content is really just a list or runs at this point.

  • layout/inlineformatting/InlineFormattingContext.h:
  • layout/inlineformatting/InlineFormattingContextLineLayout.cpp:

(WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns):

  • layout/inlineformatting/InlineFormattingContextQuirks.cpp:

(WebCore::Layout::InlineFormattingContext::Quirks::lineDescentNeedsCollapsing const):

  • layout/inlineformatting/InlineLine.cpp:

(WebCore::Layout::Line::Run::Run):
(WebCore::Layout::Line::Line):
(WebCore::Layout::Line::isVisuallyEmpty const):
(WebCore::Layout::Line::close):
(WebCore::Layout::Line::appendNonBreakableSpace):
(WebCore::Layout::Line::appendTextContent):
(WebCore::Layout::Line::appendNonReplacedInlineBox):
(WebCore::Layout::Line::appendHardLineBreak):
(WebCore::Layout::Line::Content::Run::Run): Deleted.

  • layout/inlineformatting/InlineLine.h:

(WebCore::Layout::Line::Run::layoutBox const):
(WebCore::Layout::Line::Run::logicalRect const):
(WebCore::Layout::Line::Run::textContext const):
(WebCore::Layout::Line::Run::type const):
(WebCore::Layout::Line::Run::isText const):
(WebCore::Layout::Line::Run::isBox const):
(WebCore::Layout::Line::Run::isLineBreak const):
(WebCore::Layout::Line::Run::isContainerStart const):
(WebCore::Layout::Line::Run::isContainerEnd const):
(WebCore::Layout::Line::Run::adjustLogicalTop):
(WebCore::Layout::Line::Run::moveVertically):
(WebCore::Layout::Line::Run::moveHorizontally):
(WebCore::Layout::Line::Run::setTextIsCollapsed):
(WebCore::Layout::Line::Content::Run::layoutBox const): Deleted.
(WebCore::Layout::Line::Content::Run::logicalRect const): Deleted.
(WebCore::Layout::Line::Content::Run::textContext const): Deleted.
(WebCore::Layout::Line::Content::Run::type const): Deleted.
(WebCore::Layout::Line::Content::Run::isText const): Deleted.
(WebCore::Layout::Line::Content::Run::isBox const): Deleted.
(WebCore::Layout::Line::Content::Run::isLineBreak const): Deleted.
(WebCore::Layout::Line::Content::Run::isContainerStart const): Deleted.
(WebCore::Layout::Line::Content::Run::isContainerEnd const): Deleted.
(WebCore::Layout::Line::Content::Run::adjustLogicalTop): Deleted.
(WebCore::Layout::Line::Content::Run::moveVertically): Deleted.
(WebCore::Layout::Line::Content::Run::moveHorizontally): Deleted.
(WebCore::Layout::Line::Content::Run::setTextIsCollapsed): Deleted.
(WebCore::Layout::Line::Content::runs const): Deleted.
(WebCore::Layout::Line::Content::runs): Deleted.

8:00 PM Changeset in webkit [250410] by eric.carlson@apple.com
  • 3 edits
    2 adds in trunk

REGRESSION (iOS 13): Trying to record just audio using HTML Media Capture crashes Safari
https://bugs.webkit.org/show_bug.cgi?id=202039
<rdar://problem/55566628>

Reviewed by Jer Noble.

Source/WebKit:

  • UIProcess/ios/forms/WKFileUploadPanel.mm:

(-[WKFileUploadPanel _mediaTypesForPickerSourceType:]): UIImagePickerController doesn't
support audio-only recording, so show the video recorder for "audio/*".

LayoutTests:

  • fast/forms/ios/file-upload-panel-capture-expected.txt: Added.
  • fast/forms/ios/file-upload-panel-capture.html: Added.
7:40 PM Changeset in webkit [250409] by Alan Coon
  • 7 edits in tags/Safari-609.1.5.1/Source

Versioning.

7:38 PM Changeset in webkit [250408] by Alan Coon
  • 1 copy in tags/Safari-609.1.5.1

New tag.

7:25 PM Changeset in webkit [250407] by Joseph Pecoraro
  • 4 edits in trunk/Source/WebInspectorUI

Web Inspector: Include LocalResourceOverrides in the Open Resource dialog
https://bugs.webkit.org/show_bug.cgi?id=202023

Reviewed by Devin Rousso.

  • UserInterface/Views/OpenResourceDialog.js:

(WI.OpenResourceDialog.prototype._addScriptsForTarget):
Also walk the extraScriptCollection. Some Worker resource loads never
fully become resources.

(WI.OpenResourceDialog.prototype.didPresentDialog):
(WI.OpenResourceDialog.prototype._addLocalResourceOverrides):
Include local resource override resources.

(WI.OpenResourceDialog.prototype._populateResourceTreeOutline):

  • Localizations/en.lproj/localizedStrings.js:

Include a subtitle for local resource overrides.

  • UserInterface/Views/OpenResourceDialog.css:

(.open-resource-dialog .tree-outline.large .item .titles .subtitle):
Improved subtitle styling.

6:54 PM Changeset in webkit [250406] by Alan Coon
  • 2 edits in tags/Safari-609.1.5/Source/JavaScriptCore

Cherry-pick r250383. rdar://problem/55673084

We need to initialize the Gigacage first in setJITEnabled() when disabling the JIT.
https://bugs.webkit.org/show_bug.cgi?id=202257

Reviewed by Saam Barati.

Because of an OS quirk, even after the JIT region has been unmapped, the OS thinks
that region is reserved, and as such, can cause Gigacage allocation to fail. We
work around this by initializing the Gigacage first.

Note: when called, setJITEnabled() is always called extra early in the process
bootstrap. Under normal operation (when setJITEnabled() isn't called at all), we
will naturally initialize the Gigacage before we allocate the JIT region.
Hence, this workaround is merely ensuring the same behavior of allocation ordering.

This patch only applies to iOS.

  • jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::setJITEnabled):

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

5:59 PM Changeset in webkit [250405] by timothy_horton@apple.com
  • 3 edits in trunk/Source/WebKit

Add some logging to help diagnose blank or stuck WKWebViews
https://bugs.webkit.org/show_bug.cgi?id=202297
<rdar://problem/55763610>

Reviewed by Wenson Hsieh.

Our current logging is insufficient to rule out some of the potential
causes of stuck/blank WKWebViews in <rdar://problem/53399054>. Add
some new logging, and improve some existing logging, to aid in diagnosis.

  • UIProcess/API/Cocoa/WKWebView.mm:

(-[WKWebView _willInvokeUIScrollViewDelegateCallback]):
(-[WKWebView _didInvokeUIScrollViewDelegateCallback]):
Rename _delayUpdateVisibleContentRects to be more specific that it
was due to us being underneath a UIScrollView delegate callback.

(-[WKWebView _processWillSwapOrDidExit]):
(-[WKWebView _didCommitLayerTree:]):
Add a log when we receive an incoming commit while visible content rect
updates are being deferred. Also, include the current transaction ID
and the transaction ID that _needsResetViewState... is waiting for, to
help rule out a class of potential problems.

Add a log when we receive an incoming commit more than 5 seconds after
a visible content rect update.

(-[WKWebView _updateVisibleContentRects]):
Keep track of when we defer visual content rect updates for any reason,
and log the first time we do an update after deferring them. This will make
it MUCH easier at-a-glance to tell if one of the "bailing" messages
represents a long-term state (a problem), or is expected.

Keep track of how long it's been since we sent a visible content rect update
and didn't get a commit back from the Web Content process; if it's been
more than 5 seconds, start logging.

(-[WKWebView _cancelAnimatedResize]):
(-[WKWebView _didCompleteAnimatedResize]):
(-[WKWebView _beginAnimatedResizeWithUpdates:]):
(-[WKWebView _endAnimatedResize]):
(-[WKWebView _resizeWhileHidingContentWithUpdates:]):
Turn animated resize logging into release logging. It is a common culprit
for many kinds of bugs, while also not being high volume, so this is well worth it.

  • WebProcess/WebPage/WebPage.cpp:

(WebKit::WebPage::freezeLayerTree):
(WebKit::WebPage::unfreezeLayerTree):
Show the current value of m_layerTreeFreezeReasons in addition to the old value and delta,
so you don't have to manually compute the current value when reading logs.

4:03 PM Changeset in webkit [250404] by Alan Bujtas
  • 5 edits in trunk/Source/WebCore

[LFC][IFC] Move Line::Content::m_lineBox to Line.
https://bugs.webkit.org/show_bug.cgi?id=202280
<rdar://problem/55755798>

Reviewed by Antti Koivisto.

This is in preparation for Line producing Display::Runs instead of Line::Runs.

  • layout/inlineformatting/InlineFormattingContext.h:
  • layout/inlineformatting/InlineFormattingContextLineLayout.cpp:

(WebCore::Layout::LineLayout::close):
(WebCore::Layout::LineLayout::placeInlineItem):
(WebCore::Layout::InlineFormattingContext::InlineLayout::layout):
(WebCore::Layout::InlineFormattingContext::InlineLayout::computedIntrinsicWidth const):
(WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns):

  • layout/inlineformatting/InlineLine.cpp:

(WebCore::Layout::Line::Line):
(WebCore::Layout::Line::close):
(WebCore::Layout::Line::removeTrailingTrimmableContent):
(WebCore::Layout::Line::moveLogicalLeft):
(WebCore::Layout::Line::appendNonBreakableSpace):
(WebCore::Layout::Line::appendTextContent):
(WebCore::Layout::Line::appendNonReplacedInlineBox):
(WebCore::Layout::Line::adjustBaselineAndLineHeight):

  • layout/inlineformatting/InlineLine.h:

(WebCore::Layout::Line::Content::runs const):
(WebCore::Layout::Line::availableWidth const):
(WebCore::Layout::Line::lineBox const):
(WebCore::Layout::Line::logicalTop const):
(WebCore::Layout::Line::logicalBottom const):
(WebCore::Layout::Line::logicalLeft const):
(WebCore::Layout::Line::logicalHeight const):
(WebCore::Layout::Line::contentLogicalWidth const):
(WebCore::Layout::Line::contentLogicalRight const):
(WebCore::Layout::Line::baselineOffset const):
(WebCore::Layout::Line::Content::lineBox const): Deleted.
(WebCore::Layout::Line::Content::lineBox): Deleted.
(WebCore::Layout::Line::Content::setLineBox): Deleted.

3:41 PM Changeset in webkit [250403] by dino@apple.com
  • 2 edits in trunk/Tools

Build fix.

  • TestWebKitAPI/Tests/WebKitCocoa/ContextMenus.mm:

(-[TestContextMenuImageWithoutConfigurationUIDelegate webView:contextMenuConfigurationForElement:completionHandler:]): Deleted.
(-[TestContextMenuImageWithoutConfigurationUIDelegate webView:contextMenuWillPresentForElement:]): Deleted.
(-[TestContextMenuImageWithoutConfigurationUIDelegate webView:contextMenuForElement:willCommitWithAnimator:]): Deleted.
(-[TestContextMenuImageWithoutConfigurationUIDelegate webView:contextMenuDidEndForElement:]): Deleted.

3:19 PM Changeset in webkit [250402] by russell_e@apple.com
  • 2 edits in trunk/LayoutTests

[ iOS ] Layout Test scrollingcoordinator/ios/fixed-scrolling-with-keyboard.html is a Flaky Failure
https://bugs.webkit.org/show_bug.cgi?id=202283

Unreviewed Test Gardening.

  • platform/ios/TestExpectations: Marked

scrollingcoordinator/ios/fixed-scrolling-with-keyboard.html as flaky

3:19 PM Changeset in webkit [250401] by dino@apple.com
  • 4 edits in trunk

ContextMenu on a link in an email no longer shows web preview
https://bugs.webkit.org/show_bug.cgi?id=201120
<rdar://54353617>

Reviewed by Wenson Hsieh.

Source/WebKit:

Only go down the image path if we are not also a link.

  • UIProcess/ios/WKContentViewInteraction.mm:

(-[WKContentView continueContextMenuInteraction:]):

Tools:

Test context menus on a link that is also an image.

  • TestWebKitAPI/Tests/WebKitCocoa/ContextMenus.mm:

(contextMenuWebViewDriver):
(-[TestContextMenuImageWithoutConfigurationUIDelegate webView:contextMenuConfigurationForElement:completionHandler:]):
(-[TestContextMenuImageWithoutConfigurationUIDelegate webView:contextMenuWillPresentForElement:]):
(-[TestContextMenuImageWithoutConfigurationUIDelegate webView:contextMenuForElement:willCommitWithAnimator:]):
(-[TestContextMenuImageWithoutConfigurationUIDelegate webView:contextMenuDidEndForElement:]):
(TEST):

2:54 PM Changeset in webkit [250400] by commit-queue@webkit.org
  • 2 edits in trunk/Tools

run-safari --ios-simulator is no longer working with Xcode 11
https://bugs.webkit.org/show_bug.cgi?id=199852

Path of MobileSafari.app has changed in Xcode 11. This patch updates
the run-safari script to use the new path. This removes support for
running Safari on iOS < 13, see discussions on bug 177595.

Patch by Frederic Wang <fwang@igalia.com> on 2019-09-26
Reviewed by Jonathan Bedard.

  • Scripts/webkitdirs.pm:

(iosSimulatorApplicationsPath):

2:51 PM Changeset in webkit [250399] by zhifei_fang@apple.com
  • 4 edits
    2 adds in trunk/Tools

[results.webkit.org] Timeline support Image inner label
https://bugs.webkit.org/show_bug.cgi?id=202180

Reviewed by Jonathan Bedard.

  • resultsdbpy/resultsdbpy/view/static/js/expectations.js:
  • resultsdbpy/resultsdbpy/view/static/library/css/webkit.css:

(.lengend>.item .dot img): support img symbol for lengend and dot

  • resultsdbpy/resultsdbpy/view/static/library/js/components/TimelineComponents.js:

(Timeline.CanvasSeriesComponent): Support user pass a Image object or a image url as inner label

2:37 PM Changeset in webkit [250398] by Chris Dumez
  • 149 edits in trunk

Stop using testRunner.overridePreference() to turn on Page Cache
https://bugs.webkit.org/show_bug.cgi?id=202274

Reviewed by Alex Christensen.

Source/WebKit:

  • WebProcess/InjectedBundle/InjectedBundle.cpp:

(WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):

Tools:

  • DumpRenderTree/TestRunner.cpp:

(overridePreferenceCallback):

  • WebKitTestRunner/InjectedBundle/TestRunner.cpp:

(WTR::TestRunner::overridePreference):

LayoutTests:

Stop using testRunner.overridePreference() to turn on Page Cache, as this does not work
for WebKit2 when navigating cross-origin due to process swapping. Instead, update tests
to rely on <!-- webkit-test-runner [ enablePageCache=true ] -->.

  • animations/resume-after-page-cache.html:
  • compositing/accelerated-layers-after-back.html:
  • compositing/iframes/page-cache-layer-tree.html:
  • compositing/page-cache-back-crash.html:
  • compositing/show-composited-iframe-on-back-button.html:
  • editing/mac/input/unconfirmed-text-navigation-with-page-cache.html:
  • fast/css/fontloader-page-cache.html:
  • fast/dom/DeviceMotion/no-page-cache.html:
  • fast/dom/DeviceOrientation/event-after-navigation.html:
  • fast/dom/DeviceOrientation/no-page-cache.html:
  • fast/dom/Window/timer-resume-on-navigation-back.html:
  • fast/events/onunload-back-to-page-cache.html:
  • fast/events/pagehide-timeout-expected.txt:
  • fast/events/pagehide-timeout.html:
  • fast/events/pagehide-xhr-open-expected.txt:
  • fast/events/pagehide-xhr-open.html:
  • fast/events/pageshow-pagehide-on-back-cached-with-frames.html:
  • fast/events/pageshow-pagehide-on-back-cached.html:
  • fast/events/suspend-timers-expected.txt:
  • fast/events/suspend-timers.html:
  • fast/forms/autocomplete-off-with-default-value-does-not-clear.html:
  • fast/frames/frame-crash-with-page-cache.html:
  • fast/frames/frame-unload-navigate-and-setTimeout-assert-fail.html:
  • fast/frames/page-hide-document-open.html:
  • fast/frames/restoring-page-cache-should-not-run-scripts-via-style-update.html:
  • fast/frames/restoring-page-cache-should-not-run-scripts.html:
  • fast/harness/page-cache-crash-on-data-urls.html:
  • fast/harness/use-page-cache-expected.txt:
  • fast/harness/use-page-cache.html:
  • fast/history/back-from-page-with-focused-iframe.html:
  • fast/history/go-back-to-iframe-with-plugin.html:
  • fast/history/go-back-to-object-subframe.html:
  • fast/history/history-back-while-pdf-in-pagecache.html:
  • fast/history/page-cache-MessagePort-pending-message.html:
  • fast/history/page-cache-after-window-open.html:
  • fast/history/page-cache-back-navigation-crash.html:
  • fast/history/page-cache-clearing-expected.txt:
  • fast/history/page-cache-clearing.html:
  • fast/history/page-cache-closed-audiocontext.html:
  • fast/history/page-cache-createObjectURL-using-open-panel.html:
  • fast/history/page-cache-createObjectURL.html:
  • fast/history/page-cache-destroy-document.html:
  • fast/history/page-cache-element-state-focused.html:
  • fast/history/page-cache-execute-script-during-restore.html:
  • fast/history/page-cache-geolocation-active-oneshot.html:
  • fast/history/page-cache-geolocation-active-watcher.html:
  • fast/history/page-cache-geolocation.html:
  • fast/history/page-cache-indexed-closed-db.html:
  • fast/history/page-cache-indexed-opened-db.html:
  • fast/history/page-cache-media-source-closed-2.html:
  • fast/history/page-cache-media-source-closed.html:
  • fast/history/page-cache-media-source-opened.html:
  • fast/history/page-cache-navigate-during-restore.html:
  • fast/history/page-cache-notification-non-suspendable.html:
  • fast/history/page-cache-notification-suspendable.html:
  • fast/history/page-cache-removed-source-buffer.html:
  • fast/history/page-cache-running-audiocontext.html:
  • fast/history/page-cache-suspended-audiocontext.html:
  • fast/history/page-cache-webdatabase-no-transaction-db-expected.txt:
  • fast/history/page-cache-webdatabase-no-transaction-db.html:
  • fast/history/page-cache-webdatabase-pending-transaction.html:
  • fast/history/page-cache-with-opener.html:
  • fast/history/pagehide-remove-iframe-crash.html:
  • fast/history/resources/page-cache-window-with-iframe.html:
  • fast/history/resources/page-cache-window-with-opener.html:
  • fast/history/timed-refresh-in-cached-frame.html:
  • fast/images/animated-gif-restored-from-bfcache.html:
  • fast/loader/frames-with-unload-handlers-in-page-cache.html:
  • fast/loader/image-in-page-cache.html:
  • fast/loader/input-element-page-cache-crash.html:
  • fast/loader/navigate-with-new-target-after-back-forward-navigation.html:
  • fast/loader/navigate-with-post-to-new-target-after-back-forward-navigation.html:
  • fast/loader/scroll-position-restored-on-back.html:
  • fast/loader/stateobjects/no-popstate-when-back-to-stateless-entry-with-page-cache.html:
  • fast/loader/stateobjects/popstate-fires-with-page-cache.html:
  • fast/loader/unschedule-relayout-after-unload.html:
  • fast/loader/window-properties-restored-from-page-cache.html:
  • fast/overflow/horizontal-scroll-after-back.html:
  • fast/scrolling/iframe-scrollable-after-back.html:
  • fast/scrolling/ios/scroll-events-back-forward-after-pageshow.html:
  • fast/scrolling/ios/scroll-events-back-forward.html:
  • fast/scrolling/ios/touch-scroll-back-forward.html:
  • fast/scrolling/overflow-scrollable-after-back.html:
  • fast/scrolling/page-cache-back-overflow-scroll-restore.html:
  • fast/text-autosizing/ios/text-autosizing-after-back.html:
  • fast/viewport/ios/viewport-shrink-to-fit-on-new-navigation.html:
  • fast/viewport/viewport-128.html:
  • http/tests/cache/display-image-unset-allows-cached-image-load.html:
  • http/tests/loading/main-resource-delegates-on-back-navigation-expected.txt:
  • http/tests/loading/main-resource-delegates-on-back-navigation.html:
  • http/tests/loading/unfinished-load-back-to-cached-page-callbacks.html:
  • http/tests/loading/unfinished-main-resource-back-to-cached-page-callbacks.html:
  • http/tests/media/reload-after-dialog.html:
  • http/tests/navigation/go-back-to-error-page.html:
  • http/tests/navigation/https-in-page-cache.html:
  • http/tests/navigation/https-no-store-subframe-in-page-cache.html:
  • http/tests/navigation/image-load-in-pagehide-handler.html:
  • http/tests/navigation/page-cache-fragment-referrer.html:
  • http/tests/navigation/page-cache-iframe-no-current-historyItem.html:
  • http/tests/navigation/page-cache-iframe-provisional-load-async-delegates.html:
  • http/tests/navigation/page-cache-iframe-provisional-load.html:
  • http/tests/navigation/page-cache-pending-image-load-cache-partition.html:
  • http/tests/navigation/page-cache-pending-image-load.html:
  • http/tests/navigation/page-cache-pending-ping-load-cross-origin.html:
  • http/tests/navigation/page-cache-pending-ping-load-same-origin.html:
  • http/tests/navigation/page-cache-xhr-in-pagehide-expected.txt:
  • http/tests/navigation/page-cache-xhr-in-pagehide.html:
  • http/tests/navigation/page-cache-xhr.html:
  • http/tests/navigation/resources/https-in-page-cache-1.php:
  • http/tests/navigation/resources/https-in-page-cache-2.php:
  • http/tests/navigation/resources/https-in-page-cache-3.html:
  • http/tests/navigation/resources/https-no-store-subframe-in-page-cache.html:
  • http/tests/navigation/subframe-pagehide-handler-starts-load.html:
  • http/tests/navigation/subframe-pagehide-handler-starts-load2.html:
  • http/tests/security/cross-origin-window-open-insert-script.html:
  • http/tests/security/cross-origin-window-open-javascript-url.html:
  • http/tests/security/navigate-when-restoring-cached-page.html:
  • http/tests/security/xss-DENIED-click-and-form-submission-from-inactive-domwindow.html:
  • http/tests/security/xss-DENIED-script-inject-into-inactive-window.html:
  • http/tests/security/xss-DENIED-script-inject-into-inactive-window2-pson.html:
  • http/tests/security/xss-DENIED-script-inject-into-inactive-window2.html:
  • http/tests/security/xss-DENIED-script-inject-into-inactive-window3.html:
  • http/tests/websocket/tests/hybi/closed-when-entering-page-cache.html:
  • http/tests/websocket/tests/hybi/stop-on-resume-in-error-handler.html:
  • http/tests/workers/service/client-added-to-clients-when-restored-from-page-cache.html:
  • http/tests/workers/service/client-removed-from-clients-while-in-page-cache.html:
  • http/wpt/beacon/support/sendBeacon-onpagehide-window.html:
  • legacy-animation-engine/animations/resume-after-page-cache.html:
  • loader/go-back-cached-main-resource.html:
  • loader/go-back-to-different-window-size.html:
  • media/crash-closing-page-with-media-as-plugin-fallback.html:
  • media/restore-from-page-cache.html:
  • platform/ios/ios/fixed/fixed-back-forward.html:
  • plugins/crash-restoring-plugin-page-from-page-cache.html:
  • plugins/frameset-with-plugin-frame.html:
  • plugins/netscape-plugin-page-cache-works.html:
  • swipe/basic-cached-back-swipe.html:
  • swipe/main-frame-pinning-requirement.html:
  • swipe/pushState-cached-back-swipe.html:
  • swipe/pushState-programmatic-back-while-swiping-crash.html:
  • swipe/pushstate-with-manual-scrollrestoration.html:
  • tiled-drawing/scrolling/null-parent-back-crash.html:
  • tiled-drawing/tiled-drawing-scroll-position-page-cache-restoration.html:
2:36 PM Changeset in webkit [250397] by jiewen_tan@apple.com
  • 2 edits in trunk/Source/WebCore

REGRESSION: [ Catalina WK2 ] http/wpt/webauthn/public-key-credential-create-success-u2f.https.html is failing
https://bugs.webkit.org/show_bug.cgi?id=201620

Unreviewed, roll back part of r249737 to confirm the cause.

  • Modules/webauthn/fido/U2fResponseConverter.cpp:

(fido::WebCore::createAttestedCredentialDataFromU2fRegisterResponse):

1:09 PM Changeset in webkit [250396] by Jonathan Bedard
  • 3 edits in trunk/Tools

results.webkit.org: Use cursor: pointer for clickable elements
https://bugs.webkit.org/show_bug.cgi?id=202268

Rubber-stamped by Aakash Jain.

  • resultsdbpy/resultsdbpy/view/static/js/drawer.js: Give collapse button a pointer for cursor.
  • resultsdbpy/resultsdbpy/view/templates/search.html: Make 'X' to close test timeline a link-button.
1:05 PM Changeset in webkit [250395] by Truitt Savell
  • 7 edits in trunk

Unreviewed, rolling out r250385.

Broke imported/w3c/web-platform-tests/svg/animations/syncbase-
remove-add-while-running.html on all platforms. Which was
caught by EWS

Reverted changeset:

"Non-callable "handleEvent" property is silently ignored"
https://bugs.webkit.org/show_bug.cgi?id=200066
https://trac.webkit.org/changeset/250385

12:20 PM Changeset in webkit [250394] by aestes@apple.com
  • 2 edits in trunk/Source/WebKit

Crash under WebPage::beginPrinting when m_printContext becomes null due to synchronous layout
https://bugs.webkit.org/show_bug.cgi?id=202171
<rdar://problem/49731211>

Reviewed by Tim Horton.

Speculatively fix a null pointer dereference crash in WebPage::beginPrinting.

WebPage::beginPrinting creates a PrintContext, stores it in m_printContext, then calls
PrintContext::begin which forces a synchronous, paginated layout. If a post-layout task
executes script, that might result in the WebPage being closed and m_printContext being set
to nullptr.

Guard against this in WebPage::beginPrinting by adding a null check before calling
PrintContext::computePageRects.

  • WebProcess/WebPage/WebPage.cpp:

(WebKit::WebPage::beginPrinting):

12:16 PM Changeset in webkit [250393] by commit-queue@webkit.org
  • 29 edits
    128 adds in trunk

Source/WebCore:
Enable LayoutTests using ResourceLoadStatistics SQLite backend (195420)
https://bugs.webkit.org/show_bug.cgi?id=195420
<rdar://problem/54213551>

Patch by Kate Cheney <Kate Cheney> on 2019-09-26
Reviewed by Brent Fulgham.

Tests: http/tests/resourceLoadStatistics/add-blocking-to-redirect-database.html

http/tests/resourceLoadStatistics/blocking-in-web-worker-script-import-database.html
http/tests/resourceLoadStatistics/cap-cache-max-age-for-prevalent-resource-database.html
http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-database.html
http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-decoration-same-site-database.html
http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-fragment-from-prevalent-resource-database.html
http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-query-and-fragment-from-prevalent-resource-database.html
http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-query-from-prevalent-resource-database.html
http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-without-link-decoration-from-prevalent-resource-database.html
http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-mixed-statistics-database.html
http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-sub-frame-under-top-frame-origins-database.html
http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-under-top-frame-origins-database.html
http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-unique-redirects-to-database.html
http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-mixed-statistics-database.html
http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-sub-frame-under-top-frame-origins-database.html
http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-redirect-collusion-database.html
http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-redirect-to-prevalent-database.html
http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-under-top-frame-origins-database.html
http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-unique-redirects-to-database.html
http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-redirect-collusion-database.html
http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-redirect-to-prevalent-database.html
http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-unique-redirects-to-database.html
http/tests/resourceLoadStatistics/classify-as-very-prevalent-based-on-mixed-statistics-database.html
http/tests/resourceLoadStatistics/clear-in-memory-and-persistent-store-database.html
http/tests/resourceLoadStatistics/clear-in-memory-and-persistent-store-one-hour-database.html
http/tests/resourceLoadStatistics/cookie-deletion-database.html
http/tests/resourceLoadStatistics/cookies-with-and-without-user-interaction-database.html
http/tests/resourceLoadStatistics/delete-script-accessible-cookies-database.html
http/tests/resourceLoadStatistics/do-not-block-top-level-navigation-redirect-database.html
http/tests/resourceLoadStatistics/do-not-capture-statistics-for-simple-top-navigations-database.html
http/tests/resourceLoadStatistics/do-not-remove-blocking-in-redirect-database.html
http/tests/resourceLoadStatistics/do-not-switch-session-on-navigation-to-prevalent-without-interaction-database.html
http/tests/resourceLoadStatistics/downgraded-referrer-for-navigation-with-link-query-from-prevalent-resource-database.html
http/tests/resourceLoadStatistics/enable-debug-mode-database.html
http/tests/resourceLoadStatistics/grandfathering-database.html
http/tests/resourceLoadStatistics/non-prevalent-resource-with-user-interaction-database.html
http/tests/resourceLoadStatistics/non-prevalent-resource-without-user-interaction-database.html
http/tests/resourceLoadStatistics/non-prevalent-resources-can-access-cookies-in-a-third-party-context-database.html
http/tests/resourceLoadStatistics/non-sandboxed-iframe-redirect-ip-to-localhost-to-ip-database.html
http/tests/resourceLoadStatistics/non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database.html
http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-ip-to-localhost-to-ip-database.html
http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database.html
http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-ip-to-localhost-to-ip-database.html
http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database.html
http/tests/resourceLoadStatistics/ping-to-prevalent-resource-database.html
http/tests/resourceLoadStatistics/prevalent-resource-handled-keydown-database.html
http/tests/resourceLoadStatistics/prevalent-resource-unhandled-keydown-database.html
http/tests/resourceLoadStatistics/prevalent-resource-with-user-interaction-database.html
http/tests/resourceLoadStatistics/prevalent-resource-with-user-interaction-timeout-database.html
http/tests/resourceLoadStatistics/prevalent-resource-without-user-interaction-database.html
http/tests/resourceLoadStatistics/prune-statistics-database.html
http/tests/resourceLoadStatistics/sandboxed-iframe-redirect-ip-to-localhost-to-ip-database.html
http/tests/resourceLoadStatistics/sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database.html
http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-ip-to-localhost-to-ip-database.html
http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database.html
http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-ip-to-localhost-to-ip-database.html
http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database.html
http/tests/resourceLoadStatistics/set-custom-prevalent-resource-in-debug-mode-database.html
http/tests/resourceLoadStatistics/strip-referrer-to-origin-for-prevalent-subresource-redirects-database.html
http/tests/resourceLoadStatistics/strip-referrer-to-origin-for-prevalent-subresource-requests-database.html
http/tests/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-with-interaction-database.html
http/tests/resourceLoadStatistics/user-interaction-in-cross-origin-sub-frame-database.html
http/tests/resourceLoadStatistics/user-interaction-only-reported-once-within-short-period-of-time-database.html
http/tests/resourceLoadStatistics/user-interaction-reported-after-website-data-removal-database.html

  • platform/sql/SQLiteDatabase.h:

Added WEBCORE_EXPORT prefix to 2 functions needed in the ITP Database
to clear out the database.

Source/WebKit:
Enable LayoutTests using ResourceLoadStatistics SQLite backend (195420)
https://bugs.webkit.org/show_bug.cgi?id=195420
<rdar://problem/54213551>

Patch by Kate Cheney <Kate Cheney> on 2019-09-26
Reviewed by Brent Fulgham.

Changed all RELEASE_LOG_ERROR() calls involving domain strings to
RELEASE_LOG_ERROR_IF_ALLOWED() to prevent leaking information about
the domain strings only if sessionID.isAlwaysOnLoggingAllowed().

  • NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:

(WebKit::ResourceLoadStatisticsDatabaseStore::ResourceLoadStatisticsDatabaseStore):
Added autovacuuming to the constructor to avoid manually calling
runVacuumCommand(). Changed constructor to take in sessionID so it
can use RELEASE_LOG_ERROR_IF_ALLOWED which requires the sessionID.

(WebKit::ResourceLoadStatisticsDatabaseStore::prepareStatements):
Added 2 statements that were not being prepared.

(WebKit::ResourceLoadStatisticsDatabaseStore::relationshipExists const):
Corrected incorrect capitalization. Added check for nullopt in case
domainID is for a domain not in the database yet.

(WebKit::ResourceLoadStatisticsDatabaseStore::domainID const):
Changed return value to Optional<unsigned>. Some tests were directly
checking for subframes under top frame domains on domains that had
not been inserted yet. Now, domainID() won't crash but will return
a nullopt value which can be checked to know that the tests failed.

(WebKit::ResourceLoadStatisticsDatabaseStore::insertDomainRelationships):
Added a check to assure domainID exists and updated the domainID
interactions to work as Optionals.

(WebKit::ResourceLoadStatisticsDatabaseStore::populateFromMemoryStore):
Moved the prepareStatements() call after the vacuum command in the case
where the database is empty. Otherwise called it before returning.

(WebKit::ResourceLoadStatisticsDatabaseStore::recursivelyFindNonPrevalentDomainsThatRedirectedToThisDomain):
Added a space to the SQL commands to correct the syntax.

(WebKit::ResourceLoadStatisticsDatabaseStore::findNotVeryPrevalentResources):
Corrected a bug in the SQL command for querying
subframeUnderTopFrameDomain. The old query was asking for subresource.

(WebKit::ResourceLoadStatisticsDatabaseStore::reclassifyResources):
Spelling fix.

(WebKit::ResourceLoadStatisticsDatabaseStore::requestStorageAccess):
Changed string concatenation to binding.

(WebKit::ResourceLoadStatisticsDatabaseStore::grandfatherDataForDomains):
The grandfathering.html test was failing because domains were being
"set" to grandfathered in the database before being inserted. This fix
ensures all domains before setting the grandfathering flag.

(WebKit::ResourceLoadStatisticsDatabaseStore::logFrameNavigation):
Multiple tests were failing because the query to insert the relationship
for the source domain relies on the target domain being in the
ObservedDomains table. This patch ensures all domains are added before
performing the query.

(WebKit::ResourceLoadStatisticsDatabaseStore::setUserInteraction):
Added a != SQLITE_OK check to make sure an error is logged if the
statement fails to bind.

(WebKit::ResourceLoadStatisticsDatabaseStore::clearUserInteraction):
Changed string concatenation to binding.

(WebKit::ResourceLoadStatisticsDatabaseStore::hasHadUserInteraction):
The SQL statement was being bound to a value and not being reset. This
patch resets the statement after binding. Additionally, the step()
function was being compared to SQLITE_DONE instead of SQLITE_ROW,
causing an error if the query returned results. The
ASSERT_NOT_REACHED() was causing null searches to crash instead of
returning false (i.e. if a domain is not in the database it should
return that it has no user interaction instead of crashing).

(WebKit::ResourceLoadStatisticsDatabaseStore::setPrevalentResource):
Updated domainID call to act as an Optional.

(WebKit::ResourceLoadStatisticsDatabaseStore::predicateValueForDomain const):
The SQL statement was being bound to a value and not being reset. This
patch resets the statement after binding. SQLITE_DONE changed to
SQLITE_ROW to return non-empty query results. ASSERT_NOT_REACHED()
removed for the same reasons as above.

(WebKit::ResourceLoadStatisticsDatabaseStore::ensureResourceStatisticsForRegistrableDomain):
Fixed the release log statement which was logging the wrong function
name.

(WebKit::ResourceLoadStatisticsDatabaseStore::clearDatabaseContents):
Clears the database and rebuilds the tables on a clear command to
match the functionality in the Memory Store.

(WebKit::ResourceLoadStatisticsDatabaseStore::clear):
Call the clearDatabaseContents function to match the functionality
in the Memory Store.

(WebKit::ResourceLoadStatisticsDatabaseStore::hasUserGrantedStorageAccessThroughPrompt const):
Updated domainID call to act as an Optional.

(WebKit::ResourceLoadStatisticsDatabaseStore::hasHadUnexpiredRecentUserInteraction):
Tests were failing because shouldRemoveAllWebsiteDataFor() was not
checking for expired user interaction. Matched functionality in the
Memory Store.

(WebKit::ResourceLoadStatisticsDatabaseStore::shouldRemoveAllWebsiteDataFor):
Tests were failing because shouldRemoveAllWebsiteDataFor() was not
checking for expired user interaction. Matched functionality in the
Memory Store.

(WebKit::ResourceLoadStatisticsDatabaseStore::registrableDomainsToRemoveWebsiteDataFor):
Spelling fix.

(WebKit::ResourceLoadStatisticsDatabaseStore::pruneStatisticsIfNeeded):
Last seen should be sorted in ascending order because you want to
prune the older statistics first, which will have a lower lastSeen
field (secondsSinceEpoch() will be lower for older values).

(WebKit::ResourceLoadStatisticsDatabaseStore::shouldRemoveAllWebsiteDataFor const): Deleted.
Deleted const specifier because the function needs to clear the
database.

  • NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:

Declared new functions. Updated spelling error (registerable -->
registrable). Updated constructor to take sessionID.

  • NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:

(WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
ITP database flag now is stored in the NetworkProcess.

  • NetworkProcess/NetworkProcess.cpp:

(WebKit::NetworkProcess::initializeNetworkProcess):
Set the ITP database flag which is now stored in the Network Process.

(WebKit::NetworkProcess::setUseITPDatabase):

  • NetworkProcess/NetworkProcess.h:

(WebKit::NetworkProcess::isITPDatabaseEnabled const):

  • NetworkProcess/NetworkProcess.messages.in:

Passed the setUseITPDatabase flag to the initialization function
of the statistics store to enable the database backend.

  • NetworkProcess/NetworkSession.cpp:

(WebKit::NetworkSession::NetworkSession):
SandboxExtension::consumePermanently was not getting called on the
WebKitTestRunner resourceLoadStatistics path. This was preventing
the database file from opening.

(WebKit::NetworkSession::recreateResourceLoadStatisticStore):
Destroy old WebResourceLoadStatisticsStore and create a new one using
the ITP database.

  • NetworkProcess/NetworkSession.h:
  • UIProcess/API/C/WKWebsiteDataStoreRef.cpp:

(WKWebsiteDataStoreSetUseITPDatabase):

  • UIProcess/API/C/WKWebsiteDataStoreRef.h:
  • UIProcess/Network/NetworkProcessProxy.cpp:

(WebKit::NetworkProcessProxy::setUseITPDatabase):

  • UIProcess/Network/NetworkProcessProxy.h:
  • UIProcess/WebsiteData/WebsiteDataStore.cpp:

(WebKit::WebsiteDataStore::setUseITPDatabase):

  • UIProcess/WebsiteData/WebsiteDataStore.h:

Passed the setUseITPDatabase flag to the initialization function
of the statistics store to enable the database backend.

Tools:
Enable LayoutTests using ResourceLoadStatistics SQLite backend (195420)
https://bugs.webkit.org/show_bug.cgi?id=195420
<rdar://problem/54213551>

Patch by Kate Cheney <Kate Cheney> on 2019-09-26
Reviewed by Brent Fulgham.

Added in logic to send a message from the UIProcess to the Network
Process which will initalize the ITP Database backend to allow for
layout testing.

  • WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
  • WebKitTestRunner/InjectedBundle/TestRunner.cpp:

(WTR::TestRunner::setUseITPDatabase):

  • WebKitTestRunner/InjectedBundle/TestRunner.h:
  • WebKitTestRunner/TestController.cpp:

(WTR::TestController::setUseITPDatabase):

  • WebKitTestRunner/TestController.h:
  • WebKitTestRunner/TestInvocation.cpp:

(WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle):

LayoutTests:
Enable LayoutTests using ResourceLoadStatistics SQLite backend (195420)
https://bugs.webkit.org/show_bug.cgi?id=195420
<rdar://problem/54213551>

Added a flag to all ITP tests to enable the ITP database backend to
allow for testing functionality against the memory store. Tests were
not created for telemetry-generation.html,
log-cross-site-load-with-link-decoration.html, or
website-data-removal-for-site-navigated-to-with-link-decoration.html,
because these rely on functions not yet implemented in the ITP database.
Additionally, added flags to some memory store tests to ensure they
are using the memory store before calling functions not implemented in
the database store yet.

Patch by Kate Cheney <Kate Cheney> on 2019-09-26
Reviewed by Brent Fulgham.

  • http/tests/resourceLoadStatistics/add-blocking-to-redirect-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/add-blocking-to-redirect-database.html: Added.
  • http/tests/resourceLoadStatistics/blocking-in-web-worker-script-import-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/blocking-in-web-worker-script-import-database.html: Added.
  • http/tests/resourceLoadStatistics/cap-cache-max-age-for-prevalent-resource-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/cap-cache-max-age-for-prevalent-resource-database.html: Added.
  • http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-database.html: Added.
  • http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-decoration-same-site-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-decoration-same-site-database.html: Added.
  • http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-fragment-from-prevalent-resource-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-fragment-from-prevalent-resource-database.html: Added.
  • http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-query-and-fragment-from-prevalent-resource-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-query-and-fragment-from-prevalent-resource-database.html: Added.
  • http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-query-from-prevalent-resource-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-query-from-prevalent-resource-database.html: Added.
  • http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-without-link-decoration-from-prevalent-resource-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-without-link-decoration-from-prevalent-resource-database.html: Added.
  • http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-mixed-statistics-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-mixed-statistics-database.html: Added.
  • http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-sub-frame-under-top-frame-origins-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-sub-frame-under-top-frame-origins-database.html: Added.
  • http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-under-top-frame-origins-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-under-top-frame-origins-database.html: Added.
  • http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-unique-redirects-to-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-unique-redirects-to-database.html: Added.
  • http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-mixed-statistics-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-mixed-statistics-database.html: Added.
  • http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-sub-frame-under-top-frame-origins-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-sub-frame-under-top-frame-origins-database.html: Added.
  • http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-redirect-collusion-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-redirect-collusion-database.html: Added.
  • http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-redirect-to-prevalent-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-redirect-to-prevalent-database.html: Added.
  • http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-under-top-frame-origins-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-under-top-frame-origins-database.html: Added.
  • http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-unique-redirects-to-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-unique-redirects-to-database.html: Added.
  • http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-redirect-collusion-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-redirect-collusion-database.html: Added.
  • http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-redirect-to-prevalent-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-redirect-to-prevalent-database.html: Added.
  • http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-unique-redirects-to-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-unique-redirects-to-database.html: Added.
  • http/tests/resourceLoadStatistics/classify-as-very-prevalent-based-on-mixed-statistics-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/classify-as-very-prevalent-based-on-mixed-statistics-database.html: Added.
  • http/tests/resourceLoadStatistics/clear-in-memory-and-persistent-store-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/clear-in-memory-and-persistent-store-database.html: Added.
  • http/tests/resourceLoadStatistics/clear-in-memory-and-persistent-store-one-hour-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/clear-in-memory-and-persistent-store-one-hour-database.html: Added.
  • http/tests/resourceLoadStatistics/cookie-deletion-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/cookie-deletion-database.html: Added.
  • http/tests/resourceLoadStatistics/cookies-with-and-without-user-interaction-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/cookies-with-and-without-user-interaction-database.html: Added.
  • http/tests/resourceLoadStatistics/delete-script-accessible-cookies-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/delete-script-accessible-cookies-database.html: Added.
  • http/tests/resourceLoadStatistics/do-not-block-top-level-navigation-redirect-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/do-not-block-top-level-navigation-redirect-database.html: Added.
  • http/tests/resourceLoadStatistics/do-not-capture-statistics-for-simple-top-navigations-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/do-not-capture-statistics-for-simple-top-navigations-database.html: Added.
  • http/tests/resourceLoadStatistics/do-not-remove-blocking-in-redirect-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/do-not-remove-blocking-in-redirect-database.html: Added.
  • http/tests/resourceLoadStatistics/do-not-switch-session-on-navigation-to-prevalent-without-interaction-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/do-not-switch-session-on-navigation-to-prevalent-without-interaction-database.html: Added.
  • http/tests/resourceLoadStatistics/downgraded-referrer-for-navigation-with-link-query-from-prevalent-resource-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/downgraded-referrer-for-navigation-with-link-query-from-prevalent-resource-database.html: Added.
  • http/tests/resourceLoadStatistics/enable-debug-mode-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/enable-debug-mode-database.html: Added.
  • http/tests/resourceLoadStatistics/grandfathering-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/grandfathering-database.html: Added.
  • http/tests/resourceLoadStatistics/log-cross-site-load-with-link-decoration.html:
  • http/tests/resourceLoadStatistics/non-prevalent-resource-with-user-interaction-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/non-prevalent-resource-with-user-interaction-database.html: Added.
  • http/tests/resourceLoadStatistics/non-prevalent-resource-without-user-interaction-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/non-prevalent-resource-without-user-interaction-database.html: Added.
  • http/tests/resourceLoadStatistics/non-prevalent-resources-can-access-cookies-in-a-third-party-context-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/non-prevalent-resources-can-access-cookies-in-a-third-party-context-database.html: Added.
  • http/tests/resourceLoadStatistics/non-sandboxed-iframe-redirect-ip-to-localhost-to-ip-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/non-sandboxed-iframe-redirect-ip-to-localhost-to-ip-database.html: Added.
  • http/tests/resourceLoadStatistics/non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database.html: Added.
  • http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-ip-to-localhost-to-ip-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-ip-to-localhost-to-ip-database.html: Added.
  • http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database.html: Added.
  • http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-ip-to-localhost-to-ip-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-ip-to-localhost-to-ip-database.html: Added.
  • http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database.html: Added.
  • http/tests/resourceLoadStatistics/ping-to-prevalent-resource-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/ping-to-prevalent-resource-database.html: Added.
  • http/tests/resourceLoadStatistics/prevalent-resource-handled-keydown-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/prevalent-resource-handled-keydown-database.html: Added.
  • http/tests/resourceLoadStatistics/prevalent-resource-unhandled-keydown-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/prevalent-resource-unhandled-keydown-database.html: Added.
  • http/tests/resourceLoadStatistics/prevalent-resource-with-user-interaction-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/prevalent-resource-with-user-interaction-database.html: Added.
  • http/tests/resourceLoadStatistics/prevalent-resource-with-user-interaction-timeout-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/prevalent-resource-with-user-interaction-timeout-database.html: Added.
  • http/tests/resourceLoadStatistics/prevalent-resource-without-user-interaction-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/prevalent-resource-without-user-interaction-database.html: Added.
  • http/tests/resourceLoadStatistics/prune-statistics-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/prune-statistics-database.html: Added.
  • http/tests/resourceLoadStatistics/sandboxed-iframe-redirect-ip-to-localhost-to-ip-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/sandboxed-iframe-redirect-ip-to-localhost-to-ip-database.html: Added.
  • http/tests/resourceLoadStatistics/sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database.html: Added.
  • http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-ip-to-localhost-to-ip-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-ip-to-localhost-to-ip-database.html: Added.
  • http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database.html: Added.
  • http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-ip-to-localhost-to-ip-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-ip-to-localhost-to-ip-database.html: Added.
  • http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database.html: Added.
  • http/tests/resourceLoadStatistics/set-custom-prevalent-resource-in-debug-mode-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/set-custom-prevalent-resource-in-debug-mode-database.html: Added.
  • http/tests/resourceLoadStatistics/strip-referrer-to-origin-for-prevalent-subresource-redirects-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/strip-referrer-to-origin-for-prevalent-subresource-redirects-database.html: Added.
  • http/tests/resourceLoadStatistics/strip-referrer-to-origin-for-prevalent-subresource-requests-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/strip-referrer-to-origin-for-prevalent-subresource-requests-database.html: Added.
  • http/tests/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-with-interaction-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-with-interaction-database.html: Added.
  • http/tests/resourceLoadStatistics/telemetry-generation.html:
  • http/tests/resourceLoadStatistics/user-interaction-in-cross-origin-sub-frame-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/user-interaction-in-cross-origin-sub-frame-database.html: Added.
  • http/tests/resourceLoadStatistics/user-interaction-only-reported-once-within-short-period-of-time-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/user-interaction-only-reported-once-within-short-period-of-time-database.html: Added.
  • http/tests/resourceLoadStatistics/user-interaction-reported-after-website-data-removal-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/user-interaction-reported-after-website-data-removal-database.html: Added.
  • http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-with-link-decoration.html:
  • platform/ios/TestExpectations:

Added test expectations to skip database tests which do not work in
ios because of reliance on EventSender.keydown() which is not
supported on iOS and also those which use UIHelper.activateAt() which
does not produce a user gesture captured by ITP in iOS.

12:03 PM Changeset in webkit [250392] by Wenson Hsieh
  • 4 edits
    4 adds in trunk

[iOS 13] Tapping on a non-editable text selection should toggle callout bar visibility instead of clearing selection
https://bugs.webkit.org/show_bug.cgi?id=202254
<rdar://problem/54410263>

Reviewed by Megan Gardner.

Source/WebKit:

In iOS 13, tapping a text selection should toggle callout bar visibility (i.e. "selection commands" in UIKit).
This currently does not work for non-editable text, since the synthetic click gesture simultaneously fires
alongside the text interaction assistant's non-editable tap gesture, which dispatches a click to the page which
then clears the selection.

To remedy this and match platform behavior, we avoid recognizing clicks that occur over the text selection, but
only in the case where the bounding rect of the text selection doesn't cover a large portion of the visible
content rect of the web view. This ensures that the user doesn't get stuck in a state where it's impossible to
dismiss a very large text selection (e.g. after selecting all the content on the page).

Tests: editing/selection/ios/clear-selection-after-tap-in-large-selected-non-editable-text.html

editing/selection/ios/toggle-callout-bar-after-tap-in-selected-non-editable-text.html

  • UIProcess/ios/WKContentViewInteraction.mm:

(-[WKContentView _shouldToggleSelectionCommandsAfterTapAt:]):

Check the last known selection rects (on _lastSelectionDrawingInfo) to see if the tapped point lies within at
least one of the selection rects.

(-[WKContentView gestureRecognizerShouldBegin:]):

LayoutTests:

  • editing/selection/ios/clear-selection-after-tap-in-large-selected-non-editable-text-expected.txt: Added.
  • editing/selection/ios/clear-selection-after-tap-in-large-selected-non-editable-text.html: Added.

Add a new layout test to verify that when tapping in a text selection that encompasses the entire page, we allow
the tap to dismiss the selection instead of toggling callout bar visibility.

  • editing/selection/ios/toggle-callout-bar-after-tap-in-selected-non-editable-text-expected.txt: Added.
  • editing/selection/ios/toggle-callout-bar-after-tap-in-selected-non-editable-text.html: Added.

Add another layout test to verify that when tapping inside a text selection, the callout bar is toggled, and
when tapping outside the selected text, the selection is dismissed.

  • resources/ui-helper.js:

(window.UIHelper.async.waitForSelectionToAppear):
(window.UIHelper.async.waitForSelectionToDisappear):

New helper methods to wait for selection rects to appear or disappear.

(window.UIHelper):

11:52 AM Changeset in webkit [250391] by Wenson Hsieh
  • 2 edits in trunk/Tools

TestWebKitAPI.WebKit.ReloadWithDifferingInitialScale is failing consistently
https://bugs.webkit.org/show_bug.cgi?id=202273

Reviewed by Aakash Jain.

The content width scaling limits added in r250361 prevent this test from scaling down the content width (2000px
wide) to fit the viewport (375px). To avoid this issue, change the content width from 2000px to 1500px, which is
still a very wide content width for a web page.

  • TestWebKitAPI/Tests/WebKitCocoa/ReloadWithDifferingInitialScale.mm:
11:25 AM Changeset in webkit [250390] by Antti Koivisto
  • 12 edits in trunk/Source/WebCore

Use LineLayoutTraversal for RenderText functions
https://bugs.webkit.org/show_bug.cgi?id=202266

Reviewed by Zalan Bujtas.

Replace a bunch of functions that have separate simple and complex line layout versions with
shared functions that use LineLayoutTraversal.

  • rendering/RenderText.cpp:

(WebCore::RenderText::absoluteRects const):
(WebCore::RenderText::firstRunLocation const):
(WebCore::RenderText::linesBoundingBox const):

This is substantially simpler than RenderTextLineBoxes::boundingBox because it uses physical rects for all computations
instead of using logical rects and flipping to physical at the end.

(WebCore::RenderText::caretMinOffset const):
(WebCore::RenderText::caretMaxOffset const):
(WebCore::RenderText::countRenderedCharacterOffsetsUntil const):
(WebCore::containsOffset):
(WebCore::RenderText::containsRenderedCharacterOffset const):
(WebCore::RenderText::containsCaretOffset const):
(WebCore::RenderText::hasRenderedText const):

  • rendering/RenderTextLineBoxes.cpp:

(WebCore::RenderTextLineBoxes::boundingBox const): Deleted.
(WebCore::RenderTextLineBoxes::firstRunLocation const): Deleted.
(WebCore::RenderTextLineBoxes::hasRenderedText const): Deleted.
(WebCore::RenderTextLineBoxes::caretMinOffset const): Deleted.
(WebCore::RenderTextLineBoxes::caretMaxOffset const): Deleted.
(WebCore::RenderTextLineBoxes::containsOffset const): Deleted.
(WebCore::RenderTextLineBoxes::countCharacterOffsetsUntil const): Deleted.
(WebCore::RenderTextLineBoxes::absoluteRects const): Deleted.

  • rendering/RenderTreeAsText.cpp:

(WebCore::write):

  • rendering/SimpleLineLayout.cpp:

(WebCore::SimpleLineLayout::LineState::appendFragmentAndCreateRunIfNeeded):

  • rendering/SimpleLineLayout.h:

(WebCore::SimpleLineLayout::Run::Run):

  • rendering/SimpleLineLayoutFunctions.cpp:

(WebCore::SimpleLineLayout::computeFirstRunLocation): Deleted.

  • rendering/SimpleLineLayoutFunctions.h:

(WebCore::SimpleLineLayout::findCaretMinimumOffset): Deleted.
(WebCore::SimpleLineLayout::findCaretMaximumOffset): Deleted.
(WebCore::SimpleLineLayout::containsOffset): Deleted.
(WebCore::SimpleLineLayout::isTextRendered): Deleted.

  • rendering/SimpleLineLayoutResolver.h:

(WebCore::SimpleLineLayout::RunResolver::Run::isLineBreak const):

  • rendering/line/LineLayoutTraversal.cpp:

(WebCore::LineLayoutTraversal::TextBox::isLineBreak const):
(WebCore::LineLayoutTraversal::firstTextBoxFor):
(WebCore::LineLayoutTraversal::firstTextBoxInTextOrderFor):
(WebCore::LineLayoutTraversal::textBoxesFor):
(WebCore::LineLayoutTraversal::firstTextBoxInVisualOrderFor): Deleted.
(WebCore::LineLayoutTraversal::textBoxRangeFor): Deleted.

  • rendering/line/LineLayoutTraversal.h:

(WebCore::LineLayoutTraversal::hasTextBoxes):

11:17 AM Changeset in webkit [250389] by commit-queue@webkit.org
  • 21 edits in trunk

toExponential, toFixed, and toPrecision should allow arguments up to 100
https://bugs.webkit.org/show_bug.cgi?id=199163

Patch by Alexey Shvayka <Alexey Shvayka> on 2019-09-26
Reviewed by Ross Kirsling.

JSTests:

  • ChakraCore/test/Number/toString_3.baseline-jsc:
  • ChakraCore/test/es5/exceptions3.baseline-jsc:
  • test262/expectations.yaml: Mark 6 test cases as passing.

Source/JavaScriptCore:

Previously, the spec gave fixed range of [0,20] for Number.prototype.{toExponential,toFixed} argument and
range of [1,21] for Number.prototype.toPrecision argument, but allowed implementations to permit a larger range.
Historically, only SpiderMonkey accepted a larger range, and other implementations threw a RangeError outside the range.
Later the spec was changed (see https://github.com/tc39/ecma262/pull/857) to specify the SpiderMonkey behavior.

  • runtime/NumberPrototype.cpp:

(JSC::numberProtoFuncToExponential): Accept arguments between 0 and 100.
(JSC::numberProtoFuncToFixed): Accept arguments between 0 and 100.
(JSC::numberProtoFuncToPrecision): Accept arguments between 1 and 100.
(JSC::getIntegerArgumentInRange): Inline to improve readability.

Source/WTF:

Increase size of NumberToStringBuffer: <21 digits> + decimal point + <100 digits> + null char = 123.
Increase kMaxFixedDigitsAfterPoint to make Number.prototype.toFixed work with arguments up to 100.
Also update other constants to their correct values.

  • wtf/dtoa.h:
  • wtf/dtoa/double-conversion.cc:
  • wtf/dtoa/double-conversion.h:

Tools:

Adjust StringNumberFixedWidth test due to lowering kMaxFixedDigitsBeforePoint.

  • TestWebKitAPI/Tests/WTF/WTFString.cpp:

LayoutTests:

  • js/dom/number-tofixed-expected.txt:
  • js/dom/number-toprecision-expected.txt:
  • js/dom/script-tests/number-tofixed.js:
  • js/dom/script-tests/number-toprecision.js:
  • js/kde/Number-expected.txt:
  • js/kde/script-tests/Number.js:
  • js/number-toExponential-expected.txt:
  • js/script-tests/number-toExponential.js:
11:04 AM Changeset in webkit [250388] by Patrick Griffis
  • 2 edits in trunk/Source/WebKit

[GTK] Fix logic of dark theme detection
https://bugs.webkit.org/show_bug.cgi?id=202276

  • If GTK_THEME is set it has a higher priority to GtkSettings.
  • GTK_THEME may be a -dark theme or :dark variant, handle both.

Reviewed by Michael Catanzaro.

  • UIProcess/API/gtk/PageClientImpl.cpp:

(WebKit::PageClientImpl::effectiveAppearanceIsDark const):

10:59 AM Changeset in webkit [250387] by russell_e@apple.com
  • 2 edits
    1 delete in trunk/LayoutTests

Layout Test platform/ios/ios/fast/text/opticalFont.html is Failing on iOS13.
https://bugs.webkit.org/show_bug.cgi?id=202278

Unreviewed Test Gardening.

  • platform/ios/ios/fast/text/opticalFont-expected.txt: Removed.
  • platform/ios/platform/ios/ios/fast/text/opticalFont-expected.txt:

Rebaselined for iOS 13.

10:49 AM Changeset in webkit [250386] by Truitt Savell
  • 5 edits in trunk/Source/WebCore

Unreviewed, rolling out r250381.

broke multiple webgpu/ tests on Mojave WK2

Reverted changeset:

"Flaky Test: inspector/canvas/updateShader.html"
https://bugs.webkit.org/show_bug.cgi?id=202186
https://trac.webkit.org/changeset/250381

10:43 AM Changeset in webkit [250385] by commit-queue@webkit.org
  • 7 edits in trunk

Non-callable "handleEvent" property is silently ignored
https://bugs.webkit.org/show_bug.cgi?id=200066

Patch by Alexey Shvayka <Alexey Shvayka> on 2019-09-26
Reviewed by Darin Adler.

LayoutTests/imported/w3c:

  • web-platform-tests/IndexedDB/fire-error-event-exception-expected.txt:
  • web-platform-tests/IndexedDB/fire-success-event-exception-expected.txt:
  • web-platform-tests/IndexedDB/fire-upgradeneeded-event-exception-expected.txt:
  • web-platform-tests/dom/events/EventListener-handleEvent-expected.txt:

Source/WebCore:

Tests: imported/w3c/web-platform-tests/IndexedDB/fire-error-event-exception.html

imported/w3c/web-platform-tests/IndexedDB/fire-success-event-exception.html
imported/w3c/web-platform-tests/IndexedDB/fire-upgradeneeded-event-exception.html
imported/w3c/web-platform-tests/dom/events/EventListener-handleEvent.html

  • bindings/js/JSEventListener.cpp:

(WebCore::JSEventListener::handleEvent): Report TypeError if "handleEvent" is not callable.

8:44 AM Changeset in webkit [250384] by Alan Bujtas
  • 2 edits in trunk/Source/WebCore

[LFC][IFC] Decouple Display::Run and Display::Box initializations.
https://bugs.webkit.org/show_bug.cgi?id=202255
<rdar://problem/55731445>

Reviewed by Antti Koivisto.

This is in preparation for moving Display::Run initialization to Line class.

  • layout/inlineformatting/InlineFormattingContextLineLayout.cpp:

(WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns):

8:07 AM Changeset in webkit [250383] by mark.lam@apple.com
  • 2 edits in trunk/Source/JavaScriptCore

We need to initialize the Gigacage first in setJITEnabled() when disabling the JIT.
https://bugs.webkit.org/show_bug.cgi?id=202257

Reviewed by Saam Barati.

Because of an OS quirk, even after the JIT region has been unmapped, the OS thinks
that region is reserved, and as such, can cause Gigacage allocation to fail. We
work around this by initializing the Gigacage first.

Note: when called, setJITEnabled() is always called extra early in the process
bootstrap. Under normal operation (when setJITEnabled() isn't called at all), we
will naturally initialize the Gigacage before we allocate the JIT region.
Hence, this workaround is merely ensuring the same behavior of allocation ordering.

This patch only applies to iOS.

  • jit/ExecutableAllocator.cpp:

(JSC::ExecutableAllocator::setJITEnabled):

2:48 AM Changeset in webkit [250382] by jiewen_tan@apple.com
  • 2 edits in trunk/Tools

TestWebKitAPI.SOAuthorizationSubFrame.AuthorizationOptions is failing consistently on iOS API tests EWS
https://bugs.webkit.org/show_bug.cgi?id=202249

Reviewed by Alex Christensen.

Swizzles +[AKAuthorizationController isURLFromAppleOwnedDomain:] following other tests.

  • TestWebKitAPI/Tests/WebKitCocoa/TestSOAuthorization.mm:

(TestWebKitAPI::TEST):

1:33 AM Changeset in webkit [250381] by Devin Rousso
  • 5 edits in trunk/Source/WebCore

Flaky Test: inspector/canvas/updateShader.html
https://bugs.webkit.org/show_bug.cgi?id=202186
<rdar://problem/55716053>

Reviewed by Joseph Pecoraro.

If the WebGPUPipeline/WebGLProgram outlives it's WebGPUDevice/WebGLRenderingContext,
the ScriptExecutionContext* that was provided in the constructor won't be invalidated
leading to the bad access crash.

Rather than pass the ScriptExecutionContext* directly, have WebGPUPipeline/WebGLProgram
extend from ContextDestructionObserver so that it can propertly invalidate (and notify Web
Inspector) when the related context is about to be destroyed.

Test: inspector/canvas/updateShader.html

  • Modules/webgpu/WebGPUPipeline.h:

(WebCore::WebGPUPipeline::scriptExecutionContext const): Deleted.

  • Modules/webgpu/WebGPUPipeline.cpp:

(WebCore::WebGPUPipeline::WebGPUPipeline):
(WebCore::WebGPUPipeline::contextDestroyed): Added.

  • html/canvas/WebGLProgram.h:

(WebCore::WebGLProgram::scriptExecutionContext const): Deleted.

  • html/canvas/WebGLProgram.cpp:

(WebCore::WebGLProgram::WebGLProgram):
(WebCore::WebGLProgram::contextDestroyed): Added.

Sep 25, 2019:

11:41 PM Changeset in webkit [250380] by Keith Rollin
  • 2 edits in trunk/Source/WTF

Address static analysis warning in UTextProviderLatin1.cpp: Array access results in a null pointer dereference
https://bugs.webkit.org/show_bug.cgi?id=202155
<rdar://problem/55672422>

Reviewed by Geoffrey Garen.

Xcode's static analysis reports:

.../OpenSource/Source/WTF/wtf/text/icu/UTextProviderLatin1.cpp:185:22: warning: Array access (from variable 'dest') results in a null pointer dereference

dest[length] = 0;

This error is due to an earlier "if" statement that caused the static
analyzer to infer that "dest" could be NULL. It turns out that that
previous check was in error, in that it tested for "!dest" when it
should have tested for "dest". So this patch fixes that.

Even with that error fixed, the static analyzer will still infer that
"dest" could be NULL at the point shown above. Therefore, add a "dest"
test just before the assignment.

  • wtf/text/icu/UTextProviderLatin1.cpp:

(WTF::uTextLatin1Extract):

10:32 PM Changeset in webkit [250379] by Chris Dumez
  • 8 edits
    2 adds in trunk

Add very basic PageCache support for RTCPeerConnection
https://bugs.webkit.org/show_bug.cgi?id=202244

Reviewed by Geoffrey Garen.

Source/WebCore:

RTCPeerConnection::canSuspendForDocumentSuspension() returns true if
RTCPeerConnection::hasPendingActivity() return false. Previously, hasPendingActivity()
would return true unless the JS has called close() on the RTCPeerConnection
object.

On weather.com, an ad would construct an RTCPeerConnection just to do some feature
checking and then let the variable go out of scope (without calling close()). Because
of the previous implementation of RTCPeerConnection::hasPendingActivity(), this wrapper
and its implementation object would stay alive forever AND prevent the page from
entering PageCache on navigation.

To improve this, the implementation of hadPendingActivity() has been updated so that
it keeps returning false if close() has been called, but will also return false if
there are no pending Promises to be resolved and no event listeners.

Test: fast/mediastream/RTCPeerConnection-page-cache.html

  • Modules/mediastream/RTCPeerConnection.cpp:

WebCore::RTCPeerConnection::RTCPeerConnection:
Stop taking a pending activity in the constructor, this would be NOT keep the wrapper
alive since RTCPeerConnection::hasPendingActivity() was not checking
ActiveDOMObject::hasPendingActivity().

(WebCore::RTCPeerConnection::canSuspendForDocumentSuspension const):
(WebCore::RTCPeerConnection::hasPendingActivity const):

  • Modules/mediastream/RTCPeerConnection.h:
  • bindings/js/JSDOMPromiseDeferred.h:

(WebCore::DOMPromiseDeferredBase::whenSettled):

LayoutTests:

Add layout test coverage.

  • fast/mediastream/RTCPeerConnection-page-cache-expected.txt: Added.
  • fast/mediastream/RTCPeerConnection-page-cache.html: Added.
9:30 PM Changeset in webkit [250378] by Chris Dumez
  • 10 edits
    1 move
    1 add
    1 delete in trunk

Improve Service worker support for Page Caching
https://bugs.webkit.org/show_bug.cgi?id=202221

Reviewed by Geoffrey Garen.

Source/WebCore:

Allow pages using service workers to enter the back / forward cache.
Update ServiceWorkerRegistration / ServiceWorker ActiveDOMObjects
to properly suspend while in PageCache. Also, let documents controlled
by a service worker to enter PageCache (we already unregistered it as
a client of the service worker while suspended).

Test: http/tests/workers/service/page-caching.html

  • dom/Document.cpp:

(WebCore::Document::suspend):
(WebCore::Document::resume):

  • history/PageCache.cpp:

(WebCore::canCacheFrame):

  • workers/service/ServiceWorker.cpp:

(WebCore::ServiceWorker::updateState):
(WebCore::ServiceWorker::canSuspendForDocumentSuspension const):
(WebCore::ServiceWorker::suspend):
(WebCore::ServiceWorker::resume):

  • workers/service/ServiceWorker.h:
  • workers/service/ServiceWorkerRegistration.cpp:

(WebCore::ServiceWorkerRegistration::fireUpdateFoundEvent):
(WebCore::ServiceWorkerRegistration::canSuspendForDocumentSuspension const):
(WebCore::ServiceWorkerRegistration::suspend):
(WebCore::ServiceWorkerRegistration::resume):

  • workers/service/ServiceWorkerRegistration.h:

LayoutTests:

Add layout test coverage.

  • http/tests/workers/service/no-page-cache-when-controlled-expected.txt: Removed.
  • http/tests/workers/service/page-caching-expected.txt: Added.
  • http/tests/workers/service/page-caching.html: Renamed from LayoutTests/http/tests/workers/service/no-page-cache-when-controlled.html.
9:24 PM Changeset in webkit [250377] by achristensen@apple.com
  • 16 edits in trunk

Add replacement SPI on _WKWebsiteDataStoreConfiguration for enabling speculative cache validation and IPC-free server trust evaluation
https://bugs.webkit.org/show_bug.cgi?id=202251

Reviewed by Tim Horton.

Source/WebKit:

These are two performance optimizations that are currently per-ProcessPool that need to be per-WebsiteDataStore.
This makes replacement SPI and deprecates the old SPI. I'm going to adopt the new SPI then remove the old SPI.

  • NetworkProcess/NetworkSession.cpp:

(WebKit::NetworkSession::NetworkSession):

  • NetworkProcess/NetworkSessionCreationParameters.cpp:

(WebKit::NetworkSessionCreationParameters::encode const):
(WebKit::NetworkSessionCreationParameters::decode):

  • NetworkProcess/NetworkSessionCreationParameters.h:
  • NetworkProcess/cocoa/NetworkSessionCocoa.h:
  • NetworkProcess/cocoa/NetworkSessionCocoa.mm:

(-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
(WebKit::NetworkSessionCocoa::NetworkSessionCocoa):

  • UIProcess/API/C/WKContextPrivate.h:
  • UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
  • UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
  • UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
  • UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:

(-[_WKWebsiteDataStoreConfiguration networkCacheSpeculativeValidationEnabled]):
(-[_WKWebsiteDataStoreConfiguration setNetworkCacheSpeculativeValidationEnabled:]):
(-[_WKWebsiteDataStoreConfiguration fastServerTrustEvaluationEnabled]):
(-[_WKWebsiteDataStoreConfiguration setFastServerTrustEvaluationEnabled:]):

  • UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:

(WebKit::WebsiteDataStore::parameters):

  • UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp:

(WebKit::WebsiteDataStoreConfiguration::copy):

  • UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h:

(WebKit::WebsiteDataStoreConfiguration::fastServerTrustEvaluationEnabled const):
(WebKit::WebsiteDataStoreConfiguration::setFastServerTrustEvaluationEnabled):
(WebKit::WebsiteDataStoreConfiguration::networkCacheSpeculativeValidationEnabled const):
(WebKit::WebsiteDataStoreConfiguration::setNetworkCacheSpeculativeValidationEnabled):

Tools:

Adopt new SPI instead of deprecated SPI.

  • MiniBrowser/mac/AppDelegate.m:

(persistentDataStore):
(defaultConfiguration):
(-[BrowserAppDelegate fetchDefaultStoreWebsiteData:]):
(-[BrowserAppDelegate fetchAndClearDefaultStoreWebsiteData:]):
(-[BrowserAppDelegate clearDefaultStoreWebsiteData:]):

9:19 PM Changeset in webkit [250376] by Joseph Pecoraro
  • 3 edits in trunk/Source/WebInspectorUI

Web Inspector: REGRESSION: Elements detail sidebar sometimes starts collapsed
https://bugs.webkit.org/show_bug.cgi?id=202057
<rdar://problem/55572345>

Reviewed by Devin Rousso.

  • UserInterface/Views/ElementsTabContentView.js:

(WI.ElementsTabContentView.prototype.get detailsSidebarExpandedByDefault):
Default the Elements tab detail sidebar to be shown, not collapsed.

  • UserInterface/Views/TabContentView.js:

(WI.TabContentView):
(WI.TabContentView.prototype.get detailsSidebarExpandedByDefault):
Allow classes to specify whether or not their detail sidebar should
be expanded by default.

7:01 PM Changeset in webkit [250375] by Jonathan Bedard
  • 35 edits
    1 add
    2 deletes in trunk/Tools

Python 3: Add support in webkitpy.common.system
https://bugs.webkit.org/show_bug.cgi?id=201826
<rdar://problem/55452671>

Reviewed by Stephanie Lewis.

Tested compatibility by running 'python3 -m unittest webkitpy.common.system.<_unittest>' on
each of the effected files.

  • Scripts/webkitpy/common/checkout/changelog.py: Import StringIO from io module.

(set_reviewer):
(set_short_description_and_bug_url):

  • Scripts/webkitpy/common/checkout/checkout.py: Import StringIO from io module.

(Checkout._latest_entry_for_changelog_at_revision):

  • Scripts/webkitpy/common/config/committers.py:

(CommitterList.load_json): iteritems -> items.

  • Scripts/webkitpy/common/net/networktransaction.py:

(NetworkTransaction.run): urllib2 is urllib in Python3.

  • Scripts/webkitpy/common/system/abstractexecutive.py:

(AbstractExecutive._stringify_args):
(AbstractExecutive.command_for_printing): The str type is unicode in Python3.

  • Scripts/webkitpy/common/system/crashlogs_unittest.py: Explicitly encode and decode binary crashlogs.
  • Scripts/webkitpy/common/system/environment_unittest.py: Use absolute imports.
  • Scripts/webkitpy/common/system/executive.py:

(ScriptError.message_with_output): The str type is unicode in Python3.
(Executive.WrappedPopen): Python3's Popen object is a context manager. To allow us to use it as one,
our Python2 Popen needs to be one as well.
(Executive.WrappedPopen.init):
(Executive.WrappedPopen.enter):
(Executive.WrappedPopen.exit):
(Executive._run_command_with_teed_output): Simplify loop, decode unicode strings.
(Executive.run_and_throw_if_fail): The child output file should not be unicode strings.
(Executive.running_pids): Use the Popen context manager to guarantee clean-up.
(Executive._compute_stdin):
(Executive.run_command): Use the Popen context manager to guarantee clean-up.
(Executive._stringify_args): The str type is unicode in Python3.
(Executive.popen): Return a context manager if the Popen object is not one.

  • Scripts/webkitpy/common/system/executive_mock.py:

(MockProcess.init): StringIO -> BytesIO.
(MockProcess.enter):
(MockProcess):
(MockProcess.exit):

  • Scripts/webkitpy/common/system/executive_unittest.py:

(ExecutiveTest.test_auto_stringify_args): Use the Popen context manager to guarantee clean-up.
(ExecutiveTest.test_popen_args): Ditto.
(ExecutiveTest.serial_test_kill_process): Ditto.
(ExecutiveTest.serial_test_kill_all): Ditto.

  • Scripts/webkitpy/common/system/filesystem.py:

(FileSystem.read_binary_file): Use 'open' instead of 'file'.
(FileSystem.write_binary_file): Ditto.
(FileSystem.write_text_file): The str type is unicode in Python3.
(FileSystem.relpath):
(FileSystem.remove): The WindowsError is just anther OSError in Python3.
(FileSystem._WindowsError): Deleted.

  • Scripts/webkitpy/common/system/filesystem_mock.py:

(MockFileSystem.glob): filter returns a generator instead of a list.
(WritableBinaryFileObject.init): Binary files are comprised of bytes, not string in Python3.
(WritableBinaryFileObject.write): Ditto.
(ReadableTextFileObject.init): Ditto.

  • Scripts/webkitpy/common/system/filesystem_mock_unittest.py:

(MockFileSystemTest.test_normpath):
(MockFileSystemTest.test_dirs_under): assertEquals -> assertEqual.

  • Scripts/webkitpy/common/system/filesystem_unittest.py:

(RealFileSystemTest.test_read_and_write_file): Explicitly define byte arrays instead of strings.
(RealFileSystemTest.test_remove_file_with_retry.remove_with_exception): The WindowsError is just
anther OSError in Python3.

  • Scripts/webkitpy/common/system/outputcapture.py:
  • Scripts/webkitpy/common/system/outputtee_unittest.py:

(SimpleTeeTest.test_simple_tee):

  • Scripts/webkitpy/common/system/path.py:

(_escape): urllib library has been broken into parts.

  • Scripts/webkitpy/common/system/pemfile.py:

(_parse_pem_format.find_end): Python3 does not define a maxint.

  • Scripts/webkitpy/common/system/pemfile_unittest.py:
  • Scripts/webkitpy/common/system/platforminfo.py:

(PlatformInfo.total_bytes_memory): Not 'long' type in Python3.

  • Scripts/webkitpy/common/system/platforminfo_unittest.py:

(TestPlatformInfo.test_real_code): assertNotEquals -> assertNotEqual.
(TestPlatformInfo.test_display_name): Ditto.

  • Scripts/webkitpy/common/system/profiler.py:

(ProfilerFactory.create_profiler): Manually implement ifilter.

  • Scripts/webkitpy/common/system/profiler_unittest.py: Use absolute imports.
  • Scripts/webkitpy/common/system/stack_utils_unittest.py:

(current_thread_id): items() returns a generator in Python3.

  • Scripts/webkitpy/common/system/systemhost.py: Use absolute imports.
  • Scripts/webkitpy/common/system/urlfetcher.py: Removed.
  • Scripts/webkitpy/common/system/urlfetcher_mock.py: Removed.
  • Scripts/webkitpy/common/system/user.py:

(User.prompt): Use absolute imports, raw_input -> input.
(User.prompt_with_multiple_lists):
(User.prompt_with_list):
(User.confirm):

  • Scripts/webkitpy/common/unicode.py: Tooling to manage compatibility between Python 2

and Python 3 unicode handling.

  • Scripts/webkitpy/common/system/user_mock.py:

(MockUser.prompt): raw_input -> input.
(MockUser.prompt_with_list): Ditto.

  • Scripts/webkitpy/common/version.py:

(Version.from_iterable): xrange -> range.
(Version.from_name): Use absolute import path.
(Version.contains): xrange -> range.
(Version.str): xrange -> range.
(Version.cmp): amp is no longer an operator in Python3, but versions are comprised
Of integers, so subtraction has the same effect.
(Version):
(Version.eq): cmp operator is no longer respected, so we need to implement
each comparison.
(Version.ne): Ditto.
(Version.lt): Ditto.
(Version.le): Ditto.
(Version.gt): Ditto.
(Version.ge): Ditto.

  • Scripts/webkitpy/common/version_name_map.py:

(VersionNameMap._automap_to_major_version):
(VersionNameMap.to_name): xrange -> range.
(VersionNameMap.from_name): iteritems -> items.

  • Scripts/webkitpy/common/version_name_map_unittest.py: Use absolute imports.
  • Scripts/webkitpy/common/version_unittest.py: Ditto.
  • Scripts/webkitpy/common/wavediff.py:

(WaveDiff.init): StringIO -> BytesIO.

  • Scripts/webkitpy/port/init.py:

(outside):

6:43 PM Changeset in webkit [250374] by Fujii Hironori
  • 2 edits in trunk/Source/WebKitLegacy/win

Unreviewed build fix for Windows ports.
https://bugs.webkit.org/show_bug.cgi?id=202125
<rdar://problem/14944104>

  • WebCoreSupport/WebEditorClient.h: Added missing subFrameScrollPositionChanged.
5:57 PM Changeset in webkit [250373] by Wenson Hsieh
  • 2 edits in trunk/Source/WebKit

Fix failing layout tests after trac.webkit.org/r250183
https://bugs.webkit.org/show_bug.cgi?id=202053
<rdar://problem/54542190>

Reviewed by Tim Horton.

Followup to r250183: move the implementation of -gestureRecognizer:shouldReceiveTouch: out of
ENABLE(TOUCH_EVENTS) and into ENABLE(POINTER_EVENTS) instead. This logic is necessary in order for scrolling
via pan gestures to work on iOS, in the case where ENABLE(POINTER_EVENTS) is on but ENABLE(TOUCH_EVENTS) is off.
This is because the new swipe gesture recognizers added in r250183 will otherwise always take priority over the
scroll view's pan gestures.

Fixes the following layout tests:

  • fast/scrolling/ios/reconcile-layer-position-recursive.html
  • fast/scrolling/ios/click-events-during-momentum-scroll-in-main-frame.html
  • fast/scrolling/ios/click-events-after-long-press-during-momentum-scroll-in-main-frame.html
  • UIProcess/ios/WKContentViewInteraction.mm:
5:44 PM Changeset in webkit [250372] by Devin Rousso
  • 2 edits in trunk/Source/WebInspectorUI

Web Inspector: Uncaught Exception: TypeError: undefined is not an object (evaluating 'WI.showDebugUISetting.addEventListener')
https://bugs.webkit.org/show_bug.cgi?id=202220

Reviewed by Joseph Pecoraro.

  • UserInterface/Views/SettingsTabContentView.js:

(WI.SettingsTabContentView.prototype.initialLayout):

5:29 PM Changeset in webkit [250371] by Alan Coon
  • 7 edits in trunk/Source

Versioning.

5:09 PM Changeset in webkit [250370] by Alan Coon
  • 1 copy in tags/Safari-609.1.5

Tag Safari-609.1.5.

4:47 PM Changeset in webkit [250369] by Chris Dumez
  • 5 edits
    8 adds in trunk

[Cocoa] Regression(r212041) Safari adds a .dms extension automatically when downloading binaries with no extension
https://bugs.webkit.org/show_bug.cgi?id=202147
<rdar://problem/54886021>

Reviewed by Alexey Proskuryakov.

Source/WebCore:

When getting a suggested filename without extension (either from Content-Disposition header or from the download
attribute), we determine a suitable file extension based on the Content-Type header and append it. This is useful
since a lot of operating systems (such as macOS) rely on the file extension to determine file type.

The issue is that if the Content-Type is not provided or when it is provided but is "application/octet-stream",
we would append a .dms extension, which was unexpected. This patch makes it so that we no longer try to append
an extension when the resolved content type is "application/octet-stream".

Tests: http/tests/download/anchor-download-attribute-content-disposition-no-extension-octet-stream.html

http/tests/download/anchor-download-attribute-content-disposition-no-extension-text-plain.html
http/tests/security/anchor-download-octet-stream-no-extension.html

  • platform/MIMETypeRegistry.cpp:

(WebCore::MIMETypeRegistry::appendFileExtensionIfNecessary):

LayoutTests:

Add layout test coverage.

  • http/tests/download/anchor-download-attribute-content-disposition-no-extension-octet-stream-expected.txt: Added.
  • http/tests/download/anchor-download-attribute-content-disposition-no-extension-octet-stream.html: Added.
  • http/tests/download/anchor-download-attribute-content-disposition-no-extension-text-plain-expected.txt: Added.
  • http/tests/download/anchor-download-attribute-content-disposition-no-extension-text-plain.html: Added.
  • http/tests/download/resources/content-disposition-pass-no-extension-octet-stream.php: Added.
  • http/tests/download/resources/content-disposition-pass-no-extension-text-plain.php: Added.
  • http/tests/security/anchor-download-octet-stream-no-extension-expected.txt: Added.
  • http/tests/security/anchor-download-octet-stream-no-extension.html: Added.
  • platform/mac-wk1/TestExpectations:
  • platform/win/TestExpectations:
4:08 PM Changeset in webkit [250368] by Alan Coon
  • 2 edits in branches/safari-608-branch/Source/WebKit

Cherry-pick r250187. rdar://problem/55644650

Regression(iOS 13) web views do not deal properly with their window's UIScene changing
https://bugs.webkit.org/show_bug.cgi?id=202070
<rdar://problem/55580699>

Reviewed by Tim Horton.

Web views do not deal properly with their window's UIScene changing. If a Safari window is in the
background for 1 minute, its UIScene will be detached and the window will get a new UIScene if
the user later switches to this window. Our web views listen to UIScene notifications to determine
their visibility and currently stop receiving visibility updates once the window’s UIScene has
changed. This causes view freezes because our WebContent process does not know its view is visible
and keeps its layer tree frozen.

Previously, when our view would be added to a window, we would get this window's UIScene and listen
for UISceneDidEnterBackgroundNotification / UISceneWillEnterForegroundNotification for this UIScene
object. Instead, we now listen to these notifications for ALL the application's UIScenes. Our handler
then checks if the notification's UIScene object matches the current window's UIScene before
forwarding the notification to the rest of WebKit.

  • UIProcess/ApplicationStateTracker.mm: (WebKit::ApplicationStateTracker::ApplicationStateTracker): (WebKit::ApplicationStateTracker::~ApplicationStateTracker):

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

4:08 PM Changeset in webkit [250367] by Alan Coon
  • 2 edits in branches/safari-608-branch/Source/WebKit

Cherry-pick r250154. rdar://problem/55644650

ApplicationStateTracker::m_isBackground initialization does not account for UIScenes
https://bugs.webkit.org/show_bug.cgi?id=202048

Reviewed by Geoffrey Garen.

ApplicationStateTracker::m_isBackground initialization does not account for UIScenes, it merely checks
the visibility state of the whole app. It should instead check the visibility state of the window's
UIScene.

This patch also refactors the code a little bit to reduce #ifdef'ing.

  • UIProcess/ApplicationStateTracker.mm: (WebKit::ApplicationStateTracker::ApplicationStateTracker):

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

4:08 PM Changeset in webkit [250366] by Alan Coon
  • 4 edits in branches/safari-608-branch/Source/WebKit

Cherry-pick r250111. rdar://problem/55644650

Add better logging for when the view visibility state changes
https://bugs.webkit.org/show_bug.cgi?id=202008

Reviewed by Geoffrey Garen.

  • UIProcess/ApplicationStateTracker.mm:
  • UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::updateActivityState):
  • UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::applicationDidEnterBackground): (WebKit::WebPageProxy::applicationWillEnterForeground):

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

3:54 PM Changeset in webkit [250365] by Megan Gardner
  • 13 edits
    2 adds in trunk

Update selections after scrolling for iframes and hide selections while iframes and overflow scrolls are scrolling.
https://bugs.webkit.org/show_bug.cgi?id=202125

Reviewed by Tim Horton.

Source/WebCore:

Test: editing/selection/ios/update-selection-after-iframe-scroll.html

When we end scrolling, make sure that iframes get a final update to ensure that the
selection is in the correct position. Pipe that to WebKit/UIProcess via
frame specific plath.

  • loader/EmptyClients.cpp:
  • page/EditorClient.h:
  • page/scrolling/AsyncScrollingCoordinator.cpp:

(WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):

Source/WebKit:

Add additional calls into UIKit differentiate between main frame scrolling and overflow/iframe scrolling.
Add piping for iframe specific scrolling.

  • Platform/spi/ios/UIKitSPI.h:
  • UIProcess/ios/WKContentViewInteraction.mm:

(-[WKContentView _willStartScrollingOrZooming]):
(-[WKContentView _didEndScrollingOrZooming]):

  • WebProcess/WebCoreSupport/WebEditorClient.cpp:

(WebKit::WebEditorClient::subFrameScrollPositionChanged):

  • WebProcess/WebCoreSupport/WebEditorClient.h:
  • WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm:

(WebKit::WebEditorClient::subFrameScrollPositionChanged):

Source/WebKitLegacy/mac:

Filling out unused functions needed for new fix.

  • WebCoreSupport/WebEditorClient.h:

LayoutTests:

Test that an iframe selection is updated after a scroll is completed.

  • editing/selection/ios/update-selection-after-iframe-scroll-expected.txt: Added.
  • editing/selection/ios/update-selection-after-iframe-scroll.html: Added.
3:53 PM Changeset in webkit [250364] by Alan Coon
  • 3 edits in branches/safari-608-branch/Source

Revert r249936. rdar://problem/55461414

3:53 PM Changeset in webkit [250363] by Alan Coon
  • 4 edits in branches/safari-608-branch/Source

Cherry-pick r249933. rdar://problem/55461414

REGRESSION: iPad: Safari becomes unresponsive after context menu on 1-800-MY-APPLE phone number, tapping 'Add to Contacts'
https://bugs.webkit.org/show_bug.cgi?id=201816
<rdar://55105827>

Reviewed by Darin Adler.

Source/WebCore/PAL:

Expose kDataDetectorsSourceRectKey (and sort things while there).

  • pal/spi/ios/DataDetectorsUISPI.h:

Source/WebKit:

When generating the DataDetectorsContext for a position, we should
also provide the source rectangle for the link in root view coordinates.
This allows DataDetectors to show any modal dialogs in the right
position.

  • UIProcess/ios/WKContentViewInteraction.mm: Use either the bounds of the positionInformation or the text bounding rectangle. (-[WKContentView dataDetectionContextForPositionInformation:]):

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

3:46 PM Changeset in webkit [250362] by aboya@igalia.com
  • 2 edits
    2 adds in trunk/LayoutTests

[GTK] Unreviewed test gardening
https://bugs.webkit.org/show_bug.cgi?id=202246

  • platform/gtk/TestExpectations:
3:30 PM Changeset in webkit [250361] by Wenson Hsieh
  • 5 edits
    2 adds in trunk

Page temporarily jumps to an excessively small viewport scale while loading usatoday.com
https://bugs.webkit.org/show_bug.cgi?id=202224
<rdar://problem/52906640>

Reviewed by Tim Horton.

Source/WebCore:

On some pages (e.g. usatoday.com), the content width of the page temporarily becomes very large during page
load. This causes a couple of viewport scaling behaviors (notably, the existing shrink-to-fit heuristic in
ViewportConfiguration::initialScaleFromSize, as well as the new iPad-specific content-aware shrink-to-fit
heuristic in WebPage::immediatelyShrinkToFitContent) to cause the page to shrink down excessively in an attempt
to fit all the content to the viewport. This causes a very ugly flash as the page appears zoomed out initially
during page load, before zooming back in.

To fix this, we add some sanity checks to these viewport scaling heuristics. In ViewportConfiguration's
initialScaleFromSize method, in the codepath where an initial scale is not specified, we always scale to fit the
contents of the page; instead, detect the case where the content width is enormous (with a threshold arbitrarily
chosen to be 1920) and fall back to the scaling to fit the viewport's width, if such a width has been explicitly
set. This ensures that we avoid excessive shrinking in the case where content is extremely wide, but also that
we do scale the viewport down to fit all the content in the case where the content isn't extremely wide (e.g. on
daringfireball.com).

See WebKit ChangeLog for more detail.

Test: fast/viewport/ios/shrink-to-fit-large-content-width.html

  • page/ViewportConfiguration.cpp:

(WebCore::ViewportConfiguration::initialScaleFromSize const):

Source/WebKit:

Tweaks the content-aware shrink-to-fit algorithm to bail in the case where the content width is extremely large,
such that it bails instead of attempting to fit the entire content of the page. See WebCore ChangeLog for more
details.

  • WebProcess/WebPage/ios/WebPageIOS.mm:

(WebKit::WebPage::immediatelyShrinkToFitContent):

LayoutTests:

Adds a new layout test to verify that when the content width of the page is excessively large and an explicit
viewport width is specified, we don't attempt to zoom out to fit the larger content width, and instead zoom to
fit the explicit viewport width.

  • fast/viewport/ios/shrink-to-fit-large-content-width-expected.txt: Added.
  • fast/viewport/ios/shrink-to-fit-large-content-width.html: Added.
3:30 PM Changeset in webkit [250360] by Alan Coon
  • 7 edits in branches/safari-608-branch/Source

Versioning.

3:17 PM Changeset in webkit [250359] by Alan Coon
  • 1 copy in tags/Safari-608.3.4

Tag Safari-608.3.4.

2:45 PM Changeset in webkit [250358] by Alan Bujtas
  • 2 edits in trunk/LayoutTests

Adjust tap position to avoid double-tap issue across tests.

Unreviewed test gardening.

  • fast/events/touch/ios/double-tap-for-two-clicks3.html:
2:12 PM Changeset in webkit [250357] by aakash_jain@apple.com
  • 3 edits in trunk/Tools

[EWS] RunJavaScriptCoreTestsToT should use the same command as RunJavaScriptCoreTests
https://bugs.webkit.org/show_bug.cgi?id=202216

Reviewed by Jonathan Bedard.

  • BuildSlaveSupport/ews-build/steps.py:

(RunJavaScriptCoreTestsToT): Removed the command so as to use the command from base class.

  • BuildSlaveSupport/ews-build/steps_unittest.py: Updatd unit-tests.
1:56 PM Changeset in webkit [250356] by aakash_jain@apple.com
  • 5 edits in trunk/Tools

[ews] JSC queues should run or skip tests based on runTests key from config.json
https://bugs.webkit.org/show_bug.cgi?id=202223

Reviewed by Jonathan Bedard.

  • BuildSlaveSupport/ews-build/config.json: Added the runTests key.
  • BuildSlaveSupport/ews-build/factories.py:

(JSCTestsFactory.init): Add RunJavaScriptCoreTests step based on runTests key.

  • BuildSlaveSupport/ews-build/loadConfig.py:

(loadBuilderConfig): Pass the runTests key to the factory.

  • BuildSlaveSupport/ews-build/loadConfig_unittest.py:

(ConfigDotJSONTest.test_builder_keys): Added the runTests key.

1:27 PM Changeset in webkit [250355] by Jonathan Bedard
  • 7 edits
    2 adds in trunk/Tools

results.webkit.org: Add investigation drawer
https://bugs.webkit.org/show_bug.cgi?id=202106

Reviewed by Dewei Zhu.

  • resultsdbpy/resultsdbpy/view/static/js/drawer.js: Support multiple 'main' classes.
  • resultsdbpy/resultsdbpy/view/static/js/expectations.js: Added.

(Expectations.colorMap): Return a dictionary mapping type strings to colors.
(Expectations.stringToStateId): Map a string to a state ID for sorting.
(Expectations.typeForId): Return a type string given an ID.
(Expectations.symbolForId): Return a symbol for a type given an ID.
(Expectations.colorForId): Return a color given an ID.
(Expectations.unexpectedResults): Given a list of actual results and expected results,
return a state.
(Expectations):

  • resultsdbpy/resultsdbpy/view/static/js/investigate.js: Added.

(commitsForUuid):
(testRunLink):
(elapsed):
(percentage):
(contentForAgregateData):
(contentForData):
(_InvestigateDrawer):
(_InvestigateDrawer.prototype.isRendered):
(_InvestigateDrawer.prototype.expand): Expand the investigation drawer.
(_InvestigateDrawer.prototype.collapse): Collapse the investigation drawer.
(_InvestigateDrawer.prototype.select): Select an element to investigate.

  • resultsdbpy/resultsdbpy/view/static/js/timeline.js:

(statsForSingleResult): Move Expectation constants.
(TimelineFromEndpoint.prototype.render): Investigate specific data points instead
of jumping to the build.
(Expectations.stringToStateId): Deleted.
(Expectations.unexpectedResults): Deleted.
(Expectations): Deleted.

  • resultsdbpy/resultsdbpy/view/static/library/css/webkit.css:

(.drawer.display): Make minimum height.
(@media screen and (min-width: 600px)): Move main and sidebar so they override drawer.
(@media screen and (min-width: 768px)): Ditto.

  • resultsdbpy/resultsdbpy/view/templates/commits.html:
  • resultsdbpy/resultsdbpy/view/templates/search.html:
  • resultsdbpy/resultsdbpy/view/templates/suite_results.html:
12:43 PM Changeset in webkit [250354] by achristensen@apple.com
  • 3 edits in trunk/Source/WebKit

Don't fall back to default session if session can't be found for cookie operations
https://bugs.webkit.org/show_bug.cgi?id=202222

Reviewed by Geoff Garen.

Apparently, during teardown of private browsing sessions, there is sometimes a race condition and cookies from a torn-down session are requested.
In this case, just fail like we do all other operations in this file. Otherwise, it's a breach of privacy.

  • NetworkProcess/NetworkConnectionToWebProcess.cpp:

(WebKit::NetworkConnectionToWebProcess::storageSession):
(WebKit::NetworkConnectionToWebProcess::cookiesForDOM):
(WebKit::NetworkConnectionToWebProcess::setCookiesFromDOM):
(WebKit::NetworkConnectionToWebProcess::cookiesEnabled):
(WebKit::NetworkConnectionToWebProcess::cookieRequestHeaderFieldValue):
(WebKit::NetworkConnectionToWebProcess::getRawCookies):
(WebKit::NetworkConnectionToWebProcess::deleteCookie):

  • NetworkProcess/NetworkConnectionToWebProcess.h:
12:34 PM Changeset in webkit [250353] by Alan Bujtas
  • 2 edits in trunk/LayoutTests

Rebaselining after r250315.

  • fast/events/touch/ios/double-tap-for-double-click3-expected.txt:
12:22 PM Changeset in webkit [250352] by achristensen@apple.com
  • 12 edits in trunk

Remove duplicate WebsiteDataStoreConfiguration copying code
https://bugs.webkit.org/show_bug.cgi?id=202215

Reviewed by Tim Horton.

Source/WebKit:

WKWebsiteDataStore's _initWithConfiguration was duplicating the functionality of WebsiteDataStoreConfiguration::copy.
The former should just call the latter.
This move has the side effect of making _WKWebsiteDataStoreConfiguration's paths readable, which I think is desirable so I added a unit test verifying it is so.

  • UIProcess/API/C/WKWebsiteDataStoreConfigurationRef.cpp:

(WKWebsiteDataStoreConfigurationCreate):

  • UIProcess/API/Cocoa/WKWebsiteDataStore.mm:

(-[WKWebsiteDataStore _initWithConfiguration:]):

  • UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:

(-[_WKWebsiteDataStoreConfiguration init]):
(-[_WKWebsiteDataStoreConfiguration initNonPersistentConfiguration]):

  • UIProcess/WebProcessPool.cpp:

(WebKit::WebProcessPool::mayHaveRegisteredServiceWorkers):

  • UIProcess/WebsiteData/WebsiteDataStore.cpp:

(WebKit::WebsiteDataStore::createNonPersistent):
(WebKit::WebsiteDataStore::defaultDataStore):
(WebKit::WebsiteDataStore::defaultDataStoreConfiguration): Deleted.

  • UIProcess/WebsiteData/WebsiteDataStore.h:
  • UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp:

(WebKit::WebsiteDataStoreConfiguration::WebsiteDataStoreConfiguration):
(WebKit::WebsiteDataStoreConfiguration::copy):

  • UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h:

(WebKit::WebsiteDataStoreConfiguration::create):
(WebKit::WebsiteDataStoreConfiguration::isPersistent const):
(WebKit::WebsiteDataStoreConfiguration::setPersistent): Deleted.

Tools:

  • TestWebKitAPI/Tests/WebKitCocoa/WebsiteDataStoreCustomPaths.mm:

(TEST):

12:16 PM Changeset in webkit [250351] by achristensen@apple.com
  • 12 edits in trunk

Replace WebsiteDataStoreParameters::privateSessionParameters with re-initializing all sessions immediately upon NetworkProcess resumption
https://bugs.webkit.org/show_bug.cgi?id=202211

Reviewed by Tim Horton.

Source/WebKit:

Re-adding an ephemeral session after a NetworkProcess crash based on guessing that all its parameters are empty was added in r227590 with a test.
That test passes even when that re-adding code is removed because we re-add all sessions with parameters from the UIProcess when we restart a NetworkProcess.
I move the addition of non-default sessions to the initialization message instead of messages after the initialization message to remove race conditions that
might cause loads to happen before the NetworkProcess has received its second message from the UIProcess. I also add a unit test to verify that session
resumption also works with non-default persistent WebsiteDataStores.

  • NetworkProcess/NetworkProcess.cpp:

(WebKit::NetworkProcess::initializeNetworkProcess):

  • NetworkProcess/NetworkProcessCreationParameters.cpp:

(WebKit::NetworkProcessCreationParameters::encode const):
(WebKit::NetworkProcessCreationParameters::decode):

  • NetworkProcess/NetworkProcessCreationParameters.h:
  • NetworkProcess/NetworkResourceLoader.cpp:

(WebKit::NetworkResourceLoader::startNetworkLoad):

  • NetworkProcess/NetworkSessionCreationParameters.cpp:

(WebKit::NetworkSessionCreationParameters::privateSessionParameters): Deleted.

  • NetworkProcess/NetworkSessionCreationParameters.h:
  • Shared/WebsiteDataStoreParameters.cpp:

(WebKit::WebsiteDataStoreParameters::privateSessionParameters): Deleted.

  • Shared/WebsiteDataStoreParameters.h:

(WebKit::WebsiteDataStoreParameters::legacyPrivateSessionParameters): Deleted.

  • UIProcess/WebProcessPool.cpp:

(WebKit::WebProcessPool::ensureNetworkProcess):

Tools:

  • TestWebKitAPI/Tests/WebKitCocoa/NetworkProcessCrashNonPersistentDataStore.mm:

(checkRecoveryAfterCrash):
(TEST):

11:35 AM Changeset in webkit [250350] by aakash_jain@apple.com
  • 4 edits in trunk/Tools

[EWS] JSC queues should dynamically add required build steps for re-testing the patch
https://bugs.webkit.org/show_bug.cgi?id=202170

Reviewed by Jonathan Bedard.

  • BuildSlaveSupport/ews-build/factories.py:

(JSCTestsFactory.init): Do not add ReRunJavaScriptCoreTests and related steps here, as
these are dynamically added (if required) in steps.py.

  • BuildSlaveSupport/ews-build/steps.py:

(CompileJSCToT): Remove doStepIf() and hideStepIf() method, these are no longer required as we add
this step dynamically only if required. We don't need an extra property ('patchFailedToBuild') to be set.
(RunJavaScriptCoreTests.evaluateCommand): Dynamically add ReRunJavaScriptCoreTests step if required.
(ReRunJavaScriptCoreTests): Removed doStepIf() and hideStepIf() method.
(ReRunJavaScriptCoreTests.evaluateCommand): Dynamically add UnApplyPatchIfRequired(), CompileJSCToT() and RunJavaScriptCoreTestsToT steps.
(RunJavaScriptCoreTestsToT.evaluateCommand): Overriden to avoid caling the base-class method which dynamically adds
more steps.

  • BuildSlaveSupport/ews-build/steps_unittest.py: Updated unit-tests accordingly.
10:14 AM Changeset in webkit [250349] by achristensen@apple.com
  • 11 edits in trunk/Source/WebKit

Replace _WKProcessPoolConfiguration.CTDataConnectionServiceType with _WKWebsiteDataStoreConfiguration.dataConnectionServiceType
https://bugs.webkit.org/show_bug.cgi?id=202174

Reviewed by Tim Horton.

_WKProcessPoolConfiguration.CTDataConnectionServiceType is used in one place and needs a replacement so we can
start a NetworkProcess without a WKProcessPool. Since this SPI only does something in the low-level networking code,
I verified that the new SPI sets the String the way the old one does, and the old one keeps working in the interim.

  • NetworkProcess/NetworkSessionCreationParameters.cpp:

(WebKit::NetworkSessionCreationParameters::encode const):
(WebKit::NetworkSessionCreationParameters::decode):

  • NetworkProcess/NetworkSessionCreationParameters.h:
  • NetworkProcess/cocoa/NetworkSessionCocoa.mm:

(WebKit::NetworkSessionCocoa::NetworkSessionCocoa):

  • UIProcess/API/Cocoa/WKWebsiteDataStore.mm:

(-[WKWebsiteDataStore _initWithConfiguration:]):

  • UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
  • UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
  • UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:

(-[_WKWebsiteDataStoreConfiguration dataConnectionServiceType]):
(-[_WKWebsiteDataStoreConfiguration setDataConnectionServiceType:]):

  • UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:

(WebKit::WebsiteDataStore::parameters):

  • UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp:

(WebKit::WebsiteDataStoreConfiguration::copy):

  • UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h:

(WebKit::WebsiteDataStoreConfiguration::dataConnectionServiceType const):
(WebKit::WebsiteDataStoreConfiguration::setDataConnectionServiceType):

10:04 AM Changeset in webkit [250348] by commit-queue@webkit.org
  • 2 edits in trunk/Source/WebKit

Unreviewed, rolling out r250336.
https://bugs.webkit.org/show_bug.cgi?id=202210

it is creating failures on iOS bots (Requested by youenn on
#webkit).

Reverted changeset:

"Make IsNSURLSessionWebSocketEnabled an experimental flag"
https://bugs.webkit.org/show_bug.cgi?id=202135
https://trac.webkit.org/changeset/250336

9:47 AM Changeset in webkit [250347] by commit-queue@webkit.org
  • 72 edits
    28 copies
    4 moves
    58 adds
    7 deletes in trunk/LayoutTests

Re-sync web-platform-tests/IndexedDB from upstream
https://bugs.webkit.org/show_bug.cgi?id=202179

Patch by Alexey Shvayka <Alexey Shvayka> on 2019-09-25
Reviewed by Alex Christensen.

Re-sync web-platform-tests/IndexedDB from upstream a0f781e4d4e9.

LayoutTests/imported/w3c:

  • web-platform-tests/IndexedDB/*: Updated.

LayoutTests:

  • TestExpectations:
  • platform/ios/TestExpectations:
  • platform/mac-wk1/TestExpectations:
  • platform/mac/TestExpectations:
  • tests-options.json:
9:23 AM Changeset in webkit [250346] by youenn@apple.com
  • 3 edits in trunk/Source/WebKit

Creation of a service worker connection for a service worker job should be based on the job scope
https://bugs.webkit.org/show_bug.cgi?id=202185

Reviewed by Alex Christensen.

  • NetworkProcess/NetworkProcess.cpp:

(WebKit::NetworkProcess::swServerForSession):
Assert that registrable domain is not empty.

  • NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:

(WebKit::WebSWServerConnection::scheduleJobInServer):
Use the scope URL instead of the script URL which may be empty in case of an unregister job.

9:01 AM Changeset in webkit [250345] by Wenson Hsieh
  • 19 edits in trunk

[iPadOS] [DataActivation] Focus moves away after focusing input fields on www.att.com
https://bugs.webkit.org/show_bug.cgi?id=202167
<rdar://problem/55185021>

Reviewed by Tim Horton.

Source/WebCore:

Adds a new site-specific quirk. See WebKit ChangeLog for more details.

  • page/Quirks.cpp:

(WebCore::Quirks::shouldUseLegacySelectPopoverDismissalBehaviorInDataActivation const):

  • page/Quirks.h:
  • platform/RuntimeApplicationChecks.h:
  • platform/cocoa/RuntimeApplicationChecksCocoa.mm:

(WebCore::IOSApplication::isDataActivation):

Source/WebKit:

When using the data activation page on www.att.com, one of the sections on the page contains several select
elements; in the case where the user agent:

  1. contains the string "iPad", and
  2. does not contain the string "Safari"

...www.att.com's data activation page will opt into a mode where it adds blur event listeners to the select
elements; in this blur event listener, www.att.com proceeds to programmatically focus a non-editable div element
after a 1 second timeout. The reasons for this behavior remain unclear to me, though it's worth noting that the
blur event handler name is "screenReaderFocus", which suggests that this is in place to ensure compatibility
with screen readers.

In iOS 12, dismissing the popover would blur the focused select menu with an animation. Since the animation
would take a slightly less than 1 second, www.att.com's logic would have the effect of moving focus to the div
element shortly after dismissing the select menu. However, after r243808, we no longer attempt to blur the
focused select element when dismissing the popover. This means that the select element is only blurred the next
time the user activates another focused element, such as one of the input fields on the page, or a different
select element. Consequently, the logic to move focus into a div element now occurs only after a different
element has already been focused; this results in focus moving away from newly focused elements after 1 second
in the case where a select element has previously focused.

To mitigate this, restore iOS 12 behavior behind a site- and app-specific quirk. See comments below for more
details.

  • Shared/FocusedElementInformation.cpp:

(WebKit::FocusedElementInformation::encode const):
(WebKit::FocusedElementInformation::decode):

  • Shared/FocusedElementInformation.h:

Add a new behavioral quirk flag to FocusedElementInformation to determine whether we should use "legacy" select
popover dismissal behavior (i.e. blurring the focused select element when dismissing the select popover, as well
as dismissing the popover with animation).

  • Shared/WebPreferences.yaml:

Enable site-specific quirks by default in WKWebView. With regards to this bug, this change allows for
site-specific hacks (namely, legacy select popover dismissal) in DataActivation. However, this also fixes
various known bugs that are otherwise addressed in Safari only, via site-specific quirks.

  • UIProcess/API/Cocoa/WKWebView.mm:

(-[WKWebView _initializeWithConfiguration:]):

For apps linked on or before iOS 13 and macOS 10.15, revert the default of value of NeedsSiteSpecificQuirks to
false. This is done here instead of in a default value function in WebPreferencesDefaultValues to prevent the
default values of NeedsSiteSpecificQuirks in the web process and UI process from going out of sync, since the
web process is not necessarily linked against the same SDK as the application.

  • UIProcess/Cocoa/VersionChecks.h:

Add a new DYLD version check for the first version of iOS and macOS where site-specific quirks are enabled by
default.

  • UIProcess/ios/WKContentViewInteraction.h:
  • UIProcess/ios/WKContentViewInteraction.mm:

(-[WKContentView endEditingAndUpdateFocusAppearanceWithReason:]):
(-[WKContentView _elementDidBlur]):
(-[WKContentView _shouldUseLegacySelectPopoverDismissalBehavior]):

We only use "legacy" select popover dismissal behavior in the case where the site-specific quirk flag is on, a
select popover is used (i.e. the device is an iPad and a select element is focused), and the application bundle
is "com.apple.DataActivation".

  • UIProcess/ios/forms/WKFormSelectPopover.mm:

(-[WKSelectTableViewController shouldDismissWithAnimation]):

Keyed off of _shouldUseLegacySelectPopoverDismissalBehavior.

(-[WKSelectPopover controlEndEditing]):

  • WebProcess/WebPage/ios/WebPageIOS.mm:

(WebKit::WebPage::getFocusedElementInformation):

Source/WTF:

Declare DYLD_IOS_VERSION_13_2.

  • wtf/spi/darwin/dyldSPI.h:

Tools:

Rebaseline an API test.

  • TestWebKitAPI/Tests/WebKit/WKPreferences.cpp:

(TestWebKitAPI::TEST):

7:55 AM Changeset in webkit [250344] by Jonathan Bedard
  • 29 edits
    128 deletes in trunk

Unreviewed, rolling out r250324.

Source/WebCore:

Broke many mac wk2 layout tests

Reverted changeset:

"Enable LayoutTests using ResourceLoadStatistics SQLite
backend (195420)"
https://bugs.webkit.org/show_bug.cgi?id=195420
https://trac.webkit.org/changeset/250324

Source/WebKit:

Broke many mac wk2 layout tests

Reverted changeset:

"Enable LayoutTests using ResourceLoadStatistics SQLite
backend (195420)"
https://bugs.webkit.org/show_bug.cgi?id=195420
https://trac.webkit.org/changeset/250324

Tools:

Tools/ChangeLog

Reverted changeset:

"Enable LayoutTests using ResourceLoadStatistics SQLite
backend (195420)"
https://bugs.webkit.org/show_bug.cgi?id=195420
https://trac.webkit.org/changeset/250324

LayoutTests:

Broke many mac wk2 layout tests

Reverted changeset:

"Enable LayoutTests using ResourceLoadStatistics SQLite
backend (195420)"
https://bugs.webkit.org/show_bug.cgi?id=195420
https://trac.webkit.org/changeset/250324

7:43 AM Changeset in webkit [250343] by Antti Koivisto
  • 8 edits
    2 moves in trunk/Source/WebCore

Rename LineLayoutInterface to LineLayoutTraversal
https://bugs.webkit.org/show_bug.cgi?id=202202

Reviewed by Zalan Bujtas.

Use a bit more informative namespace name.

  • Headers.cmake:
  • Sources.txt:
  • WebCore.xcodeproj/project.pbxproj:
  • dom/Position.cpp:

(WebCore::Position::upstream const):
(WebCore::Position::downstream const):

  • editing/TextIterator.cpp:

(WebCore::TextIterator::handleTextNode):
(WebCore::TextIterator::handleTextBox):
(WebCore::TextIterator::handleTextNodeFirstLetter):

  • editing/TextIterator.h:
  • rendering/RenderTreeAsText.cpp:

(WebCore::RenderTreeAsText::writeRenderObject):
(WebCore::writeTextBox):
(WebCore::write):

  • rendering/line/LineLayoutTraversal.cpp: Renamed from Source/WebCore/rendering/line/LineLayoutInterfaceTextBoxes.cpp.

(WebCore::LineLayoutTraversal::TextBox::rect const):
(WebCore::LineLayoutTraversal::TextBox::logicalRect const):
(WebCore::LineLayoutTraversal::TextBox::hasHyphen const):
(WebCore::LineLayoutTraversal::TextBox::isLeftToRightDirection const):
(WebCore::LineLayoutTraversal::TextBox::dirOverride const):
(WebCore::LineLayoutTraversal::TextBox::text const):
(WebCore::LineLayoutTraversal::TextBox::localStartOffset const):
(WebCore::LineLayoutTraversal::TextBox::localEndOffset const):
(WebCore::LineLayoutTraversal::TextBox::length const):
(WebCore::LineLayoutTraversal::TextBox::isLastOnLine const):
(WebCore::LineLayoutTraversal::TextBox::isLast const):
(WebCore::LineLayoutTraversal::TextBox::iterator const):
(WebCore::LineLayoutTraversal::TextBoxIterator::TextBoxIterator):
(WebCore::LineLayoutTraversal::TextBoxIterator::traverseNextInVisualOrder):
(WebCore::LineLayoutTraversal::TextBoxIterator::ComplexPath::nextInlineTextBoxInTextOrder const):
(WebCore::LineLayoutTraversal::TextBoxIterator::traverseNextInTextOrder):
(WebCore::LineLayoutTraversal::TextBoxIterator::operator== const):
(WebCore::LineLayoutTraversal::TextBoxIterator::atEnd const):
(WebCore::LineLayoutTraversal::firstTextBoxInVisualOrderFor):
(WebCore::LineLayoutTraversal::firstTextBoxInTextOrderFor):
(WebCore::LineLayoutTraversal::textBoxRangeFor):

  • rendering/line/LineLayoutTraversal.h: Renamed from Source/WebCore/rendering/line/LineLayoutInterfaceTextBoxes.h.

(WebCore::LineLayoutTraversal::TextBoxIterator::TextBoxIterator):
(WebCore::LineLayoutTraversal::TextBoxIterator::operator++):
(WebCore::LineLayoutTraversal::TextBoxIterator::operator bool const):
(WebCore::LineLayoutTraversal::TextBoxIterator::operator!= const):
(WebCore::LineLayoutTraversal::TextBoxIterator::operator== const):
(WebCore::LineLayoutTraversal::TextBoxIterator::operator* const):
(WebCore::LineLayoutTraversal::TextBoxIterator::operator-> const):
(WebCore::LineLayoutTraversal::TextBoxRange::TextBoxRange):
(WebCore::LineLayoutTraversal::TextBoxRange::begin const):
(WebCore::LineLayoutTraversal::TextBoxRange::end const):
(WebCore::LineLayoutTraversal::hasTextBoxes):

7:33 AM Changeset in webkit [250342] by Alan Bujtas
  • 5 edits in trunk/Source/WebCore

[LFC][IFC] Use existing Line::Content::LineBox to track the current line geometry
https://bugs.webkit.org/show_bug.cgi?id=202182

Reviewed by Antti Koivisto.

This patch removes the redundant Line::m_logicalTopLeft, m_contentLogicalWidth, m_lineLogicalHeight, m_baseline, m_baselineTop members
and switches over to Line::m_content's LineBox.

  • layout/displaytree/DisplayRect.h:

(WebCore::Display::Rect::Rect):

  • layout/inlineformatting/InlineLine.cpp:

(WebCore::Layout::Line::Line):
(WebCore::Layout::Line::close):
(WebCore::Layout::Line::removeTrailingTrimmableContent):
(WebCore::Layout::Line::moveLogicalLeft):
(WebCore::Layout::Line::appendNonBreakableSpace):
(WebCore::Layout::Line::appendTextContent):
(WebCore::Layout::Line::appendNonReplacedInlineBox):
(WebCore::Layout::Line::adjustBaselineAndLineHeight):
(WebCore::Layout::m_skipVerticalAligment): Deleted.

  • layout/inlineformatting/InlineLine.h:

(WebCore::Layout::Line::Content::lineBox):
(WebCore::Layout::Line::contentLogicalRight const):
(WebCore::Layout::Line::logicalTop const):
(WebCore::Layout::Line::logicalBottom const):
(WebCore::Layout::Line::logicalLeft const):
(WebCore::Layout::Line::logicalHeight const):
(WebCore::Layout::Line::contentLogicalWidth const):
(WebCore::Layout::Line::baselineOffset const):

  • layout/inlineformatting/InlineLineBox.h:

(WebCore::Layout::LineBox::setLogicalTopLeft):
(WebCore::Layout::LineBox::setLogicalHeight):
(WebCore::Layout::LineBox::setLogicalWidth):
(WebCore::Layout::LineBox::moveHorizontally):
(WebCore::Layout::LineBox::expandHorizontally):
(WebCore::Layout::LineBox::shrinkHorizontally):
(WebCore::Layout::LineBox::expandVertically):
(WebCore::Layout::LineBox::shrinkVertically):
(WebCore::Layout::LineBox::LineBox):
(WebCore::Layout::LineBox::setLogicalHeightIfGreater):
(WebCore::Layout::LineBox::setBaseline):
(WebCore::Layout::LineBox::baseline const):
(WebCore::Layout::LineBox::baseline):
(WebCore::Layout::LineBox::setBaselineOffset):
(WebCore::Layout::LineBox::Baseline::setAscentIfGreater):
(WebCore::Layout::LineBox::Baseline::setDescentIfGreater):

7:23 AM Changeset in webkit [250341] by Antti Koivisto
  • 17 edits in trunk/Source/WebCore

Rename InlineBox::nextLeafChild to nextLeafOnLine
https://bugs.webkit.org/show_bug.cgi?id=202197

Reviewed by Zalan Bujtas.

The name is confusing as it never returns a child of the inline box it is called on.
Rename it and other similar functions that traverse within a line.

  • dom/Position.cpp:

(WebCore::Position::getInlineBoxAndOffset const):

  • editing/RenderedPosition.cpp:

(WebCore::RenderedPosition::RenderedPosition):
(WebCore::RenderedPosition::previousLeafOnLine const):
(WebCore::RenderedPosition::nextLeafOnLine const):
(WebCore::RenderedPosition::isEquivalent const):
(WebCore::RenderedPosition::bidiLevelOnLeft const):
(WebCore::RenderedPosition::bidiLevelOnRight const):
(WebCore::RenderedPosition::leftBoundaryOfBidiRun):
(WebCore::RenderedPosition::rightBoundaryOfBidiRun):
(WebCore::RenderedPosition::atLeftBoundaryOfBidiRun const):
(WebCore::RenderedPosition::atRightBoundaryOfBidiRun const):
(WebCore::RenderedPosition::positionAtLeftBoundaryOfBiDiRun const):
(WebCore::RenderedPosition::positionAtRightBoundaryOfBiDiRun const):
(WebCore::RenderedPosition::prevLeafChild const): Deleted.
(WebCore::RenderedPosition::nextLeafChild const): Deleted.

  • editing/RenderedPosition.h:

(WebCore::RenderedPosition::RenderedPosition):

  • editing/VisiblePosition.cpp:

(WebCore::VisiblePosition::leftVisuallyDistinctCandidate const):
(WebCore::VisiblePosition::rightVisuallyDistinctCandidate const):

  • editing/VisibleUnits.cpp:

(WebCore::startPositionForLine):
(WebCore::endPositionForLine):
(WebCore::previousLinePosition):
(WebCore::nextLinePosition):

  • layout/Verification.cpp:

(WebCore::Layout::collectFlowBoxSubtree):

  • rendering/ComplexLineLayout.cpp:

(WebCore::ComplexLineLayout::updateRubyForJustifiedText):
(WebCore::expansionBehaviorForInlineTextBox):
(WebCore::ComplexLineLayout::computeInlineDirectionPositionsForSegment):
(WebCore::ComplexLineLayout::layoutRunsAndFloats):

  • rendering/InlineBox.cpp:

(WebCore::InlineBox::previousOnLineExists const):
(WebCore::InlineBox::nextLeafOnLine const):
(WebCore::InlineBox::previousLeafOnLine const):
(WebCore::InlineBox::nextLeafOnLineIgnoringLineBreak const):
(WebCore::InlineBox::previousLeafOnLineIgnoringLineBreak const):
(WebCore::InlineBox::nextLeafChild const): Deleted.
(WebCore::InlineBox::prevLeafChild const): Deleted.
(WebCore::InlineBox::nextLeafChildIgnoringLineBreak const): Deleted.
(WebCore::InlineBox::prevLeafChildIgnoringLineBreak const): Deleted.

  • rendering/InlineBox.h:

(WebCore::InlineBox::nextOnLine const):
(WebCore::InlineBox::previousOnLine const):
(WebCore::InlineBox::setNextOnLine):
(WebCore::InlineBox::setPreviousOnLine):
(WebCore::InlineBox::InlineBox):
(WebCore::InlineBox::prevOnLine const): Deleted.
(WebCore::InlineBox::setPrevOnLine): Deleted.

  • rendering/InlineFlowBox.cpp:

(WebCore::InlineFlowBox::addToLine):
(WebCore::InlineFlowBox::removeChild):
(WebCore::InlineFlowBox::nodeAtPoint):
(WebCore::InlineFlowBox::firstLeafDescendant const):
(WebCore::InlineFlowBox::lastLeafDescendant const):
(WebCore::InlineFlowBox::placeEllipsisBox):
(WebCore::InlineFlowBox::collectLeafBoxesInLogicalOrder const):
(WebCore::InlineFlowBox::checkConsistency const):
(WebCore::InlineFlowBox::firstLeafChild const): Deleted.
(WebCore::InlineFlowBox::lastLeafChild const): Deleted.

  • rendering/InlineFlowBox.h:
  • rendering/InlineTextBox.cpp:

(WebCore::InlineTextBox::expansionBehavior const):

  • rendering/RenderBlockFlow.cpp:

(WebCore::RenderBlockFlow::containsNonZeroBidiLevel const):
(WebCore::RenderBlockFlow::positionForPointWithInlineChildren):

  • rendering/RenderCounter.cpp:

(WebCore::RenderCounter::rendererRemovedFromTree):

  • rendering/RenderTextLineBoxes.cpp:

(WebCore::lineDirectionPointFitsInBox):
(WebCore::createVisiblePositionAfterAdjustingOffsetForBiDi):
(WebCore::RenderTextLineBoxes::positionForPoint const):

  • rendering/RootInlineBox.cpp:

(WebCore::RootInlineBox::isHyphenated const):
(WebCore::RootInlineBox::lineSelectionGap):
(WebCore::RootInlineBox::selectionState):
(WebCore::RootInlineBox::firstSelectedBox):
(WebCore::RootInlineBox::lastSelectedBox):
(WebCore::RootInlineBox::closestLeafChildForLogicalLeftPosition):

  • rendering/svg/SVGRootInlineBox.cpp:

(WebCore::SVGRootInlineBox::closestLeafChildForPosition):
(WebCore::SVGRootInlineBox::nodeAtPoint):

3:11 AM Changeset in webkit [250340] by guijemont@igalia.com
  • 2 edits in trunk/Source/JavaScriptCore

testapi: slow devices need more time before watchdog fires
https://bugs.webkit.org/show_bug.cgi?id=202149

Reviewed by Mark Lam.

In testExecutionTimeLimit(), the time that we leave for the watchdog
to fire is often not enough on (slower) arm and mips devices, creating
a testapi failure.
This change also skips FTL-specific testing when FTL is disabled.

  • API/tests/ExecutionTimeLimitTest.cpp:

(testExecutionTimeLimit):

2:47 AM Changeset in webkit [250339] by zandobersek@gmail.com
  • 8 edits
    2 adds in trunk/Source/WebCore

[Nicosia] Add implementations for fixed, positioned, sticky ScrollingTreeNodes
https://bugs.webkit.org/show_bug.cgi?id=202100

Reviewed by Carlos Garcia Campos.

Fill in the Nicosia implementations for the ScrollingTreeFixedNode,
ScrollingTreePositionedNode and ScrollingTreeStickyNode classes.

The implementations in majority repeat what the Cocoa implementations
do, with the main difference being the Nicosia-specific layer state
application. Sharing more of this logic should be investigated in the
future.

  • PlatformPlayStation.cmake: Add ScrollingTreePositionedNode to build.
  • SourcesGTK.txt: Ditto.
  • SourcesWPE.txt: Ditto.
  • page/scrolling/nicosia/ScrollingTreeFixedNode.cpp:

(WebCore::ScrollingTreeFixedNode::commitStateBeforeChildren):
(WebCore::ScrollingTreeFixedNode::applyLayerPositions):
(WebCore::ScrollingTreeFixedNode::dumpProperties const):

  • page/scrolling/nicosia/ScrollingTreeFixedNode.h:
  • page/scrolling/nicosia/ScrollingTreePositionedNode.cpp: Added.

(WebCore::ScrollingTreePositionedNode::create):
(WebCore::ScrollingTreePositionedNode::ScrollingTreePositionedNode):
(WebCore::ScrollingTreePositionedNode::commitStateBeforeChildren):
(WebCore::ScrollingTreePositionedNode::applyLayerPositions):
(WebCore::ScrollingTreePositionedNode::dumpProperties const):

  • page/scrolling/nicosia/ScrollingTreePositionedNode.h: Added.

(WebCore::ScrollingTreePositionedNode::relatedOverflowScrollingNodes const):

  • page/scrolling/nicosia/ScrollingTreeStickyNode.cpp:

(WebCore::ScrollingTreeStickyNode::commitStateBeforeChildren):
(WebCore::ScrollingTreeStickyNode::applyLayerPositions):
(WebCore::ScrollingTreeStickyNode::dumpProperties const):
(WebCore::ScrollingTreeStickyNode::computeLayerPosition const):

  • page/scrolling/nicosia/ScrollingTreeStickyNode.h:
2:25 AM Changeset in webkit [250338] by Fujii Hironori
  • 2 edits in trunk/LayoutTests

Unreviewed test gardening for WinCairo port.

  • platform/wincairo/TestExpectations: Updated several tests.
12:40 AM Changeset in webkit [250337] by Fujii Hironori
  • 3 edits in trunk/LayoutTests

Layout Test http/tests/misc/bubble-drag-events.html is a flaky crash
https://bugs.webkit.org/show_bug.cgi?id=182130

Unreviewed test gardening for Windows ports.

It doesn't flaky crash these days for Windows ports.
<https://webkit-test-results.webkit.org/dashboards/flakiness_dashboard.html#tests=http%2Ftests%2Fmisc%2Fbubble-drag-events.html>

  • platform/win/TestExpectations:
  • platform/wincairo/TestExpectations:

Unmarked it.

12:27 AM Changeset in webkit [250336] by youenn@apple.com
  • 2 edits in trunk/Source/WebKit

Make IsNSURLSessionWebSocketEnabled an experimental flag
https://bugs.webkit.org/show_bug.cgi?id=202135

Reviewed by Geoffrey Garen.

  • Shared/WebPreferences.yaml:

Sep 24, 2019:

11:53 PM Changeset in webkit [250335] by graouts@webkit.org
  • 5 edits in trunk

[Web Animations] Removing an element should only cancel its declarative animations
https://bugs.webkit.org/show_bug.cgi?id=202165

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

Mark a WPT progression and a change in FAIL expectation in a test where we used to cancel an animation and now don't.

  • web-platform-tests/web-animations/animation-model/keyframe-effects/effect-value-context-expected.txt:
  • web-platform-tests/web-animations/timing-model/animations/canceling-an-animation-expected.txt:

Source/WebCore:

When an element is removed, an Animation created using the JS API should not be canceled.
Only declarative animations should be.

  • animation/AnimationTimeline.cpp:

(WebCore::AnimationTimeline::elementWasRemoved):

9:42 PM Changeset in webkit [250334] by Fujii Hironori
  • 2 edits in trunk/Source/WebKitLegacy/win

Remove SchemeRegistry's list of URL schemes allowing local storage in private browsing, which is unused
https://bugs.webkit.org/show_bug.cgi?id=202181

Unreviewed build fix for Windows ports.

..\..\Source\WebKitLegacy\win\WebView.cpp(7342): error C2039: 'registerURLSchemeAsAllowingLocalStorageAccessInPrivateBrowsing': is not a member of 'WebCore::SchemeRegistry'

  • WebView.cpp:

(WebView::registerURLSchemeAsAllowingLocalStorageAccessInPrivateBrowsing): Removed calling the removed function.

9:11 PM Changeset in webkit [250333] by commit-queue@webkit.org
  • 5 edits in trunk/Source

Remove SchemeRegistry's list of URL schemes allowing local storage in private browsing, which is unused
https://bugs.webkit.org/show_bug.cgi?id=202181

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

Source/WebCore:

The last use of the WebView SPI to set it is being removed in rdar://problem/55685383
but it already does not do anything. Let's remove it.

  • platform/SchemeRegistry.cpp:

(WebCore::schemesAllowingLocalStorageAccessInPrivateBrowsing): Deleted.
(WebCore::SchemeRegistry::registerURLSchemeAsAllowingLocalStorageAccessInPrivateBrowsing): Deleted.
(WebCore::SchemeRegistry::allowsLocalStorageAccessInPrivateBrowsing): Deleted.

  • platform/SchemeRegistry.h:

Source/WebKitLegacy/mac:

  • WebView/WebView.mm:

(+[WebView _registerURLSchemeAsAllowingLocalStorageAccessInPrivateBrowsing:]):

8:45 PM Changeset in webkit [250332] by mitz@apple.com
  • 8 copies
    1 add in releases/Apple/iOS 13.1

Added a tag for iOS 13.1.

8:43 PM Changeset in webkit [250331] by mitz@apple.com
  • 9 copies
    1 add in releases/Apple/Safari 13.0.1

Added a tag for Safari 13.0.1.

8:15 PM Changeset in webkit [250330] by Fujii Hironori
  • 4 edits
    1 move
    1 delete in trunk

[Windows][webkitpy] _apache_config_file_name_for_platform should take the system PHP version into account
https://bugs.webkit.org/show_bug.cgi?id=202134

Reviewed by Jonathan Bedard.

Tools:

_apache_config_file_name_for_platform always returns a config file
name for PHP5 on Cygwin Python, one for PHP7 on Win32 Python. It
should detect the system PHP version as Linux ports do.

Both AppleWin and WinCairo are using XAMPP Apache. Unify the code
paths for them. And, remove a stale conf file.

This change makes it possible to use Cygwin Python with PHP7.

  • Scripts/webkitpy/port/base.py:

(Port._win_php_version): Added.
(Port._apache_config_file_name_for_platform): Unified cygwin and
win32 code path by using _win_php_version.

  • Scripts/webkitpy/port/port_testcase.py:

(test_apache_config_file_name_for_platform): Updated cygwin and
win32 test cases.

LayoutTests:

  • http/conf/cygwin-httpd.conf: Removed a stale conf file.
  • http/conf/win-httpd-2.4-php5.conf: Renamed from LayoutTests/http/conf/apache2.4-httpd-win.conf.
6:56 PM Changeset in webkit [250329] by Chris Dumez
  • 4 edits in trunk/Source/WebKit

[iOS] Regression(r249703) frequent 'kill() returned unexpected error' log messages
https://bugs.webkit.org/show_bug.cgi?id=202173

Reviewed by Geoffrey Garen.

The kill(pid, 0) command actually fails with an EPERM error when there is a process
running with the given pid, and this is causing us to log a lot of errors. The good
news is that we merely want to know that there is no process with the given PID and
we correctly get a ESRCH error in this case. I renamed the function from
isRunningProcessPID() to wasTerminated() and only check for ESRCH error now. I no
longer log any error otherwise since this is expected.

Also, for performance reason, I no longer call kill(pid, 0) from inside
AuxiliaryProcessProxy::state() as it gets called a lot. I instead only call it from
AuxiliaryProcessProxy::wasTerminated() and call it from
WebProcessPool::tryTakePrewarmedProcess().

  • UIProcess/AuxiliaryProcessProxy.cpp:

(WebKit::AuxiliaryProcessProxy::state const):
(WebKit::AuxiliaryProcessProxy::wasTerminated const):
(WebKit::AuxiliaryProcessProxy::isRunningProcessPID): Deleted.

  • UIProcess/AuxiliaryProcessProxy.h:
  • UIProcess/WebProcessPool.cpp:

(WebKit::WebProcessPool::tryTakePrewarmedProcess):

6:46 PM Changeset in webkit [250328] by chris.reid@sony.com
  • 9 edits in trunk/Source

[WinCairo] Start RemoteInspectorServer
https://bugs.webkit.org/show_bug.cgi?id=199938
<rdar://problem/53323048>

Reviewed by Fujii Hironori.

Source/JavaScriptCore:

  • inspector/remote/socket/RemoteInspectorSocket.cpp:
  • inspector/remote/socket/win/RemoteInspectorSocketWin.cpp:
    • Fixed some network byte order issues
    • Need to check for POLLHUP in isReadable as closed windows sockets don't have POLLIN set

Source/WebKit:

Enable the remote inspector client on WinCairo.
The inspector server will run if the WEBKIT_INSPECTOR_SERVER environment variable is set.
WEBKIT_INSPECTOR_SERVER needs to be set in the form of <ip>:port e.g. WEBKIT_INSPECTOR_SERVER=127.0.0.1:1234.

Updated the protocol handler to update the target list with DOM manipulation.

  • UIProcess/socket/RemoteInspectorClient.cpp:
  • UIProcess/socket/RemoteInspectorClient.h:
  • UIProcess/socket/RemoteInspectorProtocolHandler.cpp:
  • UIProcess/socket/RemoteInspectorProtocolHandler.h:
  • UIProcess/win/WebView.cpp:
6:30 PM Changeset in webkit [250327] by Matt Lewis
  • 4 edits in trunk/Tools

Bring up queues for iPadOS Simulator Tests
https://bugs.webkit.org/show_bug.cgi?id=202151

Reviewed by Jonathan Bedard.

  • BuildSlaveSupport/build.webkit.org-config/config.json:
  • BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/WebKitBuildbot.js:

(WebKitBuildbot):

  • BuildSlaveSupport/build.webkit.org-config/steps_unittest.py:
5:14 PM Changeset in webkit [250326] by Wenson Hsieh
  • 4 edits in trunk/Source/WebCore

Remove a content change observation quirk on united.com
https://bugs.webkit.org/show_bug.cgi?id=202175

Reviewed by Tim Horton.

Remove a site-specific quirk that is no longer necessary.

  • page/Quirks.cpp:

(WebCore::Quirks::shouldIgnoreContentChange const): Deleted.

  • page/Quirks.h:
  • page/ios/ContentChangeObserver.cpp:

(WebCore::ContentChangeObserver::shouldObserveVisibilityChangeForElement):

5:13 PM Changeset in webkit [250325] by Keith Rollin
  • 2 edits in trunk/Source/bmalloc

Address static analysis warning in Allocator.cpp: Null pointer argument in call to memory copy function
https://bugs.webkit.org/show_bug.cgi?id=202152
<rdar://problem/55671444>

Reviewed by Geoffrey Garen.

Xcode's static analysis facility flags the following:

.../OpenSource/Source/bmalloc/bmalloc/Allocator.cpp:98:5: warning: Null pointer argument in call to memory copy function

memcpy(result, object, copySize);
~

https://en.cppreference.com/w/cpp/string/byte/memcpy explains that
this is undefined behavior:

"If either dest or src is a null pointer, the behavior is

undefined, even if count is zero."

I suppose that passing in a null source pointer could be bad if the
implementation fetched the first source byte to copy before actually
checking the number of bytes to copy. So far, it doesn’t seem to be an
issue, but we should clean this up.

Simply adding "if (result && object)" before the memcpy will add tests
and branches in the hot path of this function and so might not be the
best solution. Instead, straighten out the code a little bit by
putting an early check and return on "object". This also allows us to
remove some intermediate code.

  • bmalloc/Allocator.cpp:

(bmalloc::Allocator::reallocateImpl):

4:54 PM Changeset in webkit [250324] by commit-queue@webkit.org
  • 29 edits
    128 adds in trunk

Source/WebCore:
Enable LayoutTests using ResourceLoadStatistics SQLite backend (195420)
https://bugs.webkit.org/show_bug.cgi?id=195420
<rdar://problem/54213551>

Patch by Kate Cheney <Kate Cheney> on 2019-09-24
Reviewed by Brent Fulgham.

Tests: http/tests/resourceLoadStatistics/add-blocking-to-redirect-database.html

http/tests/resourceLoadStatistics/blocking-in-web-worker-script-import-database.html
http/tests/resourceLoadStatistics/cap-cache-max-age-for-prevalent-resource-database.html
http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-database.html
http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-decoration-same-site-database.html
http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-fragment-from-prevalent-resource-database.html
http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-query-and-fragment-from-prevalent-resource-database.html
http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-query-from-prevalent-resource-database.html
http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-without-link-decoration-from-prevalent-resource-database.html
http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-mixed-statistics-database.html
http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-sub-frame-under-top-frame-origins-database.html
http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-under-top-frame-origins-database.html
http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-unique-redirects-to-database.html
http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-mixed-statistics-database.html
http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-sub-frame-under-top-frame-origins-database.html
http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-redirect-collusion-database.html
http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-redirect-to-prevalent-database.html
http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-under-top-frame-origins-database.html
http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-unique-redirects-to-database.html
http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-redirect-collusion-database.html
http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-redirect-to-prevalent-database.html
http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-unique-redirects-to-database.html
http/tests/resourceLoadStatistics/classify-as-very-prevalent-based-on-mixed-statistics-database.html
http/tests/resourceLoadStatistics/clear-in-memory-and-persistent-store-database.html
http/tests/resourceLoadStatistics/clear-in-memory-and-persistent-store-one-hour-database.html
http/tests/resourceLoadStatistics/cookie-deletion-database.html
http/tests/resourceLoadStatistics/cookies-with-and-without-user-interaction-database.html
http/tests/resourceLoadStatistics/delete-script-accessible-cookies-database.html
http/tests/resourceLoadStatistics/do-not-block-top-level-navigation-redirect-database.html
http/tests/resourceLoadStatistics/do-not-capture-statistics-for-simple-top-navigations-database.html
http/tests/resourceLoadStatistics/do-not-remove-blocking-in-redirect-database.html
http/tests/resourceLoadStatistics/do-not-switch-session-on-navigation-to-prevalent-without-interaction-database.html
http/tests/resourceLoadStatistics/downgraded-referrer-for-navigation-with-link-query-from-prevalent-resource-database.html
http/tests/resourceLoadStatistics/enable-debug-mode-database.html
http/tests/resourceLoadStatistics/grandfathering-database.html
http/tests/resourceLoadStatistics/non-prevalent-resource-with-user-interaction-database.html
http/tests/resourceLoadStatistics/non-prevalent-resource-without-user-interaction-database.html
http/tests/resourceLoadStatistics/non-prevalent-resources-can-access-cookies-in-a-third-party-context-database.html
http/tests/resourceLoadStatistics/non-sandboxed-iframe-redirect-ip-to-localhost-to-ip-database.html
http/tests/resourceLoadStatistics/non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database.html
http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-ip-to-localhost-to-ip-database.html
http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database.html
http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-ip-to-localhost-to-ip-database.html
http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database.html
http/tests/resourceLoadStatistics/ping-to-prevalent-resource-database.html
http/tests/resourceLoadStatistics/prevalent-resource-handled-keydown-database.html
http/tests/resourceLoadStatistics/prevalent-resource-unhandled-keydown-database.html
http/tests/resourceLoadStatistics/prevalent-resource-with-user-interaction-database.html
http/tests/resourceLoadStatistics/prevalent-resource-with-user-interaction-timeout-database.html
http/tests/resourceLoadStatistics/prevalent-resource-without-user-interaction-database.html
http/tests/resourceLoadStatistics/prune-statistics-database.html
http/tests/resourceLoadStatistics/sandboxed-iframe-redirect-ip-to-localhost-to-ip-database.html
http/tests/resourceLoadStatistics/sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database.html
http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-ip-to-localhost-to-ip-database.html
http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database.html
http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-ip-to-localhost-to-ip-database.html
http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database.html
http/tests/resourceLoadStatistics/set-custom-prevalent-resource-in-debug-mode-database.html
http/tests/resourceLoadStatistics/strip-referrer-to-origin-for-prevalent-subresource-redirects-database.html
http/tests/resourceLoadStatistics/strip-referrer-to-origin-for-prevalent-subresource-requests-database.html
http/tests/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-with-interaction-database.html
http/tests/resourceLoadStatistics/user-interaction-in-cross-origin-sub-frame-database.html
http/tests/resourceLoadStatistics/user-interaction-only-reported-once-within-short-period-of-time-database.html
http/tests/resourceLoadStatistics/user-interaction-reported-after-website-data-removal-database.html

  • platform/sql/SQLiteDatabase.h:

Added WEBCORE_EXPORT prefix to 2 functions needed in the ITP Database
to clear out the database.

Source/WebKit:
Enable LayoutTests using ResourceLoadStatistics SQLite backend (195420)
https://bugs.webkit.org/show_bug.cgi?id=195420
<rdar://problem/54213551>

Patch by Kate Cheney <Kate Cheney> on 2019-09-24
Reviewed by Brent Fulgham.

Changed all RELEASE_LOG_ERROR() calls involving domain strings to
RELEASE_LOG_ERROR_IF_ALLOWED() to prevent leaking information about
the domain strings only if sessionID.isAlwaysOnLoggingAllowed().

  • NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:

(WebKit::ResourceLoadStatisticsDatabaseStore::ResourceLoadStatisticsDatabaseStore):
Added autovacuuming to the constructor to avoid manually calling
runVacuumCommand(). Changed constructor to take in sessionID so it
can use RELEASE_LOG_ERROR_IF_ALLOWED which requires the sessionID.

(WebKit::ResourceLoadStatisticsDatabaseStore::prepareStatements):
Added 2 statements that were not being prepared.

(WebKit::ResourceLoadStatisticsDatabaseStore::relationshipExists const):
Corrected incorrect capitalization. Added check for nullopt in case
domainID is for a domain not in the database yet.

(WebKit::ResourceLoadStatisticsDatabaseStore::domainID const):
Changed return value to Optional<unsigned>. Some tests were directly
checking for subframes under top frame domains on domains that had
not been inserted yet. Now, domainID() won't crash but will return
a nullopt value which can be checked to know that the tests failed.

(WebKit::ResourceLoadStatisticsDatabaseStore::insertDomainRelationships):
Added a check to assure domainID exists and updated the domainID
interactions to work as Optionals.

(WebKit::ResourceLoadStatisticsDatabaseStore::populateFromMemoryStore):
Moved the prepareStatements() call after the vacuum command in the case
where the database is empty. Otherwise called it before returning.

(WebKit::ResourceLoadStatisticsDatabaseStore::recursivelyFindNonPrevalentDomainsThatRedirectedToThisDomain):
Added a space to the SQL commands to correct the syntax.

(WebKit::ResourceLoadStatisticsDatabaseStore::findNotVeryPrevalentResources):
Corrected a bug in the SQL command for querying
subframeUnderTopFrameDomain. The old query was asking for subresource.

(WebKit::ResourceLoadStatisticsDatabaseStore::reclassifyResources):
Spelling fix.

(WebKit::ResourceLoadStatisticsDatabaseStore::requestStorageAccess):
Changed string concatenation to binding.

(WebKit::ResourceLoadStatisticsDatabaseStore::grandfatherDataForDomains):
The grandfathering.html test was failing because domains were being
"set" to grandfathered in the database before being inserted. This fix
ensures all domains before setting the grandfathering flag.

(WebKit::ResourceLoadStatisticsDatabaseStore::logFrameNavigation):
Multiple tests were failing because the query to insert the relationship
for the source domain relies on the target domain being in the
ObservedDomains table. This patch ensures all domains are added before
performing the query.

(WebKit::ResourceLoadStatisticsDatabaseStore::setUserInteraction):
Added a != SQLITE_OK check to make sure an error is logged if the
statement fails to bind.

(WebKit::ResourceLoadStatisticsDatabaseStore::clearUserInteraction):
Changed string concatenation to binding.

(WebKit::ResourceLoadStatisticsDatabaseStore::hasHadUserInteraction):
The SQL statement was being bound to a value and not being reset. This
patch resets the statement after binding. Additionally, the step()
function was being compared to SQLITE_DONE instead of SQLITE_ROW,
causing an error if the query returned results. The
ASSERT_NOT_REACHED() was causing null searches to crash instead of
returning false (i.e. if a domain is not in the database it should
return that it has no user interaction instead of crashing).

(WebKit::ResourceLoadStatisticsDatabaseStore::setPrevalentResource):
Updated domainID call to act as an Optional.

(WebKit::ResourceLoadStatisticsDatabaseStore::predicateValueForDomain const):
The SQL statement was being bound to a value and not being reset. This
patch resets the statement after binding. SQLITE_DONE changed to
SQLITE_ROW to return non-empty query results. ASSERT_NOT_REACHED()
removed for the same reasons as above.

(WebKit::ResourceLoadStatisticsDatabaseStore::ensureResourceStatisticsForRegistrableDomain):
Fixed the release log statement which was logging the wrong function
name.

(WebKit::ResourceLoadStatisticsDatabaseStore::clearDatabaseContents):
Clears the database and rebuilds the tables on a clear command to
match the functionality in the Memory Store.

(WebKit::ResourceLoadStatisticsDatabaseStore::clear):
Call the clearDatabaseContents function to match the functionality
in the Memory Store.

(WebKit::ResourceLoadStatisticsDatabaseStore::hasUserGrantedStorageAccessThroughPrompt const):
Updated domainID call to act as an Optional.

(WebKit::ResourceLoadStatisticsDatabaseStore::hasHadUnexpiredRecentUserInteraction):
Tests were failing because shouldRemoveAllWebsiteDataFor() was not
checking for expired user interaction. Matched functionality in the
Memory Store.

(WebKit::ResourceLoadStatisticsDatabaseStore::shouldRemoveAllWebsiteDataFor):
Tests were failing because shouldRemoveAllWebsiteDataFor() was not
checking for expired user interaction. Matched functionality in the
Memory Store.

(WebKit::ResourceLoadStatisticsDatabaseStore::registrableDomainsToRemoveWebsiteDataFor):
Spelling fix.

(WebKit::ResourceLoadStatisticsDatabaseStore::pruneStatisticsIfNeeded):
Last seen should be sorted in ascending order because you want to
prune the older statistics first, which will have a lower lastSeen
field (secondsSinceEpoch() will be lower for older values).

(WebKit::ResourceLoadStatisticsDatabaseStore::shouldRemoveAllWebsiteDataFor const): Deleted.
Deleted const specifier because the function needs to clear the
database.

  • NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:

Declared new functions. Updated spelling error (registerable -->
registrable). Updated constructor to take sessionID.

  • NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:

(WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
ITP database flag now is stored in the NetworkProcess.

  • NetworkProcess/NetworkProcess.cpp:

(WebKit::NetworkProcess::initializeNetworkProcess):
Set the ITP database flag which is now stored in the Network Process.

(WebKit::NetworkProcess::addWebsiteDataStore):
SandboxExtension::consumePermanently was not getting called on the
WebKitTestRunner resourceLoadStatistics path. This was preventing
the database file from opening.

(WebKit::NetworkProcess::setUseITPDatabase):

  • NetworkProcess/NetworkProcess.h:

(WebKit::NetworkProcess::isITPDatabaseEnabled const):

  • NetworkProcess/NetworkProcess.messages.in:

Passed the setUseITPDatabase flag to the initialization function
of the statistics store to enable the database backend.

  • NetworkProcess/NetworkSession.cpp:

(WebKit::NetworkSession::recreateResourceLoadStatisticStore):
Destroy old WebResourceLoadStatisticsStore and create a new one using
the ITP database.

  • NetworkProcess/NetworkSession.h:
  • UIProcess/API/C/WKWebsiteDataStoreRef.cpp:

(WKWebsiteDataStoreSetUseITPDatabase):

  • UIProcess/API/C/WKWebsiteDataStoreRef.h:
  • UIProcess/Network/NetworkProcessProxy.cpp:

(WebKit::NetworkProcessProxy::setUseITPDatabase):

  • UIProcess/Network/NetworkProcessProxy.h:
  • UIProcess/WebsiteData/WebsiteDataStore.cpp:

(WebKit::WebsiteDataStore::setUseITPDatabase):

  • UIProcess/WebsiteData/WebsiteDataStore.h:

Passed the setUseITPDatabase flag to the initialization function
of the statistics store to enable the database backend.

Tools:
Enable LayoutTests using ResourceLoadStatistics SQLite backend (195420)
https://bugs.webkit.org/show_bug.cgi?id=195420
<rdar://problem/54213551>

Patch by Kate Cheney <Kate Cheney> on 2019-09-24
Reviewed by Brent Fulgham.

Added in logic to send a message from the UIProcess to the Network
Process which will initalize the ITP Database backend to allow for
layout testing.

  • WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
  • WebKitTestRunner/InjectedBundle/TestRunner.cpp:

(WTR::TestRunner::setUseITPDatabase):

  • WebKitTestRunner/InjectedBundle/TestRunner.h:
  • WebKitTestRunner/TestController.cpp:

(WTR::TestController::setUseITPDatabase):

  • WebKitTestRunner/TestController.h:
  • WebKitTestRunner/TestInvocation.cpp:

(WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle):

LayoutTests:
Enable LayoutTests using ResourceLoadStatistics SQLite backend (195420)
https://bugs.webkit.org/show_bug.cgi?id=195420
<rdar://problem/54213551>

Added a flag to all ITP tests to enable the ITP database backend to
allow for testing functionality against the memory store. Tests were
not created for telemetry-generation.html,
log-cross-site-load-with-link-decoration.html, or
website-data-removal-for-site-navigated-to-with-link-decoration.html,
because these rely on functions not yet implemented in the ITP database.
Additionally, added flags to some memory store tests to ensure they
are using the memory store before calling functions not implemented in
the database store yet.

Patch by Kate Cheney <Kate Cheney> on 2019-09-24
Reviewed by Brent Fulgham.

  • http/tests/resourceLoadStatistics/add-blocking-to-redirect-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/add-blocking-to-redirect-database.html: Added.
  • http/tests/resourceLoadStatistics/blocking-in-web-worker-script-import-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/blocking-in-web-worker-script-import-database.html: Added.
  • http/tests/resourceLoadStatistics/cap-cache-max-age-for-prevalent-resource-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/cap-cache-max-age-for-prevalent-resource-database.html: Added.
  • http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-database.html: Added.
  • http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-decoration-same-site-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-decoration-same-site-database.html: Added.
  • http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-fragment-from-prevalent-resource-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-fragment-from-prevalent-resource-database.html: Added.
  • http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-query-and-fragment-from-prevalent-resource-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-query-and-fragment-from-prevalent-resource-database.html: Added.
  • http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-query-from-prevalent-resource-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-query-from-prevalent-resource-database.html: Added.
  • http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-without-link-decoration-from-prevalent-resource-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-without-link-decoration-from-prevalent-resource-database.html: Added.
  • http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-mixed-statistics-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-mixed-statistics-database.html: Added.
  • http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-sub-frame-under-top-frame-origins-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-sub-frame-under-top-frame-origins-database.html: Added.
  • http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-under-top-frame-origins-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-under-top-frame-origins-database.html: Added.
  • http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-unique-redirects-to-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-unique-redirects-to-database.html: Added.
  • http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-mixed-statistics-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-mixed-statistics-database.html: Added.
  • http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-sub-frame-under-top-frame-origins-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-sub-frame-under-top-frame-origins-database.html: Added.
  • http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-redirect-collusion-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-redirect-collusion-database.html: Added.
  • http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-redirect-to-prevalent-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-redirect-to-prevalent-database.html: Added.
  • http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-under-top-frame-origins-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-under-top-frame-origins-database.html: Added.
  • http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-unique-redirects-to-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-unique-redirects-to-database.html: Added.
  • http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-redirect-collusion-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-redirect-collusion-database.html: Added.
  • http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-redirect-to-prevalent-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-redirect-to-prevalent-database.html: Added.
  • http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-unique-redirects-to-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-unique-redirects-to-database.html: Added.
  • http/tests/resourceLoadStatistics/classify-as-very-prevalent-based-on-mixed-statistics-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/classify-as-very-prevalent-based-on-mixed-statistics-database.html: Added.
  • http/tests/resourceLoadStatistics/clear-in-memory-and-persistent-store-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/clear-in-memory-and-persistent-store-database.html: Added.
  • http/tests/resourceLoadStatistics/clear-in-memory-and-persistent-store-one-hour-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/clear-in-memory-and-persistent-store-one-hour-database.html: Added.
  • http/tests/resourceLoadStatistics/cookie-deletion-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/cookie-deletion-database.html: Added.
  • http/tests/resourceLoadStatistics/cookies-with-and-without-user-interaction-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/cookies-with-and-without-user-interaction-database.html: Added.
  • http/tests/resourceLoadStatistics/delete-script-accessible-cookies-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/delete-script-accessible-cookies-database.html: Added.
  • http/tests/resourceLoadStatistics/do-not-block-top-level-navigation-redirect-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/do-not-block-top-level-navigation-redirect-database.html: Added.
  • http/tests/resourceLoadStatistics/do-not-capture-statistics-for-simple-top-navigations-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/do-not-capture-statistics-for-simple-top-navigations-database.html: Added.
  • http/tests/resourceLoadStatistics/do-not-remove-blocking-in-redirect-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/do-not-remove-blocking-in-redirect-database.html: Added.
  • http/tests/resourceLoadStatistics/do-not-switch-session-on-navigation-to-prevalent-without-interaction-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/do-not-switch-session-on-navigation-to-prevalent-without-interaction-database.html: Added.
  • http/tests/resourceLoadStatistics/downgraded-referrer-for-navigation-with-link-query-from-prevalent-resource-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/downgraded-referrer-for-navigation-with-link-query-from-prevalent-resource-database.html: Added.
  • http/tests/resourceLoadStatistics/enable-debug-mode-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/enable-debug-mode-database.html: Added.
  • http/tests/resourceLoadStatistics/grandfathering-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/grandfathering-database.html: Added.
  • http/tests/resourceLoadStatistics/log-cross-site-load-with-link-decoration.html:
  • http/tests/resourceLoadStatistics/non-prevalent-resource-with-user-interaction-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/non-prevalent-resource-with-user-interaction-database.html: Added.
  • http/tests/resourceLoadStatistics/non-prevalent-resource-without-user-interaction-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/non-prevalent-resource-without-user-interaction-database.html: Added.
  • http/tests/resourceLoadStatistics/non-prevalent-resources-can-access-cookies-in-a-third-party-context-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/non-prevalent-resources-can-access-cookies-in-a-third-party-context-database.html: Added.
  • http/tests/resourceLoadStatistics/non-sandboxed-iframe-redirect-ip-to-localhost-to-ip-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/non-sandboxed-iframe-redirect-ip-to-localhost-to-ip-database.html: Added.
  • http/tests/resourceLoadStatistics/non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database.html: Added.
  • http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-ip-to-localhost-to-ip-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-ip-to-localhost-to-ip-database.html: Added.
  • http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database.html: Added.
  • http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-ip-to-localhost-to-ip-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-ip-to-localhost-to-ip-database.html: Added.
  • http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database.html: Added.
  • http/tests/resourceLoadStatistics/ping-to-prevalent-resource-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/ping-to-prevalent-resource-database.html: Added.
  • http/tests/resourceLoadStatistics/prevalent-resource-handled-keydown-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/prevalent-resource-handled-keydown-database.html: Added.
  • http/tests/resourceLoadStatistics/prevalent-resource-unhandled-keydown-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/prevalent-resource-unhandled-keydown-database.html: Added.
  • http/tests/resourceLoadStatistics/prevalent-resource-with-user-interaction-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/prevalent-resource-with-user-interaction-database.html: Added.
  • http/tests/resourceLoadStatistics/prevalent-resource-with-user-interaction-timeout-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/prevalent-resource-with-user-interaction-timeout-database.html: Added.
  • http/tests/resourceLoadStatistics/prevalent-resource-without-user-interaction-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/prevalent-resource-without-user-interaction-database.html: Added.
  • http/tests/resourceLoadStatistics/prune-statistics-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/prune-statistics-database.html: Added.
  • http/tests/resourceLoadStatistics/sandboxed-iframe-redirect-ip-to-localhost-to-ip-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/sandboxed-iframe-redirect-ip-to-localhost-to-ip-database.html: Added.
  • http/tests/resourceLoadStatistics/sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database.html: Added.
  • http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-ip-to-localhost-to-ip-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-ip-to-localhost-to-ip-database.html: Added.
  • http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database.html: Added.
  • http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-ip-to-localhost-to-ip-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-ip-to-localhost-to-ip-database.html: Added.
  • http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database.html: Added.
  • http/tests/resourceLoadStatistics/set-custom-prevalent-resource-in-debug-mode-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/set-custom-prevalent-resource-in-debug-mode-database.html: Added.
  • http/tests/resourceLoadStatistics/strip-referrer-to-origin-for-prevalent-subresource-redirects-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/strip-referrer-to-origin-for-prevalent-subresource-redirects-database.html: Added.
  • http/tests/resourceLoadStatistics/strip-referrer-to-origin-for-prevalent-subresource-requests-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/strip-referrer-to-origin-for-prevalent-subresource-requests-database.html: Added.
  • http/tests/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-with-interaction-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-with-interaction-database.html: Added.
  • http/tests/resourceLoadStatistics/telemetry-generation.html:
  • http/tests/resourceLoadStatistics/user-interaction-in-cross-origin-sub-frame-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/user-interaction-in-cross-origin-sub-frame-database.html: Added.
  • http/tests/resourceLoadStatistics/user-interaction-only-reported-once-within-short-period-of-time-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/user-interaction-only-reported-once-within-short-period-of-time-database.html: Added.
  • http/tests/resourceLoadStatistics/user-interaction-reported-after-website-data-removal-database-expected.txt: Added.
  • http/tests/resourceLoadStatistics/user-interaction-reported-after-website-data-removal-database.html: Added.
  • http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-with-link-decoration.html:
  • platform/ios/TestExpectations:

Added test expectations to skip database tests which do not work in
ios because of reliance on EventSender.keydown() which is not
supported on iOS and also those which use UIHelper.activateAt() which
does not produce a user gesture captured by ITP in iOS.

4:53 PM Changeset in webkit [250323] by commit-queue@webkit.org
  • 4 edits in trunk

[ES6] Come up with a test for Proxy.GetOwnProperty? that tests the isExtensible error when the result of the trap is undefined
https://bugs.webkit.org/show_bug.cgi?id=154376

Patch by Alexey Shvayka <Alexey Shvayka> on 2019-09-24
Reviewed by Ross Kirsling.

JSTests:

Adds 2 test cases:

  1. If GetOwnProperty? trap result is undefined and Proxy's target is non-extensible, TypeError is thrown.
  2. If GetOwnProperty? trap result is undefined and Proxy's target is another Proxy, its "isExtensible" trap is called.
  • stress/proxy-get-own-property.js:

Source/JavaScriptCore:

  • runtime/ProxyObject.cpp:

(JSC::ProxyObject::performInternalMethodGetOwnProperty): Remove resolved FIXME comments.

4:51 PM Changeset in webkit [250322] by Patrick Griffis
  • 2 edits in trunk/Tools

Add Patrick Griffis to contributors.json

Unreviewed.

  • Scripts/webkitpy/common/config/contributors.json:
4:35 PM Changeset in webkit [250321] by achristensen@apple.com
  • 4 edits in trunk/Source/WebKit

Make iOS WebProcessPool directory getters static
https://bugs.webkit.org/show_bug.cgi?id=202157

Reviewed by Tim Horton.

No change in behavior. This just cuts another dependency the NetworkProcessProxy has on its owning WebProcessPool.

  • UIProcess/Cocoa/WebProcessPoolCocoa.mm:

(WebKit::WebProcessPool::cookieStorageDirectory):
(WebKit::WebProcessPool::platformResolvePathsForSandboxExtensions):
(WebKit::WebProcessPool::parentBundleDirectory):
(WebKit::WebProcessPool::networkingCachesDirectory):
(WebKit::WebProcessPool::webContentCachesDirectory):
(WebKit::WebProcessPool::containerTemporaryDirectory):
(WebKit::WebProcessPool::cookieStorageDirectory const): Deleted.
(WebKit::WebProcessPool::parentBundleDirectory const): Deleted.
(WebKit::WebProcessPool::networkingCachesDirectory const): Deleted.
(WebKit::WebProcessPool::webContentCachesDirectory const): Deleted.
(WebKit::WebProcessPool::containerTemporaryDirectory const): Deleted.

  • UIProcess/WebProcessPool.cpp:

(WebKit::WebProcessPool::ensureNetworkProcess):

  • UIProcess/WebProcessPool.h:
4:32 PM Changeset in webkit [250320] by Patrick Griffis
  • 2 edits in trunk/Source/WebKit

[GTK][WPE] Minor code cleanup in BubblewrapLauncher
https://bugs.webkit.org/show_bug.cgi?id=201906

This just cleans up string handling and some
whitespace fixes.

Reviewed by Carlos Garcia Campos.

  • UIProcess/Launcher/glib/BubblewrapLauncher.cpp:

(WebKit::XDGDBusProxyLauncher::setAddress):
(WebKit::XDGDBusProxyLauncher::launch):
(WebKit::XDGDBusProxyLauncher::makeProxyPath):
(WebKit::XDGDBusProxyLauncher::dbusAddressToPath):

2:33 PM Changeset in webkit [250319] by Chris Dumez
  • 2 edits in trunk/Source/WebCore

Stop sampling PageCache-related AggD data
https://bugs.webkit.org/show_bug.cgi?id=202161

Reviewed by Geoffrey Garen.

Stop sampling PageCache-related AggD data to make it more actionable.

  • history/PageCache.cpp:

(WebCore::logPageCacheFailureDiagnosticMessage):
(WebCore::canCacheFrame):
(WebCore::canCachePage):

2:27 PM Changeset in webkit [250318] by aakash_jain@apple.com
  • 3 edits in trunk/Tools

[ews-build] Improve summary for Validate Patch step
https://bugs.webkit.org/show_bug.cgi?id=202163

Reviewed by Jonathan Bedard.

  • BuildSlaveSupport/ews-app/ews/views/statusbubble.py: Remove the redundant message saying:

'Some messages were logged while the patch was still eligible'.

  • BuildSlaveSupport/ews-build/steps.py:

(ValidatePatch.skip_build): Updated the descritionDone with the reason to skip the patch.
(ValidatePatch.getResultSummary): Overrode this method so as to prevent buildbot from automatically
appending '(failure)' at the end of the summary string.

2:11 PM Changeset in webkit [250317] by sihui_liu@apple.com
  • 4 edits in trunk/Source/WebCore

Stop refing UniqueIDBDatabaseTransaction in callbacks
https://bugs.webkit.org/show_bug.cgi?id=202074

Reviewed by Youenn Fablet.

After quota check is introduced to IDB, callbacks that take the ref of UniqueIDBDatabaseTransaction will be
passed to StorageQuotaManager. This can make UniqueIDBDatabaseTransaction live longer than UniqueIDBDatabase.

  • Modules/indexeddb/server/UniqueIDBDatabase.cpp:

(WebCore::IDBServer::UniqueIDBDatabase::requestSpace):
(WebCore::IDBServer::UniqueIDBDatabase::waitForRequestSpaceCompletion):
(WebCore::IDBServer::UniqueIDBDatabase::createObjectStore):
(WebCore::IDBServer::UniqueIDBDatabase::deleteObjectStore):
(WebCore::IDBServer::UniqueIDBDatabase::renameObjectStore):
(WebCore::IDBServer::UniqueIDBDatabase::clearObjectStore):
(WebCore::IDBServer::UniqueIDBDatabase::createIndex):
(WebCore::IDBServer::UniqueIDBDatabase::deleteIndex):
(WebCore::IDBServer::UniqueIDBDatabase::renameIndex):
(WebCore::IDBServer::UniqueIDBDatabase::putOrAdd):
(WebCore::IDBServer::UniqueIDBDatabase::getRecord):
(WebCore::IDBServer::UniqueIDBDatabase::getAllRecords):
(WebCore::IDBServer::UniqueIDBDatabase::getCount):
(WebCore::IDBServer::UniqueIDBDatabase::deleteRecord):
(WebCore::IDBServer::UniqueIDBDatabase::openCursor):
(WebCore::IDBServer::UniqueIDBDatabase::iterateCursor):
(WebCore::IDBServer::UniqueIDBDatabase::commitTransaction):
(WebCore::IDBServer::UniqueIDBDatabase::abortTransaction):

  • Modules/indexeddb/server/UniqueIDBDatabase.h:
  • Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:

(WebCore::IDBServer::UniqueIDBDatabaseTransaction::abort):
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::commit):
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::createObjectStore):
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::deleteObjectStore):
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::renameObjectStore):
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::clearObjectStore):
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::createIndex):
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::deleteIndex):
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::renameIndex):
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::putOrAdd):
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::getRecord):
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::getAllRecords):
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::getCount):
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::deleteRecord):
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::openCursor):
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::iterateCursor):

1:30 PM Changeset in webkit [250316] by Kocsen Chung
  • 1 edit in branches/safari-608-branch/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm

Build fix after r250255. rdar://problem/55644665.

1:06 PM Changeset in webkit [250315] by Alan Bujtas
  • 8 edits
    9 adds in trunk

[iPadOs] The second click event is missing on double tap when dblclick handler is not present
https://bugs.webkit.org/show_bug.cgi?id=202006
<rdar://problem/51706828>

Reviewed by Wenson Hsieh.

Source/WebKit:

While double tapping,

  1. the first tap triggers a click event through the normal _singleTapIdentified/_singleTapRecognized codepath.
  2. and the second tap should trigger either a second single click event or a second single click followed by a dblclick event when dblclick handler is present.

However the second click is dropped on the floor when the node under the cursor does not have a dblclick handler (see handleDoubleTapForDoubleClickAtPoint()) -so we end up sending one click event.

This patch fixes this case by sending the second tap through the normal single tap flow when the dblclick handler is not present.

  • Shared/ios/InteractionInformationAtPosition.h:
  • Shared/ios/InteractionInformationAtPosition.mm:

(WebKit::InteractionInformationAtPosition::encode const):
(WebKit::InteractionInformationAtPosition::decode):

  • UIProcess/ios/WKContentViewInteraction.h:
  • UIProcess/ios/WKContentViewInteraction.mm:

(-[WKContentView setupInteraction]):
(-[WKContentView gestureRecognizerShouldBegin:]):
(WebKit::WebPage::positionInformation):
(WebKit::WebPage::requestPositionInformation):

LayoutTests:

  • fast/events/touch/ios/double-tap-for-two-clicks1-expected.txt: Added.
  • fast/events/touch/ios/double-tap-for-two-clicks1.html: Added.
  • fast/events/touch/ios/double-tap-for-two-clicks2-expected.txt: Added.
  • fast/events/touch/ios/double-tap-for-two-clicks2.html: Added.
  • fast/events/touch/ios/double-tap-for-two-clicks3-expected.txt: Added.
  • fast/events/touch/ios/double-tap-for-two-clicks3.html: Added.
  • fast/events/touch/ios/double-tap-for-two-clicks4-expected.txt: Added.
  • fast/events/touch/ios/double-tap-for-two-clicks4.html: Added.
  • fast/events/touch/ios/doubleclick.html: Added.
  • fast/events/touch/resources/doubleClickContent.html: Added.
12:22 PM Changeset in webkit [250314] by ap@apple.com
  • 3 edits in trunk/Source/JavaScriptCore

JavaScriptCore (still) doesn't unlock the engineering keychain
https://bugs.webkit.org/show_bug.cgi?id=202123

Reviewed by Dan Bernstein.

Unlike WebKit, JavaScriptCore only defines CODE_SIGN_IDENTITY in ToolExecutable
configuration, not in DebugRelease. As a result, it's not defined when running
the script for Unlock Keychain phase.

Fix this by moving CODE_SIGN_IDENTITY to DebugRelease configuration, matching
WebKit. As a result, we are now using consistent signing options in all targets.

  • Configurations/DebugRelease.xcconfig:
  • Configurations/ToolExecutable.xcconfig:

When moving, removed a special case for Production, as that's never used with
DebugRelease (also, the Profile case was incorrect).

12:09 PM Changeset in webkit [250313] by Caio Lima
  • 27 edits
    5 adds in trunk

[BigInt] Add ValueBitRShift into DFG
https://bugs.webkit.org/show_bug.cgi?id=192663

Reviewed by Robin Morisset.

JSTests:

  • stress/big-int-right-shift-jit-osr.js: Added.
  • stress/big-int-right-shift-jit-untyped.js: Added.
  • stress/big-int-right-shift-jit.js: Added.
  • stress/value-rshift-ai-rule.js: Added.

PerformanceTests:

  • BigIntBench/big-int-simple-rshift.js: Added.

(bigInt):

Source/JavaScriptCore:

We are introducing a new node called ValueBitRShift that is
responsible to handle speculation of UntypedUse and BigIntUse during
DFG. Following the approach of other bitwise operations, we
now have 2 nodes to handle ">>" operator during JIT, mainly because
of the introduction of BigInt, that makes this operator result into
Int32 or BigInt. We renamed BitRShift to ArithBitRShift and such
node handles Integers and Numbers speculation and can only return
Int32 values.

  • bytecode/BytecodeList.rb:
  • bytecode/CodeBlock.cpp:

(JSC::CodeBlock::finishCreation):

  • bytecode/Opcode.h:

Adding support to ValueProfile to op_rshift to be used during
prediction propagation.

  • dfg/DFGAbstractInterpreterInlines.h:

(JSC::DFG::AbstractInterpreter<AbstractStateType>::handleConstantBinaryBitwiseOp):
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):

Adding support to still do constant propagation of ValueBitRShift when
it is UntypedUse.

  • dfg/DFGBackwardsPropagationPhase.cpp:

(JSC::DFG::BackwardsPropagationPhase::isWithinPowerOfTwo):
(JSC::DFG::BackwardsPropagationPhase::propagate):

  • dfg/DFGByteCodeParser.cpp:

(JSC::DFG::ByteCodeParser::parseBlock):

  • dfg/DFGClobberize.h:

(JSC::DFG::clobberize):

  • dfg/DFGDoesGC.cpp:

(JSC::DFG::doesGC):

ValueBitRshift can trigger GC when it is BigIntUse because the
operation JSBigInt::signedRightShift potentially allocates new
JSBigInts. It also can trigger GC when it is UntypedUse because it
can execute arbitrary code.

  • dfg/DFGFixupPhase.cpp:

(JSC::DFG::FixupPhase::fixupNode):

The fixup rule of ValueBitRShift checks if it should fixup for
BigIntUse or UntypedUse. If those checks fail, we fallback to
ArithBitRShift.

  • dfg/DFGNode.h:

(JSC::DFG::Node::hasNumericResult):
(JSC::DFG::Node::hasHeapPrediction):

  • dfg/DFGNodeType.h:
  • dfg/DFGOperations.cpp:
  • dfg/DFGOperations.h:
  • dfg/DFGPredictionPropagationPhase.cpp:

We are using the same rule used by ValueBitLShift to propagate
types. We try to propagate the type based on operation's input, but
fallback to getHeapPrediction() if this is not possible.

  • dfg/DFGSafeToExecute.h:

(JSC::DFG::safeToExecute):

  • dfg/DFGSpeculativeJIT.cpp:

(JSC::DFG::SpeculativeJIT::emitUntypedRightShiftBitOp):
(JSC::DFG::SpeculativeJIT::compileValueBitRShift):
(JSC::DFG::SpeculativeJIT::compileShiftOp):

  • dfg/DFGSpeculativeJIT.h:

(JSC::DFG::SpeculativeJIT::shiftOp):

  • dfg/DFGSpeculativeJIT32_64.cpp:

(JSC::DFG::SpeculativeJIT::compile):

  • dfg/DFGSpeculativeJIT64.cpp:

(JSC::DFG::SpeculativeJIT::compile):

  • dfg/DFGStrengthReductionPhase.cpp:

(JSC::DFG::StrengthReductionPhase::handleNode):

  • ftl/FTLCapabilities.cpp:

(JSC::FTL::canCompile):

  • ftl/FTLLowerDFGToB3.cpp:

(JSC::FTL::DFG::LowerDFGToB3::compileNode):
(JSC::FTL::DFG::LowerDFGToB3::compileValueBitRShift):
(JSC::FTL::DFG::LowerDFGToB3::compileArithBitRShift):
(JSC::FTL::DFG::LowerDFGToB3::compileBitRShift): Deleted.

  • llint/LowLevelInterpreter64.asm:
  • runtime/CommonSlowPaths.cpp:

(JSC::SLOW_PATH_DECL):

11:54 AM Changeset in webkit [250312] by achristensen@apple.com
  • 7 edits in trunk/Source/WebKit

Move HSTS storage directory to LegacyGlobalSettings
https://bugs.webkit.org/show_bug.cgi?id=202059

Reviewed by Tim Horton.

I continue my lamentation begun in r245075.
Remove the glib setting of it on the WebKitWebContext because they use it on the WebsiteDataStore. We should do that too when we can.

  • UIProcess/API/APIProcessPoolConfiguration.cpp:

(API::ProcessPoolConfiguration::copy):

  • UIProcess/API/APIProcessPoolConfiguration.h:
  • UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:

(-[_WKProcessPoolConfiguration setHSTSStorageDirectory:]):
(-[_WKProcessPoolConfiguration hstsStorageDirectory]):

  • UIProcess/LegacyGlobalSettings.h:

(WebKit::LegacyGlobalSettings::setHSTSStorageDirectory):
(WebKit::LegacyGlobalSettings::hstsStorageDirectory const):

  • UIProcess/WebProcessPool.cpp:

(WebKit::WebProcessPool::ensureNetworkProcess):

11:44 AM Changeset in webkit [250311] by Kocsen Chung
  • 1 edit in branches/safari-608-branch/Source/WebCore/loader/DocumentWriter.cpp

Build fix after r250255. rdar://problem/55644665.

11:42 AM Changeset in webkit [250310] by Keith Rollin
  • 4 edits in trunk/Source/WebCore/PAL

Remove some support for < iOS 13
https://bugs.webkit.org/show_bug.cgi?id=201969
<rdar://problem/55505586>

Reviewed by Jonathan Bedard.

Remove some support for iOS versions less than 13.0.

Update conditionals that reference IPHONE_OS_VERSION_MIN_REQUIRED
and
IPHONE_OS_VERSION_MAX_ALLOWED, assuming that they both have
values >= 130000. This means that expressions like
"IPHONE_OS_VERSION_MIN_REQUIRED < 101300" are always False and
"
IPHONE_OS_VERSION_MIN_REQUIRED >= 101300" are always True.

This removal is part of a series of patches effecting the removal of
dead code for old versions of iOS. This particular pass involves
changes in which Jonathan Bedard was involved. These changes are
isolated from other similar changes in order to facilitate the
reviewing process.

  • pal/spi/cocoa/CoreTextSPI.h:
  • pal/spi/cocoa/QuartzCoreSPI.h:
  • pal/spi/ios/UIKitSPI.h:
11:03 AM Changeset in webkit [250309] by Keith Rollin
  • 25 edits in trunk
Coalesce or remove PLATFORM(MAC)
PLATFORM(IOS_FAMILY)

https://bugs.webkit.org/show_bug.cgi?id=202119
<rdar://problem/55638792>

Reviewed by Alex Christensen.

After refactoring and other code evolution, some platform checks have

ended up looking like PLATFORM(MAC)
PLATFORM(IOS_FAMILY) (or

vice-versa). These can be converted into the equivalent
PLATFORM(COCOA). Where the instance occurs in a Cocoa-only file, the
check can be removed altogether (along with any "#else" branches).

Source/WebCore:

No new tests -- no new or changed functionality.

  • Modules/applepay/cocoa/PaymentContactCocoa.mm:

(WebCore::subLocality):
(WebCore::setSubLocality):
(WebCore::subAdministrativeArea):
(WebCore::setSubAdministrativeArea):

  • css/parser/CSSPropertyParser.cpp:

(WebCore::isAppleLegacyCssValueKeyword):

  • html/HTMLMediaElement.cpp:

(WebCore::HTMLMediaElement::mediaSessionTitle const):

  • inspector/InspectorFrontendHost.cpp:

(WebCore::InspectorFrontendHost::platform):

  • page/FrameView.cpp:

(WebCore::FrameView::updateBackgroundRecursively):

  • platform/Timer.cpp:
  • platform/cocoa/NetworkExtensionContentFilter.mm:

(WebCore::NetworkExtensionContentFilter::initialize):

  • platform/graphics/cg/GraphicsContextCG.cpp:

(WebCore::displayP3ColorSpaceRef):

  • platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
  • platform/network/cf/SocketStreamHandleImplCFNet.cpp:
  • rendering/RenderLayerCompositor.cpp:

(WebCore::RenderLayerCompositor::requiresCompositingForScrollableFrame const):

Source/WebCore/PAL:

  • pal/spi/cf/CFNetworkSPI.h:
  • pal/spi/cocoa/NEFilterSourceSPI.h:
  • pal/spi/mac/AVFoundationSPI.h:

Source/WebKit:

  • NetworkProcess/cocoa/NetworkSessionCocoa.mm:

(-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]):

  • WebProcess/WebCoreSupport/WebChromeClient.h:

Source/WTF:

  • wtf/Platform.h:
  • wtf/text/TextBreakIterator.h:

Tools:

  • DumpRenderTree/AccessibilityTextMarker.h:
  • DumpRenderTree/AccessibilityUIElement.cpp:

(AccessibilityUIElement::setValue):

10:57 AM Changeset in webkit [250308] by Kocsen Chung
  • 1 edit in branches/safari-608-branch/Source/WebCore/dom/Document.cpp

Build fix after r250255. rdar://problem/55644665.

10:48 AM Changeset in webkit [250307] by zhifei_fang@apple.com
  • 2 edits
    5 adds in trunk/Tools

Add tests for Ref.js.
https://bugs.webkit.org/show_bug.cgi?id=201778.

Reviewed by Jonathan Bedard.

  • resultsdbpy/resultsdbpy/view/static/library/js/Ref.js:

(applyStateDiff): null, 0, false are all valid state
(Ref.prototype.setState): We should do nothing for undefined stateDiff

  • resultsdbpy/resultsdbpy/view/static/library/js/Test.js: Added.

(AssertFailedError):
(Expect): Perform assertions during unit tests.
(Expect.prototype.isType):
(Expect.prototype.equalToValue):
(Expect.prototype.equalToHtmlWithoutRef):
(Expect.prototype.notEqualToValue):
(Expect.prototype.greaterThan):
(Expect.prototype.greaterThanOrEqualTo):
(Expect.prototype.lessThan):
(Expect.prototype.lessThanOrEqualTo):
(TestSuite): Common TestSuite class for user to extend.
(TestSuite.prototype.expect):
(TestSuite.prototype.sleep): Test will sleep for certain ms
(TestSuite.prototype.waitForSignal): Wait until we receive a certain signal with timeout
(TestSuite.prototype.waitForRefMounted): Wait until we receive ref object's onElementMount signal with timeout
(TestSuite.prototype.waitForRefUnmounted): Wait until we receive ref object's onElementUnmount signal with timeout
(TestSuite.prototype.waitForStateUpdated):Wait until we receive ref object's onStateUpdate signal with timeout
(TestSuite.prototype.async.setup): Common interface for setup a test suite
(TestSuite.prototype.async.clearUp): Common interface for clear up a test suite
(getTestFucntionNames): Collect all the test method of a test instance.
(TestResult):
(TestResult.prototype.catchException):
(async.getTestResult): Run the test and generate a TestResult object
(TestController):
(TestController.prototype.addResultHandler): Test controller will send notification of a test result to result handler
(TestController.prototype.addSetupArgs): This gives some additional args for the common setup method for each test class,
it is the best place to setup something like a root element, a fake data source, etc
(TestController.prototype.collect): This method used for collect the test classes.
(TestController.prototype.async.collectFile): It will import the file as a module dynamicly and collect all the test classes that module export
(TestController.prototype.async.runTest): It will run a test method of a test class
(TestController.prototype.async.run): It will run all test or a test class or a test method

  • resultsdbpy/resultsdbpy/view/static/library/js/components/TestComponents.js: components for test app.
  • resultsdbpy/resultsdbpy/view/static/library/js/test/RefTest.js: Ref.js test cases.
  • resultsdbpy/resultsdbpy/view/static/library/js/test/index.html: Test app entry.
10:25 AM Changeset in webkit [250306] by Wenson Hsieh
  • 4 edits in trunk

FocusPreservationTests.ChangingFocusedNodeResetsFocusPreservationState triggers a debug assertion
https://bugs.webkit.org/show_bug.cgi?id=202145
<rdar://problem/51273128>

Reviewed by Tim Horton.

Source/WebKit:

Fixes an assertion in -tableView:cellForRowAtIndexPath: to only require the cell to have a non-zero
width in the case where the table view itself has a non-empty width. When run under TestWebKitAPI,
this assertion currently fires because the view controller used to show the popover isn't actually
presented, so the view controller's view (i.e. the UITableView) ends up being empty. This causes all
of its table view cells to subsequently become empty upon reuse.

  • UIProcess/ios/forms/WKFormSelectPopover.mm:

(-[WKSelectTableViewController tableView:cellForRowAtIndexPath:]):

Tools:

Fixes this API test to work on iPad as well as iPhone. Importantly, we show a popover when focusing
select elements on iPad, which means that there is no -inputView present on WKContentView, and upon
dismissing the form accessory view, the select element is still focused.

  • TestWebKitAPI/Tests/ios/FocusPreservationTests.mm:
10:15 AM Changeset in webkit [250305] by Kocsen Chung
  • 23 edits
    2 adds in branches/safari-608-branch

Cherry-pick r250256. rdar://problem/55644660

[iOS] Drop animation when dragging images from Photos to WebKit2 Mail compose is incorrect
https://bugs.webkit.org/show_bug.cgi?id=201674
<rdar://problem/51250952>

Reviewed by Tim Horton.

Source/WebCore:

Adds new helper methods on DragController to support the new image placeholder drop codepath. See WebKit
ChangeLog for more details.

Tests: WKAttachmentTestsIOS.TargetedPreviewsWhenDroppingImages

WKAttachmentTestsIOS.TargetedPreviewIsClippedWhenDroppingTallImage

  • editing/WebContentReader.h:

Fix the Windows build after including WebContentReader.h in DragController.cpp.

  • html/HTMLImageElement.h: (WebCore::HTMLImageElement::isDroppedImagePlaceholder const): (WebCore::HTMLImageElement::setIsDroppedImagePlaceholder):

Add a flag to HTMLImageElement, indicating whether it is a dropped image placeholder. If so, we have special
logic to remove some temporary inline style properties from the image after it has finished loading (see
finalizeDroppedImagePlaceholder).

Note that this doesn't increase the size of HTMLImageElement.

  • page/DragController.cpp: (WebCore::DragController::dragEnded):

Clean up any stale placeholders after the drag ends.

(WebCore::DragController::performDragOperation):
(WebCore::DragController::removeAllDroppedImagePlaceholders):

Add a private helper to clean up any dropped image placeholders after failing to update dropped image
placeholders for any reason.

(WebCore::DragController::tryToUpdateDroppedImagePlaceholders):

Invoked when performing the drag operation, after image data has been loaded; this function attempts to update
the list of image placeholder elements tracked by DragController that were previously inserted using
insertDroppedImagePlaceholdersAtCaret, and updates the source attribute of each element (as well as any backed
attachment element, if attachment elements are enabled). It achieves this by reading the dropped data as web
content, and matching up the images in the resulting fragment against the placeholder images. If each image in
the fragment can correspond to exactly one placeholder, we update the source of each placeholder image,
migrate attachment elements over to the placeholder images if needed, and finally discard the fragment.

A return value of false indicates that this process failed, in which case we clean up the placeholders and fall
back to handling the drop normally.

(WebCore::DragController::insertDroppedImagePlaceholdersAtCaret):

Invoked when handling the drop, before any image data has been loaded; this function takes a list of sizes
representing the preferred presentation sizes of each item provider that will be loaded as an image, and uses
ReplaceSelectionCommand to insert a list of (initially blank) placeholder images at the drop caret, sized
accordingly to each item provider's preferredPresentationSize.

To make this compatible with Mail compose (and all other known internal clients that use the _editable SPI), we
additionally enforce a max-width of 100% on each image and preserve the aspect ratio of the image by adjusting
the height if needed.

(WebCore::DragController::finalizeDroppedImagePlaceholder):

  • page/DragController.h:

Have DragController keep track of the list of dropped image placeholders (in DOM order), as well as the dropped
image placeholder range. This information is used once item provider data arrives and the drag operation is
being performed, to update the source of each dropped image placeholder.

(WebCore::DragController::droppedImagePlaceholders const):
(WebCore::DragController::droppedImagePlaceholderRange const):

  • platform/network/mac/UTIUtilities.h:

Mark an existing helper function as WEBCORE_EXPORT.

Source/WebKit:

Our current logic for handling dropped content in editable elements on iOS works like this in the ideal case:

(1) UIKit asks us for a targeted preview for each UIDragItem. We don't know (and can't determine this

synchronously without blocking on the web process) so we simply retarget the preview to animate to the
last known caret location.

(2) Soonafter, UIKit hands us a drop preview update block, which may be used to retarget the drop preview

once, as long as the drop animation is less than 90% complete. We stash these update blocks for now.

(3) -dropInteraction:performDrop: is then called, and we start loading item provider data right away.

(4) When the data has finished loading, we perform the drop in the web process. After any inserted images

have finished loading, we take snapshots (of the dropped content as well as surrounding web content
minus the dropped content), and deliver these images to the UI process via TextIndicatorData.

(5) Upon receiving the TextIndicatorData sent in (4), we use the image data to create updated targeted drag

previews, and use these to invoke the preview update blocks we stored earlier in (2). We also obscure
the entire web view with a snapshot of the view minus any dropped content, such that the updated drop
previews may animate into place without also showing the final content.

(6) When the drop animation ends, we remove the unselected content snapshot view added in (5) simultaneously

as the targeted previews disappear, revealing the actual dropped content on the page. The drop is now
complete.

However, note that the drag update block we invoke in (5) doesn't work if the drop animation is already more
than 90% complete. Since the lifecycle of the drop animation is distinct from that of item provider loading, if
the delay between (3) and (4) exceeds 90% of the total drop animation time, we'll fail to update the targeted
previews, such that the user only sees the initial drag preview fly on top of the caret and disappear. While we
typically win this race for data dragged from other WebKit apps, we almost always lose when dragging from Photos
and end up with a janky drop animation. This is especially true for any images that aren't locally available,
and need to be fetched from iCloud. An additional problem is that in step (5), we use the same final snapshot to
update the drop preview of every item, since we don't have a snapshot for the fragment corresponding to each
individual dropped item.

To address these issues for Mail in the case where the user drops images with known sizes (i.e. -[NSItemProvider
preferredPresentationSize] is specified), we introduce an alternate codepath for handling dropped images that
performs the drop immediately upon receiving -dropInteraction:performDrop: in the UI process. Since the data has
yet to arrive, we instead handle the drop by inserting placeholder image elements at the drag caret position,
which initially have no source but are sized to fit their expected final image sizes. After doing so, we
snapshot the page (minus the dropped content range, as usual) and deliver this snapshot to the UI process, along
with the rects (in root view coordinates) of each placeholder image that was inserted. In the UI process, we
then take this snapshot and obscure the content view with it, and also use each of the placeholder rects to
provide an updated target for each drag preview, such that the drop previews now animate to their final
locations on the page.

When the data eventually arrives, we handle the drop by detecting the placeholder elements we inserted earlier,
and using the dropped data to update the source attribute and attachment backing for each of these placeholder
elements instead of attempting to insert new content.

Note that this codepath is currently only enabled for SPI clients that set -[WKWebView _editable] to YES, since
it involves us performing the editing action for the drop (thus changing the DOM) prior to the preventable drop
event, and prior to us having any data at all. However, the drop event can't come before the editing action,
since we need to have already loaded data from the item providers to expose it via the dataTransfer of the drop
event. This contradiction means that this image placeholder hack is only for _editable SPI clients that, at the
very least, will not require preventing default behavior when dropping only images with predetermined sizes.

Covered by 2 new API tests. See comments below for more detail.

  • UIProcess/WebPageProxy.h:
  • UIProcess/ios/DragDropInteractionState.h:
  • UIProcess/ios/DragDropInteractionState.mm: (WebKit::DragDropInteractionState::setDefaultDropPreview):

Add a way to keep track of default drop previews that we observed during each call to
-dropInteraction:previewForDroppingItem:withDefault:. In the image placeholder drop scenario, we use these
default drop previews later on to create retargeted drop previews after the placeholders have been inserted.

(WebKit::DragDropInteractionState::defaultDropPreview const):
(WebKit::DragDropInteractionState::deliverDelayedDropPreview):

Add an alternate version of deliverDelayedDropPreview that is used when inserting image placeholders. Rather
than use text indicator data of the final dropped content on the page, use the root-view-coordinate rects of
each of the placeholder elements to reposition the default drop previews.

There's additional logic here to handle the case where the final image is taller than the height of the
unobscured content rect, in which case we clip the drop preview using UIDragPreviewParameter's visiblePath to
prevent the drop preview from being shown outside of the bounds of the web view.

  • UIProcess/ios/WKContentViewInteraction.h:
  • UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _deliverDelayedDropPreviewIfPossible:]): (sizesOfPlaceholderElementsToInsertWhenDroppingItems):

Collects the list of expected image sizes for the dropped item providers, or an empty list in the case where
any of the item providers may not be represented as inline images or do not have predetermined sizes.

(-[WKContentView _handleDropByInsertingImagePlaceholders:session:]):

If possible, handles the drop by inserting image placeholders instead of waiting for the data to finish loading
before dropping. Returns whether or not we decided to proceed with the image placeholder drop.

(-[WKContentView dropInteraction:performDrop:]):
(-[WKContentView dropInteraction:item:willAnimateDropWithAnimator:]):

Fixes a bug where the unselected content snapshot view could linger around on the web view forever after a drop
where the data doesn't load in time for the drop to finish by keeping track of whether there is an actively
animating drag item, and only applying the unselected content snapshot if so.

(-[WKContentView dropInteraction:previewForDroppingItem:withDefault:]):

Stash the default drop preview away here.

  • UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::insertDroppedImagePlaceholders):
  • WebProcess/WebPage/WebPage.h:
  • WebProcess/WebPage/WebPage.messages.in:
  • WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::insertDroppedImagePlaceholders):

See WebCore ChangeLog for more information.

(WebKit::WebPage::didFinishLoadingImageForElement):

If the image that finished loading is a dropped image placeholder, allow DragController to "finalize" it by
stripping away some styles that were temporarily added.

Tools:

Add a couple of new API tests to exercise the new image placeholder drop codepath, in addition to testing
infrastructure to simulate the timing of drop animation delegate calls.

  • TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
  • TestWebKitAPI/Tests/WebKitCocoa/WKAttachmentTests.mm: (-[NSArray _attachmentWithName:]): (-[TestWKWebView allBoundingClientRects:]):

Add some new API testing helper methods.

(TestWebKitAPI::targetedImageDragPreview):
(TestWebKitAPI::TEST):

Add two new tests, to:
(1) verify that images are dropped as attachment-backed placeholder image elements when the web view is editable

and enables attachment elements, and

(2) verify that when dropping an image taller than the web view, the bottom portion of the drop preview is

clipped using the targeted preview parameter's visiblePath.

  • TestWebKitAPI/Tests/ios/DragAndDropTestsIOS.mm: (-[NSItemProvider registerDataRepresentationForTypeIdentifier:withData:]): Deleted.
  • TestWebKitAPI/cocoa/DragAndDropSimulator.h:
  • TestWebKitAPI/cocoa/NSItemProviderAdditions.h: Added.
  • TestWebKitAPI/cocoa/NSItemProviderAdditions.mm: Added.

Move some common helpers for registering data on a NSItemProvider to a separate file, so that it can be used in
both WKAttachmentTests and DragAndDropTests.

(-[NSItemProvider registerDataRepresentationForTypeIdentifier:withData:]):
(-[NSItemProvider registerDataRepresentationForTypeIdentifier:withData:loadingDelay:]):

  • TestWebKitAPI/ios/DragAndDropSimulatorIOS.mm: (-[DragAndDropSimulator initWithWebView:]): (-[DragAndDropSimulator _concludeDropAndPerformOperationIfNecessary]): (-[DragAndDropSimulator clearExternalDragInformation]): (-[DragAndDropSimulator setExternalItemProviders:defaultDropPreviews:]):

Add a new method to allow tests to specify both a list of externally dragged item providers, as well as default
targeted previews for each of the corresponding items. These default previews are used when invoking the drop
interaction delegate's preview generation methods.

(-[DragAndDropSimulator addAnimations:]):

Not implemented yet; for now, this simply asserts.

(-[DragAndDropSimulator addCompletion:]):

Queues a completion handler, which is invoked when the drop animation for each item completes. Depending on the
value of DragAndDropSimulator's -dropAnimationTiming, this may occur either before or after handling the drop.
By default, these will be invoked after the drop completes, which represents the common case where data can be
loaded quickly relative to the drop animation.

(-[DragAndDropSimulator _invokeDropAnimationCompletionBlocksAndConcludeDrop]):
(-[DragAndDropSimulator _webView:dataInteractionOperationWasHandled:forSession:itemProviders:]):

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

10:09 AM Changeset in webkit [250304] by timothy_horton@apple.com
  • 2 edits in branches/safari-608-branch/Tools

Fix the macOS branch build

  • TestRunnerShared/UIScriptContext/UIScriptController.cpp:

(WTR::UIScriptController::twoFingerSingleTapAtPoint):
Untested and unreviewed. Introduce a empty implementation of
twoFingerSingleTapAtPoint for non-iOS targets. No longer
necessary on trunk because of r247898.

10:02 AM Changeset in webkit [250303] by graouts@webkit.org
  • 6 edits in trunk

[Web Animations] Unflake web-animations/timing-model/animations/updating-the-finished-state.html WPT test
https://bugs.webkit.org/show_bug.cgi?id=181121

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

  • web-platform-tests/web-animations/timing-model/animations/updating-the-finished-state-expected.txt:

Source/WebCore:

When running the "update animations and send events" steps (https://drafts.csswg.org/web-animations/#update-animations-and-send-events)
we assemble a list of animations to remove after updating their relevance based on the new timeline current time. However, we wouldn't
account for the fact that we would *then* dispatch events which could update the timing properties of animations that had been marked
for removal at this point.

In this specific WPT test, there were two individual tests that would rewind animations within a "finish" event handler and we would
not consider the fact that they had been rewound. We now check a second time before removing an animation that it should indeed be
removed.

  • animation/DocumentTimeline.cpp:

(WebCore::DocumentTimeline::internalUpdateAnimationsAndSendEvents):

LayoutTests:

9:39 AM Changeset in webkit [250302] by cathiechen
  • 2 edits in trunk/Tools

Add Cathie Chen as WebKit committer

Unreviewed.

  • Scripts/webkitpy/common/config/contributors.json:
9:31 AM Changeset in webkit [250301] by Kocsen Chung
  • 16 edits
    6 adds in branches/safari-608-branch

Cherry-pick r250255. rdar://problem/55644665

Improve CSP inheritance semantics
https://bugs.webkit.org/show_bug.cgi?id=201884
<rdar://problem/50172407>

Reviewed by Brent Fulgham.

LayoutTests/imported/w3c:

Update expected results now that we pass more sub-tests.

  • web-platform-tests/content-security-policy/inheritance/iframe-all-local-schemes-inherit-self.sub-expected.txt:
  • web-platform-tests/content-security-policy/inheritance/window-expected.txt:

Source/WebCore:

Update the CSP inheritance semantics to more closely match the logic in section Initialize a Document's CSP list
of the CSP3 spec., <https://w3c.github.io/webappsec-csp/#initialize-document-csp>.

Towards this, move more of the inheritance logic out of Document::initContentSecurityPolicy() and into
DocumentWriter::begin() where details about the document being replaced live. This lets us remove the
need to track the previous content security policy to pass it to Document::initContentSecurityPolicy().
Moreover, DocumentWriter::begin() knows the owner document that will be replaced with the result of
executing a JavaScript URL. This is needed in order to fix up inheritance of CSP for such documents.

Tests: http/tests/security/contentSecurityPolicy/iframe-allowed-when-loaded-via-javascript-url.html

http/tests/security/contentSecurityPolicy/iframe-blocked-when-loaded-via-javascript-url.html
http/tests/security/contentSecurityPolicy/iframe-blocked-when-loaded-via-javascript-url2.html

  • dom/Document.cpp: (WebCore::Document::initSecurityContext): If we are inheriting the security origin from the owner document then inherit its CSP policy. We copy over both the CSP state from the owner as well as update 'self' to match the owner's origin so that CSP source expressions that include 'self' work correctly even from about:blank documents. (WebCore::Document::initContentSecurityPolicy): Move most of the logic from here into DocumentWriter::begin() to take advantage of the fact that DocumentWriter::begin() knows about the outgoing document (if there is one) as well as whether the outgoing document is being replaced with a new document that is the result of evaluating a JavaScript URL. We need do know both these things in order to inherit the correct CSP policy. This function only exists to copy some upgrade-insecure-requests state and to fix up plugin documents as we currently do. (WebCore::Document::shouldInheritContentSecurityPolicy const): Deleted.
  • dom/Document.h:
  • dom/SecurityContext.cpp: (WebCore::SecurityContext::setContentSecurityPolicy): Modified to take its param by rvalue-reference to make it less error prone to use.
  • dom/SecurityContext.h: Expose setContentSecurityPolicy() so that we can invoke it from DocumentWriter::begin().
  • loader/DocumentWriter.cpp: (WebCore::DocumentWriter::begin): For documents being replaced with the result of a JavaScript URL (i.e. ownerDocument is non-null) inherit the CSP from the owner document. Similarly, if we have an existing document in the frame and the protocol of the new document's URL is data: or blob: then inherit the CSP from the existing page. The latter is what we currently do just moved from Document::initContentSecurityPolicy() and re-written in terms of the existingDocument instead of previousContentSecurityPolicy. Also call setInsecureNavigationRequestsToUpgrade() both when we have a non-null ownerDocument as well as when we have a non-null existingDocument. The former fixes the block-all-mixed-content feature for documents loaded via JavaScript URLs and the latter is what we do now.
  • loader/FrameLoader.cpp: (WebCore::FrameLoader::didBeginDocument): Remove parameter previousContentSecurityPolicy as the logic that made use of it moved to DocumentWriter::begin().
  • loader/FrameLoader.h:
  • page/csp/ContentSecurityPolicy.h:

LayoutTests:

Add some more tests and update expected results of existing tests now that we pass more sub-tests.

  • http/tests/security/contentSecurityPolicy/iframe-allowed-when-loaded-via-javascript-url-expected.txt: Added.
  • http/tests/security/contentSecurityPolicy/iframe-allowed-when-loaded-via-javascript-url.html: Added.
  • http/tests/security/contentSecurityPolicy/iframe-blocked-when-loaded-via-javascript-url-expected.txt: Added.
  • http/tests/security/contentSecurityPolicy/iframe-blocked-when-loaded-via-javascript-url.html: Added.
  • http/tests/security/contentSecurityPolicy/iframe-blocked-when-loaded-via-javascript-url2-expected.txt: Added.
  • http/tests/security/contentSecurityPolicy/iframe-blocked-when-loaded-via-javascript-url2.html: Added.
  • http/tests/security/contentSecurityPolicy/user-style-sheet-font-crasher-expected.txt: I don't understand why there is another duplicte console log message emitted, but there are already two such messages, which is already one too many. The duplicate messages are more cosmetic than functional though there may be implications with respect to CSP reporting. Filed <https://bugs.webkit.org/show_bug.cgi?id=202004> to track this issue.
  • platform/mac-wk1/http/tests/security/contentSecurityPolicy/user-style-sheet-font-crasher-expected.txt:
  • platform/win/http/tests/security/contentSecurityPolicy/user-style-sheet-font-crasher-expected.txt:

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

8:31 AM Changeset in webkit [250300] by Chris Dumez
  • 7 edits
    11 adds in trunk

Mixed content blocking is bypassed for WebSockets in Workers (159726)
https://bugs.webkit.org/show_bug.cgi?id=159726
<rdar://problem/27326438>

Patch by Kate Cheney <Kate Cheney> on 2019-09-24
Reviewed by Brady Eidson.

Source/WebCore:

Tests: http/tests/websocket/tests/hybi/non-document-mixed-content-blocked-http-with-embedded-https-with-embedded-http.html

http/tests/websocket/tests/hybi/non-document-mixed-content-blocked-http-with-embedded-https.html
http/tests/websocket/tests/hybi/non-document-mixed-content-blocked-https-with-embedded-http-with-embedded-https.https.html
http/tests/websocket/tests/hybi/non-document-mixed-content-blocked.https.html

  • Modules/websockets/WebSocket.cpp:

(WebCore::WebSocket::connect):

  • Modules/websockets/WorkerThreadableWebSocketChannel.cpp:

(WebCore::WorkerThreadableWebSocketChannel::Bridge::connect):

  • loader/MixedContentChecker.cpp:

(WebCore::MixedContentChecker::checkForMixedContentInFrameTree):

  • loader/MixedContentChecker.h:

Patch to block insecure WebSocket URL connection attempts by Workers
on secure pages. If the URL is ws, and any embedding iframe has protocol
https, and the context is a Worker, the connection should be blocked.

I was unable to write a test case to hit the case where a document
does not have a frame and tries to communicate via a worker to
connect to a WebSocket because after removing the subframe from its
parent, the subframe is unable to perform a postMessage to a worker
even in the same script execution to tell the worker to connect
to a WebSocket.

LayoutTests:

Added 4 test cases and 2 html resources utilized by the tests.
The cases test the following:

  1. an https page with a worker trying to connect via ws: url -->

fails.

  1. an https page embedded in an http page trying to connect via ws

:url (through a worker) --> fails.

  1. an http page embedded in an https page with an http top frame

trying to connect via an insecure ws url fails.

  1. an https page embedded in an http page embedded in an https page

trying to connect to a ws :url via a worker --> fails.

  • http/tests/websocket/tests/hybi/non-document-mixed-content-blocked-http-with-embedded-https-expected.txt: Added.
  • http/tests/websocket/tests/hybi/non-document-mixed-content-blocked-http-with-embedded-https-with-embedded-http-expected.txt: Added.
  • http/tests/websocket/tests/hybi/non-document-mixed-content-blocked-http-with-embedded-https-with-embedded-http.html: Added.
  • http/tests/websocket/tests/hybi/non-document-mixed-content-blocked-http-with-embedded-https.html: Added.
  • http/tests/websocket/tests/hybi/non-document-mixed-content-blocked-https-with-embedded-http-with-embedded-https.https-expected.txt: Added.
  • http/tests/websocket/tests/hybi/non-document-mixed-content-blocked-https-with-embedded-http-with-embedded-https.https.html: Added.
  • http/tests/websocket/tests/hybi/non-document-mixed-content-blocked.https-expected.txt: Added.
  • http/tests/websocket/tests/hybi/non-document-mixed-content-blocked.https.html: Added.
  • http/tests/websocket/tests/hybi/resources/non-document-mixed-content-blocked-embedded-http.https.html: Added.
  • http/tests/websocket/tests/hybi/resources/non-document-mixed-content-blocked-embedding-https.js: Added.

(handleConnect.self.postMessage):
(handleConnect):
(runTests.ws.onopen):
(runTests.ws.onerror):
(runTests):

  • http/tests/websocket/tests/hybi/resources/non-document-mixed-content-blocked.html: Added.
  • http/tests/websocket/tests/hybi/resources/non-document-mixed-content-blocked.js: Added.

(handleConnect.self.postMessage):
(handleConnect):
(runTests.ws.onopen):
(runTests.ws.onerror):
(runTests):

  • http/tests/workers/service/resources/serviceworker-websocket-worker.js:

(async.doTest):
Updated previous test which was hitting the fix to use a wss url

8:30 AM Changeset in webkit [250299] by Alan Bujtas
  • 6 edits in trunk/Source/WebCore

[LFC][IFC] Line::Content should use LineBox
https://bugs.webkit.org/show_bug.cgi?id=202128
<rdar://problem/55649079>

Reviewed by Antti Koivisto.

Replace Line::Content's m_logicalRect, m_baseline and m_baselineOffset with LineBox.

  • layout/inlineformatting/InlineFormattingContextLineLayout.cpp:

(WebCore::Layout::InlineFormattingContext::InlineLayout::layout):
(WebCore::Layout::InlineFormattingContext::InlineLayout::computedIntrinsicWidth const):
(WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns):

  • layout/inlineformatting/InlineFormattingContextQuirks.cpp:

(WebCore::Layout::InlineFormattingContext::Quirks::lineDescentNeedsCollapsing const):
(WebCore::Layout::InlineFormattingContext::Quirks::lineHeightConstraints const):

  • layout/inlineformatting/InlineLine.cpp:

(WebCore::Layout::Line::close):
(WebCore::Layout::Line::adjustBaselineAndLineHeight):

  • layout/inlineformatting/InlineLine.h:

(WebCore::Layout::Line::Content::lineBox const):
(WebCore::Layout::Line::Content::setLineBox):
(WebCore::Layout::Line::baselineOffset const):
(WebCore::Layout::Line::Content::isEmpty const): Deleted.
(WebCore::Layout::Line::Content::logicalTop const): Deleted.
(WebCore::Layout::Line::Content::logicalLeft const): Deleted.
(WebCore::Layout::Line::Content::logicalRight const): Deleted.
(WebCore::Layout::Line::Content::logicalBottom const): Deleted.
(WebCore::Layout::Line::Content::logicalWidth const): Deleted.
(WebCore::Layout::Line::Content::logicalHeight const): Deleted.
(WebCore::Layout::Line::Content::baseline const): Deleted.
(WebCore::Layout::Line::Content::baselineOffset const): Deleted.
(WebCore::Layout::Line::Content::setLogicalRect): Deleted.
(WebCore::Layout::Line::Content::setBaseline): Deleted.
(WebCore::Layout::Line::Content::setBaselineOffset): Deleted.

  • layout/inlineformatting/InlineLineBox.h:

(WebCore::Layout::LineBox::Baseline::height const):
(WebCore::Layout::LineBox::LineBox):
(WebCore::Layout::LineBox::baselineOffset const):
(WebCore::Layout::LineBox::Baseline::Baseline):
(WebCore::Layout::LineBox::Baseline::setAscent):
(WebCore::Layout::LineBox::Baseline::setDescent):
(WebCore::Layout::LineBox::Baseline::reset):
(WebCore::Layout::LineBox::Baseline::ascent const):
(WebCore::Layout::LineBox::Baseline::descent const):

8:11 AM WebKitGTK/2.26.x edited by Adrian Perez de Castro
(diff)
7:58 AM Changeset in webkit [250298] by Adrian Perez de Castro
  • 2 edits in trunk/Source/ThirdParty/ANGLE

[GTK] ANGLE's eglplatform.h is build broken with -DENABLE_X11_PLATFORM=OFF
https://bugs.webkit.org/show_bug.cgi?id=198621

Reviewed by Carlos Garcia Campos.

  • PlatformGTK.cmake: Define WL_EGL_PLATFORM to prefer Wayland type

definitions with ENABLE_WAYLAND_TARGET=ON and ENABLE_X11_TARGET=OFF
to avoid ANGLE's eglplatform.h from trying to include the X11 headers.

7:39 AM Changeset in webkit [250297] by Alan Bujtas
  • 4 edits in trunk/Source/WebCore

[LFC][IFC] Move line constraints computation to a dedicated function
https://bugs.webkit.org/show_bug.cgi?id=202121
<rdar://problem/55640742>

Reviewed by Antti Koivisto.

  • layout/inlineformatting/InlineFormattingContext.h:
  • layout/inlineformatting/InlineFormattingContextLineLayout.cpp:

(WebCore::Layout::LineLayout::LineLayout):
(WebCore::Layout::LineLayout::close):
(WebCore::Layout::LineLayout::placeInlineItem):
(WebCore::Layout::InlineFormattingContext::InlineLayout::layout):
(WebCore::Layout::InlineFormattingContext::InlineLayout::initialConstraintsForLine):
(WebCore::Layout::InlineFormattingContext::InlineLayout::computedIntrinsicWidth const):

  • layout/inlineformatting/InlineLine.h:
7:29 AM Changeset in webkit [250296] by Adrian Perez de Castro
  • 1 copy in releases/WPE WebKit/webkit-2.26.1

WPE WebKit 2.26.1

7:28 AM Changeset in webkit [250295] by Adrian Perez de Castro
  • 2 edits in releases/WebKitGTK/webkit-2.26

Unreviewed. Update OptionsWPE.cmake and NEWS for the 2.26.1 release

build-nouni-wpe/..:

  • Source/cmake/OptionsWPE.cmake: Bump version numbers.

build-nouni-wpe/../Source/WebKit:

  • wpe/NEWS: Add release notes for 2.26.1.
7:28 AM Changeset in webkit [250294] by Adrian Perez de Castro
  • 2 edits in releases/WebKitGTK/webkit-2.26/Source

wip

7:09 AM Changeset in webkit [250293] by commit-queue@webkit.org
  • 1 edit
    79 adds in trunk/LayoutTests/imported/w3c

Import navigation-timing WPT tests that don't time out
https://bugs.webkit.org/show_bug.cgi?id=202131

Patch by Alex Christensen <achristensen@webkit.org> on 2019-09-24
Reviewed by Youenn Fablet.

  • web-platform-tests/navigation-timing/buffered-flag.window.js: Added.

(async_test.t):

  • web-platform-tests/navigation-timing/idlharness.window.js: Added.
  • web-platform-tests/navigation-timing/nav2_test_document_open-expected.txt: Added.
  • web-platform-tests/navigation-timing/nav2_test_document_open.html: Added.
  • web-platform-tests/navigation-timing/nav2_test_document_replaced-expected.txt: Added.
  • web-platform-tests/navigation-timing/nav2_test_document_replaced.html: Added.
  • web-platform-tests/navigation-timing/nav2_test_frame_removed-expected.txt: Added.
  • web-platform-tests/navigation-timing/nav2_test_frame_removed.html: Added.
  • web-platform-tests/navigation-timing/nav2_test_instance_accessible_from_the_start-expected.txt: Added.
  • web-platform-tests/navigation-timing/nav2_test_instance_accessible_from_the_start.html: Added.
  • web-platform-tests/navigation-timing/nav2_test_navigate_within_document-expected.txt: Added.
  • web-platform-tests/navigation-timing/nav2_test_navigate_within_document.html: Added.
  • web-platform-tests/navigation-timing/nav2_test_navigation_type_backforward-expected.txt: Added.
  • web-platform-tests/navigation-timing/nav2_test_navigation_type_backforward.html: Added.
  • web-platform-tests/navigation-timing/nav2_test_navigation_type_reload-expected.txt: Added.
  • web-platform-tests/navigation-timing/nav2_test_navigation_type_reload.html: Added.
  • web-platform-tests/navigation-timing/nav2_test_redirect_chain_xserver_partial_opt_in-expected.txt: Added.
  • web-platform-tests/navigation-timing/nav2_test_redirect_chain_xserver_partial_opt_in.html: Added.
  • web-platform-tests/navigation-timing/nav2_test_redirect_server-expected.txt: Added.
  • web-platform-tests/navigation-timing/nav2_test_redirect_server.html: Added.
  • web-platform-tests/navigation-timing/nav2_test_redirect_xserver-expected.txt: Added.
  • web-platform-tests/navigation-timing/nav2_test_redirect_xserver.html: Added.
  • web-platform-tests/navigation-timing/resources: Added.
  • web-platform-tests/navigation-timing/resources/blank_page_green.html: Added.
  • web-platform-tests/navigation-timing/resources/blank_page_green_with_onunload.html: Added.
  • web-platform-tests/navigation-timing/resources/blank_page_meta_redirect.html: Added.
  • web-platform-tests/navigation-timing/resources/blank_page_unload.html: Added.
  • web-platform-tests/navigation-timing/resources/blank_page_yellow.html: Added.
  • web-platform-tests/navigation-timing/resources/blank_page_yellow_with_onunload.html: Added.
  • web-platform-tests/navigation-timing/resources/performance_attribute_sender.html: Added.
  • web-platform-tests/navigation-timing/resources/secure-connection-interim.html: Added.
  • web-platform-tests/navigation-timing/resources/secure-connection-interim.html.headers: Added.
  • web-platform-tests/navigation-timing/resources/secure-connection-test.html: Added.
  • web-platform-tests/navigation-timing/resources/webperftestharness.js: Added.

(test_namespace):
(test_timing_order):
(test_timing_equals):
(sleep_milliseconds):
(test_greater_than):
(test_greater_or_equals):

  • web-platform-tests/navigation-timing/secure_connection_start_non_zero.https-expected.txt: Added.
  • web-platform-tests/navigation-timing/secure_connection_start_non_zero.https.html: Added.
  • web-platform-tests/navigation-timing/supported_navigation_type.window.js: Added.

(test):
(typeof.PerformanceObserver.supportedEntryTypes.string_appeared_here.PerformanceObserver.supportedEntryTypes.includes.promise_test.):
(typeof.PerformanceObserver.supportedEntryTypes.string_appeared_here.PerformanceObserver.supportedEntryTypes.includes):

  • web-platform-tests/navigation-timing/test_document_open-expected.txt: Added.
  • web-platform-tests/navigation-timing/test_document_open.html: Added.
  • web-platform-tests/navigation-timing/test_document_readiness_exist-expected.txt: Added.
  • web-platform-tests/navigation-timing/test_document_readiness_exist.html: Added.
  • web-platform-tests/navigation-timing/test_navigate_within_document-expected.txt: Added.
  • web-platform-tests/navigation-timing/test_navigate_within_document.html: Added.
  • web-platform-tests/navigation-timing/test_navigation_attributes_exist-expected.txt: Added.
  • web-platform-tests/navigation-timing/test_navigation_attributes_exist.html: Added.
  • web-platform-tests/navigation-timing/test_navigation_redirectCount_none-expected.txt: Added.
  • web-platform-tests/navigation-timing/test_navigation_redirectCount_none.html: Added.
  • web-platform-tests/navigation-timing/test_navigation_type_backforward-expected.txt: Added.
  • web-platform-tests/navigation-timing/test_navigation_type_backforward.html: Added.
  • web-platform-tests/navigation-timing/test_navigation_type_enums-expected.txt: Added.
  • web-platform-tests/navigation-timing/test_navigation_type_enums.html: Added.
  • web-platform-tests/navigation-timing/test_navigation_type_reload-expected.txt: Added.
  • web-platform-tests/navigation-timing/test_navigation_type_reload.html: Added.
  • web-platform-tests/navigation-timing/test_no_previous_document-expected.txt: Added.
  • web-platform-tests/navigation-timing/test_no_previous_document.html: Added.
  • web-platform-tests/navigation-timing/test_performance_attributes.sub-expected.txt: Added.
  • web-platform-tests/navigation-timing/test_performance_attributes.sub.html: Added.
  • web-platform-tests/navigation-timing/test_performance_attributes_exist-expected.txt: Added.
  • web-platform-tests/navigation-timing/test_performance_attributes_exist.html: Added.
  • web-platform-tests/navigation-timing/test_performance_attributes_exist_in_object-expected.txt: Added.
  • web-platform-tests/navigation-timing/test_performance_attributes_exist_in_object.html: Added.
  • web-platform-tests/navigation-timing/test_readwrite-expected.txt: Added.
  • web-platform-tests/navigation-timing/test_readwrite.html: Added.
  • web-platform-tests/navigation-timing/test_timing_attributes_exist-expected.txt: Added.
  • web-platform-tests/navigation-timing/test_timing_attributes_exist.html: Added.
  • web-platform-tests/navigation-timing/test_timing_attributes_order-expected.txt: Added.
  • web-platform-tests/navigation-timing/test_timing_attributes_order.html: Added.
  • web-platform-tests/navigation-timing/test_timing_client_redirect-expected.txt: Added.
  • web-platform-tests/navigation-timing/test_timing_client_redirect.html: Added.
  • web-platform-tests/navigation-timing/test_timing_reload-expected.txt: Added.
  • web-platform-tests/navigation-timing/test_timing_reload.html: Added.
  • web-platform-tests/navigation-timing/test_timing_server_redirect-expected.txt: Added.
  • web-platform-tests/navigation-timing/test_timing_server_redirect.html: Added.
  • web-platform-tests/navigation-timing/test_timing_xserver_redirect-expected.txt: Added.
  • web-platform-tests/navigation-timing/test_timing_xserver_redirect.html: Added.
  • web-platform-tests/navigation-timing/test_unique_performance_objects-expected.txt: Added.
  • web-platform-tests/navigation-timing/test_unique_performance_objects.html: Added.
  • web-platform-tests/navigation-timing/unload-event-same-origin-check-expected.txt: Added.
  • web-platform-tests/navigation-timing/unload-event-same-origin-check.html: Added.
6:58 AM Changeset in webkit [250292] by achristensen@apple.com
  • 21 edits in trunk

Require a WebsiteDataStore when creating or resuming downloads
https://bugs.webkit.org/show_bug.cgi?id=202081

Reviewed by Youenn Fablet.

Source/WebKit:

No change in behavior, but I'll have to move Safari to the new SPI.
This makes it so there are no cases where we guess we need to use the default session,
and it allows downloads to function correctly once there is a NetworkProcess singleton.
Removing the unused WebProcessPool& in the callbacks will allow us to eventually have
downloads only associated with a WebsiteDataStore and not a WebProcessPool.

  • UIProcess/API/APIDownloadClient.h:

(API::DownloadClient::didStart):
(API::DownloadClient::didReceiveAuthenticationChallenge):
(API::DownloadClient::didReceiveResponse):
(API::DownloadClient::didReceiveData):
(API::DownloadClient::decideDestinationWithSuggestedFilename):
(API::DownloadClient::didCreateDestination):
(API::DownloadClient::didFinish):
(API::DownloadClient::didFail):
(API::DownloadClient::didCancel):
(API::DownloadClient::processDidCrash):
(API::DownloadClient::willSendRequest):

  • UIProcess/API/C/WKContext.cpp:

(WKContextSetDownloadClient):
(WKContextDownloadURLRequest):
(WKContextResumeDownload):

  • UIProcess/API/C/WKContext.h:
  • UIProcess/API/Cocoa/WKProcessPool.mm:

(-[WKProcessPool _setDownloadDelegate:]):
(-[WKProcessPool _downloadURLRequest:originatingWebView:]):
(-[WKProcessPool _resumeDownloadFromData:path:originatingWebView:]):
(-[WKProcessPool _downloadURLRequest:websiteDataStore:originatingWebView:]):
(-[WKProcessPool _resumeDownloadFromData:websiteDataStore:path:originatingWebView:]):

  • UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
  • UIProcess/API/glib/WebKitDownloadClient.cpp:
  • UIProcess/API/glib/WebKitWebContext.cpp:

(webkitWebContextDispose):
(webkitWebContextStartDownload):

  • UIProcess/Cocoa/DownloadClient.h:
  • UIProcess/Cocoa/DownloadClient.mm:

(WebKit::DownloadClient::didStart):
(WebKit::DownloadClient::didReceiveResponse):
(WebKit::DownloadClient::didReceiveData):
(WebKit::DownloadClient::didReceiveAuthenticationChallenge):
(WebKit::DownloadClient::didCreateDestination):
(WebKit::DownloadClient::processDidCrash):
(WebKit::DownloadClient::decideDestinationWithSuggestedFilename):
(WebKit::DownloadClient::didFinish):
(WebKit::DownloadClient::didFail):
(WebKit::DownloadClient::didCancel):
(WebKit::DownloadClient::willSendRequest):

  • UIProcess/Downloads/DownloadProxy.cpp:

(WebKit::DownloadProxy::create):
(WebKit::DownloadProxy::DownloadProxy):
(WebKit::DownloadProxy::invalidate):
(WebKit::DownloadProxy::processDidClose):
(WebKit::DownloadProxy::didStart):
(WebKit::DownloadProxy::didReceiveAuthenticationChallenge):
(WebKit::DownloadProxy::willSendRequest):
(WebKit::DownloadProxy::didReceiveResponse):
(WebKit::DownloadProxy::didReceiveData):
(WebKit::DownloadProxy::decideDestinationWithSuggestedFilenameAsync):
(WebKit::DownloadProxy::didCreateDestination):
(WebKit::DownloadProxy::didFinish):
(WebKit::DownloadProxy::didFail):
(WebKit::DownloadProxy::didCancel):

  • UIProcess/Downloads/DownloadProxy.h:
  • UIProcess/Downloads/DownloadProxyMap.cpp:

(WebKit::DownloadProxyMap::createDownloadProxy):

  • UIProcess/Downloads/DownloadProxyMap.h:
  • UIProcess/Network/NetworkProcessProxy.cpp:

(WebKit::NetworkProcessProxy::createDownloadProxy):

  • UIProcess/Network/NetworkProcessProxy.h:
  • UIProcess/WebPageProxy.cpp:

(WebKit::WebPageProxy::receivedPolicyDecision):
(WebKit::WebPageProxy::contextMenuItemSelected):

  • UIProcess/WebProcessPool.cpp:

(WebKit::WebProcessPool::WebProcessPool):
(WebKit::WebProcessPool::setDownloadClient):
(WebKit::WebProcessPool::download):
(WebKit::WebProcessPool::resumeDownload):
(WebKit::WebProcessPool::createDownloadProxy):

  • UIProcess/WebProcessPool.h:

Tools:

  • TestWebKitAPI/Tests/WebKitCocoa/DownloadProgress.mm:

(-[DownloadProgressTestRunner startDownload:expectedLength:]):

6:36 AM Changeset in webkit [250291] by youenn@apple.com
  • 2 edits in trunk/Source/WebKit

Delay capture sandbox extension revocation to after the page close message is sent
https://bugs.webkit.org/show_bug.cgi?id=202133

Reviewed by Eric Carlson.

This ensures that the sandbox extension is removed once no longer useful
and makes our WebProcess assertions fine.

  • UIProcess/UserMediaPermissionRequestManagerProxy.cpp:

(WebKit::UserMediaPermissionRequestManagerProxy::~UserMediaPermissionRequestManagerProxy):

1:42 AM Changeset in webkit [250290] by youenn@apple.com
  • 3 edits in trunk/Source/WebCore

AudioTrackPrivateMediaStreamCocoa does not need to manipulate the audio unit in play/pause methods
https://bugs.webkit.org/show_bug.cgi?id=202097
<rdar://problem/51548144>

Reviewed by Eric Carlson.

Instead of manipulating the audio unit in play/pause methods, it is more convenient to do so in audioSamplesAvailable.
play/pause methods only update boolean values that audioSamplesAvailable will read.
In particular, m_autoPlay and m_isPlaying are no longer modified in the audio thread.

Behavior was racy so difficult to reproduce.

  • platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:

(WebCore::AudioTrackPrivateMediaStreamCocoa::playInternal):
(WebCore::AudioTrackPrivateMediaStreamCocoa::pause):
(WebCore::AudioTrackPrivateMediaStreamCocoa::audioSamplesAvailable):

  • platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.h:
12:43 AM Changeset in webkit [250289] by mark.lam@apple.com
  • 8 edits
    1 add in trunk/Source/JavaScriptCore

Refactor cellSize() out of VMInspector::verifyCellSize().
https://bugs.webkit.org/show_bug.cgi?id=202132

Reviewed by Saam Barati.

  • CMakeLists.txt:
  • JavaScriptCore.xcodeproj/project.pbxproj:
  • runtime/CellSize.h: Added.

(JSC::isDynamicallySizedType):
(JSC::cellSize):

  • runtime/DirectArguments.h:
  • runtime/JSBigInt.h:
  • runtime/JSModuleNamespaceObject.h:
  • runtime/JSType.h:

(JSC::isDynamicallySizedType): Deleted.

  • tools/VMInspectorInlines.h:

(JSC::VMInspector::verifyCellSize):

Sep 23, 2019:

11:59 PM Changeset in webkit [250288] by youenn@apple.com
  • 9 edits
    1 delete in trunk

Support sync-xhr feature policy
https://bugs.webkit.org/show_bug.cgi?id=202098

Reviewed by Alex Christensen.

LayoutTests/imported/w3c:

Update test to use hosts[alt][].

  • web-platform-tests/xhr/xmlhttprequest-sync-default-feature-policy.sub-expected.txt:
  • web-platform-tests/xhr/xmlhttprequest-sync-default-feature-policy.sub.html:

Source/WebCore:

Add support for sync-xhr feature policy parsing.
Use this feature policy to control use of sync XHR in documents
as per https://xhr.spec.whatwg.org/#the-send()-method step 12.

Covered by updated test.

  • html/FeaturePolicy.cpp:

(WebCore::FeaturePolicy::parse):
(WebCore::FeaturePolicy::allows const):

  • html/FeaturePolicy.h:
  • xml/XMLHttpRequest.cpp:

(WebCore::isSyncXHRAllowedByFeaturePolicy):
(WebCore::XMLHttpRequest::createRequest):

LayoutTests:

  • TestExpectations: enable test.
  • platform/mac-wk1/imported/w3c/web-platform-tests/xhr/xmlhttprequest-sync-default-feature-policy.sub-expected.txt: Deleted.
11:28 PM Changeset in webkit [250287] by Chris Dumez
  • 58 edits in trunk/Source

Drop unnecessary SessionID.h header includes
https://bugs.webkit.org/show_bug.cgi?id=202129

Reviewed by Alex Christensen.

Source/WebCore:

  • Modules/fetch/FetchBodyConsumer.h:
  • Modules/indexeddb/IDBDatabaseIdentifier.h:
  • bindings/js/SerializedScriptValue.h:
  • dom/DataTransfer.h:
  • editing/WebCorePasteboardFileReader.h:
  • fileapi/FileReaderLoader.h:
  • fileapi/ThreadableBlobRegistry.h:
  • html/FileListCreator.h:
  • loader/CookieJar.h:
  • loader/EmptyFrameLoaderClient.h:
  • loader/FrameLoaderClient.h:
  • loader/LoaderStrategy.h:
  • page/CacheStorageProvider.h:
  • page/Frame.h:
  • page/PageGroup.h:
  • platform/mediastream/libwebrtc/LibWebRTCProvider.h:
  • platform/network/CacheValidation.h:
  • platform/network/FormData.h:
  • platform/network/NetworkStorageSession.cpp:
  • platform/network/StorageSessionProvider.h:
  • workers/WorkerGlobalScopeProxy.h:
  • workers/service/ServiceWorkerContainer.h:
  • workers/service/ServiceWorkerProvider.h:
  • workers/service/server/RegistrationDatabase.h:
  • workers/service/server/SWServer.h:
  • workers/service/server/SWServerToContextConnection.h:
  • worklets/WorkletGlobalScope.h:

Source/WebKit:

  • NetworkProcess/AdClickAttributionManager.h:
  • NetworkProcess/IndexedDB/WebIDBConnectionToClient.h:
  • NetworkProcess/NetworkLoadParameters.h:
  • NetworkProcess/RemoteNetworkingContext.h:
  • NetworkProcess/cache/CacheStorageEngine.cpp:
  • NetworkProcess/cache/CacheStorageEngine.h:
  • NetworkProcess/cache/NetworkCache.h:
  • NetworkProcess/webrtc/NetworkRTCProvider.h:
  • Shared/ApplePay/WebPaymentCoordinatorProxy.h:
  • Shared/Authentication/AuthenticationManager.h:
  • Shared/WebCoreArgumentCoders.cpp:
  • Shared/WebProcessCreationParameters.h:
  • UIProcess/API/APIPageConfiguration.h:
  • WebProcess/Cache/WebCacheStorageProvider.h:
  • WebProcess/Databases/WebDatabaseProvider.cpp:
  • WebProcess/InjectedBundle/InjectedBundle.cpp:
  • WebProcess/InjectedBundle/InjectedBundle.h:
  • WebProcess/Network/WebSocketChannel.h:
  • WebProcess/Storage/WebSWContextManagerConnection.cpp:
  • WebProcess/Storage/WebServiceWorkerProvider.cpp:
  • WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
  • WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
  • WebProcess/WebCoreSupport/curl/WebFrameNetworkingContext.h:
  • WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h:
  • WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp:
  • WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.h:
  • WebProcess/WebPage/WebFrame.h:
11:16 PM Changeset in webkit [250286] by zandobersek@gmail.com
  • 6 edits
    1 delete in trunk

run-web-platform-tests: remove support for in-repository manifest, expectation management
https://bugs.webkit.org/show_bug.cgi?id=202037

Reviewed by Carlos Alberto Lopez Perez.

.:

Remove the test expecations JSON and test manifest file that were used
for managing and generating the necessary wptrunner metadata.

  • WebPlatformTests/gtk/TestExpectations.json: Removed.
  • WebPlatformTests/gtk/TestManifest.ini: Removed.

Tools:

Instead of keeping wpt metadata inside the WebKit repository or have it
generated on-the-fly, provide additional option flags for the
run-web-platform-tests script that allows detailed specification of the
metadata, manifest and include manifest locations, if necessary.

If the metadata location is not provided, the wptrunner tool will simply
not rely on any metadata to adjust expected results. With no manifest
path specified, the manifest will be generated inside the wpt checkout.
If no include manifest is specified, all the tests will be initially
selected for running (until they're possibly filtered through additional
command line arguments).

  • Scripts/webkitpy/common/config/ports_mock.py:

(MockPort.run_bindings_tests_command):
(MockPort.wpt_metadata_directory): Deleted.
(MockPort.wpt_manifest_file): Deleted.

  • Scripts/webkitpy/port/base.py:

(Port.default_results_directory):
(Port.wpt_metadata_directory): Deleted.
(Port.wpt_manifest_file): Deleted.

  • Scripts/webkitpy/w3c/wpt_runner.py:

(parse_args):
(WPTRunner.prepare_wpt_checkout):
(WPTRunner.run):
(WPTRunner._generate_metadata_directory): Deleted.
(WPTRunner._wpt_run_paths): Deleted.

  • Scripts/webkitpy/w3c/wpt_runner_unittest.py:

(WPTRunnerTest.TestInstance.init):
(WPTRunnerTest.test_prepare_wpt_checkout_specified_path):
(WPTRunnerTest.test_run):
(WPTRunnerTest.test_run_with_specified_options):
(WPTRunnerTest.test_run_with_args):
(WPTRunnerTest.TestInstance.prepare_mock_files_for_run): Deleted.
(WPTRunnerTest.test_generate_metadata_directory): Deleted.

11:02 PM Changeset in webkit [250285] by mark.lam@apple.com
  • 19 edits
    4 adds in trunk/Source/JavaScriptCore

Introducing Integrity audit functions.
https://bugs.webkit.org/show_bug.cgi?id=202085

Reviewed by Saam Barati.

This patch's main goal is to introduce the Integrity audit functions. They can
be used wherever we want to audit a cell to probabilistically ensure it is not
corrupted. However, to keep this patch small, we will only introduce the audit
tool here with one example use in SlotVisitor. We'll follow up later with more
patches to deploy this tool throughout the VM.

  1. Introduced Integrity audit functions that can be configured at several AuditLevels:

None - don't do any audits.
Minimal - do a minimal quick audit (minimize perf impact).
Full - do a full audit of the many aspects of a cell.
Random - randomly do a full audit with a probability dictated by

Options::randomIntegrityAuditRate() between 0.0 (never audit) and
1.0 (audit at every chance).

The default AuditLevel for Debug builds is Random.
The default AuditLevel for Release builds is None.
The default Options::randomIntegrityAuditRate() is 0.05.

How full audits work?
====================
The full audit uses the VMInspector::verifyCell() template function to do its
job. The reason for keeping this separate is to allow the template function
to be used later for debug checks that want to take some custom action on
verification failure instead of crashing with a RELEASE_ASSERT.

Full audit of a cell pointer includes:

  1. Verify that a cell designated as a LargeAllocation is in the heap's set of LargeAllocations.
  1. Verify that a cell not designated as a LargeAllocation is actually in its MarkedBlock's bounds.
  1. Verify that the cell's container (LargeAllocation / MarkedBlock) actually belongs to the current VM.
  1. Verify that a cell in a MarkedBlock is properly aligned on the block's allocation unit size.
  1. If the cell is not an ImmutableButterfly, verify that it is not located in the Gigacage.
  1. Verify that the cell's JSType matches its StructureBlob's JSType.
  1. Verify that the cell size as dictated by the cell ClassInfo does not exceed the size of the allocation unit size (as expected by the container MarkedBlock or LargeAllocation).

Some cells are dynamically size (see isDynamicallySizedType()). For these
cells, we compute their sizes and verify that the size does not exceed the
allocation unit size. Their sizes should also be greater or equal to the
static cell size as dictated by their ClassInfo.

  1. If a cell has a butterfly, verify that the butterfly is in its the JSValue Gigacage.

We can add more verifications later, or make some these more robust, but this
is a start for now.

How random audits work?
======================
Random audits are triggered by the m_triggerBits bits in VM::m_integrityRandom.
m_triggerBits is a 64-bit bitfield.

If Options::randomIntegrityAuditRate() is 0, m_triggerBits will always be 0,
and no audits will be done.

If Options::randomIntegrityAuditRate() is non-zero, m_triggerBits will be
initialized as follows:

| 1 reload bit | ... 63 trigger bits ... |

The reload bit is always set (more details below).
Each of the 63 trigger bits are randomly set depending if the following is true
for the bit:

VM::random() <= Options::randomIntegrityAuditRate() * UINT_MAX

When Integrity::auditCell() is called, we take the bottom bit as the trigger
bit for the current cell, and shifts the rest down by 1.

If m_triggerBits is non-null after the shift, the taken trigger bit will dictate
whether we do a full audit on the current cell or not.

Once the reload bit reaches the bottom, we call a reload function to
re-initialize m_triggerBits. The reload function also returns a bool
indicating whether to trigger a full audit of the current cell.

With this scheme, we only need to call the reload function once every 64 calls
to Integrity::auditCell(), and can efficiently determine whether to trigger
the audit the other 63 times with the probability specified in
Options::randomIntegrityAuditRate().

  1. Embedded the C++ class size of JSCells into their ClassInfo. This is used in the full audits to verify cell sizes.
  1. Added isDynamicallySizedType() to check if a JSType has a dynamic size allocation i.e. the size of instances of this type is not determined by the static C++ size of its class, but rather, depends on some runtime variable.
  1. Made the VMInspector a friend of several classes so that it can access their private methods and fields.
  1. Moved the inline function JSBigInt::allocationSize() from BigInt.cpp to its header file so that we can use it in VMInspector::verifyCellSize().
  1. Gave the JSModuleNamespaceObject() its own JSType so that we can identify it as a dynamically sized object.
  1. Increased the randomness of VM::random() (which is implemented with WeakRandom) by re-seeding it with a cryptographically random number each GC.
  1. Called Integrity::auditCell() on SlotVisitor::appendJSCellOrAuxiliary()'s cell as an example use of auditCell(). More uses will be added in later patches to follow.
  • CMakeLists.txt:
  • JavaScriptCore.xcodeproj/project.pbxproj:
  • Sources.txt:
  • heap/Heap.cpp:

(JSC::Heap::runBeginPhase):

  • heap/SlotVisitor.cpp:

(JSC::SlotVisitor::appendJSCellOrAuxiliary):

  • runtime/ClassInfo.h:
  • runtime/DirectArguments.h:
  • runtime/JSBigInt.cpp:

(JSC::JSBigInt::allocationSize): Deleted.

  • runtime/JSBigInt.h:

(JSC::JSBigInt::allocationSize):

  • runtime/JSModuleNamespaceObject.h:
  • runtime/JSType.cpp:

(WTF::printInternal):

  • runtime/JSType.h:

(JSC::isDynamicallySizedType):

  • runtime/Options.cpp:

(JSC::recomputeDependentOptions):

  • runtime/OptionsList.h:
  • runtime/Structure.h:
  • runtime/VM.cpp:

(JSC::VM::VM):

  • runtime/VM.h:

(JSC::VM::random):
(JSC::VM::integrityRandom):

  • tools/Integrity.cpp: Added.

(JSC::Integrity::Random::Random):
(JSC::Integrity::Random::reloadAndCheckShouldAuditSlow):
(JSC::Integrity::auditCellFully):
(JSC::Integrity::auditCellMinimallySlow):

  • tools/Integrity.h: Added.

(JSC::Integrity::auditCell):

  • tools/IntegrityInlines.h: Added.

(JSC::Integrity::Random::shouldAudit):
(JSC::Integrity::auditCellMinimally):
(JSC::Integrity::auditCellRandomly):

  • tools/VMInspector.h:

(JSC::VMInspector::unusedVerifier):
(JSC::VMInspector::verifyCellSize):

  • tools/VMInspectorInlines.h: Added.

(JSC::VMInspector::verifyCellSize):
(JSC::VMInspector::verifyCell):

10:39 PM Changeset in webkit [250284] by aestes@apple.com
  • 1 edit in branches/safari-608-branch/Source/WebCore/bindings/js/JSDOMConvertRecord.h

Unreviewed build fix after r250266.

  • bindings/js/JSDOMConvertRecord.h:
10:25 PM Changeset in webkit [250283] by commit-queue@webkit.org
  • 11 edits in trunk

Fix WPT test html/browsers/offline/application-cache-api/api_swapcache_error.https.html
https://bugs.webkit.org/show_bug.cgi?id=202056
<rdar://problem/55523986>

Patch by Alex Christensen <achristensen@webkit.org> on 2019-09-23
Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

  • web-platform-tests/html/browsers/offline/application-cache-api/api_swapcache_error.https-expected.txt:

Source/WebCore:

The test makes sure we throw an exception when we are in an invalid state, which we should definitely do.

  • loader/appcache/ApplicationCache.cpp:

(WebCore::ApplicationCache::setGroup):
(WebCore::ApplicationCache::setManifestResource):

  • loader/appcache/ApplicationCache.h:

(WebCore::ApplicationCache::manifestResource const):
(WebCore::ApplicationCache::group const):

  • loader/appcache/ApplicationCacheGroup.h:
  • loader/appcache/ApplicationCacheHost.cpp:

(WebCore::ApplicationCacheHost::candidateApplicationCacheGroup const):
(WebCore::ApplicationCacheHost::failedLoadingMainResource):
(WebCore::ApplicationCacheHost::setCandidateApplicationCacheGroup):
(WebCore::ApplicationCacheHost::swapCache):

  • loader/appcache/ApplicationCacheHost.h:

(WebCore::ApplicationCacheHost::candidateApplicationCacheGroup const): Deleted.

  • loader/appcache/ApplicationCacheResource.h:

LayoutTests:

10:11 PM Changeset in webkit [250282] by aestes@apple.com
  • 1 edit in branches/safari-608-branch/Source/WebKit/Platform/cocoa/PaymentAuthorizationPresenter.mm

Unreviewed build fix after r250267.

  • Platform/cocoa/PaymentAuthorizationPresenter.mm:

(WebKit::PaymentAuthorizationPresenter::completeShippingContactSelection):

9:37 PM Changeset in webkit [250281] by Chris Dumez
  • 6 edits in trunk/Source

PlugInClient::didStartFromOrigin() does not need a sessionID
https://bugs.webkit.org/show_bug.cgi?id=202127

Reviewed by Geoffrey Garen.

Source/WebCore:

  • html/HTMLPlugInImageElement.cpp:

(WebCore::HTMLPlugInImageElement::userDidClickSnapshot):

  • page/PlugInClient.h:

Source/WebKit:

  • WebProcess/WebCoreSupport/WebPlugInClient.cpp:

(WebKit::WebPlugInClient::didStartFromOrigin):

  • WebProcess/WebCoreSupport/WebPlugInClient.h:
9:26 PM Changeset in webkit [250280] by Chris Dumez
  • 3 edits in trunk/Source/WebKit

FrameSpecificStorageAccessIdentifier does not need a sessionID
https://bugs.webkit.org/show_bug.cgi?id=202093

Reviewed by Geoffrey Garen.

  • WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
  • WebProcess/WebPage/WebPage.cpp:

(WebKit::WebPage::requestStorageAccess):

8:54 PM Changeset in webkit [250279] by Fujii Hironori
  • 2 edits in trunk/Tools

[Win][WebKitTestRunner] Implement EventSenderProxy::keyDown
https://bugs.webkit.org/show_bug.cgi?id=201913

Reviewed by Ross Kirsling.

Implemented eventSender.keyDown for Windows WebKitTestRunner based
on DumpRenderTree implementation.

There is a difference between them. Only WTR truns KF_UP and
KF_REPEAT flags on for WM_KEYUP event.
EventSenderProxy::dispatchMessage is used in WTR. It calls
TranslateMessage, this introduces the difference. If I didn't turn
those bits, TranslateMessage posts WM_CHAR even for WM_KEYUP.
According the spec, WM_KEYUP needs those bits.
<https://docs.microsoft.com/en-us/windows/win32/inputdev/wm-keyup>
DRT doesn't need the those bits becasuse it doesn't use
TranslateMessage for WM_KEYUP.

  • WebKitTestRunner/win/EventSenderProxyWin.cpp:

(WTR::makeKeyDataForScanCode): Added.
(WTR::pumpMessageQueue): Added.
(WTR::EventSenderProxy::keyDown): Implemented by using DRT code.

7:13 PM Changeset in webkit [250278] by commit-queue@webkit.org
  • 8 edits
    1 add in trunk/Source/JavaScriptCore

Unreviewed, rolling out r250262.
https://bugs.webkit.org/show_bug.cgi?id=202126

"Breaks Win64 builds because of MSVC bug" (Requested by mlam|a
on #webkit).

Reverted changeset:

"Reduce the amount of memory needed to store Options."
https://bugs.webkit.org/show_bug.cgi?id=202105
https://trac.webkit.org/changeset/250262

5:51 PM Changeset in webkit [250277] by Devin Rousso
  • 3 edits in trunk/Source/WebInspectorUI

Web Inspector: Canvas: WebGPU compute shaders aren't syntax highlighted
https://bugs.webkit.org/show_bug.cgi?id=202030

Reviewed by Joseph Pecoraro.

  • UserInterface/Views/CodeMirrorAdditions.js:

CodeMirror.defineMIME expects a "spec" object, which can't just be another MIME type.
Instead, get the "spec" of the defined "x-shader/x-vertex" and "x-shader/x-fragment" modes
and use that when defining MIMEs for the WebGPU shader pipeline modes.

  • UserInterface/Views/ShaderProgramContentView.js:

(WI.ShaderProgramContentView):
Get the contextType off of the shader's canvas, which is where it actually lives.

5:46 PM Changeset in webkit [250276] by commit-queue@webkit.org
  • 4 edits
    2778 adds in trunk/LayoutTests

Import SVG web-platform-tests
https://bugs.webkit.org/show_bug.cgi?id=202017

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2019-09-23
Reviewed by Tim Horton.

  • TestExpectations:
  • imported/w3c/resources/import-expectations.json:
  • imported/w3c/web-platform-tests/resources/SVGAnimationTestCase-testharness.js:
  • imported/w3c/web-platform-tests/svg: Added.
  • platform/ios-simulator/imported/w3c/web-platform-tests/svg: Added.
  • platform/mac/imported/w3c/web-platform-tests/svg: Added.
  • tests-options.json:
5:26 PM Changeset in webkit [250275] by Ross Kirsling
  • 5 edits
    1 add in trunk

Array methods should throw TypeError upon attempting to modify a string
https://bugs.webkit.org/show_bug.cgi?id=201910

Reviewed by Keith Miller.

JSTests:

  • stress/array-methods-should-not-modify-string.js: Added.
  • mozilla/js1_6/Array/regress-304828.js:

Fix test. Original copy was changed similarly seven years ago:
https://searchfox.org/mozilla-central/source/js/src/tests/non262/Array/regress-304828.js

  • stress/phantom-insertion-live-range-should-agree-with-arguments-forwarding.js:

Fix test. Object.__proto__ = []; Object.shift(); shouldn't be valid JS.

Source/JavaScriptCore:

We currently allow Array prototype methods to modify strings that they are called upon in certain cases.
(In particular, we're inconsistent about permitting writes to the length property.)

According to section 22.1.3 of the ES spec, this should result in a TypeError.
https://tc39.es/ecma262/#sec-properties-of-the-array-prototype-object
(Test262 cases are needed, but the key is that all such methods use Set(..., true) which throws on failure.)

  • runtime/ArrayPrototype.cpp:

(JSC::putLength):
(JSC::setLength):
Never update the length property of a non-JSArray without checking whether we're actually allowed to.

5:13 PM Changeset in webkit [250274] by Alan Coon
  • 4 edits
    4 adds in branches/safari-608-branch

Cherry-pick r250183. rdar://problem/55608006

[Pointer Events] touch-action set to pan-x or pan-y alone should disable scrolling altogether if the intial gesture is in the disallowed direction
https://bugs.webkit.org/show_bug.cgi?id=202053
<rdar://problem/54542190>

Reviewed by Tim Horton.

Source/WebKit:

Although the Pointer Events specification does not specify this clearly (see https://github.com/w3c/pointerevents/issues/303), setting "touch-action" to a value
that only allows scrolling a specific direction ("pan-x" or "pan-y") should disable scrolling in the specified direction if the panning gesture initially is directed
in the opposite direction. In practice, this means that setting "touch-action: pan-y" on an element should disable scrolling if the user initially pans horizontally,
even if later on in the gesture the user pans vertically. This allows for sites that want to offer a programmatic horizontal scroller to disable vertical scrolling
if the user pans horizontally.

In order to support this, we add four UISwipeGestureRecognizers, one for each direction, and we selectively allows touches to be recognizer for them based on the
"touch-action" value specified at the initial touch location for a given gesture. In the case of "touch-action: pan-y" we only allow the left and right swipe recognizers
to be enabled, and in the case of "touch-action: pan-x" we only allow the up and down swipe recognizers to be enabled. If any of those gesture recognizers is recognized,
scrolling will be disabled for the duration of this gesture. If a UIScrollView panning gesture recognizer is recognized prior to a swipe, they won't have a chance to be
recognized.

  • UIProcess/ios/WKContentViewInteraction.h:
  • UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView setupInteraction]): (-[WKContentView cleanupInteraction]): (-[WKContentView _removeDefaultGestureRecognizers]): (-[WKContentView _addDefaultGestureRecognizers]): (-[WKContentView gestureRecognizer:shouldReceiveTouch:]):

LayoutTests:

Add new tests checking that setting "touch-action: pan-y" on an element and initiating a horizontal panning gesture will disallow scrolling vertically
if a vertical scrolling gesture follows. We test both the case where scrolling would apply to the whole page and the case where scrolling would apply
to an "overflow: scroll" element.

  • pointerevents/ios/touch-action-pan-y-horizontal-gesture-prevents-vertical-scrolling-expected.txt: Added.
  • pointerevents/ios/touch-action-pan-y-horizontal-gesture-prevents-vertical-scrolling.html: Added.
  • pointerevents/ios/touch-action-pan-y-in-overflow-scroll-horizontal-gesture-prevents-vertical-scrolling-expected.txt: Added.
  • pointerevents/ios/touch-action-pan-y-in-overflow-scroll-horizontal-gesture-prevents-vertical-scrolling.html: Added.

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

5:13 PM Changeset in webkit [250273] by Alan Coon
  • 5 edits
    4 adds in branches/safari-608-branch

Cherry-pick r250182. rdar://problem/55608034

releasePointerCapture() not working for implicit capture; can't opt-in to pointerenter/leave for touches
https://bugs.webkit.org/show_bug.cgi?id=199803
<rdar://problem/53127223>

Reviewed by Dean Jackson.

Source/WebCore:

In order to dispatch boundary events (pointerover/out/enter/leave) when the implicit pointer capture is released on iOS,
we need to track the target of the pointer events that was dispatched last for a given pointer id. Then we compare that
target with the current target when dispatching a new pointer event and determine whether we should dispatch boundary
events using the exact same approach used to dispatch mouse boundary events in EventHandler::updateMouseEventTargetNode().

Tests: pointerevents/ios/boundary-events-through-hierarchy-without-pointer-capture.html

pointerevents/ios/boundary-events-without-pointer-capture.html

  • page/PointerCaptureController.cpp: (WebCore::hierarchyHasCapturingEventListeners): (WebCore::PointerCaptureController::dispatchEventForTouchAtIndex): (WebCore::PointerCaptureController::pointerEventWillBeDispatched): (WebCore::PointerCaptureController::ensureCapturingDataForPointerEvent): (WebCore::PointerCaptureController::cancelPointer):
  • page/PointerCaptureController.h:

LayoutTests:

Add new tests that check we correctly dispatch boundary events on iOS when pointer capture is disabled.

  • pointerevents/ios/boundary-events-through-hierarchy-without-pointer-capture-expected.txt: Added.
  • pointerevents/ios/boundary-events-through-hierarchy-without-pointer-capture.html: Added.
  • pointerevents/ios/boundary-events-without-pointer-capture-expected.txt: Added.
  • pointerevents/ios/boundary-events-without-pointer-capture.html: Added.
  • pointerevents/utils.js:

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

5:13 PM Changeset in webkit [250272] by Alan Coon
  • 5 edits in branches/safari-608-branch/Source/WebKit

Cherry-pick r250157. rdar://problem/55607994

Sanitize suggested filenames used for saving PDFs
https://bugs.webkit.org/show_bug.cgi?id=202034
<rdar://problem/53183075>

Reviewed by Chris Dumez.

  • UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didFinishLoadingDataForCustomContentProvider): (WebKit::WebPageProxy::saveDataToFileInDownloadsFolder): (WebKit::WebPageProxy::savePDFToFileInDownloadsFolder):
  • UIProcess/WebPageProxy.h:
  • UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::savePDFToTemporaryFolderAndOpenWithNativeApplicationRaw): Deleted.
  • UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::savePDFToTemporaryFolderAndOpenWithNativeApplication): (WebKit::WebPageProxy::savePDFToTemporaryFolderAndOpenWithNativeApplicationRaw): Deleted. Sanitize suggested filenames to ensure that they comprise only one path component when concatenated with their destination directory.

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

5:13 PM Changeset in webkit [250271] by Alan Coon
  • 13 edits
    1 add in branches/safari-608-branch

Cherry-pick r250116. rdar://problem/55608003

[JSC] DFG op_call_varargs should not assume that one-previous-local of freeReg is usable
https://bugs.webkit.org/show_bug.cgi?id=202014

Reviewed by Saam Barati.

JSTests:

  • stress/call-varargs-inlining-should-not-clobber-previous-to-free-register.js: Added. (v0):

Source/JavaScriptCore:

Let's look into the bytecode generated by the test.

[ 0] enter
[ 1] get_scope loc4
[ 3] mov loc5, loc4
[ 6] check_traps
[ 7] mov loc6, callee
[ 10] create_direct_arguments loc7
[ 12] to_this this
[ 15] mov loc8, loc7
[ 18] mov loc9, loc6
[ 21] mov loc12, Undefined(const0)
[ 24] get_by_id loc11, loc6, 0
[ 29] jneq_ptr loc11, ApplyFunction, 18(->47)
[ 34] mov loc11, loc6
[ 37] call_varargs loc11, loc11, this, loc8, loc13, 0
[ 45] jmp 17(->62)
[ 47] mov loc16, loc6
[ 50] mov loc15, this
[ 53] mov loc14, loc8
[ 56] call loc11, loc11, 3, 22
...

call_varargs uses loc13 as firstFreeReg (first usable bottom register in the current stack-frame to spread variadic arguments after this).
This is correct. And call_varargs uses |this| as this argument for the call_varargs. This |this| argument is not in a region starting from loc13.
And it is not in the previous place to loc13 (|this| is not loc12).

On the other hand, DFG::ByteCodeParser's inlining path is always assuming that the previous to firstFreeReg is usable and part of arguments.
But this is wrong. loc12 in the above bytecode is used for [ 56] call loc11, loc11, 3, 22's argument later, and this call assumes
that loc12 is not clobbered by call_varargs. But DFG and FTL clobbers it.

The test is recursively calling the same function, and we inline the same function one-level. And stack-overflow error happens when inlined
CallForwardVarargs (from op_call_varargs) is called. FTL recovers the frames, and at this point, outer function's loc12 is recovered to garbage since
LoadVarargs clobbers it. And we eventually use it and crash.

60:<!0:-> LoadVarargs(Check:Untyped:Kill:@30, MustGen, start = loc13, count = loc15, machineStart = loc7, machineCount = loc9, offset = 0, mandatoryMinimum = 0, limit = 2, R:World, W:Stack(-16),Stack(-14),Stack(-13),Heap, Exits, ClobbersExit, bc#37, ExitValid)

This LoadVarargs clobbers loc12, loc13, and loc15 while loc12 is used.

In all the tiers, op_call_varargs first allocates enough region to hold varargs including |this|. And we store |this| value to a correct place.
DFG should not assume that the previous register to firstFreeReg is used for |this|.

This patch fixes DFG::ByteCodeParser's stack region calculation for op_call_varargs inlining. And we rename maxNumArguments to maxArgumentCountIncludingThis to
represent that maxArgumentCountIncludingThis includes |this| count.

  • bytecode/CallLinkInfo.cpp: (JSC::CallLinkInfo::setMaxArgumentCountIncludingThis): (JSC::CallLinkInfo::setMaxNumArguments): Deleted.
  • bytecode/CallLinkInfo.h: (JSC::CallLinkInfo::addressOfMaxArgumentCountIncludingThis): (JSC::CallLinkInfo::maxArgumentCountIncludingThis): (JSC::CallLinkInfo::addressOfMaxNumArguments): Deleted. (JSC::CallLinkInfo::maxNumArguments): Deleted.
  • bytecode/CallLinkStatus.cpp: (JSC::CallLinkStatus::computeFor): (JSC::CallLinkStatus::dump const):
  • bytecode/CallLinkStatus.h: (JSC::CallLinkStatus::maxArgumentCountIncludingThis const): (JSC::CallLinkStatus::maxNumArguments const): Deleted.
  • dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::handleVarargsInlining):
  • dfg/DFGSpeculativeJIT32_64.cpp: (JSC::DFG::SpeculativeJIT::emitCall):
  • dfg/DFGSpeculativeJIT64.cpp: (JSC::DFG::SpeculativeJIT::emitCall):
  • ftl/FTLLowerDFGToB3.cpp: (JSC::FTL::DFG::LowerDFGToB3::compileDirectCallOrConstruct):
  • jit/JITCall.cpp: (JSC::JIT::compileSetupFrame):
  • jit/JITCall32_64.cpp: (JSC::JIT::compileSetupFrame):
  • jit/JITOperations.cpp:

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

5:13 PM Changeset in webkit [250270] by Alan Coon
  • 2 edits in branches/safari-608-branch/Source/WebKit

Cherry-pick r250108. rdar://problem/55608024

macCatalyst apps crash under TextCheckingControllerProxy::replaceRelativeToSelection when spell checking
https://bugs.webkit.org/show_bug.cgi?id=202010
<rdar://problem/54974971>

Reviewed by Beth Dakin.

  • WebProcess/WebPage/Cocoa/TextCheckingControllerProxy.mm: (WebKit::TextCheckingControllerProxy::replaceRelativeToSelection): relativeReplacementRange is in the coordinate space of the document's text, not the replacement string. We need to adjust into replacement string coordinates before slicing the replacement, or we'll throw an exception trying to read past the end of the string, in the case where the replacement string is shorter than the replaced string (by more than 2 characters).

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

5:13 PM Changeset in webkit [250269] by Alan Coon
  • 2 edits in branches/safari-608-branch/Source/WebKit

Cherry-pick r250069. rdar://problem/55524981

Eagerly create and add the m_layerHostingView to WKWebView.
https://bugs.webkit.org/show_bug.cgi?id=201942

Reviewed by Tim Horton.

Some apps will add subviews to WKWebView, and by the time we add our m_layerHostingView view we might be
adding it behind a view that should have been added behind our layer hosting view subview. This affected
the Spark email app, due to changes in order of loading delegate calls and when compositing is enabled.
Instead of delayed creation of m_layerHostingView, always create it and add it to to the WKWebView.
This ensures proper ordering of subviews when clients add a view behind all existing subviews.

  • UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::WebViewImpl): Create and add m_layerHostingView here. (WebKit::WebViewImpl::setAcceleratedCompositingRootLayer): Remove creation and removal of m_layerHostingView. Just set the sublayers of m_layerHostingView's layer here.

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

5:13 PM Changeset in webkit [250268] by Alan Coon
  • 3 edits in branches/safari-608-branch/Source/WebKitLegacy/mac

Cherry-pick r250066. rdar://problem/55608013

Add -suspend and -resumeAllMediaPlayback to WebView
https://bugs.webkit.org/show_bug.cgi?id=201951

Reviewed by Eric Carlson.

  • WebView/WebView.mm: (-[WebView suspendAllMediaPlayback]): (-[WebView resumeAllMediaPlayback]):
  • WebView/WebViewPrivate.h:

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

4:50 PM Changeset in webkit [250267] by Alan Coon
  • 21 edits
    3 copies
    1 add in branches/safari-608-branch/Source

Apply patch. rdar://problem/55608031

Clean up handling of summary items and payment method updates https://bugs.webkit.org/show_bug.cgi?id=202018 <rdar://problem/55470632>

Reviewed by Tim Horton.

Source/WebCore:

Replaced the PaymentMethodUpdate struct with a class that knows how to convert from
ApplePayPaymentMethodUpdate structs to PKPaymentRequestPaymentMethodUpdate instances.

Moved some scattered-around free functions for converting payment summary items into
PaymentSummaryItems{.h,Cocoa.mm}.

  • Modules/applepay/ApplePayPaymentMethodUpdate.h:
  • Modules/applepay/ApplePaySession.cpp: (WebCore::finishConverting): (WebCore::convertAndValidateTotal): (WebCore::convertAndValidate):
  • Modules/applepay/ApplePaySessionPaymentRequest.h:
  • Modules/applepay/PaymentCoordinator.h:
  • Modules/applepay/PaymentCoordinatorClient.h:
  • Modules/applepay/PaymentHeaders.h:
  • Modules/applepay/PaymentMethodUpdate.h: Added.
  • Modules/applepay/PaymentSummaryItems.h: Added.
  • Modules/applepay/cocoa/PaymentMethodUpdateCocoa.mm: Added. (WebCore::PaymentMethodUpdate::PaymentMethodUpdate): (WebCore::PaymentMethodUpdate::totalAndLineItems const): (WebCore::PaymentMethodUpdate::platformUpdate const):
  • Modules/applepay/cocoa/PaymentSummaryItemsCocoa.mm: Added. (WebCore::toDecimalNumber): (WebCore::toPKPaymentSummaryItemType): (WebCore::toPKPaymentSummaryItem): (WebCore::platformSummaryItems):
  • Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp: (WebCore::ApplePayPaymentHandler::paymentMethodUpdated):
  • SourcesCocoa.txt:
  • WebCore.xcodeproj/project.pbxproj:
  • testing/MockPaymentCoordinator.cpp: (WebCore::MockPaymentCoordinator::completePaymentMethodSelection):

Source/WebKit:

Now that PaymentMethodUpdate knows how to convert itself to a
PKPaymentRequestPaymentMethodUpdate, PaymentAuthorizationPresenter can merely pass the
converted update directly to the platform delegate rather than passing the individual
components and relying on the delegate to instantiate the platform update itself. Added
FIXMEs for applying a similar treatment to ShippingContactUpdate and ShippingMethodUpdate.

  • Platform/cocoa/PaymentAuthorizationPresenter.h:
  • Platform/cocoa/PaymentAuthorizationPresenter.mm: (WebKit::PaymentAuthorizationPresenter::completePaymentMethodSelection): (WebKit::PaymentAuthorizationPresenter::completeShippingContactSelection): (WebKit::PaymentAuthorizationPresenter::completeShippingMethodSelection):
  • Platform/cocoa/WKPaymentAuthorizationDelegate.h:
  • Platform/cocoa/WKPaymentAuthorizationDelegate.mm: (-[WKPaymentAuthorizationDelegate completePaymentMethodSelection:]): (-[WKPaymentAuthorizationDelegate completeShippingContactSelection:]): (-[WKPaymentAuthorizationDelegate completeShippingMethodSelection:]): (-[WKPaymentAuthorizationDelegate _didSelectPaymentMethod:completion:]): (-[WKPaymentAuthorizationDelegate _didSelectShippingContact:completion:]): (-[WKPaymentAuthorizationDelegate _didSelectShippingMethod:completion:]): (-[WKPaymentAuthorizationDelegate completeShippingContactSelection:summaryItems:shippingMethods:errors:]): Deleted.
  • Shared/ApplePay/WebPaymentCoordinatorProxy.h:
  • Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h:
  • Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (WebKit::WebPaymentCoordinatorProxy::platformPaymentRequest): (WebKit::toPKPaymentSummaryItemType): Deleted. (WebKit::toPKPaymentSummaryItem): Deleted. (WebKit::toPKPaymentSummaryItems): Deleted.
  • Shared/Cocoa/WebCoreArgumentCodersCocoa.mm: (IPC::ArgumentCoder<WebCore::PaymentMethodUpdate>::encode): (IPC::ArgumentCoder<WebCore::PaymentMethodUpdate>::decode):
4:50 PM Changeset in webkit [250266] by Alan Coon
  • 33 edits
    7 copies
    2 adds in branches/safari-608-branch

Apply patch. rdar://problem/55608028

Tell websites why a session was cancelled https://bugs.webkit.org/show_bug.cgi?id=201912 Source/WebCore:

Reviewed by Brady Eidson.

Added ApplePayCancelEvent as the interface for ApplePaySession's cancel event. This event
object includes a sessionError attribute that exposes a Web-safe version of the PassKit
domain error we received from PKPaymentAuthorization(View)Controller. Currently, we report
all errors with code "unknown", but more codes will be added in future patches.

Test: http/tests/ssl/applepay/ApplePayCancelEvent.https.html

  • DerivedSources-input.xcfilelist:
  • DerivedSources-output.xcfilelist:
  • DerivedSources.make:
  • Modules/applepay/ApplePayCancelEvent.cpp: Copied from Source/WebCore/Modules/applepay/PaymentHeaders.h. (WebCore::ApplePayCancelEvent::ApplePayCancelEvent): (WebCore::ApplePayCancelEvent::sessionError const): (WebCore::ApplePayCancelEvent::eventInterface const):
  • Modules/applepay/ApplePayCancelEvent.h: Copied from Source/WebCore/Modules/applepay/PaymentHeaders.h. (WebCore::ApplePayCancelEvent::create):
  • Modules/applepay/ApplePayCancelEvent.idl: Copied from Source/WebCore/Modules/applepay/PaymentHeaders.h.
  • Modules/applepay/ApplePaySession.cpp: (WebCore::ApplePaySession::didCancelPaymentSession):
  • Modules/applepay/ApplePaySession.h:
  • Modules/applepay/ApplePaySessionError.h: Copied from Source/WebCore/Modules/applepay/PaymentHeaders.h.
  • Modules/applepay/ApplePaySessionError.idl: Copied from Source/WebCore/Modules/applepay/PaymentHeaders.h.
  • Modules/applepay/PaymentCoordinator.cpp: (WebCore::PaymentCoordinator::didCancelPaymentSession):
  • Modules/applepay/PaymentCoordinator.h:
  • Modules/applepay/PaymentHeaders.h:
  • Modules/applepay/PaymentSession.cpp:
  • Modules/applepay/PaymentSession.h:
  • Modules/applepay/PaymentSessionError.h: Copied from Source/WebCore/Modules/applepay/PaymentHeaders.h.
  • Modules/applepay/cocoa/PaymentSessionErrorCocoa.mm: Copied from Source/WebCore/Modules/applepay/PaymentSession.h. (WebCore::additionalError): (WebCore::PaymentSessionError::PaymentSessionError): (WebCore::PaymentSessionError::sessionError const): (WebCore::PaymentSessionError::platformError const): (WebCore::PaymentSessionError::unknownError const):
  • Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp: (WebCore::ApplePayPaymentHandler::didCancelPaymentSession):
  • Modules/applepay/paymentrequest/ApplePayPaymentHandler.h:
  • Modules/webgpu/WHLSL/WHLSLCheckTextureReferences.cpp:
  • Modules/webgpu/WHLSL/WHLSLPropertyResolver.cpp:
  • SourcesCocoa.txt:
  • WebCore.xcodeproj/project.pbxproj:
  • dom/EventNames.in:
  • testing/MockPaymentCoordinator.cpp: (WebCore::MockPaymentCoordinator::cancelPayment):

Source/WebCore/PAL:

<rdar://problem/55469706>

Reviewed by Brady Eidson.

Soft-linked PKPassKitErrorDomain and included PassKit headers more judiciously.

  • pal/cocoa/PassKitSoftLink.h:
  • pal/cocoa/PassKitSoftLink.mm:
  • pal/spi/cocoa/PassKitSPI.h:

Source/WebKit:

<rdar://problem/55469706>

Reviewed by Brady Eidson.

Remembered the error passed to -[WKPaymentAuthorizationDelegate _willFinishWithError:] and
sent it to the WebContent process in Messages::WebPaymentCoordinator::DidCancelPaymentSession.

  • Platform/cocoa/PaymentAuthorizationPresenter.h:
  • Platform/cocoa/WKPaymentAuthorizationDelegate.mm: (-[WKPaymentAuthorizationDelegate _didFinish]): (-[WKPaymentAuthorizationDelegate _willFinishWithError:]):
  • Shared/ApplePay/WebPaymentCoordinatorProxy.cpp: (WebKit::WebPaymentCoordinatorProxy::didCancelPaymentSession): (WebKit::WebPaymentCoordinatorProxy::presenterDidFinish):
  • Shared/ApplePay/WebPaymentCoordinatorProxy.h: (WebKit::WebPaymentCoordinatorProxy::didCancelPaymentSession):
  • Shared/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm:
  • Shared/Cocoa/WebCoreArgumentCodersCocoa.mm: (IPC::ArgumentCoder<WebCore::PaymentSessionError>::encode): (IPC::ArgumentCoder<WebCore::PaymentSessionError>::decode):
  • Shared/WebCoreArgumentCoders.h:
  • WebProcess/ApplePay/WebPaymentCoordinator.cpp: (WebKit::WebPaymentCoordinator::networkProcessConnectionClosed): (WebKit::WebPaymentCoordinator::didCancelPaymentSession):
  • WebProcess/ApplePay/WebPaymentCoordinator.h:
  • WebProcess/ApplePay/WebPaymentCoordinator.messages.in:

LayoutTests:

Reviewed by Brady Eidson.

  • http/tests/ssl/applepay/ApplePayCancelEvent.https-expected.txt: Added.
  • http/tests/ssl/applepay/ApplePayCancelEvent.https.html: Added.
4:49 PM Changeset in webkit [250265] by Alan Coon
  • 2 edits in branches/safari-608-branch/Source/WebCore

Cherry-pick r250026. rdar://problem/55608017

[Cocoa] Add a WKA extension point
https://bugs.webkit.org/show_bug.cgi?id=201801
<rdar://problem/55372507>

Reviewed by Alexey Proskuryakov.

  • Modules/applepay/ApplePayRequestBase.cpp: (WebCore::requiresSupportedNetworks): (WebCore::convertAndValidate):

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

4:33 PM Changeset in webkit [250264] by mark.lam@apple.com
  • 3 edits
    1 add in trunk

Lazy JSGlobalObject property materialization should not use putDirectWithoutTransition.
https://bugs.webkit.org/show_bug.cgi?id=202122
<rdar://problem/55535249>

Reviewed by Yusuke Suzuki.

JSTests:

  • stress/lazy-global-object-property-materialization-should-not-putDirectWithoutTransition.js: Added.

Source/JavaScriptCore:

  • runtime/JSGlobalObject.cpp:

(JSC::JSGlobalObject::init):

4:00 PM Changeset in webkit [250263] by graouts@webkit.org
  • 45 edits
    21 adds
    1 delete in trunk/LayoutTests

[Web Animations] Update WPT tests
https://bugs.webkit.org/show_bug.cgi?id=202110

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

  • web-platform-tests/web-animations/README.md:
  • web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-expected.txt:
  • web-platform-tests/web-animations/animation-model/animation-types/addition-per-property-expected.txt:
  • web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-expected.txt:
  • web-platform-tests/web-animations/animation-model/animation-types/property-list.js:
  • web-platform-tests/web-animations/animation-model/animation-types/property-types.js:
  • web-platform-tests/web-animations/animation-model/combining-effects/effect-composition-expected.txt:
  • web-platform-tests/web-animations/animation-model/combining-effects/effect-composition.html:
  • web-platform-tests/web-animations/animation-model/keyframe-effects/computed-keyframes-shorthands-expected.txt: Added.
  • web-platform-tests/web-animations/animation-model/keyframe-effects/computed-keyframes-shorthands.html: Added.
  • web-platform-tests/web-animations/animation-model/keyframe-effects/effect-value-context-filling-expected.txt: Added.
  • web-platform-tests/web-animations/animation-model/keyframe-effects/effect-value-context-filling.html: Added.
  • web-platform-tests/web-animations/animation-model/keyframe-effects/effect-value-iteration-composite-operation.html:
  • web-platform-tests/web-animations/animation-model/keyframe-effects/effect-value-replaced-animations-expected.txt: Added.
  • web-platform-tests/web-animations/animation-model/keyframe-effects/effect-value-replaced-animations.html: Added.
  • web-platform-tests/web-animations/animation-model/keyframe-effects/effect-value-transformed-distance-expected.txt:
  • web-platform-tests/web-animations/animation-model/keyframe-effects/effect-value-transformed-distance.html:
  • web-platform-tests/web-animations/interfaces/Animatable/animate-expected.txt:
  • web-platform-tests/web-animations/interfaces/Animatable/animate.html:
  • web-platform-tests/web-animations/interfaces/Animatable/getAnimations-expected.txt:
  • web-platform-tests/web-animations/interfaces/Animatable/getAnimations.html:
  • web-platform-tests/web-animations/interfaces/Animation/commitStyles-expected.txt: Added.
  • web-platform-tests/web-animations/interfaces/Animation/commitStyles.html: Added.
  • web-platform-tests/web-animations/interfaces/Animation/persist-expected.txt: Added.
  • web-platform-tests/web-animations/interfaces/Animation/persist.html: Added.
  • web-platform-tests/web-animations/interfaces/Animation/style-change-events-expected.txt: Added.
  • web-platform-tests/web-animations/interfaces/Animation/style-change-events.html: Added.
  • web-platform-tests/web-animations/interfaces/AnimationEffect/updateTiming-expected.txt:
  • web-platform-tests/web-animations/interfaces/Document/getAnimations-expected.txt:
  • web-platform-tests/web-animations/interfaces/Document/getAnimations.html:
  • web-platform-tests/web-animations/interfaces/DocumentTimeline/constructor.html:
  • web-platform-tests/web-animations/interfaces/DocumentTimeline/style-change-events-expected.txt: Added.
  • web-platform-tests/web-animations/interfaces/DocumentTimeline/style-change-events.html: Added.
  • web-platform-tests/web-animations/interfaces/KeyframeEffect/constructor-expected.txt:
  • web-platform-tests/web-animations/interfaces/KeyframeEffect/getKeyframes-expected.txt: Added.
  • web-platform-tests/web-animations/interfaces/KeyframeEffect/getKeyframes.html: Added.
  • web-platform-tests/web-animations/interfaces/KeyframeEffect/setKeyframes-expected.txt:
  • web-platform-tests/web-animations/interfaces/KeyframeEffect/style-change-events-expected.txt: Added.
  • web-platform-tests/web-animations/interfaces/KeyframeEffect/style-change-events.html: Added.
  • web-platform-tests/web-animations/interfaces/KeyframeEffect/target-expected.txt:
  • web-platform-tests/web-animations/interfaces/KeyframeEffect/target.html:
  • web-platform-tests/web-animations/resources/easing-tests.js:
  • web-platform-tests/web-animations/resources/keyframe-tests.js:
  • web-platform-tests/web-animations/resources/timing-override.js: Added.
  • web-platform-tests/web-animations/testcommon.js:
  • web-platform-tests/web-animations/timing-model/animations/canceling-an-animation-expected.txt:
  • web-platform-tests/web-animations/timing-model/animations/canceling-an-animation.html:
  • web-platform-tests/web-animations/timing-model/animations/finishing-an-animation.html:
  • web-platform-tests/web-animations/timing-model/animations/pausing-an-animation.html:
  • web-platform-tests/web-animations/timing-model/animations/setting-the-start-time-of-an-animation.html:
  • web-platform-tests/web-animations/timing-model/animations/the-current-time-of-an-animation.html:
  • web-platform-tests/web-animations/timing-model/animations/updating-the-finished-state.html:
  • web-platform-tests/web-animations/timing-model/time-transformations/transformed-progress-expected.txt:
  • web-platform-tests/web-animations/timing-model/time-transformations/transformed-progress.html:
  • web-platform-tests/web-animations/timing-model/timelines/document-timelines-expected.txt:
  • web-platform-tests/web-animations/timing-model/timelines/document-timelines.html:
  • web-platform-tests/web-animations/timing-model/timelines/update-and-send-events-expected.txt:
  • web-platform-tests/web-animations/timing-model/timelines/update-and-send-events-replacement-expected.txt: Added.
  • web-platform-tests/web-animations/timing-model/timelines/update-and-send-events-replacement.html: Added.
  • web-platform-tests/web-animations/timing-model/timelines/update-and-send-events.html:

LayoutTests:

  • TestExpectations:
  • platform/ios/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-expected.txt:
  • platform/ios/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/addition-per-property-expected.txt:
  • platform/ios/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-expected.txt:
  • platform/mac/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-expected.txt: Removed.
  • platform/mac/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/addition-per-property-expected.txt: Removed.
  • platform/mac/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-expected.txt: Removed.
3:56 PM Changeset in webkit [250262] by mark.lam@apple.com
  • 8 edits
    1 delete in trunk/Source/JavaScriptCore

Reduce the amount of memory needed to store Options.
https://bugs.webkit.org/show_bug.cgi?id=202105

Reviewed by Yusuke Suzuki.

The size of the JSC::Config needed to store the Options is now reduced to 4K
instead of 16K, enabled by constexpr template magic.

  1. Instead of all options in a large array of OptionEntry (which is a union of all the option types), we now have separate arrays for each of the types of options. For example,

Removed g_jscConfig.options[].
Added g_jscConfig.typeBoolOptions[].
Added g_jscConfig.typeInt32Options[].
Added g_jscConfig.typeDoubleOptions[].
...

We used to find the storage for the option using g_jscConfig.options[Options::ID].
We now find the storage for each type of option using
g_jscConfig.options[optionTypeSpecificIndex<OptionTypeID, OptionID>()]. For
example, Options::useJIT() used to be implemented as:

inline bool& Options::useJIT()
{

return g_jscConfig.options[Options::useJITID];

}

... which is now replaced with:

inline bool& Options::useJIT()
{

return g_jscConfig.typeBoolOptions[optionTypeSpecificIndex<OptionTypeID::Bool, OptionID::useJIT>()];

}

  1. Introduce the optionTypeSpecificIndex() constexpr template function for computing the index of each option in their respective type specific options array.
  1. Introduce OptionTypes, OptionTypeID, and OptionID.

The OptionTypes namespace replaces OptionEntry as the container of option types.
The OptionID enum class replaces Options::ID.
The OptionTypeID enum class is new and is used together with OptionID in

constexpr templates to compute the typeSpecificIndex of options.

  1. Removed the OptionEntry struct and OptionEntry.h. After (1), this struct is only used in the Option class. We just moved the union of option types (that OptionEntry embeds) into the Option class.

Moved class OptionRange into OptionsList.h.

  1. Removed the large OptionEntry arrays from JSC::Config. Added type specific options arrays. Also ordered these arrays to maximize compactness and minimize internal fragmentation.
  1. Changed scaleJITPolicy() to go directly to g_jscConfig.typeInt32Options[] instead of going through the Option wrapper object. This allows us to simplify things and make the Option class a read only interface of options.
  1. Changed Options::initialize() to only compute the option default value once. The default value specified in the OptionsList may not always be a constant. Sometimes, it is a function call.
  1. The Option class now only gives read only access to the options.

The Option class' role is to provide an interface for reading an option at any
given OptionID without first knowing about the type of the specific option.
It is useful for iterating options, and is currently only used by
Options::dumpOption().

Technically, we could merge all the Option class code into its single client.
We opted not to do this because the amount of code is non-trivial, and the
Option class does a good job of encapsulating this functionality.

  • API/glib/JSCOptions.cpp:

(jscOptionsSetValue):
(jscOptionsGetValue):
(jsc_options_foreach):
(jsc_options_get_option_group):

  • CMakeLists.txt:
  • JavaScriptCore.xcodeproj/project.pbxproj:
  • runtime/JSCConfig.h:
  • runtime/OptionEntry.h: Removed.
  • runtime/Options.cpp:

(JSC::Options::isAvailable):
(JSC::overrideOptionWithHeuristic):
(JSC::scaleJITPolicy):
(JSC::recomputeDependentOptions):
(JSC::Options::initialize):
(JSC::Options::setOptionWithoutAlias):
(JSC::Options::dumpAllOptions):
(JSC::Options::dumpOption):
(JSC::Option::Option):
(JSC::Option::defaultOption const):
(JSC::Option::dump const):
(JSC::Option::operator== const):

  • runtime/Options.h:

(JSC::Option::id const):
(JSC::Option::name const):
(JSC::Option::description const):
(JSC::Option::type const):
(JSC::Option::availability const):
(JSC::Option::isOverridden const):
(JSC::Option::Option):
(JSC::Option::idIndex const):
(JSC::Option::defaultOption const): Deleted.
(JSC::Option::boolVal): Deleted.
(JSC::Option::unsignedVal): Deleted.
(JSC::Option::doubleVal): Deleted.
(JSC::Option::int32Val): Deleted.
(JSC::Option::optionRangeVal): Deleted.
(JSC::Option::optionStringVal): Deleted.
(JSC::Option::gcLogLevelVal): Deleted.

  • runtime/OptionsList.h:

(JSC::OptionRange::operator= ):
(JSC::OptionRange::rangeString const):
(JSC::optionTypeSpecificIndex):
(JSC::countNumberOfJSCOptionsOfType):

3:54 PM Changeset in webkit [250261] by commit-queue@webkit.org
  • 3 edits
    1 copy
    1 add in trunk/LayoutTests

Layout test webaudio/silence-after-playback.html is failing
https://bugs.webkit.org/show_bug.cgi?id=202116

Patch by Peng Liu <Peng Liu> on 2019-09-23
Reviewed by Jer Noble.

Rebasing a webaudio layout test expected result because of a bug fix in Catalina.

  • platform/mac-mojave/webaudio/silence-after-playback-expected.wav: Copied from LayoutTests/platform/mac/webaudio/silence-after-playback-expected.wav.
  • platform/mac/TestExpectations:
  • platform/mac/webaudio/silence-after-playback-expected.wav:
3:42 PM Changeset in webkit [250260] by timothy_horton@apple.com
  • 3 edits in trunk/Source/WebKit

macOS: <datalist> dropdown shadow is cropped, looks nothing like NSComboBox
https://bugs.webkit.org/show_bug.cgi?id=199350

Reviewed by Wenson Hsieh.

Improve the appearance of the macOS <datalist> dropdown, adopting the
roundly-cornered and backdrop-ful appearance of the current NSComboBox style.

Use the proper window shadow instead of our own inside the window, both
so that we match the system and so that it doesn't get clipped.

Allow vertical rubber-banding, because NSComboBox does.

Don't highlight on hover, because NSComboBox doesn't. Do use NSTableView's
selection mechanism instead of rolling our own for highlights driven by
keyboard-based navigation.

Make use of NSTableCellView, since it has some smarts around pixel alignment
that we don't need to duplicate (and things are blurry on 1x displays without).

Also rename some classes to make it a bit more clear what's going on:
WKDataListSuggestionCell -> WKDataListSuggestionView (it's a NSView, not an NSCell)
WKDataListSuggestionsView -> WKDataListSuggestionsController (it's not a view at all)

  • Platform/spi/mac/AppKitSPI.h:
  • UIProcess/mac/WebDataListSuggestionsDropdownMac.mm:

(WebKit::WebDataListSuggestionsDropdownMac::show):
(-[WKDataListSuggestionWindow initWithContentRect:styleMask:backing:defer:]):
(-[WKDataListSuggestionWindow canBecomeKeyWindow]):
(-[WKDataListSuggestionWindow hasKeyAppearance]):
(-[WKDataListSuggestionWindow shadowOptions]):
(-[WKDataListSuggestionView initWithFrame:]):
(-[WKDataListSuggestionView setText:]):
(-[WKDataListSuggestionView setBackgroundStyle:]):
(-[WKDataListSuggestionTableRowView drawSelectionInRect:]):
(-[WKDataListSuggestionTableView initWithElementRect:]):
(-[WKDataListSuggestionTableView layout]):
(-[WKDataListSuggestionTableView reload]):
(-[WKDataListSuggestionsController initWithInformation:inView:]):
(-[WKDataListSuggestionsController currentSelectedString]):
(-[WKDataListSuggestionsController updateWithInformation:]):
(-[WKDataListSuggestionsController moveSelectionByDirection:]):
(-[WKDataListSuggestionsController invalidate]):
(-[WKDataListSuggestionsController dropdownRectForElementRect:]):
(-[WKDataListSuggestionsController showSuggestionsDropdown:]):
(-[WKDataListSuggestionsController tableView:rowViewForRow:]):
(-[WKDataListSuggestionsController tableView:viewForTableColumn:row:]):
(-[WKDataListSuggestionCell initWithFrame:]): Deleted.
(-[WKDataListSuggestionCell setText:]): Deleted.
(-[WKDataListSuggestionCell setActive:]): Deleted.
(-[WKDataListSuggestionCell drawRect:]): Deleted.
(-[WKDataListSuggestionCell mouseEntered:]): Deleted.
(-[WKDataListSuggestionCell mouseExited:]): Deleted.
(-[WKDataListSuggestionCell acceptsFirstResponder]): Deleted.
(-[WKDataListSuggestionTable initWithElementRect:]): Deleted.
(-[WKDataListSuggestionTable setVisibleRect:]): Deleted.
(-[WKDataListSuggestionTable currentActiveRow]): Deleted.
(-[WKDataListSuggestionTable setActiveRow:]): Deleted.
(-[WKDataListSuggestionTable reload]): Deleted.
(-[WKDataListSuggestionTable acceptsFirstResponder]): Deleted.
(-[WKDataListSuggestionTable enclosingScrollView]): Deleted.
(-[WKDataListSuggestionTable removeFromSuperviewWithoutNeedingDisplay]): Deleted.
(-[WKDataListSuggestionsView initWithInformation:inView:]): Deleted.
(-[WKDataListSuggestionsView currentSelectedString]): Deleted.
(-[WKDataListSuggestionsView updateWithInformation:]): Deleted.
(-[WKDataListSuggestionsView moveSelectionByDirection:]): Deleted.
(-[WKDataListSuggestionsView invalidate]): Deleted.
(-[WKDataListSuggestionsView dropdownRectForElementRect:]): Deleted.
(-[WKDataListSuggestionsView showSuggestionsDropdown:]): Deleted.
(-[WKDataListSuggestionsView selectedRow:]): Deleted.
(-[WKDataListSuggestionsView numberOfRowsInTableView:]): Deleted.
(-[WKDataListSuggestionsView tableView:heightOfRow:]): Deleted.
(-[WKDataListSuggestionsView tableView:viewForTableColumn:row:]): Deleted.

3:36 PM Changeset in webkit [250259] by Kocsen Chung
  • 1 copy in tags/Safari-608.2.11.1.11

Tag Safari-608.2.11.1.11.

3:27 PM Changeset in webkit [250258] by Devin Rousso
  • 66 edits
    6 copies
    1 move
    9 adds in trunk

Web Inspector: Canvas: show WebGPU shader pipelines
https://bugs.webkit.org/show_bug.cgi?id=201675
<rdar://problem/55543450>

Reviewed by Joseph Pecoraro.

Source/JavaScriptCore:

  • inspector/protocol/Canvas.json:

Add a ProgramType enum that conveys the type of shader program/pipeline when notifying the
frontend of a new program

Source/WebCore:

Tests: inspector/canvas/requestShaderSource-webgpu.html

inspector/canvas/shaderProgram-add-remove-webgpu.html
inspector/canvas/updateShader-webgpu.html

Create common base classes for WebGPUPipeline and GPUPipeline so that Web Inspector can
instrument both render and compute shader pipelines.

Refactor InspectorShaderProgram to support both WebGLProgram and WebGPUPipeline so
that the same object can be used for all types of shader "program"s.

Keep a copy of each shader module's source, and allow the shader module to be updated.

  • Modules/webgpu/WebGPUDevice.h:
  • Modules/webgpu/WebGPUDevice.cpp:

(WebCore::WebGPUDevice::WebGPUDevice):
(WebCore::WebGPUDevice::~WebGPUDevice):
(WebCore::WebGPUDevice::createShaderModule const):
(WebCore::WebGPUDevice::createRenderPipeline): Added.
(WebCore::WebGPUDevice::createComputePipeline): Added.
(WebCore::WebGPUDevice::createRenderPipeline const): Deleted.
(WebCore::WebGPUDevice::createComputePipeline const): Deleted.

  • Modules/webgpu/WebGPUPipeline.h: Added.

(WebCore::WebGPUPipeline::isRenderPipeline const):
(WebCore::WebGPUPipeline::isComputePipeline const):
(WebCore::WebGPUPipeline::scriptExecutionContext const):

  • Modules/webgpu/WebGPUPipeline.cpp: Added.

(WebCore::WebGPUPipeline::instancesMutex):
(WebCore::WebGPUPipeline::WebGPUPipeline):
(WebCore::WebGPUPipeline::~WebGPUPipeline):

  • platform/graphics/gpu/GPUPipeline.cpp: Added.
  • platform/graphics/gpu/GPUPipeline.h: Added.

(WebCore::GPUPipeline::isRenderPipeline const):
(WebCore::GPUPipeline::isComputePipeline const):

  • Modules/webgpu/WebGPUComputePipeline.idl:
  • Modules/webgpu/WebGPUComputePipeline.h:

(WebCore::WebGPUComputePipeline::computePipeline const): Deleted.

  • Modules/webgpu/WebGPUComputePipeline.cpp:

(WebCore::WebGPUComputePipeline::create):
(WebCore::WebGPUComputePipeline::WebGPUComputePipeline):
(WebCore::WebGPUComputePipeline::recompile): Added.

  • platform/graphics/gpu/GPUComputePipeline.h:

(WebCore::GPUComputePipeline::isComputePipeline): Added.

  • platform/graphics/gpu/cocoa/GPUComputePipelineMetal.mm:

(WebCore::GPUComputePipeline::tryCreate):
(WebCore::GPUComputePipeline::GPUComputePipeline):
(WebCore::GPUComputePipeline::recompile): Added.

  • Modules/webgpu/WebGPURenderPipeline.idl:
  • Modules/webgpu/WebGPURenderPipeline.h:

(WebCore::WebGPURenderPipeline::renderPipeline const): Deleted.

  • Modules/webgpu/WebGPURenderPipeline.cpp:

(WebCore::WebGPURenderPipeline::create):
(WebCore::WebGPURenderPipeline::WebGPURenderPipeline):
(WebCore::WebGPURenderPipeline::recompile): Added.

  • platform/graphics/gpu/GPURenderPipeline.h:

(WebCore::GPURenderPipeline::isRenderPipeline): Added.

  • platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:

(WebCore::tryCreateMtlRenderPipelineState):
(WebCore::GPURenderPipeline::tryCreate):
(WebCore::GPURenderPipeline::GPURenderPipeline):
(WebCore::GPURenderPipeline::recompile): Added.

  • Modules/webgpu/WebGPUShaderModule.h:

(WebCore::WebGPUShaderModule::source const): Added.

  • Modules/webgpu/WebGPUShaderModule.cpp:

(WebCore::WebGPUShaderModule::update): Added.

  • Modules/webgpu/WebGPUProgrammableStageDescriptor.h:
  • platform/graphics/gpu/GPUProgrammableStageDescriptor.h:

(WebCore::GPUProgrammableStageDescriptor::GPUProgrammableStageDescriptor):

  • inspector/InspectorShaderProgram.h:
  • inspector/InspectorShaderProgram.cpp:

(WebCore::InspectorShaderProgram::create):
(WebCore::InspectorShaderProgram::InspectorShaderProgram):
(WebCore::InspectorShaderProgram::program const): Added.
(WebCore::InspectorShaderProgram::pipeline const): Added.
(WebCore::shaderForType): Added.
(WebCore::InspectorShaderProgram::requestShaderSource): Added.
(WebCore::InspectorShaderProgram::updateShader): Added.
(WebCore::InspectorShaderProgram::context const): Deleted.
(WebCore::InspectorShaderProgram::shaderForType): Deleted.

  • inspector/agents/InspectorCanvasAgent.h:
  • inspector/agents/InspectorCanvasAgent.cpp:

(WebCore::InspectorCanvasAgent::InspectorCanvasAgent):
(WebCore::InspectorCanvasAgent::discardAgent):
(WebCore::InspectorCanvasAgent::enable):
(WebCore::InspectorCanvasAgent::disable):
(WebCore::InspectorCanvasAgent::requestShaderSource):
(WebCore::InspectorCanvasAgent::updateShader):
(WebCore::InspectorCanvasAgent::setShaderProgramDisabled):
(WebCore::InspectorCanvasAgent::setShaderProgramHighlighted):
(WebCore::InspectorCanvasAgent::frameNavigated):
(WebCore::InspectorCanvasAgent::didCreateWebGLProgram): Added.
(WebCore::InspectorCanvasAgent::willDestroyWebGLProgram): Added.
(WebCore::InspectorCanvasAgent::isWebGLProgramDisabled): Added.
(WebCore::InspectorCanvasAgent::isWebGLProgramHighlighted): Added.
(WebCore::InspectorCanvasAgent::didCreateWebGPUPipeline): Added.
(WebCore::InspectorCanvasAgent::willDestroyWebGPUPipeline): Added.
(WebCore::InspectorCanvasAgent::programDestroyedTimerFired): Added.
(WebCore::InspectorCanvasAgent::reset): Added.
(WebCore::InspectorCanvasAgent::unbindProgram):
(WebCore::InspectorCanvasAgent::findInspectorProgram):
(WebCore::InspectorCanvasAgent::didCreateProgram): Deleted.
(WebCore::InspectorCanvasAgent::willDeleteProgram): Deleted.
(WebCore::InspectorCanvasAgent::isShaderProgramDisabled): Deleted.
(WebCore::InspectorCanvasAgent::isShaderProgramHighlighted): Deleted.
(WebCore::InspectorCanvasAgent::clearCanvasData): Deleted.

  • inspector/InspectorInstrumentation.h:

(WebCore::InspectorInstrumentation::didCreateWebGLProgram): Added.
(WebCore::InspectorInstrumentation::willDestroyWebGLProgram): Added.
(WebCore::InspectorInstrumentation::isWebGLProgramDisabled): Added.
(WebCore::InspectorInstrumentation::isWebGLProgramHighlighted): Added.
(WebCore::InspectorInstrumentation::didCreateWebGPUPipeline): Added.
(WebCore::InspectorInstrumentation::willDestroyWebGPUPipeline): Added.
(WebCore::InspectorInstrumentation::didCreateProgram): Deleted.
(WebCore::InspectorInstrumentation::willDeleteProgram): Deleted.
(WebCore::InspectorInstrumentation::isShaderProgramDisabled): Deleted.
(WebCore::InspectorInstrumentation::isShaderProgramHighlighted): Deleted.

  • inspector/InspectorInstrumentation.cpp:

(WebCore::InspectorInstrumentation::didCreateWebGLProgramImpl): Added.
(WebCore::InspectorInstrumentation::willDestroyWebGLProgramImpl): Added.
(WebCore::InspectorInstrumentation::isWebGLProgramDisabledImpl): Added.
(WebCore::InspectorInstrumentation::isWebGLProgramHighlightedImpl): Added.
(WebCore::InspectorInstrumentation::didCreateWebGPUPipelineImpl): Added.
(WebCore::InspectorInstrumentation::willDestroyWebGPUPipelineImpl): Added.
(WebCore::InspectorInstrumentation::didCreateProgramImpl): Deleted.
(WebCore::InspectorInstrumentation::willDeleteProgramImpl): Deleted.
(WebCore::InspectorInstrumentation::isShaderProgramDisabledImpl): Deleted.
(WebCore::InspectorInstrumentation::isShaderProgramHighlightedImpl): Deleted.

  • html/canvas/WebGLProgram.h:
  • html/canvas/WebGLProgram.cpp:

(WebCore::WebGLProgram::WebGLProgram):
(WebCore::WebGLProgram::~WebGLProgram):

  • html/canvas/WebGLRenderingContextBase.cpp:

(WebCore::InspectorScopedShaderProgramHighlight::showHightlight):
(WebCore::WebGLRenderingContextBase::createProgram):
(WebCore::WebGLRenderingContextBase::deleteProgram):
(WebCore::WebGLRenderingContextBase::drawArrays):
(WebCore::WebGLRenderingContextBase::drawElements):
Rename WebGL program instrumentation points to be less ambiguous.

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

Source/WebInspectorUI:

Show WebGPU shader pipelines ("programs") underneath each corresponding WebGPU device.

Allow editing of attached shader modules for each WebGPU shader pipeline, but don't allow
highlighting/disabling, as WebGPU pipelines don't have those capabilities/concepts yet.

  • UserInterface/Protocol/CanvasObserver.js:

(WI.CanvasObserver.prototype.programCreated):

  • UserInterface/Controllers/CanvasManager.js:

(WI.CanvasManager.prototype.programCreated):

  • UserInterface/Models/Canvas.js:

(WI.Canvas.prototype.nextShaderProgramDisplayNumberForProgramType): Added.
(WI.Canvas.prototype.nextShaderProgramDisplayNumber): Deleted.

  • UserInterface/Models/ShaderProgram.js:

(WI.ShaderProgram):
(WI.ShaderProgram.contextTypeSupportsProgramType): Added.
(WI.ShaderProgram.programTypeSupportsShaderType): Added.
(WI.ShaderProgram.prototype.get programType): Added.
(WI.ShaderProgram.prototype.get displayName):
(WI.ShaderProgram.prototype.set disabled):
(WI.ShaderProgram.prototype.requestShaderSource):
(WI.ShaderProgram.prototype.updateShader):
(WI.ShaderProgram.prototype.showHighlight):
(WI.ShaderProgram.prototype.hideHighlight):
(WI.ShaderProgram.prototype.requestVertexShaderSource): Deleted.
(WI.ShaderProgram.prototype.requestFragmentShaderSource): Deleted.
(WI.ShaderProgram.prototype.updateVertexShader): Deleted.
(WI.ShaderProgram.prototype.updateFragmentShader): Deleted.
(WI.ShaderProgram.prototype._requestShaderSource): Deleted.
(WI.ShaderProgram.prototype._updateShader): Deleted.

  • UserInterface/Views/ShaderProgramContentView.js:

(WI.ShaderProgramContentView):
(WI.ShaderProgramContentView.prototype.get navigationItems): Added.
(WI.ShaderProgramContentView.prototype.shown):
(WI.ShaderProgramContentView.prototype.hidden):
(WI.ShaderProgramContentView.prototype.get saveData):
(WI.ShaderProgramContentView.prototype._refreshContent):
(WI.ShaderProgramContentView.prototype._updateShader):
(WI.ShaderProgramContentView.prototype._contentDidChange):

  • UserInterface/Views/ShaderProgramContentView.css:

(.content-view.shader-program > .shader): Added.
(.content-view.shader-program > .shader.compute): Added.
(body[dir=ltr] .content-view.shader-program > .shader.vertex,): Added.
(body[dir=ltr] .content-view.shader-program > .shader.fragment,): Added.
(.content-view.shader-program > .shader + .shader): Added.
(.content-view.shader-program > .shader > header > *): Added.
(.content-view.shader-program > .shader > header > .shader-type): Added.
(@media (prefers-color-scheme: dark) .content-view.shader-program > .shader > header): Added.
(.content-view.shader-program > .text-editor.shader): Deleted.
(body[dir=ltr] .content-view.shader-program > .text-editor.shader.vertex,): Deleted.
(body[dir=ltr] .content-view.shader-program > .text-editor.shader.fragment,): Deleted.
(body[dir=ltr] .content-view.shader-program > .text-editor.shader + .text-editor.shader): Deleted.
(body[dir=rtl] .content-view.shader-program > .text-editor.shader + .text-editor.shader): Deleted.
(.content-view.shader-program > .text-editor.shader > .type-title): Deleted.
(.content-view.shader-program > .text-editor.shader > .CodeMirror): Deleted.

  • UserInterface/Views/CodeMirrorAdditions.js:
  • UserInterface/Views/ShaderProgramTreeElement.js:

(WI.ShaderProgramTreeElement):
(WI.ShaderProgramTreeElement.prototype.onattach):
(WI.ShaderProgramTreeElement.prototype.ondetach):
(WI.ShaderProgramTreeElement.prototype.canSelectOnMouseDown):
(WI.ShaderProgramTreeElement.prototype.populateContextMenu):

  • Localizations/en.lproj/localizedStrings.js:

LayoutTests:

Split existing shader tests into WebGL and WebGPU sub-tests for different platforms.

  • inspector/canvas/requestShaderSource.html:
  • inspector/canvas/requestShaderSource-expected.txt:
  • inspector/canvas/updateShader.html:
  • inspector/canvas/updateShader-expected.txt:
  • inspector/canvas/resources/shaderProgram-utilities-webgpu.js: Added.
  • inspector/canvas/requestShaderSource-webgpu.html: Added.
  • inspector/canvas/requestShaderSource-webgpu-expected.txt: Added.
  • inspector/canvas/shaderProgram-add-remove-webgpu.html: Added.
  • inspector/canvas/shaderProgram-add-remove-webgpu-expected.txt: Added.
  • inspector/canvas/updateShader-webgpu-expected.txt: Added.
  • inspector/canvas/updateShader-webgpu.html: Added.
  • inspector/canvas/resources/shaderProgram-utilities-webgl.js: Renamed from LayoutTests/inspector/canvas/resources/shaderProgram-utilities.js.
  • inspector/canvas/console-record-webgl.html:
  • inspector/canvas/console-record-webgl2.html:
  • inspector/canvas/recording-webgl-frameCount.html:
  • inspector/canvas/recording-webgl-full.html:
  • inspector/canvas/recording-webgl-memoryLimit.html:
  • inspector/canvas/recording-webgl-snapshots.html:
  • inspector/canvas/recording-webgl2-frameCount.html:
  • inspector/canvas/recording-webgl2-full.html:
  • inspector/canvas/recording-webgl2-memoryLimit.html:
  • inspector/canvas/recording-webgl2-snapshots.html:
  • inspector/canvas/requestShaderSource-webgl.html: Added.
  • inspector/canvas/requestShaderSource-webgl-expected.txt: Added.
  • inspector/canvas/setShaderProgramDisabled.html:
  • inspector/canvas/setShaderProgramHighlighted.html:
  • inspector/canvas/shaderProgram-add-remove-webgl.html:
  • inspector/canvas/shaderProgram-add-remove-webgl2.html:
  • inspector/canvas/updateShader-webgl.html: Added.
  • inspector/canvas/updateShader-webgl-expected.txt: Added.
  • platform/gtk/TestExpectations:
  • platform/ios/TestExpectations:
  • platform/mac-wk1/TestExpectations:
  • platform/mac/TestExpectations:
  • platform/win/TestExpectations:
  • platform/wincairo/TestExpectations:
  • platform/wpe/TestExpectations:
3:25 PM Changeset in webkit [250257] by aakash_jain@apple.com
  • 4 edits in trunk/Tools

[EWS] Rename CompileJSCOnly to CompileJSC
https://bugs.webkit.org/show_bug.cgi?id=202118

Reviewed by Jonathan Bedard.

  • BuildSlaveSupport/ews-build/factories.py:

(JSCTestsFactory.init): Renamed CompileJSCOnly to CompileJSC.

  • BuildSlaveSupport/ews-build/steps.py:

(CompileWebKit.evaluateCommand): Ditto.
(AnalyzeCompileWebKitResults.start): Ditto.
(CompileJSC): Changed step-name to 'compile-jsc' to better match with similar steps like 'compile-webkit'.
(CompileJSCToT): Ditto for 'compile-jsc-tot'.

  • BuildSlaveSupport/ews-build/steps_unittest.py: Renamed CompileJSCOnly to CompileJSC and CompileJSCOnlyToT to CompileJSCToT.
3:16 PM Changeset in webkit [250256] by Wenson Hsieh
  • 23 edits
    2 adds in trunk

[iOS] Drop animation when dragging images from Photos to WebKit2 Mail compose is incorrect
https://bugs.webkit.org/show_bug.cgi?id=201674
<rdar://problem/51250952>

Reviewed by Tim Horton.

Source/WebCore:

Adds new helper methods on DragController to support the new image placeholder drop codepath. See WebKit
ChangeLog for more details.

Tests: WKAttachmentTestsIOS.TargetedPreviewsWhenDroppingImages

WKAttachmentTestsIOS.TargetedPreviewIsClippedWhenDroppingTallImage

  • editing/WebContentReader.h:

Fix the Windows build after including WebContentReader.h in DragController.cpp.

  • html/HTMLImageElement.h:

(WebCore::HTMLImageElement::isDroppedImagePlaceholder const):
(WebCore::HTMLImageElement::setIsDroppedImagePlaceholder):

Add a flag to HTMLImageElement, indicating whether it is a dropped image placeholder. If so, we have special
logic to remove some temporary inline style properties from the image after it has finished loading (see
finalizeDroppedImagePlaceholder).

Note that this doesn't increase the size of HTMLImageElement.

  • page/DragController.cpp:

(WebCore::DragController::dragEnded):

Clean up any stale placeholders after the drag ends.

(WebCore::DragController::performDragOperation):
(WebCore::DragController::removeAllDroppedImagePlaceholders):

Add a private helper to clean up any dropped image placeholders after failing to update dropped image
placeholders for any reason.

(WebCore::DragController::tryToUpdateDroppedImagePlaceholders):

Invoked when performing the drag operation, after image data has been loaded; this function attempts to update
the list of image placeholder elements tracked by DragController that were previously inserted using
insertDroppedImagePlaceholdersAtCaret, and updates the source attribute of each element (as well as any backed
attachment element, if attachment elements are enabled). It achieves this by reading the dropped data as web
content, and matching up the images in the resulting fragment against the placeholder images. If each image in
the fragment can correspond to exactly one placeholder, we update the source of each placeholder image,
migrate attachment elements over to the placeholder images if needed, and finally discard the fragment.

A return value of false indicates that this process failed, in which case we clean up the placeholders and fall
back to handling the drop normally.

(WebCore::DragController::insertDroppedImagePlaceholdersAtCaret):

Invoked when handling the drop, before any image data has been loaded; this function takes a list of sizes
representing the preferred presentation sizes of each item provider that will be loaded as an image, and uses
ReplaceSelectionCommand to insert a list of (initially blank) placeholder images at the drop caret, sized
accordingly to each item provider's preferredPresentationSize.

To make this compatible with Mail compose (and all other known internal clients that use the _editable SPI), we
additionally enforce a max-width of 100% on each image and preserve the aspect ratio of the image by adjusting
the height if needed.

(WebCore::DragController::finalizeDroppedImagePlaceholder):

  • page/DragController.h:

Have DragController keep track of the list of dropped image placeholders (in DOM order), as well as the dropped
image placeholder range. This information is used once item provider data arrives and the drag operation is
being performed, to update the source of each dropped image placeholder.

(WebCore::DragController::droppedImagePlaceholders const):
(WebCore::DragController::droppedImagePlaceholderRange const):

  • platform/network/mac/UTIUtilities.h:

Mark an existing helper function as WEBCORE_EXPORT.

Source/WebKit:

Our current logic for handling dropped content in editable elements on iOS works like this in the ideal case:

(1) UIKit asks us for a targeted preview for each UIDragItem. We don't know (and can't determine this

synchronously without blocking on the web process) so we simply retarget the preview to animate to the
last known caret location.

(2) Soonafter, UIKit hands us a drop preview update block, which may be used to retarget the drop preview

once, as long as the drop animation is less than 90% complete. We stash these update blocks for now.

(3) -dropInteraction:performDrop: is then called, and we start loading item provider data right away.

(4) When the data has finished loading, we perform the drop in the web process. After any inserted images

have finished loading, we take snapshots (of the dropped content as well as surrounding web content
minus the dropped content), and deliver these images to the UI process via TextIndicatorData.

(5) Upon receiving the TextIndicatorData sent in (4), we use the image data to create updated targeted drag

previews, and use these to invoke the preview update blocks we stored earlier in (2). We also obscure
the entire web view with a snapshot of the view minus any dropped content, such that the updated drop
previews may animate into place without also showing the final content.

(6) When the drop animation ends, we remove the unselected content snapshot view added in (5) simultaneously

as the targeted previews disappear, revealing the actual dropped content on the page. The drop is now
complete.

However, note that the drag update block we invoke in (5) doesn't work if the drop animation is already more
than 90% complete. Since the lifecycle of the drop animation is distinct from that of item provider loading, if
the delay between (3) and (4) exceeds 90% of the total drop animation time, we'll fail to update the targeted
previews, such that the user only sees the initial drag preview fly on top of the caret and disappear. While we
typically win this race for data dragged from other WebKit apps, we almost always lose when dragging from Photos
and end up with a janky drop animation. This is especially true for any images that aren't locally available,
and need to be fetched from iCloud. An additional problem is that in step (5), we use the same final snapshot to
update the drop preview of every item, since we don't have a snapshot for the fragment corresponding to each
individual dropped item.

To address these issues for Mail in the case where the user drops images with known sizes (i.e. -[NSItemProvider
preferredPresentationSize] is specified), we introduce an alternate codepath for handling dropped images that
performs the drop immediately upon receiving -dropInteraction:performDrop: in the UI process. Since the data has
yet to arrive, we instead handle the drop by inserting placeholder image elements at the drag caret position,
which initially have no source but are sized to fit their expected final image sizes. After doing so, we
snapshot the page (minus the dropped content range, as usual) and deliver this snapshot to the UI process, along
with the rects (in root view coordinates) of each placeholder image that was inserted. In the UI process, we
then take this snapshot and obscure the content view with it, and also use each of the placeholder rects to
provide an updated target for each drag preview, such that the drop previews now animate to their final
locations on the page.

When the data eventually arrives, we handle the drop by detecting the placeholder elements we inserted earlier,
and using the dropped data to update the source attribute and attachment backing for each of these placeholder
elements instead of attempting to insert new content.

Note that this codepath is currently only enabled for SPI clients that set -[WKWebView _editable] to YES, since
it involves us performing the editing action for the drop (thus changing the DOM) prior to the preventable drop
event, and prior to us having any data at all. However, the drop event can't come before the editing action,
since we need to have already loaded data from the item providers to expose it via the dataTransfer of the drop
event. This contradiction means that this image placeholder hack is only for _editable SPI clients that, at the
very least, will not require preventing default behavior when dropping only images with predetermined sizes.

Covered by 2 new API tests. See comments below for more detail.

  • UIProcess/WebPageProxy.h:
  • UIProcess/ios/DragDropInteractionState.h:
  • UIProcess/ios/DragDropInteractionState.mm:

(WebKit::DragDropInteractionState::setDefaultDropPreview):

Add a way to keep track of default drop previews that we observed during each call to
-dropInteraction:previewForDroppingItem:withDefault:. In the image placeholder drop scenario, we use these
default drop previews later on to create retargeted drop previews after the placeholders have been inserted.

(WebKit::DragDropInteractionState::defaultDropPreview const):
(WebKit::DragDropInteractionState::deliverDelayedDropPreview):

Add an alternate version of deliverDelayedDropPreview that is used when inserting image placeholders. Rather
than use text indicator data of the final dropped content on the page, use the root-view-coordinate rects of
each of the placeholder elements to reposition the default drop previews.

There's additional logic here to handle the case where the final image is taller than the height of the
unobscured content rect, in which case we clip the drop preview using UIDragPreviewParameter's visiblePath to
prevent the drop preview from being shown outside of the bounds of the web view.

  • UIProcess/ios/WKContentViewInteraction.h:
  • UIProcess/ios/WKContentViewInteraction.mm:

(-[WKContentView _deliverDelayedDropPreviewIfPossible:]):
(sizesOfPlaceholderElementsToInsertWhenDroppingItems):

Collects the list of expected image sizes for the dropped item providers, or an empty list in the case where
any of the item providers may not be represented as inline images or do not have predetermined sizes.

(-[WKContentView _handleDropByInsertingImagePlaceholders:session:]):

If possible, handles the drop by inserting image placeholders instead of waiting for the data to finish loading
before dropping. Returns whether or not we decided to proceed with the image placeholder drop.

(-[WKContentView dropInteraction:performDrop:]):
(-[WKContentView dropInteraction:item:willAnimateDropWithAnimator:]):

Fixes a bug where the unselected content snapshot view could linger around on the web view forever after a drop
where the data doesn't load in time for the drop to finish by keeping track of whether there is an actively
animating drag item, and only applying the unselected content snapshot if so.

(-[WKContentView dropInteraction:previewForDroppingItem:withDefault:]):

Stash the default drop preview away here.

  • UIProcess/ios/WebPageProxyIOS.mm:

(WebKit::WebPageProxy::insertDroppedImagePlaceholders):

  • WebProcess/WebPage/WebPage.h:
  • WebProcess/WebPage/WebPage.messages.in:
  • WebProcess/WebPage/ios/WebPageIOS.mm:

(WebKit::WebPage::insertDroppedImagePlaceholders):

See WebCore ChangeLog for more information.

(WebKit::WebPage::didFinishLoadingImageForElement):

If the image that finished loading is a dropped image placeholder, allow DragController to "finalize" it by
stripping away some styles that were temporarily added.

Tools:

Add a couple of new API tests to exercise the new image placeholder drop codepath, in addition to testing
infrastructure to simulate the timing of drop animation delegate calls.

  • TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
  • TestWebKitAPI/Tests/WebKitCocoa/WKAttachmentTests.mm:

(-[NSArray _attachmentWithName:]):
(-[TestWKWebView allBoundingClientRects:]):

Add some new API testing helper methods.

(TestWebKitAPI::targetedImageDragPreview):
(TestWebKitAPI::TEST):

Add two new tests, to:
(1) verify that images are dropped as attachment-backed placeholder image elements when the web view is editable

and enables attachment elements, and

(2) verify that when dropping an image taller than the web view, the bottom portion of the drop preview is

clipped using the targeted preview parameter's visiblePath.

  • TestWebKitAPI/Tests/ios/DragAndDropTestsIOS.mm:

(-[NSItemProvider registerDataRepresentationForTypeIdentifier:withData:]): Deleted.

  • TestWebKitAPI/cocoa/DragAndDropSimulator.h:
  • TestWebKitAPI/cocoa/NSItemProviderAdditions.h: Added.
  • TestWebKitAPI/cocoa/NSItemProviderAdditions.mm: Added.

Move some common helpers for registering data on a NSItemProvider to a separate file, so that it can be used in
both WKAttachmentTests and DragAndDropTests.

(-[NSItemProvider registerDataRepresentationForTypeIdentifier:withData:]):
(-[NSItemProvider registerDataRepresentationForTypeIdentifier:withData:loadingDelay:]):

  • TestWebKitAPI/ios/DragAndDropSimulatorIOS.mm:

(-[DragAndDropSimulator initWithWebView:]):
(-[DragAndDropSimulator _concludeDropAndPerformOperationIfNecessary]):
(-[DragAndDropSimulator clearExternalDragInformation]):
(-[DragAndDropSimulator setExternalItemProviders:defaultDropPreviews:]):

Add a new method to allow tests to specify both a list of externally dragged item providers, as well as default
targeted previews for each of the corresponding items. These default previews are used when invoking the drop
interaction delegate's preview generation methods.

(-[DragAndDropSimulator addAnimations:]):

Not implemented yet; for now, this simply asserts.

(-[DragAndDropSimulator addCompletion:]):

Queues a completion handler, which is invoked when the drop animation for each item completes. Depending on the
value of DragAndDropSimulator's -dropAnimationTiming, this may occur either before or after handling the drop.
By default, these will be invoked after the drop completes, which represents the common case where data can be
loaded quickly relative to the drop animation.

(-[DragAndDropSimulator _invokeDropAnimationCompletionBlocksAndConcludeDrop]):
(-[DragAndDropSimulator _webView:dataInteractionOperationWasHandled:forSession:itemProviders:]):

2:56 PM Changeset in webkit [250255] by dbates@webkit.org
  • 16 edits
    6 adds in trunk

Improve CSP inheritance semantics
https://bugs.webkit.org/show_bug.cgi?id=201884
<rdar://problem/50172407>

Reviewed by Brent Fulgham.

LayoutTests/imported/w3c:

Update expected results now that we pass more sub-tests.

  • web-platform-tests/content-security-policy/inheritance/iframe-all-local-schemes-inherit-self.sub-expected.txt:
  • web-platform-tests/content-security-policy/inheritance/window-expected.txt:

Source/WebCore:

Update the CSP inheritance semantics to more closely match the logic in section Initialize a Document's CSP list
of the CSP3 spec., <https://w3c.github.io/webappsec-csp/#initialize-document-csp>.

Towards this, move more of the inheritance logic out of Document::initContentSecurityPolicy() and into
DocumentWriter::begin() where details about the document being replaced live. This lets us remove the
need to track the previous content security policy to pass it to Document::initContentSecurityPolicy().
Moreover, DocumentWriter::begin() knows the owner document that will be replaced with the result of
executing a JavaScript URL. This is needed in order to fix up inheritance of CSP for such documents.

Tests: http/tests/security/contentSecurityPolicy/iframe-allowed-when-loaded-via-javascript-url.html

http/tests/security/contentSecurityPolicy/iframe-blocked-when-loaded-via-javascript-url.html
http/tests/security/contentSecurityPolicy/iframe-blocked-when-loaded-via-javascript-url2.html

  • dom/Document.cpp:

(WebCore::Document::initSecurityContext): If we are inheriting the security origin from the owner
document then inherit its CSP policy. We copy over both the CSP state from the owner as well as
update 'self' to match the owner's origin so that CSP source expressions that include 'self' work
correctly even from about:blank documents.
(WebCore::Document::initContentSecurityPolicy): Move most of the logic from here into DocumentWriter::begin()
to take advantage of the fact that DocumentWriter::begin() knows about the outgoing document (if there
is one) as well as whether the outgoing document is being replaced with a new document that is the result
of evaluating a JavaScript URL. We need do know both these things in order to inherit the correct CSP
policy. This function only exists to copy some upgrade-insecure-requests state and to fix up plugin documents
as we currently do.
(WebCore::Document::shouldInheritContentSecurityPolicy const): Deleted.

  • dom/Document.h:
  • dom/SecurityContext.cpp:

(WebCore::SecurityContext::setContentSecurityPolicy): Modified to take its param by rvalue-reference
to make it less error prone to use.

  • dom/SecurityContext.h: Expose setContentSecurityPolicy() so that we can invoke it from DocumentWriter::begin().
  • loader/DocumentWriter.cpp:

(WebCore::DocumentWriter::begin): For documents being replaced with the result of a JavaScript URL (i.e. ownerDocument
is non-null) inherit the CSP from the owner document. Similarly, if we have an existing document in the frame
and the protocol of the new document's URL is data: or blob: then inherit the CSP from the existing page. The latter
is what we currently do just moved from Document::initContentSecurityPolicy() and re-written in terms of the
existingDocument instead of previousContentSecurityPolicy. Also call setInsecureNavigationRequestsToUpgrade()
both when we have a non-null ownerDocument as well as when we have a non-null existingDocument. The former fixes
the block-all-mixed-content feature for documents loaded via JavaScript URLs and the latter is what we do now.

  • loader/FrameLoader.cpp:

(WebCore::FrameLoader::didBeginDocument): Remove parameter previousContentSecurityPolicy as the logic that
made use of it moved to DocumentWriter::begin().

  • loader/FrameLoader.h:
  • page/csp/ContentSecurityPolicy.h:

LayoutTests:

Add some more tests and update expected results of existing tests now that we pass more sub-tests.

  • http/tests/security/contentSecurityPolicy/iframe-allowed-when-loaded-via-javascript-url-expected.txt: Added.
  • http/tests/security/contentSecurityPolicy/iframe-allowed-when-loaded-via-javascript-url.html: Added.
  • http/tests/security/contentSecurityPolicy/iframe-blocked-when-loaded-via-javascript-url-expected.txt: Added.
  • http/tests/security/contentSecurityPolicy/iframe-blocked-when-loaded-via-javascript-url.html: Added.
  • http/tests/security/contentSecurityPolicy/iframe-blocked-when-loaded-via-javascript-url2-expected.txt: Added.
  • http/tests/security/contentSecurityPolicy/iframe-blocked-when-loaded-via-javascript-url2.html: Added.
  • http/tests/security/contentSecurityPolicy/user-style-sheet-font-crasher-expected.txt: I don't understand

why there is another duplicte console log message emitted, but there are already two such messages, which is
already one too many. The duplicate messages are more cosmetic than functional though there may be implications
with respect to CSP reporting. Filed <https://bugs.webkit.org/show_bug.cgi?id=202004> to track this issue.

  • platform/mac-wk1/http/tests/security/contentSecurityPolicy/user-style-sheet-font-crasher-expected.txt:
  • platform/win/http/tests/security/contentSecurityPolicy/user-style-sheet-font-crasher-expected.txt:
2:08 PM Changeset in webkit [250254] by achristensen@apple.com
  • 5 edits in trunk/Source/WebKit

REGRESSION(250143) Disk cache should be enabled for Safari
https://bugs.webkit.org/show_bug.cgi?id=202117

Reviewed by Brady Eidson.

r250143 made it so in Safari, when setCacheModel is called for the first time in NetworkProcess::initializeNetworkProcess,
it didn't have a path to check available disk space. This resulted in disabling the disk cache in Safari, which caused a
huge performance regression.

  • NetworkProcess/NetworkProcess.cpp:

(WebKit::NetworkProcess::initializeNetworkProcess):
(WebKit::NetworkProcess::setCacheModel):

  • NetworkProcess/NetworkProcess.h:

(WebKit::NetworkProcess::setCacheModel):

  • NetworkProcess/NetworkProcess.messages.in:
  • UIProcess/WebProcessPool.cpp:

(WebKit::WebProcessPool::ensureNetworkProcess):
(WebKit::WebProcessPool::setCacheModel):

1:56 PM Changeset in webkit [250253] by Alan Coon
  • 8 edits in branches/safari-608-branch/Source/WebKit

Apply patch. rdar://problem/55608007

1:56 PM Changeset in webkit [250252] by Alan Coon
  • 5 edits in branches/safari-608-branch/Source

Apply patch. rdar://problem/55427470

1:50 PM Changeset in webkit [250251] by Jonathan Bedard
  • 2 edits in trunk/Tools

results.webkit.org: Collapse results with the same version name (Follow-up fix)
https://bugs.webkit.org/show_bug.cgi?id=201779

Rubber-stamped by Aakash Jain.

  • resultsdbpy/resultsdbpy/view/static/js/configuration.js:

(Configuration.prototype.compare): Correctly compare constructed version names.

1:42 PM Changeset in webkit [250250] by Caio Lima
  • 2 edits in trunk/JSTests

Skip stress/regexp-unicode-surrogate-pair-increment-should-involve-length-check.js into ARMv7 and MIPS
https://bugs.webkit.org/show_bug.cgi?id=202113

Unreviewed test gardening, skipped test in ARMv7 and MIPS.

It is going to be fixed in
https://bugs.webkit.org/show_bug.cgi?id=202041

  • stress/regexp-unicode-surrogate-pair-increment-should-involve-length-check.js:
1:18 PM Changeset in webkit [250249] by jiewen_tan@apple.com
  • 27 edits in trunk

[WebAuthn] LocalAuthenticator tests are failing on internal bots
https://bugs.webkit.org/show_bug.cgi?id=201844
<rdar://problem/54278693>

Reviewed by Brent Fulgham.

Source/WebKit:

This patch adds a way for mock tests to select a credential in getAssertion
ceremonies such that a test can ensure it always uses the credential it manages.
Credentials managed by other test could be deleted at anytime.

  • UIProcess/API/C/WKWebsiteDataStoreRef.cpp:

(WKWebsiteDataStoreSetWebAuthenticationMockConfiguration):

  • UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:

(WebKit::LocalAuthenticator::getAssertion):

  • UIProcess/WebAuthentication/Cocoa/LocalConnection.h:
  • UIProcess/WebAuthentication/Cocoa/LocalConnection.mm:

(WebKit::LocalConnection::selectCredential const):

  • UIProcess/WebAuthentication/Mock/MockLocalConnection.h:
  • UIProcess/WebAuthentication/Mock/MockLocalConnection.mm:

(WebKit::MockLocalConnection::selectCredential const):

  • UIProcess/WebAuthentication/Mock/MockWebAuthenticationConfiguration.h:

Tools:

LocalAuthenticator tests utilize Keychain for mock testing. Unlike iOS simulator tests which
each test runner is running in different simulator containers, all test runners are running
in the same macOS container in macOS. Therefore, Keychain is shared among all test runners
in macOS while it is not in iOS simulators. And therefore, race conditions would happen in
macOS which make the current tests flaky given they don't consider race conditions.

This patch then makes each test generate a random credential, and thus no other tests would
be able to access it, and therefore eliminate any race condition. To support this, a few new
functionalities are introduced to the mock test infrastructure as well:
1) TestRunner.cleanUpKeychain accepts a new parameter to more precisely identify an item.
2) WebAuthenticationMockConfiguration.Local has a new member to uniquely select a credential
for getAssertion ceremony when multiple presents.

  • WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
  • WebKitTestRunner/InjectedBundle/TestRunner.cpp:

(WTR::TestRunner::setWebAuthenticationMockConfiguration):
(WTR::TestRunner::cleanUpKeychain):

  • WebKitTestRunner/InjectedBundle/TestRunner.h:
  • WebKitTestRunner/TestController.h:
  • WebKitTestRunner/TestInvocation.cpp:

(WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle):

  • WebKitTestRunner/TestController.cpp:

(WTR::TestController::cleanUpKeychain):

  • WebKitTestRunner/cocoa/TestControllerCocoa.mm:

(WTR::TestController::cleanUpKeychain):

LayoutTests:

This patch makes each test to generate their own credentials to avoid race conditions in Keychain
accesses when multiple test runners present.

  • http/wpt/credential-management/credentialscontainer-store-basics.https.html:
  • http/wpt/webauthn/idl.https.html:

These two tests are changed to use hid authenticator instead of local to avoid any future Keychain issues.

  • http/wpt/webauthn/public-key-credential-create-failure-local-silent.https.html:
  • http/wpt/webauthn/public-key-credential-create-failure-local.https.html:
  • http/wpt/webauthn/public-key-credential-create-success-local.https.html:
  • http/wpt/webauthn/public-key-credential-get-failure-local-silent.https.html:
  • http/wpt/webauthn/public-key-credential-get-failure-local.https.html:
  • http/wpt/webauthn/public-key-credential-get-success-local.https.html:
  • http/wpt/webauthn/resources/util.js:
  • platform/mac-wk2/TestExpectations:
1:15 PM Changeset in webkit [250248] by david_quesada@apple.com
  • 2 edits in trunk/Source/WebKit

[iOS] REGRESSION(r250151): Occasional assertion failures in ShareableBitmap::~ShareableBitmap()
https://bugs.webkit.org/show_bug.cgi?id=202112
rdar://problem/55624598

Reviewed by Chris Dumez.

  • Shared/cg/ShareableBitmapCG.cpp:

(WebKit::ShareableBitmap::releaseDataProviderData):
It is possible and valid for a UIImage created from a ShareableBitmap's CGImage representation
to be deallocated on a background thread. When this happens, releaseDataProviderData() should
ensure it's running on the main thread before deref'ing the ShareableBitmap. Otherwise the
bitmap can be deallocated on the background thread, violating an assertion added in r250151.

12:15 PM Changeset in webkit [250247] by Keith Rollin
  • 2 edits in trunk/Source/WebCore

Unreviewed build fix after r250173: tvOS build broken due to unused function.

  • platform/network/cocoa/CookieCocoa.mm:

(WebCore::Cookie::operator NSHTTPCookie * _Nullable const):

11:38 AM Changeset in webkit [250246] by Kocsen Chung
  • 6 edits in branches/safari-608-branch

Cherry-pick r250015. rdar://problem/55579794

Remove the "Show Link Previews" and "Hide Link Previews" action menus in the preview platter
https://bugs.webkit.org/show_bug.cgi?id=201864
<rdar://55190038>

Reviewed by Simon Fraser.

Source/WebKit:

  • UIProcess/ios/WKActionSheetAssistant.mm: Remove the toggle action from the default values. (-[WKActionSheetAssistant defaultActionsForLinkSheet:]):
  • UIProcess/ios/WKContentViewInteraction.mm: No longer try to add a toggle when it isn't there. (-[WKContentView assignLegacyDataForContextMenuInteraction]): (menuWithShowLinkPreviewAction): Deleted.

Tools:

Test for the suggested actions.

  • TestWebKitAPI/Tests/WebKitCocoa/ContextMenus.mm: (-[TestContextMenuSuggestedActionsUIDelegate webView:contextMenuConfigurationForElement:completionHandler:]): (-[TestContextMenuSuggestedActionsUIDelegate webView:contextMenuWillPresentForElement:]): (TEST):

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

11:23 AM Changeset in webkit [250245] by Kocsen Chung
  • 7 edits in branches/safari-608-branch/Source

Versioning.

11:19 AM Changeset in webkit [250244] by Kocsen Chung
  • 7 edits in branches/safari-608.2.11.1-branch/Source

Versioning.

11:06 AM Changeset in webkit [250243] by Joseph Pecoraro
  • 7 edits in trunk/Source

Web Inspector: Improve the Uncaught Exception View file a bug link
https://bugs.webkit.org/show_bug.cgi?id=201717

Reviewed by Devin Rousso.

Source/WebInspectorUI:

  • UserInterface/Debug/UncaughtExceptionReporter.js:

Allow the link to be clicked. Use openInNewTab on click to also
bring the new tab to the foreground. Also update the content.

Source/WebKit:

  • UIProcess/WebInspectorProxy.cpp:

(WebKit::WebInspectorProxy::bringInspectedPageToFront):

  • UIProcess/WebInspectorProxy.h:
  • UIProcess/WebInspectorProxy.messages.in:

Provide a way to bring the inspected page to the foreground.

  • WebProcess/WebPage/WebInspectorUI.cpp:

(WebKit::WebInspectorUI::openInNewTab):
Use it when opening a new tab beside the inspected page.

11:00 AM Changeset in webkit [250242] by Brent Fulgham
  • 3 edits in trunk/Source/WebKit

Unreviewed build fix after r250169 and r250236.

  • NetworkProcess/curl/NetworkDataTaskCurl.cpp:

(WebKit::NetworkDataTaskCurl::createCurlRequest):

  • UIProcess/API/C/curl/WKWebsiteDataStoreRefCurl.cpp:

(WKWebsiteDataStoreEnableDefaultNetworkProxySettings):
(WKWebsiteDataStoreEnableCustomNetworkProxySettings):
(WKWebsiteDataStoreDisableNetworkProxySettings):

10:53 AM Changeset in webkit [250241] by Brent Fulgham
  • 2 edits in trunk/Source/WebCore

Unreviewed WinCairo/FTW Build fix after r250192.

  • platform/network/curl/CurlDownload.cpp:

(WebCore::CurlDownload::createCurlRequest):

10:21 AM Changeset in webkit [250240] by Alan Bujtas
  • 3 edits in trunk/Source/WebCore

[LFC][IFC] Merge inline box compute functions
https://bugs.webkit.org/show_bug.cgi?id=202092
<rdar://problem/55607748>

Reviewed by Antti Koivisto.

Make InlineFormattingContext::layoutInFlowContent() logic simpler.

  • layout/inlineformatting/InlineFormattingContext.cpp:

(WebCore::Layout::InlineFormattingContext::layoutInFlowContent):
(WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot):
(WebCore::Layout::InlineFormattingContext::computeHorizontalAndVerticalGeometry):
(WebCore::Layout::InlineFormattingContext::initializeMarginBorderAndPaddingForGenericInlineBox): Deleted.
(WebCore::Layout::InlineFormattingContext::computeMarginBorderAndPaddingForInlineContainer): Deleted.

  • layout/inlineformatting/InlineFormattingContext.h:
10:04 AM Changeset in webkit [250239] by ddkilzer@apple.com
  • 5 edits in trunk/Source/WebKit

clang-tidy: Fix unnecessary copy/ref churn of for loop variables in WebKit
<https://webkit.org/b/202096>

Reviewed by Darin Adler.

Fix unwanted copying/ref churn of loop variables by making them
const references.

  • NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:

(WebKit::domainsToString):

  • UIProcess/ios/WKActionSheetAssistant.mm:

(-[WKActionSheetAssistant presentationRectForElementUsingClosestIndicatedRect]):

  • UIProcess/ios/WKContentViewInteraction.mm:

(-[WKContentView _singleTapDidReset:]):

  • UIProcess/ios/WebDataListSuggestionsDropdownIOS.mm:

(-[WKDataListSuggestionsControl textSuggestions]):

9:48 AM Changeset in webkit [250238] by ddkilzer@apple.com
  • 2 edits in trunk/Source/WebCore

REGRESSION (r249855): Remove debug logging from WebCore::RenderImage::paintIntoRect()
<https://webkit.org/b/202103>

Reviewed by Zalan Bujtas.

  • rendering/RenderImage.cpp:

(WebCore::RenderImage::paintIntoRect): Remove debug logging
statements.

9:40 AM Changeset in webkit [250237] by Kocsen Chung
  • 7 edits in branches/safari-608.2.30.1-branch/Source

Versioning.

9:31 AM Changeset in webkit [250236] by Chris Dumez
  • 3 edits in trunk/Source/WebKit

WebPage::sessionID() does not need to get the sessionID from there WebCore Page
https://bugs.webkit.org/show_bug.cgi?id=202094

Reviewed by Youenn Fablet.

WebPage::sessionID() does not need to get the sessionID from there WebCore Page, it can
simply get the sessionID from the WebProcess singleton, now that we have a single session
per WebProcess. This will avoid potential crashes trying to dereference m_page to get the
sessionID, since m_page can be null.

  • WebProcess/WebPage/WebPage.cpp:

(WebKit::WebPage::sessionID const):

  • WebProcess/WebPage/WebPage.h:

(WebKit::WebPage::sessionID const): Deleted.

9:14 AM Changeset in webkit [250235] by Alan Bujtas
  • 4 edits in trunk/Source/WebCore

[LFC][IFC] Pass in the Used*Values to inline layout functions.
https://bugs.webkit.org/show_bug.cgi?id=202091
<rdar://problem/55601987>

Reviewed by Antti Koivisto.

Only the top level layout functions should generate constraint values.

  • layout/inlineformatting/InlineFormattingContext.cpp:

(WebCore::Layout::InlineFormattingContext::layoutInFlowContent):
(WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthConstraints):
(WebCore::Layout::InlineFormattingContext::computeMarginBorderAndPaddingForInlineContainer):
(WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFormattingRoot):
(WebCore::Layout::InlineFormattingContext::computeHorizontalMargin):
(WebCore::Layout::InlineFormattingContext::computeWidthAndMargin):
(WebCore::Layout::InlineFormattingContext::computeHeightAndMargin):
(WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot):
(WebCore::Layout::InlineFormattingContext::computeWidthAndHeightForReplacedInlineBox):

  • layout/inlineformatting/InlineFormattingContext.h:

(WebCore::Layout::InlineFormattingContext::InlineLayout::widthConstraint const):

  • layout/inlineformatting/InlineFormattingContextLineLayout.cpp:

(WebCore::Layout::InlineFormattingContext::InlineLayout::InlineLayout):
(WebCore::Layout::InlineFormattingContext::InlineLayout::layout):
(WebCore::Layout::InlineFormattingContext::InlineLayout::computedIntrinsicWidth const):
(WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns):

8:54 AM Changeset in webkit [250234] by Antti Koivisto
  • 13 edits in trunk/Source/WebCore

Refcount simple line layout
https://bugs.webkit.org/show_bug.cgi?id=202104

Reviewed by Zalan Bujtas.

Make SimpleLineLayout::Layout refcounted for safety and ease of use.

  • dom/Position.cpp:

(WebCore::Position::upstream const):
(WebCore::Position::downstream const):

  • editing/TextIterator.cpp:

(WebCore::TextIterator::handleTextNode):
(WebCore::TextIterator::handleTextBox):
(WebCore::TextIterator::handleTextNodeFirstLetter):

  • editing/TextIterator.h:
  • rendering/RenderBlockFlow.h:
  • rendering/RenderTreeAsText.cpp:

(WebCore::RenderTreeAsText::writeRenderObject):
(WebCore::write):

  • rendering/SimpleLineLayout.cpp:

(WebCore::SimpleLineLayout::create):
(WebCore::SimpleLineLayout::Layout::create):

  • rendering/SimpleLineLayout.h:
  • rendering/SimpleLineLayoutFunctions.cpp:

(WebCore::SimpleLineLayout::outputLineLayoutForFlow):

  • rendering/SimpleLineLayoutResolver.cpp:

(WebCore::SimpleLineLayout::RunResolver::Run::rect const):
(WebCore::SimpleLineLayout::RunResolver::Iterator::Iterator):

Iterator now refs the layout. Since the resolver is owned by the layout, it is guaranteed to stay alive too.

(WebCore::SimpleLineLayout::RunResolver::Iterator::advanceLines):

  • rendering/SimpleLineLayoutResolver.h:

(WebCore::SimpleLineLayout::RunResolver::Iterator::layout const):
(WebCore::SimpleLineLayout::RunResolver::Run::computeBaselinePosition const):
(WebCore::SimpleLineLayout::RunResolver::Iterator::simpleRun const):
(WebCore::SimpleLineLayout::RunResolver::Iterator::inQuirksMode const): Deleted.
(WebCore::SimpleLineLayout::runResolver): Deleted.

Always use the cached resolver owned by SimpleLineLayout::Layout.

  • rendering/line/LineLayoutInterfaceTextBoxes.cpp:

(WebCore::LineLayoutInterface::firstTextBoxInVisualOrderFor):
(WebCore::LineLayoutInterface::firstTextBoxInTextOrderFor):
(WebCore::LineLayoutInterface::textBoxRangeFor):
(WebCore::LineLayoutInterface::Provider::firstTextBoxInVisualOrderFor): Deleted.
(WebCore::LineLayoutInterface::Provider::firstTextBoxInTextOrderFor): Deleted.
(WebCore::LineLayoutInterface::Provider::textBoxRangeFor): Deleted.

There is no need for a separate Provider class anymore as the iterator keeps SimpleLineLayout::Layout
and Resolver instances alive itself.

  • rendering/line/LineLayoutInterfaceTextBoxes.h:

(WebCore::LineLayoutInterface::hasTextBoxes):
(WebCore::LineLayoutInterface::Provider::firstTextBoxFor): Deleted.

7:17 AM WebKitGTK/2.26.x edited by Michael Catanzaro
(diff)
7:16 AM Changeset in webkit [250233] by youenn@apple.com
  • 9 edits in trunk

Simplify UserMediaPermissionRequestManager management of UserMediaRequest
https://bugs.webkit.org/show_bug.cgi?id=201688

Reviewed by Eric Carlson.

Source/WebCore:

Covered by existing tests and modified test.

  • Modules/mediastream/UserMediaRequest.cpp:

(WebCore::UserMediaRequest::UserMediaRequest):

  • Modules/mediastream/UserMediaRequest.h:

(WebCore::UserMediaRequest::identifier const):
Add an identifier generated for each request.

Source/WebKit:

Instead of having two maps to go from ID to request and request to ID,
Make request own its ID and keep a single ID to request map.
Rename it to m_ongoingUserMediaRequests.

Rename requests that are not processed because the document cannot start media as m_pendingUserMediaRequests.
In case the request is cancelled following the stopping of active dom objects, we just remove it from m_pendingUserMediaRequests
instead of denying the request. This matches Chrome and Firefox behavior.

  • WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:

(WebKit::UserMediaPermissionRequestManager::startUserMediaRequest):
(WebKit::UserMediaPermissionRequestManager::sendUserMediaRequest):
(WebKit::UserMediaPermissionRequestManager::cancelUserMediaRequest):
(WebKit::UserMediaPermissionRequestManager::mediaCanStart):
(WebKit::UserMediaPermissionRequestManager::userMediaAccessWasGranted):
(WebKit::UserMediaPermissionRequestManager::userMediaAccessWasDenied):
(WebKit::UserMediaPermissionRequestManager::addDeviceChangeObserver):
(WebKit::generateRequestID): Deleted.
(WebKit::UserMediaPermissionRequestManager::removeMediaRequestFromMaps): Deleted.

  • WebProcess/MediaStream/UserMediaPermissionRequestManager.h:

LayoutTests:

  • http/tests/media/media-stream/disconnected-frame-permission-denied-expected.txt:
  • http/tests/media/media-stream/disconnected-frame-permission-denied.html:
7:08 AM Changeset in webkit [250232] by zandobersek@gmail.com
  • 2 edits in trunk/Source/JavaScriptCore

testmasm: integer operands loaded as unsigned values
https://bugs.webkit.org/show_bug.cgi?id=202099

Reviewed by Mark Lam.

Suppress GCC warnings about comparing signed and unsigned values in
test cases introduced in r247913 by using signed integer types for
loading 32-bit and 64-bit integer operand values.

  • assembler/testmasm.cpp:

(JSC::testBranchTestBit32RegReg):
(JSC::testBranchTestBit32RegImm):
(JSC::testBranchTestBit32AddrImm):
(JSC::testBranchTestBit64RegReg):
(JSC::testBranchTestBit64RegImm):
(JSC::testBranchTestBit64AddrImm):

6:59 AM Changeset in webkit [250231] by Patrick Griffis
  • 2 edits in trunk/Source/WebKit

[GTK][WPE] Don't use prgname in dbus-proxy socket path
https://bugs.webkit.org/show_bug.cgi?id=201979

The path length for the socket is limited to 108 bytes so it is easy for a long
prgname to cause it to get truncated and fail. Since we only allow the socket
path into the sandbox the unique directory isn't necessary.

Reviewed by Michael Catanzaro.

  • UIProcess/Launcher/glib/BubblewrapLauncher.cpp:

(WebKit::XDGDBusProxyLauncher::setAddress):

6:22 AM UsingGitWithWebKit edited by ddkilzer@apple.com
(diff)
3:42 AM Changeset in webkit [250230] by Carlos Garcia Campos
  • 1 copy in releases/WebKitGTK/webkit-2.26.1

WebKitGTK 2.26.1

3:40 AM Changeset in webkit [250229] by Carlos Garcia Campos
  • 4 edits in releases/WebKitGTK/webkit-2.26

Unreviewed. Update OptionsGTK.cmake and NEWS for 2.26.1 release

.:

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

Source/WebKit:

  • gtk/NEWS: Add release notes for 2.26.1.
3:40 AM Changeset in webkit [250228] by Carlos Garcia Campos
  • 2 edits in releases/WebKitGTK/webkit-2.26/Source/WTF

Merge r250126 - UI process crash when using callOnMainThread() after the main thread dispatcher has been destroyed
https://bugs.webkit.org/show_bug.cgi?id=197266

Patch by Libor Bukata <libor.bukata@oracle.com> on 2019-09-20
Reviewed by Carlos Garcia Campos.

  • wtf/generic/MainThreadGeneric.cpp:

(WTF::scheduleDispatchFunctionsOnMainThread):

3:31 AM Changeset in webkit [250227] by cturner@igalia.com
  • 2 edits in trunk/Source/WebCore

[GStreamer] isAVC1CodecSupported is crashing several media source tests due to avc1.4d4001 codec type
https://bugs.webkit.org/show_bug.cgi?id=201870

Reviewed by Xabier Rodriguez-Calvar.

The GStreamer codec-utils package expects all level_idc's to be
multiples of 10 from the spec idc, i.e., 1.1 -> 11, 3.1 -> 31, 1
-> 10, etc.

In the WPT tests, there is some confusion of this *10 multiplier,
and the level_idc is given in several places as simply "1". This
causes the get_level codec helper to return NULL, which the
registry scanner was not handling properly, and crashing on.

Fix this by special casing "web level idc's" that violate the *10
rule in isAVC1CodecSupported.

There is prior art along these lines in Gecko:
https://searchfox.org/mozilla-central/source/dom/media/VideoUtils.cpp#453
I assume Chrome/IE/etc must do something similar. The fix does not
belong in GStreamer since these are actually invalid inputs to the
get_level function.

Tested by imported/w3c/web-platform-tests/media-source

  • platform/graphics/gstreamer/GStreamerRegistryScanner.cpp:

(WebCore::GStreamerRegistryScanner::isAVC1CodecSupported const):
Special case levels 1..5, even though these *should* be
represented as 10 through 50 respectively, they are not in
web-land. The two-byte local storage trick was contributed to me
by Adrian Perez de Castro.

3:14 AM Changeset in webkit [250226] by Carlos Garcia Campos
  • 3 edits in releases/WebKitGTK/webkit-2.26/Source/WebKit

Merge r250217 - [SOUP] Stop setting G_TLS_GNUTLS_PRIORITY
https://bugs.webkit.org/show_bug.cgi?id=172154

Reviewed by Carlos Garcia Campos.

Nowadays, I maintain glib-networking. WebKit doesn't need to override its defaults to be
secure anymore. By overriding glib-networking's default priority, WebKit is force-reenabling
TLS 1.0 and TLS 1.1 even when glib-networking has disabled them.

  • NetworkProcess/EntryPoint/unix/NetworkProcessMain.cpp:

(main):

  • WebProcess/EntryPoint/unix/WebProcessMain.cpp:

(main):

3:14 AM Changeset in webkit [250225] by Carlos Garcia Campos
  • 3 edits
    1 add in releases/WebKitGTK/webkit-2.26

Merge r250058 - Phantom insertion phase may disagree with arguments forwarding about live ranges
https://bugs.webkit.org/show_bug.cgi?id=200715
<rdar://problem/54301717>

Reviewed by Yusuke Suzuki.

JSTests:

  • stress/phantom-insertion-live-range-should-agree-with-arguments-forwarding.js: Added.

(main.v23):
(main.try.v43):
(main.):
(main):

Source/JavaScriptCore:

The issue is that Phantom insertion phase was disagreeing about live ranges
from the arguments forwarding phase. The effect is that Phantom insertion
would insert a Phantom creating a longer live range than what arguments
forwarding was analyzing. Arguments forwarding will look for the last DFG
use or the last bytecode use of a variable it wants to eliminate. It then
does an interference analysis to ensure that nothing clobbers other variables
it needs to recover the sunken allocation during OSR exit.

Phantom insertion works by ordering the program into OSR exit epochs. If a value was used
in the current epoch, there is no need to insert a phantom for it. We
determine where we might need a Phantom by looking at bytecode kills. In this
analysis, we have a mapping from bytecode local to DFG node. However, we
sometimes forgot to remove the entry when a local is killed. So, if the first
kill of a variable is in the same OSR exit epoch, we won't insert a Phantom by design.
However, if the variable gets killed again, we might errantly insert a Phantom
for the prior variable which should've already been killed. The solution is to
clear the entry in our mapping when a variable is killed.

The program in question was like this:

1: DirectArguments
...
2: MovHint(@1, loc1) arguments forwarding treats this as the final kill for @1
...
clobber things needed for recovery
...

Arguments elimination would transform the program since between @1 and
@2, nothing clobbers values needed for exit and nothing escapes @1. The
program becomes:

1: PhantomDirectArguments
...
2: MovHint(@1, loc1) arguments forwarding treats this as the final kill for @1
...
clobber things needed for recovery of @1
...

Phantom insertion would then transform the program into:

1: PhantomDirectArguments
...
2: MovHint(@1, loc1) arguments forwarding treats this as the final kill for @1
...
clobber things needed for recovery of @1
...
3: Phantom(@1)
...

This is wrong because Phantom insertion and arguments forwarding must agree on live
ranges, otherwise the interference analysis performed by arguments forwarding will
not correctly analyze up until where the value might be recovered.

  • dfg/DFGPhantomInsertionPhase.cpp:
3:14 AM Changeset in webkit [250224] by Carlos Garcia Campos
  • 3 edits
    2 adds in releases/WebKitGTK/webkit-2.26

Merge r249954 - [First-letter] Use WeakPtr for the first-letter insertion point.
https://bugs.webkit.org/show_bug.cgi?id=201842
<rdar://problem/51373788>

Reviewed by Antti Koivisto.

Source/WebCore:

The about-to-be-removed first letter renderer's sibling could potentially be destroyed too as the result of the anonymous subtree collapsing logic (when the next sibling is a generated anonymous block and it is not needed anymore.)

Test: fast/text/first-letter-with-columns-crash.html

  • rendering/updating/RenderTreeBuilderFirstLetter.cpp:

(WebCore::RenderTreeBuilder::FirstLetter::updateStyle):

LayoutTests:

  • fast/text/first-letter-with-columns-crash-expected.txt: Added.
  • fast/text/first-letter-with-columns-crash.html: Added.
3:14 AM Changeset in webkit [250223] by Carlos Garcia Campos
  • 5 edits
    1 add in releases/WebKitGTK/webkit-2.26

Merge r249926 - [JSC] Perform check again when we found non-BMP characters
https://bugs.webkit.org/show_bug.cgi?id=201647

Reviewed by Yusuke Suzuki.

JSTests:

  • stress/regexp-unicode-surrogate-pair-increment-should-involve-length-check.js: Added.
  • stress/regexp-unicode-within-string.js: Updated test to eliminate the bogus print().

(testRegExpInbounds):

Source/JavaScriptCore:

We need to check for end of input for non-BMP characters when matching a character class that contains
both BMP and non-BMP characters. In advanceIndexAfterCharacterClassTermMatch() we were checking for
end of input for both BMP and non-BMP characters. For BMP characters, this check is redundant.
After moving the check to after the "is BMP check", we need to decrement index after reaching the failure
label to back out the index++ for the first surrogate of the non-BMP character.

Added the same kind of check in generateCharacterClassOnce(). In that case, we have pre-checked the
first character (surrogate) for a non-BMP codepoint, so we just need to check for end of input before
we increment for the second surrogate.

While writing tests, I found an off by one error in backtrackCharacterClassGreedy() and changed the
loop to check the count at loop top instead of loop bottom.

  • yarr/YarrJIT.cpp:

(JSC::Yarr::YarrGenerator::advanceIndexAfterCharacterClassTermMatch):
(JSC::Yarr::YarrGenerator::generateCharacterClassOnce):
(JSC::Yarr::YarrGenerator::generateCharacterClassGreedy):
(JSC::Yarr::YarrGenerator::backtrackCharacterClassGreedy):
(JSC::Yarr::YarrGenerator::backtrackCharacterClassNonGreedy):

3:14 AM Changeset in webkit [250222] by Carlos Garcia Campos
  • 2 edits in releases/WebKitGTK/webkit-2.26/Source/WebCore

Merge r249854 - Crash under WebCore::firstPositionInNode()
https://bugs.webkit.org/show_bug.cgi?id=201764
<rdar://problem/54823754>

Reviewed by Wenson Hsieh and Geoff Garen.

Make sure to keep a Ref<> to the textNode when we call insertNodeAtTabSpanPosition()
or insertNodeAt().

Test: editing/firstPositionInNode-crash.html

  • editing/InsertTextCommand.cpp:

(WebCore::InsertTextCommand::positionInsideTextNode):

3:14 AM Changeset in webkit [250221] by Carlos Garcia Campos
  • 3 edits
    1 add in releases/WebKitGTK/webkit-2.26

Merge r249777 - JSC crashes due to stack overflow while building RegExp
https://bugs.webkit.org/show_bug.cgi?id=201649

Reviewed by Yusuke Suzuki.

JSTests:

New regression test.

  • stress/regexp-bol-optimize-out-of-stack.js: Added.

(test):
(catch):

Source/JavaScriptCore:

Check for running out of stack when we are optimizing RegExp containing BOL terms or
other deep copying of disjunctions.

  • yarr/YarrPattern.cpp:

(JSC::Yarr::YarrPatternConstructor::copyDisjunction):
(JSC::Yarr::YarrPatternConstructor::copyTerm):
(JSC::Yarr::YarrPatternConstructor::error):
(JSC::Yarr::YarrPattern::compile):

3:14 AM Changeset in webkit [250220] by Carlos Garcia Campos
  • 4 edits in releases/WebKitGTK/webkit-2.26/Source/WebCore

Merge r249762 - Prevent reentrancy FrameLoader::dispatchUnloadEvents()
https://bugs.webkit.org/show_bug.cgi?id=200738

Reviewed by Brady Eidson.

Reentrancy causes m_pageDismissalEventBeingDispatched to be incorrectly
updated, so don't allow reentrancy.

Since this prevents m_pageDismissalEventBeingDispatched from being reset
inside a reentrant call, it can have the unintended effect of causing
FrameLoader::stopAllLoaders to early-out when called from
FrameLoader::detachFromParent while a frame's unload event handler
calls document.open() on a parent frame and causes itself to become
detached. Allowing a load to continue in a detached frame will lead to
a crash. To prevent this, add a new argument to FrameLoader::stopAllLoaders
that FrameLoader::detachFromParent can use to prevent an early-out.

  • loader/FrameLoader.cpp:

(WebCore::FrameLoader::stopAllLoaders):
(WebCore::FrameLoader::detachFromParent):
(WebCore::FrameLoader::dispatchUnloadEvents):
(WebCore::FrameLoader::dispatchBeforeUnloadEvent):
Ensure that m_pageDismissalEventBeingDispatched is reset to its previous value, even if this is not None.

  • loader/FrameLoader.h:
  • loader/FrameLoaderTypes.h:

Add a StopLoadingPolicy enum.

3:14 AM Changeset in webkit [250219] by Carlos Garcia Campos
  • 10 edits in releases/WebKitGTK/webkit-2.26

Merge r249445 - REGRESSION (r249078): Flaky crash in com.apple.JavaScriptCore: Inspector::InjectedScriptModule::ensureInjected
https://bugs.webkit.org/show_bug.cgi?id=201201
<rdar://problem/54771560>

Reviewed by Joseph Pecoraro.

Source/JavaScriptCore:

  • inspector/InjectedScriptSource.js:

(let.InjectedScript.prototype.injectModule):
(let.InjectedScript.prototype._evaluateOn):
(CommandLineAPI):
(let.InjectedScript.prototype.setInspectObject): Deleted.
(let.InjectedScript.prototype.addCommandLineAPIGetter): Deleted.
(let.InjectedScript.prototype.addCommandLineAPIMethod.func.toString): Deleted.
(let.InjectedScript.prototype.addCommandLineAPIMethod): Deleted.
(InjectedScript.CommandLineAPI): Deleted.
Allow injected script "extensions" (e.g. CommandLineAPIModuleSource.js) to modify objects
directly, instead of having them call functions.

  • inspector/InjectedScriptModule.cpp:

(Inspector::InjectedScriptModule::ensureInjected):
Make sure to reset hadException to false before making another call.

Source/WebCore:

Tests: inspector/debugger/tail-deleted-frames-this-value.html

inspector/heap/getRemoteObject.html

  • inspector/CommandLineAPIModuleSource.js:

Avoid executing functions when injecting. Instead, modify the CommandLineAPI directly.

LayoutTests:

  • inspector/debugger/tail-deleted-frames-this-value.html:
  • inspector/debugger/tail-deleted-frames-this-value-expected.txt:
  • inspector/debugger/resources/tail-deleted-frames-this-value.js:
  • inspector/timeline/line-column-expected.txt:
3:14 AM Changeset in webkit [250218] by Carlos Garcia Campos
  • 8 edits
    2 adds in releases/WebKitGTK/webkit-2.26

Merge r249594 - REGRESSION (r249367): m_decodingPromises grows indefinitely until ImageLoader destruction
https://bugs.webkit.org/show_bug.cgi?id=201402

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2019-09-06
Reviewed by Youenn Fablet and Daniel Bates.

Source/WebCore:

Add the static functions resolvePromises() and rejectPromises(). These
functions take an lvalue reference to a Vector of promises. Inside them,
the lvalue reference argument are exchanged with an empty Vector of
promises then the promises are processed. This clears m_decodingPromises
and fixes the leak.

Add an internal API which returns the count of the pending promises of
an HTMLImageElement. This internal API will be used in the attached test.

Test: fast/images/decode-resolve-reject-no-leak.html

  • html/HTMLImageElement.h:

(WebCore::HTMLImageElement::pendingDecodePromisesCountForTesting const):

  • loader/ImageLoader.cpp:

(WebCore::resolvePromises):
ImageLoader::decode() calls BitmapImage::decode() and moves m_decodingPromises
in capture. When decoding finishes, this function is called to resolve the
promises. But ImageLoader might get deleted before the image decoding
finishes. So this function has to be static.

(WebCore::rejectPromises):
(WebCore::ImageLoader::resolveDecodePromises):
(WebCore::ImageLoader::rejectDecodePromises):
(WebCore::ImageLoader::notifyFinished):
(WebCore::ImageLoader::decode):
(WebCore::resolveDecodePromises): Deleted.
(WebCore::rejectDecodePromises): Deleted.

  • loader/ImageLoader.h:

(WebCore::ImageLoader::pendingDecodePromisesCountForTesting const):

  • testing/Internals.cpp:

(WebCore::Internals::imagePendingDecodePromisesCountForTesting):

  • testing/Internals.h:
  • testing/Internals.idl:

LayoutTests:

  • fast/images/decode-resolve-reject-no-leak-expected.txt: Added.
  • fast/images/decode-resolve-reject-no-leak.html: Added.
2:05 AM Changeset in webkit [250217] by Michael Catanzaro
  • 3 edits in trunk/Source/WebKit

[SOUP] Stop setting G_TLS_GNUTLS_PRIORITY
https://bugs.webkit.org/show_bug.cgi?id=172154

Reviewed by Carlos Garcia Campos.

Nowadays, I maintain glib-networking. WebKit doesn't need to override its defaults to be
secure anymore. By overriding glib-networking's default priority, WebKit is force-reenabling
TLS 1.0 and TLS 1.1 even when glib-networking has disabled them.

  • NetworkProcess/EntryPoint/unix/NetworkProcessMain.cpp:

(main):

  • WebProcess/EntryPoint/unix/WebProcessMain.cpp:

(main):

1:49 AM Changeset in webkit [250216] by commit-queue@webkit.org
  • 6 edits
    4 adds
    1 delete in trunk

Sync operator dictionary
https://bugs.webkit.org/show_bug.cgi?id=201974

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

LayoutTests/imported/w3c:

Update improved test results.

  • web-platform-tests/mathml/presentation-markup/operators/operator-dictionary-001-expected.txt:

Source/WebCore:

Sync with operator dictionary list from
https://mathml-refresh.github.io/mathml-core/#operator-dictionary

Test: imported/w3c/web-platform-tests/mathml/presentation-markup/operators/operator-dictionary-001.html

  • mathml/MathMLOperatorDictionary.cpp:

LayoutTests:

  • platform/ios-wk2/imported/w3c/web-platform-tests/mathml/relations/css-styling/ignored-properties-001-expected.txt: Added.
  • platform/win/TestExpectations:
1:46 AM Changeset in webkit [250215] by Carlos Garcia Campos
  • 2 edits in releases/WebKitGTK/webkit-2.26/Source/WebCore

Merge r250027 - [cairo] Incorrect targetRect in BackingStoreBackendCairoImpl::scroll
https://bugs.webkit.org/show_bug.cgi?id=201895

Reviewed by Carlos Garcia Campos.

In BackingStoreBackendCairoImpl::scroll, targetRect is calculated
wrongly by shifting maxX and maxY. Bug 59655 fixed the issue by
removing the shifting, but only for BackingStoreBackendCairoX11::scroll.

No new tests, no behavior change.

  • platform/graphics/cairo/BackingStoreBackendCairoImpl.cpp:

(WebCore::BackingStoreBackendCairoImpl::scroll): Take intersection of targetRect and scrollRect.

1:46 AM Changeset in webkit [250214] by Carlos Garcia Campos
  • 2 edits in releases/WebKitGTK/webkit-2.26/Source/WebCore

Merge r249937 - [Cairo] Image::drawTiled → Cairo::drawSurface → cairo_paint_with_alpha → segfault happens in pixman
https://bugs.webkit.org/show_bug.cgi?id=201755

Reviewed by Don Olmstead.

Segmentation faults happened in pixman while painting a image. In
Cairo::drawSurface, originalSrcRect can be slightly larger than
the surface size because of floating number calculations.
Cairo::drawSurface created a subsurface which is running over the
parent surface boundaries.

  • platform/graphics/cairo/CairoOperations.cpp:

(WebCore::Cairo::drawSurface): Calculated a intersection with
expandedSrcRect and the parent surface size for subsurface size.

1:46 AM Changeset in webkit [250213] by Carlos Garcia Campos
  • 2 edits in releases/WebKitGTK/webkit-2.26/Source/WebCore

Merge r249761 - [GStreamer] Do not adopt floating references.
https://bugs.webkit.org/show_bug.cgi?id=201685

Reviewed by Carlos Garcia Campos.

Covered by existing tests.

  • platform/graphics/gstreamer/GStreamerCommon.cpp:

(WebCore::initializeGStreamer): gst_element_factory_make returns
floating references, you do not adopt such references, rather you
sink them.

1:46 AM Changeset in webkit [250212] by Carlos Garcia Campos
  • 2 edits in releases/WebKitGTK/webkit-2.26/Source/WebCore

Merge r249477 - [GStreamer] Sound is down-pitched when playing video from YLE Areena
https://bugs.webkit.org/show_bug.cgi?id=201399

Reviewed by Xabier Rodriguez-Calvar.

If the FDK-AAC decoder is available, promote it and downrank the
libav AAC decoders, due to their broken LC support, as reported in:
https://ffmpeg.org/pipermail/ffmpeg-devel/2019-July/247063.html

  • platform/graphics/gstreamer/GStreamerCommon.cpp:

(WebCore::initializeGStreamer):

1:46 AM Changeset in webkit [250211] by Carlos Garcia Campos
  • 2 edits in releases/WebKitGTK/webkit-2.26/Source/WebKit

Merge r249882 - [GTK][WPE] Check for a Snap sandbox a bit harder
https://bugs.webkit.org/show_bug.cgi?id=201793

Reviewed by Michael Catanzaro.

  • UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:

(WebKit::isInsideSnap): Check whether the SNAP_NAME and SNAP_REVISION
environment variables are defined as well.

1:39 AM Changeset in webkit [250210] by Carlos Garcia Campos
  • 8 edits in releases/WebKitGTK/webkit-2.26/Source/WebCore

Revert r249160 - "InlineTextBox::end() should return first-past-end offset"

1:39 AM Changeset in webkit [250209] by Carlos Garcia Campos
  • 3 edits in releases/WebKitGTK/webkit-2.26/Source/WebKit

Merge r249953 - [GTK] Initial view loading is slow
https://bugs.webkit.org/show_bug.cgi?id=201451

Reviewed by Sergio Villar Senin.

The problem is that now we are always calling DrawingAreaProxy::waitForBackingStoreUpdateOnNextPaint() after a
new process is launched and we used to do that only when launching a new process after a crash. This makes
m_hasReceivedFirstUpdate useless, because it's always set to true right after a process is launched. Then, we
wait up to half a second (which is usually the case for the initial load) until the first update. We only want
to do that when recovering from a crash or when swapping processes to avoid flashing effect.

  • UIProcess/WebPageProxy.cpp:

(WebKit::WebPageProxy::launchProcess): Add ProcessLaunchReason parameter and pass it to
finishAttachingToWebProcess instead of IsProcessSwap.
(WebKit::WebPageProxy::swapToWebProcess): Pass ProcessLaunchReason::ProcessSwap to
finishAttachingToWebProcess().
(WebKit::WebPageProxy::finishAttachingToWebProcess): Do not call
DrawingAreaProxy::waitForBackingStoreUpdateOnNextPaint() when process launch reason is ProcessLaunchReason::InitialProcess.
(WebKit::WebPageProxy::launchProcessForReload): Pass ProcessLaunchReason::Reload to launchProcess().

  • UIProcess/WebPageProxy.h: Remove IsProcessSwap and add ProcessLaunchReason instead that is passed to

launchProcess and finishAttachingToWebProcess.

1:39 AM Changeset in webkit [250208] by Carlos Garcia Campos
  • 30 edits
    1 copy
    2 adds
    8 deletes in releases/WebKitGTK/webkit-2.26

Revert "Merge r249332, r249325, r249205"

Revert "Merge r249332 - [MSE][GStreamer] Replaying the video should update currentTime"
Revert "Merge r249325 - [MSE][GStreamer] Gracefully fail on invalid non-first initialization segment"
Revert "Merge r249205 - [MSE][GStreamer] WebKitMediaSrc rework"

1:21 AM WebKitGTK/2.26.x edited by Carlos Garcia Campos
(diff)
1:21 AM Changeset in webkit [250207] by Carlos Garcia Campos
  • 2 edits in releases/WebKitGTK/webkit-2.26

Merge r249883 - [GTK][WPE] Do not run the Bubblewrap executable when configuring for cross-compilation
https://bugs.webkit.org/show_bug.cgi?id=201340

Reviewed by Konstantin Tokarev.

  • Source/cmake/BubblewrapSandboxChecks.cmake: Do not run the

Bubblewrap executable when cross-compiling to guess its version.
Emit a warning instead and trust that valid run-time paths will
be set using the BWRAP_EXECUTABLE and DBUS_PROXY_EXECUTABLE
variables. While at it, fix the regular expression used to match
the version string in the Bubblewrap output when not cross-compiling.

1:21 AM Changeset in webkit [250206] by Carlos Garcia Campos
  • 2 edits in releases/WebKitGTK/webkit-2.26/Source/WebKit

Merge r250036 - [GTK][WPE] bubblewrap sandbox should be disabled when running inside docker
https://bugs.webkit.org/show_bug.cgi?id=201914

Reviewed by Michael Catanzaro.

Detect if running inside Docker by checking the file /.dockerenv
In that case, disable the sandbox.

  • UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:

(WebKit::isInsideDocker):
(WebKit::ProcessLauncher::launchProcess):

1:21 AM Changeset in webkit [250205] by Carlos Garcia Campos
  • 2 edits in releases/WebKitGTK/webkit-2.26/Source/WebCore

Merge r249951 - [GTK] Cannot create EGL window surface: EGL_BAD_ALLOC
https://bugs.webkit.org/show_bug.cgi?id=201505

Reviewed by Žan Doberšek.

This happens because eglCreateWindowSurface() is called twice for the same window when not using the WPE
renderer. New versions of Mesa fail the second time with a EGL_BAD_ALLOC.

  • platform/graphics/egl/GLContextEGL.cpp:

(WebCore::GLContextEGL::createWindowContext): Check surface is nullptr before falling back to use
eglCreateWindowSurface().

1:21 AM Changeset in webkit [250204] by Carlos Garcia Campos
  • 8 edits in releases/WebKitGTK/webkit-2.26/Source/WebKit

Merge r249947 - [GTK] Crash closing web view while hardware acceleration is enabled
https://bugs.webkit.org/show_bug.cgi?id=200856

Reviewed by Michael Catanzaro.

The crash happens when destroying the WaylandCompositor::Surface because the web view GL context is used to
release the texture, but the GL context is no longer valid after web view
unrealize. AcceleratedBackingStoreWayland should handle the web view unrealize to destroy the GL context. It
will be created on demand again after the web view is realized.

  • UIProcess/API/gtk/WebKitWebViewBase.cpp:

(webkitWebViewBaseRealize): Notify AcceleratedBackingStore.
(webkitWebViewBaseUnrealize): Ditto.

  • UIProcess/gtk/AcceleratedBackingStore.h:

(WebKit::AcceleratedBackingStore::realize): Added.
(WebKit::AcceleratedBackingStore::unrealize): Added.

  • UIProcess/gtk/AcceleratedBackingStoreWayland.cpp:

(WebKit::AcceleratedBackingStoreWayland::realize): In case of using WaylandCompositor, call
WaylandCompositor::bindWebPage() to bind the WebPageProxy to the Wayland surface.
(WebKit::AcceleratedBackingStoreWayland::unrealize): Destroy GL resources and the GL context.
(WebKit::AcceleratedBackingStoreWayland::tryEnsureGLContext): Do not try to create the GL context if the web
view is not realized.
(WebKit::AcceleratedBackingStoreWayland::displayBuffer): Remove the code to initialize the texture.
(WebKit::AcceleratedBackingStoreWayland::paint): And add it here.

  • UIProcess/gtk/AcceleratedBackingStoreWayland.h:
  • UIProcess/gtk/WaylandCompositor.cpp:

(WebKit::WaylandCompositor::Surface::setWebPage): Return early if given page is the current one already.
(WebKit::WaylandCompositor::bindWebPage): Set the surface WebPageProxy.
(WebKit::WaylandCompositor::unbindWebPage): Unset the surface WebPageProxy.

  • UIProcess/gtk/WaylandCompositor.h:
  • WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp:

(WebKit::DrawingAreaCoordinatedGraphics::enterAcceleratedCompositingMode): When restoring a previous layer tree
host, always call resumeRendering() to balance the suspendRendering() called in exitAcceleratedCompositingMode().

1:20 AM Changeset in webkit [250203] by Carlos Garcia Campos
  • 6 edits in releases/WebKitGTK/webkit-2.26

Merge r249890 - REGRESSION(r249142): [GTK] Epiphany delayed page loads continue indefinitely
https://bugs.webkit.org/show_bug.cgi?id=201544

Reviewed by Michael Catanzaro.

Source/WebKit:

WebPageProxy::loadAlternateHTML() is an exception, because it's an API request but always sets the navigationID
to 0. We always want to reset the pending API request URL when alternate HTML load starts.

  • UIProcess/WebPageProxy.cpp:

(WebKit::WebPageProxy::didStartProvisionalLoadForFrameShared): Check also that it's an API alternate HTML load
to reset the pending API request URL.

Tools:

Add new test cases.

  • TestWebKitAPI/Tests/WebKitGLib/TestLoaderClient.cpp:

(testWebViewActiveURI):
(testWebViewIsLoading):

  • TestWebKitAPI/glib/WebKitGLib/LoadTrackingTest.cpp:

(loadChangedCallback):
(LoadTrackingTest::loadAlternateHTML):
(LoadTrackingTest::reset):

  • TestWebKitAPI/glib/WebKitGLib/LoadTrackingTest.h:
1:20 AM Changeset in webkit [250202] by Carlos Garcia Campos
  • 9 edits in releases/WebKitGTK/webkit-2.26

Merge r249810 - [GTK][WPE] webkit_settings_set_user_agent() allows content forbidden in HTTP headers
https://bugs.webkit.org/show_bug.cgi?id=201077

Reviewed by Carlos Garcia Campos.

Source/WebCore:

Add a function to validate whether a string contains a valid value
which can be used in a HTTP User-Agent header.

Covered by new WebCore API test HTTPParsers.ValidateUserAgentValues.

  • platform/glib/UserAgentGLib.cpp:

(WebCore::standardUserAgent): Assert that the returned string is a valid User-Agent.
(WebCore::standardUserAgentForURL): Ditto.

  • platform/network/HTTPParsers.cpp: Added a series of helper functions which skip over

characters of a string, which can be used to scan over the different elements of an
User-Agent value; all of them receive the position from the input string where to start
scanning, updating it to the position right after the scanned item (this follow the
convention already in use by other functions in the source file). Each of them has
been annotated with the RFC number and section which contains the definition of the
scanned item, and the corresponding BNF rules to make the code easier to follow.
(WebCore::skipWhile): Added.
(WebCore::isVisibleCharacter): Added.
(WebCore::isOctectInFieldContentCharacter): Added.
(WebCore::isCommentTextCharacter): Added.
(WebCore::isHTTPTokenCharacter): Added.
(WebCore::isValidHTTPToken): Refactored to use the new isHTTPTokenCharacter()
helper function instead of having the test inside the loop.
(WebCore::skipCharacter): Added.
(WebCore::skipQuotedPair): Added.
(WebCore::skipComment): Added.
(WebCore::skipHTTPToken): Added.
(WebCore::skipUserAgentProduct): Added.
(WebCore::isValidUserAgentHeaderValue): Added.

  • platform/network/HTTPParsers.h: Add prototype for isValidUserAgentHeaderValue().

Source/WebKit:

  • UIProcess/API/glib/WebKitSettings.cpp:

(webkit_settings_set_user_agent): Check the passed string using the new
WebCore::isValidUserAgentHeaderValue() function, and return early without
changing the setting if the string is not usable in the User-Agent HTTP
header.

Tools:

  • TestWebKitAPI/CMakeLists.txt: Add missing HTTPParsers.cpp to be built into TestWebCore.
  • TestWebKitAPI/Tests/WebCore/HTTPParsers.cpp:

(TestWebKitAPI::TEST): Add tests for WebCore::isValidUserAgentHeaderValue().

Note: See TracTimeline for information about the timeline view.