Skip to content

Commit

Permalink
Unprefix -webkit-hyphens/-webkit-hyphenate-character CSS properties
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=243670

Reviewed by Tim Nguyen.

This change supports unprefixed hyphenate-character, not only -webkit-hyphenate-character.

According to the csswg discussion, w3c/csswg-drafts#6887, hyphenate-character css property is stable enough to ship.

* LayoutTests/TestExpectations:
* LayoutTests/fast/css/getComputedStyle/computed-style-expected.txt:
* LayoutTests/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt:
* LayoutTests/fast/css/getComputedStyle/resources/property-names.js:
* LayoutTests/imported/w3c/web-platform-tests/css/css-cascade/all-prop-initial-xml-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-cascade/all-prop-revert-layer-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/parsing/marker-supported-properties-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/parsing/marker-supported-properties-in-animation-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/hyphens/hyphenate-character-001-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/hyphens/hyphenate-character-001.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/hyphens/hyphenate-character-002-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/hyphens/hyphenate-character-002.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/hyphens/hyphenate-character-003-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/hyphens/hyphenate-character-003.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/hyphens/hyphenate-character-004-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/hyphens/hyphenate-character-004.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/hyphens/hyphenate-character-005-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/hyphens/hyphenate-character-005.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/hyphens/hyphenate-limit-chars-001-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/hyphens/hyphenate-limit-chars-001.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/hyphens/hyphens-auto-001.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/hyphens/hyphens-auto-002-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/hyphens/hyphens-auto-002.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/hyphens/hyphens-auto-003-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/hyphens/hyphens-auto-003.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/hyphens/hyphens-auto-and-contenteditable-crash.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/hyphens/hyphens-auto-control-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/hyphens/hyphens-auto-control.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/hyphens/hyphens-character-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/hyphens/hyphens-character.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/hyphens/hyphens-manual-010.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/hyphens/hyphens-manual-011.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/hyphens/hyphens-manual-012.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/hyphens/hyphens-manual-013.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/hyphens/hyphens-manual-inline-010.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/hyphens/hyphens-manual-inline-011.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/hyphens/hyphens-manual-inline-012.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/hyphens/hyphens-none-011.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/hyphens/hyphens-none-012-expected.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/hyphens/hyphens-none-012.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/hyphens/hyphens-none-013-expected.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/hyphens/hyphens-none-013.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/hyphens/hyphens-none-014-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/hyphens/hyphens-none-014.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/hyphens/hyphens-none-015-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/hyphens/hyphens-none-015.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/hyphens/hyphens-out-of-flow-001.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/hyphens/hyphens-out-of-flow-002.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/hyphens/hyphens-punctuation-001-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/hyphens/hyphens-punctuation-001.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/hyphens/hyphens-shaping-001.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/hyphens/hyphens-shaping-002.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/hyphens/hyphens-span-001.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/hyphens/hyphens-span-002.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/hyphens/hyphens-vertical-001-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/hyphens/hyphens-vertical-001.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/hyphens/hyphens-vertical-002-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/hyphens/hyphens-vertical-002.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/hyphens/hyphens-vertical-003-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/hyphens/hyphens-vertical-003.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/hyphens/hyphens-vertical-004-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/hyphens/hyphens-vertical-004.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/hyphens/shy-styling-001.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/inheritance-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/parsing/hyphenate-character-computed-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/parsing/hyphenate-character-valid-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/parsing/hyphenate-limit-chars-computed-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/parsing/hyphens-computed-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/parsing/hyphens-valid-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/hyphens-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-001-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/addition-per-property-001-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-001-expected.txt:
* LayoutTests/platform/gtk/TestExpectations:
* LayoutTests/platform/gtk/imported/w3c/web-platform-tests/css/css-cascade/all-prop-initial-xml-expected.txt:
* LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/css/css-cascade/all-prop-initial-xml-expected.txt:
* LayoutTests/platform/ipad/imported/w3c/web-platform-tests/css/css-cascade/all-prop-initial-xml-expected.txt:
* LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/css/css-cascade/all-prop-initial-xml-expected.txt:
* LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/css/css-cascade/all-prop-revert-layer-expected.txt:
* LayoutTests/platform/wpe/TestExpectations:
* LayoutTests/platform/wpe/imported/w3c/web-platform-tests/css/css-cascade/all-prop-initial-xml-expected.txt:
* LayoutTests/svg/css/getComputedStyle-basic-expected.txt:
* Source/WebCore/animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
* Source/WebCore/css/CSSProperties.json:
* Source/WebCore/css/ComputedStyleExtractor.cpp:
(WebCore::ComputedStyleExtractor::valueForPropertyInStyle):
* Source/WebCore/editing/cocoa/HTMLConverter.mm:
(HTMLConverter::computedAttributesForElement):
* Source/WebCore/style/PropertyAllowlist.cpp:
(WebCore::Style::isValidMarkerStyleProperty):

Canonical link: https://commits.webkit.org/264628@main
  • Loading branch information
joonghunpark authored and mnutt committed Jun 19, 2023
1 parent b9b7986 commit 40e9063
Show file tree
Hide file tree
Showing 87 changed files with 986 additions and 112 deletions.
8 changes: 8 additions & 0 deletions LayoutTests/TestExpectations
Original file line number Diff line number Diff line change
Expand Up @@ -2782,6 +2782,14 @@ webkit.org/b/214290 imported/w3c/web-platform-tests/css/css-text/hyphens/hyphens
webkit.org/b/214290 imported/w3c/web-platform-tests/css/css-text/hyphens/hyphens-shaping-001.html [ ImageOnlyFailure ]
webkit.org/b/214290 imported/w3c/web-platform-tests/css/css-text/hyphens/hyphens-shaping-002.html [ ImageOnlyFailure ]
webkit.org/b/214290 imported/w3c/web-platform-tests/css/css-text/hyphens/hyphens-span-002.html [ ImageOnlyFailure ]
webkit.org/b/257011 imported/w3c/web-platform-tests/css/css-text/hyphens/hyphenate-character-002.html [ ImageOnlyFailure ]
webkit.org/b/257011 imported/w3c/web-platform-tests/css/css-text/hyphens/hyphenate-character-005.html [ ImageOnlyFailure ]
webkit.org/b/257011 imported/w3c/web-platform-tests/css/css-text/hyphens/hyphens-vertical-001.html [ ImageOnlyFailure ]
webkit.org/b/257011 imported/w3c/web-platform-tests/css/css-text/hyphens/hyphens-vertical-003.html [ ImageOnlyFailure ]
webkit.org/b/257011 imported/w3c/web-platform-tests/css/css-text/hyphens/hyphenate-limit-chars-001.html [ ImageOnlyFailure ]
webkit.org/b/257011 imported/w3c/web-platform-tests/css/css-text/hyphens/hyphens-auto-003.html [ ImageOnlyFailure ]
webkit.org/b/257011 imported/w3c/web-platform-tests/css/css-text/hyphens/hyphens-auto-control.html [ ImageOnlyFailure ]
webkit.org/b/257011 imported/w3c/web-platform-tests/css/css-text/hyphens/hyphens-character.html [ ImageOnlyFailure ]
webkit.org/b/195275 imported/w3c/web-platform-tests/css/css-text/letter-spacing/letter-spacing-bidi-001.html [ ImageOnlyFailure ]
webkit.org/b/195275 imported/w3c/web-platform-tests/css/css-text/letter-spacing/letter-spacing-bidi-002.html [ ImageOnlyFailure ]
webkit.org/b/214290 imported/w3c/web-platform-tests/css/css-text/letter-spacing/letter-spacing-bidi-003.xht [ ImageOnlyFailure ]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ grid-template-columns: none;
grid-template-rows: none;
hanging-punctuation: none;
height: 576px;
hyphenate-character: auto;
image-rendering: auto;
justify-content: normal;
justify-items: normal;
Expand Down Expand Up @@ -227,11 +228,9 @@ zoom: 1;
-webkit-box-shadow: none;
-webkit-column-axis: auto;
-webkit-font-smoothing: auto;
-webkit-hyphenate-character: auto;
-webkit-hyphenate-limit-after: auto;
-webkit-hyphenate-limit-before: auto;
-webkit-hyphenate-limit-lines: no-limit;
-webkit-hyphens: manual;
-webkit-line-align: none;
-webkit-line-box-contain: block inline replaced;
-webkit-line-clamp: none;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ grid-template-columns: none
grid-template-rows: none
hanging-punctuation: none
height: 100px
hyphenate-character: auto
image-rendering: auto
justify-content: normal
justify-items: normal
Expand Down Expand Up @@ -226,11 +227,9 @@ zoom: 1
-webkit-box-shadow: none
-webkit-column-axis: auto
-webkit-font-smoothing: auto
-webkit-hyphenate-character: auto
-webkit-hyphenate-limit-after: auto
-webkit-hyphenate-limit-before: auto
-webkit-hyphenate-limit-lines: no-limit
-webkit-hyphens: manual
-webkit-line-align: none
-webkit-line-box-contain: block inline replaced
-webkit-line-clamp: none
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ var propertiesToTest = {
"grid-template-columns": true,
"grid-template-rows": true,
"-webkit-highlight": true,
"-webkit-hyphenate-character": true,
"hyphenate-character": true,
"-webkit-hyphenate-limit-after": true,
"-webkit-hyphenate-limit-before": true,
"-webkit-hyphenate-limit-lines": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@ PASS grid-template-columns
PASS grid-template-rows
PASS hanging-punctuation
PASS height
PASS hyphenate-character
PASS hyphens
PASS image-orientation
PASS image-rendering
PASS inline-size
Expand Down Expand Up @@ -376,11 +378,9 @@ PASS -webkit-column-axis
PASS -webkit-column-progression
PASS -webkit-cursor-visibility
PASS -webkit-font-smoothing
PASS -webkit-hyphenate-character
PASS -webkit-hyphenate-limit-after
PASS -webkit-hyphenate-limit-before
PASS -webkit-hyphenate-limit-lines
PASS -webkit-hyphens
PASS -webkit-initial-letter
PASS -webkit-line-align
PASS -webkit-line-box-contain
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@ PASS grid-template-columns
PASS grid-template-rows
PASS hanging-punctuation
PASS height
PASS hyphenate-character
PASS hyphens
PASS image-orientation
PASS image-rendering
PASS inline-size
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ PASS Property transition-delay value '1s' in ::marker
PASS Property transition-duration value '2s' in ::marker
PASS Property transition-property value 'display' in ::marker
PASS Property transition-timing-function value 'linear' in ::marker
FAIL Property hyphens value 'none' in ::marker assert_true: hyphens doesn't seem to be supported in the computed style expected true got false
PASS Property hyphens value 'none' in ::marker
PASS Property letter-spacing value '10px' in ::marker
PASS Property line-break value 'anywhere' in ::marker
PASS Property overflow-wrap value 'anywhere' in ::marker
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ PASS Animation of text-combine-upright in ::marker
PASS Animation of unicode-bidi in ::marker
PASS Animation of direction in ::marker
PASS Animation of content in ::marker
FAIL Animation of hyphens in ::marker assert_true: hyphens doesn't seem to be supported in the computed style expected true got false
PASS Animation of hyphens in ::marker
PASS Animation of letter-spacing in ::marker
PASS Animation of line-break in ::marker
PASS Animation of overflow-wrap in ::marker
Expand Down Expand Up @@ -72,7 +72,7 @@ PASS Transition of text-combine-upright in ::marker
PASS Transition of unicode-bidi in ::marker
PASS Transition of direction in ::marker
PASS Transition of content in ::marker
FAIL Transition of hyphens in ::marker assert_true: hyphens doesn't seem to be supported in the computed style expected true got false
PASS Transition of hyphens in ::marker
PASS Transition of letter-spacing in ::marker
PASS Transition of line-break in ::marker
PASS Transition of overflow-wrap in ::marker
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Text reference: hyphenate-character</title>
<link rel="author" title="Jonathan Kew" href="mailto:[email protected]">
<style>
div {
font: 16px monospace;
}
</style>

<p>Test passes if the words below are broken at hyphenation positions but <b>no visible hyphens appear</b>.

<div lang="en">
im<br>ple<br>men<br>ta<br>tion<br><br>
ini<br>tial<br>iza<br>tion<br><br>
real<br>iza<br>tion<br><br>
hy<br>phen<br>ation
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Text test: hyphenate-character</title>
<link rel="author" title="Jonathan Kew" href="mailto:[email protected]">
<link rel="help" href="https://drafts.csswg.org/css-text-4/#hyphenate-character">
<link rel="match" href="reference/hyphenate-character-001-ref.html">
<meta name="assert" content="Specifies the string that appears at the end of the line before a hyphenation break">
<style>
div {
font: 16px monospace;
width: 4.5ch; /* wide enough that the first potential break in "re-al-iza-tion" should NOT be used */
hyphens: manual;
hyphenate-character: "";
}
</style>

<p>Test passes if the words below are broken at hyphenation positions but <b>no visible hyphens appear</b>.

<div lang="en">
im&shy;ple&shy;men&shy;ta&shy;tion<br><br>
ini&shy;tial&shy;iza&shy;tion<br><br>
re&shy;al&shy;iza&shy;tion<br><br>
hy&shy;phen&shy;ation
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Text reference: hyphenate-character</title>
<link rel="author" title="Jonathan Kew" href="mailto:[email protected]">
<style>
div {
font: 16px monospace;
}
</style>

<p>Test passes if the words below are broken at hyphenation positions but <b>no visible hyphens appear</b>.

<div lang="en">
im<br>ple<br>men<br>ta<br>tion<br><br>
ini<br>tial<br>iza<br>tion<br><br>
real<br>iza<br>tion<br><br>
hy<br>phen<br>ation
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Text test: hyphenate-character</title>
<link rel="author" title="Jonathan Kew" href="mailto:[email protected]">
<link rel="help" href="https://drafts.csswg.org/css-text-4/#hyphenate-character">
<link rel="match" href="reference/hyphenate-character-001-ref.html">
<meta name="assert" content="Specifies the string that appears at the end of the line before a hyphenation break">
<style>
div {
font: 16px monospace;
width: 4.5ch; /* wide enough that the first potential break in "re-al-iza-tion" should NOT be used */
hyphens: auto; /* assuming the usual en_US patterns, should generate the same breaks as the manual
soft hyphens in test 001. */
hyphenate-character: "";
}
</style>

<p>Test passes if the words below are broken at hyphenation positions but <b>no visible hyphens appear</b>.

<div lang="en">
implementation<br><br>
initialization<br><br>
realization<br><br>
hyphenation
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Text reference: hyphenate-character</title>
<link rel="author" title="Jonathan Kew" href="mailto:[email protected]">
<style>
div {
font: 16px monospace;
}
</style>

<p>Test passes if the words below are hyphenated <b>using a bullet (&#x2022;) character</b>.

<div lang="en">
im•<br>ple•<br>men•<br>ta•<br>tion<br><br>
ini•<br>tial•<br>iza•<br>tion<br><br>
real•<br>iza•<br>tion<br><br>
hy•<br>phen•<br>ation
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Text test: hyphenate-character</title>
<link rel="author" title="Jonathan Kew" href="mailto:[email protected]">
<link rel="help" href="https://drafts.csswg.org/css-text-4/#hyphenate-character">
<link rel="match" href="reference/hyphenate-character-003-ref.html">
<meta name="assert" content="Specifies the string that appears at the end of the line before a hyphenation break">
<style>
div {
font: 16px monospace;
width: 5.5ch; /* wide enough that the first potential break in "re-al-iza-tion" should NOT be used */
hyphens: manual;
hyphenate-character: "\2022";
}
</style>

<p>Test passes if the words below are hyphenated <b>using a bullet (&#x2022;) character</b>.

<div lang="en">
im&shy;ple&shy;men&shy;ta&shy;tion<br><br>
ini&shy;tial&shy;iza&shy;tion<br><br>
re&shy;al&shy;iza&shy;tion<br><br>
hy&shy;phen&shy;ation
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Text reference: hyphenate-character</title>
<link rel="author" title="Jonathan Kew" href="mailto:[email protected]">
<style>
div {
font: 16px monospace;
}
</style>

<p>Test passes if the words below are hyphenated <b>using the string "/-/"</b>.

<div lang="en">
im/-/<br>ple/-/<br>men/-/<br>tation<br><br>
ini/-/<br>tial/-/<br>iza/-/<br>tion<br><br>
re/-/<br>al/-/<br>iza/-/<br>tion<br><br>
hy/-/<br>phen/-/<br>ation
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Text test: hyphenate-character</title>
<link rel="author" title="Jonathan Kew" href="mailto:[email protected]">
<link rel="help" href="https://drafts.csswg.org/css-text-4/#hyphenate-character">
<link rel="match" href="reference/hyphenate-character-004-ref.html">
<meta name="assert" content="Specifies the string that appears at the end of the line before a hyphenation break">
<style>
div {
font: 16px monospace;
width: 6.5ch; /* wide enough that the last potential break in "im-ple-men-ta-tion" should NOT be used */
hyphens: manual;
hyphenate-character: "/-/";
}
</style>

<p>Test passes if the words below are hyphenated <b>using the string "/-/"</b>.

<div lang="en">
im&shy;ple&shy;men&shy;ta&shy;tion<br><br>
ini&shy;tial&shy;iza&shy;tion<br><br>
re&shy;al&shy;iza&shy;tion<br><br>
hy&shy;phen&shy;ation
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Text reference: hyphenate-character</title>
<link rel="author" title="Jonathan Kew" href="mailto:[email protected]">
<style>
div {
font: 32px sans-serif;
margin-left: 10ch;
width: 3ch;
}
</style>

<p>Test passes if the word below is hyphenated
using a right-to-left <i>space+kashida</i> sequence "<span dir=rtl>&nbsp;&#x0640;</span>",
and shaping is <i>not</i> interrupted.

<div dir=rtl lang=ug>
قىل&#x200d;&nbsp;&#x640;<br>&#x200d;مىغانلىقى
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Text test: hyphenate-character</title>
<link rel="author" title="Jonathan Kew" href="mailto:[email protected]">
<link rel="help" href="https://drafts.csswg.org/css-text-4/#hyphenate-character">
<link rel="match" href="reference/hyphenate-character-005-ref.html">
<meta name="assert" content="Specifies the string that appears at the end of the line before a hyphenation break">
<style>
div {
font: 32px sans-serif;
margin-left: 10ch;
width: 3ch;
hyphenate-character: "\00a0\0640";
}
</style>

<p>Test passes if the word below is hyphenated
using a right-to-left <i>space+kashida</i> sequence "<span dir=rtl>&nbsp;&#x0640;</span>",
and shaping is <i>not</i> interrupted.

<div dir=rtl lang=ug>
قىل­مىغانلىقى
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!DOCTYPE html>
<title>CSS Text: 'hyphens: auto' with a valid 'lang' attribute specification</title>
<link rel="help" href="https://www.w3.org/TR/css-text-3/#hyphenation">
<link rel="author" href="mailto:[email protected]">
<style>
#container > div {
border: black solid 2px;
font-family: monospace;
font-size: 20px;
line-height: 1;
width: 1ch;
}
</style>
<body>
<div lang="en-us" id="container">
<div>ex-<br>am-<br>ple</div>
<div>example</div>
<div>ex-<br>am-<br>ple</div>
<div>exam-<br>ple</div>
<div>exam-<br>ple</div>
<div>example</div>
<div>ex-<br>am-<br>ple</div>
<div>ex-<br>ample</div>
<div>example</div>
</div>
</body>
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<!DOCTYPE html>
<title>CSS Text: 'hyphens: auto' with a valid 'lang' attribute specification</title>
<link rel="help" href="https://www.w3.org/TR/css-text-3/#hyphenation">
<link rel="match" href="reference/hyphenate-limit-chars-001-ref.html">
<link rel="author" href="mailto:[email protected]">
<style>
#container > div {
border: black solid 2px;
font-family: monospace;
font-size: 20px;
line-height: 1;
width: 1ch;
hyphens: auto;
hyphenate-character: '-';
}
</style>
<body>
<div lang="en-us" id="container">
<div>example</div>
<div style="hyphenate-limit-chars: 8">example</div>
<div style="hyphenate-limit-chars: auto 2 2">example</div>
<div style="hyphenate-limit-chars: auto 3 2">example</div>
<div style="hyphenate-limit-chars: auto 4 2">example</div>
<div style="hyphenate-limit-chars: auto 5 2">example</div>
<div style="hyphenate-limit-chars: auto 2 3">example</div>
<div style="hyphenate-limit-chars: auto 2 4">example</div>
<div style="hyphenate-limit-chars: auto 3 4">example</div>
</div>
</body>
Loading

0 comments on commit 40e9063

Please sign in to comment.