16 ms·
WebKit fix: Quirk news.ycombinator to skip TextAutoSizing
- gbnvc 2y ago[dead]
- zxxh 2y ago[dead]
- hklijlyh 2y ago[dead]
- jan3024 2y ago[dead]
- mrdoop 2y ago[flagged]
- matteason 2y agoThere are two previous discussions on WebKit's Quirks.cpp [0] here: https://news.ycombinator.com/item?id=33207685 https://news.ycombinator.com/item?id=33207685 https://news.ycombinator.com/item?id=26165357 https://news.ycombinator.com/item?id=26165357 I wonder how big your site has to be to earn a spot in that file when you hit a Safari bug. Don't suppose Apple publish the criteria anywhere? [0] https://github.com/WebKit/WebKit/blob/84ae355619354ee1bfa7daaa1fc95565a6726be3/Source/WebCore/page/Quirks.cpp https://github.com/WebKit/WebKit/blob/84ae355619354ee1bfa7da...
- knallfrosch 2y agoApple's guidelines are meant to be broken anyway. Bloomberg's app (Bloomberg Professional) is unusable without an account, which is 100% against iOS guidelines, but who cares? Other big players, such as Amazon, simply negotiate the Apple tax – instead of paying the 30%. Naturally, Apple doesn't tell you how often and for whom it breaks its rules.
- tssva 2y agoApple made the rules for their convenience and benefit. They aren’t breaking them. They are adjusting them to once again be in line with their convenience and benefit.
- pquki4 2y agoBlah blah, that's just word play. I am always amazed by the defense that Apple apologists come up.
- tssva 2y agoI wasn’t apologizing for Apple. I actually pretty dislike Apple but that doesn’t change the fact that you can’t break the rules when you make the rules.
- leptons 2y ago>you can’t break the rules when you make the rules. This is really abusive, no wonder they are getting sued by the DOJ.
- nozzlegear 2y agoWho’s being abused by Bloomberg Professional requiring an account?
- freedomben 2y agoGP is surely talking about Apple changing/breaking the rules when they want to, as being unfair.
- 1f60c 2y agoI wish Apple had never abandoned the rule that you need to be able to subscribe in the app at the same listed price as on the web.
- onion2k 2y agoThis feels like a poor solution to the problem. As much as I like HN, browsers changing to maintain the status quo is a terrible idea. At the very least there should be a user controllable array of domains to apply this to in the config rather than a single magic string for one website.
- tda 2y agoI seriously thought that implementing some site specific custom rendering behaviour was meant as a joke. Why change html/css for a website when you can just implement some hardcoded site specific behaviour straight in the rendering engine? What could possibly go wrong? But after having a closer look at the PR, the 1900 LOC monstrosity Quirks.cpp actually seems to exist with lots of things like if (host == "tripadvisor.com"_s || host.endsWith(".tripadvisor.com"_s)) m_needsRelaxedCorsMixedContentCheckQuirk = true; Fixing CORS issues has never been easier
- thepra 2y agoThat's messed up, why should I put up with CORS when others have a special treatment...
- its-summertime 2y agoIts used here: https://github.com/WebKit/WebKit/blob/dc1354a1d26db54d17f7d3989a81036a46ee2d60/Source/WebCore/loader/MixedContentChecker.cpp#L170C27-L170C55 https://github.com/WebKit/WebKit/blob/dc1354a1d26db54d17f7d3... Seems to be specifically for (not) upgrading images and videos from http to https, nothing else.
- jorlow 2y agoIf a browser has too many compatibility issues, users will switch away. Outreach to the sites in question takes time and is often unsuccessful. Quirks is the pragmatic answer.
- formerly_proven 2y agoIs this triggered by HN being a table-based layout? Shouldn't this then affect way more sites?
- graemep 2y agoNO, the URL is hardcoded: https://github.com/WebKit/WebKit/commit/84ae355619354ee1bfa7daaa1fc95565a6726be3#diff-9c9efac6c4387d440e3758f970294201316416e5cac2abc4c94c4d25685dbdb0 https://github.com/WebKit/WebKit/commit/84ae355619354ee1bfa7...
- jraph 2y agoI believe your parent was asking whether the bug this workaround tries to address is caused by HN using tables for layout. This also came to my mind.
- paulgb 2y agoI imagine there are some stories out there of people tearing their hair out over issues in prod can’t be reproduced in localhost (or vice versa) due to quirks exceptions.
- jorlow 2y agoI wonder why browsers don't show a bit of UI that it's in compatibility mode and give a way to disable (or enable for other domains for dev/testing).
- lililililililll 2y ago[flagged]
- saagarjha 2y agoWhen I was at Twitter we had several engineers spend an afternoon trying to figure out why we were seeing different behavior for opening links (IIRC?) on iOS 14.5 (?) versus previous versions. Turns out that the WebKit team in their infinite wisdom had added some sort of change to how this worked several months back, realized it broke Twitter, then committed a change to restore the old behavior specifically for us. Of course, they also didn’t want to keep this around forever, so they also checked the iOS version to disable this behavior after 14.5 (?). Which is all well and good, except they never told us about this at all. So of course we find out about it when I, being well acquainted with Apple’s stupid quirks process, find the Slack thread where everyone is confused what is going on, identify where the bug is coming from, then do a search in WebKit for where they hardcoded the behavior for us. So thanks, WebKit team. You’re really doing a great job pushing web compatibility forward :(
- lapcat 2y agoThe least they could do, which they don't, is log a console warning when a quirk is activated.
- qingcharles 2y ago
- nottorp 2y ago> we can quirk TextAutoSizing to skip adjusting for it, at least until we figure out why we are calculating RenderBlockFlow width inconsistently: Looks like it's a bug on their side and this is a bandaid? That will presumably live forever.
- its-summertime 2y agoLooking at the html of HN's pages, can't blame them really. Running though https://validator.w3.org/ https://validator.w3.org/ , the result is abysmal. At this rate, if web browsers started requiring sites to output HTML that is somewhere in the realm of normalcy, HN would sooner shut down than consider ever updating.
- arp242 2y agoPretty much all of the HTML validator "errors" warnings for outdated attributes and the like. The "No space between attributes" one is pretty much the only real error.
- debugnik 2y agoPointing the validator at this submission and filtering out obsolete elements/attributes and all warnings/info messages, I still got 221 errors: No DOCTYPE, an script element after closing the body, duplicate element ids, and invalid attributes (not obsolete, they must be be using them like data-*).
- arp242 2y agoNone of which are serious errors. Certainly not the type that introduce rendering errors.
- Aardwolf 2y agoYet its pages load much faster than most websites, no cookie popups, no "subscribe to our newsletter" slide-ins, no phenomenon where the content loads but then a second later the page resets and re-loads the content again (probably with more ads or something), no images only getting loaded and popping in view while you scroll (rather than do it a bit predicatively beforehand so they'd pop in outside of your view to give a less slow impression), etc...
- sitharus 2y agoI don’t understand how that’s at odds with having spec-valid HTML and CSS
- swapsCAPS 2y ago[flagged]
- bob1029 2y agoI am confused. What part of the hacker news web source was more difficult to change than the source code for my web browser?
- Kiro 2y agoOT but what's up with the spam comments? What's the purpose?
- lapcat 2y agoUnfortunately these hacks last forever and can cause other problems. My web browser extension had to add a hack to work around WebKit's YouTube hack: https://bugs.webkit.org/show_bug.cgi?id=245612 https://bugs.webkit.org/show_bug.cgi?id=245612
- jraph 2y agoApparently it's a workaround until https://bugs.webkit.org/show_bug.cgi?id=275223 https://bugs.webkit.org/show_bug.cgi?id=275223 is understood and fixed. Seems more reasonable than how it looked at first.
- onion2k 2y agoThis is an example of somewhere a comment would actually have been useful.
- nightpool 2y agoI mean, it's explained very clearly in the commit message that's linked? Since the page where the bug manifests itself already has responsive CSS styling, we can quirk TextAutoSizing to skip adjusting for it, at least until we figure out why we are calculating RenderBlockFlow width inconsistently: https://bugs.webkit.org/show_bug.cgi?id=275223 That's even better than a comment, because you can git blame for it and get the full context of the issue (from the bug thread that proposed it to all of the documentation of the investigation done for both bugs)
- freedomben 2y agoI very much disagree that it's better than a comment. The git blame log will over time get layered on as changes are made to various lines, meaning you have to dive for the original message, assuming one is even there (many a time I dig for commits, only to see that the commit message doesn't answer the question of motivation very well or at all). A short comment in the code makes it obvious.
- alex3305 2y agoIs this the reason that Chromium based browsers always change font sizes for me on here? Since I'm visually impaired and have set my text sizing pretty large, I have that issue on multiple sites, including Hacker News. It's a bit of a gamble how large text will be when I refresh the page.
- maybevain 2y agoInterestingly there seems to be a few quirks for twitter.com, but none for x.com. I assume that'll lead to some regressions?
- saagarjha 2y agoProbably. But I doubt the engineers care about X as they did for Twitter.
- influx 2y agoWhy is that?
- manuelmoreale 2y agoI guess because Twitter used to be the place where all the tech people were hanging out and so there was an incentive to make it work properly while now is a bit of a cesspool in free fall and people have moved on to other platforms? That’s my guess.
- tomduncalf 2y agoI don’t get the impression that many people have moved on, though I could be wrong as my usage of Twitter has decreased “post-X” - but more because the site is so frequently broken! No need for rendering workarounds in browsers if the site breaks itself lol.
- saagarjha 2y agoIt's less that random people have moved and more that the Safari/WebKit engineers have
- rob 2y agoAwesome, time to submit a ticket to WebKit to auto-adjust HN's default text size to 16px like everybody else instead of 12px. It made sense in 2007 when your resolution was 1024x768.
- account42 2y ago> It made sense in 2007 when your resolution was 1024x768. Yes and so it makes sense today because CSS pixels are resolution independent. If something worked on 1024x768 monitors in 2007 but is too small on your monitor today then the problem is with your settings not the website.
- rwalle 2y agoSo why does HN text look so small under default settings on the desktop, and I always need to zoom to 133% to match the font size on other websites (that require no special treatment)? Am I using the browser wrong, or something is not quite right with HN? I am inclined to think the latter.
- rob 2y ago2560x1440 and ~12px on HN looks incredibly small. I just switched the resolution to 1024x768, and now the same ~12px is "larger" and easier to read without needing to increase my browser zoom. There's an obvious visual difference between the two.
- account42 2y agoThen your setup is not compliant with web standards. Most likely you need to enable DPI scaling somewhere.
- SassyBird 2y agoWithout HiDPI (sic!) scaling that means that a correctly-sized display for that resolution would have a 30" diagonal on Windows (standard PPI: 96) and 40" on Mac (standard PPI: 72). If you don’t have HiDPI (sic!) scaling enabled in your system and your display is smaller than that, then you’re basically browsing everything zoomed out.
- emursebrian 2y agoDo other browser vendors add special cases in their codebase for specific sites? It seems like a really bad idea. Since around 2020, I've been working on an app that makes heavy use of audio playback and recording. I feel like I am frequently making Safari specific updates because something related media playback or recording stopped working on Safari. I don't recall this kind of regression ever happening with Chromium-based browsers or Firefox. It feels weird in 2024 to be adding work-arounds and hacks specific web browsers and anecdotally, it seems to be getting worse. See https://news.ycombinator.com/item?id=40134383 https://news.ycombinator.com/item?id=40134383. On BrowserStack, still no Safari dev tools on iOS 17.4+
- phrz 2y agoThis has existed for every web engine since time immemorial, calling out Safari is misleading. Firefox calls them "site interventions" and Chrome calls them "patches" rather than Safari/WebKit's "quirks".
- kalleboo 2y agoAnd beyond web engines, operating systems have them too - both Windows and macOS have workarounds for popular apps.
- kmlx 2y agogpu drivers with patches for individual games.
- nightpool 2y agoDo you have a link to the Chrome site-specific patches directory? As you can imagine, it's pretty hard to search for :P
- deleted 2y ago[deleted]
- syngrog66 2y agoA quick glance at the title made me hope HN would finally allow screen-responsive auto-wrap of text lines. Its 2024 now and we know a thing or two about good vs bad UX.
- glonq 2y agoTIL that it's not just me who finds the default text size on HN to be excruciatingly tiny. I'd presumed that it was just an unfortunate side-effect of aging and poor vision!