UNPKG

siesta-lite

Version:

Stress-free JavaScript unit testing and functional testing tool, works in NodeJS and browsers

77 lines (60 loc) 2.63 kB
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>The source code</title> <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" /> <script type="text/javascript" src="../resources/prettify/prettify.js"></script> <style type="text/css"> .highlight { display: block; background-color: #ddd; } </style> <script type="text/javascript"> function highlight() { document.getElementById(location.hash.replace(/#/, "")).className = "highlight"; } </script> </head> <body onload="prettyPrint(); highlight();"> <pre class="prettyprint lang-js">/* Siesta 5.6.1 Copyright(c) 2009-2022 Bryntum AB https://bryntum.com/contact https://bryntum.com/products/siesta/license */ Class(&#39;Ariadne.DomQueryFinder.Identifier.Id&#39;, { isa : Ariadne.QueryFinder.Identifier, does : Ariadne.DomQueryFinder.Role.DomHelper, has : { uniqueDomNodeProperty : null, shouldIgnoreDomElementId : null }, methods : { identify : function (target, root, maze) { var idProperty = this.uniqueDomNodeProperty || &#39;id&#39; var id = target.getAttribute(idProperty) var shouldIgnoreDomElementId = this.shouldIgnoreDomElementId if (id &amp;&amp; !this.ignoreDomId(id, target) &amp;&amp; (!shouldIgnoreDomElementId || !shouldIgnoreDomElementId(id, target))) { // the 1st encountered id will be assigned with weight -100000 in case of `enableMandatoryId` // it should be guaranteed that this id will belong to lowest parent with id (currently this holds) var weight = maze.encounteredMandatoryId || !this.finder.enableMandatoryId ? 1000 : -100000 maze.encounteredMandatoryId = true var query = idProperty == &#39;id&#39; ? &#39;#&#39; + this.escapeDomSelector(id, true) : &quot;[&quot; + idProperty + &quot;=&#39;&quot; + this.escapeDomSelector(id) + &quot;&#39;]&quot; return { query : query, weight : weight, isId : true } } else return null }, ignoreDomId : function () { return false } } }); </pre> </body> </html>