Skip to content

[CSS Zoom] Apply zoom factor to -webkit-text-stroke-width#51713

Merged
webkit-commit-queue merged 1 commit intoWebKit:mainfrom
nt1m:eng/CSS-Zoom-Apply-zoom-factor-to-webkit-text-stroke-width
Oct 10, 2025
Merged

[CSS Zoom] Apply zoom factor to -webkit-text-stroke-width#51713
webkit-commit-queue merged 1 commit intoWebKit:mainfrom
nt1m:eng/CSS-Zoom-Apply-zoom-factor-to-webkit-text-stroke-width

Conversation

@nt1m
Copy link
Member

@nt1m nt1m commented Oct 3, 2025

97cc34d

[CSS Zoom] Apply zoom factor to -webkit-text-stroke-width
https://bugs.webkit.org/show_bug.cgi?id=300061
rdar://161859808

Reviewed by Antti Koivisto.

Test: imported/w3c/web-platform-tests/css/css-viewport/zoom/text-stroke-width.html

* LayoutTests/TestExpectations:
* Source/WebCore/rendering/RenderTreeAsText.cpp:
(WebCore::RenderTreeAsText::writeRenderObject):
* Source/WebCore/rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::computedStrokeWidth const):
* Source/WebCore/style/values/non-standard/StyleWebKitTextStrokeWidth.h:

Canonical link: https://commits.webkit.org/301322@main

ba7938c

Misc iOS, visionOS, tvOS & watchOS macOS Linux Windows Apple Internal
✅ 🧪 style ❌ 🛠 ios ✅ 🛠 mac 🛠 wpe 🛠 win ⏳ 🛠 ios-apple
✅ 🧪 bindings ✅ 🛠 ios-sim ✅ 🛠 mac-AS-debug 🧪 wpe-wk2 🧪 win-tests ⏳ 🛠 mac-apple
✅ 🧪 webkitperl 🧪 ios-wk2 🧪 api-mac 🧪 api-wpe ⏳ 🛠 vision-apple
🧪 ios-wk2-wpt 🧪 mac-wk1 ❌ 🛠 wpe-cairo
🧪 api-ios 🧪 mac-wk2 🛠 gtk
🛠 vision 🧪 mac-AS-debug-wk2 🧪 gtk-wk2
✅ 🛠 vision-sim 🧪 mac-wk2-stress 🧪 api-gtk
🧪 vision-wk2 🧪 mac-intel-wk2 🛠 playstation
✅ 🛠 🧪 unsafe-merge 🛠 tv ✅ 🛠 mac-safer-cpp
🛠 tv-sim
🛠 watch
🛠 watch-sim

@nt1m nt1m self-assigned this Oct 3, 2025
@nt1m nt1m added the CSS Cascading Style Sheets implementation label Oct 3, 2025
@nt1m nt1m requested review from anttijk and weinig October 3, 2025 00:34
@weinig
Copy link
Contributor

weinig commented Oct 3, 2025

Like with the others, this needs tests for the useSVGZoomRulesForLength cases.

@nt1m
Copy link
Member Author

nt1m commented Oct 10, 2025

Like with the others, this needs tests for the useSVGZoomRulesForLength cases.

I tried making such a test, but -webkit-text-stroke-width doesn't apply to SVG elements.

@nt1m nt1m force-pushed the eng/CSS-Zoom-Apply-zoom-factor-to-webkit-text-stroke-width branch from a71b502 to b36a2fc Compare October 10, 2025 03:41
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Oct 10, 2025
@nt1m nt1m removed the merging-blocked Applied to prevent a change from being merged label Oct 10, 2025
@nt1m nt1m force-pushed the eng/CSS-Zoom-Apply-zoom-factor-to-webkit-text-stroke-width branch from b36a2fc to ba7938c Compare October 10, 2025 18:54
@nt1m nt1m added the unsafe-merge-queue Applied to send a pull request to merge-queue, but skip building and testing label Oct 10, 2025
https://bugs.webkit.org/show_bug.cgi?id=300061
rdar://161859808

Reviewed by Antti Koivisto.

Test: imported/w3c/web-platform-tests/css/css-viewport/zoom/text-stroke-width.html

* LayoutTests/TestExpectations:
* Source/WebCore/rendering/RenderTreeAsText.cpp:
(WebCore::RenderTreeAsText::writeRenderObject):
* Source/WebCore/rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::computedStrokeWidth const):
* Source/WebCore/style/values/non-standard/StyleWebKitTextStrokeWidth.h:

Canonical link: https://commits.webkit.org/301322@main
@webkit-commit-queue webkit-commit-queue force-pushed the eng/CSS-Zoom-Apply-zoom-factor-to-webkit-text-stroke-width branch from ba7938c to 97cc34d Compare October 10, 2025 18:57
@webkit-commit-queue
Copy link
Collaborator

Committed 301322@main (97cc34d): https://commits.webkit.org/301322@main

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

@webkit-commit-queue webkit-commit-queue merged commit 97cc34d into WebKit:main Oct 10, 2025
@webkit-commit-queue webkit-commit-queue removed the unsafe-merge-queue Applied to send a pull request to merge-queue, but skip building and testing label Oct 10, 2025
@nt1m nt1m deleted the eng/CSS-Zoom-Apply-zoom-factor-to-webkit-text-stroke-width branch October 10, 2025 19:06
@weinig
Copy link
Contributor

weinig commented Oct 11, 2025

Even for cases where there is no rendering difference, code needs testing for getComputedValue. Here is an example test case I made for @nullhook:

<!DOCTYPE html>
<html>
<head>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/computed-testcommon.js"></script>
</head>
<body>
<svg style="border-spacing: 10px 20px;">
  <rect id="target" width="200" height="100" x="10" y="10" rx="20" ry="20" fill="blue" />
</svg>

<script>
  const target = document.getElementById("target");

  test_computed_value("border-spacing", "1px", "1px", "no zoom");
  test_computed_value("border-spacing", "1px 2px", "1px 2px", "no zoom");
  test_computed_value("border-spacing", "inherit", "10px 20px", "no zoom");

  target.style.zoom = 2;

  test_computed_value("border-spacing", "1px", "1px", "zoom: 2");
  test_computed_value("border-spacing", "1px 2px", "1px 2px", "zoom: 2");
  test_computed_value("border-spacing", "inherit", "10px 20px", "zoom: 2");
</script>
</body>
</html>

@nt1m
Copy link
Member Author

nt1m commented Oct 12, 2025

Thanks for the example! I originally looked at the -svg.html reftests from @nullhook, but didn't think about computed style test. I'll make a follow up Monday to add that.

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.

7 participants