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 776 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
787 curr->SetLogicalTop(new_logical_top); | 787 curr->SetLogicalTop(new_logical_top); |
788 | 788 |
789 if (child_affects_top_bottom_pos) { | 789 if (child_affects_top_bottom_pos) { |
790 if (curr->GetLineLayoutItem().IsRubyRun()) { | 790 if (curr->GetLineLayoutItem().IsRubyRun()) { |
791 // Treat the leading on the first and last lines of ruby runs as not | 791 // Treat the leading on the first and last lines of ruby runs as not |
792 // being part of the overall lineTop/lineBottom. | 792 // being part of the overall lineTop/lineBottom. |
793 // Really this is a workaround hack for the fact that ruby should have | 793 // Really this is a workaround hack for the fact that ruby should have |
794 // been done as line layout and not done using inline-block. | 794 // been done as line layout and not done using inline-block. |
795 if (GetLineLayoutItem().Style()->IsFlippedLinesWritingMode() == | 795 if (GetLineLayoutItem().Style()->IsFlippedLinesWritingMode() == |
796 (curr->GetLineLayoutItem().Style()->GetRubyPosition() == | 796 (curr->GetLineLayoutItem().Style()->GetRubyPosition() == |
797 kRubyPositionAfter)) | 797 RubyPosition::kAfter)) |
798 has_annotations_before = true; | 798 has_annotations_before = true; |
799 else | 799 else |
800 has_annotations_after = true; | 800 has_annotations_after = true; |
801 | 801 |
802 LineLayoutRubyRun ruby_run = | 802 LineLayoutRubyRun ruby_run = |
803 LineLayoutRubyRun(curr->GetLineLayoutItem()); | 803 LineLayoutRubyRun(curr->GetLineLayoutItem()); |
804 if (LineLayoutRubyBase ruby_base = ruby_run.RubyBase()) { | 804 if (LineLayoutRubyBase ruby_base = ruby_run.RubyBase()) { |
805 LayoutUnit bottom_ruby_base_leading = | 805 LayoutUnit bottom_ruby_base_leading = |
806 (curr->LogicalHeight() - ruby_base.LogicalBottom()) + | 806 (curr->LogicalHeight() - ruby_base.LogicalBottom()) + |
807 ruby_base.LogicalHeight() - | 807 ruby_base.LogicalHeight() - |
(...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1506 continue; // Positioned placeholders don't affect calculations. | 1506 continue; // Positioned placeholders don't affect calculations. |
1507 | 1507 |
1508 if (curr->IsInlineFlowBox()) | 1508 if (curr->IsInlineFlowBox()) |
1509 result = std::max(result, | 1509 result = std::max(result, |
1510 ToInlineFlowBox(curr)->ComputeOverAnnotationAdjustment( | 1510 ToInlineFlowBox(curr)->ComputeOverAnnotationAdjustment( |
1511 allowed_position)); | 1511 allowed_position)); |
1512 | 1512 |
1513 if (curr->GetLineLayoutItem().IsAtomicInlineLevel() && | 1513 if (curr->GetLineLayoutItem().IsAtomicInlineLevel() && |
1514 curr->GetLineLayoutItem().IsRubyRun() && | 1514 curr->GetLineLayoutItem().IsRubyRun() && |
1515 curr->GetLineLayoutItem().Style()->GetRubyPosition() == | 1515 curr->GetLineLayoutItem().Style()->GetRubyPosition() == |
1516 kRubyPositionBefore) { | 1516 RubyPosition::kBefore) { |
1517 LineLayoutRubyRun ruby_run = LineLayoutRubyRun(curr->GetLineLayoutItem()); | 1517 LineLayoutRubyRun ruby_run = LineLayoutRubyRun(curr->GetLineLayoutItem()); |
1518 LineLayoutRubyText ruby_text = ruby_run.RubyText(); | 1518 LineLayoutRubyText ruby_text = ruby_run.RubyText(); |
1519 if (!ruby_text) | 1519 if (!ruby_text) |
1520 continue; | 1520 continue; |
1521 | 1521 |
1522 if (!ruby_run.Style()->IsFlippedLinesWritingMode()) { | 1522 if (!ruby_run.Style()->IsFlippedLinesWritingMode()) { |
1523 LayoutUnit top_of_first_ruby_text_line = | 1523 LayoutUnit top_of_first_ruby_text_line = |
1524 ruby_text.LogicalTop() + (ruby_text.FirstRootBox() | 1524 ruby_text.LogicalTop() + (ruby_text.FirstRootBox() |
1525 ? ruby_text.FirstRootBox()->LineTop() | 1525 ? ruby_text.FirstRootBox()->LineTop() |
1526 : LayoutUnit()); | 1526 : LayoutUnit()); |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1577 continue; // Positioned placeholders don't affect calculations. | 1577 continue; // Positioned placeholders don't affect calculations. |
1578 | 1578 |
1579 if (curr->IsInlineFlowBox()) | 1579 if (curr->IsInlineFlowBox()) |
1580 result = std::max(result, | 1580 result = std::max(result, |
1581 ToInlineFlowBox(curr)->ComputeUnderAnnotationAdjustment( | 1581 ToInlineFlowBox(curr)->ComputeUnderAnnotationAdjustment( |
1582 allowed_position)); | 1582 allowed_position)); |
1583 | 1583 |
1584 if (curr->GetLineLayoutItem().IsAtomicInlineLevel() && | 1584 if (curr->GetLineLayoutItem().IsAtomicInlineLevel() && |
1585 curr->GetLineLayoutItem().IsRubyRun() && | 1585 curr->GetLineLayoutItem().IsRubyRun() && |
1586 curr->GetLineLayoutItem().Style()->GetRubyPosition() == | 1586 curr->GetLineLayoutItem().Style()->GetRubyPosition() == |
1587 kRubyPositionAfter) { | 1587 RubyPosition::kAfter) { |
1588 LineLayoutRubyRun ruby_run = LineLayoutRubyRun(curr->GetLineLayoutItem()); | 1588 LineLayoutRubyRun ruby_run = LineLayoutRubyRun(curr->GetLineLayoutItem()); |
1589 LineLayoutRubyText ruby_text = ruby_run.RubyText(); | 1589 LineLayoutRubyText ruby_text = ruby_run.RubyText(); |
1590 if (!ruby_text) | 1590 if (!ruby_text) |
1591 continue; | 1591 continue; |
1592 | 1592 |
1593 if (ruby_run.Style()->IsFlippedLinesWritingMode()) { | 1593 if (ruby_run.Style()->IsFlippedLinesWritingMode()) { |
1594 LayoutUnit top_of_first_ruby_text_line = | 1594 LayoutUnit top_of_first_ruby_text_line = |
1595 ruby_text.LogicalTop() + (ruby_text.FirstRootBox() | 1595 ruby_text.LogicalTop() + (ruby_text.FirstRootBox() |
1596 ? ruby_text.FirstRootBox()->LineTop() | 1596 ? ruby_text.FirstRootBox()->LineTop() |
1597 : LayoutUnit()); | 1597 : LayoutUnit()); |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1707 InlineBox::ShowLineTreeAndMark(marked_box1, marked_label1, marked_box2, | 1707 InlineBox::ShowLineTreeAndMark(marked_box1, marked_label1, marked_box2, |
1708 marked_label2, obj, depth); | 1708 marked_label2, obj, depth); |
1709 for (const InlineBox* box = FirstChild(); box; box = box->NextOnLine()) | 1709 for (const InlineBox* box = FirstChild(); box; box = box->NextOnLine()) |
1710 box->ShowLineTreeAndMark(marked_box1, marked_label1, marked_box2, | 1710 box->ShowLineTreeAndMark(marked_box1, marked_label1, marked_box2, |
1711 marked_label2, obj, depth + 1); | 1711 marked_label2, obj, depth + 1); |
1712 } | 1712 } |
1713 | 1713 |
1714 #endif | 1714 #endif |
1715 | 1715 |
1716 } // namespace blink | 1716 } // namespace blink |
OLD | NEW |