mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-02 01:08:48 +00:00
LibWeb: Convert Paintable coordinates to new pixel units
This fixes a few sizing issues too. The page size is now correct in most cases! \o/ We get to remove some of the `to_type<>()` shenanigans, though it reappears in some other places.
This commit is contained in:
parent
57a69f15ff
commit
ab49dbf137
Notes:
sideshowbarker
2024-07-17 20:33:50 +09:00
Author: https://github.com/AtkinsSJ
Commit: ab49dbf137
Pull-request: https://github.com/SerenityOS/serenity/pull/16448
Reviewed-by: https://github.com/awesomekling ✅
39 changed files with 200 additions and 179 deletions
|
@ -102,7 +102,7 @@ unsigned HTMLImageElement::width() const
|
|||
|
||||
// Return the rendered width of the image, in CSS pixels, if the image is being rendered.
|
||||
if (auto* paint_box = this->paint_box())
|
||||
return paint_box->content_width();
|
||||
return paint_box->content_width().value();
|
||||
|
||||
// NOTE: This step seems to not be in the spec, but all browsers do it.
|
||||
auto width_attr = get_attribute(HTML::AttributeNames::width);
|
||||
|
@ -130,7 +130,7 @@ unsigned HTMLImageElement::height() const
|
|||
|
||||
// Return the rendered height of the image, in CSS pixels, if the image is being rendered.
|
||||
if (auto* paint_box = this->paint_box())
|
||||
return paint_box->content_height();
|
||||
return paint_box->content_height().value();
|
||||
|
||||
// NOTE: This step seems to not be in the spec, but all browsers do it.
|
||||
auto height_attr = get_attribute(HTML::AttributeNames::height);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue