Open Bug 1539619 Opened 6 years ago Updated 1 year ago

Implement event.fromElement and event.toElement

Categories

(Core :: DOM: Core & HTML, enhancement, P2)

66 Branch
enhancement

Tracking

()

Webcompat Priority P3

People

(Reporter: beaven+firefox, Unassigned)

References

(Blocks 1 open bug)

Details

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:66.0) Gecko/20100101 Firefox/66.0

Steps to reproduce:

Actual site is behind a login but this is what the popup says--

A javascript error has occurred.

Error reference ID: 1553716576679
Error location: Line #135 of https://www.360-value.com/iv/xv2scripts.js (/ComMenu.jsp)
Error message: TypeError: event.fromElement is undefined
Information about this error has been sent to 360Value.

Click OK to continue or Cancel to reload the page

Actual results:

Popup message.

Expected results:

The text should be displayed instead of an error message.

Has STR: --- → yes

Hi,
Can you please attach more specific steps so I can try to reproduce this issue? I tried to access https://www.360-value.com/apps/iv/Login and no error appears by hovering on any element from the page.

Flags: needinfo?(beaven+firefox)

Unfortunately, you need to be logged in to get the error to replicate. Would a screenshot help?

Flags: needinfo?(beaven+firefox)

Yes, please attach a screenshot. Thank you!
Meanwhile, I will set a component to this issue and leave it Unconfirmed for the moment, due to the fact that login is needed.

Component: Untriaged → JavaScript Engine
Flags: needinfo?(beaven+firefox)
Product: Firefox → Core

The script at https://www.360-value.com/iv/xv2scripts.js assumes when window.event is present, the browser is IE and therefore window.event.fromElement is also present:

function searchMouseOut()
{
	// IE calls a mouseout event when scrolling over an inner div. This
	// causes the ui to flicker for the create valuation list.
	var doIEFix = false;
	if (typeof event != 'undefined')
	{
		doIEFix = true;
	}
	
	if (!doIEFix || !event.fromElement.contains(event.toElement) &&!document.getElementById('searchsection').contains(event.toElement)) 
	{ 
		var obj = document.getElementById('searchvalimage');
		obj.src = "/iv/images/xv2_search_off.jpg";
		
	}
}
Component: JavaScript Engine → DOM: Core & HTML

Screenshots:

  1. When the page loads, it looks like this-- https://i.imgur.com/Vl9e5es.png

  2. When you hover over any of the three graphic icons, this error happens-- https://i.imgur.com/lRxRM3L.png

A menu is supposed to appear when hovering over those icons.

Flags: needinfo?(beaven+firefox)

It seems Blink supports fromElement and toElement. I gather these should be in the UI Events spec, but I don't see them there.

annevk, is there a spec for these? If not, do these belong in UI Events or HTML?

(Confirming in the sense that comment 4 looks like code that we'd break now.)

Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(annevk)
Priority: -- → P2

annevk pointed me to https://github.com/w3c/uievents/issues/84 on IRC.

Flags: needinfo?(annevk)
Summary: A javascript error pops-up when hovering over text that a graphic that changes to text when hovering over it. → Implement event.fromElement and event.toElement
Flags: webcompat?
Type: defect → enhancement

Just a note for the reported site, the function searchMouseOut() has been updated to not use the window.event sniffing or fromElement/toElement:

function searchMouseOut()
{
	var obj = document.getElementById('searchvalimage');
	obj.src = "/iv/images/xv2_search_off.jpg";
}

See bug 1547409. Moving webcompat whiteboard tags to project flags.

Webcompat Priority: --- → ?
Webcompat Priority: ? → revisit
Flags: webcompat?
Blocks: 1578346
Severity: normal → S3
Webcompat Priority: revisit → P3
Duplicate of this bug: 1874259
You need to log in before you can comment on or make changes to this bug.