Revert "Override mw.experiments.getBucket() via body classes"

This reverts commit b599da4153.

Change-Id: I977b352ee71faa25c3921205025ba326e05a0f9b
This commit is contained in:
Jon Robson 2023-05-25 21:32:36 +03:00
parent cc570fe280
commit 7c29c5ff03
2 changed files with 1 additions and 15 deletions

View file

@ -236,8 +236,6 @@ class SkinVector22 extends SkinMustache {
* @inheritDoc
*/
public function getHtmlElementAttributes() {
$aBTest = $this->getConfig()->get( 'VectorWebABTestEnrollment' );
$zebraEnabled = VectorServices::getFeatureManager()->isFeatureEnabled( Constants::FEATURE_ZEBRA_DESIGN );
$original = parent::getHtmlElementAttributes();
$featureManager = VectorServices::getFeatureManager();
$original['class'] .= ' ' . implode( ' ', $featureManager->getFeatureBodyClass() );
@ -256,15 +254,6 @@ class SkinVector22 extends SkinMustache {
// possibly others). It must instead be applied to the html tag.
$original['class'] = implode( ' ', [ $original['class'] ?? '', self::STICKY_HEADER_ENABLED_CLASS ] );
}
if ( $aBTest[ 'enabled' ] ) {
if ( $zebraEnabled ) {
$original['class'] .= ' ' . $aBTest[ 'name' ] . '-treatment ';
} else {
$original['class'] .= ' ' . $aBTest[ 'name' ] . '-control ';
}
}
$original['class'] = trim( $original['class'] );
return $original;

View file

@ -90,10 +90,7 @@ module.exports = function webABTest( props, token, forceInit ) {
*/
function getBucketFromHTML() {
for ( const bucketName of getBucketNames() ) {
if (
document.body.classList.contains( `${props.name}-${bucketName}` ) ||
document.documentElement.classList.contains( `${props.name}-${bucketName}` )
) {
if ( document.body.classList.contains( `${props.name}-${bucketName}` ) ) {
return bucketName;
}
}