Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2152)

Unified Diff: chrome/browser/resources/md_history/searched_label.js

Issue 2313823002: MD History: Remove shadow root from <history-searched-label> (Closed)
Patch Set: Fix tests Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/md_history/searched_label.js
diff --git a/chrome/browser/resources/md_history/searched_label.js b/chrome/browser/resources/md_history/searched_label.js
index 3eeffb123f59c20e38395d9dfa0aa4230e32b0cd..c22803c205e60c96bf1d39924b63f297a195f41f 100644
--- a/chrome/browser/resources/md_history/searched_label.js
+++ b/chrome/browser/resources/md_history/searched_label.js
@@ -22,29 +22,28 @@ Polymer({
*/
setSearchedTextToBold_: function() {
var i = 0;
- var titleElem = this.$.container;
var titleText = this.title;
if (this.searchTerm == '' || this.searchTerm == null) {
- titleElem.textContent = titleText;
+ this.textContent = titleText;
return;
}
var re = new RegExp(quoteString(this.searchTerm), 'gim');
var match;
- titleElem.textContent = '';
+ this.textContent = '';
while (match = re.exec(titleText)) {
if (match.index > i)
Dan Beam 2016/09/06 15:54:32 nit: curlies
- titleElem.appendChild(document.createTextNode(
+ this.appendChild(document.createTextNode(
titleText.slice(i, match.index)));
i = re.lastIndex;
// Mark the highlighted text in bold.
var b = document.createElement('b');
b.textContent = titleText.substring(match.index, i);
- titleElem.appendChild(b);
+ this.appendChild(b);
}
if (i < titleText.length)
- titleElem.appendChild(
+ this.appendChild(
Dan Beam 2016/09/06 15:54:32 nit: curlies
document.createTextNode(titleText.slice(i)));
},
});
« no previous file with comments | « chrome/browser/resources/md_history/searched_label.html ('k') | chrome/test/data/webui/md_history/history_list_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698