Changeset 141401 in webkit
- Timestamp:
- Jan 31, 2013 4:04:09 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r141399 r141401 1 2013-01-31 Andrey Lushnikov <lushnikov@chromium.org> 2 3 Web Inspector: DTE doesn't highlight words if the selected one is the last in the line 4 https://bugs.webkit.org/show_bug.cgi?id=108344 5 6 Reviewed by Pavel Feldman. 7 8 Add a test to cover specific case which caused the bug. 9 10 * inspector/editor/text-editor-highlight-token-expected.txt: 11 * inspector/editor/text-editor-highlight-token.html: 12 1 13 2013-01-31 Andrey Lushnikov <lushnikov@chromium.org> 2 14 -
trunk/LayoutTests/inspector/editor/text-editor-highlight-token-expected.txt
r140828 r141401 3 3 =========== TextEditor text ========== 4 4 function findElement(collection, elem) { 5 // length 5 6 for(var i = 0; i < collection.length; ++i) 6 7 if (collection[i] === elem) … … 12 13 <div class="inner-container text-editor-editable" tabindex="0"> 13 14 <div class="webkit-line-content">function findElement(collection, elem) {</div> 15 <div class="webkit-line-content"> // length</div> 14 16 <div class="webkit-line-content"> for(var i = 0; i <span class="webkit-html-tag"><</span> <span class="webkit-html-tag">collection.length;</span> <span class="webkit-html-attribute-name">++i)</span></div> 15 17 <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> … … 21 23 <div class="inner-container text-editor-editable" tabindex="0"> 22 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;"> </span></div> 25 <div class="webkit-line-content"> // length</div> 23 26 <div class="webkit-line-content"> for(var i = 0; i <span class="webkit-html-tag"><</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;"> </span></div> 24 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;"> </span></div> … … 30 33 <div class="inner-container text-editor-editable" tabindex="0"> 31 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;"> </span></div> 35 <div class="webkit-line-content"> // length</div> 32 36 <div class="webkit-line-content"> for(var i = 0; i <span class="webkit-html-tag"><</span> <span class="webkit-html-tag">collection.length;</span> <span class="webkit-html-attribute-name">++i)</span></div> 33 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;"> </span></div> … … 35 39 <div class="webkit-line-content"> <span class="webkit-html-attribute-value">return</span> <span class="webkit-html-attribute-value">null;</span></div> 36 40 <div class="webkit-line-content"> <span class="webkit-html-attribute-value">}</span></div></div> 41 =========== After selecting 'length' =========== 37 42 43 <div class="inner-container text-editor-editable" tabindex="0"> 44 <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;"> </span></div> 46 <div class="webkit-line-content"> for(var i = 0; i <span class="webkit-html-tag"><</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;"> </span></div> 47 <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> 48 <div class="webkit-line-content"> <span class="webkit-html-attribute-value">return</span> <span class="webkit-html-attribute-value">i;</span></div> 49 <div class="webkit-line-content"> <span class="webkit-html-attribute-value">return</span> <span class="webkit-html-attribute-value">null;</span></div> 50 <div class="webkit-line-content"> <span class="webkit-html-attribute-value">}</span></div></div> 51 -
trunk/LayoutTests/inspector/editor/text-editor-highlight-token.html
r140828 r141401 7 7 { 8 8 function findElement(collection, elem) { 9 // length 9 10 for(var i = 0; i < collection.length; ++i) 10 11 if (collection[i] === elem) … … 13 14 } 14 15 15 var steps = [step 2, step1]; // reversed order16 var steps = [step3, step2, step1]; // reversed order 16 17 function selectionChangeListener() 17 18 { … … 49 50 InspectorTest.addResult("=========== After selecting '" + textEditor._textModel.copyRange(range) + "' ==========="); 50 51 InspectorTest.dumpEditorHTML(textEditor, true); 52 range = new WebInspector.TextRange(1, 11, 1, 17); 53 textEditor.setSelection(range); 54 } 55 56 function step3() 57 { 58 InspectorTest.addResult("=========== After selecting '" + textEditor._textModel.copyRange(range) + "' ==========="); 59 InspectorTest.dumpEditorHTML(textEditor, true); 51 60 InspectorTest.completeTest(); 52 61 } -
trunk/Source/WebCore/ChangeLog
r141398 r141401 1 2013-01-31 Andrey Lushnikov <lushnikov@chromium.org> 2 3 Web Inspector: DTE doesn't highlight words if the selected one is the last in the line 4 https://bugs.webkit.org/show_bug.cgi?id=108344 5 6 Reviewed by Pavel Feldman. 7 8 Fix error in _isWord function which made an erroneous line-end check. 9 10 Improved test: inspector/editor/text-editor-highlight-token.html 11 12 * inspector/front-end/DefaultTextEditor.js: 13 (WebInspector.TextEditorMainPanel.TokenHighlighter.prototype._isWord): 14 1 15 2013-01-31 Philippe Normand <pnormand@igalia.com> 2 16 -
trunk/Source/WebCore/inspector/front-end/DefaultTextEditor.js
r141257 r141401 3188 3188 var line = this._textModel.line(range.startLine); 3189 3189 var leftBound = range.startColumn === 0 || NonWordChar.test(line.charAt(range.startColumn - 1)); 3190 var rightBound = range.endColumn === line.length - 1|| NonWordChar.test(line.charAt(range.endColumn));3190 var rightBound = range.endColumn === line.length || NonWordChar.test(line.charAt(range.endColumn)); 3191 3191 return leftBound && rightBound && WordRegex.test(selectedText); 3192 3192 }
Note: See TracChangeset
for help on using the changeset viewer.