OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 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. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 /** | 5 /** |
6 * This library exports all of the commonly used functions and types for | 6 * This library exports all of the commonly used functions and types for |
7 * building UI's. It is equivalent to the following imports: | 7 * building UI's. It is equivalent to the following imports: |
8 * | 8 * |
9 * import 'package:web_ui/observe.dart'; | 9 * import 'package:web_ui/observe.dart'; |
10 * import 'package:web_ui/safe_html.dart'; | 10 * import 'package:web_ui/safe_html.dart'; |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 | 227 |
228 | 228 |
229 /** | 229 /** |
230 * This is an implementation of the [distribution algorithm][1] from the | 230 * This is an implementation of the [distribution algorithm][1] from the |
231 * Shadow DOM spec. | 231 * Shadow DOM spec. |
232 * | 232 * |
233 * [1]: http://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.htm
l#dfn-distribution-algorithm | 233 * [1]: http://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.htm
l#dfn-distribution-algorithm |
234 */ | 234 */ |
235 List<Node> _distributeNodes(Element tree, List<Node> pool) { | 235 List<Node> _distributeNodes(Element tree, List<Node> pool) { |
236 // Repeat for each active insertion point in TREE, in tree order: | 236 // Repeat for each active insertion point in TREE, in tree order: |
237 for (var insertionPoint in tree.queryAll('content')) { | 237 for (var insertionPoint in tree.querySelectorAll('content')) { |
238 if (!_isActive(insertionPoint)) continue; | 238 if (!_isActive(insertionPoint)) continue; |
239 // Let POINT be the current insertion point. | 239 // Let POINT be the current insertion point. |
240 | 240 |
241 // TODO(jmesserly): validate selector, as specified here: | 241 // TODO(jmesserly): validate selector, as specified here: |
242 // http://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html
#matching-insertion-points | 242 // http://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html
#matching-insertion-points |
243 var select = insertionPoint.attributes['select']; | 243 var select = insertionPoint.attributes['select']; |
244 if (select == null || select == '') select = '*'; | 244 if (select == null || select == '') select = '*'; |
245 | 245 |
246 // Repeat for each node in POOL: | 246 // Repeat for each node in POOL: |
247 // 1. Let NODE be the current node | 247 // 1. Let NODE be the current node |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 * traversal. | 333 * traversal. |
334 */ | 334 */ |
335 bool useShadowDom = false; | 335 bool useShadowDom = false; |
336 | 336 |
337 bool get _realShadowRoot => useShadowDom && ShadowRoot.supported; | 337 bool get _realShadowRoot => useShadowDom && ShadowRoot.supported; |
338 | 338 |
339 /** | 339 /** |
340 * Set this to the [Element] to be used as the root for the Web UI app. | 340 * Set this to the [Element] to be used as the root for the Web UI app. |
341 */ | 341 */ |
342 Element webUIRoot = document.body; | 342 Element webUIRoot = document.body; |
OLD | NEW |