[SCM] WebKit Debian packaging branch, webkit-1.3, updated. upstream/1.3.7-4207-g178b198

ojan at chromium.org ojan at chromium.org
Sun Feb 20 22:48:52 UTC 2011


The following commit has been merged in the webkit-1.3 branch:
commit 4068d9d7c089dd7c162c01a763711fae97aba880
Author: ojan at chromium.org <ojan at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Jan 11 20:56:13 2011 +0000

    2011-01-11  Ojan Vafai  <ojan at chromium.org>
    
            Reviewed by Mihai Parparita.
    
            fix exception when adding a comment to a side-by-side diff
            https://bugs.webkit.org/show_bug.cgi?id=52240
    
            prev() and next() won't get the previous and next lines in
            side-by-side mode. Instead do a query to find them.
    
            * code-review.js:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@75539 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/Websites/bugs.webkit.org/ChangeLog b/Websites/bugs.webkit.org/ChangeLog
index 4c4e5bd..76d0a83 100644
--- a/Websites/bugs.webkit.org/ChangeLog
+++ b/Websites/bugs.webkit.org/ChangeLog
@@ -2,6 +2,18 @@
 
         Reviewed by Mihai Parparita.
 
+        fix exception when adding a comment to a side-by-side diff
+        https://bugs.webkit.org/show_bug.cgi?id=52240
+
+        prev() and next() won't get the previous and next lines in
+        side-by-side mode. Instead do a query to find them.
+
+        * code-review.js:
+
+2011-01-11  Ojan Vafai  <ojan at chromium.org>
+
+        Reviewed by Mihai Parparita.
+
         maintain word diffs when converting to side-by-side and back
         https://bugs.webkit.org/show_bug.cgi?id=52244
 
diff --git a/Websites/bugs.webkit.org/code-review.js b/Websites/bugs.webkit.org/code-review.js
index cad12e3..26dc13a 100644
--- a/Websites/bugs.webkit.org/code-review.js
+++ b/Websites/bugs.webkit.org/code-review.js
@@ -969,10 +969,25 @@
     in_drag_select = false;
   }
 
+  function lineOffsetFrom(line, offset) {
+    var file_diff = line.parents('.FileDiff');
+    var all_lines = $('.Line', file_diff);
+    var index = all_lines.index(line);
+    return $(all_lines[index + offset]);
+  }
+
+  function previousLineFor(line) {
+    return lineOffsetFrom(line, -1);
+  }
+
+  function nextLineFor(line) {
+    return lineOffsetFrom(line, 1);
+  }
+
   $('.lineNumber').live('click', function() {
     var line = $(this).parent();
     if (line.hasClass('commentContext'))
-      trimCommentContextToBefore(line.prev());
+      trimCommentContextToBefore(previousLineFor(line));
   }).live('mousedown', function() {
     in_drag_select = true;
     $(lineFromLineDescendant(this)).addClass('selected');
@@ -989,7 +1004,7 @@
     if (!in_drag_select)
       return;
     var selected = $('.selected');
-    var should_add_comment = !selected.last().next().hasClass('commentContext');
+    var should_add_comment = !nextLineFor(selected.last()).hasClass('commentContext');
     selected.addClass('commentContext');
 
     var id;
@@ -998,7 +1013,7 @@
       addCommentFor($(last));
       id = last.id;
     } else {
-      id = selected.last().next()[0].getAttribute('data-comment-base-line');
+      id = nextLineFor(selected.last())[0].getAttribute('data-comment-base-line');
     }
 
     selected.each(function() {

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list