Do not expose RenderingError::InvalidTransform in the public API
Related to #663 - I added RenderingError::InvalidTransform
to catch the internal condition where an invalid transform gets created during the process of rendering an element (e.g. transform="matrix(0 0 0 0 0 0)"
). In that case, the error bubbles up, and gets caught in Node::draw()
:
// https://www.w3.org/TR/css-transforms-1/#transform-function-lists
//
// "If a transform function causes the current transformation matrix of an
// object to be non-invertible, the object and its content do not get
// displayed."
Err(RenderingError::InvalidTransform) => Ok(draw_ctx.empty_bbox()),
RenderingError::InvalidTransform
is not meant to bubble up to the public API. Maybe we can have an InternalRenderingError
with that variant, that gets translated to RenderingError
for the public API, only if the "hard failure" cases are hit?