зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1462829: Test {background,mask}-{size,position} clamping. r=hiro
These properties no longer use calc() as an intermediate value as long as the types of the values match. But they don't resolve percentages to pixels in getComputedStyle as transform-origin and perspective-origin. MozReview-Commit-ID: 1CtN10ctGPF
This commit is contained in:
Родитель
716d561add
Коммит
c881bfab77
|
@ -87,29 +87,17 @@ var supported_properties = {
|
||||||
"background-color": [ test_color_transition,
|
"background-color": [ test_color_transition,
|
||||||
test_true_currentcolor_transition ],
|
test_true_currentcolor_transition ],
|
||||||
"background-position": [ test_background_position_transition,
|
"background-position": [ test_background_position_transition,
|
||||||
// FIXME: We don't currently test clamping,
|
test_length_percent_pair_unclamped ],
|
||||||
// since background-position uses calc() as
|
|
||||||
// an intermediate form.
|
|
||||||
/* test_length_percent_pair_unclamped */ ],
|
|
||||||
"background-position-x": [ test_background_position_coord_transition,
|
"background-position-x": [ test_background_position_coord_transition,
|
||||||
test_length_transition,
|
test_length_transition,
|
||||||
test_percent_transition,
|
test_percent_transition,
|
||||||
// FIXME: We don't currently test clamping,
|
test_length_percent_pair_unclamped ],
|
||||||
// since background-position-x uses calc() as
|
|
||||||
// an intermediate form.
|
|
||||||
/* test_length_percent_pair_unclamped */ ],
|
|
||||||
"background-position-y": [ test_background_position_coord_transition,
|
"background-position-y": [ test_background_position_coord_transition,
|
||||||
test_length_transition,
|
test_length_transition,
|
||||||
test_percent_transition,
|
test_percent_transition,
|
||||||
// FIXME: We don't currently test clamping,
|
test_length_percent_pair_unclamped ],
|
||||||
// since background-position-y uses calc() as
|
|
||||||
// an intermediate form.
|
|
||||||
/* test_length_percent_pair_unclamped */ ],
|
|
||||||
"background-size": [ test_background_size_transition,
|
"background-size": [ test_background_size_transition,
|
||||||
// FIXME: We don't currently test clamping,
|
test_length_percent_pair_clamped ],
|
||||||
// since background-size uses calc() as an
|
|
||||||
// intermediate form.
|
|
||||||
/* test_length_percent_pair_clamped */ ],
|
|
||||||
"border-bottom-color": [ test_color_transition,
|
"border-bottom-color": [ test_color_transition,
|
||||||
test_true_currentcolor_transition ],
|
test_true_currentcolor_transition ],
|
||||||
"border-bottom-width": [ test_length_transition,
|
"border-bottom-width": [ test_length_transition,
|
||||||
|
@ -195,29 +183,17 @@ var supported_properties = {
|
||||||
test_length_percent_calc_transition,
|
test_length_percent_calc_transition,
|
||||||
test_length_unclamped, test_percent_unclamped ],
|
test_length_unclamped, test_percent_unclamped ],
|
||||||
"mask-position": [ test_background_position_transition,
|
"mask-position": [ test_background_position_transition,
|
||||||
// FIXME: We don't currently test clamping,
|
test_length_percent_pair_unclamped ],
|
||||||
// since mask-position uses calc() as
|
|
||||||
// an intermediate form.
|
|
||||||
/* test_length_percent_pair_unclamped */ ],
|
|
||||||
"mask-position-x": [ test_background_position_coord_transition,
|
"mask-position-x": [ test_background_position_coord_transition,
|
||||||
test_length_transition,
|
test_length_transition,
|
||||||
test_percent_transition,
|
test_percent_transition,
|
||||||
// FIXME: We don't currently test clamping,
|
test_length_percent_pair_unclamped ],
|
||||||
// since background-position-x uses calc() as
|
|
||||||
// an intermediate form.
|
|
||||||
/* test_length_percent_pair_unclamped */ ],
|
|
||||||
"mask-position-y": [ test_background_position_coord_transition,
|
"mask-position-y": [ test_background_position_coord_transition,
|
||||||
test_length_transition,
|
test_length_transition,
|
||||||
test_percent_transition,
|
test_percent_transition,
|
||||||
// FIXME: We don't currently test clamping,
|
test_length_percent_pair_unclamped ],
|
||||||
// since background-position-y uses calc() as
|
|
||||||
// an intermediate form.
|
|
||||||
/* test_length_percent_pair_unclamped */ ],
|
|
||||||
"mask-size": [ test_background_size_transition,
|
"mask-size": [ test_background_size_transition,
|
||||||
// FIXME: We don't currently test clamping,
|
test_length_percent_pair_clamped ],
|
||||||
// since mask-size uses calc() as an
|
|
||||||
// intermediate form.
|
|
||||||
/* test_length_percent_pair_clamped */ ],
|
|
||||||
"max-height": [ test_length_transition, test_percent_transition,
|
"max-height": [ test_length_transition, test_percent_transition,
|
||||||
test_length_clamped, test_percent_clamped ],
|
test_length_clamped, test_percent_clamped ],
|
||||||
"max-width": [ test_length_transition, test_percent_transition,
|
"max-width": [ test_length_transition, test_percent_transition,
|
||||||
|
@ -2119,11 +2095,18 @@ function test_length_percent_pair_clamped_or_unclamped(prop, is_clamped) {
|
||||||
div.style.setProperty("transition-timing-function", FUNC_NEGATIVE, "");
|
div.style.setProperty("transition-timing-function", FUNC_NEGATIVE, "");
|
||||||
div.style.setProperty("transition-property", "none", "");
|
div.style.setProperty("transition-property", "none", "");
|
||||||
div.style.setProperty(prop, "0px 0%", "");
|
div.style.setProperty(prop, "0px 0%", "");
|
||||||
is(cs.getPropertyValue(prop), "0px 0px",
|
var is_zero = function(val) {
|
||||||
|
if (prop == "transform-origin" || prop == "perspective-origin") {
|
||||||
|
// These two properties resolve percentages to pixels.
|
||||||
|
return val == "0px 0px";
|
||||||
|
}
|
||||||
|
return val == "0px 0%";
|
||||||
|
}
|
||||||
|
ok(is_zero(cs.getPropertyValue(prop)),
|
||||||
"length+percent-valued property " + prop + ": flush before clamping test");
|
"length+percent-valued property " + prop + ": flush before clamping test");
|
||||||
div.style.setProperty("transition-property", prop, "");
|
div.style.setProperty("transition-property", prop, "");
|
||||||
div.style.setProperty(prop, "30px 25%", "");
|
div.style.setProperty(prop, "30px 25%", "");
|
||||||
(is_clamped ? is : isnot)(cs.getPropertyValue(prop), "0px 0px",
|
is(is_zero(cs.getPropertyValue(prop)), is_clamped,
|
||||||
"length+percent-valued property " + prop + ": clamping of negatives");
|
"length+percent-valued property " + prop + ": clamping of negatives");
|
||||||
div.style.setProperty("transition-timing-function", "linear", "");
|
div.style.setProperty("transition-timing-function", "linear", "");
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче