Closed
Bug 767173
Opened 12 years ago
Closed 12 years ago
:visited does not take "background-color" CSS in account (docs say opposite statement).
Categories
(Core :: CSS Parsing and Computation, defect)
Tracking
()
RESOLVED
DUPLICATE
of bug 765448
People
(Reporter: gavenkoa, Unassigned)
References
Details
Attachments
(1 file)
398 bytes,
text/html
|
Details |
User Agent: Mozilla/5.0 (X11; Linux i686; rv:10.0.4) Gecko/20100101 Firefox/10.0.4 Iceweasel/10.0.4 Build ID: 20120517130437 Steps to reproduce: I make simple HTML page: <html> <head> <style type="text/css"> :link, :visited { outline: 1px dotted !important } :link { outline-color: blue !important } :visited { outline-color: orange !important; color: yellow !important; background-color: green !important; } </style> </head> <body> <a href="http://brain-break.blogspot.com/">link to blog</a> </body> </html> Open it in Firefox and visit links, then back to original page. Actual results: As say https://developer.mozilla.org/en/CSS/Privacy_and_the_:visited_selector outline and color is work (I get yellow link text with orange dotted outline). Expected results: But background still white... when must be green...
Updated•12 years ago
|
Component: Untriaged → Style System (CSS)
Product: Firefox → Core
QA Contact: untriaged → style-system
Hardware: x86 → All
Version: 10 Branch → Trunk
Comment 1•12 years ago
|
||
The docs are just wrong. Please read http://dbaron.org/mozilla/visited-privacy for complete documentation on the behavior.
Status: UNCONFIRMED → RESOLVED
Closed: 12 years ago
Resolution: --- → DUPLICATE
Comment 2•12 years ago
|
||
Oh, actually the docs do say this: In addition, even for the properties you can set for visited links, you won't be able to change the transparency between unvisited and visited links which you are: your unvisited background is transparent.
Comment 3•12 years ago
|
||
Yup, here's a testcase demonstrating correct behavior (with a background-color specified for both visited and un-visited style)
Comment 4•12 years ago
|
||
The default background color for everything is "transparent", and :visited styles are not allowed to change the *transparency* of a color, because that can cause a measurable difference in how long it takes to draw the page. Therefore, if you want :visited to change the background color, you must set the background color of *un*visited links to something other than "transparent". For example, your test case's styles work as you desire if you add :link { background-color: white; } or even if you add: :link { background-color: rgba(255,0,0,.5) } (In the latter case, the color that gets painted is not "green" but "rgba(0,128,0,.5)".)
Comment 5•12 years ago
|
||
(Whee, personal record for size of mid-air collision.)
BTW, that's what bug 147777 comment 288 says. I will add some clarifying text to the docs because it's easy to miss that an unspecified background-color defaults to transparent.
@j.j What docs you update?? I edit page https://developer.mozilla.org/en/CSS/Privacy_and_the_:visited_selector and add working example. They cover all hard cases with CSS for :visited. Anyone can improve page as my English is pure...
You need to log in
before you can comment on or make changes to this bug.
Description
•