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

Side by Side Diff: Source/core/dom/Attribute.h

Issue 688333002: Remove the Element.prefix setter (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 6 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 const AtomicString& prefix() const { return m_name.prefix(); } 47 const AtomicString& prefix() const { return m_name.prefix(); }
48 const AtomicString& localName() const { return m_name.localName(); } 48 const AtomicString& localName() const { return m_name.localName(); }
49 const AtomicString& namespaceURI() const { return m_name.namespaceURI(); } 49 const AtomicString& namespaceURI() const { return m_name.namespaceURI(); }
50 50
51 const QualifiedName& name() const { return m_name; } 51 const QualifiedName& name() const { return m_name; }
52 52
53 bool isEmpty() const { return m_value.isEmpty(); } 53 bool isEmpty() const { return m_value.isEmpty(); }
54 bool matches(const QualifiedName&) const; 54 bool matches(const QualifiedName&) const;
55 55
56 void setValue(const AtomicString& value) { m_value = value; } 56 void setValue(const AtomicString& value) { m_value = value; }
57 void setPrefix(const AtomicString& prefix) { m_name.setPrefix(prefix); }
58 57
59 // Note: This API is only for HTMLTreeBuilder. It is not safe to change the 58 // Note: This API is only for HTMLTreeBuilder. It is not safe to change the
60 // name of an attribute once parseAttribute has been called as DOM 59 // name of an attribute once parseAttribute has been called as DOM
61 // elements may have placed the Attribute in a hash by name. 60 // elements may have placed the Attribute in a hash by name.
62 void parserSetName(const QualifiedName& name) { m_name = name; } 61 void parserSetName(const QualifiedName& name) { m_name = name; }
63 62
64 #if COMPILER(MSVC) 63 #if COMPILER(MSVC)
65 // NOTE: This constructor is not actually implemented, it's just defined so MSVC 64 // NOTE: This constructor is not actually implemented, it's just defined so MSVC
66 // will let us use a zero-length array of Attributes. 65 // will let us use a zero-length array of Attributes.
67 Attribute(); 66 Attribute();
68 #endif 67 #endif
69 68
70 private: 69 private:
71 QualifiedName m_name; 70 QualifiedName m_name;
72 AtomicString m_value; 71 AtomicString m_value;
73 }; 72 };
74 73
75 inline bool Attribute::matches(const QualifiedName& qualifiedName) const 74 inline bool Attribute::matches(const QualifiedName& qualifiedName) const
76 { 75 {
77 if (qualifiedName.localName() != localName()) 76 if (qualifiedName.localName() != localName())
78 return false; 77 return false;
79 return qualifiedName.prefix() == starAtom || qualifiedName.namespaceURI() == namespaceURI(); 78 return qualifiedName.prefix() == starAtom || qualifiedName.namespaceURI() == namespaceURI();
80 } 79 }
81 80
82 } // namespace blink 81 } // namespace blink
83 82
84 #endif // Attribute_h 83 #endif // Attribute_h
OLDNEW
« no previous file with comments | « LayoutTests/fast/dom/script-tests/node-prefix-setter-namespace-exception.js ('k') | Source/core/dom/Element.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698