-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Overflow implementation in Fabric as per Parity to Paper #15338
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
base: main
Are you sure you want to change the base?
Conversation
|
@Nitin-100 |
5603646 to
8527924
Compare
8527924 to
85b860f
Compare
|
/azp run |
|
Azure Pipelines successfully started running 2 pipeline(s). |
|
We already use a clip for rounded corners to clip the background: ComponentView::updateClippingPath. Really we need to stop doing that for rounded corners, which means fixing our background logic for rounded corners so that that clip is not required. Then we can do this change. |
acoates-ms
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to work out how to not conflict with the existing clip.
|
Looks like the prop is not working as expected as per the screenshots attached. Please add E2ETestApp unit tests as well and more examples in playground. |
Changes are not added yet, I'm busy with release work. |
| layoutMetrics.frame.size.height * layoutMetrics.pointScaleFactor}); | ||
|
|
||
| // Apply overflow clipping | ||
| if (m_props && m_props->yogaStyle.overflow() == facebook::yoga::Overflow::Hidden) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about other overflow types?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getClipsContentToBounds check this
| winrt::Microsoft::ReactNative::Composition::Experimental::MicrosoftCompositionContextHelper::InnerVisual( | ||
| Visual()); | ||
| if (compVisual) { | ||
| compVisual.Clip(nullptr); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is as good as doing nothing, right?
If no clip was ever applied, this line is redundant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Re-review the code.
Sure, please convert this PR to draft while you work on it. |
Hi OSG Instrumentation Team, I'm working on React Native Windows telemetry. We currently have: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ EXISTING (working): - JavaScript CLI telemetry via 1DS SDK - Instrumentation Key: 49ff6d3ef12f4578a7b75a2573d9dba8-026332b2-2d50-452f-ad0d-50f921c97a9d-7145 - Data flows to: Aria → Kusto - Kusto cluster: [YOU NEED TO TELL ME THIS] NEW (want to add): - Native C++ telemetry via ETW/TraceLogging - Provider Name: Microsoft.ReactNativeWindows.Telemetry - Provider GUID: [WILL GENERATE] ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ QUESTION: Can you register the new ETW provider GUID and route it to the SAME Aria tenant as our existing 1DS instrumentation key? Goal: Have both JavaScript (1DS) and C++ (ETW) telemetry appear in the same Kusto database for unified querying. Is this possible? If yes, what info do you need from me? Thanks, Harini Malothu React Native Windows Team

Description
Type of Change
Why
The overflow CSS property was not implemented in the Fabric Composition architecture. Paper XAML architecture has supported overflow, but Fabric was missing this functionality entirely. This PR closes the feature gap between the two architectures where views with
overflow: hiddendo not clip their children in Fabric apps, while they work correctly in Paper apps. This change brings Fabric to parity with Paper by implementing the missing overflow property support.What
Added overflow clipping support to the Fabric architecture by introducing a dedicated
m_contentVisualfor mounting children and applying clipping inCompositionViewComponentView.cpp:Created
m_contentVisual- A separate visual layer that is a child ofm_visual, used specifically for mounting child components. This allows clipping to be applied independently of the border/background visual.Updated
ensureVisual()- Createsm_contentVisualas a child ofm_visualwhen the visual is initialized.Updated
VisualToMountChildrenInto()- Returnsm_contentVisualso all children are mounted into the clippable content visual.Updated
updateLayoutMetrics()- Sizes and offsetsm_contentVisualto match the content area (excluding borders), and applies overflow clipping usingSetClippingPathwith a path geometry that accounts for border radii.The implementation:
BorderPrimitive::resolveAndAlignBorderMetrics()to get accurate border widthsBorderPrimitive::GenerateRoundedRectPathGeometry()to create the clip pathSetClippingPathonm_contentVisualwhengetClipsContentToBounds()returns truenullptrwhen overflow is not hiddenThis approach properly handles:
Screenshots
Paper overflow
Fabric with overflow (before)
ovefflow.mp4
Testing
overflowTest.tsx
Tested with RNTester View overflow examples and custom overflowTest.tsx by navigating to View component and scrolling to the Overflow section. Verified that:
overflow: hiddennow properly clip overflowing child contentoverflow: visiblecorrectly allow content to extend beyond their boundsRan both playground.sln (Paper) and playground-composition.sln (Fabric) to verify identical behavior between the two architectures.
Changelog
Should this change be included in the release notes: yes
Implemented overflow property support for Fabric architecture. Views with
overflow: hiddennow properly clip their children to the container bounds, achieving parity with Paper architecture. Addedm_contentVisualto properly separate content clipping from border rendering.