Merge branch 'master' into improvement/add-linter

This commit is contained in:
daviskoh
2015-02-05 19:51:45 -05:00

View File

@@ -44,17 +44,23 @@ var layoutTestUtils = (function() {
};
}
function renderIframe() {
var iframe = document.createElement('iframe');
document.body.appendChild(iframe);
return iframe;
}
var cachedIframe;
function getIframe() {
if (cachedIframe) {
return cachedIframe;
}
var iframe = document.createElement('iframe');
document.body.appendChild(iframe);
var doc = iframe.contentDocument;
if(doc.readyState === 'complete') {
var style = document.createElement('style');
style.innerText = (function() {/*
style.textContent = (function() {/*
body, div {
box-sizing: border-box;
border: 0 solid black;
@@ -83,8 +89,15 @@ var layoutTestUtils = (function() {
doc.head.appendChild(style);
cachedIframe = iframe;
return iframe;
} else {
setTimeout(getIframe, 0);
}
}
if (typeof window !== 'undefined') {
var iframe = renderIframe();
getIframe();
}
if (typeof computeLayout === 'function') {
var realComputeLayout = computeLayout;