~ubuntu-branches/ubuntu/lucid/webkit/lucid-security

« back to all changes in this revision

Viewing changes to WebCore/svg/SVGPathSegList.cpp

  • 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:
51
51
{
52
52
}
53
53
 
54
 
unsigned SVGPathSegList::getPathSegAtLength(double)
 
54
unsigned SVGPathSegList::getPathSegAtLength(double, ExceptionCode& ec)
55
55
{
56
56
    // FIXME : to be useful this will need to support non-normalized SVGPathSegLists
57
 
    ExceptionCode ec = 0;
58
57
    int len = numberOfItems();
59
58
    // FIXME: Eventually this will likely move to a "path applier"-like model, until then PathTraversalState is less useful as we could just use locals
60
59
    PathTraversalState traversalState(PathTraversalState::TraversalSegmentAtLength);
61
60
    for (int i = 0; i < len; ++i) {
62
61
        SVGPathSeg* segment = getItem(i, ec).get();
 
62
        if (ec)
 
63
            return 0;
63
64
        float segmentLength = 0;
64
65
        switch (segment->pathSegType()) {
65
66
        case SVGPathSeg::PATHSEG_MOVETO_ABS:
104
105
{
105
106
    // FIXME : This should also support non-normalized PathSegLists
106
107
    Path pathData;
 
108
    int len = numberOfItems();
107
109
    ExceptionCode ec = 0;
108
 
    int len = numberOfItems();
109
110
    for (int i = 0; i < len; ++i) {
110
111
        SVGPathSeg* segment = getItem(i, ec).get();
 
112
        if (ec)
 
113
            return Path();
111
114
        switch (segment->pathSegType()) {
112
115
            case SVGPathSeg::PATHSEG_MOVETO_ABS:
113
116
            {
182
185
    if (!itemCount || itemCount != toList->numberOfItems())
183
186
        return 0;
184
187
    RefPtr<SVGPathSegList> result = create(fromList->associatedAttributeName());
185
 
    ExceptionCode ec;
 
188
    ExceptionCode ec = 0;
186
189
    for (unsigned n = 0; n < itemCount; ++n) {
187
190
        SVGPathSeg* from = fromList->getItem(n, ec).get();
 
191
        if (ec)
 
192
            return 0;
188
193
        SVGPathSeg* to = toList->getItem(n, ec).get();
 
194
        if (ec)
 
195
            return 0;
189
196
        if (from->pathSegType() == SVGPathSeg::PATHSEG_UNKNOWN || from->pathSegType() != to->pathSegType())
190
197
            return 0;
191
198
        RefPtr<SVGPathSeg> segment = 0;
251
258
            ASSERT_NOT_REACHED();
252
259
        }
253
260
        result->appendItem(segment, ec);
 
261
        if (ec)
 
262
            return 0;
254
263
    }
255
264
    return result.release();
256
265
}