mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-30 12:27:29 +09:00
Issue #2790 - Part 3: Address BZ bug 1849122 and resolve build issues
This commit is contained in:
parent
d99eab0d9d
commit
4cdfb9e16b
4 changed files with 33 additions and 4 deletions
|
|
@ -1603,6 +1603,16 @@ private:
|
||||||
|
|
||||||
// Data members
|
// Data members
|
||||||
EventStates mState;
|
EventStates mState;
|
||||||
|
|
||||||
|
public:
|
||||||
|
// Public helper to add or remove event states
|
||||||
|
void SetEventState(mozilla::EventStates aState, bool aAdd) {
|
||||||
|
if (aAdd) {
|
||||||
|
this->AddStates(aState);
|
||||||
|
} else {
|
||||||
|
this->RemoveStates(aState);
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class RemoveFromBindingManagerRunnable : public mozilla::Runnable
|
class RemoveFromBindingManagerRunnable : public mozilla::Runnable
|
||||||
|
|
|
||||||
|
|
@ -4067,7 +4067,11 @@ nsDOMWindowUtils::AddElementEventState(nsIDOMElement* aElement, uint64_t aState)
|
||||||
if (!content) {
|
if (!content) {
|
||||||
return NS_ERROR_INVALID_ARG;
|
return NS_ERROR_INVALID_ARG;
|
||||||
}
|
}
|
||||||
content->AddStates(mozilla::EventStates(aState));
|
mozilla::dom::Element* element = static_cast<mozilla::dom::Element*>(content.get());
|
||||||
|
if (!element) {
|
||||||
|
return NS_ERROR_INVALID_ARG;
|
||||||
|
}
|
||||||
|
element->SetEventState(mozilla::EventStates(aState), true);
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -4079,6 +4083,10 @@ nsDOMWindowUtils::RemoveElementEventState(nsIDOMElement* aElement, uint64_t aSta
|
||||||
if (!content) {
|
if (!content) {
|
||||||
return NS_ERROR_INVALID_ARG;
|
return NS_ERROR_INVALID_ARG;
|
||||||
}
|
}
|
||||||
content->RemoveStates(mozilla::EventStates(aState));
|
mozilla::dom::Element* element = static_cast<mozilla::dom::Element*>(content.get());
|
||||||
|
if (!element) {
|
||||||
|
return NS_ERROR_INVALID_ARG;
|
||||||
|
}
|
||||||
|
element->SetEventState(mozilla::EventStates(aState), false);
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -63,8 +63,6 @@ public:
|
||||||
explicit nsDOMWindowUtils(nsGlobalWindow *aWindow);
|
explicit nsDOMWindowUtils(nsGlobalWindow *aWindow);
|
||||||
NS_DECL_ISUPPORTS
|
NS_DECL_ISUPPORTS
|
||||||
NS_DECL_NSIDOMWINDOWUTILS
|
NS_DECL_NSIDOMWINDOWUTILS
|
||||||
NS_IMETHOD AddElementEventState(nsIDOMElement* aElement, uint64_t aState) override;
|
|
||||||
NS_IMETHOD RemoveElementEventState(nsIDOMElement* aElement, uint64_t aState) override;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
~nsDOMWindowUtils();
|
~nsDOMWindowUtils();
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,19 @@ function FormHandler(aForm, aWindow) {
|
||||||
this.window = aWindow;
|
this.window = aWindow;
|
||||||
|
|
||||||
this.fieldDetails = [];
|
this.fieldDetails = [];
|
||||||
|
|
||||||
|
// Add a reset event listener to clear autofill state
|
||||||
|
this.form.addEventListener("reset", () => {
|
||||||
|
console.log('Form reset detected, clearing autofill state');
|
||||||
|
for (let element of this.form.elements) {
|
||||||
|
if (typeof element.setAutofilled === "function") {
|
||||||
|
element.setAutofilled(false);
|
||||||
|
console.log('setAutofilled(false) called on', element);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Optionally, clear fieldDetails if you want to force re-collection
|
||||||
|
// this.fieldDetails = [];
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
FormHandler.prototype = {
|
FormHandler.prototype = {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue