summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/Painting
diff options
context:
space:
mode:
authorMacDue <macdue@dueutil.tech>2022-07-04 21:09:13 +0100
committerAndreas Kling <kling@serenityos.org>2022-07-04 23:09:06 +0200
commitb179d514d9d880f27716cc74d4e8a05a17e32f66 (patch)
tree05ff0a94ac7002b96edf679dd8154dac39ab8102 /Userland/Libraries/LibWeb/Painting
parent3600c34c1dbd11cb61f0e09f96195b7464370fa4 (diff)
downloadserenity-b179d514d9d880f27716cc74d4e8a05a17e32f66.zip
LibWeb: Support adding a border-radius to <iframe> elements
Diffstat (limited to 'Userland/Libraries/LibWeb/Painting')
-rw-r--r--Userland/Libraries/LibWeb/Painting/NestedBrowsingContextPaintable.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/Userland/Libraries/LibWeb/Painting/NestedBrowsingContextPaintable.cpp b/Userland/Libraries/LibWeb/Painting/NestedBrowsingContextPaintable.cpp
index f5217887cf..0c18019e13 100644
--- a/Userland/Libraries/LibWeb/Painting/NestedBrowsingContextPaintable.cpp
+++ b/Userland/Libraries/LibWeb/Painting/NestedBrowsingContextPaintable.cpp
@@ -8,6 +8,7 @@
#include <LibWeb/HTML/BrowsingContextContainer.h>
#include <LibWeb/Layout/FrameBox.h>
#include <LibWeb/Layout/InitialContainingBlock.h>
+#include <LibWeb/Painting/BorderRadiusCornerClipper.h>
#include <LibWeb/Painting/NestedBrowsingContextPaintable.h>
namespace Web::Painting {
@@ -32,6 +33,9 @@ void NestedBrowsingContextPaintable::paint(PaintContext& context, PaintPhase pha
PaintableBox::paint(context, phase);
if (phase == PaintPhase::Foreground) {
+ auto clip_rect = absolute_rect().to_rounded<int>();
+ ScopedCornerRadiusClip corner_clip { context.painter(), clip_rect, normalized_border_radii_data() };
+
auto* hosted_document = layout_box().dom_node().content_document_without_origin_check();
if (!hosted_document)
return;
@@ -42,7 +46,7 @@ void NestedBrowsingContextPaintable::paint(PaintContext& context, PaintPhase pha
context.painter().save();
auto old_viewport_rect = context.viewport_rect();
- context.painter().add_clip_rect(enclosing_int_rect(absolute_rect()));
+ context.painter().add_clip_rect(clip_rect);
context.painter().translate(absolute_x(), absolute_y());
context.set_viewport_rect({ {}, layout_box().dom_node().nested_browsing_context()->size() });