Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MouseEvent-prototype-offsetX-offsetY.html seems to depend on non-spec-defined behavior #15089

Open
bzbarsky opened this issue Jan 25, 2019 · 3 comments · May be fixed by #22234
Open

MouseEvent-prototype-offsetX-offsetY.html seems to depend on non-spec-defined behavior #15089

bzbarsky opened this issue Jan 25, 2019 · 3 comments · May be fixed by #22234

Comments

@bzbarsky
Copy link
Contributor

The test is testing things like the offsetTop of an inline, but this is not actually defined in the CSS specification. Specifically, the relevant text in CSS 2.1, last I checked, is:

 10.6 Calculating heights and margins
   10.6.1 Inline, non-replaced elements
     The 'height' property does not apply. The height of the content area
     should be based on the font, but this specification does not specify how.

and I'm not aware of any later CSS specs that define the behavior.

Since the offsetTop depends on the interaction of the line-height and the heights of the inlines, it's not specified either.

The test should probably use a display: block target element instead.

@rniwa, thoughts? It looks like you wrote this test.

@bzbarsky
Copy link
Contributor Author

Actually, we could probably stay with an inline if we set line-height: 1; font-family: Ahem on the my-host element. That should eliminate the browser rendering differences in terms of inline layout.

@rniwa
Copy link
Contributor

rniwa commented Jan 25, 2019

Yeah, setting line-height and font-family sounds great to me. I wanted to add testing for inline elements but didn't realize it wasn't specified at all. I guess we could use display:block if we wanted to avoid depending on any unspec'ed behavior.

@bzbarsky
Copy link
Contributor Author

No, browsers are still not interoperable even with the Ahem/line-height thing, looks like...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants