Title: [174807] trunk
Revision
174807
Author
[email protected]
Date
2014-10-16 19:17:14 -0700 (Thu, 16 Oct 2014)

Log Message

REGRESSION (r169024): Undetermined text is not displayed in the search field of Adobe Help Website
https://bugs.webkit.org/show_bug.cgi?id=137679
rdar://problem/18450335

Reviewed by Enrica Casucci.

Source/WebCore:

Test: platform/mac/editing/input/selected-composed-text-painting.html

* rendering/InlineTextBox.cpp: (WebCore::InlineTextBox::paint): We do not paint
selection beckground for unconfirmed text with underlines, so we should use a regular
style for text painting, as well.

LayoutTests:

* platform/mac/editing/input/selected-composed-text-painting-expected.html: Added.
* platform/mac/editing/input/selected-composed-text-painting.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (174806 => 174807)


--- trunk/LayoutTests/ChangeLog	2014-10-17 01:54:37 UTC (rev 174806)
+++ trunk/LayoutTests/ChangeLog	2014-10-17 02:17:14 UTC (rev 174807)
@@ -1,3 +1,14 @@
+2014-10-16  Alexey Proskuryakov  <[email protected]>
+
+        REGRESSION (r169024): Undetermined text is not displayed in the search field of Adobe Help Website
+        https://bugs.webkit.org/show_bug.cgi?id=137679
+        rdar://problem/18450335
+
+        Reviewed by Enrica Casucci.
+
+        * platform/mac/editing/input/selected-composed-text-painting-expected.html: Added.
+        * platform/mac/editing/input/selected-composed-text-painting.html: Added.
+
 2014-10-16  Zalan Bujtas  <[email protected]>
 
         [Mac] Unreviewed gardening.

Added: trunk/LayoutTests/platform/mac/editing/input/selected-composed-text-painting-expected.html (0 => 174807)


--- trunk/LayoutTests/platform/mac/editing/input/selected-composed-text-painting-expected.html	                        (rev 0)
+++ trunk/LayoutTests/platform/mac/editing/input/selected-composed-text-painting-expected.html	2014-10-17 02:17:14 UTC (rev 174807)
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+<meta charset="utf-8">
+<body>
+<p>Test that selected unconfirmed text ignores ::selection rules.
+To test manually, type anything using Kotoeri Hiragana, and press down arrow. The text should not become invisible.</p>
+<input id="test" type="text">
+<script>
+
+var test = document.getElementById('test');
+test.focus();
+
+var markedText = textInputController.makeAttributedString("ひらがな");
+markedText.addAttribute("NSUnderline", 2);
+textInputController.setMarkedText(markedText, 0, 4);
+
+</script>
+</body>
+</html>

Added: trunk/LayoutTests/platform/mac/editing/input/selected-composed-text-painting.html (0 => 174807)


--- trunk/LayoutTests/platform/mac/editing/input/selected-composed-text-painting.html	                        (rev 0)
+++ trunk/LayoutTests/platform/mac/editing/input/selected-composed-text-painting.html	2014-10-17 02:17:14 UTC (rev 174807)
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html>
+<meta charset="utf-8">
+<body>
+<style>
+::selection {
+    background: #447099;
+    color: #fff
+}
+
+</style>
+<p>Test that selected unconfirmed text ignores ::selection rules.
+To test manually, type anything using Kotoeri Hiragana, and press down arrow. The text should not become invisible.</p>
+<input id="test" type="text">
+<script>
+
+var test = document.getElementById('test');
+test.focus();
+
+var markedText = textInputController.makeAttributedString("ひらがな");
+markedText.addAttribute("NSUnderline", 2);
+textInputController.setMarkedText(markedText, 0, 4);
+
+</script>
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (174806 => 174807)


--- trunk/Source/WebCore/ChangeLog	2014-10-17 01:54:37 UTC (rev 174806)
+++ trunk/Source/WebCore/ChangeLog	2014-10-17 02:17:14 UTC (rev 174807)
@@ -1,3 +1,17 @@
+2014-10-16  Alexey Proskuryakov  <[email protected]>
+
+        REGRESSION (r169024): Undetermined text is not displayed in the search field of Adobe Help Website
+        https://bugs.webkit.org/show_bug.cgi?id=137679
+        rdar://problem/18450335
+
+        Reviewed by Enrica Casucci.
+
+        Test: platform/mac/editing/input/selected-composed-text-painting.html
+
+        * rendering/InlineTextBox.cpp: (WebCore::InlineTextBox::paint): We do not paint
+        selection beckground for unconfirmed text with underlines, so we should use a regular
+        style for text painting, as well.
+
 2014-10-16  Chris Dumez  <[email protected]>
 
         Use is<>() / downcast<>() for BasicShape subclasses

Modified: trunk/Source/WebCore/rendering/InlineTextBox.cpp (174806 => 174807)


--- trunk/Source/WebCore/rendering/InlineTextBox.cpp	2014-10-17 01:54:37 UTC (rev 174806)
+++ trunk/Source/WebCore/rendering/InlineTextBox.cpp	2014-10-17 02:17:14 UTC (rev 174807)
@@ -537,6 +537,10 @@
     const ShadowData* selectionShadow;
     TextPaintStyle selectionPaintStyle = computeTextSelectionPaintStyle(textPaintStyle, renderer(), lineStyle, paintInfo, paintSelectedTextOnly, paintSelectedTextSeparately, selectionShadow);
 
+    // Text with custom underlines does not have selection background painted, so selection paint style is not appropriate for it.
+    if (useCustomUnderlines)
+        selectionPaintStyle = textPaintStyle;
+
     // Set our font.
     const Font& font = fontToUse(lineStyle, renderer());
     // 1. Paint backgrounds behind text if needed. Examples of such backgrounds include selection
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to