Backed out changeset d53b25dcf2d7 (bug 966168) for causing bustage

This commit is contained in:
Carsten "Tomcat" Book 2014-09-25 09:40:40 +02:00
Родитель 5bca523013
Коммит 84fa1ee595
18 изменённых файлов: 78 добавлений и 562 удалений

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

@ -48,17 +48,8 @@ nsCounterUseNode::GetCounterStyle()
{
if (!mCounterStyle) {
const nsCSSValue& style = mCounterFunction->Item(mAllCounters ? 2 : 1);
CounterStyleManager* manager = mPresContext->CounterStyleManager();
if (style.GetUnit() == eCSSUnit_Ident) {
nsString ident;
style.GetStringValue(ident);
mCounterStyle = manager->BuildCounterStyle(ident);
} else if (style.GetUnit() == eCSSUnit_Symbols) {
mCounterStyle = manager->BuildCounterStyle(style.GetArrayValue());
} else {
NS_NOTREACHED("Unknown counter style");
mCounterStyle = CounterStyleManager::GetDecimalStyle();
}
mCounterStyle = mPresContext->CounterStyleManager()->
BuildCounterStyle(nsDependentString(style.GetStringBufferValue()));
}
return mCounterStyle;
}

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

@ -31,5 +31,3 @@ fails-if(B2G) == descriptor-suffix.html descriptor-suffix-ref.html # B2G kerni
== redefine-builtin.html redefine-builtin-ref.html
== redefine-attr-mapping.html redefine-attr-mapping-ref.html
== disclosure-styles.html disclosure-styles-ref.html
== symbols-function.html symbols-function-ref.html
== symbols-function-invalid.html symbols-function-invalid-ref.html

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

@ -1,11 +0,0 @@
<!DOCTYPE html>
<link rel="stylesheet" href="test-common.css">
<style type="text/css">
.invalid {
list-style-type: lower-greek;
}
</style>
<ol start="-2" class="invalid">
<li><li><li><li><li>
<li><li><li><li><li>
</ol>

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

@ -1,18 +0,0 @@
<!DOCTYPE html>
<link rel="stylesheet" href="test-common.css">
<style type="text/css">
.invalid {
list-style-type: lower-greek;
list-style-type: symbols(a b c);
list-style-type: symbols(alphabetic a b c);
list-style-type: symbols(numeric 0 1 2);
list-style-type: symbols(additive 'a' 'b');
list-style-type: symbols(fixed);
list-style-type: symbols(alphabetic 'a');
list-style-type: symbols(numeric '0');
}
</style>
<ol start="-2" class="invalid">
<li><li><li><li><li>
<li><li><li><li><li>
</ol>

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

@ -1,86 +0,0 @@
<!DOCTYPE html>
<link rel="stylesheet" href="test-common.css">
<style type="text/css">
@counter-style cyclic {
system: cyclic;
symbols: '*' '\2020' '\2021' '\A7';
suffix: ' ';
}
@counter-style numeric {
system: numeric;
symbols: '0' '1' '2';
suffix: ' ';
}
@counter-style alphabetic {
system: alphabetic;
symbols: '\26AA' '\26AB';
suffix: ' ';
}
@counter-style symbolic {
system: symbolic;
symbols: '*' '\2020' '\2021' '\A7';
suffix: ' ';
}
@counter-style fixed {
system: fixed;
symbols: '\25F0' '\25F1' '\25F2' '\25F3';
suffix: ' ';
}
@counter-style counter {
symbols: '*';
}
@counter-style counters {
system: numeric;
symbols: '0' '1';
}
.counter { counter-reset: a; }
.counter p { counter-increment: a 1; }
.counter p::after {
content: counter(a, counter);
}
.counter, .counters {
list-style-type: none;
counter-reset: a;
}
.counter li, .counters li {
counter-increment: a;
padding-right: .5em;
}
.counter li::after {
content: counter(a, counter);
}
.counters .counters li::after {
content: counters(a, '.', counters);
}
</style>
<ol start="-2" style="list-style-type: symbolic">
<li><li><li><li><li>
<li><li><li><li><li>
</ol>
<ol start="-2" style="list-style-type: cyclic">
<li><li><li><li><li>
<li><li><li><li><li>
</ol>
<ol start="-2" style="list-style-type: numeric">
<li><li><li><li><li>
<li><li><li><li><li>
</ol>
<ol start="-2" style="list-style-type: alphabetic">
<li><li><li><li><li>
<li><li><li><li><li>
</ol>
<ol start="-2" style="list-style-type: symbolic">
<li><li><li><li><li>
<li><li><li><li><li>
</ol>
<ol start="-2" style="list-style-type: fixed">
<li><li><li><li><li>
<li><li><li><li><li>
</ol>
<ol class="counter">
<li><li><li><li><li>
</ol>
<ol class="counters">
<li><ol class="counters"><li><li><li><li><li></ol></li>
<li><ol class="counters"><li><li><li><li><li></ol></li>
</ol>

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

@ -1,67 +0,0 @@
<!DOCTYPE html>
<link rel="stylesheet" href="test-common.css">
<style type="text/css">
.default {
list-style-type: symbols('*' '\2020' '\2021' '\A7');
}
.cyclic {
list-style-type: symbols(cyclic '*' '\2020' '\2021' '\A7');
}
.numeric {
list-style-type: symbols(numeric '0' '1' '2');
}
.alphabetic {
list-style-type: symbols(alphabetic '\26AA' '\26AB');
}
.symbolic {
list-style-type: symbols(symbolic '*' '\2020' '\2021' '\A7');
}
.fixed {
list-style-type: symbols(fixed '\25F0' '\25F1' '\25F2' '\25F3');
}
.counter, .counters {
list-style-type: none;
counter-reset: a;
}
.counter li, .counters li {
counter-increment: a;
padding-right: .5em;
}
.counter li::after {
content: counter(a, symbols('*'));
}
.counters .counters li::after {
content: counters(a, '.', symbols(numeric '0' '1'));
}
</style>
<ol start="-2" class="default">
<li><li><li><li><li>
<li><li><li><li><li>
</ol>
<ol start="-2" class="cyclic">
<li><li><li><li><li>
<li><li><li><li><li>
</ol>
<ol start="-2" class="numeric">
<li><li><li><li><li>
<li><li><li><li><li>
</ol>
<ol start="-2" class="alphabetic">
<li><li><li><li><li>
<li><li><li><li><li>
</ol>
<ol start="-2" class="symbolic">
<li><li><li><li><li>
<li><li><li><li><li>
</ol>
<ol start="-2" class="fixed">
<li><li><li><li><li>
<li><li><li><li><li>
</ol>
<ol class="counter">
<li><li><li><li><li>
</ol>
<ol class="counters">
<li><ol class="counters"><li><li><li><li><li></ol></li>
<li><ol class="counters"><li><li><li><li><li></ol></li>
</ol>

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

@ -542,37 +542,6 @@ EthiopicToText(CounterValue aOrdinal, nsSubstring& aResult)
return true;
}
static uint8_t
GetDefaultSpeakAsForSystem(uint8_t aSystem)
{
NS_ABORT_IF_FALSE(aSystem != NS_STYLE_COUNTER_SYSTEM_EXTENDS,
"Extends system does not have static default speak-as");
switch (aSystem) {
case NS_STYLE_COUNTER_SYSTEM_ALPHABETIC:
return NS_STYLE_COUNTER_SPEAKAS_SPELL_OUT;
case NS_STYLE_COUNTER_SYSTEM_CYCLIC:
return NS_STYLE_COUNTER_SPEAKAS_BULLETS;
default:
return NS_STYLE_COUNTER_SPEAKAS_NUMBERS;
}
}
static bool
SystemUsesNegativeSign(uint8_t aSystem)
{
NS_ABORT_IF_FALSE(aSystem != NS_STYLE_COUNTER_SYSTEM_EXTENDS,
"Cannot check this for extending style");
switch (aSystem) {
case NS_STYLE_COUNTER_SYSTEM_SYMBOLIC:
case NS_STYLE_COUNTER_SYSTEM_ALPHABETIC:
case NS_STYLE_COUNTER_SYSTEM_NUMERIC:
case NS_STYLE_COUNTER_SYSTEM_ADDITIVE:
return true;
default:
return false;
}
}
class BuiltinCounterStyle : public CounterStyle
{
public:
@ -607,6 +576,10 @@ public:
virtual uint8_t GetSpeakAs() MOZ_OVERRIDE;
virtual bool UseNegativeSign() MOZ_OVERRIDE;
virtual void CallFallbackStyle(CounterValue aOrdinal,
WritingMode aWritingMode,
nsSubstring& aResult,
bool& aIsRTL) MOZ_OVERRIDE;
virtual bool GetInitialCounterText(CounterValue aOrdinal,
WritingMode aWritingMode,
nsSubstring& aResult,
@ -873,6 +846,15 @@ BuiltinCounterStyle::UseNegativeSign()
}
}
/* virtual */ void
BuiltinCounterStyle::CallFallbackStyle(CounterValue aOrdinal,
WritingMode aWritingMode,
nsSubstring& aResult,
bool& aIsRTL)
{
GetFallback()->GetCounterText(aOrdinal, aWritingMode, aResult, aIsRTL);
}
/* virtual */ bool
BuiltinCounterStyle::GetInitialCounterText(CounterValue aOrdinal,
WritingMode aWritingMode,
@ -1373,10 +1355,17 @@ CustomCounterStyle::GetSpeakAs()
/* virtual */ bool
CustomCounterStyle::UseNegativeSign()
{
if (mSystem == NS_STYLE_COUNTER_SYSTEM_EXTENDS) {
return GetExtendsRoot()->UseNegativeSign();
switch (mSystem) {
case NS_STYLE_COUNTER_SYSTEM_SYMBOLIC:
case NS_STYLE_COUNTER_SYSTEM_ALPHABETIC:
case NS_STYLE_COUNTER_SYSTEM_NUMERIC:
case NS_STYLE_COUNTER_SYSTEM_ADDITIVE:
return true;
case NS_STYLE_COUNTER_SYSTEM_EXTENDS:
return GetExtendsRoot()->UseNegativeSign();
default:
return false;
}
return SystemUsesNegativeSign(mSystem);
}
/* virtual */ void
@ -1467,7 +1456,14 @@ CustomCounterStyle::GetSpeakAsAutoValue()
}
system = static_cast<CustomCounterStyle*>(root)->mSystem;
}
return GetDefaultSpeakAsForSystem(system);
switch (system) {
case NS_STYLE_COUNTER_SYSTEM_ALPHABETIC:
return NS_STYLE_COUNTER_SPEAKAS_SPELL_OUT;
case NS_STYLE_COUNTER_SYSTEM_CYCLIC:
return NS_STYLE_COUNTER_SPEAKAS_BULLETS;
default:
return NS_STYLE_COUNTER_SPEAKAS_NUMBERS;
}
}
// This method corresponds to the first stage of computation of the
@ -1655,119 +1651,6 @@ CustomCounterStyle::GetExtendsRoot()
return mExtendsRoot;
}
AnonymousCounterStyle::AnonymousCounterStyle(const nsCSSValue::Array* aParams)
: CounterStyle(NS_STYLE_LIST_STYLE_CUSTOM)
{
mSystem = aParams->Item(0).GetIntValue();
for (const nsCSSValueList* item = aParams->Item(1).GetListValue();
item; item = item->mNext) {
item->mValue.GetStringValue(*mSymbols.AppendElement());
}
mSymbols.Compact();
}
/* virtual */ void
AnonymousCounterStyle::GetPrefix(nsAString& aResult)
{
aResult.Truncate();
}
/* virtual */ void
AnonymousCounterStyle::GetSuffix(nsAString& aResult)
{
aResult = ' ';
}
/* virtual */ bool
AnonymousCounterStyle::IsBullet()
{
switch (mSystem) {
case NS_STYLE_COUNTER_SYSTEM_CYCLIC:
// Only use ::-moz-list-bullet for cyclic system
return true;
default:
return false;
}
}
/* virtual */ void
AnonymousCounterStyle::GetNegative(NegativeType& aResult)
{
aResult.before.AssignLiteral(MOZ_UTF16("-"));
aResult.after.Truncate();
}
/* virtual */ bool
AnonymousCounterStyle::IsOrdinalInRange(CounterValue aOrdinal)
{
switch (mSystem) {
case NS_STYLE_COUNTER_SYSTEM_CYCLIC:
case NS_STYLE_COUNTER_SYSTEM_NUMERIC:
case NS_STYLE_COUNTER_SYSTEM_FIXED:
return true;
case NS_STYLE_COUNTER_SYSTEM_ALPHABETIC:
case NS_STYLE_COUNTER_SYSTEM_SYMBOLIC:
return aOrdinal >= 1;
default:
NS_NOTREACHED("Invalid system.");
return false;
}
}
/* virtual */ bool
AnonymousCounterStyle::IsOrdinalInAutoRange(CounterValue aOrdinal)
{
return AnonymousCounterStyle::IsOrdinalInRange(aOrdinal);
}
/* virtual */ void
AnonymousCounterStyle::GetPad(PadType& aResult)
{
aResult.width = 0;
aResult.symbol.Truncate();
}
/* virtual */ CounterStyle*
AnonymousCounterStyle::GetFallback()
{
return CounterStyleManager::GetDecimalStyle();
}
/* virtual */ uint8_t
AnonymousCounterStyle::GetSpeakAs()
{
return GetDefaultSpeakAsForSystem(mSystem);
}
/* virtual */ bool
AnonymousCounterStyle::UseNegativeSign()
{
return SystemUsesNegativeSign(mSystem);
}
/* virtual */ bool
AnonymousCounterStyle::GetInitialCounterText(CounterValue aOrdinal,
WritingMode aWritingMode,
nsAString& aResult,
bool& aIsRTL)
{
switch (mSystem) {
case NS_STYLE_COUNTER_SYSTEM_CYCLIC:
return GetCyclicCounterText(aOrdinal, aResult, mSymbols);
case NS_STYLE_COUNTER_SYSTEM_FIXED:
return GetFixedCounterText(aOrdinal, aResult, 1, mSymbols);
case NS_STYLE_COUNTER_SYSTEM_SYMBOLIC:
return GetSymbolicCounterText(aOrdinal, aResult, mSymbols);
case NS_STYLE_COUNTER_SYSTEM_ALPHABETIC:
return GetAlphabeticCounterText(aOrdinal, aResult, mSymbols);
case NS_STYLE_COUNTER_SYSTEM_NUMERIC:
return GetNumericCounterText(aOrdinal, aResult, mSymbols);
default:
NS_NOTREACHED("Invalid system.");
return false;
}
}
bool
CounterStyle::IsDependentStyle() const
{
@ -1899,15 +1782,6 @@ CounterStyle::GetSpokenCounterText(CounterValue aOrdinal,
}
}
/* virtual */ void
CounterStyle::CallFallbackStyle(CounterValue aOrdinal,
WritingMode aWritingMode,
nsAString& aResult,
bool& aIsRTL)
{
GetFallback()->GetCounterText(aOrdinal, aWritingMode, aResult, aIsRTL);
}
static BuiltinCounterStyle gBuiltinStyleTable[NS_STYLE_LIST_STYLE__MAX];
CounterStyleManager::CounterStyleManager(nsPresContext* aPresContext)
@ -1987,12 +1861,6 @@ CounterStyleManager::BuildCounterStyle(const nsSubstring& aName)
return data;
}
CounterStyle*
CounterStyleManager::BuildCounterStyle(const nsCSSValue::Array* aParams)
{
return new AnonymousCounterStyle(aParams);
}
/* static */ CounterStyle*
CounterStyleManager::GetBuiltinStyle(int32_t aStyle)
{

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

@ -25,7 +25,6 @@ class WritingMode;
typedef int32_t CounterValue;
class CounterStyleManager;
class AnonymousCounterStyle;
struct NegativeType;
struct PadType;
@ -87,14 +86,12 @@ public:
virtual void CallFallbackStyle(CounterValue aOrdinal,
WritingMode aWritingMode,
nsSubstring& aResult,
bool& aIsRTL);
bool& aIsRTL) = 0;
virtual bool GetInitialCounterText(CounterValue aOrdinal,
WritingMode aWritingMode,
nsSubstring& aResult,
bool& aIsRTL) = 0;
virtual AnonymousCounterStyle* AsAnonymous() { return nullptr; }
NS_IMETHOD_(MozExternalRefCountType) AddRef() = 0;
NS_IMETHOD_(MozExternalRefCountType) Release() = 0;
@ -102,42 +99,6 @@ protected:
int32_t mStyle;
};
class AnonymousCounterStyle MOZ_FINAL : public CounterStyle
{
public:
AnonymousCounterStyle(const nsCSSValue::Array* aValue);
virtual void GetPrefix(nsAString& aResult) MOZ_OVERRIDE;
virtual void GetSuffix(nsAString& aResult) MOZ_OVERRIDE;
virtual bool IsBullet() MOZ_OVERRIDE;
virtual void GetNegative(NegativeType& aResult) MOZ_OVERRIDE;
virtual bool IsOrdinalInRange(CounterValue aOrdinal) MOZ_OVERRIDE;
virtual bool IsOrdinalInAutoRange(CounterValue aOrdinal) MOZ_OVERRIDE;
virtual void GetPad(PadType& aResult) MOZ_OVERRIDE;
virtual CounterStyle* GetFallback() MOZ_OVERRIDE;
virtual uint8_t GetSpeakAs() MOZ_OVERRIDE;
virtual bool UseNegativeSign() MOZ_OVERRIDE;
virtual bool GetInitialCounterText(CounterValue aOrdinal,
WritingMode aWritingMode,
nsSubstring& aResult,
bool& aIsRTL) MOZ_OVERRIDE;
virtual AnonymousCounterStyle* AsAnonymous() MOZ_OVERRIDE { return this; }
uint8_t GetSystem() const { return mSystem; }
const nsTArray<nsString>& GetSymbols() const { return mSymbols; }
NS_INLINE_DECL_REFCOUNTING(AnonymousCounterStyle)
private:
~AnonymousCounterStyle() {}
uint8_t mSystem;
nsTArray<nsString> mSymbols;
};
class CounterStyleManager MOZ_FINAL
{
private:
@ -156,7 +117,6 @@ public:
}
CounterStyle* BuildCounterStyle(const nsSubstring& aName);
CounterStyle* BuildCounterStyle(const nsCSSValue::Array* aParams);
static CounterStyle* GetBuiltinStyle(int32_t aStyle);
static CounterStyle* GetNoneStyle()

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

@ -723,7 +723,6 @@ CSS_KEY(reset-size, reset_size)
//CSS_KEY(start, start)
CSS_KEY(srgb, srgb)
CSS_KEY(symbolic, symbolic)
CSS_KEY(symbols, symbols)
CSS_KEY(text-after-edge, text_after_edge)
CSS_KEY(text-before-edge, text_before_edge)
CSS_KEY(use-script, use_script)

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

@ -513,7 +513,6 @@ protected:
bool ParseCounterStyleRule(RuleAppendFunc aAppendFunc, void* aProcessData);
bool ParseCounterStyleName(nsAString& aName, bool aForDefinition);
bool ParseCounterStyleNameValue(nsCSSValue& aValue);
bool ParseCounterDescriptor(nsCSSCounterStyleRule *aRule);
bool ParseCounterDescriptorValue(nsCSSCounterDesc aDescID,
nsCSSValue& aValue);
@ -937,7 +936,6 @@ protected:
const nsCSSProps::KTableValue aPropertyKTable[] = nullptr);
bool ParseCounter(nsCSSValue& aValue);
bool ParseAttr(nsCSSValue& aValue);
bool ParseSymbols(nsCSSValue& aValue);
bool SetValueToURL(nsCSSValue& aValue, const nsString& aURL);
bool TranslateDimension(nsCSSValue& aValue, int32_t aVariantMask,
float aNumber, const nsString& aUnit);
@ -4360,17 +4358,6 @@ CSSParserImpl::ParseCounterStyleName(nsAString& aName, bool aForDefinition)
return true;
}
bool
CSSParserImpl::ParseCounterStyleNameValue(nsCSSValue& aValue)
{
nsString name;
if (ParseCounterStyleName(name, false)) {
aValue.SetStringValue(name, eCSSUnit_Ident);
return true;
}
return false;
}
bool
CSSParserImpl::ParseCounterDescriptor(nsCSSCounterStyleRule* aRule)
{
@ -4432,12 +4419,12 @@ CSSParserImpl::ParseCounterDescriptorValue(nsCSSCounterDesc aDescID,
return true;
}
case NS_STYLE_COUNTER_SYSTEM_EXTENDS: {
nsCSSValue name;
if (!ParseCounterStyleNameValue(name)) {
nsString name;
if (!ParseCounterStyleName(name, false)) {
REPORT_UNEXPECTED_TOKEN(PECounterExtendsNotIdent);
return false;
}
aValue.SetPairValue(system, name);
aValue.SetPairValue(system, nsCSSValue(name, eCSSUnit_Ident));
return true;
}
default:
@ -4495,8 +4482,14 @@ CSSParserImpl::ParseCounterDescriptorValue(nsCSSCounterDesc aDescID,
return true;
}
case eCSSCounterDesc_Fallback:
return ParseCounterStyleNameValue(aValue);
case eCSSCounterDesc_Fallback: {
nsString name;
if (!ParseCounterStyleName(name, false)) {
return false;
}
aValue.SetStringValue(name, eCSSUnit_Ident);
return true;
}
case eCSSCounterDesc_Symbols: {
nsCSSValueList* item = nullptr;
@ -4546,7 +4539,7 @@ CSSParserImpl::ParseCounterDescriptorValue(nsCSSCounterDesc aDescID,
// should always return in the loop
}
case eCSSCounterDesc_SpeakAs:
case eCSSCounterDesc_SpeakAs: {
if (ParseVariant(aValue, VARIANT_AUTO | VARIANT_KEYWORD,
nsCSSProps::kCounterSpeakAsKTable)) {
if (aValue.GetUnit() == eCSSUnit_Enumerated &&
@ -4558,7 +4551,13 @@ CSSParserImpl::ParseCounterDescriptorValue(nsCSSCounterDesc aDescID,
}
return true;
}
return ParseCounterStyleNameValue(aValue);
nsString name;
if (ParseCounterStyleName(name, false)) {
aValue.SetStringValue(name, eCSSUnit_Ident);
return true;
}
return false;
}
default:
NS_NOTREACHED("unknown descriptor");
@ -7207,16 +7206,16 @@ CSSParserImpl::ParseCounter(nsCSSValue& aValue)
}
// get optional type
int32_t typeItem = eCSSUnit_Counters == unit ? 2 : 1;
nsCSSValue& type = val->Item(typeItem);
nsString type = NS_LITERAL_STRING("decimal");
if (ExpectSymbol(',', true)) {
if (!ParseCounterStyleNameValue(type) && !ParseSymbols(type)) {
if (!ParseCounterStyleName(type, false)) {
break;
}
} else {
type.SetStringValue(NS_LITERAL_STRING("decimal"), eCSSUnit_Ident);
}
int32_t typeItem = eCSSUnit_Counters == unit ? 2 : 1;
val->Item(typeItem).SetStringValue(type, eCSSUnit_Ident);
if (!ExpectSymbol(')', true)) {
break;
}
@ -7295,54 +7294,6 @@ CSSParserImpl::ParseAttr(nsCSSValue& aValue)
return true;
}
bool
CSSParserImpl::ParseSymbols(nsCSSValue& aValue)
{
if (!GetToken(true)) {
return false;
}
if (mToken.mType != eCSSToken_Function &&
!mToken.mIdent.LowerCaseEqualsLiteral("symbols")) {
UngetToken();
return false;
}
nsRefPtr<nsCSSValue::Array> params = nsCSSValue::Array::Create(2);
nsCSSValue& type = params->Item(0);
nsCSSValue& symbols = params->Item(1);
if (!ParseEnum(type, nsCSSProps::kCounterSymbolsSystemKTable)) {
type.SetIntValue(NS_STYLE_COUNTER_SYSTEM_SYMBOLIC, eCSSUnit_Enumerated);
}
bool first = true;
nsCSSValueList* item = symbols.SetListValue();
for (;;) {
// FIXME Should also include VARIANT_IMAGE. See bug 1071436.
if (!ParseVariant(item->mValue, VARIANT_STRING, nullptr)) {
break;
}
if (ExpectSymbol(')', true)) {
if (first) {
switch (type.GetIntValue()) {
case NS_STYLE_COUNTER_SYSTEM_NUMERIC:
case NS_STYLE_COUNTER_SYSTEM_ALPHABETIC:
// require at least two symbols
return false;
}
}
aValue.SetArrayValue(params, eCSSUnit_Symbols);
return true;
}
item->mNext = new nsCSSValueList;
item = item->mNext;
first = false;
}
SkipUntil(')');
return false;
}
bool
CSSParserImpl::SetValueToURL(nsCSSValue& aValue, const nsString& aURL)
{
@ -12918,10 +12869,11 @@ CSSParserImpl::ParseListStyleType(nsCSSValue& aValue)
return true;
}
if (ParseCounterStyleNameValue(aValue) || ParseSymbols(aValue)) {
nsString name;
if (ParseCounterStyleName(name, false)) {
aValue.SetStringValue(name, eCSSUnit_Ident);
return true;
}
return false;
}

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

@ -1982,15 +1982,6 @@ const KTableValue nsCSSProps::kCounterSystemKTable[] = {
eCSSKeyword_UNKNOWN, -1
};
const KTableValue nsCSSProps::kCounterSymbolsSystemKTable[] = {
eCSSKeyword_cyclic, NS_STYLE_COUNTER_SYSTEM_CYCLIC,
eCSSKeyword_numeric, NS_STYLE_COUNTER_SYSTEM_NUMERIC,
eCSSKeyword_alphabetic, NS_STYLE_COUNTER_SYSTEM_ALPHABETIC,
eCSSKeyword_symbolic, NS_STYLE_COUNTER_SYSTEM_SYMBOLIC,
eCSSKeyword_fixed, NS_STYLE_COUNTER_SYSTEM_FIXED,
eCSSKeyword_UNKNOWN, -1
};
const KTableValue nsCSSProps::kCounterRangeKTable[] = {
eCSSKeyword_infinite, NS_STYLE_COUNTER_RANGE_INFINITE,
eCSSKeyword_UNKNOWN, -1

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

@ -657,7 +657,6 @@ public:
static const KTableValue kWritingModeKTable[];
static const KTableValue kHyphensKTable[];
static const KTableValue kCounterSystemKTable[];
static const KTableValue kCounterSymbolsSystemKTable[];
static const KTableValue kCounterRangeKTable[];
static const KTableValue kCounterSpeakAsKTable[];
};

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

@ -853,13 +853,12 @@ nsCSSValue::AppendToString(nsCSSProperty aProperty, nsAString& aResult,
nsStyleUtil::AppendEscapedCSSIdent(buffer, aResult);
}
}
else if (eCSSUnit_Array <= unit && unit <= eCSSUnit_Symbols) {
else if (eCSSUnit_Array <= unit && unit <= eCSSUnit_Steps) {
switch (unit) {
case eCSSUnit_Counter: aResult.AppendLiteral("counter("); break;
case eCSSUnit_Counters: aResult.AppendLiteral("counters("); break;
case eCSSUnit_Cubic_Bezier: aResult.AppendLiteral("cubic-bezier("); break;
case eCSSUnit_Steps: aResult.AppendLiteral("steps("); break;
case eCSSUnit_Symbols: aResult.AppendLiteral("symbols("); break;
default: break;
}
@ -867,9 +866,8 @@ nsCSSValue::AppendToString(nsCSSProperty aProperty, nsAString& aResult,
bool mark = false;
for (size_t i = 0, i_end = array->Count(); i < i_end; ++i) {
if (mark && array->Item(i).GetUnit() != eCSSUnit_Null) {
if ((unit == eCSSUnit_Array &&
eCSSProperty_transition_timing_function != aProperty) ||
unit == eCSSUnit_Symbols)
if (unit == eCSSUnit_Array &&
eCSSProperty_transition_timing_function != aProperty)
aResult.Append(' ');
else
aResult.AppendLiteral(", ");
@ -889,17 +887,6 @@ nsCSSValue::AppendToString(nsCSSProperty aProperty, nsAString& aResult,
}
continue;
}
if (unit == eCSSUnit_Symbols && i == 0) {
NS_ABORT_IF_FALSE(array->Item(i).GetUnit() == eCSSUnit_Enumerated,
"unexpected value");
int32_t system = array->Item(i).GetIntValue();
if (system != NS_STYLE_COUNTER_SYSTEM_SYMBOLIC) {
AppendASCIItoUTF16(nsCSSProps::ValueToKeyword(
system, nsCSSProps::kCounterSystemKTable), aResult);
mark = true;
}
continue;
}
nsCSSProperty prop =
((eCSSUnit_Counter <= unit && unit <= eCSSUnit_Counters) &&
i == array->Count() - 1)
@ -1418,7 +1405,6 @@ nsCSSValue::AppendToString(nsCSSProperty aProperty, nsAString& aResult,
case eCSSUnit_Attr:
case eCSSUnit_Cubic_Bezier:
case eCSSUnit_Steps:
case eCSSUnit_Symbols:
case eCSSUnit_Counter:
case eCSSUnit_Counters: aResult.Append(char16_t(')')); break;
case eCSSUnit_Local_Font: break;
@ -1525,7 +1511,6 @@ nsCSSValue::SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
case eCSSUnit_Counters:
case eCSSUnit_Cubic_Bezier:
case eCSSUnit_Steps:
case eCSSUnit_Symbols:
case eCSSUnit_Function:
case eCSSUnit_Calc:
case eCSSUnit_Calc_Plus:

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

@ -265,8 +265,7 @@ enum nsCSSUnit {
eCSSUnit_Counters = 22, // (nsCSSValue::Array*) a counters(string,string[,string]) value
eCSSUnit_Cubic_Bezier = 23, // (nsCSSValue::Array*) a list of float values
eCSSUnit_Steps = 24, // (nsCSSValue::Array*) a list of (integer, enumerated)
eCSSUnit_Symbols = 25, // (nsCSSValue::Array*) a symbols(enumerated, symbols) value
eCSSUnit_Function = 26, // (nsCSSValue::Array*) a function with
eCSSUnit_Function = 25, // (nsCSSValue::Array*) a function with
// parameters. First elem of array is name,
// an nsCSSKeyword as eCSSUnit_Enumerated,
// the rest of the values are arguments.

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

@ -1064,11 +1064,10 @@ nsComputedDOMStyle::DoGetContent()
NS_ABORT_IF_FALSE(eCSSUnit_None != a->Item(typeItem).GetUnit(),
"'none' should be handled as identifier value");
nsString type;
a->Item(typeItem).AppendToString(eCSSProperty_list_style_type,
type, nsCSSValue::eNormalized);
a->Item(typeItem).GetStringValue(type);
if (!type.LowerCaseEqualsLiteral("decimal")) {
str.AppendLiteral(", ");
str.Append(type);
nsStyleUtil::AppendEscapedCSSIdent(type, str);
}
str.Append(char16_t(')'));
@ -2978,42 +2977,12 @@ CSSValue*
nsComputedDOMStyle::DoGetListStyleType()
{
nsROCSSPrimitiveValue *val = new nsROCSSPrimitiveValue;
CounterStyle* style = StyleList()->GetCounterStyle();
AnonymousCounterStyle* anonymous = style->AsAnonymous();
if (!anonymous) {
// want SetIdent
nsString type;
StyleList()->GetListStyleType(type);
nsString value;
nsStyleUtil::AppendEscapedCSSIdent(type, value);
val->SetString(value);
} else {
nsAutoString tmp;
tmp.AppendLiteral("symbols(");
uint8_t system = anonymous->GetSystem();
NS_ASSERTION(system == NS_STYLE_COUNTER_SYSTEM_CYCLIC ||
system == NS_STYLE_COUNTER_SYSTEM_NUMERIC ||
system == NS_STYLE_COUNTER_SYSTEM_ALPHABETIC ||
system == NS_STYLE_COUNTER_SYSTEM_SYMBOLIC ||
system == NS_STYLE_COUNTER_SYSTEM_FIXED,
"Invalid system for anonymous counter style.");
if (system != NS_STYLE_COUNTER_SYSTEM_SYMBOLIC) {
AppendASCIItoUTF16(nsCSSProps::ValueToKeyword(
system, nsCSSProps::kCounterSystemKTable), tmp);
tmp.Append(' ');
}
const nsTArray<nsString>& symbols = anonymous->GetSymbols();
NS_ASSERTION(symbols.Length() > 0,
"No symbols in the anonymous counter style");
for (size_t i = 0, iend = symbols.Length(); i < iend; i++) {
nsStyleUtil::AppendEscapedCSSString(symbols[i], tmp);
tmp.Append(' ');
}
tmp.Replace(tmp.Length() - 1, 1, char16_t(')'));
val->SetString(tmp);
}
// want SetIdent
nsString type;
StyleList()->GetListStyleType(type);
nsString value;
nsStyleUtil::AppendEscapedCSSIdent(type, value);
val->SetString(value);
return val;
}

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

@ -7146,11 +7146,6 @@ nsRuleNode::ComputeListData(void* aStartStruct,
list->SetListStyleType(name, mPresContext);
break;
}
case eCSSUnit_Symbols:
list->SetListStyleType(NS_LITERAL_STRING(""),
mPresContext->CounterStyleManager()->
BuildCounterStyle(typeValue->GetArrayValue()));
break;
case eCSSUnit_Null:
break;
default:

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

@ -2354,7 +2354,7 @@ var gCSSProperties = {
type: CSS_TYPE_LONGHAND,
/* XXX needs to be on pseudo-elements */
initial_values: [ "normal", "none" ],
other_values: [ '""', "''", '"hello"', "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAKElEQVR42u3NQQ0AAAgEoNP+nTWFDzcoQE1udQQCgUAgEAgEAsGTYAGjxAE/G/Q2tQAAAABJRU5ErkJggg==)", "url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAKElEQVR42u3NQQ0AAAgEoNP+nTWFDzcoQE1udQQCgUAgEAgEAsGTYAGjxAE/G/Q2tQAAAABJRU5ErkJggg==')", 'url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAKElEQVR42u3NQQ0AAAgEoNP+nTWFDzcoQE1udQQCgUAgEAgEAsGTYAGjxAE/G/Q2tQAAAABJRU5ErkJggg==")', 'counter(foo)', 'counter(bar, upper-roman)', 'counters(foo, ".")', "counters(bar, '-', lower-greek)", "'-' counter(foo) '.'", "attr(title)", "open-quote", "close-quote", "no-open-quote", "no-close-quote", "close-quote attr(title) counters(foo, '.', upper-alpha)", "counter(foo, none)", "counters(bar, '.', none)", "attr(\\32)", "attr(\\2)", "attr(-\\2)", "attr(-\\32)", "counter(\\2)", "counters(\\32, '.')", "counter(-\\32, upper-roman)", "counters(-\\2, '-', lower-greek)", "counter(\\()", "counters(a\\+b, '.')", "counter(\\}, upper-alpha)", "-moz-alt-content", "counter(foo, symbols('*'))", "counter(foo, symbols(numeric '0' '1'))", "counters(foo, '.', symbols('*'))", "counters(foo, '.', symbols(numeric '0' '1'))" ],
other_values: [ '""', "''", '"hello"', "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAKElEQVR42u3NQQ0AAAgEoNP+nTWFDzcoQE1udQQCgUAgEAgEAsGTYAGjxAE/G/Q2tQAAAABJRU5ErkJggg==)", "url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAKElEQVR42u3NQQ0AAAgEoNP+nTWFDzcoQE1udQQCgUAgEAgEAsGTYAGjxAE/G/Q2tQAAAABJRU5ErkJggg==')", 'url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAKElEQVR42u3NQQ0AAAgEoNP+nTWFDzcoQE1udQQCgUAgEAgEAsGTYAGjxAE/G/Q2tQAAAABJRU5ErkJggg==")', 'counter(foo)', 'counter(bar, upper-roman)', 'counters(foo, ".")', "counters(bar, '-', lower-greek)", "'-' counter(foo) '.'", "attr(title)", "open-quote", "close-quote", "no-open-quote", "no-close-quote", "close-quote attr(title) counters(foo, '.', upper-alpha)", "counter(foo, none)", "counters(bar, '.', none)", "attr(\\32)", "attr(\\2)", "attr(-\\2)", "attr(-\\32)", "counter(\\2)", "counters(\\32, '.')", "counter(-\\32, upper-roman)", "counters(-\\2, '-', lower-greek)", "counter(\\()", "counters(a\\+b, '.')", "counter(\\}, upper-alpha)", "-moz-alt-content" ],
invalid_values: [ 'counters(foo)', 'counter(foo, ".")', 'attr("title")', "attr('title')", "attr(2)", "attr(-2)", "counter(2)", "counters(-2, '.')", "-moz-alt-content 'foo'", "'foo' -moz-alt-content" ]
},
"counter-increment": {
@ -2716,12 +2716,6 @@ var gCSSProperties = {
subproperties: [ "list-style-type", "list-style-position", "list-style-image" ],
initial_values: [ "outside", "disc", "disc outside", "outside disc", "disc none", "none disc", "none disc outside", "none outside disc", "disc none outside", "disc outside none", "outside none disc", "outside disc none" ],
other_values: [ "inside none", "none inside", "none none inside", "square", "none", "none none", "outside none none", "none outside none", "none none outside", "none outside", "outside none", "outside outside", "outside inside", "\\32 style", "\\32 style inside",
"symbols(\"*\" \"\\2020\" \"\\2021\" \"\\A7\")",
"symbols(cyclic \"*\" \"\\2020\" \"\\2021\" \"\\A7\")",
"inside symbols(\"*\" \"\\2020\" \"\\2021\" \"\\A7\")",
"symbols(\"*\" \"\\2020\" \"\\2021\" \"\\A7\") outside",
"none symbols(\"*\" \"\\2020\" \"\\2021\" \"\\A7\")",
"inside none symbols(\"*\" \"\\2020\" \"\\2021\" \"\\A7\")",
'url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAKElEQVR42u3NQQ0AAAgEoNP+nTWFDzcoQE1udQQCgUAgEAgEAsGTYAGjxAE/G/Q2tQAAAABJRU5ErkJggg==")',
'none url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAKElEQVR42u3NQQ0AAAgEoNP+nTWFDzcoQE1udQQCgUAgEAgEAsGTYAGjxAE/G/Q2tQAAAABJRU5ErkJggg==")',
'url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAKElEQVR42u3NQQ0AAAgEoNP+nTWFDzcoQE1udQQCgUAgEAgEAsGTYAGjxAE/G/Q2tQAAAABJRU5ErkJggg==") none',
@ -2792,9 +2786,7 @@ var gCSSProperties = {
"-moz-ethiopic-halehame", "-moz-ethiopic-numeric",
"-moz-ethiopic-halehame-am",
"-moz-ethiopic-halehame-ti-er", "-moz-ethiopic-halehame-ti-et",
"other-style", "inside", "outside", "\\32 style",
"symbols(\"*\" \"\\2020\" \"\\2021\" \"\\A7\")",
"symbols(cyclic '*' '\\2020' '\\2021' '\\A7')"
"other-style", "inside", "outside", "\\32 style"
],
invalid_values: []
},

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

@ -167,7 +167,7 @@ function test_system_dep_desc() {
},
tests: {
system: [
[null, "extends", "fixed", "cyclic", "extends symbols('*')"],
[null, "extends", "fixed", "cyclic"],
["extends cjk-decimal", "ExTends cjk-decimal", "extends CJK-decimal"],
],
symbols: [
@ -235,13 +235,13 @@ function test_system_indep_desc() {
[null, "0", "\"\"", "0 0", "a a", "0 a a"],
],
fallback: [
[null, "", "-", "0", "a b", "symbols('*')"],
[null, "", "-", "0", "a b"],
["a"],
["A"],
["decimal", "Decimal"],
],
speakAs: [
[null, "", "-", "0", "a b", "symbols('*')"],
[null, "", "-", "0", "a b"],
["auto", "AuTo"],
["bullets", "BULLETs"],
["numbers", "NumBers"],