blob: 1c36745b3fe048e41424010fc2515f7746ebf6bb [file] [log] [blame]
Andrew Bonventre78792e82016-03-04 17:48:22 -05001<!--
Dave Borowitz8cdc76b2018-03-26 10:04:27 -04002@license
Andrew Bonventre78792e82016-03-04 17:48:22 -05003Copyright (C) 2015 The Android Open Source Project
4
5Licensed under the Apache License, Version 2.0 (the "License");
6you may not use this file except in compliance with the License.
7You may obtain a copy of the License at
8
9http://www.apache.org/licenses/LICENSE-2.0
10
11Unless required by applicable law or agreed to in writing, software
12distributed under the License is distributed on an "AS IS" BASIS,
13WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14See the License for the specific language governing permissions and
15limitations under the License.
16-->
17
Ole Rehmsen31640742019-05-16 11:24:47 +020018<link rel="import" href="/bower_components/polymer/polymer.html">
Paladox none44b3a7c2019-08-06 14:36:29 +000019<link rel="import" href="../../../behaviors/fire-behavior/fire-behavior.html">
Kasper Nilsson380bf8b2017-08-03 15:16:20 -070020<link rel="import" href="../../../behaviors/gr-patch-set-behavior/gr-patch-set-behavior.html">
Viktar Donicha28dee062017-11-10 16:03:13 -080021<link rel="import" href="../../../styles/shared-styles.html">
Andrew Bonventre78792e82016-03-04 17:48:22 -050022<link rel="import" href="../../shared/gr-button/gr-button.html">
Viktar Donich0f02cda2016-06-01 11:41:47 -070023<link rel="import" href="../gr-diff-builder/gr-diff-builder.html">
Viktar Donichab1b2112016-06-10 12:47:57 -070024<link rel="import" href="../gr-diff-highlight/gr-diff-highlight.html">
Viktar Doniche1341972016-06-09 16:39:17 -070025<link rel="import" href="../gr-diff-selection/gr-diff-selection.html">
Kasper Nilsson889ca952018-04-18 12:06:23 +020026<link rel="import" href="../gr-syntax-themes/gr-syntax-theme.html">
Dmitrii Filippov9b4836a2019-08-16 15:06:34 +020027<link rel="import" href="../gr-ranged-comment-themes/gr-ranged-comment-theme.html">
Andrew Bonventre78792e82016-03-04 17:48:22 -050028
Viktar Donich1057e052017-05-12 11:24:31 -070029<script src="../../../scripts/hiddenscroll.js"></script>
30
Andrew Bonventre78792e82016-03-04 17:48:22 -050031<dom-module id="gr-diff">
32 <template>
Becky Siegelb159a7f2017-06-01 15:31:55 -070033 <style include="shared-styles">
Tao Zhou42ee1972019-10-22 12:48:19 +020034 :host(.no-left) .sideBySide .left,
35 :host(.no-left) .sideBySide .left + td,
36 :host(.no-left) .sideBySide .right:not([data-value]),
37 :host(.no-left) .sideBySide .right:not([data-value]) + td {
Viktar Donichc282d7b2016-08-10 11:53:12 -070038 display: none;
39 }
Ben Rohlfs49802962019-07-11 22:59:03 +020040 ::slotted(*) .thread-group {
41 display: block;
42 max-width: var(--content-width, 80ch);
43 white-space: normal;
44 }
Ben Rohlfs5259b3a2019-10-24 17:47:40 +020045 :host {
46 font-family: var(--monospace-font-family, ''), 'Roboto Mono';
Ben Rohlfs0f3edd22019-10-31 08:33:31 +010047 font-size: var(--font-size, var(--font-size-code, 12px));
48 line-height: var(--line-height-code, 1.334);
Ben Rohlfs5259b3a2019-10-24 17:47:40 +020049 }
Tao Zhou5b47bbe2019-09-05 10:12:43 +020050
Ben Rohlfs49802962019-07-11 22:59:03 +020051 .thread-group {
Ole Rehmsenec1b3512018-11-08 09:12:48 +010052 display: block;
53 max-width: var(--content-width, 80ch);
54 white-space: normal;
55 }
Andrew Bonventre78792e82016-03-04 17:48:22 -050056 .diffContainer {
Andrew Bonventre78792e82016-03-04 17:48:22 -050057 display: flex;
Kasper Nilsson86b28f42018-06-25 20:44:19 -070058 font-family: var(--monospace-font-family);
Becky Siegel7fc77622017-11-28 15:49:20 -080059 @apply --diff-container-styles;
Andrew Bonventre78792e82016-03-04 17:48:22 -050060 }
Viktar Donich1057e052017-05-12 11:24:31 -070061 .diffContainer.hiddenscroll {
Ben Rohlfsb3d95cf2019-10-20 19:26:48 +020062 margin-bottom: var(--spacing-m);
Viktar Donich1057e052017-05-12 11:24:31 -070063 }
Andrew Bonventre2aa22122016-03-25 16:48:13 -040064 table {
65 border-collapse: collapse;
Kasper Nilssonc8280982018-04-11 15:32:06 -070066 border-right: 1px solid var(--border-color);
Wyatt Allen32b03fc2016-08-05 15:56:33 -070067 table-layout: fixed;
Andrew Bonventre78792e82016-03-04 17:48:22 -050068 }
Viktar Doniche1341972016-06-09 16:39:17 -070069 .lineNum {
Kasper Nilsson83d8aac2018-04-17 13:39:50 +020070 background-color: var(--table-header-background-color);
Andrew Bonventre2aa22122016-03-25 16:48:13 -040071 }
Wyatt Allen88678da2016-05-23 17:18:43 -070072 .image-diff .gr-diff {
73 text-align: center;
74 }
75 .image-diff img {
Kasper Nilsson2a3f59f2018-07-25 14:01:14 -070076 box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
Wyatt Allen88678da2016-05-23 17:18:43 -070077 max-width: 50em;
Kasper Nilsson2a3f59f2018-07-25 14:01:14 -070078 }
79 .image-diff .right.lineNum {
80 border-left: 1px solid var(--border-color);
Wyatt Allen88678da2016-05-23 17:18:43 -070081 }
Wyatt Allenbae435c2017-11-27 10:07:44 -080082 .image-diff label,
83 .binary-diff label {
Wyatt Allen88678da2016-05-23 17:18:43 -070084 font-family: var(--font-family);
85 font-style: italic;
86 }
Kasper Nilsson40ea3ad2017-06-06 16:59:22 -070087 .diff-row {
88 outline: none;
89 }
Wyatt Allen72b87fc2016-05-16 14:40:51 -070090 .diff-row.target-row.target-side-left .lineNum.left,
91 .diff-row.target-row.target-side-right .lineNum.right,
92 .diff-row.target-row.unified .lineNum {
Kasper Nilsson83d8aac2018-04-17 13:39:50 +020093 background-color: var(--diff-selection-background-color);
Kasper Nilsson92ad99f2018-04-16 10:15:33 +020094 color: var(--primary-text-color);
Wyatt Allen72b87fc2016-05-16 14:40:51 -070095 }
Andrew Bonventre2aa22122016-03-25 16:48:13 -040096 .content {
Kasper Nilssonc4f41032018-04-16 11:42:56 +020097 background-color: var(--view-background-color);
Andrew Bonventre2aa22122016-03-25 16:48:13 -040098 }
Ole Rehmsenc5a5cb32019-07-02 17:13:38 +020099 .blank {
100 background-color: var(--diff-blank-background-color);
101 }
Wyatt Allene3ef1da2018-08-28 16:28:26 -0700102 .image-diff .content {
103 background-color: var(--table-header-background-color);
104 }
Becky Siegele7d19a92016-10-31 14:35:35 -0700105 .full-width {
106 width: 100%;
107 }
Becky Siegeldc462182016-11-02 17:57:16 -0700108 .full-width .contentText {
109 white-space: pre-wrap;
110 word-wrap: break-word;
111 }
Andrew Bonventre2aa22122016-03-25 16:48:13 -0400112 .lineNum,
113 .content {
114 vertical-align: top;
115 white-space: pre;
116 }
Wyatt Allenf5f68992018-02-09 13:34:56 -0800117 .contextLineNum,
118 .lineNum {
119 -webkit-user-select: none;
120 -moz-user-select: none;
121 -ms-user-select: none;
122 user-select: none;
123
Kasper Nilssonb0d03d02018-04-16 17:04:22 +0200124 color: var(--deemphasized-text-color);
Ben Rohlfsb3d95cf2019-10-20 19:26:48 +0200125 padding: 0 var(--spacing-m);
Andrew Bonventre2aa22122016-03-25 16:48:13 -0400126 text-align: right;
Andrew Bonventre2aa22122016-03-25 16:48:13 -0400127 }
Wyatt Allenf5f68992018-02-09 13:34:56 -0800128 .canComment .lineNum {
Andrew Bonventre2aa22122016-03-25 16:48:13 -0400129 cursor: pointer;
130 }
Andrew Bonventre2aa22122016-03-25 16:48:13 -0400131 .content {
Viktar Donich60cbd2f2018-04-11 13:34:40 -0700132 /* Set min width since setting width on table cells still
133 allows them to shrink. Do not set max width because
134 CJK (Chinese-Japanese-Korean) glyphs have variable width */
Andrew Bonventreac802cd2016-04-02 21:53:35 -0400135 min-width: var(--content-width, 80ch);
Becky Siegele7d19a92016-10-31 14:35:35 -0700136 width: var(--content-width, 80ch);
Becky Siegeld7dbed62016-10-12 10:55:26 -0700137 }
Wyatt Allen650c5292016-06-22 17:18:06 -0700138 .content.add .intraline,
Tao Zhou7d39f9b2019-08-09 16:14:54 +0200139 /* If there are no intraline info, consider everything changed */
140 .content.add.no-intraline-info,
Wyatt Allen1e3cd472016-12-21 12:55:21 -0800141 .delta.total .content.add {
Andrew Bonventre2aa22122016-03-25 16:48:13 -0400142 background-color: var(--dark-add-highlight-color);
143 }
Wyatt Allen1e3cd472016-12-21 12:55:21 -0800144 .content.add {
Andrew Bonventre2aa22122016-03-25 16:48:13 -0400145 background-color: var(--light-add-highlight-color);
146 }
Wyatt Allen650c5292016-06-22 17:18:06 -0700147 .content.remove .intraline,
Tao Zhou7d39f9b2019-08-09 16:14:54 +0200148 /* If there are no intraline info, consider everything changed */
149 .content.remove.no-intraline-info,
Wyatt Allen1e3cd472016-12-21 12:55:21 -0800150 .delta.total .content.remove {
Andrew Bonventre2aa22122016-03-25 16:48:13 -0400151 background-color: var(--dark-remove-highlight-color);
152 }
Wyatt Allen1e3cd472016-12-21 12:55:21 -0800153 .content.remove {
Andrew Bonventre2aa22122016-03-25 16:48:13 -0400154 background-color: var(--light-remove-highlight-color);
155 }
Ole Rehmsen80df1f32019-04-16 15:55:08 +0200156
157 /* dueToRebase */
Alice Kober-Sotzek4cb04e12017-07-20 16:31:02 +0000158 .dueToRebase .content.add .intraline,
159 .delta.total.dueToRebase .content.add {
160 background-color: var(--dark-rebased-add-highlight-color);
161 }
162 .dueToRebase .content.add {
163 background-color: var(--light-rebased-add-highlight-color);
164 }
165 .dueToRebase .content.remove .intraline,
166 .delta.total.dueToRebase .content.remove {
167 background-color: var(--dark-rebased-remove-highlight-color);
168 }
169 .dueToRebase .content.remove {
Kasper Nilsson83d8aac2018-04-17 13:39:50 +0200170 background-color: var(--light-remove-add-highlight-color);
Alice Kober-Sotzek4cb04e12017-07-20 16:31:02 +0000171 }
Ole Rehmsen80df1f32019-04-16 15:55:08 +0200172
173 /* ignoredWhitespaceOnly */
174 .ignoredWhitespaceOnly .content.add .intraline,
175 .delta.total.ignoredWhitespaceOnly .content.add,
176 .ignoredWhitespaceOnly .content.add,
177 .ignoredWhitespaceOnly .content.remove .intraline,
178 .delta.total.ignoredWhitespaceOnly .content.remove,
179 .ignoredWhitespaceOnly .content.remove {
180 background: none;
181 }
182
Luís Oliveira40eb3f42018-01-24 01:31:15 +0000183 .content .contentText:empty:after {
184 /* Newline, to ensure empty lines are one line-height tall. */
Aaron Gabled5d9a132016-12-09 12:30:29 -0800185 content: '\A';
186 }
Andrew Bonventre2aa22122016-03-25 16:48:13 -0400187 .contextControl {
Ole Rehmsen2bf48672019-05-28 17:26:17 +0200188 background-color: var(--diff-context-control-background-color);
Kasper Nilsson83d8aac2018-04-17 13:39:50 +0200189 border: 1px solid var(--diff-context-control-border-color);
Ben Rohlfs5259b3a2019-10-24 17:47:40 +0200190 color: var(--diff-context-control-color);
Andrew Bonventre2aa22122016-03-25 16:48:13 -0400191 }
192 .contextControl gr-button {
Wyatt Allen10979632016-06-01 15:13:33 -0700193 display: inline-block;
Andrew Bonventre2aa22122016-03-25 16:48:13 -0400194 text-decoration: none;
Becky Siegel8b60a512018-03-26 13:18:47 -0700195 --gr-button: {
Ole Rehmsen2bf48672019-05-28 17:26:17 +0200196 color: var(--diff-context-control-color);
Ben Rohlfsb3d95cf2019-10-20 19:26:48 +0200197 padding: var(--spacing-xs);
Becky Siegel8b60a512018-03-26 13:18:47 -0700198 }
Andrew Bonventre2aa22122016-03-25 16:48:13 -0400199 }
200 .contextControl td:not(.lineNum) {
201 text-align: center;
202 }
Becky Siegel08ca8262017-06-28 16:29:56 -0700203 .displayLine .diff-row.target-row td {
Kasper Nilsson83d8aac2018-04-17 13:39:50 +0200204 box-shadow: inset 0 -1px var(--border-color);
Becky Siegel6a7085e2016-11-02 16:25:53 -0700205 }
Andrew Bonventre2aa22122016-03-25 16:48:13 -0400206 .br:after {
207 /* Line feed */
208 content: '\A';
209 }
210 .tab {
211 display: inline-block;
212 }
Wyatt Allenbe0142c2016-08-25 11:31:42 -0700213 .tab-indicator:before {
Kasper Nilsson83d8aac2018-04-17 13:39:50 +0200214 color: var(--diff-tab-indicator-color);
Wyatt Allenbe0142c2016-08-25 11:31:42 -0700215 /* >> character */
216 content: '\00BB';
Orgad Shaneh537c0a52019-05-03 10:31:39 +0300217 position: absolute;
Andrew Bonventre2aa22122016-03-25 16:48:13 -0400218 }
Ben Rohlfs0037f282019-04-18 11:53:21 +0200219 /* Is defined after other background-colors, such that this
220 rule wins in case of same specificity. */
221 .trailing-whitespace,
222 .content .trailing-whitespace,
223 .trailing-whitespace .intraline,
224 .content .trailing-whitespace .intraline {
Ben Rohlfs4415e6b2019-10-29 08:46:43 +0100225 border-radius: var(--border-radius, 4px);
Kasper Nilsson83d8aac2018-04-17 13:39:50 +0200226 background-color: var(--diff-trailing-whitespace-indicator);
Wyatt Allend9705002016-11-17 12:03:51 -0800227 }
Kasper Nilssonb4893d02017-04-07 15:52:28 -0700228 #diffHeader {
Kasper Nilsson83d8aac2018-04-17 13:39:50 +0200229 background-color: var(--table-header-background-color);
230 border-bottom: 1px solid var(--border-color);
231 color: var(--link-color);
Ben Rohlfsb3d95cf2019-10-20 19:26:48 +0200232 padding: var(--spacing-m) 0 var(--spacing-m) 48px;
Kasper Nilssonb4893d02017-04-07 15:52:28 -0700233 }
Wyatt Alleneb043442018-08-15 14:13:01 -0700234 #loadingError,
Wyatt Allen6df3f492017-06-13 15:32:51 -0700235 #sizeWarning {
236 display: none;
Ben Rohlfsb3d95cf2019-10-20 19:26:48 +0200237 margin: var(--spacing-l) auto;
Wyatt Allen6df3f492017-06-13 15:32:51 -0700238 max-width: 60em;
239 text-align: center;
240 }
Wyatt Alleneb043442018-08-15 14:13:01 -0700241 #loadingError {
242 color: var(--error-text-color);
243 }
Wyatt Allen6df3f492017-06-13 15:32:51 -0700244 #sizeWarning gr-button {
Ben Rohlfsb3d95cf2019-10-20 19:26:48 +0200245 margin: var(--spacing-l);
Wyatt Allen6df3f492017-06-13 15:32:51 -0700246 }
Wyatt Alleneb043442018-08-15 14:13:01 -0700247 #loadingError.showError,
Wyatt Allen6df3f492017-06-13 15:32:51 -0700248 #sizeWarning.warn {
249 display: block;
250 }
Wyatt Allened628d72017-09-14 09:45:50 -0700251 .target-row td.blame {
Kasper Nilssone46284e2018-04-30 10:14:58 -0700252 background: var(--diff-selection-background-color);
Wyatt Allened628d72017-09-14 09:45:50 -0700253 }
Wyatt Allen03097562017-09-30 14:54:01 +0100254 col.blame {
255 display: none;
256 }
Wyatt Allened628d72017-09-14 09:45:50 -0700257 td.blame {
258 display: none;
Ben Rohlfsb3d95cf2019-10-20 19:26:48 +0200259 padding: 0 var(--spacing-m);
Wyatt Allened628d72017-09-14 09:45:50 -0700260 white-space: pre;
261 }
Wyatt Allen03097562017-09-30 14:54:01 +0100262 :host(.showBlame) col.blame {
263 display: table-column;
264 }
Wyatt Allened628d72017-09-14 09:45:50 -0700265 :host(.showBlame) td.blame {
266 display: table-cell;
267 }
268 td.blame > span {
269 opacity: 0.6;
270 }
271 td.blame > span.startOfRange {
272 opacity: 1;
273 }
274 td.blame .sha {
275 font-family: var(--monospace-font-family);
276 }
277 .full-width td.blame {
278 overflow: hidden;
279 width: 200px;
280 }
Becky Siegeld3cd1252018-03-19 14:36:52 -0700281 /** Support the line length indicator **/
282 .full-width td.content,
283 .full-width td.blank {
Becky Siegel7982f5c2018-03-20 10:40:44 -0700284 /* Base 64 encoded 1x1px of #ddd */
Paladox none0e7367c2018-03-22 18:30:26 +0000285 background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mO8+x8AAr8B3gzOjaQAAAAASUVORK5CYII=');
Becky Siegeld3cd1252018-03-19 14:36:52 -0700286 background-position: var(--line-limit) 0;
287 background-repeat: repeat-y;
288 }
Wyatt Allend13f4182018-08-01 11:57:34 -0700289 .newlineWarning {
290 color: var(--deemphasized-text-color);
291 text-align: center;
292 }
293 .newlineWarning.hidden {
294 display: none;
295 }
brohlfsb2577e42019-02-28 17:56:24 +0100296 .lineNum.COVERED {
297 background-color: #E0F2F1;
298 }
299 .lineNum.NOT_COVERED {
300 background-color: #FFD1A4;
301 }
302 .lineNum.PARTIALLY_COVERED {
303 background: linear-gradient(to right bottom, #FFD1A4 0%, #FFD1A4 50%, #E0F2F1 50%, #E0F2F1 100%);
304 }
Tao Zhou170ffff2019-08-21 19:13:17 +0200305
Tao Zhou5b47bbe2019-09-05 10:12:43 +0200306 /** BEGIN: Select and copy for Polymer 2 */
307 /** Below was copied and modified from the original css in gr-diff-selection.html */
Tao Zhou170ffff2019-08-21 19:13:17 +0200308 .content,
309 .contextControl,
310 .blame {
311 -webkit-user-select: none;
312 -moz-user-select: none;
313 -ms-user-select: none;
314 user-select: none;
315 }
316
317 .selected-left:not(.selected-comment) .side-by-side .left + .content .contentText,
318 .selected-right:not(.selected-comment) .side-by-side .right + .content .contentText,
319 .selected-left:not(.selected-comment) .unified .left.lineNum ~ .content:not(.both) .contentText,
320 .selected-right:not(.selected-comment) .unified .right.lineNum ~ .content .contentText,
321 .selected-left.selected-comment .side-by-side .left + .content .message,
322 .selected-right.selected-comment .side-by-side .right + .content .message :not(.collapsedContent),
323 .selected-comment .unified .message :not(.collapsedContent),
324 .selected-blame .blame {
325 -webkit-user-select: text;
326 -moz-user-select: text;
327 -ms-user-select: text;
328 user-select: text;
329 }
Tao Zhou33ab43c2019-08-23 15:19:27 +0200330
Tao Zhoub8f9ad82019-09-17 12:13:43 +0200331 /** Make comments selectable when selected */
332 .selected-left.selected-comment ::slotted(gr-comment-thread[comment-side=left]),
333 .selected-right.selected-comment ::slotted(gr-comment-thread[comment-side=right]) {
Tao Zhou5b47bbe2019-09-05 10:12:43 +0200334 -webkit-user-select: text;
335 -moz-user-select: text;
336 -ms-user-select: text;
337 user-select: text;
338 }
339 /** END: Select and copy for Polymer 2 */
340
Tao Zhou33ab43c2019-08-23 15:19:27 +0200341 .whitespace-change-only-message {
342 background-color: var(--diff-context-control-background-color);
343 border: 1px solid var(--diff-context-control-border-color);
344 text-align: center;
345 }
Andrew Bonventre78792e82016-03-04 17:48:22 -0500346 </style>
Kasper Nilsson889ca952018-04-18 12:06:23 +0200347 <style include="gr-syntax-theme"></style>
Dmitrii Filippov9b4836a2019-08-16 15:06:34 +0200348 <style include="gr-ranged-comment-theme"></style>
Kasper Nilssonb4893d02017-04-07 15:52:28 -0700349 <div id="diffHeader" hidden$="[[_computeDiffHeaderHidden(_diffHeaderItems)]]">
350 <template
351 is="dom-repeat"
352 items="[[_diffHeaderItems]]">
353 <div>[[item]]</div>
354 </template>
355 </div>
Ole Rehmsenb1a79672018-08-27 22:43:38 +0200356 <div class$="[[_computeContainerClass(loggedIn, viewMode, displayLine)]]"
Viktar Doniche1341972016-06-09 16:39:17 -0700357 on-tap="_handleTap">
Ole Rehmsenb1a79672018-08-27 22:43:38 +0200358 <gr-diff-selection diff="[[diff]]">
Viktar Donichab1b2112016-06-10 12:47:57 -0700359 <gr-diff-highlight
360 id="highlights"
Ole Rehmsenb1a79672018-08-27 22:43:38 +0200361 logged-in="[[loggedIn]]"
Ole Rehmsendf6ab9c2018-11-09 17:54:16 +0100362 comment-ranges="{{_commentRanges}}">
Viktar Donichab1b2112016-06-10 12:47:57 -0700363 <gr-diff-builder
364 id="diffBuilder"
Ole Rehmsendf6ab9c2018-11-09 17:54:16 +0100365 comment-ranges="[[_commentRanges]]"
brohlfsb2577e42019-02-28 17:56:24 +0100366 coverage-ranges="[[coverageRanges]]"
Wyatt Allenf0eb4bb2017-07-31 14:33:16 -0700367 project-name="[[projectName]]"
Ole Rehmsenb1a79672018-08-27 22:43:38 +0200368 diff="[[diff]]"
Tao Zhoude3c72f2019-12-03 17:29:16 +0100369 path="[[path]]"
Ravi Mistryaf1e0f82017-10-10 09:47:26 -0400370 change-num="[[changeNum]]"
371 patch-num="[[patchRange.patchNum]]"
Viktar Donichab1b2112016-06-10 12:47:57 -0700372 view-mode="[[viewMode]]"
Becky Siegele7d19a92016-10-31 14:35:35 -0700373 line-wrapping="[[lineWrapping]]"
Viktar Donichab1b2112016-06-10 12:47:57 -0700374 is-image-diff="[[isImageDiff]]"
Ole Rehmsenb1a79672018-08-27 22:43:38 +0200375 base-image="[[baseImage]]"
Mayank Kumar41b0f952019-10-03 18:04:08 -0700376 layers="[[layers]]"
Ilham Kurniaace16472018-11-14 15:43:01 +0100377 revision-image="[[revisionImage]]">
Kasper Nilsson40ea3ad2017-06-06 16:59:22 -0700378 <table
379 id="diffTable"
380 class$="[[_diffTableClass]]"
381 role="presentation"></table>
Tao Zhou33ab43c2019-08-23 15:19:27 +0200382
383 <template is="dom-if" if="[[showNoChangeMessage(loading, prefs, _diffLength)]]">
384 <div class="whitespace-change-only-message">
385 This file only contains whitespace changes.
386 Modify the whitespace setting to see the changes.
387 </div>
388 </template>
Viktar Donichab1b2112016-06-10 12:47:57 -0700389 </gr-diff-builder>
390 </gr-diff-highlight>
Viktar Doniche1341972016-06-09 16:39:17 -0700391 </gr-diff-selection>
Andrew Bonventre78792e82016-03-04 17:48:22 -0500392 </div>
Ole Rehmsenb1a79672018-08-27 22:43:38 +0200393 <div class$="[[_computeNewlineWarningClass(_newlineWarning, loading)]]">
Wyatt Allend13f4182018-08-01 11:57:34 -0700394 [[_newlineWarning]]
395 </div>
Ole Rehmsenb1a79672018-08-27 22:43:38 +0200396 <div id="loadingError" class$="[[_computeErrorClass(errorMessage)]]">
397 [[errorMessage]]
Wyatt Alleneb043442018-08-15 14:13:01 -0700398 </div>
Wyatt Allen6df3f492017-06-13 15:32:51 -0700399 <div id="sizeWarning" class$="[[_computeWarningClass(_showWarning)]]">
400 <p>
401 Prevented render because "Whole file" is enabled and this diff is very
Wyatt Allen7e9b0c32018-09-14 17:19:39 -0700402 large (about [[_diffLength]] lines).
Wyatt Allen6df3f492017-06-13 15:32:51 -0700403 </p>
Milutin Kristofic63cf95d2019-09-27 15:41:53 +0200404 <gr-button on-click="_handleLimitedBypass">
Wyatt Allen6df3f492017-06-13 15:32:51 -0700405 Render with limited context
406 </gr-button>
Milutin Kristofic63cf95d2019-09-27 15:41:53 +0200407 <gr-button on-click="_handleFullBypass">
Wyatt Allen6df3f492017-06-13 15:32:51 -0700408 Render anyway (may be slow)
409 </gr-button>
410 </div>
Andrew Bonventre78792e82016-03-04 17:48:22 -0500411 </template>
Andrew Bonventre2aa22122016-03-25 16:48:13 -0400412 <script src="gr-diff-line.js"></script>
413 <script src="gr-diff-group.js"></script>
Andrew Bonventre78792e82016-03-04 17:48:22 -0500414 <script src="gr-diff.js"></script>
415</dom-module>