Bug 129742

Summary: Form-association for <img> is inconsistent
Product: WebKit Reporter: David Kilzer (:ddkilzer) <ddkilzer>
Component: FormsAssignee: Ryosuke Niwa <rniwa>
Status: RESOLVED FIXED    
Severity: Normal CC: ahmad.saleem792, ap, bfulgham, cdumez, changseok, esprehn+autocc, ews-watchlist, gyuyoung.kim, mifenton, rniwa, tkent, webkit-bug-importer, zalan
Priority: P2 Keywords: BlinkMergeCandidate, InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
URL: data:text/html,<div id=willBeRemoved> <div> <form id=f1> <input id=in1> <img id=im1> </div> <input id=in3> <img id=im3> </div> <input id=in2> <img id=im2> <script>var f = document.getElementById('f1'); var d=document.getElementById('willBeRemoved'); d.parentNode.removeChild(d); alert('' + f['im1'] + ',' + f['im2'] + ',' + f['im3']);</script>
Attachments:
Description Flags
WIP none

David Kilzer (:ddkilzer)
Reported 2014-03-05 09:49:31 PST
From <https://code.google.com/p/chromium/issues/detail?id=336317>: Version: all (ancient WebKit bug) OS: all What steps will reproduce the problem? 1. Open the following URL: data:text/html,<div id=willBeRemoved> <div> <form id=f1> <input id=in1> <img id=im1> </div> <input id=in3> <img id=im3> </div> <input id=in2> <img id=im2> <script>var f = document.getElementById('f1'); var d=document.getElementById('willBeRemoved'); d.parentNode.removeChild(d); alert('' + f['im1'] + ',' + f['im2'] + ',' + f['im3']);</script> What is the expected output? What do you see instead? Expected: Alert "[object HTMLImageElement],undefined,[object HTMLImageElement]" according to the standard and Firefox. Actual: Alert "undefined,[object HTMLImageElement],undefined"
Attachments
WIP (5.11 KB, patch)
2022-11-12 22:30 PST, Ryosuke Niwa
no flags
David Kilzer (:ddkilzer)
Comment 1 2014-03-05 09:49:53 PST
David Kilzer (:ddkilzer)
Comment 2 2014-03-05 09:54:13 PST
Ahmad Saleem
Comment 3 2022-08-21 01:06:30 PDT
I am able to reproduce this using test case changed into JSFiddle: Link - https://jsfiddle.net/jscdb4mu/ Outputs across all browsers: *** Safari 15.6.1 on macOS 12.5.1 *** undefined,[object HTMLImageElement],undefined *** Safari Technology Preview 151 *** undefined,[object HTMLImageElement],undefined *** Firefox Nightly 105 *** [object HTMLImageElement],undefined,[object HTMLImageElement] *** Chrome Canary 106 *** [object HTMLImageElement],undefined,[object HTMLImageElement] __________________ Just wanted to share updated test results. Thanks!
Ryosuke Niwa
Comment 4 2022-11-12 22:30:09 PST
Ryosuke Niwa
Comment 5 2022-11-13 14:13:29 PST
EWS
Comment 6 2022-11-13 20:33:11 PST
Committed 256629@main (36537bb39ed8): <https://commits.webkit.org/256629@main> Reviewed commits have been landed. Closing PR #6447 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.