Page MenuHomePhabricator

VisualEditor: Math inspector does not check type of node it's inspecting
Closed, ResolvedPublic

Description

Link inspector and Math inspector together

Steps to reproduce:

1.Click on the Edit beta
2.Add a media such as image
3.Now open the Math inspector from More>Latex

Observed Result:
The Math inspector does not open,Now if you click on link both the inspectors open together.

See the screenshot attached.


Version: unspecified
Severity: normal

Attached:

Screen_Shot_2013-11-05_at_4.27.26_PM.png (590×518 px, 54 KB)

Details

Reference
bz56645

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 2:42 AM
bzimport set Reference to bz56645.

At least one issue here is that MWExtensionInspector and MWMathInspector don't check that this.focusedNode is actually of the right type before doing things, so the math inspector will happily inspect references etc.

I couldn't reproduce the double inspector offhand.

(In reply to comment #1)

I couldn't reproduce the double inspector offhand.

I can now:

  1. Insert an image
  2. Unselect and reselect the image so just the image is selected
  3. Open the math inspector. It attempts to inspect the image and crashes
  4. Post-crash, you get the double inspector thing

Both issues caused by the math inspector not checking that what it's inspecting is really a math node, changing summary.

It also throws the following errors and the math inspector gets completely blank.:
Uncaught TypeError: Cannot call method 'getAttribute' of null VM977:417
Uncaught TypeError: Cannot call method 'getOuterRange' of null

Created attachment 15126
Errors and blank inspector

Attached:

Screen_Shot_2014-04-16_at_4.41.33_PM.png (660×1 px, 117 KB)

Verified the fix on production