OLD | NEW |
1 library html; | 1 library html; |
2 | 2 |
3 import 'dart:isolate'; | 3 import 'dart:isolate'; |
4 import 'dart:json'; | 4 import 'dart:json'; |
5 import 'dart:svg' as svg; | 5 import 'dart:svg' as svg; |
6 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 6 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
7 // for details. All rights reserved. Use of this source code is governed by a | 7 // for details. All rights reserved. Use of this source code is governed by a |
8 // BSD-style license that can be found in the LICENSE file. | 8 // BSD-style license that can be found in the LICENSE file. |
9 | 9 |
10 // DO NOT EDIT | 10 // DO NOT EDIT |
(...skipping 6223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6234 void webkitExitFullscreen() native; | 6234 void webkitExitFullscreen() native; |
6235 | 6235 |
6236 /** @domName Document.webkitExitPointerLock */ | 6236 /** @domName Document.webkitExitPointerLock */ |
6237 void webkitExitPointerLock() native; | 6237 void webkitExitPointerLock() native; |
6238 | 6238 |
6239 // TODO(jacobr): implement all Element methods not on Document. | 6239 // TODO(jacobr): implement all Element methods not on Document. |
6240 | 6240 |
6241 Element query(String selectors) { | 6241 Element query(String selectors) { |
6242 // It is fine for our RegExp to detect element id query selectors to have | 6242 // It is fine for our RegExp to detect element id query selectors to have |
6243 // false negatives but not false positives. | 6243 // false negatives but not false positives. |
6244 if (new RegExp("^#[_a-zA-Z]\\w*\$").hasMatch(selectors)) { | 6244 if (const RegExp("^#[_a-zA-Z]\\w*\$").hasMatch(selectors)) { |
6245 return $dom_getElementById(selectors.substring(1)); | 6245 return $dom_getElementById(selectors.substring(1)); |
6246 } | 6246 } |
6247 return $dom_querySelector(selectors); | 6247 return $dom_querySelector(selectors); |
6248 } | 6248 } |
6249 | 6249 |
6250 List<Element> queryAll(String selectors) { | 6250 List<Element> queryAll(String selectors) { |
6251 if (new RegExp("""^\\[name=["'][^'"]+['"]\\]\$""").hasMatch(selectors)) { | 6251 if (const RegExp("""^\\[name=["'][^'"]+['"]\\]\$""").hasMatch(selectors)) { |
6252 final mutableMatches = $dom_getElementsByName( | 6252 final mutableMatches = $dom_getElementsByName( |
6253 selectors.substring(7,selectors.length - 2)); | 6253 selectors.substring(7,selectors.length - 2)); |
6254 int len = mutableMatches.length; | 6254 int len = mutableMatches.length; |
6255 final copyOfMatches = new List<Element>(len); | 6255 final copyOfMatches = new List<Element>(len); |
6256 for (int i = 0; i < len; ++i) { | 6256 for (int i = 0; i < len; ++i) { |
6257 copyOfMatches[i] = mutableMatches[i]; | 6257 copyOfMatches[i] = mutableMatches[i]; |
6258 } | 6258 } |
6259 return new _FrozenElementList._wrap(copyOfMatches); | 6259 return new _FrozenElementList._wrap(copyOfMatches); |
6260 } else if (new RegExp("^[*a-zA-Z0-9]+\$").hasMatch(selectors)) { | 6260 } else if (const RegExp("^[*a-zA-Z0-9]+\$").hasMatch(selectors)) { |
6261 final mutableMatches = $dom_getElementsByTagName(selectors); | 6261 final mutableMatches = $dom_getElementsByTagName(selectors); |
6262 int len = mutableMatches.length; | 6262 int len = mutableMatches.length; |
6263 final copyOfMatches = new List<Element>(len); | 6263 final copyOfMatches = new List<Element>(len); |
6264 for (int i = 0; i < len; ++i) { | 6264 for (int i = 0; i < len; ++i) { |
6265 copyOfMatches[i] = mutableMatches[i]; | 6265 copyOfMatches[i] = mutableMatches[i]; |
6266 } | 6266 } |
6267 return new _FrozenElementList._wrap(copyOfMatches); | 6267 return new _FrozenElementList._wrap(copyOfMatches); |
6268 } else { | 6268 } else { |
6269 return new _FrozenElementList._wrap($dom_querySelectorAll(selectors)); | 6269 return new _FrozenElementList._wrap($dom_querySelectorAll(selectors)); |
6270 } | 6270 } |
(...skipping 1291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7562 void webkitRequestFullscreen() native; | 7562 void webkitRequestFullscreen() native; |
7563 | 7563 |
7564 /** @domName Element.webkitRequestPointerLock */ | 7564 /** @domName Element.webkitRequestPointerLock */ |
7565 void webkitRequestPointerLock() native; | 7565 void webkitRequestPointerLock() native; |
7566 | 7566 |
7567 } | 7567 } |
7568 | 7568 |
7569 // Temporary dispatch hook to support WebComponents. | 7569 // Temporary dispatch hook to support WebComponents. |
7570 Function dynamicUnknownElementDispatcher; | 7570 Function dynamicUnknownElementDispatcher; |
7571 | 7571 |
7572 final _START_TAG_REGEXP = new RegExp('<(\\w+)'); | 7572 final _START_TAG_REGEXP = const RegExp('<(\\w+)'); |
7573 class _ElementFactoryProvider { | 7573 class _ElementFactoryProvider { |
7574 static final _CUSTOM_PARENT_TAG_MAP = const { | 7574 static final _CUSTOM_PARENT_TAG_MAP = const { |
7575 'body' : 'html', | 7575 'body' : 'html', |
7576 'head' : 'html', | 7576 'head' : 'html', |
7577 'caption' : 'table', | 7577 'caption' : 'table', |
7578 'td': 'tr', | 7578 'td': 'tr', |
7579 'colgroup': 'table', | 7579 'colgroup': 'table', |
7580 'col' : 'colgroup', | 7580 'col' : 'colgroup', |
7581 'tr' : 'tbody', | 7581 'tr' : 'tbody', |
7582 'tbody' : 'table', | 7582 'tbody' : 'table', |
(...skipping 17261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
24844 if (length < 0) throw new ArgumentError('length'); | 24844 if (length < 0) throw new ArgumentError('length'); |
24845 if (start < 0) throw new RangeError.value(start); | 24845 if (start < 0) throw new RangeError.value(start); |
24846 int end = start + length; | 24846 int end = start + length; |
24847 if (end > a.length) throw new RangeError.value(end); | 24847 if (end > a.length) throw new RangeError.value(end); |
24848 for (int i = start; i < end; i++) { | 24848 for (int i = start; i < end; i++) { |
24849 accumulator.add(a[i]); | 24849 accumulator.add(a[i]); |
24850 } | 24850 } |
24851 return accumulator; | 24851 return accumulator; |
24852 } | 24852 } |
24853 } | 24853 } |
OLD | NEW |