Page MenuHomePhabricator

Should we flatten spans in summary output
Closed, ResolvedPublic

Description

In https://gerrit.wikimedia.org/r/#/c/372875/ @bearND pondered whether we should remove superfluous spans from the summary output.

Benefits:

  • Simplified HTML

Cons:

  • Will this cause rendering issues for math elements or any other HTML?

Related Objects

Event Timeline

@Jdlrobson @bearND does this mean we need to do investigation on the effects?

(note: currently this would not affect apps as they use the plain text)

@Jdlrobson @bearND ping

What needs to be done here and who needs to do it?

it isn't clear from the task name/description who is responsible or if this is blocking any other work.

We need to have a conversation about whether to do this. Next services sync or tech lead sync.

bearND lowered the priority of this task from High to Low.Oct 6 2017, 5:23 AM

Since it's more a payload optimization we can lower the priority of this. I don't understand why it was high to begin with.

kaldari removed a subscriber: kaldari.Oct 6 2017, 5:36 AM
Jdlrobson lowered the priority of this task from Low to Lowest.Nov 7 2017, 8:07 PM

If we don't have a strong motivation to do this I'd be inclined to decline or at least mark to "Lowest" to signal we'll accept patches but we won't be actively pursuing this. Payload optimisation is a micro-optimisation and doesn't seem worth the effort right now.

Any issues with that @bearND ?

bearND added a comment.Nov 8 2017, 3:09 AM

No issues.

Change 403977 had a related patch set uploaded (by BearND; owner: BearND):
[mediawiki/services/mobileapps@master] Flatten DOM anchors if no attributes kept

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

bearND added a comment.EditedJan 12 2018, 6:57 PM

When creating this patch I was also thinking if we should also keep inline style attributes. Thoughts?

When creating this patch I was also thinking if we should also keep inline style attributes. Thoughts?

This is a tricky one. My gut feeling is that yes, we should keep inline style attributes. Consider the sfrac template, used on a bunch of scientific pages:

{{sfrac|1|2}}

yields

<span class="sfrac nowrap" style="display:inline-block; vertical-align:-0.5em; font-size:85%; text-align:center;">
  <span style="display:block; line-height:1em; margin:0 0.1em;">1</span>
  <span class="visualhide">/</span>
  <span style="display:block; line-height:1em; margin:0 0.1em; border-top:1px solid;">2</span>
</span>

None of the above elements, classes, or inline styles is superfluous.

Change 404496 had a related patch set uploaded (by BearND; owner: BearND):
[mediawiki/services/mobileapps@master] Also keep style attributes when flattening elements

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

@phuedx @Jdlrobson Ok, I've added another patch to keep the style attributes, too.

Change 403977 merged by jenkins-bot:
[mediawiki/services/mobileapps@master] Flatten DOM anchors if no attributes kept

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

Change 404496 merged by jenkins-bot:
[mediawiki/services/mobileapps@master] Also keep style attributes when flattening elements

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

Stashbot added a subscriber: Stashbot.

Mentioned in SAL (#wikimedia-operations) [2018-01-18T18:40:32Z] <bsitzmann@tin> Started deploy [mobileapps/deploy@669fb5b]: Update mobileapps to 2690899 (T184328 T184557 T177007 T184669 T177430 T185050)

Mentioned in SAL (#wikimedia-operations) [2018-01-18T18:47:35Z] <bsitzmann@tin> Finished deploy [mobileapps/deploy@669fb5b]: Update mobileapps to 2690899 (T184328 T184557 T177007 T184669 T177430 T185050) (duration: 07m 03s)

bearND closed this task as Resolved.
bearND claimed this task.