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 exposes the types in [watcher], [safe_html], [templating] and | 6 * This library exposes the types in [watcher], [safe_html], [templating] and |
7 * the [WebComponent] base class. See this article for more information about | 7 * the [WebComponent] base class. See this article for more information about |
8 * this library: <http://www.dartlang.org/articles/dart-web-components/>. | 8 * this library: <http://www.dartlang.org/articles/dart-web-components/>. |
9 */ | 9 */ |
10 library web_components; | 10 library web_components; |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 static void _distribute(Element insertionPoint, List<Node> nodes) { | 259 static void _distribute(Element insertionPoint, List<Node> nodes) { |
260 assert(_isInsertionPoint(insertionPoint)); | 260 assert(_isInsertionPoint(insertionPoint)); |
261 for (var node in nodes) { | 261 for (var node in nodes) { |
262 insertionPoint.parent.insertBefore(node, insertionPoint); | 262 insertionPoint.parent.insertBefore(node, insertionPoint); |
263 } | 263 } |
264 insertionPoint.remove(); | 264 insertionPoint.remove(); |
265 } | 265 } |
266 | 266 |
267 // TODO(jmesserly): this forwarding is temporary until Dart supports | 267 // TODO(jmesserly): this forwarding is temporary until Dart supports |
268 // subclassing Elements. | 268 // subclassing Elements. |
| 269 // TODO(jmesserly): we were missing the setter for title, are other things |
| 270 // missing setters? |
269 | 271 |
270 List<Node> get nodes => _element.nodes; | 272 List<Node> get nodes => _element.nodes; |
271 | 273 |
272 set nodes(Collection<Node> value) { _element.nodes = value; } | 274 set nodes(Collection<Node> value) { _element.nodes = value; } |
273 | 275 |
274 /** | 276 /** |
275 * Replaces this node with another node. | 277 * Replaces this node with another node. |
276 */ | 278 */ |
277 Node replaceWith(Node otherNode) { _element.replaceWith(otherNode); } | 279 Node replaceWith(Node otherNode) { _element.replaceWith(otherNode); } |
278 | 280 |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
354 String get lang => _element.lang; | 356 String get lang => _element.lang; |
355 | 357 |
356 String get outerHTML => _element.outerHTML; | 358 String get outerHTML => _element.outerHTML; |
357 | 359 |
358 bool get spellcheck => _element.spellcheck; | 360 bool get spellcheck => _element.spellcheck; |
359 | 361 |
360 int get tabIndex => _element.tabIndex; | 362 int get tabIndex => _element.tabIndex; |
361 | 363 |
362 String get title => _element.title; | 364 String get title => _element.title; |
363 | 365 |
| 366 set title(String value) { _element.title = value; } |
| 367 |
364 bool get translate => _element.translate; | 368 bool get translate => _element.translate; |
365 | 369 |
366 String get webkitdropzone => _element.webkitdropzone; | 370 String get webkitdropzone => _element.webkitdropzone; |
367 | 371 |
368 void click() { _element.click(); } | 372 void click() { _element.click(); } |
369 | 373 |
370 Element insertAdjacentElement(String where, Element element) => | 374 Element insertAdjacentElement(String where, Element element) => |
371 _element.insertAdjacentElement(where, element); | 375 _element.insertAdjacentElement(where, element); |
372 | 376 |
373 void insertAdjacentHTML(String where, String html) { | 377 void insertAdjacentHTML(String where, String html) { |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
536 } | 540 } |
537 | 541 |
538 /** | 542 /** |
539 * Set this to true to use native Shadow DOM if it is supported. | 543 * Set this to true to use native Shadow DOM if it is supported. |
540 * Note that this will change behavior of [WebComponent] APIs for tree | 544 * Note that this will change behavior of [WebComponent] APIs for tree |
541 * traversal. | 545 * traversal. |
542 */ | 546 */ |
543 bool useShadowDom = false; | 547 bool useShadowDom = false; |
544 | 548 |
545 bool get _realShadowRoot => useShadowDom && ShadowRoot.supported; | 549 bool get _realShadowRoot => useShadowDom && ShadowRoot.supported; |
OLD | NEW |