Bug Tracker

Opened 9 years ago

Closed 8 years ago

#15201 closed bug (migrated)

.offset() thinks all elements in the ShadowDom are disconnected, and thus as 0,0

Reported by: rictic Owned by:
Priority: low Milestone: None
Component: offset Version: 2.1.1
Keywords: Cc:
Blocked by: Blocking:


JSBin link to reproduce: http://jsbin.com/tamugo/2/edit (try in Chrome (or Firefox with dom.webcomponents.enabled turned on))

An element that is in the shadow dom appears in some ways to not be contained in the document. .offset() assumes that if the element isn't contained in the document then it's disconnected and returns an offset of {top: 0, left: 0}.

When .offset() checks to see if the element is disconnected it could try walking up the DOM not only by checking .parentNode as .contains() does but also by looking at .host, which is how one travels up from a shadow root into its containing element.

Change History (2)

comment:1 Changed 9 years ago by dmethvin

Component: unfiledoffset
Priority: undecidedlow
Status: newopen

comment:2 Changed 8 years ago by m_gol

Resolution: migrated
Status: openclosed
Note: See TracTickets for help on using tickets.