Bug 455105 - IsSolidBorderEdge in nsCSSRendering.cpp ignores foreground borders; r=vladimir, sr=roc
--- a/layout/base/nsCSSRendering.cpp
+++ b/layout/base/nsCSSRendering.cpp
@@ -1346,19 +1346,32 @@ PixelSnapPoint(gfxContext* aContext, nsI
static PRBool
IsSolidBorderEdge(const nsStyleBorder& aBorder, PRUint32 aSide)
{
if (aBorder.GetActualBorder().side(aSide) == 0)
return PR_TRUE;
if (aBorder.GetBorderStyle(aSide) != NS_STYLE_BORDER_STYLE_SOLID)
return PR_FALSE;
+ // If we're using a border image, assume it's not fully opaque,
+ // because we may not even have the image loaded at this point, and
+ // even if we did, checking whether the relevant tile is fully
+ // opaque would be too much work.
+ if (aBorder.GetBorderImage())
+ return PR_FALSE;
+
nscolor color;
PRBool isForeground;
aBorder.GetBorderColor(aSide, color, isForeground);
+
+ // We don't know the foreground color here, so if it's being used
+ // we must assume it might be transparent.
+ if (isForeground)
+ return PR_FALSE;
+
return NS_GET_A(color) == 255;
}
/**
* Returns true if all border edges are either missing or opaque.
*/
static PRBool
IsSolidBorder(const nsStyleBorder& aBorder)
--- a/layout/reftests/bugs/reftest.list
+++ b/layout/reftests/bugs/reftest.list
@@ -921,12 +921,14 @@ fails == 441259-2.html 441259-2-ref.html
# == 448987.html 448987-ref.html # Disabled for now - it needs privileges
== 449171-1.html 449171-ref.html
== 449519-1.html 449519-1-ref.html
# == 449653-1.html 449653-1-ref.html # Disabled for now - it needs privileges
== 450670-1.html 450670-1-ref.html
== 451168-1.html 451168-1-ref.html
== 452964-1.html 452964-1-ref.html
== 454361.html about:blank
+== 455105-1.html 455105-ref.html
+== 455105-2.html 455105-ref.html
== 455280-1.xhtml 455280-1-ref.xhtml
fails-if(MOZ_WIDGET_TOOLKIT=="cocoa") == 456147.xul 456147-ref.html # bug 456147, but not caused by it
== 456484-1.html 456484-1-ref.html
fails == 461512-1.html 461512-1-ref.html # Bug 461512