verbose dump of MUL Box elements. draft
authorISHIKAWA, Chiaki <ishikawa@yk.rim.or.jp>
Wed, 01 Jul 2020 13:26:21 +0900
changeset 89804 9d1858b545bdf345df600f25e5e3e26926e74163
parent 89803 cdbab14b904cda22db64a2732be3fd579aed6975
child 89805 63b52af4d35e745e58f4d7067ac2c40b53366908
push id11337
push userishikawa@yk.rim.or.jp
push dateWed, 01 Jul 2020 04:26:34 +0000
treeherdertry-comm-central@5b0c8a7b2471 [default view] [failures only]
verbose dump of MUL Box elements.
mozilla-M-C-000-1621274-verbose-dump-rev03.patch
new file mode 100644
--- /dev/null
+++ b/mozilla-M-C-000-1621274-verbose-dump-rev03.patch
@@ -0,0 +1,117 @@
+# HG changeset patch
+# User ISHIKAWA, Chiaki <ishikawa@yk.rim.or.jp>
+# Parent  4221f87da7fe9ecdb1a7ceda3967a7cc0acbf942
+verbose dump of MUL Box elements.
+
+diff --git a/layout/tables/BasicTableLayoutStrategy.cpp b/layout/tables/BasicTableLayoutStrategy.cpp
+--- a/layout/tables/BasicTableLayoutStrategy.cpp
++++ b/layout/tables/BasicTableLayoutStrategy.cpp
+@@ -750,19 +750,54 @@ void BasicTableLayoutStrategy::Distribut
+     nscoord c;
+     float f;
+   } basis;  // the sum of the statistic over columns to divide it
+   if (aISize < guess_pref) {
+     if (aISizeType != BTLS_FINAL_ISIZE && aISize <= guess_min) {
+       // Return early -- we don't have any extra space to distribute.
+       return;
+     }
+-    NS_ASSERTION(!(aISizeType == BTLS_FINAL_ISIZE && aISize < guess_min),
+-                 "Table inline-size is less than the "
+-                 "sum of its columns' min inline-sizes");
++#define LOCAL_STRINGFY(a) #a
++    if((aISizeType == BTLS_FINAL_ISIZE && aISize < guess_min)) {
++#ifdef DEBUG
++      char *lcp = LOCAL_STRINGFY(! (aISizeType == BTLS_FINAL_ISIZE && aISize < guess_min));
++      fprintf(stderr,"{debug}:ASSERTION: %s, %s, line=%d\n", lcp, __FILE__, __LINE__);
++      fprintf(stderr,
++              "aISizeType=%d, BTLS_FINALSIZE=%d\n",
++             aISizeType, BTLS_FINAL_ISIZE);
++      fprintf(stderr,"aISize=%d, guess_min=%d, guess_pref=%d\n",
++             aISize, guess_min, guess_pref);
++#endif
++      nsIFrame* tframe = mTableFrame;
++      bool is_xul = false;
++      for( int i = 0 ; !is_xul && tframe && i < 30; i++) {
++        if(tframe->IsXULBoxFrame()) {
++#ifdef DEBUG
++          fprintf(stderr, "parent at the position [%d] is XULBox.\n", i);
++#endif
++          is_xul = true;
++          break;
++        }
++        tframe = tframe->GetParent();
++      }
++      if (is_xul) {
++        fprintf(stderr,
++                "{debug} "
++                "This strange situation is with XULBox Frame. Just ignore it for now.\n");
++        fprintf(stderr,"{debug} List of elements- \n");
++        if(tframe) {
++          tframe->DumpFrameTreeLimited();
++        }
++      }
++      else {                            // we are hosed. Dump
++        NS_ASSERTION(!(aISizeType == BTLS_FINAL_ISIZE && aISize < guess_min),
++                     "Table inline-size is less than the "
++                     "sum of its columns' min inline-sizes");
++      }
++    }
+     if (aISize < guess_min_pct) {
+       l2t = FLEX_PCT_SMALL;
+       space = aISize - guess_min;
+       basis.c = guess_min_pct - guess_min;
+     } else if (aISize < guess_min_spec) {
+       l2t = FLEX_FIXED_SMALL;
+       space = aISize - guess_min_pct;
+       basis.c =
+@@ -975,14 +1010,49 @@ void BasicTableLayoutStrategy::Distribut
+         colFrame->SetFinalISize(col_iSize);
+ 
+         if (old_final != col_iSize) {
+           mTableFrame->DidResizeColumns();
+         }
+       } break;
+     }
+   }
+-  NS_ASSERTION(
++
++  if (! ( (space == 0 || space == nscoord_MAX) &&
++          ((l2t == FLEX_PCT_LARGE) ? (-0.001f < basis.f && basis.f < 0.001f)
++           : (basis.c == 0 || basis.c == nscoord_MAX)))) {
++#ifdef DEBUG
++    char *lcp = LOCAL_STRINGFY((space == 0 || space == nscoord_MAX) &&
++          ((l2t == FLEX_PCT_LARGE) ? (-0.001f < basis.f && basis.f < 0.001f)
++           : (basis.c == 0 || basis.c == nscoord_MAX)));
++
++    fprintf(stderr,"{debug}:ASSERTION: %s, %s, line=%d\n", lcp, __FILE__, __LINE__);
++    fprintf(stderr,"space=%d, nscoord_MAX=%d\n", space, nscoord_MAX);
++    fprintf(stderr,"l2t=%d, FLEX_PCT_LARGE=%d\n", l2t, FLEX_PCT_LARGE);
++    fprintf(stderr,"basis.c=%d, nscoord_MAX=%d, basis.f=%f\n",
++            basis.c, nscoord_MAX, basis.f);
++#endif
++    nsIFrame* tframe = mTableFrame;
++    bool is_xul = false;
++    for( int i = 0 ; !is_xul && tframe && i < 30; i++) {
++      if(tframe->IsXULBoxFrame()) {
++#ifdef DEBUG
++        fprintf(stderr, "parent at the position [%d] is XULBox.\n", i);
++#endif
++        is_xul = true;
++        break;
++      }
++      tframe = tframe->GetParent();
++    }
++    if (is_xul) {
++      fprintf(stderr,
++              "{debug} "
++              "This strange situation is with XULBox Frame. Just ignore it for now.\n");
++    }
++    else {                              // We are hosed. dump.
++      NS_ASSERTION(
+       (space == 0 || space == nscoord_MAX) &&
+           ((l2t == FLEX_PCT_LARGE) ? (-0.001f < basis.f && basis.f < 0.001f)
+                                    : (basis.c == 0 || basis.c == nscoord_MAX)),
+       "didn't subtract all that we added");
++    }
++  }
+ }