Bug 1359054 - Take shadow DOM into account when getting paint tree; r=maja_zf

We want to take shadow DOM into account when getting an element's
pointer-interactable paint tree.

Marionette is currently unable to determine if an element inside a shadow
DOM host is disconnected from the document because we are constructing
the frame container with only the main document.

MozReview-Commit-ID: IPDi8fQZYRP

--HG--
extra : rebase_source : 8c6757a032342aa6bbe50ef15025a37ac09ae413
This commit is contained in:
Andreas Tolfsen 2017-04-17 17:51:13 +01:00
Родитель aeb36a2713
Коммит e14f20eea7
1 изменённых файлов: 9 добавлений и 1 удалений

Просмотреть файл

@ -995,9 +995,17 @@ element.getInViewCentrePoint = function (rect, win) {
element.getPointerInteractablePaintTree = function (el) {
const doc = el.ownerDocument;
const win = doc.defaultView;
const container = {frame: win};
const rootNode = el.getRootNode();
// Include shadow DOM host only if the element's root node is not the
// owner document.
if (rootNode !== doc) {
container.shadowRoot = rootNode;
}
// pointer-interactable elements tree, step 1
if (element.isDisconnected(el, {frame: win})) {
if (element.isDisconnected(el, container)) {
return [];
}