OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 727 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
738 line = line->prevRootBox(); | 738 line = line->prevRootBox(); |
739 | 739 |
740 // FIXME: Paginating using line overflow isn't all fine. See FIXME in | 740 // FIXME: Paginating using line overflow isn't all fine. See FIXME in |
741 // adjustLinePositionForPagination() for more details. | 741 // adjustLinePositionForPagination() for more details. |
742 LayoutRect overflow = line->logicalVisualOverflowRect(line->lineTop(), l
ine->lineBottom()); | 742 LayoutRect overflow = line->logicalVisualOverflowRect(line->lineTop(), l
ine->lineBottom()); |
743 lineTop = std::min(line->lineTopWithLeading(), overflow.y()); | 743 lineTop = std::min(line->lineTopWithLeading(), overflow.y()); |
744 } | 744 } |
745 return lineBottom - lineTop; | 745 return lineBottom - lineTop; |
746 } | 746 } |
747 | 747 |
748 void LayoutBlockFlow::adjustLinePositionForPagination(RootInlineBox& lineBox, La
youtUnit& delta, LayoutFlowThread* flowThread) | 748 void LayoutBlockFlow::adjustLinePositionForPagination(RootInlineBox& lineBox, La
youtUnit& delta) |
749 { | 749 { |
750 // FIXME: For now we paginate using line overflow. This ensures that lines d
on't overlap at all when we | 750 // FIXME: For now we paginate using line overflow. This ensures that lines d
on't overlap at all when we |
751 // put a strut between them for pagination purposes. However, this really is
n't the desired layout, since | 751 // put a strut between them for pagination purposes. However, this really is
n't the desired layout, since |
752 // the line on the top of the next page will appear too far down relative to
the same kind of line at the top | 752 // the line on the top of the next page will appear too far down relative to
the same kind of line at the top |
753 // of the first column. | 753 // of the first column. |
754 // | 754 // |
755 // The layout we would like to see is one where the lineTopWithLeading is at
the top of the column, and any line overflow | 755 // The layout we would like to see is one where the lineTopWithLeading is at
the top of the column, and any line overflow |
756 // simply spills out above the top of the column. This effect would match wh
at happens at the top of the first column. | 756 // simply spills out above the top of the column. This effect would match wh
at happens at the top of the first column. |
757 // We can't achieve this layout, however, until we stop columns from clippin
g to the column bounds (thus allowing | 757 // We can't achieve this layout, however, until we stop columns from clippin
g to the column bounds (thus allowing |
758 // for overflow to occur), and then cache visible overflow for each column r
ect. | 758 // for overflow to occur), and then cache visible overflow for each column r
ect. |
(...skipping 2307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3066 FrameView* frameView = document().view(); | 3066 FrameView* frameView = document().view(); |
3067 LayoutUnit top = (style()->position() == FixedPosition) ? 0 : frameView->scr
ollOffset().height(); | 3067 LayoutUnit top = (style()->position() == FixedPosition) ? 0 : frameView->scr
ollOffset().height(); |
3068 int visibleHeight = frameView->visibleContentRect(IncludeScrollbars).height(
); | 3068 int visibleHeight = frameView->visibleContentRect(IncludeScrollbars).height(
); |
3069 if (size().height() < visibleHeight) | 3069 if (size().height() < visibleHeight) |
3070 top += (visibleHeight - size().height()) / 2; | 3070 top += (visibleHeight - size().height()) / 2; |
3071 setY(top); | 3071 setY(top); |
3072 dialog->setCentered(top); | 3072 dialog->setCentered(top); |
3073 } | 3073 } |
3074 | 3074 |
3075 } // namespace blink | 3075 } // namespace blink |
OLD | NEW |