Created attachment 339399 [details] test.html See the testcase incoming, which does something useful in every other browser.
The problem doesn't seem to be with iframe.contentWindow.document. If I just add "var frm = document.getElementById('frm');" at the beginning, WebKit behaves identically to Chrome. I don't think it's standard to be able to reference HTML element by ID as named variables in JavaScript. I could be wrong.
(In reply to Danyao Wang from comment #1) > The problem doesn't seem to be with iframe.contentWindow.document. If I just > add "var frm = document.getElementById('frm');" at the beginning, WebKit > behaves identically to Chrome. > > I don't think it's standard to be able to reference HTML element by ID as > named variables in JavaScript. I could be wrong. See bug 183087; the id becomes a global variable unless it gets shadowed by another explicitly declared global variable. So if adding "var frm = document.getElementById('frm');" changes behavior in this example, that sounds like a bug, since frm should already be referring to that element.
I believe the issue is that WebKit wrongly uses the iframe's id as the iframe's window name. Because of the ordering of Window's named property getter, we return the iframe's window that matches 'frm' instead of the iframe with id 'frm'.
(In reply to Chris Dumez from comment #3) > I believe the issue is that WebKit wrongly uses the iframe's id as the > iframe's window name. Because of the ordering of Window's named property > getter, we return the iframe's window that matches 'frm' instead of the > iframe with id 'frm'. Ironically, looks like I fixed this in Blink a long time ago :) https://bugs.chromium.org/p/chromium/issues/detail?id=347169
*** This bug has been marked as a duplicate of bug 11388 ***
(In reply to Chris Dumez from comment #4) > (In reply to Chris Dumez from comment #3) > > I believe the issue is that WebKit wrongly uses the iframe's id as the > > iframe's window name. Because of the ordering of Window's named property > > getter, we return the iframe's window that matches 'frm' instead of the > > iframe with id 'frm'. > > Ironically, looks like I fixed this in Blink a long time ago :) > https://bugs.chromium.org/p/chromium/issues/detail?id=347169 Lol. Ok, thanks a lot, now I can report the CSS bug I really wanted to report :-)