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

Unified Diff: third_party/WebKit/Source/devtools/front_end/ui/UIUtils.js

Issue 2891383002: Force non overlay scrollbar in Devtools/Performance for Aura Overlay Scrollbar (Closed)
Patch Set: alph comments addressed Created 3 years, 7 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
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/perf_ui/flameChart.css ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/ui/UIUtils.js
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/UIUtils.js b/third_party/WebKit/Source/devtools/front_end/ui/UIUtils.js
index d952835790792d5407b3e3abc269ce4a9fd56e7b..ea0a021fb2e34331e953b1e088d703fb9b721d85 100644
--- a/third_party/WebKit/Source/devtools/front_end/ui/UIUtils.js
+++ b/third_party/WebKit/Source/devtools/front_end/ui/UIUtils.js
@@ -669,6 +669,24 @@ UI.installComponentRootStyles = function(element) {
UI.appendStyle(element, 'ui/inspectorCommon.css');
UI.themeSupport.injectHighlightStyleSheets(element);
element.classList.add('platform-' + Host.platform());
+
+ /**
+ * Detect overlay scrollbar enable by checking clientWidth and offsetWidth of
+ * overflow: scroll div.
+ * @param {?Document=} document
+ * @return {boolean}
+ */
+ function overlayScrollbarEnabled(document) {
+ var scrollDiv = document.createElement('div');
+ scrollDiv.setAttribute('style', 'width: 100px; height: 100px; overflow: scroll;');
+ document.body.appendChild(scrollDiv);
+ var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth;
+ document.body.removeChild(scrollDiv);
+ return scrollbarWidth === 0;
+ }
+
+ if (!Host.isMac() && overlayScrollbarEnabled(element.ownerDocument))
+ element.classList.add('overlay-scrollbar-enabled');
};
/**
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/perf_ui/flameChart.css ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698