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

align="justify" should align to start, not to left #10148

Open
Loirooriol opened this issue Feb 20, 2024 · 4 comments
Open

align="justify" should align to start, not to left #10148

Loirooriol opened this issue Feb 20, 2024 · 4 comments
Labels
needs tests Moving the issue forward requires someone to write tests topic: rendering

Comments

@Loirooriol
Copy link
Contributor

What is the issue with the HTML Standard?

https://html.spec.whatwg.org/multipage/rendering.html#flow-content-3

The div element, when it has an align attribute whose value is an ASCII case-insensitive match for the string "justify", is expected to full-justify text within itself, as if it had its 'text-align' property set to 'justify' in a presentational hint, and to align descendants to the left.

However, all browsers I tested (Gecko, Blink, WebKit, Servo 2013) align to the start side, not to the left side. Testcase:

<!DOCTYPE html>
<div align="justify" style="border: solid; direction: rtl">
  <div style="width: 150px; background: cyan">
    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
  </div>
</div>

The cyan box appears on the right, not on the left. I think the spec should be changed to reflect reality?

@annevk
Copy link
Member

annevk commented Feb 21, 2024

Makes sense. Would be good to add test coverage too.

@annevk
Copy link
Member

annevk commented Feb 21, 2024

So you're saying we should remove

, and to align descendants to the left

?

Looking at the code I wonder if Chromium and WebKit are problematic as they would automatically support new text-align values it seems.

@Loirooriol
Copy link
Contributor Author

So you're saying we should remove

Yes

Looking at the code I wonder if Chromium and WebKit are problematic

Good point, align="end" sets text-align: end there, but not on Firefox.

@annevk annevk added the needs tests Moving the issue forward requires someone to write tests label Feb 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs tests Moving the issue forward requires someone to write tests topic: rendering
Development

No branches or pull requests

2 participants