import changes from win7-7/UXP:

bug1347737, bug1365982, bug1367206
This commit is contained in:
Roy Tam 2019-06-29 06:38:51 +08:00
commit 0f035317a3
96 changed files with 1525 additions and 1329 deletions

View file

@ -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();

View file

@ -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()) {

View file

@ -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"

View file

@ -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);

View file

@ -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

View file

@ -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();
}

View file

@ -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

View file

@ -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;