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

Minimize EditText Spans 8/9: CustomStyleSpan #36577

Closed
wants to merge 4 commits into from

Commits on Mar 24, 2023

  1. Minimize EditText Spans 5/N: Strikethrough and Underline

    Summary:
    This is part of a series of changes to minimize the number of spans committed to EditText, as a mitigation for platform issues on Samsung devices. See this [GitHub thread]( facebook#35936 (comment)) for greater context on the platform behavior.
    
    This change makes us apply strikethrough and underline as paint flags to the underlying EditText, instead of just the spans. We then opt ReactUnderlineSpan and ReactStrikethroughSpan into being strippable.
    
    This does actually create visual behavior changes, where child text will inherit any underline or strikethrough of the root EditText (including if the child specifies `textDecorationLine: "none"`. The new behavior is consistent with both iOS and web though, so it seems like more of a bugfix than a regression.
    
    Changelog:
    [Android][Fixed] - Minimize Spans 5/N: Strikethrough and Underline
    
    Differential Revision: https://www.internalfb.com/diff/D44240778?entry_point=27
    
    fbshipit-source-id: 0dad788a7585bdf4e98a2f2f4607eb82088ba2f4
    NickGerleman authored and facebook-github-bot committed Mar 24, 2023
    Configuration menu
    Copy the full SHA
    a8ec53e View commit details
    Browse the repository at this point in the history
  2. Minimize EditText Spans 6/N: letterSpacing

    Summary:
    This is part of a series of changes to minimize the number of spans committed to EditText, as a mitigation for platform issues on Samsung devices. See this [GitHub thread]( facebook#35936 (comment)) for greater context on the platform behavior.
    
    This change lets us set `letterSpacing` on the EditText instead of using our custom span.
    
    Changelog:
    [Android][Fixed] - Minimize EditText Spans 6/N: letterSpacing
    
    Differential Revision: https://internalfb.com/D44240777
    
    fbshipit-source-id: 6eb8ddc6232b799f5ba48431fd6adc1181950631
    NickGerleman authored and facebook-github-bot committed Mar 24, 2023
    Configuration menu
    Copy the full SHA
    28f0a9b View commit details
    Browse the repository at this point in the history
  3. Minimize EditText Spans 7/N: Avoid temp list

    Summary:
    This is part of a series of changes to minimize the number of spans committed to EditText, as a mitigation for platform issues on Samsung devices. See this [GitHub thread]( facebook#35936 (comment)) for greater context on the platform behavior.
    
    This change addresses some minor CR feedback and removes the temporary list of spans in favor of applying them directly.
    
    Differential Revision: D44295190
    
    fbshipit-source-id: 27ad202c799e7ebeb0baad1276bbde1442d8de04
    NickGerleman authored and facebook-github-bot committed Mar 24, 2023
    Configuration menu
    Copy the full SHA
    303735d View commit details
    Browse the repository at this point in the history
  4. Minimize EditText Spans 8/9: CustomStyleSpan (facebook#36577)

    Summary:
    Pull Request resolved: facebook#36577
    
    This is part of a series of changes to minimize the number of spans committed to EditText, as a mitigation for platform issues on Samsung devices. See this [GitHub thread]( facebook#35936 (comment)) for greater context on the platform behavior.
    
    This change allows us to strip CustomStyleSpan. We already set all but `fontVariant` on the underlying EditText, so we just need to route that through as well.
    
    Note that because this span is non-parcelable, it is seemingly not subject to the buggy behavior on Samsung devices of infinitely cloning the spans, but non-parcelable spans have different issues on the devices (they disappear), so moving `fontVariant` to the top-level makes sense here.
    
    Changelog:
    [Android][Fixed] - Minimize EditText Spans 8/N: CustomStyleSpan
    
    Reviewed By: javache
    
    Differential Revision: D44297384
    
    fbshipit-source-id: dcaf5f7c0560fe660bbc20c3b78fdb16794ba4e9
    NickGerleman authored and facebook-github-bot committed Mar 24, 2023
    Configuration menu
    Copy the full SHA
    1cb4642 View commit details
    Browse the repository at this point in the history