Path2D does not support SVG path data in the constructor

Issue #8438884 • Assigned to Christian F.

Details

Author
Martin W.
Created
Aug 9, 2016
Privacy
This issue is public.
Found in
  • Microsoft Edge
Reports
Reported by 6 people

Sign in to watch or report this issue.

Steps to reproduce

Try this example from MDN ( https://developer.mozilla.org/en-US/docs/Web/API/Path2D/Path2D ):

var canvas = document.getElementById(“canvas”);
var ctx = canvas.getContext(“2d”);

var p = new Path2D(“M10 10 h 80 v 80 h -80 Z”);
ctx.fill§;

Attachments

0 attachments

    Comments and activity

    • Microsoft Edge Team

      Changed Assigned To to “Brad E.”

    • Thanks for the feedback on Edge. When I run this code sample you provided to us, I get:

      Unable to get property ‘getContext’ of undefined or null reference

      Returned in both Chrome Canary 54 and Edge 10586.

      Am I missing any steps in this repro?

    • The code snippet is the relevant part from the linked page. Obviously you can’t call that in isolation since you need a canvas for the very first statement to work.

    • The above example implies that you have a html page with a canvas element with id canvas - hence the error you get that it’s undefined.
      I think it would be easier for you to confirm the bug by going to the url above the sample. Then scroll down to “Using SVG data” and look at the rectangular output below the sample code.

    • Working a little too fast that day.  Sorry.  I am able to repro.

      Have a simple reduction here:
      http://codepen.io/bledwards1/pen/dXEVQL](http://codepen.io/bledwards1/pen/dXEVQL)[http://codepen.io/bledwards1/pen/dXEVQL](http://codepen.io/bledwards1/pen/dXEVQL)

      Thank you for your feedback, guys.

    • Microsoft Edge Team

      Changed Assigned To to “Rick J.”

      Changed Assigned To from “Rick J.” to “Christian F.”

    • Any ETA on this? Working a project for work right now and this is a must.

    • Any updates on supporting the full spec of Path2D?

    • I have 2 paths in my code now. One is using Path2D for my shapes and is currently commented out (because of this issue) and the other is Canvas shape drawing tools (which is much more verbose). Using the Canvas method till Edge supports Path2D. This is important. Writing code for Internet Explorer in the past was always a compromise and frustrating. Edge is supposed to be better. Please bring feature parity to Edge for Path2D. Thank you.

    • Hi Edge Team, is there any updates, or are you working on this fix? Thanks.

    You need to sign in to your Microsoft account to add a comment.

    Sign in