Bug 34741

Summary: MathML Support for mfrac
Product: WebKit Reporter: Alex Milowski <alex>
Component: WebCore Misc.Assignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, fred.wang
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Mac (Intel)   
OS: OS X 10.5   
Bug Depends on:    
Bug Blocks: 3251    
Attachments:
Description Flags
The patch to add support for mfrac.
none
Updated the patch to the latest trunk and added other changes suggested
kenneth: review-
Updated mfrac implementation with custom painting of fraction line none

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.