Bug 595922 - tooltips should not show form validation message if the form element has @novalidate. r+a=sicking
This commit is contained in:
@@ -1111,7 +1111,17 @@ DefaultTooltipTextProvider::GetNodeText(nsIDOMNode *aNode, PRUnichar **aText,
|
||||
if (cvElement) {
|
||||
nsCOMPtr<nsIContent> content = do_QueryInterface(cvElement);
|
||||
nsCOMPtr<nsIAtom> titleAtom = do_GetAtom("title");
|
||||
if (content->HasAttr(kNameSpaceID_None, titleAtom)) {
|
||||
|
||||
nsCOMPtr<nsIFormControl> formControl = do_QueryInterface(content);
|
||||
PRBool formHasNoValidate = PR_FALSE;
|
||||
mozilla::dom::Element* form = formControl->GetFormElement();
|
||||
if (form) {
|
||||
nsCOMPtr<nsIAtom> noValidateAtom = do_GetAtom("novalidate");
|
||||
formHasNoValidate = form->HasAttr(kNameSpaceID_None, noValidateAtom);
|
||||
}
|
||||
|
||||
if (!content->HasAttr(kNameSpaceID_None, titleAtom) &&
|
||||
!formHasNoValidate) {
|
||||
cvElement->GetValidationMessage(outText);
|
||||
found = !outText.IsEmpty();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user