| 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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 ContentRun(LayoutUnit breakOffset) | 154 ContentRun(LayoutUnit breakOffset) |
| 155 : m_breakOffset(breakOffset) | 155 : m_breakOffset(breakOffset) |
| 156 , m_assumedImplicitBreaks(0) { } | 156 , m_assumedImplicitBreaks(0) { } |
| 157 | 157 |
| 158 unsigned assumedImplicitBreaks() const { return m_assumedImplicitBreaks;
} | 158 unsigned assumedImplicitBreaks() const { return m_assumedImplicitBreaks;
} |
| 159 void assumeAnotherImplicitBreak() { m_assumedImplicitBreaks++; } | 159 void assumeAnotherImplicitBreak() { m_assumedImplicitBreaks++; } |
| 160 LayoutUnit breakOffset() const { return m_breakOffset; } | 160 LayoutUnit breakOffset() const { return m_breakOffset; } |
| 161 | 161 |
| 162 // Return the column height that this content run would require, conside
ring the implicit | 162 // Return the column height that this content run would require, conside
ring the implicit |
| 163 // breaks assumed so far. | 163 // breaks assumed so far. |
| 164 LayoutUnit columnLogicalHeight(LayoutUnit startOffset) const { return ce
ilf(float(m_breakOffset - startOffset) / float(m_assumedImplicitBreaks + 1)); } | 164 LayoutUnit columnLogicalHeight(LayoutUnit startOffset) const { return ce
ilf((m_breakOffset - startOffset).toFloat() / float(m_assumedImplicitBreaks + 1)
); } |
| 165 | 165 |
| 166 private: | 166 private: |
| 167 LayoutUnit m_breakOffset; // Flow thread offset where this run ends. | 167 LayoutUnit m_breakOffset; // Flow thread offset where this run ends. |
| 168 unsigned m_assumedImplicitBreaks; // Number of implicit breaks in this r
un assumed so far. | 168 unsigned m_assumedImplicitBreaks; // Number of implicit breaks in this r
un assumed so far. |
| 169 }; | 169 }; |
| 170 Vector<ContentRun, 1> m_contentRuns; | 170 Vector<ContentRun, 1> m_contentRuns; |
| 171 }; | 171 }; |
| 172 | 172 |
| 173 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderMultiColumnSet, isRenderMultiColumnSet()); | 173 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderMultiColumnSet, isRenderMultiColumnSet()); |
| 174 | 174 |
| 175 } // namespace WebCore | 175 } // namespace WebCore |
| 176 | 176 |
| 177 #endif // RenderMultiColumnSet_h | 177 #endif // RenderMultiColumnSet_h |
| 178 | 178 |
| OLD | NEW |