| 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 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 | 271 |
| 272 LayoutRubyBase* rubyBase = this->rubyBase(); | 272 LayoutRubyBase* rubyBase = this->rubyBase(); |
| 273 LayoutRubyText* rubyText = this->rubyText(); | 273 LayoutRubyText* rubyText = this->rubyText(); |
| 274 | 274 |
| 275 if (!rubyBase || !rubyText) | 275 if (!rubyBase || !rubyText) |
| 276 return; | 276 return; |
| 277 | 277 |
| 278 if (!rubyBase->firstRootBox()) | 278 if (!rubyBase->firstRootBox()) |
| 279 return; | 279 return; |
| 280 | 280 |
| 281 int logicalWidth = this->logicalWidth(); | 281 int logicalWidth = this->logicalWidth().toInt(); |
| 282 int logicalLeftOverhang = std::numeric_limits<int>::max(); | 282 int logicalLeftOverhang = std::numeric_limits<int>::max(); |
| 283 int logicalRightOverhang = std::numeric_limits<int>::max(); | 283 int logicalRightOverhang = std::numeric_limits<int>::max(); |
| 284 for (RootInlineBox* rootInlineBox = rubyBase->firstRootBox(); rootInlineBox;
rootInlineBox = rootInlineBox->nextRootBox()) { | 284 for (RootInlineBox* rootInlineBox = rubyBase->firstRootBox(); rootInlineBox;
rootInlineBox = rootInlineBox->nextRootBox()) { |
| 285 logicalLeftOverhang = std::min<int>(logicalLeftOverhang, rootInlineBox->
logicalLeft()); | 285 logicalLeftOverhang = std::min<int>(logicalLeftOverhang, rootInlineBox->
logicalLeft().toInt()); |
| 286 logicalRightOverhang = std::min<int>(logicalRightOverhang, logicalWidth
- rootInlineBox->logicalRight()); | 286 logicalRightOverhang = std::min<int>(logicalRightOverhang, (logicalWidth
- rootInlineBox->logicalRight()).toInt()); |
| 287 } | 287 } |
| 288 | 288 |
| 289 startOverhang = style()->isLeftToRightDirection() ? logicalLeftOverhang : lo
gicalRightOverhang; | 289 startOverhang = style()->isLeftToRightDirection() ? logicalLeftOverhang : lo
gicalRightOverhang; |
| 290 endOverhang = style()->isLeftToRightDirection() ? logicalRightOverhang : log
icalLeftOverhang; | 290 endOverhang = style()->isLeftToRightDirection() ? logicalRightOverhang : log
icalLeftOverhang; |
| 291 | 291 |
| 292 if (!startLayoutObject || !startLayoutObject->isText() || startLayoutObject-
>style(firstLine)->fontSize() > rubyBase->style(firstLine)->fontSize()) | 292 if (!startLayoutObject || !startLayoutObject->isText() || startLayoutObject-
>style(firstLine)->fontSize() > rubyBase->style(firstLine)->fontSize()) |
| 293 startOverhang = 0; | 293 startOverhang = 0; |
| 294 | 294 |
| 295 if (!endLayoutObject || !endLayoutObject->isText() || endLayoutObject->style
(firstLine)->fontSize() > rubyBase->style(firstLine)->fontSize()) | 295 if (!endLayoutObject || !endLayoutObject->isText() || endLayoutObject->style
(firstLine)->fontSize() > rubyBase->style(firstLine)->fontSize()) |
| 296 endOverhang = 0; | 296 endOverhang = 0; |
| (...skipping 27 matching lines...) Expand all 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 |