Closed Bug 19329 Opened 25 years ago Closed 23 years ago

default page background color differs between platforms [mac][gfx]

Categories

(Core :: XUL, defect, P4)

All
Mac System 8.5
defect

Tracking

()

RESOLVED FIXED
mozilla0.9

People

(Reporter: sfraser_bugs, Assigned: Brade)

References

Details

(Keywords: platform-parity)

Attachments

(1 file)

On Windows, the default page background color is white (i.e. for an HTML page
that does not specify a background color or image on the BODY tag, or through
CSS). On Mac and UNIX, it's gray. Why the difference?
I guess it has something to do with widget/nsLookAndFeel.cpp on Mac and Unix:
    case eColor_WindowBackground:
        aColor = NS_RGB(0xdd,0xdd,0xdd);
        break;
Assignee: leger → trudelle
Component: Browser-General → XP Toolkit/Widgets
QA Contact: leger → claudius
Setting QA Contact/component
Assignee: trudelle → sdagley
Priority: P3 → P4
Target Milestone: M13
reassigning to sdagley as p4 for m13
Status: NEW → ASSIGNED
Target Milestone: M13 → M15
why was this left on M13?  moving to m15
Blocks: 24206
Keywords: pp
*** Bug 26772 has been marked as a duplicate of this bug. ***
Summary: [PP] default page background color differs between platforms → default page background color differs between platforms
Why does sdagley have this? Reassigning to pierre, since this is really a layout 
issue.
Assignee: sdagley → pierre
Status: ASSIGNED → NEW
Assigning to ekrock: 1/3 of Pierre's NEW bugs to help reduce his doomage factor
Assignee: pierre → ekrock
Reassigned back to me these bugs that shouldn't have left my list.
Assignee: ekrock → pierre
On Windows the bkcolor is a system setting, as it is on gtk, qt and OS/2. The 
mac and BeOS implementations of nsLookAndFeel have hard-coded the values instead 
of getting the system values. (I did not look at the other platforms)

This is either OK as is, or the platform implementations of nsLookAndFeel 
that have hard-coded colors need to be updated to reflect system colors. This 
should probably be somebody else's bug...
sfraser: The CSS2 System Colors are a related yet separate issue. It was assigned 
to sdagley because the platform-specific implementations of nsLookAndFeel belong 
to XPWidgets. Bouncing back to XPWidgets.
Assignee: pierre → trudelle
QA Contact: claudius → jrgm
reassigning to rods, who I'm told has claimed this as his very own.
Assignee: trudelle → rods
The nsLookAndFeel on the make needs to get the system color for the background 
of pages just like the other platforms
Assignee: rods → dcone
On Mac, there is no widely accepted background color for HTML pages in the 
system, which is probably the reason why the platforms differ. However, Internet 
Config has a setting for the page background color, as well as visitied and 
unvisited links, and I think we should start using these.

davidm is in the process of adding Internet Config support, so there will be a 
service you can call to get info from IC.
Status: NEW → ASSIGNED
Target Milestone: M15 → M17
Target Milestone: M17 → M18
No longer blocks: 24206
This bug has been marked future because we have determined that it is not 
critical for netscape 6.0.  If you feel this is an error, or if it blocks your 
work in some way -- please attach your concern to the bug for reconsideration.
Target Milestone: M18 → Future
this may seem like a silly suggestion, but why don't we simply modify html.css
from this:

body {
  display: block;
  line-height: normal;
  margin: 8px;
}

to this:

body {
  display: block;
  line-height: normal;
  margin: 8px;
  background-color: white; /* ensures platform parity on background colors */	
}

In the future, we can add more platform specific stuff for a "more correct"
solution. In the here and now, we're consistent across platforms.

There is also a mozilla precident for this. The html.css frame background color
is defined as being white. This solution would simply be doing the same thing
for non-frame pages.

Thoughts?

David
This bug is not valid. We get the colour of the page background from the system,
and thus fit with the user's preferences by default. You could take three 
Windows systems and we would have a different page background colour on each;
it's not a per-platform thing it is a per-user thing.

If you want the default background changed for a particular platform, file a bug
directly on that platform. Mac and Xlib have a hard coded values, because (I
guess) those platforms do not have user-editable preferences for colours (!).

The proposed solution would not work due to clashing with CSS rules for 
background propagation (this is a complex issue, mail me if you want details).

Also, the "mozilla precedent" was actually a bug causing performance problems,
and you will see the frame background colours have now been set to transparent.
In any case, that white was not being used as 'white' anywhere. (The colour was
overriden by the document that was drawn on the frame itself.)

FWIW, bug 1004 is covering the issue of implementing nsLookAndFeel correctly on 
the Mac.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → INVALID
Reopening because nobody knows where the gray background is coming from. I asked 
the following question to Don, Buster, Waterson, Kevin and others last month but 
nobidy replied. Ian is persuaded that it comes from the nsPresContext constructor 
but I wrote 3 times already that it does not.
---
In html.css, when the viewport and viewport-scroll have "background-color: 
inherit", we get a gray background on the web pages - rgb(192,192,192) - but it 
doesn't come from nsLookAndFeel, nor StyleColorImpl::ResetFrom(), nor from
nsPresContext::nsPresContext(). Do you know where that default background is
set? 
Status: RESOLVED → REOPENED
Resolution: INVALID → ---
I should have added that when viewport and viewport-scroll don't have 
"background-color: inherit" (which isn't what we want) then the color comes from 
the LookAndFeel.
Bug 5721 is the general "support Internet Config properly" bug on the Mac.

This can be considered to be a part of that bug, if you like.
Blocks: 57234
Status: REOPENED → ASSIGNED
Summary: default page background color differs between platforms → default page background color differs between platforms [mac][gfx]
boy howdy. this bug has been around the block.

i know for a fact that this difference is causing certain pages to look crappy on 
mac when they look ok on win32. tables end up with a gray bg on mac, and on win32 
they're white and so it looks a-ok.

http://bugzilla.mozilla.org/show_bug.cgi?id=71775
I think the color we give (hardcoded) in the Mac version of nsLookAndFeel.cpp, 
should be white for eColor_WindowBackground.

I made this change (see Pierre's first comment for location) and haven't seen any 
problems in either theme.
brade, since you made the bg white, can you try 

http://www.headphone.com/ProductsHeadphones/SennheiserHD570.asp

and see if the table bg is gray or white? On the tip, it's an ugly gray.
Assignee: dcone → brade
Status: ASSIGNED → NEW
I'll take this bug and do the IC thing
Target Milestone: Future → mozilla0.9
Does IC default to #FFFFFF? Having a default other than #FFFFFF defeats the purpose of 
the setting because Web authors will keep overriding the user pref on a per page basis if 
the default is unacceptable to them. (Page authors, in general, don't want gray 
backgrounds. Defaulting to gray way back in Mosaic and Nav 1 was a bad idea.)
The default of Internet Config is irrelevant (but yes, it is white).  The reason 
is that if the Preference for using the "OS Settings" is checked, this is what 
the OS has set (whether the user has that setting in IC to orange, red, blue, 
gray, or white).

Henri--I don't understand your point.  If the user sets the preference in the OS, 
we should be following it (not trying to guess what a page author may or may not 
have wanted it to appear with).
Status: NEW → ASSIGNED
Patch looks good. My only reservation is the overhead of getting the IC service 
each time we request the page background or foreground color. Does anyone have 
opinions on this?
nsInternetConfigService::GetColor gets called 3 times for a new window open and 
once for each URL that is loaded.

Unfortunately I don't have the instrumentation installed right now to determine 
how long it takes to call into IC on my Mac.

If there is a performance problem, I think we should fix the problem of the 
nsPresContext constructor not calling into LookAndFeel when it may not need the 
information anyways (or some other related fix).

Other opinions?
fix checked in
Status: ASSIGNED → RESOLVED
Closed: 24 years ago23 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: