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

Unified Diff: Source/devtools/front_end/profiler/CanvasProfileView.js

Issue 446763003: DevTools: Get rid of CSS hackery in CanvasProfiler. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/devtools/front_end/canvasProfiler.css ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/profiler/CanvasProfileView.js
diff --git a/Source/devtools/front_end/profiler/CanvasProfileView.js b/Source/devtools/front_end/profiler/CanvasProfileView.js
index 2e770169e0a2c7de1650e52af965d0c7ff1e0765..10f8402647866bea687b231abb6d7def1fea200d 100644
--- a/Source/devtools/front_end/profiler/CanvasProfileView.js
+++ b/Source/devtools/front_end/profiler/CanvasProfileView.js
@@ -50,14 +50,15 @@ WebInspector.CanvasProfileView = function(profile)
this._imageSplitView = new WebInspector.SplitView(false, true, "canvasProfileViewSplitViewState", 300);
this._imageSplitView.show(this._replayInfoSplitView.mainElement());
- var replayImageContainerView = new WebInspector.VBox();
+ var replayImageContainerView = new WebInspector.VBoxWithResizeCallback(this._onReplayImageResize.bind(this));
replayImageContainerView.setMinimumSize(50, 28);
replayImageContainerView.show(this._imageSplitView.mainElement());
- // NOTE: The replayImageContainer can NOT be a flex div (e.g. VBox or SplitView elements)!
- var replayImageContainer = replayImageContainerView.element.createChild("div");
+ var replayImageContainer = replayImageContainerView.element;
replayImageContainer.id = "canvas-replay-image-container";
- this._replayImageElement = replayImageContainer.createChild("img", "canvas-replay-image");
+ var replayImageParent = replayImageContainer.createChild("div", "canvas-replay-image-parent");
+ replayImageParent.createChild("span"); // Helps to align the image vertically.
+ this._replayImageElement = replayImageParent.createChild("img");
this._debugInfoElement = replayImageContainer.createChild("div", "canvas-debug-info hidden");
this._spinnerIcon = replayImageContainer.createChild("div", "spinner-icon small hidden");
@@ -129,6 +130,13 @@ WebInspector.CanvasProfileView.prototype = {
return this._profile;
},
+ _onReplayImageResize: function()
+ {
+ var parent = this._replayImageElement.parentElement;
+ this._replayImageElement.style.maxWidth = parent.clientWidth + "px";
+ this._replayImageElement.style.maxHeight = parent.clientHeight + "px";
+ },
+
/**
* @override
* @return {!Array.<!Element>}
« no previous file with comments | « Source/devtools/front_end/canvasProfiler.css ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698