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

Side by Side Diff: tools/dom/src/Validators.dart

Issue 1068573003: Update node_validator_test for IE11 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 8 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/html.status ('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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 dart.dom.html; 5 part of dart.dom.html;
6 6
7 7
8 /** 8 /**
9 * Interface used to validate that only accepted elements and attributes are 9 * Interface used to validate that only accepted elements and attributes are
10 * allowed while parsing HTML strings into DOM nodes. 10 * allowed while parsing HTML strings into DOM nodes.
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 final Location _loc = window.location; 104 final Location _loc = window.location;
105 105
106 bool allowsUri(String uri) { 106 bool allowsUri(String uri) {
107 _hiddenAnchor.href = uri; 107 _hiddenAnchor.href = uri;
108 // IE leaves an empty hostname for same-origin URIs. 108 // IE leaves an empty hostname for same-origin URIs.
109 return (_hiddenAnchor.hostname == _loc.hostname && 109 return (_hiddenAnchor.hostname == _loc.hostname &&
110 _hiddenAnchor.port == _loc.port && 110 _hiddenAnchor.port == _loc.port &&
111 _hiddenAnchor.protocol == _loc.protocol) || 111 _hiddenAnchor.protocol == _loc.protocol) ||
112 (_hiddenAnchor.hostname == '' && 112 (_hiddenAnchor.hostname == '' &&
113 _hiddenAnchor.port == '' && 113 _hiddenAnchor.port == '' &&
114 _hiddenAnchor.protocol == ':'); 114 (_hiddenAnchor.protocol == ':' || _hiddenAnchor.protocol == ''));
115 } 115 }
116 } 116 }
117 117
118 118
119 class _ThrowsNodeValidator implements NodeValidator { 119 class _ThrowsNodeValidator implements NodeValidator {
120 final NodeValidator validator; 120 final NodeValidator validator;
121 121
122 _ThrowsNodeValidator(this.validator) {} 122 _ThrowsNodeValidator(this.validator) {}
123 123
124 bool allowsElement(Element element) { 124 bool allowsElement(Element element) {
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 case Node.COMMENT_NODE: 202 case Node.COMMENT_NODE:
203 case Node.DOCUMENT_FRAGMENT_NODE: 203 case Node.DOCUMENT_FRAGMENT_NODE:
204 case Node.TEXT_NODE: 204 case Node.TEXT_NODE:
205 case Node.CDATA_SECTION_NODE: 205 case Node.CDATA_SECTION_NODE:
206 break; 206 break;
207 default: 207 default:
208 node.remove(); 208 node.remove();
209 } 209 }
210 } 210 }
211 } 211 }
OLDNEW
« no previous file with comments | « tests/html/html.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698