Skip to content

Commit

Permalink
Bug 1459529: Remove some useless nsIDocumentObserver notifications. r…
Browse files Browse the repository at this point in the history
…=heycam

MozReview-Commit-ID: DzuiqVGKsiu
  • Loading branch information
emilio committed May 15, 2018
1 parent 028a5b5 commit 21a1db9
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 80 deletions.
1 change: 0 additions & 1 deletion accessible/generic/DocAccessible.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,6 @@ DocAccessible::OnPivotChanged(nsIAccessiblePivot* aPivot,

NS_IMPL_NSIDOCUMENTOBSERVER_CORE_STUB(DocAccessible)
NS_IMPL_NSIDOCUMENTOBSERVER_LOAD_STUB(DocAccessible)
NS_IMPL_NSIDOCUMENTOBSERVER_STYLE_STUB(DocAccessible)

void
DocAccessible::AttributeWillChange(dom::Element* aElement,
Expand Down
10 changes: 0 additions & 10 deletions dom/base/nsDocument.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4301,8 +4301,6 @@ nsIDocument::AddStyleSheetToStyleSets(StyleSheet* aSheet)
void
nsIDocument::NotifyStyleSheetAdded(StyleSheet* aSheet, bool aDocumentSheet)
{
NS_DOCUMENT_NOTIFY_OBSERVERS(StyleSheetAdded, (aSheet, aDocumentSheet));

if (StyleSheetChangeEventsEnabled()) {
DO_STYLESHEET_NOTIFICATION(StyleSheetChangeEvent,
"StyleSheetAdded",
Expand All @@ -4314,8 +4312,6 @@ nsIDocument::NotifyStyleSheetAdded(StyleSheet* aSheet, bool aDocumentSheet)
void
nsIDocument::NotifyStyleSheetRemoved(StyleSheet* aSheet, bool aDocumentSheet)
{
NS_DOCUMENT_NOTIFY_OBSERVERS(StyleSheetRemoved, (aSheet, aDocumentSheet));

if (StyleSheetChangeEventsEnabled()) {
DO_STYLESHEET_NOTIFICATION(StyleSheetChangeEvent,
"StyleSheetRemoved",
Expand Down Expand Up @@ -4432,12 +4428,6 @@ nsIDocument::SetStyleSheetApplicableState(StyleSheet* aSheet, bool aApplicable)
}
}

// We have to always notify, since this will be called for sheets
// that are children of sheets in our style set, as well as some
// sheets for HTMLEditor.

NS_DOCUMENT_NOTIFY_OBSERVERS(StyleSheetApplicableStateChanged, (aSheet));

if (StyleSheetChangeEventsEnabled()) {
DO_STYLESHEET_NOTIFICATION(StyleSheetApplicableStateChangeEvent,
"StyleSheetApplicableStateChanged",
Expand Down
68 changes: 0 additions & 68 deletions dom/base/nsIDocumentObserver.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,43 +83,6 @@ class nsIDocumentObserver : public nsIMutationObserver
*/
virtual void DocumentStatesChanged(nsIDocument* aDocument,
mozilla::EventStates aStateMask) = 0;

/**
* A StyleSheet has just been added to the document. This method is
* called automatically when a StyleSheet gets added to the
* document, even if the stylesheet is not applicable. The
* notification is passed on to all of the document observers.
*
* @param aStyleSheet the StyleSheet that has been added
* @param aDocumentSheet True if sheet is in document's style sheet list,
* false if sheet is not (i.e., UA or user sheet)
*/
virtual void StyleSheetAdded(mozilla::StyleSheet* aStyleSheet,
bool aDocumentSheet) = 0;

/**
* A StyleSheet has just been removed from the document. This
* method is called automatically when a StyleSheet gets removed
* from the document, even if the stylesheet is not applicable. The
* notification is passed on to all of the document observers.
*
* @param aStyleSheet the StyleSheet that has been removed
* @param aDocumentSheet True if sheet is in document's style sheet list,
* false if sheet is not (i.e., UA or user sheet)
*/
virtual void StyleSheetRemoved(mozilla::StyleSheet* aStyleSheet,
bool aDocumentSheet) = 0;

/**
* A StyleSheet has just changed its applicable state.
* This method is called automatically when the applicable state
* of a StyleSheet gets changed. The style sheet passes this
* notification to the document. The notification is passed on
* to all of the document observers.
*
* @param aStyleSheet the StyleSheet that has changed state
*/
virtual void StyleSheetApplicableStateChanged(mozilla::StyleSheet* aStyleSheet) = 0;
};

NS_DEFINE_STATIC_IID_ACCESSOR(nsIDocumentObserver, NS_IDOCUMENT_OBSERVER_IID)
Expand All @@ -146,28 +109,13 @@ NS_DEFINE_STATIC_IID_ACCESSOR(nsIDocumentObserver, NS_IDOCUMENT_OBSERVER_IID)
virtual void DocumentStatesChanged(nsIDocument* aDocument, \
mozilla::EventStates aStateMask) override;

#define NS_DECL_NSIDOCUMENTOBSERVER_STYLESHEETADDED \
virtual void StyleSheetAdded(mozilla::StyleSheet* aStyleSheet, \
bool aDocumentSheet) override;

#define NS_DECL_NSIDOCUMENTOBSERVER_STYLESHEETREMOVED \
virtual void StyleSheetRemoved(mozilla::StyleSheet* aStyleSheet, \
bool aDocumentSheet) override;

#define NS_DECL_NSIDOCUMENTOBSERVER_STYLESHEETAPPLICABLESTATECHANGED \
virtual void StyleSheetApplicableStateChanged( \
mozilla::StyleSheet* aStyleSheet) override;

#define NS_DECL_NSIDOCUMENTOBSERVER \
NS_DECL_NSIDOCUMENTOBSERVER_BEGINUPDATE \
NS_DECL_NSIDOCUMENTOBSERVER_ENDUPDATE \
NS_DECL_NSIDOCUMENTOBSERVER_BEGINLOAD \
NS_DECL_NSIDOCUMENTOBSERVER_ENDLOAD \
NS_DECL_NSIDOCUMENTOBSERVER_CONTENTSTATECHANGED \
NS_DECL_NSIDOCUMENTOBSERVER_DOCUMENTSTATESCHANGED \
NS_DECL_NSIDOCUMENTOBSERVER_STYLESHEETADDED \
NS_DECL_NSIDOCUMENTOBSERVER_STYLESHEETREMOVED \
NS_DECL_NSIDOCUMENTOBSERVER_STYLESHEETAPPLICABLESTATECHANGED \
NS_DECL_NSIMUTATIONOBSERVER


Expand Down Expand Up @@ -209,20 +157,4 @@ _class::DocumentStatesChanged(nsIDocument* aDocument, \
#define NS_IMPL_NSIDOCUMENTOBSERVER_CONTENT(_class) \
NS_IMPL_NSIMUTATIONOBSERVER_CONTENT(_class)

#define NS_IMPL_NSIDOCUMENTOBSERVER_STYLE_STUB(_class) \
void \
_class::StyleSheetAdded(mozilla::StyleSheet* aStyleSheet, \
bool aDocumentSheet) \
{ \
} \
void \
_class::StyleSheetRemoved(mozilla::StyleSheet* aStyleSheet, \
bool aDocumentSheet) \
{ \
} \
void \
_class::StyleSheetApplicableStateChanged(mozilla::StyleSheet* aStyleSheet)\
{ \
} \

#endif /* nsIDocumentObserver_h___ */
1 change: 0 additions & 1 deletion dom/base/nsStubDocumentObserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,3 @@ NS_IMPL_NSIDOCUMENTOBSERVER_CORE_STUB(nsStubDocumentObserver)
NS_IMPL_NSIDOCUMENTOBSERVER_LOAD_STUB(nsStubDocumentObserver)
NS_IMPL_NSIDOCUMENTOBSERVER_STATE_STUB(nsStubDocumentObserver)
NS_IMPL_NSIDOCUMENTOBSERVER_CONTENT(nsStubDocumentObserver)
NS_IMPL_NSIDOCUMENTOBSERVER_STYLE_STUB(nsStubDocumentObserver)

0 comments on commit 21a1db9

Please sign in to comment.