[Webkit-unassigned] [Bug 53752] New: [JSC binding] Inconsistent behavior of DOMStringMap

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Feb 3 20:33:31 PST 2011


https://bugs.webkit.org/show_bug.cgi?id=53752

           Summary: [JSC binding] Inconsistent behavior of DOMStringMap
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: PC
        OS/Version: Mac OS X 10.5
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: HTML DOM
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: tkent at chromium.org
                CC: mitz at webkit.org, sam at webkit.org
            Blocks: 53578


The behavior of the current JSC binding for DOMStringMap is:
  put: Handle JavaScript property first, then handle HTML attribute if there is not JS property.
  delete: ditto.
  get: Handle HTML attribute, then handle JavaScript property.

The get operation is inconsistent with put/delete.  So, we have the following curious behavior:

1> document.body.dataset.toString
function toString() { ...
2> document.body.setAttribute('data-to-string', 'attr')
3> document.body.dataset.toString
  "attr"
4> document.body.dataset.toString = function() { return "dataset"; }
5> document.body.dataset.toString
  "attr"

Even if one sets a new value to .toString [4], .toString doesn't return the new value [5].  It's not good.

I think it's reasonable to handle JavaScript properties first to protect JavaScript Object behavior.  However, we should do it in the get operation too and should give up providing "data-to-string" attribute via HTMLElement::dataset for consistency.

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



More information about the webkit-unassigned mailing list