- fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8023
Attribute.h missing class predeclaration
* dom/Attribute.h: Add declarations for classes so that the friend
declaration is not the only one. There's an issue with either an earlier
or later version of gcc, which is why we see this only on certain platforms.
* dom/Attr.cpp:
(WebCore::Attr::Attr):
(WebCore::Attr::~Attr):
* dom/NamedAttrMap.cpp:
(WebCore::NamedAttrMap::clearAttributes):
(WebCore::NamedAttrMap::addAttribute):
(WebCore::NamedAttrMap::removeAttribute):
Change places where practical to use attr() instead of m_impl in the vain
hope of removing the need for the friend declarations.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@13533
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2006-03-28 Michael Emmel <mike.emmel@gmail.com>
+
+ Reviewed, tweaked, landed by Darin.
+
+ - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8023
+ Attribute.h missing class predeclaration
+
+ * dom/Attribute.h: Add declarations for classes so that the friend
+ declaration is not the only one. There's an issue with either an earlier
+ or later version of gcc, which is why we see this only on certain platforms.
+
+ * dom/Attr.cpp:
+ (WebCore::Attr::Attr):
+ (WebCore::Attr::~Attr):
+ * dom/NamedAttrMap.cpp:
+ (WebCore::NamedAttrMap::clearAttributes):
+ (WebCore::NamedAttrMap::addAttribute):
+ (WebCore::NamedAttrMap::removeAttribute):
+ Change places where practical to use attr() instead of m_impl in the vain
+ hope of removing the need for the friend declarations.
+
2006-03-27 Eric Seidel <eseidel@apple.com>
Reviewed by darin.
m_attribute(a),
m_ignoreChildrenChanged(0)
{
- assert(!m_attribute->m_impl);
+ assert(!m_attribute->attr());
m_attribute->m_impl = this;
m_specified = true;
}
Attr::~Attr()
{
- assert(m_attribute->m_impl == this);
+ assert(m_attribute->attr() == this);
m_attribute->m_impl = 0;
}
namespace WebCore {
+class Attr;
class CSSStyleDeclaration;
+class Element;
+class NamedAttrMap;
// this has no counterpart in DOM, purely internal
// representation of the nodevalue of an Attr.
// is only allocated on demand by the DOM bindings.
// Any use of Attr inside khtml should be avoided.
class Attribute : public Shared<Attribute> {
- friend class NamedAttrMap;
- friend class Element;
friend class Attr;
-
+ friend class Element;
+ friend class NamedAttrMap;
public:
// null value is forbidden !
Attribute(const QualifiedName& name, const AtomicString& value)
const QualifiedName& name() const { return m_name; }
Attr* attr() const { return m_impl; }
- PassRefPtr<Attr> createAttrIfNeeded(Element* e);
+ PassRefPtr<Attr> createAttrIfNeeded(Element*);
bool isNull() const { return m_value.isNull(); }
bool isEmpty() const { return m_value.isEmpty(); }
{
if (attrs) {
for (unsigned i = 0; i < len; i++) {
- if (attrs[i]->m_impl)
- attrs[i]->m_impl->m_element = 0;
+ if (attrs[i]->attr())
+ attrs[i]->attr()->m_element = 0;
attrs[i]->deref();
}
fastFree(attrs);
attrs[len++] = attribute;
attribute->ref();
- Attr * const attr = attribute->m_impl;
+ Attr * const attr = attribute->attr();
if (attr)
attr->m_element = element;
// Remove the attribute from the list
Attribute* attr = attrs[index];
- if (attrs[index]->m_impl)
- attrs[index]->m_impl->m_element = 0;
+ if (attrs[index]->attr())
+ attrs[index]->attr()->m_element = 0;
if (len == 1) {
fastFree(attrs);
attrs = 0;