4 ms·
Slightly off topic, check out the HTML code next to the "Onsite repairs" box; the formatting uses strikethrough, but there is a hidden element with "Not" text b
by thih9 5y ago
Slightly off topic, check out the HTML code next to the "Onsite repairs" box; the formatting uses strikethrough, but there is a hidden element with "Not" text before each crossed out line. I assume this is for accessibility or copy-paste compatibility; as a result the raw text still reads:
> Onsite repairs: Not someday Not next week Not soon
ASAP.
I find this kind of attention to detail very cool.
(Too bad "ASAP" is not very specific either and can mean "someday", "next week", or "soon" too...)
- polycaster 5y agoI suppose this is more about the concern the wrong meaning could be indexed. Nice highlight in search results: "Apple BE: Onsite repairs someday".
- CityOfThrowaway 5y agoThis is for the visually impaired! Screen readers will announce the hidden element
- dahfizz 5y agoCan screen readers not figure out that a 1px x 1px element with a clip-path: inset(0px 0px 99.9% 99.9%) is invisible?
- londons_explore 5y agoScreen readers are a lot dumber than you'd expect... And now web designers have come to rely on this dumb-ness, so making them smarter breaks stuff.
- steve_adams_86 5y agoThe trouble is, I think, that typefaces vary so much that some could appear to have a strike through when they don't. Or take for example the number 0 which sometimes has a fairly horizontal slash through it. Do you program the screen reader to check if the struck letter is a 0, and if so, consider it not to be struck? But... What if it actually is, and that typeface doesn't have a slashed 0? Do you only check perfectly horizontal strikes? How thick? At which height in the type? How much overhead is it to parse all of this? etc. This also requires rendering the document and inspecting the image with object detection, I would think? Someone correct me if I'm wrong, I'm only trying to imagine potential problems.
- deleted 5y ago[deleted]
- zeusk 5y agoscreen readers don't do OCR.
- steve_adams_86 5y agoThat's kind of my point - I don't understand how you could go about identifying words on screen with a strike-through in the way they described.
- zeusk 5y agoDepends on how you implement the strikethrough; if you use the HTML tag - the screen reader will have zero trouble. Although with all the vDOM and JavaScript crap these days, web is quite inaccessible compared to most native apps.
- dahfizz 5y agoThe issue is not with detecting the strike through. The issue is that the CSS of the hidden "not" element obviously makes the element invisible, but a screen reader still reads it. Obviously, Apple is abusing that fact here in order to insert elements that only screen readers would see. Definitely feels like a hack.
- steve_adams_86 5y agoI understand what's happening (I use this approach myself). I'm only wondering about if the strike-through recognition idea makes sense.
- dahfizz 5y agoThere is a text-decoration: line-through csv styling available, which I would hope a screen reader would convey properly. Apple isn't using that here though, for whatever reason. An AI could probably get pretty good at detecting and interpreting stuff like the ::after as a strikethrough. The general problem of extracting semantics from a hacked up html / css / js web page feels like it would require a human level AGI. There are a ton of ways to make text appear with a line through it, and in some cases it may not even have been intended as a strikethrough.
- cma 5y agoDo they not indicate strike through already in another way?
- overspeed 5y agoSlightly tangential but don't soon and ASAP mean the same with the difference of an urgency qualifier?
- city17 5y agoThought the same. ASAP seems just as meaningless/vague as soon?
- 5faulker 5y agoIt's way too vague if they're channeling that much attention to it.
- spyder 5y agoLooks like they are using the hidden "not" and the weird :after CSS pseudo element to draw a line over text instead of "text-decoration: line-through;" probably because screen readers don't recognize the proper strike-trough styling: https://veroniiiica.com/2020/05/29/tips-for-censoring-text-with-accessibility-in-mind/ https://veroniiiica.com/2020/05/29/tips-for-censoring-text-w... If that's the case than it should be fixed in the screen readers instead of still requiring CSS "hacking" in 2021.
- mappu 5y agoBootstrap's .visually-hidden (formerly .sr-only) does something similar using clip(): https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss https://github.com/twbs/bootstrap/blob/main/scss/mixins/_vis...