Bug 56543

Summary: CSS property "-webkit-text-size-adjust" means different things in Safari and iOS
Product: WebKit Reporter: ar <webkitbugs>
Component: CSSAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: adam-f3-webkit, ahf, allan.jensen, ap, benm, cshu, ddkilzer, dglazkov, eoconnor, eric, esprehn+autocc, gyuyoung.kim, hyatt, jcraig, joepeck, johnme, jreck, kenneth, laszlo.gombos, ljaehun.lim, macpherson, menard, mifenton, mitz, ojan.autocc, parag, rakuco, simon.fraser, solo-webkit, syoichi, tonikitoo, wamatt, webkit.org, webkit.review.bot
Priority: P3 Keywords: InRadar, WebExposed
Version: 528+ (Nightly build)   
Hardware: Mac (Intel)   
OS: OS X 10.6   
See Also: https://bugs.webkit.org/show_bug.cgi?id=259435
Bug Depends on:    
Bug Blocks: 70342, 73546    
Attachments:
Description Flags
Testcase for this bug
none
Patch to restrict -webkit-text-size-adjust to iOS only
mitz: review-
Patch
simon.fraser: review-
Remove desktop version of -webkit-text-size-adjust property.
simon.fraser: review+
Patch for EWS and landing none

ar
Reported 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/>
Attachments
Testcase for this bug (4.61 KB, text/html)
2011-03-16 23:32 PDT, ar
no flags
Patch to restrict -webkit-text-size-adjust to iOS only (9.32 KB, patch)
2011-06-01 12:31 PDT, jreck
mitz: review-
Patch (4.60 KB, patch)
2011-12-05 07:32 PST, Alexander Færøy
simon.fraser: review-
Remove desktop version of -webkit-text-size-adjust property. (38.38 KB, patch)
2013-03-07 11:16 PST, Andreas Kling
simon.fraser: review+
Patch for EWS and landing (43.41 KB, patch)
2013-03-07 11:59 PST, Andreas Kling
no flags
Simon Fraser (smfr)
Comment 1 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.
ar
Comment 2 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.
Simon Fraser (smfr)
Comment 3 2011-03-17 13:06:56 PDT
Simon Fraser (smfr)
Comment 4 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.
jreck
Comment 5 2011-06-01 12:31:49 PDT
Created attachment 95643 [details] Patch to restrict -webkit-text-size-adjust to iOS only
mitz
Comment 6 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.
jreck
Comment 7 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.
Simon Fraser (smfr)
Comment 8 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.
mitz
Comment 9 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?
jreck
Comment 10 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?
Ben Murdoch
Comment 11 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.
Kenneth Rohde Christiansen
Comment 12 2011-10-19 02:00:27 PDT
We need this support for Qt as well.
Alexander Færøy
Comment 13 2011-12-05 07:32:20 PST
Simon Fraser (smfr)
Comment 14 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.
Alexander Færøy
Comment 15 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?
Simon Fraser (smfr)
Comment 16 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.
Alexander Færøy
Comment 17 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?
Theresa O'Connor
Comment 18 2011-12-06 11:37:10 PST
I'll ask around and get back to you.
Alexander Færøy
Comment 19 2011-12-08 07:08:09 PST
Any updates to this?
Eric Seidel (no email)
Comment 20 2012-02-13 16:34:42 PST
It looks like this stalled out. Any updates Edward?
Alexander Færøy
Comment 21 2012-03-13 06:23:28 PDT
Ping. We are really looking forward to get this fixed. Any updates to this?
Simon Fraser (smfr)
Comment 22 2012-04-04 13:21:57 PDT
*** Bug 83052 has been marked as a duplicate of this bug. ***
James Craig
Comment 23 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
Matt Tagg
Comment 24 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.
Simon Fraser (smfr)
Comment 25 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?
Andreas Kling
Comment 26 2013-03-07 11:16:45 PST
Created attachment 192052 [details] Remove desktop version of -webkit-text-size-adjust property.
Simon Fraser (smfr)
Comment 27 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
Andreas Kling
Comment 28 2013-03-07 11:59:57 PST
Created attachment 192060 [details] Patch for EWS and landing
WebKit Review Bot
Comment 29 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
WebKit Review Bot
Comment 30 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>
WebKit Review Bot
Comment 31 2013-03-07 18:10:54 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.