WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
125597
mo text does not appear in dumpAsText output
https://bugs.webkit.org/show_bug.cgi?id=125597
Summary
mo text does not appear in dumpAsText output
Frédéric Wang (:fredw)
Reported
2013-12-11 12:03:29 PST
Try to call DumpRenderTree on the attached testcase. You'll get the "mtext" text but not the "mo" text.
Attachments
testcase
(185 bytes, text/html)
2013-12-11 12:50 PST
,
Frédéric Wang (:fredw)
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
Frédéric Wang (:fredw)
Comment 1
2013-12-11 12:48:12 PST
I'm moving this to Tools/Tests as I think that's something that could be fixed in rendering/RenderTreeAsText.cpp or similar. Any suggestion for how to do that would be welcome.
Frédéric Wang (:fredw)
Comment 2
2013-12-11 12:50:27 PST
Created
attachment 218996
[details]
testcase
Darin Adler
Comment 3
2013-12-12 21:11:04 PST
RenderTreeAsText.cpp is only used when you do *not* call dumpAsText. The testRunner.dumpAsText feature is implemented with the DOM innerText function, so there is not necessarily a way to fix this without changing the behavior of the DOM. The innerText function, in turn, is based on the text iterator in TextIterator.cpp, which is the same code used for things like converting a selection to plain text on the clipboard when you select and copy something, or searching for text with the browser’s find command. So this is likely a bug in the MathML implementation and not a tools issue, assuming that we want text from inside an <mo> to be copyable and searchable, etc. The text iterator primarily iterates the DOM and not the render tree. It does not have any code to dig inside of the kind of render tree that RenderMathMLOperator::updateFromElement builds. We could add code for that, or we could simply add special case code to TextIterator::handleNonTextNode to handle RenderMathMLOperator specially.
Frédéric Wang (:fredw)
Comment 4
2013-12-13 02:09:49 PST
Thank you Darin. Indeed, the patch for
bug 124838
seems to break text selection of token elements. So I'll have to check what text iterator is doing and how it could handle MathML text better.
Frédéric Wang (:fredw)
Comment 5
2013-12-13 08:45:27 PST
Changing the direction of the dependency since I'll probably fix the issue while doing the refactoring code of MathML token elements. Some test references are currently incorrect with the <mo> text not appearing in the expected output.
Darin Adler
Comment 6
2013-12-13 09:30:12 PST
(In reply to
comment #4
)
> Indeed, the patch for
bug 124838
seems to break text selection of token elements.
That is an even-more-fundamental issue with the same underlying cause: A render tree that is not linked to a DOM tree in the usual way. Text selection is done by other editing code and is not handled by the text iterator, so text iterator changes will not fix that. We may need to use a shadow DOM approach as elements like the slider do rather than just creating a set of renderers. Not really my area of expertise.
Frédéric Wang (:fredw)
Comment 7
2013-12-13 09:41:16 PST
(In reply to
comment #6
)
> (In reply to
comment #4
) > > Indeed, the patch for
bug 124838
seems to break text selection of token elements. > > That is an even-more-fundamental issue with the same underlying cause: A render tree that is not linked to a DOM tree in the usual way. Text selection is done by other editing code and is not handled by the text iterator, so text iterator changes will not fix that. > > We may need to use a shadow DOM approach as elements like the slider do rather than just creating a set of renderers. Not really my area of expertise.
Yes, I've been able to get something for the text output but not the selection. If that's too complicated, I'll first try to do the refactoring that is necessary for 99620 on the mo element only and come back to this later.
Frédéric Wang (:fredw)
Comment 8
2016-02-05 06:09:19 PST
On Alex's MathMLLayout branch, DumpRenderTree on the testcase now generates the expected "mo" test. Actually, the MathML layout code no longer uses any anonymous nodes for RenderMathMLOperator / RenderMathMLToken, instead we just different measuring / painting functions when necessary.
Frédéric Wang (:fredw)
Comment 9
2016-06-24 23:59:55 PDT
Fixed after
r202420
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