From 47afabb81a21652b7d898501d9b68aef0dc47a35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Tue, 7 Jun 2022 23:09:53 +0000 Subject: [PATCH] Bug 1773070 - While at it use some better names for some bits. r=smaug Differential Revision: https://phabricator.services.mozilla.com/D148538 --- dom/base/rust/lib.rs | 8 ++++---- dom/html/HTMLButtonElement.cpp | 4 ++-- dom/html/HTMLElement.cpp | 4 ++-- dom/html/HTMLInputElement.cpp | 8 ++++---- dom/html/HTMLSelectElement.cpp | 12 ++++++------ dom/html/HTMLTextAreaElement.cpp | 8 ++++---- .../style/gecko/non_ts_pseudo_class_list.rs | 4 ++-- 7 files changed, 24 insertions(+), 24 deletions(-) diff --git a/dom/base/rust/lib.rs b/dom/base/rust/lib.rs index bb447c076f98..4eab231d3d23 100644 --- a/dom/base/rust/lib.rs +++ b/dom/base/rust/lib.rs @@ -41,10 +41,10 @@ bitflags! { const VALID = 1 << 10; /// 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; + /// + const USER_VALID = 1 << 12; + /// + 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 diff --git a/dom/html/HTMLButtonElement.cpp b/dom/html/HTMLButtonElement.cpp index 64a26dbd5fb4..0c359b9bb81a 100644 --- a/dom/html/HTMLButtonElement.cpp +++ b/dom/html/HTMLButtonElement.cpp @@ -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; } } diff --git a/dom/html/HTMLElement.cpp b/dom/html/HTMLElement.cpp index 41c6d35dc713..7768671fd13e 100644 --- a/dom/html/HTMLElement.cpp +++ b/dom/html/HTMLElement.cpp @@ -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; } } } diff --git a/dom/html/HTMLInputElement.cpp b/dom/html/HTMLInputElement.cpp index 9b8ff042677c..46f1feaff8f3 100644 --- a/dom/html/HTMLInputElement.cpp +++ b/dom/html/HTMLInputElement.cpp @@ -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 diff --git a/dom/html/HTMLSelectElement.cpp b/dom/html/HTMLSelectElement.cpp index 51124de91b98..20f3ddaabf2e 100644 --- a/dom/html/HTMLSelectElement.cpp +++ b/dom/html/HTMLSelectElement.cpp @@ -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; } } diff --git a/dom/html/HTMLTextAreaElement.cpp b/dom/html/HTMLTextAreaElement.cpp index 8ca0e2ac0785..5106ff000c3e 100644 --- a/dom/html/HTMLTextAreaElement.cpp +++ b/dom/html/HTMLTextAreaElement.cpp @@ -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; } } diff --git a/servo/components/style/gecko/non_ts_pseudo_class_list.rs b/servo/components/style/gecko/non_ts_pseudo_class_list.rs index d93fc95a509c..fabac104ad81 100644 --- a/servo/components/style/gecko/non_ts_pseudo_class_list.rs +++ b/servo/components/style/gecko/non_ts_pseudo_class_list.rs @@ -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, _),