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

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

Issue 1292963003: Fix identity and SVGAnimatedString issues with element_classes_test (Closed) Base URL: git@github.com:dart-lang/sdk.git@integration
Patch Set: Created 5 years, 4 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
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 4348ca5b8c6085fde550136d5784a98d43d2925d..6799c68ccf1a46e49da989cf4009a55c90ca9c08 100644
--- a/tools/dom/templates/html/impl/impl_Element.darttemplate
+++ b/tools/dom/templates/html/impl/impl_Element.darttemplate
@@ -97,7 +97,12 @@ class _ChildrenElementList extends ListBase<Element>
bool remove(Object object) {
if (object is Element) {
Element element = object;
+$if JSINTEROP
+ // We aren't preserving identity of nodes in JSINTEROP mode
+ if (element.parentNode == _element) {
+$else
if (identical(element.parentNode, _element)) {
+$endif
_element._removeChild(element);
return true;
}
@@ -1259,8 +1264,13 @@ $endif
// offsetParent, "tops out" at BODY. But people could conceivably pass in
// the document.documentElement and I want it to return an absolute offset,
// so we have the special case checking for HTML.
- bool foundAsParent = identical(current, parent) || parent.tagName == 'HTML';
- if (current == null || identical(current, parent)) {
+$if JSINTEROP
terry 2015/08/17 14:40:29 Comment? // We aren't preserving identity of node
+ bool sameAsParent = current == parent;
+$else
+ bool sameAsParent = identical(current, parent);
+$endif
+ bool foundAsParent = sameAsParent || parent.tagName == 'HTML';
+ if (current == null || sameAsParent) {
if (foundAsParent) return new Point(0, 0);
throw new ArgumentError("Specified element is not a transitive offset "
"parent of this element.");

Powered by Google App Engine
This is Rietveld 408576698