[Webkit-unassigned] [Bug 37130] Add the const modififier to HTMLLabelElement::correspondingControl

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Apr 5 18:42:02 PDT 2010


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





--- Comment #3 from James Hawkins <jhawkins at chromium.org>  2010-04-05 18:42:01 PST ---
(In reply to comment #2)
> (From update of attachment 52594 [details])
> Generally speaking, it's not all that helpful to have const in the DOM tree.
> You can't traverse the tree without losing the const modifier anyway, so it's
> not normally a useful distinction, although we do have const here and there on
> DOM objects. Similarly, the notion of a const pointer to a DOM element doesn't
> exist in JavaScript or even in Objective-C.
> 
> Is it really important to be able to do this operation on a const
> HTMLLabelElement*? When would one of those even arise?

As a matter of style, it's best to use const objects when possible.  In Chrome
AutoFill, we have label parsing code that traverses the DOM in an
HTMLFormElement, pulling out the labels.  In the case where a form has
HTMLLabelElements, we just need to read the innerText() from the
HTMLLabelElement objects.  Since the parsing is a read-only operation, there's
really no reason not to have const objects.

-- 
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