mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 21:31:04 +00:00
Avoid showing black when the if-visited style is transparent and the unvisited style is a color. (Bug 557584) r=bzbarsky
This commit is contained in:
parent
e85f5e69dd
commit
ea2113c668
11
layout/reftests/css-visited/white-to-transparent-1-ref.html
Normal file
11
layout/reftests/css-visited/white-to-transparent-1-ref.html
Normal file
@ -0,0 +1,11 @@
|
||||
<!DOCTYPE HTML>
|
||||
<title>Test for privacy restrictions on :visited (Bug 147777)</title>
|
||||
<style type="text/css">
|
||||
|
||||
body { background: white; color: black }
|
||||
|
||||
span { background: #ccc; }
|
||||
|
||||
</style>
|
||||
<span>unvisited</span>
|
||||
<span>visited</span>
|
13
layout/reftests/css-visited/white-to-transparent-1.html
Normal file
13
layout/reftests/css-visited/white-to-transparent-1.html
Normal file
@ -0,0 +1,13 @@
|
||||
<!DOCTYPE HTML>
|
||||
<title>Test for privacy restrictions on :visited (Bug 147777)</title>
|
||||
<style type="text/css">
|
||||
|
||||
body { background: white; color: black }
|
||||
|
||||
a { text-decoration: none; color: black }
|
||||
:link { background: #ccc; }
|
||||
:visited { background: transparent }
|
||||
|
||||
</style>
|
||||
<a href="unvisited-page.html">unvisited</a>
|
||||
<a href="visited-page.html">visited</a>
|
@ -753,6 +753,14 @@ nsStyleContext::GetVisitedDependentColor(nsCSSProperty aProperty)
|
||||
/* static */ nscolor
|
||||
nsStyleContext::CombineVisitedColors(nscolor *aColors, PRBool aLinkIsVisited)
|
||||
{
|
||||
if (NS_GET_A(aColors[1]) == 0) {
|
||||
// If the style-if-visited is transparent, then just use the
|
||||
// unvisited style rather than using the (meaningless) color
|
||||
// components of the visited style along with a potentially
|
||||
// non-transparent alpha value.
|
||||
aLinkIsVisited = PR_FALSE;
|
||||
}
|
||||
|
||||
// NOTE: We want this code to have as little timing dependence as
|
||||
// possible on whether this->RelevantLinkVisited() is true.
|
||||
const ColorIndexSet &set =
|
||||
|
@ -77,6 +77,7 @@ var gTests = [
|
||||
// FIXME: commented out because dynamic changes on the non-first-line
|
||||
// part of the test don't work right when the link becomes visited.
|
||||
//"== first-line-1.html first-line-1-ref.html",
|
||||
"== white-to-transparent-1.html white-to-transparent-1-ref.html",
|
||||
];
|
||||
|
||||
// Maintain a reference count of how many things we're waiting for until
|
||||
|
Loading…
Reference in New Issue
Block a user