Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(729)

Side by Side Diff: tests/html/shadow_dom_layout_test.dart

Issue 10690052: added shadow dom layout test (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: addressed sigmund's comments Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tests/html/html.status ('k') | tests/html/shadow_dom_layout_test.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 #library('ShadowDOMTest');
6
7 #import('dart:html');
8
9 // Test that children of a shadow host get distributed properly to the
10 // insertion points of a shadow subtree. Output should be three boxes,
11 // ordered blue, red, green down the page.
12 main() {
13 var div = new DivElement();
14 document.body.elements.add(div);
15
16 // build some DOM elements
17 var bluebox = _colorBox('blue', 40, 20);
18 bluebox.classes.add('foo');
19 var redbox = _colorBox('red', 30, 30);
20 var greenbox = _colorBox('green', 60, 10);
21
22 // assemble DOM
23 var sRoot = new ShadowRoot(div);
24 sRoot.nodes.add(new Element.html('<content select=".foo"></content>'));
25 sRoot.nodes.add(redbox);
26 sRoot.nodes.add(new Element.tag('content'));
27
28 div.nodes.add(bluebox);
29 div.nodes.add(greenbox);
30 }
31
32 DivElement _colorBox(String color, int width, int height) {
33 var style = ('background-color:$color; '
34 'width:${width}px; height:${height}px;');
35 return new Element.html('<div style="$style"></div>');
36 }
OLDNEW
« no previous file with comments | « tests/html/html.status ('k') | tests/html/shadow_dom_layout_test.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698