Skip to content

Commit

Permalink
WIP(maintain/disabled): adding content document resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
rodneyrehm committed Jan 12, 2016
1 parent a357c36 commit 53a4f36
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 6 additions & 1 deletion docs/api/maintain/disabled.md
@@ -1,6 +1,6 @@
---
layout: doc-api.html
tags: shadow-dom, service, argument-options
tags: shadow-dom, service, argument-options, content-document
---

# ally.maintain.disabled
Expand Down Expand Up @@ -49,6 +49,11 @@ A [`<service>`](../concepts.md#Service) interface, providing the `handle.disenga
* **EXAMPLE:** [`ally.maintain.disabled` Example](./disabled.example.html)


## Changes

* Since `v#master` `options.context` resolves to the content document for `<iframe>` and `<object>` elements.


## Notes

* **NOTE:** `ShadowHost`s are pierced and `ShadowRoot` content is made inert as well (except for closed shadow trees).
Expand Down
2 changes: 2 additions & 0 deletions src/maintain/disabled.js
Expand Up @@ -18,6 +18,7 @@
import nodeArray from '../util/node-array';
import queryFocusable from '../query/focusable';
import elementDisabled from '../element/disabled';
import getContentDocument from '../util/get-content-document';
import {getParentComparator} from '../util/compare-position';

function makeElementInert(element) {
Expand All @@ -38,6 +39,7 @@ const observerConfig = {
class InertSubtree {
constructor({context, filter} = {}) {
this._context = nodeArray(context || document.documentElement)[0];
this._context = getContentDocument(this._context) || this._context;
this._filter = nodeArray(filter);

this.disengage = this.disengage.bind(this);
Expand Down

0 comments on commit 53a4f36

Please sign in to comment.