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

Implement font-language-override #14837

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

shivamidow
Copy link
Member

@shivamidow shivamidow commented Jun 9, 2023

409efd5ab32743edb9eec26883621e3044f23486

Implement font-language-override
https://bugs.webkit.org/show_bug.cgi?id=150081

Reviewed by NOBODY (OOPS!).

WIP.

* Source/WebCore/css/CSSProperties.json:
* Source/WebCore/css/ComputedStyleExtractor.cpp:
(WebCore::ComputedStyleExtractor::valueForPropertyInStyle):
* Source/WebCore/platform/graphics/FontCascadeDescription.cpp:
* Source/WebCore/platform/graphics/FontCascadeDescription.h:
(WebCore::FontCascadeDescription::initialLanguageOverride):
* Source/WebCore/platform/graphics/FontDescription.cpp:
(WebCore::FontDescription::setLanguageOverride):
* Source/WebCore/platform/graphics/FontDescription.h:
(WebCore::FontDescription::languageOverride const):
* Source/WebCore/rendering/style/RenderStyle.h:
* Source/WebCore/rendering/style/RenderStyleInlines.h:
(WebCore::RenderStyle::fontLanguageOverride const):
* Source/WebCore/style/StyleBuilderCustom.h:
(WebCore::Style::BuilderCustom::applyValueFontLanguageOverride):

bf590eb

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

@shivamidow shivamidow force-pushed the eng/prototype-font-language-override branch from c351904 to 409efd5 Compare June 9, 2023 23:59
@shivamidow shivamidow self-assigned this Jun 9, 2023
@shivamidow shivamidow added the Text For bugs in text layout and rendering, including international text support. label Jun 9, 2023
@litherum
Copy link
Contributor

litherum commented Jun 10, 2023

Is this a good idea?

I've spoken in the CSSWG about how I think this property shouldn't exist, and authors should just use lang= instead.

@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Jun 10, 2023
@shivamidow
Copy link
Member Author

shivamidow commented Jun 12, 2023

Hi @litherum, thanks for your interest in this WIP patch. I just aimed to see how font-language-override is compatible with the existing local implementation, but thanks for your comment anyway.

I am aware of w3c/csswg-drafts#5484. My rationale and motivation for this feature are three.

  1. Gecko has supported it. And there is a strong objection to dropping this feature from the spec. So, it would be good if WebKit also supports font-language-override for interoperability.
  2. As explained in the ticket in the CSS working group, the language locale and font-size-adjust have slightly different purposes and functionalities. In my understanding, font-size-adjust not only sets language but also affects glyph rendering. It gives web designers more control.
  3. WebKit already supports a non-standard language designation CSS property, --webkit-locale. I think it would be better if we can replace it with a standard one, --font-language-override.

We can continue our discussion in the ticket of the CSS WG.

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

Reviewed by NOBODY (OOPS!).

WIP.

* Source/WebCore/css/CSSProperties.json:
* Source/WebCore/css/ComputedStyleExtractor.cpp:
(WebCore::ComputedStyleExtractor::valueForPropertyInStyle):
* Source/WebCore/platform/graphics/FontCascadeDescription.cpp:
* Source/WebCore/platform/graphics/FontCascadeDescription.h:
(WebCore::FontCascadeDescription::initialLanguageOverride):
* Source/WebCore/platform/graphics/FontDescription.cpp:
(WebCore::FontDescription::setLanguageOverride):
* Source/WebCore/platform/graphics/FontDescription.h:
(WebCore::FontDescription::languageOverride const):
* Source/WebCore/rendering/style/RenderStyle.h:
* Source/WebCore/rendering/style/RenderStyleInlines.h:
(WebCore::RenderStyle::fontLanguageOverride const):
* Source/WebCore/style/StyleBuilderCustom.h:
(WebCore::Style::BuilderCustom::applyValueFontLanguageOverride):
@shivamidow shivamidow force-pushed the eng/prototype-font-language-override branch from 409efd5 to bf590eb Compare June 13, 2023 07:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merging-blocked Applied to prevent a change from being merged Text For bugs in text layout and rendering, including international text support.
Projects
None yet
4 participants