Commit 9e53b192 authored by dgozman's avatar dgozman Committed by Commit bot

[DevTools] Migrate FileBasedSearchResultsPane to TreeOutlineInShadow.

This is a step towards turning all tree outlines into independent web components,
removing global styles related to it and allowing more components to encapsulate their inner details.

BUG=none

Review-Url: https://codereview.chromium.org/2339683005
Cr-Commit-Position: refs/heads/master@{#418782}
parent 380aafbf
......@@ -624,6 +624,7 @@ devtools_source_frame_js_files = [
]
devtools_sources_js_files = [
"front_end/sources/eventListenerBreakpoints.css",
"front_end/sources/fileBasedSearchResultsPane.css",
"front_end/sources/navigatorView.css",
"front_end/sources/revisionHistory.css",
"front_end/sources/serviceWorkersSidebar.css",
......
......@@ -12,10 +12,8 @@ WebInspector.FileBasedSearchResultsPane = function(searchConfig)
WebInspector.SearchResultsPane.call(this, searchConfig);
this._searchResults = [];
this.element.id = "search-results-pane-file-based";
this._treeOutline = new TreeOutline();
this._treeOutline.element.classList.add("search-results-outline-disclosure");
this._treeOutline = new TreeOutlineInShadow();
this._treeOutline.registerRequiredCSS("sources/fileBasedSearchResultsPane.css");
this.element.appendChild(this._treeOutline.element);
this._matchesExpandedCount = 0;
......
/*
* Copyright 2016 The Chromium Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
:host {
padding: 0;
margin: 0;
}
.tree-outline {
padding: 0;
}
.tree-outline ol {
padding: 0;
}
li.search-result {
font-size: 11px;
padding: 2px 0 2px 4px;
word-wrap: normal;
white-space: pre;
cursor: pointer;
}
li.search-result:hover {
background-color: rgba(121, 121, 121, 0.1);
}
li.search-result .search-result-file-name {
font-weight: bold;
color: #222;
}
li.search-result .search-result-matches-count {
margin-left: 5px;
color: #222;
}
li.show-more-matches {
padding: 4px 0;
color: #222;
cursor: pointer;
font-size: 11px;
margin-left: 20px;
}
li.show-more-matches:hover {
text-decoration: underline;
}
li.search-match {
word-wrap: normal;
white-space: pre;
min-height: 12px;
}
li.search-match::before {
display: none;
}
li.search-match .search-match-line-number {
color: rgb(128, 128, 128);
text-align: right;
vertical-align: top;
word-break: normal;
padding-right: 4px;
padding-left: 6px;
margin-right: 5px;
border-right: 1px solid #BBB;
}
li.search-match:not(:hover) .search-match-line-number {
background-color: #F0F0F0;
}
li.search-match:hover {
background-color: rgba(56, 121, 217, 0.1);
}
li.search-match .highlighted-match {
background-color: #F1EA00;
}
:host-context(.-theme-with-dark-background) li.search-match .highlighted-match {
background-color: hsl(133, 100%, 30%) !important;
}
.tree-outline a {
text-decoration: none;
display: block;
}
li.search-match .search-match-content {
color: #000;
}
......@@ -549,6 +549,7 @@
"resources": [
"uiList.css",
"eventListenerBreakpoints.css",
"fileBasedSearchResultsPane.css",
"navigatorView.css",
"revisionHistory.css",
"serviceWorkersSidebar.css",
......
......@@ -89,37 +89,6 @@
overflow: hidden;
}
#search-results-pane-file-based li {
list-style: none;
}
#search-results-pane-file-based ol {
-webkit-padding-start: 0;
margin-top: 0;
}
#search-results-pane-file-based ol.children {
display: none;
}
#search-results-pane-file-based ol.children.expanded {
display: block;
}
#search-results-pane-file-based li.parent::before {
-webkit-user-select: none;
background-image: url(Images/toolbarButtonGlyphs.png);
background-size: 352px 168px;
opacity: 0.5;
width: 12px;
content: "a";
color: transparent;
margin-left: -5px;
padding-right: 4px;
display: inline-block;
box-sizing: border-box;
}
@media (-webkit-min-device-pixel-ratio: 1.1) {
.search-drawer-header .search-icon {
background-image: url(Images/toolbarButtonGlyphs_2x.png);
......@@ -128,95 +97,8 @@
.search-drawer-header .search-cancel-button::before {
background-image: url(Images/toolbarButtonGlyphs_2x.png);
}
#search-results-pane-file-based li.parent::before {
background-image: url(Images/toolbarButtonGlyphs_2x.png);
}
} /* media */
#search-results-pane-file-based li.parent::before {
background-position: -4px -96px;
}
#search-results-pane-file-based li.parent.expanded::before {
background-position: -20px -96px;
}
#search-results-pane-file-based .search-result {
font-size: 11px;
padding: 2px 0 2px 10px;
word-wrap: normal;
white-space: pre;
cursor: pointer;
}
#search-results-pane-file-based .search-result:hover {
background-color: rgba(121, 121, 121, 0.1);
}
#search-results-pane-file-based .search-result .search-result-file-name {
font-weight: bold;
color: #222;
}
#search-results-pane-file-based .search-result .search-result-matches-count {
margin-left: 5px;
color: #222;
}
#search-results-pane-file-based .show-more-matches {
padding: 4px 0;
color: #222;
cursor: pointer;
font-size: 11px;
margin-left: 20px;
}
#search-results-pane-file-based .show-more-matches:hover {
text-decoration: underline;
}
#search-results-pane-file-based .search-match {
word-wrap: normal;
white-space: pre;
}
#search-results-pane-file-based .search-match .search-match-line-number {
color: rgb(128, 128, 128);
text-align: right;
vertical-align: top;
word-break: normal;
padding-right: 4px;
padding-left: 6px;
margin-right: 5px;
border-right: 1px solid #BBB;
}
#search-results-pane-file-based .search-match:not(:hover) .search-match-line-number {
background-color: #F0F0F0;
}
#search-results-pane-file-based .search-match:hover {
background-color: rgba(56, 121, 217, 0.1);
}
#search-results-pane-file-based .search-match .highlighted-match {
background-color: #F1EA00;
}
:host-context(.-theme-with-dark-background) #search-results-pane-file-based .search-match .highlighted-match {
background-color: hsl(133, 100%, 30%) !important;
}
#search-results-pane-file-based a {
text-decoration: none;
display: block;
}
#search-results-pane-file-based .search-match .search-match-content {
color: #000;
}
.search-view .search-results {
overflow-y: auto;
display: flex;
......
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