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

Unified Diff: sky/examples/layout/basic.sky

Issue 1023753007: First iteration on custom layout. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: fix liscense header Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: sky/examples/layout/basic.sky
diff --git a/sky/examples/layout/basic.sky b/sky/examples/layout/basic.sky
new file mode 100644
index 0000000000000000000000000000000000000000..33496444f6aeaf8b66e96c913836058325159f61
--- /dev/null
+++ b/sky/examples/layout/basic.sky
@@ -0,0 +1,20 @@
+<parent style='background-color: lightblue;'>
+ <child style='background-color: pink;' />
+</parent>
+<script>
+import 'dart:sky';
+
+void main() {
+ var parent = document.querySelector('parent');
+ parent.setLayoutManager(() {
+ parent.width = 200.0;
+ parent.height = 100.0;
+
+ var child = document.querySelector('child');
+ child.x = 100.0;
+ child.y = 50.0;
+ child.width = 100.0;
+ child.height = 50.0;
+ });
+}
+</script>
abarth-chromium 2015/03/25 00:18:51 Can we make this into a test rather than an exampl
ojan 2015/04/02 00:02:29 Good point. This should be easy to test. I was jus
« sky/engine/core/dom/Element.cpp ('K') | « sky/engine/core/rendering/RenderCustomLayout.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698