WebKit-https.git
4 months agoThere should be a single CacheStorageConnection per WebProcess
cdumez@apple.com [Tue, 17 Sep 2019 19:22:39 +0000 (19:22 +0000)]
There should be a single CacheStorageConnection per WebProcess
https://bugs.webkit.org/show_bug.cgi?id=201874

Reviewed by Geoffrey Garen.

There should be a single CacheStorageConnection per WebProcess now that we have a single session
per WebProcess. This invariant allows us to simplify the code.

* NetworkProcess/cache/CacheStorageEngineConnection.cpp:
(WebKit::CacheStorageEngineConnection::~CacheStorageEngineConnection):
(WebKit::CacheStorageEngineConnection::open):
(WebKit::CacheStorageEngineConnection::remove):
(WebKit::CacheStorageEngineConnection::caches):
(WebKit::CacheStorageEngineConnection::retrieveRecords):
(WebKit::CacheStorageEngineConnection::deleteMatchingRecords):
(WebKit::CacheStorageEngineConnection::putRecords):
(WebKit::CacheStorageEngineConnection::reference):
(WebKit::CacheStorageEngineConnection::dereference):
(WebKit::CacheStorageEngineConnection::clearMemoryRepresentation):
(WebKit::CacheStorageEngineConnection::engineRepresentation):
(WebKit::CacheStorageEngineConnection::sessionID const):
* NetworkProcess/cache/CacheStorageEngineConnection.h:
* NetworkProcess/cache/CacheStorageEngineConnection.messages.in:
* WebProcess/Cache/WebCacheStorageConnection.cpp:
(WebKit::WebCacheStorageConnection::WebCacheStorageConnection):
(WebKit::WebCacheStorageConnection::open):
(WebKit::WebCacheStorageConnection::remove):
(WebKit::WebCacheStorageConnection::retrieveCaches):
(WebKit::WebCacheStorageConnection::retrieveRecords):
(WebKit::WebCacheStorageConnection::batchDeleteOperation):
(WebKit::WebCacheStorageConnection::batchPutOperation):
(WebKit::WebCacheStorageConnection::reference):
(WebKit::WebCacheStorageConnection::dereference):
(WebKit::WebCacheStorageConnection::clearMemoryRepresentation):
(WebKit::WebCacheStorageConnection::engineRepresentation):
(WebKit::WebCacheStorageConnection::updateQuotaBasedOnSpaceUsage):
(WebKit::WebCacheStorageConnection::sessionID const):
* WebProcess/Cache/WebCacheStorageConnection.h:
* WebProcess/Cache/WebCacheStorageProvider.cpp:
(WebKit::WebCacheStorageProvider::createCacheStorageConnection):
* WebProcess/Cache/WebCacheStorageProvider.h:

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

4 months agoREGRESSION (macOS): Many webgpu/whlsl* tests are flaky failures.
russell_e@apple.com [Tue, 17 Sep 2019 19:01:54 +0000 (19:01 +0000)]
REGRESSION (macOS): Many webgpu/whlsl* tests are flaky failures.
https://bugs.webkit.org/show_bug.cgi?id=201877.

Unreviewed Test Gardening.

Incorrectly marked tests as Failures. Changed to ImageOnlyFailures as
intended.
* platform/mac/TestExpectations:

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

4 months agoREGRESSION (macOS): Many webgpu/whlsl* tests are flaky failures.
russell_e@apple.com [Tue, 17 Sep 2019 18:55:23 +0000 (18:55 +0000)]
REGRESSION (macOS): Many webgpu/whlsl* tests are flaky failures.
https://bugs.webkit.org/show_bug.cgi?id=201877

Unreviewed Test Gardening.

* platform/mac/TestExpectations:

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

4 months agoUnreviewed attempt to fix internal build after r249962.
cdumez@apple.com [Tue, 17 Sep 2019 18:42:11 +0000 (18:42 +0000)]
Unreviewed attempt to fix internal build after r249962.

* UIProcess/API/C/WKPreferencesRef.h:

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

4 months agoWeb Inspector: HTML Formatter - better handling for HTML specific tag cases (<p>...
joepeck@webkit.org [Tue, 17 Sep 2019 18:37:07 +0000 (18:37 +0000)]
Web Inspector: HTML Formatter - better handling for HTML specific tag cases (<p>/<li>)
https://bugs.webkit.org/show_bug.cgi?id=201757
<rdar://problem/55409987>

Reviewed by Devin Rousso.

Source/WebInspectorUI:

* UserInterface/Workers/Formatter/HTMLFormatter.js:
(HTMLFormatter.prototype._after):
Handle a closing tag with different text than the opening tag.

* UserInterface/Workers/Formatter/HTMLTreeBuilderFormatter.js:
(HTMLTreeBuilderFormatter.prototype._pushParserNodeTopLevel):
(HTMLTreeBuilderFormatter.prototype._pushParserNodeStack):
(HTMLTreeBuilderFormatter.prototype._implicitlyCloseHTMLNodesForOpenTag):
(HTMLTreeBuilderFormatter.prototype._implicitlyCloseTagNamesInsideParentTagNames):
(HTMLTreeBuilderFormatter.prototype._indexOfStackNodeMatchingTagNames):
Generalize the implicit closing a bit. Allow open tags to implicitly
close certain other open tags in the stack.

LayoutTests:

* inspector/formatting/formatting-html-expected.txt:
* inspector/formatting/formatting-html.html:
* inspector/formatting/resources/html-tests/auto-close-normal-expected.html: Renamed from LayoutTests/inspector/formatting/resources/html-tests/auto-close-expected.html.
* inspector/formatting/resources/html-tests/auto-close-normal.html: Renamed from LayoutTests/inspector/formatting/resources/html-tests/auto-close.html.
* inspector/formatting/resources/html-tests/auto-close-special-expected.html: Added.
* inspector/formatting/resources/html-tests/auto-close-special.html: Added.
* inspector/formatting/resources/html-tests/list-expected.html:
* inspector/formatting/resources/html-tests/list.html:
* inspector/formatting/resources/html-tests/not-well-formed-1-expected.html:
* inspector/formatting/resources/html-tests/not-well-formed-1.html:
* inspector/formatting/resources/html-tests/p-expected.html: Added.
* inspector/formatting/resources/html-tests/p.html: Added.
* inspector/formatting/resources/html-tests/table-expected.html: Added.
* inspector/formatting/resources/html-tests/table.html: Added.
* inspector/formatting/resources/html-tests/tag-case-expected.html: Added.
* inspector/formatting/resources/html-tests/tag-case.html: Added.
Tests for HTML specialties.

* inspector/formatting/formatting-xml-expected.txt:
* inspector/formatting/formatting-xml.html:
* inspector/formatting/resources/xml-tests/tag-case-expected.xml: Added.
* inspector/formatting/resources/xml-tests/tag-case.xml: Added.
* inspector/formatting/resources/xml-tests/valid-html-invalid-xml-expected.xml:
* inspector/formatting/resources/xml-tests/valid-html-invalid-xml.xml:
XML is case-sensitive. Ensure XML doesn't get more of the HTML specialties.

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

4 months agoRolled out r249964 because it broke the build.
aestes@apple.com [Tue, 17 Sep 2019 18:11:10 +0000 (18:11 +0000)]
Rolled out r249964 because it broke the build.

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

4 months agorun-webkit-tests: Driver.do_post_tests_work() is never called when `stop_when_done...
ddkilzer@apple.com [Tue, 17 Sep 2019 17:50:26 +0000 (17:50 +0000)]
run-webkit-tests: Driver.do_post_tests_work() is never called when `stop_when_done` is true in Driver.run_test()
<https://webkit.org/b/201873>

Reviewed by Jonathan Bedard.

* Scripts/webkitpy/port/driver.py:
(Driver.run_test): Call self.do_post_tests_work() when a test
shard has completed, but didn't crash or time out.

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

4 months ago[Cocoa] Add a WKA extension point
aestes@apple.com [Tue, 17 Sep 2019 17:46:04 +0000 (17:46 +0000)]
[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@249964 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoTextIterator should convert tabs to spaces
antti@apple.com [Tue, 17 Sep 2019 17:31:20 +0000 (17:31 +0000)]
TextIterator should convert tabs to spaces
https://bugs.webkit.org/show_bug.cgi?id=201863

Reviewed by Zalan Bujtas.

LayoutTests/imported/w3c:

* web-platform-tests/html/dom/elements/the-innertext-idl-attribute/getter-expected.txt:
* web-platform-tests/innerText/getter-expected.txt:

Source/WebCore:

As seen in tests

imported/w3c/web-platform-tests/innerText/getter.html
imported/w3c/web-platform-tests/html/dom/elements/the-innertext-idl-attribute/getter.html

The old simple line layout path in TextIterator used to do this.

* editing/TextIterator.cpp:
(WebCore::TextIterator::handleTextBox):

LayoutTests:

* editing/pasteboard/5761530-1.html:

Set body to 'whitespace:pre' so tabs don't get lost in test output.

* fast/tokenizer/script_extra_close-expected.txt:
* imported/blink/fast/text/font-linux-normalize-expected.txt:
* platform/mac/editing/pasteboard/5761530-1-expected.txt: Removed.

No need for platform specific result.

* editing/pasteboard/5761530-1-expected.txt:

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

4 months agoREGRESSION (r249923): ASSERTION FAILED: sessionID == WebProcess::singleton().sessionI...
cdumez@apple.com [Tue, 17 Sep 2019 17:12:04 +0000 (17:12 +0000)]
REGRESSION (r249923): ASSERTION FAILED: sessionID == WebProcess::singleton().sessionID() in WebCore::SWClientConnection *WebKit::WebServiceWorkerProvider::existingServiceWorkerConnectionForSession(PAL::SessionID)
https://bugs.webkit.org/show_bug.cgi?id=201859
<rdar://problem/55426742>

Reviewed by Alex Christensen.

Source/WebKit:

Drop support for the WKPreferencesSetPrivateBrowsingEnabled() C API (Mark as deprecated and make it a no-op) as it
was changing a WebContent process's sessionID, which is no longer supported. This was also using the legacy private
browsing session, which we're trying to get rid of. There is suitable C API to do private browsing (WKWebsiteDataStoreRef).

* Shared/WebPreferences.yaml:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetPrivateBrowsingEnabled):
(WKPreferencesGetPrivateBrowsingEnabled):
* UIProcess/API/C/WKPreferencesRef.h:
* UIProcess/API/C/mac/WKPagePrivateMac.mm:
(WKPageIsURLKnownHSTSHost):
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::isURLKnownHSTSHost const):
* UIProcess/WebPreferences.cpp:
(WebKit::WebPreferences::addPage):
(WebKit::WebPreferences::removePage):
(WebKit::WebPreferences::updateBoolValueForKey):
* UIProcess/WebPreferences.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::ensureNetworkProcess):
* UIProcess/WebProcessPool.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):

Tools:

Update API test to use WKWebsiteDataStoreRef C API to do private browsing instead of using
the legacy WKPreferencesSetPrivateBrowsingEnabled() C API.

* TestWebKitAPI/Tests/WebKit/PrivateBrowsingPushStateNoHistoryCallback.cpp:
(TestWebKitAPI::TEST):

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

4 months agoREGRESSION (iOS 13): rAF stops firing when navigating away cross-origin and then...
cdumez@apple.com [Tue, 17 Sep 2019 17:09:49 +0000 (17:09 +0000)]
REGRESSION (iOS 13): rAF stops firing when navigating away cross-origin and then back
https://bugs.webkit.org/show_bug.cgi?id=201767
<rdar://problem/55350854>

Reviewed by Geoffrey Garen.

Source/WebKit:

When navigating back and restoring a SuspendedPage, WebPage::reinitializeWebPage() ends up
reconstructing a new DrawingArea to match the identifier of the DrawingAreaProxy that the
UIProcess created. The issue is that when reconstructing the DrawingArea, we were losing
the DisplayRefreshMonitors that had been registered on the previous drawing area. To
address the issue, we now make sure to transfer the DisplayRefreshMonitors over from the
old to the new drawing area. This patch is kept as small as possible to faciliate cherry
picking to a branch. However, I think we should consider refactoring the code so that
we no longer need to re-create the DrawingArea in the WebProcess in this case.

* WebProcess/WebPage/DrawingArea.h:
(WebKit::DrawingArea::adoptDisplayRefreshMonitorsFromDrawingArea):
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::adoptDisplayRefreshMonitorsFromDrawingArea):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::reinitializeWebPage):

LayoutTests:

Add layout test coverage.

* http/tests/navigation/page-cache-requestAnimationFrame-expected.txt: Added.
* http/tests/navigation/page-cache-requestAnimationFrame.html: Added.

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

4 months agoBring up queues for iOS 13
ryanhaddad@apple.com [Tue, 17 Sep 2019 16:49:49 +0000 (16:49 +0000)]
Bring up queues for iOS 13
https://bugs.webkit.org/show_bug.cgi?id=201710

Reviewed by Jonathan Bedard.

* BuildSlaveSupport/build.webkit.org-config/config.json: Move iOS 12 queues to iOS 13.
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/Dashboard.js: Ditto.
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/WebKitBuildbot.js:
(WebKitBuildbot):
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Styles/Main.css:
(table.queue-grid tr.platform.ios-simulator-12 img.logo): Deleted.
(table.queue-grid tr.platform.ios-12 img.logo): Deleted.
* BuildSlaveSupport/build.webkit.org-config/steps_unittest.py: Update unit tests.
* BuildSlaveSupport/build.webkit.org-config/wkbuild.py:
(_should_file_trigger_build):
* BuildSlaveSupport/build.webkit.org-config/wkbuild_unittest.py:
(ShouldBuildTest):
(ShouldBuildTest.test_should_build):
* BuildSlaveSupport/ews-build/config.json: Move iOS 12 queues to iOS 13.

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

4 months agoCheckArray on DirectArguments/ScopedArguments does not filter out slow put array...
sbarati@apple.com [Tue, 17 Sep 2019 16:32:11 +0000 (16:32 +0000)]
CheckArray on DirectArguments/ScopedArguments does not filter out slow put array storage
https://bugs.webkit.org/show_bug.cgi?id=201853
<rdar://problem/53805461>

Reviewed by Yusuke Suzuki.

JSTests:

* stress/direct-arguments-check-array-filter-type.js: Added.
(foo):

Source/JavaScriptCore:

We were claiming CheckArray for ScopedArguments/DirectArguments was filtering
out SlowPutArrayStorage. It does no such thing. We just check that the object
is either ScopedArguments/DirectArguments.

* dfg/DFGArrayMode.h:
(JSC::DFG::ArrayMode::arrayModesThatPassFiltering const):
(JSC::DFG::ArrayMode::arrayModesWithIndexingShapes const):
(JSC::DFG::ArrayMode::arrayModesWithIndexingShape const): Deleted.

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

4 months agoFollow-up: Provide a prototype for AR QuickLook to trigger processing in the originat...
jbedard@apple.com [Tue, 17 Sep 2019 16:25:35 +0000 (16:25 +0000)]
Follow-up: Provide a prototype for AR QuickLook to trigger processing in the originating page
https://bugs.webkit.org/show_bug.cgi?id=201371

Unreviewed follow-up fix.

* pal/spi/ios/SystemPreviewSPI.h:

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

4 months agoUnreviewed, address flakiness of imported/w3c/web-platform-tests/IndexedDB/fire-error...
cdumez@apple.com [Tue, 17 Sep 2019 16:05:37 +0000 (16:05 +0000)]
Unreviewed, address flakiness of imported/w3c/web-platform-tests/IndexedDB/fire-error-event-exception.html

Do not log console messages.

LayoutTests/imported/w3c:

* web-platform-tests/IndexedDB/fire-error-event-exception-expected.txt:

LayoutTests:

* TestExpectations:

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

4 months agoUnreviewed, rolling out r249950.
tsavell@apple.com [Tue, 17 Sep 2019 16:03:09 +0000 (16:03 +0000)]
Unreviewed, rolling out r249950.

Broke the iOS build.

Reverted changeset:

"Remove the "Show Link Previews" and "Hide Link Previews"
action menus in the preview platter"
https://bugs.webkit.org/show_bug.cgi?id=201864
https://trac.webkit.org/changeset/249950

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

4 months ago[LFC[MarginCollapsing] MarginCollapse::estimatedMarginBefore should take pre-computed...
zalan@apple.com [Tue, 17 Sep 2019 15:57:15 +0000 (15:57 +0000)]
[LFC[MarginCollapsing] MarginCollapse::estimatedMarginBefore should take pre-computed non-collapsed margin values.
https://bugs.webkit.org/show_bug.cgi?id=201848
<rdar://problem/55419419>

Reviewed by Antti Koivisto.

This is in preparation for using constraint values instead of querying the display tree for containing block geometry information.
See webkit.org/b/201795

* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPosition):
* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginBefore):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginAfter):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::estimatedMarginBefore):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeIgnoringCollapsingThrough):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedVerticalValues):

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

4 months ago[First-letter] Use WeakPtr for the first-letter insertion point.
zalan@apple.com [Tue, 17 Sep 2019 15:01:23 +0000 (15:01 +0000)]
[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.

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

4 months ago[GTK] Initial view loading is slow
carlosgc@webkit.org [Tue, 17 Sep 2019 11:05:00 +0000 (11:05 +0000)]
[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.

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

4 months agoREGRESSION(r249275): [GTK][WPE] WebPage injected bundle messages no longer work
carlosgc@webkit.org [Tue, 17 Sep 2019 11:04:12 +0000 (11:04 +0000)]
REGRESSION(r249275): [GTK][WPE] WebPage injected bundle messages no longer work
https://bugs.webkit.org/show_bug.cgi?id=201865

Reviewed by Žan Doberšek.

We use them to implement the web resources API. This is another regression of r249275 because we are using the
page proxy identifier when we really want to the web page identifier.

* UIProcess/API/glib/WebKitWebContext.cpp:
(webkitWebContextGetWebViewForPage): Use WebPageProxy::webPageID() instead of WebPageProxy::identifier().

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

4 months ago[GTK] Cannot create EGL window surface: EGL_BAD_ALLOC
carlosgc@webkit.org [Tue, 17 Sep 2019 10:12:26 +0000 (10:12 +0000)]
[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().

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

4 months agoRemove the "Show Link Previews" and "Hide Link Previews" action menus in the preview...
dino@apple.com [Tue, 17 Sep 2019 09:03:40 +0000 (09:03 +0000)]
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@249950 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months ago[WebAuthn] Use WebPreferences instead of RuntimeEnabledFeatures in UIProcess
jiewen_tan@apple.com [Tue, 17 Sep 2019 08:17:17 +0000 (08:17 +0000)]
[WebAuthn] Use WebPreferences instead of RuntimeEnabledFeatures in UIProcess
https://bugs.webkit.org/show_bug.cgi?id=198176
<rdar://problem/55285709>

Reviewed by Youenn Fablet.

Source/WebCore:

No changes of behavior.

* Modules/webauthn/PublicKeyCredential.cpp:
(WebCore::PublicKeyCredential::isUserVerifyingPlatformAuthenticatorAvailable):
Resolves the promise with false immediately when the feature flag is false.

Source/WebKit:

This patch does the following two things:
1) It merges WebAuthenticationRequestData::creationOptions and requestOptions into a variant, and therefore
merges code paths that involve WebAuthenticationRequestData.
2) It teaches WebAuthenticationRequestData to store a WebPreferences such that AuthenticatorManager could utilize
runtime feature flags to turn features on or off.

* UIProcess/WebAuthentication/Authenticator.cpp:
(WebKit::Authenticator::handleRequest):
* UIProcess/WebAuthentication/AuthenticatorManager.cpp:
(WebKit::AuthenticatorManager::handleRequest):
(WebKit::AuthenticatorManager::clearState):
(WebKit::AuthenticatorManager::authenticatorAdded):
(WebKit::AuthenticatorManager::startDiscovery):
(WebKit::AuthenticatorManager::makeCredential): Deleted.
(WebKit::AuthenticatorManager::getAssertion): Deleted.
* UIProcess/WebAuthentication/AuthenticatorManager.h:
* UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
(WebKit::LocalAuthenticator::makeCredential):
(WebKit::LocalAuthenticator::continueMakeCredentialAfterUserConsented):
(WebKit::LocalAuthenticator::continueMakeCredentialAfterAttested):
(WebKit::LocalAuthenticator::getAssertion):
(WebKit::LocalAuthenticator::continueGetAssertionAfterUserConsented):
* UIProcess/WebAuthentication/Cocoa/LocalService.mm:
(WebKit::LocalService::isAvailable):
Don't check RuntimeEnabledFeatures given it is for WebCore.
* UIProcess/WebAuthentication/WebAuthenticationRequestData.h:
(): Deleted.
* UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.cpp:
(WebKit::WebAuthenticatorCoordinatorProxy::makeCredential):
(WebKit::WebAuthenticatorCoordinatorProxy::getAssertion):
(WebKit::WebAuthenticatorCoordinatorProxy::handleRequest):
* UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.h:
* UIProcess/WebAuthentication/fido/CtapAuthenticator.cpp:
(WebKit::CtapAuthenticator::makeCredential):
(WebKit::CtapAuthenticator::continueMakeCredentialAfterResponseReceived const):
(WebKit::CtapAuthenticator::getAssertion):
* UIProcess/WebAuthentication/fido/U2fAuthenticator.cpp:
(WebKit::U2fAuthenticator::makeCredential):
(WebKit::U2fAuthenticator::checkExcludeList):
(WebKit::U2fAuthenticator::issueRegisterCommand):
(WebKit::U2fAuthenticator::getAssertion):
(WebKit::U2fAuthenticator::issueSignCommand):
(WebKit::U2fAuthenticator::continueRegisterCommandAfterResponseReceived):
(WebKit::U2fAuthenticator::continueSignCommandAfterResponseReceived):

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

4 months agoKeeps running obsolete WebProcess-es for too long
carlosgc@webkit.org [Tue, 17 Sep 2019 08:14:29 +0000 (08:14 +0000)]
Keeps running obsolete WebProcess-es for too long
https://bugs.webkit.org/show_bug.cgi?id=201492

Reviewed by Chris Dumez.

That's how the web process cache is expected to work, but it's true that it probably only makes sense to use it
when cache model is primary web browser.

* UIProcess/WebProcessCache.cpp:
(WebKit::WebProcessCache::updateCapacity): Disable the web process cache when cache model is not primary web browser.

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

4 months ago[GTK] Crash closing web view while hardware acceleration is enabled
carlosgc@webkit.org [Tue, 17 Sep 2019 08:05:30 +0000 (08:05 +0000)]
[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().

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

4 months agoAccess-Control-Expose-Headers parsed incorrectly
commit-queue@webkit.org [Tue, 17 Sep 2019 07:56:08 +0000 (07:56 +0000)]
Access-Control-Expose-Headers parsed incorrectly
https://bugs.webkit.org/show_bug.cgi?id=172357

Patch by Rob Buis <rbuis@igalia.com> on 2019-09-17
Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

Import cors/access-control-expose-headers-parsing.window.js and adjust it
so it fetches a remote url, since subdomains do not work for localhost.

* web-platform-tests/cors/access-control-expose-headers-parsing.window-expected.txt: Added.
* web-platform-tests/cors/access-control-expose-headers-parsing.window.html: Added.
* web-platform-tests/cors/access-control-expose-headers-parsing.window.js:
(runTests):
(exposeTest): Deleted.
* web-platform-tests/cors/allow-headers-expected.txt: Removed.
* web-platform-tests/cors/allow-headers.htm: Removed.
* web-platform-tests/cors/resources/access-control-expose-headers-parsing-2.asis: Removed.
* web-platform-tests/cors/resources/access-control-expose-headers-parsing.asis: Removed.
* web-platform-tests/cors/resources/access-control-expose-headers.json: Added.
* web-platform-tests/cors/resources/expose-headers.py: Added.
(main):

Source/WebCore:

When parsing the list, strip HTTP spaces and verify
that the list items are valid HTTP tokens.

Behavior matches Firefox and Chrome.

Test: imported/w3c/web-platform-tests/cors/access-control-expose-headers-parsing.window.html

* platform/network/HTTPParsers.h:
(WebCore::addToAccessControlAllowList):
(WebCore::parseAccessControlAllowList):

LayoutTests:

Add Mac/iOS expectations.

* platform/ios/imported/w3c/web-platform-tests/cors/access-control-expose-headers-parsing.window-expected.txt: Added.
* platform/mac/imported/w3c/web-platform-tests/cors/access-control-expose-headers-parsing.window-expected.txt: Added.

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

4 months agoContent-Type should be preserved on responses created from DOMCache
youenn@apple.com [Tue, 17 Sep 2019 07:39:52 +0000 (07:39 +0000)]
Content-Type should be preserved on responses created from DOMCache
https://bugs.webkit.org/show_bug.cgi?id=201815

Reviewed by Alex Christensen.

LayoutTests/imported/w3c:

Fixes one subtest.
Remaining failing test is failing consistently in other browsers.

* web-platform-tests/service-workers/cache-storage/serviceworker/cache-match.https-expected.txt:
* web-platform-tests/service-workers/cache-storage/window/cache-match.https-expected.txt:
* web-platform-tests/service-workers/cache-storage/worker/cache-match.https-expected.txt:

Source/WebCore:

       Covered by updated test expectations

* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::create):
Update content type when creating the response from DOMCache.

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

4 months ago[WinCairo][curl] Define NOCRYPT to suppress libressl "Warning, overriding WinCrypt...
Hironori.Fujii@sony.com [Tue, 17 Sep 2019 07:26:17 +0000 (07:26 +0000)]
[WinCairo][curl] Define NOCRYPT to suppress libressl "Warning, overriding WinCrypt defines"
https://bugs.webkit.org/show_bug.cgi?id=201858

Reviewed by Alex Christensen.

LibreSSL headers are reporing a compilation warning for overriding
WinCrypt defines. Define NOCRYPT to let windows.h not to include
WinCrypt for WinCairo port.

* Source/cmake/OptionsWinCairo.cmake: Added -DNOCRYPT.

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

4 months agoMove code for traversing reversed text boxes from TextIterator to TextBoxIterator
antti@apple.com [Tue, 17 Sep 2019 06:38:22 +0000 (06:38 +0000)]
Move code for traversing reversed text boxes from TextIterator to TextBoxIterator
https://bugs.webkit.org/show_bug.cgi?id=201819

Reviewed by Zalan Bujtas.

Handle traversal order in TextBoxIterator.

* editing/TextIterator.cpp:
(WebCore::TextIterator::handleTextNode):
(WebCore::TextIterator::handleTextBox):
(WebCore::TextIterator::handleTextNodeFirstLetter):
* editing/TextIterator.h:
* rendering/line/LineLayoutInterfaceTextBoxes.cpp:
(WebCore::LineLayoutInterface::TextBox::rect const):
(WebCore::LineLayoutInterface::TextBox::logicalRect const):
(WebCore::LineLayoutInterface::TextBox::hasHyphen const):
(WebCore::LineLayoutInterface::TextBox::isLeftToRightDirection const):
(WebCore::LineLayoutInterface::TextBox::dirOverride const):
(WebCore::LineLayoutInterface::TextBox::text const):
(WebCore::LineLayoutInterface::TextBox::localStartOffset const):
(WebCore::LineLayoutInterface::TextBox::localEndOffset const):
(WebCore::LineLayoutInterface::TextBox::length const):
(WebCore::LineLayoutInterface::TextBoxIterator::TextBoxIterator):
(WebCore::LineLayoutInterface::TextBoxIterator::traverseNextInVisualOrder):
(WebCore::LineLayoutInterface::TextBoxIterator::traverseNextInTextOrder):
(WebCore::LineLayoutInterface::TextBoxIterator::operator== const):
(WebCore::LineLayoutInterface::TextBoxIterator::atEnd const):
(WebCore::LineLayoutInterface::Provider::firstTextBoxInVisualOrderFor):
(WebCore::LineLayoutInterface::Provider::firstTextBoxInTextOrderFor):
(WebCore::LineLayoutInterface::Provider::textBoxRangeFor):
* rendering/line/LineLayoutInterfaceTextBoxes.h:
(WebCore::LineLayoutInterface::TextBoxIterator::TextBoxIterator):
(WebCore::LineLayoutInterface::TextBoxIterator::operator++):
(WebCore::LineLayoutInterface::Provider::firstTextBoxFor):

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

4 months agoUnreviewed, rolling out r249910.
ryanhaddad@apple.com [Tue, 17 Sep 2019 06:24:28 +0000 (06:24 +0000)]
Unreviewed, rolling out r249910.

Caused layout test failures and timeouts on Catalina

Reverted changeset:

"REGRESSION(249649): Unable to open local files in MiniBrowser
on macOS"
https://bugs.webkit.org/show_bug.cgi?id=201798
https://trac.webkit.org/changeset/249910

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

4 months agoRemove "gopher" from list of special schemes in URLParser
commit-queue@webkit.org [Tue, 17 Sep 2019 05:39:18 +0000 (05:39 +0000)]
Remove "gopher" from list of special schemes in URLParser
https://bugs.webkit.org/show_bug.cgi?id=201852

Patch by Alex Christensen <achristensen@webkit.org> on 2019-09-16
Reviewed by Simon Fraser.

LayoutTests/imported/w3c:

* web-platform-tests/url/a-element-expected.txt:
* web-platform-tests/url/a-element-origin-expected.txt:
* web-platform-tests/url/a-element-origin-xhtml-expected.txt:
* web-platform-tests/url/a-element-xhtml-expected.txt:
* web-platform-tests/url/url-constructor-expected.txt:
* web-platform-tests/url/url-origin-expected.txt:
* web-platform-tests/url/url-setters-expected.txt:

Source/WTF:

There is little meaningful content on gopher servers, and WebKit does not actually support gopher.
This makes WebKit match the behavior of Gecko and goes along with a change proposed at
https://github.com/whatwg/url/issues/342

* wtf/URLParser.cpp:
(WTF::URLParser::defaultPortForProtocol):
(WTF::scheme):
(WTF::URLParser::copyURLPartsUntil):
(WTF::URLParser::parse):

Tools:

* TestWebKitAPI/Tests/WTF/URLParser.cpp:
(TestWebKitAPI::TEST_F):
* TestWebKitAPI/Tests/WebCore/URLParserTextEncoding.cpp:
(TestWebKitAPI::TEST_F):
* TestWebKitAPI/Tests/WebKitCocoa/WKURLSchemeHandler-1.mm:

LayoutTests:

* fast/url/invalid-urls-utf8-expected.txt:
* fast/url/invalid-urls-utf8.html:
* fast/url/segments-expected.txt:
* fast/url/segments.html:
* fast/url/standard-url-expected.txt:
* fast/url/standard-url.html:
* fetch/fetch-urls.json:
* http/wpt/html/browsers/history/the-location-interface/location-protocol-setter-non-broken-async-delegate-expected.txt:

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

4 months ago[WinCairo][curl] Don't compile unused CertificateCFWin.cpp
Hironori.Fujii@sony.com [Tue, 17 Sep 2019 05:28:46 +0000 (05:28 +0000)]
[WinCairo][curl] Don't compile unused CertificateCFWin.cpp
https://bugs.webkit.org/show_bug.cgi?id=201860

Reviewed by Alex Christensen.

Source/WebCore:

Curl port is using ResourceHandle::setClientCertificateInfo
instead of ResourceHandle::setClientCertificate.

* PlatformWin.cmake: Added CertificateCFWin.cpp to WebCore_SOURCES only if USE_CFURLCONNECTION.
* platform/network/ResourceHandle.h: Removed an unused method setClientCertificate.
* platform/network/curl/ResourceHandleCurl.cpp:
(WebCore::ResourceHandle::setClientCertificate): Deleted.

Source/WebKitLegacy/win:

* WebMutableURLRequest.cpp: Include <WebCore/CertificateCFWin.h> only if USE(CFURLCONNECTION).
(WebMutableURLRequest::setClientCertificate): Don't use PCCERT_CONTEXT for curl port which is defined in WinCrypt.

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

4 months agoDrop sessionID / websiteDataStoreID from WebPageCreationParameters
cdumez@apple.com [Tue, 17 Sep 2019 03:48:49 +0000 (03:48 +0000)]
Drop sessionID / websiteDataStoreID from WebPageCreationParameters
https://bugs.webkit.org/show_bug.cgi?id=201847

Reviewed by Youenn Fablet.

Drop sessionID / websiteDataStoreID from WebPageCreationParameters now that we have
one session per WebProcess.

* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode const):
(WebKit::WebPageCreationParameters::decode):
* Shared/WebPageCreationParameters.h:
(WebKit::WebPageCreationParameters::WebPageCreationParameters): Deleted.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::creationParameters):
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::createWindow):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_textAutoSizingAdjustmentTimer):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::createWebPage):

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

4 months ago[AppleWin] Assertion failure in defaultSupportedImageTypes in UTIRegistry.cpp
Hironori.Fujii@sony.com [Tue, 17 Sep 2019 03:05:13 +0000 (03:05 +0000)]
[AppleWin] Assertion failure in defaultSupportedImageTypes in UTIRegistry.cpp
https://bugs.webkit.org/show_bug.cgi?id=198286

Reviewed by Brent Fulgham.

Some image types aren't supported by CG for Windows.

No new tests, covered by existing tests.

* platform/graphics/cg/ImageSourceCGWin.cpp:
(WebCore::MIMETypeForImageType): Return the correct MIME types for
com.microsoft.cur and com.microsoft.ico.
* platform/graphics/cg/UTIRegistry.cpp:
(WebCore::defaultSupportedImageTypes): Excluded public.jpeg-2000 and public.mpo-image if PLATFORM(WIN).

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

4 months ago[Cairo] Image::drawTiled → Cairo::drawSurface → cairo_paint_with_alpha → segfault...
Hironori.Fujii@sony.com [Tue, 17 Sep 2019 02:56:54 +0000 (02:56 +0000)]
[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.

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

4 months agoProvide a prototype for AR QuickLook to trigger processing in the originating page
dino@apple.com [Tue, 17 Sep 2019 02:29:31 +0000 (02:29 +0000)]
Provide a prototype for AR QuickLook to trigger processing in the originating page
https://bugs.webkit.org/show_bug.cgi?id=201371

Hopefully fix the public iOS 13 build.

Source/WebCore/PAL:

* pal/spi/ios/SystemPreviewSPI.h:

Source/WebKit:

* UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:

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

4 months agoWasm StreamingParser should validate that number of functions matches number of decla...
tzagallo@apple.com [Tue, 17 Sep 2019 01:40:49 +0000 (01:40 +0000)]
Wasm StreamingParser should validate that number of functions matches number of declarations
https://bugs.webkit.org/show_bug.cgi?id=201850
<rdar://problem/55290186>

Reviewed by Yusuke Suzuki.

JSTests:

* wasm/regress/validate-number-of-functions-match-declarations.js: Added.
(catch):

Source/JavaScriptCore:

Currently, when parsing the code section, we check that the number of functions matches the number
of declarations in the function section. However, that check is never performed if the module does
not have a code section. To fix that, we perform the check again in StreamingParser::finalize.

* wasm/WasmStreamingParser.cpp:
(JSC::Wasm::StreamingParser::finalize):

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

4 months ago[WebAuthn] Name instance variables consistently in WKMockNFTag
ddkilzer@apple.com [Tue, 17 Sep 2019 01:25:59 +0000 (01:25 +0000)]
[WebAuthn] Name instance variables consistently in WKMockNFTag
<https://webkit.org/b/201845>

Reviewed by Jiewen Tan.

* UIProcess/WebAuthentication/Mock/MockNfcService.mm:
Make all @synthesize instance variables use a leading underscore
for their name.

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

4 months agoREGRESSION: iPad: Safari becomes unresponsive after context menu on 1-800-MY-APPLE...
dino@apple.com [Tue, 17 Sep 2019 00:37:57 +0000 (00:37 +0000)]
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

4 months agoresults.webkit.org: Shard result archives
jbedard@apple.com [Tue, 17 Sep 2019 00:13:16 +0000 (00:13 +0000)]
results.webkit.org: Shard result archives
https://bugs.webkit.org/show_bug.cgi?id=201734

Reviewed by Dewei Zhu.

Cassandra advertises being able to store up to 2 GB in a single blob-storage row.
In practice, this usually doesn't work according to the Cassandra developers,
large blobs should be broken up into shards of, at most, 10 MB.

* resultsdbpy/resultsdbpy/model/archive_context.py:
(ArchiveContext):
(ArchiveContext.ArchiveMetaDataByCommit): Point to the archive shards by hash.
(ArchiveContext.ArchiveMetaDataByCommit.unpack):
(ArchiveContext.ArchiveChunks): Store archive shards, indexed by hash.
(ArchiveContext.__init__):
(ArchiveContext.register): When saving archives, save a reference hash and then
shard the actual archive data before saving.
(ArchiveContext.find_archive): Search for archive by meta-data, then reconstruct
the archive. Raise an exception if we determine that memory usage is a problem.
(ArchiveContext.ArchivesByCommit): Deleted.
(ArchiveContext.ArchivesByCommit.unpack): Deleted.
* resultsdbpy/resultsdbpy/model/archive_context_unittest.py:
(ArchiveContextTest.init_database): Allow configuration and archive to be specified.
(ArchiveContextTest):
(ArchiveContextTest.test_large_archive): Test archive sharding.

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

4 months agoUnreviewed, rebaseline test after testharness.js update in r249918.
cdumez@apple.com [Mon, 16 Sep 2019 23:59:46 +0000 (23:59 +0000)]
Unreviewed, rebaseline test after testharness.js update in r249918.

* webgpu/whlsl/test-harness-test-expected.txt:

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

4 months agoAX: USER: VO: Messages > Message > Shift-VO-M doesn't reveal correct actions
commit-queue@webkit.org [Mon, 16 Sep 2019 23:58:25 +0000 (23:58 +0000)]
AX: USER: VO: Messages > Message > Shift-VO-M doesn't reveal correct actions
https://bugs.webkit.org/show_bug.cgi?id=201840

Patch by Eric Liang <ericliang@apple.com> on 2019-09-16
Reviewed by Chris Fleizach.

menuForEvent: expects event-position in window's space, but we pass the position in Core's space. In this case, we need to convert core's space to window's space.
Tested that existing tests passed with WK1 and WK2

* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper accessibilityShowContextMenu]):

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

4 months agoUnreviewed, fix several css-dark-mode tests to run properly after testharness.js...
cdumez@apple.com [Mon, 16 Sep 2019 23:53:33 +0000 (23:53 +0000)]
Unreviewed, fix several css-dark-mode tests to run properly after testharness.js update in r249918.

* css-dark-mode/color-scheme-css-expected.txt:
* css-dark-mode/color-scheme-css.html:
* css-dark-mode/color-scheme-meta-expected.txt:
* css-dark-mode/color-scheme-meta.html:
* css-dark-mode/color-scheme-scrollbar-expected.txt:
* css-dark-mode/color-scheme-scrollbar.html:
* css-dark-mode/older-syntax/supported-color-schemes-css-expected.txt:
* css-dark-mode/older-syntax/supported-color-schemes-css.html:
* css-dark-mode/older-syntax/supported-color-schemes-meta-expected.txt:
* css-dark-mode/older-syntax/supported-color-schemes-meta.html:

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

4 months agoUnreviewed, skip imported/w3c/web-platform-tests/html/browsers/offline/application...
cdumez@apple.com [Mon, 16 Sep 2019 23:43:33 +0000 (23:43 +0000)]
Unreviewed, skip imported/w3c/web-platform-tests/html/browsers/offline/application-cache-api/api_update.https.html.

This test is a flaky timeout since it was imported in r249886.

* TestExpectations:

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

4 months ago[WebAuthn] Support more than two FIDO protocol versions
jiewen_tan@apple.com [Mon, 16 Sep 2019 23:28:10 +0000 (23:28 +0000)]
[WebAuthn] Support more than two FIDO protocol versions
https://bugs.webkit.org/show_bug.cgi?id=198408
<rdar://problem/51292176>

Reviewed by Chris Dumez.

Source/WebCore:

Covered by new API tests.

* Modules/webauthn/fido/DeviceResponseConverter.cpp:
(fido::readCTAPGetInfoResponse):
Remove the check for the array size.

Tools:

Adds a new test case that includes a FIDO_2_1_PRE version string.

* TestWebKitAPI/Tests/WebCore/CtapResponseTest.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebCore/FidoTestData.h:

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

4 months ago[JSC] Perform check again when we found non-BMP characters
msaboff@apple.com [Mon, 16 Sep 2019 23:10:47 +0000 (23:10 +0000)]
[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):

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

4 months ago[JSC] Add missing syntax errors for await in function parameter default expressions
ross.kirsling@sony.com [Mon, 16 Sep 2019 22:56:08 +0000 (22:56 +0000)]
[JSC] Add missing syntax errors for await in function parameter default expressions
https://bugs.webkit.org/show_bug.cgi?id=201615

Reviewed by Darin Adler.

JSTests:

* stress/async-await-reserved-word.js:
* stress/async-await-syntax.js:
Add test cases.

* test262/expectations.yaml:
Mark newly-passing test cases.

Source/JavaScriptCore:

This patch rectifies two oversights:
  1. We were prohibiting `async function f(x = (await) => {}) {}` but not `async function f(x = await => {}) {}`
     (and likewise for async arrow functions).
  2. We were not prohibiting `(x = await => {}) => {}` in an async context
     (regardless of parentheses, but note that this one *only* applies to arrow functions).

* parser/Parser.cpp:
(JSC::Parser<LexerType>::isArrowFunctionParameters): Fix case (1).
(JSC::Parser<LexerType>::parseFunctionInfo): Fix case (2).
(JSC::Parser<LexerType>::parseAwaitExpression): Convert unfailing check into an ASSERT.
(JSC::Parser<LexerType>::parsePrimaryExpression): Adjust error message for case (2).

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

4 months agoresults.webkit.org: Configurations should be branch specific
jbedard@apple.com [Mon, 16 Sep 2019 22:40:50 +0000 (22:40 +0000)]
results.webkit.org: Configurations should be branch specific
https://bugs.webkit.org/show_bug.cgi?id=201561

Reviewed by Dewei Zhu.

Partition configurations by branch in both Redis and Cassandra.

* resultsdbpy/resultsdbpy/controller/upload_controller.py:
(UploadController.suites): Allow the user to specify branches while listing suites.
* resultsdbpy/resultsdbpy/model/archive_context.py:
(ArchiveContext.register): Register each configuration with a branch.
* resultsdbpy/resultsdbpy/model/configuration_context.py:
(ConfigurationContext.ByPlatform): Index by branch.
(ConfigurationContext.ByPlatformAndVersion): Ditto.
(ConfigurationContext.ByArchitecture): Ditto.
(ConfigurationContext.ByModel): Ditto.
(ConfigurationContext.__init__): Populate Redis cache with branch.
(ConfigurationContext._convert_to_redis_key): Accept branch in Redis key.
(ConfigurationContext._register_in_redis): Register configuration with branch.
(ConfigurationContext.register_configuration): Ditto.
(ConfigurationContext.search_for_configuration): Search for configuration with branch.
(ConfigurationContext.search_for_recent_configuration): Ditto.
(ConfigurationContext.select_from_table_with_configurations): Ditto.
* resultsdbpy/resultsdbpy/model/configuration_context_unittest.py:
(ConfigurationContextTest.register_configurations): Register with branch.
(ConfigurationContextTest.test_repopulate_recent): Construct ConfigurationContext with
CommitContext object.
* resultsdbpy/resultsdbpy/model/upload_context.py:
(UploadContext.SuitesByConfiguration): Index by branch.
(UploadContext.upload_test_results): Register each configuration with a branch.
(UploadContext.find_suites): Pass branch to search for configurations.
* resultsdbpy/resultsdbpy/view/static/js/drawer.js: Check for new configurations when the branch is changed.
* resultsdbpy/resultsdbpy/view/templates/suite_results.html: Add branch to suites query.

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

4 months agoNetworkProcessConnection does not need HashMaps of sessionIDs for Service Workers...
cdumez@apple.com [Mon, 16 Sep 2019 21:52:05 +0000 (21:52 +0000)]
NetworkProcessConnection does not need HashMaps of sessionIDs for Service Workers and IDB
https://bugs.webkit.org/show_bug.cgi?id=201830

Reviewed by Geoffrey Garen.

NetworkProcessConnection does not need HashMaps of sessionIDs for Service Workers and IDB, since
we now have one sessionID per WebContent process.

* NetworkProcess/IndexedDB/WebIDBConnectionToClient.h:
* NetworkProcess/ServiceWorker/WebSWServerConnection.h:
* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
(WebKit::WebIDBConnectionToServer::create):
(WebKit::WebIDBConnectionToServer::WebIDBConnectionToServer):
* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
* WebProcess/Databases/WebDatabaseProvider.cpp:
(WebKit::WebDatabaseProvider::idbConnectionToServerForSession):
* WebProcess/Network/NetworkProcessConnection.cpp:
(WebKit::NetworkProcessConnection::didReceiveMessage):
(WebKit::NetworkProcessConnection::didClose):
(WebKit::NetworkProcessConnection::idbConnectionToServerForSession):
(WebKit::NetworkProcessConnection::serviceWorkerConnectionForSession):
* WebProcess/Network/NetworkProcessConnection.h:
(WebKit::NetworkProcessConnection::existingIDBConnectionToServer const):
(WebKit::NetworkProcessConnection::existingServiceWorkerConnectionForSession):
* WebProcess/Storage/WebServiceWorkerProvider.cpp:
(WebKit::WebServiceWorkerProvider::serviceWorkerConnectionForSession):
(WebKit::WebServiceWorkerProvider::existingServiceWorkerConnectionForSession):
(WebKit::WebServiceWorkerProvider::handleFetch):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::networkProcessConnectionClosed):

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

4 months ago[FTW] Correct lifespan of other SharedBitmaps
bfulgham@apple.com [Mon, 16 Sep 2019 21:39:45 +0000 (21:39 +0000)]
[FTW] Correct lifespan of other SharedBitmaps
https://bugs.webkit.org/show_bug.cgi?id=201800

Reviewed by Dean Jackson.

The pop-up menu code creates its own SharedBitmap in the WebContent process,
which needs to release its handle before destruction, otherwise the UIProcess
will be unable to access the GPU texture (since it will have been cleaned up).

Source/WebCore:

This patch also audits other uses of SharedBitmap to make sure a similar
problem doesn't exist elsewhere.

* platform/graphics/win/Direct2DUtilities.cpp:
(WebCore::Direct2D::toDXGIDevice): Switch to IDXGIDevice1 (since that is our
minimum target DX).
(WebCore::Direct2D::factoryForDXGIDevice): Ditto.
(WebCore::Direct2D::swapChainOfSizeForWindowAndDevice): Added.
* platform/graphics/win/Direct2DUtilities.h:
* platform/graphics/win/GraphicsContextDirect2D.cpp:
(WebCore::GraphicsContextPlatformPrivate::GraphicsContextPlatformPrivate): Correct
a very silly use-after-move in the implementation.
* platform/graphics/win/PlatformContextDirect2D.h:
(WebCore::PlatformContextDirect2D::d3dDevice const): Added.
(WebCore::PlatformContextDirect2D::setD3DDevice):

Source/WebKit:

Since WebPopupMenuProxyWin has its own HWND and WinProc, it needs its own
swapChain to handle syncing of content to the screen.

This patch also audits other uses of SharedBitmap to make sure a similar
problem doesn't exist elsewhere.

* Shared/ShareableBitmap.h:
* Shared/win/ShareableBitmapDirect2D.cpp:
(WebKit::ShareableBitmap::paint):
(WebKit::ShareableBitmap::createDirect2DSurface):
* UIProcess/win/WebPopupMenuProxyWin.cpp:
(WebKit::WebPopupMenuProxyWin::showPopupMenu): Add Direct2D code paths.
(WebKit::WebPopupMenuProxyWin::paint): Update for Direct2D.
(WebKit::WebPopupMenuProxyWin::setupSwapChain): Added.
(WebKit::WebPopupMenuProxyWin::configureBackingStore): Added.
* UIProcess/win/WebPopupMenuProxyWin.h:
* UIProcess/win/WebView.cpp:
(WebKit::WebView::setupSwapChain): Move some implementation code to the
Direct2DUtilities file.
* UIProcess/win/WebView.h:
(WebKit::WebView::d3dDevice const):
(WebKit::WebView::d3dImmediateContext const):
(WebKit::WebView::d3dDevice): Deleted.
* WebProcess/WebCoreSupport/WebPopupMenu.cpp:
(WebKit::WebPopupMenu::show):
* WebProcess/WebPage/FindController.cpp:
(WebKit::FindController::getImageForFindMatch): Prevent WebContent process from
destroying SharedBitmap before the UIProcess can receive it.

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

4 months agoSimplify WebResourceLoadObserver now that we have one WebProcess per session
cdumez@apple.com [Mon, 16 Sep 2019 21:21:29 +0000 (21:21 +0000)]
Simplify WebResourceLoadObserver now that we have one WebProcess per session
https://bugs.webkit.org/show_bug.cgi?id=201821

Reviewed by Brent Fulgham.

Source/WebCore:

* Modules/websockets/WebSocket.cpp:
(WebCore::WebSocket::connect):
* loader/ResourceLoadObserver.h:
(WebCore::ResourceLoadObserver::logWebSocketLoading):
(WebCore::ResourceLoadObserver::statisticsForURL):
* testing/Internals.cpp:
(WebCore::Internals::resourceLoadStatisticsForURL):

Source/WebKit:

Simplify WebResourceLoadObserver now that we have one WebProcess per session.
No need to pass sessionIDs around or store statistics per sessionID.
Also, only initialize the WebResourceLoadObserver if both ITP is enabled and
we're not in a WebContent process used for an ephemeral session.

* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::resourceLoadStatisticsUpdated):
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* WebProcess/WebCoreSupport/WebResourceLoadObserver.cpp:
(WebKit::WebResourceLoadObserver::requestStorageAccessUnderOpener):
(WebKit::WebResourceLoadObserver::ensureResourceStatisticsForRegistrableDomain):
(WebKit::WebResourceLoadObserver::scheduleNotificationIfNeeded):
(WebKit::WebResourceLoadObserver::statisticsForURL):
(WebKit::WebResourceLoadObserver::takeStatistics):
(WebKit::WebResourceLoadObserver::clearState):
(WebKit::WebResourceLoadObserver::logFontLoad):
(WebKit::WebResourceLoadObserver::logCanvasRead):
(WebKit::WebResourceLoadObserver::logCanvasWriteOrMeasure):
(WebKit::WebResourceLoadObserver::logNavigatorAPIAccessed):
(WebKit::WebResourceLoadObserver::logScreenAPIAccessed):
(WebKit::WebResourceLoadObserver::logSubresourceLoading):
(WebKit::WebResourceLoadObserver::logWebSocketLoading):
(WebKit::WebResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
* WebProcess/WebCoreSupport/WebResourceLoadObserver.h:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::setWebsiteDataStoreParameters):

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

4 months agoUpdate testharness.js from upstream
cdumez@apple.com [Mon, 16 Sep 2019 21:04:08 +0000 (21:04 +0000)]
Update testharness.js from upstream
https://bugs.webkit.org/show_bug.cgi?id=201808

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Update existing layout tests so that they are compatible with this new version
of testharness.js.

* IndexedDB-private-browsing/idbdatabase_createObjectStore9-invalidparameters.html:
* IndexedDB-private-browsing/idbobjectstore_deleted.html:
* web-platform-tests/custom-elements/resources/custom-elements-helpers.js:
(create_window_in_test):

LayoutTests:

Update testharness.js from upstream 6fd5e1e086ce590a4780a30d12968.
Update existing layout tests so that they are compatible with this new version
of testharness.js.

* TestExpectations:
* css-custom-properties-api/length-expected.txt:
* css-custom-properties-api/length.html:
* css-custom-properties-api/registerProperty.html:
* css-dark-mode/older-systems/color-scheme-css-expected.txt:
* css-dark-mode/older-systems/color-scheme-css.html:
* css-dark-mode/older-systems/color-scheme-meta-expected.txt:
* css-dark-mode/older-systems/color-scheme-meta.html:
* css3/flexbox/style-change-expected.txt:
* fast/css/DOMQuad-serialization.html:
* fast/css/Element-style.html:
* fast/css/parse-justify-self-expected.txt:
* fast/css/parse-justify-self.html:
* fast/events/clipboard-event-constructor-expected.txt:
* fast/events/clipboard-event-constructor.html:
* fast/media/mq-js-update-media-expected.txt:
* fast/media/mq-js-update-media.html:
* fast/mediacapturefromelement/CanvasCaptureMediaStream-offscreencanvas-expected.txt:
* fast/mediastream/captureStream/canvas2d-expected.txt:
* fast/mediastream/captureStream/canvas2d-heavy-drawing.html:
* fast/mediastream/captureStream/canvas2d.html:
* fast/shadow-dom/event-path-with-window-expected.txt:
* fast/shadow-dom/event-path-with-window.html:
* fast/shadow-dom/offsetParent-across-shadow-boundaries-expected.txt:
* fast/shadow-dom/offsetParent-across-shadow-boundaries.html:
* fast/shadow-dom/slotchange-for-slot-mutation-expected.txt:
* fast/shadow-dom/slotchange-for-slot-mutation.html:
* fast/shadow-dom/stylesheet-title-in-shadow-tree-expected.txt:
* fast/shadow-dom/stylesheet-title-in-shadow-tree.html:
* http/tests/fetch/redirectmode-and-preload-expected.txt:
* http/tests/fetch/redirectmode-and-preload.html:
* imported/blink/editing/selection/selectstart-event-crash-expected.txt:
* js/promises-tests/promises-in-workers-expected.txt:
* js/promises-tests/promises-in-workers.js:
* resources/check-layout-th.js:
(window.checkLayout):
* resources/testharness.js:
(WindowTestEnvironment):
(WindowTestEnvironment.prototype._dispatch):
(WindowTestEnvironment.prototype._forEach_windows):
(WindowTestEnvironment.prototype.next_default_test_name):
(WorkerTestEnvironment.prototype.next_default_test_name):
(ServiceWorkerTestEnvironment.on_all_loaded):
(ServiceWorkerTestEnvironment):
(ShellTestEnvironment):
(ShellTestEnvironment.prototype.next_default_test_name):
(ShellTestEnvironment.prototype.on_new_harness_properties):
(ShellTestEnvironment.prototype.on_tests_ready):
(ShellTestEnvironment.prototype.add_on_loaded_callback):
(ShellTestEnvironment.prototype.test_timeout):
(create_test_environment):
(is_shared_worker):
(is_service_worker):
(test):
(promise_test):
(this.wait_for):
(EventWatcher):
(done):
* streams/readable-byte-stream-controller-expected.txt:
* streams/readable-byte-stream-controller-worker-expected.txt: Added.
* streams/readable-byte-stream-controller-worker.html: Copied from LayoutTests/streams/readable-byte-stream-controller.html.
* streams/readable-byte-stream-controller.html:
* streams/readable-stream-byob-reader-expected.txt:
* streams/readable-stream-byob-reader-worker-expected.txt: Added.
* streams/readable-stream-byob-reader-worker.html: Copied from LayoutTests/streams/readable-stream-byob-reader.html.
* streams/readable-stream-byob-reader.html:
* streams/readable-stream-byob-request-expected.txt:
* streams/readable-stream-byob-request-worker-expected.txt: Copied from LayoutTests/streams/readable-stream-byob-request-expected.txt.
* streams/readable-stream-byob-request-worker.html: Copied from LayoutTests/streams/readable-stream-byob-request.html.
* streams/readable-stream-byob-request.html:
* streams/reference-implementation/readable-stream-templated-expected.txt:
* streams/reference-implementation/readable-stream-templated.html:
* streams/reference-implementation/writable-stream-abort-expected.txt:
* streams/reference-implementation/writable-stream-expected.txt:
* webrtc/datachannel/basic-expected.txt:
* webrtc/datachannel/basic.html:
* webrtc/datachannel/mdns-ice-candidates-expected.txt:
* webrtc/datachannel/mdns-ice-candidates.html:
* webrtc/pc-detached-document-expected.txt:
* webrtc/pc-detached-document.html:
* webrtc/video-mute-expected.txt:
* webrtc/video-mute-vp8-expected.txt:
* webrtc/video-mute-vp8.html:
* webrtc/video-mute.html:

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

4 months agoFix build failure in MockNfcService.mm
ryanhaddad@apple.com [Mon, 16 Sep 2019 20:52:40 +0000 (20:52 +0000)]
Fix build failure in MockNfcService.mm
<https://webkit.org/b/201839>

Patch by David Kilzer <ddkilzer@apple.com> on 2019-09-16
Reviewed by Brady Eidson.

* UIProcess/WebAuthentication/Mock/MockNfcService.mm:
Specify instance variable names for @synthesized variables that
need to be manually released in -dealloc under MRR.

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

4 months agoSamplingProfiler should hold API lock before reporting results
tzagallo@apple.com [Mon, 16 Sep 2019 20:48:37 +0000 (20:48 +0000)]
SamplingProfiler should hold API lock before reporting results
https://bugs.webkit.org/show_bug.cgi?id=201829

Reviewed by Yusuke Suzuki.

Right now, the SamplingProfiler crashes in debug builds when trying
report results if it finds a JSFunction on the stack that doesn't have
RareData. It tries to allocate the function's rare data when we call
getOwnPropertySlot in order to get the function's name, but that fails
because we are not holding the VM's API lock. We fix it by just holding
the lock before reporting the results.

* runtime/SamplingProfiler.cpp:
(JSC::SamplingProfiler::reportDataToOptionFile):

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

4 months ago[JSC] REGRESSION (r248938): Leak of uint32_t arrays in testFastForwardCopy32()
ddkilzer@apple.com [Mon, 16 Sep 2019 20:29:43 +0000 (20:29 +0000)]
[JSC] REGRESSION (r248938): Leak of uint32_t arrays in testFastForwardCopy32()
<https://webkit.org/b/201804>

Reviewed by Saam Barati.

* b3/testb3_8.cpp:
(testFastForwardCopy32): Allocate arrays using
WTF::makeUniqueArray<uint32_t> to fix leaks caused by continue
statements.

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

4 months ago[ macOS ] Layout tests webgpu/*-triangle-strip.html are flaky failures.
russell_e@apple.com [Mon, 16 Sep 2019 20:24:39 +0000 (20:24 +0000)]
[ macOS ] Layout tests webgpu/*-triangle-strip.html are flaky failures.
https://bugs.webkit.org/show_bug.cgi?id=201827

Unreviewed Test Gardening.

* platform/mac/TestExpectations:

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

4 months agoUnreviewed, mark imported/w3c/web-platform-tests/html/webappapis/scripting/processing...
cdumez@apple.com [Mon, 16 Sep 2019 20:03:15 +0000 (20:03 +0000)]
Unreviewed, mark imported/w3c/web-platform-tests/html/webappapis/scripting/processing-model-2/unhandled-promise-rejections/promise-rejection-events-onerror.html as flaky on iOS.

This test was imported in r249886.

* platform/ios-wk2/TestExpectations:

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

4 months agoJSObject::putInlineSlow should not ignore "__proto__" for Proxy
sbarati@apple.com [Mon, 16 Sep 2019 19:32:39 +0000 (19:32 +0000)]
JSObject::putInlineSlow should not ignore "__proto__" for Proxy
https://bugs.webkit.org/show_bug.cgi?id=200386
<rdar://problem/53854946>

Reviewed by Yusuke Suzuki.

JSTests:

* stress/proxy-__proto__-in-prototype-chain.js: Added.
* stress/proxy-property-replace-structure-transition.js: Added.

Source/JavaScriptCore:

We used to ignore '__proto__' in putInlineSlow when the object in question
was Proxy. There is no reason for this, and it goes against the spec. So
I've removed that condition. This also has the effect that it fixes an
assertion firing inside our inline caching code which dictates that for a
property replace that the base value's structure must be equal to the
structure when we grabbed the structure prior to the put operation.
The old code caused a weird edge case where we broke this invariant.

* runtime/JSObject.cpp:
(JSC::JSObject::putInlineSlow):

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

4 months agoREGRESSION(249649): Unable to open local files in MiniBrowser on macOS
pvollan@apple.com [Mon, 16 Sep 2019 19:15:51 +0000 (19:15 +0000)]
REGRESSION(249649): Unable to open local files in MiniBrowser on macOS
https://bugs.webkit.org/show_bug.cgi?id=201798

Reviewed by Brent Fulgham.

The commit <https://trac.webkit.org/changeset/249649> introduced a MiniBrowser regression on macOS where
MiniBrowser is not able to open local files. The change set r249649 fixed a problem where the WebContent
process PID was not ready to be used when creating a sandbox extension. This happened in the cases where
the WebContent process had not finished launching when the load started. The WebContent process is also
creating sandbox extensions for the Networking process for the files being loaded, and also needs to be
passing the PID of the Networking process when creating these. This patch is addressing this by getting
the PID of the Networking process when the WebContent process is initially getting the connection to the
Networking process. The PID is then stored in the NetworkProcessConnection class, from where it is passed
to the NetworkLoadParameters, and used when creating the sandbox extension for the Networking process.

* NetworkProcess/NetworkLoadParameters.h:
* NetworkProcess/NetworkResourceLoadParameters.cpp:
(WebKit::NetworkResourceLoadParameters::encode const):
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::~NetworkProcessProxy):
(WebKit::NetworkProcessProxy::openNetworkProcessConnection):
(WebKit::NetworkProcessProxy::networkProcessCrashed):
(WebKit::NetworkProcessProxy::didFinishLaunching):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::loadRequestWithNavigationShared):
* UIProcess/WebProcessProxy.messages.in:
* WebProcess/Network/NetworkProcessConnection.cpp:
(WebKit::NetworkProcessConnection::NetworkProcessConnection):
* WebProcess/Network/NetworkProcessConnection.h:
(WebKit::NetworkProcessConnection::create):
(WebKit::NetworkProcessConnection::networkProcessPID const):
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
* WebProcess/WebProcess.cpp:
(WebKit::getNetworkProcessConnection):
(WebKit::WebProcess::ensureNetworkProcessConnection):

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

4 months ago[GTK] Remove GraphicsContext3D dependency from the outside of WebGL
commit-queue@webkit.org [Mon, 16 Sep 2019 18:59:18 +0000 (18:59 +0000)]
[GTK] Remove GraphicsContext3D dependency from the outside of WebGL
https://bugs.webkit.org/show_bug.cgi?id=201748

Patch by ChangSeok Oh <changseok@webkit.org> on 2019-09-16
Reviewed by Alex Christensen.

This is a preliminary change to bring ANGLE support for WebGL to GTK port.
GraphicsContext3DANGLE has its own egl context but we want to make ANGLE egl context
for WebGL and other GL contexts (i.e., glx, gles/egl) for TextureMapper live together.
Mixed uses of GraphicsContext3D outside of WebGL code could cause unintended behaviors.
We want to make sure that only WebGL code uses it.

No new tests since no functionality changed.

* platform/graphics/GLContext.cpp:
* platform/graphics/GLContext.h:
* platform/graphics/glx/GLContextGLX.cpp:
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::GstVideoFrameHolder::platformLayerBuffer):
(WebCore::MediaPlayerPrivateGStreamerBase::nativeImageForCurrentTime):
* platform/graphics/gstreamer/VideoTextureCopierGStreamer.cpp:

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

4 months ago[LFC] Make the nested Geometry/MarginCollapse/Quirks c'tors private.
zalan@apple.com [Mon, 16 Sep 2019 18:44:36 +0000 (18:44 +0000)]
[LFC] Make the nested Geometry/MarginCollapse/Quirks c'tors private.
https://bugs.webkit.org/show_bug.cgi?id=201825
<rdar://problem/55403474>

Reviewed by Antti Koivisto.

The Geometry/MarginCollapse/Quirks objects should be constructed through the corresponding accessor functions.
This is also a preparation for being able to pass the layout box in to these stack objects and call geometry(layoutBox)->outOfFlowVerticalGeometry() vs. geometry()->outOfFlowVerticalGeometry(layoutBox).

* layout/FormattingContext.h:
* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
* layout/blockformatting/BlockFormattingContextQuirks.cpp:
(WebCore::Layout::BlockFormattingContext::Quirks::stretchedInFlowHeight):
* layout/inlineformatting/InlineFormattingContext.h:
* layout/tableformatting/TableFormattingContext.h:

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

4 months ago[WebAuthn] REGRESSION (r249059): Leak of WKMockNFTag objects and WKMockNFTag instance...
ddkilzer@apple.com [Mon, 16 Sep 2019 18:29:49 +0000 (18:29 +0000)]
[WebAuthn] REGRESSION (r249059): Leak of WKMockNFTag objects and WKMockNFTag instance variables
<https://webkit.org/b/201813>

Reviewed by Darin Adler.

* UIProcess/WebAuthentication/Mock/MockNfcService.mm:
(-[WKMockNFTag dealloc]): Add method and release instance
variables to fix leaks.
(WebKit::MockNfcService::detectTags const): Use adoptNS() to fix
leaks of WKMockNFTag objects.

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

4 months agocheck-webkit-style: Fix warning message for std::make_unique<typename[]>
ddkilzer@apple.com [Mon, 16 Sep 2019 17:44:48 +0000 (17:44 +0000)]
check-webkit-style: Fix warning message for std::make_unique<typename[]>
<https://webkit.org/b/201818>

Reviewed by Darin Adler.

* Scripts/webkitpy/style/checkers/cpp.py:
(check_wtf_make_unique): Emit different error message when using
std::make_unique<>() to create an array.  Personalize the error
message by including the original type name, which also
demonstrates that WTF::makeUniqueArray<>() does not need square
brackets for its typename.
* Scripts/webkitpy/style/checkers/cpp_unittest.py:
(WebKitStyleTest.test_wtf_make_unique): Add test.
(WebKitStyleTest.test_wtf_make_unique_array): Ditto.

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

4 months agoUpdate feature status for Battery Status API, WebGL 2, and Dialog Element
jond@apple.com [Mon, 16 Sep 2019 17:30:19 +0000 (17:30 +0000)]
Update feature status for Battery Status API, WebGL 2, and Dialog Element
https://bugs.webkit.org/show_bug.cgi?id=201469

Reviewed by Joseph Pecoraro.

* features.json:

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

4 months agoRename [WebAccessibilityObjectWrapper _accessibilityInsertText] to accessibilityInser...
commit-queue@webkit.org [Mon, 16 Sep 2019 17:15:31 +0000 (17:15 +0000)]
Rename [WebAccessibilityObjectWrapper _accessibilityInsertText] to accessibilityInsertText to match accessibility client.
https://bugs.webkit.org/show_bug.cgi?id=201820

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

Source/WebCore:

No new tests necessary since this is a method rename.

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

Tools:

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

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

4 months ago[LFC] Always provide a containing block width value to compute* functions.
zalan@apple.com [Mon, 16 Sep 2019 16:56:35 +0000 (16:56 +0000)]
[LFC] Always provide a containing block width value to compute* functions.
https://bugs.webkit.org/show_bug.cgi?id=201809
<rdar://problem/55383153>

Reviewed by Antti Koivisto.

The caller can always make a more informative decision about the default value when the containing block width is not available.
(Currently the only case is when computing the preferred width.)

* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeBorderAndPadding):
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry const):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry const):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry const):
(WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin const):
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin const):
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin const):
(WebCore::Layout::FormattingContext::Geometry::inFlowPositionedPositionOffset const):
(WebCore::Layout::FormattingContext::Geometry::computedPadding const):
(WebCore::Layout::FormattingContext::Geometry::computedHorizontalMargin const):
(WebCore::Layout::FormattingContext::Geometry::computedVerticalMargin const):
* layout/LayoutUnits.h:
(WebCore::Layout::UsedHorizontalValues::UsedHorizontalValues):
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin const):
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthConstraints):
(WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFormattingRoot):
(WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot):
(WebCore::Layout::InlineFormattingContext::computeWidthAndHeightForReplacedInlineBox):
* layout/inlineformatting/InlineFormattingContextGeometry.cpp:
(WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockWidthAndMargin):

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

4 months agoREGRESSION (r243113): Leak of multiple instance variable blocks when deallocating...
ddkilzer@apple.com [Mon, 16 Sep 2019 16:41:46 +0000 (16:41 +0000)]
REGRESSION (r243113): Leak of multiple instance variable blocks when deallocating _WKAttributedStringNavigationDelegate
<https://webkit.org/b/201812>

Reviewed by Timothy Hatcher.

* UIProcess/API/Cocoa/NSAttributedString.mm:
(-[_WKAttributedStringNavigationDelegate dealloc]): Add method
to release instance variable blocks to fix potential leaks.

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

4 months agoFix leaks in DumpRenderTree and WebKitTestRunner
ddkilzer@apple.com [Mon, 16 Sep 2019 16:26:53 +0000 (16:26 +0000)]
Fix leaks in DumpRenderTree and WebKitTestRunner
<https://webkit.org/b/201814>

Reviewed by Darin Adler.

* DumpRenderTree/TestNetscapePlugIn/PluginObject.h:
(createCoreAnimationLayer): Fix signature to return CFTypeRef.
Add CF_RETURNS_RETAINED to document behavior.
* DumpRenderTree/TestNetscapePlugIn/PluginObjectMac.mm:
(createCoreAnimationLayer): Fix signature to return CFTypeRef.

* DumpRenderTree/mac/PixelDumpSupportMac.mm:
(takeWindowSnapshot): Add CF_RETURNS_RETAINED to document
behavior.
(createBitmapContextFromWebView): Fix leak of CGImageRef when
generating a replacement image.

* WebKitTestRunner/cocoa/TestRunnerWKWebView.mm: Add @dynamic
declaration for _stableStateOverride so compiler wouldn't try to
create another instance variable for it.

* WebKitTestRunner/mac/EventSenderProxy.mm:
(-[EventSenderSyntheticEvent initPressureEventAtLocation:globalLocation:stage:pressure:stageTransition:phase:time:eventNumber:window:]):
Release `cgEvent` to fix leak.

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

4 months ago[LFC][BFC] BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin should...
zalan@apple.com [Mon, 16 Sep 2019 16:11:57 +0000 (16:11 +0000)]
[LFC][BFC] BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin should not read containing block's width
https://bugs.webkit.org/show_bug.cgi?id=201807
<rdar://problem/55381342>

Reviewed by Antti Koivisto.

This is in preparation for using constraint values instead of querying the display tree for containing block geometry information.
See webkit.org/b/201795

* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin const):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):

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

4 months agoUnreviewed, skip a couple of new WPT tests that are timing out on the bots.
cdumez@apple.com [Mon, 16 Sep 2019 16:04:47 +0000 (16:04 +0000)]
Unreviewed, skip a couple of new WPT tests that are timing out on the bots.

These tests were imported in r249886.

* TestExpectations:

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

4 months agoUnreviewed, land expectations for imported/w3c/web-platform-tests/html/browsers/offli...
cdumez@apple.com [Mon, 16 Sep 2019 15:58:13 +0000 (15:58 +0000)]
Unreviewed, land expectations for imported/w3c/web-platform-tests/html/browsers/offline/application-cache-api/api_swapcache_error.https.html.

This test was imported in r249886.

LayoutTests/imported/w3c:

* web-platform-tests/html/browsers/offline/application-cache-api/api_swapcache_error.https-expected.txt:

LayoutTests:

* TestExpectations:

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

4 months agoUnreviewed, mark imported/w3c/web-platform-tests/html/rendering/replaced-elements...
cdumez@apple.com [Mon, 16 Sep 2019 15:53:29 +0000 (15:53 +0000)]
Unreviewed, mark imported/w3c/web-platform-tests/html/rendering/replaced-elements/embedded-content/video-controls-vertical-writing-mode.html as failing

This test was imported from upstream in r249886.

* TestExpectations:

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

4 months agoUnreviewed, address flakiness of imported/w3c/web-platform-tests/html/browsers/offlin...
cdumez@apple.com [Mon, 16 Sep 2019 15:48:33 +0000 (15:48 +0000)]
Unreviewed, address flakiness of imported/w3c/web-platform-tests/html/browsers/offline/application-cache-api/api_update.https.html

Flaky since r249886.

LayoutTests/imported/w3c:

* web-platform-tests/html/browsers/offline/application-cache-api/api_update.https-expected.txt:

LayoutTests:

* TestExpectations:

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

4 months agoLayoutTests/imported/w3c:
antti@apple.com [Mon, 16 Sep 2019 14:31:37 +0000 (14:31 +0000)]
LayoutTests/imported/w3c:
    Eliminate separate simple line layout path from TextIterator
    https://bugs.webkit.org/show_bug.cgi?id=201760

    Reviewed by Zalan Bujtas.

    * web-platform-tests/css/css-grid/alignment/grid-row-axis-alignment-positioned-items-015-expected.txt:
    * web-platform-tests/css/css-grid/alignment/grid-row-axis-alignment-positioned-items-016-expected.txt:
    * web-platform-tests/innerText/getter-expected.txt:

    Two '\t' subtests flip to FAIL because this was only supported on TextIterator simple line layout path.
    This can now be fixed correctly for both paths.

Source/WebCore:
Eliminate separate simple line layout path from TextIterator
https://bugs.webkit.org/show_bug.cgi?id=201760

Reviewed by Zalan Bujtas.

Use the new line layout iterator to implement linebox traversal in TextIterator.

* WebCore.xcodeproj/project.pbxproj:
* editing/TextIterator.cpp:
(WebCore::TextIterator::advance):
(WebCore::TextIterator::handleTextNode):
(WebCore::TextIterator::handleTextBox):

InlineTextBox* -> LineLayoutInterface::TextBoxIterator
Delete the seperate simple line layout path.

(WebCore::TextIterator::handleTextNodeFirstLetter):
(WebCore::TextIterator::emitCharacter):
(WebCore::TextIterator::emitText):
* editing/TextIterator.h:
* rendering/RenderTreeAsText.cpp:
(WebCore::RenderTreeAsText::writeRenderObject):
(WebCore::write):
* rendering/SimpleLineLayoutResolver.cpp:
(WebCore::SimpleLineLayout::RunResolver::Iterator::Iterator):
(WebCore::SimpleLineLayout::RunResolver::Iterator::advanceLines):
* rendering/SimpleLineLayoutResolver.h:
(WebCore::SimpleLineLayout::RunResolver::Iterator::resolver const):
(WebCore::SimpleLineLayout::RunResolver::Iterator::inQuirksMode const):
(WebCore::SimpleLineLayout::RunResolver::Iterator::operator== const):
(WebCore::SimpleLineLayout::RunResolver::Iterator::simpleRun const):

Make RunResolver::Iterator copyable (so TextBoxIterator becomes copyable too).

* rendering/SimpleLineLayoutTextFragmentIterator.cpp:
(WebCore::SimpleLineLayout::TextFragmentIterator::findNextTextFragment):
* rendering/line/LineLayoutInterfaceTextBoxes.cpp:
(WebCore::LineLayoutInterface::TextBox::rect const):
(WebCore::LineLayoutInterface::TextBox::logicalRect const):
(WebCore::LineLayoutInterface::TextBox::hasHyphen const):
(WebCore::LineLayoutInterface::TextBox::isLeftToRightDirection const):
(WebCore::LineLayoutInterface::TextBox::dirOverride const):
(WebCore::LineLayoutInterface::TextBox::text const):
(WebCore::LineLayoutInterface::TextBox::localStartOffset const):
(WebCore::LineLayoutInterface::TextBox::localEndOffset const):
(WebCore::LineLayoutInterface::TextBox::length const):

Add offset and length functions.

(WebCore::LineLayoutInterface::TextBox::iterator const):
(WebCore::LineLayoutInterface::TextBoxIterator::TextBoxIterator):
(WebCore::LineLayoutInterface::TextBoxIterator::traverseNext):
(WebCore::LineLayoutInterface::TextBoxIterator::operator== const):
(WebCore::LineLayoutInterface::TextBoxIterator::atEnd const):
(WebCore::LineLayoutInterface::Provider::firstTextBoxFor):
(WebCore::LineLayoutInterface::Provider::textBoxRangeFor):
(WebCore::LineLayoutInterface::Provider::iteratorForInlineTextBox):

Add Provider class for making iterators. It constructs and keeps SimpleLineLayout::Resolvers alive during traversal as needed.

* rendering/line/LineLayoutInterfaceTextBoxes.h:
(WebCore::LineLayoutInterface::TextBoxIterator::TextBoxIterator):
(WebCore::LineLayoutInterface::TextBoxIterator::operator bool const):
(WebCore::LineLayoutInterface::TextBoxIterator::operator== const):
(WebCore::LineLayoutInterface::TextBoxIterator::operator!= const):
(WebCore::LineLayoutInterface::TextBoxIterator::operator* const):
(WebCore::LineLayoutInterface::TextBoxIterator::operator-> const):

Make TextBoxIterator privately inherit TextBox. This way we don't need to construct temporaries and can easily implement operator->.

(WebCore::LineLayoutInterface::TextBoxRange::TextBoxRange):
(WebCore::LineLayoutInterface::TextBoxRange::begin const):
(WebCore::LineLayoutInterface::TextBoxRange::end const):

Use separate end() type of C++17 ranges.

LayoutTests:
Eliminate separate simple line layout path from TextIterator
https://bugs.webkit.org/show_bug.cgi?id=201760

Reviewed by Zalan Bujtas.

This patch makes simple and complex line layout path results from TextIterator match, causing some whitespace changes.

* animations/lineheight-animation-expected.txt:
* animations/simultaneous-start-transform-expected.txt:
* animations/width-using-ems-expected.txt:
* compositing/shared-backing/overflow-scroll/absolute-in-stacking-relative-in-scroller-expected.txt:
* css3/filters/backdrop/backdrop-filter-does-not-size-properly-absolute-expected.txt:
* fast/events/window-events-bubble-expected.txt:
* fast/events/window-events-bubble2-expected.txt:
* fast/tokenizer/script_extra_close-expected.txt:
* legacy-animation-engine/animations/lineheight-animation-expected.txt:
* legacy-animation-engine/animations/simultaneous-start-transform-expected.txt:
* scrollingcoordinator/scrolling-tree/nested-absolute-in-overflow-expected.txt:

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

4 months agoUnreviewed build fix.
aperez@igalia.com [Mon, 16 Sep 2019 11:37:10 +0000 (11:37 +0000)]
Unreviewed build fix.

* NetworkProcess/NetworkConnectionToWebProcess.h: Add missing forward
declaration of the NetworkSession class.

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

4 months agoExpose misspelling ranges for editable content to accessibility clients.
commit-queue@webkit.org [Mon, 16 Sep 2019 09:04:42 +0000 (09:04 +0000)]
Expose misspelling ranges for editable content to accessibility clients.
https://bugs.webkit.org/show_bug.cgi?id=201752
<rdar://problem/49556828>

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

Source/WebCore:

Test: accessibility/misspelling-range.html

Added [WebAccessibilityObjectWrapper misspellingTextMarkerRange] and
underlying AccessibilityObject implementation to expose misspellings to
accessibility clients that provide an alternative user interface to
spell checking.
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::getMisspellingRange const):
* accessibility/AccessibilityObject.h:
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper misspellingTextMarkerRange:direction:]):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(accessibilityMisspellingSearchCriteriaForParameterizedAttribute):
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):

Tools:

Test code needed for LayoutTests/accessibility/misspelling-range.html.
* WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h:
* WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl:
* WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm:
(WTR::AccessibilityUIElement::misspellingTextMarkerRange):
(WTR::AccessibilityUIElement::indexForTextMarker):
* WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm:
(WTR::misspellingSearchParameterizedAttributeForCriteria):
(WTR::AccessibilityUIElement::misspellingTextMarkerRange):

LayoutTests:

* accessibility/misspelling-range-expected.txt: Added.
* accessibility/misspelling-range.html: Added.
* platform/ios-simulator/TestExpectations:

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

4 months agoRemove commit.h copying build steps
commit-queue@webkit.org [Mon, 16 Sep 2019 08:46:46 +0000 (08:46 +0000)]
Remove commit.h copying build steps
https://bugs.webkit.org/show_bug.cgi?id=201785

Patch by James Darpinian <jdarpinian@chromium.org> on 2019-09-16
Reviewed by Alex Christensen.

* ANGLE.xcodeproj/project.pbxproj: Remove leftover build step
* CMakeLists.txt: Remove commit.h copying
* src/common/version.h: Restore to upstream version
* src/id/commit.h: Added.
* update-angle.sh: Copy commit.h to id/commit.h at import time

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

4 months agoStore sessionID on the NetworkConnectionToWebProcess now that there is one session...
cdumez@apple.com [Mon, 16 Sep 2019 08:01:38 +0000 (08:01 +0000)]
Store sessionID on the NetworkConnectionToWebProcess now that there is one session per WebProcess
https://bugs.webkit.org/show_bug.cgi?id=201789

Reviewed by Alex Christensen.

Store sessionID on the NetworkConnectionToWebProcess now that there is one session per WebProcess.
As a result, we no longer need to pass the sessionID in each IPC from the WebProcess to the
NetworkProcess.

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::create):
(WebKit::NetworkConnectionToWebProcess::NetworkConnectionToWebProcess):
(WebKit::NetworkConnectionToWebProcess::~NetworkConnectionToWebProcess):
(WebKit::NetworkConnectionToWebProcess::didReceiveMessage):
(WebKit::NetworkConnectionToWebProcess::didReceiveSyncMessage):
(WebKit::NetworkConnectionToWebProcess::didClose):
(WebKit::NetworkConnectionToWebProcess::createSocketStream):
(WebKit::NetworkConnectionToWebProcess::createSocketChannel):
(WebKit::NetworkConnectionToWebProcess::networkSession):
(WebKit::NetworkConnectionToWebProcess::resolveBlobReferences):
(WebKit::NetworkConnectionToWebProcess::storageSession):
(WebKit::NetworkConnectionToWebProcess::startDownload):
(WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload):
(WebKit::NetworkConnectionToWebProcess::cookiesForDOM):
(WebKit::NetworkConnectionToWebProcess::setCookiesFromDOM):
(WebKit::NetworkConnectionToWebProcess::cookiesEnabled):
(WebKit::NetworkConnectionToWebProcess::cookieRequestHeaderFieldValue):
(WebKit::NetworkConnectionToWebProcess::getRawCookies):
(WebKit::NetworkConnectionToWebProcess::deleteCookie):
(WebKit::NetworkConnectionToWebProcess::registerFileBlobURL):
(WebKit::NetworkConnectionToWebProcess::registerBlobURL):
(WebKit::NetworkConnectionToWebProcess::registerBlobURLFromURL):
(WebKit::NetworkConnectionToWebProcess::registerBlobURLOptionallyFileBacked):
(WebKit::NetworkConnectionToWebProcess::registerBlobURLForSlice):
(WebKit::NetworkConnectionToWebProcess::unregisterBlobURL):
(WebKit::NetworkConnectionToWebProcess::blobSize):
(WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles):
(WebKit::NetworkConnectionToWebProcess::removeStorageAccessForFrame):
(WebKit::NetworkConnectionToWebProcess::clearPageSpecificDataForResourceLoadStatistics):
(WebKit::NetworkConnectionToWebProcess::logUserInteraction):
(WebKit::NetworkConnectionToWebProcess::hasStorageAccess):
(WebKit::NetworkConnectionToWebProcess::requestStorageAccess):
(WebKit::NetworkConnectionToWebProcess::requestStorageAccessUnderOpener):
(WebKit::NetworkConnectionToWebProcess::startTrackingResourceLoad):
(WebKit::NetworkConnectionToWebProcess::establishIDBConnectionToServer):
(WebKit::NetworkConnectionToWebProcess::unregisterSWConnection):
(WebKit::NetworkConnectionToWebProcess::establishSWServerConnection):
(WebKit::NetworkConnectionToWebProcess::establishSWContextConnection):
* NetworkProcess/NetworkConnectionToWebProcess.h:
(WebKit::NetworkConnectionToWebProcess::sessionID const):
(WebKit::NetworkConnectionToWebProcess::startDownload):
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::createNetworkConnectionToWebProcess):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::start):
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::openNetworkProcessConnection):
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::sessionID const):
* UIProcess/WebProcessProxy.h:
* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
(WebKit::WebIDBConnectionToServer::WebIDBConnectionToServer):
* WebProcess/FileAPI/BlobRegistryProxy.cpp:
(WebKit::BlobRegistryProxy::registerFileBlobURL):
(WebKit::BlobRegistryProxy::registerBlobURL):
(WebKit::BlobRegistryProxy::registerBlobURLOptionallyFileBacked):
(WebKit::BlobRegistryProxy::unregisterBlobURL):
(WebKit::BlobRegistryProxy::registerBlobURLForSlice):
(WebKit::BlobRegistryProxy::blobSize):
* WebProcess/Network/NetworkProcessConnection.cpp:
(WebKit::NetworkProcessConnection::writeBlobsToTemporaryFiles):
* WebProcess/Network/WebSocketChannel.cpp:
(WebKit::WebSocketChannel::connect):
* WebProcess/Network/WebSocketStream.cpp:
(WebKit::WebSocketStream::WebSocketStream):
* WebProcess/Storage/WebSWClientConnection.cpp:
(WebKit::WebSWClientConnection::WebSWClientConnection):
* WebProcess/Storage/WebSWContextManagerConnection.cpp:
(WebKit::m_userAgent):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::detachedFromParent2):
(WebKit::WebFrameLoaderClient::dispatchWillChangeDocument):
* WebProcess/WebCoreSupport/WebResourceLoadObserver.cpp:
(WebKit::WebResourceLoadObserver::requestStorageAccessUnderOpener):
(WebKit::WebResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
* WebProcess/WebPage/WebCookieJar.cpp:
(WebKit::WebCookieJar::cookies const):
(WebKit::WebCookieJar::setCookies):
(WebKit::WebCookieJar::cookiesEnabled const):
(WebKit::WebCookieJar::cookieRequestHeaderFieldValue const):
(WebKit::WebCookieJar::getRawCookies const):
(WebKit::WebCookieJar::deleteCookie):
* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::startDownload):
(WebKit::WebFrame::convertMainResourceLoadToDownload):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::close):
(WebKit::WebPage::hasStorageAccess):
(WebKit::WebPage::requestStorageAccess):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::createWebPage):
(WebKit::WebProcess::removeWebPage):
* WebProcess/WebProcess.h:
(WebKit::WebProcess::sessionID const):

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

4 months agoREGRESSION(r249142): [GTK] Epiphany delayed page loads continue indefinitely
carlosgc@webkit.org [Mon, 16 Sep 2019 07:49:10 +0000 (07:49 +0000)]
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:

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

4 months agoREGRESSION (r248592): Leak of CFDictionaryRef in WebKit::NetworkRTCProvider::proxyInf...
ddkilzer@apple.com [Mon, 16 Sep 2019 05:51:49 +0000 (05:51 +0000)]
REGRESSION (r248592): Leak of CFDictionaryRef in WebKit::NetworkRTCProvider::proxyInfoFromSession()
<https://webkit.org/b/201811>

Reviewed by Youenn Fablet.

* NetworkProcess/webrtc/NetworkRTCProvider.mm:
(WebKit::NetworkRTCProvider::proxyInfoFromSession): Use
RetainPtr<> to fix the leak.

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

4 months ago[WebIDL] Derived dictionaries should inherit their inherited dictionaries' partials
aestes@apple.com [Mon, 16 Sep 2019 00:41:07 +0000 (00:41 +0000)]
[WebIDL] Derived dictionaries should inherit their inherited dictionaries' partials
https://bugs.webkit.org/show_bug.cgi?id=201802

Reviewed by Sam Weinig.

Prior to this change, a dictionary D that inherits from dictionary B would not inherit B's
partial dictionaries. Fixed this by moving supplemental dependencies processing from
generate-bindings.pl to CodeGenerator.pm and reusing it in GetDictionaryByType.

Added new bindings tests.

* bindings/scripts/CodeGenerator.pm:
(new):
(ProcessDocument):
(ProcessSupplementalDependencies):
(shouldPropertyBeExposed):
(GetDictionaryByType):
* bindings/scripts/generate-bindings.pl:
(generateBindings):
(shouldPropertyBeExposed): Deleted.
* bindings/scripts/test/JS/JSTestDerivedDictionary.cpp: Added.
(WebCore::convertDictionary<TestDerivedDictionary>):
(WebCore::convertDictionaryToJS):
* bindings/scripts/test/JS/JSTestDerivedDictionary.h: Added.
* bindings/scripts/test/JS/JSTestInheritedDictionary.cpp: Added.
(WebCore::convertDictionary<TestInheritedDictionary>):
(WebCore::convertDictionaryToJS):
* bindings/scripts/test/JS/JSTestInheritedDictionary.h: Added.
* bindings/scripts/test/TestDerivedDictionary.idl: Added.
* bindings/scripts/test/TestInheritedDictionary.idl: Added.
* bindings/scripts/test/TestSupplemental.idl:

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

4 months agoMissing call to [self init] in -[WebScrollbarPartAnimation initWithScrollbar:featureT...
ddkilzer@apple.com [Sun, 15 Sep 2019 21:43:27 +0000 (21:43 +0000)]
Missing call to [self init] in -[WebScrollbarPartAnimation initWithScrollbar:featureToAnimate:animateFrom:animateTo:duration:]
<https://webkit.org/b/201806>

Reviewed by Simon Fraser.

* platform/mac/ScrollAnimatorMac.mm:
(-[WebScrollbarPartAnimation initWithScrollbar:featureToAnimate:animateFrom:animateTo:duration:]):
Call [self init] and return early if the result is nil.

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

4 months agoRe-sync HTML web-platform-tests from upstream
cdumez@apple.com [Sun, 15 Sep 2019 19:25:50 +0000 (19:25 +0000)]
Re-sync HTML web-platform-tests from upstream
https://bugs.webkit.org/show_bug.cgi?id=201753

Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

Re-sync HTML web-platform-tests from upstream 8893b1bcfc2ca0675f4e81.

* web-platform-tests/html/*: Updated.

LayoutTests:

* TestExpectations:
* platform/gtk/TestExpectations:
* platform/ios-wk1/TestExpectations:
* platform/ios/TestExpectations:
* platform/mac-wk2/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/type-change-state-expected.txt:
* platform/mac/TestExpectations:
* platform/mac/imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location_hash-expected.txt:
* platform/win/TestExpectations:
* tests-options.json:

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

4 months agoLeak of NSMapTable in -[JSVirtualMachine addManagedReference:withOwner:]
ddkilzer@apple.com [Sun, 15 Sep 2019 17:17:02 +0000 (17:17 +0000)]
Leak of NSMapTable in -[JSVirtualMachine addManagedReference:withOwner:]
<https://webkit.org/b/201803>

Reviewed by Dan Bernstein.

* API/JSVirtualMachine.mm:
(-[JSVirtualMachine addManagedReference:withOwner:]): Use
RetainPtr<> to fix the leak.

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

4 months agoblock-spammers should obtain credentials the same way as webkit-patch
ddkilzer@apple.com [Sun, 15 Sep 2019 14:14:59 +0000 (14:14 +0000)]
block-spammers should obtain credentials the same way as webkit-patch
<https://webkit.org/b/201733>

Reviewed by Lucas Forschler.

* Scripts/block-spammers: Import Credentials from webkitpy.
Remove unused imports.  Enable logging at info level to match
webkit-patch.
(get_bugzilla_token): Use Credentials module to get
bugs.webkit.org credentials.
* Scripts/webkitpy/common/net/credentials.py:
(Credentials._run_security_tool): Change logging level from
error to info since multiple attempts are made at reading the
keychain.  Fix typos in comment.
(Credentials._credentials_from_security_command): Extract common
logic from Credentials._credentials_from_keychain into new
method.
(Credentials._credentials_from_keychain): Make fallback logic
for checking for credentials in the keychain more consistent and
easier to read.  Add error logging if no credentials are found.

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

4 months ago[GTK][WPE] Do not run the Bubblewrap executable when configuring for cross-compilation
aperez@igalia.com [Sun, 15 Sep 2019 13:30:01 +0000 (13:30 +0000)]
[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.

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

4 months ago[GTK][WPE] Check for a Snap sandbox a bit harder
aperez@igalia.com [Sat, 14 Sep 2019 22:45:30 +0000 (22:45 +0000)]
[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.

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

4 months ago[WebGPU] Make WebGPURenderPipeline and WebGPUComputePipeline inherit from GPUObjectBase
justin_fan@apple.com [Sat, 14 Sep 2019 22:31:02 +0000 (22:31 +0000)]
[WebGPU] Make WebGPURenderPipeline and WebGPUComputePipeline inherit from GPUObjectBase
https://bugs.webkit.org/show_bug.cgi?id=201207

Reviewed by Dean Jackson.

Make remaining WebGPU "client" classes manage their error scopes, instead of the internal classes.
Matches Web/GPUBuffer, and allows "invalid" WebGPU objects to create errors.

Covered by existing tests.

* Modules/webgpu/WebGPUComputePipeline.cpp:
(WebCore::WebGPUComputePipeline::create):
(WebCore::WebGPUComputePipeline::WebGPUComputePipeline):
* Modules/webgpu/WebGPUComputePipeline.h:
* Modules/webgpu/WebGPUDevice.cpp:
(WebCore::WebGPUDevice::createRenderPipeline const):
(WebCore::WebGPUDevice::createComputePipeline const):
* Modules/webgpu/WebGPURenderPipeline.cpp:
(WebCore::WebGPURenderPipeline::create):
(WebCore::WebGPURenderPipeline::WebGPURenderPipeline):
* Modules/webgpu/WebGPURenderPipeline.h:
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/gpu/GPUComputePipeline.h:
* platform/graphics/gpu/GPURenderPipeline.h:
* platform/graphics/gpu/cocoa/GPUComputePipelineMetal.mm:
(WebCore::GPUComputePipeline::tryCreate):
(WebCore::GPUComputePipeline::GPUComputePipeline):
* platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
(WebCore::GPURenderPipeline::tryCreate):
(WebCore::GPURenderPipeline::GPURenderPipeline):

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

4 months agoRetire x86 32bit JIT support
ysuzuki@apple.com [Sat, 14 Sep 2019 19:36:29 +0000 (19:36 +0000)]
Retire x86 32bit JIT support
https://bugs.webkit.org/show_bug.cgi?id=201790

Reviewed by Mark Lam.

Source/JavaScriptCore:

Now, Xcode no longer has ability to build 32bit binary, so we cannot even test it on macOS.
Fedora stops shipping x86 32bit kernel. Our x86/x86_64 JIT requires SSE2, and so such relatively modern CPUs
can use JIT by switching x86 to x86_64. And these CPUs are modern enough to run CLoop at high speed.
WebKit already disabled x86 JIT by default while the implementation exists. So literary, it is not tested.

While x86 32bit becomes less useful, x86 32bit JIT backend is very complicated and is being a major maintenance burden.
This is due to very few # of registers. Which scatters a lot of isX86 / CPU(X86) in Baseline, DFG, and Yarr.

This patch retires x86 JIT support from JavaScriptCore and CSS JIT. We still keep MacroAssembler and GPRInfo / FPRInfo,
MachineContext information since they are useful even though JIT is not supported.

* dfg/DFGArrayMode.cpp:
(JSC::DFG::ArrayMode::refine const):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleIntrinsicCall):
(JSC::DFG::ByteCodeParser::parseBlock):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGJITCompiler.cpp:
(JSC::DFG::JITCompiler::compileExceptionHandlers):
* dfg/DFGOSRExitCompilerCommon.cpp:
(JSC::DFG::osrWriteBarrier):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileArithDiv):
(JSC::DFG::SpeculativeJIT::compileArithMod):
(JSC::DFG::SpeculativeJIT::compileCreateRest):
(JSC::DFG::SpeculativeJIT::compileGetDirectPname):
* dfg/DFGSpeculativeJIT.h:
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::emitCall):
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGThunks.cpp:
(JSC::DFG::osrExitGenerationThunkGenerator):
* ftl/FTLThunks.cpp:
(JSC::FTL::slowPathCallThunkGenerator):
* jit/AssemblyHelpers.cpp:
(JSC::AssemblyHelpers::callExceptionFuzz):
(JSC::AssemblyHelpers::debugCall):
* jit/AssemblyHelpers.h:
(JSC::AssemblyHelpers::emitComputeButterflyIndexingMask):
* jit/CCallHelpers.h:
(JSC::CCallHelpers::setupArgumentsImpl):
(JSC::CCallHelpers::prepareForTailCallSlow):
* jit/CallFrameShuffler.cpp:
(JSC::CallFrameShuffler::prepareForTailCall):
* jit/JIT.cpp:
(JSC::JIT::privateCompileExceptionHandlers):
* jit/JITArithmetic32_64.cpp:
(JSC::JIT::emit_op_mod):
(JSC::JIT::emitSlow_op_mod):
* jit/SlowPathCall.h:
(JSC::JITSlowPathCall::call):
* jit/ThunkGenerators.cpp:
(JSC::nativeForGenerator):
(JSC::arityFixupGenerator):
* wasm/WasmAirIRGenerator.cpp:
(JSC::Wasm::AirIRGenerator::emitModOrDiv):
* yarr/YarrJIT.cpp:
(JSC::Yarr::YarrGenerator::generateDotStarEnclosure):
(JSC::Yarr::YarrGenerator::generateEnter):
(JSC::Yarr::YarrGenerator::generateReturn):
(JSC::Yarr::YarrGenerator::compile):
* yarr/YarrJIT.h:

Source/WebCore:

* cssjit/FunctionCall.h:
(WebCore::FunctionCall::callAndBranchOnBooleanReturnValue):
(WebCore::FunctionCall::swapArguments):

Source/WTF:

* wtf/Platform.h:

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

4 months ago[LFC] FormattingContext::Geometry::inFlowPositionedPositionOffset should not read...
zalan@apple.com [Sat, 14 Sep 2019 18:52:02 +0000 (18:52 +0000)]
[LFC] FormattingContext::Geometry::inFlowPositionedPositionOffset should not read containing block's width
https://bugs.webkit.org/show_bug.cgi?id=201797
<rdar://problem/55366244>

Reviewed by Antti Koivisto.

This is in preparation for using constraint values instead of querying the display tree for containing block geometry information.
See webkit.org/b/201795

* layout/FormattingContext.h:
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::inFlowPositionedPositionOffset const):
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::placeInFlowPositionedChildren):
* layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
(WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns const):

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

4 months ago[LFC] FormattingContext::Geometry::inlineReplacedHeightAndMargin should not read...
zalan@apple.com [Sat, 14 Sep 2019 18:05:58 +0000 (18:05 +0000)]
[LFC] FormattingContext::Geometry::inlineReplacedHeightAndMargin should not read containing block's width
https://bugs.webkit.org/show_bug.cgi?id=201796
<rdar://problem/55366109>

Reviewed by Antti Koivisto.

This is in preparation for using constraint values instead of querying the display tree for containing block geometry information.
See webkit.org/b/201795

* layout/FormattingContext.h:
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry const):
(WebCore::Layout::FormattingContext::Geometry::complicatedCases const):
(WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin const):
(WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin const):
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin const):
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::computeHeightAndMargin):
* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::computeHeightAndMargin):
* layout/inlineformatting/InlineFormattingContext.h:
* layout/inlineformatting/InlineFormattingContextGeometry.cpp:
(WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockHeightAndMargin const):

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

4 months ago[LFC] FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry should not read...
zalan@apple.com [Sat, 14 Sep 2019 17:23:28 +0000 (17:23 +0000)]
[LFC] FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry should not read containing block's width.
https://bugs.webkit.org/show_bug.cgi?id=201794
<rdar://problem/55365669>

Reviewed by Antti Koivisto.

This is in preparation for using constraint values instead of querying the display tree for containing block geometry information.
See webkit.org/b/201795

* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry):
* layout/FormattingContext.h:
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry const):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry const):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowVerticalGeometry const):

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

4 months agonewController may be moved several times under SWClientConnection::notifyClientsOfCon...
cdumez@apple.com [Sat, 14 Sep 2019 16:00:56 +0000 (16:00 +0000)]
newController may be moved several times under SWClientConnection::notifyClientsOfControllerChange()
https://bugs.webkit.org/show_bug.cgi?id=201792
<rdar://problem/55351284>

Reviewed by Youenn Fablet.

Stop WTFMove()'ing inside the for loop.

* workers/service/SWClientConnection.cpp:
(WebCore::SWClientConnection::notifyClientsOfControllerChange):

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

4 months ago[LFC] FormattingContext::Geometry::computedHeightValue should not read containing...
zalan@apple.com [Sat, 14 Sep 2019 13:55:34 +0000 (13:55 +0000)]
[LFC] FormattingContext::Geometry::computedHeightValue should not read containing block's height.
https://bugs.webkit.org/show_bug.cgi?id=201791
<rdar://problem/55361695>

Reviewed by Antti Koivisto.

While sizing/positioning a particular box, we oftentimes need some containing block geometry information.
The idea here is that instead of calling formattingContext().geometry(containingBlock), these constraint values
would be pushed in to those compute* functions. It helps controlling the access to the display box tree and
prevents formatting context escaping.

* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry):
* layout/FormattingContext.h:
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::computedHeightValue const):
(WebCore::Layout::FormattingContext::Geometry::computedMaxHeight const):
(WebCore::Layout::FormattingContext::Geometry::computedMinHeight const):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry const):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry const):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowVerticalGeometry const):
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin const):
* layout/LayoutUnits.h:
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::computeHeightAndMargin):

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

4 months agoAdd release logging in WebLoaderStrategy to check that a load is going through servic...
youenn@apple.com [Sat, 14 Sep 2019 10:11:23 +0000 (10:11 +0000)]
Add release logging in WebLoaderStrategy to check that a load is going through service worker
https://bugs.webkit.org/show_bug.cgi?id=201761

Reviewed by Chris Dumez.

This allows identifying whether a load remains pending on the service worker fetch path.

* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::scheduleLoad):

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

4 months agoASSERTION FAILED: !renderer() in WebCore::Text::~Text
antti@apple.com [Sat, 14 Sep 2019 08:52:50 +0000 (08:52 +0000)]
ASSERTION FAILED: !renderer() in  WebCore::Text::~Text
https://bugs.webkit.org/show_bug.cgi?id=172514
<rdar://problem/32470509>

Unreviewed, this assert should be fixed now.

* TestExpectations:

Unskipping imported/w3c/web-platform-tests/innerText/getter.html on debug

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

4 months agoWPT importer should check META global tag in .any.js files to generate the valid...
youenn@apple.com [Sat, 14 Sep 2019 06:23:43 +0000 (06:23 +0000)]
WPT importer should check META global tag in .any.js files to generate the valid .html stub files
https://bugs.webkit.org/show_bug.cgi?id=201718

Reviewed by Chris Dumez.

LayoutTests/imported/w3c:

* web-platform-tests/infrastructure/server/context.any.serviceworker-expected.txt: Added.
* web-platform-tests/infrastructure/server/context.any.serviceworker.html: Added.
* web-platform-tests/infrastructure/server/secure-context.https.any.serviceworker-expected.txt: Added.
* web-platform-tests/infrastructure/server/secure-context.https.any.serviceworker.html: Added.

Tools:

Read meta tag information to select the environments where the any.js template tests will be run.
Added support to run service worker tests from any.js template tests.

Covered by unit test.
Since we import only a single repository nowadays, use a test config file with just one repository
to simplify the new test.

* Scripts/webkitpy/w3c/test_importer.py:
(TestImporter.__init__):
(TestImporter.readEnvironmentsForTemplateTest):
(TestImporter.write_html_files_for_templated_js_tests):
* Scripts/webkitpy/w3c/test_importer_unittest.py:
(TestImporterTest.test_import_dir_with_no_tests_and_no_hg):
(TestImporterTest.test_import_dir_with_no_tests):
(TestImporterTest.test_import_dir_with_empty_init_py):
(TestImporterTest.test_harnesslinks_conversion):
(TestImporterTest.test_submodules_generation):
(test_checkout_directory):
(test_clean_directory_option):
(test_git_ignore_generation):
(test_initpy_generation):
(test_remove_obsolete_content):
(test_manual_slow_test):
(test_webkit_test_runner_options):
(test_webkit_test_runner_import_reftests_with_absolute_paths_download):
(test_webkit_test_runner_import_reftests_with_absolute_paths_from_source_dir):
(test_template_test):

LayoutTests:

* platform/mac-wk1/TestExpectations:
Skipping service worker tests.

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

4 months ago[MacOS/iOS] imported/w3c/web-platform-tests/service-workers/cache-storage/servicework...
youenn@apple.com [Sat, 14 Sep 2019 05:14:13 +0000 (05:14 +0000)]
[MacOS/iOS] imported/w3c/web-platform-tests/service-workers/cache-storage/serviceworker/cache-abort.https.html is sometimes crashing in Debug
https://bugs.webkit.org/show_bug.cgi?id=201686

Reviewed by Alexey Proskuryakov.

A load might be cancelled shortly after being started in network process.
In that case, NetworkDataTaskCocoa might be destroyed, thus removed from the ID to task map
but some handlers might still be called until the NSURLSessionTask is finished cancelling.
This happens for authentication challenges.
In case where the NSURLSessionTask is cancelling, return early instead of processing the challenge.

Covered by LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/window/cache-abort.https.html and LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/serviceworker/cache-abort.https.html no longer crashing in debug.

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

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

4 months agojsc -d stopped working.
mark.lam@apple.com [Sat, 14 Sep 2019 02:22:49 +0000 (02:22 +0000)]
jsc -d stopped working.
https://bugs.webkit.org/show_bug.cgi?id=201787

Reviewed by Joseph Pecoraro.

The reason is because, in this case, the jsc shell is trying to set an option
after the VM has been instantiated.  The fix is simply to move all options
initialization before the VM is instantiated.

* jsc.cpp:
(runWithOptions):
(jscmain):

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

4 months agoWeb Inspector: HTML Formatter - XML mode
joepeck@webkit.org [Sat, 14 Sep 2019 02:16:00 +0000 (02:16 +0000)]
Web Inspector: HTML Formatter - XML mode
https://bugs.webkit.org/show_bug.cgi?id=201758

Reviewed by Devin Rousso.

Source/WebInspectorUI:

* Tools/HTMLFormatter/index.html:
* Tools/SourceMaps/index.html:
Update Tools to more easily test XML.

* UserInterface/Proxies/FormatterWorkerProxy.js:
(WI.FormatterWorkerProxy.prototype.formatXML):
* UserInterface/Views/TextEditor.js:
(WI.TextEditor.prototype.hasFormatter):
(WI.TextEditor.prototype._startWorkerPrettyPrint):
Allow formatting XML content.

* UserInterface/Workers/Formatter/FormatterWorker.js:
(FormatterWorker.prototype.formatHTML):
(FormatterWorker.prototype.formatXML):
Expose "formatXML".

* UserInterface/Workers/Formatter/HTMLFormatter.js:
(HTMLFormatter.let.dom):
(HTMLFormatter):
(HTMLFormatter.prototype._shouldHaveNoChildren):
(HTMLFormatter.prototype._before):
(HTMLFormatter.prototype._after):
* UserInterface/Workers/Formatter/HTMLParser.js:
(HTMLParser.prototype.parseDocument):
* UserInterface/Workers/Formatter/HTMLTreeBuilderFormatter.js:
(HTMLTreeBuilderFormatter.prototype._isEmptyNode):
Give the HTMLFormatter and related classes an XML mode that
has less of the smarts of XML.

LayoutTests:

* inspector/formatting/formatting-xml-expected.txt: Added.
* inspector/formatting/formatting-xml.html: Added.
* inspector/formatting/resources/formatting-utilities.js:
(TestPage.registerInitializer.async.runFormattingTest):
* inspector/formatting/resources/xml-tests/atom-expected.xml: Added.
* inspector/formatting/resources/xml-tests/atom.xml: Added.
* inspector/formatting/resources/xml-tests/basic-expected.xml: Added.
* inspector/formatting/resources/xml-tests/basic.xml: Added.
* inspector/formatting/resources/xml-tests/rss-expected.xml: Added.
* inspector/formatting/resources/xml-tests/rss.xml: Added.
* inspector/formatting/resources/xml-tests/valid-html-invalid-xml-expected.xml: Added.
* inspector/formatting/resources/xml-tests/valid-html-invalid-xml.xml: Added.
* inspector/formatting/resources/xml-tests/xslt-expected.xml: Added.
* inspector/formatting/resources/xml-tests/xslt.xml: Added.

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