Bug 1360508: Use the parent's frame style context when handling text-combine. r?xidorn draft
authorEmilio Cobos Álvarez <emilio@crisal.io>
Fri, 28 Apr 2017 14:48:22 +0200
changeset 570170 1d61bb9fa88a0cb3c4c3e7fc5db6ec86ea9c5286
parent 570139 5bba8f3e5eb05918f5a471ee16fd4670feb6e6a6
child 570171 cdbddf16aa9816371488e47e8139147b859b8d5c
push id56414
push userbmo:emilio+bugs@crisal.io
push dateFri, 28 Apr 2017 13:28:07 +0000
reviewersxidorn
bugs1360508, 1360530
milestone55.0a1
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
layout/generic/nsTextFrame.cpp
--- 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();