Page MenuHomePhabricator

Offsets calculated incorrectly with inline images in MediaWiki
Closed, ResolvedPublic8 Story Points

Description

As reported at https://en.wikipedia.org/wiki/Wikipedia:VisualEditor/Feedback#Can.27t_type_because_it_switches_characters , try and VEdit the table at https://en.wikipedia.org/w/index.php?title=List_of_predecessors_of_sovereign_states_in_North_America&veaction=edit . For example, where it says "Colony of Antigua (1671–1816; 1833–1958) (part of British Leeward Islands)", try to add something after Islands, then hit Enter. See how the word is now in a new position, part of (in other cases, label for) the previous wikilink.

Event Timeline

Elitre created this task.Jun 5 2017, 10:21 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJun 5 2017, 10:21 AM
Deskana triaged this task as High priority.Jun 5 2017, 1:05 PM
Deskana moved this task from To Triage to TR0: Interrupt on the VisualEditor board.
Deskana added a subscriber: Deskana.

This needs investigation.

cscott added a subscriber: cscott.Jun 5 2017, 8:30 PM

Can reproduce locally with the following cut-down test case:

{| class="wikitable"
|-
! Sovereign state
! Predecessors
|-
| [[Antigua and Barbuda]]
| [[File:Flag of Leeward Islands 1871-1956.gif|24px]] [[History of Antigua and Barbuda#European colonization|Colony of Antigua]] (1671–1816; 1833–1958) ''(part of [[British Leeward Islands]])''<br/>[[File:Flag of Leeward Islands 1871-1956.gif|24px]] [[History of Antigua and Barbuda#European colonization|Colony of Barbuda]]
|}
== See also ==

When I type "foo" before the close paren, the *model* shows the insertion as occurring inside the link, although it shows up "as expected" outside the link... until you hit enter. After you hit enter, the model and the view are in sync again. And in fact if you then Ctrl-Z undo, the view stays in sync with the model as your typing is undone.

(Looks like a pure VE bug, no Parsoid involvement.)

Thanks, @cscott ! I've put this at the top of the column, so we get to it sooner.

Jdforrester-WMF set the point value for this task to 8.

This seems to be happening outside tables as well? Check this diff - in particular what happened when I changed Queensland to Maryland in both target and label, and July 2014 to July 2017. This is probably UBN at this point. Related thread at en.wp.

Deskana raised the priority of this task from High to Unbreak Now!.Jun 22 2017, 5:09 PM

This is potentially very bad wikitext corruption that needs urgent investigation.

Restricted Application added subscribers: Jay8g, TerraCodes. · View Herald TranscriptJun 22 2017, 5:09 PM
Esanders added subscribers: dchan, Esanders.EditedJun 22 2017, 7:21 PM

Looks like some issues with view/model cursor offsets in CE code. I get an exception as soon as I double click on the table cell. (that was with TOC enabled) Pinging @dchan.

The problem appears to be caused by the inline image - I imagine it is not getting counted properly during offset conversion. Simply cursoring off the image to the right jumps you an extra two places.

Minimal wikitext:

Inline [[File:Flag_of_Leeward_Islands_1871-1956.gif|24x24px]] image
Esanders renamed this task from Text added in table gets mingled with wikilinks to Offsets calculated incorrectly with inline images in MediaWiki.Jun 22 2017, 7:33 PM

Change 360907 had a related patch set uploaded (by Esanders; owner: Esanders):
[mediawiki/extensions/VisualEditor@master] Ensure MWInlineImage's get the ve-ce-leafNode class

https://gerrit.wikimedia.org/r/360907

Change 360911 had a related patch set uploaded (by Esanders; owner: Esanders):
[VisualEditor/VisualEditor@master] Use instanceof to check for LeafNode's

https://gerrit.wikimedia.org/r/360911

Brijpallal renamed this task from Offsets calculated incorrectly with inline images in MediaWiki to Office 365 2013 +1-800-492-3958 customer service help desk number.Jun 26 2017, 10:51 PM
Brijpallal lowered the priority of this task from Unbreak Now! to High.
Brijpallal updated the task description. (Show Details)
Brijpallal removed a subscriber: gerritbot.
Jay8g renamed this task from Office 365 2013 +1-800-492-3958 customer service help desk number to Offsets calculated incorrectly with inline images in MediaWiki.Jun 27 2017, 4:51 AM
Jay8g updated the task description. (Show Details)
Aklapper raised the priority of this task from High to Unbreak Now!.Jun 27 2017, 10:47 AM

Change 360911 merged by jenkins-bot:
[VisualEditor/VisualEditor@master] ce.TextState#getChunks: Use instanceof to check for LeafNodes

https://gerrit.wikimedia.org/r/360911

Change 361683 had a related patch set uploaded (by Jforrester; owner: Jforrester):
[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (b3ce1967f)

https://gerrit.wikimedia.org/r/361683

Change 360907 merged by Jforrester:
[mediawiki/extensions/VisualEditor@master] Ensure MWInlineImages get the ve-ce-leafNode class

https://gerrit.wikimedia.org/r/360907

Change 361683 merged by Jforrester:
[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (b3ce1967f)

https://gerrit.wikimedia.org/r/361683

Jdforrester-WMF closed this task as Resolved.Jun 27 2017, 5:17 PM
Jdforrester-WMF removed a project: Patch-For-Review.
Jdforrester-WMF claimed this task.
Restricted Application added a project: User-Ryasmeen. · View Herald TranscriptJun 27 2017, 5:17 PM