Closed Bug 340063 Opened 18 years ago Closed 16 years ago

The LEGEND element ignores the CSS properties FLOAT and POSITION in Author stylesheets

Categories

(Core :: Layout, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 269908

People

(Reporter: christopher.bentley, Unassigned)

References

()

Details

User-Agent:       Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/418 (KHTML, like Gecko) Safari/417.9.3
Build Identifier: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8.0.3) Gecko/20060426 Firefox/1.5.0.3

An Author CSS stylesheet cannot overrule the Browser's CSS rules for the LEGEND element for the CSS properties FLOAT and POSITION. Author stylesheets should be able to overrule Browser stylesheets.

In the Firefox stylesheet located at (./res/forms.css) the LEGEND selector has rules (quoted below) which set properties for FLOAT and POSITION with an "!important" statement and cannot be overruled by an Author CSS stylesheet.

legend {
  padding-left: 2px;
  padding-right: 2px;
  border: none;
  position: static ! important;
  float: none ! important;
}


If I delete the !important statements from this rule then Firefox renders the LEGEND element in the test case as expected for floated LEGENDs but a Positioned LEGEND is not poistioned correctly.

Safari version 2.0.3 (417.9.3) renders this test as expected.

Reproducible: Always

Steps to Reproduce:
See test case:
http://code.clientside.net.au/firefox/legend.html


Expected Results:  
Author stylesheets should have precedence over Browser stylesheets
Roughly speaking, bug 292736?
Component: General → Layout
Product: Firefox → Core
QA Contact: general → layout
Version: unspecified → Trunk
just run into this using Mozilla/5.0 (Windows; U; Windows NT 5.1; en_US; rv:1.8.1b2) Gecko/20060824 Firefox/1.5


Looking with Dom-Inspector at the structure of a HTML Form I see that 

LEGEND

has assigned CSS from resource://gre/res/forms.css, namely

float: none !important;
position: static !important;


Now, wouldn't it help to just remove this "important" flags from the gre/res/forms.css?


I have an older mozilla build that does not show this and I can reposition the LEGEND element to where ever I want.


Suggest to change Severity to "Major" since I cannot find a workaround around this issue
Note that before we had the !important rules we enforced not positioning the legend in C++.  See the diff in bug 263406.

In any case, the problem is that the fieldset/legend combination depends on a particular frame tree relationship, and positioning the legend would break that relationship.  If nothing else were changed, removing the !important would most likely introduce crash bugs; it certainly did last I looked at that code.

The right way to fix this is probably to remove the special relationship somehow, but given the way fieldset borders are expected to be painted, and the way fieldsets are expected to be sized, it's not exactly clear how.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Blocks: 315474
No longer blocks: 315474
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.