OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2012 Apple 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 | 56 |
57 RenderMultiColumnSet* RenderMultiColumnSet::nextSiblingMultiColumnSet() const | 57 RenderMultiColumnSet* RenderMultiColumnSet::nextSiblingMultiColumnSet() const |
58 { | 58 { |
59 for (RenderObject* sibling = nextSibling(); sibling; sibling = sibling->next
Sibling()) { | 59 for (RenderObject* sibling = nextSibling(); sibling; sibling = sibling->next
Sibling()) { |
60 if (sibling->isRenderMultiColumnSet()) | 60 if (sibling->isRenderMultiColumnSet()) |
61 return toRenderMultiColumnSet(sibling); | 61 return toRenderMultiColumnSet(sibling); |
62 } | 62 } |
63 return 0; | 63 return 0; |
64 } | 64 } |
65 | 65 |
| 66 LayoutSize RenderMultiColumnSet::flowThreadTranslationAtOffset(LayoutUnit blockO
ffset) const |
| 67 { |
| 68 unsigned columnIndex = columnIndexAtOffset(blockOffset); |
| 69 LayoutRect portionRect(flowThreadPortionRectAt(columnIndex)); |
| 70 flipForWritingMode(portionRect); |
| 71 LayoutRect columnRect(columnRectAt(columnIndex)); |
| 72 flipForWritingMode(columnRect); |
| 73 return contentBoxRect().location() + columnRect.location() - portionRect.loc
ation(); |
| 74 } |
| 75 |
66 LayoutUnit RenderMultiColumnSet::heightAdjustedForSetOffset(LayoutUnit height) c
onst | 76 LayoutUnit RenderMultiColumnSet::heightAdjustedForSetOffset(LayoutUnit height) c
onst |
67 { | 77 { |
68 RenderBlockFlow* multicolBlock = multiColumnBlockFlow(); | 78 RenderBlockFlow* multicolBlock = multiColumnBlockFlow(); |
69 LayoutUnit contentLogicalTop = logicalTop() - multicolBlock->borderBefore()
- multicolBlock->paddingBefore(); | 79 LayoutUnit contentLogicalTop = logicalTop() - multicolBlock->borderBefore()
- multicolBlock->paddingBefore(); |
70 | 80 |
71 height -= contentLogicalTop; | 81 height -= contentLogicalTop; |
72 return max(height, LayoutUnit(1)); // Let's avoid zero height, as that would
probably cause an infinite amount of columns to be created. | 82 return max(height, LayoutUnit(1)); // Let's avoid zero height, as that would
probably cause an infinite amount of columns to be created. |
73 } | 83 } |
74 | 84 |
75 LayoutUnit RenderMultiColumnSet::pageLogicalTopForOffset(LayoutUnit offset) cons
t | 85 LayoutUnit RenderMultiColumnSet::pageLogicalTopForOffset(LayoutUnit offset) cons
t |
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
594 fragments.append(fragment); | 604 fragments.append(fragment); |
595 } | 605 } |
596 } | 606 } |
597 | 607 |
598 const char* RenderMultiColumnSet::renderName() const | 608 const char* RenderMultiColumnSet::renderName() const |
599 { | 609 { |
600 return "RenderMultiColumnSet"; | 610 return "RenderMultiColumnSet"; |
601 } | 611 } |
602 | 612 |
603 } | 613 } |
OLD | NEW |