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

[Wasm] Text measurement bug when ancestor contains a RenderTransform #1034

Merged
merged 4 commits into from
Jun 10, 2019

Conversation

carldebilly
Copy link
Member

GitHub Issue (If applicable): #808

Bugfix

Text measurement refactoring.

What is the current behavior?

Sometimes a TextBlock were wrapping even if the parent were provinding enough space to prevent it.

The problem was caused by a parent element containing a transform in the HTMLDOM. The cause
is directly in the spec itself:

https://www.w3.org/TR/css-transforms-1/

For elements whose layout is governed by the CSS box model, any value other than none
for the transform property also causes the element to establish a containing block for all
descendants. Its padding box will be used to layout for all of its absolute-position
descendants, fixed-position descendants, and descendant fixed background attachments.

BONUS: The investigations also revealed another one, never reported: a TextBlock width was hard limited to viewport width.

What is the new behavior?

This limitation is now used to remove any kind of [known yet] DOM ancestor constrains.
The parent element is now set to almost-infinite size to remove any size contention.

PR Checklist

Please check if your PR fulfills the following requirements:

Internal Issue (If applicable):

@carldebilly carldebilly changed the title Dev/cdb/wasm/text measure bug [Wasm] Text measurement bug when ancestor contains a RenderTransform Jun 7, 2019
@jeromelaban
Copy link
Member

There's a rendering difference in SamplesApp.Windows_UI_Xaml_Controls.ListView.ListViewChangeHeight.png:
image

is that expected ?

@carldebilly
Copy link
Member Author

carldebilly commented Jun 10, 2019

@jeromelaban It is expected:

image

@carldebilly carldebilly force-pushed the dev/cdb/wasm/text-measure-bug branch from 81bd59b to 4ebaec0 Compare June 10, 2019 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants