Change some users of GetAttr to HasAttr instead. Bug 113564, r=jag, sr=jst.

This commit is contained in:
bzbarsky%mit.edu 2002-01-13 04:03:52 +00:00
Родитель fc030b3f78
Коммит 4668370855
4 изменённых файлов: 14 добавлений и 20 удалений

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

@ -872,11 +872,10 @@ HTMLStyleSheetImpl::HasStateDependentStyle(StateRuleProcessorData* aData,
aData->mStyledContent &&
aData->mIsHTMLContent &&
aData->mContentTag == nsHTMLAtoms::a) {
nsAutoString href;
nsresult attrState =
aData->mStyledContent->GetAttr(kNameSpaceID_None,
nsHTMLAtoms::href, href);
if (NS_CONTENT_ATTR_HAS_VALUE == attrState)
PRBool hasHrefAttr =
aData->mStyledContent->HasAttr(kNameSpaceID_None,
nsHTMLAtoms::href);
if (hasHrefAttr)
result = NS_OK; // yes, style will depend on link state
}

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

@ -5077,11 +5077,9 @@ nsCSSFrameConstructor::ConstructXULFrame(nsIPresShell* aPresShell,
else if (aTag == nsXULAtoms::text || aTag == nsHTMLAtoms::label ||
aTag == nsXULAtoms::description) {
isReplaced = PR_TRUE;
if (aTag == nsHTMLAtoms::label || aTag == nsXULAtoms::description) {
nsAutoString value;
if (aContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::value, value) ==
NS_CONTENT_ATTR_NOT_THERE)
return NS_OK;
if ((aTag == nsHTMLAtoms::label || aTag == nsXULAtoms::description) &&
(! aContent->HasAttr(kNameSpaceID_None, nsHTMLAtoms::value))) {
return NS_OK;
}
rv = NS_NewTextBoxFrame(aPresShell, &newFrame);
}

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

@ -5077,11 +5077,9 @@ nsCSSFrameConstructor::ConstructXULFrame(nsIPresShell* aPresShell,
else if (aTag == nsXULAtoms::text || aTag == nsHTMLAtoms::label ||
aTag == nsXULAtoms::description) {
isReplaced = PR_TRUE;
if (aTag == nsHTMLAtoms::label || aTag == nsXULAtoms::description) {
nsAutoString value;
if (aContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::value, value) ==
NS_CONTENT_ATTR_NOT_THERE)
return NS_OK;
if ((aTag == nsHTMLAtoms::label || aTag == nsXULAtoms::description) &&
(! aContent->HasAttr(kNameSpaceID_None, nsHTMLAtoms::value))) {
return NS_OK;
}
rv = NS_NewTextBoxFrame(aPresShell, &newFrame);
}

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

@ -872,11 +872,10 @@ HTMLStyleSheetImpl::HasStateDependentStyle(StateRuleProcessorData* aData,
aData->mStyledContent &&
aData->mIsHTMLContent &&
aData->mContentTag == nsHTMLAtoms::a) {
nsAutoString href;
nsresult attrState =
aData->mStyledContent->GetAttr(kNameSpaceID_None,
nsHTMLAtoms::href, href);
if (NS_CONTENT_ATTR_HAS_VALUE == attrState)
PRBool hasHrefAttr =
aData->mStyledContent->HasAttr(kNameSpaceID_None,
nsHTMLAtoms::href);
if (hasHrefAttr)
result = NS_OK; // yes, style will depend on link state
}