Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function enterDocumentRouteElement(path) {
dom.enterDocument('');
return document.querySelector('link[href="' + path + '"]');
}
beforeEach(function() {
element = document.createElement('div');
dom.enterDocument(element);
});
function enterDocumentSurfaceElement(surfaceId, opt_content) {
dom.enterDocument('<div id="' + surfaceId + '">' + (opt_content ? opt_content : '') + '</div>');
return document.getElementById(surfaceId);
}
function enterDocumentRouteElementMissingScreenType(path) {
dom.enterDocument('');
return document.querySelector('link[href="' + path + '"]');
}
beforeEach(function() {
dom.enterDocument('<div style="position:absolute;height: 25px;width:25px;" id="element"></div>');
dom.enterDocument('<div style="position:absolute;top:100px;left:100px;width:50px;height:50px;" id="center"></div>');
dom.enterDocument('<div style="position:absolute;width:50px;height:50px;" id="mutable"></div>');
dom.enterDocument('<div style="position:absolute;width:500px;height:500px;top:100px;left:100px;"></div>');
element = dom.toElement('#element');
mutable = dom.toElement('#mutable');
center = dom.toElement('#center');
offsetParent = dom.toElement('#offsetParent');
mutable.style.top = '100px';
mutable.style.left = '100px';
mutable.style.bottom = '';
mutable.style.right = '';
});
beforeEach(function() {
dom.enterDocument('<div style="position:absolute;height: 25px;width:25px;" id="element"></div>');
dom.enterDocument('<div style="position:absolute;top:100px;left:100px;width:50px;height:50px;" id="center"></div>');
dom.enterDocument('<div style="position:absolute;width:50px;height:50px;" id="mutable"></div>');
dom.enterDocument('<div style="position:absolute;width:500px;height:500px;top:100px;left:100px;"></div>');
element = dom.toElement('#element');
mutable = dom.toElement('#mutable');
center = dom.toElement('#center');
offsetParent = dom.toElement('#offsetParent');
mutable.style.top = '100px';
mutable.style.left = '100px';
mutable.style.bottom = '';
mutable.style.right = '';
});
function enterDocumentSurfaceElement(surfaceId, opt_content) {
dom.enterDocument('<div id="' + surfaceId + '">' + (opt_content ? opt_content : '') + '</div>');
return document.getElementById(surfaceId);
}
getPortalElement_(portalElementSelector) {
let portalElement = toElement(portalElementSelector);
if (portalElement) {
return portalElement;
}
if (
portalElementSelector.indexOf('#') === 0 &&
portalElementSelector.indexOf(' ') === -1
) {
portalElement = document.createElement('div');
portalElement.setAttribute('id', portalElementSelector.slice(1));
enterDocument(portalElement);
}
return portalElement;
}