|
Make first-letter style to work with editing
This patch changes to consider a renderer for first letter with first-letter style is different from renderer associate to Node object, e.g. node->renderer(), for following actions to work:
- Mouse click
- Caret/Selection motion implemented in Position and VisiblePosition
- Caret rendering
- Selection range rendering
For mouse click, this patch adds two function HitTestResult::renderer() and HitTestResult::setIsFirstLetter() to carry first letter hit from renderer to event handler. Note: Caching renderer in HitTestResult doesn't work because during event handling layout can be changed.
For caret motion, this patch adds Position::rendererOfAnchorNode() and PostionIterator::renderer() to get renderer for first-letter when offset in DOM node points first letter rather than DOM node associate renderer. This change leads replacement from Position::anchorNode()->renderer() to Position::renderer() in Editor code and other use sites.
For selection rendering, this patch changes FrameSelection::updateAppearance() to call RenderView::setSelection() with Postion::renderer() and Postion::offsetInRendererOfAnchorNode()
Test file chagnes:
* editing/deleting/merge-paragraph-with-first-letter.html
Split(insert line break) a paragraph with first letter and merge(delete line break) to restore original state.
* editing/selection/caret-with-first-letter.html
Move caret around a first letter.
* editing/selection/click-first-letter.html
Set caret at first letter.
Set caret at middle of text
* editing/selection/extend-by-word-002.html
Changed to JS test for portability with considering selection containing a first letter.
* editing/selection/select-first-letter.html
Check rendering selection range contains first-letter CSS property.
* editing/text-iterator/first-letter-word-boundary.html
First letter text fragment renderer contains two characters, a space and a letter.
BUG= 174349
Total comments: 6
Total comments: 4
Total comments: 4
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+567 lines, -332 lines) |
Patch |
 |
A |
LayoutTests/editing/deleting/merge-paragraph-with-first-letter.html
|
View
|
|
1 chunk |
+43 lines, -0 lines |
0 comments
|
Download
|
 |
A |
LayoutTests/editing/deleting/merge-paragraph-with-first-letter-expected.txt
|
View
|
|
1 chunk |
+14 lines, -0 lines |
0 comments
|
Download
|
 |
A |
LayoutTests/editing/selection/caret-with-first-letter.html
|
View
|
|
1 chunk |
+78 lines, -0 lines |
0 comments
|
Download
|
 |
A |
LayoutTests/editing/selection/caret-with-first-letter-expected.txt
|
View
|
|
1 chunk |
+24 lines, -0 lines |
0 comments
|
Download
|
 |
A |
LayoutTests/editing/selection/click-first-letter.html
|
View
|
|
1 chunk |
+60 lines, -0 lines |
0 comments
|
Download
|
 |
A |
LayoutTests/editing/selection/click-first-letter-expected.txt
|
View
|
|
1 chunk |
+12 lines, -0 lines |
0 comments
|
Download
|
 |
M |
LayoutTests/editing/selection/extend-by-word-002.html
|
View
|
|
2 chunks |
+19 lines, -15 lines |
0 comments
|
Download
|
 |
M |
LayoutTests/editing/selection/extend-by-word-002-expected.txt
|
View
|
|
1 chunk |
+9 lines, -74 lines |
0 comments
|
Download
|
 |
A |
LayoutTests/editing/selection/select-first-letter.html
|
View
|
|
1 chunk |
+20 lines, -0 lines |
0 comments
|
Download
|
 |
A |
LayoutTests/editing/selection/select-first-letter-expected.html
|
View
|
|
1 chunk |
+12 lines, -0 lines |
0 comments
|
Download
|
 |
D |
LayoutTests/platform/linux/editing/selection/extend-by-word-002-expected.png
|
View
|
|
Binary file |
0 comments
|
Download
|
 |
D |
LayoutTests/platform/mac/editing/selection/extend-by-word-002-expected.png
|
View
|
1
2
|
Binary file |
0 comments
|
Download
|
 |
D |
LayoutTests/platform/win/editing/selection/extend-by-word-002-expected.png
|
View
|
|
Binary file |
0 comments
|
Download
|
 |
D |
LayoutTests/platform/win/editing/selection/extend-by-word-002-expected.txt
|
View
|
|
1 chunk |
+0 lines, -74 lines |
0 comments
|
Download
|
 |
M |
Source/core/dom/Position.h
|
View
|
1
2
3
|
1 chunk |
+7 lines, -0 lines |
0 comments
|
Download
|
 |
M |
Source/core/dom/Position.cpp
|
View
|
1
2
3
|
18 chunks |
+103 lines, -61 lines |
1 comment
|
Download
|
 |
M |
Source/core/dom/PositionIterator.h
|
View
|
|
2 chunks |
+3 lines, -0 lines |
0 comments
|
Download
|
 |
M |
Source/core/dom/PositionIterator.cpp
|
View
|
1
2
3
|
3 chunks |
+10 lines, -1 line |
2 comments
|
Download
|
 |
M |
Source/core/editing/Caret.h
|
View
|
1
2
|
2 chunks |
+6 lines, -5 lines |
0 comments
|
Download
|
 |
M |
Source/core/editing/Caret.cpp
|
View
|
1
2
3
|
9 chunks |
+26 lines, -33 lines |
1 comment
|
Download
|
 |
M |
Source/core/editing/FrameSelection.h
|
View
|
1
2
3
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
Source/core/editing/FrameSelection.cpp
|
View
|
1
2
3
|
7 chunks |
+16 lines, -20 lines |
0 comments
|
Download
|
 |
M |
Source/core/editing/TextIterator.cpp
|
View
|
1
2
3
|
2 chunks |
+2 lines, -15 lines |
0 comments
|
Download
|
 |
M |
Source/core/editing/VisiblePosition.cpp
|
View
|
1
2
3
|
4 chunks |
+6 lines, -3 lines |
0 comments
|
Download
|
 |
M |
Source/core/editing/VisibleUnits.cpp
|
View
|
1
2
3
|
2 chunks |
+6 lines, -6 lines |
0 comments
|
Download
|
 |
M |
Source/core/editing/htmlediting.cpp
|
View
|
1
2
3
|
3 chunks |
+9 lines, -3 lines |
0 comments
|
Download
|
 |
M |
Source/core/page/EventHandler.cpp
|
View
|
1
2
3
|
13 chunks |
+25 lines, -19 lines |
0 comments
|
Download
|
 |
M |
Source/core/rendering/HitTestResult.h
|
View
|
|
4 chunks |
+5 lines, -0 lines |
0 comments
|
Download
|
 |
M |
Source/core/rendering/HitTestResult.cpp
|
View
|
1
2
3
|
6 chunks |
+18 lines, -1 line |
0 comments
|
Download
|
 |
M |
Source/core/rendering/RenderText.h
|
View
|
1
2
3
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
 |
M |
Source/core/rendering/RenderText.cpp
|
View
|
1
2
3
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
 |
M |
Source/core/rendering/RenderTextFragment.h
|
View
|
1
|
2 chunks |
+3 lines, -0 lines |
0 comments
|
Download
|
 |
M |
Source/core/rendering/RenderTextFragment.cpp
|
View
|
1
|
3 chunks |
+27 lines, -0 lines |
0 comments
|
Download
|
Total messages: 13 (0 generated)
|