| OLD | NEW |
| 1 Sky Markup: Syntax | 1 Sky Markup: Syntax |
| 2 ================== | 2 ================== |
| 3 | 3 |
| 4 A Sky file must consist of the following components: | 4 A Sky file must consist of the following components: |
| 5 | 5 |
| 6 1. If the file is intended to be a top-level Sky application, the | 6 1. If the file is intended to be a top-level Sky application, the |
| 7 string "```#!mojo mojo:sky```" followed by a U+0020, U+000A or | 7 string "```#!mojo mojo:sky```" followed by a U+0020, U+000A or |
| 8 U+000D character. | 8 U+000D character. |
| 9 | 9 |
| 10 If the file is intended to be a module, then the string "SKY", a | 10 If the file is intended to be a module, then the string "SKY", a |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 3. Same sequence of characters as "tag name" above. | 137 3. Same sequence of characters as "tag name" above. |
| 138 4. ```>``` | 138 4. ```>``` |
| 139 | 139 |
| 140 | 140 |
| 141 Sky Markup: Elements | 141 Sky Markup: Elements |
| 142 ==================== | 142 ==================== |
| 143 | 143 |
| 144 The Sky language consists of very few elements, since it is expected | 144 The Sky language consists of very few elements, since it is expected |
| 145 that everything of note would be provided by frameworks. | 145 that everything of note would be provided by frameworks. |
| 146 | 146 |
| 147 <import src="foo.sky"> | 147 ```<import src="foo.sky">``` |
| 148 - Downloads and imports foo.sky in the background. | 148 - Downloads and imports foo.sky in the background. |
| 149 | 149 |
| 150 <import src="foo.sky" as="foo"> | 150 ```<import src="foo.sky" as="foo">``` |
| 151 - Downloads and imports foo.sky in the background, using "foo" as its | 151 - Downloads and imports foo.sky in the background, using "foo" as its |
| 152 local name (see <script>). | 152 local name (see ```<script>```). |
| 153 | 153 |
| 154 <template> | 154 ```<template>``` |
| 155 - The contents of the element aren't placed in the Element itself. | 155 - The contents of the element aren't placed in the Element itself. |
| 156 They are instead placed into a DocumentFragment that you can obtain | 156 They are instead placed into a DocumentFragment that you can obtain |
| 157 from the element's "content" attribute. | 157 from the element's "content" attribute. |
| 158 | 158 |
| 159 <script> | 159 ```<script>``` |
| 160 - Blocks until all previous imports have been loaded, then runs the | 160 - Blocks until all previous imports have been loaded, then runs the |
| 161 script, with either 'module' or 'application' as the first | 161 script, with either 'module' or 'application' as the first |
| 162 argument, the exports of any imports that have "as" attributes at | 162 argument, the exports of any imports that have "as" attributes at |
| 163 this time passed in as subsequent arguments, and with "this" set to | 163 this time passed in as subsequent arguments, and with "this" set to |
| 164 null. | 164 null. |
| 165 | 165 |
| 166 <style> | 166 ```<style>``` |
| 167 - Adds the contents to the document's styles. | 167 - Adds the contents to the document's styles. |
| 168 | 168 |
| 169 <content> | 169 ```<content>``` |
| 170 <content select="..."> | 170 ```<content select="...">``` |
| 171 - In a shadow tree, acts as an insertion point for distributed nodes. | 171 - In a shadow tree, acts as an insertion point for distributed nodes. |
| 172 The select="" attribute gives the selector to use to pick the nodes | 172 The select="" attribute gives the selector to use to pick the nodes |
| 173 to place in this insertion point; it defaults to everything. | 173 to place in this insertion point; it defaults to everything. |
| 174 | 174 |
| 175 <shadow> | 175 ```<shadow>``` |
| 176 - In a shadow tree, acts as an insertion point for older shadow trees. | 176 - In a shadow tree, acts as an insertion point for older shadow trees. |
| 177 | 177 |
| 178 <img src="foo.bin"> | 178 ```<img src="foo.bin">``` |
| 179 - Sky fetches the bits for foo.bin, looks for a decoder for those | 179 - Sky fetches the bits for foo.bin, looks for a decoder for those |
| 180 bits, and renders the bits that the decoder returns. | 180 bits, and renders the bits that the decoder returns. |
| 181 | 181 |
| 182 <iframe src="foo.bin"> | 182 ```<iframe src="foo.bin">``` |
| 183 - Sky tells mojo to open an application for foo.bin, and hands that | 183 - Sky tells mojo to open an application for foo.bin, and hands that |
| 184 application a view so that the application can render appropriately. | 184 application a view so that the application can render appropriately. |
| 185 | 185 |
| 186 <t> | 186 ```<t>``` |
| 187 - Within a <t> section, whitespace is not trimmed from the start and | 187 - Within a ```<t>``` section, whitespace is not trimmed from the start and |
| 188 end of text nodes by the parser. | 188 end of text nodes by the parser. |
| 189 TOOD(ianh): figure out if the authoring aesthetics of this are ok | 189 TOOD(ianh): figure out if the authoring aesthetics of this are ok |
| 190 | 190 |
| 191 <a href="foo.bin"> | 191 ```<a href="foo.bin">``` |
| 192 - A widget that, when invoked, causes mojo to open a new application | 192 - A widget that, when invoked, causes mojo to open a new application |
| 193 for "foo.bin". | 193 for "foo.bin". |
| 194 | 194 |
| 195 <title> | 195 ```<title>``` |
| 196 - Sets the contents as the document's title (as provided by Sky to | 196 - Sets the contents as the document's title (as provided by Sky to |
| 197 the view manager). (Actually just ensures that any time the element | 197 the view manager). (Actually just ensures that any time the element |
| 198 is mutated, theTitleElement.ownerScope.ownerDocument.title is set | 198 is mutated, theTitleElement.ownerScope.ownerDocument.title is set |
| 199 to the element's contents.) | 199 to the element's contents.) |
| 200 | 200 |
| 201 | 201 |
| 202 Sky Markup: Global Attributes | 202 Sky Markup: Global Attributes |
| 203 ============================= | 203 ============================= |
| 204 | 204 |
| 205 The following attributes are available on all elements: | 205 The following attributes are available on all elements: |
| 206 | 206 |
| 207 id="" (any value) | 207 id="" (any value) |
| 208 class="" (any value, space-separated) | 208 class="" (any value, space-separated) |
| 209 style="" (declaration part of a Sky style rule) | 209 style="" (declaration part of a Sky style rule) |
| 210 lang="" (language code) | 210 lang="" (language code) |
| 211 dir="" (ltr or rtl only) | 211 dir="" (ltr or rtl only) |
| 212 | 212 |
| 213 contenteditable="" (subject to future developments) | 213 contenteditable="" (subject to future developments) |
| 214 tabindex="" (subject to future developments) | 214 tabindex="" (subject to future developments) |
| OLD | NEW |