зеркало из https://github.com/mozilla/pjs.git
Bug 66399: Make click on targetted server-side image map load resulting page into correct frame, r=nisheeth@netscape.com, sr=jst@netscape.com
This commit is contained in:
Родитель
2f1086b27b
Коммит
e4f0f038f0
|
@ -1297,10 +1297,11 @@ nsImageFrame::TranslateEventCoords(nsIPresContext* aPresContext,
|
||||||
}
|
}
|
||||||
|
|
||||||
PRBool
|
PRBool
|
||||||
nsImageFrame::GetAnchorHREF(nsString& aResult)
|
nsImageFrame::GetAnchorHREFAndTarget(nsString& aHref, nsString& aTarget)
|
||||||
{
|
{
|
||||||
PRBool status = PR_FALSE;
|
PRBool status = PR_FALSE;
|
||||||
aResult.Truncate();
|
aHref.Truncate();
|
||||||
|
aTarget.Truncate();
|
||||||
|
|
||||||
// Walk up the content tree, looking for an nsIDOMAnchorElement
|
// Walk up the content tree, looking for an nsIDOMAnchorElement
|
||||||
nsCOMPtr<nsIContent> content;
|
nsCOMPtr<nsIContent> content;
|
||||||
|
@ -1308,10 +1309,11 @@ nsImageFrame::GetAnchorHREF(nsString& aResult)
|
||||||
while (content) {
|
while (content) {
|
||||||
nsCOMPtr<nsIDOMHTMLAnchorElement> anchor(do_QueryInterface(content));
|
nsCOMPtr<nsIDOMHTMLAnchorElement> anchor(do_QueryInterface(content));
|
||||||
if (anchor) {
|
if (anchor) {
|
||||||
anchor->GetHref(aResult);
|
anchor->GetHref(aHref);
|
||||||
if (aResult.Length() > 0) {
|
if (aHref.Length() > 0) {
|
||||||
status = PR_TRUE;
|
status = PR_TRUE;
|
||||||
}
|
}
|
||||||
|
anchor->GetTarget(aTarget);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
nsCOMPtr<nsIContent> parent;
|
nsCOMPtr<nsIContent> parent;
|
||||||
|
@ -1390,7 +1392,7 @@ nsImageFrame::HandleEvent(nsIPresContext* aPresContext,
|
||||||
// Server side image maps use the href in a containing anchor
|
// Server side image maps use the href in a containing anchor
|
||||||
// element to provide the basis for the destination url.
|
// element to provide the basis for the destination url.
|
||||||
nsAutoString src;
|
nsAutoString src;
|
||||||
if (GetAnchorHREF(src)) {
|
if (GetAnchorHREFAndTarget(src, target)) {
|
||||||
NS_MakeAbsoluteURI(absURL, src, baseURL);
|
NS_MakeAbsoluteURI(absURL, src, baseURL);
|
||||||
NS_IF_RELEASE(baseURL);
|
NS_IF_RELEASE(baseURL);
|
||||||
|
|
||||||
|
|
|
@ -152,7 +152,7 @@ protected:
|
||||||
const nsPoint& aPoint,
|
const nsPoint& aPoint,
|
||||||
nsPoint& aResult);
|
nsPoint& aResult);
|
||||||
|
|
||||||
PRBool GetAnchorHREF(nsString& aResult);
|
PRBool GetAnchorHREFAndTarget(nsString& aHref, nsString& aTarget);
|
||||||
|
|
||||||
PRIntn GetSuppress();
|
PRIntn GetSuppress();
|
||||||
|
|
||||||
|
|
|
@ -1297,10 +1297,11 @@ nsImageFrame::TranslateEventCoords(nsIPresContext* aPresContext,
|
||||||
}
|
}
|
||||||
|
|
||||||
PRBool
|
PRBool
|
||||||
nsImageFrame::GetAnchorHREF(nsString& aResult)
|
nsImageFrame::GetAnchorHREFAndTarget(nsString& aHref, nsString& aTarget)
|
||||||
{
|
{
|
||||||
PRBool status = PR_FALSE;
|
PRBool status = PR_FALSE;
|
||||||
aResult.Truncate();
|
aHref.Truncate();
|
||||||
|
aTarget.Truncate();
|
||||||
|
|
||||||
// Walk up the content tree, looking for an nsIDOMAnchorElement
|
// Walk up the content tree, looking for an nsIDOMAnchorElement
|
||||||
nsCOMPtr<nsIContent> content;
|
nsCOMPtr<nsIContent> content;
|
||||||
|
@ -1308,10 +1309,11 @@ nsImageFrame::GetAnchorHREF(nsString& aResult)
|
||||||
while (content) {
|
while (content) {
|
||||||
nsCOMPtr<nsIDOMHTMLAnchorElement> anchor(do_QueryInterface(content));
|
nsCOMPtr<nsIDOMHTMLAnchorElement> anchor(do_QueryInterface(content));
|
||||||
if (anchor) {
|
if (anchor) {
|
||||||
anchor->GetHref(aResult);
|
anchor->GetHref(aHref);
|
||||||
if (aResult.Length() > 0) {
|
if (aHref.Length() > 0) {
|
||||||
status = PR_TRUE;
|
status = PR_TRUE;
|
||||||
}
|
}
|
||||||
|
anchor->GetTarget(aTarget);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
nsCOMPtr<nsIContent> parent;
|
nsCOMPtr<nsIContent> parent;
|
||||||
|
@ -1390,7 +1392,7 @@ nsImageFrame::HandleEvent(nsIPresContext* aPresContext,
|
||||||
// Server side image maps use the href in a containing anchor
|
// Server side image maps use the href in a containing anchor
|
||||||
// element to provide the basis for the destination url.
|
// element to provide the basis for the destination url.
|
||||||
nsAutoString src;
|
nsAutoString src;
|
||||||
if (GetAnchorHREF(src)) {
|
if (GetAnchorHREFAndTarget(src, target)) {
|
||||||
NS_MakeAbsoluteURI(absURL, src, baseURL);
|
NS_MakeAbsoluteURI(absURL, src, baseURL);
|
||||||
NS_IF_RELEASE(baseURL);
|
NS_IF_RELEASE(baseURL);
|
||||||
|
|
||||||
|
|
|
@ -152,7 +152,7 @@ protected:
|
||||||
const nsPoint& aPoint,
|
const nsPoint& aPoint,
|
||||||
nsPoint& aResult);
|
nsPoint& aResult);
|
||||||
|
|
||||||
PRBool GetAnchorHREF(nsString& aResult);
|
PRBool GetAnchorHREFAndTarget(nsString& aHref, nsString& aTarget);
|
||||||
|
|
||||||
PRIntn GetSuppress();
|
PRIntn GetSuppress();
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче