Bug 120164 - Implement negative width for mspace
: Implement negative width for mspace
Status: NEW
Product: WebKit
Classification: Unclassified
Component: MathML
: 528+ (Nightly build)
: All All
: P2 Normal
Assigned To: Nobody
:
Depends on: 124841
Blocks: 115583
  Show dependency treegraph
 
Reported: 2013-08-22 11:04 PDT by Frédéric Wang (:fredw)
Modified: 2013-12-17 15:54 PST (History)
5 users (show)

See Also:


Attachments
Experimental Patch (10.81 KB, patch)
2013-08-22 11:04 PDT, Frédéric Wang (:fredw)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Frédéric Wang (:fredw) 2013-08-22 11:04:44 PDT
Created attachment 209380 [details]
Experimental Patch

Just opening this bug for the record and attaching an old experimental patch if someone wants to work on this. IIRC, one problem with that patch is that it caused an assert to be raised in the flexbox code. I also tried a simpler version that just removed

if (m_width < 0) {
   m_width = 0;
}

and I think this gave similar results. Both methods provided the expected rendering for the added reftests. One case that is not included in the tests is negative space in table cells:

...
            <mtd>
              <mspace width="2em" height="1em" mathbackground="red"></mspace>
              <mspace width="-1em"/>
              <mspace width="1em" height="1em" mathbackground="blue"></mspace>
            </mtd>
...

that can't work because <mtd> has not a flexbox display but a table-cell display. I think the solution will be to add an anonymous flexbox as a child of the mtd element.