Bug 1508028 - Change stroke-miterlimit restriction from GreaterThanOrEqualToOneNumber to NonNegativeNumber. r=longsonr,emilio

This commit is contained in:
violet 2019-03-09 13:05:56 +00:00
Родитель b0db7d94fa
Коммит 7d525e84a8
6 изменённых файлов: 15 добавлений и 26 удалений

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

@ -5594,8 +5594,8 @@ var gCSSProperties = {
inherited: true,
type: CSS_TYPE_LONGHAND,
initial_values: [ "4" ],
other_values: [ "1", "7", "5000", "1.1" ],
invalid_values: [ "0.9", "0", "-1", "3px", "-0.3" ]
other_values: [ "0", "0.9", "1", "7", "5000", "1.1" ],
invalid_values: [ "-1", "3px", "-0.3" ]
},
"stroke-opacity": {
domProp: "strokeOpacity",

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

@ -263,8 +263,9 @@ var supported_properties = {
"stroke-dasharray": [ test_dasharray_transition ],
"stroke-dashoffset": [ test_length_transition, test_percent_transition,
test_length_unclamped, test_percent_unclamped, ],
"stroke-miterlimit": [ test_float_aboveOne_transition,
test_float_aboveOne_clamped ],
"stroke-miterlimit": [ test_float_zeroToOne_transition,
test_float_aboveOne_transition,
test_float_aboveZero_clamped ],
"stroke-opacity" : [ test_float_zeroToOne_transition,
// opacity is clamped in computed style
// (not parsing/interpolation)
@ -1350,7 +1351,7 @@ function test_float_zeroToOne_clamped_or_unclamped(prop, is_clamped) {
div.style.setProperty("transition-timing-function", "linear", "");
}
// Test using float values in the range [1, infinity) (e.g. stroke-miterlimit)
// Test using float values in the range [1, infinity)
function test_float_aboveOne_transition(prop) {
div.style.setProperty("transition-property", "none", "");
div.style.setProperty(prop, "1", "");
@ -1363,15 +1364,15 @@ function test_float_aboveOne_transition(prop) {
check_distance(prop, "1", "1.275", "2.1");
}
function test_float_aboveOne_clamped(prop) {
function test_float_aboveZero_clamped(prop) {
div.style.setProperty("transition-timing-function", FUNC_NEGATIVE, "");
div.style.setProperty("transition-property", "none", "");
div.style.setProperty(prop, "1", "");
is(cs.getPropertyValue(prop), "1",
div.style.setProperty(prop, "0", "");
is(cs.getPropertyValue(prop), "0",
"float-valued property " + prop + ": flush before clamping test");
div.style.setProperty("transition-property", prop, "");
div.style.setProperty(prop, "5", "");
is(cs.getPropertyValue(prop), "1",
is(cs.getPropertyValue(prop), "0",
"float-valued property " + prop + ": clamping of negatives");
div.style.setProperty("transition-timing-function", "linear", "");
}

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

@ -1295,6 +1295,8 @@ gfxRect nsSVGUtils::PathExtentsToMaxStrokeExtents(const gfxRect& aPathExtents,
// The stroke can extend even further for paths that can be affected by
// stroke-miterlimit.
// We only need to do this if the limit is greater than 1, but it's probably
// not worth optimizing for that.
bool affectedByMiterlimit = aFrame->GetContent()->IsAnyOfSVGElements(
nsGkAtoms::path, nsGkAtoms::polyline, nsGkAtoms::polygon);

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

@ -110,11 +110,11 @@ ${helpers.single_keyword(
${helpers.predefined_type(
"stroke-miterlimit",
"GreaterThanOrEqualToOneNumber",
"NonNegativeNumber",
"From::from(4.0)",
products="gecko",
animation_value_type="crate::values::computed::GreaterThanOrEqualToOneNumber",
spec="https://www.w3.org/TR/SVG11/painting.html#StrokeMiterlimitProperty",
animation_value_type="crate::values::computed::NonNegativeNumber",
spec="https://www.w3.org/TR/SVG2/painting.html#StrokeMiterlimitProperty",
)}
${helpers.predefined_type(

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

@ -1,7 +0,0 @@
[stroke-miterlimit-computed.svg]
[Property stroke-miterlimit value '0.5' computes to '0.5']
expected: FAIL
[Property stroke-miterlimit value '0' computes to '0']
expected: FAIL

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

@ -1,7 +0,0 @@
[stroke-miterlimit-valid.svg]
[e.style['stroke-miterlimit'\] = "0.5" should set the property value]
expected: FAIL
[e.style['stroke-miterlimit'\] = "0" should set the property value]
expected: FAIL