Skip to content

-webkit-column-count crashes Mathjax in Chrome #45

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

Closed
joshguffin opened this issue Jan 7, 2011 · 10 comments
Closed

-webkit-column-count crashes Mathjax in Chrome #45

joshguffin opened this issue Jan 7, 2011 · 10 comments
Labels
Accepted Issue has been reproduced by MathJax team Browser Bug Test Available

Comments

@joshguffin
Copy link

Bug was observed using

  • MathJax version: 1.01a
  • Chrome version: 8.0.552.231 for mac, 8.0.552.224 for linux

With any number of columns > 1, the -webkit-column-count styling for divs crashes mathjax when
superscripts or subscripts are used. Removing sub/superscripts solves the problem.

Minimal example exhibiting crash below.

<html> <head> 
<script src="path.to/MathJax/MathJax.js" type="text/javascript"></script> 
</head><body> 
<div style=" -webkit-column-count:2;"> $P^1$ </div> 
</body></html>
@dpvc
Copy link
Member

dpvc commented Jan 7, 2011

OK, I have reproduced your results. Not sure what to suggest at the moment, other than not using -webkit-column-count for now. I haven't yet looked into where exactly the crash is occurring.

Davide

@fred-wang
Copy link
Contributor

Thanks very much for your testcase, I'll integrated it in the testsuite as a "crashtest".
I've been able to reproduce the test on Chrome but not on Safari for Windows.
Does the crash also happen for Safari on MacOS?

@dpvc
Copy link
Member

dpvc commented Mar 7, 2011

Does the crash also happen for Safari on MacOS?

No, Safari processes the test page properly.

Davide

@fred-wang
Copy link
Contributor

OK, I've added crashtest Crashtests/webkit-column-count-1.html
and marked it as "skip-if(Chrome)"

@dpvc
Copy link
Member

dpvc commented May 6, 2011

It looks like WebKit has some bugs with multiple column output. Both Safari and Chrome have problems with elements that have position other than static when they appear in multi-column alignments.

For example, the page

<!DOCTYPE HTML>
<html>
<head>
<title>Safari positioning bug</title>
</head>
<body>

<div style="-webkit-column-count: 2; color:red">
a<br />
b<br />
c<br />
d<br />
e <span style="position: relative;">x</span><br />
f
</div>
d<br />
e<br />
f

</body>
</html>

incorrectly displays the "x" from the second column in the location it would have been in had it been only one column. Note that the two-column material is in red; the black lettering represents the corresponding single-column output. The red "x" appears next to the back "e", not the red "e" as it should.

The situation for Chrome is more complicated. While it properly displays the page listed above, it also has problems with positioned elements within a multi-column format, but I'm not entirely sure of what the trigger is. For example, the following page

<!DOCTYPE HTML>
<html>

<head>
<title>Chrome Crash test</title>
</head>
<body>

<div style="-webkit-column-count: 2; ">

<span style="display: inline-block; position: relative;">
  <span style="position: absolute;">
    <span style="position: relative;">
      <span style="position: absolute;">
      </span>
    </span>
  </span>
</span>

</div>

</body>
</html>

causes Chrome 11.0.696.57 on Mac OS X 10.5.8 to crash. Removing any one of the style attributes (the column count, the display value, or any of the position values) allows the page to display. Changing the first absolute to relative also allows it to display (though changing the second doesn't). So it is not clear to me exactly what is going on, here.

In any case, positioned elements are crucial to MathJax's ability to position the symbols correctly, and I don't see any way to work around these browser bugs from within MathJax. The only suggestion I can offer is to not use multi-column styles until the browsers resolve these bugs.

Davide

@fred-wang
Copy link
Contributor

Is there a bug entry in Webkit Bugzilla? I seem to remember one, but can not find it.

@dpvc
Copy link
Member

dpvc commented Apr 16, 2012

I never made any bug report, but I thought there was one about it, too.

@fred-wang
Copy link
Contributor

OK, I think I found it:
https://bugs.webkit.org/show_bug.cgi?id=48983

It seems that it was fixed one year ago.

The test page no longer crashes for me with the latest Chrome version:
http://devel.mathjax.org/testing/testsuite/Crashtests/webkit-column-count-1.html

@dpvc
Copy link
Member

dpvc commented Apr 16, 2012

My two test file now also work properly as well, so I'm closing this bug as it is fixed upstream.

@dpvc dpvc closed this as completed Apr 16, 2012
@fred-wang
Copy link
Contributor

OK i'll remove the "skip-if" tag on the crashtest so that it will run on Chrome.

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 Browser Bug Test Available
Projects
None yet
Development

No branches or pull requests

3 participants