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

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

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/dom/Attr.h ('k') | sky/engine/core/dom/Attr.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/dom/Attr.cpp
diff --git a/sky/engine/core/dom/Attr.cpp b/sky/engine/core/dom/Attr.cpp
index 4fb879608ed7864e8dac5b32d6d29f9d6bba070f..ac1d0d0eee6b266b5f6e994f48a4770ed11a1779 100644
--- a/sky/engine/core/dom/Attr.cpp
+++ b/sky/engine/core/dom/Attr.cpp
@@ -23,29 +23,18 @@
#include "config.h"
#include "core/dom/Attr.h"
-#include "bindings/core/v8/ExceptionState.h"
-#include "bindings/core/v8/ExceptionStatePlaceholder.h"
-#include "core/dom/Document.h"
-#include "core/dom/Element.h"
-#include "core/dom/Text.h"
-#include "core/events/ScopedEventQueue.h"
-#include "core/frame/UseCounter.h"
-#include "wtf/text/AtomicString.h"
-#include "wtf/text/StringBuilder.h"
-
namespace blink {
-Attr::Attr(Element& element, const QualifiedName& name)
- : Node(&element.document(), Node::CreateOther)
- , m_element(&element)
- , m_name(name)
+Attr::Attr(const QualifiedName& name, const AtomicString& value)
+ : m_name(name)
+ , m_value(value)
{
ScriptWrappable::init(this);
}
-PassRefPtr<Attr> Attr::create(Element& element, const QualifiedName& name)
+PassRefPtr<Attr> Attr::create(const QualifiedName& name, const AtomicString& value)
{
- RefPtr<Attr> attr = adoptRef(new Attr(element, name));
+ RefPtr<Attr> attr = adoptRef(new Attr(name, value));
return attr.release();
}
@@ -53,29 +42,4 @@ Attr::~Attr()
{
}
-void Attr::setValue(const AtomicString& value)
-{
- if (!m_element)
- return;
- m_element->setAttribute(m_name, value);
-}
-
-const AtomicString& Attr::value() const
-{
- if (m_element)
- return m_element->getAttribute(m_name);
- return nullAtom;
-}
-
-void Attr::detachFromElement()
-{
- m_element = nullptr;
-}
-
-void Attr::trace(Visitor* visitor)
-{
- visitor->trace(m_element);
- Node::trace(visitor);
-}
-
}
« no previous file with comments | « sky/engine/core/dom/Attr.h ('k') | sky/engine/core/dom/Attr.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698