Andrew Bonventre | 78792e8 | 2016-03-04 17:48:22 -0500 | [diff] [blame] | 1 | <!-- |
Dave Borowitz | 8cdc76b | 2018-03-26 10:04:27 -0400 | [diff] [blame] | 2 | @license |
Andrew Bonventre | 78792e8 | 2016-03-04 17:48:22 -0500 | [diff] [blame] | 3 | Copyright (C) 2015 The Android Open Source Project |
| 4 | |
| 5 | Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | you may not use this file except in compliance with the License. |
| 7 | You may obtain a copy of the License at |
| 8 | |
| 9 | http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | |
| 11 | Unless required by applicable law or agreed to in writing, software |
| 12 | distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | See the License for the specific language governing permissions and |
| 15 | limitations under the License. |
| 16 | --> |
| 17 | |
Ole Rehmsen | 3164074 | 2019-05-16 11:24:47 +0200 | [diff] [blame] | 18 | <link rel="import" href="/bower_components/polymer/polymer.html"> |
Paladox none | 44b3a7c | 2019-08-06 14:36:29 +0000 | [diff] [blame] | 19 | <link rel="import" href="../../../behaviors/fire-behavior/fire-behavior.html"> |
Kasper Nilsson | 380bf8b | 2017-08-03 15:16:20 -0700 | [diff] [blame] | 20 | <link rel="import" href="../../../behaviors/gr-patch-set-behavior/gr-patch-set-behavior.html"> |
Viktar Donich | a28dee06 | 2017-11-10 16:03:13 -0800 | [diff] [blame] | 21 | <link rel="import" href="../../../styles/shared-styles.html"> |
Andrew Bonventre | 78792e8 | 2016-03-04 17:48:22 -0500 | [diff] [blame] | 22 | <link rel="import" href="../../shared/gr-button/gr-button.html"> |
Viktar Donich | 0f02cda | 2016-06-01 11:41:47 -0700 | [diff] [blame] | 23 | <link rel="import" href="../gr-diff-builder/gr-diff-builder.html"> |
Viktar Donich | ab1b211 | 2016-06-10 12:47:57 -0700 | [diff] [blame] | 24 | <link rel="import" href="../gr-diff-highlight/gr-diff-highlight.html"> |
Viktar Donich | e134197 | 2016-06-09 16:39:17 -0700 | [diff] [blame] | 25 | <link rel="import" href="../gr-diff-selection/gr-diff-selection.html"> |
Kasper Nilsson | 889ca95 | 2018-04-18 12:06:23 +0200 | [diff] [blame] | 26 | <link rel="import" href="../gr-syntax-themes/gr-syntax-theme.html"> |
Dmitrii Filippov | 9b4836a | 2019-08-16 15:06:34 +0200 | [diff] [blame] | 27 | <link rel="import" href="../gr-ranged-comment-themes/gr-ranged-comment-theme.html"> |
Andrew Bonventre | 78792e8 | 2016-03-04 17:48:22 -0500 | [diff] [blame] | 28 | |
Viktar Donich | 1057e05 | 2017-05-12 11:24:31 -0700 | [diff] [blame] | 29 | <script src="../../../scripts/hiddenscroll.js"></script> |
| 30 | |
Andrew Bonventre | 78792e8 | 2016-03-04 17:48:22 -0500 | [diff] [blame] | 31 | <dom-module id="gr-diff"> |
| 32 | <template> |
Becky Siegel | b159a7f | 2017-06-01 15:31:55 -0700 | [diff] [blame] | 33 | <style include="shared-styles"> |
Tao Zhou | 42ee197 | 2019-10-22 12:48:19 +0200 | [diff] [blame] | 34 | :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 Donich | c282d7b | 2016-08-10 11:53:12 -0700 | [diff] [blame] | 38 | display: none; |
| 39 | } |
Ben Rohlfs | 4980296 | 2019-07-11 22:59:03 +0200 | [diff] [blame] | 40 | ::slotted(*) .thread-group { |
| 41 | display: block; |
| 42 | max-width: var(--content-width, 80ch); |
| 43 | white-space: normal; |
| 44 | } |
Ben Rohlfs | 5259b3a | 2019-10-24 17:47:40 +0200 | [diff] [blame] | 45 | :host { |
| 46 | font-family: var(--monospace-font-family, ''), 'Roboto Mono'; |
Ben Rohlfs | 0f3edd2 | 2019-10-31 08:33:31 +0100 | [diff] [blame] | 47 | font-size: var(--font-size, var(--font-size-code, 12px)); |
| 48 | line-height: var(--line-height-code, 1.334); |
Ben Rohlfs | 5259b3a | 2019-10-24 17:47:40 +0200 | [diff] [blame] | 49 | } |
Tao Zhou | 5b47bbe | 2019-09-05 10:12:43 +0200 | [diff] [blame] | 50 | |
Ben Rohlfs | 4980296 | 2019-07-11 22:59:03 +0200 | [diff] [blame] | 51 | .thread-group { |
Ole Rehmsen | ec1b351 | 2018-11-08 09:12:48 +0100 | [diff] [blame] | 52 | display: block; |
| 53 | max-width: var(--content-width, 80ch); |
| 54 | white-space: normal; |
| 55 | } |
Andrew Bonventre | 78792e8 | 2016-03-04 17:48:22 -0500 | [diff] [blame] | 56 | .diffContainer { |
Andrew Bonventre | 78792e8 | 2016-03-04 17:48:22 -0500 | [diff] [blame] | 57 | display: flex; |
Kasper Nilsson | 86b28f4 | 2018-06-25 20:44:19 -0700 | [diff] [blame] | 58 | font-family: var(--monospace-font-family); |
Becky Siegel | 7fc7762 | 2017-11-28 15:49:20 -0800 | [diff] [blame] | 59 | @apply --diff-container-styles; |
Andrew Bonventre | 78792e8 | 2016-03-04 17:48:22 -0500 | [diff] [blame] | 60 | } |
Viktar Donich | 1057e05 | 2017-05-12 11:24:31 -0700 | [diff] [blame] | 61 | .diffContainer.hiddenscroll { |
Ben Rohlfs | b3d95cf | 2019-10-20 19:26:48 +0200 | [diff] [blame] | 62 | margin-bottom: var(--spacing-m); |
Viktar Donich | 1057e05 | 2017-05-12 11:24:31 -0700 | [diff] [blame] | 63 | } |
Andrew Bonventre | 2aa2212 | 2016-03-25 16:48:13 -0400 | [diff] [blame] | 64 | table { |
| 65 | border-collapse: collapse; |
Kasper Nilsson | c828098 | 2018-04-11 15:32:06 -0700 | [diff] [blame] | 66 | border-right: 1px solid var(--border-color); |
Wyatt Allen | 32b03fc | 2016-08-05 15:56:33 -0700 | [diff] [blame] | 67 | table-layout: fixed; |
Andrew Bonventre | 78792e8 | 2016-03-04 17:48:22 -0500 | [diff] [blame] | 68 | } |
Viktar Donich | e134197 | 2016-06-09 16:39:17 -0700 | [diff] [blame] | 69 | .lineNum { |
Kasper Nilsson | 83d8aac | 2018-04-17 13:39:50 +0200 | [diff] [blame] | 70 | background-color: var(--table-header-background-color); |
Andrew Bonventre | 2aa2212 | 2016-03-25 16:48:13 -0400 | [diff] [blame] | 71 | } |
Wyatt Allen | 88678da | 2016-05-23 17:18:43 -0700 | [diff] [blame] | 72 | .image-diff .gr-diff { |
| 73 | text-align: center; |
| 74 | } |
| 75 | .image-diff img { |
Kasper Nilsson | 2a3f59f | 2018-07-25 14:01:14 -0700 | [diff] [blame] | 76 | box-shadow: 0 1px 3px rgba(0, 0, 0, .3); |
Wyatt Allen | 88678da | 2016-05-23 17:18:43 -0700 | [diff] [blame] | 77 | max-width: 50em; |
Kasper Nilsson | 2a3f59f | 2018-07-25 14:01:14 -0700 | [diff] [blame] | 78 | } |
| 79 | .image-diff .right.lineNum { |
| 80 | border-left: 1px solid var(--border-color); |
Wyatt Allen | 88678da | 2016-05-23 17:18:43 -0700 | [diff] [blame] | 81 | } |
Wyatt Allen | bae435c | 2017-11-27 10:07:44 -0800 | [diff] [blame] | 82 | .image-diff label, |
| 83 | .binary-diff label { |
Wyatt Allen | 88678da | 2016-05-23 17:18:43 -0700 | [diff] [blame] | 84 | font-family: var(--font-family); |
| 85 | font-style: italic; |
| 86 | } |
Kasper Nilsson | 40ea3ad | 2017-06-06 16:59:22 -0700 | [diff] [blame] | 87 | .diff-row { |
| 88 | outline: none; |
| 89 | } |
Wyatt Allen | 72b87fc | 2016-05-16 14:40:51 -0700 | [diff] [blame] | 90 | .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 Nilsson | 83d8aac | 2018-04-17 13:39:50 +0200 | [diff] [blame] | 93 | background-color: var(--diff-selection-background-color); |
Kasper Nilsson | 92ad99f | 2018-04-16 10:15:33 +0200 | [diff] [blame] | 94 | color: var(--primary-text-color); |
Wyatt Allen | 72b87fc | 2016-05-16 14:40:51 -0700 | [diff] [blame] | 95 | } |
Andrew Bonventre | 2aa2212 | 2016-03-25 16:48:13 -0400 | [diff] [blame] | 96 | .content { |
Kasper Nilsson | c4f4103 | 2018-04-16 11:42:56 +0200 | [diff] [blame] | 97 | background-color: var(--view-background-color); |
Andrew Bonventre | 2aa2212 | 2016-03-25 16:48:13 -0400 | [diff] [blame] | 98 | } |
Ole Rehmsen | c5a5cb3 | 2019-07-02 17:13:38 +0200 | [diff] [blame] | 99 | .blank { |
| 100 | background-color: var(--diff-blank-background-color); |
| 101 | } |
Wyatt Allen | e3ef1da | 2018-08-28 16:28:26 -0700 | [diff] [blame] | 102 | .image-diff .content { |
| 103 | background-color: var(--table-header-background-color); |
| 104 | } |
Becky Siegel | e7d19a9 | 2016-10-31 14:35:35 -0700 | [diff] [blame] | 105 | .full-width { |
| 106 | width: 100%; |
| 107 | } |
Becky Siegel | dc46218 | 2016-11-02 17:57:16 -0700 | [diff] [blame] | 108 | .full-width .contentText { |
| 109 | white-space: pre-wrap; |
| 110 | word-wrap: break-word; |
| 111 | } |
Andrew Bonventre | 2aa2212 | 2016-03-25 16:48:13 -0400 | [diff] [blame] | 112 | .lineNum, |
| 113 | .content { |
| 114 | vertical-align: top; |
| 115 | white-space: pre; |
| 116 | } |
Wyatt Allen | f5f6899 | 2018-02-09 13:34:56 -0800 | [diff] [blame] | 117 | .contextLineNum, |
| 118 | .lineNum { |
| 119 | -webkit-user-select: none; |
| 120 | -moz-user-select: none; |
| 121 | -ms-user-select: none; |
| 122 | user-select: none; |
| 123 | |
Kasper Nilsson | b0d03d0 | 2018-04-16 17:04:22 +0200 | [diff] [blame] | 124 | color: var(--deemphasized-text-color); |
Ben Rohlfs | b3d95cf | 2019-10-20 19:26:48 +0200 | [diff] [blame] | 125 | padding: 0 var(--spacing-m); |
Andrew Bonventre | 2aa2212 | 2016-03-25 16:48:13 -0400 | [diff] [blame] | 126 | text-align: right; |
Andrew Bonventre | 2aa2212 | 2016-03-25 16:48:13 -0400 | [diff] [blame] | 127 | } |
Wyatt Allen | f5f6899 | 2018-02-09 13:34:56 -0800 | [diff] [blame] | 128 | .canComment .lineNum { |
Andrew Bonventre | 2aa2212 | 2016-03-25 16:48:13 -0400 | [diff] [blame] | 129 | cursor: pointer; |
| 130 | } |
Andrew Bonventre | 2aa2212 | 2016-03-25 16:48:13 -0400 | [diff] [blame] | 131 | .content { |
Viktar Donich | 60cbd2f | 2018-04-11 13:34:40 -0700 | [diff] [blame] | 132 | /* 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 Bonventre | ac802cd | 2016-04-02 21:53:35 -0400 | [diff] [blame] | 135 | min-width: var(--content-width, 80ch); |
Becky Siegel | e7d19a9 | 2016-10-31 14:35:35 -0700 | [diff] [blame] | 136 | width: var(--content-width, 80ch); |
Becky Siegel | d7dbed6 | 2016-10-12 10:55:26 -0700 | [diff] [blame] | 137 | } |
Wyatt Allen | 650c529 | 2016-06-22 17:18:06 -0700 | [diff] [blame] | 138 | .content.add .intraline, |
Tao Zhou | 7d39f9b | 2019-08-09 16:14:54 +0200 | [diff] [blame] | 139 | /* If there are no intraline info, consider everything changed */ |
| 140 | .content.add.no-intraline-info, |
Wyatt Allen | 1e3cd47 | 2016-12-21 12:55:21 -0800 | [diff] [blame] | 141 | .delta.total .content.add { |
Andrew Bonventre | 2aa2212 | 2016-03-25 16:48:13 -0400 | [diff] [blame] | 142 | background-color: var(--dark-add-highlight-color); |
| 143 | } |
Wyatt Allen | 1e3cd47 | 2016-12-21 12:55:21 -0800 | [diff] [blame] | 144 | .content.add { |
Andrew Bonventre | 2aa2212 | 2016-03-25 16:48:13 -0400 | [diff] [blame] | 145 | background-color: var(--light-add-highlight-color); |
| 146 | } |
Wyatt Allen | 650c529 | 2016-06-22 17:18:06 -0700 | [diff] [blame] | 147 | .content.remove .intraline, |
Tao Zhou | 7d39f9b | 2019-08-09 16:14:54 +0200 | [diff] [blame] | 148 | /* If there are no intraline info, consider everything changed */ |
| 149 | .content.remove.no-intraline-info, |
Wyatt Allen | 1e3cd47 | 2016-12-21 12:55:21 -0800 | [diff] [blame] | 150 | .delta.total .content.remove { |
Andrew Bonventre | 2aa2212 | 2016-03-25 16:48:13 -0400 | [diff] [blame] | 151 | background-color: var(--dark-remove-highlight-color); |
| 152 | } |
Wyatt Allen | 1e3cd47 | 2016-12-21 12:55:21 -0800 | [diff] [blame] | 153 | .content.remove { |
Andrew Bonventre | 2aa2212 | 2016-03-25 16:48:13 -0400 | [diff] [blame] | 154 | background-color: var(--light-remove-highlight-color); |
| 155 | } |
Ole Rehmsen | 80df1f3 | 2019-04-16 15:55:08 +0200 | [diff] [blame] | 156 | |
| 157 | /* dueToRebase */ |
Alice Kober-Sotzek | 4cb04e1 | 2017-07-20 16:31:02 +0000 | [diff] [blame] | 158 | .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 Nilsson | 83d8aac | 2018-04-17 13:39:50 +0200 | [diff] [blame] | 170 | background-color: var(--light-remove-add-highlight-color); |
Alice Kober-Sotzek | 4cb04e1 | 2017-07-20 16:31:02 +0000 | [diff] [blame] | 171 | } |
Ole Rehmsen | 80df1f3 | 2019-04-16 15:55:08 +0200 | [diff] [blame] | 172 | |
| 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 Oliveira | 40eb3f4 | 2018-01-24 01:31:15 +0000 | [diff] [blame] | 183 | .content .contentText:empty:after { |
| 184 | /* Newline, to ensure empty lines are one line-height tall. */ |
Aaron Gable | d5d9a13 | 2016-12-09 12:30:29 -0800 | [diff] [blame] | 185 | content: '\A'; |
| 186 | } |
Andrew Bonventre | 2aa2212 | 2016-03-25 16:48:13 -0400 | [diff] [blame] | 187 | .contextControl { |
Ole Rehmsen | 2bf4867 | 2019-05-28 17:26:17 +0200 | [diff] [blame] | 188 | background-color: var(--diff-context-control-background-color); |
Kasper Nilsson | 83d8aac | 2018-04-17 13:39:50 +0200 | [diff] [blame] | 189 | border: 1px solid var(--diff-context-control-border-color); |
Ben Rohlfs | 5259b3a | 2019-10-24 17:47:40 +0200 | [diff] [blame] | 190 | color: var(--diff-context-control-color); |
Andrew Bonventre | 2aa2212 | 2016-03-25 16:48:13 -0400 | [diff] [blame] | 191 | } |
| 192 | .contextControl gr-button { |
Wyatt Allen | 1097963 | 2016-06-01 15:13:33 -0700 | [diff] [blame] | 193 | display: inline-block; |
Andrew Bonventre | 2aa2212 | 2016-03-25 16:48:13 -0400 | [diff] [blame] | 194 | text-decoration: none; |
Becky Siegel | 8b60a51 | 2018-03-26 13:18:47 -0700 | [diff] [blame] | 195 | --gr-button: { |
Ole Rehmsen | 2bf4867 | 2019-05-28 17:26:17 +0200 | [diff] [blame] | 196 | color: var(--diff-context-control-color); |
Ben Rohlfs | b3d95cf | 2019-10-20 19:26:48 +0200 | [diff] [blame] | 197 | padding: var(--spacing-xs); |
Becky Siegel | 8b60a51 | 2018-03-26 13:18:47 -0700 | [diff] [blame] | 198 | } |
Andrew Bonventre | 2aa2212 | 2016-03-25 16:48:13 -0400 | [diff] [blame] | 199 | } |
| 200 | .contextControl td:not(.lineNum) { |
| 201 | text-align: center; |
| 202 | } |
Becky Siegel | 08ca826 | 2017-06-28 16:29:56 -0700 | [diff] [blame] | 203 | .displayLine .diff-row.target-row td { |
Kasper Nilsson | 83d8aac | 2018-04-17 13:39:50 +0200 | [diff] [blame] | 204 | box-shadow: inset 0 -1px var(--border-color); |
Becky Siegel | 6a7085e | 2016-11-02 16:25:53 -0700 | [diff] [blame] | 205 | } |
Andrew Bonventre | 2aa2212 | 2016-03-25 16:48:13 -0400 | [diff] [blame] | 206 | .br:after { |
| 207 | /* Line feed */ |
| 208 | content: '\A'; |
| 209 | } |
| 210 | .tab { |
| 211 | display: inline-block; |
| 212 | } |
Wyatt Allen | be0142c | 2016-08-25 11:31:42 -0700 | [diff] [blame] | 213 | .tab-indicator:before { |
Kasper Nilsson | 83d8aac | 2018-04-17 13:39:50 +0200 | [diff] [blame] | 214 | color: var(--diff-tab-indicator-color); |
Wyatt Allen | be0142c | 2016-08-25 11:31:42 -0700 | [diff] [blame] | 215 | /* >> character */ |
| 216 | content: '\00BB'; |
Orgad Shaneh | 537c0a5 | 2019-05-03 10:31:39 +0300 | [diff] [blame] | 217 | position: absolute; |
Andrew Bonventre | 2aa2212 | 2016-03-25 16:48:13 -0400 | [diff] [blame] | 218 | } |
Ben Rohlfs | 0037f28 | 2019-04-18 11:53:21 +0200 | [diff] [blame] | 219 | /* 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 Rohlfs | 4415e6b | 2019-10-29 08:46:43 +0100 | [diff] [blame] | 225 | border-radius: var(--border-radius, 4px); |
Kasper Nilsson | 83d8aac | 2018-04-17 13:39:50 +0200 | [diff] [blame] | 226 | background-color: var(--diff-trailing-whitespace-indicator); |
Wyatt Allen | d970500 | 2016-11-17 12:03:51 -0800 | [diff] [blame] | 227 | } |
Kasper Nilsson | b4893d0 | 2017-04-07 15:52:28 -0700 | [diff] [blame] | 228 | #diffHeader { |
Kasper Nilsson | 83d8aac | 2018-04-17 13:39:50 +0200 | [diff] [blame] | 229 | background-color: var(--table-header-background-color); |
| 230 | border-bottom: 1px solid var(--border-color); |
| 231 | color: var(--link-color); |
Ben Rohlfs | b3d95cf | 2019-10-20 19:26:48 +0200 | [diff] [blame] | 232 | padding: var(--spacing-m) 0 var(--spacing-m) 48px; |
Kasper Nilsson | b4893d0 | 2017-04-07 15:52:28 -0700 | [diff] [blame] | 233 | } |
Wyatt Allen | eb04344 | 2018-08-15 14:13:01 -0700 | [diff] [blame] | 234 | #loadingError, |
Wyatt Allen | 6df3f49 | 2017-06-13 15:32:51 -0700 | [diff] [blame] | 235 | #sizeWarning { |
| 236 | display: none; |
Ben Rohlfs | b3d95cf | 2019-10-20 19:26:48 +0200 | [diff] [blame] | 237 | margin: var(--spacing-l) auto; |
Wyatt Allen | 6df3f49 | 2017-06-13 15:32:51 -0700 | [diff] [blame] | 238 | max-width: 60em; |
| 239 | text-align: center; |
| 240 | } |
Wyatt Allen | eb04344 | 2018-08-15 14:13:01 -0700 | [diff] [blame] | 241 | #loadingError { |
| 242 | color: var(--error-text-color); |
| 243 | } |
Wyatt Allen | 6df3f49 | 2017-06-13 15:32:51 -0700 | [diff] [blame] | 244 | #sizeWarning gr-button { |
Ben Rohlfs | b3d95cf | 2019-10-20 19:26:48 +0200 | [diff] [blame] | 245 | margin: var(--spacing-l); |
Wyatt Allen | 6df3f49 | 2017-06-13 15:32:51 -0700 | [diff] [blame] | 246 | } |
Wyatt Allen | eb04344 | 2018-08-15 14:13:01 -0700 | [diff] [blame] | 247 | #loadingError.showError, |
Wyatt Allen | 6df3f49 | 2017-06-13 15:32:51 -0700 | [diff] [blame] | 248 | #sizeWarning.warn { |
| 249 | display: block; |
| 250 | } |
Wyatt Allen | ed628d7 | 2017-09-14 09:45:50 -0700 | [diff] [blame] | 251 | .target-row td.blame { |
Kasper Nilsson | e46284e | 2018-04-30 10:14:58 -0700 | [diff] [blame] | 252 | background: var(--diff-selection-background-color); |
Wyatt Allen | ed628d7 | 2017-09-14 09:45:50 -0700 | [diff] [blame] | 253 | } |
Wyatt Allen | 0309756 | 2017-09-30 14:54:01 +0100 | [diff] [blame] | 254 | col.blame { |
| 255 | display: none; |
| 256 | } |
Wyatt Allen | ed628d7 | 2017-09-14 09:45:50 -0700 | [diff] [blame] | 257 | td.blame { |
| 258 | display: none; |
Ben Rohlfs | b3d95cf | 2019-10-20 19:26:48 +0200 | [diff] [blame] | 259 | padding: 0 var(--spacing-m); |
Wyatt Allen | ed628d7 | 2017-09-14 09:45:50 -0700 | [diff] [blame] | 260 | white-space: pre; |
| 261 | } |
Wyatt Allen | 0309756 | 2017-09-30 14:54:01 +0100 | [diff] [blame] | 262 | :host(.showBlame) col.blame { |
| 263 | display: table-column; |
| 264 | } |
Wyatt Allen | ed628d7 | 2017-09-14 09:45:50 -0700 | [diff] [blame] | 265 | :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 Siegel | d3cd125 | 2018-03-19 14:36:52 -0700 | [diff] [blame] | 281 | /** Support the line length indicator **/ |
| 282 | .full-width td.content, |
| 283 | .full-width td.blank { |
Becky Siegel | 7982f5c | 2018-03-20 10:40:44 -0700 | [diff] [blame] | 284 | /* Base 64 encoded 1x1px of #ddd */ |
Paladox none | 0e7367c | 2018-03-22 18:30:26 +0000 | [diff] [blame] | 285 | background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mO8+x8AAr8B3gzOjaQAAAAASUVORK5CYII='); |
Becky Siegel | d3cd125 | 2018-03-19 14:36:52 -0700 | [diff] [blame] | 286 | background-position: var(--line-limit) 0; |
| 287 | background-repeat: repeat-y; |
| 288 | } |
Wyatt Allen | d13f418 | 2018-08-01 11:57:34 -0700 | [diff] [blame] | 289 | .newlineWarning { |
| 290 | color: var(--deemphasized-text-color); |
| 291 | text-align: center; |
| 292 | } |
| 293 | .newlineWarning.hidden { |
| 294 | display: none; |
| 295 | } |
brohlfs | b2577e4 | 2019-02-28 17:56:24 +0100 | [diff] [blame] | 296 | .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 Zhou | 170ffff | 2019-08-21 19:13:17 +0200 | [diff] [blame] | 305 | |
Tao Zhou | 5b47bbe | 2019-09-05 10:12:43 +0200 | [diff] [blame] | 306 | /** BEGIN: Select and copy for Polymer 2 */ |
| 307 | /** Below was copied and modified from the original css in gr-diff-selection.html */ |
Tao Zhou | 170ffff | 2019-08-21 19:13:17 +0200 | [diff] [blame] | 308 | .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 Zhou | 33ab43c | 2019-08-23 15:19:27 +0200 | [diff] [blame] | 330 | |
Tao Zhou | b8f9ad8 | 2019-09-17 12:13:43 +0200 | [diff] [blame] | 331 | /** 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 Zhou | 5b47bbe | 2019-09-05 10:12:43 +0200 | [diff] [blame] | 334 | -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 Zhou | 33ab43c | 2019-08-23 15:19:27 +0200 | [diff] [blame] | 341 | .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 Bonventre | 78792e8 | 2016-03-04 17:48:22 -0500 | [diff] [blame] | 346 | </style> |
Kasper Nilsson | 889ca95 | 2018-04-18 12:06:23 +0200 | [diff] [blame] | 347 | <style include="gr-syntax-theme"></style> |
Dmitrii Filippov | 9b4836a | 2019-08-16 15:06:34 +0200 | [diff] [blame] | 348 | <style include="gr-ranged-comment-theme"></style> |
Kasper Nilsson | b4893d0 | 2017-04-07 15:52:28 -0700 | [diff] [blame] | 349 | <div id="diffHeader" hidden$="[[_computeDiffHeaderHidden(_diffHeaderItems)]]"> |
| 350 | <template |
| 351 | is="dom-repeat" |
| 352 | items="[[_diffHeaderItems]]"> |
| 353 | <div>[[item]]</div> |
| 354 | </template> |
| 355 | </div> |
Ole Rehmsen | b1a7967 | 2018-08-27 22:43:38 +0200 | [diff] [blame] | 356 | <div class$="[[_computeContainerClass(loggedIn, viewMode, displayLine)]]" |
Viktar Donich | e134197 | 2016-06-09 16:39:17 -0700 | [diff] [blame] | 357 | on-tap="_handleTap"> |
Ole Rehmsen | b1a7967 | 2018-08-27 22:43:38 +0200 | [diff] [blame] | 358 | <gr-diff-selection diff="[[diff]]"> |
Viktar Donich | ab1b211 | 2016-06-10 12:47:57 -0700 | [diff] [blame] | 359 | <gr-diff-highlight |
| 360 | id="highlights" |
Ole Rehmsen | b1a7967 | 2018-08-27 22:43:38 +0200 | [diff] [blame] | 361 | logged-in="[[loggedIn]]" |
Ole Rehmsen | df6ab9c | 2018-11-09 17:54:16 +0100 | [diff] [blame] | 362 | comment-ranges="{{_commentRanges}}"> |
Viktar Donich | ab1b211 | 2016-06-10 12:47:57 -0700 | [diff] [blame] | 363 | <gr-diff-builder |
| 364 | id="diffBuilder" |
Ole Rehmsen | df6ab9c | 2018-11-09 17:54:16 +0100 | [diff] [blame] | 365 | comment-ranges="[[_commentRanges]]" |
brohlfs | b2577e4 | 2019-02-28 17:56:24 +0100 | [diff] [blame] | 366 | coverage-ranges="[[coverageRanges]]" |
Wyatt Allen | f0eb4bb | 2017-07-31 14:33:16 -0700 | [diff] [blame] | 367 | project-name="[[projectName]]" |
Ole Rehmsen | b1a7967 | 2018-08-27 22:43:38 +0200 | [diff] [blame] | 368 | diff="[[diff]]" |
Tao Zhou | de3c72f | 2019-12-03 17:29:16 +0100 | [diff] [blame] | 369 | path="[[path]]" |
Ravi Mistry | af1e0f8 | 2017-10-10 09:47:26 -0400 | [diff] [blame] | 370 | change-num="[[changeNum]]" |
| 371 | patch-num="[[patchRange.patchNum]]" |
Viktar Donich | ab1b211 | 2016-06-10 12:47:57 -0700 | [diff] [blame] | 372 | view-mode="[[viewMode]]" |
Becky Siegel | e7d19a9 | 2016-10-31 14:35:35 -0700 | [diff] [blame] | 373 | line-wrapping="[[lineWrapping]]" |
Viktar Donich | ab1b211 | 2016-06-10 12:47:57 -0700 | [diff] [blame] | 374 | is-image-diff="[[isImageDiff]]" |
Ole Rehmsen | b1a7967 | 2018-08-27 22:43:38 +0200 | [diff] [blame] | 375 | base-image="[[baseImage]]" |
Mayank Kumar | 41b0f95 | 2019-10-03 18:04:08 -0700 | [diff] [blame] | 376 | layers="[[layers]]" |
Ilham Kurnia | ace1647 | 2018-11-14 15:43:01 +0100 | [diff] [blame] | 377 | revision-image="[[revisionImage]]"> |
Kasper Nilsson | 40ea3ad | 2017-06-06 16:59:22 -0700 | [diff] [blame] | 378 | <table |
| 379 | id="diffTable" |
| 380 | class$="[[_diffTableClass]]" |
| 381 | role="presentation"></table> |
Tao Zhou | 33ab43c | 2019-08-23 15:19:27 +0200 | [diff] [blame] | 382 | |
| 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 Donich | ab1b211 | 2016-06-10 12:47:57 -0700 | [diff] [blame] | 389 | </gr-diff-builder> |
| 390 | </gr-diff-highlight> |
Viktar Donich | e134197 | 2016-06-09 16:39:17 -0700 | [diff] [blame] | 391 | </gr-diff-selection> |
Andrew Bonventre | 78792e8 | 2016-03-04 17:48:22 -0500 | [diff] [blame] | 392 | </div> |
Ole Rehmsen | b1a7967 | 2018-08-27 22:43:38 +0200 | [diff] [blame] | 393 | <div class$="[[_computeNewlineWarningClass(_newlineWarning, loading)]]"> |
Wyatt Allen | d13f418 | 2018-08-01 11:57:34 -0700 | [diff] [blame] | 394 | [[_newlineWarning]] |
| 395 | </div> |
Ole Rehmsen | b1a7967 | 2018-08-27 22:43:38 +0200 | [diff] [blame] | 396 | <div id="loadingError" class$="[[_computeErrorClass(errorMessage)]]"> |
| 397 | [[errorMessage]] |
Wyatt Allen | eb04344 | 2018-08-15 14:13:01 -0700 | [diff] [blame] | 398 | </div> |
Wyatt Allen | 6df3f49 | 2017-06-13 15:32:51 -0700 | [diff] [blame] | 399 | <div id="sizeWarning" class$="[[_computeWarningClass(_showWarning)]]"> |
| 400 | <p> |
| 401 | Prevented render because "Whole file" is enabled and this diff is very |
Wyatt Allen | 7e9b0c3 | 2018-09-14 17:19:39 -0700 | [diff] [blame] | 402 | large (about [[_diffLength]] lines). |
Wyatt Allen | 6df3f49 | 2017-06-13 15:32:51 -0700 | [diff] [blame] | 403 | </p> |
Milutin Kristofic | 63cf95d | 2019-09-27 15:41:53 +0200 | [diff] [blame] | 404 | <gr-button on-click="_handleLimitedBypass"> |
Wyatt Allen | 6df3f49 | 2017-06-13 15:32:51 -0700 | [diff] [blame] | 405 | Render with limited context |
| 406 | </gr-button> |
Milutin Kristofic | 63cf95d | 2019-09-27 15:41:53 +0200 | [diff] [blame] | 407 | <gr-button on-click="_handleFullBypass"> |
Wyatt Allen | 6df3f49 | 2017-06-13 15:32:51 -0700 | [diff] [blame] | 408 | Render anyway (may be slow) |
| 409 | </gr-button> |
| 410 | </div> |
Andrew Bonventre | 78792e8 | 2016-03-04 17:48:22 -0500 | [diff] [blame] | 411 | </template> |
Andrew Bonventre | 2aa2212 | 2016-03-25 16:48:13 -0400 | [diff] [blame] | 412 | <script src="gr-diff-line.js"></script> |
| 413 | <script src="gr-diff-group.js"></script> |
Andrew Bonventre | 78792e8 | 2016-03-04 17:48:22 -0500 | [diff] [blame] | 414 | <script src="gr-diff.js"></script> |
| 415 | </dom-module> |