Skip to content
Permalink
Browse files
Restore navigator.hardwareConcurrency
https://bugs.webkit.org/show_bug.cgi?id=233381
<rdar://85023911>

Reviewed by Saam Barati.

LayoutTests/imported/w3c:

* web-platform-tests/html/dom/idlharness.https-expected.txt:
* web-platform-tests/html/dom/idlharness.worker-expected.txt:
* web-platform-tests/workers/WorkerNavigator-hardware-concurrency.any.worker-expected.txt:

Source/WebCore:

Navigator.hardwareConcurrency was removed in r219379, but it is now used
by emscripten to implement std:🧵:hardware_concurrency()

Test: fast/dom/navigator-hardwareConcurrency.html

* page/Navigator.idl:
* page/NavigatorBase.cpp:
(WebCore::NavigatorBase::hardwareConcurrency):
* page/NavigatorBase.h:
* page/WorkerNavigator.idl:

LayoutTests:

* fast/dom/Window/resources/window-property-collector.js:
(emitExpectedResult):
* fast/dom/navigator-detached-no-crash-expected.txt:
* fast/dom/navigator-hardwareConcurrency-expected.txt: Added.
* fast/dom/navigator-hardwareConcurrency.html: Added.
* fast/workers/resources/worker-navigator.js:
* fast/workers/worker-navigator-expected.txt:
* platform/glib/imported/w3c/web-platform-tests/html/dom/idlharness.worker-expected.txt:
* platform/gtk/fast/dom/navigator-detached-no-crash-expected.txt:
* platform/gtk/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt:
* platform/ios-wk2/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt:
* platform/ipad/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt:
* platform/mac-wk1/fast/dom/navigator-detached-no-crash-expected.txt:
* platform/mac-wk1/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt:
* platform/mac-wk2/fast/dom/navigator-detached-no-crash-expected.txt:
* platform/mac-wk2/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt:
* platform/mac/fast/dom/navigator-detached-no-crash-expected.txt:
* platform/win/fast/dom/navigator-detached-no-crash-expected.txt:
* platform/wincairo/fast/dom/navigator-detached-no-crash-expected.txt:
* platform/wpe/fast/dom/navigator-detached-no-crash-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt:



Canonical link: https://commits.webkit.org/244881@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@286550 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
tadeuzagallo committed Dec 6, 2021
1 parent ef51692 commit f146f8a8aa8972114df09b347f7a525a83db01ae
Showing 30 changed files with 145 additions and 19 deletions.
@@ -1,3 +1,33 @@
2021-12-06 Tadeu Zagallo <tzagallo@apple.com>

Restore navigator.hardwareConcurrency
https://bugs.webkit.org/show_bug.cgi?id=233381
<rdar://85023911>

Reviewed by Saam Barati.

* fast/dom/Window/resources/window-property-collector.js:
(emitExpectedResult):
* fast/dom/navigator-detached-no-crash-expected.txt:
* fast/dom/navigator-hardwareConcurrency-expected.txt: Added.
* fast/dom/navigator-hardwareConcurrency.html: Added.
* fast/workers/resources/worker-navigator.js:
* fast/workers/worker-navigator-expected.txt:
* platform/glib/imported/w3c/web-platform-tests/html/dom/idlharness.worker-expected.txt:
* platform/gtk/fast/dom/navigator-detached-no-crash-expected.txt:
* platform/gtk/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt:
* platform/ios-wk2/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt:
* platform/ipad/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt:
* platform/mac-wk1/fast/dom/navigator-detached-no-crash-expected.txt:
* platform/mac-wk1/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt:
* platform/mac-wk2/fast/dom/navigator-detached-no-crash-expected.txt:
* platform/mac-wk2/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt:
* platform/mac/fast/dom/navigator-detached-no-crash-expected.txt:
* platform/win/fast/dom/navigator-detached-no-crash-expected.txt:
* platform/wincairo/fast/dom/navigator-detached-no-crash-expected.txt:
* platform/wpe/fast/dom/navigator-detached-no-crash-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt:

2021-12-06 Said Abou-Hallawa <said@apple.com>

[GPU Process] (REGRESSION r285597): Set the filterRegion of the CSSFilter after it is created
@@ -65,6 +65,7 @@ function emitExpectedResult(path, expected)
break;
case "navigator.appCodeName":
case "navigator.appName":
case "navigator.hardwareConcurrency":
case "navigator.language":
case "navigator.onLine":
case "navigator.platform":
@@ -10,6 +10,7 @@ navigator.contacts is OK
navigator.cookieEnabled is OK
navigator.credentials is OK
navigator.getStorageUpdates() is OK
navigator.hardwareConcurrency is OK
navigator.javaEnabled() is OK
navigator.language is OK
navigator.languages is OK
@@ -38,6 +39,7 @@ navigator.contacts is OK
navigator.cookieEnabled is OK
navigator.credentials is OK
navigator.getStorageUpdates() is OK
navigator.hardwareConcurrency is OK
navigator.javaEnabled() is OK
navigator.language is OK
navigator.languages is OK
@@ -0,0 +1,3 @@
Tests for navigator.hardwareConcurrency

PASS
@@ -0,0 +1,16 @@
<html>
<body>
<p>Tests for navigator.hardwareConcurrency</p>
<script>
if (window.testRunner)
testRunner.dumpAsText();

var concurrency = navigator.hardwareConcurrency;

if(concurrency && concurrency > 0)
document.write("PASS");
else
document.write("Fail, navigator.hardwareConcurrency is " + concurrency);
</script>
</body>
</html>
@@ -12,6 +12,9 @@ var worker = createWorker();
worker.postMessage("eval typeof navigator");
worker.postMessage("eval navigator");

// NavigatorConcurrentHardware
worker.postMessage("eval navigator.hardwareConcurrency >= 1 && navigator.hardwareConcurrency <= 8");

// NavigatorID
worker.postMessage("eval navigator.appCodeName === 'Mozilla'");
worker.postMessage("eval navigator.appName === 'Netscape'");
@@ -2,6 +2,7 @@ Test Navigator properties.

typeof navigator: object
navigator: [object WorkerNavigator]
navigator.hardwareConcurrency >= 1 && navigator.hardwareConcurrency <= 8: true
navigator.appCodeName === 'Mozilla': true
navigator.appName === 'Netscape': true
navigator.appVersion.indexOf('WebKit') != 0: true
@@ -1,3 +1,15 @@
2021-12-06 Tadeu Zagallo <tzagallo@apple.com>

Restore navigator.hardwareConcurrency
https://bugs.webkit.org/show_bug.cgi?id=233381
<rdar://85023911>

Reviewed by Saam Barati.

* web-platform-tests/html/dom/idlharness.https-expected.txt:
* web-platform-tests/html/dom/idlharness.worker-expected.txt:
* web-platform-tests/workers/WorkerNavigator-hardware-concurrency.any.worker-expected.txt:

2021-12-03 Sergio Villar Senin <svillar@igalia.com>

[css-flexbox] WPT import. December 2021 edition
@@ -4617,7 +4617,7 @@ PASS Navigator interface: attribute cookieEnabled
PASS Navigator interface: attribute plugins
PASS Navigator interface: attribute mimeTypes
PASS Navigator interface: operation javaEnabled()
FAIL Navigator interface: attribute hardwareConcurrency assert_true: The prototype object must have a property "hardwareConcurrency" expected true got false
PASS Navigator interface: attribute hardwareConcurrency
PASS Navigator must be primary interface of window.navigator
PASS Stringification of window.navigator
PASS Navigator interface: window.navigator must inherit property "appCodeName" with the proper type
@@ -4642,7 +4642,7 @@ PASS Navigator interface: window.navigator must inherit property "cookieEnabled"
PASS Navigator interface: window.navigator must inherit property "plugins" with the proper type
PASS Navigator interface: window.navigator must inherit property "mimeTypes" with the proper type
PASS Navigator interface: window.navigator must inherit property "javaEnabled()" with the proper type
FAIL Navigator interface: window.navigator must inherit property "hardwareConcurrency" with the proper type assert_inherits: property "hardwareConcurrency" not found in prototype chain
PASS Navigator interface: window.navigator must inherit property "hardwareConcurrency" with the proper type
PASS PluginArray interface: existence and properties of interface object
PASS PluginArray interface object length
PASS PluginArray interface object name
@@ -761,7 +761,7 @@ PASS WorkerNavigator interface: member oscpu
PASS WorkerNavigator interface: attribute language
PASS WorkerNavigator interface: attribute languages
PASS WorkerNavigator interface: attribute onLine
FAIL WorkerNavigator interface: attribute hardwareConcurrency assert_true: The prototype object must have a property "hardwareConcurrency" expected true got false
PASS WorkerNavigator interface: attribute hardwareConcurrency
PASS WorkerNavigator must be primary interface of self.navigator
PASS Stringification of self.navigator
PASS WorkerNavigator interface: self.navigator must inherit property "appCodeName" with the proper type
@@ -778,7 +778,7 @@ PASS WorkerNavigator interface: self.navigator must not have property "oscpu"
PASS WorkerNavigator interface: self.navigator must inherit property "language" with the proper type
PASS WorkerNavigator interface: self.navigator must inherit property "languages" with the proper type
PASS WorkerNavigator interface: self.navigator must inherit property "onLine" with the proper type
FAIL WorkerNavigator interface: self.navigator must inherit property "hardwareConcurrency" with the proper type assert_inherits: property "hardwareConcurrency" not found in prototype chain
PASS WorkerNavigator interface: self.navigator must inherit property "hardwareConcurrency" with the proper type
PASS WorkerLocation interface: existence and properties of interface object
PASS WorkerLocation interface object length
PASS WorkerLocation interface object name
@@ -1,3 +1,3 @@

FAIL Test worker navigator hardware concurrency. assert_true: expected true got false
PASS Test worker navigator hardware concurrency.

@@ -761,7 +761,7 @@ PASS WorkerNavigator interface: member oscpu
PASS WorkerNavigator interface: attribute language
PASS WorkerNavigator interface: attribute languages
PASS WorkerNavigator interface: attribute onLine
FAIL WorkerNavigator interface: attribute hardwareConcurrency assert_true: The prototype object must have a property "hardwareConcurrency" expected true got false
PASS WorkerNavigator interface: attribute hardwareConcurrency
PASS WorkerNavigator must be primary interface of self.navigator
PASS Stringification of self.navigator
PASS WorkerNavigator interface: self.navigator must inherit property "appCodeName" with the proper type
@@ -778,7 +778,7 @@ PASS WorkerNavigator interface: self.navigator must not have property "oscpu"
PASS WorkerNavigator interface: self.navigator must inherit property "language" with the proper type
PASS WorkerNavigator interface: self.navigator must inherit property "languages" with the proper type
PASS WorkerNavigator interface: self.navigator must inherit property "onLine" with the proper type
FAIL WorkerNavigator interface: self.navigator must inherit property "hardwareConcurrency" with the proper type assert_inherits: property "hardwareConcurrency" not found in prototype chain
PASS WorkerNavigator interface: self.navigator must inherit property "hardwareConcurrency" with the proper type
PASS WorkerLocation interface: existence and properties of interface object
PASS WorkerLocation interface object length
PASS WorkerLocation interface object name
@@ -7,6 +7,7 @@ navigator.clipboard is OK
navigator.contacts is OK
navigator.cookieEnabled is OK
navigator.getStorageUpdates() is OK
navigator.hardwareConcurrency is OK
navigator.javaEnabled() is OK
navigator.language is OK
navigator.languages is OK
@@ -36,6 +37,7 @@ navigator.clipboard is OK
navigator.contacts is OK
navigator.cookieEnabled is OK
navigator.getStorageUpdates() is OK
navigator.hardwareConcurrency is OK
navigator.javaEnabled() is OK
navigator.language is OK
navigator.languages is OK
@@ -4839,7 +4839,7 @@ PASS Navigator interface: attribute plugins
PASS Navigator interface: attribute mimeTypes
PASS Navigator interface: operation javaEnabled()
FAIL Navigator interface: attribute pdfViewerEnabled assert_true: The prototype object must have a property "pdfViewerEnabled" expected true got false
FAIL Navigator interface: attribute hardwareConcurrency assert_true: The prototype object must have a property "hardwareConcurrency" expected true got false
PASS Navigator interface: attribute hardwareConcurrency
PASS Navigator must be primary interface of window.navigator
PASS Stringification of window.navigator
PASS Navigator interface: window.navigator must inherit property "appCodeName" with the proper type
@@ -4865,7 +4865,7 @@ PASS Navigator interface: window.navigator must inherit property "plugins" with
PASS Navigator interface: window.navigator must inherit property "mimeTypes" with the proper type
PASS Navigator interface: window.navigator must inherit property "javaEnabled()" with the proper type
FAIL Navigator interface: window.navigator must inherit property "pdfViewerEnabled" with the proper type assert_inherits: property "pdfViewerEnabled" not found in prototype chain
FAIL Navigator interface: window.navigator must inherit property "hardwareConcurrency" with the proper type assert_inherits: property "hardwareConcurrency" not found in prototype chain
PASS Navigator interface: window.navigator must inherit property "hardwareConcurrency" with the proper type
PASS PluginArray interface: existence and properties of interface object
PASS PluginArray interface object length
PASS PluginArray interface object name
@@ -4795,7 +4795,7 @@ PASS Navigator interface: attribute cookieEnabled
PASS Navigator interface: attribute plugins
PASS Navigator interface: attribute mimeTypes
PASS Navigator interface: operation javaEnabled()
FAIL Navigator interface: attribute hardwareConcurrency assert_true: The prototype object must have a property "hardwareConcurrency" expected true got false
PASS Navigator interface: attribute hardwareConcurrency
PASS Navigator must be primary interface of window.navigator
PASS Stringification of window.navigator
PASS Navigator interface: window.navigator must inherit property "appCodeName" with the proper type
@@ -4820,7 +4820,7 @@ PASS Navigator interface: window.navigator must inherit property "cookieEnabled"
PASS Navigator interface: window.navigator must inherit property "plugins" with the proper type
PASS Navigator interface: window.navigator must inherit property "mimeTypes" with the proper type
PASS Navigator interface: window.navigator must inherit property "javaEnabled()" with the proper type
FAIL Navigator interface: window.navigator must inherit property "hardwareConcurrency" with the proper type assert_inherits: property "hardwareConcurrency" not found in prototype chain
PASS Navigator interface: window.navigator must inherit property "hardwareConcurrency" with the proper type
PASS ImageBitmap interface: existence and properties of interface object
PASS ImageBitmap interface object length
PASS ImageBitmap interface object name
@@ -4805,7 +4805,7 @@ PASS Navigator interface: attribute cookieEnabled
PASS Navigator interface: attribute plugins
PASS Navigator interface: attribute mimeTypes
PASS Navigator interface: operation javaEnabled()
FAIL Navigator interface: attribute hardwareConcurrency assert_true: The prototype object must have a property "hardwareConcurrency" expected true got false
PASS Navigator interface: attribute hardwareConcurrency
PASS Navigator must be primary interface of window.navigator
PASS Stringification of window.navigator
PASS Navigator interface: window.navigator must inherit property "appCodeName" with the proper type
@@ -4830,7 +4830,7 @@ PASS Navigator interface: window.navigator must inherit property "cookieEnabled"
PASS Navigator interface: window.navigator must inherit property "plugins" with the proper type
PASS Navigator interface: window.navigator must inherit property "mimeTypes" with the proper type
PASS Navigator interface: window.navigator must inherit property "javaEnabled()" with the proper type
FAIL Navigator interface: window.navigator must inherit property "hardwareConcurrency" with the proper type assert_inherits: property "hardwareConcurrency" not found in prototype chain
PASS Navigator interface: window.navigator must inherit property "hardwareConcurrency" with the proper type
PASS ImageBitmap interface: existence and properties of interface object
PASS ImageBitmap interface object length
PASS ImageBitmap interface object name
@@ -5,6 +5,7 @@ navigator.appName is OK
navigator.appVersion is OK
navigator.cookieEnabled is OK
navigator.getStorageUpdates() is OK
navigator.hardwareConcurrency is OK
navigator.javaEnabled() is OK
navigator.language is OK
navigator.languages is OK
@@ -31,6 +32,7 @@ navigator.appName is OK
navigator.appVersion is OK
navigator.cookieEnabled is OK
navigator.getStorageUpdates() is OK
navigator.hardwareConcurrency is OK
navigator.javaEnabled() is OK
navigator.language is OK
navigator.languages is OK
@@ -4839,7 +4839,7 @@ PASS Navigator interface: attribute plugins
PASS Navigator interface: attribute mimeTypes
PASS Navigator interface: operation javaEnabled()
FAIL Navigator interface: attribute pdfViewerEnabled assert_true: The prototype object must have a property "pdfViewerEnabled" expected true got false
FAIL Navigator interface: attribute hardwareConcurrency assert_true: The prototype object must have a property "hardwareConcurrency" expected true got false
PASS Navigator interface: attribute hardwareConcurrency
PASS Navigator must be primary interface of window.navigator
PASS Stringification of window.navigator
PASS Navigator interface: window.navigator must inherit property "appCodeName" with the proper type
@@ -4865,7 +4865,7 @@ PASS Navigator interface: window.navigator must inherit property "plugins" with
PASS Navigator interface: window.navigator must inherit property "mimeTypes" with the proper type
PASS Navigator interface: window.navigator must inherit property "javaEnabled()" with the proper type
FAIL Navigator interface: window.navigator must inherit property "pdfViewerEnabled" with the proper type assert_inherits: property "pdfViewerEnabled" not found in prototype chain
FAIL Navigator interface: window.navigator must inherit property "hardwareConcurrency" with the proper type assert_inherits: property "hardwareConcurrency" not found in prototype chain
PASS Navigator interface: window.navigator must inherit property "hardwareConcurrency" with the proper type
PASS PluginArray interface: existence and properties of interface object
PASS PluginArray interface object length
PASS PluginArray interface object name
@@ -9,6 +9,7 @@ navigator.contacts is OK
navigator.cookieEnabled is OK
navigator.credentials is OK
navigator.getStorageUpdates() is OK
navigator.hardwareConcurrency is OK
navigator.isLoggedIn() is OK
navigator.javaEnabled() is OK
navigator.language is OK
@@ -45,6 +46,7 @@ navigator.contacts is OK
navigator.cookieEnabled is OK
navigator.credentials is OK
navigator.getStorageUpdates() is OK
navigator.hardwareConcurrency is OK
navigator.isLoggedIn() is OK
navigator.javaEnabled() is OK
navigator.language is OK
@@ -4805,7 +4805,7 @@ PASS Navigator interface: attribute cookieEnabled
PASS Navigator interface: attribute plugins
PASS Navigator interface: attribute mimeTypes
PASS Navigator interface: operation javaEnabled()
FAIL Navigator interface: attribute hardwareConcurrency assert_true: The prototype object must have a property "hardwareConcurrency" expected true got false
PASS Navigator interface: attribute hardwareConcurrency
PASS Navigator must be primary interface of window.navigator
PASS Stringification of window.navigator
PASS Navigator interface: window.navigator must inherit property "appCodeName" with the proper type
@@ -4830,7 +4830,7 @@ PASS Navigator interface: window.navigator must inherit property "cookieEnabled"
PASS Navigator interface: window.navigator must inherit property "plugins" with the proper type
PASS Navigator interface: window.navigator must inherit property "mimeTypes" with the proper type
PASS Navigator interface: window.navigator must inherit property "javaEnabled()" with the proper type
FAIL Navigator interface: window.navigator must inherit property "hardwareConcurrency" with the proper type assert_inherits: property "hardwareConcurrency" not found in prototype chain
PASS Navigator interface: window.navigator must inherit property "hardwareConcurrency" with the proper type
PASS ImageBitmap interface: existence and properties of interface object
PASS ImageBitmap interface object length
PASS ImageBitmap interface object name
@@ -9,6 +9,7 @@ navigator.contacts is OK
navigator.cookieEnabled is OK
navigator.credentials is OK
navigator.getStorageUpdates() is OK
navigator.hardwareConcurrency is OK
navigator.javaEnabled() is OK
navigator.language is OK
navigator.languages is OK
@@ -35,6 +36,7 @@ navigator.contacts is OK
navigator.cookieEnabled is OK
navigator.credentials is OK
navigator.getStorageUpdates() is OK
navigator.hardwareConcurrency is OK
navigator.javaEnabled() is OK
navigator.language is OK
navigator.languages is OK
@@ -9,6 +9,7 @@ navigator.contacts is OK
navigator.cookieEnabled is OK
navigator.credentials is OK
navigator.getStorageUpdates() is OK
navigator.hardwareConcurrency is OK
navigator.javaEnabled() is OK
navigator.language is OK
navigator.languages is OK
@@ -31,6 +32,7 @@ navigator.contacts is OK
navigator.cookieEnabled is OK
navigator.credentials is OK
navigator.getStorageUpdates() is OK
navigator.hardwareConcurrency is OK
navigator.javaEnabled() is OK
navigator.language is OK
navigator.languages is OK
@@ -7,6 +7,7 @@ navigator.clipboard is OK
navigator.contacts is OK
navigator.cookieEnabled is OK
navigator.getStorageUpdates() is OK
navigator.hardwareConcurrency is OK
navigator.javaEnabled() is OK
navigator.language is OK
navigator.languages is OK
@@ -27,6 +28,7 @@ navigator.clipboard is OK
navigator.contacts is OK
navigator.cookieEnabled is OK
navigator.getStorageUpdates() is OK
navigator.hardwareConcurrency is OK
navigator.javaEnabled() is OK
navigator.language is OK
navigator.languages is OK

0 comments on commit f146f8a

Please sign in to comment.