| Index: Source/core/rendering/RenderBoxModelObject.cpp
 | 
| diff --git a/Source/core/rendering/RenderBoxModelObject.cpp b/Source/core/rendering/RenderBoxModelObject.cpp
 | 
| index 76ecbf15576a4116374d482d8c63f1fc14f1a175..69d48478fe7973028a88bf5f18a5f9356ea76bee 100644
 | 
| --- a/Source/core/rendering/RenderBoxModelObject.cpp
 | 
| +++ b/Source/core/rendering/RenderBoxModelObject.cpp
 | 
| @@ -60,6 +60,11 @@ namespace blink {
 | 
|  typedef WillBeHeapHashMap<RawPtrWillBeMember<const RenderBoxModelObject>, RawPtrWillBeMember<RenderBoxModelObject> > ContinuationMap;
 | 
|  static OwnPtrWillBePersistent<ContinuationMap>* continuationMap = 0;
 | 
|  
 | 
| +// This HashMap is similar to the continuation map, but connects first-letter
 | 
| +// renderers to their remaining text fragments.
 | 
| +typedef WillBeHeapHashMap<RawPtrWillBeMember<const RenderBoxModelObject>, RawPtrWillBeMember<RenderTextFragment> > FirstLetterRemainingTextMap;
 | 
| +static OwnPtrWillBePersistent<FirstLetterRemainingTextMap>* firstLetterRemainingTextMap = 0;
 | 
| +
 | 
|  void RenderBoxModelObject::setSelectionState(SelectionState state)
 | 
|  {
 | 
|      if (state == SelectionInside && selectionState() != SelectionNone)
 | 
| @@ -108,6 +113,11 @@ void RenderBoxModelObject::willBeDestroyed()
 | 
|      // 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);
 | 
| +
 | 
|      RenderLayerModelObject::willBeDestroyed();
 | 
|  }
 | 
|  
 | 
| @@ -482,6 +492,24 @@ void RenderBoxModelObject::computeLayerHitTestRects(LayerHitTestRects& rects) co
 | 
|          continuation()->computeLayerHitTestRects(rects);
 | 
|  }
 | 
|  
 | 
| +RenderTextFragment* RenderBoxModelObject::firstLetterRemainingText() const
 | 
| +{
 | 
| +    if (!firstLetterRemainingTextMap)
 | 
| +        return 0;
 | 
| +    return (*firstLetterRemainingTextMap)->get(this);
 | 
| +}
 | 
| +
 | 
| +void RenderBoxModelObject::setFirstLetterRemainingText(RenderTextFragment* remainingText)
 | 
| +{
 | 
| +    if (remainingText) {
 | 
| +        if (!firstLetterRemainingTextMap)
 | 
| +            firstLetterRemainingTextMap = new OwnPtrWillBePersistent<FirstLetterRemainingTextMap>(adoptPtrWillBeNoop(new FirstLetterRemainingTextMap));
 | 
| +        (*firstLetterRemainingTextMap)->set(this, remainingText);
 | 
| +    } else if (firstLetterRemainingTextMap) {
 | 
| +        (*firstLetterRemainingTextMap)->remove(this);
 | 
| +    }
 | 
| +}
 | 
| +
 | 
|  LayoutRect RenderBoxModelObject::localCaretRectForEmptyElement(LayoutUnit width, LayoutUnit textIndentOffset)
 | 
|  {
 | 
|      ASSERT(!slowFirstChild());
 | 
| 
 |