Changeset 90800 in webkit
- Timestamp:
- Jul 11, 2011 6:10:32 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r90798 r90800 1 2011-07-11 Ryosuke Niwa <rniwa@webkit.org> 2 3 positionForPoint is broken when a block is positioned relatively inside the parent 4 https://bugs.webkit.org/show_bug.cgi?id=64298 5 6 Reviewed by Simon Fraser. 7 8 Added a test for hit testing on relatively positioned children. 9 10 * fast/block/positioning/hittest-on-relative-positioned-children-expected.txt: Added. 11 * fast/block/positioning/hittest-on-relative-positioned-children.html: Added. 12 1 13 2011-07-11 Dan Bernstein <mitz@apple.com> 2 14 -
trunk/Source/WebCore/ChangeLog
r90798 r90800 1 2011-07-11 Ryosuke Niwa <rniwa@webkit.org> 2 3 positionForPoint is broken when a block is positioned relatively inside the parent 4 https://bugs.webkit.org/show_bug.cgi?id=64298 5 6 Reviewed by Simon Fraser. 7 8 The bug was caused by positionForPointRespectingEditingBoundaries's not taking relativePositionOffset 9 into account when computing the point in child coordinates. Fixed the bug by adding the offset to 10 childLocation as needed. 11 12 Test: fast/block/positioning/hittest-on-relative-positioned-children.html 13 14 * rendering/RenderBlock.cpp: 15 (WebCore::positionForPointRespectingEditingBoundaries): Fixed the bug; also replaced all instances of 16 IntPoint by LayoutPoint. 17 1 18 2011-07-11 Dan Bernstein <mitz@apple.com> 2 19 -
trunk/Source/WebCore/rendering/RenderBlock.cpp
r90773 r90800 4118 4118 // all cases in which positionForPoint recurs could call this instead to 4119 4119 // prevent crossing editable boundaries. This would require many tests. 4120 static VisiblePosition positionForPointRespectingEditingBoundaries(RenderBlock* parent, RenderBox* child, const IntPoint& pointInParentCoordinates) 4121 { 4120 static VisiblePosition positionForPointRespectingEditingBoundaries(RenderBlock* parent, RenderBox* child, const LayoutPoint& pointInParentCoordinates) 4121 { 4122 LayoutPoint childLocation = child->location(); 4123 if (child->isRelPositioned()) 4124 childLocation += child->relativePositionOffset(); 4122 4125 // FIXME: This is wrong if the child's writing-mode is different from the parent's. 4123 IntPoint pointInChildCoordinates(pointInParentCoordinates - child->location());4126 LayoutPoint pointInChildCoordinates(pointInParentCoordinates - childLocation); 4124 4127 4125 4128 // If this is an anonymous renderer, we just recur normally … … 4139 4142 4140 4143 // Otherwise return before or after the child, depending on if the click was to the logical left or logical right of the child 4141 int childMiddle = parent->logicalWidthForChild(child) / 2;4142 int logicalLeft = parent->isHorizontalWritingMode() ? pointInChildCoordinates.x() : pointInChildCoordinates.y();4144 LayoutUnit childMiddle = parent->logicalWidthForChild(child) / 2; 4145 LayoutUnit logicalLeft = parent->isHorizontalWritingMode() ? pointInChildCoordinates.x() : pointInChildCoordinates.y(); 4143 4146 if (logicalLeft < childMiddle) 4144 4147 return ancestor->createVisiblePosition(childNode->nodeIndex(), DOWNSTREAM);
Note: See TracChangeset
for help on using the changeset viewer.