Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[leading-trim] Add support for parsing "text-edge" CSS property
https://bugs.webkit.org/show_bug.cgi?id=248448 Reviewed by Antti Koivisto. This patch add support for parsing "text-edge" (https://www.w3.org/TR/css-inline-3/#text-edges). This property is behind the "CSS leading-trim" run-time flag which is off by default. (will WPTify the test cases soon after the expected behavior is confirmed -not so much about parsing, but more about how they interact with leading-trim.) * Source/WebCore/WebCore.xcodeproj/project.pbxproj: * Source/WebCore/css/CSSPrimitiveValueMappings.h: (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): (WebCore::CSSPrimitiveValue::operator TextEdge const): * Source/WebCore/css/CSSProperties.json: * Source/WebCore/css/CSSValueKeywords.in: * Source/WebCore/css/ComputedStyleExtractor.cpp: (WebCore::valueForTextEdge): (WebCore::ComputedStyleExtractor::valueForPropertyInStyle): * Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp: (WebCore::CSSPropertyParserHelpers::consumeTextEdge): * Source/WebCore/css/parser/CSSPropertyParserHelpers.h: * Source/WebCore/rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::textEdge const): (WebCore::RenderStyle::setTextEdge): (WebCore::RenderStyle::initialTextEdge): * Source/WebCore/rendering/style/RenderStyle.h: * Source/WebCore/rendering/style/RenderStyleConstants.cpp: (WebCore::operator<<): * Source/WebCore/rendering/style/RenderStyleConstants.h: * Source/WebCore/rendering/style/StyleRareInheritedData.cpp: (WebCore::StyleRareInheritedData::StyleRareInheritedData): (WebCore::StyleRareInheritedData::operator== const): * Source/WebCore/rendering/style/StyleRareInheritedData.h: * Source/WebCore/rendering/style/StyleTextEdge.h: Added. (WebCore::operator==): (WebCore::operator!=): * Source/WebCore/style/StyleBuilderConverter.h: (WebCore::Style::BuilderConverter::convertTextEdge): Canonical link: https://commits.webkit.org/257233@main
- Loading branch information
1 parent
d3ed347
commit 5cecbfb
Showing
21 changed files
with
387 additions
and
1 deletion.
There are no files selected for viewing
51 changes: 51 additions & 0 deletions
51
LayoutTests/fast/text/text-edge-property-parsing-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,51 @@ | ||
Test parsing of the CSS text-edge property. | ||
|
||
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". | ||
|
||
|
||
PASS test("text-edge: leading") is "leading" | ||
PASS test("text-edge: text") is "text" | ||
PASS test("text-edge: cap") is "cap" | ||
PASS test("text-edge: ex") is "ex" | ||
PASS test("text-edge: ideographic") is "ideographic" | ||
PASS test("text-edge: ideographic-ink") is "ideographic-ink" | ||
PASS test("text-edge: alphabetic") is "" | ||
PASS test("text-edge: text text") is "text text" | ||
PASS test("text-edge: text alphabetic") is "text alphabetic" | ||
PASS test("text-edge: text ideographic") is "text ideographic" | ||
PASS test("text-edge: text ideographic-ink") is "text ideographic-ink" | ||
PASS test("text-edge: cap text") is "cap text" | ||
PASS test("text-edge: cap alphabetic") is "cap alphabetic" | ||
PASS test("text-edge: cap ideographic") is "cap ideographic" | ||
PASS test("text-edge: cap ideographic-ink") is "cap ideographic-ink" | ||
PASS test("text-edge: ex text") is "ex text" | ||
PASS test("text-edge: ex alphabetic") is "ex alphabetic" | ||
PASS test("text-edge: ex ideographic") is "ex ideographic" | ||
PASS test("text-edge: ex ideographic-ink") is "ex ideographic-ink" | ||
PASS test("text-edge: ideographic text") is "ideographic text" | ||
PASS test("text-edge: ideographic alphabetic") is "ideographic alphabetic" | ||
PASS test("text-edge: ideographic ideographic") is "ideographic ideographic" | ||
PASS test("text-edge: ideographic ideographic-ink") is "ideographic ideographic-ink" | ||
PASS test("text-edge: ideographic-ink text") is "ideographic-ink text" | ||
PASS test("text-edge: ideographic-ink alphabetic") is "ideographic-ink alphabetic" | ||
PASS test("text-edge: ideographic-ink ideographic") is "ideographic-ink ideographic" | ||
PASS test("text-edge: ideographic-ink ideographic-ink") is "ideographic-ink ideographic-ink" | ||
PASS test("text-edge: leading leading") is "" | ||
PASS test("text-edge: leading text") is "" | ||
PASS test("text-edge: leading cap") is "" | ||
PASS test("text-edge: leading ex") is "" | ||
PASS test("text-edge: leading ideographic") is "" | ||
PASS test("text-edge: leading ideographic-ink") is "" | ||
PASS test("text-edge: text leading") is "" | ||
PASS test("text-edge: cap leading") is "" | ||
PASS test("text-edge: ex leading") is "" | ||
PASS test("text-edge: ideographic leading") is "" | ||
PASS test("text-edge: ideographic-ink leading") is "" | ||
PASS test("text-edge: text cap") is "" | ||
PASS test("text-edge: text ex") is "" | ||
PASS test("text-edge: alphabetic") is "" | ||
PASS test("text-edge: alphabetic text") is "" | ||
PASS successfullyParsed is true | ||
|
||
TEST COMPLETE | ||
|
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,71 @@ | ||
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | ||
<html> | ||
<head> | ||
<script src="../../resources/js-test-pre.js"></script> | ||
</head> | ||
<body> | ||
<script> | ||
description('Test parsing of the CSS text-edge property.'); | ||
|
||
function test(declaration) { | ||
var div = document.createElement("div"); | ||
div.setAttribute("style", declaration); | ||
return div.style.textEdge; | ||
} | ||
|
||
shouldBeEqualToString('test("text-edge: leading")', "leading"); | ||
|
||
shouldBeEqualToString('test("text-edge: text")', "text"); | ||
shouldBeEqualToString('test("text-edge: cap")', "cap"); | ||
shouldBeEqualToString('test("text-edge: ex")', "ex"); | ||
shouldBeEqualToString('test("text-edge: ideographic")', "ideographic"); | ||
shouldBeEqualToString('test("text-edge: ideographic-ink")', "ideographic-ink"); | ||
shouldBeEqualToString('test("text-edge: alphabetic")', ""); | ||
|
||
shouldBeEqualToString('test("text-edge: text text")', "text text"); | ||
shouldBeEqualToString('test("text-edge: text alphabetic")', "text alphabetic"); | ||
shouldBeEqualToString('test("text-edge: text ideographic")', "text ideographic"); | ||
shouldBeEqualToString('test("text-edge: text ideographic-ink")', "text ideographic-ink"); | ||
|
||
shouldBeEqualToString('test("text-edge: cap text")', "cap text"); | ||
shouldBeEqualToString('test("text-edge: cap alphabetic")', "cap alphabetic"); | ||
shouldBeEqualToString('test("text-edge: cap ideographic")', "cap ideographic"); | ||
shouldBeEqualToString('test("text-edge: cap ideographic-ink")', "cap ideographic-ink"); | ||
|
||
shouldBeEqualToString('test("text-edge: ex text")', "ex text"); | ||
shouldBeEqualToString('test("text-edge: ex alphabetic")', "ex alphabetic"); | ||
shouldBeEqualToString('test("text-edge: ex ideographic")', "ex ideographic"); | ||
shouldBeEqualToString('test("text-edge: ex ideographic-ink")', "ex ideographic-ink"); | ||
|
||
shouldBeEqualToString('test("text-edge: ideographic text")', "ideographic text"); | ||
shouldBeEqualToString('test("text-edge: ideographic alphabetic")', "ideographic alphabetic"); | ||
shouldBeEqualToString('test("text-edge: ideographic ideographic")', "ideographic ideographic"); | ||
shouldBeEqualToString('test("text-edge: ideographic ideographic-ink")', "ideographic ideographic-ink"); | ||
|
||
shouldBeEqualToString('test("text-edge: ideographic-ink text")', "ideographic-ink text"); | ||
shouldBeEqualToString('test("text-edge: ideographic-ink alphabetic")', "ideographic-ink alphabetic"); | ||
shouldBeEqualToString('test("text-edge: ideographic-ink ideographic")', "ideographic-ink ideographic"); | ||
shouldBeEqualToString('test("text-edge: ideographic-ink ideographic-ink")', "ideographic-ink ideographic-ink"); | ||
|
||
shouldBeEqualToString('test("text-edge: leading leading")', ""); | ||
shouldBeEqualToString('test("text-edge: leading text")', ""); | ||
shouldBeEqualToString('test("text-edge: leading cap")', ""); | ||
shouldBeEqualToString('test("text-edge: leading ex")', ""); | ||
shouldBeEqualToString('test("text-edge: leading ideographic")', ""); | ||
shouldBeEqualToString('test("text-edge: leading ideographic-ink")', ""); | ||
|
||
shouldBeEqualToString('test("text-edge: text leading")', ""); | ||
shouldBeEqualToString('test("text-edge: cap leading")', ""); | ||
shouldBeEqualToString('test("text-edge: ex leading")', ""); | ||
shouldBeEqualToString('test("text-edge: ideographic leading")', ""); | ||
shouldBeEqualToString('test("text-edge: ideographic-ink leading")', ""); | ||
|
||
shouldBeEqualToString('test("text-edge: text cap")', ""); | ||
shouldBeEqualToString('test("text-edge: text ex")', ""); | ||
shouldBeEqualToString('test("text-edge: alphabetic")', ""); | ||
shouldBeEqualToString('test("text-edge: alphabetic text")', ""); | ||
|
||
</script> | ||
<script src="../../resources/js-test-post.js"></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
2 changes: 1 addition & 1 deletion
2
...ported/w3c/web-platform-tests/css/cssom/cssom-getPropertyValue-common-checks-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
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
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
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
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
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
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
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
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
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
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
Oops, something went wrong.