Skip to content

Commit

Permalink
Fix lint.
Browse files Browse the repository at this point in the history
  • Loading branch information
William Chou committed May 21, 2021
1 parent a608ede commit b15c843
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions extensions/amp-list/0.1/amp-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ import {dict, getValueForExpr} from '../../../src/core/types/object';
import {getMode} from '../../../src/mode';
import {getSourceOrigin, isAmpScriptUri} from '../../../src/url';

import {escapeCssSelectorIdent} from '../../../src/core/dom/css';
import {isAmp4Email} from '../../../src/format';
import {isArray, toArray} from '../../../src/core/types/array';
import {isExperimentOn} from '../../../src/experiments';
Expand Down Expand Up @@ -322,12 +323,12 @@ export class AmpList extends AMP.BaseElement {
/**
* A "diffable placeholder" is the child container <div> (which is usually created by the amp-list
* to hold the rendered children). It serves the same purpose as a placeholder, except it can be diffed.
*
*
* For example:
* <amp-list>
* <div placeholder>I'm displayed before render.</div>
* </amp-list>
*
*
* <amp-list diffable>
* <div role=list>I'm displayed before render.</div>
* </amp-list>
Expand All @@ -336,11 +337,16 @@ export class AmpList extends AMP.BaseElement {
* @private
*/
queryDiffablePlaceholder_() {
const roleSelector = this.element.hasAttribute('single-item') ? '' : '[role=list]'
const roleSelector = this.element.hasAttribute('single-item')
? ''
: '[role=list]';

return scopedQuerySelector(
this.element,
// Don't select other special <div> children used for placeholders/fallback/etc.
`> div${roleSelector}:not([placeholder]):not([fallback]):not([fetch-error])`
`> div${escapeCssSelectorIdent(
roleSelector
)}:not([placeholder]):not([fallback]):not([fetch-error])`
);
}

Expand Down

0 comments on commit b15c843

Please sign in to comment.