Closed bicknellr closed 7 years ago
After cleaning, it looks like this causes a closure compiler warning about assignedSlot
never being defined on Node
. Maybe I should try to get Shadow DOM v1 stuff into closure first? :/
Sorry for not looking at this sooner!
You can patch around this locally by adding the following in externs.js
:
/**
* @constructor
* @extends {HTMLElement}
*/
function HTMLSlotElement() {}
/**
* @return {?HTMLSlotElement}
*/
HTMLElement.prototype.assignedSlot = function() {};
And you might want to make a PR on https://github.com/google/closure-compiler/blob/master/externs/browser/html5.js to add the same lines where appropriate.
(Meanwhile, https://github.com/GoogleChrome/accessibility-developer-tools/pull/327 updates us to use the google-released closure compiler which should stay more up to date)
Updated with your patch - no more closure errors!
Oh, I still need to check for the right node types...
No problem!
This PR updates
axs.dom.composedParentNode
to useassignedSlot
(new in Shadow DOM v1, link) if available and doesn't attempt to callgetDestinationInsertionPoints
(removed) if it isn't available.Some of the tests specifically check the behavior of content elements with a set
select
attribute; I changed these to use slots withname
attributes and addedslot
attributes to the relevant nodes outside the shadow tree to get the same 'distributed vs. not distributed' behavior. It might be worth renaming the tests since they're not about content elements anymore.(fixes #312)