Bug 455105 - IsSolidBorderEdge in nsCSSRendering.cpp ignores foreground borders; r=vladimir, sr=roc
authorZack Weinberg <zweinberg@mozilla.com>
Thu, 30 Oct 2008 12:54:58 +0330
changeset 21091 7e85c5796676b613e07538cd6ee55df201a4c8ae
parent 21090 90ddcaa921e4834b88962031c74cdc07c0e55544
child 21092 d61da77977df6b56ae15ffc52070bc84480249df
push id3303
push userehsan.akhgari@gmail.com
push dateThu, 30 Oct 2008 09:25:39 +0000
treeherdermozilla-central@7e85c5796676 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvladimir, roc
bugs455105
milestone1.9.1b2pre
Bug 455105 - IsSolidBorderEdge in nsCSSRendering.cpp ignores foreground borders; r=vladimir, sr=roc
layout/base/nsCSSRendering.cpp
layout/reftests/bugs/reftest.list
--- 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