Changeset 143313 in webkit
- Timestamp:
- Feb 19, 2013 2:14:07 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r143312 r143313 1 2013-02-19 Arpita Bahuguna <arpitabahuguna@gmail.com> 2 3 Caret is not displayed when trying to focus inside a contenteditable element containing an empty block. 4 https://bugs.webkit.org/show_bug.cgi?id=108053 5 6 Reviewed by Ryosuke Niwa. 7 8 * editing/selection/caret-in-div-containing-empty-block-expected.txt: Added. 9 * editing/selection/caret-in-div-containing-empty-block.html: Added. 10 Layout test added for verifying that a caret is displayed within a 11 contenteditable div having a border, both for the horizontal 12 as well as the vertical writing modes. 13 1 14 2013-02-19 Mihnea Ovidenie <mihnea@adobe.com> 2 15 -
trunk/Source/WebCore/ChangeLog
r143312 r143313 1 2013-02-19 Arpita Bahuguna <a.bah@samsung.com> 2 3 Caret is not displayed when trying to focus inside a contenteditable element containing an empty block. 4 https://bugs.webkit.org/show_bug.cgi?id=108053 5 6 Reviewed by Ryosuke Niwa. 7 8 Test: editing/selection/caret-in-div-containing-empty-block.html 9 10 * rendering/RenderBox.cpp: 11 (WebCore::RenderBox::localCaretRect): 12 When trying to compute the caret rect for the contenteditable div, the 13 border and the padding were not considered. Because of this, for the 14 given test case, which had a border defined on the containing div, the 15 caret was being painted just atop the border, thereby masking it. 16 17 Have modified the code to ensure that the computed caret rect takes 18 into account the border and padding (if any) specified on the box, but only 19 if the node doesn't have content that shall be skipped for editing. 20 21 We do not add border and padding while computing the caret rect for any 22 element that either has no content or has content that shall be skipped 23 for editing purposes. This holds true for table elements as well. 24 25 This helps avoid the caret displacement previsouly observed before/after 26 any controls placed within the contenteditable box, when considering 27 border and padding in computation of the caret rect. 28 1 29 2013-02-19 Mihnea Ovidenie <mihnea@adobe.com> 2 30 -
trunk/Source/WebCore/rendering/RenderBox.cpp
r143312 r143313 3820 3820 // FIXME: Paint the carets inside empty blocks differently than the carets before/after elements. 3821 3821 3822 // FIXME: What about border and padding?3823 3822 LayoutRect rect(location(), LayoutSize(caretWidth, height())); 3824 3823 bool ltr = box ? box->isLeftToRightDirection() : style()->isLeftToRightDirection(); … … 3851 3850 // Move to local coords 3852 3851 rect.moveBy(-location()); 3852 3853 // FIXME: Border/padding should be added for all elements but this workaround 3854 // is needed because we use offsets inside an "atomic" element to represent 3855 // positions before and after the element in deprecated editing offsets. 3856 if (!(editingIgnoresContent(node()) || isTableElement(node()))) { 3857 rect.setX(rect.x() + borderLeft() + paddingLeft()); 3858 rect.setY(rect.y() + paddingTop() + borderTop()); 3859 } 3853 3860 3854 3861 if (!isHorizontalWritingMode())
Note: See TracChangeset
for help on using the changeset viewer.