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/HTMLLinkElement.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'dom/html/HTMLLinkElement.h') diff --git a/dom/html/HTMLLinkElement.h b/dom/html/HTMLLinkElement.h index 421b149e9..1fa154f41 100644 --- a/dom/html/HTMLLinkElement.h +++ b/dom/html/HTMLLinkElement.h @@ -46,7 +46,8 @@ public: void UpdateImport(); // nsIDOMEventTarget - virtual nsresult PreHandleEvent(EventChainPreVisitor& aVisitor) override; + virtual nsresult GetEventTargetParent( + EventChainPreVisitor& aVisitor) override; virtual nsresult PostHandleEvent( EventChainPostVisitor& aVisitor) override; -- 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/HTMLLinkElement.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'dom/html/HTMLLinkElement.h') diff --git a/dom/html/HTMLLinkElement.h b/dom/html/HTMLLinkElement.h index 1fa154f41..9c69cfb13 100644 --- a/dom/html/HTMLLinkElement.h +++ b/dom/html/HTMLLinkElement.h @@ -62,7 +62,7 @@ public: virtual void UnbindFromTree(bool aDeep = true, bool aNullParent = true) override; virtual nsresult BeforeSetAttr(int32_t aNameSpaceID, nsIAtom* aName, - nsAttrValueOrString* aValue, + const nsAttrValueOrString* aValue, bool aNotify) override; virtual nsresult AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName, const nsAttrValue* aValue, -- 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/HTMLLinkElement.h | 1 + 1 file changed, 1 insertion(+) (limited to 'dom/html/HTMLLinkElement.h') diff --git a/dom/html/HTMLLinkElement.h b/dom/html/HTMLLinkElement.h index 9c69cfb13..acac955cb 100644 --- a/dom/html/HTMLLinkElement.h +++ b/dom/html/HTMLLinkElement.h @@ -66,6 +66,7 @@ public: bool aNotify) override; virtual nsresult AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName, const nsAttrValue* aValue, + const nsAttrValue* aOldValue, bool aNotify) override; virtual bool IsLink(nsIURI** aURI) const override; virtual already_AddRefed GetHrefURI() const override; -- cgit v1.2.3 From a9f337ea7ca1e8743c3f38645c525751a479a561 Mon Sep 17 00:00:00 2001 From: athenian200 Date: Tue, 21 Jul 2020 18:23:30 -0500 Subject: Issue #1629 - Part 1: Implement basic logic in HTMLLinkElement. So basically, I'm trying to adapt this to UXP: https://bugzilla.mozilla.org/show_bug.cgi?id=1281135 The earliest source of difficulty while adapting Bug 1281135 to our codebase was simply getting the new ErrorResult flag added to the SetDisabled function to play nice with the SetMozDisabled function. At this point, the implementation can actually have a stylesheet be disabled by default but there are supposedly issues with alternate stylesheets. At first I played around with the return type of SetMozDisabled to no avail, but I found another solution fairly quickly. https://bugzilla.mozilla.org/show_bug.cgi?id=846972 https://bugzilla.mozilla.org/show_bug.cgi?id=1157898 Essentially, the way around the problem of the number of return arguments not matching up is to declare a local variable within SetMozDisabled called ErrorResult rv, and using that to store the return value of the ErrorResult argument from SetDisabled. After that, because ErrorCode was removed, you would return rv.StealNSResult() in order to report success or failure to any consumer that calls on SetMozDisabled. --- dom/html/HTMLLinkElement.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'dom/html/HTMLLinkElement.h') diff --git a/dom/html/HTMLLinkElement.h b/dom/html/HTMLLinkElement.h index acac955cb..e024d42bb 100644 --- a/dom/html/HTMLLinkElement.h +++ b/dom/html/HTMLLinkElement.h @@ -86,8 +86,8 @@ public: virtual bool HasDeferredDNSPrefetchRequest() override; // WebIDL - bool Disabled(); - void SetDisabled(bool aDisabled); + bool Disabled() const; + void SetDisabled(bool aDisabled, ErrorResult& aRv); // XPCOM GetHref is fine. void SetHref(const nsAString& aHref, ErrorResult& aRv) { -- cgit v1.2.3 From 68623263573f5a087ad878f1609de272cc617399 Mon Sep 17 00:00:00 2001 From: athenian200 Date: Tue, 11 Aug 2020 05:27:40 -0500 Subject: Issue #1629 - Part 2: Implement the Explicitly Enabled flag. This part of the bug was significantly complicated by the following major refactors: https://bugzilla.mozilla.org/show_bug.cgi?id=1456435 https://bugzilla.mozilla.org/show_bug.cgi?id=1459498 As best as I can tell, we just need to implement the explicitly enabled flag on every instance of GetStyleSheetInfo, make sure aIsExplicitlyEnabled is false in every situation except the one where the disabled content attribute is removed from a link element, and enable alternate stylesheets if this flag is set on them. So we take the explicitly enabled flag as an input to PrepareSheet, and also add it to LoadStyleLink and LoadInlineStyle. I also decided not to defer loading of alternate stylesheets that have been explicitly enabled. --- dom/html/HTMLLinkElement.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'dom/html/HTMLLinkElement.h') diff --git a/dom/html/HTMLLinkElement.h b/dom/html/HTMLLinkElement.h index e024d42bb..190213028 100644 --- a/dom/html/HTMLLinkElement.h +++ b/dom/html/HTMLLinkElement.h @@ -181,10 +181,18 @@ protected: nsAString& aType, nsAString& aMedia, bool* aIsScoped, - bool* aIsAlternate) override; -protected: + bool* aIsAlternate, + bool* aIsExplicitlyEnabled) override; + RefPtr mRelList; + // The "explicitly enabled" flag. This flag is set whenever the 'disabled' + // attribute is explicitly unset, and makes alternate stylesheets not be + // disabled by default anymore. + // + // See https://github.com/whatwg/html/issues/3840#issuecomment-481034206. + bool mExplicitlyEnabled = false; + private: RefPtr mImportLoader; }; -- cgit v1.2.3 From a680bdc637e0393aaa08d575c66f7166b788b443 Mon Sep 17 00:00:00 2001 From: Moonchild Date: Wed, 23 Sep 2020 13:55:00 +0000 Subject: Issue #1656 - Part 1: Nuke most vim config lines in the tree. Since these are just interpreted comments, there's 0 impact on actual code. This removes all lines that match /* vim: set(.*)tw=80: */ with S&R -- there are a few others scattered around which will be removed manually in a second part. --- dom/html/HTMLLinkElement.h | 1 - 1 file changed, 1 deletion(-) (limited to 'dom/html/HTMLLinkElement.h') diff --git a/dom/html/HTMLLinkElement.h b/dom/html/HTMLLinkElement.h index 190213028..8575d5b49 100644 --- a/dom/html/HTMLLinkElement.h +++ b/dom/html/HTMLLinkElement.h @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* vim: set ts=8 sts=2 et sw=2 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -- cgit v1.2.3