[Extra zoom mode] Tweak UA stylesheet to improve legibility of rendered text
authorwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 27 Feb 2018 01:32:06 +0000 (01:32 +0000)
committerwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 27 Feb 2018 01:32:06 +0000 (01:32 +0000)
https://bugs.webkit.org/show_bug.cgi?id=183142
<rdar://problem/37912966>

Reviewed by Tim Horton.

Force text-size-adjust and hyphens to be always on in EXTRA_ZOOM_MODE. To accomplish this, we override the extra
style sheet in RenderTheme to include these two style rules.

* rendering/RenderThemeIOS.h:
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::extraDefaultStyleSheet):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229049 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderThemeIOS.h
Source/WebCore/rendering/RenderThemeIOS.mm

index 154b662..2421ab3 100644 (file)
@@ -1,3 +1,18 @@
+2018-02-26  Wenson Hsieh  <wenson_hsieh@apple.com>
+
+        [Extra zoom mode] Tweak UA stylesheet to improve legibility of rendered text
+        https://bugs.webkit.org/show_bug.cgi?id=183142
+        <rdar://problem/37912966>
+
+        Reviewed by Tim Horton.
+
+        Force text-size-adjust and hyphens to be always on in EXTRA_ZOOM_MODE. To accomplish this, we override the extra
+        style sheet in RenderTheme to include these two style rules.
+
+        * rendering/RenderThemeIOS.h:
+        * rendering/RenderThemeIOS.mm:
+        (WebCore::RenderThemeIOS::extraDefaultStyleSheet):
+
 2018-02-26  Don Olmstead  <don.olmstead@sony.com>
 
         Fix WebCore includes within WebKitLegacy
index 4a079f4..641e434 100644 (file)
@@ -128,6 +128,10 @@ private:
 
     void purgeCaches() override;
 
+#if ENABLE(EXTRA_ZOOM_MODE)
+    String extraDefaultStyleSheet() final;
+#endif
+
     const Color& shadowColor() const;
     FloatRect addRoundedBorderClip(const RenderObject& box, GraphicsContext&, const IntRect&);
 
index f099c28..d3bc50a 100644 (file)
@@ -1799,6 +1799,15 @@ bool RenderThemeIOS::paintAttachment(const RenderObject& renderer, const PaintIn
 
 #endif // ENABLE(ATTACHMENT_ELEMENT)
 
+#if ENABLE(EXTRA_ZOOM_MODE)
+
+String RenderThemeIOS::extraDefaultStyleSheet()
+{
+    return "* { -webkit-text-size-adjust: auto !important; -webkit-hyphens: auto !important; }";
+}
+
+#endif
+
 } // namespace WebCore
 
 #endif //PLATFORM(IOS)