r96166 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r96165‎ | r96166 | r96167 >
Date:00:35, 3 September 2011
Author:krinkle
Status:ok
Tags:
Comment:
Html.php: Move html5-validation blacklist check to *AFTER* the check the might continue (and skip this loop entirely) if we're not in HTML5 with an html5-only attribute.
* Performance :)
Modified paths:
  • /trunk/phase3/includes/Html.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Html.php
@@ -389,16 +389,6 @@
390390 # and we'd like consistency and better compression anyway.
391391 $key = strtolower( $key );
392392
393 - # Bug 23769: Blacklist all form validation attributes for now. Current
394 - # (June 2010) WebKit has no UI, so the form just refuses to submit
395 - # without telling the user why, which is much worse than failing
396 - # server-side validation. Opera is the only other implementation at
397 - # this time, and has ugly UI, so just kill the feature entirely until
398 - # we have at least one good implementation.
399 - if ( in_array( $key, array( 'max', 'min', 'pattern', 'required', 'step' ) ) ) {
400 - continue;
401 - }
402 -
403393 # Here we're blacklisting some HTML5-only attributes...
404394 if ( !$wgHtml5 && in_array( $key, array(
405395 'autocomplete',
@@ -415,6 +405,16 @@
416406 continue;
417407 }
418408
 409+ # Bug 23769: Blacklist all form validation attributes for now. Current
 410+ # (June 2010) WebKit has no UI, so the form just refuses to submit
 411+ # without telling the user why, which is much worse than failing
 412+ # server-side validation. Opera is the only other implementation at
 413+ # this time, and has ugly UI, so just kill the feature entirely until
 414+ # we have at least one good implementation.
 415+ if ( in_array( $key, array( 'max', 'min', 'pattern', 'required', 'step' ) ) ) {
 416+ continue;
 417+ }
 418+
419419 # See the "Attributes" section in the HTML syntax part of HTML5,
420420 # 9.1.2.3 as of 2009-08-10. Most attributes can have quotation
421421 # marks omitted, but not all. (Although a literal " is not

Status & tagging log