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 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 LayoutUnit last_line_ruby_text_bottom = rt->LogicalHeight(); | 229 LayoutUnit last_line_ruby_text_bottom = rt->LogicalHeight(); |
230 LayoutUnit first_line_ruby_text_top; | 230 LayoutUnit first_line_ruby_text_top; |
231 RootInlineBox* root_box = rt->LastRootBox(); | 231 RootInlineBox* root_box = rt->LastRootBox(); |
232 if (root_box) { | 232 if (root_box) { |
233 // In order to align, we have to ignore negative leading. | 233 // In order to align, we have to ignore negative leading. |
234 first_line_ruby_text_top = rt->FirstRootBox()->LogicalTopLayoutOverflow(); | 234 first_line_ruby_text_top = rt->FirstRootBox()->LogicalTopLayoutOverflow(); |
235 last_line_ruby_text_bottom = root_box->LogicalBottomLayoutOverflow(); | 235 last_line_ruby_text_bottom = root_box->LogicalBottomLayoutOverflow(); |
236 } | 236 } |
237 | 237 |
238 if (Style()->IsFlippedLinesWritingMode() == | 238 if (Style()->IsFlippedLinesWritingMode() == |
239 (Style()->GetRubyPosition() == kRubyPositionAfter)) { | 239 (Style()->GetRubyPosition() == RubyPosition::kAfter)) { |
240 LayoutUnit first_line_top; | 240 LayoutUnit first_line_top; |
241 if (LayoutRubyBase* rb = RubyBase()) { | 241 if (LayoutRubyBase* rb = RubyBase()) { |
242 RootInlineBox* root_box = rb->FirstRootBox(); | 242 RootInlineBox* root_box = rb->FirstRootBox(); |
243 if (root_box) | 243 if (root_box) |
244 first_line_top = root_box->LogicalTopLayoutOverflow(); | 244 first_line_top = root_box->LogicalTopLayoutOverflow(); |
245 first_line_top += rb->LogicalTop(); | 245 first_line_top += rb->LogicalTop(); |
246 } | 246 } |
247 | 247 |
248 rt->SetLogicalTop(-last_line_ruby_text_bottom + first_line_top); | 248 rt->SetLogicalTop(-last_line_ruby_text_bottom + first_line_top); |
249 } else { | 249 } else { |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 case U_LB_GLUE: | 345 case U_LB_GLUE: |
346 case U_LB_OPEN_PUNCTUATION: | 346 case U_LB_OPEN_PUNCTUATION: |
347 return false; | 347 return false; |
348 default: | 348 default: |
349 break; | 349 break; |
350 } | 350 } |
351 return true; | 351 return true; |
352 } | 352 } |
353 | 353 |
354 } // namespace blink | 354 } // namespace blink |
OLD | NEW |