Title: [226859] branches/safari-605-branch

Diff

Modified: branches/safari-605-branch/LayoutTests/ChangeLog (226858 => 226859)


--- branches/safari-605-branch/LayoutTests/ChangeLog	2018-01-12 04:53:02 UTC (rev 226858)
+++ branches/safari-605-branch/LayoutTests/ChangeLog	2018-01-12 04:53:08 UTC (rev 226859)
@@ -1,5 +1,23 @@
 2018-01-11  Jason Marcell  <jmarc...@apple.com>
 
+        Cherry-pick r226753. rdar://problem/36429138
+
+    2018-01-10  Wenson Hsieh  <wenson_hs...@apple.com>
+
+            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.
+
+            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.
+
+2018-01-11  Jason Marcell  <jmarc...@apple.com>
+
         Cherry-pick r226750. rdar://problem/36429156
 
     2018-01-10  Tim Horton  <timothy_hor...@apple.com>

Added: branches/safari-605-branch/LayoutTests/editing/marked-text-appearance-expected-mismatch.html (0 => 226859)


--- branches/safari-605-branch/LayoutTests/editing/marked-text-appearance-expected-mismatch.html	                        (rev 0)
+++ branches/safari-605-branch/LayoutTests/editing/marked-text-appearance-expected-mismatch.html	2018-01-12 04:53:08 UTC (rev 226859)
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<body contenteditable></body>
+<script>
+    document.body.focus();
+    if (window.textInputController) {
+        textInputController.setMarkedText("^^^^^", 0, 5, true);
+        textInputController.insertText("^^^^^");
+    }
+</script>

Added: branches/safari-605-branch/LayoutTests/editing/marked-text-appearance.html (0 => 226859)


--- branches/safari-605-branch/LayoutTests/editing/marked-text-appearance.html	                        (rev 0)
+++ branches/safari-605-branch/LayoutTests/editing/marked-text-appearance.html	2018-01-12 04:53:08 UTC (rev 226859)
@@ -0,0 +1,7 @@
+<!DOCTYPE html>
+<body contenteditable></body>
+<script>
+    document.body.focus();
+    if (window.textInputController)
+        textInputController.setMarkedText("^^^^^", 0, 5, true);
+</script>

Modified: branches/safari-605-branch/Source/WebCore/ChangeLog (226858 => 226859)


--- branches/safari-605-branch/Source/WebCore/ChangeLog	2018-01-12 04:53:02 UTC (rev 226858)
+++ branches/safari-605-branch/Source/WebCore/ChangeLog	2018-01-12 04:53:08 UTC (rev 226859)
@@ -1,5 +1,24 @@
 2018-01-11  Jason Marcell  <jmarc...@apple.com>
 
+        Cherry-pick r226753. rdar://problem/36429138
+
+    2018-01-10  Wenson Hsieh  <wenson_hs...@apple.com>
+
+            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.
+
+            Fixes the order of arguments passed to paintTextSubrangeBackground from paintCompositionBackground.
+
+            Test: editing/marked-text-appearance.html
+
+            * rendering/InlineTextBox.cpp:
+            (WebCore::InlineTextBox::paintCompositionBackground):
+
+2018-01-11  Jason Marcell  <jmarc...@apple.com>
+
         Cherry-pick r226721. rdar://problem/36429159
 
     2018-01-10  Antti Koivisto  <an...@apple.com>

Modified: branches/safari-605-branch/Source/WebCore/rendering/InlineTextBox.cpp (226858 => 226859)


--- branches/safari-605-branch/Source/WebCore/rendering/InlineTextBox.cpp	2018-01-12 04:53:02 UTC (rev 226858)
+++ branches/safari-605-branch/Source/WebCore/rendering/InlineTextBox.cpp	2018-01-12 04:53:08 UTC (rev 226859)
@@ -1044,7 +1044,7 @@
 
 void InlineTextBox::paintCompositionBackground(GraphicsContext& context, const FloatPoint& boxOrigin)
 {
-    paintTextSubrangeBackground(context, boxOrigin, clampedOffset(renderer().frame().editor().compositionStart()), clampedOffset(renderer().frame().editor().compositionEnd()), Color::compositionFill);
+    paintTextSubrangeBackground(context, boxOrigin, Color::compositionFill, clampedOffset(renderer().frame().editor().compositionStart()), clampedOffset(renderer().frame().editor().compositionEnd()));
 }
 
 void InlineTextBox::paintCompositionUnderlines(GraphicsContext& context, const FloatPoint& boxOrigin) const

Modified: branches/safari-605-branch/Source/WebKit/ChangeLog (226858 => 226859)


--- branches/safari-605-branch/Source/WebKit/ChangeLog	2018-01-12 04:53:02 UTC (rev 226858)
+++ branches/safari-605-branch/Source/WebKit/ChangeLog	2018-01-12 04:53:08 UTC (rev 226859)
@@ -1,5 +1,26 @@
 2018-01-11  Jason Marcell  <jmarc...@apple.com>
 
+        Cherry-pick r226753. rdar://problem/36429138
+
+    2018-01-10  Wenson Hsieh  <wenson_hs...@apple.com>
+
+            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.
+
+            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:
+
+2018-01-11  Jason Marcell  <jmarc...@apple.com>
+
         Cherry-pick r226750. rdar://problem/36429156
 
     2018-01-10  Tim Horton  <timothy_hor...@apple.com>

Modified: branches/safari-605-branch/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp (226858 => 226859)


--- branches/safari-605-branch/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp	2018-01-12 04:53:02 UTC (rev 226858)
+++ branches/safari-605-branch/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp	2018-01-12 04:53:08 UTC (rev 226859)
@@ -540,9 +540,9 @@
     return toAPI(&toImpl(pageRef)->trackedRepaintRects().leakRef());
 }
 
-void WKBundlePageSetComposition(WKBundlePageRef pageRef, WKStringRef text, int from, int length)
+void WKBundlePageSetComposition(WKBundlePageRef pageRef, WKStringRef text, int from, int length, bool suppressUnderline)
 {
-    toImpl(pageRef)->setCompositionForTesting(toWTFString(text), from, length);
+    toImpl(pageRef)->setCompositionForTesting(toWTFString(text), from, length, suppressUnderline);
 }
 
 bool WKBundlePageHasComposition(WKBundlePageRef pageRef)

Modified: branches/safari-605-branch/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h (226858 => 226859)


--- branches/safari-605-branch/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h	2018-01-12 04:53:02 UTC (rev 226858)
+++ branches/safari-605-branch/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h	2018-01-12 04:53:08 UTC (rev 226859)
@@ -72,7 +72,7 @@
 WK_EXPORT void WKBundlePageResetTrackedRepaints(WKBundlePageRef page);
 WK_EXPORT WKArrayRef WKBundlePageCopyTrackedRepaintRects(WKBundlePageRef page);
 
-WK_EXPORT void WKBundlePageSetComposition(WKBundlePageRef page, WKStringRef text, int from, int length);
+WK_EXPORT void WKBundlePageSetComposition(WKBundlePageRef page, WKStringRef text, int from, int length, bool suppressUnderline);
 WK_EXPORT bool WKBundlePageHasComposition(WKBundlePageRef page);
 WK_EXPORT void WKBundlePageConfirmComposition(WKBundlePageRef page);
 WK_EXPORT void WKBundlePageConfirmCompositionWithText(WKBundlePageRef page, WKStringRef text);

Modified: branches/safari-605-branch/Source/WebKit/WebProcess/WebPage/WebPage.cpp (226858 => 226859)


--- branches/safari-605-branch/Source/WebKit/WebProcess/WebPage/WebPage.cpp	2018-01-12 04:53:02 UTC (rev 226858)
+++ branches/safari-605-branch/Source/WebKit/WebProcess/WebPage/WebPage.cpp	2018-01-12 04:53:08 UTC (rev 226859)
@@ -4417,7 +4417,7 @@
     mouseEvent(WebMouseEvent(WebMouseEvent::MouseMove, WebMouseEvent::NoButton, 0, position, position, 0, 0, 0, 0, WebMouseEvent::Modifiers(), time, 0, WebMouseEvent::NoTap));
 }
 
-void WebPage::setCompositionForTesting(const String& compositionString, uint64_t from, uint64_t length)
+void WebPage::setCompositionForTesting(const String& compositionString, uint64_t from, uint64_t length, bool suppressUnderline)
 {
     Frame& frame = m_page->focusController().focusedOrMainFrame();
     if (!frame.editor().canEdit())
@@ -4424,7 +4424,9 @@
         return;
 
     Vector<CompositionUnderline> underlines;
-    underlines.append(CompositionUnderline(0, compositionString.length(), CompositionUnderlineColor::TextColor, Color(Color::black), false));
+    if (!suppressUnderline)
+        underlines.append(CompositionUnderline(0, compositionString.length(), CompositionUnderlineColor::TextColor, Color(Color::black), false));
+
     frame.editor().setComposition(compositionString, underlines, from, from + length);
 }
 

Modified: branches/safari-605-branch/Source/WebKit/WebProcess/WebPage/WebPage.h (226858 => 226859)


--- branches/safari-605-branch/Source/WebKit/WebProcess/WebPage/WebPage.h	2018-01-12 04:53:02 UTC (rev 226858)
+++ branches/safari-605-branch/Source/WebKit/WebProcess/WebPage/WebPage.h	2018-01-12 04:53:08 UTC (rev 226859)
@@ -735,7 +735,7 @@
     void updateAccessibilityTree();
 #endif
 
-    void setCompositionForTesting(const String& compositionString, uint64_t from, uint64_t length);
+    void setCompositionForTesting(const String& compositionString, uint64_t from, uint64_t length, bool suppressUnderline);
     bool hasCompositionForTesting();
     void confirmCompositionForTesting(const String& compositionString);
 

Modified: branches/safari-605-branch/Tools/ChangeLog (226858 => 226859)


--- branches/safari-605-branch/Tools/ChangeLog	2018-01-12 04:53:02 UTC (rev 226858)
+++ branches/safari-605-branch/Tools/ChangeLog	2018-01-12 04:53:08 UTC (rev 226859)
@@ -1,5 +1,36 @@
 2018-01-11  Jason Marcell  <jmarc...@apple.com>
 
+        Cherry-pick r226753. rdar://problem/36429138
+
+    2018-01-10  Wenson Hsieh  <wenson_hs...@apple.com>
+
+            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.
+
+            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:
+
+2018-01-11  Jason Marcell  <jmarc...@apple.com>
+
         Cherry-pick r226750. rdar://problem/36429156
 
     2018-01-10  Tim Horton  <timothy_hor...@apple.com>

Modified: branches/safari-605-branch/Tools/DumpRenderTree/ios/TextInputControllerIOS.m (226858 => 226859)


--- branches/safari-605-branch/Tools/DumpRenderTree/ios/TextInputControllerIOS.m	2018-01-12 04:53:02 UTC (rev 226858)
+++ branches/safari-605-branch/Tools/DumpRenderTree/ios/TextInputControllerIOS.m	2018-01-12 04:53:08 UTC (rev 226859)
@@ -39,7 +39,7 @@
 + (BOOL)isSelectorExcludedFromWebScript:(SEL)aSelector
 {
     if (aSelector == @selector(insertText:)
-        || aSelector == @selector(setMarkedText:selectedFrom:length:)
+        || aSelector == @selector(setMarkedText:selectedFrom:length:suppressUnderline:)
         || aSelector == @selector(markedRange))
         return NO;
 
@@ -50,7 +50,7 @@
 {
     if (aSelector == @selector(insertText:))
         return @"insertText";
-    if (aSelector == @selector(setMarkedText:selectedFrom:length:))
+    if (aSelector == @selector(setMarkedText:selectedFrom:length:suppressUnderline:))
         return @"setMarkedText";
     if (aSelector == @selector(markedRange))
         return @"markedRange";
@@ -83,7 +83,7 @@
     [[webView mainFrame] confirmMarkedText:text];
 }
 
-- (void)setMarkedText:(NSString *)text selectedFrom:(NSInteger)selectionStart length:(NSInteger)selectionLength
+- (void)setMarkedText:(NSString *)text selectedFrom:(NSInteger)selectionStart length:(NSInteger)selectionLength suppressUnderline:(BOOL)suppressUnderline
 {
     if (selectionStart == -1)
         selectionStart = NSNotFound;

Modified: branches/safari-605-branch/Tools/DumpRenderTree/mac/TextInputControllerMac.m (226858 => 226859)


--- branches/safari-605-branch/Tools/DumpRenderTree/mac/TextInputControllerMac.m	2018-01-12 04:53:02 UTC (rev 226858)
+++ branches/safari-605-branch/Tools/DumpRenderTree/mac/TextInputControllerMac.m	2018-01-12 04:53:08 UTC (rev 226859)
@@ -223,7 +223,7 @@
 {
     if (aSelector == @selector(insertText:)
         || aSelector == @selector(doCommand:)
-        || aSelector == @selector(setMarkedText:selectedFrom:length:)
+        || aSelector == @selector(setMarkedText:selectedFrom:length:suppressUnderline:)
         || aSelector == @selector(unmarkText)
         || aSelector == @selector(hasMarkedText)
         || aSelector == @selector(conversationIdentifier)
@@ -249,7 +249,7 @@
         return @"insertText";
     if (aSelector == @selector(doCommand:))
         return @"doCommand";
-    if (aSelector == @selector(setMarkedText:selectedFrom:length:))
+    if (aSelector == @selector(setMarkedText:selectedFrom:length:suppressUnderline:))
         return @"setMarkedText";
     if (aSelector == @selector(substringFrom:length:))
         return @"substringFromRange";
@@ -312,7 +312,7 @@
         [textInput doCommandBySelector:NSSelectorFromString(aCommand)];
 }
 
-- (void)setMarkedText:(NSString *)aString selectedFrom:(int)from length:(int)length
+- (void)setMarkedText:(NSString *)aString selectedFrom:(int)from length:(int)length suppressUnderline:(BOOL)suppressUnderline
 {
     NSObject <NSTextInput> *textInput = [self textInput];
 

Modified: branches/safari-605-branch/Tools/WebKitTestRunner/InjectedBundle/Bindings/TextInputController.idl (226858 => 226859)


--- branches/safari-605-branch/Tools/WebKitTestRunner/InjectedBundle/Bindings/TextInputController.idl	2018-01-12 04:53:02 UTC (rev 226858)
+++ branches/safari-605-branch/Tools/WebKitTestRunner/InjectedBundle/Bindings/TextInputController.idl	2018-01-12 04:53:08 UTC (rev 226859)
@@ -24,7 +24,7 @@
  */
 
 interface TextInputController {
-    void setMarkedText(DOMString string, long from, long length);
+    void setMarkedText(DOMString string, long from, long length, boolean suppressUnderline);
     boolean hasMarkedText();
     void unmarkText();
     void insertText(DOMString string);

Modified: branches/safari-605-branch/Tools/WebKitTestRunner/InjectedBundle/TextInputController.cpp (226858 => 226859)


--- branches/safari-605-branch/Tools/WebKitTestRunner/InjectedBundle/TextInputController.cpp	2018-01-12 04:53:02 UTC (rev 226858)
+++ branches/safari-605-branch/Tools/WebKitTestRunner/InjectedBundle/TextInputController.cpp	2018-01-12 04:53:08 UTC (rev 226859)
@@ -57,9 +57,9 @@
     setProperty(context, windowObject, "textInputController", this, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete, exception);
 }
 
-void TextInputController::setMarkedText(JSStringRef text, int from, int length)
+void TextInputController::setMarkedText(JSStringRef text, int from, int length, bool suppressUnderline)
 {
-    WKBundlePageSetComposition(InjectedBundle::singleton().page()->page(), toWK(text).get(), from, length);
+    WKBundlePageSetComposition(InjectedBundle::singleton().page()->page(), toWK(text).get(), from, length, suppressUnderline);
 }
 
 bool TextInputController::hasMarkedText()

Modified: branches/safari-605-branch/Tools/WebKitTestRunner/InjectedBundle/TextInputController.h (226858 => 226859)


--- branches/safari-605-branch/Tools/WebKitTestRunner/InjectedBundle/TextInputController.h	2018-01-12 04:53:02 UTC (rev 226858)
+++ branches/safari-605-branch/Tools/WebKitTestRunner/InjectedBundle/TextInputController.h	2018-01-12 04:53:08 UTC (rev 226859)
@@ -40,7 +40,7 @@
 
     void makeWindowObject(JSContextRef, JSObjectRef windowObject, JSValueRef* exception);
 
-    void setMarkedText(JSStringRef text, int from, int length);
+    void setMarkedText(JSStringRef text, int from, int length, bool suppressUnderline);
     bool hasMarkedText();
     void unmarkText();
     void insertText(JSStringRef text);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to