Skip to content

Commit dc92436

Browse files
committed
bug #22491 Fixed the rendering of exceptions inside the profiler (javiereguiluz)
This PR was merged into the 3.3-dev branch. Discussion ---------- Fixed the rendering of exceptions inside the profiler | Q | A | ------------- | --- | Branch? | master | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #22442 | License | MIT | Doc PR | - In #22448 we tried to reuse the same CSS styles as the new exception pages. But that's not enough because it doesn't look good: ![before](https://cloud.githubusercontent.com/assets/73419/25250100/a287b4bc-2614-11e7-88e7-e0ef89eac1ff.png) --- This PR goes a bit further and tweaks the exception styles slightly to better integrate them. Same page as before: ![after_1](https://cloud.githubusercontent.com/assets/73419/25250131/b8d16cf4-2614-11e7-93b4-187248849103.png) It should also work reasonably well when the exception message is very long: ![after_2](https://cloud.githubusercontent.com/assets/73419/25250144/c25eab38-2614-11e7-99e2-843548d12810.png) Commits ------- 73d81de Fixed the rendering of exceptions inside the profiler
2 parents 59f3f34 + 73d81de commit dc92436

File tree

4 files changed

+147
-215
lines changed

4 files changed

+147
-215
lines changed
Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
html{font-family:sans-serif;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}h1{margin:.67em 0;font-size:2em}mark{color:#000;background:#ff0}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{height:0;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{margin:0;font:inherit;color:inherit}button{overflow:visible}button,select{text-transform:none}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{padding:0;border:0}input{line-height:normal}input[type="checkbox"],input[type="radio"]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:0}input[type="number"]::-webkit-inner-spin-button,input[type="number"]::-webkit-outer-spin-button{height:auto}input[type="search"]{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;-webkit-appearance:textfield}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}fieldset{padding:.35em .625em .75em;margin:0 2px;border:1px solid silver}legend{padding:0;border:0}textarea{overflow:auto}optgroup{font-weight:700}table{border-spacing:0;border-collapse:collapse}td,th{padding:0}
2+
3+
html {
4+
/* always display the vertical scrollbar to avoid jumps when toggling contents */
5+
overflow-y: scroll;
6+
}
7+
body { background-color: #F9F9F9; color: #222; font: 14px/1.4 Helvetica, Arial, sans-serif; padding-bottom: 45px; }
8+
9+
a { cursor: pointer; text-decoration: none; }
10+
a:hover { text-decoration: underline; }
11+
abbr[title] { border-bottom: none; cursor: help; text-decoration: none; }
12+
13+
code, pre { font: 13px/1.5 Consolas, Monaco, Menlo, "Ubuntu Mono", "Liberation Mono", monospace; }
14+
15+
table, tr, th, td { background: #FFF; border-collapse: collapse; vertical-align: top; }
16+
table { background: #FFF; border: 1px solid #E0E0E0; box-shadow: 0px 0px 1px rgba(128, 128, 128, .2); margin: 1em 0; width: 100%; }
17+
table th, table td { border: solid #E0E0E0; border-width: 1px 0; padding: 8px 10px; }
18+
table th { background-color: #E0E0E0; font-weight: bold; text-align: left; }
19+
20+
.hidden-xs-down { display: none; }
21+
.block { display: block; }
22+
.hidden { display: none; }
23+
.nowrap { white-space: nowrap; }
24+
.newline { display: block; }
25+
.break-long-words { -ms-word-break: break-all; word-break: break-all; word-break: break-word; -webkit-hyphens: auto; -moz-hyphens: auto; hyphens: auto; }
26+
.text-small { font-size: 12px !important; }
27+
.text-muted { color: #999; }
28+
.text-bold { font-weight: bold; }
29+
.empty { border: 4px dashed #E0E0E0; color: #999; margin: 1em 0; padding: .5em 2em; }
30+
31+
.status-success { background: rgba(94, 151, 110, 0.3); }
32+
.status-warning { background: rgba(240, 181, 24, 0.3); }
33+
.status-error { background: rgba(176, 65, 62, 0.2); }
34+
.status-success td, .status-warning td, .status-error td { background: transparent; }
35+
tr.status-error td, tr.status-warning td { border-bottom: 1px solid #FAFAFA; border-top: 1px solid #FAFAFA; }
36+
.status-warning .colored { color: #A46A1F; }
37+
.status-error .colored { color: #B0413E; }
38+
39+
.sf-toggle { cursor: pointer; }
40+
.sf-toggle-content { -moz-transition: display .25s ease; -webkit-transition: display .25s ease; transition: display .25s ease; }
41+
.sf-toggle-content.sf-toggle-hidden { display: none; }
42+
.sf-toggle-content.sf-toggle-visible { display: block; }
43+
thead.sf-toggle-content.sf-toggle-visible, tbody.sf-toggle-content.sf-toggle-visible { display: table-row-group; }
44+
.sf-toggle-off .icon-close, .sf-toggle-on .icon-open { display: none; }
45+
.sf-toggle-off .icon-open, .sf-toggle-on .icon-close { display: block; }
46+
47+
.tab-navigation { margin: 0 0 1em 0; padding: 0; }
48+
.tab-navigation li { background: #FFF; border: 1px solid #DDD; color: #444; cursor: pointer; display: inline-block; font-size: 16px; margin: 0 0 0 -1px; padding: .5em .75em; z-index: 1; }
49+
.tab-navigation li:hover { background: #EEE; }
50+
.tab-navigation li.disabled { background: #F5F5F5; color: #999; }
51+
.tab-navigation li.active { background: #666; border-color: #666; color: #FAFAFA; z-index: 1100; }
52+
.tab-navigation li .badge { background-color: #F5F5F5; color: #777; display: inline-block; font-size: 14px; font-weight: bold; margin-left: 8px; min-width: 10px; padding: 1px 6px; text-align: center; }
53+
.tab-navigation li:hover .badge { background: #FAFAFA; color: #777; }
54+
.tab-navigation li.active .badge { background-color: #444; color: #FFF; }
55+
.tab-navigation li .badge.status-warning { background: #A46A1F; color: #FFF; }
56+
.tab-navigation li .badge.status-error { background: #B0413E; color: #FFF; }
57+
.tab-content > *:first-child { margin-top: 0; }
58+
59+
.container { max-width: 1024px; margin: 0 auto; padding: 0 15px; }
60+
.container::after { content: ""; display: table; clear: both; }
61+
62+
header { background-color: #222; color: rgba(255, 255, 255, 0.75); font-size: 13px; height: 33px; line-height: 33px; padding: 0; }
63+
header .container { display: flex; justify-content: space-between; }
64+
.logo { flex: 1; font-size: 13px; font-weight: normal; margin: 0; padding: 0; }
65+
.logo svg { height: 18px; width: 18px; opacity: .8; vertical-align: -5px; }
66+
67+
.help-link { margin-left: 15px; }
68+
.help-link a { color: inherit; }
69+
.help-link .icon svg { height: 15px; width: 15px; opacity: .7; vertical-align: -2px; }
70+
.help-link a:hover { color: #EEE; text-decoration: none; }
71+
.help-link a:hover svg { opacity: .9; }
72+
73+
.exception-summary { background: #B0413E; border-bottom: 2px solid rgba(0, 0, 0, 0.1); border-top: 1px solid rgba(0, 0, 0, .3); flex: 0 0 auto; margin-bottom: 15px; }
74+
.exception-metadata { background: rgba(0, 0, 0, 0.1); padding: 7px 0; }
75+
.exception-metadata .container { display: flex; flex-direction: row; justify-content: space-between; }
76+
.exception-metadata h2 { color: rgba(255, 255, 255, 0.8); font-size: 13px; font-weight: 400; margin: 0; }
77+
.exception-http small { font-size: 13px; opacity: .7; }
78+
.exception-hierarchy { flex: 1; }
79+
.exception-hierarchy .icon { margin: 0 3px; opacity: .7; }
80+
.exception-hierarchy .icon svg { height: 13px; width: 13px; vertical-align: -2px; }
81+
82+
.exception-message-wrapper { display: flex; align-items: flex-start; min-height: 70px; padding: 10px 0 8px; }
83+
.exception-message { flex-grow: 1; }
84+
.exception-message, .exception-message a { color: #FFF; font-size: 21px; font-weight: 400; margin: 0; }
85+
.exception-message.long { font-size: 18px; }
86+
.exception-message a { text-decoration: none; }
87+
.exception-message a:hover { text-decoration: underline; }
88+
89+
.exception-illustration { flex-basis: 111px; flex-shrink: 0; height: 66px; margin-left: 15px; opacity: .7; }
90+
91+
.trace + .trace { margin-top: 30px; }
92+
.trace-head { -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; }
93+
.trace-head .trace-class { color: #222; font-size: 18px; font-weight: bold; line-height: 1.3; margin: 0; position: relative; }
94+
.trace-head .trace-namespace { color: #999; display: block; font-size: 13px; }
95+
.trace-head .icon { position: absolute; right: 0; top: 0; }
96+
.trace-head .icon svg { height: 24px; width: 24px; }
97+
98+
.trace-message { font-size: 14px; font-weight: normal; margin: .5em 0 0; }
99+
100+
.trace-line { position: relative; padding-left: 36px; }
101+
.trace-line.sf-toggle:hover { background: #F5F5F5; }
102+
.trace-line a { color: #222; }
103+
.trace-line .icon { opacity: .4; position: absolute; left: 10px; top: 11px; }
104+
.trace-line .icon svg { height: 16px; width: 16px; }
105+
106+
.trace-file-path, .trace-file-path a { margin-top: 3px; color: #999; color: #795da3; color: #B0413E; color: #222; font-size: 13px; }
107+
.trace-class { color: #B0413E; }
108+
.trace-type { padding: 0 2px; }
109+
.trace-method { color: #B0413E; color: #222; font-weight: bold; color: #B0413E; }
110+
.trace-arguments { color: #222; color: #999; font-weight: normal; color: #795da3; color: #777; padding-left: 2px; }
111+
112+
.trace-code { background: #FFF; font-size: 12px; margin: 10px 0 2px; padding: 10px; }
113+
.trace-code ol { margin: 0; }
114+
.trace-code li { color: #969896; margin: 0; padding-left: 10px; }
115+
.trace-code li + li { margin-top: 10px; }
116+
.trace-code li.selected { background: #F8EEC7; padding: 3px 0 3px 10px; }
117+
.trace-code li code { color: #222; }
118+
119+
.trace-as-text .stacktrace { line-height: 1.8; margin: 0 0 15px; white-space: pre-wrap; }
120+
121+
@media (min-width: 575px) {
122+
.hidden-xs-down { display: initial; }
123+
.help-link { margin-left: 30px; }
124+
}

src/Symfony/Bundle/TwigBundle/Resources/views/layout.html.twig

Lines changed: 1 addition & 126 deletions
Original file line numberDiff line numberDiff line change
@@ -6,132 +6,7 @@
66
<meta name="viewport" content="width=device-width,initial-scale=1" />
77
<title>{% block title %}{% endblock %}</title>
88
<link rel="icon" type="image/png" href="{{ include('@Twig/images/favicon.png.base64') }}">
9-
<style>
10-
html{font-family:sans-serif;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}h1{margin:.67em 0;font-size:2em}mark{color:#000;background:#ff0}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{height:0;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{margin:0;font:inherit;color:inherit}button{overflow:visible}button,select{text-transform:none}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{padding:0;border:0}input{line-height:normal}input[type="checkbox"],input[type="radio"]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:0}input[type="number"]::-webkit-inner-spin-button,input[type="number"]::-webkit-outer-spin-button{height:auto}input[type="search"]{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;-webkit-appearance:textfield}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}fieldset{padding:.35em .625em .75em;margin:0 2px;border:1px solid silver}legend{padding:0;border:0}textarea{overflow:auto}optgroup{font-weight:700}table{border-spacing:0;border-collapse:collapse}td,th{padding:0}
11-
12-
html {
13-
/* always display the vertical scrollbar to avoid jumps when toggling contents */
14-
overflow-y: scroll;
15-
}
16-
body { background-color: #F9F9F9; color: #222; font: 14px/1.4 Helvetica, Arial, sans-serif; padding-bottom: 45px; }
17-
18-
a { cursor: pointer; text-decoration: none; }
19-
a:hover { text-decoration: underline; }
20-
abbr[title] { border-bottom: none; cursor: help; text-decoration: none; }
21-
22-
code, pre { font: 13px/1.5 Consolas, Monaco, Menlo, "Ubuntu Mono", "Liberation Mono", monospace; }
23-
24-
table, tr, th, td { background: #FFF; border-collapse: collapse; vertical-align: top; }
25-
table { background: #FFF; border: 1px solid #E0E0E0; box-shadow: 0px 0px 1px rgba(128, 128, 128, .2); margin: 1em 0; width: 100%; }
26-
table th, table td { border: solid #E0E0E0; border-width: 1px 0; padding: 8px 10px; }
27-
table th { background-color: #E0E0E0; font-weight: bold; text-align: left; }
28-
29-
.hidden-xs-down { display: none; }
30-
.block { display: block; }
31-
.hidden { display: none; }
32-
.nowrap { white-space: nowrap; }
33-
.newline { display: block; }
34-
.break-long-words { -ms-word-break: break-all; word-break: break-all; word-break: break-word; -webkit-hyphens: auto; -moz-hyphens: auto; hyphens: auto; }
35-
.text-small { font-size: 12px !important; }
36-
.text-muted { color: #999; }
37-
.text-bold { font-weight: bold; }
38-
.empty { border: 4px dashed #E0E0E0; color: #999; margin: 1em 0; padding: .5em 2em; }
39-
40-
.status-success { background: rgba(94, 151, 110, 0.3); }
41-
.status-warning { background: rgba(240, 181, 24, 0.3); }
42-
.status-error { background: rgba(176, 65, 62, 0.2); }
43-
.status-success td, .status-warning td, .status-error td { background: transparent; }
44-
tr.status-error td, tr.status-warning td { border-bottom: 1px solid #FAFAFA; border-top: 1px solid #FAFAFA; }
45-
.status-warning .colored { color: #A46A1F; }
46-
.status-error .colored { color: #B0413E; }
47-
48-
.sf-toggle { cursor: pointer; }
49-
.sf-toggle-content { -moz-transition: display .25s ease; -webkit-transition: display .25s ease; transition: display .25s ease; }
50-
.sf-toggle-content.sf-toggle-hidden { display: none; }
51-
.sf-toggle-content.sf-toggle-visible { display: block; }
52-
thead.sf-toggle-content.sf-toggle-visible, tbody.sf-toggle-content.sf-toggle-visible { display: table-row-group; }
53-
.sf-toggle-off .icon-close, .sf-toggle-on .icon-open { display: none; }
54-
.sf-toggle-off .icon-open, .sf-toggle-on .icon-close { display: block; }
55-
56-
.tab-navigation { margin: 0 0 1em 0; padding: 0; }
57-
.tab-navigation li { background: #FFF; border: 1px solid #DDD; color: #444; cursor: pointer; display: inline-block; font-size: 16px; margin: 0 0 0 -1px; padding: .5em .75em; z-index: 1; }
58-
.tab-navigation li:hover { background: #EEE; }
59-
.tab-navigation li.disabled { background: #F5F5F5; color: #999; }
60-
.tab-navigation li.active { background: #666; border-color: #666; color: #FAFAFA; z-index: 1100; }
61-
.tab-navigation li .badge { background-color: #F5F5F5; color: #777; display: inline-block; font-size: 14px; font-weight: bold; margin-left: 8px; min-width: 10px; padding: 1px 6px; text-align: center; }
62-
.tab-navigation li:hover .badge { background: #FAFAFA; color: #777; }
63-
.tab-navigation li.active .badge { background-color: #444; color: #FFF; }
64-
.tab-navigation li .badge.status-warning { background: #A46A1F; color: #FFF; }
65-
.tab-navigation li .badge.status-error { background: #B0413E; color: #FFF; }
66-
.tab-content > *:first-child { margin-top: 0; }
67-
68-
.container { max-width: 1024px; margin: 0 auto; padding: 0 15px; }
69-
.container::after { content: ""; display: table; clear: both; }
70-
71-
header { background-color: #222; color: rgba(255, 255, 255, 0.75); font-size: 13px; height: 33px; line-height: 33px; padding: 0; }
72-
header .container { display: flex; justify-content: space-between; }
73-
.logo { flex: 1; font-size: 13px; font-weight: normal; margin: 0; padding: 0; }
74-
.logo svg { height: 18px; width: 18px; opacity: .8; vertical-align: -5px; }
75-
76-
.help-link { margin-left: 15px; }
77-
.help-link a { color: inherit; }
78-
.help-link .icon svg { height: 15px; width: 15px; opacity: .7; vertical-align: -2px; }
79-
.help-link a:hover { color: #EEE; text-decoration: none; }
80-
.help-link a:hover svg { opacity: .9; }
81-
82-
.exception-summary { background: #B0413E; border-bottom: 2px solid rgba(0, 0, 0, 0.1); border-top: 1px solid rgba(0, 0, 0, .3); flex: 0 0 auto; margin-bottom: 15px; }
83-
.exception-metadata { background: rgba(0, 0, 0, 0.1); padding: 7px 0; }
84-
.exception-metadata .container { display: flex; flex-direction: row; justify-content: space-between; }
85-
.exception-metadata h2 { color: rgba(255, 255, 255, 0.8); font-size: 13px; font-weight: 400; margin: 0; }
86-
.exception-http small { font-size: 13px; opacity: .7; }
87-
.exception-hierarchy { flex: 1; }
88-
.exception-hierarchy .icon { margin: 0 3px; opacity: .7; }
89-
.exception-hierarchy .icon svg { height: 13px; width: 13px; vertical-align: -2px; }
90-
91-
.exception-message-wrapper { display: flex; align-items: flex-start; min-height: 70px; padding: 10px 0 8px; }
92-
.exception-message { flex-grow: 1; }
93-
.exception-message, .exception-message a { color: #FFF; font-size: 21px; font-weight: 400; margin: 0; }
94-
.exception-message.long { font-size: 18px; }
95-
.exception-message a { text-decoration: none; }
96-
.exception-message a:hover { text-decoration: underline; }
97-
98-
.exception-illustration { flex-basis: 111px; flex-shrink: 0; height: 66px; margin-left: 15px; opacity: .7; }
99-
100-
.trace + .trace { margin-top: 30px; }
101-
.trace-head { -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; }
102-
.trace-head .trace-class { color: #222; font-size: 18px; font-weight: bold; line-height: 1.3; margin: 0; position: relative; }
103-
.trace-head .trace-namespace { color: #999; display: block; font-size: 13px; }
104-
.trace-head .icon { position: absolute; right: 0; top: 0; }
105-
.trace-head .icon svg { height: 24px; width: 24px; }
106-
107-
.trace-message { font-size: 14px; font-weight: normal; margin: .5em 0 0; }
108-
109-
.trace-line { position: relative; padding-left: 36px; }
110-
.trace-line.sf-toggle:hover { background: #F5F5F5; }
111-
.trace-line a { color: #222; }
112-
.trace-line .icon { opacity: .4; position: absolute; left: 10px; top: 11px; }
113-
.trace-line .icon svg { height: 16px; width: 16px; }
114-
115-
.trace-file-path, .trace-file-path a { margin-top: 3px; color: #999; color: #795da3; color: #B0413E; color: #222; font-size: 13px; }
116-
.trace-class { color: #B0413E; }
117-
.trace-type { padding: 0 2px; }
118-
.trace-method { color: #B0413E; color: #222; font-weight: bold; color: #B0413E; }
119-
.trace-arguments { color: #222; color: #999; font-weight: normal; color: #795da3; color: #777; padding-left: 2px; }
120-
121-
.trace-code { background: #FFF; font-size: 12px; margin: 10px 0 2px; padding: 10px; }
122-
.trace-code ol { margin: 0; }
123-
.trace-code li { color: #969896; margin: 0; padding-left: 10px; }
124-
.trace-code li + li { margin-top: 10px; }
125-
.trace-code li.selected { background: #F8EEC7; padding: 3px 0 3px 10px; }
126-
.trace-code li code { color: #222; }
127-
128-
.trace-as-text .stacktrace { line-height: 1.8; margin: 0 0 15px; white-space: pre-wrap; }
129-
130-
@media (min-width: 575px) {
131-
.hidden-xs-down { display: initial; }
132-
.help-link { margin-left: 30px; }
133-
}
134-
</style>
9+
<style>{{ include('@Twig/exception.css.twig') }}</style>
13510
{% block head %}{% endblock %}
13611
</head>
13712
<body>

0 commit comments

Comments
 (0)