mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-23 21:01:08 +00:00
Bug 1830127 - Revert changeset 63b04ce7cf57 (bug 1808995) and remove associated WPT tests, because the behavior implemented there deviated from the Counter-Styles spec. r=emilio
Per https://github.com/w3c/csswg-drafts/issues/8619. Differential Revision: https://phabricator.services.mozilla.com/D177240
This commit is contained in:
parent
ddea586548
commit
b93fcb26d3
@ -206,11 +206,10 @@ void ContainStyleScopeManager::GetSpokenCounterText(nsIFrame* aFrame,
|
||||
aText.Append(' ');
|
||||
}
|
||||
} else {
|
||||
auto* resolvedStyle = counterStyle->ResolveFallbackFor(ordinal);
|
||||
resolvedStyle->GetPrefix(ordinal, aText);
|
||||
counterStyle->GetPrefix(aText);
|
||||
aText += text;
|
||||
nsAutoString suffix;
|
||||
resolvedStyle->GetSuffix(ordinal, suffix);
|
||||
counterStyle->GetSuffix(suffix);
|
||||
aText += suffix;
|
||||
}
|
||||
}
|
||||
|
@ -102,11 +102,9 @@ void nsCounterUseNode::GetText(WritingMode aWM, CounterStyle* aStyle,
|
||||
}
|
||||
};
|
||||
|
||||
CounterStyle* resolvedStyle = nullptr;
|
||||
if (mForLegacyBullet) {
|
||||
resolvedStyle = aStyle->ResolveFallbackFor(mValueAfter);
|
||||
nsAutoString prefix;
|
||||
resolvedStyle->GetPrefix(mValueAfter, prefix);
|
||||
aStyle->GetPrefix(prefix);
|
||||
aResult.Assign(prefix);
|
||||
}
|
||||
|
||||
@ -135,10 +133,8 @@ void nsCounterUseNode::GetText(WritingMode aWM, CounterStyle* aStyle,
|
||||
}
|
||||
|
||||
if (mForLegacyBullet) {
|
||||
// resolvedStyle was initialized above when we handled the prefix.
|
||||
MOZ_ASSERT(resolvedStyle);
|
||||
nsAutoString suffix;
|
||||
resolvedStyle->GetSuffix(mValueAfter, suffix);
|
||||
aStyle->GetSuffix(suffix);
|
||||
aResult.Append(suffix);
|
||||
}
|
||||
}
|
||||
|
@ -515,6 +515,8 @@ class BuiltinCounterStyle : public CounterStyle {
|
||||
|
||||
nsStaticAtom* GetStyleName() const { return mName; }
|
||||
|
||||
virtual void GetPrefix(nsAString& aResult) override;
|
||||
virtual void GetSuffix(nsAString& aResult) override;
|
||||
virtual void GetSpokenCounterText(CounterValue aOrdinal,
|
||||
WritingMode aWritingMode,
|
||||
nsAString& aResult,
|
||||
@ -537,20 +539,15 @@ class BuiltinCounterStyle : public CounterStyle {
|
||||
constexpr BuiltinCounterStyle(const BuiltinCounterStyle& aOther)
|
||||
: CounterStyle(aOther.mStyle), mName(aOther.mName) {}
|
||||
|
||||
virtual void GetPrefixInternal(nsAString& aResult) override;
|
||||
virtual void GetSuffixInternal(nsAString& aResult) override;
|
||||
|
||||
private:
|
||||
nsStaticAtom* mName;
|
||||
};
|
||||
|
||||
/* virtual */
|
||||
void BuiltinCounterStyle::GetPrefixInternal(nsAString& aResult) {
|
||||
aResult.Truncate();
|
||||
}
|
||||
void BuiltinCounterStyle::GetPrefix(nsAString& aResult) { aResult.Truncate(); }
|
||||
|
||||
/* virtual */
|
||||
void BuiltinCounterStyle::GetSuffixInternal(nsAString& aResult) {
|
||||
void BuiltinCounterStyle::GetSuffix(nsAString& aResult) {
|
||||
switch (mStyle) {
|
||||
case ListStyle::None:
|
||||
aResult.Truncate();
|
||||
@ -956,6 +953,8 @@ class CustomCounterStyle final : public CounterStyle {
|
||||
const RawServoCounterStyleRule* GetRule() const { return mRule; }
|
||||
uint32_t GetRuleGeneration() const { return mRuleGeneration; }
|
||||
|
||||
virtual void GetPrefix(nsAString& aResult) override;
|
||||
virtual void GetSuffix(nsAString& aResult) override;
|
||||
virtual void GetSpokenCounterText(CounterValue aOrdinal,
|
||||
WritingMode aWritingMode,
|
||||
nsAString& aResult,
|
||||
@ -973,7 +972,6 @@ class CustomCounterStyle final : public CounterStyle {
|
||||
virtual void CallFallbackStyle(CounterValue aOrdinal,
|
||||
WritingMode aWritingMode, nsAString& aResult,
|
||||
bool& aIsRTL) override;
|
||||
virtual CounterStyle* ResolveFallbackFor(CounterValue aOrdinal) override;
|
||||
virtual bool GetInitialCounterText(CounterValue aOrdinal,
|
||||
WritingMode aWritingMode,
|
||||
nsAString& aResult, bool& aIsRTL) override;
|
||||
@ -991,10 +989,6 @@ class CustomCounterStyle final : public CounterStyle {
|
||||
presShell->FreeByObjectID(eArenaObjectID_CustomCounterStyle, this);
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual void GetPrefixInternal(nsAString& aResult) override;
|
||||
virtual void GetSuffixInternal(nsAString& aResult) override;
|
||||
|
||||
private:
|
||||
~CustomCounterStyle() = default;
|
||||
|
||||
@ -1016,8 +1010,6 @@ class CustomCounterStyle final : public CounterStyle {
|
||||
CounterStyle* GetExtends();
|
||||
CounterStyle* GetExtendsRoot();
|
||||
|
||||
bool AdditiveSymbolsIncludeZero();
|
||||
|
||||
// CounterStyleManager should always overlive any CounterStyle as it
|
||||
// is owned by nsPresContext, and will be released after all nodes and
|
||||
// frames are released.
|
||||
@ -1100,13 +1092,13 @@ void CustomCounterStyle::ResetDependentData() {
|
||||
}
|
||||
|
||||
/* virtual */
|
||||
void CustomCounterStyle::GetPrefixInternal(nsAString& aResult) {
|
||||
void CustomCounterStyle::GetPrefix(nsAString& aResult) {
|
||||
if (!(mFlags & FLAG_PREFIX_INITED)) {
|
||||
mFlags |= FLAG_PREFIX_INITED;
|
||||
|
||||
if (!Servo_CounterStyleRule_GetPrefix(mRule, &mPrefix)) {
|
||||
if (IsExtendsSystem()) {
|
||||
GetExtends()->GetPrefixInternal(mPrefix);
|
||||
GetExtends()->GetPrefix(mPrefix);
|
||||
} else {
|
||||
mPrefix.Truncate();
|
||||
}
|
||||
@ -1116,13 +1108,13 @@ void CustomCounterStyle::GetPrefixInternal(nsAString& aResult) {
|
||||
}
|
||||
|
||||
/* virtual */
|
||||
void CustomCounterStyle::GetSuffixInternal(nsAString& aResult) {
|
||||
void CustomCounterStyle::GetSuffix(nsAString& aResult) {
|
||||
if (!(mFlags & FLAG_SUFFIX_INITED)) {
|
||||
mFlags |= FLAG_SUFFIX_INITED;
|
||||
|
||||
if (!Servo_CounterStyleRule_GetSuffix(mRule, &mSuffix)) {
|
||||
if (IsExtendsSystem()) {
|
||||
GetExtends()->GetSuffixInternal(mSuffix);
|
||||
GetExtends()->GetSuffix(mSuffix);
|
||||
} else {
|
||||
mSuffix.AssignLiteral(u". ");
|
||||
}
|
||||
@ -1198,11 +1190,6 @@ bool CustomCounterStyle::IsOrdinalInRange(CounterValue aOrdinal) {
|
||||
return IsOrdinalInAutoRange(aOrdinal);
|
||||
}
|
||||
|
||||
bool CustomCounterStyle::AdditiveSymbolsIncludeZero() {
|
||||
const auto symbols = GetAdditiveSymbols();
|
||||
return !symbols.IsEmpty() && symbols[symbols.Length() - 1].weight == 0;
|
||||
}
|
||||
|
||||
/* virtual */
|
||||
bool CustomCounterStyle::IsOrdinalInAutoRange(CounterValue aOrdinal) {
|
||||
switch (mSystem) {
|
||||
@ -1214,7 +1201,7 @@ bool CustomCounterStyle::IsOrdinalInAutoRange(CounterValue aOrdinal) {
|
||||
case StyleCounterSystem::Symbolic:
|
||||
return aOrdinal >= 1;
|
||||
case StyleCounterSystem::Additive:
|
||||
return aOrdinal >= (AdditiveSymbolsIncludeZero() ? 0 : 1);
|
||||
return aOrdinal >= 0;
|
||||
case StyleCounterSystem::Extends:
|
||||
return GetExtendsRoot()->IsOrdinalInAutoRange(aOrdinal);
|
||||
default:
|
||||
@ -1280,20 +1267,6 @@ void CustomCounterStyle::CallFallbackStyle(CounterValue aOrdinal,
|
||||
mFallback = fallback;
|
||||
}
|
||||
|
||||
/* virtual */
|
||||
CounterStyle* CustomCounterStyle::ResolveFallbackFor(CounterValue aOrdinal) {
|
||||
if (IsOrdinalInRange(aOrdinal)) {
|
||||
return this;
|
||||
}
|
||||
CounterStyle* fallback = GetFallback();
|
||||
// If it recursively falls back to this counter style again,
|
||||
// it will then fallback to decimal to break the loop.
|
||||
mFallback = CounterStyleManager::GetDecimalStyle();
|
||||
CounterStyle* result = fallback->ResolveFallbackFor(aOrdinal);
|
||||
mFallback = fallback;
|
||||
return result;
|
||||
}
|
||||
|
||||
/* virtual */
|
||||
bool CustomCounterStyle::GetInitialCounterText(CounterValue aOrdinal,
|
||||
WritingMode aWritingMode,
|
||||
@ -1547,12 +1520,12 @@ AnonymousCounterStyle::AnonymousCounterStyle(StyleSymbolsType aType,
|
||||
mSymbols(std::move(aSymbols)) {}
|
||||
|
||||
/* virtual */
|
||||
void AnonymousCounterStyle::GetPrefixInternal(nsAString& aResult) {
|
||||
void AnonymousCounterStyle::GetPrefix(nsAString& aResult) {
|
||||
aResult.Truncate();
|
||||
}
|
||||
|
||||
/* virtual */
|
||||
void AnonymousCounterStyle::GetSuffixInternal(nsAString& aResult) {
|
||||
void AnonymousCounterStyle::GetSuffix(nsAString& aResult) {
|
||||
if (IsSingleString()) {
|
||||
aResult.Truncate();
|
||||
} else {
|
||||
@ -1770,16 +1743,6 @@ void CounterStyle::CallFallbackStyle(CounterValue aOrdinal,
|
||||
GetFallback()->GetCounterText(aOrdinal, aWritingMode, aResult, aIsRTL);
|
||||
}
|
||||
|
||||
/* virtual */
|
||||
CounterStyle* CounterStyle::ResolveFallbackFor(CounterValue aOrdinal) {
|
||||
// Fallback for built-in counters doesn't involve any loops, so the recursion
|
||||
// here will terminate; custom counters override this to guard against loops.
|
||||
if (IsOrdinalInRange(aOrdinal)) {
|
||||
return this;
|
||||
}
|
||||
return GetFallback()->ResolveFallbackFor(aOrdinal);
|
||||
}
|
||||
|
||||
CounterStyleManager::CounterStyleManager(nsPresContext* aPresContext)
|
||||
: mPresContext(aPresContext) {
|
||||
// Insert the static styles into cache table
|
||||
|
@ -55,20 +55,8 @@ class CounterStyle {
|
||||
// styles are dependent for fallback.
|
||||
bool IsDependentStyle() const;
|
||||
|
||||
// Note: caller is responsible to handle range limits and fallback, so that
|
||||
// the ordinal value passed to GetPrefix or GetSuffix is within the style's
|
||||
// supported range.
|
||||
void GetPrefix(CounterValue aOrdinal, nsAString& aResult) {
|
||||
MOZ_ASSERT(IsOrdinalInRange(aOrdinal),
|
||||
"caller should have handled range fallback");
|
||||
GetPrefixInternal(aResult);
|
||||
}
|
||||
void GetSuffix(CounterValue aOrdinal, nsAString& aResult) {
|
||||
MOZ_ASSERT(IsOrdinalInRange(aOrdinal),
|
||||
"caller should have handled range fallback");
|
||||
GetSuffixInternal(aResult);
|
||||
}
|
||||
|
||||
virtual void GetPrefix(nsAString& aResult) = 0;
|
||||
virtual void GetSuffix(nsAString& aResult) = 0;
|
||||
void GetCounterText(CounterValue aOrdinal, WritingMode aWritingMode,
|
||||
nsAString& aResult, bool& aIsRTL);
|
||||
virtual void GetSpokenCounterText(CounterValue aOrdinal,
|
||||
@ -106,19 +94,7 @@ class CounterStyle {
|
||||
|
||||
virtual AnonymousCounterStyle* AsAnonymous() { return nullptr; }
|
||||
|
||||
/**
|
||||
* This returns the counter-style that should handle the given ordinal value,
|
||||
* following the fallback chain if necessary.
|
||||
*/
|
||||
virtual CounterStyle* ResolveFallbackFor(CounterValue aOrdinal);
|
||||
|
||||
protected:
|
||||
friend class CustomCounterStyle;
|
||||
// Get the style's prefix or suffix text, without checking range coverage or
|
||||
// handling fallback (but following 'extends' relations as needed).
|
||||
virtual void GetPrefixInternal(nsAString& aResult) = 0;
|
||||
virtual void GetSuffixInternal(nsAString& aResult) = 0;
|
||||
|
||||
const ListStyle mStyle;
|
||||
};
|
||||
|
||||
@ -127,6 +103,8 @@ class AnonymousCounterStyle final : public CounterStyle {
|
||||
explicit AnonymousCounterStyle(const nsAString& aContent);
|
||||
AnonymousCounterStyle(StyleSymbolsType, nsTArray<nsString> aSymbols);
|
||||
|
||||
virtual void GetPrefix(nsAString& aResult) override;
|
||||
virtual void GetSuffix(nsAString& aResult) override;
|
||||
virtual bool IsBullet() override;
|
||||
|
||||
virtual void GetNegative(NegativeType& aResult) override;
|
||||
@ -150,10 +128,6 @@ class AnonymousCounterStyle final : public CounterStyle {
|
||||
|
||||
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(AnonymousCounterStyle)
|
||||
|
||||
protected:
|
||||
virtual void GetPrefixInternal(nsAString& aResult) override;
|
||||
virtual void GetSuffixInternal(nsAString& aResult) override;
|
||||
|
||||
private:
|
||||
~AnonymousCounterStyle() = default;
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
<!DOCTYPE html>
|
||||
<meta charset="UTF-8">
|
||||
<title>CSS Reference: descriptor prefix</title>
|
||||
<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">
|
||||
<!-- ol -->
|
||||
<div>-2. </div>
|
||||
<div>-1. </div>
|
||||
<div>0. </div>
|
||||
<div>Appendix -2. </div>
|
||||
<div>Appendix -1. </div>
|
||||
<div>Appendix 0. </div>
|
||||
<div>Appendix I. </div>
|
||||
<div>Appendix II. </div>
|
||||
<!-- section -->
|
||||
|
@ -7,8 +7,6 @@
|
||||
<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,56 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<meta charset=utf-8>
|
||||
<title>CSS Reference: fallback cycle</title>
|
||||
<style>
|
||||
.decimal {
|
||||
list-style-type: decimal;
|
||||
}
|
||||
.paren::marker {
|
||||
content: "(" counter(list-item) ")\A0";
|
||||
}
|
||||
.bracket::marker {
|
||||
content: "[" counter(list-item, lower-roman) "]\A0";
|
||||
}
|
||||
.brace::marker {
|
||||
content: "{" counter(list-item, lower-alpha) "}\A0";
|
||||
}
|
||||
</style>
|
||||
|
||||
<ol>
|
||||
<li class=decimal>paren > bracket > brace > decimal
|
||||
<li class=paren>paren
|
||||
<li class=paren>paren
|
||||
<li class=paren>paren
|
||||
<li class=bracket>paren > bracket
|
||||
<li class=bracket>paren > bracket
|
||||
<li class=bracket>paren > bracket
|
||||
<li class=brace>paren > bracket > brace
|
||||
<li class=brace>paren > bracket > brace
|
||||
<li class=decimal>paren > bracket > brace > decimal
|
||||
</ol>
|
||||
|
||||
<ol>
|
||||
<li class=decimal>bracket > brace > paren > decimal
|
||||
<li class=paren>bracket > brace > paren
|
||||
<li class=paren>bracket > brace > paren
|
||||
<li class=bracket>bracket
|
||||
<li class=bracket>bracket
|
||||
<li class=bracket>bracket
|
||||
<li class=bracket>bracket
|
||||
<li class=brace>bracket > brace
|
||||
<li class=brace>bracket > brace
|
||||
<li class=decimal>bracket > brace > paren > decimal
|
||||
</ol>
|
||||
|
||||
<ol>
|
||||
<li class=decimal>brace > paren > bracket > decimal
|
||||
<li class=paren>brace > paren
|
||||
<li class=paren>brace > paren
|
||||
<li class=paren>brace > paren
|
||||
<li class=bracket>brace > paren > bracket
|
||||
<li class=bracket>brace > paren > bracket
|
||||
<li class=brace>brace
|
||||
<li class=brace>brace
|
||||
<li class=brace>brace
|
||||
<li class=decimal>brace > paren > bracket > decimal
|
||||
</ol>
|
@ -1,85 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<meta charset=utf-8>
|
||||
<title>CSS Test: fallback cycle</title>
|
||||
<link rel="author" title="Jonathan Kew" href="mailto:jkew@mozilla.com">
|
||||
<link rel="help" href="https://drafts.csswg.org/css-counter-styles-3/#counter-style-range">
|
||||
<link rel="help" href="https://drafts.csswg.org/css-counter-styles-3/#counter-style-fallback">
|
||||
<meta name="assert" content="While following fallbacks to find a counter style that can render the given counter value,
|
||||
if a loop in the specified fallbacks is detected, the decimal style must be used instead">
|
||||
<link rel="match" href="fallback-cycle-ref.html">
|
||||
<style>
|
||||
/*
|
||||
Three styles with different but overlapping ranges,
|
||||
with fallback to each other in a cycle.
|
||||
|
||||
Depending where in the cycle we start, we expect different results
|
||||
for the overlapping ranges; in all cases we fall back to the default
|
||||
(decimal) style when fallback would loop around.
|
||||
*/
|
||||
@counter-style paren {
|
||||
system: extends decimal;
|
||||
prefix: "(";
|
||||
suffix: ")\A0";
|
||||
range: 2 4;
|
||||
fallback: bracket;
|
||||
}
|
||||
|
||||
@counter-style bracket {
|
||||
system: extends lower-roman;
|
||||
prefix: "[";
|
||||
suffix: "]\A0";
|
||||
range: 4 7;
|
||||
fallback: brace;
|
||||
}
|
||||
|
||||
@counter-style brace {
|
||||
system: extends lower-alpha;
|
||||
prefix: "{";
|
||||
suffix: "}\A0";
|
||||
range: 7 9;
|
||||
fallback: paren;
|
||||
}
|
||||
|
||||
ol {
|
||||
list-style-type: disc; /* overridden by the counter-style rules */
|
||||
}
|
||||
</style>
|
||||
|
||||
<ol style="list-style: paren">
|
||||
<li>paren > bracket > brace > decimal
|
||||
<li>paren
|
||||
<li>paren
|
||||
<li>paren
|
||||
<li>paren > bracket
|
||||
<li>paren > bracket
|
||||
<li>paren > bracket
|
||||
<li>paren > bracket > brace
|
||||
<li>paren > bracket > brace
|
||||
<li>paren > bracket > brace > decimal
|
||||
</ol>
|
||||
|
||||
<ol style="list-style: bracket">
|
||||
<li>bracket > brace > paren > decimal
|
||||
<li>bracket > brace > paren
|
||||
<li>bracket > brace > paren
|
||||
<li>bracket
|
||||
<li>bracket
|
||||
<li>bracket
|
||||
<li>bracket
|
||||
<li>bracket > brace
|
||||
<li>bracket > brace
|
||||
<li>bracket > brace > paren > decimal
|
||||
</ol>
|
||||
|
||||
<ol style="list-style: brace">
|
||||
<li>brace > paren > bracket > decimal
|
||||
<li>brace > paren
|
||||
<li>brace > paren
|
||||
<li>brace > paren
|
||||
<li>brace > paren > bracket
|
||||
<li>brace > paren > bracket
|
||||
<li>brace
|
||||
<li>brace
|
||||
<li>brace
|
||||
<li>brace > paren > bracket > decimal
|
||||
</ol>
|
@ -1,47 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<meta charset=utf-8>
|
||||
<title>CSS Reference: suffix fallback</title>
|
||||
<style>
|
||||
div div {
|
||||
width: 4em;
|
||||
text-align: right;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div>
|
||||
<div>1st</div>
|
||||
<div>2nd</div>
|
||||
<div>3rd</div>
|
||||
<div>4th</div>
|
||||
<div>5th</div>
|
||||
<div>6th</div>
|
||||
<div>7th</div>
|
||||
<div>8th</div>
|
||||
<div>9th</div>
|
||||
<div>10th</div>
|
||||
<div>11th</div>
|
||||
<div>12th</div>
|
||||
<div>13th</div>
|
||||
<div>14th</div>
|
||||
<div>15th</div>
|
||||
<div>16th</div>
|
||||
<div>17th</div>
|
||||
<div>18th</div>
|
||||
<div>19th</div>
|
||||
<div>20th</div>
|
||||
<div>21st</div>
|
||||
<div>22nd</div>
|
||||
<div>23rd</div>
|
||||
<div>24th</div>
|
||||
<div>25th</div>
|
||||
<div>26th</div>
|
||||
<div>27th</div>
|
||||
<div>28th</div>
|
||||
<div>29th</div>
|
||||
<div>30th</div>
|
||||
<div>31st</div>
|
||||
<div>32nd</div>
|
||||
<div>33rd</div>
|
||||
<div>34th</div>
|
||||
<div>35th</div>
|
||||
</div>
|
@ -1,84 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<meta charset=utf-8>
|
||||
<title>CSS Test: suffix fallback</title>
|
||||
<link rel="author" title="Jonathan Kew" href="mailto:jkew@mozilla.com">
|
||||
<link rel="help" href="https://drafts.csswg.org/css-counter-styles-3/#counter-style-range">
|
||||
<link rel="help" href="https://drafts.csswg.org/css-counter-styles-3/#counter-style-fallback">
|
||||
<link rel="match" href="suffix-fallback-ref.html">
|
||||
<style>
|
||||
/* A set of rules that rely on range limits and fallback to vary the suffix. */
|
||||
@counter-style ordinal-default {
|
||||
system: numeric;
|
||||
symbols: "0" "1" "2" "3" "4" "5" "6" "7" "8" "9";
|
||||
suffix: "th";
|
||||
range: 1 infinite;
|
||||
}
|
||||
|
||||
@counter-style ordinal {
|
||||
system: extends ordinal-default;
|
||||
suffix: "st";
|
||||
fallback: ordinal-twos;
|
||||
range: 1 1, 21 21, 31 31, 41 41, 51 51, 61 61, 71 71, 81 81, 91 91;
|
||||
}
|
||||
|
||||
@counter-style ordinal-twos {
|
||||
system: extends ordinal-default;
|
||||
suffix: "nd";
|
||||
fallback: ordinal-threes;
|
||||
range: 2 2, 22 22, 32 32, 42 42, 52 52, 62 62, 72 72, 82 82, 92 92;
|
||||
}
|
||||
|
||||
@counter-style ordinal-threes {
|
||||
system: extends ordinal-default;
|
||||
suffix: "rd";
|
||||
fallback: ordinal-default;
|
||||
range: 3 3, 23 23, 33 33, 43 43, 53 53, 63 63, 73 73, 83 83, 93 93;
|
||||
}
|
||||
|
||||
ol.ordinal {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style: ordinal;
|
||||
}
|
||||
li {
|
||||
margin-left: 4em;
|
||||
}
|
||||
</style>
|
||||
|
||||
<ol class="ordinal">
|
||||
<li></li>
|
||||
<li></li>
|
||||
<li></li>
|
||||
<li></li>
|
||||
<li></li>
|
||||
<li></li>
|
||||
<li></li>
|
||||
<li></li>
|
||||
<li></li>
|
||||
<li></li>
|
||||
<li></li>
|
||||
<li></li>
|
||||
<li></li>
|
||||
<li></li>
|
||||
<li></li>
|
||||
<li></li>
|
||||
<li></li>
|
||||
<li></li>
|
||||
<li></li>
|
||||
<li></li>
|
||||
<li></li>
|
||||
<li></li>
|
||||
<li></li>
|
||||
<li></li>
|
||||
<li></li>
|
||||
<li></li>
|
||||
<li></li>
|
||||
<li></li>
|
||||
<li></li>
|
||||
<li></li>
|
||||
<li></li>
|
||||
<li></li>
|
||||
<li></li>
|
||||
<li></li>
|
||||
<li></li>
|
||||
</ol>
|
@ -1,12 +1,12 @@
|
||||
<!DOCTYPE html>
|
||||
<meta charset="UTF-8">
|
||||
<title>CSS Reference: system additive</title>
|
||||
<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">
|
||||
<!-- 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,13 +7,11 @@
|
||||
<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,8 +7,6 @@
|
||||
<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>-2. </div>
|
||||
<div>-1. </div>
|
||||
<div>0. </div>
|
||||
<div>Chapter -2. </div>
|
||||
<div>Chapter -1. </div>
|
||||
<div>Chapter 0. </div>
|
||||
<div>Chapter I. </div>
|
||||
<div>Chapter II. </div>
|
||||
<div>Chapter III. </div>
|
||||
<div>Chapter IV. </div>
|
||||
<div>Chapter V. </div>
|
||||
<div>6. </div>
|
||||
<div>7. </div>
|
||||
<div>Chapter 6. </div>
|
||||
<div>Chapter 7. </div>
|
||||
<!-- list-style-type: b -->
|
||||
<div>-2. </div>
|
||||
<div>-1. </div>
|
||||
<div>0. </div>
|
||||
<div>Section -2. </div>
|
||||
<div>Section -1. </div>
|
||||
<div>Section 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>7. </div>
|
||||
<div>Section 7. </div>
|
||||
|
@ -7,13 +7,11 @@
|
||||
<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,8 +8,6 @@
|
||||
<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: '';
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user