Merge "HTMLForm: Rename file to `ooui.styles.less` and use LESS notation"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Sat, 7 Oct 2017 00:17:34 +0000 (00:17 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Sat, 7 Oct 2017 00:17:34 +0000 (00:17 +0000)
docs/uidesign/monospace.html
includes/installer/DatabaseUpdater.php
includes/resourceloader/ResourceLoaderImageModule.php
tests/phpunit/includes/resourceloader/ResourceLoaderImageTest.php

index f2b988e..cdaf580 100644 (file)
@@ -2,16 +2,25 @@
 <html lang="en" dir="ltr">
 <head>
        <style>
-               pre {
+               pre,
+               textarea {
                        border: 1px dashed #AAA;
                        background-color: #E0E0E0;
                        color: #000000;
-                       margin: 1em 10%;
                        padding: 0.5em;
+                       height: 1em;
+                       width: 90%;
                }
                blockquote {
                        font-style: italic;
                }
+               table {
+                       width: 100%;
+                       table-layout: fixed;
+               }
+               td {
+                       padding: 0.5em;
+               }
        </style>
 </head>
 <body>
@@ -33,45 +42,138 @@ font besides just "monospace", those browsers will no longer treat it as
 monospace and use 0.8 x 16px = 13px instead.
 </blockquote>
 <p>
+Additionally, it seems that textareas have their own font-size set in Chrome
+(but not Firefox and other browsers), making them unaffected by this behavior.
+</p>
+<p>
 Below are various rendering:
 </p>
 
+<table>
+
+<tr>
+<th>&lt;pre&gt;</th>
+<th>&lt;textarea&gt;</th>
+</tr>
+
+<tr>
+<td>
 <pre style='
 font-family: monospace;'>
 font-family: monospace;
 </pre>
+</td>
+<td>
+<textarea style='
+font-family: monospace;'>
+font-family: monospace;
+</textarea>
+</td>
+</tr>
 
+<tr>
+<td>
 <pre style='
 font-family: "Courier New";'>
 font-family: "Courier New";
 </pre>
+</td>
+<td>
+<textarea style='
+font-family: "Courier New";'>
+font-family: "Courier New";
+</textarea>
+</td>
+</tr>
 
+<tr>
+<td>
 <pre style='
 font-family: Courier;'>
 font-family: Courier;
 </pre>
+</td>
+<td>
+<textarea style='
+font-family: Courier;'>
+font-family: Courier;
+</textarea>
+</td>
+</tr>
 
+<tr>
+<td>
 <pre style='
 font-family: monospace, monospace;'>
 font-family: monospace, monospace;
 </pre>
+</td>
+<td>
+<textarea style='
+font-family: monospace, monospace;'>
+font-family: monospace, monospace;
+</textarea>
+</td>
+</tr>
 
+<tr>
+<td>
 <pre style='
 font-family: monospace, "Courier New";'>
 font-family: monospace, "Courier New";
 </pre>
+</td>
+<td>
+<textarea style='
+font-family: monospace, "Courier New";'>
+font-family: monospace, "Courier New";
+</textarea>
+</td>
+</tr>
 
+<tr>
+<td>
 <pre style='
 font-family: monospace, Courier;'>
 font-family: monospace, Courier;
 </pre>
+</td>
+<td>
+<textarea style='
+font-family: monospace, Courier;'>
+font-family: monospace, Courier;
+</textarea>
+</td>
+</tr>
 
+<tr>
+<td>
 <pre style='
 font-family: monospace, Verdana;'>
 font-family: monospace, Verdana;
 </pre>
+</td>
+<td>
+<textarea style='
+font-family: monospace, Verdana;'>
+font-family: monospace, Verdana;
+</textarea>
+</td>
+</tr>
 
+<tr>
+<td>
 <pre style='
 font-family: monospace, DOESNOTEXISTREALLY;'>
 font-family: monospace, DOESNOTEXISTREALLY;
 </pre>
+</td>
+<td>
+<textarea style='
+font-family: monospace, DOESNOTEXISTREALLY;'>
+font-family: monospace, DOESNOTEXISTREALLY;
+</textarea>
+</td>
+</tr>
+
+</table>
index 752bc54..a317822 100644 (file)
@@ -988,19 +988,27 @@ abstract class DatabaseUpdater {
        }
 
        /**
-        * Purge the objectcache table
+        * Purge various database caches
         */
        public function purgeCache() {
                global $wgLocalisationCacheConf;
-               # We can't guarantee that the user will be able to use TRUNCATE,
-               # but we know that DELETE is available to us
+               // We can't guarantee that the user will be able to use TRUNCATE,
+               // but we know that DELETE is available to us
                $this->output( "Purging caches..." );
+
+               // ObjectCache
                $this->db->delete( 'objectcache', '*', __METHOD__ );
+
+               // LocalisationCache
                if ( $wgLocalisationCacheConf['manualRecache'] ) {
                        $this->rebuildLocalisationCache();
                }
+
+               // ResourceLoader: Message cache
                $blobStore = new MessageBlobStore();
                $blobStore->clear();
+
+               // ResourceLoader: File-dependency cache
                $this->db->delete( 'module_deps', '*', __METHOD__ );
                $this->output( "done.\n" );
        }
index 8b54959..71a0fa2 100644 (file)
@@ -249,7 +249,7 @@ class ResourceLoaderImageModule extends ResourceLoaderModule {
                                $fileDescriptor = is_string( $options ) ? $options : $options['file'];
 
                                $allowedVariants = array_merge(
-                                       is_array( $options ) && isset( $options['variants'] ) ? $options['variants'] : [],
+                                       ( is_array( $options ) && isset( $options['variants'] ) ) ? $options['variants'] : [],
                                        $this->getGlobalVariants( $context )
                                );
                                if ( isset( $this->variants[$skin] ) ) {
index aea2776..838d2c0 100644 (file)
@@ -15,8 +15,8 @@ class ResourceLoaderImageTest extends ResourceLoaderTestCase {
        protected function getTestImage( $name ) {
                $options = ResourceLoaderImageModuleTest::$commonImageData[$name];
                $fileDescriptor = is_string( $options ) ? $options : $options['file'];
-               $allowedVariants = is_array( $options ) &&
-                       isset( $options['variants'] ) ? $options['variants'] : [];
+               $allowedVariants = ( is_array( $options ) && isset( $options['variants'] ) ) ?
+                       $options['variants'] : [];
                $variants = array_fill_keys( $allowedVariants, [ 'color' => 'red' ] );
                return new ResourceLoaderImageTestable(
                        $name,