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

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

Issue 1123173003: Another try at appendHtml and insertAdjacentHtml should be consistently sanitized (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 7 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
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 $(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS { 7 $(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
8 factory $CLASSNAME() => document.createDocumentFragment(); 8 factory $CLASSNAME() => document.createDocumentFragment();
9 9
10 factory $CLASSNAME.html(String html, 10 factory $CLASSNAME.html(String html,
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 */ 86 */
87 void appendText(String text) { 87 void appendText(String text) {
88 this.append(new Text(text)); 88 this.append(new Text(text));
89 } 89 }
90 90
91 91
92 /** 92 /**
93 * Parses the specified text as HTML and adds the resulting node after the 93 * Parses the specified text as HTML and adds the resulting node after the
94 * last child of this document fragment. 94 * last child of this document fragment.
95 */ 95 */
96 void appendHtml(String text) { 96 void appendHtml(String text, {NodeValidator validator,
97 this.append(new DocumentFragment.html(text)); 97 NodeTreeSanitizer, treeSanitizer}) {
98 this.append(new DocumentFragment.html(text, validator: validator,
99 treeSanitizer: treeSanitizer));
98 } 100 }
99 101
100 /** 102 /**
101 * Alias for [querySelector]. Note this function is deprecated because its 103 * Alias for [querySelector]. Note this function is deprecated because its
102 * semantics will be changing in the future. 104 * semantics will be changing in the future.
103 */ 105 */
104 @deprecated 106 @deprecated
105 @Experimental() 107 @Experimental()
106 @DomName('DocumentFragment.querySelector') 108 @DomName('DocumentFragment.querySelector')
107 Element query(String relativeSelectors) { 109 Element query(String relativeSelectors) {
108 return querySelector(relativeSelectors); 110 return querySelector(relativeSelectors);
109 } 111 }
110 112
111 /** 113 /**
112 * Alias for [querySelectorAll]. Note this function is deprecated because its 114 * Alias for [querySelectorAll]. Note this function is deprecated because its
113 * semantics will be changing in the future. 115 * semantics will be changing in the future.
114 */ 116 */
115 @deprecated 117 @deprecated
116 @Experimental() 118 @Experimental()
117 @DomName('DocumentFragment.querySelectorAll') 119 @DomName('DocumentFragment.querySelectorAll')
118 ElementList<Element> queryAll(String relativeSelectors) { 120 ElementList<Element> queryAll(String relativeSelectors) {
119 return querySelectorAll(relativeSelectors); 121 return querySelectorAll(relativeSelectors);
120 } 122 }
121 $!MEMBERS 123 $!MEMBERS
122 } 124 }
OLDNEW
« no previous file with comments | « tools/dom/scripts/htmlrenamer.py ('k') | tools/dom/templates/html/impl/impl_Element.darttemplate » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698