Closed
Bug 1066554
Opened 11 years ago
Closed 11 years ago
[shadow-dom] The mathml.css stylesheet is not loaded when inserting shadow MathML
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla35
People
(Reporter: fredw, Assigned: jkitch)
References
()
Details
(Keywords: regression)
Attachments
(3 files, 4 obsolete files)
|
765 bytes,
text/html
|
Details | |
|
989 bytes,
text/html
|
Details | |
|
10.47 KB,
patch
|
Details | Diff | Splinter Review |
In the attached testcase, if you click "insert Shadow Math" you see a "X^X" formula with the exponent that incorrectly has the same size as the base. If you click "insert Math", you then get the correct rendering for the shadow formula. This would suggest that mathml.css (which contains -moz-increment-script-level rules) is not loaded when inserting Shadow Math.
This used to work in Gecko 31 but is broken in nightly. I haven't tried to find a regression window, but bug 946065 might be a candidate.
Note: the use case was for the <x-tex> custom element http://fred-wang.github.io/TeXZilla/examples/customElement.html
Comment 1•11 years ago
|
||
My guess is that some code uses GetCurrentDoc() which is null for shadow dom.
It should use GetComposedDoc().
Where do we start loading mathml.css?
Comment 2•11 years ago
|
||
Oh, maybe it is a different issue
http://mxr.mozilla.org/mozilla-central/source/dom/mathml/nsMathMLElement.cpp#92
See bug 1062578.
Could you test the patch in that bug?
| Assignee | ||
Comment 3•11 years ago
|
||
Last good revision: f5232023af37
First bad revision: a2f0e0619332
Pushlog:
https://hg.mozilla.org/integration/mozilla-inbound/pushloghtml?fromchange=f52320
23af37&tochange=a2f0e0619332
| Reporter | ||
Comment 4•11 years ago
|
||
(In reply to Olli Pettay [:smaug] from comment #2)
> See bug 1062578.
> Could you test the patch in that bug?
No, that does not seem to help :-(
(In reply to James Kitchener from comment #3)
> https://hg.mozilla.org/integration/mozilla-inbound/pushloghtml?fromchange=f5232023af37&tochange=a2f0e0619332
So maybe bug 992521...
| Assignee | ||
Comment 5•11 years ago
|
||
The attached patch seems to fix it, however I do not know that bit of code well enough to be confident of correctness.
https://tbpl.mozilla.org/?tree=Try&rev=ce7b4a241b9d
Comment 6•11 years ago
|
||
Please retest on top of the patch for bug 1062578?
Comment 7•11 years ago
|
||
And in particular, we need a clear understanding of what exactly the nsIDocument argument to BindToTree is supposed to mean in the Shadow DOM world. Just changing it ad-hoc in one particular spot definitely seems wrong.
Flags: needinfo?(wchen)
Comment 8•11 years ago
|
||
The nsIDocument passed to BindToTree is currently the uncomposed document, so it will be null for elements in a shadow tree.
Flags: needinfo?(wchen)
Comment 9•11 years ago
|
||
OK. Then we should probably change the mathml stylesheet loading bits somehow to look at the composed doc...
| Reporter | ||
Comment 10•11 years ago
|
||
OK, of course I should have said that before but we probably want something similar for other UA stylesheets:
http://dxr.mozilla.org/mozilla-central/search?q=EnsureOnDemandBuiltInUASheet
(mmmh, BTW shouldn't SVGDocument::EnsureNonSVGUserAgentStyleSheetsLoaded also load the MathML stylesheet? That is, can we use a MathML document to do something like bug 1016145?)
Comment 11•11 years ago
|
||
> shouldn't SVGDocument::EnsureNonSVGUserAgentStyleSheetsLoaded also load the MathML
> stylesheet
No, since we have other codepaths that will load the mathml bits on demand.
| Assignee | ||
Comment 12•11 years ago
|
||
The initial patch was very wrong. The attached patch follows the suggestion from comment 9.
The effects should be limited to MathML elements. Other issues involving SVG/XUL-specific stylesheets I would prefer to leave to someone with more experience in that area.
Attachment #8488984 -
Flags: review?(bzbarsky)
| Assignee | ||
Comment 13•11 years ago
|
||
The patch wasn't refreshed before submission.
nsMathMLElement::UnbindFromTree() now uses the composed document as well to be consistent.
Attachment #8488600 -
Attachment is obsolete: true
Attachment #8488984 -
Attachment is obsolete: true
Attachment #8488984 -
Flags: review?(bzbarsky)
Attachment #8488985 -
Flags: review?(bzbarsky)
Comment 14•11 years ago
|
||
Comment on attachment 8488985 [details] [diff] [review]
patch
Please don't change the link-update behavior; that stuff should be done in concert with other link-related code that assumes certain behavior from bind/unbind.
And it really would be good to fix the other EnsureOnDemandBuiltInUASheet consumers too. They should need pretty identical changes. If you're not willing to do that, at the very least make sure there are followup bugs filed on them.
Attachment #8488985 -
Flags: review?(bzbarsky) → review-
| Assignee | ||
Comment 15•11 years ago
|
||
Review comments have been addressed.
If the XUL and SVG changes require their own tests, I'll split them off into followup bugs.
Assignee: nobody → jkitch.bug
Attachment #8488985 -
Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #8490024 -
Flags: review?(bzbarsky)
| Reporter | ||
Comment 16•11 years ago
|
||
For the tests, you might also consider == reftests if that's easier (normal DOM vs shadow DOM) although I don't don't know if we can use XUL in reftest pages.
Here is a quick testcase for SVG.
Comment 17•11 years ago
|
||
Comment on attachment 8490024 [details] [diff] [review]
patch
Looks great, thanks!
A test for SVG would be good, yes. Followup bug is OK.
I wouldn't worry too much about a test for XUL if it's being too annoying.
Attachment #8490024 -
Flags: review?(bzbarsky) → review+
| Assignee | ||
Comment 18•11 years ago
|
||
Thank you for the SVG test.
Both tests have been converted to reftests.
Attachment #8490024 -
Attachment is obsolete: true
| Assignee | ||
Comment 19•11 years ago
|
||
Keywords: checkin-needed
Comment 20•11 years ago
|
||
Keywords: checkin-needed
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla35
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•