From 6c40f8a40b19ecd124b0b1e5485c45637e716bc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Sun, 19 Mar 2017 12:00:50 +0100 Subject: [PATCH] Bug 1296516: Tidy RestyleManager::ContentStateChanged. r=heycam MozReview-Commit-ID: 7iWc6JvljhT --- layout/base/GeckoRestyleManager.cpp | 5 ++--- layout/base/GeckoRestyleManager.h | 4 ++-- layout/base/RestyleManager.h | 4 ++-- layout/base/RestyleManagerInlines.h | 2 +- layout/base/ServoRestyleManager.cpp | 6 ++---- layout/base/ServoRestyleManager.h | 3 +-- 6 files changed, 10 insertions(+), 14 deletions(-) diff --git a/layout/base/GeckoRestyleManager.cpp b/layout/base/GeckoRestyleManager.cpp index f20b84c88486..40f83f612284 100644 --- a/layout/base/GeckoRestyleManager.cpp +++ b/layout/base/GeckoRestyleManager.cpp @@ -200,14 +200,14 @@ ElementForStyleContext(nsIContent* aParentContent, // Forwarded nsIDocumentObserver method, to handle restyling (and // passing the notification to the frame). -nsresult +void GeckoRestyleManager::ContentStateChanged(nsIContent* aContent, EventStates aStateMask) { // XXXbz it would be good if this function only took Elements, but // we'd have to make ESM guarantee that usefully. if (!aContent->IsElement()) { - return NS_OK; + return; } Element* aElement = aContent->AsElement(); @@ -217,7 +217,6 @@ GeckoRestyleManager::ContentStateChanged(nsIContent* aContent, ContentStateChangedInternal(aElement, aStateMask, &changeHint, &restyleHint); PostRestyleEvent(aElement, restyleHint, changeHint); - return NS_OK; } // Forwarded nsIMutationObserver method, to handle restyling. diff --git a/layout/base/GeckoRestyleManager.h b/layout/base/GeckoRestyleManager.h index cf599a4d2076..b228d119b0c4 100644 --- a/layout/base/GeckoRestyleManager.h +++ b/layout/base/GeckoRestyleManager.h @@ -54,8 +54,8 @@ protected: public: // Forwarded nsIDocumentObserver method, to handle restyling (and // passing the notification to the frame). - nsresult ContentStateChanged(nsIContent* aContent, - EventStates aStateMask); + void ContentStateChanged(nsIContent* aContent, + EventStates aStateMask); // Forwarded nsIMutationObserver method, to handle restyling. void AttributeWillChange(Element* aElement, diff --git a/layout/base/RestyleManager.h b/layout/base/RestyleManager.h index f973323cc279..39e06efd2435 100644 --- a/layout/base/RestyleManager.h +++ b/layout/base/RestyleManager.h @@ -174,8 +174,8 @@ public: inline void PostRebuildAllStyleDataEvent(nsChangeHint aExtraHint, nsRestyleHint aRestyleHint); inline void ProcessPendingRestyles(); - inline nsresult ContentStateChanged(nsIContent* aContent, - EventStates aStateMask); + inline void ContentStateChanged(nsIContent* aContent, + EventStates aStateMask); inline void AttributeWillChange(dom::Element* aElement, int32_t aNameSpaceID, nsIAtom* aAttribute, diff --git a/layout/base/RestyleManagerInlines.h b/layout/base/RestyleManagerInlines.h index 921739fa893f..0c6aabe824c1 100644 --- a/layout/base/RestyleManagerInlines.h +++ b/layout/base/RestyleManagerInlines.h @@ -44,7 +44,7 @@ RestyleManager::ProcessPendingRestyles() MOZ_STYLO_FORWARD(ProcessPendingRestyles, ()); } -nsresult +void RestyleManager::ContentStateChanged(nsIContent* aContent, EventStates aStateMask) { diff --git a/layout/base/ServoRestyleManager.cpp b/layout/base/ServoRestyleManager.cpp index f3dd2a11c0f4..1addf4cf08f7 100644 --- a/layout/base/ServoRestyleManager.cpp +++ b/layout/base/ServoRestyleManager.cpp @@ -462,12 +462,12 @@ ServoRestyleManager::ContentRemoved(nsINode* aContainer, NS_WARNING("stylo: ServoRestyleManager::ContentRemoved not implemented"); } -nsresult +void ServoRestyleManager::ContentStateChanged(nsIContent* aContent, EventStates aChangedBits) { if (!aContent->IsElement()) { - return NS_OK; + return; } Element* aElement = aContent->AsElement(); @@ -502,8 +502,6 @@ ServoRestyleManager::ContentStateChanged(nsIContent* aContent, snapshot->AddState(previousState); PostRestyleEvent(aElement, restyleHint, changeHint); } - - return NS_OK; } void diff --git a/layout/base/ServoRestyleManager.h b/layout/base/ServoRestyleManager.h index c82075394944..e34db1040194 100644 --- a/layout/base/ServoRestyleManager.h +++ b/layout/base/ServoRestyleManager.h @@ -63,8 +63,7 @@ public: nsIContent* aChild); void RestyleForAppend(nsIContent* aContainer, nsIContent* aFirstNewContent); - nsresult ContentStateChanged(nsIContent* aContent, - EventStates aStateMask); + void ContentStateChanged(nsIContent* aContent, EventStates aStateMask); void AttributeWillChange(dom::Element* aElement, int32_t aNameSpaceID, nsIAtom* aAttribute,