google-code-export / gwt-test-utils

Automatically exported from code.google.com/p/gwt-test-utils
1 stars 0 forks source link

Recursive implementation required for com.google.gwt.dom.client.DOMImpl#isOrHasChild #67

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The current implementation provided at 
com.octo.gwt.test.internal.patchers.dom.DOMImplPatcher#isOrHasChild does not 
operate recursive and thus will only recognize direct children elements. 
Implementations given by GWT for Mozilla et al. imply a recursive check for a 
parent-child relation.

Patch-method of ours:
@PatchMethod(override = true)
static boolean isOrHasChild(final Object domImpl, final Node parent, Node 
child) {
  while (child != null) {
    if (parent.equals(child)) {
      return true;
    }
    child = child.getParentNode();
  }
  return false;
}

Original issue reported on code.google.com by stefan.s...@googlemail.com on 15 Aug 2011 at 1:16

GoogleCodeExporter commented 9 years ago
I applied your patch and deploy new snapshots. Could you please give me some 
feeback again ?

Original comment by gael.laz...@gmail.com on 15 Aug 2011 at 2:26

GoogleCodeExporter commented 9 years ago
Of course, fix works like charm. :)

Original comment by stefan.s...@googlemail.com on 15 Aug 2011 at 2:47

GoogleCodeExporter commented 9 years ago

Original comment by gael.laz...@gmail.com on 15 Aug 2011 at 4:34

GoogleCodeExporter commented 9 years ago

Original comment by gael.laz...@gmail.com on 14 Sep 2011 at 6:03