Bug 1488684 - Made nsIFrame-derived classes and some others 'final' where possible - r=dbaron

All classes deriving from nsIFrame that did not have any subclasses themselves
(at the time of writing this patch) have been marked with `final`.
Some other Layout classes have also been made final, but this was opportunistic
while working on nsIFrame subclasses, and is definitely not exhaustive, further
patches welcome; refer to bug 1332680.

Advantages of marking a class final include:
- Allowing the compiler to devirtualize some method calls (i.e., calling
  virtual functions directly instead of going through the vtable),
- Indicating that the class is not currently subclassed,
- Preventing subclassing without being aware that this would remove the
  finalization benefits of the parent class.
`final` does not signify that these classes should *never* be subclassed, this
is left for developers to decide.

Differential Revision: https://phabricator.services.mozilla.com/D5020

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Gerald Squelart 2018-09-06 01:23:14 +00:00
parent 963d00aef7
commit b099eab802
59 changed files with 123 additions and 87 deletions

View File

@ -148,7 +148,7 @@ class AutoPrintEventDispatcher;
// a small delegate class used to avoid circular references
class nsDocViewerSelectionListener : public nsISelectionListener
class nsDocViewerSelectionListener final : public nsISelectionListener
{
public:
@ -180,7 +180,7 @@ protected:
/** editor Implementation of the FocusListener interface
*/
class nsDocViewerFocusListener : public nsIDOMEventListener
class nsDocViewerFocusListener final : public nsIDOMEventListener
{
public:
/** default constructor

View File

@ -22,7 +22,7 @@ nsresult NS_NewFrameTraversal(nsIFrameEnumerator **aEnumerator,
nsresult NS_CreateFrameTraversal(nsIFrameTraversal** aResult);
class nsFrameTraversal : public nsIFrameTraversal
class nsFrameTraversal final : public nsIFrameTraversal
{
public:
nsFrameTraversal();

View File

@ -2174,7 +2174,7 @@ nsPresContext::UserFontSetUpdated(gfxUserFontEntry* aUpdatedFont)
}
}
class CounterStyleCleaner : public nsAPostRefreshObserver
class CounterStyleCleaner final : public nsAPostRefreshObserver
{
public:
CounterStyleCleaner(nsRefreshDriver* aRefreshDriver,

View File

@ -19,7 +19,7 @@ class nsIStreamListener;
#define CONTENT_DLF_CONTRACTID "@mozilla.org/content/document-loader-factory;1"
#define PLUGIN_DLF_CONTRACTID "@mozilla.org/content/plugin/document-loader-factory;1"
class nsContentDLF : public nsIDocumentLoaderFactory
class nsContentDLF final : public nsIDocumentLoaderFactory
{
protected:
virtual ~nsContentDLF();

View File

@ -211,7 +211,8 @@ nsDisplayButtonBoxShadowOuter::CreateWebRenderCommands(
return true;
}
class nsDisplayButtonBorder : public nsDisplayItem {
class nsDisplayButtonBorder final : public nsDisplayItem
{
public:
nsDisplayButtonBorder(nsDisplayListBuilder* aBuilder,
nsButtonFrameRenderer* aRenderer)
@ -334,7 +335,8 @@ nsDisplayButtonBorder::GetBounds(nsDisplayListBuilder* aBuilder,
: mFrame->GetVisualOverflowRectRelativeToSelf() + ToReferenceFrame();
}
class nsDisplayButtonForeground : public nsDisplayItem {
class nsDisplayButtonForeground final : public nsDisplayItem
{
public:
nsDisplayButtonForeground(nsDisplayListBuilder* aBuilder,
nsButtonFrameRenderer* aRenderer)

View File

@ -89,7 +89,7 @@ nsComboboxControlFrame::RedisplayTextEvent::Run()
* combo box is toggled to open or close. this is used by Accessibility which presses
* that button Programmatically.
*/
class nsComboButtonListener : public nsIDOMEventListener
class nsComboButtonListener final : public nsIDOMEventListener
{
private:
virtual ~nsComboButtonListener() {}
@ -1304,7 +1304,8 @@ nsComboboxControlFrame::GetDisplayNode() const
// XXXbz this is a for-now hack. Now that display:inline-block works,
// need to revisit this.
class nsComboboxDisplayFrame : public nsBlockFrame {
class nsComboboxDisplayFrame final : public nsBlockFrame
{
public:
NS_DECL_FRAMEARENA_HELPERS(nsComboboxDisplayFrame)
@ -1554,7 +1555,8 @@ nsComboboxControlFrame::UpdateRecentIndex(int32_t aIndex)
return index;
}
class nsDisplayComboboxFocus : public nsDisplayItem {
class nsDisplayComboboxFocus : public nsDisplayItem
{
public:
nsDisplayComboboxFocus(nsDisplayListBuilder* aBuilder,
nsComboboxControlFrame* aFrame)

View File

@ -79,7 +79,8 @@ nsFieldSetFrame::GetLegend() const
return mFrames.FirstChild();
}
class nsDisplayFieldSetBorder : public nsDisplayItem {
class nsDisplayFieldSetBorder final : public nsDisplayItem
{
public:
nsDisplayFieldSetBorder(nsDisplayListBuilder* aBuilder,
nsFieldSetFrame* aFrame)

View File

@ -22,9 +22,9 @@ class DataTransfer;
} // namespace dom
} // namespace mozilla
class nsFileControlFrame : public nsBlockFrame,
public nsIFormControlFrame,
public nsIAnonymousContentCreator
class nsFileControlFrame final : public nsBlockFrame,
public nsIFormControlFrame,
public nsIAnonymousContentCreator
{
public:
explicit nsFileControlFrame(ComputedStyle* aStyle);

View File

@ -16,8 +16,8 @@
using namespace mozilla;
class nsImageControlFrame : public nsImageFrame,
public nsIFormControlFrame
class nsImageControlFrame final : public nsImageFrame,
public nsIFormControlFrame
{
public:
explicit nsImageControlFrame(ComputedStyle* aStyle);

View File

@ -13,8 +13,8 @@
#include "nsCOMPtr.h"
#include "nsCSSPseudoElements.h"
class nsMeterFrame : public nsContainerFrame,
public nsIAnonymousContentCreator
class nsMeterFrame final : public nsContainerFrame,
public nsIAnonymousContentCreator
{
typedef mozilla::dom::Element Element;

View File

@ -163,7 +163,7 @@ nsRangeFrame::AppendAnonymousContentTo(nsTArray<nsIContent*>& aElements,
}
}
class nsDisplayRangeFocusRing : public nsDisplayItem
class nsDisplayRangeFocusRing final : public nsDisplayItem
{
public:
nsDisplayRangeFocusRing(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame)

View File

@ -9,7 +9,7 @@
#include "mozilla/Attributes.h"
#include "nsBlockFrame.h"
class nsSelectsAreaFrame : public nsBlockFrame
class nsSelectsAreaFrame final : public nsBlockFrame
{
public:
NS_DECL_FRAMEARENA_HELPERS(nsSelectsAreaFrame)

View File

@ -25,7 +25,7 @@ struct ScrollAnimationBezierPhysicsSettings
// This class implements a cubic bezier timing function and automatically
// adapts the animation duration based on the scrolling rate.
class ScrollAnimationBezierPhysics : public ScrollAnimationPhysics
class ScrollAnimationBezierPhysics final : public ScrollAnimationPhysics
{
public:
explicit ScrollAnimationBezierPhysics(const nsPoint& aStartPos,

View File

@ -14,7 +14,7 @@ namespace mozilla {
// This class implements a cubic MSD timing function and automatically
// adapts the animation duration based on the scrolling rate.
class ScrollAnimationMSDPhysics : public ScrollAnimationPhysics
class ScrollAnimationMSDPhysics final : public ScrollAnimationPhysics
{
public:
typedef mozilla::layers::AxisPhysicsMSDModel AxisPhysicsMSDModel;

View File

@ -162,7 +162,7 @@ IsFrameDescendantOfAny(nsIFrame* aChild,
return false;
}
class nsDisplayTextOverflowMarker : public nsDisplayItem
class nsDisplayTextOverflowMarker final : public nsDisplayItem
{
public:
nsDisplayTextOverflowMarker(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame,

View File

@ -26,7 +26,8 @@ class ServoRestyleState;
* containing the doc root frame. ViewportFrame stores this child in its primary child
* list.
*/
class ViewportFrame : public nsContainerFrame {
class ViewportFrame : public nsContainerFrame
{
public:
NS_DECL_QUERYFRAME
NS_DECL_FRAMEARENA_HELPERS(ViewportFrame)

View File

@ -144,7 +144,8 @@ private:
* We can also paint an "extra background color" behind the normal
* background.
*/
class nsDisplayCanvasBackgroundColor : public nsDisplaySolidColorBase {
class nsDisplayCanvasBackgroundColor final : public nsDisplaySolidColorBase
{
public:
nsDisplayCanvasBackgroundColor(nsDisplayListBuilder* aBuilder, nsIFrame *aFrame)
: nsDisplaySolidColorBase(aBuilder, aFrame, NS_RGBA(0,0,0,0))

View File

@ -62,7 +62,7 @@ struct nsFramesetDrag {
/*******************************************************************************
* nsHTMLFramesetFrame
******************************************************************************/
class nsHTMLFramesetFrame : public nsContainerFrame
class nsHTMLFramesetFrame final : public nsContainerFrame
{
public:
NS_DECL_QUERYFRAME

View File

@ -63,7 +63,8 @@ IntrinsicRatioFromCanvasSize(const nsIntSize& aCanvasSizeInPx)
nsPresContext::CSSPixelsToAppUnits(aCanvasSizeInPx.height));
}
class nsDisplayCanvas : public nsDisplayItem {
class nsDisplayCanvas final : public nsDisplayItem
{
public:
nsDisplayCanvas(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame)
: nsDisplayItem(aBuilder, aFrame)

View File

@ -1382,7 +1382,8 @@ struct nsRecessedBorder : public nsStyleBorder {
}
};
class nsDisplayAltFeedback : public nsDisplayItem {
class nsDisplayAltFeedback final : public nsDisplayItem
{
public:
nsDisplayAltFeedback(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame)
: nsDisplayItem(aBuilder, aFrame) {}

View File

@ -42,7 +42,7 @@ namespace layers {
} // namespace layers
} // namespace mozilla
class nsImageListener : public imgINotificationObserver
class nsImageListener final : public imgINotificationObserver
{
protected:
virtual ~nsImageListener();
@ -446,7 +446,8 @@ public:
* image itself, and hence receive events just as if the image itself
* received events.
*/
class nsDisplayImage : public nsDisplayImageContainer {
class nsDisplayImage final : public nsDisplayImageContainer
{
public:
typedef mozilla::layers::LayerManager LayerManager;

View File

@ -268,7 +268,8 @@ void Area::HasFocus(bool aHasFocus)
//----------------------------------------------------------------------
class DefaultArea : public Area {
class DefaultArea final : public Area
{
public:
explicit DefaultArea(HTMLAreaElement* aArea);
@ -312,7 +313,8 @@ void DefaultArea::GetRect(nsIFrame* aFrame, nsRect& aRect)
//----------------------------------------------------------------------
class RectArea : public Area {
class RectArea final : public Area
{
public:
explicit RectArea(HTMLAreaElement* aArea);
@ -418,7 +420,8 @@ void RectArea::GetRect(nsIFrame* aFrame, nsRect& aRect)
//----------------------------------------------------------------------
class PolyArea : public Area {
class PolyArea final : public Area
{
public:
explicit PolyArea(HTMLAreaElement* aArea);
@ -575,7 +578,8 @@ void PolyArea::GetRect(nsIFrame* aFrame, nsRect& aRect)
//----------------------------------------------------------------------
class CircleArea : public Area {
class CircleArea final : public Area
{
public:
explicit CircleArea(HTMLAreaElement* aArea);

View File

@ -474,7 +474,8 @@ static gfx::Matrix4x4 ComputePageTransform(nsIFrame* aFrame, float aAppUnitsPerP
return gfx::Matrix4x4::Scaling(scale, scale, 1);
}
class nsDisplayHeaderFooter : public nsDisplayItem {
class nsDisplayHeaderFooter final : public nsDisplayItem
{
public:
nsDisplayHeaderFooter(nsDisplayListBuilder* aBuilder, nsPageFrame *aFrame)
: nsDisplayItem(aBuilder, aFrame)

View File

@ -363,7 +363,8 @@ public:
}
};
class nsDisplayPlugin : public nsDisplayItem {
class nsDisplayPlugin final : public nsDisplayItem
{
public:
nsDisplayPlugin(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame)
: nsDisplayItem(aBuilder, aFrame)

View File

@ -196,7 +196,8 @@ NS_DECLARE_FRAME_PROPERTY_SMALL_VALUE(FontSizeInflationProperty, float)
*
* This is stored in {Simple, Complex}TextRunUserData.
*/
class GlyphObserver : public gfxFont::GlyphChangeObserver {
class GlyphObserver final : public gfxFont::GlyphChangeObserver
{
public:
GlyphObserver(gfxFont* aFont, gfxTextRun* aTextRun)
: gfxFont::GlyphChangeObserver(aFont), mTextRun(aTextRun) {
@ -4884,7 +4885,8 @@ nsTextFrame::CharacterDataChanged(const CharacterDataChangeInfo& aInfo)
return NS_OK;
}
class nsDisplayText final : public nsCharClipDisplayItem {
class nsDisplayText final : public nsCharClipDisplayItem
{
public:
nsDisplayText(nsDisplayListBuilder* aBuilder, nsTextFrame* aFrame,
const Maybe<bool>& aIsSelected);

View File

@ -26,8 +26,8 @@ class LayerManager;
class nsPresContext;
class nsDisplayItem;
class nsVideoFrame : public nsContainerFrame
, public nsIAnonymousContentCreator
class nsVideoFrame final : public nsContainerFrame
, public nsIAnonymousContentCreator
{
public:
template <typename T> using Maybe = mozilla::Maybe<T>;

View File

@ -32,7 +32,7 @@ struct ScrollableLayerGuid;
namespace layout {
class RenderFrameParent : public PRenderFrameParent
class RenderFrameParent final : public PRenderFrameParent
{
typedef mozilla::layers::AsyncDragMetrics AsyncDragMetrics;
typedef mozilla::layers::FrameMetrics FrameMetrics;
@ -144,7 +144,7 @@ private:
* layer tree (for a given RenderFrameParent) into its parent
* process's layer tree.
*/
class nsDisplayRemote : public nsDisplayItem
class nsDisplayRemote final : public nsDisplayItem
{
typedef mozilla::layout::RenderFrameParent RenderFrameParent;

View File

@ -1830,7 +1830,7 @@ nsMathMLChar::GetMaxWidth(nsIFrame* aForFrame,
return std::max(bm.width, bm.rightBearing) - std::min(0, bm.leftBearing);
}
class nsDisplayMathMLSelectionRect : public nsDisplayItem {
class nsDisplayMathMLSelectionRect final : public nsDisplayItem {
public:
nsDisplayMathMLSelectionRect(nsDisplayListBuilder* aBuilder,
nsIFrame* aFrame, const nsRect& aRect)
@ -1864,7 +1864,7 @@ void nsDisplayMathMLSelectionRect::Paint(nsDisplayListBuilder* aBuilder,
drawTarget->FillRect(rect, ColorPattern(ToDeviceColor(bgColor)));
}
class nsDisplayMathMLCharForeground : public nsDisplayItem {
class nsDisplayMathMLCharForeground final : public nsDisplayItem {
public:
nsDisplayMathMLCharForeground(nsDisplayListBuilder* aBuilder,
nsIFrame* aFrame, nsMathMLChar* aChar,
@ -1920,7 +1920,7 @@ private:
};
#ifdef DEBUG
class nsDisplayMathMLCharDebug : public nsDisplayItem {
class nsDisplayMathMLCharDebug final : public nsDisplayItem {
public:
nsDisplayMathMLCharDebug(nsDisplayListBuilder* aBuilder,
nsIFrame* aFrame, const nsRect& aRect)

View File

@ -401,7 +401,8 @@ private:
// 2) proper inter-frame spacing
// 3) firing of Stretch() (in which case FinalizeReflow() would have to be cleaned)
// Issues: If/when mathml becomes a pluggable component, the separation will be needed.
class nsMathMLmathBlockFrame : public nsBlockFrame {
class nsMathMLmathBlockFrame final : public nsBlockFrame
{
public:
NS_DECL_QUERYFRAME
NS_DECL_FRAMEARENA_HELPERS(nsMathMLmathBlockFrame)
@ -483,8 +484,9 @@ protected:
// --------------
class nsMathMLmathInlineFrame : public nsInlineFrame,
public nsMathMLFrame {
class nsMathMLmathInlineFrame final : public nsInlineFrame,
public nsMathMLFrame
{
public:
NS_DECL_QUERYFRAME
NS_DECL_FRAMEARENA_HELPERS(nsMathMLmathInlineFrame)

View File

@ -276,7 +276,7 @@ nsMathMLFrame::ParseNumericValue(const nsString& aString,
}
#if defined(DEBUG) && defined(SHOW_BOUNDING_BOX)
class nsDisplayMathMLBoundingMetrics : public nsDisplayItem {
class nsDisplayMathMLBoundingMetrics final : public nsDisplayItem {
public:
nsDisplayMathMLBoundingMetrics(nsDisplayListBuilder* aBuilder,
nsIFrame* aFrame, const nsRect& aRect)
@ -324,7 +324,8 @@ nsMathMLFrame::DisplayBoundingMetrics(nsDisplayListBuilder* aBuilder,
}
#endif
class nsDisplayMathMLBar : public nsDisplayItem {
class nsDisplayMathMLBar final : public nsDisplayItem
{
public:
nsDisplayMathMLBar(nsDisplayListBuilder* aBuilder,
nsIFrame* aFrame, const nsRect& aRect, uint32_t aIndex)

View File

@ -16,7 +16,8 @@
// <maction> -- bind actions to a subexpression
//
class nsMathMLmactionFrame : public nsMathMLSelectedFrame {
class nsMathMLmactionFrame final : public nsMathMLSelectedFrame
{
public:
NS_DECL_FRAMEARENA_HELPERS(nsMathMLmactionFrame)

View File

@ -747,7 +747,7 @@ nsMathMLmencloseFrame::SetAdditionalComputedStyle(int32_t aIndex,
mMathMLChar[aIndex].SetComputedStyle(aComputedStyle);
}
class nsDisplayNotation : public nsDisplayItem
class nsDisplayNotation final : public nsDisplayItem
{
public:
nsDisplayNotation(nsDisplayListBuilder* aBuilder,

View File

@ -50,7 +50,8 @@ environment, but can be set explicitly only on the <mstyle>
element.
*/
class nsMathMLmfracFrame : public nsMathMLContainerFrame {
class nsMathMLmfracFrame final : public nsMathMLContainerFrame
{
public:
NS_DECL_FRAMEARENA_HELPERS(nsMathMLmfracFrame)

View File

@ -17,7 +17,8 @@
// <msup> -- attach a superscript to a base
//
class nsMathMLmmultiscriptsFrame : public nsMathMLContainerFrame {
class nsMathMLmmultiscriptsFrame final : public nsMathMLContainerFrame
{
public:
NS_DECL_FRAMEARENA_HELPERS(nsMathMLmmultiscriptsFrame)

View File

@ -15,7 +15,8 @@
// <mo> -- operator, fence, or separator
//
class nsMathMLmoFrame : public nsMathMLTokenFrame {
class nsMathMLmoFrame final : public nsMathMLTokenFrame
{
public:
NS_DECL_FRAMEARENA_HELPERS(nsMathMLmoFrame)

View File

@ -14,7 +14,8 @@
// <mpadded> -- adjust space around content
//
class nsMathMLmpaddedFrame : public nsMathMLContainerFrame {
class nsMathMLmpaddedFrame final : public nsMathMLContainerFrame
{
public:
NS_DECL_FRAMEARENA_HELPERS(nsMathMLmpaddedFrame)

View File

@ -15,7 +15,8 @@
// <msqrt> and <mroot> -- form a radical
//
class nsMathMLmrootFrame : public nsMathMLContainerFrame {
class nsMathMLmrootFrame final : public nsMathMLContainerFrame
{
public:
NS_DECL_FRAMEARENA_HELPERS(nsMathMLmrootFrame)

View File

@ -16,7 +16,8 @@
// <mstyle> -- make style changes that affect the rendering of its contents
//
class nsMathMLmrowFrame : public nsMathMLContainerFrame {
class nsMathMLmrowFrame final : public nsMathMLContainerFrame
{
public:
NS_DECL_FRAMEARENA_HELPERS(nsMathMLmrowFrame)

View File

@ -14,7 +14,8 @@
// <mspace> -- space
//
class nsMathMLmspaceFrame : public nsMathMLContainerFrame {
class nsMathMLmspaceFrame final : public nsMathMLContainerFrame
{
public:
NS_DECL_FRAMEARENA_HELPERS(nsMathMLmspaceFrame)

View File

@ -33,7 +33,8 @@ These attributes are inherited by every element from its rendering environment,
but can be set explicitly only on <mstyle>. (See Section 3.3.4.)
*/
class nsMathMLmsqrtFrame : public nsMathMLmencloseFrame {
class nsMathMLmsqrtFrame final : public nsMathMLmencloseFrame
{
public:
NS_DECL_FRAMEARENA_HELPERS(nsMathMLmsqrtFrame)

View File

@ -262,7 +262,7 @@ ComputeBorderOverflow(nsMathMLmtdFrame* aFrame,
* around a nsMathMLmtdFrame based on the rowline and columnline properties
* set on the cell frame.
*/
class nsDisplaymtdBorder : public nsDisplayBorder
class nsDisplaymtdBorder final : public nsDisplayBorder
{
public:
nsDisplaymtdBorder(nsDisplayListBuilder* aBuilder, nsMathMLmtdFrame* aFrame)

View File

@ -242,7 +242,7 @@ protected:
// --------------
class nsMathMLmtdFrame : public nsTableCellFrame
class nsMathMLmtdFrame final : public nsTableCellFrame
{
public:
NS_DECL_FRAMEARENA_HELPERS(nsMathMLmtdFrame)

View File

@ -14,7 +14,8 @@
// <semantics> -- associate annotations with a MathML expression
//
class nsMathMLsemanticsFrame : public nsMathMLSelectedFrame {
class nsMathMLsemanticsFrame final : public nsMathMLSelectedFrame
{
public:
NS_DECL_FRAMEARENA_HELPERS(nsMathMLsemanticsFrame)

View File

@ -16,7 +16,8 @@
namespace mozilla {
namespace layout {
class PRFileDescStream : public mozilla::gfx::EventStream {
class PRFileDescStream final : public mozilla::gfx::EventStream
{
// Most writes, as seen in the print IPC use case, are very small (<32 bytes),
// with a small number of very large (>40KB) writes. Writes larger than this
// value are not buffered.
@ -129,7 +130,7 @@ private:
bool mGood;
};
class DrawEventRecorderPRFileDesc : public gfx::DrawEventRecorderPrivate
class DrawEventRecorderPRFileDesc final : public gfx::DrawEventRecorderPrivate
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(DrawEventRecorderPRFileDesc, override)

View File

@ -22,8 +22,8 @@
class nsIPrincipal;
class nsFontFaceLoader : public nsIStreamLoaderObserver
, public nsIRequestObserver
class nsFontFaceLoader final : public nsIStreamLoaderObserver
, public nsIRequestObserver
{
public:
nsFontFaceLoader(gfxUserFontEntry* aFontToLoad, nsIURI* aFontURI,

View File

@ -18,7 +18,7 @@ using namespace mozilla;
* This frame is used by filter primitive elements that
* have special child elements that provide parameters.
*/
class SVGFEContainerFrame : public nsContainerFrame
class SVGFEContainerFrame final : public nsContainerFrame
{
friend nsIFrame*
NS_NewSVGFEContainerFrame(nsIPresShell* aPresShell, ComputedStyle* aStyle);

View File

@ -11,7 +11,7 @@
#include "SVGObserverUtils.h"
#include "nsSVGFilters.h"
class SVGFEUnstyledLeafFrame : public nsFrame
class SVGFEUnstyledLeafFrame final : public nsFrame
{
friend nsIFrame*
NS_NewSVGFEUnstyledLeafFrame(nsIPresShell* aPresShell, ComputedStyle* aStyle);

View File

@ -57,7 +57,8 @@ NS_QUERYFRAME_TAIL_INHERITING(nsFrame)
//----------------------------------------------------------------------
// Display list item:
class nsDisplaySVGGeometry : public nsDisplayItem {
class nsDisplaySVGGeometry final : public nsDisplayItem
{
typedef mozilla::image::imgDrawingParams imgDrawingParams;
public:

View File

@ -2724,7 +2724,8 @@ CharIterator::MatchesFilter() const
* An nsCharClipDisplayItem that obtains its left and right clip edges from a
* TextRenderedRun object.
*/
class SVGCharClipDisplayItem : public nsCharClipDisplayItem {
class SVGCharClipDisplayItem final : public nsCharClipDisplayItem
{
public:
explicit SVGCharClipDisplayItem(const TextRenderedRun& aRun)
: nsCharClipDisplayItem(aRun.mFrame)
@ -2747,7 +2748,7 @@ public:
* cannot be done directly (e.g. if we are using an SVG pattern fill, stroking
* the text, etc.).
*/
class SVGTextDrawPathCallbacks : public nsTextFrame::DrawPathCallbacks
class SVGTextDrawPathCallbacks final : public nsTextFrame::DrawPathCallbacks
{
typedef mozilla::image::imgDrawingParams imgDrawingParams;
@ -3066,7 +3067,8 @@ SVGTextDrawPathCallbacks::StrokeGeometry()
// ----------------------------------------------------------------------------
// Display list item
class nsDisplaySVGText : public nsDisplayItem {
class nsDisplaySVGText final : public nsDisplayItem
{
public:
nsDisplaySVGText(nsDisplayListBuilder* aBuilder, SVGTextFrame* aFrame)
: nsDisplayItem(aBuilder, aFrame)

View File

@ -19,7 +19,7 @@ using namespace mozilla::dom;
* identifier. The SVGViewFrame class passes on any attribute changes
* the view receives to the overridden <svg> element (if there is one).
**/
class SVGViewFrame : public nsFrame
class SVGViewFrame final : public nsFrame
{
friend nsIFrame*
NS_NewSVGViewFrame(nsIPresShell* aPresShell, ComputedStyle* aStyle);

View File

@ -16,7 +16,7 @@
using namespace mozilla;
class nsSVGAFrame : public nsSVGDisplayContainerFrame
class nsSVGAFrame final : public nsSVGDisplayContainerFrame
{
friend nsIFrame*
NS_NewSVGAFrame(nsIPresShell* aPresShell, ComputedStyle* aStyle);

View File

@ -27,7 +27,7 @@ class SVGFilterElement;
} // namespace dom
} // namespace mozilla
class nsSVGFilterFrame : public nsSVGContainerFrame
class nsSVGFilterFrame final : public nsSVGContainerFrame
{
friend nsIFrame*
NS_NewSVGFilterFrame(nsIPresShell* aPresShell, ComputedStyle* aStyle);

View File

@ -17,8 +17,8 @@
class gfxContext;
class nsSVGForeignObjectFrame : public nsContainerFrame
, public nsSVGDisplayableFrame
class nsSVGForeignObjectFrame final : public nsContainerFrame
, public nsSVGDisplayableFrame
{
friend nsContainerFrame*
NS_NewSVGForeignObjectFrame(nsIPresShell* aPresShell, ComputedStyle* aStyle);

View File

@ -119,7 +119,7 @@ private:
// Linear Gradients
// -------------------------------------------------------------------------
class nsSVGLinearGradientFrame : public nsSVGGradientFrame
class nsSVGLinearGradientFrame final : public nsSVGGradientFrame
{
friend nsIFrame* NS_NewSVGLinearGradientFrame(nsIPresShell* aPresShell,
ComputedStyle* aStyle);
@ -161,7 +161,7 @@ protected:
// Radial Gradients
// -------------------------------------------------------------------------
class nsSVGRadialGradientFrame : public nsSVGGradientFrame
class nsSVGRadialGradientFrame final : public nsSVGGradientFrame
{
friend nsIFrame* NS_NewSVGRadialGradientFrame(nsIPresShell* aPresShell,
ComputedStyle* aStyle);

View File

@ -539,7 +539,8 @@ nsSVGOuterSVGFrame::UnionChildOverflow(nsOverflowAreas& aOverflowAreas)
/**
* Used to paint/hit-test SVG when SVG display lists are disabled.
*/
class nsDisplayOuterSVG : public nsDisplayItem {
class nsDisplayOuterSVG final : public nsDisplayItem
{
public:
nsDisplayOuterSVG(nsDisplayListBuilder* aBuilder,
nsSVGOuterSVGFrame* aFrame) :

View File

@ -9,8 +9,7 @@
#include "nsSVGViewportFrame.h"
class nsSVGSymbolFrame
: public nsSVGViewportFrame
class nsSVGSymbolFrame final : public nsSVGViewportFrame
{
friend nsIFrame*
NS_NewSVGSymbolFrame(nsIPresShell* aPresShell, ComputedStyle* aStyle);

View File

@ -141,8 +141,8 @@ class nsView;
class nsMenuPopupFrame;
// this class is used for dispatching popupshown events asynchronously.
class nsXULPopupShownEvent : public mozilla::Runnable,
public nsIDOMEventListener
class nsXULPopupShownEvent final : public mozilla::Runnable,
public nsIDOMEventListener
{
public:
nsXULPopupShownEvent(nsIContent* aPopup, nsPresContext* aPresContext)

View File

@ -932,7 +932,8 @@ nsSliderMediator::HandleEvent(dom::Event* aEvent)
return NS_OK;
}
class AsyncScrollbarDragStarter : public nsAPostRefreshObserver {
class AsyncScrollbarDragStarter final : public nsAPostRefreshObserver
{
public:
AsyncScrollbarDragStarter(nsIPresShell* aPresShell,
nsIWidget* aWidget,

View File

@ -1067,7 +1067,7 @@ nsXULPopupManager::HidePopup(nsIContent* aPopup,
}
// This is used to hide the popup after a transition finishes.
class TransitionEnder : public nsIDOMEventListener
class TransitionEnder final : public nsIDOMEventListener
{
protected:
virtual ~TransitionEnder() { }