From: Brion Vibber Date: Sun, 19 Jul 2009 19:59:12 +0000 (+0000) Subject: * (bug 19287) Workaround for lag on history page in Firefox 3.5 X-Git-Tag: 1.31.0-rc.0~40831 X-Git-Url: http://git.cyclocoop.org/%24self?a=commitdiff_plain;h=739aee25ae2423bca77b6e84dd0aecfe29a7e831;p=lhc%2Fweb%2Fwiklou.git * (bug 19287) Workaround for lag on history page in Firefox 3.5 Added id attributes to diff radios and show/hide check boxes; this is to work around a bug in Firefox 3.5 where form session saving hangs for a while after each change when a page contains hundreds of anonymous radio and checkboxes. --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index ddccf5ee90..a78eaa693e 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -294,6 +294,7 @@ this. Was used when mwEmbed was going to be an extension. Keyword set was not useful, and is ignored by modern search engines anway. * (bug 19827) Special:SpecialPages title is "Upload file * (bug 19355) Added .xhtml, .xht to upload file extension blacklist +* (bug 19287) Workaround for lag on history page in Firefox 3.5 == API changes in 1.16 == diff --git a/includes/PageHistory.php b/includes/PageHistory.php index 279f97b43a..ed84e189e7 100644 --- a/includes/PageHistory.php +++ b/includes/PageHistory.php @@ -301,9 +301,12 @@ class PageHistory { '(' . $this->message['rev-delundel'] . ')' ); // Otherwise, show the link... } else { - $jsCall = 'updateShowHideForm('.$rev->getId().',this.checked)'; + $id = $rev->getId(); + $jsCall = "updateShowHideForm($id,this.checked)"; $del = Xml::check( 'showhiderevisions', false, - $hidden + array('onchange' => $jsCall) ); + $hidden + array( + 'onchange' => $jsCall, + 'id' => "mw-revdel-$id" ) ); $query = array( 'type' => 'revision', 'target' => $this->mTitle->getPrefixedDbkey(), @@ -473,11 +476,15 @@ class PageHistory { */ function diffButtons( $rev, $firstInList, $counter ) { if( $this->linesonpage > 1 ) { - $radio = array( 'type' => 'radio', 'value' => $rev->getId() ); + $id = $rev->getId(); + $radio = array( 'type' => 'radio', 'value' => $id ); /** @todo: move title texts to javascript */ if( $firstInList ) { $first = Xml::element( 'input', - array_merge( $radio, array( 'style' => 'visibility:hidden', 'name' => 'oldid' ) ) + array_merge( $radio, array( + 'style' => 'visibility:hidden', + 'name' => 'oldid', + 'id' => 'mw-oldid-null' ) ) ); $checkmark = array( 'checked' => 'checked' ); } else { @@ -487,14 +494,20 @@ class PageHistory { $checkmark = array(); // We will check the next possible one } else if( $counter == 2 || !$this->mOldIdChecked ) { $checkmark = array( 'checked' => 'checked' ); - $this->mOldIdChecked = $rev->getId(); + $this->mOldIdChecked = $id; } else { $checkmark = array(); } - $first = Xml::element( 'input', array_merge( $radio, $checkmark, array( 'name' => 'oldid' ) ) ); + $first = Xml::element( 'input', + array_merge( $radio, $checkmark, array( + 'name' => 'oldid', + 'id' => "mw-oldid-$id" ) ) ); $checkmark = array(); } - $second = Xml::element( 'input', array_merge( $radio, $checkmark, array( 'name' => 'diff' ) ) ); + $second = Xml::element( 'input', + array_merge( $radio, $checkmark, array( + 'name' => 'diff', + 'id' => "mw-diff-$id" ) ) ); return $first . $second; } else { return '';