Index: Source/WebCore/rendering/RenderQuote.cpp |
=================================================================== |
--- Source/WebCore/rendering/RenderQuote.cpp (revision 143280) |
+++ Source/WebCore/rendering/RenderQuote.cpp (working copy) |
@@ -54,10 +54,15 @@ |
void RenderQuote::willBeRemovedFromTree() |
{ |
RenderText::willBeRemovedFromTree(); |
- |
detachQuote(); |
} |
+void RenderQuote::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle) |
+{ |
+ RenderText::styleDidChange(diff, oldStyle); |
+ updateText(); |
+} |
+ |
typedef HashMap<AtomicString, const QuotesData*, CaseFoldingHash> QuotesMap; |
static const QuotesMap& quotesDataLanguageMap() |
@@ -245,27 +250,9 @@ |
void RenderQuote::updateText() |
{ |
- computePreferredLogicalWidths(0); |
+ setText(originalText()); |
} |
-void RenderQuote::computePreferredLogicalWidths(float lead) |
-{ |
-#ifndef NDEBUG |
- // FIXME: We shouldn't be modifying the tree in computePreferredLogicalWidths. |
- // Instead, we should properly hook the appropriate changes in the DOM and modify |
- // the render tree then. When that's done, we also won't need to override |
- // computePreferredLogicalWidths at all. |
- // https://bugs.webkit.org/show_bug.cgi?id=104829 |
- SetLayoutNeededForbiddenScope layoutForbiddenScope(this, false); |
-#endif |
- |
- if (!m_attached) |
- attachQuote(); |
- setTextInternal(originalText()); |
- |
- RenderText::computePreferredLogicalWidths(lead); |
-} |
- |
const QuotesData* RenderQuote::quotesData() const |
{ |
if (QuotesData* customQuotes = style()->quotes()) |
@@ -285,14 +272,8 @@ |
ASSERT(view()); |
ASSERT(!m_attached); |
ASSERT(!m_next && !m_previous); |
+ ASSERT(isRooted()); |
- // FIXME: Don't set pref widths dirty during layout. See updateDepth() for |
- // more detail. |
- if (!isRooted()) { |
- setNeedsLayoutAndPrefWidthsRecalc(); |
- return; |
- } |
- |
if (!view()->renderQuoteHead()) { |
view()->setRenderQuoteHead(this); |
m_attached = true; |
@@ -370,12 +351,8 @@ |
break; |
} |
} |
- // FIXME: Don't call setNeedsLayout or dirty our preferred widths during layout. |
- // This is likely to fail anyway as one of our ancestor will call setNeedsLayout(false), |
- // preventing the future layout to occur on |this|. The solution is to move that to a |
- // pre-layout phase. |
if (oldDepth != m_depth) |
- setNeedsLayoutAndPrefWidthsRecalc(); |
+ updateText(); |
} |
} // namespace WebCore |