[Webkit-unassigned] [Bug 118053] Parsing of MathML length

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jun 26 23:11:14 PDT 2013


https://bugs.webkit.org/show_bug.cgi?id=118053





--- Comment #11 from Frédéric Wang <fred.wang at free.fr>  2013-06-26 23:13:10 PST ---
I can do whatever to preserve consistency with other code in WebKit but my point is that this MathML parsing is a bit special because of how the default value is handled. So basically do we want to do

float v;
float v2 = ParseLength(s, default value, b);
if (b) {
  v = v2;
  [...]
} [ else {
  ...
}]

or just

float v = default value;
[if] ParseLength(s, v, b) [... else ...]

where the brackets are optional parts when we really do something with the boolean success/failure. I personally prefer the concise form, especially if we are to use the function everywhere in the MathML code. I just did a grep on Gecko, and it's true that it is not used that much but that's still about 20 times (and more will probably come with implementation of e.g. elementary math):

nsMathMLFrame.cpp:nsMathMLFrame::ParseNumericValue(const nsString&   aString,
nsMathMLFrame.cpp:  if (!nsMathMLElement::ParseNumericValue(aString, cssValue, aFlags,
nsMathMLmfracFrame.cpp:      ParseNumericValue(aThicknessAttribute, &lineThickness,
nsMathMLmmultiscriptsFrame.cpp:    ParseNumericValue(value, &mSubScriptShift, 0, PresContext(),
nsMathMLmmultiscriptsFrame.cpp:    ParseNumericValue(value, &mSupScriptShift, 0, PresContext(),
nsMathMLmoFrame.cpp:    if (nsMathMLElement::ParseNumericValue(value, cssValue, 0,
nsMathMLmoFrame.cpp:    if (nsMathMLElement::ParseNumericValue(value, cssValue, 0,
nsMathMLmoFrame.cpp:    if (nsMathMLElement::ParseNumericValue(value, cssValue,
nsMathMLmoFrame.cpp:    if (nsMathMLElement::ParseNumericValue(value, cssValue,
nsMathMLmpaddedFrame.cpp:    if (nsMathMLElement::ParseNumericValue(number, aCSSValue, 
nsMathMLmspaceFrame.cpp:    ParseNumericValue(value, &mWidth,
nsMathMLmspaceFrame.cpp:    ParseNumericValue(value, &mHeight, 0,
nsMathMLmspaceFrame.cpp:    ParseNumericValue(value, &mDepth, 0,
nsMathMLmsubFrame.cpp:    ParseNumericValue(value, &subScriptShift, 0, PresContext(), mStyleContext);
nsMathMLmsubsupFrame.cpp:    ParseNumericValue(value, &subScriptShift, 0, PresContext(), mStyleContext);
nsMathMLmsubsupFrame.cpp:    ParseNumericValue(value, &supScriptShift, 0, PresContext(), mStyleContext);
nsMathMLmsupFrame.cpp:    ParseNumericValue(value, &supScriptShift, 0, PresContext(), mStyleContext);
nsMathMLElement.cpp:      ParseNumericValue(value->GetStringValue(), *scriptMinSize,
nsMathMLElement.cpp:      if (!ParseNumericValue(str, *fontSize, PARSE_SUPPRESS_WARNINGS |
nsMathMLElement.cpp:        ParseNumericValue(value->GetStringValue(), *width, 0,

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list