Bug 56543 - CSS property "-webkit-text-size-adjust" means different things in Safari and iOS
: CSS property "-webkit-text-size-adjust" means different things in Safari and iOS
Status: RESOLVED FIXED
Product: WebKit
Classification: Unclassified
Component: CSS
: 528+ (Nightly build)
: Macintosh Intel Mac OS X 10.6
: P3 Normal
Assigned To: Nobody
: InRadar, WebExposed
Depends on:
Blocks: 73546 70342
  Show dependency treegraph
 
Reported: 2011-03-16 23:32 PDT by ar
Modified: 2013-03-07 22:16 PST (History)
34 users (show)

See Also:


Attachments
Testcase for this bug (4.61 KB, text/html)
2011-03-16 23:32 PDT, ar
no flags Details
Patch to restrict -webkit-text-size-adjust to iOS only (9.32 KB, patch)
2011-06-01 12:31 PDT, jreck
mitz: review-
Details | Formatted Diff | Diff
Patch (4.60 KB, patch)
2011-12-05 07:32 PST, Alexander Færøy
simon.fraser: review-
Details | Formatted Diff | Diff
Remove desktop version of -webkit-text-size-adjust property. (38.38 KB, patch)
2013-03-07 11:16 PST, Andreas Kling
simon.fraser: review+
Details | Formatted Diff | Diff
Patch for EWS and landing (43.41 KB, patch)
2013-03-07 11:59 PST, Andreas Kling
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description ar 2011-03-16 23:32:06 PDT
Created attachment 86034 [details]
Testcase for this bug

=== Bug: ===
According to the "Safari Web Content Guide" documentation, the css property "-webkit-text-size-adjust" should *only* effect Mobile Safari.

"...you can control the text size that Safari on iOS uses when rendering a block of text."

That is true, in that it does effect "Safari on iOS". The problem is, when set to "none" it *does* inhibit the ability to "Zoom In/Out" of a page (with or without "Zoom Text Only" on or off) in desktop Safari or other Webkit based desktop browsers.

I've attached a testcase.



=== Expected Behavior: ===
- Setting "-webkit-text-size-adjust: none;" *should* lock the font size in place on iOS devices (as it currently does) but it should *not* inhibit the ability to enlarge/reduce the size of text in desktop Safari/Webkit.



=== Workarounds: ===
- #1 Use @media queries to target iOS devices and include this property in the relevant selector. This way, the @media query takes care of applying it only to Safari on iOS.
- #2 Alternatively, setting "-webkit-text-size-adjust" to "100%" seems to be the best of both worlds. It locks the font size down in iOS, allows for enlarging/reducing the size of the text in desktop Safari/Webkit and doesn't require @media queries.



=== Other: ===
- Apparently, the workarounds above aren't necessary for iPad, because this property is automatically set to "none" on iPad. At least according to: <http://blog.grahamlicence.co.uk/post/-webkit-text-size-adjust.aspx>
- I searched the documentation and couldn't find that rule though. Can anyone else confirm that this is the case?

 

=== Reference: ===
Apple Safari Developer Library:
 
<http://developer.apple.com/library/safari/documentation/appleapplications/reference/safariwebcontent/AdjustingtheTextSize/AdjustingtheTextSize.html#//apple_ref/doc/uid/TP40006510-SW16>

<http://developer.apple.com/library/safari/documentation/appleapplications/reference/SafariCSSRef/Articles/StandardCSSProperties.html#//apple_ref/doc/uid/TP30001266--webkit-text-size-adjust>

<http://css-infos.net/property/-webkit-text-size-adjust>

<http://www.campaignmonitor.com/blog/post/3339/save-your-layout-by-overriding-the-minimum-font-size-on-the-iphone-and/>



=== Credit for finding and blogging about this bug before me: ===
<http://www.456bereastreet.com/archive/201011/beware_of_-webkit-text-size-adjustnone/>
Comment 1 Simon Fraser (smfr) 2011-03-17 10:47:46 PDT
text-size-adjust was added in http://trac.webkit.org/changeset/6805 with an -apple prefix. I think this has a different meaning that the iOS -webkit-text-size-adjust.
Comment 2 ar 2011-03-17 11:47:02 PDT
I just realized there's a typo in my Testcase.

In the "Workaround #1" sample CSS code, "#wa2" (both of them) should be "#wa1".

The typo is *only* in the sample code that you see when you're looking at the rendered page. The actual CSS (in the <head><styles>) that targets/effects that block ("Workaround #1") is correct.
Comment 3 Simon Fraser (smfr) 2011-03-17 13:06:56 PDT
<rdar://problem/9150203>
Comment 4 Simon Fraser (smfr) 2011-05-27 09:37:10 PDT
I think we should deprecate or rename the version of -webkit-text-size-adjust that was added in r6805. I believe it only has users inside Apple, and we can fix those to use a new name.
Comment 5 jreck 2011-06-01 12:31:49 PDT
Created attachment 95643 [details]
Patch to restrict -webkit-text-size-adjust to iOS only
Comment 6 mitz@webkit.org 2011-06-01 13:17:48 PDT
Comment on attachment 95643 [details]
Patch to restrict -webkit-text-size-adjust to iOS only

This will break Safari RSS.
Comment 7 jreck 2011-06-01 14:39:18 PDT
(In reply to comment #6)
> (From update of attachment 95643 [details])
> This will break Safari RSS.

How so? The RSS reader looks fine with this patch. Cmd +/- doesn't scale the RSS sidebar. The minimum font size setting will now affect the RSS reader, but IMHO that would be fixing the RSS reader not breaking it.
Comment 8 Simon Fraser (smfr) 2011-06-01 14:43:19 PDT
Safari RSS and some other Apple-internal content expect -webkit-text-size-adjust to work the old way. We can't change this until that internal content has been updated to use something else.
Comment 9 mitz@webkit.org 2011-06-01 15:11:46 PDT
(In reply to comment #7)
> (In reply to comment #6)
> > (From update of attachment 95643 [details] [details])
> > This will break Safari RSS.
> 
> How so? The RSS reader looks fine with this patch. Cmd +/- doesn't scale the RSS sidebar.

Did you test with View > Zoom Text Only enabled?
Comment 10 jreck 2011-06-01 16:39:48 PDT
(In reply to comment #9)
> (In reply to comment #7)
> > (In reply to comment #6)
> > > (From update of attachment 95643 [details] [details] [details])
> > > This will break Safari RSS.
> > 
> > How so? The RSS reader looks fine with this patch. Cmd +/- doesn't scale the RSS sidebar.
> 
> Did you test with View > Zoom Text Only enabled?

Ah, no, I hadn't. That option does cause the sidebar to scale. So should I change it so that this CSS property is still honored for Safari as well? Are there any other browsers that expect this property to be supported?
Comment 11 Ben Murdoch 2011-06-02 01:41:44 PDT
Could we make supporting this property a configurable option, perhaps at runtime on the Settings object? It could default to true so as to not break existing apps, but platforms like Android that want to provide a different behavior for accessibility can disable it at startup. Or maybe we could do it at compile time with an ENABLE macro or similar. Then it's easy for each platform to make their own choice.
Comment 12 Kenneth Rohde Christiansen 2011-10-19 02:00:27 PDT
We need this support for Qt as well.
Comment 13 Alexander Færøy 2011-12-05 07:32:20 PST
Created attachment 117877 [details]
Patch
Comment 14 Simon Fraser (smfr) 2011-12-05 09:07:24 PST
Comment on attachment 117877 [details]
Patch

I think you are misunderstanding. -webkit-text-size-means something totally different on iOS and desktop. It's not just a question of some size threshold. We need to migrate desktop clients to a different property name before adding any mobile-style text size adjust.
Comment 15 Alexander Færøy 2011-12-06 02:21:09 PST
(In reply to comment #14)
> I think you are misunderstanding. -webkit-text-size-means something totally different on iOS and desktop. It's not just a question of some size threshold. We need to migrate desktop clients to a different property name before adding any mobile-style text size adjust.

Do you suggest that we rename the current implementation to something else like -apple-text-size-adjust? Or do you have a better suggestion?
Comment 16 Simon Fraser (smfr) 2011-12-06 10:50:56 PST
(In reply to comment #15)
> (In reply to comment #14)
> > I think you are misunderstanding. -webkit-text-size-means something totally different on iOS and desktop. It's not just a question of some size threshold. We need to migrate desktop clients to a different property name before adding any mobile-style text size adjust.
> 
> Do you suggest that we rename the current implementation to something else like -apple-text-size-adjust? Or do you have a better suggestion?

I think it needs a new name, not just a different prefix. Or there's a chance that it could be removed, but someone inside of Apple would have to verify that.
Comment 17 Alexander Færøy 2011-12-06 11:29:17 PST
(In reply to comment #16)
> I think it needs a new name, not just a different prefix. Or there's a chance that it could be removed, but someone inside of Apple would have to verify that.

Thanks for clarifying. Who within Apple should I try to contact regarding this?
Comment 18 Edward O'Connor 2011-12-06 11:37:10 PST
I'll ask around and get back to you.
Comment 19 Alexander Færøy 2011-12-08 07:08:09 PST
Any updates to this?
Comment 20 Eric Seidel 2012-02-13 16:34:42 PST
It looks like this stalled out.  Any updates Edward?
Comment 21 Alexander Færøy 2012-03-13 06:23:28 PDT
Ping. We are really looking forward to get this fixed. Any updates to this?
Comment 22 Simon Fraser (smfr) 2012-04-04 13:21:57 PDT
*** Bug 83052 has been marked as a duplicate of this bug. ***
Comment 23 James Craig 2012-04-04 21:19:49 PDT
From the duplicate:

The desktop implementation (preventing users from explicitly enlarging their font size) is in violation of both WCAG Guideline 1.4.4 and UAAG Guideline 4.1.

WCAG Guideline 1.4:
http://www.w3.org/TR/WCAG/#visual-audio-contrast
1.4.4 Resize text: Except for captions and images of text, text can be resized without assistive technology up to 200 percent without loss of content or functionality. (Level AA)

UAAG Guideline 4. Ensure user control of rendering
http://www.w3.org/TR/UAAG/guidelines.html#gl-user-control-styles
4.1 Configure text scale (P1) (1) Allow global configuration of the scale of visually rendered text content. Preserve distinctions in the size of rendered text as the user increases or decreases the scale. (2) As part of satisfying provision one of this checkpoint, provide a configuration option to override rendered text sizes specified by the author or user agent defaults
Comment 24 Matt Tagg 2013-01-22 23:07:43 PST
Still appears stalled, is anyone taking ownership?

Would be great to see it bug squashed, as it appears to have non-trivial user visibility.
Comment 25 Simon Fraser (smfr) 2013-02-26 16:16:33 PST
My plan here is to wrap the CSS code in ENABLE(TEXT_AUTOSIZING), with the assumption that the CSS property will be used at some point in future for text autosizing by non-iOS ports.

However, the property would just do nothing until that's hooked up. Is that acceptable? Or would it be better to just remove it?
Comment 26 Andreas Kling 2013-03-07 11:16:45 PST
Created attachment 192052 [details]
Remove desktop version of -webkit-text-size-adjust property.
Comment 27 Simon Fraser (smfr) 2013-03-07 11:23:48 PST
Comment on attachment 192052 [details]
Remove desktop version of -webkit-text-size-adjust property.

View in context: https://bugs.webkit.org/attachment.cgi?id=192052&action=review

> Source/WebCore/css/svg.css:-61
> -text, tspan, tref {
> -   -webkit-text-size-adjust: none;
> -}
> -

I suggest you file a bug saying that, after this patch, text inside SVG will grow when zoomed. Or reopen http://bugs.webkit.org/show_bug.cgi?id=6487
Comment 28 Andreas Kling 2013-03-07 11:59:57 PST
Created attachment 192060 [details]
Patch for EWS and landing
Comment 29 WebKit Review Bot 2013-03-07 17:13:45 PST
Comment on attachment 192060 [details]
Patch for EWS and landing

Attachment 192060 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://webkit-commit-queue.appspot.com/results/16987255

New failing tests:
html5lib/generated/run-tests16-data.html
Comment 30 WebKit Review Bot 2013-03-07 18:10:47 PST
Comment on attachment 192060 [details]
Patch for EWS and landing

Clearing flags on attachment: 192060

Committed r145168: <http://trac.webkit.org/changeset/145168>
Comment 31 WebKit Review Bot 2013-03-07 18:10:54 PST
All reviewed patches have been landed.  Closing bug.