-
-
Notifications
You must be signed in to change notification settings - Fork 828
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
text: Skip setting HTML text when it hasn't changed #19012
base: master
Are you sure you want to change the base?
Conversation
What do you mean? Aren't they supposed to be always synced anyway? |
They are, but due to the fact that HTML cannot represent all possible contents, it gets tricky. I'm talking specifically about the following scenario:
Now the fact that the binding synchronizes the value back doesn't matter, because when you do the same without binding, it behaves the same way (i.e. the value is Unfortunately, the tests now started to fail, which means I have found yet another bug related to when the relayout takes place (yay! I guess?). |
To be sure, is the full roundtrip ("binding synchronizes the value back") needed, or is it more like "it's simpler this way and doesn't impact any behavior by itself"? |
So first of all, I did it this way not because it's simpler, but because it's correct. The binding has nothing to do with this behavior, it just happens to occur with a binding. I don't think the roundtrip is needed (but I'm not sure), I think after this PR it will just be a useless string comparison + property lookup. I guess that could be optimized, but I'm not sure if that's worth it. |
I wasn't questioning the PR at all, sorry if it seemed that way. Was just making sure about the roundtrip. |
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.
Ah, sorry, reversing the approve, since you mentioned that new bug 😅
No worries! I wasn't thinking that, just wanted to emphasize (for everyone) that the binding thing is not that important here 😄 |
This fixes issues with setting align to a value that isn't lowercase.
Added cases related to case sensitivity of p's align attribute.
This behavior not only prevents text relayout, but it also has observable effects, because not every set of spans is representable as HTML.
This behavior not only prevents text relayout, but it also has observable effects, because text format is not being reset to the default format.
This test verifies the behavior of htmlText when setting to the same value.
6c0356a
to
71405d4
Compare
@adrian17 Should be good now, added some more test cases here too |
Flash Player checks whether we're setting
htmlText
to a different value before doing it. It not only prevents text relayout, but also has observable effects, because not every set of spans can be represented as HTML.This is especially affecting input text fields with bound variables, as text propagation will set the value back, and we can produce spans not representable as HTML during input.
Additionally, this PR fixes
<p>
's align case sensitivity.