Bug 157943 - Small improvements to RenderBox/LayoutUnit casting in MathML
Summary: Small improvements to RenderBox/LayoutUnit casting in MathML
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: MathML (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Frédéric Wang (:fredw)
URL:
Keywords:
Depends on: 153208 153742 153917
Blocks:
  Show dependency treegraph
 
Reported: 2016-05-20 06:16 PDT by Frédéric Wang (:fredw)
Modified: 2016-05-26 02:16 PDT (History)
7 users (show)

See Also:


Attachments
Patch (5.97 KB, patch)
2016-05-20 06:23 PDT, Frédéric Wang (:fredw)
darin: review+
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) 2016-05-20 06:16:18 PDT
This is a small follow-up of the ​RenderMathMLRow/​RenderMathMLUnderOver/​RenderMathMLFraction refactoring. Since these MathML renderers can only contain other MathML renderers, we can just considerer RenderBox children and prevent unnecessary casts. Similarly, when the two arguments of std::max are LayoutUnit's, we do not need to specialize to std::max<LayoutUnit>.
Comment 1 Frédéric Wang (:fredw) 2016-05-20 06:23:50 PDT
Created attachment 279480 [details]
Patch
Comment 2 Darin Adler 2016-05-24 09:03:02 PDT
Comment on attachment 279480 [details]
Patch

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

> Source/WebCore/rendering/mathml/RenderMathMLUnderOver.cpp:58
> +    RenderBox* base = firstChildBox();

Typically in new code, we would use auto* here instead of writing RenderBox*.

> Source/WebCore/rendering/mathml/RenderMathMLUnderOver.cpp:78
> +    for (RenderBox* child = firstChildBox(); child; child = child->nextSiblingBox()) {

Ditto.
Comment 3 Frédéric Wang (:fredw) 2016-05-26 02:16:18 PDT
https://trac.webkit.org/changeset/201418