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

Side by Side Diff: chrome/browser/resources/settings/search_settings.js

Issue 2226883002: MD Settings: Fix missing yellow rectangle highlighting. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/resources/settings/settings_shared_css.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium 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 cr.define('settings', function() { 5 cr.define('settings', function() {
6 /** @const {string} */ 6 /** @const {string} */
7 var WRAPPER_CSS_CLASS = 'search-highlight-wrapper'; 7 var WRAPPER_CSS_CLASS = 'search-highlight-wrapper';
8 8
9 /** @const {string} */ 9 /** @const {string} */
10 var HIT_CSS_CLASS = 'search-highlight-hit'; 10 var HIT_CSS_CLASS = 'search-highlight-hit';
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 // Use existing node as placeholder to determine where to insert the 95 // Use existing node as placeholder to determine where to insert the
96 // replacement content. 96 // replacement content.
97 node.parentNode.replaceChild(wrapper, node); 97 node.parentNode.replaceChild(wrapper, node);
98 98
99 for (var i = 0; i < tokens.length; ++i) { 99 for (var i = 0; i < tokens.length; ++i) {
100 if (i % 2 == 0) { 100 if (i % 2 == 0) {
101 wrapper.appendChild(document.createTextNode(tokens[i])); 101 wrapper.appendChild(document.createTextNode(tokens[i]));
102 } else { 102 } else {
103 var span = document.createElement('span'); 103 var span = document.createElement('span');
104 span.classList.add(HIT_CSS_CLASS); 104 span.classList.add(HIT_CSS_CLASS);
105 span.style.backgroundColor = '#ffeb3b'; // --var(--paper-yellow-500)
105 span.textContent = tokens[i]; 106 span.textContent = tokens[i];
106 wrapper.appendChild(span); 107 wrapper.appendChild(span);
107 } 108 }
108 } 109 }
109 } 110 }
110 111
111 /** 112 /**
112 * Traverses the entire DOM (including Shadow DOM), finds text nodes that 113 * Traverses the entire DOM (including Shadow DOM), finds text nodes that
113 * match the given regular expression and applies the highlight UI. It also 114 * match the given regular expression and applies the highlight UI. It also
114 * ensures that <settings-section> instances become visible if any matches 115 * ensures that <settings-section> instances become visible if any matches
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after
576 function setSearchManagerForTesting(searchManager) { 577 function setSearchManagerForTesting(searchManager) {
577 SearchManagerImpl.instance_ = searchManager; 578 SearchManagerImpl.instance_ = searchManager;
578 } 579 }
579 580
580 return { 581 return {
581 getSearchManager: getSearchManager, 582 getSearchManager: getSearchManager,
582 setSearchManagerForTesting: setSearchManagerForTesting, 583 setSearchManagerForTesting: setSearchManagerForTesting,
583 SearchRequest: SearchRequest, 584 SearchRequest: SearchRequest,
584 }; 585 };
585 }); 586 });
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/resources/settings/settings_shared_css.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698