Skip to content
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

text-combine-upright: all & text-transform don't work together #8703

Conversation

Ahmad-S792
Copy link
Contributor

@Ahmad-S792 Ahmad-S792 commented Jan 16, 2023

`text-combine-upright: all` & `text-transform` don't work together
https://bugs.webkit.org/show_bug.cgi?id=250657

Reviewed by NOBODY (OOPS!).

This patch is to align WebKit with Gecko / Firefox and Blink / Chromium.

Merge - https://src.chromium.org/viewvc/blink?view=rev&revision=167624

When we transform text, we set transformed text to
RenderText::m_text. RenderCombineText overwrites the text at
combineText() and use originalText() at combineTextIfNeeded() in
painting. Therefore, text combine paints original text instead of
transformed text.

* Source/WebCore/rendering/RenderCombineText.h: Add "m_renderedText" as String definition
* Source/WebCore/rendering/RenderCombineText.cpp:
(RenderCombineText::combineTextIfNeeded): Change 'originalText' to "m_renderedText" and call it also while object replacement
* LayoutTests/fast/text/text-combine-upright-text-transform.html: Add Test Case
* LayoutTests/fast/text/text-combine-upright-text-transform-expected.html: Add Test Case Expectation

2537d1f

Misc iOS, tvOS & watchOS macOS Linux Windows
βœ… πŸ§ͺ style βœ… πŸ›  ios βœ… πŸ›  mac βœ… πŸ›  wpe ❌ πŸ›  πŸ§ͺ win
βœ… πŸ§ͺ bindings βœ… πŸ›  ios-sim βœ… πŸ›  mac-AS-debug βœ… πŸ›  gtk βœ… πŸ›  wincairo
βœ… πŸ§ͺ webkitperl ❌ πŸ§ͺ ios-wk2 βœ… πŸ§ͺ api-mac ❌ πŸ§ͺ gtk-wk2
βœ… πŸ§ͺ api-ios ❌ πŸ§ͺ mac-wk1 βœ… πŸ§ͺ api-gtk
βœ… πŸ›  tv ❌ πŸ§ͺ mac-wk2
βœ… πŸ›  tv-sim ❌ πŸ§ͺ mac-AS-debug-wk2
βœ… πŸ›  watch βœ… πŸ§ͺ mac-wk2-stress
βœ… πŸ›  watch-sim

@Ahmad-S792 Ahmad-S792 added the CSS Cascading Style Sheets implementation label Jan 16, 2023
@Ahmad-S792 Ahmad-S792 self-assigned this Jan 16, 2023
Copy link
Member

@nt1m nt1m left a comment

Choose a reason for hiding this comment

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

I think the test could be a web-platform-test in the css/css-writing-modes directory, but not required for this patch.

LayoutTests/fast/text/text-combine-text-transform.html Outdated Show resolved Hide resolved
LayoutTests/fast/text/text-combine-text-transform.html Outdated Show resolved Hide resolved
Source/WebCore/rendering/RenderCombineText.h Outdated Show resolved Hide resolved
@Ahmad-S792 Ahmad-S792 marked this pull request as ready for review January 16, 2023 23:24
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Jan 16, 2023
@Ahmad-S792 Ahmad-S792 force-pushed the fix250657-text-combin-upright-transform branch from 402b261 to d757636 Compare January 16, 2023 23:55
@Ahmad-S792 Ahmad-S792 removed the merging-blocked Applied to prevent a change from being merged label Jan 16, 2023
`text-combine-upright: all` & `text-transform` don't work together
https://bugs.webkit.org/show_bug.cgi?id=250657

Reviewed by NOBODY (OOPS!).

This patch is to align WebKit with Gecko / Firefox and Blink / Chromium.

Merge - https://src.chromium.org/viewvc/blink?view=rev&revision=167624

When we transform text, we set transformed text to
RenderText::m_text. RenderCombineText overwrites the text at
combineText() and use originalText() at combineTextIfNeeded() in
painting. Therefore, text combine paints original text instead of
transformed text.

* Source/WebCore/rendering/RenderCombineText.h: Add "m_renderedText" as String definition
* Source/WebCore/rendering/RenderCombineText.cpp:
(RenderCombineText::combineTextIfNeeded): Change 'originalText' to "m_renderedText" and call it also while object replacement
* LayoutTests/fast/text/text-combine-upright-text-transform.html: Add Test Case
* LayoutTests/fast/text/text-combine-upright-text-transform-expected.html: Add Test Case Expectation
@Ahmad-S792 Ahmad-S792 force-pushed the fix250657-text-combin-upright-transform branch from d757636 to 2537d1f Compare January 17, 2023 00:57
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Jan 17, 2023
@@ -99,7 +100,7 @@ void RenderCombineText::combineTextIfNeeded()

// An ancestor element may trigger us to lay out again, even when we're already combined.
if (m_isCombined)
RenderText::setRenderedText(originalText());
RenderText::setRenderedText(m_renderedText);
Copy link
Member

Choose a reason for hiding this comment

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

Seems like the original intended was to copy the string.

@darinadler @cdumez The original Blink patch did RenderText::setRenderedText(m_renderedText.impl()), although I'm not sure if that's the common pattern.

Copy link
Contributor

@cdumez cdumez Jan 17, 2023

Choose a reason for hiding this comment

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

This looks right to me. No reason to take the StringImpl here, they should be equivalent.

Copy link
Member

Choose a reason for hiding this comment

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

Seems like maybe the Blink merge simply isn't working, the initial version without any of my requested changes had the test failing on Windows.

@@ -53,6 +54,7 @@ class RenderCombineText final : public RenderText {
float m_combinedTextWidth { 0 };
float m_combinedTextAscent { 0 };
float m_combinedTextDescent { 0 };
String m_renderedText;
Copy link
Contributor

Choose a reason for hiding this comment

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

This naming is confusing. It does not represent the rendered combined text, this is pre-combined after-transformed text.

Copy link
Contributor

Choose a reason for hiding this comment

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

I am not even sure if I agree with this approach, but since RenderCombine is going to go through a proper refactoring soonish, I guess this will do for now.

Copy link
Member

@nt1m nt1m left a comment

Choose a reason for hiding this comment

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

Per #8703 (comment), seems like the patch isn't working (even before my requested changes).

I'd recommend contributing the tests to WPT so we can make sure we fix this later on however.

@Ahmad-S792
Copy link
Contributor Author

Left comment on main bug and closing this PR now. Thanks all!

@Ahmad-S792 Ahmad-S792 closed this Jan 17, 2023
@Ahmad-S792 Ahmad-S792 deleted the fix250657-text-combin-upright-transform branch March 31, 2023 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CSS Cascading Style Sheets implementation merging-blocked Applied to prevent a change from being merged
Projects
None yet
6 participants