Changeset 167817 in webkit
- Timestamp:
- Apr 25, 2014 1:20:48 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 16 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r167812 r167817 1 2014-04-25 David Hyatt <hyatt@apple.com> 2 3 [New Multicolumn] fast/multicol/hit-test-* layout tests all fail 4 https://bugs.webkit.org/show_bug.cgi?id=132081 5 6 Reviewed by Dean Jackson. 7 8 * fast/multicol/newmulticol/compare-with-old-impl/hit-test-above-or-below-expected.txt: Added. 9 * fast/multicol/newmulticol/compare-with-old-impl/hit-test-above-or-below.html: Added. 10 * fast/multicol/newmulticol/compare-with-old-impl/hit-test-block-axis-flipped-expected.txt: Added. 11 * fast/multicol/newmulticol/compare-with-old-impl/hit-test-block-axis-flipped.html: Added. 12 * fast/multicol/newmulticol/compare-with-old-impl/hit-test-end-of-column-expected.txt: Added. 13 * fast/multicol/newmulticol/compare-with-old-impl/hit-test-end-of-column-with-line-height-expected.txt: Added. 14 * fast/multicol/newmulticol/compare-with-old-impl/hit-test-end-of-column-with-line-height.html: Added. 15 * fast/multicol/newmulticol/compare-with-old-impl/hit-test-end-of-column.html: Added. 16 * fast/multicol/newmulticol/compare-with-old-impl/hit-test-float-expected.txt: Added. 17 * fast/multicol/newmulticol/compare-with-old-impl/hit-test-float.html: Added. 18 * fast/multicol/newmulticol/compare-with-old-impl/hit-test-gap-between-pages-expected.txt: Added. 19 * fast/multicol/newmulticol/compare-with-old-impl/hit-test-gap-between-pages-flipped-expected.txt: Added. 20 * fast/multicol/newmulticol/compare-with-old-impl/hit-test-gap-between-pages-flipped.html: Added. 21 * fast/multicol/newmulticol/compare-with-old-impl/hit-test-gap-between-pages.html: Added. 22 * fast/multicol/newmulticol/compare-with-old-impl/hit-test-gap-block-axis-expected.txt: Added. 23 * fast/multicol/newmulticol/compare-with-old-impl/hit-test-gap-block-axis.html: Added. 24 1 25 2014-04-25 Tim Horton <timothy_horton@apple.com> 2 26 -
trunk/Source/WebCore/ChangeLog
r167811 r167817 1 2014-04-25 David Hyatt <hyatt@apple.com> 2 3 [New Multicolumn] fast/multicol/hit-test-* layout tests all fail 4 https://bugs.webkit.org/show_bug.cgi?id=132081 5 6 Reviewed by Dean Jackson. 7 8 Added a bunch of tests in fast/multicol/newmulticol/compare-with-old-impl/hit-test-*.html 9 10 * rendering/RenderBlock.h: 11 Make offsetForContents public, since I need to call it from RenderMultiColumnSet. 12 13 * rendering/RenderMultiColumnFlowThread.cpp: 14 (WebCore::RenderMultiColumnFlowThread::populate): 15 Stop an ASSERT in the new columns code on the hit tests by making sure layout state is 16 disabled when moving children around. 17 18 * rendering/RenderMultiColumnSet.cpp: 19 (WebCore::RenderMultiColumnSet::positionForPoint): 20 Refactor this function to call a helper function instead, translateRegionPointToFlowThread. 21 22 (WebCore::RenderMultiColumnSet::translateRegionPointToFlowThread): 23 This function is logical (unlike the mistaken physical function I first implemented in 24 positionForPoint). 25 26 (WebCore::RenderMultiColumnSet::updateHitTestResult): 27 * rendering/RenderMultiColumnSet.h: 28 Overridden to fill in the correct local coordinate when the HTML document is inside a paginated 29 RenderView. Note that column spans don't actually work, but once we move over to a 30 non-column based pagination API, that will become irrelevant. 31 1 32 2014-04-25 Andreas Kling <akling@apple.com> 2 33 -
trunk/Source/WebCore/rendering/RenderBlock.h
r167803 r167817 419 419 // FIXME: Can devirtualize once old column code is gone. 420 420 virtual void computeLineGridPaginationOrigin(LayoutState&) const; 421 422 // Adjust from painting offsets to the local coords of this renderer 423 void offsetForContents(LayoutPoint&) const; 421 424 422 425 protected: … … 569 572 570 573 protected: 571 // Adjust from painting offsets to the local coords of this renderer572 void offsetForContents(LayoutPoint&) const;573 574 574 virtual bool requiresColumns(int computedColumnCount) const; 575 575 -
trunk/Source/WebCore/rendering/RenderMultiColumnFlowThread.cpp
r167808 r167817 156 156 // now. At this point there's obviously nothing after the flow thread, but renderers (column 157 157 // sets and spanners) will be inserted there as we insert elements into the flow thread. 158 LayoutStateDisabler layoutStateDisabler(&view()); 158 159 multicolContainer->moveChildrenTo(this, multicolContainer->firstChild(), this, true); 159 160 } -
trunk/Source/WebCore/rendering/RenderMultiColumnSet.cpp
r167808 r167817 28 28 29 29 #include "FrameView.h" 30 #include "HitTestResult.h" 30 31 #include "PaintInfo.h" 31 32 #include "RenderLayer.h" … … 870 871 } 871 872 872 VisiblePosition RenderMultiColumnSet::positionForPoint(const LayoutPoint& physicalPoint, const RenderRegion*) 873 VisiblePosition RenderMultiColumnSet::positionForPoint(const LayoutPoint& logicalPoint, const RenderRegion*) 874 { 875 return multiColumnFlowThread()->positionForPoint(translateRegionPointToFlowThread(logicalPoint, ClampHitTestTranslationToColumns), this); 876 } 877 878 LayoutPoint RenderMultiColumnSet::translateRegionPointToFlowThread(const LayoutPoint & logicalPoint, ColumnHitTestTranslationMode clampMode) const 873 879 { 874 880 // Determine which columns we intersect. 875 881 LayoutUnit colGap = columnGap(); 876 882 LayoutUnit halfColGap = colGap / 2; 877 LayoutPoint columnPoint(columnRectAt(0).location()); 878 LayoutUnit logicalOffset = 0; 879 883 880 884 bool progressionIsInline = multiColumnFlowThread()->progressionIsInline(); 881 885 882 LayoutPoint point = physicalPoint;886 LayoutPoint point = logicalPoint; 883 887 884 888 for (unsigned i = 0; i < columnCount(); i++) { 885 889 // Add in half the column gap to the left and right of the rect. 886 890 LayoutRect colRect = columnRectAt(i); 887 flipForWritingMode(colRect);888 891 if (isHorizontalWritingMode() == progressionIsInline) { 889 892 LayoutRect gapAndColumnRect(colRect.x() - halfColGap, colRect.y(), colRect.width() + colGap, colRect.height()); 890 893 if (point.x() >= gapAndColumnRect.x() && point.x() < gapAndColumnRect.maxX()) { 891 if (progressionIsInline) { 892 // FIXME: The clamping that follows is not completely right for right-to-left 893 // content. 894 // Clamp everything above the column to its top left. 895 if (point.y() < gapAndColumnRect.y()) 896 point = gapAndColumnRect.location(); 897 // Clamp everything below the column to the next column's top left. If there is 898 // no next column, this still maps to just after this column. 899 else if (point.y() >= gapAndColumnRect.maxY()) { 900 point = gapAndColumnRect.location(); 901 point.move(0, gapAndColumnRect.height()); 894 if (clampMode == ClampHitTestTranslationToColumns) { 895 if (progressionIsInline) { 896 // FIXME: The clamping that follows is not completely right for right-to-left 897 // content. 898 // Clamp everything above the column to its top left. 899 if (point.y() < gapAndColumnRect.y()) 900 point = gapAndColumnRect.location(); 901 // Clamp everything below the column to the next column's top left. If there is 902 // no next column, this still maps to just after this column. 903 else if (point.y() >= gapAndColumnRect.maxY()) { 904 point = gapAndColumnRect.location(); 905 point.move(0, gapAndColumnRect.height()); 906 } 907 } else { 908 if (point.x() < colRect.x()) 909 point.setX(colRect.x()); 910 else if (point.x() >= colRect.maxX()) 911 point.setX(colRect.maxX() - 1); 902 912 } 903 } else {904 if (point.x() < colRect.x())905 point.setX(colRect.x());906 else if (point.x() >= colRect.maxX())907 point.setX(colRect.maxX() - 1);908 913 } 909 910 // We're inside the column. Translate the x and y into our column coordinate space.911 if (progressionIsInline)912 point.move(columnPoint.x() - colRect.x(), (!style().isFlippedBlocksWritingMode() ? logicalOffset : -logicalOffset));913 else914 point.move((!style().isFlippedBlocksWritingMode() ? logicalOffset : -logicalOffset) - colRect.x() + borderLeft() + paddingLeft(), 0);915 914 916 Layout Rect portion = flowThreadPortionRect();917 flipForWritingMode(portion);918 point.move(isHorizontalWritingMode() ? LayoutUnit() : portion.x(), isHorizontalWritingMode() ? portion.y() : LayoutUnit());919 return multiColumnFlowThread()->positionForPoint(point, this);915 LayoutSize offsetInColumn = point - colRect.location(); 916 LayoutRect flowThreadPortion = flowThreadPortionRectAt(i); 917 918 return flowThreadPortion.location() + offsetInColumn; 920 919 } 921 922 // Move to the next position.923 logicalOffset += progressionIsInline ? colRect.height() : colRect.width();924 920 } else { 925 921 LayoutRect gapAndColumnRect(colRect.x(), colRect.y() - halfColGap, colRect.width(), colRect.height() + colGap); 926 922 if (point.y() >= gapAndColumnRect.y() && point.y() < gapAndColumnRect.maxY()) { 927 if (progressionIsInline) { 928 // FIXME: The clamping that follows is not completely right for right-to-left 929 // content. 930 // Clamp everything above the column to its top left. 931 if (point.x() < gapAndColumnRect.x()) 932 point = gapAndColumnRect.location(); 933 // Clamp everything below the column to the next column's top left. If there is 934 // no next column, this still maps to just after this column. 935 else if (point.x() >= gapAndColumnRect.maxX()) { 936 point = gapAndColumnRect.location(); 937 point.move(gapAndColumnRect.width(), 0); 923 if (clampMode == ClampHitTestTranslationToColumns) { 924 if (progressionIsInline) { 925 // FIXME: The clamping that follows is not completely right for right-to-left 926 // content. 927 // Clamp everything above the column to its top left. 928 if (point.x() < gapAndColumnRect.x()) 929 point = gapAndColumnRect.location(); 930 // Clamp everything below the column to the next column's top left. If there is 931 // no next column, this still maps to just after this column. 932 else if (point.x() >= gapAndColumnRect.maxX()) { 933 point = gapAndColumnRect.location(); 934 point.move(gapAndColumnRect.width(), 0); 935 } 936 } else { 937 if (point.y() < colRect.y()) 938 point.setY(colRect.y()); 939 else if (point.y() >= colRect.maxY()) 940 point.setY(colRect.maxY() - 1); 938 941 } 939 } else {940 if (point.y() < colRect.y())941 point.setY(colRect.y());942 else if (point.y() >= colRect.maxY())943 point.setY(colRect.maxY() - 1);944 942 } 945 946 // We're inside the column. Translate the x and y into our column coordinate space.947 if (progressionIsInline)948 point.move((!style().isFlippedBlocksWritingMode() ? logicalOffset : -logicalOffset), columnPoint.y() - colRect.y());949 else950 point.move(0, (!style().isFlippedBlocksWritingMode() ? logicalOffset : -logicalOffset) - colRect.y() + borderTop() + paddingTop());951 943 952 LayoutRect portion = flowThreadPortionRect(); 953 flipForWritingMode(portion); 954 point.move(isHorizontalWritingMode() ? LayoutUnit() : portion.x(), isHorizontalWritingMode() ? portion.y() : LayoutUnit()); 955 956 return multiColumnFlowThread()->positionForPoint(point, this); 944 LayoutSize offsetInColumn = point - colRect.location(); 945 LayoutRect flowThreadPortion = flowThreadPortionRectAt(i); 946 return flowThreadPortion.location() + offsetInColumn; 957 947 } 958 959 // Move to the next position.960 logicalOffset += progressionIsInline ? colRect.width() : colRect.height();961 948 } 962 949 } 963 950 964 return VisiblePosition(); 951 return logicalPoint; 952 } 953 954 void RenderMultiColumnSet::updateHitTestResult(HitTestResult& result, const LayoutPoint& point) 955 { 956 if (result.innerNode() || !parent()->isRenderView()) 957 return; 958 959 // Note this does not work with column spans, but once we implement RenderPageSet, we can move this code 960 // over there instead (and spans of course won't be allowed on pages). 961 Node* node = document().documentElement(); 962 if (node) { 963 result.setInnerNode(node); 964 if (!result.innerNonSharedNode()) 965 result.setInnerNonSharedNode(node); 966 LayoutPoint adjustedPoint = translateRegionPointToFlowThread(point); 967 view().offsetForContents(adjustedPoint); 968 result.setLocalPoint(adjustedPoint); 969 } 965 970 } 966 971 -
trunk/Source/WebCore/rendering/RenderMultiColumnSet.h
r167803 r167817 120 120 void paintColumnRules(PaintInfo&, const LayoutPoint& paintOffset); 121 121 122 enum ColumnHitTestTranslationMode { 123 ClampHitTestTranslationToColumns, 124 DoNotClampHitTestTranslationToColumns 125 }; 126 LayoutPoint translateRegionPointToFlowThread(const LayoutPoint & logicalPoint, ColumnHitTestTranslationMode = DoNotClampHitTestTranslationToColumns) const; 127 128 virtual void updateHitTestResult(HitTestResult&, const LayoutPoint&) override; 129 122 130 protected: 123 131 void addOverflowFromChildren() override;
Note: See TracChangeset
for help on using the changeset viewer.