mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 03:45:46 +00:00
Bug 1613349 - Rename nsINode::UnsetProperty to nsINode::TakeProperty. r=smaug
For consistency with the previous change for layout. Depends on D61755 Differential Revision: https://phabricator.services.mozilla.com/D61756 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
bba367ec8f
commit
86ca3370c2
@ -219,9 +219,8 @@ void nsINode::DeleteProperty(const nsAtom* aPropertyName) {
|
||||
OwnerDoc()->PropertyTable().DeleteProperty(this, aPropertyName);
|
||||
}
|
||||
|
||||
void* nsINode::UnsetProperty(const nsAtom* aPropertyName, nsresult* aStatus) {
|
||||
return OwnerDoc()->PropertyTable().UnsetProperty(this, aPropertyName,
|
||||
aStatus);
|
||||
void* nsINode::TakeProperty(const nsAtom* aPropertyName, nsresult* aStatus) {
|
||||
return OwnerDoc()->PropertyTable().TakeProperty(this, aPropertyName, aStatus);
|
||||
}
|
||||
|
||||
nsIContentSecurityPolicy* nsINode::GetCsp() const {
|
||||
|
@ -872,9 +872,9 @@ class nsINode : public mozilla::dom::EventTarget {
|
||||
void DeleteProperty(const nsAtom* aPropertyName);
|
||||
|
||||
/**
|
||||
* Unset a property associated with this node. The value will not be
|
||||
* destroyed but rather returned. It is the caller's responsibility to
|
||||
* destroy the value after that point.
|
||||
* Take a property associated with this node. The value will not be destroyed
|
||||
* but rather returned. It is the caller's responsibility to destroy the value
|
||||
* after that point.
|
||||
*
|
||||
* @param aPropertyName name of property to unset.
|
||||
* @param aStatus out parameter for storing resulting status.
|
||||
@ -884,7 +884,7 @@ class nsINode : public mozilla::dom::EventTarget {
|
||||
* (though a null return value does not imply the
|
||||
* property was not set, i.e. it can be set to null).
|
||||
*/
|
||||
void* UnsetProperty(const nsAtom* aPropertyName, nsresult* aStatus = nullptr);
|
||||
void* TakeProperty(const nsAtom* aPropertyName, nsresult* aStatus = nullptr);
|
||||
|
||||
bool HasProperties() const { return HasFlag(NODE_HAS_PROPERTIES); }
|
||||
|
||||
|
@ -89,11 +89,11 @@ class nsPropertyTable {
|
||||
nsresult DeleteProperty(nsPropertyOwner aObject, const nsAtom* aPropertyName);
|
||||
|
||||
/**
|
||||
* Unset the property |aPropertyName| in the global category for object
|
||||
* Remove the property |aPropertyName| in the global category for object
|
||||
* |aObject|, but do not call the property's destructor function. The
|
||||
* property value is returned.
|
||||
*/
|
||||
void* UnsetProperty(const nsPropertyOwner& aObject,
|
||||
void* TakeProperty(const nsPropertyOwner& aObject,
|
||||
const nsAtom* aPropertyName,
|
||||
nsresult* aStatus = nullptr) {
|
||||
return GetPropertyInternal(aObject, aPropertyName, true, aStatus);
|
||||
|
@ -580,7 +580,7 @@ const SVGPreserveAspectRatio* SVGSVGElement::GetPreserveAspectRatioProperty()
|
||||
}
|
||||
|
||||
bool SVGSVGElement::ClearPreserveAspectRatioProperty() {
|
||||
void* valPtr = UnsetProperty(nsGkAtoms::overridePreserveAspectRatio);
|
||||
void* valPtr = TakeProperty(nsGkAtoms::overridePreserveAspectRatio);
|
||||
bool didHaveProperty = !!valPtr;
|
||||
delete static_cast<SVGPreserveAspectRatio*>(valPtr);
|
||||
return didHaveProperty;
|
||||
|
@ -3207,7 +3207,7 @@ void nsCSSFrameConstructor::ConstructTextFrame(
|
||||
if (newFrame->IsGeneratedContentFrame()) {
|
||||
UniquePtr<nsGenConInitializer> initializer(
|
||||
static_cast<nsGenConInitializer*>(
|
||||
aContent->UnsetProperty(nsGkAtoms::genConInitializerProperty)));
|
||||
aContent->TakeProperty(nsGkAtoms::genConInitializerProperty)));
|
||||
if (initializer) {
|
||||
if (initializer->mNode.release()->InitTextFrame(
|
||||
initializer->mList,
|
||||
|
@ -253,8 +253,8 @@ void ActiveLayerTracker::TransferActivityToContent(nsIFrame* aFrame,
|
||||
/* static */
|
||||
void ActiveLayerTracker::TransferActivityToFrame(nsIContent* aContent,
|
||||
nsIFrame* aFrame) {
|
||||
LayerActivity* layerActivity = static_cast<LayerActivity*>(
|
||||
aContent->UnsetProperty(nsGkAtoms::LayerActivity));
|
||||
auto* layerActivity = static_cast<LayerActivity*>(
|
||||
aContent->TakeProperty(nsGkAtoms::LayerActivity));
|
||||
if (!layerActivity) {
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user