RESOLVED FIXED 155406
MathMLMencloseElement style should not depend on rendering
https://bugs.webkit.org/show_bug.cgi?id=155406
Summary MathMLMencloseElement style should not depend on rendering
Antti Koivisto
Reported 2016-03-13 04:38:32 PDT
Style shouldn't depend on rendering.
Attachments
patch (3.56 KB, patch)
2016-03-13 04:43 PDT, Antti Koivisto
no flags
Antti Koivisto
Comment 1 2016-03-13 04:43:05 PDT
Frédéric Wang (:fredw)
Comment 2 2016-03-13 04:52:49 PDT
See also the complete refactoring in bug 155019, that will probably make this unnecessary.
Antti Koivisto
Comment 3 2016-03-13 05:57:27 PDT
Yeah, looks much better. We could probably just disable mathml/presentation/menclose-notation-attribute-change-value.html until that lands.
Frédéric Wang (:fredw)
Comment 4 2016-03-13 06:03:33 PDT
(In reply to comment #3) > Yeah, looks much better. We could probably just disable > mathml/presentation/menclose-notation-attribute-change-value.html until that > lands. Yes, I guess we can do it either way. Just disabling that test is probably the easiest way so that it does not block the work on bug 155298.
Darin Adler
Comment 5 2016-03-13 14:31:44 PDT
Comment on attachment 273889 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=273889&action=review > Source/WebCore/mathml/MathMLMencloseElement.cpp:134 > String closingBrace(")", String::ConstructFromLiteral); > TextRun run(closingBrace); We do not need a String to construct a TextRun, which takes a StringView. We can write something more like this: LChar rightParenthesis = ')'; TextRun run({ &rightParenthesis, 1 }); I took the liberty of calling this what the Unicode standard calls it, rather than calling it "closing brace", which seems like it could be the name of some other characters. > Source/WebCore/mathml/MathMLMencloseElement.cpp:136 > + const FontCascade& font = parentStyle.fontCascade(); > + padding.appendNumber(font.width(run)); I don’t think we need a local variable when we are just using it once. In fact, I would write this: LChar rightParenthesis = ')'; padding.appendNumber(parentStyle.fontCascade().width(TextRun{ &rightParenthesis, 1 })); Might need an extra type name or set of curly brackets in there, but something like that would work. The version with more lines of code seems no more clear to me. > Source/WebCore/mathml/MathMLMencloseElement.cpp:143 > +String MathMLMencloseElement::longDivLeftPadding() const This could return a const String& instead of a String to avoid unneeded reference count churn.
Darin Adler
Comment 6 2016-03-13 14:32:14 PDT
Oh, I see, this code is going away. Oops, my comments are overkill.
Frédéric Wang (:fredw)
Comment 7 2016-07-07 08:42:44 PDT
Resolving since this was fixed by https://trac.webkit.org/changeset/199980
Note You need to log in before you can comment on or make changes to this bug.