Jdlrobson has uploaded a new change for review.
https://gerrit.wikimedia.org/r/276009
Change subject: Fix parser cache issues
......................................................................
Fix parser cache issues
Mobile does not have a separate ParserOutput cache
Thus transformations such as removing the table of contents
and section collapsing have to occur later in the skin itself
Bug: T128702
Bug: T124356
Change-Id: I2b2aa15bee73454b1abc238c3413d30cdaa49f2c
---
M extension.json
M includes/MobileFrontend.hooks.php
2 files changed, 23 insertions(+), 2 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend
refs/changes/09/276009/1
diff --git a/extension.json b/extension.json
index 7d66b9d..00ddc99 100644
--- a/extension.json
+++ b/extension.json
@@ -1815,6 +1815,9 @@
"MediaWikiPerformAction": [
"MobileFrontendHooks::onMediaWikiPerformAction"
],
+ "OutputPageBeforeHTML": [
+ "MobileFrontendHooks::onOutputPageBeforeHTML"
+ ],
"SkinTemplateOutputPageBeforeExec": [
"MobileFrontendHooks::onSkinTemplateOutputPageBeforeExec"
],
diff --git a/includes/MobileFrontend.hooks.php
b/includes/MobileFrontend.hooks.php
index 7e72b4c..63e0dbd 100644
--- a/includes/MobileFrontend.hooks.php
+++ b/includes/MobileFrontend.hooks.php
@@ -183,6 +183,25 @@
}
/**
+ * OutputPageBeforeHTML hook handler
+ * @see https://www.mediawiki.org/wiki/Manual:Hooks/OutputPageBeforeHTML
+ *
+ * Applies MobileFormatter to mobile viewed content
+ *
+ * @param OutputPage $out
+ * @param string $text the HTML to be wrapped inside the
#mw-content-text element
+ * @return bool
+ */
+ public static function onOutputPageBeforeHTML( &$out, &$text ) {
+ $context = MobileContext::singleton();
+ // Perform a few extra changes if we are in mobile mode
+ if ( $context->shouldDisplayMobileView() ) {
+ $text = ExtMobileFrontend::DOMParse( $out, $text );
+ }
+ return true;
+ }
+
+ /**
* BeforePageRedirect hook handler
* @see https://www.mediawiki.org/wiki/Manual:Hooks/BeforePageRedirect
*
@@ -1237,8 +1256,7 @@
}
}
}
- // Enable wrapped sections
- $po->setText( ExtMobileFrontend::DOMParse( $outputPage,
$po->getText(), $isBeta ) );
+
}
return true;
}
--
To view, visit https://gerrit.wikimedia.org/r/276009
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I2b2aa15bee73454b1abc238c3413d30cdaa49f2c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: wmf/1.27.0-wmf.15
Gerrit-Owner: Jdlrobson <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits