Bug 451168 - "Borders around folder icons in directory listings (e.g. when viewing FTP sites)" [r+sr=bzbarsky]
authorRobert O'Callahan <roc@ocallahan.org>
Tue, 19 Aug 2008 22:50:31 -0500
changeset 17097 4b6e1af7a81930ecd53ae630cd1ddf61cc26961d
parent 17096 ddab14b88e4adcb7cf585a3816d79b29aee441f3
child 17098 0125707007974dd2d9badc0adffa35aa0916ad76
push id1404
push userreed@reedloden.com
push dateWed, 20 Aug 2008 03:51:45 +0000
treeherdermozilla-central@012570700797 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs451168
milestone1.9.1a2pre
Bug 451168 - "Borders around folder icons in directory listings (e.g. when viewing FTP sites)" [r+sr=bzbarsky]
content/base/src/nsGkAtomList.h
layout/base/nsCSSFrameConstructor.cpp
layout/reftests/bugs/451168-1-ref.html
layout/reftests/bugs/451168-1.html
--- a/content/base/src/nsGkAtomList.h
+++ b/content/base/src/nsGkAtomList.h
@@ -60,16 +60,17 @@
 //---------------------------------------------------------------------------
 // Generic atoms
 //---------------------------------------------------------------------------
 
 GK_ATOM(_empty, "")
 GK_ATOM(mozdirty, "_moz_dirty")
 GK_ATOM(mozgeneratedcontentbefore, "_moz_generated_content_before")
 GK_ATOM(mozgeneratedcontentafter, "_moz_generated_content_after")
+GK_ATOM(mozgeneratedcontentimage, "_moz_generated_content_image")
 GK_ATOM(_moz_target, "_moz_target")
 GK_ATOM(menuactive, "_moz-menuactive")
 GK_ATOM(_poundDefault, "#default")
 GK_ATOM(_asterix, "*")
 GK_ATOM(a, "a")
 GK_ATOM(abbr, "abbr")
 GK_ATOM(abort, "abort")
 GK_ATOM(above, "above")
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -1962,17 +1962,17 @@ nsCSSFrameConstructor::CreateGeneratedCo
       // image object
       return nsnull;
     }
     
     // Create an image content object and pass it the image request.
     // XXX Check if it's an image type we can handle...
 
     nsCOMPtr<nsINodeInfo> nodeInfo;
-    mDocument->NodeInfoManager()->GetNodeInfo(nsGkAtoms::img, nsnull,
+    mDocument->NodeInfoManager()->GetNodeInfo(nsGkAtoms::mozgeneratedcontentimage, nsnull,
                                               kNameSpaceID_XHTML,
                                               getter_AddRefs(nodeInfo));
 
     nsCOMPtr<nsIContent> content;
     NS_NewGenConImageContent(getter_AddRefs(content), nodeInfo,
                              data.mContent.mImage);
     return content.forget();
   }
@@ -3215,17 +3215,18 @@ IsSpecialContent(nsIContent*     aConten
         else if (NS_FORM_INPUT_IMAGE == type) {
           return nsImageFrame::ShouldCreateImageFrameFor(aContent, aStyleContext);
         }
       }
 
       return PR_TRUE;
     }
 
-    if (aTag == nsGkAtoms::img) {
+    if (aTag == nsGkAtoms::img ||
+        aTag == nsGkAtoms::mozgeneratedcontentimage) {
       return nsImageFrame::ShouldCreateImageFrameFor(aContent, aStyleContext);
     }
 
     if (aTag == nsGkAtoms::object ||
         aTag == nsGkAtoms::applet ||
         aTag == nsGkAtoms::embed) {
       return !(aContent->IntrinsicState() &
              (NS_EVENT_STATE_BROKEN | NS_EVENT_STATE_USERDISABLED |
@@ -5234,17 +5235,17 @@ nsCSSFrameConstructor::ConstructHTMLFram
   nsresult  rv = NS_OK;
   
   PRBool triedFrame = PR_FALSE;
 
   // See if the element is absolute or fixed positioned
   const nsStyleDisplay* display = aStyleContext->GetStyleDisplay();
 
   // Create a frame based on the tag
-  if (nsGkAtoms::img == aTag) {
+  if (nsGkAtoms::img == aTag || nsGkAtoms::mozgeneratedcontentimage == aTag) {
     // Make sure to keep IsSpecialContent in synch with this code
     rv = CreateHTMLImageFrame(aContent, aStyleContext, NS_NewImageFrame,
                               &newFrame);
     if (newFrame) {
       if (!aHasPseudoParent && !aState.mPseudoFrames.IsEmpty()) {
         ProcessPseudoFrames(aState, aFrameItems); 
       }
     }
new file mode 100644
--- /dev/null
+++ b/layout/reftests/bugs/451168-1-ref.html
@@ -0,0 +1,6 @@
+<!DOCTYPE HTML>
+<html>
+<body>
+<img src="mozilla-banner.gif">
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/bugs/451168-1.html
@@ -0,0 +1,11 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<style>
+a::before { content:url(mozilla-banner.gif); }
+</style>
+</head>
+<body>
+<a href="#"></a>
+</body>
+</html>