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 3/N: ReactBackgroundColorSpan #36547

Closed
wants to merge 3 commits into from

Commits on Mar 24, 2023

  1. Minimize EditText Spans 1/9: Fix precedence (facebook#36543)

    Summary:
    Pull Request resolved: facebook#36543
    
    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.
    
    We cache the backing EditText span on text change to later measure. To measure outside of a TextInput we need to restore any spans we removed. Spans may overlap, so base attributes should be behind everything else.
    
    The logic here for dealing with precedence is incorrect, and we should instead accomplish this by twiddling with the `SPAN_PRIORITY` bits.
    
    Changelog:
    [Android][Fixed] - Minimize Spans 1/N: Fix precedence
    
    Differential Revision: https://internalfb.com/D44240779
    
    fbshipit-source-id: fdd9081aa4e8a51a69ef18f7ae33227893e6563f
    NickGerleman authored and facebook-github-bot committed Mar 24, 2023
    Configuration menu
    Copy the full SHA
    56e51b5 View commit details
    Browse the repository at this point in the history
  2. Minimize EditText Spans 2/9: Make stripAttributeEquivalentSpans gener…

    …ic (facebook#36546)
    
    Summary:
    Pull Request resolved: facebook#36546
    
    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 generalizes `stripAttributeEquivalentSpans()` to allow plugging in different spans.
    
    Changelog:
    [Internal]
    
    Differential Revision: https://www.internalfb.com/diff/D44240781?entry_point=27
    
    fbshipit-source-id: 196b46a6edd3f0b1ba5f712f5739ab3fea30bf17
    NickGerleman authored and facebook-github-bot committed Mar 24, 2023
    Configuration menu
    Copy the full SHA
    3ead142 View commit details
    Browse the repository at this point in the history
  3. Minimize EditText Spans 3/9: ReactBackgroundColorSpan (facebook#36547)

    Summary:
    Pull Request resolved: facebook#36547
    
    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 adds `ReactBackgroundColorSpan` to the list of spans eligible to be stripped.
    
    Changelog:
    [Android][Fixed] - Minimize Spans 3/N: ReactBackgroundColorSpan
    
    Reviewed By: javache
    
    Differential Revision: D44240782
    
    fbshipit-source-id: e60f95c020f39f17207db202286aed70d084102f
    NickGerleman authored and facebook-github-bot committed Mar 24, 2023
    Configuration menu
    Copy the full SHA
    51157fc View commit details
    Browse the repository at this point in the history