Bug 34741 - MathML Support for mfrac
Summary: MathML Support for mfrac
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Macintosh Intel OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks: 3251
  Show dependency treegraph
 
Reported: 2010-02-08 21:06 PST by Alex Milowski
Modified: 2010-03-22 10:20 PDT (History)
2 users (show)

See Also:


Attachments
The patch to add support for mfrac. (74.45 KB, patch)
2010-02-08 21:06 PST, Alex Milowski
no flags Details | Formatted Diff | Diff
Updated the patch to the latest trunk and added other changes suggested (76.89 KB, patch)
2010-03-03 14:49 PST, Alex Milowski
kenneth: review-
Details | Formatted Diff | Diff
Updated mfrac implementation with custom painting of fraction line (109.14 KB, patch)
2010-03-22 08:23 PDT, Alex Milowski
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Milowski 2010-02-08 21:06:36 PST
Created attachment 48393 [details]
The patch to add support for mfrac.

This patch adds support for non-beveled fractions for the MathML mfrac element.  There is basic support for the fraction line thickness.
Comment 1 Alex Milowski 2010-03-03 14:49:43 PST
Created attachment 49951 [details]
Updated the patch to the latest trunk and added other changes suggested 

I also added some changes suggested by Sausset François.
Comment 2 Kenneth Rohde Christiansen 2010-03-13 10:28:47 PST
Comment on attachment 49951 [details]
Updated the patch to the latest trunk and added other changes suggested 


> +    if (lastChild())
> +        if (lastChild()->isRenderBlock()) {
> +            RenderBlock* denominator = toRenderBlock(lastChild());
> +            int previousWidth = denominator->style()->borderTopWidth();
> +            int borderWidth = static_cast<int>(ceil(gFractionBarWidth * style()->fontSize()));
> +            denominator->style()->setBorderTopWidth(previousWidth * borderWidth);
> +        }
> +    
> +    if (previousSibling())
> +        if (previousSibling()->isRenderBlock()) {
> +            RenderBlock* sibling = toRenderBlock(previousSibling());
> +            verticalAlignCompute(sibling);
> +            RenderBlock::layout();
> +            return;
> +        }
> +    if (nextSibling())
> +        if (nextSibling()->isRenderBlock()) {
> +            RenderBlock* sibling = toRenderBlock(nextSibling());
> +            verticalAlignCompute(sibling);
> +        }
> +    

The above is against our coding style. An if with contents (comments included) spanding more than one line should use {}
Comment 3 Alex Milowski 2010-03-22 08:23:56 PDT
Created attachment 51291 [details]
Updated mfrac implementation with custom painting of fraction line
Comment 4 Kenneth Rohde Christiansen 2010-03-22 09:58:33 PDT
Comment on attachment 51291 [details]
Updated mfrac implementation with custom painting of fraction line

Looks good!
Comment 5 WebKit Commit Bot 2010-03-22 10:20:52 PDT
Comment on attachment 51291 [details]
Updated mfrac implementation with custom painting of fraction line

Clearing flags on attachment: 51291

Committed r56340: <http://trac.webkit.org/changeset/56340>
Comment 6 WebKit Commit Bot 2010-03-22 10:20:58 PDT
All reviewed patches have been landed.  Closing bug.