Bug 1534674: Add a test for pseudo element which defines CSS variable. r=gl

Differential Revision: https://phabricator.services.mozilla.com/D38303

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Daisuke Akatsuka 2019-07-30 08:00:57 +00:00
Родитель bfa5925f04
Коммит 627b67599a
3 изменённых файлов: 93 добавлений и 0 удалений

Просмотреть файл

@ -106,6 +106,8 @@ skip-if = (verify && !debug && os == 'win')
[browser_rules_completion-popup-hidden-after-navigation.js]
[browser_rules_content_01.js]
[browser_rules_content_02.js]
[browser_rules_variables-in-pseudo-element_01.js]
[browser_rules_variables-in-pseudo-element_02.js]
[browser_rules_variables_01.js]
[browser_rules_variables_02.js]
skip-if = e10s && debug # Bug 1250058 - Docshell leak on debug e10s

Просмотреть файл

@ -0,0 +1,46 @@
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Test for pseudo element which defines CSS variable.
const TEST_URI = `
<style type='text/css'>
div::before {
color: var(--color);
--color: orange;
}
div {
color: var(--color);
--color: lime;
}
</style>
<div></div>
`;
add_task(async function() {
await addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
const { inspector, view } = await openRuleView();
await selectNode("div", inspector);
info("Test the CSS variable which normal element is referring to");
checkCSSVariableOutput(
view,
"div",
"color",
"ruleview-variable",
"--color = lime"
);
info("Test the CSS variable which pseudo element is referring to");
checkCSSVariableOutput(
view,
"div::before",
"color",
"ruleview-variable",
"--color = orange"
);
});

Просмотреть файл

@ -0,0 +1,45 @@
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Test for pseudo element which inherits CSS variable.
const TEST_URI = `
<style type='text/css'>
div::before {
color: var(--color);
}
div {
color: var(--color);
--color: lime;
}
</style>
<div></div>
`;
add_task(async function() {
await addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
const { inspector, view } = await openRuleView();
await selectNode("div", inspector);
info("Test the CSS variable which normal element is referring to");
checkCSSVariableOutput(
view,
"div",
"color",
"ruleview-variable",
"--color = lime"
);
info("Test the CSS variable which pseudo element is referring to");
checkCSSVariableOutput(
view,
"div::before",
"color",
"ruleview-variable",
"--color = lime"
);
});