Skip to content

Commit

Permalink
Use Date.now to avoid . class selector conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
jridgewell committed Jan 31, 2017
1 parent f05d61e commit 5d9a2af
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/dom.js
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ export function scopedQuerySelector(root, selector) {
}

// Only IE.
const unique = `i-amphtml-scoped-${Math.random()}`;
const unique = `i-amphtml-scoped-${Date.now()}`;
root.classList.add(unique);
const elements = root./*OK*/querySelector(`.${unique} ${selector}`);
root.classList.remove(unique);
Expand All @@ -418,7 +418,7 @@ export function scopedQuerySelectorAll(root, selector) {
}

// Only IE.
const unique = `i-amphtml-scoped-${Math.random()}`;
const unique = `i-amphtml-scoped-${Date.now()}`;
root.classList.add(unique);
const elements = toArray(root./*OK*/querySelectorAll(`.${unique} ${selector}`));
root.classList.remove(unique);
Expand Down

0 comments on commit 5d9a2af

Please sign in to comment.