1
0
mirror of https://github.com/roytam1/UXP.git synced 2026-05-26 13:58:49 +00:00

Issue #2790 - Cleanup: Remove debugging lines

This commit is contained in:
MeladJM
2025-07-26 04:07:54 +08:00
committed by roytam1
parent 156c755085
commit 459ed6ea85
6 changed files with 1 additions and 63 deletions
-2
View File
@@ -1270,13 +1270,11 @@ ComputeSelectorStateDependence(nsCSSSelector& aSelector)
continue;
}
// --- BEGIN PATCH: Explicit autofill state dependence ---
if (pseudoClass->mType == CSSPseudoClassType::autofill ||
pseudoClass->mType == CSSPseudoClassType::mozAutofillHighlight) {
states |= NS_EVENT_STATE_AUTOFILL;
continue;
}
// --- END PATCH ---
auto idx = static_cast<CSSPseudoClassTypeBase>(pseudoClass->mType);
states |= nsCSSPseudoClasses::sPseudoClassStateDependences[idx];
-2
View File
@@ -576,7 +576,6 @@ nsCSSRuleUtils::StateSelectorMatches(Element* aElement,
for (nsPseudoClassList* pseudoClass = aSelector->mPseudoClassList;
pseudoClass;
pseudoClass = pseudoClass->mNext) {
// --- Autofill explicit matching ---
if (pseudoClass->mType == CSSPseudoClassType::autofill ||
pseudoClass->mType == CSSPseudoClassType::mozAutofillHighlight) {
// Match if the element has the autofill state, regardless of focus
@@ -585,7 +584,6 @@ nsCSSRuleUtils::StateSelectorMatches(Element* aElement,
}
continue; // This pseudo-class matches
}
// --- End autofill explicit matching ---
auto idx = static_cast<CSSPseudoClassTypeBase>(pseudoClass->mType);
EventStates statesToCheck = nsCSSPseudoClasses::sPseudoClassStates[idx];
if (!statesToCheck.IsEmpty() && !StateSelectorMatches(aElement,
-32
View File
@@ -82,24 +82,8 @@ label {
/* Note: Values in nsNativeTheme IsWidgetStyled function
need to match textfield background/border values here */
/* Autofill persistent highlight styles */
input:-moz-autofill {
background-color: #FFEB3B !important;
background-image: none !important;
color: fieldtext !important;
}
input:-moz-autofill:hover,
input:-moz-autofill:focus,
input:-moz-autofill:active {
background-color: #FFEB3B !important;
background-image: none !important;
color: fieldtext !important;
}
input {
-moz-appearance: textfield;
appearance: textfield;
/* The sum of border and padding on block-start and block-end
must be the same here, for buttons, and for <select> (including its
internal padding magic) */
@@ -107,22 +91,6 @@ input {
border: 2px inset ThreeDLightShadow;
background-color: -moz-Field;
color: -moz-FieldText;
}
/* Autofill styles - make highlighting persist */
input:-moz-autofill {
background-color: #FFEB3B !important;
color: fieldtext !important;
background-image: none !important;
}
/* Ensure highlight persists on focus/hover/active states */
input:-moz-autofill:hover,
input:-moz-autofill:focus,
input:-moz-autofill:active {
background-color: #FFEB3B !important;
color: fieldtext !important;
background-image: none !important;
font: -moz-field;
text-rendering: optimizeLegibility;
line-height: normal;
@@ -250,29 +250,7 @@ FormHandler.prototype = {
}
fieldDetail.element.value = field.value;
// Add event listeners for debugging
// try {
// fieldDetail.element.addEventListener('focus', () => console.log('[JS] input focused'));
// fieldDetail.element.addEventListener('blur', () => console.log('[JS] input blurred'));
// fieldDetail.element.addEventListener('input', () => console.log('[JS] input event, value:', fieldDetail.element.value));
// } catch (e) {
// console.log('[JS] Could not add event listeners:', e);
// }
// if (typeof fieldDetail.element.setAutofilled === 'function') {
// if (field.value) {
// console.log('AUTOFILL: Calling setAutofilled(true) on element');
// fieldDetail.element.setAutofilled(true);
// console.log('AUTOFILL: setAutofilled(true) called successfully');
// } else {
// console.log('AUTOFILL: Calling setAutofilled(false) on element (empty value)');
// fieldDetail.element.setAutofilled(false);
// }
// } else {
// console.log('AUTOFILL: setAutofilled is not a function on this element');
// }
// Highlight: Set autofilled state for all autofilled fields
if (typeof fieldDetail.element.setAutofilled === 'function') {
fieldDetail.element.setAutofilled(!!field.value);
}
@@ -1220,7 +1220,7 @@ var LoginManagerContent = {
};
log("Saving autoFilledLogin", autoFilledLogin.guid, "for", form.rootElement);
this.stateForDocument(doc).fillsByRootElement.set(form.rootElement, autoFilledLogin);
// Patch: Set autofilled state if value is present
// Set autofilled state if value is present
if (typeof passwordField.setAutofilled === "function" && passwordField.value) {
passwordField.setAutofilled(true);
}
@@ -1347,10 +1347,6 @@ nsFormFillController::StopControllingInput()
nsresult rv;
nsCOMPtr <nsIFormAutoComplete> formAutoComplete =
do_GetService("@mozilla.org/satchel/form-autocomplete;1", &rv);
if (formAutoComplete) {
// PATCH: Do NOT call StopControllingInput here, so autofill state is NOT cleared on blur/focus.
// formAutoComplete->StopControllingInput(mFocusedInput);
}
mFocusedInputNode = nullptr;
mFocusedInput = nullptr;