зеркало из https://github.com/mozilla/pjs.git
Spaces now stripped from map name for client-side maps. Client-side and server-side imagemaps can now co-exist
This commit is contained in:
Родитель
c91a9f5a64
Коммит
5356c31fd8
|
@ -520,6 +520,10 @@ nsImageFrame::GetImageMap()
|
|||
return nsnull;
|
||||
}
|
||||
|
||||
// Strip out whitespace in the name for navigator compatability
|
||||
// XXX NAV QUIRK
|
||||
usemap.StripWhitespace();
|
||||
|
||||
nsIDocument* doc = nsnull;
|
||||
mContent->GetDocument(doc);
|
||||
if (nsnull == doc) {
|
||||
|
@ -669,12 +673,15 @@ nsImageFrame::HandleEvent(nsIPresContext& aPresContext,
|
|||
switch (aEvent->message) {
|
||||
case NS_MOUSE_LEFT_BUTTON_UP:
|
||||
case NS_MOUSE_MOVE:
|
||||
{
|
||||
map = GetImageMap();
|
||||
if ((nsnull != map) || IsServerImageMap()) {
|
||||
PRBool isServerMap = IsServerImageMap();
|
||||
if ((nsnull != map) || isServerMap) {
|
||||
nsPoint p;
|
||||
TranslateEventCoords(aPresContext, aEvent->point, p);
|
||||
nsAutoString absURL, target, altText;
|
||||
PRBool suppress;
|
||||
PRBool inside = PR_FALSE;
|
||||
if (nsnull != map) {
|
||||
nsIDocument* doc = nsnull;
|
||||
mContent->GetDocument(doc);
|
||||
|
@ -684,7 +691,6 @@ nsImageFrame::HandleEvent(nsIPresContext& aPresContext,
|
|||
NS_RELEASE(doc);
|
||||
}
|
||||
|
||||
PRBool inside = PR_FALSE;
|
||||
if (docURL) {
|
||||
inside = map->IsInside(p.x, p.y, docURL, absURL, target, altText,
|
||||
&suppress);
|
||||
|
@ -701,7 +707,8 @@ nsImageFrame::HandleEvent(nsIPresContext& aPresContext,
|
|||
TriggerLink(aPresContext, absURL, target, clicked);
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
if (!inside && isServerMap) {
|
||||
suppress = GetSuppress();
|
||||
nsIURI* baseURL = nsnull;
|
||||
nsIHTMLContent* htmlContent;
|
||||
|
@ -748,6 +755,7 @@ nsImageFrame::HandleEvent(nsIPresContext& aPresContext,
|
|||
TriggerLink(aPresContext, absURL, target, clicked);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
|
|
@ -520,6 +520,10 @@ nsImageFrame::GetImageMap()
|
|||
return nsnull;
|
||||
}
|
||||
|
||||
// Strip out whitespace in the name for navigator compatability
|
||||
// XXX NAV QUIRK
|
||||
usemap.StripWhitespace();
|
||||
|
||||
nsIDocument* doc = nsnull;
|
||||
mContent->GetDocument(doc);
|
||||
if (nsnull == doc) {
|
||||
|
@ -669,12 +673,15 @@ nsImageFrame::HandleEvent(nsIPresContext& aPresContext,
|
|||
switch (aEvent->message) {
|
||||
case NS_MOUSE_LEFT_BUTTON_UP:
|
||||
case NS_MOUSE_MOVE:
|
||||
{
|
||||
map = GetImageMap();
|
||||
if ((nsnull != map) || IsServerImageMap()) {
|
||||
PRBool isServerMap = IsServerImageMap();
|
||||
if ((nsnull != map) || isServerMap) {
|
||||
nsPoint p;
|
||||
TranslateEventCoords(aPresContext, aEvent->point, p);
|
||||
nsAutoString absURL, target, altText;
|
||||
PRBool suppress;
|
||||
PRBool inside = PR_FALSE;
|
||||
if (nsnull != map) {
|
||||
nsIDocument* doc = nsnull;
|
||||
mContent->GetDocument(doc);
|
||||
|
@ -684,7 +691,6 @@ nsImageFrame::HandleEvent(nsIPresContext& aPresContext,
|
|||
NS_RELEASE(doc);
|
||||
}
|
||||
|
||||
PRBool inside = PR_FALSE;
|
||||
if (docURL) {
|
||||
inside = map->IsInside(p.x, p.y, docURL, absURL, target, altText,
|
||||
&suppress);
|
||||
|
@ -701,7 +707,8 @@ nsImageFrame::HandleEvent(nsIPresContext& aPresContext,
|
|||
TriggerLink(aPresContext, absURL, target, clicked);
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
if (!inside && isServerMap) {
|
||||
suppress = GetSuppress();
|
||||
nsIURI* baseURL = nsnull;
|
||||
nsIHTMLContent* htmlContent;
|
||||
|
@ -748,6 +755,7 @@ nsImageFrame::HandleEvent(nsIPresContext& aPresContext,
|
|||
TriggerLink(aPresContext, absURL, target, clicked);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
|
Загрузка…
Ссылка в новой задаче