Files
palemoon27/dom/base/nsIDocumentObserver.h
T
roytam1 01cb9ab79e import changes from `dev' branch of rmottola/Arctic-Fox:
- Bug 1233497 - Fix infrastructure for disallowing unsafe CPOWs in browser code. r=mrbkap (d8c6be9ef0)
- Bug 1235615 - Split JS::CompartmentOptions into JS::CompartmentCreationOptions that are immutable characteristics of a compartment, and JS::CompartmentBehaviors that may be changed after the compartment's been created. r=terrence (d664435b2c)
- Bug 1245801 - Disable non-standard flag argument of String.prototype. {search,match,replace} in non-release channel. r=jandem (2e41d087e4)
- Bug 1207922 - Part 1: Self-host RegExp.prototype.{exec,test}. r=till,h4writer (21dddac0e3)
- Bug 1207922 - Part 2: Propagate OOM thrown from stub generation. r=till (507c3fc5e0)
- Bug 1207922 - Part 3: Add masm.branchLatin1String and masm.branchTwoByteString. r=h4writer (59f56d60d8)
- Bug 1207922 - Clean-up RRegExp{Match,Test}er function in Recover.cpp. r=arai (fd4f0e4744)
- Bug 1226904 - Fix boundary checking for leaves collecting. r=roc (0736fec30c)
- Bug 1222880 - Followup to handle the case when aStopAtAnimatedGeometryRoot isn't an ancestor of aAnimatedGeometryRoot. CLOSED TREE (648d12bbcb)
- Bug 1222880. Followup to the followup to handle the case when aStopAtAnimatedGeometryRoot isn't an ancestor of aAnimatedGeometryRoot the same way we did before the patches of this bug. r=mattwoordrow (more or less) (e4ce4414ef)
- Bug 1200611 - Size ImageLayers correctly for <img>s using object-fit. r=dholbert (cc3b82a126)
- Bug 1232852 (part 1) - Set |aSnap| in two GetOpaqueRegion() overloadings that are missing it. r=roc. (114660bbbe)
- Bug 1232852 (part 2) - Remove some dead member functions from nsILayoutDebugger. r=roc. (b9eb5ca6b4)
- Bug 1233605 - Cull some uses of gfxContext. r=dholbert. (2ae4a1d390)
- Bug 1059519. Relax assertion. r=mstange (79a1f08992)
- Bug 1176395 - When an element is both position:sticky and transformed, apply the position:sticky outside the transform. r=roc (b2d86a714b)
- Bug 1147673 - Use ancestor clip for root scrollable framemetrics clips. r=tn (6fd10a0ea3)
- Bug 1187804 - Reftests for async scrolling with position:fixed in an iframe. r=kats (2e30186596)
- Bug 1223944 - Reftest bg-fixed-transformed-image-ref.html fails for Fennec when C++APZ enabled. r=kats (99bfa3344b)
- Bug 1208829 - Reftest. r=mstange (e35a18d12a)
- Bug 1224209. Add reftest. (acfd2fba9d)
- Bug 1201889 - Reftest. r=mstange (ec4b26fbd2)
- Bug 1208829 - Another reftest. r=botond (558ca3cdbc)
- Bug 1147673 - Make display items know about their scroll clips. r=tn, r=roc (3485c3fada)
- Bug 1152049 - Rename GetClippedBoundsUpTo into GetScrollClippedBoundsUpTo. r=tn (aeeaf3bcdb)
- Bug 1232852 (part 3) - Remove unused parameters from some accessibility code. r=tbsaunde. (97041bf561)
- Bug 1232852 (part 4) - Remove some unused parameters in and around layout/base/. r=heycam. (2dcf169efa)
- Bug 1232852 (part 5) - Remove some unused parameters in and around layout/base/. r=heycam. (9a302428f1)
- Bug 1232852 (part 6) - Remove unused parameters from some layout sort functions. r=tn. (26faa2c71f)
- Bug 1232852 (part 7) - Remove some unused parameters in and around layout/base/. r=tn. (6f9417aa0b)
- Bug 1232852 (part 8) - Remove some unused parameters in and around layout/base/. r=roc. (30315134c4)
- Bug 1186774 - Scroll position (scrollX/scrollY) should be restored after popstate, not before, r=bz (3d8cd617ce)
- Bug 1155730, implement History.scrollRestoration r=jst (4e0ffb69a9)
- Bug 1237075 - Navigating from 'manual' to 'auto' session history entry should scroll the page, r=jst (d8eb9296bf)
- Bug 1228229 part 2 - Add a helper to get the appropriate (pseudo-)element for a frame; r=dbaron (2a8b5bdc95)
- Bug 1228229 part 3 - Factor out a method to get compositor-animatable overridden properties; r=dbaron (0e5fef1fc9)
- Bug 1228229 part 4 - Add a flag to EffectSet to mark when the cascade needs to be updated; r=dbaron (206e42236e)
- Bug 1228229 part 5 - Separate target element registration in NotifyAnimationTimingUpdated; r=dbaron (fe4b799d14)
- Bug 1228229 part 6 - Mark the animation cascade results as dirty when an effect goes in or out of being "in effect"; r=dbaron (6be413b655)
- Bug 1228229 part 7 - Add a method to Animation to indicate if it applies to the transitions level of the cascade; r=dbaron (d1845e299b)
- Bug 1228229 part 8 - Add EffectCompositor::(Maybe)UpdateCascadeResults; r=dbaron (dfdd0b9822)
- Bug 1228229 part 9 - Use EffectCompositor::UpdateCascadeResults; r=dbaron (917ec2023c)
- Bug 1228229 part 10 - Remove no-longer-used cascade functions; r=dbaron (3dc6662f3a)
- Bug 1228229 part 11 - Avoid calling nsRuleNode::ComputePropertiesOverridingAnimation when there are no compositor-animatable properties; r=dbaron (9b90a1d9a6)
- Bug 1229662 (part 1) - Remove AzureState::clipWasReset. r=jrmuizel. (ce48b700f7)
- Bug 1229662 (part 2) - Remove AzureState::parentTarget. r=jrmuizel. (95713803b1)
- Bug 1229662 (part 3) - Remove AzureState::fillRule. r=jrmuizel. (e1f936af7d)
- part of Bug 1232576 (part 1) - Move the reference |cairo_t*| from gfxContext (e81dd09541)
- part of  Bug 1232576 (part 2) - Rename gfxContext::GetCairo() as GetRefCairo() (82538c1451)
- Bug 1232822 (part 1) - Moz2Dify SetupCairoFont(). r=jfkthame. (ef6b1e99b3)
- Bug 1232822 (part 2) - Moz2Dify SetupGlyphExtents(). r=jfkthame. (9ed9a03559)
- Bug 1232822 (part 3) - Moz2Dify gfxFont::CalcXScale() and gfxFont::PostShapingFixup(). r=jfkthame. (60f5f49df8)
- Bug 1232822 (part 4) - Remove unused argument from SetPotentialLineBreaks(). r=jfkthame. (7fb087a26b)
- Bug 1232822 (part 5) - Moz2Dify GetRoundOffsetsToPixels(). r=jfkthame. (4055a07cba)
- Bug 1232822 (part 6) - Move RefCairo() from gfxContext to gfxFont. r=jfkthame. (c5d2db8eab)
- Bug 1235185 - Fix clang -Wclass-varargs warnings in js/. r=bhackett (43fc9c0b1c)
- Bug 1232772 - suppress numerous clang-style warnings when using clang-cl; r=glandium (c26dab4483)
- Bug 1204752 - Disable thread-safe statics on VS2015 to fix WinXP startup crash. r=glandium (59c67ca7ba)
- Bug 1235743 - Move compiler flags used for dependency generation to a separate variable. r=gps (649853408e)
- Bug 1232159 followup, test for the existence of TypedObject so the test doesn't fail when it hits mozilla-aurora, r=efaust (c87a681a64)
2023-07-31 14:29:48 +08:00

291 lines
14 KiB
C++

/* -*- 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/. */
#ifndef nsIDocumentObserver_h___
#define nsIDocumentObserver_h___
#include "mozilla/EventStates.h"
#include "nsISupports.h"
#include "nsIMutationObserver.h"
class nsIContent;
class nsIStyleSheet;
class nsIDocument;
namespace mozilla {
namespace css {
class Rule;
} // namespace css
} // namespace mozilla
#define NS_IDOCUMENT_OBSERVER_IID \
{ 0x71041fa3, 0x6dd7, 0x4cde, \
{ 0xbb, 0x76, 0xae, 0xcc, 0x69, 0xe1, 0x75, 0x78 } }
typedef uint32_t nsUpdateType;
#define UPDATE_CONTENT_MODEL 0x00000001
#define UPDATE_STYLE 0x00000002
#define UPDATE_ALL (UPDATE_CONTENT_MODEL | UPDATE_STYLE)
// Document observer interface
class nsIDocumentObserver : public nsIMutationObserver
{
public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOCUMENT_OBSERVER_IID)
/**
* Notify that a content model update is beginning. This call can be
* nested.
*/
virtual void BeginUpdate(nsIDocument *aDocument,
nsUpdateType aUpdateType) = 0;
/**
* Notify that a content model update is finished. This call can be
* nested.
*/
virtual void EndUpdate(nsIDocument *aDocument, nsUpdateType aUpdateType) = 0;
/**
* Notify the observer that a document load is beginning.
*/
virtual void BeginLoad(nsIDocument *aDocument) = 0;
/**
* Notify the observer that a document load has finished. Note that
* the associated reflow of the document will be done <b>before</b>
* EndLoad is invoked, not after.
*/
virtual void EndLoad(nsIDocument *aDocument) = 0;
/**
* Notification that the state of a content node has changed.
* (ie: gained or lost focus, became active or hovered over)
* This method is called automatically by content objects
* when their state is changed (therefore there is normally
* no need to invoke this method directly). The notification
* is passed to any IDocumentObservers. The notification is
* passed on to all of the document observers. <p>
*
* This notification is not sent when a piece of content is
* added/removed from the document or the content itself changed
* (the other notifications are used for that).
*
* @param aDocument The document being observed
* @param aContent the piece of content that changed
*/
virtual void ContentStateChanged(nsIDocument* aDocument,
nsIContent* aContent,
mozilla::EventStates aStateMask) = 0;
/**
* Notification that the state of the document has changed.
*
* @param aDocument The document being observed
* @param aStateMask the state that changed
*/
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(nsIStyleSheet* 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(nsIStyleSheet* 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(nsIStyleSheet* aStyleSheet) = 0;
/**
* A StyleRule has just been modified within a style sheet.
* This method is called automatically when the rule gets
* modified. 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 contians the rule
*/
virtual void StyleRuleChanged(nsIStyleSheet* aStyleSheet) = 0;
/**
* A StyleRule has just been added to a style sheet.
* This method is called automatically when the rule gets
* added to the sheet. 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 been modified
*/
virtual void StyleRuleAdded(nsIStyleSheet* aStyleSheet) = 0;
/**
* A StyleRule has just been removed from a style sheet.
* This method is called automatically when the rule gets
* removed from the sheet. 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 been modified
*/
virtual void StyleRuleRemoved(nsIStyleSheet* aStyleSheet) = 0;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsIDocumentObserver, NS_IDOCUMENT_OBSERVER_IID)
#define NS_DECL_NSIDOCUMENTOBSERVER_BEGINUPDATE \
virtual void BeginUpdate(nsIDocument* aDocument, \
nsUpdateType aUpdateType) override;
#define NS_DECL_NSIDOCUMENTOBSERVER_ENDUPDATE \
virtual void EndUpdate(nsIDocument* aDocument, nsUpdateType aUpdateType) override;
#define NS_DECL_NSIDOCUMENTOBSERVER_BEGINLOAD \
virtual void BeginLoad(nsIDocument* aDocument) override;
#define NS_DECL_NSIDOCUMENTOBSERVER_ENDLOAD \
virtual void EndLoad(nsIDocument* aDocument) override;
#define NS_DECL_NSIDOCUMENTOBSERVER_CONTENTSTATECHANGED \
virtual void ContentStateChanged(nsIDocument* aDocument, \
nsIContent* aContent, \
mozilla::EventStates aStateMask) override;
#define NS_DECL_NSIDOCUMENTOBSERVER_DOCUMENTSTATESCHANGED \
virtual void DocumentStatesChanged(nsIDocument* aDocument, \
mozilla::EventStates aStateMask) override;
#define NS_DECL_NSIDOCUMENTOBSERVER_STYLESHEETADDED \
virtual void StyleSheetAdded(nsIStyleSheet* aStyleSheet, \
bool aDocumentSheet) override;
#define NS_DECL_NSIDOCUMENTOBSERVER_STYLESHEETREMOVED \
virtual void StyleSheetRemoved(nsIStyleSheet* aStyleSheet, \
bool aDocumentSheet) override;
#define NS_DECL_NSIDOCUMENTOBSERVER_STYLESHEETAPPLICABLESTATECHANGED \
virtual void StyleSheetApplicableStateChanged(nsIStyleSheet* aStyleSheet) override;
#define NS_DECL_NSIDOCUMENTOBSERVER_STYLERULECHANGED \
virtual void StyleRuleChanged(nsIStyleSheet* aStyleSheet) override;
#define NS_DECL_NSIDOCUMENTOBSERVER_STYLERULEADDED \
virtual void StyleRuleAdded(nsIStyleSheet* aStyleSheet) override;
#define NS_DECL_NSIDOCUMENTOBSERVER_STYLERULEREMOVED \
virtual void StyleRuleRemoved(nsIStyleSheet* 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_NSIDOCUMENTOBSERVER_STYLERULECHANGED \
NS_DECL_NSIDOCUMENTOBSERVER_STYLERULEADDED \
NS_DECL_NSIDOCUMENTOBSERVER_STYLERULEREMOVED \
NS_DECL_NSIMUTATIONOBSERVER
#define NS_IMPL_NSIDOCUMENTOBSERVER_CORE_STUB(_class) \
void \
_class::BeginUpdate(nsIDocument* aDocument, nsUpdateType aUpdateType) \
{ \
} \
void \
_class::EndUpdate(nsIDocument* aDocument, nsUpdateType aUpdateType) \
{ \
} \
NS_IMPL_NSIMUTATIONOBSERVER_CORE_STUB(_class)
#define NS_IMPL_NSIDOCUMENTOBSERVER_LOAD_STUB(_class) \
void \
_class::BeginLoad(nsIDocument* aDocument) \
{ \
} \
void \
_class::EndLoad(nsIDocument* aDocument) \
{ \
}
#define NS_IMPL_NSIDOCUMENTOBSERVER_STATE_STUB(_class) \
void \
_class::ContentStateChanged(nsIDocument* aDocument, \
nsIContent* aContent, \
mozilla::EventStates aStateMask) \
{ \
} \
\
void \
_class::DocumentStatesChanged(nsIDocument* aDocument, \
mozilla::EventStates aStateMask) \
{ \
}
#define NS_IMPL_NSIDOCUMENTOBSERVER_CONTENT(_class) \
NS_IMPL_NSIMUTATIONOBSERVER_CONTENT(_class)
#define NS_IMPL_NSIDOCUMENTOBSERVER_STYLE_STUB(_class) \
void \
_class::StyleSheetAdded(nsIStyleSheet* aStyleSheet, \
bool aDocumentSheet) \
{ \
} \
void \
_class::StyleSheetRemoved(nsIStyleSheet* aStyleSheet, \
bool aDocumentSheet) \
{ \
} \
void \
_class::StyleSheetApplicableStateChanged(nsIStyleSheet* aStyleSheet) \
{ \
} \
void \
_class::StyleRuleChanged(nsIStyleSheet* aStyleSheet) \
{ \
} \
void \
_class::StyleRuleAdded(nsIStyleSheet* aStyleSheet) \
{ \
} \
void \
_class::StyleRuleRemoved(nsIStyleSheet* aStyleSheet) \
{ \
}
#endif /* nsIDocumentObserver_h___ */