summaryrefslogtreecommitdiffstats
path: root/dom/xbl
diff options
context:
space:
mode:
Diffstat (limited to 'dom/xbl')
-rw-r--r--dom/xbl/XBLChildrenElement.cpp39
-rw-r--r--dom/xbl/XBLChildrenElement.h12
2 files changed, 19 insertions, 32 deletions
diff --git a/dom/xbl/XBLChildrenElement.cpp b/dom/xbl/XBLChildrenElement.cpp
index e4058a789..f785a3058 100644
--- a/dom/xbl/XBLChildrenElement.cpp
+++ b/dom/xbl/XBLChildrenElement.cpp
@@ -7,6 +7,7 @@
#include "mozilla/dom/XBLChildrenElement.h"
#include "nsCharSeparatedTokenizer.h"
#include "mozilla/dom/NodeListBinding.h"
+#include "nsAttrValueOrString.h"
namespace mozilla {
namespace dom {
@@ -27,34 +28,24 @@ NS_INTERFACE_MAP_END_INHERITING(Element)
NS_IMPL_ELEMENT_CLONE(XBLChildrenElement)
nsresult
-XBLChildrenElement::UnsetAttr(int32_t aNameSpaceID, nsIAtom* aAttribute,
- bool aNotify)
+XBLChildrenElement::BeforeSetAttr(int32_t aNamespaceID, nsIAtom* aName,
+ const nsAttrValueOrString* aValue,
+ bool aNotify)
{
- if (aAttribute == nsGkAtoms::includes &&
- aNameSpaceID == kNameSpaceID_None) {
- mIncludes.Clear();
- }
-
- return Element::UnsetAttr(aNameSpaceID, aAttribute, aNotify);
-}
-
-bool
-XBLChildrenElement::ParseAttribute(int32_t aNamespaceID,
- nsIAtom* aAttribute,
- const nsAString& aValue,
- nsAttrValue& aResult)
-{
- if (aAttribute == nsGkAtoms::includes &&
- aNamespaceID == kNameSpaceID_None) {
- mIncludes.Clear();
- nsCharSeparatedTokenizer tok(aValue, '|',
- nsCharSeparatedTokenizer::SEPARATOR_OPTIONAL);
- while (tok.hasMoreTokens()) {
- mIncludes.AppendElement(NS_Atomize(tok.nextToken()));
+ if (aNamespaceID == kNameSpaceID_None) {
+ if (aName == nsGkAtoms::includes) {
+ mIncludes.Clear();
+ if (aValue) {
+ nsCharSeparatedTokenizer tok(aValue->String(), '|',
+ nsCharSeparatedTokenizer::SEPARATOR_OPTIONAL);
+ while (tok.hasMoreTokens()) {
+ mIncludes.AppendElement(NS_Atomize(tok.nextToken()));
+ }
+ }
}
}
- return false;
+ return nsXMLElement::BeforeSetAttr(aNamespaceID, aName, aValue, aNotify);
}
} // namespace dom
diff --git a/dom/xbl/XBLChildrenElement.h b/dom/xbl/XBLChildrenElement.h
index 4714da4a8..c01085474 100644
--- a/dom/xbl/XBLChildrenElement.h
+++ b/dom/xbl/XBLChildrenElement.h
@@ -37,14 +37,6 @@ public:
virtual nsIDOMNode* AsDOMNode() override { return this; }
- // nsIContent interface methods
- virtual nsresult UnsetAttr(int32_t aNameSpaceID, nsIAtom* aAttribute,
- bool aNotify) override;
- virtual bool ParseAttribute(int32_t aNamespaceID,
- nsIAtom* aAttribute,
- const nsAString& aValue,
- nsAttrValue& aResult) override;
-
void AppendInsertedChild(nsIContent* aChild)
{
mInsertedChildren.AppendElement(aChild);
@@ -147,6 +139,10 @@ public:
protected:
~XBLChildrenElement();
+ virtual nsresult BeforeSetAttr(int32_t aNamespaceID, nsIAtom* aName,
+ const nsAttrValueOrString* aValue,
+ bool aNotify) override;
+
private:
nsTArray<nsIContent*> mInsertedChildren; // WEAK
nsTArray<nsCOMPtr<nsIAtom> > mIncludes;