haikuwebkit/LayoutTests/svg/dom/SVGPathSegList-xml-dom-sync...

36 lines
1.4 KiB
HTML
Raw Permalink Normal View History

2010-11-19 Nikolas Zimmermann <nzimmermann@rim.com> Reviewed by Dirk Schulze. Convert SVGPathSeg/SVGPathSegList to the new SVGPropertyTearOff concept https://bugs.webkit.org/show_bug.cgi?id=49580 SVGPathElement.cloneNode loses generated pathSegList https://bugs.webkit.org/show_bug.cgi?id=43388 SVG Path elements are not correctly updated through pathSegList manipulation on relative values https://bugs.webkit.org/show_bug.cgi?id=30219 Changing an SVGPathSeg does not update a following Smooth Cubic Curveto https://bugs.webkit.org/show_bug.cgi?id=19741 SVGPathElement should only build SVGPathSeg* list on demand https://bugs.webkit.org/show_bug.cgi?id=10827 Tests: svg/W3C-SVG-1.1-SE/paths-dom-02-f.svg svg/dom/SVGPathSegList-appendItem.xhtml svg/dom/SVGPathSegList-clear-and-initialize.xhtml svg/dom/SVGPathSegList-cloning.html svg/dom/SVGPathSegList-insertItemBefore.xhtml svg/dom/SVGPathSegList-removeItem.xhtml svg/dom/SVGPathSegList-replaceItem.xhtml svg/dom/SVGPathSegList-xml-dom-synchronization.xhtml svg/dom/SVGPathSegList-xml-dom-synchronization2.xhtml svg/dom/SVGPathSegList-segment-modification.svg Convert SVGPathSeg*/SVGPathSegList to the new SVG(Animated)PropertyTearOff concept. Unlike all other SVG* types that use the SVGPropertyTearOff concept, SVGPathSegs are already refcounted, and don't need to be wrapped in SVGPropertyTearOff objects. The consequence is that SVGPathSegs need to track themselves to which list and path element they belong. Introduce new SVGAnimatedPathSegListPropertyTearOff and SVGPathSegListPropertyTearOff classes, that encapsulate the special needed for SVGPathSegList. Each SVGPathSeg now needs to store a RefPtr<SVGPathElement> - this makes it impossible to use SVGPathSegList to represent the 'd' attribute internally in SVGPathElement. SVGPathSegList is now only used in the SVG DOM bindings if someone explicitely requests 'pathElement.pathSegList' (eg. via JS). Switch to use SVGPathByteStream to store the 'd' attribute data in SVGPathElement, which is much more compact, and less memory intensive. Dirk already prepared SVGPathParserFactory some months ago, which allows easy conversion between String/Path/SVGPathSegList/SVGPathByteStream in all directions, including normalizing the lists, when requested. As consequence SVGPathSegList is now only built on demand, when explicitely requested. Using the SVGAnimatedProperty concept gives us 'd' attribute <-> SVGPathSegList synchronization for free, fixing several bugs, listed above. * Android.mk: Remove obsolete SVGPathSeg*.cpp files and SVGAnimatedPathData.cpp from build. * CMakeLists.txt: Ditto. * DerivedSources.make: Remove SVGAnimatedPathData IDL generation. * GNUmakefile.am: Remove obsolete SVGPathSeg*.cpp files and SVGAnimatedPathData.cpp from build. * WebCore.gyp/WebCore.gyp: Remove SVGAnimatedPathData IDL generation. * WebCore.gypi: Remove obsolete SVGPathSeg*.cpp files and SVGAnimatedPathData.cpp from build. * WebCore.order: Remove no-longer existant SVGAnimatedPathData symbols. * WebCore.pro: Remove obsolete SVGPathSeg*.cpp files and SVGAnimatedPathData.cpp / JSSVGPathSegCustom.* from build. * WebCore.vcproj/WebCore.vcproj: Ditto. * WebCore.xcodeproj/project.pbxproj: Ditto. * bindings/js/JSBindingsAllInOne.cpp: Remove JSSVGPathSegCustom.cpp from build. * bindings/js/JSDOMBinding.cpp: Adapt to toJS() changes, remove context parameter. (WebCore::setDOMException): * bindings/js/JSDOMBinding.h: Remove obsolete CREATE_SVG_OBJECT_WRAPPER macro, the context parameter is not existant anymore. * bindings/js/JSSVGPathSegCustom.cpp: Replace CREATE_SVG_OBJECT_WRAPPER by CREATE_DOM_OBJECT_WRAPPER. Remove context parameter/handling. (WebCore::toJS): * bindings/js/JSSVGPathSegListCustom.cpp: Removed. * bindings/scripts/CodeGenerator.pm: Map 'SVGPathSegList' IDL type to SVG 'SVGPathSegListPropertyTearOff' native type. * bindings/scripts/CodeGeneratorJS.pm: Remove IsSVGTypeNeedingContextParameter() methods and usages. Handle SVGPathSegListPropertyTearOff. * bindings/scripts/CodeGeneratorObjC.pm: Handle SVGPathSegListPropertyTearOff. * bindings/scripts/CodeGeneratorV8.pm: Remove IsSVGTypeNeedingContextParameter() methods and usages. * rendering/SVGRenderTreeAsText.cpp: Build path string from byte stream, not path segment list. (WebCore::operator<<): * svg/SVGAllInOne.cpp: Remove obsolete cpp files. * svg/SVGAnimatedPathData.cpp: Removed. * svg/SVGAnimatedPathData.h: Removed. * svg/SVGAnimatedPathData.idl: Removed. * svg/SVGPathElement.cpp: Build SVGPathList on demand. Use SVGPathByteStream to parse/store the 'd' attribute content. (WebCore::SVGPathElement::SVGPathElement): (WebCore::SVGPathElement::getPathSegAtLength): Use SVGPathByteStream, not SVGPathSegList to determine the getPathSegAtLength() information. (WebCore::SVGPathElement::createSVGPathSegClosePath): Pass SVGPathElement to SVGPathSeg and a SVGPathSegRole parameter and store it to track the list origin. (WebCore::SVGPathElement::createSVGPathSegMovetoAbs): Ditto. (WebCore::SVGPathElement::createSVGPathSegMovetoRel): Ditto. (WebCore::SVGPathElement::createSVGPathSegLinetoAbs): Ditto. (WebCore::SVGPathElement::createSVGPathSegLinetoRel): Ditto. (WebCore::SVGPathElement::createSVGPathSegCurvetoCubicAbs): Ditto. (WebCore::SVGPathElement::createSVGPathSegCurvetoCubicRel): Ditto. (WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticAbs): Ditto. (WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticRel): Ditto. (WebCore::SVGPathElement::createSVGPathSegArcAbs): Ditto. (WebCore::SVGPathElement::createSVGPathSegArcRel): Ditto. (WebCore::SVGPathElement::createSVGPathSegLinetoHorizontalAbs): Ditto. (WebCore::SVGPathElement::createSVGPathSegLinetoHorizontalRel): Ditto. (WebCore::SVGPathElement::createSVGPathSegLinetoVerticalAbs): Ditto. (WebCore::SVGPathElement::createSVGPathSegLinetoVerticalRel): Ditto. (WebCore::SVGPathElement::createSVGPathSegCurvetoCubicSmoothAbs): Ditto. (WebCore::SVGPathElement::createSVGPathSegCurvetoCubicSmoothRel): Ditto. (WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticSmoothAbs): Ditto. (WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticSmoothRel): Ditto. (WebCore::SVGPathElement::parseMappedAttribute): Build SVGPathByteStream from 'd' attribute, not a SVGPathSegList. (WebCore::SVGPathElement::svgAttributeChanged): If a SVGPathSegList object has been built, synchronize it with the 'd' attribute. (WebCore::SVGPathElement::synchronizeProperty): Synchronize 'd' attribute with the SVGPathSegList, if needed. (WebCore::SVGPathElement::synchronizeD): Added. (WebCore::SVGPathElement::pathSegList): Use same trick as in SVGPolyElement to expose the 'pathSegList' / 'animatedPathSegList' object to the SVG DOM bindings. (WebCore::SVGPathElement::normalizedPathSegList): Ditto. (WebCore::SVGPathElement::animatedPathSegList): Ditto. (WebCore::SVGPathElement::animatedNormalizedPathSegList): Ditto. (WebCore::SVGPathElement::toPathData): Build 'Path' object from SVGPathByteStream, not from SVGPathSegList. (WebCore::SVGPathElement::pathSegListChanged): Used to synchronize the SVGPathSegLists and the d attribute, as well as any changes from any SVGPathSeg associated with this SVGPathElement. * svg/SVGPathElement.h: Add new accessors... (WebCore::SVGPathElement::pathByteStream): ... needed by SVGRenderTreeAsText. (WebCore::SVGPathElement::animatablePathSegList): ... needed by SVGPathSegListPropertyTearOff. * svg/SVGPathElement.idl: Merge SVGAnimatedPathData interface into SVGPathElement. * svg/SVGPathParserFactory.cpp: Cleanup SVGPathParserFactory, remove obsolete methods, now that SVGPathElement switched to using SVGPathByteStream internally. (WebCore::globalSVGPathSegListBuilder): (WebCore::SVGPathParserFactory::buildSVGPathByteStreamFromSVGPathSegList): (WebCore::SVGPathParserFactory::buildPathFromByteStream): (WebCore::SVGPathParserFactory::buildSVGPathSegListFromByteStream): (WebCore::SVGPathParserFactory::buildStringFromSVGPathSegList): (WebCore::SVGPathParserFactory::buildSVGPathByteStreamFromString): (WebCore::SVGPathParserFactory::buildAnimatedSVGPathByteStream): (WebCore::SVGPathParserFactory::getSVGPathSegAtLengthFromSVGPathByteStream): * svg/SVGPathParserFactory.h: * svg/SVGPathSeg.cpp: Removed. * svg/SVGPathSeg.h: Add new SVGPathSegRole enum, identifying to which list a path segment belongs. (WebCore::SVGPathSeg::SVGPathSeg): * svg/SVGPathSeg.idl: Reindented. * svg/SVGPathSegArc.cpp: Removed. * svg/SVGPathSegArc.h: All setters now call the commitChange() method. * svg/SVGPathSegArcAbs.idl: Enable StrictTypeChecking. * svg/SVGPathSegArcRel.idl: Ditto. * svg/SVGPathSegClosePath.cpp: Removed. * svg/SVGPathSegClosePath.h: * svg/SVGPathSegCurvetoCubic.cpp: Removed. * svg/SVGPathSegCurvetoCubic.h: All setters now call the commitChange() method. * svg/SVGPathSegCurvetoCubicAbs.idl: Enable StrictTypeChecking. * svg/SVGPathSegCurvetoCubicRel.idl: Ditto. * svg/SVGPathSegCurvetoCubicSmooth.cpp: Removed. * svg/SVGPathSegCurvetoCubicSmooth.h: All setters now call the commitChange() method. * svg/SVGPathSegCurvetoCubicSmoothAbs.idl: Enable StrictTypeChecking. * svg/SVGPathSegCurvetoCubicSmoothRel.idl: Ditto. * svg/SVGPathSegCurvetoQuadratic.cpp: Removed. * svg/SVGPathSegCurvetoQuadratic.h: All setters now call the commitChange() method. * svg/SVGPathSegCurvetoQuadraticAbs.idl: Enable StrictTypeChecking. * svg/SVGPathSegCurvetoQuadraticRel.idl: Ditto. * svg/SVGPathSegCurvetoQuadraticSmooth.cpp: Removed. * svg/SVGPathSegCurvetoQuadraticSmooth.h: All setters now call the commitChange() method. * svg/SVGPathSegCurvetoQuadraticSmoothAbs.idl: Enable StrictTypeChecking. * svg/SVGPathSegCurvetoQuadraticSmoothRel.idl: Ditto. * svg/SVGPathSegLineto.cpp: Removed. * svg/SVGPathSegLineto.h: All setters now call the commitChange() method. * svg/SVGPathSegLinetoAbs.idl: Enable StrictTypeChecking. * svg/SVGPathSegLinetoHorizontal.cpp: Removed. * svg/SVGPathSegLinetoHorizontal.h: All setters now call the commitChange() method. * svg/SVGPathSegLinetoHorizontalAbs.idl: Enable StrictTypeChecking. * svg/SVGPathSegLinetoHorizontalRel.idl: Ditto. * svg/SVGPathSegLinetoRel.idl: Enable StrictTypeChecking. * svg/SVGPathSegLinetoVertical.cpp: Removed. * svg/SVGPathSegLinetoVertical.h: All setters now call the commitChange() method. * svg/SVGPathSegLinetoVerticalAbs.idl: Enable StrictTypeChecking. * svg/SVGPathSegLinetoVerticalRel.idl: Ditto. * svg/SVGPathSegList.cpp: Switch from SVGList<RefPtr<SVGPathSeg> > to a plain Vector<RefPtr<SVGPathSeg> >. (WebCore::SVGPathSegList::valueAsString): Utilize SVGPathParserFactory to build a String from a SVGPathSegList. (WebCore::SVGPathSegList::commitChange): Call SVGPathElement::pathSegListChanged(). * svg/SVGPathSegList.h: (WebCore::SVGPathSegList::SVGPathSegList): * svg/SVGPathSegList.idl: Remove [JSCCustom] flags, no longer needed. * svg/SVGPathSegListBuilder.cpp: Adapt to SVGPathSegList API changes. (WebCore::SVGPathSegListBuilder::SVGPathSegListBuilder): (WebCore::SVGPathSegListBuilder::moveTo): (WebCore::SVGPathSegListBuilder::lineTo): (WebCore::SVGPathSegListBuilder::lineToHorizontal): (WebCore::SVGPathSegListBuilder::lineToVertical): (WebCore::SVGPathSegListBuilder::curveToCubic): (WebCore::SVGPathSegListBuilder::curveToCubicSmooth): (WebCore::SVGPathSegListBuilder::curveToQuadratic): (WebCore::SVGPathSegListBuilder::curveToQuadraticSmooth): (WebCore::SVGPathSegListBuilder::arcTo): (WebCore::SVGPathSegListBuilder::closePath): * svg/SVGPathSegListBuilder.h: Ditto. (WebCore::SVGPathSegListBuilder::setCurrentSVGPathElement): (WebCore::SVGPathSegListBuilder::setCurrentSVGPathSegList): (WebCore::SVGPathSegListBuilder::setCurrentSVGPathSegRole): (WebCore::SVGPathSegListBuilder::cleanup): * svg/SVGPathSegListSource.cpp: Ditto. (WebCore::SVGPathSegListSource::SVGPathSegListSource): (WebCore::SVGPathSegListSource::parseSVGSegmentType): (WebCore::SVGPathSegListSource::nextCommand): (WebCore::SVGPathSegListSource::parseMoveToSegment): (WebCore::SVGPathSegListSource::parseLineToSegment): (WebCore::SVGPathSegListSource::parseCurveToQuadraticSmoothSegment): * svg/SVGPathSegListSource.h: Ditto. (WebCore::SVGPathSegListSource::create): * svg/SVGPathSegMoveto.cpp: Removed. * svg/SVGPathSegMoveto.h: All setters now call the commitChange() method. * svg/SVGPathSegMovetoAbs.idl: Enable StrictTypeChecking. * svg/SVGPathSegMovetoRel.idl: Ditto. * svg/SVGPathSegWithContext.h: Added. This is the new base class for all SVGPathSeg derived types, that's associated with a SVGPathElement and a 'role' (normalized/unaltered segment list). (WebCore::SVGPathSegWithContext::SVGPathSegWithContext): (WebCore::SVGPathSegWithContext::animatedProperty): (WebCore::SVGPathSegWithContext::setContextAndRole): (WebCore::SVGPathSegWithContext::commitChange): (WebCore::SVGPathSegSingleCoordinate::x): (WebCore::SVGPathSegSingleCoordinate::setX): (WebCore::SVGPathSegSingleCoordinate::y): (WebCore::SVGPathSegSingleCoordinate::setY): (WebCore::SVGPathSegSingleCoordinate::SVGPathSegSingleCoordinate): * svg/properties/SVGAnimatedPathSegListPropertyTearOff.h: Added. (WebCore::SVGAnimatedPathSegListPropertyTearOff::baseVal): (WebCore::SVGAnimatedPathSegListPropertyTearOff::animVal): (WebCore::SVGAnimatedPathSegListPropertyTearOff::removeItemFromList): (WebCore::SVGAnimatedPathSegListPropertyTearOff::create): (WebCore::SVGAnimatedPathSegListPropertyTearOff::SVGAnimatedPathSegListPropertyTearOff): * svg/properties/SVGPathSegListPropertyTearOff.cpp: Added. (WebCore::SVGPathSegListPropertyTearOff::clear): Added in the cpp file, not in the header, as it needs access to SVGPathSegWithContext, which we can't include from the header. (WebCore::SVGPathSegListPropertyTearOff::getItem): Ditto. (WebCore::SVGPathSegListPropertyTearOff::removeItem): Ditto. (WebCore::SVGPathSegListPropertyTearOff::contextElement): Needs access to SVGPathElement, that's why it lives in the cpp file. (WebCore::SVGPathSegListPropertyTearOff::processIncomingListItemValue): Needs access to SVGPathSegWithContext. * svg/properties/SVGPathSegListPropertyTearOff.h: Added. (WebCore::SVGPathSegListPropertyTearOff::create): (WebCore::SVGPathSegListPropertyTearOff::removeItemFromList): (WebCore::SVGPathSegListPropertyTearOff::numberOfItems): (WebCore::SVGPathSegListPropertyTearOff::initialize): (WebCore::SVGPathSegListPropertyTearOff::insertItemBefore): (WebCore::SVGPathSegListPropertyTearOff::replaceItem): (WebCore::SVGPathSegListPropertyTearOff::appendItem): (WebCore::SVGPathSegListPropertyTearOff::SVGPathSegListPropertyTearOff): (WebCore::SVGPathSegListPropertyTearOff::commitChange): (WebCore::SVGPathSegListPropertyTearOff::processIncomingListItemWrapper): 2010-11-19 Nikolas Zimmermann <nzimmermann@rim.com> Reviewed by Dirk Schulze. Convert SVGPathSeg/SVGPathSegList to the new SVGPropertyTearOff concept https://bugs.webkit.org/show_bug.cgi?id=49580 Add several new tests covering SVGPathSegList usage. * platform/mac/svg/W3C-SVG-1.1-SE/paths-dom-02-f-expected.checksum: Added. * platform/mac/svg/W3C-SVG-1.1-SE/paths-dom-02-f-expected.png: Added. * platform/mac/svg/W3C-SVG-1.1-SE/paths-dom-02-f-expected.txt: Added. * platform/mac/svg/custom/svg-curve-with-relative-cordinates-expected.txt: * platform/mac/svg/dom/SVGPathSegList-appendItem-expected.checksum: Added. * platform/mac/svg/dom/SVGPathSegList-appendItem-expected.png: Added. * platform/mac/svg/dom/SVGPathSegList-clear-and-initialize-expected.checksum: Added. * platform/mac/svg/dom/SVGPathSegList-clear-and-initialize-expected.png: Added. * platform/mac/svg/dom/SVGPathSegList-cloning-expected.checksum: Added. * platform/mac/svg/dom/SVGPathSegList-cloning-expected.png: Added. * platform/mac/svg/dom/SVGPathSegList-cloning-expected.txt: Added. * platform/mac/svg/dom/SVGPathSegList-insertItemBefore-expected.checksum: Added. * platform/mac/svg/dom/SVGPathSegList-insertItemBefore-expected.png: Added. * platform/mac/svg/dom/SVGPathSegList-removeItem-expected.checksum: Added. * platform/mac/svg/dom/SVGPathSegList-removeItem-expected.png: Added. * platform/mac/svg/dom/SVGPathSegList-replaceItem-expected.checksum: Added. * platform/mac/svg/dom/SVGPathSegList-replaceItem-expected.png: Added. * platform/mac/svg/dom/SVGPathSegList-segment-modification-expected.checksum: Added. * platform/mac/svg/dom/SVGPathSegList-segment-modification-expected.png: Added. * platform/mac/svg/dom/SVGPathSegList-segment-modification-expected.txt: Added. * platform/mac/svg/dom/SVGPathSegList-xml-dom-synchronization-expected.checksum: Added. * platform/mac/svg/dom/SVGPathSegList-xml-dom-synchronization-expected.png: Added. * platform/mac/svg/dom/SVGPathSegList-xml-dom-synchronization2-expected.checksum: Added. * platform/mac/svg/dom/SVGPathSegList-xml-dom-synchronization2-expected.png: Added. * platform/mac/svg/dom/SVGPathSegList-xml-dom-synchronization2-expected.txt: Added. * svg/W3C-SVG-1.1-SE/paths-dom-02-f.svg: Added. * svg/dom/SVGPathSegList-appendItem-expected.txt: Added. * svg/dom/SVGPathSegList-appendItem.xhtml: Added. * svg/dom/SVGPathSegList-clear-and-initialize-expected.txt: Added. * svg/dom/SVGPathSegList-clear-and-initialize.xhtml: Added. * svg/dom/SVGPathSegList-cloning.html: Added. * svg/dom/SVGPathSegList-insertItemBefore-expected.txt: Added. * svg/dom/SVGPathSegList-insertItemBefore.xhtml: Added. * svg/dom/SVGPathSegList-removeItem-expected.txt: Added. * svg/dom/SVGPathSegList-removeItem.xhtml: Added. * svg/dom/SVGPathSegList-replaceItem-expected.txt: Added. * svg/dom/SVGPathSegList-replaceItem.xhtml: Added. * svg/dom/SVGPathSegList-segment-modification.svg: Added. * svg/dom/SVGPathSegList-xml-dom-synchronization-expected.txt: Added. * svg/dom/SVGPathSegList-xml-dom-synchronization.xhtml: Added. * svg/dom/SVGPathSegList-xml-dom-synchronization2.xhtml: Added. * svg/dom/fuzz-path-parser-expected.txt: * svg/dom/path-parser-expected.txt: * svg/dom/script-tests/path-parser.js: (): * svg/dom/svglist-exception-on-out-bounds-error-expected.txt: * svg/dom/svglist-exception-on-out-bounds-error.html: * svg/dom/svgpath-out-of-bounds-getPathSeg-expected.txt: Canonical link: https://commits.webkit.org/62843@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@72381 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2010-11-19 12:54:11 +00:00
<?xml version="1.0" standalone="no"?>
SVGLoad event fires too early https://bugs.webkit.org/show_bug.cgi?id=78084 Reviewed by Hajime Morita. Source/WebCore: SVGLoad event fires too early, making it impossible to use the vanilla repaint.js harness (runRepaintTest). We're using a hack called runSVGRepaintTest() at the moment in trunk, which runs runRepaintTest() from a 0ms timer, which is not reliable. The main difference between HTML onload and SVG onload is that HTMLs event is a "window event", thus dispatched through DOMWindow (eg. <body onload="alert(event.target)" will yield Document, <svg onload="alert(evt.target)"> will say SVGSVGElement). Consider: <svg onload="alert('1')> <g onload="alert('2)"> <rect onload="alert('3')"/> </svg> As soon as the <rect> finishes parsing (SVGElement::finishedParsingChildren), it's SVGLoad event is fired. So first you'll see '3', then '2', then '1'. Using: <svg onload="alert('1')> <g onload="alert('2)"> <image xlink:href="someExternal.jpg" onload="alert('3')"/> </svg> will yield the same SVGLoad order. When using <image externalREsourcesRequired="true", first the '1' will fire, then '3', then '2', all as expected and specified in SVG. http://www.w3.org/TR/SVG/interact.html#LoadEvent says: "The event is triggered at the point at which the user agent has fully parsed the element and its descendants and is ready to act appropriately upon that element, such as being ready to render the element to the target device. Referenced external resources that are required must be loaded, parsed and ready to render before the event is triggered. Optional external resources are not required to be ready for the event to be triggered." What we don't implement correctly is the second part of the first sentence: "and is ready to act appropriately upon that element, such as being ready to render the element to the target device". We currently fire the SVGLoad event, right after </svg> is seen, if no externalResourceRequired="true" attributes are set anywhere. This is not wrong, but not correct for WebKit, as we're not yet "ready to render". HTML fires its window onload event from Document::implicitClose(), where it calls Document::dispatchWindowLoadEvent. At this point we're ready to render. So I'm now aligning the timing of the outermost <svg> elements SVGLoad event, to be equal to HTML. This lets use use the repaint.js harness w/o any special SVG tricks. Covered by existing tests. * dom/Document.cpp: (WebCore::Document::implicitClose): Dispatch SVGLoad event for outermost <svg> elements from here, as HTML does for its window onload event. * svg/SVGDocumentExtensions.cpp: (WebCore::SVGDocumentExtensions::dispatchSVGLoadEventToOutermostSVGElements): Sends a SVGLoad event to all outermost <svg> elements in a document, if possible. There can be multiple ones, if using <svg><foreignObject><svg>... - the <svg> in the <fO> also acts as outermost <svg> element. * svg/SVGDocumentExtensions.h: Add new dispatchSVGLoadEventToOutermostSVGElements() helper. * svg/SVGElement.cpp: (WebCore::SVGElement::isOutermostSVGSVGElement): Moved from SVGSVGElement into SVGElement, and renamed from isOutermostSVG(). (WebCore::SVGElement::sendSVGLoadEventIfPossible): Don't dispatch load events to outermost <svg> elements, if Document::implicitClose() wasn't called yet. (WebCore::SVGElement::finishParsingChildren): Stop using the default SVGLoad dispatching logic for outermost <svg> elements. * svg/SVGElement.h: Add isOutermostSVGSVGElement(). * svg/SVGSVGElement.cpp: Rename isOutermostSVG to isOutermostSVGSVGElement. (WebCore::SVGSVGElement::currentScale): (WebCore::SVGSVGElement::setCurrentScale): (WebCore::SVGSVGElement::localCoordinateSpaceTransform): (WebCore::SVGSVGElement::createRenderer): * svg/SVGSVGElement.h: Move isOutermostSVG() to SVGElement. * svg/SVGStyledElement.cpp: (WebCore::SVGStyledElement::title): Rename isOutermostSVG to isOutermostSVGSVGElement. LayoutTests: Remove runSVGRepaintTest() from repaint.js again, and convert all *.svg tests to use runRepaintTest() directly. This is now possible as the outermost <svg> elements load event timing as aligned with HTML. * fast/repaint/resources/repaint.js: Remove runSVGRepaintTest(), it's no longer needed. (runRepaintTest): s/document.rootElement/document.documentElement/ to make it work for all HTML/XHTML and SVG documents (XHTML was broken). * platform/chromium/test_expectations.txt: * platform/mac/svg/custom/SVGPoint-matrixTransform-expected.png: * platform/mac/svg/custom/SVGPoint-matrixTransform-expected.txt: * platform/mac/svg/custom/getTransformToElement-expected.png: * platform/mac/svg/custom/getTransformToElement-expected.txt: * platform/mac/svg/custom/polyline-setattribute-points-null-expected.png: * platform/mac/svg/custom/polyline-setattribute-points-null-expected.txt: * platform/mac/svg/custom/text-ctm-expected.png: * platform/mac/svg/custom/text-ctm-expected.txt: * platform/mac/svg/custom/text-hit-test-expected.png: * platform/mac/svg/custom/text-hit-test-expected.txt: * platform/mac/svg/filters/filter-refresh-expected.png: * svg/carto.net/tabgroup.svg: * svg/carto.net/window.svg: * svg/css/shadow-changes.svg: * svg/custom/loadevents-externalresourcesrequired.svg: * svg/dom/SVGPathSegList-segment-modification.svg: * svg/dom/SVGPathSegList-xml-dom-synchronization2.xhtml: * svg/dom/SVGRectElement/rect-modify-rx.svg: * svg/filters/animate-fill.svg: * svg/filters/feImage-reference-invalidation.svg: * svg/filters/feImage-target-add-to-document.svg: * svg/filters/feImage-target-changes-id.svg: * svg/filters/feImage-target-id-change.svg: * svg/filters/feImage-target-reappend-to-document.svg: * svg/filters/feImage-target-remove-from-document.svg: * svg/filters/filter-refresh.svg: * svg/filters/filter-width-update.svg: * svg/filters/invalidate-on-child-layout.svg: * svg/hixie/perf/001.xml: * svg/hixie/perf/002.xml: * svg/hixie/perf/003.xml: * svg/hixie/perf/004.xml: * svg/hixie/perf/005.xml: * svg/hixie/perf/006.xml: * svg/hixie/perf/007.xml: * svg/repaint/container-repaint.svg: * svg/repaint/filter-child-repaint.svg: * svg/repaint/image-href-change.svg: * svg/repaint/image-with-clip-path.svg: * svg/text/text-text-05-t.svg: * svg/zoom/page/absolute-sized-document-no-scrollbars.svg: * svg/zoom/page/absolute-sized-document-scrollbars.svg: * svg/zoom/page/relative-sized-document-scrollbars.svg: * svg/zoom/page/zoom-coords-viewattr-01-b.svg: * svg/zoom/page/zoom-foreignObject.svg: * svg/zoom/page/zoom-mask-with-percentages.svg: * svg/zoom/resources/testPageZoom.js: (repaintTest): * svg/zoom/text/absolute-sized-document-no-scrollbars.svg: * svg/zoom/text/absolute-sized-document-scrollbars.svg: * svg/zoom/text/relative-sized-document-scrollbars.svg: * svg/zoom/text/zoom-coords-viewattr-01-b.svg: * svg/zoom/text/zoom-foreignObject.svg: Canonical link: https://commits.webkit.org/94969@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@107057 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-02-08 10:21:49 +00:00
<svg width="600" height="500" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" onload="runRepaintTest()">
Rewrite SVG tests to make extensive use of display() in repaint tests https://bugs.webkit.org/show_bug.cgi?id=77736 Reviewed by Andreas Kling. Convert all tests in svg/ (except svg/custom & svg/dynamic-updates) that exercise repainting to use the fast/repaint/resources/repaint.js harness, which forces a layout, and calls layoutTestController.display() before executing the actual repaint test, so that repaint rectangles are properly tracked and shown (white areas that are redrawn, on top of the gray background, painted over the web view after the initial painting). Previously SVG tests used to work like this: (using an HTML example, but it doesn't matter) <html><body><svg><rect/><script>function change() { rect.setAttribute(...); layoutTestController.notifyDone(); } setTimeout(change, 0); </script></svg></body></html> We expected that the initial painting was done, before change() as called. This is unreliable for various reasons: - the timeout is not guaranteed to fire after the document loaded, it may happen inbetween on eg. a slow connection. - nor is it guaranteed that the document has painted initially before we enter change(). This leads to the current regressions -- if we break repainting, we can't see it in the current layout tests, as the initial painting always happens after change() executed in trunk, at least on a fast machine. In order to make repaint testing reliable we have to use following scheme: <html><body onload="runRepaintTest()"><svg><rect/><script>function repaintTest() { rect.setAttribute(...); }</script></svg></body></html> runRepaintTest() is provided by the repaint.js harness and does: if (window.layoutTestController) { document.body.offsetTop; layoutTestController.display(); repaintTest(); } else { setTimeout(repaintTest, 100); } Using this harness outside of DRT allows to test SVG repainting tests in the browser as well, as the repainting changes aren't immediately fired (0ms timer) but instead delayed by 100ms, so a visual "flash" is visible, if something changes. For DRT it does two things. First it forces Document::updateLayout() to be called, and then forces the web view to paint immediately, and then it starts tracking any repaint rects, that are fired _after_ the initial painting, which are then highlighted in the pixel test dump later on. Using display() is the only way to get reliable painting results across DRT/WebKitTestRunner, and to get rid of the flakiness. All *.xml/*.html/*.htm/*.xhtml tests which excersise repainting can be moved to use runRepaintTest() from repaint.js. <body> needs to be changed to <body onload="runRepaintTest()">, and the timeouts & waitUntilDone/notifyDone calls can be removed from the tests, leading to much nicer testcases, removing lots of boilerplate. Pure *.svg tests unfortunately can't use <svg onload="runRepaintTest()"> at the moment, due timing differences between the HTML load and the SVGLoad event, that's out of scope for this bug report. To remove any hacks from the testcases themselves, I centralized following work-around in a new function in repaint.js, and let all *.svg tests use it. function runSVGRepaintTest() { if (window.layoutTestController) { layoutTestController.waitUntilDone(); setTimeout(runRepaintTest, 0); } else runRepaintTest(); } runRepaintTest() has to be called from a timer at the moment, as the SVGLoad event fires earlier as HTML load event. Before that is fixed, we have to use <svg onload="runSVGRepaintTest()"> instead of <svg onload="runRepaintTest()"> and append: layoutTestController.notifyDone() to the repaintTest() functions in the testcases. That should explain the testcase differences between pure-SVG and non-pure-SVG tests, and why I treated them differently. This approach is unfortunately as flakey as the old, so to make pure *.svg tests test repainting reliable, the bug needs to be fixed. Note that svg/custom, and svg/dynamic-updates will be fixed in another chunk, as they also require large amounts of rebaselines. * fast/repaint/resources/repaint.js: (runRepaintTest): (runSVGRepaintTest): * platform/chromium/test_expectations.txt: * platform/mac/svg/as-background-image/animated-svg-as-background-expected.png: * platform/mac/svg/as-image/animated-svg-as-image-expected.png: * platform/mac/svg/as-image/animated-svg-as-image-no-fixed-intrinsic-size-expected.png: * platform/mac/svg/as-image/animated-svg-as-image-same-image-expected.png: * platform/mac/svg/as-image/svg-image-change-content-size-expected.png: * platform/mac/svg/as-object/deep-nested-embedded-svg-size-changes-no-layout-triggers-1-expected.png: * platform/mac/svg/as-object/deep-nested-embedded-svg-size-changes-no-layout-triggers-1-expected.txt: * platform/mac/svg/as-object/deep-nested-embedded-svg-size-changes-no-layout-triggers-2-expected.png: * platform/mac/svg/as-object/deep-nested-embedded-svg-size-changes-no-layout-triggers-2-expected.txt: * platform/mac/svg/as-object/embedded-svg-immediate-offsetWidth-query-expected.png: * platform/mac/svg/as-object/embedded-svg-size-changes-expected.png: * platform/mac/svg/as-object/embedded-svg-size-changes-no-layout-triggers-expected.png: * platform/mac/svg/as-object/embedded-svg-size-changes-no-layout-triggers-expected.txt: * platform/mac/svg/as-object/nested-embedded-svg-size-changes-expected.png: * platform/mac/svg/as-object/nested-embedded-svg-size-changes-no-layout-triggers-1-expected.png: * platform/mac/svg/as-object/nested-embedded-svg-size-changes-no-layout-triggers-1-expected.txt: * platform/mac/svg/as-object/nested-embedded-svg-size-changes-no-layout-triggers-2-expected.png: * platform/mac/svg/as-object/nested-embedded-svg-size-changes-no-layout-triggers-2-expected.txt: * platform/mac/svg/carto.net/tabgroup-expected.png: * platform/mac/svg/carto.net/tabgroup-expected.txt: * platform/mac/svg/carto.net/window-expected.png: * platform/mac/svg/carto.net/window-expected.txt: * platform/mac/svg/css/shadow-changes-expected.png: * platform/mac/svg/dom/SVGPathSegList-segment-modification-expected.png: * platform/mac/svg/dom/SVGPathSegList-segment-modification-expected.txt: * platform/mac/svg/dom/SVGPathSegList-xml-dom-synchronization-expected.png: * platform/mac/svg/dom/SVGPathSegList-xml-dom-synchronization2-expected.png: * platform/mac/svg/dom/SVGRectElement/rect-modify-rx-expected.png: * platform/mac/svg/filters/filter-refresh-expected.png: * platform/mac/svg/filters/filter-width-update-expected.png: * platform/mac/svg/filters/filter-width-update-expected.txt: * platform/mac/svg/filters/invalidate-on-child-layout-expected.png: * platform/mac/svg/hixie/perf/001-expected.png: * platform/mac/svg/hixie/perf/002-expected.png: * platform/mac/svg/hixie/perf/003-expected.png: * platform/mac/svg/hixie/perf/003-expected.txt: * platform/mac/svg/hixie/perf/004-expected.png: * platform/mac/svg/hixie/perf/004-expected.txt: * platform/mac/svg/hixie/perf/005-expected.png: * platform/mac/svg/hixie/perf/005-expected.txt: * platform/mac/svg/hixie/perf/006-expected.png: * platform/mac/svg/hixie/perf/006-expected.txt: * platform/mac/svg/hixie/perf/007-expected.png: * platform/mac/svg/hixie/perf/007-expected.txt: * platform/mac/svg/repaint/filter-child-repaint-expected.png: * platform/mac/svg/repaint/image-href-change-expected.png: * platform/mac/svg/repaint/image-with-clip-path-expected.png: * platform/mac/svg/text/append-text-node-to-tspan-expected.png: * platform/mac/svg/text/modify-text-node-in-tspan-expected.png: * platform/mac/svg/text/remove-text-node-from-tspan-expected.png: * platform/mac/svg/text/remove-tspan-from-text-expected.png: * platform/mac/svg/text/text-text-05-t-expected.png: * platform/mac/svg/text/text-text-05-t-expected.txt: * platform/mac/svg/transforms/animated-path-inside-transformed-html-expected.png: * platform/mac/svg/zoom/page/absolute-sized-document-no-scrollbars-expected.png: * platform/mac/svg/zoom/page/relative-sized-document-scrollbars-expected.png: * platform/mac/svg/zoom/page/zoom-background-images-expected.txt: * platform/mac/svg/zoom/page/zoom-foreignObject-expected.png: * platform/mac/svg/zoom/page/zoom-hixie-mixed-008-expected.txt: * platform/mac/svg/zoom/page/zoom-hixie-rendering-model-004-expected.png: * platform/mac/svg/zoom/page/zoom-hixie-rendering-model-004-expected.txt: * platform/mac/svg/zoom/page/zoom-mask-with-percentages-expected.png: * platform/mac/svg/zoom/page/zoom-svg-as-background-with-relative-size-and-viewBox-expected.png: * platform/mac/svg/zoom/page/zoom-svg-as-background-with-relative-size-expected.png: * platform/mac/svg/zoom/page/zoom-svg-as-image-expected.png: * platform/mac/svg/zoom/page/zoom-svg-as-object-expected.png: * platform/mac/svg/zoom/page/zoom-svg-as-relative-image-expected.png: * platform/mac/svg/zoom/page/zoom-svg-through-object-with-auto-size-expected.txt: * platform/mac/svg/zoom/page/zoom-svg-through-object-with-override-size-expected.txt: * platform/mac/svg/zoom/text/absolute-sized-document-no-scrollbars-expected.png: * platform/mac/svg/zoom/text/absolute-sized-document-scrollbars-expected.png: * platform/mac/svg/zoom/text/relative-sized-document-scrollbars-expected.png: * platform/mac/svg/zoom/text/zoom-foreignObject-expected.png: * platform/mac/svg/zoom/text/zoom-hixie-mixed-008-expected.png: * platform/mac/svg/zoom/text/zoom-hixie-mixed-008-expected.txt: * platform/mac/svg/zoom/text/zoom-hixie-mixed-009-expected.png: * platform/mac/svg/zoom/text/zoom-hixie-rendering-model-004-expected.png: * platform/mac/svg/zoom/text/zoom-hixie-rendering-model-004-expected.txt: * svg/as-background-image/animated-svg-as-background.html: * svg/as-background-image/resources/animated-rect-relative-size.svg: * svg/as-background-image/svg-as-background-5.html: * svg/as-background-image/svg-background-partial-redraw.html: * svg/as-image/animated-svg-as-image-no-fixed-intrinsic-size.html: * svg/as-image/animated-svg-as-image-same-image.html: * svg/as-image/animated-svg-as-image.html: * svg/as-image/resources/animated-rect-fixed-size-2.svg: Copied from LayoutTests/svg/as-image/resources/animated-rect-same-image.svg. * svg/as-image/resources/animated-rect-fixed-size.svg: * svg/as-image/resources/animated-rect-relative-size.svg: * svg/as-image/resources/animated-rect-same-image.svg: * svg/as-image/svg-image-change-content-size.xhtml: * svg/as-object/embedded-svg-immediate-offsetWidth-query.html: * svg/as-object/embedded-svg-size-changes-no-layout-triggers.html: * svg/as-object/embedded-svg-size-changes.html: * svg/as-object/nested-embedded-svg-size-changes-no-layout-triggers-1.html: * svg/as-object/nested-embedded-svg-size-changes-no-layout-triggers-2.html: * svg/as-object/nested-embedded-svg-size-changes.html: * svg/as-object/resources/embedded-svg-size-changes-no-layout-triggers.svg: * svg/as-object/resources/nested-embedded-svg-size-changes-target-no-layout-triggers-1.html: * svg/carto.net/tabgroup.svg: * svg/carto.net/window.svg: * svg/css/shadow-changes.svg: * svg/dom/SVGPathSegList-segment-modification.svg: * svg/dom/SVGPathSegList-xml-dom-synchronization.xhtml: * svg/dom/SVGPathSegList-xml-dom-synchronization2.xhtml: * svg/dom/SVGRectElement/rect-modify-rx.svg: * svg/filters/animate-fill-expected.png: * svg/filters/animate-fill.svg: * svg/filters/feImage-reference-invalidation-expected.png: * svg/filters/feImage-reference-invalidation.svg: * svg/filters/feImage-target-add-to-document-expected.png: * svg/filters/feImage-target-add-to-document.svg: * svg/filters/feImage-target-changes-id-expected.png: * svg/filters/feImage-target-changes-id.svg: * svg/filters/feImage-target-id-change-expected.png: * svg/filters/feImage-target-id-change.svg: * svg/filters/feImage-target-reappend-to-document-expected.png: * svg/filters/feImage-target-reappend-to-document.svg: * svg/filters/feImage-target-remove-from-document-expected.png: * svg/filters/feImage-target-remove-from-document.svg: * svg/filters/filter-refresh.svg: * svg/filters/filter-width-update.svg: * svg/filters/invalidate-on-child-layout.svg: * svg/hixie/perf/001.xml: * svg/hixie/perf/002.xml: * svg/hixie/perf/003.xml: * svg/hixie/perf/004.xml: * svg/hixie/perf/005.xml: * svg/hixie/perf/006.xml: * svg/hixie/perf/007.xml: * svg/hixie/perf/resources/smallcats.gif: Added. * svg/repaint/container-repaint-expected.png: * svg/repaint/container-repaint.svg: * svg/repaint/filter-child-repaint.svg: * svg/repaint/image-href-change.svg: * svg/repaint/image-with-clip-path.svg: * svg/text/append-text-node-to-tspan.html: * svg/text/modify-text-node-in-tspan.html: * svg/text/remove-text-node-from-tspan.html: * svg/text/remove-tspan-from-text.html: * svg/text/text-text-05-t.svg: * svg/transforms/animated-path-inside-transformed-html.xhtml: * svg/zoom/page/absolute-sized-document-no-scrollbars.svg: * svg/zoom/page/absolute-sized-document-scrollbars.svg: * svg/zoom/page/relative-sized-document-scrollbars.svg: * svg/zoom/page/zoom-background-image-tiled.html: * svg/zoom/page/zoom-background-images.html: * svg/zoom/page/zoom-coords-viewattr-01-b.svg: * svg/zoom/page/zoom-foreignObject.svg: * svg/zoom/page/zoom-getBoundingClientRect.xhtml: * svg/zoom/page/zoom-hixie-mixed-008.xml: * svg/zoom/page/zoom-hixie-mixed-009.xml: * svg/zoom/page/zoom-hixie-rendering-model-004.xhtml: * svg/zoom/page/zoom-img-preserveAspectRatio-support-1.html: * svg/zoom/page/zoom-mask-with-percentages.svg: * svg/zoom/page/zoom-replaced-intrinsic-ratio-001.htm: * svg/zoom/page/zoom-svg-as-background-with-relative-size-and-viewBox.html: * svg/zoom/page/zoom-svg-as-background-with-relative-size.html: * svg/zoom/page/zoom-svg-as-image.html: * svg/zoom/page/zoom-svg-as-object.html: * svg/zoom/page/zoom-svg-as-relative-image.html: * svg/zoom/page/zoom-svg-float-border-padding.xml: * svg/zoom/page/zoom-svg-through-object-with-absolute-size-2.xhtml: * svg/zoom/page/zoom-svg-through-object-with-absolute-size.xhtml: * svg/zoom/page/zoom-svg-through-object-with-auto-size.html: * svg/zoom/page/zoom-svg-through-object-with-huge-size.xhtml: * svg/zoom/page/zoom-svg-through-object-with-override-size.html: * svg/zoom/page/zoom-svg-through-object-with-percentage-size.xhtml: * svg/zoom/page/zoom-svg-through-object-with-text.xhtml-disabled: * svg/zoom/page/zoom-zoom-coords.xhtml: * svg/zoom/resources/testPageZoom.js: (repaintTest): * svg/zoom/resources/testTextZoom.js: (repaintTest): * svg/zoom/text/absolute-sized-document-no-scrollbars.svg: * svg/zoom/text/absolute-sized-document-scrollbars.svg: * svg/zoom/text/relative-sized-document-scrollbars.svg: * svg/zoom/text/zoom-coords-viewattr-01-b.svg: * svg/zoom/text/zoom-foreignObject.svg: * svg/zoom/text/zoom-hixie-mixed-008.xml: * svg/zoom/text/zoom-hixie-mixed-009.xml: * svg/zoom/text/zoom-hixie-rendering-model-004.xhtml: * svg/zoom/text/zoom-svg-float-border-padding.xml: Canonical link: https://commits.webkit.org/94836@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@106918 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-02-07 11:19:19 +00:00
<script xlink:href="../../fast/repaint/resources/repaint.js"></script>
2010-11-19 Nikolas Zimmermann <nzimmermann@rim.com> Reviewed by Dirk Schulze. Convert SVGPathSeg/SVGPathSegList to the new SVGPropertyTearOff concept https://bugs.webkit.org/show_bug.cgi?id=49580 SVGPathElement.cloneNode loses generated pathSegList https://bugs.webkit.org/show_bug.cgi?id=43388 SVG Path elements are not correctly updated through pathSegList manipulation on relative values https://bugs.webkit.org/show_bug.cgi?id=30219 Changing an SVGPathSeg does not update a following Smooth Cubic Curveto https://bugs.webkit.org/show_bug.cgi?id=19741 SVGPathElement should only build SVGPathSeg* list on demand https://bugs.webkit.org/show_bug.cgi?id=10827 Tests: svg/W3C-SVG-1.1-SE/paths-dom-02-f.svg svg/dom/SVGPathSegList-appendItem.xhtml svg/dom/SVGPathSegList-clear-and-initialize.xhtml svg/dom/SVGPathSegList-cloning.html svg/dom/SVGPathSegList-insertItemBefore.xhtml svg/dom/SVGPathSegList-removeItem.xhtml svg/dom/SVGPathSegList-replaceItem.xhtml svg/dom/SVGPathSegList-xml-dom-synchronization.xhtml svg/dom/SVGPathSegList-xml-dom-synchronization2.xhtml svg/dom/SVGPathSegList-segment-modification.svg Convert SVGPathSeg*/SVGPathSegList to the new SVG(Animated)PropertyTearOff concept. Unlike all other SVG* types that use the SVGPropertyTearOff concept, SVGPathSegs are already refcounted, and don't need to be wrapped in SVGPropertyTearOff objects. The consequence is that SVGPathSegs need to track themselves to which list and path element they belong. Introduce new SVGAnimatedPathSegListPropertyTearOff and SVGPathSegListPropertyTearOff classes, that encapsulate the special needed for SVGPathSegList. Each SVGPathSeg now needs to store a RefPtr<SVGPathElement> - this makes it impossible to use SVGPathSegList to represent the 'd' attribute internally in SVGPathElement. SVGPathSegList is now only used in the SVG DOM bindings if someone explicitely requests 'pathElement.pathSegList' (eg. via JS). Switch to use SVGPathByteStream to store the 'd' attribute data in SVGPathElement, which is much more compact, and less memory intensive. Dirk already prepared SVGPathParserFactory some months ago, which allows easy conversion between String/Path/SVGPathSegList/SVGPathByteStream in all directions, including normalizing the lists, when requested. As consequence SVGPathSegList is now only built on demand, when explicitely requested. Using the SVGAnimatedProperty concept gives us 'd' attribute <-> SVGPathSegList synchronization for free, fixing several bugs, listed above. * Android.mk: Remove obsolete SVGPathSeg*.cpp files and SVGAnimatedPathData.cpp from build. * CMakeLists.txt: Ditto. * DerivedSources.make: Remove SVGAnimatedPathData IDL generation. * GNUmakefile.am: Remove obsolete SVGPathSeg*.cpp files and SVGAnimatedPathData.cpp from build. * WebCore.gyp/WebCore.gyp: Remove SVGAnimatedPathData IDL generation. * WebCore.gypi: Remove obsolete SVGPathSeg*.cpp files and SVGAnimatedPathData.cpp from build. * WebCore.order: Remove no-longer existant SVGAnimatedPathData symbols. * WebCore.pro: Remove obsolete SVGPathSeg*.cpp files and SVGAnimatedPathData.cpp / JSSVGPathSegCustom.* from build. * WebCore.vcproj/WebCore.vcproj: Ditto. * WebCore.xcodeproj/project.pbxproj: Ditto. * bindings/js/JSBindingsAllInOne.cpp: Remove JSSVGPathSegCustom.cpp from build. * bindings/js/JSDOMBinding.cpp: Adapt to toJS() changes, remove context parameter. (WebCore::setDOMException): * bindings/js/JSDOMBinding.h: Remove obsolete CREATE_SVG_OBJECT_WRAPPER macro, the context parameter is not existant anymore. * bindings/js/JSSVGPathSegCustom.cpp: Replace CREATE_SVG_OBJECT_WRAPPER by CREATE_DOM_OBJECT_WRAPPER. Remove context parameter/handling. (WebCore::toJS): * bindings/js/JSSVGPathSegListCustom.cpp: Removed. * bindings/scripts/CodeGenerator.pm: Map 'SVGPathSegList' IDL type to SVG 'SVGPathSegListPropertyTearOff' native type. * bindings/scripts/CodeGeneratorJS.pm: Remove IsSVGTypeNeedingContextParameter() methods and usages. Handle SVGPathSegListPropertyTearOff. * bindings/scripts/CodeGeneratorObjC.pm: Handle SVGPathSegListPropertyTearOff. * bindings/scripts/CodeGeneratorV8.pm: Remove IsSVGTypeNeedingContextParameter() methods and usages. * rendering/SVGRenderTreeAsText.cpp: Build path string from byte stream, not path segment list. (WebCore::operator<<): * svg/SVGAllInOne.cpp: Remove obsolete cpp files. * svg/SVGAnimatedPathData.cpp: Removed. * svg/SVGAnimatedPathData.h: Removed. * svg/SVGAnimatedPathData.idl: Removed. * svg/SVGPathElement.cpp: Build SVGPathList on demand. Use SVGPathByteStream to parse/store the 'd' attribute content. (WebCore::SVGPathElement::SVGPathElement): (WebCore::SVGPathElement::getPathSegAtLength): Use SVGPathByteStream, not SVGPathSegList to determine the getPathSegAtLength() information. (WebCore::SVGPathElement::createSVGPathSegClosePath): Pass SVGPathElement to SVGPathSeg and a SVGPathSegRole parameter and store it to track the list origin. (WebCore::SVGPathElement::createSVGPathSegMovetoAbs): Ditto. (WebCore::SVGPathElement::createSVGPathSegMovetoRel): Ditto. (WebCore::SVGPathElement::createSVGPathSegLinetoAbs): Ditto. (WebCore::SVGPathElement::createSVGPathSegLinetoRel): Ditto. (WebCore::SVGPathElement::createSVGPathSegCurvetoCubicAbs): Ditto. (WebCore::SVGPathElement::createSVGPathSegCurvetoCubicRel): Ditto. (WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticAbs): Ditto. (WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticRel): Ditto. (WebCore::SVGPathElement::createSVGPathSegArcAbs): Ditto. (WebCore::SVGPathElement::createSVGPathSegArcRel): Ditto. (WebCore::SVGPathElement::createSVGPathSegLinetoHorizontalAbs): Ditto. (WebCore::SVGPathElement::createSVGPathSegLinetoHorizontalRel): Ditto. (WebCore::SVGPathElement::createSVGPathSegLinetoVerticalAbs): Ditto. (WebCore::SVGPathElement::createSVGPathSegLinetoVerticalRel): Ditto. (WebCore::SVGPathElement::createSVGPathSegCurvetoCubicSmoothAbs): Ditto. (WebCore::SVGPathElement::createSVGPathSegCurvetoCubicSmoothRel): Ditto. (WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticSmoothAbs): Ditto. (WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticSmoothRel): Ditto. (WebCore::SVGPathElement::parseMappedAttribute): Build SVGPathByteStream from 'd' attribute, not a SVGPathSegList. (WebCore::SVGPathElement::svgAttributeChanged): If a SVGPathSegList object has been built, synchronize it with the 'd' attribute. (WebCore::SVGPathElement::synchronizeProperty): Synchronize 'd' attribute with the SVGPathSegList, if needed. (WebCore::SVGPathElement::synchronizeD): Added. (WebCore::SVGPathElement::pathSegList): Use same trick as in SVGPolyElement to expose the 'pathSegList' / 'animatedPathSegList' object to the SVG DOM bindings. (WebCore::SVGPathElement::normalizedPathSegList): Ditto. (WebCore::SVGPathElement::animatedPathSegList): Ditto. (WebCore::SVGPathElement::animatedNormalizedPathSegList): Ditto. (WebCore::SVGPathElement::toPathData): Build 'Path' object from SVGPathByteStream, not from SVGPathSegList. (WebCore::SVGPathElement::pathSegListChanged): Used to synchronize the SVGPathSegLists and the d attribute, as well as any changes from any SVGPathSeg associated with this SVGPathElement. * svg/SVGPathElement.h: Add new accessors... (WebCore::SVGPathElement::pathByteStream): ... needed by SVGRenderTreeAsText. (WebCore::SVGPathElement::animatablePathSegList): ... needed by SVGPathSegListPropertyTearOff. * svg/SVGPathElement.idl: Merge SVGAnimatedPathData interface into SVGPathElement. * svg/SVGPathParserFactory.cpp: Cleanup SVGPathParserFactory, remove obsolete methods, now that SVGPathElement switched to using SVGPathByteStream internally. (WebCore::globalSVGPathSegListBuilder): (WebCore::SVGPathParserFactory::buildSVGPathByteStreamFromSVGPathSegList): (WebCore::SVGPathParserFactory::buildPathFromByteStream): (WebCore::SVGPathParserFactory::buildSVGPathSegListFromByteStream): (WebCore::SVGPathParserFactory::buildStringFromSVGPathSegList): (WebCore::SVGPathParserFactory::buildSVGPathByteStreamFromString): (WebCore::SVGPathParserFactory::buildAnimatedSVGPathByteStream): (WebCore::SVGPathParserFactory::getSVGPathSegAtLengthFromSVGPathByteStream): * svg/SVGPathParserFactory.h: * svg/SVGPathSeg.cpp: Removed. * svg/SVGPathSeg.h: Add new SVGPathSegRole enum, identifying to which list a path segment belongs. (WebCore::SVGPathSeg::SVGPathSeg): * svg/SVGPathSeg.idl: Reindented. * svg/SVGPathSegArc.cpp: Removed. * svg/SVGPathSegArc.h: All setters now call the commitChange() method. * svg/SVGPathSegArcAbs.idl: Enable StrictTypeChecking. * svg/SVGPathSegArcRel.idl: Ditto. * svg/SVGPathSegClosePath.cpp: Removed. * svg/SVGPathSegClosePath.h: * svg/SVGPathSegCurvetoCubic.cpp: Removed. * svg/SVGPathSegCurvetoCubic.h: All setters now call the commitChange() method. * svg/SVGPathSegCurvetoCubicAbs.idl: Enable StrictTypeChecking. * svg/SVGPathSegCurvetoCubicRel.idl: Ditto. * svg/SVGPathSegCurvetoCubicSmooth.cpp: Removed. * svg/SVGPathSegCurvetoCubicSmooth.h: All setters now call the commitChange() method. * svg/SVGPathSegCurvetoCubicSmoothAbs.idl: Enable StrictTypeChecking. * svg/SVGPathSegCurvetoCubicSmoothRel.idl: Ditto. * svg/SVGPathSegCurvetoQuadratic.cpp: Removed. * svg/SVGPathSegCurvetoQuadratic.h: All setters now call the commitChange() method. * svg/SVGPathSegCurvetoQuadraticAbs.idl: Enable StrictTypeChecking. * svg/SVGPathSegCurvetoQuadraticRel.idl: Ditto. * svg/SVGPathSegCurvetoQuadraticSmooth.cpp: Removed. * svg/SVGPathSegCurvetoQuadraticSmooth.h: All setters now call the commitChange() method. * svg/SVGPathSegCurvetoQuadraticSmoothAbs.idl: Enable StrictTypeChecking. * svg/SVGPathSegCurvetoQuadraticSmoothRel.idl: Ditto. * svg/SVGPathSegLineto.cpp: Removed. * svg/SVGPathSegLineto.h: All setters now call the commitChange() method. * svg/SVGPathSegLinetoAbs.idl: Enable StrictTypeChecking. * svg/SVGPathSegLinetoHorizontal.cpp: Removed. * svg/SVGPathSegLinetoHorizontal.h: All setters now call the commitChange() method. * svg/SVGPathSegLinetoHorizontalAbs.idl: Enable StrictTypeChecking. * svg/SVGPathSegLinetoHorizontalRel.idl: Ditto. * svg/SVGPathSegLinetoRel.idl: Enable StrictTypeChecking. * svg/SVGPathSegLinetoVertical.cpp: Removed. * svg/SVGPathSegLinetoVertical.h: All setters now call the commitChange() method. * svg/SVGPathSegLinetoVerticalAbs.idl: Enable StrictTypeChecking. * svg/SVGPathSegLinetoVerticalRel.idl: Ditto. * svg/SVGPathSegList.cpp: Switch from SVGList<RefPtr<SVGPathSeg> > to a plain Vector<RefPtr<SVGPathSeg> >. (WebCore::SVGPathSegList::valueAsString): Utilize SVGPathParserFactory to build a String from a SVGPathSegList. (WebCore::SVGPathSegList::commitChange): Call SVGPathElement::pathSegListChanged(). * svg/SVGPathSegList.h: (WebCore::SVGPathSegList::SVGPathSegList): * svg/SVGPathSegList.idl: Remove [JSCCustom] flags, no longer needed. * svg/SVGPathSegListBuilder.cpp: Adapt to SVGPathSegList API changes. (WebCore::SVGPathSegListBuilder::SVGPathSegListBuilder): (WebCore::SVGPathSegListBuilder::moveTo): (WebCore::SVGPathSegListBuilder::lineTo): (WebCore::SVGPathSegListBuilder::lineToHorizontal): (WebCore::SVGPathSegListBuilder::lineToVertical): (WebCore::SVGPathSegListBuilder::curveToCubic): (WebCore::SVGPathSegListBuilder::curveToCubicSmooth): (WebCore::SVGPathSegListBuilder::curveToQuadratic): (WebCore::SVGPathSegListBuilder::curveToQuadraticSmooth): (WebCore::SVGPathSegListBuilder::arcTo): (WebCore::SVGPathSegListBuilder::closePath): * svg/SVGPathSegListBuilder.h: Ditto. (WebCore::SVGPathSegListBuilder::setCurrentSVGPathElement): (WebCore::SVGPathSegListBuilder::setCurrentSVGPathSegList): (WebCore::SVGPathSegListBuilder::setCurrentSVGPathSegRole): (WebCore::SVGPathSegListBuilder::cleanup): * svg/SVGPathSegListSource.cpp: Ditto. (WebCore::SVGPathSegListSource::SVGPathSegListSource): (WebCore::SVGPathSegListSource::parseSVGSegmentType): (WebCore::SVGPathSegListSource::nextCommand): (WebCore::SVGPathSegListSource::parseMoveToSegment): (WebCore::SVGPathSegListSource::parseLineToSegment): (WebCore::SVGPathSegListSource::parseCurveToQuadraticSmoothSegment): * svg/SVGPathSegListSource.h: Ditto. (WebCore::SVGPathSegListSource::create): * svg/SVGPathSegMoveto.cpp: Removed. * svg/SVGPathSegMoveto.h: All setters now call the commitChange() method. * svg/SVGPathSegMovetoAbs.idl: Enable StrictTypeChecking. * svg/SVGPathSegMovetoRel.idl: Ditto. * svg/SVGPathSegWithContext.h: Added. This is the new base class for all SVGPathSeg derived types, that's associated with a SVGPathElement and a 'role' (normalized/unaltered segment list). (WebCore::SVGPathSegWithContext::SVGPathSegWithContext): (WebCore::SVGPathSegWithContext::animatedProperty): (WebCore::SVGPathSegWithContext::setContextAndRole): (WebCore::SVGPathSegWithContext::commitChange): (WebCore::SVGPathSegSingleCoordinate::x): (WebCore::SVGPathSegSingleCoordinate::setX): (WebCore::SVGPathSegSingleCoordinate::y): (WebCore::SVGPathSegSingleCoordinate::setY): (WebCore::SVGPathSegSingleCoordinate::SVGPathSegSingleCoordinate): * svg/properties/SVGAnimatedPathSegListPropertyTearOff.h: Added. (WebCore::SVGAnimatedPathSegListPropertyTearOff::baseVal): (WebCore::SVGAnimatedPathSegListPropertyTearOff::animVal): (WebCore::SVGAnimatedPathSegListPropertyTearOff::removeItemFromList): (WebCore::SVGAnimatedPathSegListPropertyTearOff::create): (WebCore::SVGAnimatedPathSegListPropertyTearOff::SVGAnimatedPathSegListPropertyTearOff): * svg/properties/SVGPathSegListPropertyTearOff.cpp: Added. (WebCore::SVGPathSegListPropertyTearOff::clear): Added in the cpp file, not in the header, as it needs access to SVGPathSegWithContext, which we can't include from the header. (WebCore::SVGPathSegListPropertyTearOff::getItem): Ditto. (WebCore::SVGPathSegListPropertyTearOff::removeItem): Ditto. (WebCore::SVGPathSegListPropertyTearOff::contextElement): Needs access to SVGPathElement, that's why it lives in the cpp file. (WebCore::SVGPathSegListPropertyTearOff::processIncomingListItemValue): Needs access to SVGPathSegWithContext. * svg/properties/SVGPathSegListPropertyTearOff.h: Added. (WebCore::SVGPathSegListPropertyTearOff::create): (WebCore::SVGPathSegListPropertyTearOff::removeItemFromList): (WebCore::SVGPathSegListPropertyTearOff::numberOfItems): (WebCore::SVGPathSegListPropertyTearOff::initialize): (WebCore::SVGPathSegListPropertyTearOff::insertItemBefore): (WebCore::SVGPathSegListPropertyTearOff::replaceItem): (WebCore::SVGPathSegListPropertyTearOff::appendItem): (WebCore::SVGPathSegListPropertyTearOff::SVGPathSegListPropertyTearOff): (WebCore::SVGPathSegListPropertyTearOff::commitChange): (WebCore::SVGPathSegListPropertyTearOff::processIncomingListItemWrapper): 2010-11-19 Nikolas Zimmermann <nzimmermann@rim.com> Reviewed by Dirk Schulze. Convert SVGPathSeg/SVGPathSegList to the new SVGPropertyTearOff concept https://bugs.webkit.org/show_bug.cgi?id=49580 Add several new tests covering SVGPathSegList usage. * platform/mac/svg/W3C-SVG-1.1-SE/paths-dom-02-f-expected.checksum: Added. * platform/mac/svg/W3C-SVG-1.1-SE/paths-dom-02-f-expected.png: Added. * platform/mac/svg/W3C-SVG-1.1-SE/paths-dom-02-f-expected.txt: Added. * platform/mac/svg/custom/svg-curve-with-relative-cordinates-expected.txt: * platform/mac/svg/dom/SVGPathSegList-appendItem-expected.checksum: Added. * platform/mac/svg/dom/SVGPathSegList-appendItem-expected.png: Added. * platform/mac/svg/dom/SVGPathSegList-clear-and-initialize-expected.checksum: Added. * platform/mac/svg/dom/SVGPathSegList-clear-and-initialize-expected.png: Added. * platform/mac/svg/dom/SVGPathSegList-cloning-expected.checksum: Added. * platform/mac/svg/dom/SVGPathSegList-cloning-expected.png: Added. * platform/mac/svg/dom/SVGPathSegList-cloning-expected.txt: Added. * platform/mac/svg/dom/SVGPathSegList-insertItemBefore-expected.checksum: Added. * platform/mac/svg/dom/SVGPathSegList-insertItemBefore-expected.png: Added. * platform/mac/svg/dom/SVGPathSegList-removeItem-expected.checksum: Added. * platform/mac/svg/dom/SVGPathSegList-removeItem-expected.png: Added. * platform/mac/svg/dom/SVGPathSegList-replaceItem-expected.checksum: Added. * platform/mac/svg/dom/SVGPathSegList-replaceItem-expected.png: Added. * platform/mac/svg/dom/SVGPathSegList-segment-modification-expected.checksum: Added. * platform/mac/svg/dom/SVGPathSegList-segment-modification-expected.png: Added. * platform/mac/svg/dom/SVGPathSegList-segment-modification-expected.txt: Added. * platform/mac/svg/dom/SVGPathSegList-xml-dom-synchronization-expected.checksum: Added. * platform/mac/svg/dom/SVGPathSegList-xml-dom-synchronization-expected.png: Added. * platform/mac/svg/dom/SVGPathSegList-xml-dom-synchronization2-expected.checksum: Added. * platform/mac/svg/dom/SVGPathSegList-xml-dom-synchronization2-expected.png: Added. * platform/mac/svg/dom/SVGPathSegList-xml-dom-synchronization2-expected.txt: Added. * svg/W3C-SVG-1.1-SE/paths-dom-02-f.svg: Added. * svg/dom/SVGPathSegList-appendItem-expected.txt: Added. * svg/dom/SVGPathSegList-appendItem.xhtml: Added. * svg/dom/SVGPathSegList-clear-and-initialize-expected.txt: Added. * svg/dom/SVGPathSegList-clear-and-initialize.xhtml: Added. * svg/dom/SVGPathSegList-cloning.html: Added. * svg/dom/SVGPathSegList-insertItemBefore-expected.txt: Added. * svg/dom/SVGPathSegList-insertItemBefore.xhtml: Added. * svg/dom/SVGPathSegList-removeItem-expected.txt: Added. * svg/dom/SVGPathSegList-removeItem.xhtml: Added. * svg/dom/SVGPathSegList-replaceItem-expected.txt: Added. * svg/dom/SVGPathSegList-replaceItem.xhtml: Added. * svg/dom/SVGPathSegList-segment-modification.svg: Added. * svg/dom/SVGPathSegList-xml-dom-synchronization-expected.txt: Added. * svg/dom/SVGPathSegList-xml-dom-synchronization.xhtml: Added. * svg/dom/SVGPathSegList-xml-dom-synchronization2.xhtml: Added. * svg/dom/fuzz-path-parser-expected.txt: * svg/dom/path-parser-expected.txt: * svg/dom/script-tests/path-parser.js: (): * svg/dom/svglist-exception-on-out-bounds-error-expected.txt: * svg/dom/svglist-exception-on-out-bounds-error.html: * svg/dom/svgpath-out-of-bounds-getPathSeg-expected.txt: Canonical link: https://commits.webkit.org/62843@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@72381 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2010-11-19 12:54:11 +00:00
<path d="M50,150 l45,-43 l24,64 l-69,-21z" fill="#FF0000" stroke="#000000" stroke-width="5"/>
<text x="10" y="20" style="font-weight:bold">Right after loading, a segment is added to the path.</text>
<text x="10" y="40" style="font-weight:bold">The path and its attribute should be updated to include the new segment.</text>
<text x="10" y="70">"d" initial: </text>
<text id="d_start" x="90" y="70"></text>
<text x="10" y="90">"d" after: </text>
<text id="d_end" x="90" y="90"></text>
Rewrite SVG tests to make extensive use of display() in repaint tests https://bugs.webkit.org/show_bug.cgi?id=77736 Reviewed by Andreas Kling. Convert all tests in svg/ (except svg/custom & svg/dynamic-updates) that exercise repainting to use the fast/repaint/resources/repaint.js harness, which forces a layout, and calls layoutTestController.display() before executing the actual repaint test, so that repaint rectangles are properly tracked and shown (white areas that are redrawn, on top of the gray background, painted over the web view after the initial painting). Previously SVG tests used to work like this: (using an HTML example, but it doesn't matter) <html><body><svg><rect/><script>function change() { rect.setAttribute(...); layoutTestController.notifyDone(); } setTimeout(change, 0); </script></svg></body></html> We expected that the initial painting was done, before change() as called. This is unreliable for various reasons: - the timeout is not guaranteed to fire after the document loaded, it may happen inbetween on eg. a slow connection. - nor is it guaranteed that the document has painted initially before we enter change(). This leads to the current regressions -- if we break repainting, we can't see it in the current layout tests, as the initial painting always happens after change() executed in trunk, at least on a fast machine. In order to make repaint testing reliable we have to use following scheme: <html><body onload="runRepaintTest()"><svg><rect/><script>function repaintTest() { rect.setAttribute(...); }</script></svg></body></html> runRepaintTest() is provided by the repaint.js harness and does: if (window.layoutTestController) { document.body.offsetTop; layoutTestController.display(); repaintTest(); } else { setTimeout(repaintTest, 100); } Using this harness outside of DRT allows to test SVG repainting tests in the browser as well, as the repainting changes aren't immediately fired (0ms timer) but instead delayed by 100ms, so a visual "flash" is visible, if something changes. For DRT it does two things. First it forces Document::updateLayout() to be called, and then forces the web view to paint immediately, and then it starts tracking any repaint rects, that are fired _after_ the initial painting, which are then highlighted in the pixel test dump later on. Using display() is the only way to get reliable painting results across DRT/WebKitTestRunner, and to get rid of the flakiness. All *.xml/*.html/*.htm/*.xhtml tests which excersise repainting can be moved to use runRepaintTest() from repaint.js. <body> needs to be changed to <body onload="runRepaintTest()">, and the timeouts & waitUntilDone/notifyDone calls can be removed from the tests, leading to much nicer testcases, removing lots of boilerplate. Pure *.svg tests unfortunately can't use <svg onload="runRepaintTest()"> at the moment, due timing differences between the HTML load and the SVGLoad event, that's out of scope for this bug report. To remove any hacks from the testcases themselves, I centralized following work-around in a new function in repaint.js, and let all *.svg tests use it. function runSVGRepaintTest() { if (window.layoutTestController) { layoutTestController.waitUntilDone(); setTimeout(runRepaintTest, 0); } else runRepaintTest(); } runRepaintTest() has to be called from a timer at the moment, as the SVGLoad event fires earlier as HTML load event. Before that is fixed, we have to use <svg onload="runSVGRepaintTest()"> instead of <svg onload="runRepaintTest()"> and append: layoutTestController.notifyDone() to the repaintTest() functions in the testcases. That should explain the testcase differences between pure-SVG and non-pure-SVG tests, and why I treated them differently. This approach is unfortunately as flakey as the old, so to make pure *.svg tests test repainting reliable, the bug needs to be fixed. Note that svg/custom, and svg/dynamic-updates will be fixed in another chunk, as they also require large amounts of rebaselines. * fast/repaint/resources/repaint.js: (runRepaintTest): (runSVGRepaintTest): * platform/chromium/test_expectations.txt: * platform/mac/svg/as-background-image/animated-svg-as-background-expected.png: * platform/mac/svg/as-image/animated-svg-as-image-expected.png: * platform/mac/svg/as-image/animated-svg-as-image-no-fixed-intrinsic-size-expected.png: * platform/mac/svg/as-image/animated-svg-as-image-same-image-expected.png: * platform/mac/svg/as-image/svg-image-change-content-size-expected.png: * platform/mac/svg/as-object/deep-nested-embedded-svg-size-changes-no-layout-triggers-1-expected.png: * platform/mac/svg/as-object/deep-nested-embedded-svg-size-changes-no-layout-triggers-1-expected.txt: * platform/mac/svg/as-object/deep-nested-embedded-svg-size-changes-no-layout-triggers-2-expected.png: * platform/mac/svg/as-object/deep-nested-embedded-svg-size-changes-no-layout-triggers-2-expected.txt: * platform/mac/svg/as-object/embedded-svg-immediate-offsetWidth-query-expected.png: * platform/mac/svg/as-object/embedded-svg-size-changes-expected.png: * platform/mac/svg/as-object/embedded-svg-size-changes-no-layout-triggers-expected.png: * platform/mac/svg/as-object/embedded-svg-size-changes-no-layout-triggers-expected.txt: * platform/mac/svg/as-object/nested-embedded-svg-size-changes-expected.png: * platform/mac/svg/as-object/nested-embedded-svg-size-changes-no-layout-triggers-1-expected.png: * platform/mac/svg/as-object/nested-embedded-svg-size-changes-no-layout-triggers-1-expected.txt: * platform/mac/svg/as-object/nested-embedded-svg-size-changes-no-layout-triggers-2-expected.png: * platform/mac/svg/as-object/nested-embedded-svg-size-changes-no-layout-triggers-2-expected.txt: * platform/mac/svg/carto.net/tabgroup-expected.png: * platform/mac/svg/carto.net/tabgroup-expected.txt: * platform/mac/svg/carto.net/window-expected.png: * platform/mac/svg/carto.net/window-expected.txt: * platform/mac/svg/css/shadow-changes-expected.png: * platform/mac/svg/dom/SVGPathSegList-segment-modification-expected.png: * platform/mac/svg/dom/SVGPathSegList-segment-modification-expected.txt: * platform/mac/svg/dom/SVGPathSegList-xml-dom-synchronization-expected.png: * platform/mac/svg/dom/SVGPathSegList-xml-dom-synchronization2-expected.png: * platform/mac/svg/dom/SVGRectElement/rect-modify-rx-expected.png: * platform/mac/svg/filters/filter-refresh-expected.png: * platform/mac/svg/filters/filter-width-update-expected.png: * platform/mac/svg/filters/filter-width-update-expected.txt: * platform/mac/svg/filters/invalidate-on-child-layout-expected.png: * platform/mac/svg/hixie/perf/001-expected.png: * platform/mac/svg/hixie/perf/002-expected.png: * platform/mac/svg/hixie/perf/003-expected.png: * platform/mac/svg/hixie/perf/003-expected.txt: * platform/mac/svg/hixie/perf/004-expected.png: * platform/mac/svg/hixie/perf/004-expected.txt: * platform/mac/svg/hixie/perf/005-expected.png: * platform/mac/svg/hixie/perf/005-expected.txt: * platform/mac/svg/hixie/perf/006-expected.png: * platform/mac/svg/hixie/perf/006-expected.txt: * platform/mac/svg/hixie/perf/007-expected.png: * platform/mac/svg/hixie/perf/007-expected.txt: * platform/mac/svg/repaint/filter-child-repaint-expected.png: * platform/mac/svg/repaint/image-href-change-expected.png: * platform/mac/svg/repaint/image-with-clip-path-expected.png: * platform/mac/svg/text/append-text-node-to-tspan-expected.png: * platform/mac/svg/text/modify-text-node-in-tspan-expected.png: * platform/mac/svg/text/remove-text-node-from-tspan-expected.png: * platform/mac/svg/text/remove-tspan-from-text-expected.png: * platform/mac/svg/text/text-text-05-t-expected.png: * platform/mac/svg/text/text-text-05-t-expected.txt: * platform/mac/svg/transforms/animated-path-inside-transformed-html-expected.png: * platform/mac/svg/zoom/page/absolute-sized-document-no-scrollbars-expected.png: * platform/mac/svg/zoom/page/relative-sized-document-scrollbars-expected.png: * platform/mac/svg/zoom/page/zoom-background-images-expected.txt: * platform/mac/svg/zoom/page/zoom-foreignObject-expected.png: * platform/mac/svg/zoom/page/zoom-hixie-mixed-008-expected.txt: * platform/mac/svg/zoom/page/zoom-hixie-rendering-model-004-expected.png: * platform/mac/svg/zoom/page/zoom-hixie-rendering-model-004-expected.txt: * platform/mac/svg/zoom/page/zoom-mask-with-percentages-expected.png: * platform/mac/svg/zoom/page/zoom-svg-as-background-with-relative-size-and-viewBox-expected.png: * platform/mac/svg/zoom/page/zoom-svg-as-background-with-relative-size-expected.png: * platform/mac/svg/zoom/page/zoom-svg-as-image-expected.png: * platform/mac/svg/zoom/page/zoom-svg-as-object-expected.png: * platform/mac/svg/zoom/page/zoom-svg-as-relative-image-expected.png: * platform/mac/svg/zoom/page/zoom-svg-through-object-with-auto-size-expected.txt: * platform/mac/svg/zoom/page/zoom-svg-through-object-with-override-size-expected.txt: * platform/mac/svg/zoom/text/absolute-sized-document-no-scrollbars-expected.png: * platform/mac/svg/zoom/text/absolute-sized-document-scrollbars-expected.png: * platform/mac/svg/zoom/text/relative-sized-document-scrollbars-expected.png: * platform/mac/svg/zoom/text/zoom-foreignObject-expected.png: * platform/mac/svg/zoom/text/zoom-hixie-mixed-008-expected.png: * platform/mac/svg/zoom/text/zoom-hixie-mixed-008-expected.txt: * platform/mac/svg/zoom/text/zoom-hixie-mixed-009-expected.png: * platform/mac/svg/zoom/text/zoom-hixie-rendering-model-004-expected.png: * platform/mac/svg/zoom/text/zoom-hixie-rendering-model-004-expected.txt: * svg/as-background-image/animated-svg-as-background.html: * svg/as-background-image/resources/animated-rect-relative-size.svg: * svg/as-background-image/svg-as-background-5.html: * svg/as-background-image/svg-background-partial-redraw.html: * svg/as-image/animated-svg-as-image-no-fixed-intrinsic-size.html: * svg/as-image/animated-svg-as-image-same-image.html: * svg/as-image/animated-svg-as-image.html: * svg/as-image/resources/animated-rect-fixed-size-2.svg: Copied from LayoutTests/svg/as-image/resources/animated-rect-same-image.svg. * svg/as-image/resources/animated-rect-fixed-size.svg: * svg/as-image/resources/animated-rect-relative-size.svg: * svg/as-image/resources/animated-rect-same-image.svg: * svg/as-image/svg-image-change-content-size.xhtml: * svg/as-object/embedded-svg-immediate-offsetWidth-query.html: * svg/as-object/embedded-svg-size-changes-no-layout-triggers.html: * svg/as-object/embedded-svg-size-changes.html: * svg/as-object/nested-embedded-svg-size-changes-no-layout-triggers-1.html: * svg/as-object/nested-embedded-svg-size-changes-no-layout-triggers-2.html: * svg/as-object/nested-embedded-svg-size-changes.html: * svg/as-object/resources/embedded-svg-size-changes-no-layout-triggers.svg: * svg/as-object/resources/nested-embedded-svg-size-changes-target-no-layout-triggers-1.html: * svg/carto.net/tabgroup.svg: * svg/carto.net/window.svg: * svg/css/shadow-changes.svg: * svg/dom/SVGPathSegList-segment-modification.svg: * svg/dom/SVGPathSegList-xml-dom-synchronization.xhtml: * svg/dom/SVGPathSegList-xml-dom-synchronization2.xhtml: * svg/dom/SVGRectElement/rect-modify-rx.svg: * svg/filters/animate-fill-expected.png: * svg/filters/animate-fill.svg: * svg/filters/feImage-reference-invalidation-expected.png: * svg/filters/feImage-reference-invalidation.svg: * svg/filters/feImage-target-add-to-document-expected.png: * svg/filters/feImage-target-add-to-document.svg: * svg/filters/feImage-target-changes-id-expected.png: * svg/filters/feImage-target-changes-id.svg: * svg/filters/feImage-target-id-change-expected.png: * svg/filters/feImage-target-id-change.svg: * svg/filters/feImage-target-reappend-to-document-expected.png: * svg/filters/feImage-target-reappend-to-document.svg: * svg/filters/feImage-target-remove-from-document-expected.png: * svg/filters/feImage-target-remove-from-document.svg: * svg/filters/filter-refresh.svg: * svg/filters/filter-width-update.svg: * svg/filters/invalidate-on-child-layout.svg: * svg/hixie/perf/001.xml: * svg/hixie/perf/002.xml: * svg/hixie/perf/003.xml: * svg/hixie/perf/004.xml: * svg/hixie/perf/005.xml: * svg/hixie/perf/006.xml: * svg/hixie/perf/007.xml: * svg/hixie/perf/resources/smallcats.gif: Added. * svg/repaint/container-repaint-expected.png: * svg/repaint/container-repaint.svg: * svg/repaint/filter-child-repaint.svg: * svg/repaint/image-href-change.svg: * svg/repaint/image-with-clip-path.svg: * svg/text/append-text-node-to-tspan.html: * svg/text/modify-text-node-in-tspan.html: * svg/text/remove-text-node-from-tspan.html: * svg/text/remove-tspan-from-text.html: * svg/text/text-text-05-t.svg: * svg/transforms/animated-path-inside-transformed-html.xhtml: * svg/zoom/page/absolute-sized-document-no-scrollbars.svg: * svg/zoom/page/absolute-sized-document-scrollbars.svg: * svg/zoom/page/relative-sized-document-scrollbars.svg: * svg/zoom/page/zoom-background-image-tiled.html: * svg/zoom/page/zoom-background-images.html: * svg/zoom/page/zoom-coords-viewattr-01-b.svg: * svg/zoom/page/zoom-foreignObject.svg: * svg/zoom/page/zoom-getBoundingClientRect.xhtml: * svg/zoom/page/zoom-hixie-mixed-008.xml: * svg/zoom/page/zoom-hixie-mixed-009.xml: * svg/zoom/page/zoom-hixie-rendering-model-004.xhtml: * svg/zoom/page/zoom-img-preserveAspectRatio-support-1.html: * svg/zoom/page/zoom-mask-with-percentages.svg: * svg/zoom/page/zoom-replaced-intrinsic-ratio-001.htm: * svg/zoom/page/zoom-svg-as-background-with-relative-size-and-viewBox.html: * svg/zoom/page/zoom-svg-as-background-with-relative-size.html: * svg/zoom/page/zoom-svg-as-image.html: * svg/zoom/page/zoom-svg-as-object.html: * svg/zoom/page/zoom-svg-as-relative-image.html: * svg/zoom/page/zoom-svg-float-border-padding.xml: * svg/zoom/page/zoom-svg-through-object-with-absolute-size-2.xhtml: * svg/zoom/page/zoom-svg-through-object-with-absolute-size.xhtml: * svg/zoom/page/zoom-svg-through-object-with-auto-size.html: * svg/zoom/page/zoom-svg-through-object-with-huge-size.xhtml: * svg/zoom/page/zoom-svg-through-object-with-override-size.html: * svg/zoom/page/zoom-svg-through-object-with-percentage-size.xhtml: * svg/zoom/page/zoom-svg-through-object-with-text.xhtml-disabled: * svg/zoom/page/zoom-zoom-coords.xhtml: * svg/zoom/resources/testPageZoom.js: (repaintTest): * svg/zoom/resources/testTextZoom.js: (repaintTest): * svg/zoom/text/absolute-sized-document-no-scrollbars.svg: * svg/zoom/text/absolute-sized-document-scrollbars.svg: * svg/zoom/text/relative-sized-document-scrollbars.svg: * svg/zoom/text/zoom-coords-viewattr-01-b.svg: * svg/zoom/text/zoom-foreignObject.svg: * svg/zoom/text/zoom-hixie-mixed-008.xml: * svg/zoom/text/zoom-hixie-mixed-009.xml: * svg/zoom/text/zoom-hixie-rendering-model-004.xhtml: * svg/zoom/text/zoom-svg-float-border-padding.xml: Canonical link: https://commits.webkit.org/94836@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@106918 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-02-07 11:19:19 +00:00
<script type="text/javascript">
<![CDATA[
function repaintTest() {
var path = document.getElementsByTagName('path')[0];
var start = document.getElementById('d_start');
var end = document.getElementById('d_end');
var start_d = path.getAttribute('d');
start.textContent = start_d;
var list = path.pathSegList;
var seg = path.createSVGPathSegLinetoRel(50, 50);
list.insertItemBefore(seg, 2);
var end_d = path.getAttribute('d');
end.textContent = end_d;
if(start_d == end_d) {
end.textContent += ' (failed)';
}
}
]]>
</script>
2010-11-19 Nikolas Zimmermann <nzimmermann@rim.com> Reviewed by Dirk Schulze. Convert SVGPathSeg/SVGPathSegList to the new SVGPropertyTearOff concept https://bugs.webkit.org/show_bug.cgi?id=49580 SVGPathElement.cloneNode loses generated pathSegList https://bugs.webkit.org/show_bug.cgi?id=43388 SVG Path elements are not correctly updated through pathSegList manipulation on relative values https://bugs.webkit.org/show_bug.cgi?id=30219 Changing an SVGPathSeg does not update a following Smooth Cubic Curveto https://bugs.webkit.org/show_bug.cgi?id=19741 SVGPathElement should only build SVGPathSeg* list on demand https://bugs.webkit.org/show_bug.cgi?id=10827 Tests: svg/W3C-SVG-1.1-SE/paths-dom-02-f.svg svg/dom/SVGPathSegList-appendItem.xhtml svg/dom/SVGPathSegList-clear-and-initialize.xhtml svg/dom/SVGPathSegList-cloning.html svg/dom/SVGPathSegList-insertItemBefore.xhtml svg/dom/SVGPathSegList-removeItem.xhtml svg/dom/SVGPathSegList-replaceItem.xhtml svg/dom/SVGPathSegList-xml-dom-synchronization.xhtml svg/dom/SVGPathSegList-xml-dom-synchronization2.xhtml svg/dom/SVGPathSegList-segment-modification.svg Convert SVGPathSeg*/SVGPathSegList to the new SVG(Animated)PropertyTearOff concept. Unlike all other SVG* types that use the SVGPropertyTearOff concept, SVGPathSegs are already refcounted, and don't need to be wrapped in SVGPropertyTearOff objects. The consequence is that SVGPathSegs need to track themselves to which list and path element they belong. Introduce new SVGAnimatedPathSegListPropertyTearOff and SVGPathSegListPropertyTearOff classes, that encapsulate the special needed for SVGPathSegList. Each SVGPathSeg now needs to store a RefPtr<SVGPathElement> - this makes it impossible to use SVGPathSegList to represent the 'd' attribute internally in SVGPathElement. SVGPathSegList is now only used in the SVG DOM bindings if someone explicitely requests 'pathElement.pathSegList' (eg. via JS). Switch to use SVGPathByteStream to store the 'd' attribute data in SVGPathElement, which is much more compact, and less memory intensive. Dirk already prepared SVGPathParserFactory some months ago, which allows easy conversion between String/Path/SVGPathSegList/SVGPathByteStream in all directions, including normalizing the lists, when requested. As consequence SVGPathSegList is now only built on demand, when explicitely requested. Using the SVGAnimatedProperty concept gives us 'd' attribute <-> SVGPathSegList synchronization for free, fixing several bugs, listed above. * Android.mk: Remove obsolete SVGPathSeg*.cpp files and SVGAnimatedPathData.cpp from build. * CMakeLists.txt: Ditto. * DerivedSources.make: Remove SVGAnimatedPathData IDL generation. * GNUmakefile.am: Remove obsolete SVGPathSeg*.cpp files and SVGAnimatedPathData.cpp from build. * WebCore.gyp/WebCore.gyp: Remove SVGAnimatedPathData IDL generation. * WebCore.gypi: Remove obsolete SVGPathSeg*.cpp files and SVGAnimatedPathData.cpp from build. * WebCore.order: Remove no-longer existant SVGAnimatedPathData symbols. * WebCore.pro: Remove obsolete SVGPathSeg*.cpp files and SVGAnimatedPathData.cpp / JSSVGPathSegCustom.* from build. * WebCore.vcproj/WebCore.vcproj: Ditto. * WebCore.xcodeproj/project.pbxproj: Ditto. * bindings/js/JSBindingsAllInOne.cpp: Remove JSSVGPathSegCustom.cpp from build. * bindings/js/JSDOMBinding.cpp: Adapt to toJS() changes, remove context parameter. (WebCore::setDOMException): * bindings/js/JSDOMBinding.h: Remove obsolete CREATE_SVG_OBJECT_WRAPPER macro, the context parameter is not existant anymore. * bindings/js/JSSVGPathSegCustom.cpp: Replace CREATE_SVG_OBJECT_WRAPPER by CREATE_DOM_OBJECT_WRAPPER. Remove context parameter/handling. (WebCore::toJS): * bindings/js/JSSVGPathSegListCustom.cpp: Removed. * bindings/scripts/CodeGenerator.pm: Map 'SVGPathSegList' IDL type to SVG 'SVGPathSegListPropertyTearOff' native type. * bindings/scripts/CodeGeneratorJS.pm: Remove IsSVGTypeNeedingContextParameter() methods and usages. Handle SVGPathSegListPropertyTearOff. * bindings/scripts/CodeGeneratorObjC.pm: Handle SVGPathSegListPropertyTearOff. * bindings/scripts/CodeGeneratorV8.pm: Remove IsSVGTypeNeedingContextParameter() methods and usages. * rendering/SVGRenderTreeAsText.cpp: Build path string from byte stream, not path segment list. (WebCore::operator<<): * svg/SVGAllInOne.cpp: Remove obsolete cpp files. * svg/SVGAnimatedPathData.cpp: Removed. * svg/SVGAnimatedPathData.h: Removed. * svg/SVGAnimatedPathData.idl: Removed. * svg/SVGPathElement.cpp: Build SVGPathList on demand. Use SVGPathByteStream to parse/store the 'd' attribute content. (WebCore::SVGPathElement::SVGPathElement): (WebCore::SVGPathElement::getPathSegAtLength): Use SVGPathByteStream, not SVGPathSegList to determine the getPathSegAtLength() information. (WebCore::SVGPathElement::createSVGPathSegClosePath): Pass SVGPathElement to SVGPathSeg and a SVGPathSegRole parameter and store it to track the list origin. (WebCore::SVGPathElement::createSVGPathSegMovetoAbs): Ditto. (WebCore::SVGPathElement::createSVGPathSegMovetoRel): Ditto. (WebCore::SVGPathElement::createSVGPathSegLinetoAbs): Ditto. (WebCore::SVGPathElement::createSVGPathSegLinetoRel): Ditto. (WebCore::SVGPathElement::createSVGPathSegCurvetoCubicAbs): Ditto. (WebCore::SVGPathElement::createSVGPathSegCurvetoCubicRel): Ditto. (WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticAbs): Ditto. (WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticRel): Ditto. (WebCore::SVGPathElement::createSVGPathSegArcAbs): Ditto. (WebCore::SVGPathElement::createSVGPathSegArcRel): Ditto. (WebCore::SVGPathElement::createSVGPathSegLinetoHorizontalAbs): Ditto. (WebCore::SVGPathElement::createSVGPathSegLinetoHorizontalRel): Ditto. (WebCore::SVGPathElement::createSVGPathSegLinetoVerticalAbs): Ditto. (WebCore::SVGPathElement::createSVGPathSegLinetoVerticalRel): Ditto. (WebCore::SVGPathElement::createSVGPathSegCurvetoCubicSmoothAbs): Ditto. (WebCore::SVGPathElement::createSVGPathSegCurvetoCubicSmoothRel): Ditto. (WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticSmoothAbs): Ditto. (WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticSmoothRel): Ditto. (WebCore::SVGPathElement::parseMappedAttribute): Build SVGPathByteStream from 'd' attribute, not a SVGPathSegList. (WebCore::SVGPathElement::svgAttributeChanged): If a SVGPathSegList object has been built, synchronize it with the 'd' attribute. (WebCore::SVGPathElement::synchronizeProperty): Synchronize 'd' attribute with the SVGPathSegList, if needed. (WebCore::SVGPathElement::synchronizeD): Added. (WebCore::SVGPathElement::pathSegList): Use same trick as in SVGPolyElement to expose the 'pathSegList' / 'animatedPathSegList' object to the SVG DOM bindings. (WebCore::SVGPathElement::normalizedPathSegList): Ditto. (WebCore::SVGPathElement::animatedPathSegList): Ditto. (WebCore::SVGPathElement::animatedNormalizedPathSegList): Ditto. (WebCore::SVGPathElement::toPathData): Build 'Path' object from SVGPathByteStream, not from SVGPathSegList. (WebCore::SVGPathElement::pathSegListChanged): Used to synchronize the SVGPathSegLists and the d attribute, as well as any changes from any SVGPathSeg associated with this SVGPathElement. * svg/SVGPathElement.h: Add new accessors... (WebCore::SVGPathElement::pathByteStream): ... needed by SVGRenderTreeAsText. (WebCore::SVGPathElement::animatablePathSegList): ... needed by SVGPathSegListPropertyTearOff. * svg/SVGPathElement.idl: Merge SVGAnimatedPathData interface into SVGPathElement. * svg/SVGPathParserFactory.cpp: Cleanup SVGPathParserFactory, remove obsolete methods, now that SVGPathElement switched to using SVGPathByteStream internally. (WebCore::globalSVGPathSegListBuilder): (WebCore::SVGPathParserFactory::buildSVGPathByteStreamFromSVGPathSegList): (WebCore::SVGPathParserFactory::buildPathFromByteStream): (WebCore::SVGPathParserFactory::buildSVGPathSegListFromByteStream): (WebCore::SVGPathParserFactory::buildStringFromSVGPathSegList): (WebCore::SVGPathParserFactory::buildSVGPathByteStreamFromString): (WebCore::SVGPathParserFactory::buildAnimatedSVGPathByteStream): (WebCore::SVGPathParserFactory::getSVGPathSegAtLengthFromSVGPathByteStream): * svg/SVGPathParserFactory.h: * svg/SVGPathSeg.cpp: Removed. * svg/SVGPathSeg.h: Add new SVGPathSegRole enum, identifying to which list a path segment belongs. (WebCore::SVGPathSeg::SVGPathSeg): * svg/SVGPathSeg.idl: Reindented. * svg/SVGPathSegArc.cpp: Removed. * svg/SVGPathSegArc.h: All setters now call the commitChange() method. * svg/SVGPathSegArcAbs.idl: Enable StrictTypeChecking. * svg/SVGPathSegArcRel.idl: Ditto. * svg/SVGPathSegClosePath.cpp: Removed. * svg/SVGPathSegClosePath.h: * svg/SVGPathSegCurvetoCubic.cpp: Removed. * svg/SVGPathSegCurvetoCubic.h: All setters now call the commitChange() method. * svg/SVGPathSegCurvetoCubicAbs.idl: Enable StrictTypeChecking. * svg/SVGPathSegCurvetoCubicRel.idl: Ditto. * svg/SVGPathSegCurvetoCubicSmooth.cpp: Removed. * svg/SVGPathSegCurvetoCubicSmooth.h: All setters now call the commitChange() method. * svg/SVGPathSegCurvetoCubicSmoothAbs.idl: Enable StrictTypeChecking. * svg/SVGPathSegCurvetoCubicSmoothRel.idl: Ditto. * svg/SVGPathSegCurvetoQuadratic.cpp: Removed. * svg/SVGPathSegCurvetoQuadratic.h: All setters now call the commitChange() method. * svg/SVGPathSegCurvetoQuadraticAbs.idl: Enable StrictTypeChecking. * svg/SVGPathSegCurvetoQuadraticRel.idl: Ditto. * svg/SVGPathSegCurvetoQuadraticSmooth.cpp: Removed. * svg/SVGPathSegCurvetoQuadraticSmooth.h: All setters now call the commitChange() method. * svg/SVGPathSegCurvetoQuadraticSmoothAbs.idl: Enable StrictTypeChecking. * svg/SVGPathSegCurvetoQuadraticSmoothRel.idl: Ditto. * svg/SVGPathSegLineto.cpp: Removed. * svg/SVGPathSegLineto.h: All setters now call the commitChange() method. * svg/SVGPathSegLinetoAbs.idl: Enable StrictTypeChecking. * svg/SVGPathSegLinetoHorizontal.cpp: Removed. * svg/SVGPathSegLinetoHorizontal.h: All setters now call the commitChange() method. * svg/SVGPathSegLinetoHorizontalAbs.idl: Enable StrictTypeChecking. * svg/SVGPathSegLinetoHorizontalRel.idl: Ditto. * svg/SVGPathSegLinetoRel.idl: Enable StrictTypeChecking. * svg/SVGPathSegLinetoVertical.cpp: Removed. * svg/SVGPathSegLinetoVertical.h: All setters now call the commitChange() method. * svg/SVGPathSegLinetoVerticalAbs.idl: Enable StrictTypeChecking. * svg/SVGPathSegLinetoVerticalRel.idl: Ditto. * svg/SVGPathSegList.cpp: Switch from SVGList<RefPtr<SVGPathSeg> > to a plain Vector<RefPtr<SVGPathSeg> >. (WebCore::SVGPathSegList::valueAsString): Utilize SVGPathParserFactory to build a String from a SVGPathSegList. (WebCore::SVGPathSegList::commitChange): Call SVGPathElement::pathSegListChanged(). * svg/SVGPathSegList.h: (WebCore::SVGPathSegList::SVGPathSegList): * svg/SVGPathSegList.idl: Remove [JSCCustom] flags, no longer needed. * svg/SVGPathSegListBuilder.cpp: Adapt to SVGPathSegList API changes. (WebCore::SVGPathSegListBuilder::SVGPathSegListBuilder): (WebCore::SVGPathSegListBuilder::moveTo): (WebCore::SVGPathSegListBuilder::lineTo): (WebCore::SVGPathSegListBuilder::lineToHorizontal): (WebCore::SVGPathSegListBuilder::lineToVertical): (WebCore::SVGPathSegListBuilder::curveToCubic): (WebCore::SVGPathSegListBuilder::curveToCubicSmooth): (WebCore::SVGPathSegListBuilder::curveToQuadratic): (WebCore::SVGPathSegListBuilder::curveToQuadraticSmooth): (WebCore::SVGPathSegListBuilder::arcTo): (WebCore::SVGPathSegListBuilder::closePath): * svg/SVGPathSegListBuilder.h: Ditto. (WebCore::SVGPathSegListBuilder::setCurrentSVGPathElement): (WebCore::SVGPathSegListBuilder::setCurrentSVGPathSegList): (WebCore::SVGPathSegListBuilder::setCurrentSVGPathSegRole): (WebCore::SVGPathSegListBuilder::cleanup): * svg/SVGPathSegListSource.cpp: Ditto. (WebCore::SVGPathSegListSource::SVGPathSegListSource): (WebCore::SVGPathSegListSource::parseSVGSegmentType): (WebCore::SVGPathSegListSource::nextCommand): (WebCore::SVGPathSegListSource::parseMoveToSegment): (WebCore::SVGPathSegListSource::parseLineToSegment): (WebCore::SVGPathSegListSource::parseCurveToQuadraticSmoothSegment): * svg/SVGPathSegListSource.h: Ditto. (WebCore::SVGPathSegListSource::create): * svg/SVGPathSegMoveto.cpp: Removed. * svg/SVGPathSegMoveto.h: All setters now call the commitChange() method. * svg/SVGPathSegMovetoAbs.idl: Enable StrictTypeChecking. * svg/SVGPathSegMovetoRel.idl: Ditto. * svg/SVGPathSegWithContext.h: Added. This is the new base class for all SVGPathSeg derived types, that's associated with a SVGPathElement and a 'role' (normalized/unaltered segment list). (WebCore::SVGPathSegWithContext::SVGPathSegWithContext): (WebCore::SVGPathSegWithContext::animatedProperty): (WebCore::SVGPathSegWithContext::setContextAndRole): (WebCore::SVGPathSegWithContext::commitChange): (WebCore::SVGPathSegSingleCoordinate::x): (WebCore::SVGPathSegSingleCoordinate::setX): (WebCore::SVGPathSegSingleCoordinate::y): (WebCore::SVGPathSegSingleCoordinate::setY): (WebCore::SVGPathSegSingleCoordinate::SVGPathSegSingleCoordinate): * svg/properties/SVGAnimatedPathSegListPropertyTearOff.h: Added. (WebCore::SVGAnimatedPathSegListPropertyTearOff::baseVal): (WebCore::SVGAnimatedPathSegListPropertyTearOff::animVal): (WebCore::SVGAnimatedPathSegListPropertyTearOff::removeItemFromList): (WebCore::SVGAnimatedPathSegListPropertyTearOff::create): (WebCore::SVGAnimatedPathSegListPropertyTearOff::SVGAnimatedPathSegListPropertyTearOff): * svg/properties/SVGPathSegListPropertyTearOff.cpp: Added. (WebCore::SVGPathSegListPropertyTearOff::clear): Added in the cpp file, not in the header, as it needs access to SVGPathSegWithContext, which we can't include from the header. (WebCore::SVGPathSegListPropertyTearOff::getItem): Ditto. (WebCore::SVGPathSegListPropertyTearOff::removeItem): Ditto. (WebCore::SVGPathSegListPropertyTearOff::contextElement): Needs access to SVGPathElement, that's why it lives in the cpp file. (WebCore::SVGPathSegListPropertyTearOff::processIncomingListItemValue): Needs access to SVGPathSegWithContext. * svg/properties/SVGPathSegListPropertyTearOff.h: Added. (WebCore::SVGPathSegListPropertyTearOff::create): (WebCore::SVGPathSegListPropertyTearOff::removeItemFromList): (WebCore::SVGPathSegListPropertyTearOff::numberOfItems): (WebCore::SVGPathSegListPropertyTearOff::initialize): (WebCore::SVGPathSegListPropertyTearOff::insertItemBefore): (WebCore::SVGPathSegListPropertyTearOff::replaceItem): (WebCore::SVGPathSegListPropertyTearOff::appendItem): (WebCore::SVGPathSegListPropertyTearOff::SVGPathSegListPropertyTearOff): (WebCore::SVGPathSegListPropertyTearOff::commitChange): (WebCore::SVGPathSegListPropertyTearOff::processIncomingListItemWrapper): 2010-11-19 Nikolas Zimmermann <nzimmermann@rim.com> Reviewed by Dirk Schulze. Convert SVGPathSeg/SVGPathSegList to the new SVGPropertyTearOff concept https://bugs.webkit.org/show_bug.cgi?id=49580 Add several new tests covering SVGPathSegList usage. * platform/mac/svg/W3C-SVG-1.1-SE/paths-dom-02-f-expected.checksum: Added. * platform/mac/svg/W3C-SVG-1.1-SE/paths-dom-02-f-expected.png: Added. * platform/mac/svg/W3C-SVG-1.1-SE/paths-dom-02-f-expected.txt: Added. * platform/mac/svg/custom/svg-curve-with-relative-cordinates-expected.txt: * platform/mac/svg/dom/SVGPathSegList-appendItem-expected.checksum: Added. * platform/mac/svg/dom/SVGPathSegList-appendItem-expected.png: Added. * platform/mac/svg/dom/SVGPathSegList-clear-and-initialize-expected.checksum: Added. * platform/mac/svg/dom/SVGPathSegList-clear-and-initialize-expected.png: Added. * platform/mac/svg/dom/SVGPathSegList-cloning-expected.checksum: Added. * platform/mac/svg/dom/SVGPathSegList-cloning-expected.png: Added. * platform/mac/svg/dom/SVGPathSegList-cloning-expected.txt: Added. * platform/mac/svg/dom/SVGPathSegList-insertItemBefore-expected.checksum: Added. * platform/mac/svg/dom/SVGPathSegList-insertItemBefore-expected.png: Added. * platform/mac/svg/dom/SVGPathSegList-removeItem-expected.checksum: Added. * platform/mac/svg/dom/SVGPathSegList-removeItem-expected.png: Added. * platform/mac/svg/dom/SVGPathSegList-replaceItem-expected.checksum: Added. * platform/mac/svg/dom/SVGPathSegList-replaceItem-expected.png: Added. * platform/mac/svg/dom/SVGPathSegList-segment-modification-expected.checksum: Added. * platform/mac/svg/dom/SVGPathSegList-segment-modification-expected.png: Added. * platform/mac/svg/dom/SVGPathSegList-segment-modification-expected.txt: Added. * platform/mac/svg/dom/SVGPathSegList-xml-dom-synchronization-expected.checksum: Added. * platform/mac/svg/dom/SVGPathSegList-xml-dom-synchronization-expected.png: Added. * platform/mac/svg/dom/SVGPathSegList-xml-dom-synchronization2-expected.checksum: Added. * platform/mac/svg/dom/SVGPathSegList-xml-dom-synchronization2-expected.png: Added. * platform/mac/svg/dom/SVGPathSegList-xml-dom-synchronization2-expected.txt: Added. * svg/W3C-SVG-1.1-SE/paths-dom-02-f.svg: Added. * svg/dom/SVGPathSegList-appendItem-expected.txt: Added. * svg/dom/SVGPathSegList-appendItem.xhtml: Added. * svg/dom/SVGPathSegList-clear-and-initialize-expected.txt: Added. * svg/dom/SVGPathSegList-clear-and-initialize.xhtml: Added. * svg/dom/SVGPathSegList-cloning.html: Added. * svg/dom/SVGPathSegList-insertItemBefore-expected.txt: Added. * svg/dom/SVGPathSegList-insertItemBefore.xhtml: Added. * svg/dom/SVGPathSegList-removeItem-expected.txt: Added. * svg/dom/SVGPathSegList-removeItem.xhtml: Added. * svg/dom/SVGPathSegList-replaceItem-expected.txt: Added. * svg/dom/SVGPathSegList-replaceItem.xhtml: Added. * svg/dom/SVGPathSegList-segment-modification.svg: Added. * svg/dom/SVGPathSegList-xml-dom-synchronization-expected.txt: Added. * svg/dom/SVGPathSegList-xml-dom-synchronization.xhtml: Added. * svg/dom/SVGPathSegList-xml-dom-synchronization2.xhtml: Added. * svg/dom/fuzz-path-parser-expected.txt: * svg/dom/path-parser-expected.txt: * svg/dom/script-tests/path-parser.js: (): * svg/dom/svglist-exception-on-out-bounds-error-expected.txt: * svg/dom/svglist-exception-on-out-bounds-error.html: * svg/dom/svgpath-out-of-bounds-getPathSeg-expected.txt: Canonical link: https://commits.webkit.org/62843@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@72381 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2010-11-19 12:54:11 +00:00
</svg>