| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 "use strict"; | 5 "use strict"; |
| 6 | 6 |
| 7 class TextView extends View { | 7 class TextView extends View { |
| 8 constructor(id, broker, patterns, allowSpanSelection) { | 8 constructor(id, broker, patterns, allowSpanSelection) { |
| 9 super(id, broker); | 9 super(id, broker); |
| 10 let view = this; | 10 let view = this; |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 | 113 |
| 114 createFragment(text, style) { | 114 createFragment(text, style) { |
| 115 let view = this; | 115 let view = this; |
| 116 let span = document.createElement("SPAN"); | 116 let span = document.createElement("SPAN"); |
| 117 span.onmousedown = function(e) { | 117 span.onmousedown = function(e) { |
| 118 view.mouseDownSpan(span, e); | 118 view.mouseDownSpan(span, e); |
| 119 } | 119 } |
| 120 if (style != undefined) { | 120 if (style != undefined) { |
| 121 span.classList.add(style); | 121 span.classList.add(style); |
| 122 } | 122 } |
| 123 span.innerText = text; | 123 span.innerHTML = text; |
| 124 return span; | 124 return span; |
| 125 } | 125 } |
| 126 | 126 |
| 127 appendFragment(li, fragment) { | 127 appendFragment(li, fragment) { |
| 128 li.appendChild(fragment); | 128 li.appendChild(fragment); |
| 129 } | 129 } |
| 130 | 130 |
| 131 processLine(line) { | 131 processLine(line) { |
| 132 let view = this; | 132 let view = this; |
| 133 let result = []; | 133 let result = []; |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 lineLocation(li) { | 287 lineLocation(li) { |
| 288 let view = this; | 288 let view = this; |
| 289 for (let i = 0; i < li.children.length; ++i) { | 289 for (let i = 0; i < li.children.length; ++i) { |
| 290 let fragment = li.children[i]; | 290 let fragment = li.children[i]; |
| 291 if (fragment.location != undefined && !view.allowSpanSelection) { | 291 if (fragment.location != undefined && !view.allowSpanSelection) { |
| 292 return fragment.location; | 292 return fragment.location; |
| 293 } | 293 } |
| 294 } | 294 } |
| 295 } | 295 } |
| 296 } | 296 } |
| OLD | NEW |