Commit a220c265 authored by philipj@opera.com's avatar philipj@opera.com
parent fcc76ba6
<!DOCTYPE html>
<title>Element ready check for containing iframe</title>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="../trusted-event.js"></script>
<div id="log"></div>
<iframe allowfullscreen></iframe>
<iframe allowfullscreen></iframe>
<script>
async_test(function(t)
{
var iframes = document.getElementsByTagName("iframe");
trusted_request(iframes[0].contentDocument.body, document.body);
iframes[0].contentDocument.onfullscreenchange = t.step_func(function()
{
trusted_request(iframes[1].contentDocument.body, iframes[0].contentDocument.body);
iframes[1].contentDocument.onfullscreenchange = t.unreached_func("fullscreenchange event");
iframes[1].contentDocument.onfullscreenerror = t.step_func_done();
});
});
</script>
......@@ -185,9 +185,9 @@ bool Fullscreen::elementReady(Element& element, RequestType requestType)
}
// |element|'s node document's fullscreen element stack is either empty or its top element is an
// ancestor of |element|.
// inclusive ancestor of |element|.
if (Element* topElement = fullscreenElementFrom(element.document())) {
if (!element.isDescendantOf(topElement))
if (!topElement->contains(&element))
return false;
}
......@@ -196,6 +196,14 @@ bool Fullscreen::elementReady(Element& element, RequestType requestType)
if (Traversal<HTMLIFrameElement>::firstAncestor(element))
return false;
// |element|'s node document's browsing context either has a browsing context container and the
// fullscreen element ready check returns true for |element|'s node document's browsing
// context's browsing context container, or it has no browsing context container.
if (HTMLFrameOwnerElement* container = element.document().ownerElement()) {
if (!elementReady(*container, requestType))
return false;
}
return true;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment