Closed Bug 116161 Opened 24 years ago Closed 24 years ago

STYLE inside BODY breaks BodyFixupRule since it doesn't cause complete reframe anymore

Categories

(Core :: Layout, defect, P3)

x86
Windows 2000
defect

Tracking

()

RESOLVED FIXED
mozilla0.9.8

People

(Reporter: jud, Assigned: dbaron)

References

()

Details

(Whiteboard: [bae:20011220])

Attachments

(2 files, 4 obsolete files)

Visit said URL w/ a trunk build. notice the white boarder around the main bottom right frame. that border shouldn't be visible (it should be black).
hwaara, you touched this code last... wanna look?
Assignee: radha → hwaara
White border? Where? I can't see it. I only see purple and black colors on this page.
Ouch, I see it in my build from today. This must've regressed very recently.
Well, actually this isn't a HTML frames problem, the problem seems to be that the body bgcolor of http://www.stvlive.com/home/form.html is white on today's trunk, but should be black. It's not the frameborder.
Assignee: hwaara → attinasi
Summary: frame bordering is off → Body bgcolor is white but should be white
When we encountered a style element in the body, it caused a reframe, which results in the white margin area. If you happen to change the prefs to use system colors, it also causes the same effect. A very reduced testcase: <html> <head> <title></title> </head> <body BGCOLOR="#000000"> <style type="text/css"></style> <p><br></p> <p><br></p> </body> </html>
Severity: normal → minor
Priority: -- → P3
Whiteboard: [bae:20011220]
Target Milestone: --- → mozilla1.2
*** Bug 116636 has been marked as a duplicate of this bug. ***
*** Bug 116452 has been marked as a duplicate of this bug. ***
This bug is being frequently reported. Does anyone want to get us a testcase based on the URLs in the dups and this?
To rephrase, if a <style> element is found in the body tag -- the whole page will reframe and the background-color of the body will not be persisted. <body bgcolor="black"><style type="text/css"></body> will turn up with a white bgcolor! Hyatt, did you change something recently in this area?
Assignee: attinasi → hyatt
Severity: minor → major
Attached file Testcase —
Summary: Body bgcolor is white but should be white → STYLE inside BODY breaks BodyFixupRule since it doesn't cause complete reframe anymore
I think the solution to this problem is to remove the BodyFixupRule (and all the tons of bugs that it causes) and replace it with code in layout, where it should be handled. Really, this time. :-)
This patch replaces the BodyFixupRule with code in layout. It's work-in-progress, and it still has two problems I know about: * I no longer set the Foreground/Background color on the HTMLStyleSheet (I think this has some effect on tables) * The circles inside radio buttons are a little off-center -- I'm not sure whether this is a problem only in the GTK+ version of FillEllipse, or whether it's XP. (I replaced a background drawing call to do that with a FillEllipse, since it was the only call to nsCSSRendering::PaintBackground that passed in a style context that didn't correspond to the frame.) It fixes the testcase above and also passes all of the tests in http://hixie.ch/tests/adhoc/css/background/04.html (or does the same as the trunk, anyway) -- I didn't test subdirectories yet, as well as the background section of the CSS1 test suite. I need to go through some old bugs as well.
I also need to remember to test printing. :-)
...and taking bug. (Sorry, meant to do that in previous comment, but I accidentally hit tab before hitting enter.)
Assignee: hyatt → dbaron
Target Milestone: mozilla1.2 → mozilla0.9.8
Well, in order to solve the problem of the HTMLStyleSheet, I decided to try the solution of setting the document foreground/background color from the body element's attribute mapping function just like link, alink, and vlink, which would limit the table color quirk to when the attributes were used to set the document color, which, IMO, makes sense. I also need to remove the code in nsHTMLDocument that uses the HTMLStyleSheet as a backup repository for those colors and the code that applies those colors to the html element since the mapping to the html element doesn't work with the new solution and it's a real edge case (although I could apply them to the body element, I guess). But when I did this I saw some really weird things happen -- these were the result of HTMLDocumentColorRule::MapRuleInfoInto being completely wrong and overriding any properties higher in the cascade. This makes me think that in the past it somehow wasn't being used at all, and the table color quirk in question works some other way. I'll need to refresh my memory on exactly how that quirk is supposed to work...
The testcases in bug 70831 might be interesting for figuring out what the HTMLDocumentColorRule is for.
I'm unable to find a Nav4 quirk that applied the *background* color of the body to table cells. Anybody have any idea what it was?
Attached patch patch for testing (obsolete) — — Splinter Review
This patch fixes all the regressions that I know about. I'd appreciate if someone on Windows or Mac could try it to let me know if the selected radio button circles are centered within the button, or if that problem is Linux-only. Bugs this patch fixes: bug 54657 bug 60222 (why, or does it just hide the problem by making it worse? - this patch doesn't help bug 63863 or bug 80607, which is the same as bug 63863, at least now) bug 87103 bug 90194 bug 100650 I suspect it will fix bug 115855 but I didn't test. bug 115858 bug 116161 (this bug) bug 116468 Tests this does not cause regressions on: all of http://www.w3.org/Style/CSS/Test/current/sec53.htm all of http://hixie.ch/tests/adhoc/css/background/ (I need to try other tests like one on bug 54657, and other tests for table quirks, and other tests for various dynamic changes, and more printing tests)
> I'd appreciate if someone on Windows or Mac could try it to let me know if the > selected radio button circles are centered within the button, or if that > problem is Linux-only. To test that, you need only the patch in nsGfxRadioControlFrame.cpp.
That nsXULOuterTreeGroupFrame change shouldn't be there -- it's a warning fix, but it may be wrong, since I realize the function it's overriding is actually very slightly different. (However, the fix doesn't actually change the code, but it could be hiding a bug...)
With only the nsGfxRadioControlFrame.cpp patch applied, radiobuttons still work fine under win32. I tested the radiobuttons in bugzilla.
David, does your patch by any chance allow the removal of the background hackery in nsCSSFrameConstructor::AttributeChanged (http://lxr.mozilla.org/seamonkey/source/layout/html/style/src/nsCSSFrameConstru ctor.cpp#10521)?
The code mentioned in comment #22 is, I think, related to bug 63863, not this one (see my comment #18).
Attached patch revised patch (obsolete) — — Splinter Review
This patch fixes an outliner mistake I made, restores the old radio button code the same way, fixes the table background quirk to work as it should (in a bit of a hacky way, but then again, so was the old way), cleans up the FindBackground code, and probably some other things I forgot. The only remaining issue that I know of is that somehow expose events when moving a window on top perfectly horizontally, or selection, cause a big mess on certain pages, like http://www.w3.org/Style/CSS/Test/current/sec535.htm (which has a fixed background). I'm really not sure what would be causing that...
Attachment #62892 - Attachment is obsolete: true
Attached patch patch for review (I hope) (obsolete) — — Splinter Review
To fix the refresh bug, I needed to modify nsHTMLContainerFrame::CreateViewForFrame to use FindBackground. I also reduced the number of places where I needed to copy style structs -- I only copy when painting the canvas frame. Hopefully this should be ready for review, but I plan to run this patch through all the tests again.
Attachment #63068 - Attachment is obsolete: true
Attached patch patch for review — — Splinter Review
I ran through the same tests again with this patch, after fixing the problem with fixed backgrounds not working (see the comment in nsCSSRendering::PaintBackground).
Attachment #63131 - Attachment is obsolete: true
sr=hyatt. Run through hixie's suite of background/canvas tests.
> Run through hixie's suite of background/canvas tests. I did, both before I posted comment 18, and before I posted the last patch. (I'm assuming you mean the ones I mentioned in comment 18.)
Yep.
As far as I can tell, the way this is implemented will cause interesting problems once we let the root element take values of 'display' other than 'block'. (Such as 'inline' or '-moz-xul-box' or 'table-row'...) See bug 15462.
Comment on attachment 63516 [details] [diff] [review] patch for review very cool - r=attinasi
Attachment #63516 - Flags: review+
The problems Ian mentions in comment #30 would probably be problems in many other areas as well, and to solve them we'll have to write functions that do what the code I wrote here does (find the frame for the root element), and use those functions here and in other places.
Fix checked in 2002-01-07 15:45/46 PST.
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Think this caused regression seen in bug 119462.
There was also a regression which I just fixed in the handling of stretchy MathML characters. MathML frames that own stretchy MathML character also own additional leaf style contexts (because when stretching happens, some of the default CSS rules have to be disabled otherwise the piecewise glyphs that are juxtaposed to get the bigger character look as if they were misaligned). My change was simply to use PaintBackgroundWithSC() since the initial fix to this bug is only concerned with the default primary style context.
*** Bug 92496 has been marked as a duplicate of this bug. ***
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: