assertions:
  - id: size.width
    text: "attribute long width;<^>"
  - id: size.height
    text: "attribute long height;<^>"
  - id: size.nonnegativeinteger
    text: "The rules for parsing non-negative integers must be used to obtain their numeric values<^>."
  - id: size.missing
    text: "If an attribute is missing<^>, <...> then the default value must be used instead."
  - id: size.error
    text: "if parsing its value returns an error<^>, then the default value must be used instead."
  - id: size.default
    text: "The width attribute defaults to 300, and the height attribute defaults to 150<^>."
  - id: size.css
    text: "the element can be sized arbitrarily by a style sheet. During rendering, the image is scaled to fit this layout size<^>."

  - id: initial.colour
    text: "The canvas must initially be fully transparent black<^>."
  - id: initial.reset
    text: "If the width and height attributes are dynamically modified, the bitmap and any associated contexts must be cleared back to their initial state<^>"
  - id: size.reflect
    text: "The width and height DOM attributes must reflect the content attributes of the same name<^>."

  - id: context.2d
    text: "If getContext() is called with that exact string, then the UA must return a reference to an object implementing CanvasRenderingContext2D<^>."
  - id: context.empty
    text: "When the UA is passed an empty string<^> <...> then it must return null."
  - id: context.unrecognised
    text: "When the UA is passed <...> a string specifying a context that it does not support<^>, then it must return null."
  - id: context.casesensitive
    text: "String comparisons should be <...> case-sensitive<^>."

  - id: context.2d.unique
    text: "calling the getContext() method with the 2d argument a second time must return the same object<^>."

  - id: 2d.coordinatespace
    text: "flat cartesian surface whose origin (0,0) is at the top left corner, with the coordinate space having x values increasing when going right, and y values increasing when going down<^>."
  - id: 2d.canvas
    text: "The canvas attribute must return the canvas element that the context paints on<^>."
  - id: 2d.canvas.attribute
    text: "// back-reference to the canvas readonly attribute<^>"

  - meta: |
        for s in ['strokeStyle', 'fillStyle', 'globalAlpha', 'lineWidth', 'lineCap', 'lineJoin', 'miterLimit', 'shadowOffsetX', 'shadowOffsetY', 'shadowBlur', 'shadowColor', 'globalCompositeOperation']:
            assertions.append( {
                'id': '2d.state.%s' % s,
                'text': 'The current values of the following attributes:<...>%s<^>' % s
            } )
  - id: 2d.state.transformation
    text: "The current transformation matrix<^>."
  - id: 2d.state.clip
    text: "The current clip region<^>."
  - id: 2d.state.path
    text: "The current path<^> <...> are not part of the drawing state."
  - id: 2d.state.bitmap
    text: "The <...> current bitmap<^> are not part of the drawing state."

  - id: 2d.state.save
    text: "The save() method pushes a copy of the current drawing state onto the drawing state stack<^>."
  - id: 2d.state.restore
    text: "The restore() method pops the top entry in the drawing state stack, and resets the drawing state it describes<^>."
  - id: 2d.state.restore.underflow
    text: "If there is no saved state, the method does nothing<^>."

  - id: 2d.transformation.order
    text: "For instance, <...> the actual result will be a square<^>."
  - id: 2d.transformation.scale
    text: "The scale(x, y) method must add the scaling transformation described by the arguments to the transformation matrix<^>."
  - id: 2d.transformation.rotate
    text: "The rotate(angle) method must add the rotation transformation described by the argument to the transformation matrix<^>."
  - id: 2d.transformation.rotate.direction
    text: "The angle argument represents a clockwise rotation angle<^>"
  - id: 2d.transformation.rotate.radians
    text: "The angle argument <...> expressed in radians<^>."
  - id: 2d.transformation.translate
    text: "The translate(x, y) method must add the translation transformation described by the arguments to the transformation matrix<^>."

  - id: nonnegative.return
    text: "This algorithm will either return zero, a positive integer, or an error<^>."
  - id: nonnegative.leading
    text: "Leading spaces are ignored<^>."
  - id: nonnegative.trailing
    text: "Trailing spaces and indeed any trailing garbage characters are ignored<^>."
