Changeset 141647 in webkit


Ignore:
Timestamp:
Feb 1, 2013 2:55:51 PM (11 years ago)
Author:
commit-queue@webkit.org
Message:

Web Inspector: remove extra padding around overlay highlight.
https://bugs.webkit.org/show_bug.cgi?id=108679

Patch by Andrey Lushnikov <lushnikov@chromium.org> on 2013-02-01
Reviewed by Alexander Pavlov.

Source/WebCore:

No new tests: no change in behaviour.

Remove extraWidth from overlay highlight spans.

  • inspector/front-end/DefaultTextEditor.js:

(WebInspector.TextEditorMainPanel.prototype._appendOverlayHighlight):

LayoutTests:

Update layout test expectations to correspond to updated overlay highlight style.

  • inspector/editor/text-editor-highlight-api-expected.txt:
  • inspector/editor/text-editor-highlight-token-expected.txt:
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r141645 r141647  
     12013-02-01  Andrey Lushnikov  <lushnikov@chromium.org>
     2
     3        Web Inspector: remove extra padding around overlay highlight.
     4        https://bugs.webkit.org/show_bug.cgi?id=108679
     5
     6        Reviewed by Alexander Pavlov.
     7
     8        Update layout test expectations to correspond to updated overlay highlight style.
     9
     10        * inspector/editor/text-editor-highlight-api-expected.txt:
     11        * inspector/editor/text-editor-highlight-token-expected.txt:
     12
    1132013-02-01  Philip Rogers  <pdr@google.com>
    214
  • trunk/LayoutTests/inspector/editor/text-editor-highlight-api-expected.txt

    r141414 r141647  
    1919<div class="inner-container" tabindex="0">
    2020<div class="webkit-line-content">foo();</div>
    21 <div class="webkit-line-content">foo_1; foor; foo_;<span class="some-css-class text-editor-overlay-highlight" style="left: -1px; width: 37px; height: <number>px;"></span><span class="some-css-class text-editor-overlay-highlight" style="left: 90px; width: 37px; height: <number>px;"></span></div>
     21<div class="webkit-line-content">foo_1; foor; foo_;<span class="some-css-class text-editor-overlay-highlight" style="left: 0px; width: 35px; height: <number>px;"></span><span class="some-css-class text-editor-overlay-highlight" style="left: 91px; width: 35px; height: <number>px;"></span></div>
    2222<div class="webkit-line-content">foo_</div>
    2323<div class="webkit-line-content">global_foo</div>
    2424<div class="webkit-line-content">global_foo2</div>
    25 <div class="webkit-line-content">some_other_foo_X<span class="some-css-class text-editor-overlay-highlight" style="left: 76px; width: 37px; height: <number>px;"></span></div></div>
     25<div class="webkit-line-content">some_other_foo_X<span class="some-css-class text-editor-overlay-highlight" style="left: 77px; width: 35px; height: <number>px;"></span></div></div>
    2626
    2727Running: testHighlightRange
     
    3232<div class="inner-container" tabindex="0">
    3333<div class="webkit-line-content">foo();</div>
    34 <div class="webkit-line-content">foo_1; foor; foo_;<span class="some-css-class text-editor-overlay-highlight" style="left: -1px; width: 37px; height: <number>px;"></span><span class="some-css-class text-editor-overlay-highlight" style="left: 90px; width: 37px; height: <number>px;"></span><span class="some-other-class text-editor-overlay-highlight" style="left: 90px; width: 37px; height: <number>px;"></span></div>
    35 <div class="webkit-line-content">foo_<span class="some-other-class text-editor-overlay-highlight" style="left: -1px; width: 30px; height: <number>px;"></span></div>
    36 <div class="webkit-line-content">global_foo<span class="some-other-class text-editor-overlay-highlight" style="left: -1px; width: 72px; height: <number>px;"></span></div>
     34<div class="webkit-line-content">foo_1; foor; foo_;<span class="some-css-class text-editor-overlay-highlight" style="left: 0px; width: 35px; height: <number>px;"></span><span class="some-css-class text-editor-overlay-highlight" style="left: 91px; width: 35px; height: <number>px;"></span><span class="some-other-class text-editor-overlay-highlight" style="left: 91px; width: 35px; height: <number>px;"></span></div>
     35<div class="webkit-line-content">foo_<span class="some-other-class text-editor-overlay-highlight" style="left: 0px; width: 28px; height: <number>px;"></span></div>
     36<div class="webkit-line-content">global_foo<span class="some-other-class text-editor-overlay-highlight" style="left: 0px; width: 70px; height: <number>px;"></span></div>
    3737<div class="webkit-line-content">global_foo2</div>
    38 <div class="webkit-line-content">some_other_foo_X<span class="some-css-class text-editor-overlay-highlight" style="left: 76px; width: 37px; height: <number>px;"></span></div></div>
     38<div class="webkit-line-content">some_other_foo_X<span class="some-css-class text-editor-overlay-highlight" style="left: 77px; width: 35px; height: <number>px;"></span></div></div>
    3939
    4040Running: testRemoveRegexHighlight
     
    4545<div class="inner-container" tabindex="0">
    4646<div class="webkit-line-content">foo();</div>
    47 <div class="webkit-line-content">foo_1; foor; foo_;<span class="some-other-class text-editor-overlay-highlight" style="left: 90px; width: 37px; height: <number>px;"></span></div>
    48 <div class="webkit-line-content">foo_<span class="some-other-class text-editor-overlay-highlight" style="left: -1px; width: 30px; height: <number>px;"></span></div>
    49 <div class="webkit-line-content">global_foo<span class="some-other-class text-editor-overlay-highlight" style="left: -1px; width: 72px; height: <number>px;"></span></div>
     47<div class="webkit-line-content">foo_1; foor; foo_;<span class="some-other-class text-editor-overlay-highlight" style="left: 91px; width: 35px; height: <number>px;"></span></div>
     48<div class="webkit-line-content">foo_<span class="some-other-class text-editor-overlay-highlight" style="left: 0px; width: 28px; height: <number>px;"></span></div>
     49<div class="webkit-line-content">global_foo<span class="some-other-class text-editor-overlay-highlight" style="left: 0px; width: 70px; height: <number>px;"></span></div>
    5050<div class="webkit-line-content">global_foo2</div>
    5151<div class="webkit-line-content">some_other_foo_X</div></div>
  • trunk/LayoutTests/inspector/editor/text-editor-highlight-token-expected.txt

    r141414 r141647  
    2222
    2323<div class="inner-container text-editor-editable" tabindex="0">
    24 <div class="webkit-line-content">function findElement(collection, elem) {<span class="text-editor-token-highlight text-editor-overlay-highlight" style="left: 146px; width: 72px; height: <number>px;"></span></div>
     24<div class="webkit-line-content">function findElement(collection, elem) {<span class="text-editor-token-highlight text-editor-overlay-highlight" style="left: 147px; width: 70px; height: <number>px;"></span></div>
    2525<div class="webkit-line-content">        // length</div>
    26 <div class="webkit-line-content">        for(var i = 0; i <span class="webkit-html-tag">&lt;</span> <span class="webkit-html-tag">collection.length;</span> <span class="webkit-html-attribute-name">++i)</span><span class="text-editor-token-highlight text-editor-overlay-highlight" style="left: 188px; width: 72px; height: <number>px;"></span></div>
    27 <div class="webkit-line-content">            <span class="webkit-html-attribute-name">if</span> <span class="webkit-html-attribute-name">(collection</span>[<span class="webkit-html-attribute-name">i</span>] === <span class="webkit-html-attribute-value">elem)</span><span class="text-editor-token-highlight text-editor-overlay-highlight" style="left: 111px; width: 72px; height: <number>px;"></span></div>
     26<div class="webkit-line-content">        for(var i = 0; i <span class="webkit-html-tag">&lt;</span> <span class="webkit-html-tag">collection.length;</span> <span class="webkit-html-attribute-name">++i)</span><span class="text-editor-token-highlight text-editor-overlay-highlight" style="left: 189px; width: 70px; height: <number>px;"></span></div>
     27<div class="webkit-line-content">            <span class="webkit-html-attribute-name">if</span> <span class="webkit-html-attribute-name">(collection</span>[<span class="webkit-html-attribute-name">i</span>] === <span class="webkit-html-attribute-value">elem)</span><span class="text-editor-token-highlight text-editor-overlay-highlight" style="left: 112px; width: 70px; height: <number>px;"></span></div>
    2828<div class="webkit-line-content">                <span class="webkit-html-attribute-value">return</span> <span class="webkit-html-attribute-value">i;</span></div>
    2929<div class="webkit-line-content">        <span class="webkit-html-attribute-value">return</span> <span class="webkit-html-attribute-value">null;</span></div>
     
    3232
    3333<div class="inner-container text-editor-editable" tabindex="0">
    34 <div class="webkit-line-content">function findElement(collection, elem) {<span class="text-editor-token-highlight text-editor-overlay-highlight" style="left: 230px; width: 30px; height: <number>px;"></span></div>
     34<div class="webkit-line-content">function findElement(collection, elem) {<span class="text-editor-token-highlight text-editor-overlay-highlight" style="left: 231px; width: 28px; height: <number>px;"></span></div>
    3535<div class="webkit-line-content">        // length</div>
    3636<div class="webkit-line-content">        for(var i = 0; i <span class="webkit-html-tag">&lt;</span> <span class="webkit-html-tag">collection.length;</span> <span class="webkit-html-attribute-name">++i)</span></div>
    37 <div class="webkit-line-content">            <span class="webkit-html-attribute-name">if</span> <span class="webkit-html-attribute-name">(collection</span>[<span class="webkit-html-attribute-name">i</span>] === <span class="webkit-html-attribute-value">elem)</span><span class="text-editor-token-highlight text-editor-overlay-highlight" style="left: 237px; width: 30px; height: <number>px;"></span></div>
     37<div class="webkit-line-content">            <span class="webkit-html-attribute-name">if</span> <span class="webkit-html-attribute-name">(collection</span>[<span class="webkit-html-attribute-name">i</span>] === <span class="webkit-html-attribute-value">elem)</span><span class="text-editor-token-highlight text-editor-overlay-highlight" style="left: 238px; width: 28px; height: <number>px;"></span></div>
    3838<div class="webkit-line-content">                <span class="webkit-html-attribute-value">return</span> <span class="webkit-html-attribute-value">i;</span></div>
    3939<div class="webkit-line-content">        <span class="webkit-html-attribute-value">return</span> <span class="webkit-html-attribute-value">null;</span></div>
     
    4343<div class="inner-container text-editor-editable" tabindex="0">
    4444<div class="webkit-line-content">function findElement(collection, elem) {</div>
    45 <div class="webkit-line-content">        // length<span class="text-editor-token-highlight text-editor-overlay-highlight" style="left: 76px; width: 44px; height: <number>px;"></span></div>
    46 <div class="webkit-line-content">        for(var i = 0; i <span class="webkit-html-tag">&lt;</span> <span class="webkit-html-tag">collection.length;</span> <span class="webkit-html-attribute-name">++i)</span><span class="text-editor-token-highlight text-editor-overlay-highlight" style="left: 265px; width: 44px; height: <number>px;"></span></div>
     45<div class="webkit-line-content">        // length<span class="text-editor-token-highlight text-editor-overlay-highlight" style="left: 77px; width: 42px; height: <number>px;"></span></div>
     46<div class="webkit-line-content">        for(var i = 0; i <span class="webkit-html-tag">&lt;</span> <span class="webkit-html-tag">collection.length;</span> <span class="webkit-html-attribute-name">++i)</span><span class="text-editor-token-highlight text-editor-overlay-highlight" style="left: 266px; width: 42px; height: <number>px;"></span></div>
    4747<div class="webkit-line-content">            <span class="webkit-html-attribute-name">if</span> <span class="webkit-html-attribute-name">(collection</span>[<span class="webkit-html-attribute-name">i</span>] === <span class="webkit-html-attribute-value">elem)</span></div>
    4848<div class="webkit-line-content">                <span class="webkit-html-attribute-value">return</span> <span class="webkit-html-attribute-value">i;</span></div>
  • trunk/Source/WebCore/ChangeLog

    r141645 r141647  
     12013-02-01  Andrey Lushnikov  <lushnikov@chromium.org>
     2
     3        Web Inspector: remove extra padding around overlay highlight.
     4        https://bugs.webkit.org/show_bug.cgi?id=108679
     5
     6        Reviewed by Alexander Pavlov.
     7
     8        No new tests: no change in behaviour.
     9
     10        Remove extraWidth from overlay highlight spans.
     11
     12        * inspector/front-end/DefaultTextEditor.js:
     13        (WebInspector.TextEditorMainPanel.prototype._appendOverlayHighlight):
     14
    1152013-02-01  Philip Rogers  <pdr@google.com>
    216
  • trunk/Source/WebCore/inspector/front-end/DefaultTextEditor.js

    r141426 r141647  
    19441944    _appendOverlayHighlight: function(lineRow, highlight)
    19451945    {
    1946         const extraWidth = 1;
    19471946        var metrics = highlight.metrics;
    19481947        var cssClass = highlight.cssClass;
     
    19511950            highlightSpan._isOverlayHighlightElement = true;
    19521951            highlightSpan.addStyleClass(cssClass);
    1953             highlightSpan.style.left = (metrics[i].left - extraWidth) + "px";
    1954             highlightSpan.style.width = (metrics[i].width + extraWidth * 2) + "px";
     1952            highlightSpan.style.left = metrics[i].left + "px";
     1953            highlightSpan.style.width = metrics[i].width + "px";
    19551954            highlightSpan.style.height = metrics[i].height + "px";
    19561955            highlightSpan.addStyleClass("text-editor-overlay-highlight");
Note: See TracChangeset for help on using the changeset viewer.