1
0
Fork 0
firefox/testing/web-platform/tests/mathml/support/box-navigation.js
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02:00

29 lines
794 B
JavaScript

function IsInFlow(element) {
var style = window.getComputedStyle(element);
return style.getPropertyValue("display") !== "none" &&
style.getPropertyValue("position") !== "absolute" &&
style.getPropertyValue("position") !== "fixed";
}
function firstInFlowChild(element) {
var child = element.firstElementChild;
if (!child || IsInFlow(child))
return child;
return nextInFlowSibling(child);
}
function nextInFlowSibling(element) {
var child = element;
do {
child = child.nextElementSibling;
} while (child && !IsInFlow(child));
return child;
}
function previousInFlowSibling(element) {
var child = element;
do {
child = child.previousElementSibling;
} while (child && !IsInFlow(child));
return child;
}