- Revision
- 143380
- Author
- espr...@chromium.org
- Date
- 2013-02-19 13:51:19 -0800 (Tue, 19 Feb 2013)
Log Message
Remove RenderText::updateText
https://bugs.webkit.org/show_bug.cgi?id=109991
Reviewed by Eric Seidel.
There's no reason for the generic RenderText::updateText virtual hook
anymore now that r143060 made RenderQuote stop setting dirty bits during
layout since the hook is only used by RenderCounter.
Instead add updateCounterIfNeeded and make it clear this is a hack for
counters.
* rendering/RenderBlockLineLayout.cpp:
(WebCore::updateCounterIfNeeded): Added, not handles the counter specific hack.
(WebCore::dirtyLineBoxesForRenderer):
(WebCore::RenderBlock::LineBreaker::nextSegmentBreak):
* rendering/RenderCounter.cpp:
(WebCore::RenderCounter::updateCounter):
* rendering/RenderCounter.h:
(RenderCounter):
* rendering/RenderQuote.cpp:
(WebCore::RenderQuote::styleDidChange):
(WebCore::RenderQuote::updateDepth):
* rendering/RenderQuote.h:
(RenderQuote):
* rendering/RenderText.h:
(RenderText):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (143379 => 143380)
--- trunk/Source/WebCore/ChangeLog 2013-02-19 21:48:33 UTC (rev 143379)
+++ trunk/Source/WebCore/ChangeLog 2013-02-19 21:51:19 UTC (rev 143380)
@@ -1,3 +1,33 @@
+2013-02-19 Elliott Sprehn <espr...@chromium.org>
+
+ Remove RenderText::updateText
+ https://bugs.webkit.org/show_bug.cgi?id=109991
+
+ Reviewed by Eric Seidel.
+
+ There's no reason for the generic RenderText::updateText virtual hook
+ anymore now that r143060 made RenderQuote stop setting dirty bits during
+ layout since the hook is only used by RenderCounter.
+
+ Instead add updateCounterIfNeeded and make it clear this is a hack for
+ counters.
+
+ * rendering/RenderBlockLineLayout.cpp:
+ (WebCore::updateCounterIfNeeded): Added, not handles the counter specific hack.
+ (WebCore::dirtyLineBoxesForRenderer):
+ (WebCore::RenderBlock::LineBreaker::nextSegmentBreak):
+ * rendering/RenderCounter.cpp:
+ (WebCore::RenderCounter::updateCounter):
+ * rendering/RenderCounter.h:
+ (RenderCounter):
+ * rendering/RenderQuote.cpp:
+ (WebCore::RenderQuote::styleDidChange):
+ (WebCore::RenderQuote::updateDepth):
+ * rendering/RenderQuote.h:
+ (RenderQuote):
+ * rendering/RenderText.h:
+ (RenderText):
+
2013-02-19 Tony Chang <t...@chromium.org>
Border changes on tables with collapsed borders doesn't relayout table cells
Modified: trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp (143379 => 143380)
--- trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp 2013-02-19 21:48:33 UTC (rev 143379)
+++ trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp 2013-02-19 21:51:19 UTC (rev 143380)
@@ -29,6 +29,7 @@
#include "Logging.h"
#include "RenderArena.h"
#include "RenderCombineText.h"
+#include "RenderCounter.h"
#include "RenderFlowThread.h"
#include "RenderInline.h"
#include "RenderLayer.h"
@@ -426,11 +427,20 @@
return toRenderInline(obj)->createAndAppendInlineFlowBox();
}
+// FIXME: Don't let counters mark themselves as needing pref width recalcs during layout
+// so we don't need this hack.
+static inline void updateCounterIfNeeded(RenderText* o)
+{
+ if (!o->preferredLogicalWidthsDirty() || !o->isCounter())
+ return;
+ toRenderCounter(o)->updateCounter();
+}
+
static inline void dirtyLineBoxesForRenderer(RenderObject* o, bool fullLayout)
{
if (o->isText()) {
RenderText* renderText = toRenderText(o);
- renderText->updateTextIfNeeded(); // FIXME: Counters depend on this hack. No clue why. Should be investigated and removed.
+ updateCounterIfNeeded(renderText);
renderText->dirtyLineBoxes(fullLayout);
} else
toRenderInline(o)->dirtyLineBoxes(fullLayout);
@@ -2782,7 +2792,7 @@
}
if (renderTextInfo.m_text != t) {
- t->updateTextIfNeeded();
+ updateCounterIfNeeded(t);
renderTextInfo.m_text = t;
renderTextInfo.m_font = &f;
renderTextInfo.m_layout = f.createLayout(t, width.currentWidth(), collapseWhiteSpace);
Modified: trunk/Source/WebCore/rendering/RenderCounter.cpp (143379 => 143380)
--- trunk/Source/WebCore/rendering/RenderCounter.cpp 2013-02-19 21:48:33 UTC (rev 143379)
+++ trunk/Source/WebCore/rendering/RenderCounter.cpp 2013-02-19 21:51:19 UTC (rev 143380)
@@ -512,7 +512,7 @@
return text.impl();
}
-void RenderCounter::updateText()
+void RenderCounter::updateCounter()
{
computePreferredLogicalWidths(0);
}
Modified: trunk/Source/WebCore/rendering/RenderCounter.h (143379 => 143380)
--- trunk/Source/WebCore/rendering/RenderCounter.h 2013-02-19 21:48:33 UTC (rev 143379)
+++ trunk/Source/WebCore/rendering/RenderCounter.h 2013-02-19 21:51:19 UTC (rev 143380)
@@ -40,6 +40,8 @@
static void rendererRemovedFromTree(RenderObject*);
static void rendererStyleChanged(RenderObject*, const RenderStyle* oldStyle, const RenderStyle* newStyle);
+ void updateCounter();
+
protected:
virtual void willBeDestroyed();
@@ -48,7 +50,6 @@
virtual bool isCounter() const;
virtual PassRefPtr<StringImpl> originalText() const;
- virtual void updateText() OVERRIDE;
virtual void computePreferredLogicalWidths(float leadWidth) OVERRIDE;
// Removes the reference to the CounterNode associated with this renderer.
Modified: trunk/Source/WebCore/rendering/RenderQuote.cpp (143379 => 143380)
--- trunk/Source/WebCore/rendering/RenderQuote.cpp 2013-02-19 21:48:33 UTC (rev 143379)
+++ trunk/Source/WebCore/rendering/RenderQuote.cpp 2013-02-19 21:51:19 UTC (rev 143380)
@@ -60,7 +60,7 @@
void RenderQuote::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
{
RenderText::styleDidChange(diff, oldStyle);
- updateText();
+ setText(originalText());
}
typedef HashMap<AtomicString, const QuotesData*, CaseFoldingHash> QuotesMap;
@@ -248,11 +248,6 @@
return StringImpl::empty();
}
-void RenderQuote::updateText()
-{
- setText(originalText());
-}
-
const QuotesData* RenderQuote::quotesData() const
{
if (QuotesData* customQuotes = style()->quotes())
@@ -352,7 +347,7 @@
}
}
if (oldDepth != m_depth)
- updateText();
+ setText(originalText());
}
} // namespace WebCore
Modified: trunk/Source/WebCore/rendering/RenderQuote.h (143379 => 143380)
--- trunk/Source/WebCore/rendering/RenderQuote.h 2013-02-19 21:48:33 UTC (rev 143379)
+++ trunk/Source/WebCore/rendering/RenderQuote.h 2013-02-19 21:51:19 UTC (rev 143380)
@@ -37,8 +37,6 @@
virtual ~RenderQuote();
void attachQuote();
- virtual void updateText() OVERRIDE;
-
private:
void detachQuote();
@@ -47,12 +45,6 @@
virtual bool isQuote() const OVERRIDE { return true; };
virtual PassRefPtr<StringImpl> originalText() const OVERRIDE;
virtual void styleDidChange(StyleDifference, const RenderStyle*) OVERRIDE;
-
- // We don't override insertedIntoTree to call attachQuote() as it would be attached
- // too early and get the wrong depth since generated content is inserted into anonymous
- // renderers before going into the main render tree. Once we can ensure that insertIntoTree,
- // is called on an attached tree, we should override it here.
-
virtual void willBeRemovedFromTree() OVERRIDE;
const QuotesData* quotesData() const;
Modified: trunk/Source/WebCore/rendering/RenderText.h (143379 => 143380)
--- trunk/Source/WebCore/rendering/RenderText.h 2013-02-19 21:48:33 UTC (rev 143379)
+++ trunk/Source/WebCore/rendering/RenderText.h 2013-02-19 21:51:19 UTC (rev 143380)
@@ -45,12 +45,6 @@
virtual PassRefPtr<StringImpl> originalText() const;
- void updateTextIfNeeded()
- {
- if (preferredLogicalWidthsDirty())
- updateText();
- }
-
void extractTextBox(InlineTextBox*);
void attachTextBox(InlineTextBox*);
void removeTextBox(InlineTextBox*);
@@ -152,7 +146,6 @@
virtual void styleWillChange(StyleDifference, const RenderStyle*) { }
virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);
- virtual void updateText() { }
virtual void setTextInternal(PassRefPtr<StringImpl>);
virtual UChar previousCharacter() const;