Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(360)

Unified Diff: Source/WebCore/rendering/RenderBoxModelObject.cpp

Issue 9249043: Merge 104123 - Crash due to first-letter block processing (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/912/
Patch Set: Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/WebCore/rendering/RenderBoxModelObject.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/rendering/RenderBoxModelObject.cpp
===================================================================
--- Source/WebCore/rendering/RenderBoxModelObject.cpp (revision 105348)
+++ Source/WebCore/rendering/RenderBoxModelObject.cpp (working copy)
@@ -64,6 +64,11 @@
typedef HashMap<const RenderBoxModelObject*, RenderBoxModelObject*> ContinuationMap;
static ContinuationMap* continuationMap = 0;
+// This HashMap is similar to the continuation map, but connects first-letter
+// renderers to their remaining text fragments.
+typedef HashMap<const RenderBoxModelObject*, RenderObject*> FirstLetterRemainingTextMap;
+static FirstLetterRemainingTextMap* firstLetterRemainingTextMap = 0;
+
class ImageQualityController {
WTF_MAKE_NONCOPYABLE(ImageQualityController); WTF_MAKE_FAST_ALLOCATED;
public:
@@ -281,6 +286,11 @@
// A continuation of this RenderObject should be destroyed at subclasses.
ASSERT(!continuation());
+ // If this is a first-letter object with a remaining text fragment then the
+ // entry needs to be cleared from the map.
+ if (firstLetterRemainingText())
+ setFirstLetterRemainingText(0);
+
// RenderObject::willBeDestroyed calls back to destroyLayer() for layer destruction
RenderObject::willBeDestroyed();
}
@@ -2573,6 +2583,23 @@
}
}
+RenderObject* RenderBoxModelObject::firstLetterRemainingText() const
+{
+ if (!firstLetterRemainingTextMap)
+ return 0;
+ return firstLetterRemainingTextMap->get(this);
+}
+
+void RenderBoxModelObject::setFirstLetterRemainingText(RenderObject* remainingText)
+{
+ if (remainingText) {
+ if (!firstLetterRemainingTextMap)
+ firstLetterRemainingTextMap = new FirstLetterRemainingTextMap;
+ firstLetterRemainingTextMap->set(this, remainingText);
+ } else if (firstLetterRemainingTextMap)
+ firstLetterRemainingTextMap->remove(this);
+}
+
bool RenderBoxModelObject::shouldAntialiasLines(GraphicsContext* context)
{
// FIXME: We may want to not antialias when scaled by an integral value,
« no previous file with comments | « Source/WebCore/rendering/RenderBoxModelObject.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698