Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upHTMLElement::GetOffsetParent should correctly check if root element #10521
Comments
|
Ideally there'd be a regression test for this, but I don't know how difficult that would be to write. |
|
Like this, I assume. <!doctype html>
<div id=cont style="position:relative"></div>
<script>
var h = document.createElement("html");
var cont = document.getElementById("cont");
cont.appendChild(h);
assertEqual(h.offsetParent, cont);
cont.innerHTML = "PASS";
function assertEqual(a, b) {
if (a !== b) {
cont.innerHTML = "FAIL";
throw new Exception("FAIL");
}
}
</script> |
|
This is still not done. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Spec link
Relevant code
Currently, we just check if the
HTMLElementbeing called on is anHTMLHtmlElement. This is insufficient as an<html>can (incorrectly) appear anywhere in the tree and is not necessarily the root element. We should instead callElement::root_elementand compare that value.