WebKit Bugzilla
Attachment 373109 Details for
Bug 199318
: [Text autosizing] bing.com is hard to read even with boosted text because of the line height
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-199318-20190628055039.patch (text/plain), 2.81 KB, created by
zalan
on 2019-06-28 05:50:41 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
zalan
Created:
2019-06-28 05:50:41 PDT
Size:
2.81 KB
patch
obsolete
>Subversion Revision: 246791 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 704f598299e11482f5d1b3128e2bceebc42ab192..bf6a18c8ff5a5ebc0bd6c3bfe7640777857a9807 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,16 @@ >+2019-06-28 Zalan Bujtas <zalan@apple.com> >+ >+ [Text autosizing] bing.com is hard to read even with boosted text because of the line height >+ https://bugs.webkit.org/show_bug.cgi?id=199318 >+ <rdar://problem/51826096> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ WIP. >+ >+ * css/StyleResolver.cpp: >+ (WebCore::StyleResolver::adjustRenderStyleForTextAutosizing): >+ > 2019-06-25 Michael Catanzaro <mcatanzaro@igalia.com> > > Add user agent quirk for bankofamerica.com >diff --git a/Source/WebCore/css/StyleResolver.cpp b/Source/WebCore/css/StyleResolver.cpp >index b3e6e1415f55af5aec5123f3ec90155ff2ebc2c0..93bf3227a9829743240f3a56255379e31fb1bcec 100644 >--- a/Source/WebCore/css/StyleResolver.cpp >+++ b/Source/WebCore/css/StyleResolver.cpp >@@ -889,14 +889,33 @@ void StyleResolver::adjustRenderStyleForTextAutosizing(RenderStyle& style, const > if (style.textSizeAdjust().isNone()) > return; > >+ float initialScale = document().page() ? document().page()->initialScale() : 1; >+ auto adjustLineHeightIfNeeded = [&](auto computedFontSize) { >+ auto lineHeight = style.specifiedLineHeight(); >+ constexpr static unsigned eligibleFontSize = 12; >+ if (computedFontSize * initialScale >= eligibleFontSize) >+ return; >+ >+ constexpr static float boostFactor = 1.25; >+ auto minimumLineHeight = boostFactor * computedFontSize; >+ if (!lineHeight.isFixed() || lineHeight.value() >= minimumLineHeight) >+ return; >+ >+ style.setLineHeight({ minimumLineHeight, Fixed }); >+ style.setTextShadow(std::make_unique<ShadowData>(IntPoint(0, 0), 10, 20, ShadowStyle::Normal, true, Color(0, 255, 255, 200))); >+ }; >+ > if (!style.isIdempotentTextAutosizingCandidate()) >- return; >+ return adjustLineHeightIfNeeded(style.computedFontSize()); > >- float initialScale = document().page() ? document().page()->initialScale() : 1; > auto fontDescription = style.fontDescription(); >- fontDescription.setComputedSize(AutosizeStatus::idempotentTextSize(fontDescription.specifiedSize(), initialScale)); >+ auto initialComputedFontSize = fontDescription.computedSize(); >+ auto adjustedFontSize = AutosizeStatus::idempotentTextSize(fontDescription.specifiedSize(), initialScale); >+ fontDescription.setComputedSize(adjustedFontSize); > style.setFontDescription(WTFMove(fontDescription)); > style.fontCascade().update(&document().fontSelector()); >+ if (initialComputedFontSize != adjustedFontSize) >+ adjustLineHeightIfNeeded(adjustedFontSize); > } > #endif >
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
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 199318
:
373109
|
373140