[Webkit-unassigned] [Bug 43691] Add missing SVGPathSegList source for SVGPathParser

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Aug 9 23:08:48 PDT 2010


Nikolas Zimmermann <zimmermann at kde.org> changed:

           What    |Removed                     |Added
  Attachment #63847|review?                     |review-
               Flag|                            |

--- Comment #2 from Nikolas Zimmermann <zimmermann at kde.org>  2010-08-09 23:08:49 PST ---
(From update of attachment 63847)
Still needs some tweaks:

 +          Did some refactoring of SVGPathSource, the input data of SVGPathParser. The parsing process
Refactored SVGPathSource code, to read concrete path segments instead of type/flag/coordinates from the data sources.
This is a further abstraction and seperates the reading of content from the parsing and interpreting.

 +  bool SVGPathByteStreamSource::parseCurveToCubicSegment(FloatPoint& point1 , FloatPoint& point2, FloatPoint& targetPoint)
Superfluous space before comma.

 +      if (!m_source->parseMoveToSegment(targetPoint))
parseLineToSegment! :-)

 +      m_itemEnd = pathSegList->numberOfItems();
For consistency: s/pathSegList/m_pathSegList/

 +      SVGPathSegSingleCoord* moveTo = static_cast<SVGPathSegSingleCoord*>(m_segment);
You should ASSERT that the type is correct before casting, and also in all the other parse*Segment functions.

 +  bool SVGPathSegListSource::parseCurveToCubicSegment(FloatPoint& point1 , FloatPoint& point2, FloatPoint& targetPoint)
Superfluous space before comma.

 +      SVGPathSegSingleCoord* quadraticSmooth = static_cast<SVGPathSegSingleCoord*>(m_segment);
You can cast to the concrete SVGPathSegCurveToQudaraticSmoothSegment, no?

 +      SVGPathSeg* m_segment;
Hm, as SVGPathSeg is refcounted, you'd better store a RefPtr<SVGPathSeg> here, it's safer.
Instead of using static_cast to cast from SVGPathSeg to the individual types, you can use static_pointer_cast, that gives the same functionality but operates on RefPtrs.

 +  bool SVGPathStringSource::parseCurveToCubicSegment(FloatPoint& point1 , FloatPoint& point2, FloatPoint& targetPoint)
Superfluous space before comma.

Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

More information about the webkit-unassigned mailing list