V
V
VL54382020-05-02 16:03:26
css
VL5438, 2020-05-02 16:03:26

What is a canvas and in what case is a new nested canvas created?

The CSS22 specification describes what a canvas is, and the appendix to the CSS2.2 specification , which describes the overlay context, says the following:

The canvas is transparent if contained within another, and given a UA-defined color if it is not. It is infinite in extent and contains the root element. Initially, the viewport is anchored with its top left corner at the canvas origin.

In what cases is this nested canvas created? And what size will it be?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Kovalsky, 2020-05-02
@lazalu68

It is not written that the canvas is being created somewhere. It is written that the canvas is 1) transparent if it is inside another canvas and 2) has a color set by the user agent (browser for example) if it is not inside another canvas.
Update - everything I wrote above is bullshit, because I thought it was about Canvas . In fact, it's just about the space in which the document is rendered (which, by the way, almost does not change the essence):

For all media, the term canvas describes "the space where the formatting structure is rendered." The canvas is infinite for each dimension of the space, but rendering generally occurs within a finite region of the canvas, established by the user agent according to the target medium. For instance, user agents rendering to a screen generally impose a minimum width and choose an initial width based on the dimensions of the viewport. User agents rendering to a page generally impose width and height constraints. Aural user agents may impose limits in audio space, but not in time.

For example, the html and body elements are rendered within this very space, and this space has some default color. This color is transparent if the canvas is nested within another, or set by the browser if not.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question