WebKit Bugzilla
Attachment 361330 Details for
Bug 194361
: Shrink and hyphenate safe browsing warning text on watchOS
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-194361-20190206143730.patch (text/plain), 3.28 KB, created by
Alex Christensen
on 2019-02-06 14:37:30 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Alex Christensen
Created:
2019-02-06 14:37:30 PST
Size:
3.28 KB
patch
obsolete
>Index: Source/WebKit/ChangeLog >=================================================================== >--- Source/WebKit/ChangeLog (revision 241049) >+++ Source/WebKit/ChangeLog (working copy) >@@ -1,3 +1,18 @@ >+2019-02-06 Alex Christensen <achristensen@webkit.org> >+ >+ Shrink and hyphenate safe browsing warning text on watchOS >+ https://bugs.webkit.org/show_bug.cgi?id=194361 >+ <rdar://problem/47466549> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Some internationalizations use long words that didn't fit on small watches. >+ >+ * UIProcess/Cocoa/WKSafeBrowsingWarning.mm: >+ (fontOfSize): >+ (-[WKSafeBrowsingWarning addContent]): >+ (-[WKSafeBrowsingTextView initWithAttributedString:forWarning:]): >+ > 2019-02-06 John Wilander <wilander@apple.com> > > Forward Ad Click Attribution data from HTMLAnchorElement::handleClick() to WebKit::NavigationActionData >Index: Source/WebKit/UIProcess/Cocoa/WKSafeBrowsingWarning.mm >=================================================================== >--- Source/WebKit/UIProcess/Cocoa/WKSafeBrowsingWarning.mm (revision 241028) >+++ Source/WebKit/UIProcess/Cocoa/WKSafeBrowsingWarning.mm (working copy) >@@ -37,7 +37,7 @@ constexpr CGFloat exclamationPointSize = > 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 @@ static FontType *fontOfSize(WarningTextS > 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 @@ - (void)addContent > 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)); >@@ -368,7 +374,6 @@ - (void)showDetailsClicked > { > ViewType *box = _box.get().get(); > ButtonType *showDetails = box.subviews.lastObject; >- WTFLogAlways("SHOW DETAILS BUTTON? %@", showDetails); > [showDetails removeFromSuperview]; > > NSMutableAttributedString *text = [[_warning->details() mutableCopy] autorelease]; >@@ -537,6 +542,9 @@ - (instancetype)initWithAttributedString > #if !PLATFORM(MAC) > self.scrollEnabled = NO; > #endif >+#if PLATFORM(WATCHOS) >+ self.layoutManager.hyphenationFactor = 1; >+#endif > > return self; > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
ggaren
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 194361
:
361328
| 361330