Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

mdebbar
Copy link
Contributor

@mdebbar mdebbar commented Jan 11, 2021

Description

  1. Apply font-family and other styles to the root paragraph element. For some reason, even if all the span have the correct font-family, the browser won't render the paragraph correctly unless the root element also has a font-family. This issue seems to only affect the Ahem font in tests for now.

  2. Clear the measurement cache when new fonts are loaded. This causes issues occasionally when font loading is delayed or takes longer than expected.

@mdebbar mdebbar added the platform-web Code specifically for the web engine label Jan 11, 2021
@mdebbar mdebbar requested a review from ferhatb January 11, 2021 19:33
@@ -8,7 +8,7 @@ import 'package:test/test.dart';
import 'package:ui/src/engine.dart';
import 'package:ui/ui.dart';

const String paragraphStyle = 'style="position: absolute; white-space: pre-wrap; overflow-wrap: break-word; overflow: hidden;"';
const String paragraphStyle = 'font-family: sans-serif; position: absolute; white-space: pre-wrap; overflow-wrap: break-word; overflow: hidden;';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we still need overflow hidden?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's only needed for certain cases like when max-lines is set. I'll change it so that the overflow property is only added when needed, instead of all the time.

@mdebbar mdebbar force-pushed the rich_dom_paragraph branch from 9d26ef6 to cdeb1a1 Compare January 11, 2021 21:55
@mdebbar mdebbar requested a review from ferhatb January 11, 2021 21:59
@mdebbar mdebbar added the waiting for tree to go green This PR is approved and tested, but waiting for the tree to be green to land. label Jan 11, 2021
@fluttergithubbot fluttergithubbot merged commit 497dcb5 into flutter:master Jan 11, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jan 12, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jan 12, 2021
@mdebbar mdebbar deleted the rich_dom_paragraph branch April 15, 2021 17:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes platform-web Code specifically for the web engine waiting for tree to go green This PR is approved and tested, but waiting for the tree to be green to land.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants