Bug 926546 - Modify assertion in nsComputedDOMStyle::GetPropertyCSSValue to mention the pseudo-element concerned to aid debugging. r=dbaron

This commit is contained in:
Jonathan Watt 2013-11-06 10:05:18 +00:00
parent 0d6ce00781
commit 4cb02e2c56

View File

@ -672,10 +672,14 @@ nsComputedDOMStyle::GetPropertyCSSValue(const nsAString& aPropertyName, ErrorRes
while (topWithPseudoElementData->GetParent()->HasPseudoElementData()) {
topWithPseudoElementData = topWithPseudoElementData->GetParent();
}
NS_ASSERTION(nsCSSPseudoElements::PseudoElementContainsElements(
topWithPseudoElementData->GetPseudo()),
"we should be in a pseudo-element that is expected to "
"contain elements");
nsIAtom* pseudo = topWithPseudoElementData->GetPseudo();
nsAutoString assertMsg =
NS_LITERAL_STRING("we should be in a pseudo-element that is expected "
"to contain elements (") +
nsDependentString(pseudo->GetUTF16String()) +
NS_LITERAL_STRING(")");
NS_ASSERTION(nsCSSPseudoElements::PseudoElementContainsElements(pseudo),
NS_LossyConvertUTF16toASCII(assertMsg).get());
}
#endif
// Need to resolve a style context