Bug 1297306 - part3:make BreakTypeToString() to be a member of nsLineBox. r=xidorn
authorJeremy Chen <jeremychen@mozilla.com>
Wed, 07 Sep 2016 10:20:16 +0800
changeset 312980 cd5cf15a6fa9012624514996352e4f60f9b6be9e
parent 312979 907028433e467a3eb04cd69db622302238edc598
child 312981 4088eddbb3397c248e50e9e8fba2a6faa0d85d5e
push id30668
push userkwierso@gmail.com
push dateThu, 08 Sep 2016 00:26:51 +0000
treeherdermozilla-central@7c655e03eef7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersxidorn
bugs1297306
milestone51.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1297306 - part3:make BreakTypeToString() to be a member of nsLineBox. r=xidorn With this change, we could export BreakTypeToString() to other files that desire to print break type for debugging. MozReview-Commit-ID: 34m1BWAmZTB
layout/generic/nsLineBox.cpp
layout/generic/nsLineBox.h
--- a/layout/generic/nsLineBox.cpp
+++ b/layout/generic/nsLineBox.cpp
@@ -187,27 +187,29 @@ ListFloats(FILE* out, const char* aPrefi
     else {
       str += "\n###!!! NULL out-of-flow frame";
     }
     fprintf_stderr(out, "%s\n", str.get());
     fc = fc->Next();
   }
 }
 
-const char *
-BreakTypeToString(uint8_t aBreakType)
+const char*
+nsLineBox::BreakTypeToString(uint8_t aBreakType) const
 {
   switch (aBreakType) {
-  case NS_STYLE_CLEAR_NONE: return "nobr";
-  case NS_STYLE_CLEAR_LEFT: return "leftbr";
-  case NS_STYLE_CLEAR_RIGHT: return "rightbr";
-  case NS_STYLE_CLEAR_BOTH: return "leftbr+rightbr";
-  case NS_STYLE_CLEAR_LINE: return "linebr";
-  default:
-    break;
+    case NS_STYLE_CLEAR_NONE: return "nobr";
+    case NS_STYLE_CLEAR_LEFT: return "leftbr";
+    case NS_STYLE_CLEAR_RIGHT: return "rightbr";
+    case NS_STYLE_CLEAR_INLINE_START: return "inlinestartbr";
+    case NS_STYLE_CLEAR_INLINE_END: return "inlineendbr";
+    case NS_STYLE_CLEAR_BOTH: return "leftbr+rightbr";
+    case NS_STYLE_CLEAR_LINE: return "linebr";
+    default:
+      break;
   }
   return "unknown";
 }
 
 char*
 nsLineBox::StateToString(char* aBuf, int32_t aBufSize) const
 {
   snprintf(aBuf, aBufSize, "%s,%s,%s,%s,%s,before:%s,after:%s[0x%x]",
--- a/layout/generic/nsLineBox.h
+++ b/layout/generic/nsLineBox.h
@@ -567,16 +567,17 @@ public:
   // list).
   static bool RFindLineContaining(nsIFrame* aFrame,
                                     const nsLineList_iterator& aBegin,
                                     nsLineList_iterator& aEnd,
                                     nsIFrame* aLastFrameBeforeEnd,
                                     int32_t* aFrameIndexInLine);
 
 #ifdef DEBUG_FRAME_DUMP
+  const char* BreakTypeToString(uint8_t aBreakType) const;
   char* StateToString(char* aBuf, int32_t aBufSize) const;
 
   void List(FILE* out, int32_t aIndent, uint32_t aFlags = 0) const;
   void List(FILE* out = stderr, const char* aPrefix = "", uint32_t aFlags = 0) const;
   nsIFrame* LastChild() const;
 #endif
 
 private: