Skip to content
This repository has been archived by the owner on Jan 4, 2018. It is now read-only.

Polyfill slotting issue #111

Merged
merged 12 commits into from
Aug 9, 2016
Merged

Polyfill slotting issue #111

merged 12 commits into from
Aug 9, 2016

Conversation

jpnelson
Copy link
Contributor

@jpnelson jpnelson commented Aug 8, 2016

worked on this with @lukebatchelor

…hanging

this test passes in Chrome Canary v54
part of this was to make the slot name change unregister / reregister. Another part was to make the
slotNodeFromSlot function work under a closed shadow root, as assignedSlot would return null in this
case. We still need to fix the function to work with setAttribute
@@ -168,7 +168,7 @@ function slotNodeIntoSlot(slot, node, insertBefore) {
}

function slotNodeFromSlot(node) {
const slot = node.assignedSlot;
const slot = nodeToSlotMap.get(node);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To make sure we can use get the slot when in closed mode

const slotHasRoot = root;

if (slotHasRoot) {
removeSlotFromRoot(root, this);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks weird. Why are you doing this?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's because the previous DOM nodes must be unassigned. There might be a better way to do this, like unassignNodesFromSlot(). I'm thinking this might be able to be used elsewhere, too.

That said, I'd get this working and tests green before trying to refactor that now.

@lukebatchelor
Copy link
Contributor

lGtm

The capital G is for "GREAT". Also, to test the case sensitivity of gh

@jpnelson
Copy link
Contributor Author

jpnelson commented Aug 9, 2016

lgtm

1 similar comment
@treshugart
Copy link
Member

lgtm

@@ -54,7 +54,7 @@ describe('slot/distribution', () => {
expect(frag.childNodes.length).to.equal(0);
});

describe('changing slot name with three children', () => {
describe('changing slot name with more than two', () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

more than two what? :D

@adevnadia
Copy link
Contributor

adevnadia commented Aug 9, 2016

no lgtm from me until you fix airbnb linting ;p
we really need to include linting into commit...

@jpnelson
Copy link
Contributor Author

jpnelson commented Aug 9, 2016

lgtm

@jpnelson jpnelson merged commit 318c925 into master Aug 9, 2016
@jpnelson jpnelson deleted the polyfill-slotting-issue branch August 9, 2016 07:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants