warmup: true
runs: 5
scenarios:
- Load a page:
+ Read a page:
# The only page that exists by default is the main page.
# But its actual name is configurable/unknown (T216791).
# Omit 'title' to let MediaWiki show the default (which is the main page),
probes:
- screenshot
- trace
+ View history of a page:
+ url: "{MW_SERVER}{MW_SCRIPT_PATH}/index.php?action=history"
+ viewport:
+ width: 1100
+ height: 700
+ reports:
+ - navtiming
+ - paint
+ - transfer
+ probes:
+ - screenshot
+ - trace
View recent changes:
url: "{MW_SERVER}{MW_SCRIPT_PATH}/index.php?title=Special:RecentChanges"
viewport:
// Use an IE conditional comment to serve the script only to old IE
$pieces[] = '<!--[if lt IE 9]>' .
ResourceLoaderClientHtml::makeLoad(
- ResourceLoaderContext::newDummyContext(),
+ new ResourceLoaderContext(
+ $this->getResourceLoader(),
+ new FauxRequest( [] )
+ ),
[ 'html5shiv' ],
ResourceLoaderModule::TYPE_SCRIPTS,
[ 'sync' => true ],
try {
$text = $content_handler->exportTransform( $text, $content_format );
}
- catch ( MWException $ex ) {
- // leave text as is; that's the way it goes
+ catch ( Exception $ex ) {
+ if ( $ex instanceof MWException || $ex instanceof RuntimeException ) {
+ // leave text as is; that's the way it goes
+ wfLogWarning( 'exportTransform failed on text for revid ' . $row->rev_id . "\n" );
+ } else {
+ throw $ex;
+ }
}
$out .= " " . Xml::elementClean( 'text',
[ 'xml:space' => 'preserve', 'bytes' => intval( $row->rev_len ) ],
// TODO: make this fully MCR aware, see T174031
$rev = $this->getRevisionStore()->newRevisionFromRow( $row, 0, $this->currentTitle );
$slot = $rev->getSlot( 'main' );
- $content = $slot->getContent();
-
- if ( $content instanceof TextContent ) {
- // HACK: For text based models, bypass the serialization step.
- // This allows extensions (like Flow)that use incompatible combinations
- // of serialization format and content model.
- $text = $content->getNativeData();
- } else {
- $text = $content->serialize( $content_format );
+ try {
+ $content = $slot->getContent();
+
+ if ( $content instanceof TextContent ) {
+ // HACK: For text based models, bypass the serialization step.
+ // This allows extensions (like Flow)that use incompatible combinations
+ // of serialization format and content model.
+ $text = $content->getNativeData();
+ } else {
+ $text = $content->serialize( $content_format );
+ }
+ $text = $content_handler->exportTransform( $text, $content_format );
+ $out .= " " . Xml::elementClean( 'text',
+ [ 'xml:space' => 'preserve', 'bytes' => intval( $slot->getSize() ) ],
+ strval( $text ) ) . "\n";
+ }
+ catch ( Exception $ex ) {
+ if ( $ex instanceof MWException || $ex instanceof RuntimeException ) {
+ // there's no provsion in the schema for an attribute that will let
+ // the user know this element was unavailable due to error; an empty
+ // tag is the best we can do
+ $out .= " " . Xml::element( 'text' ) . "\n";
+ wfLogWarning( 'failed to load content for revid ' . $row->rev_id . "\n" );
+ } else {
+ throw $ex;
+ }
}
-
- $text = $content_handler->exportTransform( $text, $content_format );
- $out .= " " . Xml::elementClean( 'text',
- [ 'xml:space' => 'preserve', 'bytes' => intval( $slot->getSize() ) ],
- strval( $text ) ) . "\n";
} elseif ( isset( $row->rev_text_id ) ) {
// Stub output for pre-MCR schema
// TODO: MCR: rev_text_id only exists in the pre-MCR schema. Remove this when
*/
use Wikimedia\Rdbms\Database;
use Wikimedia\Rdbms\IDatabase;
+use Wikimedia\Rdbms\IMaintainableDatabase;
use MediaWiki\MediaWikiServices;
require_once __DIR__ . '/../../maintenance/Maintenance.php';
}
/**
- * @param Database $db
+ * @param IMaintainableDatabase $db
* @param bool $shared
* @param Maintenance|null $maintenance
*
* @throws MWException
* @return DatabaseUpdater
*/
- public static function newForDB( Database $db, $shared = false, Maintenance $maintenance = null ) {
+ public static function newForDB(
+ IMaintainableDatabase $db,
+ $shared = false,
+ Maintenance $maintenance = null
+ ) {
$type = $db->getType();
if ( in_array( $type, Installer::getDBTypes() ) ) {
$class = ucfirst( $type ) . 'Updater';
* things that don't "really" need a context.
*
* Use cases:
- * - Creating html5shiv script tag in OutputPage.
* - Unit tests (deprecated, create empty instance directly or use RLTestCase).
*
* @return ResourceLoaderContext
"delete-confirm": "Delete \"$1\"",
"delete-legend": "Delete",
"historywarning": "<strong>Warning:</strong> The page you are about to delete has a history with $1 {{PLURAL:$1|revision|revisions}}:",
- "historyaction-submit": "Show",
+ "historyaction-submit": "Show revisions",
"confirmdeletetext": "You are about to delete a page along with all of its history.\nPlease confirm that you intend to do this, that you understand the consequences, and that you are doing this in accordance with [[{{MediaWiki:Policy-url}}|the policy]].",
"actioncomplete": "Action complete",
"actionfailed": "Action failed",
"delete-confirm": "Used as page title. Parameters:\n* $1 - the page title\n{{Identical|Delete}}",
"delete-legend": "{{Identical|Delete}}",
"historywarning": "Warning when about to delete a page that has history.\n\nFollowed by a link which points to the history page.\n\nParameters:\n* $1 - the number of revisions that the page has",
- "historyaction-submit": "Submit button on history pages\n{{Identical|Show}}",
+ "historyaction-submit": "Submit button to show revisions on revision history pages\n",
"confirmdeletetext": "Introduction shown when deleting a page.\n\nRefers to {{msg-mw|Policy-url}}.",
"actioncomplete": "Used in several situations, for example when a page has been deleted.\n\nSee also:\n* {{msg-mw|Actionfailed|page title}}",
"actionfailed": "Used as page title when the submit operation failed, in [[Special:RevisionDelete]].\n\nSee also:\n* {{msg-mw|Actioncomplete|page title}}",
],
'mediawiki.action.history.styles' => [
'skinStyles' => [
- 'default' => 'resources/src/mediawiki.action/mediawiki.action.history.styles.css',
+ 'default' => 'resources/src/mediawiki.action/mediawiki.action.history.styles.less',
],
'targets' => [ 'desktop', 'mobile' ],
],
+++ /dev/null
-/* Basic styles for the history page */
-
-#pagehistory .history-user {
- margin-left: 0.4em;
- margin-right: 0.2em;
-}
-
-#pagehistory li {
- border: 1px solid #fff;
-}
-
-#pagehistory li.selected {
- background-color: #f8f9fa;
- color: #222;
- border: 1px dashed #a2a9b1;
-}
-
-.mw-history-revisionactions {
- float: right;
-}
-
-.updatedmarker {
- background-color: #b7f430;
-}
--- /dev/null
+/* Basic styles for the history page */
+@import 'mediawiki.mixins';
+
+/* Visually hide repeating text, but leave in for better form navigation on screen readers. */
+.action-history .mw-htmlform-ooui .oo-ui-fieldsetLayout:first-child .oo-ui-fieldsetLayout-header {
+ .mixin-screen-reader-text();
+}
+
+#pagehistory .history-user {
+ margin-left: 0.4em;
+ margin-right: 0.2em;
+}
+
+#pagehistory li {
+ border: 1px solid #fff;
+}
+
+#pagehistory li.selected {
+ background-color: #f8f9fa;
+ color: #222;
+ border: 1px dashed #a2a9b1;
+}
+
+.mw-history-revisionactions {
+ float: right;
+}
+
+.updatedmarker {
+ background-color: #b7f430;
+}
}
.mw-datatable th {
- background-color: #ddf;
+ background-color: #eaeeff;
}
.mw-datatable td {
list-style-image: e( '/* @embed */' ) url( @url );
}
-.list-style-image-svg( @svg, @fallback ) {
- list-style-image: e( '/* @embed */' ) url( @svg );
- /* Fallback to PNG bullet for IE 8 and below using CSS hack */
- list-style-image: e( '/* @embed */' ) url( @fallback ) e( '\9' );
-}
-
.hyphens( @value: auto ) {
& when ( @value = auto ) {
// Legacy `word-wrap`; IE 6-11, Edge 12+, Firefox 3.5+, Chrome 4+, Safari 3.1+,
},
/**
- * Get an automatically generated random ID (persisted in sessionStorage)
+ * Retrieve a random ID persisted in sessionStorage, generating it if needed
*
- * This ID is ephemeral for everyone, staying in their browser only until they
- * close their browsing session.
+ * This ID is stored in sessionStorage and persists within a single tab,
+ * including between page views through links and form submissions,
+ * and when going forwards/backwards in browser history, and when restoring
+ * a closed tab, or restoring a closed browser session.
+ *
+ * This is different from session cookies, because it is not shared between
+ * tabs of the same browser. Two simultaneous pageviews in the same browser
+ * can have different session IDs. The ID is also not re-used when opening
+ * a new tab to a website after fully closing others.
+ *
+ * See https://phabricator.wikimedia.org/T118063#4547178 and
+ * https://developer.mozilla.org/en-US/docs/Web/API/Window/sessionStorage
+ * for more information.
*
* @return {string} Random session ID
*/