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

Unified Diff: Source/core/rendering/RenderTextFragment.h

Issue 571603003: Convert first letter into a pseudo element. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 2 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
Index: Source/core/rendering/RenderTextFragment.h
diff --git a/Source/core/rendering/RenderTextFragment.h b/Source/core/rendering/RenderTextFragment.h
index 4f70b4293d4849c91f2a5fb9e1eb84b595671699..f1e1d50425fc1bf7777f7f34b58e9e0ffafe6f41 100644
--- a/Source/core/rendering/RenderTextFragment.h
+++ b/Source/core/rendering/RenderTextFragment.h
@@ -27,6 +27,8 @@
namespace blink {
+class FirstLetterPseudoElement;
+
// Used to represent a text substring of an element, e.g., for text runs that are split because of
// first letter and that must therefore have different styles (and positions in the render tree).
// We cache offsets so that text transformations can be applied in such a way that we can recover
@@ -36,7 +38,6 @@ public:
RenderTextFragment(Node*, StringImpl*, int startOffset, int length);
RenderTextFragment(Node*, StringImpl*);
virtual ~RenderTextFragment();
- virtual void trace(Visitor*) OVERRIDE;
virtual bool isTextFragment() const OVERRIDE { return true; }
@@ -46,11 +47,8 @@ public:
unsigned end() const { return m_end; }
virtual unsigned textStartOffset() const OVERRIDE { return start(); }
- RenderBoxModelObject* firstLetter() const { return m_firstLetter; }
- void setFirstLetter(RenderBoxModelObject* firstLetter) { m_firstLetter = firstLetter; }
- RenderText* firstRenderTextInFirstLetter() const;
-
StringImpl* contentString() const { return m_contentString.get(); }
+ PassRefPtr<StringImpl> completeText() const;
virtual PassRefPtr<StringImpl> originalText() const OVERRIDE;
virtual void setText(PassRefPtr<StringImpl>, bool force = false) OVERRIDE;
@@ -59,20 +57,19 @@ public:
virtual const char* renderName() const OVERRIDE FINAL { return "RenderTextFragment"; }
-protected:
- virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle) OVERRIDE;
+ void setFirstLetterPseudoElement(FirstLetterPseudoElement* element) { m_firstLetterPseudoElement = element; }
+ FirstLetterPseudoElement* firstLetterPseudoElement() const { return m_firstLetterPseudoElement; }
private:
- virtual void willBeDestroyed() OVERRIDE;
-
virtual UChar previousCharacter() const OVERRIDE;
- RenderBlock* blockForAccompanyingFirstLetter() const;
virtual void updateHitTestResult(HitTestResult&, const LayoutPoint&) OVERRIDE;
+ Text* associatedTextNode() const;
+
unsigned m_start;
unsigned m_end;
RefPtr<StringImpl> m_contentString;
- RawPtrWillBeMember<RenderBoxModelObject> m_firstLetter;
+ FirstLetterPseudoElement* m_firstLetterPseudoElement;
Julien - ping for review 2014/10/06 20:11:45 Shouldn't this be a RawPtrWillBeMember<FirstLetter
dsinclair 2014/10/07 19:36:21 Done.
};
DEFINE_TYPE_CASTS(RenderTextFragment, RenderObject, object, toRenderText(object)->isTextFragment(), toRenderText(object).isTextFragment());

Powered by Google App Engine
This is Rietveld 408576698