Page MenuHomePhabricator

/rest_v1/page/html/ draws Vector's light-blue border in the middle of a page
Closed, ResolvedPublic

Description

Parsoid's HTML output, e.g. https://en.wikipedia.org/api/rest_v1/page/html/Parsing, has a blue border visible on the left and "bottom" that appears part-way down the page:

parsoid_blue_border_bug.png (368×473 px, 57 KB)

This comes from Parsoid requesting RL module skins.vector.styles, which incorporates Vector's components/common.less, which has:

html,
body {
    height: 100%;
...
}
/* Content */
.mw-body {
    margin-left: 10em;
    padding: @content-padding;
    /* Border on top, left, and bottom side */
    border: 1px solid @content-border-color;
    border-right-width: 0;
    /* Merge the border with tabs' one (in their background image) */
    margin-top: -1px;
   ...
}

There are two bugs here: a) somehow height: 100% ends up way less than the actual height of the article; b) the blue border on mw-body is pointless without Vector's grey mw-head, mw-panel sidebar, and footer. a) I can't figure out; the computed height seems always 409.5px in Firefox and 1028px in chromium. b) Parsoid has to use mw-body because of the way Vector/components/common.less is structured, so it needs to clear this border and maybe other properties, e.g. the wide left margin.

Event Timeline

Spage raised the priority of this task from to Needs Triage.
Spage updated the task description. (Show Details)
Spage subscribed.
Arlolra subscribed.

There are two bugs here:

a.1) somehow height: 100% ends up way less than the actual height of the article;
a.2) I can't figure out; the computed height seems always 409.5px in Firefox and 1028px in chromium.

This comes from Parsoid requesting RL module skins.vector.styles, which incorporates Vector's components/common.less, which has:

html,
body {
    height: 100%;
...
}

If I force the same .css settings locally, I get the same thing as described (getting viewport height rather than document height). Once I 'separate the two' and let <body> "use" either the agent's default(s) or let it inherit an attribute value from the root <html>'s setting(s), the quirky height dimensions stopped.

Frankly I can't see the point of 'making settings' that "high up'' in the document.structure unless its to force or override another setting for the 'remaining' document or something. Why bother to set height: to 100% when in this case that attribute carries a setting of auto to begin with?

This was closed as duplicate of T155863, but that task is resolved, and it seems like this task isn't (I still see a blue border in https://en.wikipedia.org/api/rest_v1/page/html/Parsing).

@matmarex Oh, sorry, I was going off of the comment you left here https://gerrit.wikimedia.org/r/#/c/158803/

Hm, I think I was also confused when writing that, these two bugs have a similar cause but they're not the same.

Change 347605 had a related patch set uploaded (by Arlolra):
[mediawiki/services/parsoid@master] T116508: Remove .mw-body from Parsoid content

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

Change 347605 merged by jenkins-bot:
[mediawiki/services/parsoid@master] T116508: Remove .mw-body from Parsoid content

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

Arlolra claimed this task.