[Webkit-unassigned] [Bug 13894] Remove the legacy class KJS::JSHTMLElement

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon May 28 10:05:30 PDT 2007


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


darin at apple.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #14752|review?                     |review+
               Flag|                            |




------- Comment #2 from darin at apple.com  2007-05-28 10:05 PDT -------
(From update of attachment 14752)
+    if (impl()->hasTagName(aTag))
+        return UString(static_cast<const HTMLAnchorElement*>(impl())->href());

Shouldn't this code be in JSHTMLAnchorElement instead?

+static HTMLFormElement* getForm(HTMLElement* element)
+{
+    if (element->isGenericFormElement())
+        return static_cast<HTMLGenericFormElement*>(element)->form();
+    if (element->hasTagName(labelTag))
+        return static_cast<HTMLLabelElement*>(element)->form();
+    if (element->hasTagName(objectTag))
+        return static_cast<HTMLObjectElement*>(element)->form();
+
+    return 0;
+}

This should instead of a virtual function; maybe named
formForEventHandlerScope. The base implementation could be in HTMLElement (with
most of the form code from JSHTMLElement::pushEventHandlerScope), and then the
overriden versions for subclasses to do what getForm does.

+HTMLElement* toHTMLElement(JSValue *val)
+{
+    if (!val || !val->isObject(&JSHTMLElement::info))
+        return 0;
+    return
static_cast<HTMLElement*>(static_cast<JSHTMLElement*>(val)->impl());
+}

Don't functions like that get auto-generated for us? Why do we have to write
that one? I don't think it belongs in kjs_html.h/cpp regardless.

+// Runtime object support code for JSHTMLAppletElement, JSHTMLEmbedElement and
JSHTMLObjectElement.

Seems like this code needs to move into a new source file.

r=me


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