OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2001 Peter Kelly (pmk@post.com) | 4 * (C) 2001 Peter Kelly (pmk@post.com) |
5 * (C) 2001 Dirk Mueller (mueller@kde.org) | 5 * (C) 2001 Dirk Mueller (mueller@kde.org) |
6 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2012 Apple Inc. All rights reserv
ed. | 6 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2012 Apple Inc. All rights reserv
ed. |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 11 matching lines...) Expand all Loading... |
22 * | 22 * |
23 */ | 23 */ |
24 | 24 |
25 #ifndef Attribute_h | 25 #ifndef Attribute_h |
26 #define Attribute_h | 26 #define Attribute_h |
27 | 27 |
28 #include "core/dom/QualifiedName.h" | 28 #include "core/dom/QualifiedName.h" |
29 | 29 |
30 namespace blink { | 30 namespace blink { |
31 | 31 |
32 // This has no counterpart in DOM. | 32 // This is the internal representation of an attribute, consisting of a name and |
33 // It is an internal representation of the node value of an Attr. | 33 // value. It is distinct from the web-exposed Attr, which also knows of the |
34 // The actual Attr with its value as a Text child is allocated only if needed. | 34 // element to which it attached, if any. |
35 class Attribute { | 35 class Attribute { |
36 public: | 36 public: |
37 Attribute(const QualifiedName& name, const AtomicString& value) | 37 Attribute(const QualifiedName& name, const AtomicString& value) |
38 : m_name(name) | 38 : m_name(name) |
39 , m_value(value) | 39 , m_value(value) |
40 { | 40 { |
41 } | 41 } |
42 | 42 |
43 // NOTE: The references returned by these functions are only valid for as lo
ng | 43 // NOTE: The references returned by these functions are only valid for as lo
ng |
44 // as the Attribute stays in place. For example, calling a function that mut
ates | 44 // as the Attribute stays in place. For example, calling a function that mut
ates |
(...skipping 29 matching lines...) Expand all Loading... |
74 inline bool Attribute::matches(const QualifiedName& qualifiedName) const | 74 inline bool Attribute::matches(const QualifiedName& qualifiedName) const |
75 { | 75 { |
76 if (qualifiedName.localName() != localName()) | 76 if (qualifiedName.localName() != localName()) |
77 return false; | 77 return false; |
78 return qualifiedName.prefix() == starAtom || qualifiedName.namespaceURI() ==
namespaceURI(); | 78 return qualifiedName.prefix() == starAtom || qualifiedName.namespaceURI() ==
namespaceURI(); |
79 } | 79 } |
80 | 80 |
81 } // namespace blink | 81 } // namespace blink |
82 | 82 |
83 #endif // Attribute_h | 83 #endif // Attribute_h |
OLD | NEW |