Index: src/wp-includes/link-template.php
===================================================================
--- src/wp-includes/link-template.php	(revision 28821)
+++ src/wp-includes/link-template.php	(working copy)
@@ -2842,7 +2842,7 @@
  * @since 3.4.0
  *
  * @param string $url Absolute url that includes a scheme
- * @param string $scheme Optional. Scheme to give $url. Currently 'http', 'https', 'login', 'login_post', 'admin', or 'relative'.
+ * @param string $scheme Optional. Scheme to give $url. Currently 'http', 'https', 'login', 'login_post', 'admin', 'relative', or 'protocol_relative'.
  * @return string $url URL with chosen scheme.
  */
 function set_url_scheme( $url, $scheme = null ) {
@@ -2852,7 +2852,7 @@
 		$scheme = is_ssl() ? 'https' : 'http';
 	} elseif ( $scheme === 'admin' || $scheme === 'login' || $scheme === 'login_post' || $scheme === 'rpc' ) {
 		$scheme = is_ssl() || force_ssl_admin() ? 'https' : 'http';
-	} elseif ( $scheme !== 'http' && $scheme !== 'https' && $scheme !== 'relative' ) {
+	} elseif ( $scheme !== 'http' && $scheme !== 'https' && $scheme !== 'relative' && $scheme !== 'protocol_relative' ) {
 		$scheme = is_ssl() ? 'https' : 'http';
 	}
 
@@ -2864,6 +2864,8 @@
 		$url = ltrim( preg_replace( '#^\w+://[^/]*#', '', $url ) );
 		if ( $url !== '' && $url[0] === '/' )
 			$url = '/' . ltrim($url , "/ \t\n\r\0\x0B" );
+	} else if ( 'protocol_relative' == $scheme ) {
+		$url = preg_replace( '#^\w+://#', '//', $url );
 	} else {
 		$url = preg_replace( '#^\w+://#', $scheme . '://', $url );
 	}
@@ -2876,7 +2878,7 @@
 	 * @param string $url         The complete URL including scheme and path.
 	 * @param string $scheme      Scheme applied to the URL. One of 'http', 'https', or 'relative'.
 	 * @param string $orig_scheme Scheme requested for the URL. One of 'http', 'https', 'login',
-	 *                            'login_post', 'admin', 'rpc', or 'relative'.
+	 *                            'login_post', 'admin', 'rpc', 'relative', or 'protocol_relative'.
 	 */
 	return apply_filters( 'set_url_scheme', $url, $scheme, $orig_scheme );
 }
Index: tests/phpunit/tests/url.php
===================================================================
--- tests/phpunit/tests/url.php	(revision 28821)
+++ tests/phpunit/tests/url.php	(working copy)
@@ -239,6 +239,13 @@
 			''
 		);
 
+		$protocol_relative_links = array(
+			'//wordpress.org/',
+			'//wordpress.org/',
+			'//wordpress.org/news/',
+			'//wordpress.org'
+		);
+
 		$forced_admin = force_ssl_admin();
 		$forced_login = force_ssl_login();
 		$i = 0;
@@ -246,6 +253,7 @@
 			$this->assertEquals( $https_links[ $i ], set_url_scheme( $link, 'https' ) );
 			$this->assertEquals( $http_links[ $i ], set_url_scheme( $link, 'http' ) );
 			$this->assertEquals( $relative_links[ $i ], set_url_scheme( $link, 'relative' ) );
+			$this->assertEquals( $protocol_relative_links[ $i ], set_url_scheme( $link, 'protocol_relative' ) );
 
 			$_SERVER['HTTPS'] = 'on';
 			$this->assertEquals( $https_links[ $i ], set_url_scheme( $link ) );
