Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge r174097 - Caret not shown at the end of line in overtype mode
https://bugs.webkit.org/show_bug.cgi?id=135508 Reviewed by Ryosuke Niwa. Source/WebCore: When overtype mode is enabled we usually replace the 'normal' blinking caret shown in contenteditable elements by a block cursor that covers the next character to be replaced. The exception is the end of line where we fallback to the blinking caret even in overtype mode (as there is no next character to replace). We were not showing anything at the end of lines in overtype mode because the detection of the end of line was incorrect and not very understandable. Replaced the old code with a proper and clean end of line detection mechanism compatible with bidi text. Tests: editing/selection/block-cursor-overtype-mode-end-of-line-rtl.html editing/selection/block-cursor-overtype-mode-end-of-line.html * editing/FrameSelection.cpp: (WebCore::FrameSelection::updateAppearance): * editing/VisibleUnits.cpp: (WebCore::isLogicalEndOfLine): * editing/VisibleUnits.h: LayoutTests: * editing/selection/block-cursor-overtype-mode-end-of-line-expected.html: Added. * editing/selection/block-cursor-overtype-mode-end-of-line-rtl-expected.html: Added. * editing/selection/block-cursor-overtype-mode-end-of-line-rtl.html: Added. * editing/selection/block-cursor-overtype-mode-end-of-line.html: Added. Canonical link: https://commits.webkit.org/154760.61@webkitgtk/2.6 git-svn-id: https://svn.webkit.org/repository/webkit/releases/WebKitGTK/webkit-2.6@174449 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
1 parent
35e9560
commit 864f0f4
Showing
9 changed files
with
119 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
LayoutTests/editing/selection/block-cursor-overtype-mode-end-of-line-expected.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<script> | ||
function run() { | ||
var element = (document.getElementById("editableContent")).firstChild; | ||
getSelection().collapse(element, element.length); | ||
} | ||
</script> | ||
</head> | ||
<body style = "font: 30px;" onload="run();"> | ||
<!-- We want to test block cursor appearance at the end of lines that aren't the end of the editable element. --> | ||
<div id="editableContent" contenteditable="true">ABC<br>ABC</div> | ||
</body> | ||
</html> |
15 changes: 15 additions & 0 deletions
15
LayoutTests/editing/selection/block-cursor-overtype-mode-end-of-line-rtl-expected.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<script> | ||
function run() { | ||
var element = (document.getElementById("editableContent")).firstChild; | ||
getSelection().collapse(element, element.length); | ||
} | ||
</script> | ||
</head> | ||
<body style = "font: 30px;" onload="run();"> | ||
<!-- We want to test block cursor appearance at the end of lines that aren't the end of the editable element. --> | ||
<div id="editableContent" style="direction: rtl;" contenteditable="true">שדןABC<br>ABC</div> | ||
</body> | ||
</html> |
18 changes: 18 additions & 0 deletions
18
LayoutTests/editing/selection/block-cursor-overtype-mode-end-of-line-rtl.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<script> | ||
if (window.testRunner) | ||
internals.toggleOverwriteModeEnabled(document); | ||
|
||
function run() { | ||
var element = (document.getElementById("editableContent")).firstChild; | ||
getSelection().collapse(element, element.length); | ||
} | ||
</script> | ||
</head> | ||
<body style = "font: 30px;" onload="run();""> | ||
<!-- We want to test block cursor appearance at the end of lines that aren't the end of the editable element. --> | ||
<div id="editableContent" style="direction: rtl;" contenteditable="true">שדןABC<br>ABC</div> | ||
</body> | ||
</html> |
18 changes: 18 additions & 0 deletions
18
LayoutTests/editing/selection/block-cursor-overtype-mode-end-of-line.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<script> | ||
if (window.testRunner) | ||
internals.toggleOverwriteModeEnabled(document); | ||
|
||
function run() { | ||
var element = (document.getElementById("editableContent")).firstChild; | ||
getSelection().collapse(element, element.length); | ||
} | ||
</script> | ||
</head> | ||
<body style = "font: 30px;" onload="run();""> | ||
<!-- We want to test block cursor appearance at the end of lines that aren't the end of the editable element. --> | ||
<div id="editableContent" contenteditable="true">ABC<br>ABC</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters