зеркало из https://github.com/mozilla/pjs.git
Make empty string in ^= $= *= attribute selectors match nothing (and check for ~= although it already works). (Bug 420245) r+sr=dbaron
This commit is contained in:
Родитель
f22aac5075
Коммит
3cf1479a92
|
@ -1076,6 +1076,17 @@ static PRBool AttrMatchesValue(const nsAttrSelector* aAttrSelector,
|
|||
const nsString& aValue)
|
||||
{
|
||||
NS_PRECONDITION(aAttrSelector, "Must have an attribute selector");
|
||||
|
||||
// http://lists.w3.org/Archives/Public/www-style/2008Apr/0038.html
|
||||
// *= (CONTAINSMATCH) ~= (INCLUDES) ^= (BEGINSMATCH) $= (ENDSMATCH)
|
||||
// all accept the empty string, but match nothing.
|
||||
if (aAttrSelector->mValue.IsEmpty() &&
|
||||
(aAttrSelector->mFunction == NS_ATTR_FUNC_INCLUDES ||
|
||||
aAttrSelector->mFunction == NS_ATTR_FUNC_ENDSMATCH ||
|
||||
aAttrSelector->mFunction == NS_ATTR_FUNC_BEGINSMATCH ||
|
||||
aAttrSelector->mFunction == NS_ATTR_FUNC_CONTAINSMATCH))
|
||||
return PR_FALSE;
|
||||
|
||||
const nsDefaultStringComparator defaultComparator;
|
||||
const nsCaseInsensitiveStringComparator ciComparator;
|
||||
const nsStringComparator& comparator = aAttrSelector->mCaseSensitive
|
||||
|
|
Загрузка…
Ссылка в новой задаче