From 0ec55b8dbc3614c03c9f6ba0e56eab767286e738 Mon Sep 17 00:00:00 2001 From: "rusty.lynch%intel.com" Date: Sun, 7 May 2000 16:48:06 +0000 Subject: [PATCH] Fix for bug #37165 (Unknown protocol handler in embed/object src attribute kills plug-in.) r=av --- layout/generic/nsObjectFrame.cpp | 11 +++++++++++ layout/html/base/src/nsObjectFrame.cpp | 11 +++++++++++ 2 files changed, 22 insertions(+) diff --git a/layout/generic/nsObjectFrame.cpp b/layout/generic/nsObjectFrame.cpp index 711843fc342..38046eb187c 100644 --- a/layout/generic/nsObjectFrame.cpp +++ b/layout/generic/nsObjectFrame.cpp @@ -721,11 +721,22 @@ nsObjectFrame::Reflow(nsIPresContext* aPresContext, { // Create an absolute URL rv = NS_NewURI(&fullURL, src, baseURL); + if ( rv != NS_OK ) + // Failed to create URI, maybe because we didn't + // reconize the protocol handler ==> treat like + // no 'src' was specified in the embed tag + fullURL = baseURL; } else if(NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::data, src)) { // Create an absolute URL rv = NS_NewURI(&fullURL, src, baseURL); + if ( rv != NS_OK ) + // Failed to create URI, maybe because we didn't + // reconize the protocol handler ==> treat like + // no 'data' was specified in the object tag + fullURL = baseURL; + } else {// we didn't find a src or data param, so just set the url to the base fullURL = baseURL; NS_IF_ADDREF(fullURL); diff --git a/layout/html/base/src/nsObjectFrame.cpp b/layout/html/base/src/nsObjectFrame.cpp index 711843fc342..38046eb187c 100644 --- a/layout/html/base/src/nsObjectFrame.cpp +++ b/layout/html/base/src/nsObjectFrame.cpp @@ -721,11 +721,22 @@ nsObjectFrame::Reflow(nsIPresContext* aPresContext, { // Create an absolute URL rv = NS_NewURI(&fullURL, src, baseURL); + if ( rv != NS_OK ) + // Failed to create URI, maybe because we didn't + // reconize the protocol handler ==> treat like + // no 'src' was specified in the embed tag + fullURL = baseURL; } else if(NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::data, src)) { // Create an absolute URL rv = NS_NewURI(&fullURL, src, baseURL); + if ( rv != NS_OK ) + // Failed to create URI, maybe because we didn't + // reconize the protocol handler ==> treat like + // no 'data' was specified in the object tag + fullURL = baseURL; + } else {// we didn't find a src or data param, so just set the url to the base fullURL = baseURL; NS_IF_ADDREF(fullURL);