REGRESSION(r222507): Composition highlight doesn't render when using IME
authorwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 11 Jan 2018 03:05:10 +0000 (03:05 +0000)
committerwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 11 Jan 2018 03:05:10 +0000 (03:05 +0000)
commit5fdc2bd326bf9c2c0d9df4db9879744b1ecc51a0
treea1b4cbcdaa2522d8dfd526c7bc6a7c84de8d2a37
parentdec4ae01481dd10c6a8a38a9bfee1f39bd05c68a
REGRESSION(r222507): Composition highlight doesn't render when using IME
https://bugs.webkit.org/show_bug.cgi?id=181485
<rdar://problem/35896516>

Reviewed by Ryosuke Niwa.

Source/WebCore:

Fixes the order of arguments passed to paintTextSubrangeBackground from paintCompositionBackground.

Test: editing/marked-text-appearance.html

* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paintCompositionBackground):

Source/WebKit:

Add plumbing for a `suppressUnderline` argument when setting marked text.

* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageSetComposition):
* WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::setCompositionForTesting):
* WebProcess/WebPage/WebPage.h:

Tools:

Add a `suppressUnderline` argument to TextInputController.setMarkedText. This suppresses the custom underlines
rendered when testing IME on iOS in WebKit2. In this new test, suppressing underline rendering is needed to
allow rendering composition backgrounds (see InlineTextBox::paint).

* DumpRenderTree/ios/TextInputControllerIOS.m:
(+[TextInputController isSelectorExcludedFromWebScript:]):
(+[TextInputController webScriptNameForSelector:]):
(-[TextInputController setMarkedText:selectedFrom:length:suppressUnderline:]):
(-[TextInputController setMarkedText:selectedFrom:length:]): Deleted.
* DumpRenderTree/mac/TextInputControllerMac.m:
(+[TextInputController isSelectorExcludedFromWebScript:]):
(+[TextInputController webScriptNameForSelector:]):
(-[TextInputController setMarkedText:selectedFrom:length:suppressUnderline:]):
(-[TextInputController setMarkedText:selectedFrom:length:]): Deleted.
* WebKitTestRunner/InjectedBundle/Bindings/TextInputController.idl:
* WebKitTestRunner/InjectedBundle/TextInputController.cpp:
(WTR::TextInputController::setMarkedText):
* WebKitTestRunner/InjectedBundle/TextInputController.h:

LayoutTests:

Add a new layout test to ensure that in the absence of custom composition underlines, a marked composition
string appears different once it is confirmed.

* editing/marked-text-appearance-expected-mismatch.html: Added.
* editing/marked-text-appearance.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@226753 268f45cc-cd09-0410-ab3c-d52691b4dbfc
16 files changed:
LayoutTests/ChangeLog
LayoutTests/editing/marked-text-appearance-expected-mismatch.html [new file with mode: 0644]
LayoutTests/editing/marked-text-appearance.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/InlineTextBox.cpp
Source/WebKit/ChangeLog
Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp
Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h
Source/WebKit/WebProcess/WebPage/WebPage.cpp
Source/WebKit/WebProcess/WebPage/WebPage.h
Tools/ChangeLog
Tools/DumpRenderTree/ios/TextInputControllerIOS.m
Tools/DumpRenderTree/mac/TextInputControllerMac.m
Tools/WebKitTestRunner/InjectedBundle/Bindings/TextInputController.idl
Tools/WebKitTestRunner/InjectedBundle/TextInputController.cpp
Tools/WebKitTestRunner/InjectedBundle/TextInputController.h