Repository navigation
Enable zooming outline: auto - #61077
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
b5261ae to
7c8164c
Compare
This comment was marked as outdated.
This comment was marked as outdated.
| <canvas id="canvas1" width="100" height="100"> | ||
| <button id="btn1" tabindex="0">X</button> | ||
| </canvas> | ||
| <canvas id="canvas2" width="100" height="100" style="zoom: 2"> |
There was a problem hiding this comment.
zoom style on the canvas is one thing, but I'd me more interested to see a test that draws the focus ring after ctx.scale(2, 2)
There was a problem hiding this comment.
Done, also added a more esoteric transform test.
| // zoomFactor covers CSS zoom / page zoom (Cmd+/-). The user-to-base CTM ratio covers page scale (pinch-to-zoom). | ||
| auto oldBaseCTM = CGContextGetBaseCTM(platformContext); | ||
| auto userToBase = CGAffineTransformConcat(CGContextGetCTM(platformContext), CGAffineTransformInvert(oldBaseCTM)); | ||
| auto ctmScale = std::max(std::abs(userToBase.a), std::abs(userToBase.d)); |
There was a problem hiding this comment.
Maybe this should follow scaledBlurRadius which does something more complex (maybe to handle rotations/skews?
There was a problem hiding this comment.
Thanks for the pointer. Created a shared abstraction.
7c8164c to
1358421
Compare
This comment was marked as outdated.
This comment was marked as outdated.
1358421 to
078da3f
Compare
|
EWS run on previous version of this PR (hash 078da3f) Details
|
078da3f to
3711ee7
Compare
|
EWS run on current version of this PR (hash 3711ee7) Details
|
https://bugs.webkit.org/show_bug.cgi?id=310434 rdar://173068660 Reviewed by Simon Fraser. The outline: auto focus ring would never change in size. This placed it outside the CSS coordinate system which could get awkward/ugly when combined with outline-offset, which does participate in the CSS coordinate system. To address this we need to account for two types of zoom, "page zoom" (Cmd+) and "page scale" (pinch). The changes in GraphicsContextCocoa take care these. We repurpose some of the logic from scaledBlurRadius() to handle rotation and skew correctly, but go for the larger value so the focus ring is sufficiently large in all directions. That's also why we go from 0 to 1: to ensure there's a focus ring visible. Most of the other changes are about forwarding the relevant "page zoom" factor to the graphics layer. Finally, the change in RenderStyle takes fixes a bug where we pass the zoomed outline-width value to platformFocusRingWidthOffset() which operates on un-zoomed values. This results in an outline snug to a border getting an ever larger gap as you page zoom. Tests: fast/css/mac/outline-auto-zoom.html fast/css/outline-auto-zoom-canvas.html Canonical link: https://commits.webkit.org/309926@main
3711ee7 to
bd74c28
Compare
|
Committed 309926@main (bd74c28): https://commits.webkit.org/309926@main Reviewed commits have been landed. Closing PR #61077 and removing active labels. |
bd74c28
3711ee7
🧪 win-tests🧪 ios-wk2🧪 api-mac🧪 api-mac-debug🧪 api-ios