Bug 1331322 - Stop using a node bit for HasExplicitBaseURI. r=bz
This is only called during URI resolution, and the proptable bit should make
this relatively fast.
--- a/dom/base/nsINode.cpp
+++ b/dom/base/nsINode.cpp
@@ -1524,17 +1524,16 @@ ReleaseURI(void*, /* aObject*/
NS_RELEASE(uri);
}
nsresult
nsINode::SetExplicitBaseURI(nsIURI* aURI)
{
nsresult rv = SetProperty(nsGkAtoms::baseURIProperty, aURI, ReleaseURI);
if (NS_SUCCEEDED(rv)) {
- SetHasExplicitBaseURI();
NS_ADDREF(aURI);
}
return rv;
}
static nsresult
AdoptNodeIntoOwnerDoc(nsINode *aParent, nsINode *aNode)
{
--- a/dom/base/nsINode.h
+++ b/dom/base/nsINode.h
@@ -1298,20 +1298,21 @@ public:
virtual bool IsHTMLShadowElement() const { return false; }
// Elements named <content> may or may not be HTMLContentElement. This is a
// way to ask an element whether it's an HTMLContentElement.
virtual bool IsHTMLContentElement() const { return false; }
protected:
nsIURI* GetExplicitBaseURI() const {
- if (HasExplicitBaseURI()) {
- return static_cast<nsIURI*>(GetProperty(nsGkAtoms::baseURIProperty));
+ if (!HasProperties()) {
+ return nullptr;
}
- return nullptr;
+
+ return static_cast<nsIURI*>(GetProperty(nsGkAtoms::baseURIProperty));
}
public:
void GetTextContent(nsAString& aTextContent,
mozilla::OOMReporter& aError)
{
GetTextContentInternal(aTextContent, aError);
}
@@ -1509,18 +1510,16 @@ private:
NodeIsDescendantOfCommonAncestorForRangeInSelection,
// Set if CanSkipInCC check has been done for this subtree root.
NodeIsCCMarkedRoot,
// Maybe set if this node is in black subtree.
NodeIsCCBlackTree,
// Maybe set if the node is a root of a subtree
// which needs to be kept in the purple buffer.
NodeIsPurpleRoot,
- // Set if the node has an explicit base URI stored
- NodeHasExplicitBaseURI,
// Set if the element has some style states locked
ElementHasLockedStyleStates,
// Set if element has pointer locked
ElementHasPointerLock,
// Set if the node may have DOMMutationObserver attached to it.
NodeMayHaveDOMMutationObserver,
// Set if node is Content
NodeIsContent,
@@ -1716,18 +1715,16 @@ protected:
void SetIsElement() { SetBoolFlag(NodeIsElement); }
void SetHasID() { SetBoolFlag(ElementHasID); }
void ClearHasID() { ClearBoolFlag(ElementHasID); }
void SetMayHaveStyle() { SetBoolFlag(ElementMayHaveStyle); }
void SetHasName() { SetBoolFlag(ElementHasName); }
void ClearHasName() { ClearBoolFlag(ElementHasName); }
void SetMayHaveContentEditableAttr()
{ SetBoolFlag(ElementMayHaveContentEditableAttr); }
- bool HasExplicitBaseURI() const { return GetBoolFlag(NodeHasExplicitBaseURI); }
- void SetHasExplicitBaseURI() { SetBoolFlag(NodeHasExplicitBaseURI); }
void SetHasLockedStyleStates() { SetBoolFlag(ElementHasLockedStyleStates); }
void ClearHasLockedStyleStates() { ClearBoolFlag(ElementHasLockedStyleStates); }
bool HasLockedStyleStates() const
{ return GetBoolFlag(ElementHasLockedStyleStates); }
void SetHasWeirdParserInsertionMode() { SetBoolFlag(ElementHasWeirdParserInsertionMode); }
bool HasWeirdParserInsertionMode() const
{ return GetBoolFlag(ElementHasWeirdParserInsertionMode); }
bool HandlingClick() const { return GetBoolFlag(NodeHandlingClick); }