This website requires JavaScript.
Explore
Help
Sign in
Stowage
/
ladybird
Watch
2
Star
0
Fork
You've already forked ladybird
0
mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced
2025-12-08 06:09:58 +00:00
Code
Issues
Projects
Releases
Packages
Wiki
Activity
d31a58a7d6
ladybird
/
Tests
/
LibWeb
/
Text
/
expected
/
DOM
/
Offset-of-empty-inline-element.txt
3 lines
16 B
Text
Raw
Normal View
History
Unescape
Escape
LibWeb: Implement time-traveling inheritance for CSS font-size When setting `font-family: monospace;` in CSS, we have to interpret the keyword font sizes (small, medium, large, etc) as slightly smaller for historical reasons. Normally the medium font size is 16px, but for monospace it's 13px. The way this needs to behave is extremely strange: When encountering `font-family: monospace`, we have to go back and replay the CSS cascade as if the medium font size had been 13px all along. Otherwise relative values like 2em/200%/etc could have gotten lost in the inheritance chain. We implement this in a fairly naive way by explicitly checking for `font-family: monospace` (note: it has to be *exactly* like that, it can't be `font-family: monospace, Courier` or similar.) When encountered, we simply walk the element ancestors and re-run the cascade for the font-size property. This is clumsy and inefficient, but it does work for the common cases. Other browsers do more elaborate things that we should eventually care about as well, such as user-configurable font settings, per-language behavior, etc. For now, this is just something that allows us to handle more WPT tests where things fall apart due to unexpected font sizes. To learn more about the wonders of font-size, see this blog post: https://manishearth.github.io/blog/2017/08/10/font-size-an-unexpectedly-complex-css-property/
2025-02-25 11:47:03 +01:00
Top: 13
LibWeb: Make offsetTop and offsetLeft behave more like other browsers We now follow the rules from the spec more closely, along with an unspecified quirk for when the offsetParent is a non-positioned body element. (Spec bug linked in a comment.) This fixes a whole bunch of css-flexbox tests on WPT, which already had correct layout, but the reported metrics from JS API were wrong.
2024-07-25 17:01:16 +02:00
Left: 8
Reference in a new issue
Copy permalink