Bug 159876

Summary: Do not store gap and shift parameters on RenderMathMLFraction
Product: WebKit Reporter: Frédéric Wang (:fredw) <fred.wang>
Component: MathMLAssignee: Frédéric Wang (:fredw) <fred.wang>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, commit-queue, dbarton, esprehn+autocc, glenn, kondapallykalyan
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 159624    
Bug Blocks:    
Attachments:
Description Flags
Patch darin: review+

Description Frédéric Wang (:fredw) 2016-07-18 04:43:05 PDT
Follow-up of bug 159624. Gap and shift parameters are only used during layoutBlock so we do not need to store them on the renderer class. I'm going to split updateLayoutParameters into three helper functions: one to update thickness and two to retrieve fraction and stack parameters.
Comment 1 Frédéric Wang (:fredw) 2016-07-18 04:53:20 PDT
Created attachment 283899 [details]
Patch
Comment 2 Darin Adler 2016-07-18 10:04:46 PDT
Comment on attachment 283899 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=283899&action=review

> Source/WebCore/rendering/mathml/RenderMathMLFraction.cpp:125
> +        topShiftUp = bottomShiftDown = 0;

WebKit coding style normally frowns on this style of multiple assignments in a single expression.

> Source/WebCore/rendering/mathml/RenderMathMLFraction.h:63
> +    void getFractionParameters(LayoutUnit&, LayoutUnit&, LayoutUnit&, LayoutUnit&);
> +    void getStackParameters(LayoutUnit&, LayoutUnit&, LayoutUnit&);

Normally we’d include argument names in a case like this where the order of the arguments doesn’t make clear which is which. in fact, we could consider a version where these functions return structs instead, which eliminates the possibility of getting the order wrong.
Comment 3 Frédéric Wang (:fredw) 2016-07-18 22:38:48 PDT
https://trac.webkit.org/changeset/203395