zlacker

WebKit Quirks.cpp

submitted by Bodaci+(OP) on 2022-10-14 19:16:58 | 199 points 91 comments
[view article] [source] [go to bottom]

NOTE: showing posts with links only show all posts
2. sanxiy+T6[view] [source] 2022-10-14 19:54:53
>>Bodaci+(OP)
By the way, this is as old as web. It's ironic to re-read https://dev.opera.com/blog/opera-s-site-patching/ published in 2009, which uses 2022(!) as a stand-in year for far future when hopefully none of this will be required.
4. sanxiy+m8[view] [source] 2022-10-14 20:02:44
>>Bodaci+(OP)
You can check out https://github.com/webcompat/web-bugs/labels/sitepatch-appli... to see current actions.
5. leland+T8[view] [source] 2022-10-14 20:05:54
>>Bodaci+(OP)
Unrelated to quirks mode: https://en.wikipedia.org/wiki/Quirks_mode

Which even just remembering now gave me some small terror

6. eatonp+o9[view] [source] 2022-10-14 20:09:11
>>Bodaci+(OP)
I noticed this today through Andreas Kling's tweet: https://twitter.com/awesomekling/status/1580993812247158784.
8. pvg+Nc[view] [source] 2022-10-14 20:31:57
>>Bodaci+(OP)
Previous (87 comment) discussion two years ago:

https://news.ycombinator.com/item?id=26165357

15. lapcat+ug[view] [source] 2022-10-14 20:56:17
>>Bodaci+(OP)
Interesting that this is posted to HN now, because I recently ran into some YouTube brokenness caused by an old WebKit quirk.

"Site-specific hacks break native video controls in YouTube embeds" https://bugs.webkit.org/show_bug.cgi?id=245612

So many hours spent debugging this...

◧◩
17. richdo+Nh[view] [source] [discussion] 2022-10-14 21:06:11
>>pvg+Nc
We found a bug last time!

https://bugs.webkit.org/show_bug.cgi?id=222130

29. squeak+Lr[view] [source] 2022-10-14 22:10:29
>>Bodaci+(OP)
I've found another webkit quirk in the past which is outside of the Quirks.cpp file, ObjectPrototype.cpp has some special code for the PokerBros app. Looks like it's still there.

https://github.com/WebKit/WebKit/blob/f134a54c03b71e8e3c4da0...

https://github.com/WebKit/WebKit/blob/f134a54c03b71e8e3c4da0...

Also not as disgusting as Quirks.cpp, but I was debugging some video decoding stuff in Chrome this week and found some fun things today, special code to work around various GPU driver bugs.

https://source.chromium.org/chromium/chromium/src/+/main:gpu...

https://source.chromium.org/chromium/chromium/src/+/main:gpu...

And a separate implementation of MSAA for Intel GPUs

https://source.chromium.org/chromium/chromium/src/+/main:gpu...

◧◩◪◨
56. happyt+LP[view] [source] [discussion] 2022-10-15 02:00:46
>>Charle+uw
That's Paul. His product is https://github.com/canalplus/rx-player
◧◩
64. bialpi+dh1[view] [source] [discussion] 2022-10-15 07:22:51
>>squeak+Lr
There's also https://source.chromium.org/chromium/chromium/src/+/main:gpu...
◧◩◪
74. olliej+Uq1[view] [source] [discussion] 2022-10-15 09:23:32
>>shadow+hk
That is a glib, and inaccurate claim of browser engine development based on the reality of the web more than a decade ago.

It is however absolutely the behavior of web developers, that's why the web used to be filled with IE only sites, and why we are now getting chrome only sites. It is much easier to blame other engines that ask whether your site is depending on implementation details.

The TLDR for this is: the modern web is very well specified, and all browser engines work very hard to conform to those specs, and now when divergent behavior is found the erroneous engine is corrected, or if the specification itself was incomplete considerable effort is expended making sure it is complete so that it is possible to ensure conforming implementations. The driving force for this was engine developers, not site developers.

Anyway.

The entire point of the html5 and subsequent "living" spec, and the death of ES4 and subsequent ES3.1 and ES5 specs, and then ES's "living spec" was dealing with the carnage of the early web and the Netscape vs IE insanity it produced. This was a huge amount of effort driven almost entirely by the engine developers, specifically so that the specs could actually be used to implement browser engines. The existing W3C and ECMA specifications were useless as they frequently did not match reality, where they did match reality they had gaps where things were not specified, and frequently they simply did not acknowledge features existed.

It took a huge amount of effort to determine the exact specification for parsing html, such that it could be adopted without breaking things. It took a huge amount of effort to go through the DOM APIs, the node traversal, event propagation, and on and on to specify them.

The same thing happened with ecmascript. A lot of effort for many years was spent replacing the existing spec, ignoring a bunch of time wasted by some parts of the committee creating ES4, making it so that the ecmascript specification actually matched reality.

There were places where we found that there were mutually incompatible behaviors between Gecko and Trident, but in most cases we were able to replace old badly written specs, with real specifications that were compatible with reality, and were sufficiently detailed that they could be used to implement a new engine, and be confident that their engine would actually be usable.

The immense work required for this also means that the spec authors and committees are acutely aware of the need for exact and precise specification of new features. So it is expected that new specifications completely specify all behavior.

As an example, I recall that after originally implementing support for IMEs in webkit on windows, I spent weeks stepping through how key down, up, and press events were fired in the DOM when a user was typing with an IME. The spec at that point failed to say what events should be fired in that case - text entry is not keydown/press/up once IMEs are involved, do not assume one keyup will result in a single character change - it was a months long effort to get to something that only managed to specify keydown/up/press, none of the actual complexity of IMEs. The specification has since expanded to be more capable of handling IMEs, but they have an example of what the "keys typed by a user" vs "key events you receive" [1], and alas my work is now largely "legacy" :D [2]

The problem as ever, is that it is very easy for web developers to rely on some implementation detail that a specification failed to dictate, and then say any browser engine that does not behave identically is wrong. This is what webdevs did with IE, and now it's what webdevs do with Chrome. It is always easier for a webdev to paste "this site requires ie/chrome" than to work out if what they're doing is actually specified behavior. Sure, it's possible it's a bug in the other engine, but if you are saying "install chrome" you're saying it doesn't work in Gecko or WebKit, so it's much more likely to be a site bug.

[1] https://www.w3.org/TR/uievents/#keys-IME

[2] https://www.w3.org/TR/uievents/#legacy-key-models

[go to top]