-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
REGRESSION(269613@main):
text-wrap: balance
parses even when `text-…
…wrap-style` is disabled https://bugs.webkit.org/show_bug.cgi?id=263495 rdar://117295817 Reviewed by Alan Baradlay. 269613@main accidentally enabled `text-wrap: balance`. It was assuming the generated `text-wrap-style` parsing function would check for the preference, but that is not the case. Add a manual check for the preference to avoid exposing the `text-wrap-style` values in `text-wrap` when the longhand is disabled. * LayoutTests/fast/css/text-wrap-style-disabled-expected.txt: Added. * LayoutTests/fast/css/text-wrap-style-disabled.html: Added. * Source/WebCore/css/parser/CSSPropertyParser.cpp: (WebCore::CSSPropertyParser::consumeTextWrapShorthand): Canonical link: https://commits.webkit.org/269624@main
- Loading branch information
1 parent
2eed046
commit 6051265
Showing
3 changed files
with
72 additions
and
1 deletion.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
LayoutTests/fast/css/text-wrap-style-disabled-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
When text-wrap-style is disabled, the following should not parse: | ||
|
||
|
||
PASS e.style['text-wrap-style'] = "auto" should not set the property value | ||
PASS e.style['text-wrap-style'] = "balance" should not set the property value | ||
PASS e.style['text-wrap-style'] = "stable" should not set the property value | ||
PASS e.style['text-wrap-style'] = "pretty" should not set the property value | ||
PASS e.style['text-wrap'] = "auto" should not set the property value | ||
PASS e.style['text-wrap'] = "balance" should not set the property value | ||
PASS e.style['text-wrap'] = "stable" should not set the property value | ||
PASS e.style['text-wrap'] = "pretty" should not set the property value | ||
PASS e.style['text-wrap'] = "wrap auto" should not set the property value | ||
PASS e.style['text-wrap'] = "wrap balance" should not set the property value | ||
PASS e.style['text-wrap'] = "wrap pretty" should not set the property value | ||
PASS e.style['text-wrap'] = "wrap stable" should not set the property value | ||
PASS e.style['text-wrap'] = "auto wrap" should not set the property value | ||
PASS e.style['text-wrap'] = "balance wrap" should not set the property value | ||
PASS e.style['text-wrap'] = "pretty wrap" should not set the property value | ||
PASS e.style['text-wrap'] = "stable wrap" should not set the property value | ||
PASS e.style['text-wrap'] = "nowrap auto" should not set the property value | ||
PASS e.style['text-wrap'] = "nowrap balance" should not set the property value | ||
PASS e.style['text-wrap'] = "nowrap pretty" should not set the property value | ||
PASS e.style['text-wrap'] = "nowrap stable" should not set the property value | ||
PASS e.style['text-wrap'] = "auto nowrap" should not set the property value | ||
PASS e.style['text-wrap'] = "balance nowrap" should not set the property value | ||
PASS e.style['text-wrap'] = "pretty nowrap" should not set the property value | ||
PASS e.style['text-wrap'] = "stable nowrap" should not set the property value | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<!-- webkit-test-runner [ CSSTextWrapStyleEnabled=false ]--> | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Test text-wrap parsing when text-wrap-style is disabled</title> | ||
<meta charset="utf-8"> | ||
</head> | ||
<body> | ||
<p>When text-wrap-style is disabled, the following should not parse:</p> | ||
<script src="../../resources/testharness.js"></script> | ||
<script src="../../resources/testharnessreport.js"></script> | ||
<script src="../../imported/w3c/web-platform-tests/css/support/parsing-testcommon.js"></script> | ||
<script> | ||
test_invalid_value("text-wrap-style", "auto"); | ||
test_invalid_value("text-wrap-style", "balance"); | ||
test_invalid_value("text-wrap-style", "stable"); | ||
test_invalid_value("text-wrap-style", "pretty"); | ||
|
||
test_invalid_value("text-wrap", "auto"); | ||
test_invalid_value("text-wrap", "balance"); | ||
test_invalid_value("text-wrap", "stable"); | ||
test_invalid_value("text-wrap", "pretty"); | ||
|
||
test_invalid_value("text-wrap", "wrap auto"); | ||
test_invalid_value("text-wrap", "wrap balance"); | ||
test_invalid_value("text-wrap", "wrap pretty"); | ||
test_invalid_value("text-wrap", "wrap stable"); | ||
test_invalid_value("text-wrap", "auto wrap"); | ||
test_invalid_value("text-wrap", "balance wrap"); | ||
test_invalid_value("text-wrap", "pretty wrap"); | ||
test_invalid_value("text-wrap", "stable wrap"); | ||
|
||
test_invalid_value("text-wrap", "nowrap auto"); | ||
test_invalid_value("text-wrap", "nowrap balance"); | ||
test_invalid_value("text-wrap", "nowrap pretty"); | ||
test_invalid_value("text-wrap", "nowrap stable"); | ||
test_invalid_value("text-wrap", "auto nowrap"); | ||
test_invalid_value("text-wrap", "balance nowrap"); | ||
test_invalid_value("text-wrap", "pretty nowrap"); | ||
test_invalid_value("text-wrap", "stable nowrap"); | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters