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 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
467 logicalHeight += group.logicalHeight(); | 467 logicalHeight += group.logicalHeight(); |
468 computedValues.m_extent = logicalHeight; | 468 computedValues.m_extent = logicalHeight; |
469 computedValues.m_position = logicalTop; | 469 computedValues.m_position = logicalTop; |
470 } | 470 } |
471 | 471 |
472 PositionWithAffinity LayoutMultiColumnSet::positionForPoint( | 472 PositionWithAffinity LayoutMultiColumnSet::positionForPoint( |
473 const LayoutPoint& point) { | 473 const LayoutPoint& point) { |
474 // Convert the visual point to a flow thread point. | 474 // Convert the visual point to a flow thread point. |
475 const MultiColumnFragmentainerGroup& row = | 475 const MultiColumnFragmentainerGroup& row = |
476 fragmentainerGroupAtVisualPoint(point); | 476 fragmentainerGroupAtVisualPoint(point); |
477 LayoutPoint flowThreadPoint = | 477 LayoutPoint flowThreadPoint = row.visualPointToFlowThreadPoint( |
478 row.visualPointToFlowThreadPoint(point + row.offsetFromColumnSet()); | 478 point + row.offsetFromColumnSet(), |
| 479 MultiColumnFragmentainerGroup::SnapToColumn); |
479 // Then drill into the flow thread, where we'll find the actual content. | 480 // Then drill into the flow thread, where we'll find the actual content. |
480 return flowThread()->positionForPoint(flowThreadPoint); | 481 return flowThread()->positionForPoint(flowThreadPoint); |
481 } | 482 } |
482 | 483 |
483 LayoutUnit LayoutMultiColumnSet::columnGap() const { | 484 LayoutUnit LayoutMultiColumnSet::columnGap() const { |
484 LayoutBlockFlow* parentBlock = multiColumnBlockFlow(); | 485 LayoutBlockFlow* parentBlock = multiColumnBlockFlow(); |
485 | 486 |
486 if (parentBlock->style()->hasNormalColumnGap()) { | 487 if (parentBlock->style()->hasNormalColumnGap()) { |
487 // "1em" is recommended as the normal gap setting. Matches <p> margins. | 488 // "1em" is recommended as the normal gap setting. Matches <p> margins. |
488 return LayoutUnit( | 489 return LayoutUnit( |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
626 // Now add in column rule bounds, if present. | 627 // Now add in column rule bounds, if present. |
627 Vector<LayoutRect> columnRuleBounds; | 628 Vector<LayoutRect> columnRuleBounds; |
628 if (computeColumnRuleBounds(LayoutPoint(), columnRuleBounds)) { | 629 if (computeColumnRuleBounds(LayoutPoint(), columnRuleBounds)) { |
629 for (auto& bound : columnRuleBounds) | 630 for (auto& bound : columnRuleBounds) |
630 blockFlowBounds.unite(bound); | 631 blockFlowBounds.unite(bound); |
631 } | 632 } |
632 return blockFlowBounds; | 633 return blockFlowBounds; |
633 } | 634 } |
634 | 635 |
635 } // namespace blink | 636 } // namespace blink |
OLD | NEW |