зеркало из https://github.com/mozilla/gecko-dev.git
Bug 896050 followup: fix some nits in the filter animation mochitest code. (test-only, no review)
This commit is contained in:
Родитель
10ac32e77a
Коммит
9cd2fb6d36
|
@ -1146,18 +1146,21 @@ function test_border_color_transition(prop) {
|
||||||
div.style.removeProperty("color");
|
div.style.removeProperty("color");
|
||||||
}
|
}
|
||||||
|
|
||||||
function filter_function_list_equals(string, expectedList)
|
function filter_function_list_equals(computedValStr, expectedList)
|
||||||
{
|
{
|
||||||
// Check simple case "none"
|
// Check simple case "none"
|
||||||
if (string == "none" && string == expectedList[0]) {
|
if (computedValStr == "none" && computedValStr == expectedList[0]) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// The regular expression does not filter out the last parenthesis.
|
// The regular expression does not filter out the last parenthesis.
|
||||||
// Remove last character for now.
|
// Remove last character for now.
|
||||||
is(string.substring(string.length - 1, string.length), ')', "Check if last character is close-paren.")
|
is(computedValStr.substring(computedValStr.length - 1, computedValStr.length),
|
||||||
string = string.substring(0, string.length - 1);
|
')', "Check if last character is close-paren");
|
||||||
|
computedValStr = computedValStr.substring(0, computedValStr.length - 1);
|
||||||
|
|
||||||
var reg = /\)*\s*(blur|brightness|contrast|grayscale|hue\-rotate|invert|opacity|saturate|sepia|drop\-shadow|url)\(/
|
var reg = /\)*\s*(blur|brightness|contrast|grayscale|hue\-rotate|invert|opacity|saturate|sepia|drop\-shadow|url)\(/
|
||||||
var matches = string.split(reg);
|
var matches = computedValStr.split(reg);
|
||||||
// First item must be empty. All other items are of functionName, functionValue.
|
// First item must be empty. All other items are of functionName, functionValue.
|
||||||
if (!matches || matches.shift() != "") {
|
if (!matches || matches.shift() != "") {
|
||||||
ok(false, "computed style of 'filter' isn't in the format we expect");
|
ok(false, "computed style of 'filter' isn't in the format we expect");
|
||||||
|
|
Загрузка…
Ссылка в новой задаче