Page MenuHomePhabricator

Provide data-section-offsets with HTML and WT offsets for immediate children of <body>
Closed, ResolvedPublic

Description

For T94890, RESTBase needs the HTML offsets for top-level children of <body> so that those elements can be edited in isolation (in VE, mobile editing, etc.). It should be possible to gather these offsets relatively easily in the XMLSerialization code.

The proposal right now is to return a new json blob, data-section-offsets:

{ 
  mwxxx: { 
    wt: [183,235], 
    html: [384,568] 
  }, 
  ....
}

Alternatively, this info could be folded into a separate section_offsets object in data-parsoid, which would be documented as a public API.

Event Timeline

ssastry created this task.Apr 16 2015, 5:50 PM
ssastry raised the priority of this task from to Normal.
ssastry updated the task description. (Show Details)
ssastry added a project: Parsoid.
ssastry added a subscriber: ssastry.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptApr 16 2015, 5:50 PM
ssastry moved this task from Backlog to In Progress on the Parsoid board.Apr 16 2015, 5:51 PM

From IRC:

11:09:09 +gwicke another option could be to document parts of data-parsoid
11:09:27 +subbu this is a different blob altogether .. so not strictly data-parsoid.
11:09:36 +subbu so, can be documented separately.
11:09:59 +gwicke the wt offset info overlaps with data-parsoid
11:10:10 +subbu can call it data-section-offsets maybe?
11:10:41 +subbu yes, it does. but, that part is trivial to document. i didn't fully understand your concern about documentation.
11:10:53 +gwicke it means another set of API end points
11:11:42 +gwicke not a big issue now, could just become a bit unwieldy if we continue to spawn more of those in the future

GWicke renamed this task from Provide data-parsoid-offsets with HTML and WT offsets for immediate children of <body> to Provide data-section-offsets with HTML and WT offsets for immediate children of <body>.Apr 16 2015, 6:13 PM
GWicke set Security to None.
GWicke updated the task description. (Show Details)
GWicke updated the task description. (Show Details)Apr 16 2015, 6:17 PM
GWicke updated the task description. (Show Details)
ssastry raised the priority of this task from Normal to High.Apr 20 2015, 5:23 PM
Arlolra claimed this task.Apr 28 2015, 6:48 PM

We realized that the offsets should be relative to <body> so that RESTBase doesn't have to compensate for any headers it adds to <head> on its end.

Change 209253 had a related patch set uploaded (by Arlolra):
WIP: Provide section-offsets for immediate children of <body>

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

Change 209253 merged by jenkins-bot:
Provide section-offsets for immediate children of <body>

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

Arlolra closed this task as Resolved.May 18 2015, 5:38 PM