summaryrefslogtreecommitdiff
path: root/Source/WebCore/dom/Attribute.h
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
commit1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch)
tree46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/WebCore/dom/Attribute.h
parent32761a6cee1d0dee366b885b7b9c777e67885688 (diff)
downloadWebKitGtk-tarball-master.tar.gz
Diffstat (limited to 'Source/WebCore/dom/Attribute.h')
-rw-r--r--Source/WebCore/dom/Attribute.h21
1 files changed, 13 insertions, 8 deletions
diff --git a/Source/WebCore/dom/Attribute.h b/Source/WebCore/dom/Attribute.h
index 61c9ec5a8..72dbed69e 100644
--- a/Source/WebCore/dom/Attribute.h
+++ b/Source/WebCore/dom/Attribute.h
@@ -3,7 +3,7 @@
* (C) 1999 Antti Koivisto (koivisto@kde.org)
* (C) 2001 Peter Kelly (pmk@post.com)
* (C) 2001 Dirk Mueller (mueller@kde.org)
- * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2012 Apple Inc. All rights reserved.
+ * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2012, 2014 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -22,8 +22,7 @@
*
*/
-#ifndef Attribute_h
-#define Attribute_h
+#pragma once
#include "QualifiedName.h"
@@ -44,13 +43,16 @@ public:
// as the Attribute stays in place. For example, calling a function that mutates
// an Element's internal attribute storage may invalidate them.
const AtomicString& value() const { return m_value; }
+ static ptrdiff_t valueMemoryOffset() { return OBJECT_OFFSETOF(Attribute, m_value); }
const AtomicString& prefix() const { return m_name.prefix(); }
const AtomicString& localName() const { return m_name.localName(); }
const AtomicString& namespaceURI() const { return m_name.namespaceURI(); }
const QualifiedName& name() const { return m_name; }
+ static ptrdiff_t nameMemoryOffset() { return OBJECT_OFFSETOF(Attribute, m_name); }
bool isEmpty() const { return m_value.isEmpty(); }
+ static bool nameMatchesFilter(const QualifiedName&, const AtomicString& filterPrefix, const AtomicString& filterLocalName, const AtomicString& filterNamespaceURI);
bool matches(const AtomicString& prefix, const AtomicString& localName, const AtomicString& namespaceURI) const;
void setValue(const AtomicString& value) { m_value = value; }
@@ -72,13 +74,16 @@ private:
AtomicString m_value;
};
-inline bool Attribute::matches(const AtomicString& prefix, const AtomicString& localName, const AtomicString& namespaceURI) const
+inline bool Attribute::nameMatchesFilter(const QualifiedName& name, const AtomicString& filterPrefix, const AtomicString& filterLocalName, const AtomicString& filterNamespaceURI)
{
- if (localName != this->localName())
+ if (filterLocalName != name.localName())
return false;
- return prefix == starAtom || namespaceURI == this->namespaceURI();
+ return filterPrefix == starAtom || filterNamespaceURI == name.namespaceURI();
}
-} // namespace WebCore
+inline bool Attribute::matches(const AtomicString& prefix, const AtomicString& localName, const AtomicString& namespaceURI) const
+{
+ return nameMatchesFilter(m_name, prefix, localName, namespaceURI);
+}
-#endif // Attribute_h
+} // namespace WebCore