<?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>28867</bug_id>
          
          <creation_ts>2009-08-31 22:55:04 -0700</creation_ts>
          <short_desc>Presentation of fieldsets magically and irreversibly changes when the fieldset contains a legend</short_desc>
          <delta_ts>2018-08-16 12:19:23 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Layout and Rendering</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Mac (Intel)</rep_platform>
          <op_sys>OS X 10.5</op_sys>
          <bug_status>UNCONFIRMED</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>188643</blocked>
          <everconfirmed>0</everconfirmed>
          <reporter name="Justin French">justin</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>justin</cc>
    
    <cc>max</cc>
    
    <cc>webkit</cc>
    
    <cc>zcorpan</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>143777</commentid>
    <comment_count>0</comment_count>
    <who name="Justin French">justin</who>
    <bug_when>2009-08-31 22:55:04 -0700</bug_when>
    <thetext>When you add a legend element as a child to a fieldset, the fieldset&apos;s appearance changes in a way which isn&apos;t reflected in the Inspector, doesn&apos;t appear to be done with styles, and can&apos;t be corrected or reversed by applying additional styles.

I know and fully understand that this is the default presentation style for fieldsets with legends in many user agents, but my concern is that these visual changes do not appear to have been done with CSS, are not reflected in the Inspector pallet, and can&apos;t be reversed or altered by a stylesheet author who is aiming for a different presentation.

The Safari HTML reference seems to describe the behavior (emphasis mine):
&quot;This tag specifies the label for a fieldset (specified by the &lt;fieldset&gt; tag). The caption specified by content is *merged with the box surrounding the fieldset.*&quot;

I&apos;m not arguing that this should not be the default presentational style, but I am arguing that it should be achieved with regular styles and positioning, so that stylesheet authors can alter the presentation to suit their needs.  The only choice I seem to have right now is absolutely positioning the legend within a relatively positioned fieldset.

If it *is* possible to alter this default presentation (perhaps by altering a -webkit value somewhere, I&apos;d love for it to be known and documented.

For the record, when a fieldset has a legend child element added to it, the visual changes are best described as follows:

* hovering over the element with the inspector seems to show the box with the same top position (where it would be located if there was no legend element)
* the visual top edge of the fieldset box (where the border and background color starts) appears to shift down by half the line height of the legend element
* the legend element is shifted up by half it&apos;s line height</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>166692</commentid>
    <comment_count>1</comment_count>
      <attachid>43913</attachid>
    <who name="Maxwell Terpstra">max</who>
    <bug_when>2009-11-26 03:33:00 -0800</bug_when>
    <thetext>Created attachment 43913
fieldset/legend example/explaination and CSS equivalent</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>166693</commentid>
    <comment_count>2</comment_count>
    <who name="Maxwell Terpstra">max</who>
    <bug_when>2009-11-26 03:33:18 -0800</bug_when>
    <thetext>Two additional points about the visual affect of the legend:
* The fieldset&apos;s border is masked out in the area beneath the legend&apos;s border box, but the fieldset&apos;s background is not.
* The outer padding edge of the fieldset is aligned to the bottom edge of the legend.  The background, however, still reaches to the edge of the border box.

Neither of these effects are possible using CSS without additional markup and non-relative, pre-computed padding values.


I have attached an HTML document which illustrates the problem in detail and suggests possible CSS equivalents.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1450791</commentid>
    <comment_count>3</comment_count>
    <who name="Simon Pieters (:zcorpan)">zcorpan</who>
    <bug_when>2018-08-16 12:15:31 -0700</bug_when>
    <thetext>Proposal to be able to turn off magic for fieldset and legend at https://github.com/whatwg/html/issues/3912</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>43913</attachid>
            <date>2009-11-26 03:33:00 -0800</date>
            <delta_ts>2009-11-26 03:33:00 -0800</delta_ts>
            <desc>fieldset/legend example/explaination and CSS equivalent</desc>
            <filename>fieldset.html</filename>
            <type>text/html</type>
            <size>3756</size>
            <attacher name="Maxwell Terpstra">max</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+CjxodG1sPgo8aGVhZD4KIDx0aXRsZT5NYWdpY2FsIEZpZWxkc2V0IExl
Z2VuZCBTdHlsaW5nPC90aXRsZT4KIDxzdHlsZT4KCS8qIGxheW91dCBDU1MgbW9kZWwgbmV4dCB0
byB0aGUgZmllbGRzZXQgZm9yIGVhc2llciBjb21wYXJpc29uICovCgkjZmllbGRzZXQsICNkaXZz
IHsgZGlzcGxheTp0YWJsZS1jZWxsOyB3aWR0aDoxMGVtOyBwYWRkaW5nOjAgLjdlbTsgfQoKCS8q
IGF2b2lkIGVtIHJvdW5kaW5nIGVycm9ycyBieSB1c2luZyBwaXhlbCB3aWR0aHMgKi8KCWJvZHkg
eyBmb250LXNpemU6MTZweDsgbGluZS1oZWlnaHQ6MThweDsgIC8qIGFib3V0IDEycHQsIDEuMThl
bSBsaW5lLWhlaWdodCAqLyB9CglmaWVsZHNldCwgLmZpZWxkc2V0IHsgYm9yZGVyLXdpZHRoOjJw
eDsgfQoKCS8qIHJlZmVyZW5jZSBsaW5lIGZvciBmaWVsZHNldCB1cHBlciAibWFyZ2luIiAqLwoJ
LmJvcmRlckxpbmUgeyBib3JkZXItYm90dG9tOjFweCBzb2xpZCBibGFjazsgfQoKCS8qIG1ha2Ug
YmFja2dyb3VuZCBhcmVhIG9mIGZpZWxkc2V0IGFuZCBkaXYuZmllbGRzZXQgdmlzaWJsZSAqLwoJ
ZmllbGRzZXQsIC5maWVsZHNldCwgLmJvcmRlck1hc2sgeyBiYWNrZ3JvdW5kLWNvbG9yOiNEREY7
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