Parse canvas's width and height attributes according to the specification.