Visual iframe drops source size attributes when its rules only position it

Open Beginner friendly
#4,921 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
75/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
php
Domain
backend

Research direction

Start by reading VisualIframeBlockGenerator::sourceOwnsIframeGeometry() and find the tests for visual iframe generation. Check how a positioned iframe with source width and height attributes is handled, then run the relevant tests. Done means the saved iframe retains both size attributes when its author rule only positions it.

Written by the indexing model from the issue text.

Description

Problem

A visual iframe whose only author rule positions it, e.g. .frame{position:absolute}, loses its source width/height attributes and renders at the browser default of 300×150.

VisualIframeBlockGenerator::sourceOwnsIframeGeometry() counts position as source-owned geometry, and source-owned geometry drops the size attributes. Positioning does not size the frame, though. In the source, the attributes are what size it.

Repro

<style>.pinned{position:absolute}</style>
<main><div class="slot"><iframe class="pinned" src="https://forms.example.test/share" title="Signup" width="398" height="497"></iframe></div></main>

Expected: the saved iframe keeps width="398" height="497". Actual: neither attribute is emitted.

Real-world case

On a Wix page (/pipinbloom), a MailerLite signup embed (.xxJnkq{position:absolute}, width="398" height="497") renders as a 300×150 window that cuts off everything below the heading.

Dominant language
PHP
Stars
25
Forks
3
Avg merge
2h 23m
Merged PRs (30d)
942

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Automattic/blocks-engine

All issues in Automattic/blocks-engine

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.