MCPcopy Create free account
hub / github.com/ampproject/amphtml / applySimpleSelectorScope

Function applySimpleSelectorScope

third_party/webcomponentsjs/ShadowCSS.js:222–229  ·  view source on GitHub ↗
(selector, scopeSelector)

Source from the content-addressed store, hash-verified

220
221// scope via name and [is=name]
222export function applySimpleSelectorScope(selector, scopeSelector) {
223 if (selector.match(polyfillHostRe)) {
224 selector = selector.replace(polyfillHostNoCombinator, scopeSelector);
225 return selector.replace(polyfillHostRe, scopeSelector + ' ');
226 } else {
227 return scopeSelector + ' ' + selector;
228 }
229}
230
231// return a selector with [name] suffix on each simple selector
232// e.g. .foo.bar > .zot becomes .foo[name].bar[name] > .zot[name]

Callers 2

applySelectorScopeFunction · 0.85
applySelectorScopeListFunction · 0.85

Calls 1

replaceMethod · 0.45

Tested by

no test coverage detected