Skip to content

Commit

Permalink
Linting
Browse files Browse the repository at this point in the history
  • Loading branch information
jridgewell committed Jan 31, 2017
1 parent 00fd0ed commit dcf0a09
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 9 deletions.
3 changes: 1 addition & 2 deletions ads/google/a4a/test/test-performance.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import {
GoogleAdLifecycleReporter,
BaseLifecycleReporter,
} from '../performance';
import {childElements} from '../../../../src/dom';
import {createIframePromise} from '../../../../testing/iframe';
import {viewerForDoc} from '../../../../src/viewer';
import * as sinon from 'sinon';
Expand All @@ -43,7 +42,7 @@ function expectMatchesAll(address, matchList) {
* @param {!Array<!RegExp>} matchList
*/
function expectHasSiblingImgMatchingAll(element, matchList) {
const imgSiblings = scopedQuerySelectorAll(element.parentElement, 'img');
const imgSiblings = element.parentElement.querySelectorAll('img');
expect(imgSiblings).to.not.be.empty;
const result = imgSiblings.some(e => {
const src = e.getAttribute('src');
Expand Down
1 change: 0 additions & 1 deletion extensions/amp-ad/0.1/test/test-amp-ad.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import {createIframePromise} from '../../../../testing/iframe';
import {a4aRegistry} from '../../../../ads/_a4a-config';
import {AmpAd} from '../amp-ad';
import {AmpAd3PImpl} from '../amp-ad-3p-impl';
import {childElement} from '../../../../src/dom';
import {extensionsFor} from '../../../../src/extensions';
import {stubService} from '../../../../testing/test-helper';
import * as sinon from 'sinon';
Expand Down
2 changes: 1 addition & 1 deletion extensions/amp-analytics/0.1/analytics-root.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import {
closestBySelector,
matches,
scopedQuerySelector
scopedQuerySelector,
} from '../../../src/dom';
import {dev, user} from '../../../src/log';
import {map} from '../../../src/utils/object';
Expand Down
2 changes: 1 addition & 1 deletion extensions/amp-analytics/0.1/visibility-impl.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import {
closestByTag,
closestBySelector,
scopedQuerySelector
scopedQuerySelector,
} from '../../../src/dom';
import {dev, user} from '../../../src/log';
import {resourcesForDoc} from '../../../src/resources';
Expand Down
4 changes: 2 additions & 2 deletions src/dom.js
Original file line number Diff line number Diff line change
Expand Up @@ -456,9 +456,9 @@ export function scopedQuerySelectorAll(root, selector) {
// Only IE.
const unique = `i-amphtml-scoped-${Date.now()}`;
root.classList.add(unique);
const elements = toArray(root./*OK*/querySelectorAll(`.${unique} ${selector}`));
const elements = root./*OK*/querySelectorAll(`.${unique} ${selector}`);
root.classList.remove(unique);
return elements;
return toArray(elements);
}


Expand Down
5 changes: 3 additions & 2 deletions test/functional/test-dom.js
Original file line number Diff line number Diff line change
Expand Up @@ -437,9 +437,10 @@ describe('DOM', () => {
[element1, element2]);
}

it('scopedQuerySelectorAll should find first match', testScopedQuerySelectorAll);
it('scopedQuerySelectorAll should find all matches',
testScopedQuerySelectorAll);

it('scopedQuerySelectorAll should find first match (polyfill)', () => {
it('scopedQuerySelectorAll should find all matches (polyfill)', () => {
dom.setScopeSelectorSupportedForTesting(false);
testScopedQuerySelectorAll();
});
Expand Down

0 comments on commit dcf0a09

Please sign in to comment.