зеркало из https://github.com/mozilla/pjs.git
Fix "normal" and "-moz-initial" values for "content" to do the right thing.
Bug 262624, r+sr=dbaron
This commit is contained in:
Родитель
52c05405ec
Коммит
9a37c7da84
|
@ -3917,11 +3917,14 @@ nsRuleNode::ComputeContentData(nsStyleStruct* aStartStruct,
|
|||
parentContent = parentContext->GetStyleContent();
|
||||
PRBool inherited = aInherited;
|
||||
|
||||
// content: [string, url, counter, attr, enum]+, inherit
|
||||
// content: [string, url, counter, attr, enum]+, normal, inherit
|
||||
PRUint32 count;
|
||||
nsAutoString buffer;
|
||||
nsCSSValueList* contentValue = contentData.mContent;
|
||||
if (contentValue) {
|
||||
// "normal" and "initial" both mean no content
|
||||
if (contentValue &&
|
||||
contentValue->mValue.GetUnit() != eCSSUnit_Normal &&
|
||||
contentValue->mValue.GetUnit() != eCSSUnit_Initial) {
|
||||
if (eCSSUnit_Inherit == contentValue->mValue.GetUnit()) {
|
||||
inherited = PR_TRUE;
|
||||
count = parentContent->ContentCount();
|
||||
|
|
|
@ -5149,7 +5149,8 @@ CSSParserImpl::DoParseRect(nsCSSRect& aRect, nsresult& aErrorCode)
|
|||
PRBool CSSParserImpl::ParseContent(nsresult& aErrorCode)
|
||||
{
|
||||
nsCSSValue value;
|
||||
if (ParseVariant(aErrorCode, value, VARIANT_CONTENT | VARIANT_INHERIT,
|
||||
if (ParseVariant(aErrorCode, value,
|
||||
VARIANT_CONTENT | VARIANT_INHERIT | VARIANT_NORMAL,
|
||||
nsCSSProps::kContentKTable)) {
|
||||
nsCSSValueList* listHead = new nsCSSValueList();
|
||||
nsCSSValueList* list = listHead;
|
||||
|
@ -5167,7 +5168,8 @@ PRBool CSSParserImpl::ParseContent(nsresult& aErrorCode)
|
|||
return PR_TRUE;
|
||||
}
|
||||
if (eCSSUnit_Inherit == value.GetUnit() ||
|
||||
eCSSUnit_Initial == value.GetUnit()) {
|
||||
eCSSUnit_Initial == value.GetUnit() ||
|
||||
eCSSUnit_Normal == value.GetUnit()) {
|
||||
// This only matters the first time through the loop.
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
|
|
@ -5149,7 +5149,8 @@ CSSParserImpl::DoParseRect(nsCSSRect& aRect, nsresult& aErrorCode)
|
|||
PRBool CSSParserImpl::ParseContent(nsresult& aErrorCode)
|
||||
{
|
||||
nsCSSValue value;
|
||||
if (ParseVariant(aErrorCode, value, VARIANT_CONTENT | VARIANT_INHERIT,
|
||||
if (ParseVariant(aErrorCode, value,
|
||||
VARIANT_CONTENT | VARIANT_INHERIT | VARIANT_NORMAL,
|
||||
nsCSSProps::kContentKTable)) {
|
||||
nsCSSValueList* listHead = new nsCSSValueList();
|
||||
nsCSSValueList* list = listHead;
|
||||
|
@ -5167,7 +5168,8 @@ PRBool CSSParserImpl::ParseContent(nsresult& aErrorCode)
|
|||
return PR_TRUE;
|
||||
}
|
||||
if (eCSSUnit_Inherit == value.GetUnit() ||
|
||||
eCSSUnit_Initial == value.GetUnit()) {
|
||||
eCSSUnit_Initial == value.GetUnit() ||
|
||||
eCSSUnit_Normal == value.GetUnit()) {
|
||||
// This only matters the first time through the loop.
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
|
|
@ -3917,11 +3917,14 @@ nsRuleNode::ComputeContentData(nsStyleStruct* aStartStruct,
|
|||
parentContent = parentContext->GetStyleContent();
|
||||
PRBool inherited = aInherited;
|
||||
|
||||
// content: [string, url, counter, attr, enum]+, inherit
|
||||
// content: [string, url, counter, attr, enum]+, normal, inherit
|
||||
PRUint32 count;
|
||||
nsAutoString buffer;
|
||||
nsCSSValueList* contentValue = contentData.mContent;
|
||||
if (contentValue) {
|
||||
// "normal" and "initial" both mean no content
|
||||
if (contentValue &&
|
||||
contentValue->mValue.GetUnit() != eCSSUnit_Normal &&
|
||||
contentValue->mValue.GetUnit() != eCSSUnit_Initial) {
|
||||
if (eCSSUnit_Inherit == contentValue->mValue.GetUnit()) {
|
||||
inherited = PR_TRUE;
|
||||
count = parentContent->ContentCount();
|
||||
|
|
Загрузка…
Ссылка в новой задаче