Bug 1342873 - label runnables of nsDelayedCalcBCBorders for nsTableFrame. draft
authorJeremy Chen <jeremychen@mozilla.com>
Thu, 09 Mar 2017 18:06:07 +0800
changeset 495761 891fc04bc289fbad56e42e4a2fd8c65124356223
parent 495587 19289cc8bf6ffce3b2067fbe91aebea5a356d008
child 548467 fa9009d270f2b9675e66ae7517ff8ab84b81c445
push id48433
push userjichen@mozilla.com
push dateThu, 09 Mar 2017 10:07:04 +0000
bugs1342873
milestone55.0a1
Bug 1342873 - label runnables of nsDelayedCalcBCBorders for nsTableFrame. This is the only runnable that we need to label in layout/tables/ folder. MozReview-Commit-ID: FbWztSLzIOy
layout/tables/nsTableFrame.cpp
--- a/layout/tables/nsTableFrame.cpp
+++ b/layout/tables/nsTableFrame.cpp
@@ -5000,18 +5000,20 @@ nsTableFrame::BCRecalcNeeded(nsStyleCont
   if (change & nsChangeHint_RepaintFrame) {
     // we need to recompute the borders and the caller needs to mark
     // the bc damage area
     // XXX In principle this should only be necessary for border style changes
     // However the bc painting code tries to maximize the drawn border segments
     // so it stores in the cellmap where a new border segment starts and this
     // introduces a unwanted cellmap data dependence on color
     nsCOMPtr<nsIRunnable> evt = new nsDelayedCalcBCBorders(this);
-    NS_DispatchToCurrentThread(evt);
-    return true;
+    nsresult rv =
+      GetContent()->OwnerDoc()->Dispatch("nsDelayedCalcBCBorders",
+                                         TaskCategory::Other, evt.forget());
+    return NS_SUCCEEDED(rv);
   }
   return false;
 }
 
 
 // Compare two border segments, this comparison depends whether the two
 // segments meet at a corner and whether the second segment is inline-dir.
 // The return value is whichever of aBorder1 or aBorder2 dominates.