Last modified: 2012-10-15 22:57:09 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T35596, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 33596 - inArray's use of strict equals in es.ContentView.js may be inappropriate (FIX attached)
inArray's use of strict equals in es.ContentView.js may be inappropriate (FIX...
Status: RESOLVED INVALID
Product: VisualEditor
Classification: Unclassified
General (Other open bugs)
unspecified
All All
: High normal
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-01-09 01:30 UTC by John A
Modified: 2012-10-15 22:57 UTC (History)
6 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description John A 2012-01-09 01:30:45 UTC
I've noticed a problem with es.ContentView.js when implementing tex equation support.  When you click text outside an annotation and then click back into the annotation, the new content is determined to have a different type than the surrounding text.  I believe this is because inArray uses strict equals and really the only thing it should be comparing is the type key and I don't think that necessarily needs to be strict (although I guess it could be).

Here is a copy of the old code: https://jalto.net/equationdb/VisualEditor_save/demo/

And the new code: https://jalto.net/equationdb/VisualEditor_old/demo/

Steps to reproduce in old code:
1) Create an inline equation
2) Click a different section of the text
3) Click in the middle of the inline equation
4) Type something

The new code is working fine.  The commits are:

https://github.com/jalto/VisualEditor/commit/5e544447e5d54b260f5c0333f4dc9da5f15124d7

and

https://github.com/jalto/VisualEditor/commit/0f5a139d24870f200070a95cd70539b04dc0ce33

Thanks,

John
Comment 1 John A 2012-01-11 17:41:20 UTC
Rereading this I should have mentioned I'm new to javascript and in general a bit rusty in programming.  Here is a new commit to fix some of the mistakes I made in the previous ones.  I've done more testing and I think this actually is working now.

https://github.com/jalto/VisualEditor/commit/f9b3cd519420df518c4d0189c32c36ae77a908c6

Again you can see the working copy at https://jalto.net/equationdb/VisualEditor_old/demo/ .  The reason for the old is that I plan to made future changes and I wanted to keep a static copy.
Comment 2 James Forrester 2012-06-22 21:30:49 UTC
Fixed with new version of VE (code replaced).
Comment 3 James Forrester 2012-10-15 22:57:09 UTC
Mass-moving old VisualEditor tickets to the VE product. Search for this message to mass-delete bugmail.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links