RESOLVED INVALID 141199
Range startContainer can't access parent 3 levels up in a contentEditable
https://bugs.webkit.org/show_bug.cgi?id=141199
Summary Range startContainer can't access parent 3 levels up in a contentEditable
Brandon Andrews
Reported 2015-02-03 09:45:59 PST
So startContainer in the range object behaves rather funny. It's like a pseudo element. === randomly fails when comparing to the DOM element got by getElementById, but .isEqualNode will always work. This might be correct to the spec I'm not sure, but one oddity in Webkit is that you can only access 2 parents up. If you do something like: range.startContainer.parentNode.parentNode.parentNode it returns null. If you get the element startContainer is referencing and do element.parentNode.parentNode.parentNode it returns the correct DOM element. Very odd behavior.
Attachments
Alexey Proskuryakov
Comment 1 2015-02-03 12:40:54 PST
Could you please attach a complete test case?
Brandon Andrews
Comment 2 2015-02-03 14:39:02 PST
I actually started trying to make a test case after submitting the bug assuming it would be easy to reproduce in a jsfiddle. I can't seem to reproduce it in a small test case even with most of the code. It's not really a big issue. I'm sure someone else will be able to replicate it sometime in a smaller project. This project is so large it's hard to rip out everything to see what could be causing such odd behavior. Sorry about that.
Note You need to log in before you can comment on or make changes to this bug.