[Webkit-unassigned] [Bug 16999] New: Convert custom attributes to object properties

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jan 24 16:20:00 PST 2008


http://bugs.webkit.org/show_bug.cgi?id=16999

           Summary: Convert custom attributes to object properties
           Product: WebKit
           Version: 525+ (Nightly build)
          Platform: PC
               URL: https://ibsbjstar.ccb.com.cn/app/V5/CN/STY1/login.jsp
        OS/Version: Windows XP
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: HTML DOM
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: rjiang at gmail.com


To repro, goto: https://ibsbjstar.ccb.com.cn/app/V5/CN/STY1/login.jsp

If the above link is invalid, goto http://www.ccb.com and try to find the login
link. This is the top 3 bank in China and I use it a lot.

Type in something in the input boxes, click the red button to login. There will
be an alert box saying that:
"user id has undefined minLength attribute".

Look at the source of the page we can see that all the input has something
like:

<INPUT  maxLength=20 name=USERID minLength="1" ...>

Here minLength is not a standard attribute. Then in their JS, they do:

   if( (typeof fm[i].minLength) == "undefined" || fm[i].minLength == "" ){
     alert("blahblah");
     fm[i].focus();
     return false;
   }

fm[i] is child of the form, here it would be the input element.

Clearly they add some custom attributes and use that as a way to store extra
information. However they access it directly in JS like a property.

This is supported in IE, but not in FF.

More info: JS is at https://ibsbjstar.ccb.com.cn/V5/js5/ccblogin.js
And the frame source contains the input form is at:
https://ibsbjstar.ccb.com.cn/app/B2CMainPlatV5?CCB_IBSVersion=V5&CUSTYPE=0&TXCODE=CLOGIN&USERID=&DESKTOP=0&EXIT_PAGE=login.jsp

REDUCED test case (try it in IE and Safari)

<html><head></head><body>
<h1>Unknown attributes</h1>
<input id=userid type=text size=20 minLength=1 bizar="NO SUCH ATTR"
maxLength=10 title="User name"></input>
<div id="result"/>
<script>
  var s = "";
  s += "maxLength: " + userid.maxLength + "<br>";
  s += "minLength: " + userid.minLength + "<br>";
  var elm = document.getElementById("result");
  elm.innerHTML = s;
</script>
</body></html>


-- 
Configure bugmail: http://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list