Bug 156571 - RenderMathMLOperator: Move glyph measuring helper functions outside the class
Summary: RenderMathMLOperator: Move glyph measuring helper functions outside the class
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:
Blocks: 152244
  Show dependency treegraph
 
Reported: 2016-04-14 01:49 PDT by Frédéric Wang (:fredw)
Modified: 2016-04-14 11:23 PDT (History)
10 users (show)

See Also:


Attachments
Patch (11.07 KB, patch)
2016-04-14 01:52 PDT, Frédéric Wang (:fredw)
no flags Details | Formatted Diff | Diff
Patch (11.71 KB, patch)
2016-04-14 02:12 PDT, Frédéric Wang (:fredw)
no flags Details | Formatted Diff | Diff
Patch (11.47 KB, patch)
2016-04-14 04:44 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-04-14 01:49:21 PDT
Another simple change extracted from bug 152244.

boundsForGlyph, heightForGlyph and advanceForGlyph are really just some convenient wrapper around GlyphData functions and RenderMathMLOperator is not involved. We can just implement them as inline static functions in the C++ source. They will just be moved to MathOperator.cpp in bug 152244.

Manuel also suggested renaming advanceForGlyph to advanceWidthForGlyph.
Comment 1 Frédéric Wang (:fredw) 2016-04-14 01:52:42 PDT
Created attachment 276382 [details]
Patch
Comment 2 Frédéric Wang (:fredw) 2016-04-14 02:12:02 PDT
Created attachment 276383 [details]
Patch
Comment 3 Manuel Rego Casasnovas 2016-04-14 02:39:30 PDT
Comment on attachment 276383 [details]
Patch

LGTM.

Not a strong opinion regarding the change in computePreferredLogicalWidths() if it should be done now or later, but I'm fine with it.
Comment 4 Alejandro G. Castro 2016-04-14 02:48:01 PDT
Comment on attachment 276383 [details]
Patch

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

> Source/WebCore/ChangeLog:18
> +        (WebCore::RenderMathMLOperator::findStretchyData): Renamed to advanceWidthForGlyph.

I read the function was renamed in the comment, maybe explain you are replacing the call.

> Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp:293
> -            float glyphWidth = advanceForGlyph(data);
> +            float glyphWidth = data.isValid() ? data.font->widthForGlyph(data.glyph) : 0;

Should we add it to the API then of the new file because we need to use it?
Comment 5 Frédéric Wang (:fredw) 2016-04-14 04:44:30 PDT
Created attachment 276388 [details]
Patch
Comment 6 Frédéric Wang (:fredw) 2016-04-14 11:23:47 PDT
Committed r199547: <http://trac.webkit.org/changeset/199547>