Summary: | Convert custom attributes to object properties | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Rui Jiang <rjiang> | ||||
Component: | DOM | Assignee: | Nobody <webkit-unassigned> | ||||
Status: | RESOLVED WONTFIX | ||||||
Severity: | Normal | CC: | ahmad.saleem792, ap, bfulgham, cdumez, ggaren, gsnedders, mjs, rniwa | ||||
Priority: | P2 | ||||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | All | ||||||
OS: | All | ||||||
URL: | https://ibsbjstar.ccb.com.cn/app/V5/CN/STY1/login.jsp | ||||||
Attachments: |
|
Description
Rui Jiang
2008-01-24 16:19:59 PST
The interesting question is if IE does this for all custom attributes (mapping them to editable? properties on JS objects). I don't think we could ever implement this in WebKit, except as some sort of Quirks mode. FYI, WebKit had a mini version of this feature before, but we intentionally removed it for the sake of standards conformance. (I'm not trying to say it's out of the question -- just that the question has been raised and answered before.) (In reply to comment #1) > The interesting question is if IE does this for all custom attributes (mapping > them to editable? properties on JS objects). > > I don't think we could ever implement this in WebKit, except as some sort of > Quirks mode. > Yes, IE does this for all attributes that it doesn't recognize, and they are editable and you can still use getAttribute to query updated value: s += "getAttribute(\"minLength\"): " + userid.getAttribute("minLength") + "<br>"; userid.minLength = 99; s += "getAttribute(\"minLength\"): " + userid.getAttribute("minLength") + "<br>"; In IE, output is: getAttribute("minLength"): 1 getAttribute("minLength"): 99 Yes, I believe we even used to support this and took it out. It caused lots of problems. I don't think we plan to do this ever, but I'll defer to someone more expert in this area like Geoff or Maciej. Created attachment 18716 [details]
test case
Same test as an attachment.
(In reply to comment #4) > Yes, I believe we even used to support this and took it out. It caused lots of > problems. I don't think we plan to do this ever, but I'll defer to someone > more expert in this area like Geoff or Maciej. Do you remember what the problem were? This sounds like an important enough site to fix it if at all possible. I modified this test case slightly and added JS to using getAttribute to extract output of these custom attributes and it is working as intended: https://jsfiddle.net/ns5rk4ha/3/show All browsers (Chrome Canary 106, Firefox Nightly 105 and Safari 15.6 on macOS 12.6) show values of custom contributes. I am marking this as "RESOLVED CONFIGURATION CHANGED", please reopen, if my test case is different compared to test case attached or the issue in this bug is about. Thanks! Making properties out of unknown attributes is a not a thing, and at this point, this is WONTFIX. The reason why this test passes is misleading - minLength and maxLength are now actual real <input> attributes. |