summaryrefslogtreecommitdiff
path: root/layout/svg
diff options
context:
space:
mode:
authorwin7-7 <win7-7@users.noreply.github.com>2019-06-26 01:51:45 +0300
committerwin7-7 <win7-7@users.noreply.github.com>2019-06-26 01:51:45 +0300
commit00812e30dfa70f9b1a752cf0d09de00f6d401c85 (patch)
treee7eec9b55dd4e5825d3196f196c7f981be56e17a /layout/svg
parentd7359c38b197c221c43def1e24cb48d4aee51bba (diff)
downloaduxp-00812e30dfa70f9b1a752cf0d09de00f6d401c85.tar.gz
Attach FrameProperties to each frame instead of using a shared hashtable
Dispense the shared hashtable and instead attach the frame property list directly to nsIFrame.
Diffstat (limited to 'layout/svg')
-rw-r--r--layout/svg/SVGTextFrame.cpp10
-rw-r--r--layout/svg/nsSVGEffects.cpp47
-rw-r--r--layout/svg/nsSVGEffects.h2
-rw-r--r--layout/svg/nsSVGFilterFrame.cpp4
-rw-r--r--layout/svg/nsSVGGradientFrame.cpp4
-rw-r--r--layout/svg/nsSVGIntegrationUtils.cpp5
-rw-r--r--layout/svg/nsSVGPatternFrame.cpp4
-rw-r--r--layout/svg/nsSVGUtils.cpp5
8 files changed, 38 insertions, 43 deletions
diff --git a/layout/svg/SVGTextFrame.cpp b/layout/svg/SVGTextFrame.cpp
index e5a03333f9..6ba267ee89 100644
--- a/layout/svg/SVGTextFrame.cpp
+++ b/layout/svg/SVGTextFrame.cpp
@@ -1328,7 +1328,7 @@ NS_DECLARE_FRAME_PROPERTY_DELETABLE(TextNodeCorrespondenceProperty,
static uint32_t
GetUndisplayedCharactersBeforeFrame(nsTextFrame* aFrame)
{
- void* value = aFrame->Properties().Get(TextNodeCorrespondenceProperty());
+ void* value = aFrame->GetProperty(TextNodeCorrespondenceProperty());
TextNodeCorrespondence* correspondence =
static_cast<TextNodeCorrespondence*>(value);
if (!correspondence) {
@@ -1517,8 +1517,8 @@ TextNodeCorrespondenceRecorder::TraverseAndRecord(nsIFrame* aFrame)
}
// Set the frame property.
- frame->Properties().Set(TextNodeCorrespondenceProperty(),
- new TextNodeCorrespondence(undisplayed));
+ frame->SetProperty(TextNodeCorrespondenceProperty(),
+ new TextNodeCorrespondence(undisplayed));
// Remember how far into the current nsTextNode we are.
mNodeCharIndex = frame->GetContentEnd();
@@ -3391,7 +3391,7 @@ SVGTextFrame::HandleAttributeChangeInDescendant(Element* aElement,
// Blow away our reference, if any
nsIFrame* childElementFrame = aElement->GetPrimaryFrame();
if (childElementFrame) {
- childElementFrame->Properties().Delete(
+ childElementFrame->DeleteProperty(
nsSVGEffects::HrefAsTextPathProperty());
NotifyGlyphMetricsChange();
}
@@ -4817,7 +4817,7 @@ SVGPathElement*
SVGTextFrame::GetTextPathPathElement(nsIFrame* aTextPathFrame)
{
nsSVGTextPathProperty *property =
- aTextPathFrame->Properties().Get(nsSVGEffects::HrefAsTextPathProperty());
+ aTextPathFrame->GetProperty(nsSVGEffects::HrefAsTextPathProperty());
if (!property) {
nsIContent* content = aTextPathFrame->GetContent();
diff --git a/layout/svg/nsSVGEffects.cpp b/layout/svg/nsSVGEffects.cpp
index e75c973c8f..ca4c5778ce 100644
--- a/layout/svg/nsSVGEffects.cpp
+++ b/layout/svg/nsSVGEffects.cpp
@@ -480,27 +480,26 @@ GetOrCreateFilterProperty(nsIFrame* aFrame)
if (!effects->HasFilters())
return nullptr;
- FrameProperties props = aFrame->Properties();
- nsSVGFilterProperty *prop = props.Get(nsSVGEffects::FilterProperty());
+ nsSVGFilterProperty *prop =
+ aFrame->GetProperty(nsSVGEffects::FilterProperty());
if (prop)
return prop;
prop = new nsSVGFilterProperty(effects->mFilters, aFrame);
NS_ADDREF(prop);
- props.Set(nsSVGEffects::FilterProperty(), prop);
+ aFrame->SetProperty(nsSVGEffects::FilterProperty(), prop);
return prop;
}
static nsSVGMaskProperty*
GetOrCreateMaskProperty(nsIFrame* aFrame)
{
- FrameProperties props = aFrame->Properties();
- nsSVGMaskProperty *prop = props.Get(nsSVGEffects::MaskProperty());
+ nsSVGMaskProperty *prop = aFrame->GetProperty(nsSVGEffects::MaskProperty());
if (prop)
return prop;
prop = new nsSVGMaskProperty(aFrame);
NS_ADDREF(prop);
- props.Set(nsSVGEffects::MaskProperty(), prop);
+ aFrame->SetProperty(nsSVGEffects::MaskProperty(), prop);
return prop;
}
@@ -512,13 +511,12 @@ GetEffectProperty(nsIURI* aURI, nsIFrame* aFrame,
if (!aURI)
return nullptr;
- FrameProperties props = aFrame->Properties();
- T* prop = props.Get(aProperty);
+ T* prop = aFrame->GetProperty(aProperty);
if (prop)
return prop;
prop = new T(aURI, aFrame, false);
NS_ADDREF(prop);
- props.Set(aProperty, prop);
+ aFrame->SetProperty(aProperty, prop);
return prop;
}
@@ -553,11 +551,11 @@ nsSVGEffects::GetPaintingPropertyForURI(nsIURI* aURI, nsIFrame* aFrame,
if (!aURI)
return nullptr;
- FrameProperties props = aFrame->Properties();
- nsSVGEffects::URIObserverHashtable *hashtable = props.Get(aProperty);
+ nsSVGEffects::URIObserverHashtable *hashtable =
+ aFrame->GetProperty(aProperty);
if (!hashtable) {
hashtable = new nsSVGEffects::URIObserverHashtable();
- props.Set(aProperty, hashtable);
+ aFrame->SetProperty(aProperty, hashtable);
}
nsSVGPaintingProperty* prop =
static_cast<nsSVGPaintingProperty*>(hashtable->GetWeak(aURI));
@@ -689,16 +687,15 @@ nsSVGEffects::UpdateEffects(nsIFrame* aFrame)
NS_ASSERTION(aFrame->GetContent()->IsElement(),
"aFrame's content should be an element");
- FrameProperties props = aFrame->Properties();
- props.Delete(FilterProperty());
- props.Delete(MaskProperty());
- props.Delete(ClipPathProperty());
- props.Delete(MarkerBeginProperty());
- props.Delete(MarkerMiddleProperty());
- props.Delete(MarkerEndProperty());
- props.Delete(FillProperty());
- props.Delete(StrokeProperty());
- props.Delete(BackgroundImageProperty());
+ aFrame->DeleteProperty(FilterProperty());
+ aFrame->DeleteProperty(MaskProperty());
+ aFrame->DeleteProperty(ClipPathProperty());
+ aFrame->DeleteProperty(MarkerBeginProperty());
+ aFrame->DeleteProperty(MarkerMiddleProperty());
+ aFrame->DeleteProperty(MarkerEndProperty());
+ aFrame->DeleteProperty(FillProperty());
+ aFrame->DeleteProperty(StrokeProperty());
+ aFrame->DeleteProperty(BackgroundImageProperty());
// Ensure that the filter is repainted correctly
// We can't do that in DoUpdate as the referenced frame may not be valid
@@ -725,7 +722,7 @@ nsSVGEffects::GetFilterProperty(nsIFrame* aFrame)
if (!aFrame->StyleEffects()->HasFilters())
return nullptr;
- return aFrame->Properties().Get(FilterProperty());
+ return aFrame->GetProperty(FilterProperty());
}
void
@@ -835,7 +832,7 @@ nsSVGEffects::InvalidateRenderingObservers(nsIFrame* aFrame)
return;
// If the rendering has changed, the bounds may well have changed too:
- aFrame->Properties().Delete(nsSVGUtils::ObjectBoundingBoxProperty());
+ aFrame->DeleteProperty(nsSVGUtils::ObjectBoundingBoxProperty());
nsSVGRenderingObserverList *observerList =
GetObserverList(content->AsElement());
@@ -864,7 +861,7 @@ nsSVGEffects::InvalidateDirectRenderingObservers(Element* aElement, uint32_t aFl
nsIFrame* frame = aElement->GetPrimaryFrame();
if (frame) {
// If the rendering has changed, the bounds may well have changed too:
- frame->Properties().Delete(nsSVGUtils::ObjectBoundingBoxProperty());
+ frame->DeleteProperty(nsSVGUtils::ObjectBoundingBoxProperty());
}
if (aElement->HasRenderingObservers()) {
diff --git a/layout/svg/nsSVGEffects.h b/layout/svg/nsSVGEffects.h
index 0cf9b15000..b8b2e53c13 100644
--- a/layout/svg/nsSVGEffects.h
+++ b/layout/svg/nsSVGEffects.h
@@ -7,7 +7,7 @@
#define NSSVGEFFECTS_H_
#include "mozilla/Attributes.h"
-#include "FramePropertyTable.h"
+#include "FrameProperties.h"
#include "mozilla/dom/Element.h"
#include "nsHashKeys.h"
#include "nsID.h"
diff --git a/layout/svg/nsSVGFilterFrame.cpp b/layout/svg/nsSVGFilterFrame.cpp
index 13ce16993d..3b99f413e4 100644
--- a/layout/svg/nsSVGFilterFrame.cpp
+++ b/layout/svg/nsSVGFilterFrame.cpp
@@ -107,7 +107,7 @@ nsSVGFilterFrame::GetReferencedFilter()
return nullptr;
nsSVGPaintingProperty *property =
- Properties().Get(nsSVGEffects::HrefAsPaintingProperty());
+ GetProperty(nsSVGEffects::HrefAsPaintingProperty());
if (!property) {
// Fetch our Filter element's href or xlink:href attribute
@@ -183,7 +183,7 @@ nsSVGFilterFrame::AttributeChanged(int32_t aNameSpaceID,
aNameSpaceID == kNameSpaceID_None) &&
aAttribute == nsGkAtoms::href) {
// Blow away our reference, if any
- Properties().Delete(nsSVGEffects::HrefAsPaintingProperty());
+ DeleteProperty(nsSVGEffects::HrefAsPaintingProperty());
mNoHRefURI = false;
// And update whoever references us
nsSVGEffects::InvalidateDirectRenderingObservers(this);
diff --git a/layout/svg/nsSVGGradientFrame.cpp b/layout/svg/nsSVGGradientFrame.cpp
index 2d7684f5a0..340cfa881d 100644
--- a/layout/svg/nsSVGGradientFrame.cpp
+++ b/layout/svg/nsSVGGradientFrame.cpp
@@ -72,7 +72,7 @@ nsSVGGradientFrame::AttributeChanged(int32_t aNameSpaceID,
aNameSpaceID == kNameSpaceID_None) &&
aAttribute == nsGkAtoms::href) {
// Blow away our reference, if any
- Properties().Delete(nsSVGEffects::HrefAsPaintingProperty());
+ DeleteProperty(nsSVGEffects::HrefAsPaintingProperty());
mNoHRefURI = false;
// And update whoever references us
nsSVGEffects::InvalidateDirectRenderingObservers(this);
@@ -316,7 +316,7 @@ nsSVGGradientFrame::GetReferencedGradient()
return nullptr;
nsSVGPaintingProperty *property =
- Properties().Get(nsSVGEffects::HrefAsPaintingProperty());
+ GetProperty(nsSVGEffects::HrefAsPaintingProperty());
if (!property) {
// Fetch our gradient element's href or xlink:href attribute
diff --git a/layout/svg/nsSVGIntegrationUtils.cpp b/layout/svg/nsSVGIntegrationUtils.cpp
index 0003e1a73e..4ce2941d49 100644
--- a/layout/svg/nsSVGIntegrationUtils.cpp
+++ b/layout/svg/nsSVGIntegrationUtils.cpp
@@ -75,7 +75,7 @@ public:
private:
static nsRect GetPreEffectsVisualOverflowRect(nsIFrame* aFrame) {
- nsRect* r = aFrame->Properties().Get(nsIFrame::PreEffectsBBoxProperty());
+ nsRect* r = aFrame->GetProperty(nsIFrame::PreEffectsBBoxProperty());
if (r) {
return *r;
}
@@ -113,8 +113,7 @@ private:
NS_ASSERTION(aFrame->GetParent()->StyleContext()->GetPseudo() ==
nsCSSAnonBoxes::mozAnonymousBlock,
"How did we getting here, then?");
- NS_ASSERTION(!aFrame->Properties().Get(
- aFrame->PreTransformOverflowAreasProperty()),
+ NS_ASSERTION(!aFrame->GetProperty(aFrame->PreTransformOverflowAreasProperty()),
"GetVisualOverflowRect() won't return the pre-effects rect!");
return aFrame->GetVisualOverflowRect();
}
diff --git a/layout/svg/nsSVGPatternFrame.cpp b/layout/svg/nsSVGPatternFrame.cpp
index 198163d7f5..2cd7eeaadf 100644
--- a/layout/svg/nsSVGPatternFrame.cpp
+++ b/layout/svg/nsSVGPatternFrame.cpp
@@ -89,7 +89,7 @@ nsSVGPatternFrame::AttributeChanged(int32_t aNameSpaceID,
aNameSpaceID == kNameSpaceID_None) &&
aAttribute == nsGkAtoms::href) {
// Blow away our reference, if any
- Properties().Delete(nsSVGEffects::HrefAsPaintingProperty());
+ DeleteProperty(nsSVGEffects::HrefAsPaintingProperty());
mNoHRefURI = false;
// And update whoever references us
nsSVGEffects::InvalidateDirectRenderingObservers(this);
@@ -548,7 +548,7 @@ nsSVGPatternFrame::GetReferencedPattern()
return nullptr;
nsSVGPaintingProperty *property =
- Properties().Get(nsSVGEffects::HrefAsPaintingProperty());
+ GetProperty(nsSVGEffects::HrefAsPaintingProperty());
if (!property) {
// Fetch our pattern element's href or xlink:href attribute
diff --git a/layout/svg/nsSVGUtils.cpp b/layout/svg/nsSVGUtils.cpp
index 98e5f9b5fe..c3394e292a 100644
--- a/layout/svg/nsSVGUtils.cpp
+++ b/layout/svg/nsSVGUtils.cpp
@@ -1060,10 +1060,9 @@ nsSVGUtils::GetBBox(nsIFrame *aFrame, uint32_t aFlags)
return bbox;
}
- FrameProperties props = aFrame->Properties();
if (aFlags == eBBoxIncludeFillGeometry) {
- gfxRect* prop = props.Get(ObjectBoundingBoxProperty());
+ gfxRect* prop = aFrame->GetProperty(ObjectBoundingBoxProperty());
if (prop) {
return *prop;
}
@@ -1139,7 +1138,7 @@ nsSVGUtils::GetBBox(nsIFrame *aFrame, uint32_t aFlags)
if (aFlags == eBBoxIncludeFillGeometry) {
// Obtaining the bbox for objectBoundingBox calculations is common so we
// cache the result for future calls, since calculation can be expensive:
- props.Set(ObjectBoundingBoxProperty(), new gfxRect(bbox));
+ aFrame->SetProperty(ObjectBoundingBoxProperty(), new gfxRect(bbox));
}
return bbox;