From 5352b69a9286223272c0ed072900b4c78ba2ed7c Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Tue, 14 Apr 2020 21:24:51 -0400 Subject: Bug 1305458 - Changing -moz-appearence on hover breaks change event * Rename nsIDOMEventTarget::PreHandleEvent to nsIDOMEventTarget::GetEventTargetParent * Add nsIDOMEventTarget::PreHandleEvent * Add EventTargetChainItem::GetFirstEventTarget * Call EventTargetChainItem::PreHandleEvent even it sets mCanHandle=false * Move form control frame focus/blur from nsGenericHTMLFormElement::GetEventTargetParent to PreHandleEvent * Move fire change event from HTMLTextAreaElement::GetEventTargetParent to PreHandleEvent * Refine nsXULElement::GetEventTargetParent * Move dispatch XUL command from nsXULElement::GetEventTargetParent to PreHandleEvent * Move fire events and set value from HTMLInputElement::GetEventTargetParent to PreHandleEvent * Add test case * Let HTMLInputElement delegate event handling to it's parent class * Refine EventTargetChain flags to reduce overheads * Refine event target chain creation * Refine assertion in EventTargetChainItem::Create Tag #1375 --- dom/html/HTMLInputElement.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'dom/html/HTMLInputElement.h') diff --git a/dom/html/HTMLInputElement.h b/dom/html/HTMLInputElement.h index 98a590443..98c74893e 100644 --- a/dom/html/HTMLInputElement.h +++ b/dom/html/HTMLInputElement.h @@ -185,7 +185,9 @@ public: NS_IMETHOD_(bool) IsAttributeMapped(const nsIAtom* aAttribute) const override; virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const override; - virtual nsresult PreHandleEvent(EventChainPreVisitor& aVisitor) override; + virtual nsresult GetEventTargetParent( + EventChainPreVisitor& aVisitor) override; + virtual nsresult PreHandleEvent(EventChainVisitor& aVisitor) override; virtual nsresult PostHandleEvent( EventChainPostVisitor& aVisitor) override; void PostHandleEventForRangeThumb(EventChainPostVisitor& aVisitor); -- cgit v1.2.3 From 2f59167e65132fc652456ae8629c1246a9b4b2cb Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Thu, 16 Apr 2020 19:59:10 -0400 Subject: Bug 656197 - Push state updates further out across beforesetattr/aftersetattr * Remove the generic attr preparsing mechanism from BeforeSetAttr and just preparse class attributes directly in the one place that needs to do it * Move calls to BeforeSetAttr to after AttributeWillChange * Remove UpdateState calls in BeforeSetAttr * Move calls to AfterSetAttr to before UpdateState when manipulating attributes * Remove UpdateState calls from AfterSetAttr, since they are no longer needed there Tag #1375 --- dom/html/HTMLInputElement.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'dom/html/HTMLInputElement.h') diff --git a/dom/html/HTMLInputElement.h b/dom/html/HTMLInputElement.h index 98c74893e..86bc7d030 100644 --- a/dom/html/HTMLInputElement.h +++ b/dom/html/HTMLInputElement.h @@ -958,7 +958,7 @@ protected: * Called when an attribute is about to be changed */ virtual nsresult BeforeSetAttr(int32_t aNameSpaceID, nsIAtom* aName, - nsAttrValueOrString* aValue, + const nsAttrValueOrString* aValue, bool aNotify) override; /** * Called when an attribute has just been changed -- cgit v1.2.3 From ab05e6f9ad185a1f7c405fd29876edca9e0567ba Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Thu, 16 Apr 2020 20:02:55 -0400 Subject: Bug 1347640 - HTMLInputElement shouldn't try to cancel image request on all the type changes * Move the changing of HTMLInputElement's mType from ParseAttribute to AfterSetAttr * Move a few more things from AfterSetAttr to HandleTypeChange Tag #1375 --- dom/html/HTMLInputElement.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'dom/html/HTMLInputElement.h') diff --git a/dom/html/HTMLInputElement.h b/dom/html/HTMLInputElement.h index 86bc7d030..d6a078f0b 100644 --- a/dom/html/HTMLInputElement.h +++ b/dom/html/HTMLInputElement.h @@ -1100,7 +1100,7 @@ protected: /** * Manages the internal data storage across type changes. */ - void HandleTypeChange(uint8_t aNewType); + void HandleTypeChange(uint8_t aNewType, bool aNotify); /** * Sanitize the value of the element depending of its current type. -- cgit v1.2.3 From 091d06b43b294390a96106e57a7462f6303107a3 Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Fri, 17 Apr 2020 05:26:58 -0400 Subject: Bug 1363481 - Add the old attribute value as a parameter to Element::AfterSetAttr Tag #1375 --- dom/html/HTMLInputElement.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'dom/html/HTMLInputElement.h') diff --git a/dom/html/HTMLInputElement.h b/dom/html/HTMLInputElement.h index d6a078f0b..48807f733 100644 --- a/dom/html/HTMLInputElement.h +++ b/dom/html/HTMLInputElement.h @@ -964,7 +964,9 @@ protected: * Called when an attribute has just been changed */ virtual nsresult AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName, - const nsAttrValue* aValue, bool aNotify) override; + const nsAttrValue* aValue, + const nsAttrValue* aOldValue, + bool aNotify) override; /** * Dispatch a select event. Returns true if the event was not cancelled. -- cgit v1.2.3 From 4d1d777e706322cb9aca8ed2d5a6e50b805d3bd1 Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Fri, 17 Apr 2020 05:50:47 -0400 Subject: Bug 1373798 - Move HTML dir attribute state into event state flags * Stop calling SetHasDirAuto/ClearHasDirAuto in input element code * Introduce event state flags that track the state of an element's dir attribute * Rewrite our existing checks for the state of the dir attr on top of the new event state flags * Add pseudo-classes for matching on the dir attribute states * Use the new dir attribute pseudoclasses in html.css Tag #1375 --- dom/html/HTMLInputElement.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'dom/html/HTMLInputElement.h') diff --git a/dom/html/HTMLInputElement.h b/dom/html/HTMLInputElement.h index 48807f733..55bb59ec9 100644 --- a/dom/html/HTMLInputElement.h +++ b/dom/html/HTMLInputElement.h @@ -1122,7 +1122,7 @@ protected: */ nsresult SetDefaultValueAsValue(); - virtual void SetDirectionIfAuto(bool aAuto, bool aNotify); + void SetDirectionFromValue(bool aNotify); /** * Return if an element should have a specific validity UI -- cgit v1.2.3