Back out changeset 0bb00282a4c2 (bug 1243559) for widespread SVG assertion failures

CLOSED TREE
This commit is contained in:
Phil Ringnalda 2016-06-22 18:45:08 -07:00
parent 83442b6d87
commit 28ae5ce216
30 changed files with 242 additions and 180 deletions

View File

@ -159,7 +159,7 @@ FrameLayerBuilder::DisplayItemData::AddFrame(nsIFrame* aFrame)
mFrameList.AppendElement(aFrame);
nsTArray<DisplayItemData*>* array =
aFrame->Properties().Get(FrameLayerBuilder::LayerManagerDataProperty());
static_cast<nsTArray<DisplayItemData*>*>(aFrame->Properties().Get(FrameLayerBuilder::LayerManagerDataProperty()));
if (!array) {
array = new nsTArray<DisplayItemData*>();
aFrame->Properties().Set(FrameLayerBuilder::LayerManagerDataProperty(), array);
@ -175,7 +175,7 @@ FrameLayerBuilder::DisplayItemData::RemoveFrame(nsIFrame* aFrame)
MOZ_RELEASE_ASSERT(result, "Can't remove a frame that wasn't added!");
nsTArray<DisplayItemData*>* array =
aFrame->Properties().Get(FrameLayerBuilder::LayerManagerDataProperty());
static_cast<nsTArray<DisplayItemData*>*>(aFrame->Properties().Get(FrameLayerBuilder::LayerManagerDataProperty()));
MOZ_RELEASE_ASSERT(array, "Must be already stored on the frame!");
array->RemoveElement(this);
}
@ -1678,7 +1678,7 @@ FrameLayerBuilder::DisplayItemData*
FrameLayerBuilder::GetDisplayItemData(nsIFrame* aFrame, uint32_t aKey)
{
const nsTArray<DisplayItemData*>* array =
aFrame->Properties().Get(LayerManagerDataProperty());
static_cast<nsTArray<DisplayItemData*>*>(aFrame->Properties().Get(LayerManagerDataProperty()));
if (array) {
for (uint32_t i = 0; i < array->Length(); i++) {
DisplayItemData* item = AssertDisplayItemData(array->ElementAt(i));
@ -1907,7 +1907,7 @@ FrameLayerBuilder::GetDisplayItemDataForManager(nsDisplayItem* aItem,
LayerManager* aManager)
{
const nsTArray<DisplayItemData*>* array =
aItem->Frame()->Properties().Get(LayerManagerDataProperty());
static_cast<nsTArray<DisplayItemData*>*>(aItem->Frame()->Properties().Get(LayerManagerDataProperty()));
if (array) {
for (uint32_t i = 0; i < array->Length(); i++) {
DisplayItemData* item = AssertDisplayItemData(array->ElementAt(i));
@ -1924,7 +1924,7 @@ bool
FrameLayerBuilder::HasRetainedDataFor(nsIFrame* aFrame, uint32_t aDisplayItemKey)
{
const nsTArray<DisplayItemData*>* array =
aFrame->Properties().Get(LayerManagerDataProperty());
static_cast<nsTArray<DisplayItemData*>*>(aFrame->Properties().Get(LayerManagerDataProperty()));
if (array) {
for (uint32_t i = 0; i < array->Length(); i++) {
if (AssertDisplayItemData(array->ElementAt(i))->mDisplayItemKey == aDisplayItemKey) {
@ -1939,7 +1939,7 @@ void
FrameLayerBuilder::IterateRetainedDataFor(nsIFrame* aFrame, DisplayItemDataCallback aCallback)
{
const nsTArray<DisplayItemData*>* array =
aFrame->Properties().Get(LayerManagerDataProperty());
static_cast<nsTArray<DisplayItemData*>*>(aFrame->Properties().Get(LayerManagerDataProperty()));
if (!array) {
return;
}
@ -2006,7 +2006,7 @@ FrameLayerBuilder::ClearCachedGeometry(nsDisplayItem* aItem)
FrameLayerBuilder::GetDebugOldLayerFor(nsIFrame* aFrame, uint32_t aDisplayItemKey)
{
const nsTArray<DisplayItemData*>* array =
aFrame->Properties().Get(LayerManagerDataProperty());
static_cast<nsTArray<DisplayItemData*>*>(aFrame->Properties().Get(LayerManagerDataProperty()));
if (!array) {
return nullptr;
@ -2026,7 +2026,7 @@ FrameLayerBuilder::GetDebugOldLayerFor(nsIFrame* aFrame, uint32_t aDisplayItemKe
FrameLayerBuilder::GetDebugSingleOldPaintedLayerForFrame(nsIFrame* aFrame)
{
const nsTArray<DisplayItemData*>* array =
aFrame->Properties().Get(LayerManagerDataProperty());
static_cast<nsTArray<DisplayItemData*>*>(aFrame->Properties().Get(LayerManagerDataProperty()));
if (!array) {
return nullptr;
@ -5405,7 +5405,7 @@ FrameLayerBuilder::InvalidateAllLayers(LayerManager* aManager)
FrameLayerBuilder::InvalidateAllLayersForFrame(nsIFrame *aFrame)
{
const nsTArray<DisplayItemData*>* array =
aFrame->Properties().Get(LayerManagerDataProperty());
static_cast<nsTArray<DisplayItemData*>*>(aFrame->Properties().Get(LayerManagerDataProperty()));
if (array) {
for (uint32_t i = 0; i < array->Length(); i++) {
AssertDisplayItemData(array->ElementAt(i))->mParent->mInvalidateAllLayers = true;
@ -5422,7 +5422,7 @@ FrameLayerBuilder::GetDedicatedLayer(nsIFrame* aFrame, uint32_t aDisplayItemKey)
// in the secondary manager
const nsTArray<DisplayItemData*>* array =
aFrame->Properties().Get(LayerManagerDataProperty());
static_cast<nsTArray<DisplayItemData*>*>(aFrame->Properties().Get(LayerManagerDataProperty()));
if (array) {
for (uint32_t i = 0; i < array->Length(); i++) {
DisplayItemData *element = AssertDisplayItemData(array->ElementAt(i));
@ -5478,7 +5478,7 @@ FrameLayerBuilder::GetPaintedLayerScaleForFrame(nsIFrame* aFrame)
}
const nsTArray<DisplayItemData*>* array =
f->Properties().Get(LayerManagerDataProperty());
static_cast<nsTArray<DisplayItemData*>*>(f->Properties().Get(LayerManagerDataProperty()));
if (!array) {
continue;
}
@ -5916,7 +5916,7 @@ FrameLayerBuilder::GetMostRecentGeometry(nsDisplayItem* aItem)
// Retrieve the array of DisplayItemData associated with our frame.
FrameProperties properties = aItem->Frame()->Properties();
const DataArray* dataArray =
properties.Get(LayerManagerDataProperty());
static_cast<DataArray*>(properties.Get(LayerManagerDataProperty()));
if (!dataArray) {
return nullptr;
}

View File

@ -2268,16 +2268,16 @@ GetPrevContinuationWithPossiblySameStyle(nsIFrame* aFrame)
// previous ib-split sibling is an inline and the previous ib-split
// sibling of that is either another block-in-inline wrapper block box
// or null.
nsIFrame* prevContinuation = aFrame->GetPrevContinuation();
nsIFrame *prevContinuation = aFrame->GetPrevContinuation();
if (!prevContinuation &&
(aFrame->GetStateBits() & NS_FRAME_PART_OF_IBSPLIT)) {
// We're the first continuation, so we can just get the frame
// property directly
prevContinuation =
aFrame->Properties().Get(nsIFrame::IBSplitPrevSibling());
prevContinuation = static_cast<nsIFrame*>(
aFrame->Properties().Get(nsIFrame::IBSplitPrevSibling()));
if (prevContinuation) {
prevContinuation =
prevContinuation->Properties().Get(nsIFrame::IBSplitPrevSibling());
prevContinuation = static_cast<nsIFrame*>(
prevContinuation->Properties().Get(nsIFrame::IBSplitPrevSibling()));
}
}
@ -2335,11 +2335,11 @@ GetNextContinuationWithSameStyle(nsIFrame* aFrame,
(aFrame->GetStateBits() & NS_FRAME_PART_OF_IBSPLIT)) {
// We're the last continuation, so we have to hop back to the first
// before getting the frame property
nextContinuation = aFrame->FirstContinuation()->
Properties().Get(nsIFrame::IBSplitSibling());
nextContinuation = static_cast<nsIFrame*>(aFrame->FirstContinuation()->
Properties().Get(nsIFrame::IBSplitSibling()));
if (nextContinuation) {
nextContinuation =
nextContinuation->Properties().Get(nsIFrame::IBSplitSibling());
nextContinuation = static_cast<nsIFrame*>(
nextContinuation->Properties().Get(nsIFrame::IBSplitSibling()));
}
}
@ -2515,8 +2515,8 @@ RestyleManager::ReparentStyleContext(nsIFrame* aFrame)
// oldContext)" check will prevent us from redoing work.
if ((aFrame->GetStateBits() & NS_FRAME_PART_OF_IBSPLIT) &&
!aFrame->GetPrevContinuation()) {
nsIFrame* sib =
aFrame->Properties().Get(nsIFrame::IBSplitSibling());
nsIFrame* sib = static_cast<nsIFrame*>
(aFrame->Properties().Get(nsIFrame::IBSplitSibling()));
if (sib) {
ReparentStyleContext(sib);
}

View File

@ -134,7 +134,7 @@ public:
"InitialOverflowProperty must be set first.");
nsOverflowAreas* overflow =
frame->Properties().Get(nsIFrame::InitialOverflowProperty());
static_cast<nsOverflowAreas*>(frame->Properties().Get(nsIFrame::InitialOverflowProperty()));
if (overflow) {
// FinishAndStoreOverflow will change the overflow areas passed in,
// so make a copy.

View File

@ -290,14 +290,14 @@ protected:
nsIFrame* prevCont = aFrame->GetPrevContinuation();
if (!prevCont &&
(aFrame->GetStateBits() & NS_FRAME_PART_OF_IBSPLIT)) {
nsIFrame* block =
aFrame->Properties().Get(nsIFrame::IBSplitPrevSibling());
nsIFrame* block = static_cast<nsIFrame*>
(aFrame->Properties().Get(nsIFrame::IBSplitPrevSibling()));
if (block) {
// The {ib} properties are only stored on first continuations
NS_ASSERTION(!block->GetPrevContinuation(),
"Incorrect value for IBSplitPrevSibling");
prevCont =
block->Properties().Get(nsIFrame::IBSplitPrevSibling());
prevCont = static_cast<nsIFrame*>
(block->Properties().Get(nsIFrame::IBSplitPrevSibling()));
NS_ASSERTION(prevCont, "How did that happen?");
}
}
@ -311,9 +311,11 @@ protected:
(aFrame->GetStateBits() & NS_FRAME_PART_OF_IBSPLIT)) {
// The {ib} properties are only stored on first continuations
aFrame = aFrame->FirstContinuation();
nsIFrame* block = aFrame->Properties().Get(nsIFrame::IBSplitSibling());
nsIFrame* block = static_cast<nsIFrame*>
(aFrame->Properties().Get(nsIFrame::IBSplitSibling()));
if (block) {
nextCont = block->Properties().Get(nsIFrame::IBSplitSibling());
nextCont = static_cast<nsIFrame*>
(block->Properties().Get(nsIFrame::IBSplitSibling()));
NS_ASSERTION(nextCont, "How did that happen?");
}
}
@ -826,8 +828,8 @@ nsCSSRendering::PaintBorderWithStyleBorder(nsPresContext* aPresContext,
static nsRect
GetOutlineInnerRect(nsIFrame* aFrame)
{
nsRect* savedOutlineInnerRect =
aFrame->Properties().Get(nsIFrame::OutlineInnerRectProperty());
nsRect* savedOutlineInnerRect = static_cast<nsRect*>
(aFrame->Properties().Get(nsIFrame::OutlineInnerRectProperty()));
if (savedOutlineInnerRect)
return *savedOutlineInnerRect;
NS_NOTREACHED("we should have saved a frame property");

View File

@ -1005,7 +1005,8 @@ public:
static OutOfFlowDisplayData* GetOutOfFlowData(nsIFrame* aFrame)
{
return aFrame->Properties().Get(OutOfFlowDisplayDataProperty());
return static_cast<OutOfFlowDisplayData*>(
aFrame->Properties().Get(OutOfFlowDisplayDataProperty()));
}
nsPresContext* CurrentPresContext() {

View File

@ -4374,7 +4374,8 @@ nsLayoutUtils::GetNextContinuationOrIBSplitSibling(nsIFrame *aFrame)
// frame in the continuation chain. Walk back to find that frame now.
aFrame = aFrame->FirstContinuation();
return aFrame->Properties().Get(nsIFrame::IBSplitSibling());
void* value = aFrame->Properties().Get(nsIFrame::IBSplitSibling());
return static_cast<nsIFrame*>(value);
}
return nullptr;
@ -4386,8 +4387,8 @@ nsLayoutUtils::FirstContinuationOrIBSplitSibling(nsIFrame *aFrame)
nsIFrame *result = aFrame->FirstContinuation();
if (result->GetStateBits() & NS_FRAME_PART_OF_IBSPLIT) {
while (true) {
nsIFrame* f =
result->Properties().Get(nsIFrame::IBSplitPrevSibling());
nsIFrame *f = static_cast<nsIFrame*>
(result->Properties().Get(nsIFrame::IBSplitPrevSibling()));
if (!f)
break;
result = f;
@ -4403,8 +4404,8 @@ nsLayoutUtils::LastContinuationOrIBSplitSibling(nsIFrame *aFrame)
nsIFrame *result = aFrame->FirstContinuation();
if (result->GetStateBits() & NS_FRAME_PART_OF_IBSPLIT) {
while (true) {
nsIFrame* f =
result->Properties().Get(nsIFrame::IBSplitSibling());
nsIFrame *f = static_cast<nsIFrame*>
(result->Properties().Get(nsIFrame::IBSplitSibling()));
if (!f)
break;
result = f;

View File

@ -121,7 +121,7 @@ nsTextControlFrame::DestroyFrom(nsIFrame* aDestructRoot)
{
mScrollEvent.Revoke();
EditorInitializer* initializer = Properties().Get(TextControlInitializer());
EditorInitializer* initializer = (EditorInitializer*) Properties().Get(TextControlInitializer());
if (initializer) {
initializer->Revoke();
Properties().Delete(TextControlInitializer());
@ -388,7 +388,7 @@ nsTextControlFrame::CreateAnonymousContent(nsTArray<ContentInfo>& aElements)
if (initEagerly) {
NS_ASSERTION(!nsContentUtils::IsSafeToRunScript(),
"Someone forgot a script blocker?");
EditorInitializer* initializer = Properties().Get(TextControlInitializer());
EditorInitializer* initializer = (EditorInitializer*) Properties().Get(TextControlInitializer());
if (initializer) {
initializer->Revoke();
}

View File

@ -47,7 +47,8 @@ StickyScrollContainer::GetStickyScrollContainerForFrame(nsIFrame* aFrame)
}
FrameProperties props = static_cast<nsIFrame*>(do_QueryFrame(scrollFrame))->
Properties();
StickyScrollContainer* s = props.Get(StickyScrollContainerProperty());
StickyScrollContainer* s = static_cast<StickyScrollContainer*>
(props.Get(StickyScrollContainerProperty()));
if (!s) {
s = new StickyScrollContainer(scrollFrame);
props.Set(StickyScrollContainerProperty(), s);
@ -71,7 +72,8 @@ StickyScrollContainer::NotifyReparentedFrameAcrossScrollFrameBoundary(nsIFrame*
}
FrameProperties props = static_cast<nsIFrame*>(do_QueryFrame(oldScrollFrame))->
Properties();
StickyScrollContainer* oldSSC = props.Get(StickyScrollContainerProperty());
StickyScrollContainer* oldSSC = static_cast<StickyScrollContainer*>
(props.Get(StickyScrollContainerProperty()));
if (!oldSSC) {
// aOldParent had no sticky descendants, so aFrame doesn't have any sticky
// descendants, and we're done here.
@ -96,7 +98,8 @@ StickyScrollContainer*
StickyScrollContainer::GetStickyScrollContainerForScrollFrame(nsIFrame* aFrame)
{
FrameProperties props = aFrame->Properties();
return props.Get(StickyScrollContainerProperty());
return static_cast<StickyScrollContainer*>
(props.Get(StickyScrollContainerProperty()));
}
static nscoord
@ -142,7 +145,8 @@ StickyScrollContainer::ComputeStickyOffsets(nsIFrame* aFrame)
// Store the offset
FrameProperties props = aFrame->Properties();
nsMargin* offsets = props.Get(nsIFrame::ComputedOffsetProperty());
nsMargin* offsets = static_cast<nsMargin*>
(props.Get(nsIFrame::ComputedOffsetProperty()));
if (offsets) {
*offsets = computedOffsets;
} else {
@ -161,8 +165,8 @@ StickyScrollContainer::ComputeStickyLimits(nsIFrame* aFrame, nsRect* aStick,
aStick->SetRect(nscoord_MIN/2, nscoord_MIN/2, nscoord_MAX, nscoord_MAX);
aContain->SetRect(nscoord_MIN/2, nscoord_MIN/2, nscoord_MAX, nscoord_MAX);
const nsMargin* computedOffsets =
aFrame->Properties().Get(nsIFrame::ComputedOffsetProperty());
const nsMargin* computedOffsets = static_cast<nsMargin*>(
aFrame->Properties().Get(nsIFrame::ComputedOffsetProperty()));
if (!computedOffsets) {
// We haven't reflowed the scroll frame yet, so offsets haven't been
// computed. Bail.

View File

@ -5020,7 +5020,7 @@ nsBlockFrame::GetOutsideBulletList() const
}
NS_ASSERTION(!HasInsideBullet(), "invalid bullet state");
nsFrameList* list =
Properties().Get(OutsideBulletProperty());
static_cast<nsFrameList*>(Properties().Get(OutsideBulletProperty()));
NS_ASSERTION(list && list->GetLength() == 1 &&
list->FirstChild()->GetType() == nsGkAtoms::bulletFrame,
"bogus outside bullet list");
@ -5034,7 +5034,7 @@ nsBlockFrame::GetPushedFloats() const
return nullptr;
}
nsFrameList* result =
Properties().Get(PushedFloatProperty());
static_cast<nsFrameList*>(Properties().Get(PushedFloatProperty()));
NS_ASSERTION(result, "value should always be non-empty when state set");
return result;
}
@ -5059,7 +5059,8 @@ nsBlockFrame::RemovePushedFloats()
if (!HasPushedFloats()) {
return nullptr;
}
nsFrameList *result = Properties().Remove(PushedFloatProperty());
nsFrameList *result =
static_cast<nsFrameList*>(Properties().Remove(PushedFloatProperty()));
RemoveStateBits(NS_BLOCK_HAS_PUSHED_FLOATS);
NS_ASSERTION(result, "value should always be non-empty when state set");
return result;

View File

@ -299,8 +299,8 @@ nsDisplayCanvasBackgroundImage::Paint(nsDisplayListBuilder* aBuilder,
// to snap for this context, because we checked HasNonIntegerTranslation
// above.
destRect.Round();
RefPtr<DrawTarget> dt =
Frame()->Properties().Get(nsIFrame::CachedBackgroundImageDT());
RefPtr<DrawTarget> dt = static_cast<DrawTarget*>(
Frame()->Properties().Get(nsIFrame::CachedBackgroundImageDT()));
DrawTarget* destDT = dest->GetDrawTarget();
if (dt) {
BlitSurface(destDT, destRect, dt);

View File

@ -4269,7 +4269,8 @@ nsFlexContainerFrame::MoveFlexItemToFinalPosition(
LogicalMargin logicalOffsets(outerWM);
if (NS_STYLE_POSITION_RELATIVE == aItem.Frame()->StyleDisplay()->mPosition) {
FrameProperties props = aItem.Frame()->Properties();
nsMargin* cachedOffsets = props.Get(nsIFrame::ComputedOffsetProperty());
nsMargin* cachedOffsets =
static_cast<nsMargin*>(props.Get(nsIFrame::ComputedOffsetProperty()));
MOZ_ASSERT(cachedOffsets,
"relpos previously-reflowed frame should've cached its offsets");
logicalOffsets = LogicalMargin(outerWM, *cachedOffsets);

View File

@ -350,7 +350,8 @@ nsFloatManager::StoreRegionFor(WritingMode aWM, nsIFrame* aFloat,
props.Delete(FloatRegionProperty());
}
else {
nsMargin* storedMargin = props.Get(FloatRegionProperty());
nsMargin* storedMargin = static_cast<nsMargin*>
(props.Get(FloatRegionProperty()));
if (!storedMargin) {
storedMargin = new nsMargin();
props.Set(FloatRegionProperty(), storedMargin);

View File

@ -27,7 +27,8 @@ nsFontInflationData::FindFontInflationDataFor(const nsIFrame *aFrame)
NS_ASSERTION(bfc->GetStateBits() & NS_FRAME_FONT_INFLATION_FLOW_ROOT,
"should have found a flow root");
return bfc->Properties().Get(FontInflationDataProperty());
return static_cast<nsFontInflationData*>(
bfc->Properties().Get(FontInflationDataProperty()));
}
/* static */ bool
@ -37,7 +38,8 @@ nsFontInflationData::UpdateFontInflationDataISizeFor(const nsHTMLReflowState& aR
NS_ASSERTION(bfc->GetStateBits() & NS_FRAME_FONT_INFLATION_FLOW_ROOT,
"should have been given a flow root");
FrameProperties bfcProps(bfc->Properties());
nsFontInflationData *data = bfcProps.Get(FontInflationDataProperty());
nsFontInflationData *data = static_cast<nsFontInflationData*>(
bfcProps.Get(FontInflationDataProperty()));
bool oldInflationEnabled;
nscoord oldNCAISize;
if (data) {
@ -66,7 +68,8 @@ nsFontInflationData::MarkFontInflationDataTextDirty(nsIFrame *aBFCFrame)
"should have been given a flow root");
FrameProperties bfcProps(aBFCFrame->Properties());
nsFontInflationData *data = bfcProps.Get(FontInflationDataProperty());
nsFontInflationData *data = static_cast<nsFontInflationData*>(
bfcProps.Get(FontInflationDataProperty()));
if (data) {
data->MarkTextDirty();
}

View File

@ -177,7 +177,7 @@ InitBoxMetrics(nsIFrame* aFrame, bool aClear)
props.Delete(BoxMetricsProperty());
}
nsBoxLayoutMetrics* metrics = new nsBoxLayoutMetrics();
nsBoxLayoutMetrics *metrics = new nsBoxLayoutMetrics();
props.Set(BoxMetricsProperty(), metrics);
static_cast<nsFrame*>(aFrame)->nsFrame::MarkIntrinsicISizesDirty();
@ -664,7 +664,8 @@ nsFrame::DestroyFrom(nsIFrame* aDestructRoot)
// because that clears our Properties() table.)
if (mState & NS_FRAME_PART_OF_IBSPLIT) {
// Delete previous sibling's reference to me.
nsIFrame* prevSib = Properties().Get(nsIFrame::IBSplitPrevSibling());
nsIFrame* prevSib = static_cast<nsIFrame*>
(Properties().Get(nsIFrame::IBSplitPrevSibling()));
if (prevSib) {
NS_WARN_IF_FALSE(this ==
prevSib->Properties().Get(nsIFrame::IBSplitSibling()),
@ -673,7 +674,8 @@ nsFrame::DestroyFrom(nsIFrame* aDestructRoot)
}
// Delete next sibling's reference to me.
nsIFrame* nextSib = Properties().Get(nsIFrame::IBSplitSibling());
nsIFrame* nextSib = static_cast<nsIFrame*>
(Properties().Get(nsIFrame::IBSplitSibling()));
if (nextSib) {
NS_WARN_IF_FALSE(this ==
nextSib->Properties().Get(nsIFrame::IBSplitPrevSibling()),
@ -965,7 +967,8 @@ nsIFrame::GetUsedMargin() const
IsSVGText())
return margin;
nsMargin *m = Properties().Get(UsedMarginProperty());
nsMargin *m = static_cast<nsMargin*>
(Properties().Get(UsedMarginProperty()));
if (m) {
margin = *m;
} else {
@ -1004,7 +1007,8 @@ nsIFrame::GetUsedBorder() const
return border;
}
nsMargin *b = Properties().Get(UsedBorderProperty());
nsMargin *b = static_cast<nsMargin*>
(Properties().Get(UsedBorderProperty()));
if (b) {
border = *b;
} else {
@ -1041,7 +1045,8 @@ nsIFrame::GetUsedPadding() const
}
}
nsMargin *p = Properties().Get(UsedPaddingProperty());
nsMargin *p = static_cast<nsMargin*>
(Properties().Get(UsedPaddingProperty()));
if (p) {
padding = *p;
} else {
@ -5567,7 +5572,7 @@ nsIFrame::InvalidateFrameWithRect(const nsRect& aRect, uint32_t aDisplayItemKey)
return;
}
nsRect* rect = Properties().Get(InvalidationRect());
nsRect *rect = static_cast<nsRect*>(Properties().Get(InvalidationRect()));
if (!rect) {
if (alreadyInvalid) {
return;
@ -5674,7 +5679,7 @@ nsIFrame::IsInvalid(nsRect& aRect)
}
if (HasAnyStateBits(NS_FRAME_HAS_INVALID_RECT)) {
nsRect* rect = Properties().Get(InvalidationRect());
nsRect *rect = static_cast<nsRect*>(Properties().Get(InvalidationRect()));
NS_ASSERTION(rect, "Must have an invalid rect if NS_FRAME_HAS_INVALID_RECT is set!");
aRect = *rect;
} else {
@ -5686,8 +5691,8 @@ nsIFrame::IsInvalid(nsRect& aRect)
void
nsIFrame::SchedulePaint(PaintType aType)
{
nsIFrame* displayRoot = nsLayoutUtils::GetDisplayRootFrame(this);
nsPresContext* pres = displayRoot->PresContext()->GetRootPresContext();
nsIFrame *displayRoot = nsLayoutUtils::GetDisplayRootFrame(this);
nsPresContext *pres = displayRoot->PresContext()->GetRootPresContext();
// No need to schedule a paint for an external document since they aren't
// painted directly.
@ -5840,7 +5845,8 @@ nsIFrame::MovePositionBy(const nsPoint& aTranslation)
const nsMargin* computedOffsets = nullptr;
if (IsRelativelyPositioned()) {
computedOffsets = Properties().Get(nsIFrame::ComputedOffsetProperty());
computedOffsets = static_cast<nsMargin*>
(Properties().Get(nsIFrame::ComputedOffsetProperty()));
}
nsHTMLReflowState::ApplyRelativePositioning(this, computedOffsets ?
*computedOffsets : nsMargin(),
@ -5853,7 +5859,8 @@ nsIFrame::GetNormalRect() const
{
// It might be faster to first check
// StyleDisplay()->IsRelativelyPositionedStyle().
nsPoint* normalPosition = Properties().Get(NormalPositionProperty());
nsPoint* normalPosition = static_cast<nsPoint*>
(Properties().Get(NormalPositionProperty()));
if (normalPosition) {
return nsRect(*normalPosition, GetSize());
}
@ -5865,7 +5872,8 @@ nsIFrame::GetNormalPosition() const
{
// It might be faster to first check
// StyleDisplay()->IsRelativelyPositionedStyle().
nsPoint* normalPosition = Properties().Get(NormalPositionProperty());
nsPoint* normalPosition = static_cast<nsPoint*>
(Properties().Get(NormalPositionProperty()));
if (normalPosition) {
return *normalPosition;
}
@ -5923,8 +5931,8 @@ nsOverflowAreas
nsIFrame::GetOverflowAreasRelativeToSelf() const
{
if (IsTransformed()) {
nsOverflowAreas* preTransformOverflows =
Properties().Get(PreTransformOverflowAreasProperty());
nsOverflowAreas* preTransformOverflows = static_cast<nsOverflowAreas*>
(Properties().Get(PreTransformOverflowAreasProperty()));
if (preTransformOverflows) {
return nsOverflowAreas(preTransformOverflows->VisualOverflow(),
preTransformOverflows->ScrollableOverflow());
@ -5950,8 +5958,8 @@ nsRect
nsIFrame::GetScrollableOverflowRectRelativeToSelf() const
{
if (IsTransformed()) {
nsOverflowAreas* preTransformOverflows =
Properties().Get(PreTransformOverflowAreasProperty());
nsOverflowAreas* preTransformOverflows = static_cast<nsOverflowAreas*>
(Properties().Get(PreTransformOverflowAreasProperty()));
if (preTransformOverflows)
return preTransformOverflows->ScrollableOverflow();
}
@ -5962,8 +5970,8 @@ nsRect
nsIFrame::GetVisualOverflowRectRelativeToSelf() const
{
if (IsTransformed()) {
nsOverflowAreas* preTransformOverflows =
Properties().Get(PreTransformOverflowAreasProperty());
nsOverflowAreas* preTransformOverflows = static_cast<nsOverflowAreas*>
(Properties().Get(PreTransformOverflowAreasProperty()));
if (preTransformOverflows)
return preTransformOverflows->VisualOverflow();
}
@ -5973,7 +5981,8 @@ nsIFrame::GetVisualOverflowRectRelativeToSelf() const
nsRect
nsIFrame::GetPreEffectsVisualOverflowRect() const
{
nsRect* r = Properties().Get(nsIFrame::PreEffectsBBoxProperty());
nsRect* r = static_cast<nsRect*>
(Properties().Get(nsIFrame::PreEffectsBBoxProperty()));
return r ? *r : GetVisualOverflowRectRelativeToSelf();
}
@ -7739,7 +7748,8 @@ nsOverflowAreas*
nsIFrame::GetOverflowAreasProperty()
{
FrameProperties props = Properties();
nsOverflowAreas* overflow = props.Get(OverflowAreasProperty());
nsOverflowAreas *overflow =
static_cast<nsOverflowAreas*>(props.Get(OverflowAreasProperty()));
if (overflow) {
return overflow; // the property already exists
@ -7759,7 +7769,8 @@ bool
nsIFrame::SetOverflowAreas(const nsOverflowAreas& aOverflowAreas)
{
if (mOverflow.mType == NS_FRAME_OVERFLOW_LARGE) {
nsOverflowAreas* overflow = Properties().Get(OverflowAreasProperty());
nsOverflowAreas *overflow =
static_cast<nsOverflowAreas*>(Properties().Get(OverflowAreasProperty()));
bool changed = *overflow != aOverflowAreas;
*overflow = aOverflowAreas;
@ -8025,7 +8036,7 @@ nsIFrame::FinishAndStoreOverflow(nsOverflowAreas& aOverflowAreas,
if (!aOverflowAreas.VisualOverflow().IsEqualEdges(bounds) ||
!aOverflowAreas.ScrollableOverflow().IsEqualEdges(bounds)) {
nsOverflowAreas* initial =
Properties().Get(nsIFrame::InitialOverflowProperty());
static_cast<nsOverflowAreas*>(Properties().Get(nsIFrame::InitialOverflowProperty()));
if (!initial) {
Properties().Set(nsIFrame::InitialOverflowProperty(),
new nsOverflowAreas(aOverflowAreas));
@ -8194,7 +8205,7 @@ nsIFrame::RecomputePerspectiveChildrenOverflow(const nsIFrame* aStartFrame)
}
if (child->HasPerspective()) {
nsOverflowAreas* overflow =
child->Properties().Get(nsIFrame::InitialOverflowProperty());
static_cast<nsOverflowAreas*>(child->Properties().Get(nsIFrame::InitialOverflowProperty()));
nsRect bounds(nsPoint(0, 0), child->GetSize());
if (overflow) {
nsOverflowAreas overflowCopy = *overflow;
@ -8305,8 +8316,8 @@ GetIBSplitSiblingForAnonymousBlock(const nsIFrame* aFrame)
* Now look up the nsGkAtoms::IBSplitPrevSibling
* property.
*/
nsIFrame *ibSplitSibling =
aFrame->Properties().Get(nsIFrame::IBSplitPrevSibling());
nsIFrame *ibSplitSibling = static_cast<nsIFrame*>
(aFrame->Properties().Get(nsIFrame::IBSplitPrevSibling()));
NS_ASSERTION(ibSplitSibling, "Broken frame tree?");
return ibSplitSibling;
}
@ -9213,7 +9224,8 @@ nsFrame::BoxReflow(nsBoxLayoutState& aState,
nsBoxLayoutMetrics*
nsFrame::BoxMetrics() const
{
nsBoxLayoutMetrics* metrics = Properties().Get(BoxMetricsProperty());
nsBoxLayoutMetrics* metrics =
static_cast<nsBoxLayoutMetrics*>(Properties().Get(BoxMetricsProperty()));
NS_ASSERTION(metrics, "A box layout method was called but InitBoxMetrics was never called");
return metrics;
}

View File

@ -2542,7 +2542,8 @@ nsGridContainerFrame::GridItemCB(nsIFrame* aChild)
{
MOZ_ASSERT((aChild->GetStateBits() & NS_FRAME_OUT_OF_FLOW) &&
aChild->IsAbsolutelyPositioned());
nsRect* cb = aChild->Properties().Get(GridItemContainingBlockRect());
nsRect* cb = static_cast<nsRect*>(aChild->Properties().Get(
GridItemContainingBlockRect()));
MOZ_ASSERT(cb, "this method must only be called on grid items, and the grid "
"container should've reflowed this item by now and set up cb");
return *cb;
@ -5267,7 +5268,8 @@ nsGridContainerFrame::ReflowChildren(GridReflowState& aState,
LogicalRect itemCB =
aState.ContainingBlockForAbsPos(area, gridOrigin, gridCB);
// nsAbsoluteContainingBlock::Reflow uses physical coordinates.
nsRect* cb = child->Properties().Get(GridItemContainingBlockRect());
nsRect* cb = static_cast<nsRect*>(child->Properties().Get(
GridItemContainingBlockRect()));
if (!cb) {
cb = new nsRect;
child->Properties().Set(GridItemContainingBlockRect(), cb);
@ -5601,7 +5603,8 @@ nsGridContainerFrame::Reflow(nsPresContext* aPresContext,
}
if (!prevInFlow) {
SharedGridData* sharedGridData = Properties().Get(SharedGridData::Prop());
auto sharedGridData = static_cast<SharedGridData*>(
Properties().Get(SharedGridData::Prop()));
if (!NS_FRAME_IS_FULLY_COMPLETE(aStatus)) {
if (!sharedGridData) {
sharedGridData = new SharedGridData;

View File

@ -970,7 +970,8 @@ nsHTMLReflowState::ComputeRelativeOffsets(WritingMode aWM,
// Convert the offsets to physical coordinates and store them on the frame
aComputedOffsets = offsets.GetPhysicalMargin(aWM);
FrameProperties props = aFrame->Properties();
nsMargin* physicalOffsets = props.Get(nsIFrame::ComputedOffsetProperty());
nsMargin* physicalOffsets = static_cast<nsMargin*>
(props.Get(nsIFrame::ComputedOffsetProperty()));
if (physicalOffsets) {
*physicalOffsets = aComputedOffsets;
} else {
@ -995,7 +996,8 @@ nsHTMLReflowState::ApplyRelativePositioning(nsIFrame* aFrame,
// Store the normal position
FrameProperties props = aFrame->Properties();
nsPoint* normalPosition = props.Get(nsIFrame::NormalPositionProperty());
nsPoint* normalPosition = static_cast<nsPoint*>
(props.Get(nsIFrame::NormalPositionProperty()));
if (normalPosition) {
*normalPosition = *aPosition;
} else {

View File

@ -3286,7 +3286,9 @@ private:
DestroyPaintedPresShellList)
nsTArray<nsWeakPtr>* PaintedPresShellList() {
nsTArray<nsWeakPtr>* list = Properties().Get(PaintedPresShellsProperty());
nsTArray<nsWeakPtr>* list = static_cast<nsTArray<nsWeakPtr>*>(
Properties().Get(PaintedPresShellsProperty())
);
if (!list) {
list = new nsTArray<nsWeakPtr>();

View File

@ -2657,7 +2657,8 @@ nsTextFrame::EnsureTextRun(TextRunType aWhichTextRun,
static const gfxSkipChars emptySkipChars;
return gfxSkipCharsIterator(emptySkipChars, 0);
}
TabWidthStore* tabWidths = Properties().Get(TabWidthProperty());
TabWidthStore* tabWidths =
static_cast<TabWidthStore*>(Properties().Get(TabWidthProperty()));
if (tabWidths && tabWidths->mValidForContentOffset != GetContentOffset()) {
Properties().Delete(TabWidthProperty());
}
@ -3282,7 +3283,8 @@ PropertyProvider::CalcTabWidths(Range aRange)
return;
}
if (!mReflowing) {
mTabWidths = mFrame->Properties().Get(TabWidthProperty());
mTabWidths = static_cast<TabWidthStore*>
(mFrame->Properties().Get(TabWidthProperty()));
#ifdef DEBUG
// If we're not reflowing, we should have already computed the
// tab widths; check that they're available as far as the last
@ -6217,7 +6219,7 @@ nsTextFrame::DrawEmphasisMarks(gfxContext* aContext, WritingMode aWM,
const nscolor* aDecorationOverrideColor,
PropertyProvider* aProvider)
{
const EmphasisMarkInfo* info = Properties().Get(EmphasisMarkProperty());
const auto info = Properties().Get(EmphasisMarkProperty());
if (!info) {
return;
}

View File

@ -146,7 +146,7 @@ nsMathMLContainerFrame::GetReflowAndBoundingMetricsFor(nsIFrame* aFra
{
NS_PRECONDITION(aFrame, "null arg");
nsHTMLReflowMetrics* metrics =
nsHTMLReflowMetrics *metrics =
aFrame->Properties().Get(HTMLReflowMetricsProperty());
// IMPORTANT: This function is only meant to be called in Place() methods

View File

@ -3469,8 +3469,7 @@ SVGTextFrame::HandleAttributeChangeInDescendant(Element* aElement,
// Blow away our reference, if any
nsIFrame* childElementFrame = aElement->GetPrimaryFrame();
if (childElementFrame) {
childElementFrame->Properties().Delete(
nsSVGEffects::HrefAsTextPathProperty());
childElementFrame->Properties().Delete(nsSVGEffects::HrefProperty());
NotifyGlyphMetricsChange();
}
}
@ -4894,8 +4893,8 @@ SVGTextFrame::AdjustPositionsForClusters()
SVGPathElement*
SVGTextFrame::GetTextPathPathElement(nsIFrame* aTextPathFrame)
{
nsSVGTextPathProperty *property =
aTextPathFrame->Properties().Get(nsSVGEffects::HrefAsTextPathProperty());
nsSVGTextPathProperty *property = static_cast<nsSVGTextPathProperty*>
(aTextPathFrame->Properties().Get(nsSVGEffects::HrefProperty()));
if (!property) {
nsIContent* content = aTextPathFrame->GetContent();
@ -4911,10 +4910,8 @@ SVGTextFrame::GetTextPathPathElement(nsIFrame* aTextPathFrame)
nsContentUtils::NewURIWithDocumentCharset(getter_AddRefs(targetURI), href,
content->GetUncomposedDoc(), base);
property = nsSVGEffects::GetTextPathProperty(
targetURI,
aTextPathFrame,
nsSVGEffects::HrefAsTextPathProperty());
property = nsSVGEffects::GetTextPathProperty(targetURI, aTextPathFrame,
nsSVGEffects::HrefProperty());
if (!property)
return nullptr;
}

View File

@ -449,6 +449,37 @@ nsSVGPaintingProperty::DoUpdate()
}
}
static nsSVGRenderingObserver *
CreateMarkerProperty(nsIURI *aURI, nsIFrame *aFrame, bool aReferenceImage)
{ return new nsSVGMarkerProperty(aURI, aFrame, aReferenceImage); }
static nsSVGRenderingObserver *
CreateTextPathProperty(nsIURI *aURI, nsIFrame *aFrame, bool aReferenceImage)
{ return new nsSVGTextPathProperty(aURI, aFrame, aReferenceImage); }
static nsSVGRenderingObserver *
CreatePaintingProperty(nsIURI *aURI, nsIFrame *aFrame, bool aReferenceImage)
{ return new nsSVGPaintingProperty(aURI, aFrame, aReferenceImage); }
static nsSVGRenderingObserver *
GetEffectProperty(nsIURI *aURI, nsIFrame *aFrame,
nsSVGEffects::ObserverPropertyDescriptor aProperty,
nsSVGRenderingObserver * (* aCreate)(nsIURI *, nsIFrame *, bool))
{
if (!aURI)
return nullptr;
FrameProperties props = aFrame->Properties();
nsSVGRenderingObserver *prop =
static_cast<nsSVGRenderingObserver*>(props.Get(aProperty));
if (prop)
return prop;
prop = aCreate(aURI, aFrame, false);
NS_ADDREF(prop);
props.Set(aProperty, static_cast<nsISupports*>(prop));
return prop;
}
static nsSVGFilterProperty*
GetOrCreateFilterProperty(nsIFrame *aFrame)
{
@ -480,51 +511,37 @@ GetOrCreateMaskProperty(nsIFrame *aFrame)
return prop;
}
template<class T>
static T*
GetEffectProperty(nsIURI *aURI, nsIFrame *aFrame,
const mozilla::FramePropertyDescriptor<T>* aProperty)
nsSVGMarkerProperty *
nsSVGEffects::GetMarkerProperty(nsIURI *aURI, nsIFrame *aFrame,
ObserverPropertyDescriptor aProp)
{
MOZ_ASSERT(aFrame->GetType() == nsGkAtoms::svgPathGeometryFrame &&
static_cast<nsSVGPathGeometryElement*>(aFrame->GetContent())->IsMarkable(),
"Bad frame");
if (!aURI)
return nullptr;
FrameProperties props = aFrame->Properties();
T* prop = props.Get(aProperty);
if (prop)
return prop;
prop = new T(aURI, aFrame, false);
NS_ADDREF(prop);
props.Set(aProperty, prop);
return prop;
}
nsSVGMarkerProperty *
nsSVGEffects::GetMarkerProperty(nsIURI *aURI, nsIFrame *aFrame,
const mozilla::FramePropertyDescriptor<nsSVGMarkerProperty>* aProperty)
{
return GetEffectProperty(aURI, aFrame, aProperty);
"Bad frame");
return static_cast<nsSVGMarkerProperty*>(
GetEffectProperty(aURI, aFrame, aProp, CreateMarkerProperty));
}
nsSVGTextPathProperty *
nsSVGEffects::GetTextPathProperty(nsIURI *aURI, nsIFrame *aFrame,
const mozilla::FramePropertyDescriptor<nsSVGTextPathProperty>* aProperty)
ObserverPropertyDescriptor aProp)
{
return GetEffectProperty(aURI, aFrame, aProperty);
return static_cast<nsSVGTextPathProperty*>(
GetEffectProperty(aURI, aFrame, aProp, CreateTextPathProperty));
}
nsSVGPaintingProperty *
nsSVGEffects::GetPaintingProperty(nsIURI *aURI, nsIFrame *aFrame,
const mozilla::FramePropertyDescriptor<nsSVGPaintingProperty>* aProperty)
ObserverPropertyDescriptor aProp)
{
return GetEffectProperty(aURI, aFrame, aProperty);
return static_cast<nsSVGPaintingProperty*>(
GetEffectProperty(aURI, aFrame, aProp, CreatePaintingProperty));
}
nsSVGPaintingProperty *
nsSVGEffects::GetPaintingPropertyForURI(nsIURI *aURI, nsIFrame *aFrame,
URIObserverHashtablePropertyDescriptor aProperty)
static nsSVGRenderingObserver *
GetEffectPropertyForURI(nsIURI *aURI, nsIFrame *aFrame,
nsSVGEffects::URIObserverHashtablePropertyDescriptor aProperty,
nsSVGRenderingObserver * (* aCreate)(nsIURI *, nsIFrame *, bool))
{
if (!aURI)
return nullptr;
@ -535,16 +552,24 @@ nsSVGEffects::GetPaintingPropertyForURI(nsIURI *aURI, nsIFrame *aFrame,
hashtable = new nsSVGEffects::URIObserverHashtable();
props.Set(aProperty, hashtable);
}
nsSVGPaintingProperty* prop =
static_cast<nsSVGPaintingProperty*>(hashtable->GetWeak(aURI));
nsSVGRenderingObserver* prop =
static_cast<nsSVGRenderingObserver*>(hashtable->GetWeak(aURI));
if (!prop) {
bool watchImage = aProperty == nsSVGEffects::BackgroundImageProperty();
prop = new nsSVGPaintingProperty(aURI, aFrame, watchImage);
prop = aCreate(aURI, aFrame, watchImage);
hashtable->Put(aURI, prop);
}
return prop;
}
nsSVGPaintingProperty *
nsSVGEffects::GetPaintingPropertyForURI(nsIURI *aURI, nsIFrame *aFrame,
URIObserverHashtablePropertyDescriptor aProp)
{
return static_cast<nsSVGPaintingProperty*>(
GetEffectPropertyForURI(aURI, aFrame, aProp, CreatePaintingProperty));
}
nsSVGEffects::EffectProperties
nsSVGEffects::GetEffectProperties(nsIFrame *aFrame)
{
@ -571,7 +596,7 @@ nsSVGEffects::GetEffectProperties(nsIFrame *aFrame)
nsSVGPaintServerFrame *
nsSVGEffects::GetPaintServer(nsIFrame *aTargetFrame, const nsStyleSVGPaint *aPaint,
PaintingPropertyDescriptor aType)
ObserverPropertyDescriptor aType)
{
if (aPaint->mType != eStyleSVGPaintType_Server)
return nullptr;
@ -679,9 +704,12 @@ nsSVGEffects::UpdateEffects(nsIFrame *aFrame)
static_cast<nsSVGPathGeometryElement*>(aFrame->GetContent())->IsMarkable()) {
// Set marker properties here to avoid reference loops
const nsStyleSVG *style = aFrame->StyleSVG();
GetMarkerProperty(style->mMarkerStart, aFrame, MarkerBeginProperty());
GetMarkerProperty(style->mMarkerMid, aFrame, MarkerMiddleProperty());
GetMarkerProperty(style->mMarkerEnd, aFrame, MarkerEndProperty());
GetEffectProperty(style->mMarkerStart, aFrame, MarkerBeginProperty(),
CreateMarkerProperty);
GetEffectProperty(style->mMarkerMid, aFrame, MarkerMiddleProperty(),
CreateMarkerProperty);
GetEffectProperty(style->mMarkerEnd, aFrame, MarkerEndProperty(),
CreateMarkerProperty);
}
}
@ -693,7 +721,8 @@ nsSVGEffects::GetFilterProperty(nsIFrame *aFrame)
if (!aFrame->StyleEffects()->HasFilters())
return nullptr;
return aFrame->Properties().Get(FilterProperty());
return static_cast<nsSVGFilterProperty *>
(aFrame->Properties().Get(FilterProperty()));
}
void

View File

@ -420,8 +420,8 @@ public:
typedef nsInterfaceHashtable<nsURIHashKey, nsIMutationObserver>
URIObserverHashtable;
using PaintingPropertyDescriptor =
const mozilla::FramePropertyDescriptor<nsSVGPaintingProperty>*;
using ObserverPropertyDescriptor =
const mozilla::FramePropertyDescriptor<nsISupports>*;
using URIObserverHashtablePropertyDescriptor =
const mozilla::FramePropertyDescriptor<URIObserverHashtable>*;
@ -438,16 +438,13 @@ public:
NS_DECLARE_FRAME_PROPERTY_WITH_DTOR(FilterProperty, nsSVGFilterProperty,
DestroyFilterProperty)
NS_DECLARE_FRAME_PROPERTY_RELEASABLE(MaskProperty, nsSVGMaskProperty)
NS_DECLARE_FRAME_PROPERTY_RELEASABLE(ClipPathProperty, nsSVGPaintingProperty)
NS_DECLARE_FRAME_PROPERTY_RELEASABLE(MarkerBeginProperty, nsSVGMarkerProperty)
NS_DECLARE_FRAME_PROPERTY_RELEASABLE(MarkerMiddleProperty, nsSVGMarkerProperty)
NS_DECLARE_FRAME_PROPERTY_RELEASABLE(MarkerEndProperty, nsSVGMarkerProperty)
NS_DECLARE_FRAME_PROPERTY_RELEASABLE(FillProperty, nsSVGPaintingProperty)
NS_DECLARE_FRAME_PROPERTY_RELEASABLE(StrokeProperty, nsSVGPaintingProperty)
NS_DECLARE_FRAME_PROPERTY_RELEASABLE(HrefAsTextPathProperty,
nsSVGTextPathProperty)
NS_DECLARE_FRAME_PROPERTY_RELEASABLE(HrefAsPaintingProperty,
nsSVGPaintingProperty)
NS_DECLARE_FRAME_PROPERTY_RELEASABLE(ClipPathProperty, nsISupports)
NS_DECLARE_FRAME_PROPERTY_RELEASABLE(MarkerBeginProperty, nsISupports)
NS_DECLARE_FRAME_PROPERTY_RELEASABLE(MarkerMiddleProperty, nsISupports)
NS_DECLARE_FRAME_PROPERTY_RELEASABLE(MarkerEndProperty, nsISupports)
NS_DECLARE_FRAME_PROPERTY_RELEASABLE(FillProperty, nsISupports)
NS_DECLARE_FRAME_PROPERTY_RELEASABLE(StrokeProperty, nsISupports)
NS_DECLARE_FRAME_PROPERTY_RELEASABLE(HrefProperty, nsISupports)
NS_DECLARE_FRAME_PROPERTY_DELETABLE(BackgroundImageProperty,
URIObserverHashtable)
@ -456,7 +453,7 @@ public:
*/
static nsSVGPaintServerFrame *GetPaintServer(nsIFrame *aTargetFrame,
const nsStyleSVGPaint *aPaint,
PaintingPropertyDescriptor aProperty);
ObserverPropertyDescriptor aProperty);
struct EffectProperties {
nsSVGFilterProperty* mFilter;
@ -564,19 +561,19 @@ public:
*/
static nsSVGMarkerProperty *
GetMarkerProperty(nsIURI *aURI, nsIFrame *aFrame,
const mozilla::FramePropertyDescriptor<nsSVGMarkerProperty>* aProperty);
ObserverPropertyDescriptor aProperty);
/**
* Get an nsSVGTextPathProperty for the frame, creating a fresh one if necessary
*/
static nsSVGTextPathProperty *
GetTextPathProperty(nsIURI *aURI, nsIFrame *aFrame,
const mozilla::FramePropertyDescriptor<nsSVGTextPathProperty>* aProperty);
ObserverPropertyDescriptor aProperty);
/**
* Get an nsSVGPaintingProperty for the frame, creating a fresh one if necessary
*/
static nsSVGPaintingProperty *
GetPaintingProperty(nsIURI *aURI, nsIFrame *aFrame,
const mozilla::FramePropertyDescriptor<nsSVGPaintingProperty>* aProperty);
ObserverPropertyDescriptor aProperty);
/**
* Get an nsSVGPaintingProperty for the frame for that URI, creating a fresh
* one if necessary

View File

@ -106,8 +106,8 @@ nsSVGFilterFrame::GetReferencedFilter()
if (mNoHRefURI)
return nullptr;
nsSVGPaintingProperty *property =
Properties().Get(nsSVGEffects::HrefAsPaintingProperty());
nsSVGPaintingProperty *property = static_cast<nsSVGPaintingProperty*>
(Properties().Get(nsSVGEffects::HrefProperty()));
if (!property) {
// Fetch our Filter element's xlink:href attribute
@ -126,8 +126,7 @@ nsSVGFilterFrame::GetReferencedFilter()
mContent->GetUncomposedDoc(), base);
property =
nsSVGEffects::GetPaintingProperty(targetURI, this,
nsSVGEffects::HrefAsPaintingProperty());
nsSVGEffects::GetPaintingProperty(targetURI, this, nsSVGEffects::HrefProperty());
if (!property)
return nullptr;
}
@ -175,7 +174,7 @@ nsSVGFilterFrame::AttributeChanged(int32_t aNameSpaceID,
} else if (aNameSpaceID == kNameSpaceID_XLink &&
aAttribute == nsGkAtoms::href) {
// Blow away our reference, if any
Properties().Delete(nsSVGEffects::HrefAsPaintingProperty());
Properties().Delete(nsSVGEffects::HrefProperty());
mNoHRefURI = false;
// And update whoever references us
nsSVGEffects::InvalidateDirectRenderingObservers(this);

View File

@ -71,7 +71,7 @@ nsSVGGradientFrame::AttributeChanged(int32_t aNameSpaceID,
} else if (aNameSpaceID == kNameSpaceID_XLink &&
aAttribute == nsGkAtoms::href) {
// Blow away our reference, if any
Properties().Delete(nsSVGEffects::HrefAsPaintingProperty());
Properties().Delete(nsSVGEffects::HrefProperty());
mNoHRefURI = false;
// And update whoever references us
nsSVGEffects::InvalidateDirectRenderingObservers(this);
@ -314,8 +314,8 @@ nsSVGGradientFrame::GetReferencedGradient()
if (mNoHRefURI)
return nullptr;
nsSVGPaintingProperty *property =
Properties().Get(nsSVGEffects::HrefAsPaintingProperty());
nsSVGPaintingProperty *property = static_cast<nsSVGPaintingProperty*>
(Properties().Get(nsSVGEffects::HrefProperty()));
if (!property) {
// Fetch our gradient element's xlink:href attribute
@ -334,8 +334,7 @@ nsSVGGradientFrame::GetReferencedGradient()
mContent->GetUncomposedDoc(), base);
property =
nsSVGEffects::GetPaintingProperty(targetURI, this,
nsSVGEffects::HrefAsPaintingProperty());
nsSVGEffects::GetPaintingProperty(targetURI, this, nsSVGEffects::HrefProperty());
if (!property)
return nullptr;
}

View File

@ -74,7 +74,8 @@ public:
private:
static nsRect GetPreEffectsVisualOverflowRect(nsIFrame* aFrame) {
nsRect* r = aFrame->Properties().Get(nsIFrame::PreEffectsBBoxProperty());
nsRect* r = static_cast<nsRect*>
(aFrame->Properties().Get(nsIFrame::PreEffectsBBoxProperty()));
if (r) {
return *r;
}

View File

@ -88,7 +88,7 @@ nsSVGPatternFrame::AttributeChanged(int32_t aNameSpaceID,
if (aNameSpaceID == kNameSpaceID_XLink &&
aAttribute == nsGkAtoms::href) {
// Blow away our reference, if any
Properties().Delete(nsSVGEffects::HrefAsPaintingProperty());
Properties().Delete(nsSVGEffects::HrefProperty());
mNoHRefURI = false;
// And update whoever references us
nsSVGEffects::InvalidateDirectRenderingObservers(this);
@ -546,8 +546,8 @@ nsSVGPatternFrame::GetReferencedPattern()
if (mNoHRefURI)
return nullptr;
nsSVGPaintingProperty *property =
Properties().Get(nsSVGEffects::HrefAsPaintingProperty());
nsSVGPaintingProperty *property = static_cast<nsSVGPaintingProperty*>
(Properties().Get(nsSVGEffects::HrefProperty()));
if (!property) {
// Fetch our pattern element's xlink:href attribute
@ -566,8 +566,7 @@ nsSVGPatternFrame::GetReferencedPattern()
mContent->GetUncomposedDoc(), base);
property =
nsSVGEffects::GetPaintingProperty(targetURI, this,
nsSVGEffects::HrefAsPaintingProperty());
nsSVGEffects::GetPaintingProperty(targetURI, this, nsSVGEffects::HrefProperty());
if (!property)
return nullptr;
}

View File

@ -965,7 +965,8 @@ nsSVGUtils::GetBBox(nsIFrame *aFrame, uint32_t aFlags)
FrameProperties props = aFrame->Properties();
if (aFlags == eBBoxIncludeFillGeometry) {
gfxRect* prop = props.Get(ObjectBoundingBoxProperty());
gfxRect* prop =
static_cast<gfxRect*>(props.Get(ObjectBoundingBoxProperty()));
if (prop) {
return *prop;
}
@ -1315,7 +1316,7 @@ SetupInheritablePaint(const DrawTarget* aDrawTarget,
gfxTextContextPaint* aOuterContextPaint,
SVGTextContextPaint::Paint& aTargetPaint,
nsStyleSVGPaint nsStyleSVG::*aFillOrStroke,
nsSVGEffects::PaintingPropertyDescriptor aProperty)
nsSVGEffects::ObserverPropertyDescriptor aProperty)
{
const nsStyleSVG *style = aFrame->StyleSVG();
nsSVGPaintServerFrame *ps =

View File

@ -243,6 +243,8 @@ nsTableFrame::PageBreakAfter(nsIFrame* aSourceFrame,
return false;
}
typedef nsTArray<nsIFrame*> FrameTArray;
/* static */ void
nsTableFrame::RegisterPositionedTablePart(nsIFrame* aFrame)
{
@ -269,7 +271,8 @@ nsTableFrame::RegisterPositionedTablePart(nsIFrame* aFrame)
// Retrieve the positioned parts array for this table.
FrameProperties props = tableFrame->Properties();
FrameTArray* positionedParts = props.Get(PositionedTablePartArray());
auto positionedParts =
static_cast<FrameTArray*>(props.Get(PositionedTablePartArray()));
// Lazily create the array if it doesn't exist yet.
if (!positionedParts) {
@ -299,7 +302,8 @@ nsTableFrame::UnregisterPositionedTablePart(nsIFrame* aFrame,
// Retrieve the positioned parts array for this table.
FrameProperties props = tableFrame->Properties();
FrameTArray* positionedParts = props.Get(PositionedTablePartArray());
auto positionedParts =
static_cast<FrameTArray*>(props.Get(PositionedTablePartArray()));
// Remove the frame.
MOZ_ASSERT(positionedParts && positionedParts->Contains(aFrame),
@ -1988,7 +1992,8 @@ nsTableFrame::FixupPositionedTableParts(nsPresContext* aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsHTMLReflowState& aReflowState)
{
FrameTArray* positionedParts = Properties().Get(PositionedTablePartArray());
auto positionedParts =
static_cast<FrameTArray*>(Properties().Get(PositionedTablePartArray()));
if (!positionedParts) {
return;
}

View File

@ -137,8 +137,8 @@ public:
NS_DECL_QUERYFRAME_TARGET(nsTableFrame)
NS_DECL_FRAMEARENA_HELPERS
typedef nsTArray<nsIFrame*> FrameTArray;
NS_DECLARE_FRAME_PROPERTY_DELETABLE(PositionedTablePartArray, FrameTArray)
NS_DECLARE_FRAME_PROPERTY_DELETABLE(PositionedTablePartArray,
nsTArray<nsIFrame*>)
/** nsTableWrapperFrame has intimate knowledge of the inner table frame */
friend class nsTableWrapperFrame;

View File

@ -973,8 +973,8 @@ nsTableRowFrame::ReflowChildren(nsPresContext* aPresContext,
// We didn't reflow. Do the positioning part of what
// MovePositionBy does internally. (This codepath should really
// be merged into the else below if we can.)
nsMargin* computedOffsetProp =
kidFrame->Properties().Get(nsIFrame::ComputedOffsetProperty());
nsMargin* computedOffsetProp = static_cast<nsMargin*>
(kidFrame->Properties().Get(nsIFrame::ComputedOffsetProperty()));
// Bug 975644: a position:sticky kid can end up with a null
// property value here.
LogicalMargin computedOffsets(wm, computedOffsetProp ?