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

various issues on puzzling.SE #1384

Closed
pkra opened this issue Feb 11, 2016 · 13 comments
Closed

various issues on puzzling.SE #1384

pkra opened this issue Feb 11, 2016 · 13 comments
Labels
Accepted Issue has been reproduced by MathJax team Fixed Test Available Upstream v2.7

Comments

@pkra
Copy link
Contributor

pkra commented Feb 11, 2016

From puzzling.SE.

On this question, I see the following

  • the FastPreview crashes half-way through the page (TeX is still in place). The console reports MathJax.js?config=TeX-AMS_HTML-full:19 Uncaught TypeError: Cannot read property 'insertBefore' of null
  • If I deactivate the Fast Preview, then I see the problem described in the post -- furthe down in the page, the rendering is all over the place and equations are duplicated. This seems to roughly match the point where the FastPreview crashes (the last answer from BigBlackBox)

I'll see if later versions of Chrome suffer from this.

@pkra
Copy link
Contributor Author

pkra commented Feb 11, 2016

CommonHTML and SVG don't seem to be affected.

@pkra pkra added this to the A future release milestone Feb 11, 2016
@pkra
Copy link
Contributor Author

pkra commented Feb 11, 2016

Also, I used the standard modern.ie VM for Win7, IE9 for this.

@pkra
Copy link
Contributor Author

pkra commented Feb 11, 2016

Same on Chrome 49.0.2623.47 beta-m, Win7.

@dpvc
Copy link
Member

dpvc commented Feb 11, 2016

I can reproduce on Chrome 48.0.2564.97 on Mac OS. It is not dependent on the Fast Preview or Assistive MathML settings for me, and I see no errors in the error log.

@dpvc
Copy link
Member

dpvc commented Feb 11, 2016

The state of the DOM is very similar to that in issue #1171. I'm wondering if there isn't a second MathJax.Hub.Typeset being made somewhere that doesn't use the MathJax queue. There are several occurrences of raw MathJax.Hub.Typeset calls in the javascript loaded for the page, but since the code is minified, it is hard to tell when they get used. Rerendering the page (not reloading but calling MathJax.Hub.Rerender() in the console) clears the problem, so it is not directly an output error. It really looks like two Typeset calls being interleaved.

@pkra
Copy link
Contributor Author

pkra commented Feb 12, 2016

Thanks. I'll follow up with SE.

@pkra pkra added Upstream and removed Investigate labels Feb 17, 2016
@m0sa
Copy link

m0sa commented Feb 22, 2016

Users are reporting getting the same error here, I couldn't repro it with the provided steps though.

@dpvc
Copy link
Member

dpvc commented Feb 23, 2016

I believe this particular report will be resolved by pull request #1396. It is due to the page being replaced before MathJax is finished typesetting it, something I thought the code being used prevented. If the editing and MathJax's typesetting are no longer synchronized properly, that could account for the other problem as well.

dpvc added a commit to dpvc/MathJax that referenced this issue Mar 20, 2016
@dpvc
Copy link
Member

dpvc commented Mar 20, 2016

The issue1384 branch of my form of MathJax include additional checks to test for this.

@dpvc
Copy link
Member

dpvc commented Apr 8, 2016

I have finally been able to make some headway on the issue in puzzling.SE. It turns out to be a combination of issues. First, SE doesn't use MathJax.Hub.Queue() to perform its MathJax.Hub.Typeset() commands, so that does allow processing to become interleaved, but that turns out not to be the main issue. Another important factor is that they modify the page while MathJax is typesetting it, which removes some of the math that MathJax is trying to work on. MathJax should be able to handle that, but there are a couple of places (in addition to the ones already included in the commits listed above) where this causes MathJax to operate incorrectly. In particular, if some math in the list of expressions MathJax is typesetting is removed from the page, the HTML-CSS output jax will fail to mark the rest of the math as being processed. That means the next time MathJax is asked to typeset the page, all the math is typeset again; but because the output is already there, a second copy gets added, which gives the bad output listed in the puzzling.SE post.

It took quite some investigation to figure out the interactions in the complex environment of SE, but I do have some changes that should fix this problem.

dpvc added a commit to dpvc/MathJax that referenced this issue Apr 8, 2016
@dpvc
Copy link
Member

dpvc commented Apr 8, 2016

I have added the new fixes to the issue1384 branch.

dpvc added a commit to dpvc/MathJax that referenced this issue Apr 8, 2016
… MathJax_Processing. Also could have allowed proper output in issue mathjax#1384, though it woud have replaced all the math on the page.
@pkra pkra modified the milestones: MathJax v2.x.x, A future release Apr 15, 2016
dpvc added a commit that referenced this issue May 11, 2016
Fix problems from puzzling.SE.  #1384.
@dpvc dpvc added Accepted Issue has been reproduced by MathJax team Merged Merged into develop branch and removed Ready for Review labels May 11, 2016
@dpvc
Copy link
Member

dpvc commented May 11, 2016

==> Merged.

@dpvc
Copy link
Member

dpvc commented Aug 17, 2016

==> In testsuite

Parsing/issue1384-1.html
Parsing/issue1384-2.html
Parsing/issue1384-3.html

@dpvc dpvc added v2.7 Fixed and removed Merged Merged into develop branch labels Jan 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accepted Issue has been reproduced by MathJax team Fixed Test Available Upstream v2.7
Projects
None yet
Development

No branches or pull requests

3 participants