Commit 7282c6be authored by Olga Sharonova's avatar Olga Sharonova Committed by Commit Bot

Revert "Local NTP: make past search matches change realbox icon to clock"

This reverts commit aaab30e7.

Reason for revert: BUG:1044520

Original change's description:
> Local NTP: make past search matches change realbox icon to clock
> 
> R=​mahmadi@chromium.org
> 
> Fixed: 1043335
> Change-Id: I98b1fbcc0a5b5e0d48334e8eb33a31c66f07a4fe
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2008614
> Auto-Submit: Dan Beam <dbeam@chromium.org>
> Reviewed-by: Moe Ahmadi <mahmadi@chromium.org>
> Commit-Queue: Dan Beam <dbeam@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#733854}

TBR=dbeam@chromium.org,mahmadi@chromium.org

Change-Id: I2b2371de6ae0e3144a3bd827539526864859c570
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2013245Reviewed-by: default avatarOlga Sharonova <olka@chromium.org>
Commit-Queue: Olga Sharonova <olka@chromium.org>
Cr-Commit-Position: refs/heads/master@{#733919}
parent 64bb5633
......@@ -227,20 +227,6 @@ body.hide-fakebox #fakebox {
#realbox-icon {
background-position: center center;
background-repeat: no-repeat;
bottom: 0;
left: 16px;
margin: auto;
position: absolute;
top: 0;
width: 24px;
}
[dir=rtl] #realbox-icon {
left: auto;
right: 16px;
}
#realbox-icon.load-favicon {
background-size: 24px;
}
......@@ -514,7 +500,8 @@ html[dir=rtl] .microphone-icon {
right: auto;
}
#realbox-input-wrapper > :-webkit-any(#realbox-icon, .microphone-icon) {
#realbox-input-wrapper > :-webkit-any(.google-g-icon, .microphone-icon,
.search-icon) {
z-index: 3;
}
......
......@@ -78,8 +78,7 @@
<div id="realbox-container" $i18n{hiddenIfRealboxDisabled}>
<div id="realbox-input-wrapper">
<div id="realbox-icon" class="$i18n{realboxIconClass}"
data-realbox-icon-class="$i18n{realboxIconClass}"></div>
<div id="realbox-icon" class="$i18n{realboxIconClass}"></div>
<input id="realbox" type="search" autocomplete="off" spellcheck="false"
aria-live="polite" autofocus>
<button id="realbox-microphone" class="microphone-icon" hidden></button>
......
......@@ -91,7 +91,6 @@ const CLASSES = {
IMAGE_CONTAINER: 'image-container',
INITED: 'inited', // Reveals the <body> once init() is done.
LEFT_ALIGN_ATTRIBUTION: 'left-align-attribution',
LOAD_FAVICON: 'load-favicon',
// The image next to a realbox match.
MATCH_IMAGE: 'match-image',
// Vertically centers the most visited section for a non-Google provided page.
......@@ -2119,19 +2118,13 @@ function setFakeboxVisibility(show) {
/** @param {!AutocompleteMatch|undefined} match */
function setRealboxIcon(match) {
const loadFavicon = match && !match.isSearchType;
const showIcon = match && !match.isSearchType;
const realboxIcon = $(IDS.REALBOX_ICON);
realboxIcon.style.webkitMask = loadFavicon ? 'none' : '';
realboxIcon.style.backgroundColor = loadFavicon ? 'transparent' : '';
realboxIcon.style.webkitMask = showIcon ? 'none' : '';
realboxIcon.style.backgroundColor = showIcon ? 'transparent' : '';
realboxIcon.style.backgroundImage =
loadFavicon ? `url(${getIconUrl(match.destinationUrl)})` : '';
const historical = match && SEARCH_HISTORY_MATCH_TYPES.includes(match.type);
realboxIcon.className = loadFavicon ?
CLASSES.LOAD_FAVICON :
(historical ? CLASSES.CLOCK_ICON :
realboxIcon.dataset['realboxIconClass']);
showIcon ? `url(${getIconUrl(match.destinationUrl)})` : '';
}
/** @param {boolean} visible */
......
......@@ -70,8 +70,7 @@
<div id="realbox-container">
<div id="realbox-input-wrapper">
<div id="realbox-icon" class="search-icon"
data-realbox-icon-class="search-icon"></div>
<div id="realbox-icon" class="search-icon"></div>
<input id="realbox" type="search" autocomplete="off"
spellcheck="false" autofocus>
<button id="realbox-microphone" class="microphone-icon" hidden>
......
......@@ -27,7 +27,6 @@ test.realbox.IDS = {
* @const
*/
test.realbox.CLASSES = {
CLOCK_ICON: 'clock-icon',
HAS_IMAGE: 'has-image',
IMAGE_CONTAINER: 'image-container',
MATCH_IMAGE: 'match-image',
......@@ -1262,14 +1261,13 @@ test.realbox2.testRealboxIconPrefixSearch = function() {
matches: [
test.realbox.getUrlMatch({allowedToBeDefaultMatch: true}),
test.realbox.getSearchMatch(),
test.realbox.getSearchMatch({type: 'search-history'}),
],
});
assertTrue(test.realbox.areMatchesShowing());
// First URL match should be showing and the favicon should be in the realbox.
const matchEls = $(test.realbox.IDS.REALBOX_MATCHES).children;
assertEquals(3, matchEls.length);
assertEquals(2, matchEls.length);
assertTrue(matchEls[0].classList.contains(test.realbox.CLASSES.SELECTED));
assertTrue(!!realboxIcon.style.backgroundImage);
......@@ -1285,12 +1283,6 @@ test.realbox2.testRealboxIconPrefixSearch = function() {
assertTrue(matchEls[1].classList.contains(test.realbox.CLASSES.SELECTED));
assertFalse(!!realboxIcon.style.backgroundImage);
test.realbox.realboxEl.dispatchEvent(arrowDown);
// Third search match should change to clock icon.
assertTrue(matchEls[2].classList.contains(test.realbox.CLASSES.SELECTED));
assertEquals(realboxIcon.className, test.realbox.CLASSES.CLOCK_ICON);
const escapeToDefaultMatch = new KeyboardEvent('keydown', {
bubbles: true,
cancelable: true,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment