Title: [210425] trunk/Source/WebCore
Revision
210425
Author
cdu...@apple.com
Date
2017-01-05 18:47:06 -0800 (Thu, 05 Jan 2017)

Log Message

[Form Validation] lengthy validation messages should be truncated with an ellipsis
https://bugs.webkit.org/show_bug.cgi?id=166747
<rdar://problem/29872021>

Reviewed by Simon Fraser.

Lengthy HTML validation messages should be truncated with an ellipsis.
Previously, they were truncated but there was no ellipsis.

No new tests, not easily testable. Manually tested on
- http://codepen.io/cdumez/full/zoOZmZ/ (last field)

* platform/ios/ValidationBubbleIOS.mm:
(WebCore::ValidationBubble::ValidationBubble):
* platform/mac/ValidationBubbleMac.mm:
(WebCore::ValidationBubble::ValidationBubble):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (210424 => 210425)


--- trunk/Source/WebCore/ChangeLog	2017-01-06 02:05:22 UTC (rev 210424)
+++ trunk/Source/WebCore/ChangeLog	2017-01-06 02:47:06 UTC (rev 210425)
@@ -1,3 +1,22 @@
+2017-01-05  Chris Dumez  <cdu...@apple.com>
+
+        [Form Validation] lengthy validation messages should be truncated with an ellipsis
+        https://bugs.webkit.org/show_bug.cgi?id=166747
+        <rdar://problem/29872021>
+
+        Reviewed by Simon Fraser.
+
+        Lengthy HTML validation messages should be truncated with an ellipsis.
+        Previously, they were truncated but there was no ellipsis.
+
+        No new tests, not easily testable. Manually tested on
+        - http://codepen.io/cdumez/full/zoOZmZ/ (last field)
+
+        * platform/ios/ValidationBubbleIOS.mm:
+        (WebCore::ValidationBubble::ValidationBubble):
+        * platform/mac/ValidationBubbleMac.mm:
+        (WebCore::ValidationBubble::ValidationBubble):
+
 2017-01-05  Simon Fraser  <simon.fra...@apple.com>
 
         Radio buttons have a fixed border radius making them look square when resized

Modified: trunk/Source/WebCore/platform/ios/ValidationBubbleIOS.mm (210424 => 210425)


--- trunk/Source/WebCore/platform/ios/ValidationBubbleIOS.mm	2017-01-06 02:05:22 UTC (rev 210424)
+++ trunk/Source/WebCore/platform/ios/ValidationBubbleIOS.mm	2017-01-06 02:47:06 UTC (rev 210425)
@@ -111,7 +111,7 @@
     RetainPtr<UILabel> label = adoptNS([[getUILabelClass() alloc] initWithFrame:CGRectZero]);
     [label setText:message];
     [label setFont:[getUIFontClass() systemFontOfSize:14.0]];
-    [label setLineBreakMode:NSLineBreakByWordWrapping];
+    [label setLineBreakMode:NSLineBreakByTruncatingTail];
     [label setNumberOfLines:4];
     [popoverView addSubview:label.get()];
 

Modified: trunk/Source/WebCore/platform/mac/ValidationBubbleMac.mm (210424 => 210425)


--- trunk/Source/WebCore/platform/mac/ValidationBubbleMac.mm	2017-01-06 02:05:22 UTC (rev 210424)
+++ trunk/Source/WebCore/platform/mac/ValidationBubbleMac.mm	2017-01-06 02:47:06 UTC (rev 210425)
@@ -67,6 +67,7 @@
 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101100
     [label setMaximumNumberOfLines:4];
 #endif
+    [[label cell] setTruncatesLastVisibleLine:YES];
     [popoverView addSubview:label.get()];
     NSSize labelSize = [label sizeThatFits:NSMakeSize(maxLabelWidth, CGFLOAT_MAX)];
     [label setFrame:NSMakeRect(horizontalPadding, verticalPadding, labelSize.width, labelSize.height)];
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to