Closed Bug 400452 Opened 17 years ago Closed 17 years ago

[FIX]"Always use my page and link colors" no longer overrides color attributes of <body>

Categories

(Core :: CSS Parsing and Computation, defect, P2)

defect

Tracking

()

RESOLVED FIXED
mozilla1.9beta2

People

(Reporter: bugzilla, Assigned: bzbarsky)

References

()

Details

(Keywords: regression, Whiteboard: [dbaron-1.9:RuCo])

Attachments

(2 files)

User-Agent:       Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en; rv:1.9a9pre) Gecko/2007101900 Camino/2.0a1pre (like Firefox/3.0a9pre)
Build Identifier: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en; rv:1.9a9pre) Gecko/2007101900 Camino/2.0a1pre (like Firefox/3.0a9pre)

On some sites (but not all), page and link colors are displayed according to the site specification even when I have the "Always use my page and link colors" preference selected. This behaviour is new to the 2.0a1pre nightlies (I've lately been running 1.6a1pre to avoid this problem).
An example site which currently overrides the preference: http://www.looprumors.com/.
A site which is being rendered correctly: http://www.nytimes.com/.
I'm surprised that I was unable to find an existing bug entry for this, but please forgive me if there is indeed one.

Reproducible: Always

Steps to Reproduce:
1. Set the "Always use my page and link colors" preference (with text set to black; background to white; visited links to red; unvisited links to blue)
2. Load http://www.looprumors.com/

Actual Results:  
Observe the nasty white text on black background, with links indistinguishable from the other text. Visited links are not red.

Expected Results:  
Display should respect the Page Colors and Link Appearance settings in the Camino preference panel.
(In reply to comment #0)
> This behaviour is new to the 2.0a1pre nightlies

Do you have a specific regression date?
Same problem in Minefield...

If the background/foreground colours are set in a stylesheet: all OK (pref is applied).
If however, the uses this old school/invalid code:
<body bgcolor="black" text="#cccccc" link="white" vlink="#6f6f6f" alink="#999999">
--> pref fails (the colours specified in html override the user setting).
Status: UNCONFIRMED → NEW
Component: Page Layout → General
Ever confirmed: true
Product: Camino → Core
Version: unspecified → Trunk
Fails:
20070517 Minefield/3.0a5pre -- 17-May-2007 05:56
works:
20070516 Minefield/3.0a5pre -- 16-May-2007 08:42

A Camino build: 2007051606 (2.0a1pre)	16-May-2007 10:24 still works, subsequent builds fail

http://bonsai.mozilla.org/cvsquery.cgi?treeid=default&module=all&branch=HEAD&branchtype=match&dir=&file=&filetype=match&who=&whotype=match&sortby=Date&hours=2&date=explicit&mindate=2007-05-16+08%3A30%3A00&maxdate=2007-05-17+05%3A40%3A00&cvsroot=%2Fcvsroot

---> bug 58048, I think.
Blocks: 58048
Flags: blocking1.9?
I see Philippe beat me to it. Yes, the last nightly of 2.0a1pre that worked appears to be 20070516. The 1.6a1pre nightlies through today's (2007101902) all seem to work.

Component: General → Style System (CSS)
OS: Mac OS X → All
QA Contact: page.layout → style-system
Hardware: Macintosh → All
Summary: Camino not always respecting the "Always use my page and link colors" preference. → "Always use my page and link colors" no longer overrides color attributes of <body>
Also present on Firefox on Linux.
Flags: blocking1.9? → blocking1.9+
Whiteboard: [dbaron-1.9:RuCo]
URL to exercise the various HTML preshint failure points:

data:text/html,<body%20text="#ff0000" link="red" vlink="red" alink="red" bgcolor="purple">aaa<font%20color="#00ff00">bbb<hr color="#ffff00"><table border="10" bordercolor="red"><tr><td>ccc</td></tr></table><a href="http://www.example.com">link</a>

When testing (which involves setting prefs in some profile), need to test:
* <body text="">
* <body link="">
* <body vlink="">
* <body alink="">
* <body bgcolor="">
* <body background="">
* <font color="">
* <hr color="">
* <table bordercolor="">
Flags: in-testsuite?
Attached patch Proposed fixSplinter Review
I'm not all that happy with the code duplication.  Perhaps this should all be a helper method on nsRuleData or somewhere else...  In any case, this does work.
Assignee: nobody → bzbarsky
Status: NEW → ASSIGNED
Attachment #286529 - Flags: superreview?(dbaron)
Attachment #286529 - Flags: review?(dbaron)
Priority: -- → P2
Summary: "Always use my page and link colors" no longer overrides color attributes of <body> → [FIX]"Always use my page and link colors" no longer overrides color attributes of <body>
Target Milestone: --- → mozilla1.9 M10
Comment on attachment 286529 [details] [diff] [review]
Proposed fix

Maybe at least put a UseDocumentColors helper method on nsPresContext that combines GetCachedBoolPref and IsChrome?

I have mixed feelings about whether <hr color="..."> should still imply noshade when this pref is on.  I lean towards thinking it should, though, which is the opposite of what this patch does.

r+sr=dbaron
Attachment #286529 - Flags: superreview?(dbaron)
Attachment #286529 - Flags: superreview+
Attachment #286529 - Flags: review?(dbaron)
Attachment #286529 - Flags: review+
Checked in.
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
(In reply to comment #10)
> Checked in.
> 

Does this check-in also affect the firefox-3 beta series? Because this is
broken in firefox-3.0beta1.
> Does this check-in also affect the firefox-3 beta series? 

Yes, but it was checked in after beta 1 branched.  It should be fixed in beta 2.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: