Diff
Copied: branches/chromium/1229/LayoutTests/fast/css/content/content-quotes-crash-expected.txt (from rev 127381, trunk/LayoutTests/fast/css/content/content-quotes-crash-expected.txt) (0 => 128801)
--- branches/chromium/1229/LayoutTests/fast/css/content/content-quotes-crash-expected.txt (rev 0)
+++ branches/chromium/1229/LayoutTests/fast/css/content/content-quotes-crash-expected.txt 2012-09-17 20:56:33 UTC (rev 128801)
@@ -0,0 +1,3 @@
+PASS: WebKit didn't crash.
+
+a aA
Copied: branches/chromium/1229/LayoutTests/fast/css/content/content-quotes-crash.html (from rev 127381, trunk/LayoutTests/fast/css/content/content-quotes-crash.html) (0 => 128801)
--- branches/chromium/1229/LayoutTests/fast/css/content/content-quotes-crash.html (rev 0)
+++ branches/chromium/1229/LayoutTests/fast/css/content/content-quotes-crash.html 2012-09-17 20:56:33 UTC (rev 128801)
@@ -0,0 +1,16 @@
+<html>
+<head>
+ <title></title>
+ <script>
+ if (window.testRunner)
+ testRunner.dumpAsText();
+ </script>
+</head>
+<body>
+<p>
+ PASS: WebKit didn't crash.
+</p>
+<ruby><q style="column-gap:2;">a</ruby>
+ <cite style="word-break: break-all;">a<q style="text-transform:uppercase;">a<sup style="text-overflow:ellipsis;">
+</body>
+</html>
Modified: branches/chromium/1229/Source/WebCore/rendering/RenderBlockLineLayout.cpp (128800 => 128801)
--- branches/chromium/1229/Source/WebCore/rendering/RenderBlockLineLayout.cpp 2012-09-17 20:55:20 UTC (rev 128800)
+++ branches/chromium/1229/Source/WebCore/rendering/RenderBlockLineLayout.cpp 2012-09-17 20:56:33 UTC (rev 128801)
@@ -397,9 +397,9 @@
static inline void dirtyLineBoxesForRenderer(RenderObject* o, bool fullLayout)
{
if (o->isText()) {
- if (o->preferredLogicalWidthsDirty() && (o->isCounter() || o->isQuote()))
- toRenderText(o)->computePreferredLogicalWidths(0); // FIXME: Counters depend on this hack. No clue why. Should be investigated and removed.
- toRenderText(o)->dirtyLineBoxes(fullLayout);
+ RenderText* renderText = toRenderText(o);
+ renderText->updateTextIfNeeded(); // FIXME: Counters depend on this hack. No clue why. Should be investigated and removed.
+ renderText->dirtyLineBoxes(fullLayout);
} else
toRenderInline(o)->dirtyLineBoxes(fullLayout);
}
Modified: branches/chromium/1229/Source/WebCore/rendering/RenderCounter.cpp (128800 => 128801)
--- branches/chromium/1229/Source/WebCore/rendering/RenderCounter.cpp 2012-09-17 20:55:20 UTC (rev 128800)
+++ branches/chromium/1229/Source/WebCore/rendering/RenderCounter.cpp 2012-09-17 20:56:33 UTC (rev 128801)
@@ -537,6 +537,11 @@
return text.impl();
}
+void RenderCounter::updateText()
+{
+ computePreferredLogicalWidths(0);
+}
+
void RenderCounter::computePreferredLogicalWidths(float lead)
{
setTextInternal(originalText());
Modified: branches/chromium/1229/Source/WebCore/rendering/RenderCounter.h (128800 => 128801)
--- branches/chromium/1229/Source/WebCore/rendering/RenderCounter.h 2012-09-17 20:55:20 UTC (rev 128800)
+++ branches/chromium/1229/Source/WebCore/rendering/RenderCounter.h 2012-09-17 20:56:33 UTC (rev 128801)
@@ -48,6 +48,7 @@
virtual bool isCounter() const;
virtual PassRefPtr<StringImpl> originalText() const;
+ virtual void updateText() OVERRIDE;
virtual void computePreferredLogicalWidths(float leadWidth);
// Removes the reference to the CounterNode associated with this renderer.
Modified: branches/chromium/1229/Source/WebCore/rendering/RenderQuote.cpp (128800 => 128801)
--- branches/chromium/1229/Source/WebCore/rendering/RenderQuote.cpp 2012-09-17 20:55:20 UTC (rev 128800)
+++ branches/chromium/1229/Source/WebCore/rendering/RenderQuote.cpp 2012-09-17 20:56:33 UTC (rev 128801)
@@ -242,6 +242,11 @@
return StringImpl::empty();
}
+void RenderQuote::updateText()
+{
+ computePreferredLogicalWidths(0);
+}
+
void RenderQuote::computePreferredLogicalWidths(float lead)
{
if (!m_attached)
Modified: branches/chromium/1229/Source/WebCore/rendering/RenderQuote.h (128800 => 128801)
--- branches/chromium/1229/Source/WebCore/rendering/RenderQuote.h 2012-09-17 20:55:20 UTC (rev 128800)
+++ branches/chromium/1229/Source/WebCore/rendering/RenderQuote.h 2012-09-17 20:56:33 UTC (rev 128801)
@@ -42,6 +42,8 @@
virtual const char* renderName() const OVERRIDE { return "RenderQuote"; };
virtual bool isQuote() const OVERRIDE { return true; };
virtual PassRefPtr<StringImpl> originalText() const OVERRIDE;
+
+ virtual void updateText() OVERRIDE;
virtual void computePreferredLogicalWidths(float leadWidth) OVERRIDE;
// We don't override insertedIntoTree to call attachQuote() as it would be attached
Modified: branches/chromium/1229/Source/WebCore/rendering/RenderText.h (128800 => 128801)
--- branches/chromium/1229/Source/WebCore/rendering/RenderText.h 2012-09-17 20:55:20 UTC (rev 128800)
+++ branches/chromium/1229/Source/WebCore/rendering/RenderText.h 2012-09-17 20:56:33 UTC (rev 128801)
@@ -45,6 +45,12 @@
virtual PassRefPtr<StringImpl> originalText() const;
+ void updateTextIfNeeded()
+ {
+ if (preferredLogicalWidthsDirty())
+ updateText();
+ }
+
void extractTextBox(InlineTextBox*);
void attachTextBox(InlineTextBox*);
void removeTextBox(InlineTextBox*);
@@ -139,6 +145,7 @@
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;