Improve the warning that shows up when pages use -moz-inline-box. b=413195 r+sr=bzbarsky a=beltzner
authordbaron@dbaron.org
Fri, 25 Jan 2008 13:06:36 -0800
changeset 10682 22f130589831ea71f422c9284c1986a314003178
parent 10681 a80fb81f3aa96fbb545faa71977e69a2a1eec687
child 10683 7abe826d7a8e3dcbee64a1dddf3b23a4bbefe85b
push id1
push userbsmedberg@mozilla.com
push dateThu, 20 Mar 2008 16:49:24 +0000
treeherdermozilla-central@61007906a1f8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbeltzner
bugs413195
milestone1.9b3pre
Improve the warning that shows up when pages use -moz-inline-box. b=413195 r+sr=bzbarsky a=beltzner
dom/locales/en-US/chrome/layout/xul.properties
layout/base/nsCSSFrameConstructor.cpp
--- a/dom/locales/en-US/chrome/layout/xul.properties
+++ b/dom/locales/en-US/chrome/layout/xul.properties
@@ -13,16 +13,17 @@
 #
 # The Original Code is xul.properties.
 #
 # The Initial Developer of the Original Code is Boris Zbarsky
 # <bzbarsky@mit.edu>.  Portions created by the Initial Developer are Copyright
 # (C) 2004.  All Rights Reserved.
 #
 # Contributor(s):
+#   L. David Baron <dbaron@dbaron.org>, Mozilla Corporation
 #
 # Alternatively, the contents of this file may be used under the terms of
 # either the GNU General Public License Version 2 or later (the "GPL"), or
 # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 # in which case the provisions of the GPL or the LGPL are applicable instead
 # of those above. If you wish to allow use of your version of this file only
 # under the terms of either the GPL or the LGPL, and not to allow others to
 # use your version of this file under the terms of the MPL, indicate your
@@ -31,8 +32,9 @@
 # the provisions above, a recipient may use your version of this file under
 # the terms of any one of the MPL, the GPL or the LGPL.
 #
 # ***** END LICENSE BLOCK *****
 
 MissingOverlay=Failed to load overlay from %1$S.
 PINotInProlog=<?%1$S?> processing instruction does not have any effect outside the prolog anymore (see bug 360119).
 NeededToWrapXUL=XUL box for %1$S element contained an inline %2$S child, forcing all its children to be wrapped in a block.
+NeededToWrapXULInlineBox=XUL box for %1$S element contained an inline %2$S child, forcing all its children to be wrapped in a block.  This can often be fixed by replacing "display: -moz-inline-box" with "display: -moz-inline-box; display: inline-block".
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -6229,18 +6229,21 @@ nsCSSFrameConstructor::ConstructXULFrame
                              childItems, PR_FALSE);
         nsIContent *badKid;
         if (newFrame->IsBoxFrame() &&
             (badKid = AnyKidsNeedBlockParent(childItems.childList))) {
           nsAutoString parentTag, kidTag;
           aContent->Tag()->ToString(parentTag);
           badKid->Tag()->ToString(kidTag);
           const PRUnichar* params[] = { parentTag.get(), kidTag.get() };
+          const char *message =
+            (display->mDisplay == NS_STYLE_DISPLAY_INLINE_BOX)
+              ? "NeededToWrapXULInlineBox" : "NeededToWrapXUL";
           nsContentUtils::ReportToConsole(nsContentUtils::eXUL_PROPERTIES,
-                                          "NeededToWrapXUL",
+                                          message,
                                           params, NS_ARRAY_LENGTH(params),
                                           mDocument->GetDocumentURI(),
                                           EmptyString(), 0, 0, // not useful
                                           nsIScriptError::warningFlag,
                                           "FrameConstructor");
 
           nsRefPtr<nsStyleContext> blockSC = mPresShell->StyleSet()->
             ResolvePseudoStyleFor(aContent,