[Bug 10771] New: User agents disagree with each other and with the spec on rendering of multiple legends if the first one is styled


           Summary: User agents disagree with each other and with the spec
                    on rendering of multiple legends if the first one is
           Product: HTML WG
           Version: unspecified
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: HTML5 spec (editor: Ian Hickson)
        AssignedTo: ian@hixie.ch
        ReportedBy: bzbarsky@mit.edu
         QAContact: public-html-bugzilla@w3.org
                CC: ian@hixie.ch, mike@w3.org,
        Depends on: 10546

Ian 'Hixie' Hickson <ian@hixie.ch> changed:

           What    |Removed                     |Added
                 CC|                            |ian@hixie.ch
         Depends on|                            |10546

Consider this testcase:

    <legend style="position: absolute">aaa</legend>
The text added in bug 10547 defines Presto's behavior on this testcase, I
think.  Gecko and Webkit make the second legend into the legend rendered over
the border of the fieldset in this case.

Note that it's not just a matter of Webkit/Gecko operating on the box tree
while Presto operates on the DOM.  This testcase:

    <legend style="display: none">aaa</legend>

is interoperably rendered in Presto/Gecko/Webkit with "bbb" as the legend,
which doesn't match what bug 10547 specified.

--- Comment #1 from Boris Zbarsky <bzbarsky@mit.edu> 2010-09-27 18:02:06 UTC ---
For what it's worth the Gecko behavior is that when constructing CSS boxes, if
we're constructing a box for an HTML <legend> element whose parent in the DOM
is an HTML <fieldset> element and if the parent box of the given box is a
fieldset box (this part is needed to deal with XBL stuff) and if the <legend>
element is in-flow then we create a special legend box for the element.  This
box is more or less like a block in most respects.  Note that we can end up
creating more than one legend box for a given fieldset (e.g. if you just have
two unstyled legends).

Then once we have constructed all the child boxes for the fieldset, we scan the
list of child boxes looking for the first legend box, if any.  If one is found,
we use that a the legend for the fieldset, pulling it out of the normal in-flow
child list.

And of course on dynamic mutations things have to update properly (e.g.
removing the fieldset's legend has to pick up the next one; inserting legends
needs to notice them, etc).

--- Comment #2 from Boris Zbarsky <bzbarsky@mit.edu> 2010-09-27 18:04:01 UTC ---
Simple testcase of part of that last bit, which is passed by
Gecko/Presto/Webkit (though Webkit paints wrong):

  <legend id="x" style="display: none">This should now be the legend</legend>
  <legend onclick="document.getElementById('x').style.display = ''">Click

Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Wednesday, 29 September 2010 18:52:24 UTC