| 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 LayoutRubyBase* LayoutRubyRun::rubyBaseSafe() | 81 LayoutRubyBase* LayoutRubyRun::rubyBaseSafe() |
| 82 { | 82 { |
| 83 LayoutRubyBase* base = rubyBase(); | 83 LayoutRubyBase* base = rubyBase(); |
| 84 if (!base) { | 84 if (!base) { |
| 85 base = createRubyBase(); | 85 base = createRubyBase(); |
| 86 RenderBlockFlow::addChild(base); | 86 RenderBlockFlow::addChild(base); |
| 87 } | 87 } |
| 88 return base; | 88 return base; |
| 89 } | 89 } |
| 90 | 90 |
| 91 bool LayoutRubyRun::isChildAllowed(RenderObject* child, RenderStyle*) const | 91 bool LayoutRubyRun::isChildAllowed(RenderObject* child, const RenderStyle*) cons
t |
| 92 { | 92 { |
| 93 return child->isRubyText() || child->isInline(); | 93 return child->isRubyText() || child->isInline(); |
| 94 } | 94 } |
| 95 | 95 |
| 96 void LayoutRubyRun::addChild(RenderObject* child, RenderObject* beforeChild) | 96 void LayoutRubyRun::addChild(RenderObject* child, RenderObject* beforeChild) |
| 97 { | 97 { |
| 98 ASSERT(child); | 98 ASSERT(child); |
| 99 | 99 |
| 100 if (child->isRubyText()) { | 100 if (child->isRubyText()) { |
| 101 if (!beforeChild) { | 101 if (!beforeChild) { |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 // We can overhang the ruby by no more than half the width of the neighborin
g text | 296 // We can overhang the ruby by no more than half the width of the neighborin
g text |
| 297 // and no more than half the font size. | 297 // and no more than half the font size. |
| 298 int halfWidthOfFontSize = rubyText->style(firstLine)->fontSize() / 2; | 298 int halfWidthOfFontSize = rubyText->style(firstLine)->fontSize() / 2; |
| 299 if (startOverhang) | 299 if (startOverhang) |
| 300 startOverhang = std::min<int>(startOverhang, std::min<int>(toRenderText(
startRenderer)->minLogicalWidth(), halfWidthOfFontSize)); | 300 startOverhang = std::min<int>(startOverhang, std::min<int>(toRenderText(
startRenderer)->minLogicalWidth(), halfWidthOfFontSize)); |
| 301 if (endOverhang) | 301 if (endOverhang) |
| 302 endOverhang = std::min<int>(endOverhang, std::min<int>(toRenderText(endR
enderer)->minLogicalWidth(), halfWidthOfFontSize)); | 302 endOverhang = std::min<int>(endOverhang, std::min<int>(toRenderText(endR
enderer)->minLogicalWidth(), halfWidthOfFontSize)); |
| 303 } | 303 } |
| 304 | 304 |
| 305 } // namespace blink | 305 } // namespace blink |
| OLD | NEW |