本文整理汇总了C++中HTMLFieldSetElement::UpdateValidity方法的典型用法代码示例。如果您正苦于以下问题:C++ HTMLFieldSetElement::UpdateValidity方法的具体用法?C++ HTMLFieldSetElement::UpdateValidity怎么用?C++ HTMLFieldSetElement::UpdateValidity使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTMLFieldSetElement
的用法示例。
在下文中一共展示了HTMLFieldSetElement::UpdateValidity方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void
nsIConstraintValidation::SetBarredFromConstraintValidation(bool aBarred)
{
bool previousBarred = mBarredFromConstraintValidation;
mBarredFromConstraintValidation = aBarred;
// Inform the form and fieldset elements if our status regarding constraint
// validation is going to change.
if (!IsValid() && previousBarred != mBarredFromConstraintValidation) {
nsCOMPtr<nsIFormControl> formCtrl = do_QueryInterface(this);
NS_ASSERTION(formCtrl, "This interface should be used by form elements!");
// If the element is going to be barred from constraint validation, we can
// inform the form and fieldset that we are now valid. Otherwise, we are now
// invalid.
HTMLFormElement* form =
static_cast<HTMLFormElement*>(formCtrl->GetFormElement());
if (form) {
form->UpdateValidity(aBarred);
}
HTMLFieldSetElement* fieldSet = formCtrl->GetFieldSet();
if (fieldSet) {
fieldSet->UpdateValidity(aBarred);
}
}
}
示例2: IsValid
void
nsIConstraintValidation::SetValidityState(ValidityStateType aState,
bool aValue)
{
bool previousValidity = IsValid();
if (aValue) {
mValidityBitField |= aState;
} else {
mValidityBitField &= ~aState;
}
// Inform the form and fieldset elements if our validity has changed.
if (previousValidity != IsValid() && IsCandidateForConstraintValidation()) {
nsCOMPtr<nsIFormControl> formCtrl = do_QueryInterface(this);
NS_ASSERTION(formCtrl, "This interface should be used by form elements!");
HTMLFormElement* form =
static_cast<HTMLFormElement*>(formCtrl->GetFormElement());
if (form) {
form->UpdateValidity(IsValid());
}
HTMLFieldSetElement* fieldSet = formCtrl->GetFieldSet();
if (fieldSet) {
fieldSet->UpdateValidity(IsValid());
}
}
}