box-navigation.js (794B)
1 function IsInFlow(element) { 2 var style = window.getComputedStyle(element); 3 return style.getPropertyValue("display") !== "none" && 4 style.getPropertyValue("position") !== "absolute" && 5 style.getPropertyValue("position") !== "fixed"; 6 } 7 8 function firstInFlowChild(element) { 9 var child = element.firstElementChild; 10 if (!child || IsInFlow(child)) 11 return child; 12 return nextInFlowSibling(child); 13 } 14 15 function nextInFlowSibling(element) { 16 var child = element; 17 do { 18 child = child.nextElementSibling; 19 } while (child && !IsInFlow(child)); 20 return child; 21 } 22 23 function previousInFlowSibling(element) { 24 var child = element; 25 do { 26 child = child.previousElementSibling; 27 } while (child && !IsInFlow(child)); 28 return child; 29 }