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

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

Issue 672953002: Convert first letter into a pseudo element. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 1 month 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 db6671fa6fd5cd9b3088f8f2cead7ebca09c9ec1..14c7cf9a2d06ca4e63d0017d5f07a0a2f7ebb09a 100644
--- a/Source/core/dom/PseudoElement.h
+++ b/Source/core/dom/PseudoElement.h
@@ -32,12 +32,9 @@
namespace blink {
-class PseudoElement final : public Element {
+class PseudoElement : public Element {
public:
- static PassRefPtrWillBeRawPtr<PseudoElement> create(Element* parent, PseudoId pseudoId)
- {
- return adoptRefWillBeNoop(new PseudoElement(parent, pseudoId));
- }
+ static PassRefPtrWillBeRawPtr<PseudoElement> create(Element* parent, PseudoId);
virtual PassRefPtr<RenderStyle> customStyleForRenderer() override;
virtual void attach(const AttachContext& = AttachContext()) override;
@@ -49,11 +46,12 @@ public:
static String pseudoElementNameForEvents(PseudoId);
- void dispose();
+ virtual void dispose();
-private:
+protected:
PseudoElement(Element*, PseudoId);
+private:
virtual void didRecalcStyle(StyleRecalcChange) override;
PseudoId m_pseudoId;
@@ -63,7 +61,13 @@ 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 || style->styleType() == BACKDROP)
+ return true;
+ return style->contentData();
}
DEFINE_ELEMENT_TYPE_CASTS(PseudoElement, isPseudoElement());

Powered by Google App Engine
This is Rietveld 408576698