Skip to content

Commit 2bf9580

Browse files
Treat SVG documents in <object>/<embed> as replaced elements
SVG documents loaded inside <object> or <embed> elements were being treated as regular iframe content rather than as replaced elements. As a result, CSS properties like object-fit and object-position were being ignored. This CL modifies LayoutEmbeddedContent::ReplacedContentRectFrom() to detect SVG documents and apply the replaced element logic of their base class, making SVG content behave like images. The test external/wpt/fullscreen/rendering/backdrop-object.html started failing as a result of this CL, because the default value of object-position is not what the reference assumed. Since this functionality is outside the focus of that test, the solution was to explicitly align object-position with the expectations of the reference. Bug: 40747033, 41302806 Change-Id: I8681636a18232127df67e899e6fc1070864f68cd Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6821135 Reviewed-by: Koji Ishii <[email protected]> Reviewed-by: Kent Tamura <[email protected]> Commit-Queue: Felipe Erias <[email protected]> Cr-Commit-Position: refs/heads/main@{#1498641}
1 parent 3b35e97 commit 2bf9580

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

fullscreen/rendering/backdrop-object.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
object::backdrop {
1111
background: blue;
1212
}
13+
object {
14+
object-position: 0 0;
15+
}
1316
</style>
1417
<object width="200" type="image/svg+xml"></object>
1518

0 commit comments

Comments
 (0)