Last modified: 2014-05-01 23:50:55 UTC
Created attachment 14049 [details] screenshot of the error and empty Latex window Steps to reproduce: 1.Add a bullet list 2.Add a template as a bulleted item 3.Save the page and reopen the editor 4.Go to the next line of the bulleted list (get rid of bullets by pressing return twice) 5.Click on More>Latex Observed Result: The latex window is opening up at the right end, where the template is placed. 6.Then if you change the focus by clicking somewhere on the page outside the latex window Observed Result: A blank Latex windows is opening up and a uncaught type error appears Uncaught TypeError: Cannot call method 'getOuterRange' of null If you save the page and go to edit source , you will see empty <math> tag is getting placed
Created attachment 14050 [details] emtpy <math> tags
Modification in steps to reproduce: 4.There is an empty bullet place cursor there and then go to More>Latex It can also be reproduced by adding image in step 2.
This happens because ve.ui.MWMathInspector.prototype.setup assumes that after calling insertContent() to insert a math node, the selection will cover the math node exactly. But in a block slug, that's not true, because fixupInsertion will have amended the insertion to wrap the math node in a paragraph. Then when the selection does not precisely cover a FocusableNode, focusedNode will be null.
*** Bug 62797 has been marked as a duplicate of this bug. ***
This code as of Gerrit change #126900 is moving back into VE's repo where it needs to be fixed.
Change 126900 had a related patch set uploaded by Esanders: Create MWLiveExtensionInspector base class https://gerrit.wikimedia.org/r/126900
Change 126900 merged by jenkins-bot: Create MWLiveExtensionInspector base class https://gerrit.wikimedia.org/r/126900
Verified the fix on Betalabs
Change 129622 had a related patch set uploaded by Jforrester: Create MWLiveExtensionInspector base class https://gerrit.wikimedia.org/r/129622
Change 129622 merged by jenkins-bot: Create MWLiveExtensionInspector base class https://gerrit.wikimedia.org/r/129622
Verified the fix in test2
Verified the fix in production