зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1808995 - Fix WPT testcases that do not properly account for counter-style fallback behavior of prefix/suffix descriptors. r=emilio
Per spec, "If a counter style is used to represent a counter value outside of its ranges, the counter style instead drops down to its fallback counter style." https://www.w3.org/TR/css-counter-styles-3/#counter-style-range https://www.w3.org/TR/css-counter-styles-3/#counter-style-fallback Some existing tests incorrectly assumed that a prefix or suffix from a custom rule will still apply even when the counter value is not in range. That would mean "fallback" is only partial, using the symbols/system from the fallback style mixed with the prefix/suffix of the originally-specified style, which prevents use-cases like that in bug 1808995 working as expected. Differential Revision: https://phabricator.services.mozilla.com/D167410
This commit is contained in:
Родитель
1cad3c6c0a
Коммит
740935bf3f
|
@ -1,12 +1,12 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="UTF-8">
|
||||
<title>CSS Reference: symbols function, invalid</title>
|
||||
<title>CSS Reference: descriptor prefix</title>
|
||||
<link rel="author" title="Xidorn Quan" href="https://www.upsuper.org/">
|
||||
<link rel="stylesheet" href="support/ref-common.css">
|
||||
<!-- ol -->
|
||||
<div>Appendix -2. </div>
|
||||
<div>Appendix -1. </div>
|
||||
<div>Appendix 0. </div>
|
||||
<div>-2. </div>
|
||||
<div>-1. </div>
|
||||
<div>0. </div>
|
||||
<div>Appendix I. </div>
|
||||
<div>Appendix II. </div>
|
||||
<!-- section -->
|
||||
|
|
|
@ -7,6 +7,8 @@
|
|||
<link rel="stylesheet" href="support/test-common.css">
|
||||
<style type="text/css">
|
||||
@counter-style a {
|
||||
/* Note that upper-roman has a range of (1, 3999), so negative or zero values
|
||||
will use the fallback style. */
|
||||
system: extends upper-roman;
|
||||
prefix: "Appendix ";
|
||||
}
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="UTF-8">
|
||||
<title>CSS Reference: symbols function, invalid</title>
|
||||
<title>CSS Reference: system additive</title>
|
||||
<link rel="author" title="Xidorn Quan" href="https://www.upsuper.org/">
|
||||
<link rel="stylesheet" href="support/ref-common.css">
|
||||
<!-- list-style-type: a -->
|
||||
<div>-2</div>
|
||||
<div>-1</div>
|
||||
<div>0</div>
|
||||
<div>-2. </div>
|
||||
<div>-1. </div>
|
||||
<div>0. </div>
|
||||
<div>⚀</div>
|
||||
<div>⚁</div>
|
||||
<div>⚂</div>
|
||||
|
@ -22,8 +22,8 @@
|
|||
document.write(Array(61).join('⚅'));
|
||||
</script></div>
|
||||
<!-- list-style-type: b -->
|
||||
<div>-2</div>
|
||||
<div>-1</div>
|
||||
<div>-2. </div>
|
||||
<div>-1. </div>
|
||||
<div>☷</div>
|
||||
<div>☶</div>
|
||||
<div>☵</div>
|
||||
|
|
|
@ -7,11 +7,13 @@
|
|||
<link rel="stylesheet" href="support/test-common.css">
|
||||
<style type="text/css">
|
||||
@counter-style a {
|
||||
/* Negative and zero values cannot be represented, and will use fallback style (decimal). */
|
||||
system: additive;
|
||||
additive-symbols: 6 \2685, 5 \2684, 4 \2683, 3 \2682, 2 \2681, 1 \2680;
|
||||
suffix: "";
|
||||
}
|
||||
@counter-style b {
|
||||
/* Negative values cannot be represented, and will use fallback style (decimal). */
|
||||
system: additive;
|
||||
additive-symbols: 7 \2630, 6 \2631, 5 \2632, 4 \2633, 3 \2634, 2 \2635, 1 \2636, 0 \2637;
|
||||
suffix: "";
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
<title>CSS Reference: symbols function, invalid</title>
|
||||
<link rel="author" title="Xidorn Quan" href="https://www.upsuper.org/">
|
||||
<link rel="stylesheet" href="support/ref-common.css">
|
||||
<div>-2</div>
|
||||
<div>-1</div>
|
||||
<div>0</div>
|
||||
<div>-2. </div>
|
||||
<div>-1. </div>
|
||||
<div>0. </div>
|
||||
<div>⚪</div>
|
||||
<div>⚫</div>
|
||||
<div>⚪⚪</div>
|
||||
|
|
|
@ -7,6 +7,8 @@
|
|||
<link rel="stylesheet" href="support/test-common.css">
|
||||
<style type="text/css">
|
||||
@counter-style a {
|
||||
/* alphabetic has a range that starts from 1, so negative/zero values will
|
||||
fall back to decimal */
|
||||
system: alphabetic;
|
||||
symbols: \26AA \26AB;
|
||||
suffix: '';
|
||||
|
|
|
@ -4,24 +4,24 @@
|
|||
<link rel="author" title="Xidorn Quan" href="https://www.upsuper.org/">
|
||||
<link rel="stylesheet" href="support/ref-common.css">
|
||||
<!-- list-style-type: a -->
|
||||
<div>Chapter -2. </div>
|
||||
<div>Chapter -1. </div>
|
||||
<div>Chapter 0. </div>
|
||||
<div>-2. </div>
|
||||
<div>-1. </div>
|
||||
<div>0. </div>
|
||||
<div>Chapter I. </div>
|
||||
<div>Chapter II. </div>
|
||||
<div>Chapter III. </div>
|
||||
<div>Chapter IV. </div>
|
||||
<div>Chapter V. </div>
|
||||
<div>Chapter 6. </div>
|
||||
<div>Chapter 7. </div>
|
||||
<div>6. </div>
|
||||
<div>7. </div>
|
||||
<!-- list-style-type: b -->
|
||||
<div>Section -2. </div>
|
||||
<div>Section -1. </div>
|
||||
<div>Section 0. </div>
|
||||
<div>-2. </div>
|
||||
<div>-1. </div>
|
||||
<div>0. </div>
|
||||
<div>Section I. </div>
|
||||
<div>Section II. </div>
|
||||
<div>Section III. </div>
|
||||
<div>Section IV. </div>
|
||||
<div>Section V. </div>
|
||||
<div>Section VI. </div>
|
||||
<div>Section 7. </div>
|
||||
<div>7. </div>
|
||||
|
|
|
@ -7,11 +7,13 @@
|
|||
<link rel="stylesheet" href="support/test-common.css">
|
||||
<style type="text/css">
|
||||
@counter-style a {
|
||||
/* Values outside the range will fall back to decimal (and hence have no prefix) */
|
||||
system: extends upper-roman;
|
||||
prefix: "Chapter ";
|
||||
range: 1 5;
|
||||
}
|
||||
@counter-style b {
|
||||
/* Values outside the range will fall back to decimal (and hence have no prefix) */
|
||||
system: extends a;
|
||||
prefix: "Section ";
|
||||
range: 1 6;
|
||||
|
|
|
@ -4,9 +4,9 @@
|
|||
<link rel="author" title="Xidorn Quan" href="https://www.upsuper.org/">
|
||||
<link rel="stylesheet" href="support/ref-common.css">
|
||||
<!-- list-style-type: a -->
|
||||
<div>-2</div>
|
||||
<div>-1</div>
|
||||
<div>0</div>
|
||||
<div>-2. </div>
|
||||
<div>-1. </div>
|
||||
<div>0. </div>
|
||||
<div>*</div>
|
||||
<div>⁑</div>
|
||||
<div>†</div>
|
||||
|
|
|
@ -8,6 +8,8 @@
|
|||
<style type="text/css">
|
||||
@counter-style a {
|
||||
/* system: symbolic; */
|
||||
/* symbolic does not support negative or zero values, so they will fall back
|
||||
to decimal */
|
||||
symbols: '*' \2051 \2020 \2021;
|
||||
suffix: '';
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче