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

Fix issue when requirejs/domReady could delay rendering of content #25527

Closed
Closed
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
3 changes: 2 additions & 1 deletion app/code/Magento/Backend/view/adminhtml/layout/default.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
<title>Magento Admin</title>
<meta name="viewport" content="width=1024"/>
<meta name="format-detection" content="telephone=no"/>
<link src="requirejs/require.js"/>
<script src="requirejs/require.js"/>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

There was mistake, it should be script, so I fixed it

<script src="requirejs/domReady.js"/>
<css src="extjs/resources/css/ext-all.css"/>
<css src="extjs/resources/css/ytheme-magento.css"/>
</head>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
<severity value="CRITICAL"/>
<testCaseId value="MC-14765"/>
<group value="mtf_migrated"/>
<skip>
<issueId value="MC-19868"/>
</skip>
</annotations>
<before>
<!-- Login as admin -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<remove src="css/styles-m.css"/>
<remove src="css/styles-s.css"/>
<remove src="requirejs/require.js"/>
<remove src="requirejs/domReady.js"/>
<remove src="mage/requirejs/mixins.js"/>
<remove src="requirejs-config.js"/>
</head>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<css src="mage/calendar.css"/>
<script src="requirejs/require.js"/>
<script src="requirejs/domReady.js"/>
<script src="mage/polyfill.js"/>
</head>
<body>
Expand Down
12 changes: 5 additions & 7 deletions lib/web/requirejs/domReady.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
self: false, setInterval: false */


define(function () {
define('domReady', function () {
'use strict';

var isTop, testDiv, scrollIntervalId,
Expand Down Expand Up @@ -84,12 +84,10 @@ define(function () {
//entering "interactive" or "complete". More details:
//http://dev.w3.org/html5/spec/the-end.html#the-end
//http://stackoverflow.com/questions/3665561/document-readystate-of-interactive-vs-ondomcontentloaded
//Hmm, this is more complicated on further use, see "firing too early"
//bug: https://github.com/requirejs/domReady/issues/1
//so removing the || document.readyState === "interactive" test.
//There is still a window.onload binding that should get fired if
//DOMContentLoaded is missed.
if (document.readyState === "complete") {
//Changes from https://github.com/requirejs/domReady/commit/a3e0dd8b6d3d3ee636ff0ca6a5a7c302d6ab33bf
//were reverted because IE9 isn't supported by Magento 2
if (document.readyState === "complete" ||
document.readyState === "interactive") {
pageLoaded();
}
}
Expand Down