Changeset 136556 in webkit
- Timestamp:
- Dec 4, 2012, 1:11:01 PM (12 years ago)
- Location:
- trunk/Websites/bugs.webkit.org
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Websites/bugs.webkit.org/ChangeLog
r133576 r136556 1 2012-12-04 Ojan Vafai <ojan@chromium.org> 2 3 Can't add followup comment to a previous comment 4 https://bugs.webkit.org/show_bug.cgi?id=104025 5 6 Reviewed by Adam Barth. 7 8 If we side-by-sidify a shared diff line, and then apply 9 a previous comment, we would incorrectly put the comment 10 on the Line instead of the LineContainer. 11 12 Also, get rid of global next_line_id to simplify testing. 13 14 * code-review-test.html: 15 * code-review.js: 16 1 17 2012-11-06 Ryosuke Niwa <rniwa@webkit.org> 2 18 -
trunk/Websites/bugs.webkit.org/code-review-test.html
r102719 r136556 229 229 appendToolbar(); 230 230 231 var line = document.getElementById('line0') 231 var line = document.getElementById('line0'); 232 232 var author = "ojan@chromium.org"; 233 233 var comment_text = "This change sux."; … … 262 262 } 263 263 264 function testSideBySideDiffWithPreviousCommentsOnSharedLine() { 265 document.getElementById('diff-content').innerHTML = 266 '<div class="FileDiff">' + 267 '<h1><a href="http://trac.webkit.org/browser/trunk/Source/WebCore/ChangeLog">Source/WebCore/ChangeLog</a></h1>' + 268 '<div class="DiffSection">' + 269 '<div class="DiffBlock">' + 270 '<div class="DiffBlockPart shared">' + 271 '<div class="Line LineContainer">' + 272 '<span class="from lineNumber">336</span><span class="to lineNumber">338</span><span class="text"> layoutFlexItems(*m_orderIterator, lineContexts);</span>' + 273 '</div>' + 274 '<div class="Line LineContainer">' + 275 '<span class="from lineNumber">337</span><span class="to lineNumber">339</span><span class="text"></span>' + 276 '</div>' + 277 '<div class="Line LineContainer">' + 278 '<span class="from lineNumber">338</span><span class="to lineNumber">340</span><span class="text"> LayoutUnit oldClientAfterEdge = clientLogicalBottom();</span>' + 279 '</div>' + 280 '</div><div class="clear_float">' + 281 '</div>' + 282 '</div>' + 283 '</div>'; 284 285 next_line_id = 0; 286 eraseDraftComments(); 287 crawlDiff(); 288 289 convertAllFileDiffs('sidebyside', $('.FileDiff')); 290 291 displayPreviousComments([{ 292 author: 'ojan@chromium.org', 293 file_name: 'Source/WebCore/ChangeLog', 294 line_number: 338, 295 comment_text: 'This change sux.' 296 }]); 297 298 var previous_comment = document.querySelector('.previousComment'); 299 ASSERT_EQUAL(previous_comment.getAttribute('data-comment-for'), 'line0'); 300 301 var new_comment = addCommentField(previous_comment); 302 ASSERT("New comment should exist and contain a textarea.", new_comment.find('textarea')); 303 304 document.getElementById('diff-content').innerHTML = ''; 305 } 306 264 307 function testIsChangeLog() { 265 308 ASSERT("Top-level ChangeLog file is a ChangeLog file", isChangeLog("ChangeLog")); -
trunk/Websites/bugs.webkit.org/code-review.js
r112827 r136556 67 67 var maxLeftSideRatio = 90; 68 68 var file_diff_being_resized = null; 69 var next_line_id = 0;70 69 var files = {}; 71 70 var original_file_contents = {}; … … 90 89 } 91 90 92 function nextLineID() {93 return idForLine(next_line_id++);94 }95 96 91 function forEachLine(callback) { 97 for (var i = 0; i < next_line_id; ++i) { 98 callback($('#' + idForLine(i))); 99 } 100 } 101 102 function idify() { 103 this.id = nextLineID(); 92 var i = 0; 93 var line; 94 do { 95 line = $('#' + idForLine(i)); 96 if (line[0]) 97 callback(line); 98 i++; 99 } while (line[0]); 104 100 } 105 101 … … 424 420 if ($(this).text() != line_number) 425 421 return; 426 var line = $(this).parent();422 var line = lineContainerFromDescendant($(this)); 427 423 addPreviousComment(line, author, comment_text); 428 424 }); … … 602 598 603 599 function crawlDiff() { 600 var next_line_id = 0; 601 var idify = function() { 602 this.id = idForLine(next_line_id++); 603 } 604 604 605 $('.Line').each(idify).each(hoverify); 605 606 $('.FileDiff').each(function() { … … 1929 1930 } 1930 1931 1932 function lineContainerFromDescendant(descendant) { 1933 return descendant.hasClass('LineContainer') ? descendant : descendant.parents('.LineContainer'); 1934 } 1935 1931 1936 function lineFromLineContainer(lineContainer) { 1932 1937 var line = $(lineContainer); … … 2038 2043 window.tracLinks = tracLinks; 2039 2044 window.crawlDiff = crawlDiff; 2045 window.convertAllFileDiffs = convertAllFileDiffs; 2046 window.displayPreviousComments = displayPreviousComments; 2040 2047 window.discardComment = discardComment; 2041 2048 window.addCommentField = addCommentField;
Note:
See TracChangeset
for help on using the changeset viewer.