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 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 if (isEmpty()) { | 190 if (isEmpty()) { |
191 parent()->removeChild(this); | 191 parent()->removeChild(this); |
192 deleteLineBoxTree(); | 192 deleteLineBoxTree(); |
193 destroy(); | 193 destroy(); |
194 } | 194 } |
195 } | 195 } |
196 } | 196 } |
197 | 197 |
198 RenderRubyBase* RenderRubyRun::createRubyBase() const | 198 RenderRubyBase* RenderRubyRun::createRubyBase() const |
199 { | 199 { |
200 RenderRubyBase* renderer = RenderRubyBase::createAnonymous(document()); | 200 RenderRubyBase* renderer = RenderRubyBase::createAnonymous(&document()); |
201 RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyleWithDisplay(
style(), BLOCK); | 201 RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyleWithDisplay(
style(), BLOCK); |
202 newStyle->setTextAlign(CENTER); // FIXME: use WEBKIT_CENTER? | 202 newStyle->setTextAlign(CENTER); // FIXME: use WEBKIT_CENTER? |
203 renderer->setStyle(newStyle.release()); | 203 renderer->setStyle(newStyle.release()); |
204 return renderer; | 204 return renderer; |
205 } | 205 } |
206 | 206 |
207 RenderRubyRun* RenderRubyRun::staticCreateRubyRun(const RenderObject* parentRuby
) | 207 RenderRubyRun* RenderRubyRun::staticCreateRubyRun(const RenderObject* parentRuby
) |
208 { | 208 { |
209 ASSERT(parentRuby && parentRuby->isRuby()); | 209 ASSERT(parentRuby && parentRuby->isRuby()); |
210 RenderRubyRun* rr = new RenderRubyRun(); | 210 RenderRubyRun* rr = new RenderRubyRun(); |
211 rr->setDocumentForAnonymous(parentRuby->document()); | 211 rr->setDocumentForAnonymous(&parentRuby->document()); |
212 RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyleWithDisplay(
parentRuby->style(), INLINE_BLOCK); | 212 RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyleWithDisplay(
parentRuby->style(), INLINE_BLOCK); |
213 rr->setStyle(newStyle.release()); | 213 rr->setStyle(newStyle.release()); |
214 return rr; | 214 return rr; |
215 } | 215 } |
216 | 216 |
217 RenderObject* RenderRubyRun::layoutSpecialExcludedChild(bool relayoutChildren, S
ubtreeLayoutScope& layoutScope) | 217 RenderObject* RenderRubyRun::layoutSpecialExcludedChild(bool relayoutChildren, S
ubtreeLayoutScope& layoutScope) |
218 { | 218 { |
219 // Don't bother positioning the RenderRubyRun yet. | 219 // Don't bother positioning the RenderRubyRun yet. |
220 RenderRubyText* rt = rubyText(); | 220 RenderRubyText* rt = rubyText(); |
221 if (!rt) | 221 if (!rt) |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 // We can overhang the ruby by no more than half the width of the neighborin
g text | 309 // We can overhang the ruby by no more than half the width of the neighborin
g text |
310 // and no more than half the font size. | 310 // and no more than half the font size. |
311 int halfWidthOfFontSize = rubyText->style(firstLine)->fontSize() / 2; | 311 int halfWidthOfFontSize = rubyText->style(firstLine)->fontSize() / 2; |
312 if (startOverhang) | 312 if (startOverhang) |
313 startOverhang = min<int>(startOverhang, min<int>(toRenderText(startRende
rer)->minLogicalWidth(), halfWidthOfFontSize)); | 313 startOverhang = min<int>(startOverhang, min<int>(toRenderText(startRende
rer)->minLogicalWidth(), halfWidthOfFontSize)); |
314 if (endOverhang) | 314 if (endOverhang) |
315 endOverhang = min<int>(endOverhang, min<int>(toRenderText(endRenderer)->
minLogicalWidth(), halfWidthOfFontSize)); | 315 endOverhang = min<int>(endOverhang, min<int>(toRenderText(endRenderer)->
minLogicalWidth(), halfWidthOfFontSize)); |
316 } | 316 } |
317 | 317 |
318 } // namespace WebCore | 318 } // namespace WebCore |
OLD | NEW |