Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Properly detect attachment of Shadow DOM elements #3504

Closed
gibson042 opened this Issue Jan 16, 2017 · 2 comments

Comments

Projects
None yet
2 participants
@gibson042
Copy link
Member

commented Jan 16, 2017

There are a few places where we check document attachment with jQuery.contains( elem.ownerDocument, elem ) (isHiddenWithinTree for show/hide, curCSS for inline style fallback, buildFragment/domManip/remove/jQuery.clone for managing script evaluation during DOM manipulation), all of which fail inside Shadow DOM:

$.contains(document, elem) will return false when elem is shown in a shadow dom.
change to elem.getRootNode({composed: true}) === elem.ownerDocument works.

We should investigate the cost of a remedy (e.g., a Shadow-DOM-compatible isAttached( elem ) function).

@timmywil

This comment has been minimized.

Copy link
Member

commented Feb 6, 2017

Yes to going forward and investigating, but we may scrap it later depending on how involved this gets.

@timmywil timmywil removed the Needs review label Feb 6, 2017

@gibson042

This comment has been minimized.

Copy link
Member Author

commented Feb 6, 2017

As noted in the meeting, we'd probably benefit from an internal isAttached even if it doesn't handle shadow DOM, because it better communicates intent.

@timmywil timmywil added this to the 3.2.0 milestone Feb 13, 2017

@timmywil timmywil modified the milestones: 3.3.0, 3.2.0 Mar 6, 2017

@timmywil timmywil modified the milestones: 3.3.0, 3.4.0 Nov 13, 2017

SaptakS added a commit to SaptakS/jquery that referenced this issue Feb 14, 2018

Core: Use isAttached to check for attachment of element
This change replaces the use of contains to check for attachment
by isAttached function

Ref jquerygh-3504

SaptakS added a commit to SaptakS/jquery that referenced this issue Feb 14, 2018

Core: Use isAttached to check for attachment of element
This change replaces the use of contains to check for attachment
by isAttached function

Ref jquerygh-3504

SaptakS added a commit to SaptakS/jquery that referenced this issue Feb 14, 2018

Core: Use isAttached to check for attachment of element
This change replaces the use of contains to check for attachment
by isAttached function

Ref jquerygh-3504

SaptakS added a commit to SaptakS/jquery that referenced this issue Feb 15, 2018

Core: Use isAttached to check for attachment of element
This change replaces the use of contains to check for attachment
by isAttached function

Ref jquerygh-3504

SaptakS added a commit to SaptakS/jquery that referenced this issue Feb 16, 2018

Core: Use isAttached to check for attachment of element
This change replaces the use of contains to check for attachment
by isAttached function

Ref jquerygh-3504

SaptakS added a commit to SaptakS/jquery that referenced this issue Feb 16, 2018

Core: Use isAttached to check for attachment of element
This change replaces the use of contains to check for attachment
by isAttached function

Ref jquerygh-3504

SaptakS added a commit to SaptakS/jquery that referenced this issue Feb 28, 2018

Core: Use isAttached to check for attachment of element
This change replaces the use of contains to check for attachment
by isAttached function

Ref jquerygh-3504

SaptakS added a commit to SaptakS/jquery that referenced this issue Mar 2, 2018

Core: Use isAttached to check for attachment of element
This change replaces the use of contains to check for attachment
by isAttached function

Ref jquerygh-3504

@SaptakS SaptakS referenced this issue Mar 2, 2018

Merged

Add Shadow DOM feature to isAttached #3996

2 of 3 tasks complete

SaptakS added a commit to SaptakS/jquery that referenced this issue Mar 2, 2018

Core: Use isAttached to check for attachment of element
This change replaces the use of contains to check for attachment
by isAttached function

Ref jquerygh-3504

mgol added a commit that referenced this issue Mar 5, 2018

Core: Use isAttached to check for attachment of element
This change replaces the use of contains to check for attachment
by isAttached function

Closes gh-3977
Ref gh-3504

SaptakS added a commit to SaptakS/jquery that referenced this issue Mar 5, 2018

Core: Allow shadow DOM in attachment check
Allow isAttached to check shadow DOM for attachment. This change allows
isAttached() function to address shadowDOM elements even if the browser doesn't support getRootNode()

Ref jquerygh-3504, jquerygh-3977

SaptakS added a commit to SaptakS/jquery that referenced this issue Mar 26, 2018

Core: Allow shadow DOM in attachment check
Allow isAttached to check shadow DOM for attachment. This change allows
isAttached() function to address shadowDOM elements even if the browser doesn't support getRootNode()

Ref jquerygh-3504, jquerygh-3977

SaptakS added a commit to SaptakS/jquery that referenced this issue Apr 12, 2018

Core: Allow shadow DOM in attachment check
Allow isAttached to check shadow DOM for attachment. This change allows
isAttached() function to address shadowDOM elements even if the browser doesn't support getRootNode()

Ref jquerygh-3504, jquerygh-3977

SaptakS added a commit to SaptakS/jquery that referenced this issue Apr 13, 2018

Core: Allow shadow DOM in attachment check
Allow isAttached to check shadow DOM for attachment. This change allows
isAttached() function to address shadowDOM elements even if the browser doesn't support getRootNode()

Ref jquerygh-3504, jquerygh-3977

SaptakS added a commit to SaptakS/jquery that referenced this issue Apr 13, 2018

Core: Allow shadow DOM in attachment check
Allow isAttached to check shadow DOM for attachment. This change allows
isAttached() function to address shadowDOM elements even if the browser doesn't support getRootNode()

Ref jquerygh-3504, jquerygh-3977

SaptakS added a commit to SaptakS/jquery that referenced this issue Sep 24, 2018

Core: Allow shadow DOM in attachment check
Allow isAttached to check shadow DOM for attachment. This change allows
isAttached() function to address shadowDOM elements even if the browser doesn't support getRootNode()

Ref jquerygh-3504, jquerygh-3977

@mgol mgol closed this in 9b77def Nov 9, 2018

@GulajavaMinistudio GulajavaMinistudio referenced this issue Nov 9, 2018

Merged

Unable to install #64

0 of 4 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.