Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge r220639 - Composition underline color is always black
https://bugs.webkit.org/show_bug.cgi?id=174675 Reviewed by Ryosuke Niwa. Source/WebCore: This patch uses the current color of the text instead of black for the composition underline marker. This makes it visible in the case we have a black/dark background. Test: editing/composition-underline-color.html * editing/CompositionUnderline.h: (WebCore::CompositionUnderline::CompositionUnderline): Added new attribute compositionUnderlineColor. * rendering/InlineTextBox.cpp: (WebCore::InlineTextBox::paintCompositionUnderline): Use the text color if compositionUnderlineColor is TextColor. Source/WebKit: This patch uses the current color of the text instead of black for the composition underline marker. This makes it visible in the case we have a black/dark background. * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::extractUnderlines): If NSUnderlineColorAttributeName is not present use text color for composition underline. (WebKit::WebViewImpl::setMarkedText): Use text color for composition underline in the plain text case. * UIProcess/gtk/InputMethodFilter.cpp: (WebKit::InputMethodFilter::handleKeyboardEventWithCompositionResults): Use text color for composition underline. (WebKit::InputMethodFilter::updatePreedit): Ditto. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::setCompositionForTesting): Ditto. Source/WebKitLegacy/mac: * WebView/WebHTMLView.mm: (extractUnderlines): If NSUnderlineColorAttributeName is not present use text color for composition underline. (-[WebHTMLView setMarkedText:selectedRange:]): Use text color for composition underline in the plain text case. Source/WebKitLegacy/win: * WebView.cpp: (WebView::setCompositionForTesting): Use text color for composition underline. LayoutTests: Added new test to check that the composition underline is using the text color. The test hides the text and the caret, so it only shows the composition underline and checks against an -expected-mismatch that the color of the composition marker is different. * editing/composition-underline-color-expected-mismatch.html: Added. * editing/composition-underline-color.html: Added.
- Loading branch information
1 parent
d09d005
commit ddc54aa
Showing
14 changed files
with
183 additions
and
17 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
33 changes: 33 additions & 0 deletions
33
LayoutTests/editing/composition-underline-color-expected-mismatch.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,33 @@ | ||
<!DOCTYPE html> | ||
<style> | ||
div { | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
} | ||
#test { | ||
color: magenta; | ||
font: 20px/1 Monospace; | ||
outline: none; | ||
} | ||
#overlapping-top { | ||
background: white; | ||
width: 100px; | ||
height: 15px; | ||
} | ||
#overlapping-right { | ||
background: white; | ||
width: 50px; | ||
height: 50px; | ||
left: 50px; | ||
} | ||
</style> | ||
<div contenteditable id="test"></div> | ||
<!-- The overlapping DIVs are hiding the "^^^^^" characters and the caret to show only the composition underline. --> | ||
<div id="overlapping-top"></div> | ||
<div id="overlapping-right"></div> | ||
<script> | ||
document.getElementById("test").focus(); | ||
if (window.textInputController) | ||
textInputController.setMarkedText("^^^^^", 5, 0); | ||
</script> |
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,33 @@ | ||
<!DOCTYPE html> | ||
<style> | ||
div { | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
} | ||
#test { | ||
color: lime; | ||
font: 20px/1 Monospace; | ||
outline: none; | ||
} | ||
#overlapping-top { | ||
background: white; | ||
width: 100px; | ||
height: 15px; | ||
} | ||
#overlapping-right { | ||
background: white; | ||
width: 50px; | ||
height: 50px; | ||
left: 50px; | ||
} | ||
</style> | ||
<div contenteditable id="test"></div> | ||
<!-- The overlapping DIVs are hiding the "^^^^^" characters and the caret to show only the composition underline. --> | ||
<div id="overlapping-top"></div> | ||
<div id="overlapping-right"></div> | ||
<script> | ||
document.getElementById("test").focus(); | ||
if (window.textInputController) | ||
textInputController.setMarkedText("^^^^^", 5, 0); | ||
</script> |
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
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
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