Index: trunk/wp-includes/comment-template.php
===================================================================
--- trunk/wp-includes/comment-template.php	(revision 28359)
+++ trunk/wp-includes/comment-template.php	(working copy)
@@ -1439,15 +1439,37 @@
  *
  * @since 2.7.0
  *
- * @param string $text Optional. Text to display for cancel reply link. Default empty.
+ * @param array $args {
+ *     Optional. Override default arguments.
+ *
+ *     @type string $text Optional. Text to display for cancel reply link. Default empty.
+ *     @type string $respond_id The selector identifying the responding comment. Passed as the third parameter
+ *                              to addComment.moveForm(), and appended to the link URL as a hash value.
+ *                              Default 'respond'.
+ * }
  */
-function get_cancel_comment_reply_link( $text = '' ) {
-	if ( empty($text) )
-		$text = __('Click here to cancel reply.');
+function get_cancel_comment_reply_link( $args = array() ) {
+	$defaults = array(
+		'text'       => __('Click here to cancel reply.'),
+		'respond_id' => 'respond'
+	);
 
-	$style = isset($_GET['replytocom']) ? '' : ' style="display:none;"';
-	$link = esc_html( remove_query_arg('replytocom') ) . '#respond';
+	/**
+	 * Fallback for earlier Wordpress versions
+	 *
+	 * @since 3.9.2
+	 */
+	if( !is_array($args) )
+		$args = array('text' => $args);
 
+	$args = wp_parse_args($args, $defaults);
+
+	extract($args, EXTR_SKIP);
+
+	$comment = get_comment($_GET['replytocom']);
+	$style = $comment && $comment->comment_post_ID == get_the_ID() ? '' : ' style="display:none;"';
+	$link = esc_html( remove_query_arg('replytocom') ) . '#' . $respond_id;
+
 	$formatted_link = '<a rel="nofollow" id="cancel-comment-reply-link" href="' . $link . '"' . $style . '>' . $text . '</a>';
 	/**
 	 * Filter the cancel comment reply link HTML.
@@ -1466,10 +1488,17 @@
  *
  * @since 2.7.0
  *
- * @param string $text Optional. Text to display for cancel reply link. Default empty.
+ * @param array $args {
+ *     Optional. Override default arguments.
+ *
+ *     @type string $text Optional. Text to display for cancel reply link. Default empty.
+ *     @type string $respond_id The selector identifying the responding comment. Passed as the third parameter
+ *                              to addComment.moveForm(), and appended to the link URL as a hash value.
+ *                              Default 'respond'.
+ * }
  */
-function cancel_comment_reply_link( $text = '' ) {
-	echo get_cancel_comment_reply_link($text);
+function cancel_comment_reply_link( $args = array() ) {
+	echo get_cancel_comment_reply_link($args);
 }
 
 /**
