Skip to content

[css-text-3] Add test for intrinsic sizing and overflow-wrap - #11366

Merged
frivoal merged 2 commits into
web-platform-tests:masterfrom
frivoal:css-text-2682
Jun 6, 2018
Merged

frivoal merged 2 commits into
web-platform-tests:masterfrom
frivoal:css-text-2682

Conversation

@frivoal

@frivoal frivoal commented Jun 6, 2018

Copy link
Copy Markdown
Contributor

This test goes toghether with the spec changes for w3c/csswg-drafts#2682

<title>CSS Text Test: overflow-wrap: break-word and intrinsic sizing</title>
<link rel="author" title="Florian Rivoal" href="http://florian.rivoal.net/">
<link rel="help" href="https://drafts.csswg.org/css-text-3/#overflow-wrap-property">
<meta name="flags" content="">

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does it mean this empty flags tag ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it means that none of the possible flags listed in https://web-platform-tests.org/writing-tests/css-metadata.html apply.

Not including the flags meta at all might mean that too, or it might mean that the author forgot to consider the flags. So I prefer to include empty flags rather than leaving them out.

<link rel="match" href="reference/overflow-wrap-min-content-size-001-ref.html">
<meta name="assert" content="Soft wrap opportunities introduced by overflow-wrap:break-word **are** considered when calculating min-content intrinsic sizes.">
<style>
table {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the 'table' object here is a distraction. Perhaps i'm not understanding it properly, but at least in chrome, the max-width properly is not applied and 'table' layout just honors the min-content to determine its width. Wouldn't be better to use an inline-block, a float or just a div with 'min-content' width ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a response to this comment as well as the next one:

Yes, with width: min-content on the div directly, without using a table, would achieve the goal of this test, and be simpler. However, width: min-content is not yet widely supported, and tests should not depend on features that are not yet stable.

Using a table, and forcing it to be as small as possible will achieve min-content sizing of the div in all browsers.

I'll add a comment to the test saying that.

<style>
table {
overflow-wrap: break-word;
max-width: 0;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the max-width really relevant for this test ? If the purpose of the test is to evaluate how soft-breaking opportunities account for the min-content width, wouldn't be enough to use width: min-content ?

@frivoal
frivoal merged commit e895776 into web-platform-tests:master Jun 6, 2018
@frivoal
frivoal deleted the css-text-2682 branch June 6, 2018 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants