Commit 202e8653 authored by andersca's avatar andersca

Reviewed by Geoff.

        More conversions from DeprecatedValueList to Vector and HashSet.
        
        * css/CSSValueList.cpp:
        (WebCore::CSSValueList::~CSSValueList):
        (WebCore::CSSValueList::append):
        (WebCore::CSSValueList::cssText):
        * css/CSSValueList.h:
        (WebCore::CSSValueList::length):
        (WebCore::CSSValueList::item):
        * dom/Document.cpp:
        (WebCore::Document::attachNodeIterator):
        (WebCore::Document::notifyBeforeNodeRemoval):
        * dom/Document.h:
        * ksvg2/svg/SVGGradientElement.cpp:
        (WebCore::SVGGradientElement::notifyAttributeChange):
        * ksvg2/svg/SVGPatternElement.cpp:
        (WebCore::SVGPatternElement::notifyClientsToRepaint):
        * platform/graphics/svg/SVGResource.cpp:
        (WebCore::SVGResource::invalidate):
        (WebCore::SVGResource::addClient):
        * platform/graphics/svg/SVGResource.h:
        * rendering/RenderBlock.h:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@17838 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent cdd6842b
2006-11-17 Anders Carlsson <acarlsson@apple.com>
Reviewed by Geoff.
More conversions from DeprecatedValueList to Vector and HashSet.
* css/CSSValueList.cpp:
(WebCore::CSSValueList::~CSSValueList):
(WebCore::CSSValueList::append):
(WebCore::CSSValueList::cssText):
* css/CSSValueList.h:
(WebCore::CSSValueList::length):
(WebCore::CSSValueList::item):
* dom/Document.cpp:
(WebCore::Document::attachNodeIterator):
(WebCore::Document::notifyBeforeNodeRemoval):
* dom/Document.h:
* ksvg2/svg/SVGGradientElement.cpp:
(WebCore::SVGGradientElement::notifyAttributeChange):
* ksvg2/svg/SVGPatternElement.cpp:
(WebCore::SVGPatternElement::notifyClientsToRepaint):
* platform/graphics/svg/SVGResource.cpp:
(WebCore::SVGResource::invalidate):
(WebCore::SVGResource::addClient):
* platform/graphics/svg/SVGResource.h:
* rendering/RenderBlock.h:
=== Safari-521.31 === === Safari-521.31 ===
2006-11-17 Timothy Hatcher <timothy@apple.com> 2006-11-17 Timothy Hatcher <timothy@apple.com>
...@@ -28,8 +28,6 @@ namespace WebCore { ...@@ -28,8 +28,6 @@ namespace WebCore {
CSSValueList::~CSSValueList() CSSValueList::~CSSValueList()
{ {
for (CSSValue *val = m_values.first(); val; val = m_values.next())
val->deref();
} }
unsigned short CSSValueList::cssValueType() const unsigned short CSSValueList::cssValueType() const
...@@ -39,17 +37,18 @@ unsigned short CSSValueList::cssValueType() const ...@@ -39,17 +37,18 @@ unsigned short CSSValueList::cssValueType() const
void CSSValueList::append(PassRefPtr<CSSValue> val) void CSSValueList::append(PassRefPtr<CSSValue> val)
{ {
m_values.append(val.releaseRef()); m_values.append(val);
} }
String CSSValueList::cssText() const String CSSValueList::cssText() const
{ {
String result = ""; String result = "";
for (DeprecatedPtrListIterator<CSSValue> iterator(m_values); iterator.current(); ++iterator) { unsigned size = m_values.size();
for (unsigned i = 0; i < size; i++) {
if (!result.isEmpty()) if (!result.isEmpty())
result += ", "; result += ", ";
result += iterator.current()->cssText(); result += m_values[i]->cssText();
} }
return result; return result;
......
...@@ -24,8 +24,8 @@ ...@@ -24,8 +24,8 @@
#define CSSValueList_H #define CSSValueList_H
#include "CSSValue.h" #include "CSSValue.h"
#include "DeprecatedPtrList.h"
#include <wtf/PassRefPtr.h> #include <wtf/PassRefPtr.h>
#include <wtf/Vector.h>
namespace WebCore { namespace WebCore {
...@@ -34,8 +34,8 @@ class CSSValueList : public CSSValue ...@@ -34,8 +34,8 @@ class CSSValueList : public CSSValue
public: public:
virtual ~CSSValueList(); virtual ~CSSValueList();
unsigned length() const { return m_values.count(); } unsigned length() const { return m_values.size(); }
CSSValue* item (unsigned index) { return m_values.at(index); } CSSValue* item (unsigned index) { return m_values[index].get(); }
virtual bool isValueList() { return true; } virtual bool isValueList() { return true; }
...@@ -45,7 +45,7 @@ public: ...@@ -45,7 +45,7 @@ public:
virtual String cssText() const; virtual String cssText() const;
protected: protected:
DeprecatedPtrList<CSSValue> m_values; Vector<RefPtr<CSSValue> > m_values;
}; };
} // namespace } // namespace
......
...@@ -2166,7 +2166,7 @@ Node* Document::getCSSTarget() const ...@@ -2166,7 +2166,7 @@ Node* Document::getCSSTarget() const
void Document::attachNodeIterator(NodeIterator *ni) void Document::attachNodeIterator(NodeIterator *ni)
{ {
m_nodeIterators.append(ni); m_nodeIterators.add(ni);
} }
void Document::detachNodeIterator(NodeIterator *ni) void Document::detachNodeIterator(NodeIterator *ni)
...@@ -2180,9 +2180,10 @@ void Document::notifyBeforeNodeRemoval(Node *n) ...@@ -2180,9 +2180,10 @@ void Document::notifyBeforeNodeRemoval(Node *n)
f->selectionController()->nodeWillBeRemoved(n); f->selectionController()->nodeWillBeRemoved(n);
f->dragCaretController()->nodeWillBeRemoved(n); f->dragCaretController()->nodeWillBeRemoved(n);
} }
DeprecatedPtrListIterator<NodeIterator> it(m_nodeIterators);
for (; it.current(); ++it) HashSet<NodeIterator*>::const_iterator end = m_nodeIterators.end();
it.current()->notifyBeforeNodeRemoval(n); for (HashSet<NodeIterator*>::const_iterator it = m_nodeIterators.begin(); it != end; ++it)
(*it)->notifyBeforeNodeRemoval(n);
} }
DOMWindow* Document::defaultView() const DOMWindow* Document::defaultView() const
......
...@@ -645,7 +645,7 @@ protected: ...@@ -645,7 +645,7 @@ protected:
unsigned m_domtree_version; unsigned m_domtree_version;
DeprecatedPtrList<NodeIterator> m_nodeIterators; HashSet<NodeIterator*> m_nodeIterators;
unsigned short m_listenerTypes; unsigned short m_listenerTypes;
RefPtr<StyleSheetList> m_styleSheets; RefPtr<StyleSheetList> m_styleSheets;
......
...@@ -94,8 +94,9 @@ void SVGGradientElement::notifyAttributeChange() const ...@@ -94,8 +94,9 @@ void SVGGradientElement::notifyAttributeChange() const
m_resource->invalidate(); // should this be added to build gradient? m_resource->invalidate(); // should this be added to build gradient?
const RenderPathList &clients = m_resource->clients(); const RenderPathList &clients = m_resource->clients();
for (RenderPathList::ConstIterator it = clients.begin(); it != clients.end(); ++it) { unsigned size = clients.size();
const RenderPath* current = (*it); for (unsigned i = 0 ; i < size; i++) {
const RenderPath* current = clients[i];
SVGStyledElement* styled = (current ? static_cast<SVGStyledElement*>(current->element()) : 0); SVGStyledElement* styled = (current ? static_cast<SVGStyledElement*>(current->element()) : 0);
if (styled) if (styled)
styled->setChanged(true); styled->setChanged(true);
......
...@@ -256,11 +256,9 @@ void SVGPatternElement::notifyClientsToRepaint() const ...@@ -256,11 +256,9 @@ void SVGPatternElement::notifyClientsToRepaint() const
{ {
const RenderPathList& clients = m_paintServer->clients(); const RenderPathList& clients = m_paintServer->clients();
RenderPathList::ConstIterator it = clients.begin(); unsigned size = clients.size();
RenderPathList::ConstIterator end = clients.end(); for (unsigned i = 0 ; i < size; i++) {
const RenderPath* current = clients[i];
for (; it != end; ++it) {
const RenderPath* current = (*it);
SVGStyledElement* styled = (current ? static_cast<SVGStyledElement*>(current->element()) : 0); SVGStyledElement* styled = (current ? static_cast<SVGStyledElement*>(current->element()) : 0);
if (styled) { if (styled) {
......
...@@ -45,17 +45,19 @@ SVGResource::~SVGResource() ...@@ -45,17 +45,19 @@ SVGResource::~SVGResource()
void SVGResource::invalidate() void SVGResource::invalidate()
{ {
RenderPathList::ConstIterator it = m_clients.begin(); unsigned size = m_clients.size();
RenderPathList::ConstIterator end = m_clients.end(); for (unsigned i = 0; i < size; i++)
const_cast<RenderPath*>(m_clients[i])->repaint();
for(; it != end; ++it)
const_cast<RenderPath*>(*it)->repaint();
} }
void SVGResource::addClient(const RenderPath* item) void SVGResource::addClient(const RenderPath* item)
{ {
if(m_clients.find(item) != m_clients.end()) unsigned size = m_clients.size();
return;
for (unsigned i = 0; i < size; i++) {
if (m_clients[i] == item)
return;
}
m_clients.append(item); m_clients.append(item);
} }
......
...@@ -30,7 +30,6 @@ ...@@ -30,7 +30,6 @@
#include "Shared.h" #include "Shared.h"
#include "PlatformString.h" #include "PlatformString.h"
#include "DeprecatedValueList.h"
namespace WebCore { namespace WebCore {
...@@ -40,7 +39,7 @@ namespace WebCore { ...@@ -40,7 +39,7 @@ namespace WebCore {
class AtomicString; class AtomicString;
class KRenderingPaintServer; class KRenderingPaintServer;
typedef DeprecatedValueList<const RenderPath*> RenderPathList; typedef Vector<const RenderPath*> RenderPathList;
enum SVGResourceType { enum SVGResourceType {
// Painting mode // Painting mode
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#ifndef RenderBlock_h #ifndef RenderBlock_h
#define RenderBlock_h #define RenderBlock_h
#include "DeprecatedPtrList.h"
#include "GapRects.h" #include "GapRects.h"
#include "RenderFlow.h" #include "RenderFlow.h"
#include "RootInlineBox.h" #include "RootInlineBox.h"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment