Fix creating comments on Firefox ESF

Use the slot attribute instead of property - on browsers that do not have
native Shadow DOM support, the slot property does not exist and setting
it will be ignored.

Change-Id: Ifac4a48aba0847630990fef800e7f9d60f57c931
(cherry picked from commit 1f00b4ee4a)
This commit is contained in:
Ole Rehmsen
2019-06-05 16:13:32 +02:00
committed by David Pursehouse
parent e4ee65b679
commit dab1d7c115
2 changed files with 2 additions and 2 deletions

View File

@@ -601,7 +601,7 @@
_createThreadElement(thread) {
const threadEl = document.createElement('gr-comment-thread');
threadEl.className = 'comment-thread';
threadEl.slot = `${thread.commentSide}-${thread.lineNum}`;
threadEl.setAttribute('slot', `${thread.commentSide}-${thread.lineNum}`);
threadEl.comments = thread.comments;
threadEl.commentSide = thread.commentSide;
threadEl.isOnParent = !!thread.isOnParent;

View File

@@ -767,7 +767,7 @@
// that is okay because the first matching slot is used and the rest
// are ignored.
const slot = document.createElement('slot');
slot.name = threadEl.slot;
slot.name = threadEl.getAttribute('slot');
Polymer.dom(threadGroupEl).appendChild(Gerrit.slotToContent(slot));
}
});