RESOLVED FIXED 43682
Add missing String builder for SVGPathParser
https://bugs.webkit.org/show_bug.cgi?id=43682
Summary Add missing String builder for SVGPathParser
Dirk Schulze
Reported 2010-08-07 14:59:25 PDT
Add missing String builder (inheriting from SVGCustomer) for SVGPathParser.
Attachments
Patch (33.52 KB, patch)
2010-08-07 15:16 PDT, Dirk Schulze
zimmermann: review+
Dirk Schulze
Comment 1 2010-08-07 15:16:15 PDT
Nikolas Zimmermann
Comment 2 2010-08-08 04:46:35 PDT
Comment on attachment 63832 [details] Patch WebCore/svg/SVGPathParserFactory.cpp:80 + s_parser->setCurrentSource(source); For consistency, add a newline before this statement and remove the one before return s_parser :-) WebCore/svg/SVGPathParserFactory.cpp:181 + ASSERT(stream); Ok you misunderstood the suggestion I gave. The passed in OwnPtr should not be initialized, this is the task of this function. The function should be used like this: OwnPtr<SVGPathByteStream> stream; // stream pointer is null here! if (!factory->buildSVGPathByteStreamFromString(d, stream, NormalizedParsing)) return false; // stream pointer is now set. That means, the ASSERT(stream) should go away. The function should be used like this: bool SVGPathParserFactory::buildSVGPathByteStreamFromString(const String& d, OwnPtr<SVGPathByteStream>& result, PathParsingMode parsingMode) { if (d.isEmpty()) return false; OwnPtr<SVGPathByteStream> stream = SVGPathByteStream::create(); SVGPathByteStreamBuilder* builder = globalSVGPathByteStreamBuilder(stream.get()); OwnPtr<SVGPathStringSource> source = SVGPathStringSource::create(d); SVGPathParser* parser = globalSVGPathParser(source.get(), builder); bool ok = parser->parsePathDataFromSource(parsingMode); parser->cleanup(); result = stream.release(); // this is the important step return ok; } r=me, with those fixes.
Dirk Schulze
Comment 3 2010-08-08 09:11:15 PDT
Note You need to log in before you can comment on or make changes to this bug.