Commit d91afa27 authored by hyatt@apple.com's avatar hyatt@apple.com

https://bugs.webkit.org/show_bug.cgi?id=41445

        
Reviewed by Dan Bernstein.

Visited links painting with black background. Make sure that if the visited style has
the initial background color (transparent) set that we just use the unvisited color.

Source/WebCore: 

Added fast/history/visited-link-background-color.html

* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::visitedDependentColor):

LayoutTests: 

Added fast/history/visited-link-background-color.html
* fast/history/visited-link-background-color.html: Added.
* platform/mac/fast/history/visited-link-background-color-expected.checksum: Added.
* platform/mac/fast/history/visited-link-background-color-expected.png: Added.
* platform/mac/fast/history/visited-link-background-color-expected.txt: Added.



git-svn-id: svn://svn.chromium.org/blink/trunk@83087 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent ae089a6d
2011-04-06 David Hyatt <hyatt@apple.com>
Reviewed by Dan Bernstein.
https://bugs.webkit.org/show_bug.cgi?id=41445
Visited links painting with black background. Make sure that if the visited style has
the initial background color (transparent) set that we just use the unvisited color.
Added fast/history/visited-link-background-color.html
* fast/history/visited-link-background-color.html: Added.
* platform/mac/fast/history/visited-link-background-color-expected.checksum: Added.
* platform/mac/fast/history/visited-link-background-color-expected.png: Added.
* platform/mac/fast/history/visited-link-background-color-expected.txt: Added.
2011-04-06 Adrienne Walker <enne@google.com> 2011-04-06 Adrienne Walker <enne@google.com>
Unreviewed, update Chromium expectations for set-unloaded-frame-location.html as a flaky crasher. Unreviewed, update Chromium expectations for set-unloaded-frame-location.html as a flaky crasher.
<style>
a { display:block; width:500px; height:500px; }
a:link {
background:olive;
}
a:visited {
color: white
}
</style>
<script>
if (window.layoutTestController)
window.layoutTestController.keepWebHistory();
</script>
<body>
<iframe src="resources/dummy.html" style="display:none"></iframe>
<a href="resources/dummy.html">This text should be white on an olive background.</a>
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
layer at (0,0) size 800x600
RenderBlock {HTML} at (0,0) size 800x600
RenderBody {BODY} at (8,8) size 784x584
RenderBlock {A} at (0,0) size 500x500 [color=#0000EE] [bgcolor=#808000]
RenderText {#text} at (0,0) size 316x18
text run at (0,0) width 316: "This text should be white on an olive background."
2011-04-06 David Hyatt <hyatt@apple.com>
Reviewed by Dan Bernstein.
https://bugs.webkit.org/show_bug.cgi?id=41445
Visited links painting with black background. Make sure that if the visited style has
the initial background color (transparent) set that we just use the unvisited color.
Added fast/history/visited-link-background-color.html
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::visitedDependentColor):
2011-04-06 Csaba Osztrogonác <ossy@webkit.org> 2011-04-06 Csaba Osztrogonác <ossy@webkit.org>
Unreviewed Qt buildfix after r83079. Unreviewed Qt buildfix after r83079.
...@@ -1146,6 +1146,14 @@ const Color RenderStyle::visitedDependentColor(int colorProperty) const ...@@ -1146,6 +1146,14 @@ const Color RenderStyle::visitedDependentColor(int colorProperty) const
return unvisitedColor; return unvisitedColor;
Color visitedColor = visitedStyle->colorIncludingFallback(colorProperty, borderStyle); Color visitedColor = visitedStyle->colorIncludingFallback(colorProperty, borderStyle);
// FIXME: Technically someone could explicitly specify the color transparent, but for now we'll just
// assume that if the background color is transparent that it wasn't set. Note that it's weird that
// we're returning unvisited info for a visited link, but given our restriction that the alpha values
// have to match, it makes more sense to return the unvisited background color if specified than it
// does to return black. This behavior matches what Firefox 4 does as well.
if (colorProperty == CSSPropertyBackgroundColor && visitedColor == Color::transparent)
return unvisitedColor;
// Take the alpha from the unvisited color, but get the RGB values from the visited color. // Take the alpha from the unvisited color, but get the RGB values from the visited color.
return Color(visitedColor.red(), visitedColor.green(), visitedColor.blue(), unvisitedColor.alpha()); return Color(visitedColor.red(), visitedColor.green(), visitedColor.blue(), unvisitedColor.alpha());
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment