OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 // Insertion before a ruby base object. | 121 // Insertion before a ruby base object. |
122 // In this case we need insert a new run before the current one and
split the base. | 122 // In this case we need insert a new run before the current one and
split the base. |
123 LayoutObject* ruby = parent(); | 123 LayoutObject* ruby = parent(); |
124 LayoutRubyRun* newRun = staticCreateRubyRun(ruby); | 124 LayoutRubyRun* newRun = staticCreateRubyRun(ruby); |
125 ruby->addChild(newRun, this); | 125 ruby->addChild(newRun, this); |
126 newRun->addChild(child); | 126 newRun->addChild(child); |
127 | 127 |
128 // Make sure we don't leave anything in the percentage descendant | 128 // Make sure we don't leave anything in the percentage descendant |
129 // map before moving the children to the new base. | 129 // map before moving the children to the new base. |
130 if (hasPercentHeightDescendants()) | 130 if (hasPercentHeightDescendants()) |
131 clearPercentHeightDescendantsFrom(this); | 131 clearPercentHeightDescendants(); |
132 rubyBaseSafe()->moveChildren(newRun->rubyBaseSafe(), beforeChild); | 132 rubyBaseSafe()->moveChildren(newRun->rubyBaseSafe(), beforeChild); |
133 } | 133 } |
134 } else { | 134 } else { |
135 // child is not a text -> insert it into the base | 135 // child is not a text -> insert it into the base |
136 // (append it instead if beforeChild is the ruby text) | 136 // (append it instead if beforeChild is the ruby text) |
137 LayoutRubyBase* base = rubyBaseSafe(); | 137 LayoutRubyBase* base = rubyBaseSafe(); |
138 if (beforeChild == base) | 138 if (beforeChild == base) |
139 beforeChild = base->firstChild(); | 139 beforeChild = base->firstChild(); |
140 if (beforeChild && beforeChild->isRubyText()) | 140 if (beforeChild && beforeChild->isRubyText()) |
141 beforeChild = 0; | 141 beforeChild = 0; |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 case U_LB_GLUE: | 324 case U_LB_GLUE: |
325 case U_LB_OPEN_PUNCTUATION: | 325 case U_LB_OPEN_PUNCTUATION: |
326 return false; | 326 return false; |
327 default: | 327 default: |
328 break; | 328 break; |
329 } | 329 } |
330 return true; | 330 return true; |
331 } | 331 } |
332 | 332 |
333 } // namespace blink | 333 } // namespace blink |
OLD | NEW |