Skip to content

Unprefix -webkit-text-justify and add inter-character value #1176

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

Closed
wants to merge 2 commits into from

Conversation

nt1m
Copy link
Member

@nt1m nt1m commented May 31, 2022

bb2ece1

Unprefix -webkit-text-justify and add inter-character value
https://bugs.webkit.org/show_bug.cgi?id=229084
<rdar://82177456 >

Reviewed by Antti Koivisto.

This is still disabled by default behind the cssTextJustifyEnabled setting.
We don't keep support for the -webkit- prefix, since only Firefox ships text-justify (without the prefix) and it was never enabled in WebKit for macOS/iOS.

distribute and inter-character are aliases, with distribute being the legacy one. The spec specifies it as parse-time, but we implement it compute-time (like Chrome).

w3c/csswg-drafts#7322 is filed about potentially removing 'distribute' from the spec.

* LayoutTests/fast/css3-text/css3-text-justify/getComputedStyle/getComputedStyle-text-justify-expected.txt: Removed.
* LayoutTests/fast/css3-text/css3-text-justify/getComputedStyle/getComputedStyle-text-justify-inherited-expected.txt: Removed.
* LayoutTests/fast/css3-text/css3-text-justify/getComputedStyle/getComputedStyle-text-justify-inherited.html: Removed.
* LayoutTests/fast/css3-text/css3-text-justify/getComputedStyle/getComputedStyle-text-justify.html: Removed.
Removed parsing tests redundant with WPT.

* LayoutTests/fast/css3-text/css3-text-justify/text-justify-none.html:
* LayoutTests/fast/text/text-combine-crash.html:
* LayoutTests/TestExpectations:
* LayoutTests/imported/w3c/resources/resource-files.json:
* 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/first-letter-allowed-properties-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/first-line-allowed-properties-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/inheritance-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/parsing/text-justify-computed-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/parsing/text-justify-valid-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/letter-spacing/letter-spacing-bidi-003.xht:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-justify/text-justify-001.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-justify/text-justify-002.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-justify/text-justify-003.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-justify/text-justify-004.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-justify/text-justify-005.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-justify/text-justify-006.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-justify/distribute-alias.tentative-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-justify/distribute-alias.tentative.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-justify/text-justify-and-trailing-spaces-001-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-justify/text-justify-and-trailing-spaces-001.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-justify/text-justify-and-trailing-spaces-002-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-justify/text-justify-and-trailing-spaces-002.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-justify/text-justify-and-trailing-spaces-003-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-justify/text-justify-and-trailing-spaces-003.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-justify/text-justify-and-trailing-spaces-004-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-justify/text-justify-and-trailing-spaces-004.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-justify/text-justify-and-trailing-spaces-005-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-justify/text-justify-and-trailing-spaces-005.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-justify/text-justify-and-trailing-spaces-006-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-justify/text-justify-and-trailing-spaces-006.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-justify/text-justify-distribute-001-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-justify/text-justify-distribute-001.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-justify/text-justify-inter-character-001-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-justify/text-justify-inter-character-001-ref.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-justify/text-justify-inter-character-001.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-justify/text-justify-inter-word-001-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-justify/text-justify-inter-word-001-ref.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-justify/text-justify-inter-word-001.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-justify/text-justify-interpolation-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-justify/text-justify-interpolation.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-justify/text-justify-none-001-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-justify/text-justify-none-001-ref.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-justify/text-justify-none-001.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-justify/w3c-import.log:
* LayoutTests/platform/gtk/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/imported/w3c/web-platform-tests/css/css-cascade/all-prop-initial-xml-expected.txt:
Import new WPT from 6aa9a39, remove prefixes automatically added by the importer, and rebaseline tests.

* Source/WebCore/animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
* Source/WebCore/css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::valueForPropertyInStyle):
* Source/WebCore/css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator TextJustify const):
* Source/WebCore/css/CSSProperties.json:
* Source/WebCore/css/StyleProperties.cpp:
* Source/WebCore/css/parser/CSSParserContext.cpp:
(WebCore::CSSParserContext::isPropertyRuntimeDisabled const):
* Source/WebCore/css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
(WebCore::CSSParserFastPaths::isKeywordPropertyID):
* Source/WebCore/rendering/LegacyLineLayout.cpp:
(WebCore::LegacyLineLayout::textAlignmentForLine const):
* Source/WebCore/rendering/style/RenderStyleConstants.h:
* Source/WebInspectorUI/UserInterface/Models/CSSKeywordCompletions.js:

Canonical link: https://commits.webkit.org/251144@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@295049 268f45cc-cd09-0410-ab3c-d52691b4dbfc

@nt1m nt1m self-assigned this May 31, 2022
@nt1m nt1m added CSS Cascading Style Sheets implementation WebKit Local Build labels May 31, 2022
@nt1m nt1m requested a review from anttijk May 31, 2022 08:03
@webkit-early-warning-system webkit-early-warning-system added the merging-blocked Applied to prevent a change from being merged label May 31, 2022
@nt1m nt1m removed merging-blocked Applied to prevent a change from being merged CSS Cascading Style Sheets implementation WebKit Local Build labels May 31, 2022
@nt1m nt1m force-pushed the text-justify-unprefix branch from 932e4fb to ba0cc09 Compare May 31, 2022 10:37
@nt1m nt1m added CSS Cascading Style Sheets implementation WebKit Local Build labels May 31, 2022
@nt1m nt1m requested review from smfr and litherum May 31, 2022 13:02
…t colorspaces

https://bugs.webkit.org/show_bug.cgi?id=240633

Patch by Žan Doberšek <[email protected]> on 2022-05-31
Reviewed by Miguel Gomez and Philippe Normand.

Add the DMABufColorSpace enumeration, covering different colorspaces we
currently can support between decoded GStreamer data and the TextureMapper
DMABuf integration.

DMABufObject gains a DMABufColorSpace member variable, initially of an invalid
value but that can be overridden by whoever is constructing the object.

In MediaPlayerPrivateGStreamer, the desired colorspace can be retrieved from the
GstVideoInfo colorimetry information and set on the DMABufObject.

The colorspace is now respected in TextureMapperPlatformLayerProxyDMABuf,
choosing between different YUV-to-RGB matrices that are to be used when sampling
from the set of plane-assigned textures. The default is the BT.601 conversion
matrix. For RGBA-like formats, no conversion is required, so an assert is placed
to ensure that the colorspace is either unspecified or specified as SRGB.

* Source/WebCore/platform/TextureMapper.cmake:
* Source/WebCore/platform/graphics/gbm/DMABufColorSpace.h: Added.
* Source/WebCore/platform/graphics/gbm/DMABufObject.h:
(WebCore::DMABufObject::encode const):
(WebCore::DMABufObject::encode):
(WebCore::DMABufObject::decode):
* Source/WebCore/platform/graphics/gbm/GBMBufferSwapchain.cpp:
* Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::colorSpaceForColorimetry):
(WebCore::MediaPlayerPrivateGStreamer::pushDMABufToCompositor):
* Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayerProxyDMABuf.cpp:
(WebCore::TextureMapperPlatformLayerProxyDMABuf::DMABufLayer::paintToTextureMapper):

Canonical link: https://commits.webkit.org/251143@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@295048 268f45cc-cd09-0410-ab3c-d52691b4dbfc
@nt1m nt1m force-pushed the text-justify-unprefix branch from ba0cc09 to b0ebdca Compare May 31, 2022 13:21
@nt1m nt1m added the unsafe-merge-queue Applied to send a pull request to merge-queue, but skip building and testing label May 31, 2022
https://bugs.webkit.org/show_bug.cgi?id=229084
<rdar://82177456>

Reviewed by Antti Koivisto.

This is still disabled by default behind the cssTextJustifyEnabled setting.
We don't keep support for the -webkit- prefix, since only Firefox ships text-justify (without the prefix) and it was never enabled in WebKit for macOS/iOS.

distribute and inter-character are aliases, with distribute being the legacy one. The spec specifies it as parse-time, but we implement it compute-time (like Chrome).

w3c/csswg-drafts#7322 is filed about potentially removing 'distribute' from the spec.

* LayoutTests/fast/css3-text/css3-text-justify/getComputedStyle/getComputedStyle-text-justify-expected.txt: Removed.
* LayoutTests/fast/css3-text/css3-text-justify/getComputedStyle/getComputedStyle-text-justify-inherited-expected.txt: Removed.
* LayoutTests/fast/css3-text/css3-text-justify/getComputedStyle/getComputedStyle-text-justify-inherited.html: Removed.
* LayoutTests/fast/css3-text/css3-text-justify/getComputedStyle/getComputedStyle-text-justify.html: Removed.
Removed parsing tests redundant with WPT.

* LayoutTests/fast/css3-text/css3-text-justify/text-justify-none.html:
* LayoutTests/fast/text/text-combine-crash.html:
* LayoutTests/TestExpectations:
* LayoutTests/imported/w3c/resources/resource-files.json:
* 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/first-letter-allowed-properties-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/first-line-allowed-properties-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/inheritance-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/parsing/text-justify-computed-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/parsing/text-justify-valid-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/letter-spacing/letter-spacing-bidi-003.xht:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-justify/text-justify-001.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-justify/text-justify-002.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-justify/text-justify-003.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-justify/text-justify-004.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-justify/text-justify-005.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-justify/text-justify-006.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-justify/distribute-alias.tentative-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-justify/distribute-alias.tentative.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-justify/text-justify-and-trailing-spaces-001-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-justify/text-justify-and-trailing-spaces-001.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-justify/text-justify-and-trailing-spaces-002-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-justify/text-justify-and-trailing-spaces-002.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-justify/text-justify-and-trailing-spaces-003-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-justify/text-justify-and-trailing-spaces-003.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-justify/text-justify-and-trailing-spaces-004-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-justify/text-justify-and-trailing-spaces-004.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-justify/text-justify-and-trailing-spaces-005-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-justify/text-justify-and-trailing-spaces-005.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-justify/text-justify-and-trailing-spaces-006-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-justify/text-justify-and-trailing-spaces-006.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-justify/text-justify-distribute-001-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-justify/text-justify-distribute-001.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-justify/text-justify-inter-character-001-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-justify/text-justify-inter-character-001-ref.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-justify/text-justify-inter-character-001.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-justify/text-justify-inter-word-001-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-justify/text-justify-inter-word-001-ref.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-justify/text-justify-inter-word-001.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-justify/text-justify-interpolation-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-justify/text-justify-interpolation.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-justify/text-justify-none-001-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-justify/text-justify-none-001-ref.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-justify/text-justify-none-001.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-justify/w3c-import.log:
* LayoutTests/platform/gtk/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/imported/w3c/web-platform-tests/css/css-cascade/all-prop-initial-xml-expected.txt:
Import new WPT from 6aa9a39, remove prefixes automatically added by the importer, and rebaseline tests.

* Source/WebCore/animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
* Source/WebCore/css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::valueForPropertyInStyle):
* Source/WebCore/css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator TextJustify const):
* Source/WebCore/css/CSSProperties.json:
* Source/WebCore/css/StyleProperties.cpp:
* Source/WebCore/css/parser/CSSParserContext.cpp:
(WebCore::CSSParserContext::isPropertyRuntimeDisabled const):
* Source/WebCore/css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
(WebCore::CSSParserFastPaths::isKeywordPropertyID):
* Source/WebCore/rendering/LegacyLineLayout.cpp:
(WebCore::LegacyLineLayout::textAlignmentForLine const):
* Source/WebCore/rendering/style/RenderStyleConstants.h:
* Source/WebInspectorUI/UserInterface/Models/CSSKeywordCompletions.js:

Canonical link: https://commits.webkit.org/251144@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@295049 268f45cc-cd09-0410-ab3c-d52691b4dbfc
@webkit-early-warning-system
Copy link
Collaborator

Committed r295049 (251144@main): https://commits.webkit.org/251144@main

Reviewed commits have been landed. Closing PR #1176 and removing active labels.

@webkit-early-warning-system webkit-early-warning-system removed the unsafe-merge-queue Applied to send a pull request to merge-queue, but skip building and testing label May 31, 2022
@nt1m nt1m deleted the text-justify-unprefix branch May 31, 2022 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CSS Cascading Style Sheets implementation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants