Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wait for the web-fonts to be load before calling checkLayout script. #22332

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,16 @@
<div id="item2"></div>
</div>
<script>
document.fonts.ready.then(() => {
item1.setAttribute("data-offset-y", "75");
item2.setAttribute("data-offset-y", "300");
checkLayout('#grid');
checkLayout('#grid', false);

grid.style.height = "300px";

item1.setAttribute("data-offset-y", "35");
item2.setAttribute("data-offset-y", "160");
checkLayout('#grid');

checkLayout('#grid', true);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: You don't need to pass "true" on the last call, but it's fine if you want to be explicit here. Feel free to keep it or remove it as you wish.

});
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,15 @@
<div id="item2"></div>
</div>
<script>
document.fonts.ready.then(() => {
item1.setAttribute("data-offset-y", "75");
item2.setAttribute("data-offset-y", "300");
checkLayout('#grid');
checkLayout('#grid', false);

item1.style.height = "100px";

item1.setAttribute("data-offset-y", "50");
item2.setAttribute("data-offset-y", "300");
checkLayout('#grid');
checkLayout('#grid', true);
});
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,15 @@
<div id="item2"></div>
</div>
<script>
document.fonts.ready.then(() => {
item1.setAttribute("data-offset-y", "75");
item2.setAttribute("data-offset-y", "300");
checkLayout('#grid');
checkLayout('#grid', false);

item1.style.height = "100px";

item1.setAttribute("data-offset-y", "50");
item2.setAttribute("data-offset-y", "300");
checkLayout('#grid');
checkLayout('#grid', true);
});
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,15 @@
<div id="item2"></div>
</div>
<script>
document.fonts.ready.then(() => {
item1.setAttribute("data-offset-y", "75");
item2.setAttribute("data-offset-y", "300");
checkLayout('#grid');
checkLayout('#grid', false);

grid.style.height = "300px";

item1.setAttribute("data-offset-y", "35");
item2.setAttribute("data-offset-y", "160");
checkLayout('#grid');
checkLayout('#grid', true);
});
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,15 @@
<div id="item2">XXXXX</div>
</div>
<script>
document.fonts.ready.then(() => {
item1.setAttribute("data-offset-y", "90");
item2.setAttribute("data-offset-y", "345");
checkLayout('#grid');
checkLayout('#grid', false);

item2.style.fontSize = "40px";

item1.setAttribute("data-offset-y", "90");
item2.setAttribute("data-offset-y", "330");
checkLayout('#grid');
checkLayout('#grid', true);
});
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,15 @@
<div id="item2">XXXXX</div>
</div>
<script>
document.fonts.ready.then(() => {
item1.setAttribute("data-offset-y", "95");
item2.setAttribute("data-offset-y", "345");
checkLayout('#grid');
checkLayout('#grid', false);

grid.style.fontSize = "40px";

item1.setAttribute("data-offset-y", "80");
item2.setAttribute("data-offset-y", "330");
checkLayout('#grid');
checkLayout('#grid', true);
});
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,15 @@
<div id="item2"></div>
</div>
<script>
document.fonts.ready.then(() => {
item1.setAttribute("data-offset-y", "75");
item2.setAttribute("data-offset-y", "300");
checkLayout('#grid');
checkLayout('#grid', false);

grid.style.height = "300px";

item1.setAttribute("data-offset-y", "35");
item2.setAttribute("data-offset-y", "160");
checkLayout('#grid');
checkLayout('#grid', true);
});
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,17 @@
<div id="item2"></div>
</div>
<script>
document.fonts.ready.then(() => {
item1.setAttribute("data-offset-x", "75");
item2.setAttribute("data-offset-x", "300");
checkLayout('#grid');
checkLayout('#grid', false);

grid.style.width = "300px";

item1.setAttribute("data-offset-x", "35");
item2.setAttribute("data-offset-x", "160");
checkLayout('#grid');
checkLayout('#grid', true);

done();
});
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,15 @@
<div id="item2"></div>
</div>
<script>
document.fonts.ready.then(() => {
item1.setAttribute("data-offset-x", "75");
item2.setAttribute("data-offset-x", "300");
checkLayout('#grid');
checkLayout('#grid', false);

item1.style.width = "100px";

item1.setAttribute("data-offset-x", "50");
item2.setAttribute("data-offset-x", "300");
checkLayout('#grid');
checkLayout('#grid', true);
});
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,15 @@
<div id="item2"></div>
</div>
<script>
document.fonts.ready.then(() => {
item1.setAttribute("data-offset-x", "75");
item2.setAttribute("data-offset-x", "300");
checkLayout('#grid');
checkLayout('#grid', false);

item1.style.width = "100px";

item1.setAttribute("data-offset-x", "50");
item2.setAttribute("data-offset-x", "300");
checkLayout('#grid');
checkLayout('#grid', true);
});
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,15 @@
<div id="item2"></div>
</div>
<script>
document.fonts.ready.then(() => {
item1.setAttribute("data-offset-x", "75");
item2.setAttribute("data-offset-x", "300");
checkLayout('#grid');
checkLayout('#grid', false);

grid.style.width = "300px";

item1.setAttribute("data-offset-x", "35");
item2.setAttribute("data-offset-x", "160");
checkLayout('#grid');
checkLayout('#grid', true);
});
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@

item1.setAttribute("data-offset-x", "50");
item2.setAttribute("data-offset-x", "275");
checkLayout('#grid', false);

done();
checkLayout('#grid', true);
});
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@

item1.setAttribute("data-offset-x", "50");
item2.setAttribute("data-offset-x", "325");
checkLayout('#grid', false);

done();
checkLayout('#grid', true);
});
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,15 @@
<div id="item2"></div>
</div>
<script>
document.fonts.ready.then(() => {
item1.setAttribute("data-offset-x", "75");
item2.setAttribute("data-offset-x", "300");
checkLayout('#grid');
checkLayout('#grid', false);

grid.style.width = "300px";

item1.setAttribute("data-offset-x", "35");
item2.setAttribute("data-offset-x", "160");
checkLayout('#grid');
checkLayout('#grid', true);
});
</script>