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 ===
2006-11-17 Timothy Hatcher <timothy@apple.com>
......@@ -28,8 +28,6 @@ namespace WebCore {
CSSValueList::~CSSValueList()
{
for (CSSValue *val = m_values.first(); val; val = m_values.next())
val->deref();
}
unsigned short CSSValueList::cssValueType() const
......@@ -39,17 +37,18 @@ unsigned short CSSValueList::cssValueType() const
void CSSValueList::append(PassRefPtr<CSSValue> val)
{
m_values.append(val.releaseRef());
m_values.append(val);
}
String CSSValueList::cssText() const
{
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())
result += ", ";
result += iterator.current()->cssText();
result += m_values[i]->cssText();
}
return result;
......
......@@ -24,8 +24,8 @@
#define CSSValueList_H
#include "CSSValue.h"
#include "DeprecatedPtrList.h"
#include <wtf/PassRefPtr.h>
#include <wtf/Vector.h>
namespace WebCore {
......@@ -34,8 +34,8 @@ class CSSValueList : public CSSValue
public:
virtual ~CSSValueList();
unsigned length() const { return m_values.count(); }
CSSValue* item (unsigned index) { return m_values.at(index); }
unsigned length() const { return m_values.size(); }
CSSValue* item (unsigned index) { return m_values[index].get(); }
virtual bool isValueList() { return true; }
......@@ -45,7 +45,7 @@ public:
virtual String cssText() const;
protected:
DeprecatedPtrList<CSSValue> m_values;
Vector<RefPtr<CSSValue> > m_values;
};
} // namespace
......
......@@ -2166,7 +2166,7 @@ Node* Document::getCSSTarget() const
void Document::attachNodeIterator(NodeIterator *ni)
{
m_nodeIterators.append(ni);
m_nodeIterators.add(ni);
}
void Document::detachNodeIterator(NodeIterator *ni)
......@@ -2180,9 +2180,10 @@ void Document::notifyBeforeNodeRemoval(Node *n)
f->selectionController()->nodeWillBeRemoved(n);
f->dragCaretController()->nodeWillBeRemoved(n);
}
DeprecatedPtrListIterator<NodeIterator> it(m_nodeIterators);
for (; it.current(); ++it)
it.current()->notifyBeforeNodeRemoval(n);
HashSet<NodeIterator*>::const_iterator end = m_nodeIterators.end();
for (HashSet<NodeIterator*>::const_iterator it = m_nodeIterators.begin(); it != end; ++it)
(*it)->notifyBeforeNodeRemoval(n);
}
DOMWindow* Document::defaultView() const
......
......@@ -645,7 +645,7 @@ protected:
unsigned m_domtree_version;
DeprecatedPtrList<NodeIterator> m_nodeIterators;
HashSet<NodeIterator*> m_nodeIterators;
unsigned short m_listenerTypes;
RefPtr<StyleSheetList> m_styleSheets;
......
......@@ -94,8 +94,9 @@ void SVGGradientElement::notifyAttributeChange() const
m_resource->invalidate(); // should this be added to build gradient?
const RenderPathList &clients = m_resource->clients();
for (RenderPathList::ConstIterator it = clients.begin(); it != clients.end(); ++it) {
const RenderPath* current = (*it);
unsigned size = clients.size();
for (unsigned i = 0 ; i < size; i++) {
const RenderPath* current = clients[i];
SVGStyledElement* styled = (current ? static_cast<SVGStyledElement*>(current->element()) : 0);
if (styled)
styled->setChanged(true);
......
......@@ -256,11 +256,9 @@ void SVGPatternElement::notifyClientsToRepaint() const
{
const RenderPathList& clients = m_paintServer->clients();
RenderPathList::ConstIterator it = clients.begin();
RenderPathList::ConstIterator end = clients.end();
for (; it != end; ++it) {
const RenderPath* current = (*it);
unsigned size = clients.size();
for (unsigned i = 0 ; i < size; i++) {
const RenderPath* current = clients[i];
SVGStyledElement* styled = (current ? static_cast<SVGStyledElement*>(current->element()) : 0);
if (styled) {
......
......@@ -45,17 +45,19 @@ SVGResource::~SVGResource()
void SVGResource::invalidate()
{
RenderPathList::ConstIterator it = m_clients.begin();
RenderPathList::ConstIterator end = m_clients.end();
for(; it != end; ++it)
const_cast<RenderPath*>(*it)->repaint();
unsigned size = m_clients.size();
for (unsigned i = 0; i < size; i++)
const_cast<RenderPath*>(m_clients[i])->repaint();
}
void SVGResource::addClient(const RenderPath* item)
{
if(m_clients.find(item) != m_clients.end())
return;
unsigned size = m_clients.size();
for (unsigned i = 0; i < size; i++) {
if (m_clients[i] == item)
return;
}
m_clients.append(item);
}
......
......@@ -30,7 +30,6 @@
#include "Shared.h"
#include "PlatformString.h"
#include "DeprecatedValueList.h"
namespace WebCore {
......@@ -40,7 +39,7 @@ namespace WebCore {
class AtomicString;
class KRenderingPaintServer;
typedef DeprecatedValueList<const RenderPath*> RenderPathList;
typedef Vector<const RenderPath*> RenderPathList;
enum SVGResourceType {
// Painting mode
......
......@@ -24,6 +24,7 @@
#ifndef RenderBlock_h
#define RenderBlock_h
#include "DeprecatedPtrList.h"
#include "GapRects.h"
#include "RenderFlow.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