~ubuntu-branches/ubuntu/lucid/webkit/lucid-updates

« back to all changes in this revision

Viewing changes to WebCore/svg/SVGList.h

  • Committer: Bazaar Package Importer
  • Author(s): Gustavo Noronha Silva
  • Date: 2010-01-06 21:25:06 UTC
  • mfrom: (1.2.6 upstream) (4.3.7 sid)
  • Revision ID: james.westby@ubuntu.com-20100106212506-gd0czn4zrwf1j19l
* New upstream release
- adds basic Content-Encoding support, thanks to soup
  (Closes: #529271)
- fixes over-advertising content types as supported by
  the media player (Closes: #559420)
* debian/control:
- updated libsoup build requirement (>= 2.28.2)
* debian/libwebkit-1.0-2.symbols:
- updated with new symbols
* debian/copyright:
- updated information since 1.1.17
* Imported patch from https://bugs.webkit.org/show_bug.cgi?id=30623
- I am shipping this patch because I believe it is correct, it is the
  way to go, it fixes a race, and it needs testing.

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
        {
40
40
            return SVGListTraits<UsesDefaultInitializer<Item>::value, Item>::nullItem();
41
41
        }
 
42
        static bool isNull(const Item& it)
 
43
        {
 
44
            return SVGListTraits<UsesDefaultInitializer<Item>::value, Item>::isNull(it);
 
45
        }
42
46
    };
43
47
 
44
48
    template<typename Item>
56
60
 
57
61
        Item initialize(Item newItem, ExceptionCode& ec)
58
62
        {
 
63
            if (TypeOperations::isNull(newItem)) {
 
64
                ec = TYPE_MISMATCH_ERR;
 
65
                return TypeOperations::nullItem();
 
66
            }
59
67
            clear(ec);
60
68
            return appendItem(newItem, ec);
61
69
        }
92
100
            return m_vector[index];
93
101
        }
94
102
 
95
 
        Item insertItemBefore(Item newItem, unsigned int index, ExceptionCode&)
 
103
        Item insertItemBefore(Item newItem, unsigned int index, ExceptionCode& ec)
96
104
        {
 
105
            if (TypeOperations::isNull(newItem)) {
 
106
                ec = TYPE_MISMATCH_ERR;
 
107
                return TypeOperations::nullItem();
 
108
            }
 
109
 
97
110
            if (index < m_vector.size()) {
98
111
                m_vector.insert(index, newItem);
99
112
            } else {
108
121
                ec = INDEX_SIZE_ERR;
109
122
                return TypeOperations::nullItem();
110
123
            }
 
124
    
 
125
            if (TypeOperations::isNull(newItem)) {
 
126
                ec = TYPE_MISMATCH_ERR;
 
127
                return TypeOperations::nullItem();
 
128
            }
111
129
 
112
130
            m_vector[index] = newItem;
113
131
            return newItem;
125
143
            return item;
126
144
        }
127
145
 
128
 
        Item appendItem(Item newItem, ExceptionCode&)
 
146
        Item appendItem(Item newItem, ExceptionCode& ec)
129
147
        {
 
148
            if (TypeOperations::isNull(newItem)) {
 
149
                ec = TYPE_MISMATCH_ERR;
 
150
                return TypeOperations::nullItem();
 
151
            }
 
152
 
130
153
            m_vector.append(newItem);
131
154
            return newItem;
132
155
        }