root-canvas-001

Canvas: Embedded documents

WeasyPrint

This browser

Source

 1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
 2 <html>
 3  <head>
 4   <title>CSS Test: Canvas: Embedded documents</title>
 5   <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch">
 6   <link rel="author" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact">
 7   <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/model/canvas/001.html" type="text/html">
 8   <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#viewport">
 9   <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#containing-block-details">
10     <style type="text/css">
11    div { width: 10em; height: 10em; border: solid lime; background: red; padding: 0; }
12    object { width: 10em; height: 10em; margin: 0; padding: 0; border: 0; }
13   </style>
14  </head>
15  <body>
16   <p>There should be no red on this page, only a square green box with white
17   text and a lime green border.</p>
18   <div><object type="text/html" data="support/root-canvas-001a.html">FAIL</object></div>
19 
20   <!-- reasoning:
21 
22     Section 9.1.1:
23     # There is at most one viewport per canvas
24      -> http://www.w3.org/TR/CSS21/visuren.html#q2
25 
26     Section 2.3.1:
27     # the term canvas describes "the space where the formatting
28     # structure is rendered."
29      -> http://www.w3.org/TR/CSS21/intro.html#q4
30 
31     Section 2.3, item 5:
32     # From the annotated document tree, generate a formatting
33     # structure.
34      -> http://www.w3.org/TR/CSS21/intro.html#processing-model
35 
36     Section 2.3, item 1:
37     # Parse the source document and create a document tree.
38      -> http://www.w3.org/TR/CSS21/intro.html#processing-model
39 
40     ...therefore is a viewport per rendered document. Since there are
41     two documents on this page (the main one and the one in the
42     object) there are two viewports.
43 
44     The question becomes, what size is the viewport on the object
45     element. The spec doesn't define this, but if we consider the
46     desired results of the following proposed rule:
47 
48        @viewport { overflow: scroll; }
49 
50     ...I don't think it makes sense for the viewport to be anything
51     other than the size of the object element's box.
52 
53     -->
54 
55  </body>
56 </html>