Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1083)

Unified Diff: sky/engine/core/dom/Attr.h

Issue 697773002: Remove Element#attributes. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: fix template binding. Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/engine/core/core.gni ('k') | sky/engine/core/dom/Attr.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/dom/Attr.h
diff --git a/sky/engine/core/dom/Attr.h b/sky/engine/core/dom/Attr.h
index bae961dd2bb03c6bc12487ae18286bf01880f704..222655b555a55070bc5e52144d7fb21d962344fe 100644
--- a/sky/engine/core/dom/Attr.h
+++ b/sky/engine/core/dom/Attr.h
@@ -25,48 +25,29 @@
#ifndef Attr_h
#define Attr_h
-#include "core/dom/Node.h"
+#include "bindings/core/v8/ScriptWrappable.h"
#include "core/dom/QualifiedName.h"
+#include "wtf/RefCounted.h"
+#include "wtf/text/AtomicString.h"
namespace blink {
-class Attr final : public Node {
+class Attr : public RefCounted<Attr>, public ScriptWrappable {
DEFINE_WRAPPERTYPEINFO();
public:
- static PassRefPtr<Attr> create(Element&, const QualifiedName&);
- virtual ~Attr();
+ static PassRefPtr<Attr> create(const QualifiedName& name, const AtomicString& value);
+ ~Attr();
String name() const { return m_name.localName(); }
- Element* ownerElement() const { return m_element; }
-
- const AtomicString& value() const;
- void setValue(const AtomicString&);
-
- void detachFromElement();
-
- // FIXME(sky): Remove this.
- virtual const AtomicString& localName() const override { return m_name.localName(); }
-
- virtual void trace(Visitor*) override;
+ const AtomicString& value() const { return m_value; }
private:
- Attr(Element&, const QualifiedName&);
-
- bool isElementNode() const = delete; // This will catch anyone doing an unnecessary check.
+ Attr(const QualifiedName& name, const AtomicString& value);
- virtual String nodeName() const override { return name(); }
- virtual NodeType nodeType() const override { return ATTRIBUTE_NODE; }
-
- virtual PassRefPtr<Node> cloneNode(bool deep = true) override { return nullptr; }
-
- virtual bool isAttributeNode() const override { return true; }
-
- RawPtr<Element> m_element;
QualifiedName m_name;
+ AtomicString m_value;
};
-DEFINE_NODE_TYPE_CASTS(Attr, isAttributeNode());
-
} // namespace blink
#endif // Attr_h
« no previous file with comments | « sky/engine/core/core.gni ('k') | sky/engine/core/dom/Attr.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698