Bug 605277 - Do not show the form validation error message in the tooltip if title is set. r+a=sicking
This commit is contained in:
@@ -1105,12 +1105,16 @@ DefaultTooltipTextProvider::GetNodeText(nsIDOMNode *aNode, PRUnichar **aText,
|
||||
PRBool found = PR_FALSE;
|
||||
nsCOMPtr<nsIDOMNode> current ( aNode );
|
||||
|
||||
// If the element implement the constraint validation API,
|
||||
// show the validation message, if any, instead of the title.
|
||||
// If the element implement the constraint validation API and has no title,
|
||||
// show the validation message, if any.
|
||||
nsCOMPtr<nsIConstraintValidation> cvElement = do_QueryInterface(current);
|
||||
if (cvElement) {
|
||||
cvElement->GetValidationMessage(outText);
|
||||
found = !outText.IsEmpty();
|
||||
nsCOMPtr<nsIContent> content = do_QueryInterface(cvElement);
|
||||
nsCOMPtr<nsIAtom> titleAtom = do_GetAtom("title");
|
||||
if (content->HasAttr(kNameSpaceID_None, titleAtom)) {
|
||||
cvElement->GetValidationMessage(outText);
|
||||
found = !outText.IsEmpty();
|
||||
}
|
||||
}
|
||||
|
||||
while ( !found && current ) {
|
||||
|
||||
Reference in New Issue
Block a user