Last Comment Bug 740743 - overflow not implemented for legend elements inside fieldset
: overflow not implemented for legend elements inside fieldset
Status: RESOLVED FIXED
: testcase
Product: Core
Classification: Components
Component: Layout (show other bugs)
: Trunk
: All All
: -- normal (vote)
: mozilla14
Assigned To: Mats Palmgren (:mats)
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-03-30 02:30 PDT by lifescholar
Modified: 2012-04-15 11:39 PDT (History)
8 users (show)
mats: in‑testsuite+
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
sample html (376 bytes, text/html)
2012-04-01 11:44 PDT, Alice0775 White
no flags Details
fix+test (15.73 KB, patch)
2012-04-07 05:15 PDT, Mats Palmgren (:mats)
bzbarsky: review+
Details | Diff | Review

Description lifescholar 2012-03-30 02:30:13 PDT
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:14.0) Gecko/20120329 Firefox/14.0a1
Build ID: 20120329031156

Steps to reproduce:

Navigate to page http://forms.enfield.gov.uk/swiftlg/apas/run/wphappcriteria.display


Actual results:

Text box labels display incorrectly in Nightly 14 Mozilla/5.0 (Windows NT 6.1; WOW64; rv:14.0) Gecko/20120329 Firefox/14.0a1 ID:20120329031156

The "correct" text box labels seem to be overlayed with an incorrect set of labels that obscure the correct ones and should not be displayed.


Expected results:

Text box labels appear fine in IE 9.
Comment 1 Cork 2012-03-30 02:53:15 PDT
What happens is the page tries to hide legend content through setting overflow: hidden and width/height: 0;

Firefox doesn't apply overflow on legend elements and as far as i can tell never have (not sure about the standards).

The obvious solution would be for the page to use display: none; in its .hidden class instead.
Comment 2 Alice0775 White 2012-04-01 11:44:23 PDT
Created attachment 611299 [details]
sample html

Firefox shows the text of legend.
Opera and Chrome does not show the text of legend.
Comment 3 Boris Zbarsky [:bz] 2012-04-02 10:00:51 PDT
The standards don't define the behavior of <legend> at all.

We could pretty easily convert overflow:hidden on <legend> into a cliprect.  Actually supporting scrolling on it would take more work, but might be a good idea...
Comment 4 Daniel.S 2012-04-02 10:29:18 PDT
(In reply to Cork from comment #1)
> Firefox doesn't apply overflow on legend elements and as far as i can tell
> never have (not sure about the standards).

I was aware that this bug exists for fieldset (bug 261037 and bug 504622) and table-caption (partly, bug 553977), but I didn't know that the legend element is affected as well.

> The obvious solution would be for the page to use display: none; in its
> .hidden class instead.

The website tries to hide the labels in an accessible manner using absolute positioning, but that doesn't work, because 'absolute' is misspelled 'adsolute'.
That's all what's needed to fix the website.

(In reply to Boris Zbarsky (:bz) from comment #3)
> The standards don't define the behavior of <legend> at all.

Apparently a short text has been added to HTML5's list of expectations not long ago:
http://www.w3.org/TR/html5/rendering.html#rendered-legend

But that's still no real definition.
Comment 6 Boris Zbarsky [:bz] 2012-04-09 19:20:14 PDT
Comment on attachment 613093 [details] [diff] [review]
fix+test

r=me
Comment 8 Marco Bonardo [::mak] 2012-04-14 06:42:12 PDT
https://hg.mozilla.org/mozilla-central/rev/843a8a7b54c5
Comment 9 lifescholar 2012-04-15 11:39:52 PDT
Now fixed and tested OK in today's nightly build on original page showing problem.

Mozilla/5.0 (Windows NT 6.1; WOW64; rv:14.0) Gecko/20120415 Firefox/14.0a1 ID:20120415030725

Note You need to log in before you can comment on or make changes to this bug.