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

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..965ac48745408b45185b16a919262a537e83e51c 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)
@@ -51,19 +53,35 @@ public:
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;
Julien - ping for review 2014/10/01 21:14:47 This screams adding a specialized class and so is
dsinclair 2014/10/04 02:01:34 Done.
};
const QualifiedName& pseudoElementTagName();
inline bool pseudoElementRendererIsNeeded(const RenderStyle* style)
{
- return style && style->display() != NONE && (style->styleType() == BACKDROP || style->contentData());
+ if (!style)
+ return false;
+ if (style->display() == NONE)
+ return false;
+ if (style->styleType() == FIRST_LETTER)
+ return true;
+ if (style->styleType() == BACKDROP)
+ return true;
+ if (style->contentData())
+ return true;
+ return false;
}
DEFINE_ELEMENT_TYPE_CASTS(PseudoElement, isPseudoElement());

Powered by Google App Engine
This is Rietveld 408576698