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

Unified Diff: Source/core/dom/PseudoElement.h

Issue 571603003: Convert first letter into a pseudo element. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 3 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/dom/PseudoElement.h
diff --git a/Source/core/dom/PseudoElement.h b/Source/core/dom/PseudoElement.h
index 25761531be3d1da66b308d000187aaa62bfb1690..465df02687f6f84de12e9a0ee68ac0646a933fc6 100644
--- a/Source/core/dom/PseudoElement.h
+++ b/Source/core/dom/PseudoElement.h
@@ -32,6 +32,8 @@
namespace blink {
+class RenderTextFragment;
+
class PseudoElement FINAL : public Element {
public:
static PassRefPtrWillBeRawPtr<PseudoElement> create(Element* parent, PseudoId pseudoId)
@@ -46,24 +48,32 @@ public:
virtual bool canStartSelection() const OVERRIDE { return false; }
virtual bool canContainRangeEndPoint() const OVERRIDE { return false; }
virtual PseudoId pseudoId() const OVERRIDE { return m_pseudoId; }
+ virtual RenderObject* firstLetterTextRenderer() const OVERRIDE;
static String pseudoElementNameForEvents(PseudoId);
void dispose();
+ void setRemainingTextRenderer(RenderTextFragment* fragment) { m_remainingTextRenderer = fragment; }
+ RenderTextFragment* remainingTextRenderer() const { return m_remainingTextRenderer; }
+
private:
PseudoElement(Element*, PseudoId);
+ void attachFirstLetterTextRenderers();
+ RenderStyle* styleForFirstLetter(RenderObject*);
virtual void didRecalcStyle(StyleRecalcChange) OVERRIDE;
PseudoId m_pseudoId;
+ RenderTextFragment* m_remainingTextRenderer;
};
const QualifiedName& pseudoElementTagName();
inline bool pseudoElementRendererIsNeeded(const RenderStyle* style)
{
- return style && style->display() != NONE && (style->styleType() == BACKDROP || style->contentData());
+ return style && style->display() != NONE
esprehn 2014/09/30 09:00:30 This statement has gotten confusing, can we break
dsinclair 2014/09/30 21:46:34 Done.
+ && (style->styleType() == FIRST_LETTER || (style->styleType() == BACKDROP || style->contentData()));
}
DEFINE_ELEMENT_TYPE_CASTS(PseudoElement, isPseudoElement());

Powered by Google App Engine
This is Rietveld 408576698