OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. | 2 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. |
3 * All rights reserved. | 3 * All rights reserved. |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 // The root inline box never has borders/margins/padding. | 332 // The root inline box never has borders/margins/padding. |
333 if (Parent()) { | 333 if (Parent()) { |
334 bool ltr = GetLineLayoutItem().Style()->IsLeftToRightDirection(); | 334 bool ltr = GetLineLayoutItem().Style()->IsLeftToRightDirection(); |
335 | 335 |
336 // Check to see if all initial lines are unconstructed. If so, then | 336 // Check to see if all initial lines are unconstructed. If so, then |
337 // we know the inline began on this line (unless we are a continuation). | 337 // we know the inline began on this line (unless we are a continuation). |
338 LineBoxList* line_box_list = LineBoxes(); | 338 LineBoxList* line_box_list = LineBoxes(); |
339 if (!line_box_list->FirstLineBox()->IsConstructed() && | 339 if (!line_box_list->FirstLineBox()->IsConstructed() && |
340 !GetLineLayoutItem().IsInlineElementContinuation()) { | 340 !GetLineLayoutItem().IsInlineElementContinuation()) { |
341 if (GetLineLayoutItem().Style()->BoxDecorationBreak() == | 341 if (GetLineLayoutItem().Style()->BoxDecorationBreak() == |
342 kBoxDecorationBreakClone) | 342 EBoxDecorationBreak::kClone) |
343 include_left_edge = include_right_edge = true; | 343 include_left_edge = include_right_edge = true; |
344 else if (ltr && line_box_list->FirstLineBox() == this) | 344 else if (ltr && line_box_list->FirstLineBox() == this) |
345 include_left_edge = true; | 345 include_left_edge = true; |
346 else if (!ltr && line_box_list->LastLineBox() == this) | 346 else if (!ltr && line_box_list->LastLineBox() == this) |
347 include_right_edge = true; | 347 include_right_edge = true; |
348 } | 348 } |
349 | 349 |
350 if (!line_box_list->LastLineBox()->IsConstructed()) { | 350 if (!line_box_list->LastLineBox()->IsConstructed()) { |
351 LineLayoutInline inline_flow = LineLayoutInline(GetLineLayoutItem()); | 351 LineLayoutInline inline_flow = LineLayoutInline(GetLineLayoutItem()); |
352 LineLayoutItem logically_last_run_layout_item( | 352 LineLayoutItem logically_last_run_layout_item( |
353 logically_last_run_layout_object); | 353 logically_last_run_layout_object); |
354 bool is_last_object_on_line = | 354 bool is_last_object_on_line = |
355 !IsAncestorAndWithinBlock(GetLineLayoutItem(), | 355 !IsAncestorAndWithinBlock(GetLineLayoutItem(), |
356 logically_last_run_layout_item) || | 356 logically_last_run_layout_item) || |
357 (IsLastChildForLayoutObject(GetLineLayoutItem(), | 357 (IsLastChildForLayoutObject(GetLineLayoutItem(), |
358 logically_last_run_layout_item) && | 358 logically_last_run_layout_item) && |
359 !is_logically_last_run_wrapped); | 359 !is_logically_last_run_wrapped); |
360 | 360 |
361 // We include the border under these conditions: | 361 // We include the border under these conditions: |
362 // (1) The next line was not created, or it is constructed. We check the | 362 // (1) The next line was not created, or it is constructed. We check the |
363 // previous line for rtl. | 363 // previous line for rtl. |
364 // (2) The logicallyLastRun is not a descendant of this layout object. | 364 // (2) The logicallyLastRun is not a descendant of this layout object. |
365 // (3) The logicallyLastRun is a descendant of this layout object, but it | 365 // (3) The logicallyLastRun is a descendant of this layout object, but it |
366 // is the last child of this layout object and it does not wrap to the | 366 // is the last child of this layout object and it does not wrap to the |
367 // next line. | 367 // next line. |
368 // (4) The decoration break is set to clone therefore there will be | 368 // (4) The decoration break is set to clone therefore there will be |
369 // borders on every sides. | 369 // borders on every sides. |
370 if (GetLineLayoutItem().Style()->BoxDecorationBreak() == | 370 if (GetLineLayoutItem().Style()->BoxDecorationBreak() == |
371 kBoxDecorationBreakClone) { | 371 EBoxDecorationBreak::kClone) { |
372 include_left_edge = include_right_edge = true; | 372 include_left_edge = include_right_edge = true; |
373 } else if (ltr) { | 373 } else if (ltr) { |
374 if (!NextLineBox() && ((last_line || is_last_object_on_line) && | 374 if (!NextLineBox() && ((last_line || is_last_object_on_line) && |
375 !inline_flow.Continuation())) | 375 !inline_flow.Continuation())) |
376 include_right_edge = true; | 376 include_right_edge = true; |
377 } else { | 377 } else { |
378 if ((!PrevLineBox() || PrevLineBox()->IsConstructed()) && | 378 if ((!PrevLineBox() || PrevLineBox()->IsConstructed()) && |
379 ((last_line || is_last_object_on_line) && | 379 ((last_line || is_last_object_on_line) && |
380 !inline_flow.Continuation())) | 380 !inline_flow.Continuation())) |
381 include_left_edge = true; | 381 include_left_edge = true; |
(...skipping 1371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1753 DCHECK_EQ(child->prevOnLine(), prev); | 1753 DCHECK_EQ(child->prevOnLine(), prev); |
1754 prev = child; | 1754 prev = child; |
1755 } | 1755 } |
1756 DCHECK_EQ(prev, m_lastChild); | 1756 DCHECK_EQ(prev, m_lastChild); |
1757 #endif | 1757 #endif |
1758 } | 1758 } |
1759 | 1759 |
1760 #endif | 1760 #endif |
1761 | 1761 |
1762 } // namespace blink | 1762 } // namespace blink |
OLD | NEW |