summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/HTML
diff options
context:
space:
mode:
authorSam Atkins <atkinssj@serenityos.org>2022-10-31 19:46:55 +0000
committerLinus Groh <mail@linusgroh.de>2022-12-14 16:47:57 +0000
commitab49dbf1374e436f19f2f8b4c3f193bbb67809d4 (patch)
tree16994b73b0b6e17926be2169a21b81819bc0a696 /Userland/Libraries/LibWeb/HTML
parent57a69f15ffa43bf2bbc76a98da2890090323a7c6 (diff)
downloadserenity-ab49dbf1374e436f19f2f8b4c3f193bbb67809d4.zip
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.
Diffstat (limited to 'Userland/Libraries/LibWeb/HTML')
-rw-r--r--Userland/Libraries/LibWeb/HTML/HTMLElement.cpp4
-rw-r--r--Userland/Libraries/LibWeb/HTML/HTMLImageElement.cpp4
2 files changed, 4 insertions, 4 deletions
diff --git a/Userland/Libraries/LibWeb/HTML/HTMLElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLElement.cpp
index cd281a7ea3..30df1d0256 100644
--- a/Userland/Libraries/LibWeb/HTML/HTMLElement.cpp
+++ b/Userland/Libraries/LibWeb/HTML/HTMLElement.cpp
@@ -199,7 +199,7 @@ int HTMLElement::offset_width() const
// 2. Return the width of the axis-aligned bounding box of the border boxes of all fragments generated by the element’s principal box,
// ignoring any transforms that apply to the element and its ancestors.
// FIXME: Account for inline boxes.
- return paint_box()->border_box_width();
+ return paint_box()->border_box_width().value();
}
// https://drafts.csswg.org/cssom-view/#dom-htmlelement-offsetheight
@@ -215,7 +215,7 @@ int HTMLElement::offset_height() const
// 2. Return the height of the axis-aligned bounding box of the border boxes of all fragments generated by the element’s principal box,
// ignoring any transforms that apply to the element and its ancestors.
// FIXME: Account for inline boxes.
- return paint_box()->border_box_height();
+ return paint_box()->border_box_height().value();
}
// https://html.spec.whatwg.org/multipage/links.html#cannot-navigate
diff --git a/Userland/Libraries/LibWeb/HTML/HTMLImageElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLImageElement.cpp
index 129a0a123a..a74bc35d4f 100644
--- a/Userland/Libraries/LibWeb/HTML/HTMLImageElement.cpp
+++ b/Userland/Libraries/LibWeb/HTML/HTMLImageElement.cpp
@@ -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);