jenkins-bot has submitted this change and it was merged.

Change subject: Add root title class to <body>
......................................................................


Add root title class to <body>

This adds a class to the body node of output pages in the form:

rootpage-X

Where X is the root title of the page.

This provides for the use cases in the linked tasks, and allows the
numerous existing cases of expensive css selectors using class*='page-X'
that are otherwise needed to apply a style to a page and or its subpages.

Bug: T123156
Bug: T17075
Change-Id: Ib16e380d97bd7bb55c5b5044a084fefbd039d599
---
M includes/skins/Skin.php
1 file changed, 2 insertions(+), 1 deletion(-)

Approvals:
  Catrope: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/skins/Skin.php b/includes/skins/Skin.php
index dbc84c0..5b50cd8 100644
--- a/includes/skins/Skin.php
+++ b/includes/skins/Skin.php
@@ -387,8 +387,9 @@
                }
 
                $name = Sanitizer::escapeClass( 'page-' . 
$title->getPrefixedText() );
+               $root = Sanitizer::escapeClass( 'rootpage-' . 
$title->getRootTitle()->getPrefixedText() );
 
-               return "$numeric $type $name";
+               return "$numeric $type $name $root";
        }
 
        /**

-- 
To view, visit https://gerrit.wikimedia.org/r/281253
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib16e380d97bd7bb55c5b5044a084fefbd039d599
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: coren <[email protected]>
Gerrit-Reviewer: Alex Monk <[email protected]>
Gerrit-Reviewer: Catrope <[email protected]>
Gerrit-Reviewer: Fomafix
Gerrit-Reviewer: Jack Phoenix <[email protected]>
Gerrit-Reviewer: Jforrester <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: coren <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to