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