Files
firefox/testing/web-platform/tests/css/cssom/CSS-namespace-object-class-string.html
T
Philip Jägenstedt e47af353cf Bug 1734572 [wpt PR 31148] - Update URLs to Web IDL, a=testonly
Automatic update from web-platform-tests
Update URLs to Web IDL

Only two instances of "heycam.github.io" remain now.

interfaces/WebIDL.idl will be updated when webref is updated next time,
as it has already been fixed there:
https://github.com/w3c/webref/commit/7c04f47557121d2f7ad5203bc3254c62a44e182f

resources/webidl2/lib/webidl2.js is third-party code and will be updated
at some point in the future.

--

wpt-commits: 9a88dfd5bf623a8cb326c154b27f1e3494e11022
wpt-pr: 31148
2021-10-14 04:45:19 +00:00

48 lines
2.0 KiB
HTML

<!doctype html>
<meta charset="utf-8">
<title>CSSOM - Symbol.toStringTag value of CSS namespace object</title>
<link rel="help" href="https://webidl.spec.whatwg.org/#es-namespaces">
<link rel="help" href="https://drafts.csswg.org/cssom/#namespacedef-css">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
"use strict";
test(() => {
assert_own_property(CSS, Symbol.toStringTag);
const propDesc = Object.getOwnPropertyDescriptor(CSS, Symbol.toStringTag);
assert_equals(propDesc.value, "CSS", "value");
assert_equals(propDesc.writable, false, "writable");
assert_equals(propDesc.enumerable, false, "enumerable");
assert_equals(propDesc.configurable, true, "configurable");
}, "@@toStringTag exists on the namespace object with the appropriate descriptor");
test(() => {
assert_equals(CSS.toString(), "[object CSS]");
assert_equals(Object.prototype.toString.call(CSS), "[object CSS]");
}, "Object.prototype.toString applied to the namespace object");
test(t => {
assert_own_property(CSS, Symbol.toStringTag, "Precondition: @@toStringTag on the namespace object");
t.add_cleanup(() => {
Object.defineProperty(CSS, Symbol.toStringTag, { value: "CSS" });
});
Object.defineProperty(CSS, Symbol.toStringTag, { value: "Test" });
assert_equals(CSS.toString(), "[object Test]");
assert_equals(Object.prototype.toString.call(CSS), "[object Test]");
}, "Object.prototype.toString applied after modifying the namespace object's @@toStringTag");
test(t => {
assert_own_property(CSS, Symbol.toStringTag, "Precondition: @@toStringTag on the namespace object");
t.add_cleanup(() => {
Object.defineProperty(CSS, Symbol.toStringTag, { value: "CSS" });
});
assert_true(delete CSS[Symbol.toStringTag]);
assert_equals(CSS.toString(), "[object Object]");
assert_equals(Object.prototype.toString.call(CSS), "[object Object]");
}, "Object.prototype.toString applied after deleting @@toStringTag");
</script>