diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 17:32:43 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 17:32:43 +0000 |
commit | 6bf0a5cb5034a7e684dcc3500e841785237ce2dd (patch) | |
tree | a68f146d7fa01f0134297619fbe7e33db084e0aa /devtools/client/inspector/rules/test/browser_rules_edit-property_10.js | |
parent | Initial commit. (diff) | |
download | thunderbird-6bf0a5cb5034a7e684dcc3500e841785237ce2dd.tar.xz thunderbird-6bf0a5cb5034a7e684dcc3500e841785237ce2dd.zip |
Adding upstream version 1:115.7.0.upstream/1%115.7.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | devtools/client/inspector/rules/test/browser_rules_edit-property_10.js | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/devtools/client/inspector/rules/test/browser_rules_edit-property_10.js b/devtools/client/inspector/rules/test/browser_rules_edit-property_10.js new file mode 100644 index 0000000000..3db2164b0c --- /dev/null +++ b/devtools/client/inspector/rules/test/browser_rules_edit-property_10.js @@ -0,0 +1,51 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +const TEST_URI = ` + <style> + div { + color: red; + width: 10; /* This document is in quirks mode so this value should be valid */ + } + </style> + <div></div> +`; + +// Test that CSS property names are case insensitive when validating, and that +// quirks mode is accounted for when validating. +add_task(async function () { + await addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI)); + const { inspector, view: ruleView } = await openRuleView(); + + await selectNode("div", inspector); + let prop = getTextProperty(ruleView, 1, { color: "red" }); + + let onRuleViewChanged; + + info(`Rename the CSS property name to "Color"`); + onRuleViewChanged = ruleView.once("ruleview-changed"); + await renameProperty(ruleView, prop, "Color"); + info("Wait for Rule view to update"); + await onRuleViewChanged; + + is(prop.overridden, false, "Titlecase property is not overriden"); + is(prop.enabled, true, "Titlecase property is enabled"); + is(prop.isNameValid(), true, "Titlecase property is valid"); + + info(`Rename the CSS property name to "COLOR"`); + onRuleViewChanged = ruleView.once("ruleview-changed"); + await renameProperty(ruleView, prop, "COLOR"); + info("Wait for Rule view to update"); + await onRuleViewChanged; + + is(prop.overridden, false, "Uppercase property is not overriden"); + is(prop.enabled, true, "Uppercase property is enabled"); + is(prop.isNameValid(), true, "Uppercase property is valid"); + + info(`Checking width validity`); + prop = getTextProperty(ruleView, 1, { width: "10" }); + is(prop.isNameValid(), true, "width is a valid property"); + is(prop.isValid(), true, "10 is a valid property value in quirks mode"); +}); |