Title: [147478] trunk/Source/WebCore
Revision
147478
Author
commit-qu...@webkit.org
Date
2013-04-02 11:37:44 -0700 (Tue, 02 Apr 2013)

Log Message

Web Inspector: Make Source Frame & status bar a layout boundary
https://bugs.webkit.org/show_bug.cgi?id=112353

Patch by Andrey Lushnikov <lushni...@chromium.org> on 2013-04-02
Reviewed by Pavel Feldman.

No new tests: no change in behaviour.

- Add View.markAsLayoutBoundary method to mark a view as a layout
boundary. This will force this view to autoupdate its height to actual
pixel value.
- Mark both CodeMirrorTextEditor and DefaultTextEditor as a layout
boundary.
- Mark main-status-bar element with a layout-boundary class.

* inspector/front-end/CodeMirrorTextEditor.js:
(WebInspector.CodeMirrorTextEditor):
* inspector/front-end/DefaultTextEditor.js:
* inspector/front-end/View.js:
(WebInspector.View.prototype.markAsLayoutBoundary):
(WebInspector.View.prototype._processWillShow):
(WebInspector.View.prototype._processWasShown):
(WebInspector.View.prototype._processOnResize):
* inspector/front-end/inspector.css:
(.layout-boundary):
* inspector/front-end/inspector.html:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (147477 => 147478)


--- trunk/Source/WebCore/ChangeLog	2013-04-02 18:36:40 UTC (rev 147477)
+++ trunk/Source/WebCore/ChangeLog	2013-04-02 18:37:44 UTC (rev 147478)
@@ -1,3 +1,31 @@
+2013-04-02  Andrey Lushnikov  <lushni...@chromium.org>
+
+        Web Inspector: Make Source Frame & status bar a layout boundary
+        https://bugs.webkit.org/show_bug.cgi?id=112353
+
+        Reviewed by Pavel Feldman.
+
+        No new tests: no change in behaviour.
+
+        - Add View.markAsLayoutBoundary method to mark a view as a layout
+        boundary. This will force this view to autoupdate its height to actual
+        pixel value.
+        - Mark both CodeMirrorTextEditor and DefaultTextEditor as a layout
+        boundary.
+        - Mark main-status-bar element with a layout-boundary class.
+
+        * inspector/front-end/CodeMirrorTextEditor.js:
+        (WebInspector.CodeMirrorTextEditor):
+        * inspector/front-end/DefaultTextEditor.js:
+        * inspector/front-end/View.js:
+        (WebInspector.View.prototype.markAsLayoutBoundary):
+        (WebInspector.View.prototype._processWillShow):
+        (WebInspector.View.prototype._processWasShown):
+        (WebInspector.View.prototype._processOnResize):
+        * inspector/front-end/inspector.css:
+        (.layout-boundary):
+        * inspector/front-end/inspector.html:
+
 2013-04-02  Alexey Proskuryakov  <a...@apple.com>
 
         <rdar://problem/13551119> [WK2] Crashes in NetworkProcess when canceling loads

Modified: trunk/Source/WebCore/inspector/front-end/CodeMirrorTextEditor.js (147477 => 147478)


--- trunk/Source/WebCore/inspector/front-end/CodeMirrorTextEditor.js	2013-04-02 18:36:40 UTC (rev 147477)
+++ trunk/Source/WebCore/inspector/front-end/CodeMirrorTextEditor.js	2013-04-02 18:37:44 UTC (rev 147478)
@@ -81,7 +81,9 @@
     this._lastRange = this.range();
 
     this.element.firstChild.addStyleClass("source-code");
-    this.element.firstChild.addStyleClass("fill");
+    this.element.addStyleClass("fill");
+    this.markAsLayoutBoundary();
+
     this._elementToWidget = new Map();
     this._nestedUpdatesCounter = 0;
 

Modified: trunk/Source/WebCore/inspector/front-end/DefaultTextEditor.js (147477 => 147478)


--- trunk/Source/WebCore/inspector/front-end/DefaultTextEditor.js	2013-04-02 18:36:40 UTC (rev 147477)
+++ trunk/Source/WebCore/inspector/front-end/DefaultTextEditor.js	2013-04-02 18:37:44 UTC (rev 147478)
@@ -45,6 +45,7 @@
     this.registerRequiredCSS("textEditor.css");
 
     this.element.className = "text-editor monospace";
+    this.markAsLayoutBoundary();
 
     // Prevent middle-click pasting in the editor unless it is explicitly enabled for certain component.
     this.element.addEventListener("mouseup", preventDefaultOnMouseUp.bind(this), false);

Modified: trunk/Source/WebCore/inspector/front-end/View.js (147477 => 147478)


--- trunk/Source/WebCore/inspector/front-end/View.js	2013-04-02 18:36:40 UTC (rev 147477)
+++ trunk/Source/WebCore/inspector/front-end/View.js	2013-04-02 18:37:44 UTC (rev 147478)
@@ -59,6 +59,11 @@
         this._isRoot = true;
     },
 
+    markAsLayoutBoundary: function()
+    {
+        this.element.addStyleClass("layout-boundary");
+    },
+
     /**
      * @return {?WebInspector.View}
      */
@@ -107,6 +112,8 @@
     _processWillShow: function()
     {
         this._loadCSSIfNeeded();
+        if (this.element.hasStyleClass("layout-boundary"))
+            this.element.style.removeProperty("height");
         this._callOnVisibleChildren(this._processWillShow);
     },
 
@@ -119,6 +126,8 @@
         this._notify(this.wasShown);
         this._notify(this.onResize);
         this._callOnVisibleChildren(this._processWasShown);
+        if (this.element.hasStyleClass("layout-boundary"))
+            this.element.style.height = this.element.offsetHeight + "px";
     },
 
     _processWillHide: function()
@@ -144,8 +153,12 @@
             return;
         if (!this.isShowing())
             return;
+        if (this.element.hasStyleClass("layout-boundary"))
+            this.element.style.removeProperty("height");
         this._notify(this.onResize);
         this._callOnVisibleChildren(this._processOnResize);
+        if (this.element.hasStyleClass("layout-boundary"))
+            this.element.style.height = this.element.offsetHeight + "px";
     },
 
     /**

Modified: trunk/Source/WebCore/inspector/front-end/inspector.css (147477 => 147478)


--- trunk/Source/WebCore/inspector/front-end/inspector.css	2013-04-02 18:36:40 UTC (rev 147477)
+++ trunk/Source/WebCore/inspector/front-end/inspector.css	2013-04-02 18:37:44 UTC (rev 147478)
@@ -51,6 +51,13 @@
     white-space: nowrap !important;
 }
 
+.layout-boundary {
+    width: 100%;
+    overflow: hidden;
+    /* position must be relative or absolute */
+    /* height must be a pixel value */
+}
+
 #toolbar {
     position: absolute;
     top: 0;

Modified: trunk/Source/WebCore/inspector/front-end/inspector.html (147477 => 147478)


--- trunk/Source/WebCore/inspector/front-end/inspector.html	2013-04-02 18:36:40 UTC (rev 147477)
+++ trunk/Source/WebCore/inspector/front-end/inspector.html	2013-04-02 18:37:44 UTC (rev 147478)
@@ -199,7 +199,7 @@
         <div id="floating-status-bar-container" class="status-bar"><div id="floating-status-bar-resizer"></div></div>
     </div>
     <div id="drawer"></div>
-    <div id="main-status-bar" class="status-bar">
+    <div id="main-status-bar" class="status-bar layout-boundary">
         <div id="bottom-status-bar-container">
             <div id="panel-status-bar">
                 <div id="drawer-view-anchor"></div>
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to