lighthouse 9.3.1-dev.20220205 → 9.3.1-dev.20220209

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -138,7 +138,17 @@ function getOuterHTMLSnippet(element, ignoreAttrs = [], snippetCharacterLimit =
138
138
  dirty = true;
139
139
  }
140
140
 
141
- if (dirty) clone.setAttribute(attributeName, attributeValue);
141
+ if (dirty) {
142
+ // Style attributes can be blocked by the CSP if they are set via `setAttribute`.
143
+ // If we are trying to set the style attribute, use `el.style.cssText` instead.
144
+ // https://github.com/GoogleChrome/lighthouse/issues/13630
145
+ if (attributeName === 'style') {
146
+ const elementWithStyle = /** @type {HTMLElement} */ (clone);
147
+ elementWithStyle.style.cssText = attributeValue;
148
+ } else {
149
+ clone.setAttribute(attributeName, attributeValue);
150
+ }
151
+ }
142
152
  charCount += attributeName.length + attributeValue.length;
143
153
  }
144
154
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lighthouse",
3
- "version": "9.3.1-dev.20220205",
3
+ "version": "9.3.1-dev.20220209",
4
4
  "description": "Automated auditing, performance metrics, and best practices for the web.",
5
5
  "main": "./lighthouse-core/index.js",
6
6
  "bin": {
@@ -210,8 +210,8 @@ limitations under the License.
210
210
  <div class="lh-scores-wrapper">
211
211
  <div class="lh-scores-container">
212
212
  <div class="lh-pyro">
213
- <div class="lh-before"></div>
214
- <div class="lh-after"></div>
213
+ <div class="lh-pyro-before"></div>
214
+ <div class="lh-pyro-after"></div>
215
215
  </div>
216
216
  </div>
217
217
  </div>
@@ -450,8 +450,8 @@ function createScoresWrapperComponent(dom) {
450
450
  const el2 = dom.createElement('div', 'lh-scores-wrapper');
451
451
  const el3 = dom.createElement('div', 'lh-scores-container');
452
452
  const el4 = dom.createElement('div', 'lh-pyro');
453
- const el5 = dom.createElement('div', 'lh-before');
454
- const el6 = dom.createElement('div', 'lh-after');
453
+ const el5 = dom.createElement('div', 'lh-pyro-before');
454
+ const el6 = dom.createElement('div', 'lh-pyro-after');
455
455
  el4.append(' ', el5, ' ', el6, ' ');
456
456
  el3.append(' ', el4, ' ');
457
457
  el2.append(' ', el3, ' ');