Bug 1394156 - Make static_casts of mContent use GetContent(). r=emilio

This was done with: perl -pi -e 's/\(mContent\)/\(GetContent\(\)\)/g' *.cpp

MozReview-Commit-ID: 7ugPKf5ypGw
This commit is contained in:
Bobby Holley 2017-08-26 15:58:38 -07:00
parent 21cb4ee848
commit a61ee7166e
27 changed files with 115 additions and 115 deletions

View File

@ -404,7 +404,7 @@ nsDateTimeControlFrame::AttributeChanged(int32_t aNameSpaceID,
aAttribute == nsGkAtoms::readonly ||
aAttribute == nsGkAtoms::tabindex) {
MOZ_ASSERT(mContent->IsHTMLElement(nsGkAtoms::input), "bad cast");
auto contentAsInputElem = static_cast<dom::HTMLInputElement*>(mContent);
auto contentAsInputElem = static_cast<dom::HTMLInputElement*>(GetContent());
// If script changed the <input>'s type before setting these attributes
// then we don't need to do anything since we are going to be reframed.
if (contentAsInputElem->ControlType() == NS_FORM_INPUT_TIME ||

View File

@ -145,7 +145,7 @@ nsMeterFrame::ReflowBarFrame(nsIFrame* aBarFrame,
nscoord yoffset = aReflowInput.ComputedPhysicalBorderPadding().top;
// NOTE: Introduce a new function getPosition in the content part ?
HTMLMeterElement* meterElement = static_cast<HTMLMeterElement*>(mContent);
HTMLMeterElement* meterElement = static_cast<HTMLMeterElement*>(GetContent());
double max = meterElement->Max();
double min = meterElement->Min();

View File

@ -151,7 +151,7 @@ nsProgressFrame::ReflowChildFrame(nsIFrame* aChild,
nscoord xoffset = aReflowInput.ComputedPhysicalBorderPadding().left;
nscoord yoffset = aReflowInput.ComputedPhysicalBorderPadding().top;
double position = static_cast<HTMLProgressElement*>(mContent)->Position();
double position = static_cast<HTMLProgressElement*>(GetContent())->Position();
// Force the bar's size to match the current progress.
// When indeterminate, the progress' size will be 100%.

View File

@ -486,7 +486,7 @@ double
nsRangeFrame::GetValueAsFractionOfRange()
{
MOZ_ASSERT(mContent->IsHTMLElement(nsGkAtoms::input), "bad cast");
dom::HTMLInputElement* input = static_cast<dom::HTMLInputElement*>(mContent);
dom::HTMLInputElement* input = static_cast<dom::HTMLInputElement*>(GetContent());
MOZ_ASSERT(input->ControlType() == NS_FORM_INPUT_RANGE);
@ -515,7 +515,7 @@ nsRangeFrame::GetValueAtEventPoint(WidgetGUIEvent* aEvent)
"Unexpected event type - aEvent->mRefPoint may be meaningless");
MOZ_ASSERT(mContent->IsHTMLElement(nsGkAtoms::input), "bad cast");
dom::HTMLInputElement* input = static_cast<dom::HTMLInputElement*>(mContent);
dom::HTMLInputElement* input = static_cast<dom::HTMLInputElement*>(GetContent());
MOZ_ASSERT(input->ControlType() == NS_FORM_INPUT_RANGE);
@ -541,7 +541,7 @@ nsRangeFrame::GetValueAtEventPoint(WidgetGUIEvent* aEvent)
if (point == nsPoint(NS_UNCONSTRAINEDSIZE, NS_UNCONSTRAINEDSIZE)) {
// We don't want to change the current value for this error state.
return static_cast<dom::HTMLInputElement*>(mContent)->GetValueAsDecimal();
return static_cast<dom::HTMLInputElement*>(GetContent())->GetValueAsDecimal();
}
nsRect rangeContentRect = GetContentRectRelativeToSelf();
@ -750,7 +750,7 @@ nsRangeFrame::AttributeChanged(int32_t aNameSpaceID,
// UpdateForValueChange() anyway.
MOZ_ASSERT(mContent->IsHTMLElement(nsGkAtoms::input), "bad cast");
bool typeIsRange =
static_cast<dom::HTMLInputElement*>(mContent)->ControlType() ==
static_cast<dom::HTMLInputElement*>(GetContent())->ControlType() ==
NS_FORM_INPUT_RANGE;
// If script changed the <input>'s type before setting these attributes
// then we don't need to do anything since we are going to be reframed.
@ -837,7 +837,7 @@ bool
nsRangeFrame::IsHorizontal() const
{
dom::HTMLInputElement* element =
static_cast<dom::HTMLInputElement*>(mContent);
static_cast<dom::HTMLInputElement*>(GetContent());
return element->AttrValueIs(kNameSpaceID_None, nsGkAtoms::orient,
nsGkAtoms::horizontal, eCaseMatters) ||
(!element->AttrValueIs(kNameSpaceID_None, nsGkAtoms::orient,
@ -850,19 +850,19 @@ nsRangeFrame::IsHorizontal() const
double
nsRangeFrame::GetMin() const
{
return static_cast<dom::HTMLInputElement*>(mContent)->GetMinimum().toDouble();
return static_cast<dom::HTMLInputElement*>(GetContent())->GetMinimum().toDouble();
}
double
nsRangeFrame::GetMax() const
{
return static_cast<dom::HTMLInputElement*>(mContent)->GetMaximum().toDouble();
return static_cast<dom::HTMLInputElement*>(GetContent())->GetMaximum().toDouble();
}
double
nsRangeFrame::GetValue() const
{
return static_cast<dom::HTMLInputElement*>(mContent)->GetValueAsDecimal().toDouble();
return static_cast<dom::HTMLInputElement*>(GetContent())->GetValueAsDecimal().toDouble();
}
#define STYLES_DISABLING_NATIVE_THEMING \

View File

@ -3323,7 +3323,7 @@ nsFrame::GetContentForEvent(WidgetEvent* aEvent,
void
nsFrame::FireDOMEvent(const nsAString& aDOMEventName, nsIContent *aContent)
{
nsIContent* target = aContent ? aContent : mContent;
nsIContent* target = aContent ? aContent : GetContent();
if (target) {
RefPtr<AsyncEventDispatcher> asyncDispatcher =

View File

@ -85,7 +85,7 @@ SVGFEContainerFrame::AttributeChanged(int32_t aNameSpaceID,
nsIAtom* aAttribute,
int32_t aModType)
{
nsSVGFE *element = static_cast<nsSVGFE*>(mContent);
nsSVGFE *element = static_cast<nsSVGFE*>(GetContent());
if (element->AttributeAffectsRendering(aNameSpaceID, aAttribute)) {
MOZ_ASSERT(GetParent()->IsSVGFilterFrame(),
"Observers observe the filter, so that's what we must invalidate");

View File

@ -121,7 +121,7 @@ SVGFEImageFrame::AttributeChanged(int32_t aNameSpaceID,
nsIAtom* aAttribute,
int32_t aModType)
{
SVGFEImageElement* element = static_cast<SVGFEImageElement*>(mContent);
SVGFEImageElement* element = static_cast<SVGFEImageElement*>(GetContent());
if (element->AttributeAffectsRendering(aNameSpaceID, aAttribute)) {
MOZ_ASSERT(GetParent()->IsSVGFilterFrame(),
"Observers observe the filter, so that's what we must invalidate");

View File

@ -83,7 +83,7 @@ SVGFELeafFrame::AttributeChanged(int32_t aNameSpaceID,
nsIAtom* aAttribute,
int32_t aModType)
{
nsSVGFE *element = static_cast<nsSVGFE*>(mContent);
nsSVGFE *element = static_cast<nsSVGFE*>(GetContent());
if (element->AttributeAffectsRendering(aNameSpaceID, aAttribute)) {
MOZ_ASSERT(GetParent()->IsSVGFilterFrame(),
"Observers observe the filter, so that's what we must invalidate");

View File

@ -62,7 +62,7 @@ SVGFEUnstyledLeafFrame::AttributeChanged(int32_t aNameSpaceID,
nsIAtom* aAttribute,
int32_t aModType)
{
SVGFEUnstyledElement *element = static_cast<SVGFEUnstyledElement*>(mContent);
SVGFEUnstyledElement *element = static_cast<SVGFEUnstyledElement*>(GetContent());
if (element->AttributeAffectsRendering(aNameSpaceID, aAttribute)) {
MOZ_ASSERT(GetParent()->GetParent()->IsSVGFilterFrame(),
"Observers observe the filter, so that's what we must invalidate");

View File

@ -177,7 +177,7 @@ SVGGeometryFrame::AttributeChanged(int32_t aNameSpaceID,
if (aNameSpaceID == kNameSpaceID_None &&
(static_cast<SVGGeometryElement*>
(mContent)->AttributeDefinesGeometry(aAttribute))) {
(GetContent())->AttributeDefinesGeometry(aAttribute))) {
nsLayoutUtils::PostRestyleEvent(
mContent->AsElement(), nsRestyleHint(0),
nsChangeHint_InvalidateRenderingObservers);
@ -202,10 +202,10 @@ SVGGeometryFrame::DidSetStyleContext(nsStyleContext* aOldStyleContext)
}
SVGGeometryElement* element =
static_cast<SVGGeometryElement*>(mContent);
static_cast<SVGGeometryElement*>(GetContent());
auto oldStyleSVG = aOldStyleContext->PeekStyleSVG();
if (oldStyleSVG && !SVGContentUtils::ShapeTypeHasNoCorners(mContent)) {
if (oldStyleSVG && !SVGContentUtils::ShapeTypeHasNoCorners(GetContent())) {
if (StyleSVG()->mStrokeLinecap != oldStyleSVG->mStrokeLinecap &&
element->IsSVGElement(nsGkAtoms::path)) {
// If the stroke-linecap changes to or from "butt" then our element
@ -243,7 +243,7 @@ SVGGeometryFrame::IsSVGTransformed(gfx::Matrix *aOwnTransform,
HasChildrenOnlyTransform(aFromParentTransform);
}
nsSVGElement *content = static_cast<nsSVGElement*>(mContent);
nsSVGElement *content = static_cast<nsSVGElement*>(GetContent());
nsSVGAnimatedTransformList* transformList =
content->GetAnimatedTransformList();
if ((transformList && transformList->HasTransform()) ||
@ -263,7 +263,7 @@ void
SVGGeometryFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsDisplayListSet& aLists)
{
if (!static_cast<const nsSVGElement*>(mContent)->HasValidDimensions() ||
if (!static_cast<const nsSVGElement*>(GetContent())->HasValidDimensions() ||
(!IsVisibleForPainting(aBuilder) && aBuilder->IsForPainting())) {
return;
}
@ -342,7 +342,7 @@ SVGGeometryFrame::GetFrameForPoint(const gfxPoint& aPoint)
bool isHit = false;
SVGGeometryElement* content =
static_cast<SVGGeometryElement*>(mContent);
static_cast<SVGGeometryElement*>(GetContent());
// Using ScreenReferenceDrawTarget() opens us to Moz2D backend specific hit-
// testing bugs. Maybe we should use a BackendType::CAIRO DT for hit-testing
@ -460,9 +460,9 @@ SVGGeometryFrame::NotifySVGChanged(uint32_t aFlags)
// of stroke-dashoffset since, although that can have a percentage value
// that is resolved against our coordinate context, it does not affect our
// mRect.
if (static_cast<SVGGeometryElement*>(mContent)->GeometryDependsOnCoordCtx() ||
if (static_cast<SVGGeometryElement*>(GetContent())->GeometryDependsOnCoordCtx() ||
StyleSVG()->mStrokeWidth.HasPercent()) {
static_cast<SVGGeometryElement*>(mContent)->ClearAnyCachedPath();
static_cast<SVGGeometryElement*>(GetContent())->ClearAnyCachedPath();
nsSVGUtils::ScheduleReflowSVG(this);
}
}
@ -493,7 +493,7 @@ SVGGeometryFrame::GetBBoxContribution(const Matrix &aToBBoxUserspace,
}
SVGGeometryElement* element =
static_cast<SVGGeometryElement*>(mContent);
static_cast<SVGGeometryElement*>(GetContent());
bool getFill = (aFlags & nsSVGUtils::eBBoxIncludeFillGeometry) ||
((aFlags & nsSVGUtils::eBBoxIncludeFill) &&
@ -646,14 +646,14 @@ SVGGeometryFrame::GetBBoxContribution(const Matrix &aToBBoxUserspace,
// Account for markers:
if ((aFlags & nsSVGUtils::eBBoxIncludeMarkers) != 0 &&
static_cast<SVGGeometryElement*>(mContent)->IsMarkable()) {
static_cast<SVGGeometryElement*>(GetContent())->IsMarkable()) {
float strokeWidth = nsSVGUtils::GetStrokeWidth(this);
MarkerProperties properties = GetMarkerProperties(this);
if (properties.MarkersExist()) {
nsTArray<nsSVGMark> marks;
static_cast<SVGGeometryElement*>(mContent)->GetMarkPoints(&marks);
static_cast<SVGGeometryElement*>(GetContent())->GetMarkPoints(&marks);
uint32_t num = marks.Length();
// These are in the same order as the nsSVGMark::Type constants.
@ -691,7 +691,7 @@ SVGGeometryFrame::GetCanvasTM()
NS_ASSERTION(GetParent(), "null parent");
nsSVGContainerFrame *parent = static_cast<nsSVGContainerFrame*>(GetParent());
SVGGraphicsElement *content = static_cast<SVGGraphicsElement*>(mContent);
SVGGraphicsElement *content = static_cast<SVGGraphicsElement*>(GetContent());
return content->PrependLocalTransformsTo(parent->GetCanvasTM());
}
@ -762,7 +762,7 @@ SVGGeometryFrame::Render(gfxContext* aContext,
StyleSVG()->mClipRule : StyleSVG()->mFillRule);
SVGGeometryElement* element =
static_cast<SVGGeometryElement*>(mContent);
static_cast<SVGGeometryElement*>(GetContent());
AntialiasMode aaMode =
(StyleSVG()->mShapeRendering == NS_STYLE_SHAPE_RENDERING_OPTIMIZESPEED ||
@ -798,7 +798,7 @@ SVGGeometryFrame::Render(gfxContext* aContext,
}
}
SVGContextPaint* contextPaint = SVGContextPaint::GetContextPaint(mContent);
SVGContextPaint* contextPaint = SVGContextPaint::GetContextPaint(GetContent());
if (aRenderComponents & eRenderFill) {
GeneralPattern fillPattern;
@ -846,7 +846,7 @@ SVGGeometryFrame::Render(gfxContext* aContext,
if (strokePattern.GetPattern()) {
SVGContentUtils::AutoStrokeOptions strokeOptions;
SVGContentUtils::GetStrokeOptions(&strokeOptions,
static_cast<nsSVGElement*>(mContent),
static_cast<nsSVGElement*>(GetContent()),
StyleContext(), contextPaint);
// GetStrokeOptions may set the line width to zero as an optimization
if (strokeOptions.mLineWidth <= 0) {
@ -871,8 +871,8 @@ SVGGeometryFrame::PaintMarkers(gfxContext& aContext,
const gfxMatrix& aTransform,
imgDrawingParams& aImgParams)
{
SVGContextPaint* contextPaint = SVGContextPaint::GetContextPaint(mContent);
if (static_cast<SVGGeometryElement*>(mContent)->IsMarkable()) {
SVGContextPaint* contextPaint = SVGContextPaint::GetContextPaint(GetContent());
if (static_cast<SVGGeometryElement*>(GetContent())->IsMarkable()) {
MarkerProperties properties = GetMarkerProperties(this);
if (properties.MarkersExist()) {
@ -880,7 +880,7 @@ SVGGeometryFrame::PaintMarkers(gfxContext& aContext,
nsTArray<nsSVGMark> marks;
static_cast<SVGGeometryElement*>
(mContent)->GetMarkPoints(&marks);
(GetContent())->GetMarkPoints(&marks);
uint32_t num = marks.Length();
if (num) {

View File

@ -3651,7 +3651,7 @@ SVGTextFrame::PaintSVG(gfxContext& aContext,
TextRenderedRun run = it.Current();
SVGContextPaint* outerContextPaint =
SVGContextPaint::GetContextPaint(mContent);
SVGContextPaint::GetContextPaint(GetContent());
while (run.mFrame) {
nsTextFrame* frame = run.mFrame;
@ -3925,7 +3925,7 @@ SVGTextFrame::GetCanvasTM()
"should not call GetCanvasTM() when we are non-display");
nsSVGContainerFrame *parent = static_cast<nsSVGContainerFrame*>(GetParent());
dom::SVGTextContentElement *content = static_cast<dom::SVGTextContentElement*>(mContent);
dom::SVGTextContentElement *content = static_cast<dom::SVGTextContentElement*>(GetContent());
gfxMatrix tm = content->PrependLocalTransformsTo(parent->GetCanvasTM());
@ -5059,7 +5059,7 @@ SVGTextFrame::DoGlyphPositioning()
// If the textLength="" attribute was specified, then we need ResolvePositions
// to record that a new run starts with each glyph.
SVGTextContentElement* element = static_cast<SVGTextContentElement*>(mContent);
SVGTextContentElement* element = static_cast<SVGTextContentElement*>(GetContent());
nsSVGLength2* textLengthAttr =
element->GetAnimatedLength(nsGkAtoms::textLength);
bool adjustingTextLength = textLengthAttr->IsExplicitlySet();
@ -5213,7 +5213,7 @@ SVGTextFrame::ShouldRenderAsPath(nsTextFrame* aFrame,
// Text has a stroke.
if (style->HasStroke() &&
SVGContentUtils::CoordToFloat(static_cast<nsSVGElement*>(mContent),
SVGContentUtils::CoordToFloat(static_cast<nsSVGElement*>(GetContent()),
style->mStrokeWidth) > 0) {
return true;
}

View File

@ -103,7 +103,7 @@ nsSVGAFrame::AttributeChanged(int32_t aNameSpaceID,
(aNameSpaceID == kNameSpaceID_None ||
aNameSpaceID == kNameSpaceID_XLink)) {
dom::SVGAElement* content = static_cast<dom::SVGAElement*>(mContent);
dom::SVGAElement* content = static_cast<dom::SVGAElement*>(GetContent());
// SMIL may change whether an <a> element is a link, in which case we will
// need to update the link state.
@ -140,7 +140,7 @@ nsSVGAFrame::GetCanvasTM()
NS_ASSERTION(GetParent(), "null parent");
nsSVGContainerFrame *parent = static_cast<nsSVGContainerFrame*>(GetParent());
dom::SVGAElement *content = static_cast<dom::SVGAElement*>(mContent);
dom::SVGAElement *content = static_cast<dom::SVGAElement*>(GetContent());
gfxMatrix tm = content->PrependLocalTransformsTo(parent->GetCanvasTM());

View File

@ -458,7 +458,7 @@ nsSVGClipPathFrame::GetCanvasTM()
gfxMatrix
nsSVGClipPathFrame::GetClipPathTransform(nsIFrame* aClippedFrame)
{
SVGClipPathElement *content = static_cast<SVGClipPathElement*>(mContent);
SVGClipPathElement *content = static_cast<SVGClipPathElement*>(GetContent());
gfxMatrix tm = content->PrependLocalTransformsTo(gfxMatrix());

View File

@ -147,7 +147,7 @@ nsSVGDisplayContainerFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
{
// mContent could be a XUL element so check for an SVG element before casting
if (mContent->IsSVGElement() &&
!static_cast<const nsSVGElement*>(mContent)->HasValidDimensions()) {
!static_cast<const nsSVGElement*>(GetContent())->HasValidDimensions()) {
return;
}
DisplayOutline(aBuilder, aLists);
@ -232,7 +232,7 @@ nsSVGDisplayContainerFrame::IsSVGTransformed(gfx::Matrix *aOwnTransform,
// mContent could be a XUL element so check for an SVG element before casting
if (mContent->IsSVGElement()) {
nsSVGElement *content = static_cast<nsSVGElement*>(mContent);
nsSVGElement *content = static_cast<nsSVGElement*>(GetContent());
nsSVGAnimatedTransformList* transformList =
content->GetAnimatedTransformList();
if ((transformList && transformList->HasTransform()) ||

View File

@ -33,7 +33,7 @@ uint16_t
nsSVGFilterFrame::GetEnumValue(uint32_t aIndex, nsIContent *aDefault)
{
nsSVGEnum& thisEnum =
static_cast<SVGFilterElement *>(mContent)->mEnumAttributes[aIndex];
static_cast<SVGFilterElement *>(GetContent())->mEnumAttributes[aIndex];
if (thisEnum.IsExplicitlySet())
return thisEnum.GetAnimValue();
@ -60,7 +60,7 @@ const nsSVGLength2 *
nsSVGFilterFrame::GetLengthValue(uint32_t aIndex, nsIContent *aDefault)
{
const nsSVGLength2 *thisLength =
&static_cast<SVGFilterElement *>(mContent)->mLengthAttributes[aIndex];
&static_cast<SVGFilterElement *>(GetContent())->mLengthAttributes[aIndex];
if (thisLength->IsExplicitlySet())
return thisLength;
@ -90,7 +90,7 @@ nsSVGFilterFrame::GetFilterContent(nsIContent *aDefault)
RefPtr<nsSVGFE> primitive;
CallQueryInterface(child, (nsSVGFE**)getter_AddRefs(primitive));
if (primitive) {
return static_cast<SVGFilterElement *>(mContent);
return static_cast<SVGFilterElement *>(GetContent());
}
}
@ -121,7 +121,7 @@ nsSVGFilterFrame::GetReferencedFilter()
if (!property) {
// Fetch our Filter element's href or xlink:href attribute
SVGFilterElement *filter = static_cast<SVGFilterElement *>(mContent);
SVGFilterElement *filter = static_cast<SVGFilterElement *>(GetContent());
nsAutoString href;
if (filter->mStringAttributes[SVGFilterElement::HREF].IsExplicitlySet()) {
filter->mStringAttributes[SVGFilterElement::HREF]

View File

@ -158,7 +158,7 @@ void
nsSVGForeignObjectFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsDisplayListSet& aLists)
{
if (!static_cast<const nsSVGElement*>(mContent)->HasValidDimensions()) {
if (!static_cast<const nsSVGElement*>(GetContent())->HasValidDimensions()) {
return;
}
DisplayOutline(aBuilder, aLists);
@ -179,7 +179,7 @@ nsSVGForeignObjectFrame::IsSVGTransformed(Matrix *aOwnTransform,
HasChildrenOnlyTransform(aFromParentTransform);
}
nsSVGElement *content = static_cast<nsSVGElement*>(mContent);
nsSVGElement *content = static_cast<nsSVGElement*>(GetContent());
nsSVGAnimatedTransformList* transformList =
content->GetAnimatedTransformList();
if ((transformList && transformList->HasTransform()) ||
@ -251,7 +251,7 @@ nsSVGForeignObjectFrame::PaintSVG(gfxContext& aContext,
if (StyleDisplay()->IsScrollableOverflow()) {
float x, y, width, height;
static_cast<nsSVGElement*>(mContent)->
static_cast<nsSVGElement*>(GetContent())->
GetAnimatedLengthValues(&x, &y, &width, &height, nullptr);
gfxRect clipRect =
@ -301,7 +301,7 @@ nsSVGForeignObjectFrame::GetFrameForPoint(const gfxPoint& aPoint)
return nullptr;
float x, y, width, height;
static_cast<nsSVGElement*>(mContent)->
static_cast<nsSVGElement*>(GetContent())->
GetAnimatedLengthValues(&x, &y, &width, &height, nullptr);
if (!gfxRect(x, y, width, height).Contains(aPoint) ||
@ -335,7 +335,7 @@ nsSVGForeignObjectFrame::ReflowSVG()
// correct dimensions:
float x, y, w, h;
static_cast<SVGForeignObjectElement*>(mContent)->
static_cast<SVGForeignObjectElement*>(GetContent())->
GetAnimatedLengthValues(&x, &y, &w, &h, nullptr);
// If mRect's width or height are negative, reflow blows up! We must clamp!
@ -392,7 +392,7 @@ nsSVGForeignObjectFrame::NotifySVGChanged(uint32_t aFlags)
if (aFlags & COORD_CONTEXT_CHANGED) {
SVGForeignObjectElement *fO =
static_cast<SVGForeignObjectElement*>(mContent);
static_cast<SVGForeignObjectElement*>(GetContent());
// Coordinate context changes affect mCanvasTM if we have a
// percentage 'x' or 'y'
if (fO->mLengthAttributes[SVGForeignObjectElement::ATTR_X].IsPercentage() ||
@ -455,7 +455,7 @@ nsSVGForeignObjectFrame::GetBBoxContribution(const Matrix &aToBBoxUserspace,
uint32_t aFlags)
{
SVGForeignObjectElement *content =
static_cast<SVGForeignObjectElement*>(mContent);
static_cast<SVGForeignObjectElement*>(GetContent());
float x, y, w, h;
content->GetAnimatedLengthValues(&x, &y, &w, &h, nullptr);
@ -480,7 +480,7 @@ nsSVGForeignObjectFrame::GetCanvasTM()
nsSVGContainerFrame *parent = static_cast<nsSVGContainerFrame*>(GetParent());
SVGForeignObjectElement *content =
static_cast<SVGForeignObjectElement*>(mContent);
static_cast<SVGForeignObjectElement*>(GetContent());
gfxMatrix tm = content->PrependLocalTransformsTo(parent->GetCanvasTM());

View File

@ -65,7 +65,7 @@ nsSVGGFrame::GetCanvasTM()
NS_ASSERTION(GetParent(), "null parent");
nsSVGContainerFrame *parent = static_cast<nsSVGContainerFrame*>(GetParent());
SVGGraphicsElement *content = static_cast<SVGGraphicsElement*>(mContent);
SVGGraphicsElement *content = static_cast<SVGGraphicsElement*>(GetContent());
gfxMatrix tm = content->PrependLocalTransformsTo(parent->GetCanvasTM());

View File

@ -67,7 +67,7 @@ uint16_t
nsSVGGradientFrame::GetEnumValue(uint32_t aIndex, nsIContent *aDefault)
{
const nsSVGEnum& thisEnum =
static_cast<dom::SVGGradientElement*>(mContent)->mEnumAttributes[aIndex];
static_cast<dom::SVGGradientElement*>(GetContent())->mEnumAttributes[aIndex];
if (thisEnum.IsExplicitlySet())
return thisEnum.GetAnimValue();
@ -107,7 +107,7 @@ const nsSVGAnimatedTransformList*
nsSVGGradientFrame::GetGradientTransformList(nsIContent* aDefault)
{
nsSVGAnimatedTransformList *thisTransformList =
static_cast<dom::SVGGradientElement*>(mContent)->GetAnimatedTransformList();
static_cast<dom::SVGGradientElement*>(GetContent())->GetAnimatedTransformList();
if (thisTransformList && thisTransformList->IsExplicitlySet())
return thisTransformList;
@ -152,7 +152,7 @@ nsSVGGradientFrame::GetGradientTransform(nsIFrame *aSource,
}
const nsSVGAnimatedTransformList* animTransformList =
GetGradientTransformList(mContent);
GetGradientTransformList(GetContent());
if (!animTransformList)
return bboxMatrix;
@ -340,7 +340,7 @@ nsSVGGradientFrame::GetReferencedGradient()
if (!property) {
// Fetch our gradient element's href or xlink:href attribute
dom::SVGGradientElement* grad =
static_cast<dom::SVGGradientElement*>(mContent);
static_cast<dom::SVGGradientElement*>(GetContent());
nsAutoString href;
if (grad->mStringAttributes[dom::SVGGradientElement::HREF]
.IsExplicitlySet()) {
@ -454,7 +454,7 @@ nsSVGLinearGradientFrame::GetLengthValue(uint32_t aIndex)
{
dom::SVGLinearGradientElement* lengthElement =
GetLinearGradientWithLength(aIndex,
static_cast<dom::SVGLinearGradientElement*>(mContent));
static_cast<dom::SVGLinearGradientElement*>(GetContent()));
// We passed in mContent as a fallback, so, assuming mContent is non-null, the
// return value should also be non-null.
MOZ_ASSERT(lengthElement,
@ -482,7 +482,7 @@ nsSVGLinearGradientFrame::GetLinearGradientWithLength(uint32_t aIndex,
dom::SVGLinearGradientElement* aDefault)
{
dom::SVGLinearGradientElement* thisElement =
static_cast<dom::SVGLinearGradientElement*>(mContent);
static_cast<dom::SVGLinearGradientElement*>(GetContent());
const nsSVGLength2 &length = thisElement->mLengthAttributes[aIndex];
if (length.IsExplicitlySet()) {
@ -557,7 +557,7 @@ nsSVGRadialGradientFrame::GetLengthValue(uint32_t aIndex)
{
dom::SVGRadialGradientElement* lengthElement =
GetRadialGradientWithLength(aIndex,
static_cast<dom::SVGRadialGradientElement*>(mContent));
static_cast<dom::SVGRadialGradientElement*>(GetContent()));
// We passed in mContent as a fallback, so, assuming mContent is non-null,
// the return value should also be non-null.
MOZ_ASSERT(lengthElement,
@ -602,7 +602,7 @@ nsSVGRadialGradientFrame::GetRadialGradientWithLength(uint32_t aIndex,
dom::SVGRadialGradientElement* aDefault)
{
dom::SVGRadialGradientElement* thisElement =
static_cast<dom::SVGRadialGradientElement*>(mContent);
static_cast<dom::SVGRadialGradientElement*>(GetContent());
const nsSVGLength2 &length = thisElement->mLengthAttributes[aIndex];
if (length.IsExplicitlySet()) {

View File

@ -49,7 +49,7 @@ nsSVGImageFrame::~nsSVGImageFrame()
{
// set the frame to null so we don't send messages to a dead object.
if (mListener) {
nsCOMPtr<nsIImageLoadingContent> imageLoader = do_QueryInterface(mContent);
nsCOMPtr<nsIImageLoadingContent> imageLoader = do_QueryInterface(GetContent());
if (imageLoader) {
imageLoader->RemoveNativeObserver(mListener);
}
@ -81,7 +81,7 @@ nsSVGImageFrame::Init(nsIContent* aContent,
}
mListener = new nsSVGImageListener(this);
nsCOMPtr<nsIImageLoadingContent> imageLoader = do_QueryInterface(mContent);
nsCOMPtr<nsIImageLoadingContent> imageLoader = do_QueryInterface(GetContent());
if (!imageLoader) {
MOZ_CRASH("Why is this not an image loading content?");
}
@ -151,7 +151,7 @@ nsSVGImageFrame::AttributeChanged(int32_t aNameSpaceID,
aAttribute == nsGkAtoms::href &&
(aNameSpaceID == kNameSpaceID_XLink ||
aNameSpaceID == kNameSpaceID_None)) {
SVGImageElement* element = static_cast<SVGImageElement*>(mContent);
SVGImageElement* element = static_cast<SVGImageElement*>(GetContent());
bool hrefIsSet =
element->mStringAttributes[SVGImageElement::HREF].IsExplicitlySet() ||
@ -171,7 +171,7 @@ void
nsSVGImageFrame::OnVisibilityChange(Visibility aNewVisibility,
const Maybe<OnNonvisible>& aNonvisibleAction)
{
nsCOMPtr<nsIImageLoadingContent> imageLoader = do_QueryInterface(mContent);
nsCOMPtr<nsIImageLoadingContent> imageLoader = do_QueryInterface(GetContent());
if (!imageLoader) {
SVGGeometryFrame::OnVisibilityChange(aNewVisibility, aNonvisibleAction);
return;
@ -187,7 +187,7 @@ nsSVGImageFrame::GetRasterImageTransform(int32_t aNativeWidth,
int32_t aNativeHeight)
{
float x, y, width, height;
SVGImageElement *element = static_cast<SVGImageElement*>(mContent);
SVGImageElement *element = static_cast<SVGImageElement*>(GetContent());
element->GetAnimatedLengthValues(&x, &y, &width, &height, nullptr);
Matrix viewBoxTM =
@ -202,7 +202,7 @@ gfx::Matrix
nsSVGImageFrame::GetVectorImageTransform()
{
float x, y, width, height;
SVGImageElement *element = static_cast<SVGImageElement*>(mContent);
SVGImageElement *element = static_cast<SVGImageElement*>(GetContent());
element->GetAnimatedLengthValues(&x, &y, &width, &height, nullptr);
// No viewBoxTM needed here -- our height/width overrides any concept of
@ -258,14 +258,14 @@ nsSVGImageFrame::PaintSVG(gfxContext& aContext,
}
float x, y, width, height;
SVGImageElement *imgElem = static_cast<SVGImageElement*>(mContent);
SVGImageElement *imgElem = static_cast<SVGImageElement*>(GetContent());
imgElem->GetAnimatedLengthValues(&x, &y, &width, &height, nullptr);
NS_ASSERTION(width > 0 && height > 0,
"Should only be painting things with valid width/height");
if (!mImageContainer) {
nsCOMPtr<imgIRequest> currentRequest;
nsCOMPtr<nsIImageLoadingContent> imageLoader = do_QueryInterface(mContent);
nsCOMPtr<nsIImageLoadingContent> imageLoader = do_QueryInterface(GetContent());
if (imageLoader)
imageLoader->GetRequest(nsIImageLoadingContent::CURRENT_REQUEST,
getter_AddRefs(currentRequest));
@ -374,7 +374,7 @@ nsSVGImageFrame::GetFrameForPoint(const gfxPoint& aPoint)
}
Rect rect;
SVGImageElement *element = static_cast<SVGImageElement*>(mContent);
SVGImageElement *element = static_cast<SVGImageElement*>(GetContent());
element->GetAnimatedLengthValues(&rect.x, &rect.y,
&rect.width, &rect.height, nullptr);
@ -432,7 +432,7 @@ nsSVGImageFrame::ReflowSVG()
}
float x, y, width, height;
SVGImageElement *element = static_cast<SVGImageElement*>(mContent);
SVGImageElement *element = static_cast<SVGImageElement*>(GetContent());
element->GetAnimatedLengthValues(&x, &y, &width, &height, nullptr);
Rect extent(x, y, width, height);

View File

@ -74,7 +74,7 @@ nsSVGMarkerFrame::GetCanvasTM()
return gfxMatrix();
}
SVGMarkerElement *content = static_cast<SVGMarkerElement*>(mContent);
SVGMarkerElement *content = static_cast<SVGMarkerElement*>(GetContent());
mInUse2 = true;
gfxMatrix markedTM = mMarkedFrame->GetCanvasTM();
@ -110,7 +110,7 @@ nsSVGMarkerFrame::PaintMark(gfxContext& aContext,
AutoMarkerReferencer markerRef(this, aMarkedFrame);
SVGMarkerElement *marker = static_cast<SVGMarkerElement*>(mContent);
SVGMarkerElement *marker = static_cast<SVGMarkerElement*>(GetContent());
if (!marker->HasValidDimensions()) {
return;
}
@ -165,7 +165,7 @@ nsSVGMarkerFrame::GetMarkBBoxContribution(const Matrix& aToBBoxUserspace,
AutoMarkerReferencer markerRef(this, aMarkedFrame);
SVGMarkerElement *content = static_cast<SVGMarkerElement*>(mContent);
SVGMarkerElement *content = static_cast<SVGMarkerElement*>(GetContent());
if (!content->HasValidDimensions()) {
return bbox;
}
@ -196,7 +196,7 @@ nsSVGMarkerFrame::GetMarkBBoxContribution(const Matrix& aToBBoxUserspace,
void
nsSVGMarkerFrame::SetParentCoordCtxProvider(SVGSVGElement *aContext)
{
SVGMarkerElement *marker = static_cast<SVGMarkerElement*>(mContent);
SVGMarkerElement *marker = static_cast<SVGMarkerElement*>(GetContent());
marker->SetParentCoordCtxProvider(aContext);
}

View File

@ -160,7 +160,7 @@ nsSVGMaskFrame::GetMaskForMaskedFrame(MaskParams& aParams)
gfxRect
nsSVGMaskFrame::GetMaskArea(nsIFrame* aMaskedFrame)
{
SVGMaskElement *maskElem = static_cast<SVGMaskElement*>(mContent);
SVGMaskElement *maskElem = static_cast<SVGMaskElement*>(GetContent());
uint16_t units =
maskElem->mEnumAttributes[SVGMaskElement::MASKUNITS].GetAnimValue();
@ -221,7 +221,7 @@ nsSVGMaskFrame::GetCanvasTM()
gfxMatrix
nsSVGMaskFrame::GetMaskTransform(nsIFrame* aMaskedFrame)
{
SVGMaskElement *content = static_cast<SVGMaskElement*>(mContent);
SVGMaskElement *content = static_cast<SVGMaskElement*>(GetContent());
nsSVGEnum* maskContentUnits =
&content->mEnumAttributes[SVGMaskElement::MASKCONTENTUNITS];

View File

@ -168,7 +168,7 @@ nsSVGOuterSVGFrame::GetPrefISize(gfxContext *aRenderingContext)
nscoord result;
DISPLAY_PREF_WIDTH(this, result);
SVGSVGElement *svg = static_cast<SVGSVGElement*>(mContent);
SVGSVGElement *svg = static_cast<SVGSVGElement*>(GetContent());
WritingMode wm = GetWritingMode();
const nsSVGLength2& isize = wm.IsVertical()
? svg->mLengthAttributes[SVGSVGElement::ATTR_HEIGHT]
@ -212,7 +212,7 @@ nsSVGOuterSVGFrame::GetIntrinsicSize()
IntrinsicSize intrinsicSize;
SVGSVGElement *content = static_cast<SVGSVGElement*>(mContent);
SVGSVGElement *content = static_cast<SVGSVGElement*>(GetContent());
const nsSVGLength2& width =
content->mLengthAttributes[SVGSVGElement::ATTR_WIDTH];
const nsSVGLength2& height =
@ -240,7 +240,7 @@ nsSVGOuterSVGFrame::GetIntrinsicRatio()
// are both specified and set to non-percentage values, or we have a viewBox
// rect: http://www.w3.org/TR/SVGMobile12/coords.html#IntrinsicSizing
SVGSVGElement *content = static_cast<SVGSVGElement*>(mContent);
SVGSVGElement *content = static_cast<SVGSVGElement*>(GetContent());
const nsSVGLength2& width =
content->mLengthAttributes[SVGSVGElement::ATTR_WIDTH];
const nsSVGLength2& height =
@ -324,7 +324,7 @@ nsSVGOuterSVGFrame::ComputeSize(gfxContext *aRenderingContext,
// intrinsic size. Also note that explicit percentage values are mapped
// into style, so the following isn't for them.)
SVGSVGElement* content = static_cast<SVGSVGElement*>(mContent);
SVGSVGElement* content = static_cast<SVGSVGElement*>(GetContent());
const nsSVGLength2& width =
content->mLengthAttributes[SVGSVGElement::ATTR_WIDTH];
@ -383,7 +383,7 @@ nsSVGOuterSVGFrame::Reflow(nsPresContext* aPresContext,
NS_ASSERTION(!GetPrevInFlow(), "SVG can't currently be broken across pages.");
SVGSVGElement *svgElem = static_cast<SVGSVGElement*>(mContent);
SVGSVGElement *svgElem = static_cast<SVGSVGElement*>(GetContent());
nsSVGOuterSVGAnonChildFrame *anonKid =
static_cast<nsSVGOuterSVGAnonChildFrame*>(PrincipalChildList().FirstChild());
@ -703,7 +703,7 @@ nsSVGOuterSVGFrame::AttributeChanged(int32_t aNameSpaceID,
TRANSFORM_CHANGED | COORD_CONTEXT_CHANGED : TRANSFORM_CHANGED);
if (aAttribute != nsGkAtoms::transform) {
static_cast<SVGSVGElement*>(mContent)->ChildrenOnlyTransformChanged();
static_cast<SVGSVGElement*>(GetContent())->ChildrenOnlyTransformChanged();
}
} else if (aAttribute == nsGkAtoms::width ||
@ -743,7 +743,7 @@ nsSVGOuterSVGFrame::IsSVGTransformed(Matrix* aOwnTransform,
bool foundTransform = false;
SVGSVGElement *content = static_cast<SVGSVGElement*>(mContent);
SVGSVGElement *content = static_cast<SVGSVGElement*>(GetContent());
nsSVGAnimatedTransformList* transformList =
content->GetAnimatedTransformList();
if ((transformList && transformList->HasTransform()) ||
@ -816,7 +816,7 @@ nsSVGOuterSVGFrame::NotifyViewportOrTransformChanged(uint32_t aFlags)
return;
}
SVGSVGElement *content = static_cast<SVGSVGElement*>(mContent);
SVGSVGElement *content = static_cast<SVGSVGElement*>(GetContent());
if (aFlags & COORD_CONTEXT_CHANGED) {
if (content->HasViewBoxRect()) {
@ -900,7 +900,7 @@ gfxMatrix
nsSVGOuterSVGFrame::GetCanvasTM()
{
if (!mCanvasTM) {
SVGSVGElement *content = static_cast<SVGSVGElement*>(mContent);
SVGSVGElement *content = static_cast<SVGSVGElement*>(GetContent());
float devPxPerCSSPx =
1.0f / PresContext()->AppUnitsToFloatCSSPixels(
@ -967,7 +967,7 @@ nsSVGOuterSVGFrame::IsRootOfImage()
bool
nsSVGOuterSVGFrame::VerticalScrollbarNotNeeded() const
{
const nsSVGLength2& height = static_cast<SVGSVGElement*>(mContent)->
const nsSVGLength2& height = static_cast<SVGSVGElement*>(GetContent())->
mLengthAttributes[SVGSVGElement::ATTR_HEIGHT];
return height.IsPercentage() && height.GetBaseValInSpecifiedUnits() <= 100;
}
@ -1012,7 +1012,7 @@ nsSVGOuterSVGAnonChildFrame::IsSVGTransformed(Matrix* aOwnTransform,
// anonymous child frame. Since we are the child frame, we apply the
// children-only transforms as if they are our own transform.
SVGSVGElement* content = static_cast<SVGSVGElement*>(mContent);
SVGSVGElement* content = static_cast<SVGSVGElement*>(GetContent());
if (!content->HasChildrenOnlyTransform()) {
return false;

View File

@ -440,7 +440,7 @@ uint16_t
nsSVGPatternFrame::GetEnumValue(uint32_t aIndex, nsIContent *aDefault)
{
nsSVGEnum& thisEnum =
static_cast<SVGPatternElement *>(mContent)->mEnumAttributes[aIndex];
static_cast<SVGPatternElement *>(GetContent())->mEnumAttributes[aIndex];
if (thisEnum.IsExplicitlySet())
return thisEnum.GetAnimValue();
@ -466,7 +466,7 @@ nsSVGAnimatedTransformList*
nsSVGPatternFrame::GetPatternTransformList(nsIContent* aDefault)
{
nsSVGAnimatedTransformList *thisTransformList =
static_cast<SVGPatternElement *>(mContent)->GetAnimatedTransformList();
static_cast<SVGPatternElement *>(GetContent())->GetAnimatedTransformList();
if (thisTransformList && thisTransformList->IsExplicitlySet())
return thisTransformList;
@ -490,7 +490,7 @@ gfxMatrix
nsSVGPatternFrame::GetPatternTransform()
{
nsSVGAnimatedTransformList* animTransformList =
GetPatternTransformList(mContent);
GetPatternTransformList(GetContent());
if (!animTransformList)
return gfxMatrix();
@ -501,7 +501,7 @@ const nsSVGViewBox &
nsSVGPatternFrame::GetViewBox(nsIContent* aDefault)
{
const nsSVGViewBox &thisViewBox =
static_cast<SVGPatternElement *>(mContent)->mViewBox;
static_cast<SVGPatternElement *>(GetContent())->mViewBox;
if (thisViewBox.IsExplicitlySet())
return thisViewBox;
@ -525,7 +525,7 @@ const SVGAnimatedPreserveAspectRatio &
nsSVGPatternFrame::GetPreserveAspectRatio(nsIContent *aDefault)
{
const SVGAnimatedPreserveAspectRatio &thisPar =
static_cast<SVGPatternElement *>(mContent)->mPreserveAspectRatio;
static_cast<SVGPatternElement *>(GetContent())->mPreserveAspectRatio;
if (thisPar.IsExplicitlySet())
return thisPar;
@ -549,7 +549,7 @@ const nsSVGLength2 *
nsSVGPatternFrame::GetLengthValue(uint32_t aIndex, nsIContent *aDefault)
{
const nsSVGLength2 *thisLength =
&static_cast<SVGPatternElement *>(mContent)->mLengthAttributes[aIndex];
&static_cast<SVGPatternElement *>(GetContent())->mLengthAttributes[aIndex];
if (thisLength->IsExplicitlySet())
return thisLength;
@ -581,7 +581,7 @@ nsSVGPatternFrame::GetReferencedPattern()
if (!property) {
// Fetch our pattern element's href or xlink:href attribute
SVGPatternElement *pattern = static_cast<SVGPatternElement *>(mContent);
SVGPatternElement *pattern = static_cast<SVGPatternElement *>(GetContent());
nsAutoString href;
if (pattern->mStringAttributes[SVGPatternElement::HREF].IsExplicitlySet()) {
pattern->mStringAttributes[SVGPatternElement::HREF]

View File

@ -130,7 +130,7 @@ nsSVGSwitchFrame::GetFrameForPoint(const gfxPoint& aPoint)
// Transform the point from our SVG user space to our child's.
gfxPoint point = aPoint;
gfxMatrix m =
static_cast<const nsSVGElement*>(mContent)->
static_cast<const nsSVGElement*>(GetContent())->
PrependLocalTransformsTo(gfxMatrix(), eChildToUserSpace);
m = static_cast<const nsSVGElement*>(kid->GetContent())->
PrependLocalTransformsTo(m, eUserSpaceToParent);
@ -227,7 +227,7 @@ nsIFrame *
nsSVGSwitchFrame::GetActiveChildFrame()
{
nsIContent *activeChild =
static_cast<mozilla::dom::SVGSwitchElement*>(mContent)->GetActiveChild();
static_cast<mozilla::dom::SVGSwitchElement*>(GetContent())->GetActiveChild();
if (activeChild) {
for (nsIFrame* kid = mFrames.FirstChild(); kid;

View File

@ -100,7 +100,7 @@ nsSVGUseFrame::AttributeChanged(int32_t aNameSpaceID,
nsIAtom* aAttribute,
int32_t aModType)
{
SVGUseElement *useElement = static_cast<SVGUseElement*>(mContent);
SVGUseElement *useElement = static_cast<SVGUseElement*>(GetContent());
if (aNameSpaceID == kNameSpaceID_None) {
if (aAttribute == nsGkAtoms::x || aAttribute == nsGkAtoms::y) {
@ -150,7 +150,7 @@ nsSVGUseFrame::AttributeChanged(int32_t aNameSpaceID,
void
nsSVGUseFrame::DestroyFrom(nsIFrame* aDestructRoot)
{
RefPtr<SVGUseElement> use = static_cast<SVGUseElement*>(mContent);
RefPtr<SVGUseElement> use = static_cast<SVGUseElement*>(GetContent());
nsSVGGFrame::DestroyFrom(aDestructRoot);
use->DestroyAnonymousContent();
}
@ -166,7 +166,7 @@ nsSVGUseFrame::ReflowSVG()
// handled by the nsSVGOuterSVGFrame for the anonymous <svg> that will be
// created for that purpose.
float x, y;
static_cast<SVGUseElement*>(mContent)->
static_cast<SVGUseElement*>(GetContent())->
GetAnimatedLengthValues(&x, &y, nullptr);
mRect.MoveTo(nsLayoutUtils::RoundGfxRectToAppRect(
gfxRect(x, y, 0.0, 0.0),
@ -188,7 +188,7 @@ nsSVGUseFrame::NotifySVGChanged(uint32_t aFlags)
!(aFlags & TRANSFORM_CHANGED)) {
// Coordinate context changes affect mCanvasTM if we have a
// percentage 'x' or 'y'
SVGUseElement *use = static_cast<SVGUseElement*>(mContent);
SVGUseElement *use = static_cast<SVGUseElement*>(GetContent());
if (use->mLengthAttributes[SVGUseElement::ATTR_X].IsPercentage() ||
use->mLengthAttributes[SVGUseElement::ATTR_Y].IsPercentage()) {
aFlags |= TRANSFORM_CHANGED;
@ -215,7 +215,7 @@ nsSVGUseFrame::NotifySVGChanged(uint32_t aFlags)
nsresult
nsSVGUseFrame::CreateAnonymousContent(nsTArray<ContentInfo>& aElements)
{
SVGUseElement *use = static_cast<SVGUseElement*>(mContent);
SVGUseElement *use = static_cast<SVGUseElement*>(GetContent());
nsIContent* clone = use->CreateAnonymousContent();
nsLayoutUtils::PostRestyleEvent(
@ -231,7 +231,7 @@ void
nsSVGUseFrame::AppendAnonymousContentTo(nsTArray<nsIContent*>& aElements,
uint32_t aFilter)
{
SVGUseElement *use = static_cast<SVGUseElement*>(mContent);
SVGUseElement *use = static_cast<SVGUseElement*>(GetContent());
nsIContent* clone = use->GetAnonymousContent();
if (clone) {
aElements.AppendElement(clone);

View File

@ -38,7 +38,7 @@ nsSVGViewportFrame::PaintSVG(gfxContext& aContext,
if (StyleDisplay()->IsScrollableOverflow()) {
float x, y, width, height;
static_cast<SVGViewportElement*>(mContent)->
static_cast<SVGViewportElement*>(GetContent())->
GetAnimatedLengthValues(&x, &y, &width, &height, nullptr);
if (width <= 0 || height <= 0) {
@ -61,7 +61,7 @@ nsSVGViewportFrame::ReflowSVG()
// mRect must be set before FinishAndStoreOverflow is called in order
// for our overflow areas to be clipped correctly.
float x, y, width, height;
static_cast<SVGViewportElement*>(mContent)->
static_cast<SVGViewportElement*>(GetContent())->
GetAnimatedLengthValues(&x, &y, &width, &height, nullptr);
mRect = nsLayoutUtils::RoundGfxRectToAppRect(
gfxRect(x, y, width, height),
@ -84,7 +84,7 @@ nsSVGViewportFrame::NotifySVGChanged(uint32_t aFlags)
if (aFlags & COORD_CONTEXT_CHANGED) {
SVGViewportElement *svg = static_cast<SVGViewportElement*>(mContent);
SVGViewportElement *svg = static_cast<SVGViewportElement*>(GetContent());
bool xOrYIsPercentage =
svg->mLengthAttributes[SVGViewportElement::ATTR_X].IsPercentage() ||
@ -151,7 +151,7 @@ nsSVGViewportFrame::GetBBoxContribution(const Matrix &aToBBoxUserspace,
// Ideally getClientRects/getBoundingClientRect should be consistent with
// getBBox.
float x, y, w, h;
static_cast<SVGViewportElement*>(mContent)->
static_cast<SVGViewportElement*>(GetContent())->
GetAnimatedLengthValues(&x, &y, &w, &h, nullptr);
if (w < 0.0f) w = 0.0f;
if (h < 0.0f) h = 0.0f;
@ -180,7 +180,7 @@ nsSVGViewportFrame::AttributeChanged(int32_t aNameSpaceID,
if (aNameSpaceID == kNameSpaceID_None &&
!(GetStateBits() & NS_FRAME_IS_NONDISPLAY)) {
SVGViewportElement* content = static_cast<SVGViewportElement*>(mContent);
SVGViewportElement* content = static_cast<SVGViewportElement*>(GetContent());
if (aAttribute == nsGkAtoms::width ||
aAttribute == nsGkAtoms::height) {
@ -249,7 +249,7 @@ nsSVGViewportFrame::GetFrameForPoint(const gfxPoint& aPoint)
if (StyleDisplay()->IsScrollableOverflow()) {
Rect clip;
static_cast<nsSVGElement*>(mContent)->
static_cast<nsSVGElement*>(GetContent())->
GetAnimatedLengthValues(&clip.x, &clip.y,
&clip.width, &clip.height, nullptr);
if (!clip.Contains(ToPoint(aPoint))) {
@ -284,7 +284,7 @@ nsSVGViewportFrame::GetCanvasTM()
NS_ASSERTION(GetParent(), "null parent");
nsSVGContainerFrame *parent = static_cast<nsSVGContainerFrame*>(GetParent());
SVGViewportElement *content = static_cast<SVGViewportElement*>(mContent);
SVGViewportElement *content = static_cast<SVGViewportElement*>(GetContent());
gfxMatrix tm = content->PrependLocalTransformsTo(parent->GetCanvasTM());
@ -296,7 +296,7 @@ nsSVGViewportFrame::GetCanvasTM()
bool
nsSVGViewportFrame::HasChildrenOnlyTransform(gfx::Matrix *aTransform) const
{
SVGViewportElement *content = static_cast<SVGViewportElement*>(mContent);
SVGViewportElement *content = static_cast<SVGViewportElement*>(GetContent());
if (content->HasViewBoxOrSyntheticViewBox()) {
// XXX Maybe return false if the transform is the identity transform?

View File

@ -704,7 +704,7 @@ nsMenuFrame::GetAnchor()
}
// Always return the menu's content if the anchor wasn't set or wasn't found.
return anchor && anchor->GetPrimaryFrame() ? anchor : mContent;
return anchor && anchor->GetPrimaryFrame() ? anchor : GetContent();
}
void