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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 return child->isInline(); | 53 return child->isInline(); |
54 } | 54 } |
55 | 55 |
56 void RenderRubyBase::moveChildren(RenderRubyBase* toBase, RenderObject* beforeCh
ild) | 56 void RenderRubyBase::moveChildren(RenderRubyBase* toBase, RenderObject* beforeCh
ild) |
57 { | 57 { |
58 // This function removes all children that are before (!) beforeChild | 58 // This function removes all children that are before (!) beforeChild |
59 // and appends them to toBase. | 59 // and appends them to toBase. |
60 ASSERT_ARG(toBase, toBase); | 60 ASSERT_ARG(toBase, toBase); |
61 | 61 |
62 if (beforeChild && beforeChild->parent() != this) | 62 if (beforeChild && beforeChild->parent() != this) |
63 beforeChild = splitAnonymousBlocksAroundChild(beforeChild); | 63 beforeChild = splitAnonymousBoxesAroundChild(beforeChild); |
64 | 64 |
65 if (childrenInline()) | 65 if (childrenInline()) |
66 moveInlineChildren(toBase, beforeChild); | 66 moveInlineChildren(toBase, beforeChild); |
67 else | 67 else |
68 moveBlockChildren(toBase, beforeChild); | 68 moveBlockChildren(toBase, beforeChild); |
69 | 69 |
70 setNeedsLayoutAndPrefWidthsRecalc(); | 70 setNeedsLayoutAndPrefWidthsRecalc(); |
71 toBase->setNeedsLayoutAndPrefWidthsRecalc(); | 71 toBase->setNeedsLayoutAndPrefWidthsRecalc(); |
72 } | 72 } |
73 | 73 |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 return; | 144 return; |
145 | 145 |
146 // Inset the ruby base by half the inter-ideograph expansion amount. | 146 // Inset the ruby base by half the inter-ideograph expansion amount. |
147 float inset = (logicalWidth - maxPreferredLogicalWidth) / (expansionOpportun
ityCount + 1); | 147 float inset = (logicalWidth - maxPreferredLogicalWidth) / (expansionOpportun
ityCount + 1); |
148 | 148 |
149 logicalLeft += inset / 2; | 149 logicalLeft += inset / 2; |
150 logicalWidth -= inset; | 150 logicalWidth -= inset; |
151 } | 151 } |
152 | 152 |
153 } // namespace WebCore | 153 } // namespace WebCore |
OLD | NEW |