Changeset 147478 in webkit


Ignore:
Timestamp:
Apr 2, 2013 11:37:44 AM (11 years ago)
Author:
commit-queue@webkit.org
Message:

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

Patch by Andrey Lushnikov <lushnikov@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:
Location:
trunk/Source/WebCore
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r147476 r147478  
     12013-04-02  Andrey Lushnikov  <lushnikov@chromium.org>
     2
     3        Web Inspector: Make Source Frame & status bar a layout boundary
     4        https://bugs.webkit.org/show_bug.cgi?id=112353
     5
     6        Reviewed by Pavel Feldman.
     7
     8        No new tests: no change in behaviour.
     9
     10        - Add View.markAsLayoutBoundary method to mark a view as a layout
     11        boundary. This will force this view to autoupdate its height to actual
     12        pixel value.
     13        - Mark both CodeMirrorTextEditor and DefaultTextEditor as a layout
     14        boundary.
     15        - Mark main-status-bar element with a layout-boundary class.
     16
     17        * inspector/front-end/CodeMirrorTextEditor.js:
     18        (WebInspector.CodeMirrorTextEditor):
     19        * inspector/front-end/DefaultTextEditor.js:
     20        * inspector/front-end/View.js:
     21        (WebInspector.View.prototype.markAsLayoutBoundary):
     22        (WebInspector.View.prototype._processWillShow):
     23        (WebInspector.View.prototype._processWasShown):
     24        (WebInspector.View.prototype._processOnResize):
     25        * inspector/front-end/inspector.css:
     26        (.layout-boundary):
     27        * inspector/front-end/inspector.html:
     28
    1292013-04-02  Alexey Proskuryakov  <ap@apple.com>
    230
  • trunk/Source/WebCore/inspector/front-end/CodeMirrorTextEditor.js

    r147451 r147478  
    8282
    8383    this.element.firstChild.addStyleClass("source-code");
    84     this.element.firstChild.addStyleClass("fill");
     84    this.element.addStyleClass("fill");
     85    this.markAsLayoutBoundary();
     86
    8587    this._elementToWidget = new Map();
    8688    this._nestedUpdatesCounter = 0;
  • trunk/Source/WebCore/inspector/front-end/DefaultTextEditor.js

    r147415 r147478  
    4646
    4747    this.element.className = "text-editor monospace";
     48    this.markAsLayoutBoundary();
    4849
    4950    // Prevent middle-click pasting in the editor unless it is explicitly enabled for certain component.
  • trunk/Source/WebCore/inspector/front-end/View.js

    r145717 r147478  
    6060    },
    6161
     62    markAsLayoutBoundary: function()
     63    {
     64        this.element.addStyleClass("layout-boundary");
     65    },
     66
    6267    /**
    6368     * @return {?WebInspector.View}
     
    108113    {
    109114        this._loadCSSIfNeeded();
     115        if (this.element.hasStyleClass("layout-boundary"))
     116            this.element.style.removeProperty("height");
    110117        this._callOnVisibleChildren(this._processWillShow);
    111118    },
     
    120127        this._notify(this.onResize);
    121128        this._callOnVisibleChildren(this._processWasShown);
     129        if (this.element.hasStyleClass("layout-boundary"))
     130            this.element.style.height = this.element.offsetHeight + "px";
    122131    },
    123132
     
    145154        if (!this.isShowing())
    146155            return;
     156        if (this.element.hasStyleClass("layout-boundary"))
     157            this.element.style.removeProperty("height");
    147158        this._notify(this.onResize);
    148159        this._callOnVisibleChildren(this._processOnResize);
     160        if (this.element.hasStyleClass("layout-boundary"))
     161            this.element.style.height = this.element.offsetHeight + "px";
    149162    },
    150163
  • trunk/Source/WebCore/inspector/front-end/inspector.css

    r147474 r147478  
    5252}
    5353
     54.layout-boundary {
     55    width: 100%;
     56    overflow: hidden;
     57    /* position must be relative or absolute */
     58    /* height must be a pixel value */
     59}
     60
    5461#toolbar {
    5562    position: absolute;
  • trunk/Source/WebCore/inspector/front-end/inspector.html

    r147117 r147478  
    200200    </div>
    201201    <div id="drawer"></div>
    202     <div id="main-status-bar" class="status-bar">
     202    <div id="main-status-bar" class="status-bar layout-boundary">
    203203        <div id="bottom-status-bar-container">
    204204            <div id="panel-status-bar">
Note: See TracChangeset for help on using the changeset viewer.