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

Unified Diff: tools/dom/templates/html/impl/impl_Element.darttemplate

Issue 1365093003: Fix node_validator xss tests for IE and Firefox (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/dom/src/Validators.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/dom/templates/html/impl/impl_Element.darttemplate
diff --git a/tools/dom/templates/html/impl/impl_Element.darttemplate b/tools/dom/templates/html/impl/impl_Element.darttemplate
index 180a0b9d1d74456e31dd68b8e1f564cee61d412d..15c6f76a5b5348545f6abc893d9583513b1c07f0 100644
--- a/tools/dom/templates/html/impl/impl_Element.darttemplate
+++ b/tools/dom/templates/html/impl/impl_Element.darttemplate
@@ -1453,6 +1453,24 @@ $if DART2JS
return true;
}
}
+ var length = 0;
+ if (element.children) {
+ length = element.children.length;
+ }
+ for (var i = 0; i < length; i++) {
+ var child = element.children[i];
+ // On IE it seems like we sometimes don't see the clobbered attribute,
+ // perhaps as a result of an over-optimization. Also use another route
+ // to check of attributes, children, or lastChild are clobbered. It may
+ // seem silly to check children as we rely on children to do this iteration,
+ // but it seems possible that the access to children might see the real thing,
+ // allowing us to check for clobbering that may show up in other accesses.
+ if (child["id"] == 'attributes' || child["name"] == 'attributes' ||
+ child["id"] == 'lastChild' || child["name"] == 'lastChild' ||
+ child["id"] == 'children' || child["name"] == 'children') {
+ return true;
+ }
+ }
return false;
})(#)''', element);
}
@@ -1485,11 +1503,11 @@ $else
}
$endif
- String get _safeTagName {
+ static String _safeTagName(element) {
String result = 'element tag unavailable';
try {
- if (tagName is String) {
- result = tagName;
+ if (element.tagName is String) {
+ result = element.tagName;
}
} catch (e) {}
return result;
« no previous file with comments | « tools/dom/src/Validators.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698