Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor empty() to work better on non-IE browsers. #79

Closed
wants to merge 1 commit into from

Conversation

@wkeese
Copy link
Member

wkeese commented Apr 21, 2014

  1. Check node.innerHTML rather than node.canHaveChildren(), since the latter
    only works on IE.
  2. Limit empty(parent) to orphaning parent's children, rather than orphaning
    parent's grandchildren.

Fixes https://bugs.dojotoolkit.org/ticket/17869.

IIRC there was a lot of debate about whether a scorched-earth destroy() method did more harm than good on IE, and by corollary debate about how empty() should work. But empty() is somewhat a different ball of wax from destroy(): while destroy() is arguably supposed to work recursively, empty(parent) arguably shouldn't orphan the parent's grandchildren.

1. Test  node.innerHTML rather than node.canHaveChildren(), since the latter
only works on IE.
2. Limit empty(parent) to orphaning parent's children, rather than orphaning
parent's grandchildren.

Fixes #17869.
@wkeese

This comment has been minimized.

Copy link
Member Author

wkeese commented Apr 24, 2014

Pushed in ffbb6d4.

@wkeese wkeese closed this Apr 24, 2014
@wkeese wkeese deleted the wkeese:dom-empty branch Apr 24, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.