Remove strange CharacterData::dataImpl function
authordarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 9 Jan 2015 05:29:55 +0000 (05:29 +0000)
committerdarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 9 Jan 2015 05:29:55 +0000 (05:29 +0000)
https://bugs.webkit.org/show_bug.cgi?id=140115

Reviewed by Anders Carlsson.

Every call site could just use the data function instead.

* dom/CharacterData.h:
(WebCore::CharacterData::dataImpl): Deleted.

* dom/Text.cpp:
(WebCore::Text::splitText): Use data instead of dataImpl.
(WebCore::Text::createTextRenderer): Ditto.

* rendering/RenderCombineText.cpp:
(WebCore::RenderCombineText::RenderCombineText): Updated to take
const String&. We missed this class when RenderText changed.
* rendering/RenderCombineText.h: Ditto.

* style/StyleResolveTree.cpp:
(WebCore::Style::updateTextRendererAfterContentChange): Use data.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@178157 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/dom/CharacterData.h
Source/WebCore/dom/Text.cpp
Source/WebCore/rendering/RenderCombineText.cpp
Source/WebCore/rendering/RenderCombineText.h
Source/WebCore/style/StyleResolveTree.cpp

index 27769d0..da81b96 100644 (file)
@@ -1,3 +1,27 @@
+2015-01-08  Darin Adler  <darin@apple.com>
+
+        Remove strange CharacterData::dataImpl function
+        https://bugs.webkit.org/show_bug.cgi?id=140115
+
+        Reviewed by Anders Carlsson.
+
+        Every call site could just use the data function instead.
+
+        * dom/CharacterData.h:
+        (WebCore::CharacterData::dataImpl): Deleted.
+
+        * dom/Text.cpp:
+        (WebCore::Text::splitText): Use data instead of dataImpl.
+        (WebCore::Text::createTextRenderer): Ditto.
+
+        * rendering/RenderCombineText.cpp:
+        (WebCore::RenderCombineText::RenderCombineText): Updated to take
+        const String&. We missed this class when RenderText changed.
+        * rendering/RenderCombineText.h: Ditto.
+
+        * style/StyleResolveTree.cpp:
+        (WebCore::Style::updateTextRendererAfterContentChange): Use data.
+
 2015-01-08  Chris Dumez  <cdumez@apple.com>
 
         ASSERTION FAILED: !valueWithCalculation.calculation() in WebCore::CSSParser::validateCalculationUnit
index 317d931..4588918 100644 (file)
@@ -43,8 +43,6 @@ public:
 
     bool containsOnlyWhitespace() const;
 
-    StringImpl* dataImpl() { return m_data.impl(); }
-
     // Like appendData, but optimized for the parser (e.g., no mutation events).
     // Returns how much could be added before length limit was met.
     unsigned parserAppendData(const String& string, unsigned offset, unsigned lengthLimit);
index 1a864ca..a1e0cab 100644 (file)
@@ -80,7 +80,7 @@ RefPtr<Text> Text::splitText(unsigned offset, ExceptionCode& ec)
         document().textNodeSplit(this);
 
     if (renderer())
-        renderer()->setTextWithOffset(dataImpl(), 0, oldStr.length());
+        renderer()->setTextWithOffset(data(), 0, oldStr.length());
 
     return WTF::move(newText);
 }
@@ -185,12 +185,12 @@ static bool isSVGText(Text* text)
 RenderPtr<RenderText> Text::createTextRenderer(const RenderStyle& style)
 {
     if (isSVGText(this) || isSVGShadowText(this))
-        return createRenderer<RenderSVGInlineText>(*this, dataImpl());
+        return createRenderer<RenderSVGInlineText>(*this, data());
 
     if (style.hasTextCombine())
-        return createRenderer<RenderCombineText>(*this, dataImpl());
+        return createRenderer<RenderCombineText>(*this, data());
 
-    return createRenderer<RenderText>(*this, dataImpl());
+    return createRenderer<RenderText>(*this, data());
 }
 
 bool Text::childTypeAllowed(NodeType) const
index 59aa5c8..8122e08 100644 (file)
@@ -28,7 +28,7 @@ namespace WebCore {
 
 const float textCombineMargin = 1.15f; // Allow em + 15% margin
 
-RenderCombineText::RenderCombineText(Text& textNode, PassRefPtr<StringImpl> string)
+RenderCombineText::RenderCombineText(Text& textNode, const String& string)
     : RenderText(textNode, string)
     , m_isCombined(false)
     , m_needsFontUpdate(false)
index 11b2855..941721c 100644 (file)
@@ -30,7 +30,7 @@ namespace WebCore {
 
 class RenderCombineText final : public RenderText {
 public:
-    RenderCombineText(Text&, PassRefPtr<StringImpl>);
+    RenderCombineText(Text&, const String&);
 
     Text& textNode() const { return downcast<Text>(nodeForNonAnonymous()); }
 
index b356b32..25c029f 100644 (file)
@@ -465,7 +465,7 @@ void updateTextRendererAfterContentChange(Text& textNode, unsigned offsetOfRepla
     resolveTextNode(textNode, renderTreePosition);
 
     if (hadRenderer && textNode.renderer())
-        textNode.renderer()->setTextWithOffset(textNode.dataImpl(), offsetOfReplacedData, lengthOfReplacedData);
+        textNode.renderer()->setTextWithOffset(textNode.data(), offsetOfReplacedData, lengthOfReplacedData);
 }
 
 static void attachChildren(ContainerNode& current, RenderStyle& inheritedStyle, RenderTreePosition& renderTreePosition)