WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
43819
MathML: nested square root symbols have varying descenders
https://bugs.webkit.org/show_bug.cgi?id=43819
Summary
MathML: nested square root symbols have varying descenders
David Kilzer (:ddkilzer)
Reported
2010-08-10 17:24:14 PDT
Created
attachment 64057
[details]
Test case * SUMMARY When loading the attached test case, the bottom of the square root symbols different in how far below the baseline they're drawn. This seems like a bug. * STEPS TO REPRODUCE 1. Open the attached test case on a WebKit nightly build. * RESULTS Note that the "descender" of the square root symbol varies depending on which one you look at. * REGRESSION N/A
Attachments
Test case
(1.21 KB, application/xhtml+xml)
2010-08-10 17:24 PDT
,
David Kilzer (:ddkilzer)
no flags
Details
mroot & msubsup test case
(770 bytes, text/html)
2012-05-16 08:32 PDT
,
Dave Barton
no flags
Details
Patch
(5.58 KB, patch)
2012-05-16 08:43 PDT
,
Dave Barton
no flags
Details
Formatted Diff
Diff
Patch
(1.03 MB, patch)
2012-06-15 22:20 PDT
,
Dave Barton
no flags
Details
Formatted Diff
Diff
Patch
(1.03 MB, patch)
2012-06-21 22:59 PDT
,
Dave Barton
eric
: review+
webkit.review.bot
: commit-queue-
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
François Sausset
Comment 1
2010-08-11 00:34:42 PDT
In the test case, only the first and the last root are problematic. For the left one, the problem is known and it is due to the fact that you have more than one element inside mroot/msqrt. To fix it, we have to implement inferred mrow that will wrap around the child elements. The implementation was planned and I hope to have time to do it soon. For the right root, I'll investigate.
François Sausset
Comment 2
2010-08-11 01:48:32 PDT
The problem for the square root around the "A" (the one on the right) is only appearing with STIX fonts and not with Apple Symbol one. Strange... The problem due to the lack of the inferred mrow implementation is font independent, as expected.
Alex Milowski
Comment 3
2010-10-17 12:47:11 PDT
I believe this has been address by the patch from
Bug 43588
. Can you please test again and let me know if you accept the rendering?
François Sausset
Comment 4
2010-10-18 02:32:30 PDT
(In reply to
comment #3
)
> I believe this has been address by the patch from
Bug 43588
. Can you please test again and let me know if you accept the rendering?
Indeed, the problem is now solved by this patch when using Apple Symbols font. With STIX fonts, the different problem occurring around the "A" in the test is still there, but it should be solved by a patch that I have in preparation.
Dave Barton
Comment 5
2012-05-08 18:16:15 PDT
This appears fixed now to me, probably due to the fix for
bug 83736
. At least the right radical is now shorter, and the left radicals grow by design. Note that TeX also has large radical signs have larger descenders like this, though Firefox does not. Any objections to closing this bug?
Dave Barton
Comment 6
2012-05-16 08:32:55 PDT
Created
attachment 142269
[details]
mroot & msubsup test case msqrt descenders seem ok in the latest nightlies, but mroot ones are not! Here are some examples from a couple of mathml LayoutTests. It's tricky to catch this, because in DumpRenderTree these examples look fine. This is explained in the ChangeLog for the patch I'm about to upload - RenderInline::offsetHeight() for a text span in the font STIXGeneral 16, for instance, may have an offsetHeight() of 24 in e.g. Safari or Chrome.
Dave Barton
Comment 7
2012-05-16 08:43:04 PDT
Created
attachment 142272
[details]
Patch
mitz
Comment 8
2012-05-16 08:50:29 PDT
Comment on
attachment 142272
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=142272&action=review
> Source/WebCore/ChangeLog:15 > + This is hard to troubleshoot because for the STIXGeneral font, DumpRenderTree returns a > + similar result either way, whereas Safari and Chrome for instance may return much > + different values. This can be seen by looking at the existing test files roots.xhtml and
Why does WebKit behavior differ between Safari and DumpRenderTree?
mitz
Comment 9
2012-05-16 08:52:16 PDT
(In reply to
comment #8
)
> (From update of
attachment 142272
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=142272&action=review
> > > Source/WebCore/ChangeLog:15 > > + This is hard to troubleshoot because for the STIXGeneral font, DumpRenderTree returns a > > + similar result either way, whereas Safari and Chrome for instance may return much > > + different values. This can be seen by looking at the existing test files roots.xhtml and > > Why does WebKit behavior differ between Safari and DumpRenderTree?
Does STIX need to be added to allowedFontFamilySet() in DumpRenderTree.mm (and the corresponding set in WebKitTestRunner)?
Dave Barton
Comment 10
2012-05-16 09:02:59 PDT
> Why does WebKit behavior differ between Safari and DumpRenderTree?
> Does STIX need to be added to allowedFontFamilySet() in DumpRenderTree.mm (and the corresponding set in WebKitTestRunner)?
Thanks for asking yourself these questions so I didn't have to! :) Seriously, this is why I added you to this bug, and I greatly appreciate your expert help. I will investigate this given your pointers, or any other info you experts think I need ...
Dave Barton
Comment 11
2012-05-21 09:10:14 PDT
Comment on
attachment 142272
[details]
Patch I am reworking the patch using { -webkit-line-box-contain: glyphs replaced } - see <
http://dev.w3.org/csswg/css3-linebox/#LineStacking
>. This is exciting, and seems clearly to be the right approach for MathML rendering, but it does change several things.
Dave Barton
Comment 12
2012-06-15 22:20:46 PDT
Created
attachment 147950
[details]
Patch
Julien Chaffraix
Comment 13
2012-06-21 14:47:58 PDT
Comment on
attachment 147950
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=147950&action=review
Global comments as I don't the line box layout much.
> Source/WebCore/rendering/mathml/RenderMathMLBlock.h:79 > + virtual LayoutUnit baselinePosition(FontBaseline, bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const;
OVERRIDE
> Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp:334 > +PassRefPtr<RenderStyle> RenderMathMLOperator::createStackableStyle(int /* lineHeight */, int maxHeightForRenderer, int topRelative)
Nit: Just remove the parameter name |lineHeight| and move the FIXME to the function declaration.
> Source/WebCore/rendering/mathml/RenderMathMLRoot.cpp:170 > - int baseHeight = roundToInt(getBoxModelObjectHeight(firstChild())); > + int baseHeight = contentLogicalHeight();
You still need to round contentLogicalHeight as it returns a LayoutUnit.
> Source/WebCore/rendering/mathml/RenderMathMLSubSup.cpp:149 > + LayoutUnit baseWrapperBaseline = toRenderBox(firstChild())->firstLineBoxBaseline();
You can use: baseWrapper->firstLineBoxBaseline()
> Source/WebCore/rendering/mathml/RenderMathMLSubSup.cpp:150 > + LayoutUnit baseBaseline = baseWrapperBaseline - baseWrapper->paddingTop();
For consistency with the rest of the code who is writing-mode aware, it should be paddingBefore. Note that the rest of the code doesn't look really 100% writing mode proof so it shouldn't block the patch but at least that avoids one issue.
> Source/WebCore/rendering/mathml/RenderMathMLSubSup.cpp:153 > + LayoutUnit superscriptHeight = superscriptWrapper->logicalHeight() - superscriptWrapper->paddingBottom();
Same comment as above it should be paddingAfter()
> Source/WebCore/rendering/mathml/RenderMathMLUnderOver.cpp:158 > + /* fall through */
For one line comment, WebKit uses // not /* */ This is very weird that over uses the under computation. I would have expected the other around for UnderOver.
Dave Barton
Comment 14
2012-06-21 22:51:00 PDT
Comment on
attachment 147950
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=147950&action=review
Thanks as always for the review, Julien! Sorry this patch looks so big, but hopefully it will be the last one to rebaseline all the MathML tests for a while.
>> Source/WebCore/rendering/mathml/RenderMathMLSubSup.cpp:149 >> + LayoutUnit baseWrapperBaseline = toRenderBox(firstChild())->firstLineBoxBaseline(); > > You can use: baseWrapper->firstLineBoxBaseline()
That doesn't compile: RenderBlock.h:425: error: 'virtual WebCore::LayoutUnit WebCore::RenderBlock::firstLineBoxBaseline() const' is protected
>> Source/WebCore/rendering/mathml/RenderMathMLUnderOver.cpp:158 >> + /* fall through */ > > For one line comment, WebKit uses // not /* */ > > This is very weird that over uses the under computation. I would have expected the other around for UnderOver.
To compute the UnderOver baseline, one must use the base's baseline in any case, plus the overscript's height if it exists.
Dave Barton
Comment 15
2012-06-21 22:59:02 PDT
Created
attachment 148962
[details]
Patch
Eric Seidel (no email)
Comment 16
2012-08-01 16:09:29 PDT
Comment on
attachment 148962
[details]
Patch LGTM. Thanks.
Eric Seidel (no email)
Comment 17
2012-08-01 16:09:56 PDT
Sorry this got ignore so long. I've not been watching teh general review queue as closely as I should be.
WebKit Review Bot
Comment 18
2012-08-01 16:12:20 PDT
Comment on
attachment 148962
[details]
Patch Rejecting
attachment 148962
[details]
from commit-queue. Failed to run "['/mnt/git/webkit-commit-queue/Tools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '-..." exit_code: 2 Last 500 characters of output: cted.txt patching file LayoutTests/platform/mac/mathml/presentation/tables-expected.txt patching file LayoutTests/platform/mac/mathml/presentation/tokenElements-expected.txt patching file LayoutTests/platform/mac/mathml/presentation/under-expected.txt patching file LayoutTests/platform/mac/mathml/presentation/underover-expected.txt Failed to run "[u'/mnt/git/webkit-commit-queue/Tools/Scripts/svn-apply', u'--force', u'--reviewer', u'Eric Seidel']" exit_code: 1 cwd: /mnt/git/webkit-commit-queue/ Full output:
http://queues.webkit.org/results/13415354
Dave Barton
Comment 19
2012-08-02 13:33:08 PDT
Thanks for the r+! I'll merge in the couple test rebaselines from
bug 91677
and then try to land the result.
Dave Barton
Comment 20
2012-08-02 15:35:00 PDT
Committed
r124512
: <
http://trac.webkit.org/changeset/124512
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug