File tree Expand file tree Collapse file tree 2 files changed +34
-13
lines changed
testing/web-platform/tests/svg/animations Expand file tree Collapse file tree 2 files changed +34
-13
lines changed Original file line number Diff line number Diff line change @@ -208,17 +208,21 @@ void SVGMotionSMILAnimationFunction::RebuildPathAndVerticesFromMpathElem(
208
208
mPathSourceType = ePathSourceType_Mpath;
209
209
210
210
211
- SVGGeometryElement* shapeElem = aMpathElem->GetReferencedPath ();
212
- if (shapeElem && shapeElem->HasValidDimensions ()) {
213
- bool ok = shapeElem->GetDistancesFromOriginToEndsOfVisibleSegments (
214
- &mPathVertices );
215
- if (!ok) {
216
- mPathVertices .Clear ();
217
- return ;
218
- }
219
- if (mPathVertices .Length ()) {
220
- mPath = shapeElem->GetOrBuildPathForMeasuring ();
221
- }
211
+ SVGGeometryElement* shape = aMpathElem->GetReferencedPath ();
212
+ if (!shape || !shape->HasValidDimensions ()) {
213
+ return ;
214
+ }
215
+ if (!shape->GetDistancesFromOriginToEndsOfVisibleSegments (&mPathVertices )) {
216
+ mPathVertices .Clear ();
217
+ return ;
218
+ }
219
+ if (mPathVertices .IsEmpty ()) {
220
+ return ;
221
+ }
222
+ mPath = shape->GetOrBuildPathForMeasuring ();
223
+ if (!mPath ) {
224
+ mPathVertices .Clear ();
225
+ return ;
222
226
}
223
227
}
224
228
@@ -237,7 +241,7 @@ void SVGMotionSMILAnimationFunction::RebuildPathAndVerticesFromPathAttr() {
237
241
238
242
mPath = path.BuildPathForMeasuring (1 .0f );
239
243
bool ok = path.GetDistancesFromOriginToEndsOfVisibleSegments (&mPathVertices );
240
- if (!ok || ! mPathVertices .Length () ) {
244
+ if (!ok || mPathVertices .IsEmpty () || ! mPath ) {
241
245
mPath = nullptr ;
242
246
mPathVertices .Clear ();
243
247
}
@@ -265,7 +269,6 @@ void SVGMotionSMILAnimationFunction::RebuildPathAndVertices(
265
269
mValueNeedsReparsingEverySample = false ;
266
270
} else {
267
271
268
-
269
272
RebuildPathAndVerticesFromBasicAttrs (aTargetElement);
270
273
mValueNeedsReparsingEverySample = true ;
271
274
}
Original file line number Diff line number Diff line change
1
+ < html >
2
+ < head >
3
+ < script >
4
+ document . addEventListener ( "DOMContentLoaded" , async ( ) => {
5
+ const frame = document . createElementNS ( "http://www.w3.org/1999/xhtml" , "frame" )
6
+ document . documentElement . appendChild ( frame )
7
+ frame . src = `data:text/html,` + encodeURIComponent ( `<!doctype html>
8
+ <svg>
9
+ <ellipse id="id_8" ry="100pt"></ellipse>
10
+ <animateMotion>
11
+ <desc></desc>
12
+ <mpath xlink:href="#id_8"></mpath>
13
+ </animateMotion>
14
+ </svg>` ) ;
15
+ } )
16
+ </ script >
17
+ </ head >
18
+ </ html >
You can’t perform that action at this time.
0 commit comments