<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>23810</bug_id>
          
          <creation_ts>2009-02-06 17:23:46 -0800</creation_ts>
          <short_desc>Multiple inheritance costs too much for HTMLInput/Option/.../SelectElement</short_desc>
          <delta_ts>2019-02-06 09:03:02 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>DOM</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>OS X 10.5</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>25617</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Nikolas Zimmermann">zimmermann</reporter>
          <assigned_to name="Nikolas Zimmermann">zimmermann</assigned_to>
          <cc>cdumez</cc>
    
    <cc>darin</cc>
    
    <cc>eric</cc>
    
    <cc>hyatt</cc>
    
    <cc>mjs</cc>
    
    <cc>sam</cc>
    
    <cc>staikos</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>108784</commentid>
    <comment_count>0</comment_count>
    <who name="Nikolas Zimmermann">zimmermann</who>
    <bug_when>2009-02-06 17:23:46 -0800</bug_when>
    <thetext>Recently some ABCs have been introduced to give the render tree an abstract access to form control elements, so RenderTextControl/RenderListBox/etc. can be used from outside HTML (before those classes depended on HTMLSelectElement/HTMLInputElement directly).

The simple &amp; dirty approach I&apos;ve chosen, costs too much memory, as Dave &amp; Sam pointed out in private talks, while I argued the waste is low (real-life pages don&apos;t use thousands of input/select elements), but still it hurts HTML, and is only of benefit for WML (at least at the moment, and it&apos;s even turned off by default). So it only hurts HTML without giving it any benefit, besides a cleaner interface to the render tree.

One approach, floating in my mind is just to have _one_ FormControlElement class, replacing InputElement/OptionElement/OptionGroupElement/FormControlWithStateElement/SelectElement. All methods could be moved in this central class for form control elements, not as pure-virtual methods, but as virtual-methods defaulting to &apos;ASSERT_NOT_REACHED&apos;. We could add some boolean methods isInputElement/isOptionElement to differentiate between the types of form control elements.

This would only add 4-bytes to HTMLInputElement, etc, which is really low, and it gives huge benefits for WML (able to reuse the Render* classes for form control elements). Currently ie. HTMLInputElement derives from HTMLFormControlElementWithState (deriving from HTMLElement, FormControlElementWithState, FormControlElement) and InputElement, which is 12-bytes.

That&apos;s just _one_ idea, this bug is meant as a container to discuss the future of this code.
I&apos;m filing this bug, to adress I&apos;m aware of the current limitations of the design, and I&apos;m willing to improve it, after I get some input, where the journey should end.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>108787</commentid>
    <comment_count>1</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2009-02-06 17:45:37 -0800</bug_when>
    <thetext>Another idea is to find a way to make the functions non-virtual in builds without HTML. InputElement would become a typedef for HTMLInputElement and we&apos;d include all the appropriate functions, perhaps by inheriting from a base class, but they would not be virtual functions.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>120449</commentid>
    <comment_count>2</comment_count>
    <who name="Nikolas Zimmermann">zimmermann</who>
    <bug_when>2009-05-08 12:13:47 -0700</bug_when>
    <thetext>This bug has been fixed yesterday.

*** This bug has been marked as a duplicate of 25617 ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1502892</commentid>
    <comment_count>3</comment_count>
    <who name="Lucas Forschler">lforschler</who>
    <bug_when>2019-02-06 09:03:02 -0800</bug_when>
    <thetext>Mass moving XML DOM bugs to the &quot;DOM&quot; Component.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>