Title: [241161] branches/safari-607-branch/Source/WebKit
- Revision
- 241161
- Author
- [email protected]
- Date
- 2019-02-07 15:37:04 -0800 (Thu, 07 Feb 2019)
Log Message
Cherry-pick r241124. rdar://problem/47893586
Shrink and hyphenate safe browsing warning text on watchOS
https://bugs.webkit.org/show_bug.cgi?id=194361
<rdar://problem/47466549>
Reviewed by Geoffrey Garen.
Some internationalizations use long words that didn't fit on small watches.
* UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
(fontOfSize):
(-[WKSafeBrowsingWarning addContent]):
(-[WKSafeBrowsingTextView initWithAttributedString:forWarning:]):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241124 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Modified Paths
Diff
Modified: branches/safari-607-branch/Source/WebKit/ChangeLog (241160 => 241161)
--- branches/safari-607-branch/Source/WebKit/ChangeLog 2019-02-07 23:37:01 UTC (rev 241160)
+++ branches/safari-607-branch/Source/WebKit/ChangeLog 2019-02-07 23:37:04 UTC (rev 241161)
@@ -1,5 +1,41 @@
2019-02-07 Alan Coon <[email protected]>
+ Cherry-pick r241124. rdar://problem/47893586
+
+ Shrink and hyphenate safe browsing warning text on watchOS
+ https://bugs.webkit.org/show_bug.cgi?id=194361
+ <rdar://problem/47466549>
+
+ Reviewed by Geoffrey Garen.
+
+ Some internationalizations use long words that didn't fit on small watches.
+
+ * UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
+ (fontOfSize):
+ (-[WKSafeBrowsingWarning addContent]):
+ (-[WKSafeBrowsingTextView initWithAttributedString:forWarning:]):
+
+
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241124 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2019-02-07 Alex Christensen <[email protected]>
+
+ Shrink and hyphenate safe browsing warning text on watchOS
+ https://bugs.webkit.org/show_bug.cgi?id=194361
+ <rdar://problem/47466549>
+
+ Reviewed by Geoffrey Garen.
+
+ Some internationalizations use long words that didn't fit on small watches.
+
+ * UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
+ (fontOfSize):
+ (-[WKSafeBrowsingWarning addContent]):
+ (-[WKSafeBrowsingTextView initWithAttributedString:forWarning:]):
+
+2019-02-07 Alan Coon <[email protected]>
+
Cherry-pick r241105. rdar://problem/47893571
[Payment Request] It should be possible to require a phonetic name for shipping contacts
Modified: branches/safari-607-branch/Source/WebKit/UIProcess/Cocoa/WKSafeBrowsingWarning.mm (241160 => 241161)
--- branches/safari-607-branch/Source/WebKit/UIProcess/Cocoa/WKSafeBrowsingWarning.mm 2019-02-07 23:37:01 UTC (rev 241160)
+++ branches/safari-607-branch/Source/WebKit/UIProcess/Cocoa/WKSafeBrowsingWarning.mm 2019-02-07 23:37:04 UTC (rev 241161)
@@ -37,7 +37,7 @@
constexpr CGFloat boxCornerRadius = 6;
#if HAVE(SAFE_BROWSING)
#if PLATFORM(WATCHOS)
-constexpr CGFloat marginSize = 10;
+constexpr CGFloat marginSize = 9;
#else
constexpr CGFloat marginSize = 20;
#endif
@@ -88,7 +88,7 @@
switch (size) {
case WarningTextSize::Title:
#if PLATFORM(WATCHOS)
- return [UIFont preferredFontForTextStyle:UIFontTextStyleHeadline];
+ return [UIFont preferredFontForTextStyle:UIFontTextStyleSubheadline];
#else
return [UIFont preferredFontForTextStyle:UIFontTextStyleLargeTitle];
#endif
@@ -289,10 +289,16 @@
auto title = makeLabel([[[NSAttributedString alloc] initWithString:_warning->title() attributes:@{
NSFontAttributeName:fontOfSize(WarningTextSize::Title),
NSForegroundColorAttributeName:colorForItem(WarningItem::TitleText, self)
+#if PLATFORM(WATCHOS)
+ , NSHyphenationFactorDocumentAttribute:@1
+#endif
}] autorelease]);
auto warning = makeLabel([[[NSAttributedString alloc] initWithString:_warning->warning() attributes:@{
NSFontAttributeName:fontOfSize(WarningTextSize::Body),
NSForegroundColorAttributeName:colorForItem(WarningItem::MessageText, self)
+#if PLATFORM(WATCHOS)
+ , NSHyphenationFactorDocumentAttribute:@1
+#endif
}] autorelease]);
auto showDetails = makeButton(WarningItem::ShowDetailsButton, self, @selector(showDetailsClicked));
auto goBack = makeButton(WarningItem::GoBackButton, self, @selector(goBackClicked));
@@ -536,6 +542,9 @@
#if !PLATFORM(MAC)
self.scrollEnabled = NO;
#endif
+#if PLATFORM(WATCHOS)
+ self.layoutManager.hyphenationFactor = 1;
+#endif
return self;
}
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes