Changeset 91481 in webkit
- Timestamp:
- Jul 21, 2011, 11:45:44 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r91480 r91481 1 2011-07-21 Enrica Casucci <enrica@apple.com> 2 3 Cannot click to position the caret to the right of an image with display:block style. 4 https://bugs.webkit.org/show_bug.cgi?id=64962 5 <rdar://problem/9446343> 6 7 Reviewed by David Hyatt. 8 9 * editing/selection/click-on-block-image-expected.txt: Added. 10 * editing/selection/click-on-block-image.html: Added. 11 1 12 2011-07-21 Ryosuke Niwa <rniwa@webkit.org> 2 13 -
trunk/Source/WebCore/ChangeLog
r91475 r91481 1 2011-07-21 Enrica Casucci <enrica@apple.com> 2 3 Cannot click to position the caret to the right of an image with display:block style. 4 https://bugs.webkit.org/show_bug.cgi?id=64962 5 <rdar://problem/9446343> 6 7 Reviewed by David Hyatt. 8 9 Test: editing/selection/click-on-block-image.html 10 11 The current implementation of positionForPoint always returns the visible 12 position to the left of the image, if the image has a block style. 13 This patch changes the behavior for block styled images to match the behavior 14 for inline images. 15 16 * rendering/RenderReplaced.cpp: 17 (WebCore::RenderReplaced::positionForPoint): Modified to avoid relying entirely 18 on InlineBox to calculate the position. 19 1 20 2011-07-21 Pavel Feldman <pfeldman@google.com> 2 21 -
trunk/Source/WebCore/rendering/RenderReplaced.cpp
r91242 r91481 417 417 VisiblePosition RenderReplaced::positionForPoint(const LayoutPoint& point) 418 418 { 419 // FIXME: This code is buggy if the replaced element is relative positioned. 419 420 InlineBox* box = inlineBoxWrapper(); 420 if (!box) 421 return createVisiblePosition(0, DOWNSTREAM); 422 423 // FIXME: This code is buggy if the replaced element is relative positioned. 424 425 RootInlineBox* root = box->root(); 426 427 LayoutUnit top = root->selectionTop(); 428 LayoutUnit bottom = root->selectionBottom(); 429 430 LayoutUnit blockDirectionPosition = box->isHorizontal() ? point.y() + y() : point.x() + x(); 431 LayoutUnit lineDirectionPosition = box->isHorizontal() ? point.x() + x() : point.y() + y(); 432 421 RootInlineBox* rootBox = box ? box->root() : 0; 422 423 LayoutUnit top = rootBox ? rootBox->selectionTop() : logicalTop(); 424 LayoutUnit bottom = rootBox ? rootBox->selectionBottom() : logicalBottom(); 425 426 LayoutUnit blockDirectionPosition = isHorizontalWritingMode() ? point.y() + y() : point.x() + x(); 427 LayoutUnit lineDirectionPosition = isHorizontalWritingMode() ? point.x() + x() : point.y() + y(); 428 433 429 if (blockDirectionPosition < top) 434 430 return createVisiblePosition(caretMinOffset(), DOWNSTREAM); // coordinates are above … … 438 434 439 435 if (node()) { 440 if (lineDirectionPosition <= box->logicalLeft() + (box->logicalWidth() / 2))436 if (lineDirectionPosition <= logicalLeft() + (logicalWidth() / 2)) 441 437 return createVisiblePosition(0, DOWNSTREAM); 442 438 return createVisiblePosition(1, DOWNSTREAM);
Note:
See TracChangeset
for help on using the changeset viewer.