Bug 609437. Go through the central link-click-dispatch code for isindex. r=sicking a=blocker
authorBoris Zbarsky <bzbarsky@mit.edu>
Thu, 04 Nov 2010 16:06:20 -0400
changeset 56860 c0dbdafa583c9b0175263a2d2b07193e0aa255e0
parent 56859 4467f70ed6df12458caef94de28c7502557d97f6
child 56861 488177edfe601687eeb371c143601adad1463843
push id16716
push userbzbarsky@mozilla.com
push dateThu, 04 Nov 2010 20:06:47 +0000
treeherdermozilla-central@c0dbdafa583c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssicking, blocker
bugs609437
milestone2.0b8pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 609437. Go through the central link-click-dispatch code for isindex. r=sicking a=blocker
layout/forms/nsIsIndexFrame.cpp
--- a/layout/forms/nsIsIndexFrame.cpp
+++ b/layout/forms/nsIsIndexFrame.cpp
@@ -55,17 +55,16 @@
 #include "nsIPresShell.h"
 #include "nsIDOMHTMLInputElement.h"
 #include "nsIStatefulFrame.h"
 #include "nsXPCOM.h"
 #include "nsISupportsPrimitives.h"
 #include "nsIComponentManager.h"
 #include "nsHTMLParts.h"
 #include "nsLinebreakConverter.h"
-#include "nsILinkHandler.h"
 #include "nsIHTMLDocument.h"
 #include "nsXPIDLString.h"
 #include "nsReadableUtils.h"
 #include "nsNetUtil.h"
 #include "nsICharsetConverterManager.h"
 #include "nsEscape.h"
 #include "nsIDOMKeyListener.h"
 #include "nsIDOMKeyEvent.h"
@@ -346,18 +345,16 @@ nsIsIndexFrame::OnSubmit(nsPresContext* 
      encoder = nsnull;
 
   nsAutoString value;
   GetInputValue(value);
   URLEncode(value, encoder, data);
   // End ProcessAsURLEncoded
 
   // make the url string
-  nsILinkHandler *handler = aPresContext->GetLinkHandler();
-
   nsAutoString href;
 
   // Get the document.
   // We'll need it now to form the URL we're submitting to.
   // We'll also need it later to get the DOM window when notifying form submit observers (bug 33203)
   nsCOMPtr<nsIDocument> document = mContent->GetDocument();
   if (!document) return NS_OK; // No doc means don't submit, see Bug 28988
 
@@ -425,20 +422,19 @@ nsIsIndexFrame::OnSubmit(nsPresContext* 
     }
     href.Append(data);
   }
   nsCOMPtr<nsIURI> uri;
   result = NS_NewURI(getter_AddRefs(uri), href,
                      flatDocCharset.get(), baseURI);
   if (NS_FAILED(result)) return result;
 
-  // Now pass on absolute url to the click handler
-  if (handler) {
-    handler->OnLinkClick(mContent, uri, nsnull);
-  }
+  // Now pretend we're triggering a link
+  nsContentUtils::TriggerLink(mContent, aPresContext, uri,
+                              EmptyString(), PR_TRUE, PR_TRUE);
   return result;
 }
 
 void nsIsIndexFrame::GetSubmitCharset(nsCString& oCharset)
 {
   oCharset.AssignLiteral("UTF-8"); // default to utf-8
   // XXX
   // We may want to get it from the HTML 4 Accept-Charset attribute first