зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1773070 - While at it use some better names for some bits. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D148538
This commit is contained in:
Родитель
03dad94e95
Коммит
47afabb81a
|
@ -41,10 +41,10 @@ bitflags! {
|
|||
const VALID = 1 << 10;
|
||||
/// <https://html.spec.whatwg.org/multipage/#selector-invalid>
|
||||
const INVALID = 1 << 11;
|
||||
/// Non-standard: https://developer.mozilla.org/en-US/docs/Web/CSS/:-moz-ui-valid
|
||||
const MOZ_UI_VALID = 1 << 12;
|
||||
/// Non-standard: https://developer.mozilla.org/en-US/docs/Web/CSS/:-moz-ui-invalid
|
||||
const MOZ_UI_INVALID = 1 << 13;
|
||||
/// <https://drafts.csswg.org/selectors-4/#user-valid-pseudo>
|
||||
const USER_VALID = 1 << 12;
|
||||
/// <https://drafts.csswg.org/selectors-4/#user-invalid-pseudo>
|
||||
const USER_INVALID = 1 << 13;
|
||||
/// Non-standard: https://developer.mozilla.org/en-US/docs/Web/CSS/:-moz-broken
|
||||
const BROKEN = 1 << 14;
|
||||
/// Non-standard: https://developer.mozilla.org/en-US/docs/Web/CSS/:-moz-loading
|
||||
|
|
|
@ -399,9 +399,9 @@ ElementState HTMLButtonElement::IntrinsicState() const {
|
|||
|
||||
if (IsCandidateForConstraintValidation()) {
|
||||
if (IsValid()) {
|
||||
state |= ElementState::VALID | ElementState::MOZ_UI_VALID;
|
||||
state |= ElementState::VALID | ElementState::USER_VALID;
|
||||
} else {
|
||||
state |= ElementState::INVALID | ElementState::MOZ_UI_INVALID;
|
||||
state |= ElementState::INVALID | ElementState::USER_INVALID;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -203,9 +203,9 @@ ElementState HTMLElement::IntrinsicState() const {
|
|||
if (ElementInternals* internals = GetElementInternals()) {
|
||||
if (internals->IsCandidateForConstraintValidation()) {
|
||||
if (internals->IsValid()) {
|
||||
state |= ElementState::VALID | ElementState::MOZ_UI_VALID;
|
||||
state |= ElementState::VALID | ElementState::USER_VALID;
|
||||
} else {
|
||||
state |= ElementState::INVALID | ElementState::MOZ_UI_INVALID;
|
||||
state |= ElementState::INVALID | ElementState::USER_INVALID;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5955,7 +5955,7 @@ ElementState HTMLInputElement::IntrinsicState() const {
|
|||
|
||||
if (GetValidityState(VALIDITY_STATE_CUSTOM_ERROR) ||
|
||||
(mCanShowInvalidUI && ShouldShowValidityUI())) {
|
||||
state |= ElementState::MOZ_UI_INVALID;
|
||||
state |= ElementState::USER_INVALID;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -5967,9 +5967,9 @@ ElementState HTMLInputElement::IntrinsicState() const {
|
|||
// 3. The element has already been modified or the user tried to submit the
|
||||
// form owner while invalid.
|
||||
if (mCanShowValidUI && ShouldShowValidityUI() &&
|
||||
(IsValid() || (!state.HasState(ElementState::MOZ_UI_INVALID) &&
|
||||
!mCanShowInvalidUI))) {
|
||||
state |= ElementState::MOZ_UI_VALID;
|
||||
(IsValid() ||
|
||||
(!state.HasState(ElementState::USER_INVALID) && !mCanShowInvalidUI))) {
|
||||
state |= ElementState::USER_VALID;
|
||||
}
|
||||
|
||||
// :in-range and :out-of-range only apply if the element currently has a
|
||||
|
|
|
@ -1207,8 +1207,8 @@ nsresult HTMLSelectElement::PostHandleEvent(EventChainPostVisitor& aVisitor) {
|
|||
// UI while focused.
|
||||
mCanShowValidUI = ShouldShowValidityUI();
|
||||
|
||||
// We don't have to update ElementState::MOZ_UI_INVALID nor
|
||||
// ElementState::MOZ_UI_VALID given that the states should not change.
|
||||
// We don't have to update ElementState::USER_INVALID nor
|
||||
// ElementState::USER_VALID given that the states should not change.
|
||||
} else if (aVisitor.mEvent->mMessage == eBlur) {
|
||||
mCanShowInvalidUI = true;
|
||||
mCanShowValidUI = true;
|
||||
|
@ -1231,7 +1231,7 @@ ElementState HTMLSelectElement::IntrinsicState() const {
|
|||
|
||||
if (GetValidityState(VALIDITY_STATE_CUSTOM_ERROR) ||
|
||||
(mCanShowInvalidUI && ShouldShowValidityUI())) {
|
||||
state |= ElementState::MOZ_UI_INVALID;
|
||||
state |= ElementState::USER_INVALID;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1243,9 +1243,9 @@ ElementState HTMLSelectElement::IntrinsicState() const {
|
|||
// 3. The element has already been modified or the user tried to submit the
|
||||
// form owner while invalid.
|
||||
if (mCanShowValidUI && ShouldShowValidityUI() &&
|
||||
(IsValid() || (state.HasState(ElementState::MOZ_UI_INVALID) &&
|
||||
!mCanShowInvalidUI))) {
|
||||
state |= ElementState::MOZ_UI_VALID;
|
||||
(IsValid() ||
|
||||
(state.HasState(ElementState::USER_INVALID) && !mCanShowInvalidUI))) {
|
||||
state |= ElementState::USER_VALID;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -761,7 +761,7 @@ ElementState HTMLTextAreaElement::IntrinsicState() const {
|
|||
// error.
|
||||
if (GetValidityState(VALIDITY_STATE_CUSTOM_ERROR) ||
|
||||
(mCanShowInvalidUI && ShouldShowValidityUI())) {
|
||||
state |= ElementState::MOZ_UI_INVALID;
|
||||
state |= ElementState::USER_INVALID;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -773,9 +773,9 @@ ElementState HTMLTextAreaElement::IntrinsicState() const {
|
|||
// 3. The element has already been modified or the user tried to submit the
|
||||
// form owner while invalid.
|
||||
if (mCanShowValidUI && ShouldShowValidityUI() &&
|
||||
(IsValid() || (state.HasState(ElementState::MOZ_UI_INVALID) &&
|
||||
!mCanShowInvalidUI))) {
|
||||
state |= ElementState::MOZ_UI_VALID;
|
||||
(IsValid() ||
|
||||
(state.HasState(ElementState::USER_INVALID) && !mCanShowInvalidUI))) {
|
||||
state |= ElementState::USER_VALID;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -78,8 +78,8 @@ macro_rules! apply_non_ts_list {
|
|||
("placeholder-shown", PlaceholderShown, PLACEHOLDER_SHOWN, _),
|
||||
("read-only", ReadOnly, READONLY, _),
|
||||
("read-write", ReadWrite, READWRITE, _),
|
||||
("user-valid", UserValid, MOZ_UI_VALID, _),
|
||||
("user-invalid", UserInvalid, MOZ_UI_INVALID, _),
|
||||
("user-valid", UserValid, USER_VALID, _),
|
||||
("user-invalid", UserInvalid, USER_INVALID, _),
|
||||
("-moz-meter-optimum", MozMeterOptimum, OPTIMUM, _),
|
||||
("-moz-meter-sub-optimum", MozMeterSubOptimum, SUB_OPTIMUM, _),
|
||||
("-moz-meter-sub-sub-optimum", MozMeterSubSubOptimum, SUB_SUB_OPTIMUM, _),
|
||||
|
|
Загрузка…
Ссылка в новой задаче