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

Side by Side Diff: tools/dom/templates/html/impl/impl_Element.darttemplate

Issue 26557004: Fix for events not firing on sanitized elements (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tests/html/element_test.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 part of $LIBRARYNAME; 5 part of $LIBRARYNAME;
6 6
7 class _ChildrenElementList extends ListBase<Element> { 7 class _ChildrenElementList extends ListBase<Element> {
8 // Raw Element. 8 // Raw Element.
9 final Element _element; 9 final Element _element;
10 final HtmlCollection _childElements; 10 final HtmlCollection _childElements;
(...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after
577 * group of selectors. 577 * group of selectors.
578 * 578 *
579 * [selectors] should be a string using CSS selector syntax. 579 * [selectors] should be a string using CSS selector syntax.
580 * 580 *
581 * var items = element.querySelectorAll('.itemClassName'); 581 * var items = element.querySelectorAll('.itemClassName');
582 */ 582 */
583 @DomName('Element.querySelectorAll') 583 @DomName('Element.querySelectorAll')
584 ElementList querySelectorAll(String selectors) => 584 ElementList querySelectorAll(String selectors) =>
585 new _FrozenElementList._wrap(_querySelectorAll(selectors)); 585 new _FrozenElementList._wrap(_querySelectorAll(selectors));
586 586
587 /** 587 /**
588 * Alias for [querySelector]. Note this function is deprecated because its 588 * Alias for [querySelector]. Note this function is deprecated because its
589 * semantics will be changing in the future. 589 * semantics will be changing in the future.
590 */ 590 */
591 @deprecated 591 @deprecated
592 @DomName('Element.querySelector') 592 @DomName('Element.querySelector')
593 @Experimental() 593 @Experimental()
594 Element query(String relativeSelectors) => querySelector(relativeSelectors); 594 Element query(String relativeSelectors) => querySelector(relativeSelectors);
595 595
596 /** 596 /**
597 * Alias for [querySelectorAll]. Note this function is deprecated because its 597 * Alias for [querySelectorAll]. Note this function is deprecated because its
598 * semantics will be changing in the future. 598 * semantics will be changing in the future.
599 */ 599 */
600 @deprecated 600 @deprecated
601 @DomName('Element.querySelectorAll') 601 @DomName('Element.querySelectorAll')
602 @Experimental() 602 @Experimental()
603 ElementList queryAll(String relativeSelectors) => 603 ElementList queryAll(String relativeSelectors) =>
604 querySelectorAll(relativeSelectors); 604 querySelectorAll(relativeSelectors);
605 605
606 /** 606 /**
(...skipping 715 matching lines...) Expand 10 before | Expand all | Expand 10 after
1322 fragment = _parseDocument.createDocumentFragment(); 1322 fragment = _parseDocument.createDocumentFragment();
1323 while (contextElement.firstChild != null) { 1323 while (contextElement.firstChild != null) {
1324 fragment.append(contextElement.firstChild); 1324 fragment.append(contextElement.firstChild);
1325 } 1325 }
1326 } 1326 }
1327 if (contextElement != _parseDocument.body) { 1327 if (contextElement != _parseDocument.body) {
1328 contextElement.remove(); 1328 contextElement.remove();
1329 } 1329 }
1330 1330
1331 treeSanitizer.sanitizeTree(fragment); 1331 treeSanitizer.sanitizeTree(fragment);
1332 // Copy the fragment over to the main document (fix for 14184)
1333 document.adoptNode(fragment);
1334
1332 return fragment; 1335 return fragment;
1333 } 1336 }
1334 1337
1335 /** 1338 /**
1336 * Parses the HTML fragment and sets it as the contents of this element. 1339 * Parses the HTML fragment and sets it as the contents of this element.
1337 * 1340 *
1338 * This uses the default sanitization behavior to sanitize the HTML fragment, 1341 * This uses the default sanitization behavior to sanitize the HTML fragment,
1339 * use [setInnerHtml] to override the default behavior. 1342 * use [setInnerHtml] to override the default behavior.
1340 */ 1343 */
1341 void set innerHtml(String html) { 1344 void set innerHtml(String html) {
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
1418 const ScrollAlignment._internal(this._value); 1421 const ScrollAlignment._internal(this._value);
1419 toString() => 'ScrollAlignment.$_value'; 1422 toString() => 'ScrollAlignment.$_value';
1420 1423
1421 /// Attempt to align the element to the top of the scrollable area. 1424 /// Attempt to align the element to the top of the scrollable area.
1422 static const TOP = const ScrollAlignment._internal('TOP'); 1425 static const TOP = const ScrollAlignment._internal('TOP');
1423 /// Attempt to center the element in the scrollable area. 1426 /// Attempt to center the element in the scrollable area.
1424 static const CENTER = const ScrollAlignment._internal('CENTER'); 1427 static const CENTER = const ScrollAlignment._internal('CENTER');
1425 /// Attempt to align the element to the bottom of the scrollable area. 1428 /// Attempt to align the element to the bottom of the scrollable area.
1426 static const BOTTOM = const ScrollAlignment._internal('BOTTOM'); 1429 static const BOTTOM = const ScrollAlignment._internal('BOTTOM');
1427 } 1430 }
OLDNEW
« no previous file with comments | « tests/html/element_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698