Bug 1360508: Use the parent's frame style context when handling text-combine. r?xidorn
Instead of the parent style context itself. This also fixes
bug 1360530.
It's not clear what should we use in this case, it depends on the resolution in
[1] and [2].
While those get resolved, this is probably ok, and gets rid of the only
styleContext->GetParent() outside nsRuleNode.
[1]: https://github.com/w3c/csswg-drafts/issues/1249
[2]: https://github.com/w3c/csswg-drafts/issues/1281
MozReview-Commit-ID: LSOgFCwQi1W
--- a/layout/generic/nsTextFrame.cpp
+++ b/layout/generic/nsTextFrame.cpp
@@ -5521,17 +5521,17 @@ nsTextFrame::UpdateTextEmphasis(WritingM
if (!styleText->HasTextEmphasis()) {
Properties().Delete(EmphasisMarkProperty());
return nsRect();
}
nsStyleContext* styleContext = StyleContext();
bool isTextCombined = styleContext->IsTextCombined();
if (isTextCombined) {
- styleContext = styleContext->GetParent();
+ styleContext = GetParent()->StyleContext();
}
RefPtr<nsFontMetrics> fm = nsLayoutUtils::
GetFontMetricsOfEmphasisMarks(styleContext, GetFontSizeInflation());
EmphasisMarkInfo* info = new EmphasisMarkInfo;
info->textRun =
GenerateTextRunForEmphasisMarks(this, fm, styleContext, styleText);
info->advance = info->textRun->GetAdvanceWidth();