| 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 16 matching lines...) Expand all Loading... |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #include "config.h" | 31 #include "config.h" |
| 32 | 32 |
| 33 #include "core/layout/LayoutRubyRun.h" | 33 #include "core/layout/LayoutRubyRun.h" |
| 34 | 34 |
| 35 #include "core/layout/LayoutRubyBase.h" | 35 #include "core/layout/LayoutRubyBase.h" |
| 36 #include "core/layout/LayoutRubyText.h" | 36 #include "core/layout/LayoutRubyText.h" |
| 37 #include "core/rendering/RenderText.h" | 37 #include "core/layout/LayoutText.h" |
| 38 | 38 |
| 39 namespace blink { | 39 namespace blink { |
| 40 | 40 |
| 41 LayoutRubyRun::LayoutRubyRun() | 41 LayoutRubyRun::LayoutRubyRun() |
| 42 : LayoutBlockFlow(0) | 42 : LayoutBlockFlow(0) |
| 43 { | 43 { |
| 44 setReplaced(true); | 44 setReplaced(true); |
| 45 setInline(true); | 45 setInline(true); |
| 46 } | 46 } |
| 47 | 47 |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 startOverhang = 0; | 290 startOverhang = 0; |
| 291 | 291 |
| 292 if (!endRenderer || !endRenderer->isText() || endRenderer->style(firstLine)-
>fontSize() > rubyBase->style(firstLine)->fontSize()) | 292 if (!endRenderer || !endRenderer->isText() || endRenderer->style(firstLine)-
>fontSize() > rubyBase->style(firstLine)->fontSize()) |
| 293 endOverhang = 0; | 293 endOverhang = 0; |
| 294 | 294 |
| 295 // We overhang a ruby only if the neighboring render object is a text. | 295 // We overhang a ruby only if the neighboring render object is a text. |
| 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>(toLayoutText(
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>(toLayoutText(endR
enderer)->minLogicalWidth(), halfWidthOfFontSize)); |
| 303 } | 303 } |
| 304 | 304 |
| 305 } // namespace blink | 305 } // namespace blink |
| OLD | NEW |