mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 19:27:45 +00:00
LibWeb: Support adding a border-radius to <iframe> elements
This commit is contained in:
parent
3600c34c1d
commit
b179d514d9
1 changed files with 5 additions and 1 deletions
|
@ -8,6 +8,7 @@
|
||||||
#include <LibWeb/HTML/BrowsingContextContainer.h>
|
#include <LibWeb/HTML/BrowsingContextContainer.h>
|
||||||
#include <LibWeb/Layout/FrameBox.h>
|
#include <LibWeb/Layout/FrameBox.h>
|
||||||
#include <LibWeb/Layout/InitialContainingBlock.h>
|
#include <LibWeb/Layout/InitialContainingBlock.h>
|
||||||
|
#include <LibWeb/Painting/BorderRadiusCornerClipper.h>
|
||||||
#include <LibWeb/Painting/NestedBrowsingContextPaintable.h>
|
#include <LibWeb/Painting/NestedBrowsingContextPaintable.h>
|
||||||
|
|
||||||
namespace Web::Painting {
|
namespace Web::Painting {
|
||||||
|
@ -32,6 +33,9 @@ void NestedBrowsingContextPaintable::paint(PaintContext& context, PaintPhase pha
|
||||||
PaintableBox::paint(context, phase);
|
PaintableBox::paint(context, phase);
|
||||||
|
|
||||||
if (phase == PaintPhase::Foreground) {
|
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();
|
auto* hosted_document = layout_box().dom_node().content_document_without_origin_check();
|
||||||
if (!hosted_document)
|
if (!hosted_document)
|
||||||
return;
|
return;
|
||||||
|
@ -42,7 +46,7 @@ void NestedBrowsingContextPaintable::paint(PaintContext& context, PaintPhase pha
|
||||||
context.painter().save();
|
context.painter().save();
|
||||||
auto old_viewport_rect = context.viewport_rect();
|
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.painter().translate(absolute_x(), absolute_y());
|
||||||
|
|
||||||
context.set_viewport_rect({ {}, layout_box().dom_node().nested_browsing_context()->size() });
|
context.set_viewport_rect({ {}, layout_box().dom_node().nested_browsing_context()->size() });
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue