Open Bug 1450027 Opened 2 years ago Updated 1 year ago

shadow-dom/MouseEvent-prototype-offsetX-offsetY.html fails with unexpected event coordinates.

Categories

(Core :: DOM: Events, enhancement, P3)

enhancement

Tracking

()

People

(Reporter: emilio, Unassigned, NeedInfo)

References

(Blocks 1 open bug)

Details

(Keywords: parity-chrome, parity-safari)

Looks like we're not accounting for the padding and margin, since there's a 15px difference.
Summary: shadow-dom/MouseEvent-prototype-offsetX-offsetY.html fails with unexpected event client coordinates. → shadow-dom/MouseEvent-prototype-offsetX-offsetY.html fails with unexpected event coordinates.
The third test is actually a layout bug that I'm fixing in bug 1303605.
Priority: -- → P3
This is not a shadow DOM issue, since the first test in the file doesn't use shadow DOM at all, yet fails. And the test using shadow DOM fails the same way.
No longer blocks: shadowdom-initial-release

The first test failure I see here is due to a test bug: https://github.com/web-platform-tests/wpt/issues/15089

Once that's fixed, we probably need to re-evaluate.

So if I fix the test in the obvious way, by adding

line-height: 1; font-family: Ahem

to the my-host styles, then the test still fails, like so:

assert_equals: expected 21 but got 6

on this line:

assert_equals(eventLogs[0].offsetX, 21); // Padding edge of target is at (30px, 20px)

so there's still something funny going on here. I'm not sure why the test claims "Padding edge of target is at (30px, 20px)" if the target has 5px margin-left and the offsetLeft of the target is 45.

Maybe this test is expecting offsetX to be measured relative to the block parent of the inline or something?

Bu a simple testcase shows me that without shadow DOM involved that is exactly what we do: an event's offsetX is relative to the nearest block ancestor if it's targeted at an inline.

So in this case it should in fact be relative to the <div id="container">, which has an offsetLeft of 30, which means we should get 21. Why are we ending up with it relative to the <span id="target"> instead?

Flags: needinfo?(bugs)
You need to log in before you can comment on or make changes to this bug.