Index: wp-includes/post.php
===================================================================
--- wp-includes/post.php	(revision 6583)
+++ wp-includes/post.php	(working copy)
@@ -176,6 +176,8 @@
 
 	$_post = sanitize_post($_post, $filter);
 
+	get_post_ancestors($_post);
+
 	if ( $output == OBJECT ) {
 		return $_post;
 	} elseif ( $output == ARRAY_A ) {
@@ -187,6 +189,18 @@
 	}
 }
 
+function get_post_ancestors (&$_post) {
+    global $wpdb;
+	$_post->ancestors = array();
+
+	if ($_post->post_parent != 0) {
+	    $id = $_post->ancestors[] = $_post->post_parent;
+	    while ($ancestor = $wpdb->get_var("SELECT `post_parent` FROM $wpdb->posts WHERE ID= '{$id}' LIMIT 1")) {
+	    	$id = $_post->ancestors[] = $ancestor;
+	    }
+	}
+}
+
 /**
  * get_post_field() - Retrieve a field based on a post ID.
  *
@@ -1724,6 +1738,21 @@
 
 	$pages = apply_filters('get_pages', $pages, $r);
 
+	$ancestors = array();
+	foreach ($pages as $page) {
+	    if ($page->post_parent != 0) {
+	    	$ancestors[$page->ID] = $page->post_parent;
+	    }
+	}
+	if (!empty($ancestors)) {
+    	foreach ($pages as $page) {
+    	    $page->ancestors = array();
+    	    $id = $page->ID;
+    	    while (isset($ancestors[$id])) {
+	    	    $id = $page->ancestors[] = $ancestors[$id];
+    	    }
+    	}
+	}
 	return $pages;
 }
 
Index: wp-includes/classes.php
===================================================================
--- wp-includes/classes.php	(revision 6583)
+++ wp-includes/classes.php	(working copy)
@@ -547,10 +547,13 @@
 			$indent = str_repeat("\t", $depth);
 		else
 			$indent = '';
-			
+
 		extract($args, EXTR_SKIP);
 		$css_class = 'page_item page-item-'.$page->ID;
 		$_current_page = get_page( $current_page );
+		if ($_current_page && in_array($page->ID, $_current_page->ancestors)) {
+			$css_class .= ' current_page_ancestor ';
+		}
 		if ( $page->ID == $current_page )
 			$css_class .= ' current_page_item ';
 		elseif ( $_current_page && $page->ID == $_current_page->post_parent )
