Commit b58268cb authored by eustas@chromium.org's avatar eustas@chromium.org

DevTools: CssChecker: avoid selector crafting in AuditsPanel.

BUG=405921

Review URL: https://codereview.chromium.org/721133003

git-svn-id: svn://svn.chromium.org/blink/trunk@185422 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent fbdab111
...@@ -3,19 +3,19 @@ Tests audit rules. ...@@ -3,19 +3,19 @@ Tests audit rules.
Text Link Text Link
Page reloaded. Page reloaded.
Network Utilization Network Utilization
[severity-severe] Combine external JavaScript (4) [severity severe] Combine external JavaScript (4)
There are multiple resources served from same domain. Consider combining them into as few files as possible. There are multiple resources served from same domain. Consider combining them into as few files as possible.
4 JavaScript resources served from [domain]. 4 JavaScript resources served from [domain].
[severity-warning] Specify image dimensions (2) [severity warning] Specify image dimensions (2)
A width and height should be specified for all images in order to speed up page display. The following image(s) are missing a width and/or height: A width and height should be specified for all images in order to speed up page display. The following image(s) are missing a width and/or height:
foo1.jpg foo1.jpg
foo2.jpg foo2.jpg
Web Page Performance Web Page Performance
[severity-severe] Optimize the order of styles and scripts (2) [severity severe] Optimize the order of styles and scripts (2)
The following external CSS files were included after an external JavaScript file in the document head. To ensure CSS files are downloaded in parallel, always include external CSS before external JavaScript. The following external CSS files were included after an external JavaScript file in the document head. To ensure CSS files are downloaded in parallel, always include external CSS before external JavaScript.
audits-style1.css audits-style1.css
1 inline script block was found in the head between an external CSS file and another resource. To allow parallel downloading, move the inline script before the external CSS file, or after the next resource. 1 inline script block was found in the head between an external CSS file and another resource. To allow parallel downloading, move the inline script before the external CSS file, or after the next resource.
[severity-severe] Put CSS in the document head (2) [severity severe] Put CSS in the document head (2)
CSS in the document body adversely impacts rendering performance. CSS in the document body adversely impacts rendering performance.
1 style block(s) in the 1 style block(s) in the
audits-panel-functional.html audits-panel-functional.html
...@@ -24,7 +24,7 @@ Page reloaded. ...@@ -24,7 +24,7 @@ Page reloaded.
audits-style1.css audits-style1.css
should be moved to the document head in should be moved to the document head in
audits-panel-functional.html audits-panel-functional.html
[severity-warning] Remove unused CSS rules (10) [severity warning] Remove unused CSS rules (10)
10 rules (50%) of CSS not used by the current page. 10 rules (50%) of CSS not used by the current page.
Inline block #1: 41% is not used by the current page. Inline block #1: 41% is not used by the current page.
.unused .unused
...@@ -42,7 +42,7 @@ Page reloaded. ...@@ -42,7 +42,7 @@ Page reloaded.
audits-style1.css audits-style1.css
: 100% is not used by the current page. : 100% is not used by the current page.
.some-style .some-style
[severity-warning] Use normal CSS property names instead of vendor-prefixed ones (2) [severity warning] Use normal CSS property names instead of vendor-prefixed ones (2)
audits-panel-functional.html audits-panel-functional.html
.unused .unused
"-webkit-opacity" is used, but "opacity" is supported. "-webkit-opacity" is used, but "opacity" is supported.
......
Tests audit rules on a page without images. Tests audit rules on a page without images.
Page reloaded. Page reloaded.
Network Utilization Network Utilization
[severity-severe] Combine external JavaScript (4) [severity severe] Combine external JavaScript (4)
There are multiple resources served from same domain. Consider combining them into as few files as possible. There are multiple resources served from same domain. Consider combining them into as few files as possible.
4 JavaScript resources served from [domain]. 4 JavaScript resources served from [domain].
Web Page Performance Web Page Performance
[severity-severe] Optimize the order of styles and scripts (3) [severity severe] Optimize the order of styles and scripts (3)
3 inline script blocks were found in the head between an external CSS file and another resource. To allow parallel downloading, move the inline script before the external CSS file, or after the next resource. 3 inline script blocks were found in the head between an external CSS file and another resource. To allow parallel downloading, move the inline script before the external CSS file, or after the next resource.
[severity-severe] Put CSS in the document head (2) [severity severe] Put CSS in the document head (2)
CSS in the document body adversely impacts rendering performance. CSS in the document body adversely impacts rendering performance.
1 style block(s) in the 1 style block(s) in the
audits-panel-noimages-functional.html audits-panel-noimages-functional.html
...@@ -16,7 +16,7 @@ Page reloaded. ...@@ -16,7 +16,7 @@ Page reloaded.
audits-style1.css audits-style1.css
should be moved to the document head in should be moved to the document head in
audits-panel-noimages-functional.html audits-panel-noimages-functional.html
[severity-warning] Remove unused CSS rules (5) [severity warning] Remove unused CSS rules (5)
5 rules (100%) of CSS not used by the current page. 5 rules (100%) of CSS not used by the current page.
Inline block #1: 100% is not used by the current page. Inline block #1: 100% is not used by the current page.
.unused .unused
......
...@@ -4,7 +4,7 @@ Tests audit formatters performing evals on content scripts in WebInspector Exten ...@@ -4,7 +4,7 @@ Tests audit formatters performing evals on content scripts in WebInspector Exten
Running tests... Running tests...
RUNNING TEST: extension_testAudits RUNNING TEST: extension_testAudits
Extension audits Extension audits
[severity-warning] Rule with details subtree (1) [severity warning] Rule with details subtree (1)
Test Formatters Test Formatters
main world object main world object
whereAmI whereAmI
......
...@@ -6,9 +6,9 @@ RUNNING TEST: extension_testAudits ...@@ -6,9 +6,9 @@ RUNNING TEST: extension_testAudits
Progress: 50% Progress: 50%
Progress: 75% Progress: 75%
Extension audits Extension audits
[severity-severe] Failed rule (42) [severity severe] Failed rule (42)
this rule always fails this rule always fails
[severity-warning] Rule with details subtree (1) [severity warning] Rule with details subtree (1)
This rule has a lot of details This rule has a lot of details
Subtree Subtree
Some url: Some url:
...@@ -44,7 +44,7 @@ Progress: 75% ...@@ -44,7 +44,7 @@ Progress: 75%
/span /span
> >
extensions-audits.html:20 extensions-audits.html:20
[severity-info] Passed rule [severity info] Passed rule
this rule always passes ok this rule always passes ok
Extension audits that fail Extension audits that fail
category.onAuditStarted fired category.onAuditStarted fired
......
...@@ -103,7 +103,7 @@ WebInspector.AuditCategoryResultPane.prototype = { ...@@ -103,7 +103,7 @@ WebInspector.AuditCategoryResultPane.prototype = {
var titleFragment = createDocumentFragment(); var titleFragment = createDocumentFragment();
if (severity) { if (severity) {
var severityElement = createElement("div"); var severityElement = createElement("div");
severityElement.className = "severity-" + severity; severityElement.classList.add("severity", severity);
titleFragment.appendChild(severityElement); titleFragment.appendChild(severityElement);
} }
titleFragment.createTextChild(title); titleFragment.createTextChild(title);
......
...@@ -121,9 +121,7 @@ ...@@ -121,9 +121,7 @@
display: block; display: block;
} }
.audit-result-view .severity-severe, .audit-result-view .severity {
.audit-result-view .severity-warning,
.audit-result-view .severity-info {
background-image: url(Images/statusbarButtonGlyphs.png); background-image: url(Images/statusbarButtonGlyphs.png);
background-size: 320px 144px; background-size: 320px 144px;
display: inline-block; display: inline-block;
...@@ -136,22 +134,20 @@ ...@@ -136,22 +134,20 @@
} }
@media (-webkit-min-device-pixel-ratio: 1.5) { @media (-webkit-min-device-pixel-ratio: 1.5) {
.audit-result-view .severity-severe, .audit-result-view .severity {
.audit-result-view .severity-warning,
.audit-result-view .severity-info {
background-image: url(Images/statusbarButtonGlyphs_2x.png); background-image: url(Images/statusbarButtonGlyphs_2x.png);
} }
} /* media */ } /* media */
.audit-result-view .severity-severe { .audit-result-view .severity.severe {
background-position: -224px -96px; background-position: -224px -96px;
} }
.audit-result-view .severity-warning { .audit-result-view .severity.warning {
background-position: -246px -96px; background-position: -246px -96px;
} }
.audit-result-view .severity-info { .audit-result-view .severity.info {
background-position: -235px -96px; background-position: -235px -96px;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment