Page MenuHomePhabricator

SpecialPreferences: <p> should not be inside <strong>
Closed, ResolvedPublic


/includes/specials/SpecialPreferences.php contains


"<div class=\"successbox\"><strong>\n$1\n</strong></div><div id=\"mw-pref-clear\"></div>",


and generates

<div class="successbox"><strong>
<p>Your preferences have been saved.

The strong element must contain phrasing content The p element is not allowed.

Solution: Remove strong and add
.successbox { font-weight: bold; }

Version: unspecified
Severity: trivial



Event Timeline

Or alternatively, parse with option 'inline' instead of default 'block', as is done for other inline messages.

The css class successbox is also used in some extensions. Some have the same problem <strong>\n$1\n</strong> or even use explicit <strong><p>.

The <div id="mw-pref-clear"></div> with #mw-pref-clear { clear: both; } is because successbox has a float:left.
mw-pref-clear is only defined in /skins/common/oldshared.css and /skins/modern/main.css by Bug 19759 in r53457 and r54197.

<div id="mw-pref-clear"></div> is not needed anymore because the following mw-prefs-form has already the css class visualClear:

.successbox { float:left } is a bad way to generate a box with intrinsic width. CSS has better possibilities.

Here is a example page with several boxes:

successbox is not a inline message. It is always a block. The <strong> should be removed.

float:left is only there to generate a box with intrinsic width. This generates other problems like here:
The float:left should be removed. Then a lots of clear:both like #mw-pref-clear are unnecessary and can be removed. CSS has better possibilities to generate a box with intrinsic width.

(removing 38638 blocker, not related to i18n messages, but to how SpecialPreferences parses the output)

Change-Id: If606203218ece5974a956a3d41d5db40f55b2d5c

(In reply to comment #5)

Change-Id: If606203218ece5974a956a3d41d5db40f55b2d5c


Thanks for fixing the <strong>.

There is still
float: left;
to generate a box with intrinsic width. But this needs a clear:left in the following element.

With the following definition instead there is no need for a clear:left:
display: inline-block;
zoom: 1;
*display: inline;

Related URL: (Gerrit Change Ibb9371eecb99b627ba9dfca5b0a60143fbd6f84f)

I submitted the above patch to apply this fix. (Keeping this bug closed since it's not really related - the original issue has been fixed.)

The fix for this changes the appearance of all forms using {error,success,warning}box, even those like Userlogin and Create account that weren't bolding their contents and don't wish to. I created bug 48197.

Related URL: (Gerrit Change I0b39138967f2d29d5e50db0a5990d175fcc81a8e)