Bug 1141919 - Fix incomplete line break suppression in ruby. r=dbaron
authorXidorn Quan <quanxunzhen@gmail.com>
Sat, 14 Mar 2015 16:29:06 +1100
changeset 251915 672dba5b1f9ffc1ae59386f23c49b26a1b32f5c2
parent 251914 5f1d4592207fda0cba762d7528434ccd288d93c2
child 251916 484e881a1d26b0c95be1864a101fb78814198330
push id7860
push userjlund@mozilla.com
push dateMon, 30 Mar 2015 18:46:02 +0000
treeherdermozilla-aurora@8ac636cd51f3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdbaron
bugs1141919
milestone39.0a1
Bug 1141919 - Fix incomplete line break suppression in ruby. r=dbaron
layout/style/nsStyleContext.cpp
--- a/layout/style/nsStyleContext.cpp
+++ b/layout/style/nsStyleContext.cpp
@@ -533,19 +533,23 @@ ShouldSuppressLineBreak(const nsStyleDis
         aContainerDisplay->mDisplay == NS_STYLE_DISPLAY_RUBY_BASE_CONTAINER) {
       return true;
     }
   }
   // Any descendant of ruby level containers is non-breakable, but
   // the level containers themselves are breakable. We have to check
   // the container display type against all ruby display type here
   // because any of the ruby boxes could be anonymous.
-  if (aContainerDisplay->IsRubyDisplayType() &&
-      aStyleDisplay->mDisplay != NS_STYLE_DISPLAY_RUBY_BASE_CONTAINER &&
-      aStyleDisplay->mDisplay != NS_STYLE_DISPLAY_RUBY_TEXT_CONTAINER) {
+  if ((aContainerDisplay->IsRubyDisplayType() &&
+       aStyleDisplay->mDisplay != NS_STYLE_DISPLAY_RUBY_BASE_CONTAINER &&
+       aStyleDisplay->mDisplay != NS_STYLE_DISPLAY_RUBY_TEXT_CONTAINER) ||
+      // Since ruby base and ruby text may exist themselves without any
+      // non-anonymous frame outside, we should also check them.
+      aStyleDisplay->mDisplay == NS_STYLE_DISPLAY_RUBY_BASE ||
+      aStyleDisplay->mDisplay == NS_STYLE_DISPLAY_RUBY_TEXT) {
     return true;
   }
   return false;
 }
 
 void
 nsStyleContext::ApplyStyleFixups(bool aSkipParentDisplayBasedStyleFixup)
 {