Changeset 123988 in webkit
- Timestamp:
- Jul 29, 2012 3:55:51 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r123980 r123988 1 2012-07-29 Dan Bernstein <mitz@apple.com> 2 3 In flipped blocks, a point on the top edge of a text box is considered outside the box (and vice versa) 4 https://bugs.webkit.org/show_bug.cgi?id=92597 5 6 Reviewed by Ryosuke Niwa. 7 8 Added hits inside the text to this test. 9 10 * fast/writing-mode/flipped-blocks-hit-test-line-edges-expected.txt: 11 * fast/writing-mode/flipped-blocks-hit-test-line-edges.html: 12 1 13 2012-07-29 Dan Bernstein <mitz@apple.com> 2 14 -
trunk/LayoutTests/fast/writing-mode/flipped-blocks-hit-test-line-edges-expected.txt
r123980 r123988 1 1 Lorem ipsum dolor sit amet 2 PASS: offset at (100,105) was 4. 2 3 PASS: offset at (160,105) was 5. 4 PASS: offset at (100,104) was 10. 3 5 PASS: offset at (160,104) was 11. 6 PASS: offset at (60,26) was 24. 4 7 PASS: offset at (160,26) was 26. 8 PASS: offset at (60,25) was 24. 5 9 PASS: offset at (160,25) was 26. 10 PASS: offset at (60,24) was 26. 6 11 PASS: offset at (160,24) was 26. 7 12 -
trunk/LayoutTests/fast/writing-mode/flipped-blocks-hit-test-line-edges.html
r123980 r123988 26 26 } 27 27 28 test(100, 105, 4); 28 29 test(160, 105, 5); 30 test(100, 104, 10); 29 31 test(160, 104, 11); 32 test(60, 26, 24); 30 33 test(160, 26, 26); 34 test(60, 25, 24); 31 35 test(160, 25, 26); 36 test(60, 24, 26); 32 37 test(160, 24, 26); 33 38 </script> -
trunk/Source/WebCore/ChangeLog
r123984 r123988 1 2012-07-29 Dan Bernstein <mitz@apple.com> 2 3 In flipped blocks, a point on the top edge of a text box is considered outside the box (and vice versa) 4 https://bugs.webkit.org/show_bug.cgi?id=92597 5 6 Reviewed by Ryosuke Niwa. 7 8 This is similar to <http://webkit.org/b/92593> except for RenderText. Fixing this required 9 fixing some code that creates a point inside a box by setting its y coordinate to the 10 logical top of the box. In a flipped block, this would be just outside the box. 11 12 Enhanced fast/writing-mode/flipped-blocks-hit-test-line-edges.html to cover this. 13 14 * editing/visible_units.cpp: 15 (WebCore::absoluteLineDirectionPointToLocalPointInBlock): Changed to use 16 RootInlineBox::blockDirectionPointInLine in the vertical case as well. 17 * rendering/RenderBlock.cpp: 18 (WebCore::RenderBlock::positionForPointWithInlineChildren): Changed to use 19 RootInlineBox::blockDirectionPointInLine. 20 * rendering/RenderText.cpp: 21 (WebCore::RenderText::positionForPoint): Changed the strictness of y inequalities based on 22 the flippedness of the block. This fixes the bug. 23 * rendering/RootInlineBox.cpp: 24 (WebCore::RootInlineBox::blockDirectionPointInLine): Moved the implementation here from the 25 header, and made it return the bottom in the flipped block case, so that the returned point 26 is inside the line in that case as well. 27 * rendering/RootInlineBox.h: 28 1 29 2012-07-29 Rik Cabanier <cabanier@adobe.com> 2 30 -
trunk/Source/WebCore/editing/visible_units.cpp
r117813 r123988 920 920 return IntPoint(lineDirectionPoint - absoluteBlockPoint.x(), root->blockDirectionPointInLine()); 921 921 922 return IntPoint(root-> selectionTop(), lineDirectionPoint - absoluteBlockPoint.y());922 return IntPoint(root->blockDirectionPointInLine(), lineDirectionPoint - absoluteBlockPoint.y()); 923 923 } 924 924 -
trunk/Source/WebCore/rendering/RenderBlock.cpp
r123980 r123988 4976 4976 4977 4977 // pass the box a top position that is inside it 4978 LayoutPoint point(pointInLogicalContents.x(), max(closestBox->root()->lineTop(), closestBox->root()->selectionTop()));4978 LayoutPoint point(pointInLogicalContents.x(), closestBox->root()->blockDirectionPointInLine()); 4979 4979 if (!isHorizontalWritingMode()) 4980 4980 point = point.transposedPoint(); -
trunk/Source/WebCore/rendering/RenderText.cpp
r121102 r123988 614 614 LayoutUnit pointLineDirection = firstTextBox()->isHorizontal() ? point.x() : point.y(); 615 615 LayoutUnit pointBlockDirection = firstTextBox()->isHorizontal() ? point.y() : point.x(); 616 bool blocksAreFlipped = style()->isFlippedBlocksWritingMode(); 616 617 617 618 InlineTextBox* lastBox = 0; … … 621 622 622 623 RootInlineBox* rootBox = box->root(); 623 if (pointBlockDirection >= rootBox->selectionTop() || pointBlockDirection >= rootBox->lineTop()) { 624 LayoutUnit top = min(rootBox->selectionTop(), rootBox->lineTop()); 625 if (pointBlockDirection > top || (!blocksAreFlipped && pointBlockDirection == top)) { 624 626 LayoutUnit bottom = rootBox->selectionBottom(); 625 627 if (rootBox->nextRootBox()) 626 628 bottom = min(bottom, rootBox->nextRootBox()->lineTop()); 627 629 628 if (pointBlockDirection < bottom ) {630 if (pointBlockDirection < bottom || (blocksAreFlipped && pointBlockDirection == bottom)) { 629 631 ShouldAffinityBeDownstream shouldAffinityBeDownstream; 630 632 if (lineDirectionPointFitsInBox(pointLineDirection, box, shouldAffinityBeDownstream)) -
trunk/Source/WebCore/rendering/RootInlineBox.cpp
r122883 r123988 602 602 } 603 603 604 int RootInlineBox::blockDirectionPointInLine() const 605 { 606 return !block()->style()->isFlippedBlocksWritingMode() ? max(lineTop(), selectionTop()) : min(lineBottom(), selectionBottom()); 607 } 608 604 609 RenderBlock* RootInlineBox::block() const 605 610 { -
trunk/Source/WebCore/rendering/RootInlineBox.h
r123904 r123988 70 70 LayoutUnit selectionHeightAdjustedForPrecedingBlock() const { return max<LayoutUnit>(0, selectionBottom() - selectionTopAdjustedForPrecedingBlock()); } 71 71 72 int blockDirectionPointInLine() const { return max(lineTop(), selectionTop()); }72 int blockDirectionPointInLine() const; 73 73 74 74 LayoutUnit alignBoxesInBlockDirection(LayoutUnit heightOfBlock, GlyphOverflowAndFallbackFontsMap&, VerticalPositionCache&);
Note: See TracChangeset
for help on using the changeset viewer.