Source code

Revision control

Other Tools

Test Info:

<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Test: shape-outside with a CORS violation</title>
<link rel="author" title="Brad Werth" href=""/>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" href="/tests/SimpleTest/test.css"/>
.container {
clear: both;
width: 500px;
.shaper {
width: 50px;
height: 50px;
float: left;
background-color: green;
.shapeAllow {
shape-outside: url("support/1x1-transparent.png");
.shapeRefuse {
.sibling {
display: inline-block;
function runTests() {
let divAllow = document.getElementById("allow");
let divAllowSib = divAllow.nextElementSibling;
ok(divAllowSib.getBoundingClientRect().left == divAllow.getBoundingClientRect().left,
"Test 1: Sibling should be at same left offset as div (shape-outside should be allowed), and onload should only fire after layout is complete.");
let divRefuse = document.getElementById("refuse");
let divRefuseSib = divRefuse.nextElementSibling;
ok(divRefuseSib.getBoundingClientRect().left != divRefuse.getBoundingClientRect().left,
"Test 2: Sibling should be at different left offset from div (shape-outside should be refused).");
<body onload="runTests()">
<div class="container">
<div id="allow" class="shaper shapeAllow"></div><div class="sibling">allow (image is blank, so text is flush left)</div>
<div class="container">
<div id="refuse" class="shaper shapeRefuse"></div><div class="sibling">refuse (image unread, so text is moved to box edge)</div>