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

bugfix - textcombine #233

Closed
wants to merge 3 commits into from

Conversation

btsimonh
Copy link
Contributor

fixes #232

@@ -663,6 +664,7 @@

if (first.tagName === "SPAN" &&
second.tagName === "SPAN" &&
first._isd_element &&
Copy link
Contributor

Choose a reason for hiding this comment

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

This line will mask the impact of upstream code not setting _isd_element when we want that to happen, so possibly better not to add it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm, I'm not sure in what circumstances _isd_element would be unset, but almost certainly we'd not want to combine spans which had not come from the same source element. I think it adds robustness. If we just want to highlight errors as well as being robust, we could move the test inside the if, and console.error? no access to context.errorHandler there at the moment :(.

Copy link
Contributor

Choose a reason for hiding this comment

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

That's a good point @btsimonh , I hadn't thought of it like that.

@nigelmegitt
Copy link
Contributor

btsimonh added a commit to btsimonh/imsc-tests that referenced this pull request Oct 10, 2022
Add consecutive textCombine elements.  
These should be displayed independently.
Image needs to be regenerated using this PR:
sandflow/imscJS#233
@btsimonh
Copy link
Contributor Author

@nigelmegitt - gave a PR for imsc-tests to test this specific point.
Images need re-rendering....

Copy link
Contributor

@palemieux palemieux left a comment

Choose a reason for hiding this comment

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

@btsimonh What was wrong with your original proposal #232 (comment) ?

@btsimonh
Copy link
Contributor Author

What was wrong with your original proposal

I think @nigelmegitt wanted the code to highlight if _isd_element was not set, because it may clearly be an error?
Hence the move of the test - but no logging in that fn, so console.error is the best I could do without a lot more mods?

@palemieux
Copy link
Contributor

I think @nigelmegitt wanted the code to highlight if _isd_element was not set, because it may clearly be an error?

AFAIK _isd_element is set only on elements that are available for merging. Wasn't that the intent @nigelmegitt ?

@nigelmegitt
Copy link
Contributor

@palemieux Yes that was the intent, but I think we did not have test cases for textCombine and the code goes through a different path in that case.

It should not be the case that any elements that are candidates for merging do not have _isd_element so if that does happen we should have some mechanism for identifying it, like raising a console warning; at the same time we should fix those cases, and the elements that go through the textCombine path are one of the cases to be fixed, as I understand it.

@palemieux
Copy link
Contributor

textCombine should not have _isd_element since it is not subject to span-per-character processing.

For the purpose of flagging things that should have _isd_element but do not have it, how would one differentiate an element that should have it but does not vs. an element that does not have because it should not have it.

@btsimonh
Copy link
Contributor Author

can you highlight a case of 'should not have it' where the recombine function would get called?

@palemieux
Copy link
Contributor

Replaced by #239

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

adjacent tts:textCombine spans are combined into a single span
3 participants