Fix two case-sensitivity issues with attribute selectors. b=229172 Patch from Gilles Durys <mozbug@durys.net>. r+sr=dbaron
git-svn-id: svn://10.0.0.236/trunk@150779 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
85802c6a61
commit
d0f32a43bc
@ -2062,8 +2062,10 @@ void CSSParserImpl::ParseAttributeSelector(PRInt32& aDataMask,
|
||||
static const char* caseSensitiveHTMLAttribute[] = {
|
||||
// list based on http://www.w3.org/TR/REC-html40/index/attributes.html
|
||||
"abbr", "alt", "label",
|
||||
"prompt", "standby", "summary",
|
||||
"title", nsnull
|
||||
"prompt", "standby", "summary",
|
||||
"title", "class", "archive",
|
||||
"cite", "datetime", "href",
|
||||
"name", nsnull
|
||||
};
|
||||
short i = 0;
|
||||
const char* htmlAttr;
|
||||
|
||||
@ -3423,8 +3423,13 @@ static PRBool AttrMatchesValue(const nsAttrSelector* aAttrSelector,
|
||||
nsCaseInsensitiveStringComparator());
|
||||
}
|
||||
case NS_ATTR_FUNC_CONTAINSMATCH:
|
||||
return FindInReadable(aAttrSelector->mValue, aValue,
|
||||
nsCaseInsensitiveStringComparator());
|
||||
if (isCaseSensitive) {
|
||||
return FindInReadable(aAttrSelector->mValue, aValue);
|
||||
}
|
||||
else {
|
||||
return FindInReadable(aAttrSelector->mValue, aValue,
|
||||
nsCaseInsensitiveStringComparator());
|
||||
}
|
||||
default:
|
||||
NS_NOTREACHED("Shouldn't be ending up here");
|
||||
return PR_FALSE;
|
||||
|
||||
@ -2062,8 +2062,10 @@ void CSSParserImpl::ParseAttributeSelector(PRInt32& aDataMask,
|
||||
static const char* caseSensitiveHTMLAttribute[] = {
|
||||
// list based on http://www.w3.org/TR/REC-html40/index/attributes.html
|
||||
"abbr", "alt", "label",
|
||||
"prompt", "standby", "summary",
|
||||
"title", nsnull
|
||||
"prompt", "standby", "summary",
|
||||
"title", "class", "archive",
|
||||
"cite", "datetime", "href",
|
||||
"name", nsnull
|
||||
};
|
||||
short i = 0;
|
||||
const char* htmlAttr;
|
||||
|
||||
@ -3423,8 +3423,13 @@ static PRBool AttrMatchesValue(const nsAttrSelector* aAttrSelector,
|
||||
nsCaseInsensitiveStringComparator());
|
||||
}
|
||||
case NS_ATTR_FUNC_CONTAINSMATCH:
|
||||
return FindInReadable(aAttrSelector->mValue, aValue,
|
||||
nsCaseInsensitiveStringComparator());
|
||||
if (isCaseSensitive) {
|
||||
return FindInReadable(aAttrSelector->mValue, aValue);
|
||||
}
|
||||
else {
|
||||
return FindInReadable(aAttrSelector->mValue, aValue,
|
||||
nsCaseInsensitiveStringComparator());
|
||||
}
|
||||
default:
|
||||
NS_NOTREACHED("Shouldn't be ending up here");
|
||||
return PR_FALSE;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user