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

Side by Side Diff: Source/core/dom/FirstLetterPseudoElement.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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 /*
esprehn 2014/10/07 00:17:40 new short copyright.
dsinclair 2014/10/07 19:36:20 Done.
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2007 David Smith (catfish.man@gmail.com)
5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
7 *
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
12 *
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Library General Public License for more details.
17 *
18 * You should have received a copy of the GNU Library General Public License
19 * along with this library; see the file COPYING.LIB. If not, write to
20 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 * Boston, MA 02110-1301, USA.
22 *
23 */
24
25 #ifndef FirstLetterPseudoElement_h
26 #define FirstLetterPseudoElement_h
27
28 #include "core/dom/PseudoElement.h"
29 #include "wtf/text/WTFString.h"
30
31 namespace blink {
32
33 class Element;
34 class RenderObject;
35
36 class FirstLetterPseudoElement FINAL : public PseudoElement {
37 WTF_MAKE_NONCOPYABLE(FirstLetterPseudoElement);
38 public:
39 static RenderObject* firstLetterTextRenderer(const Element&);
40 static unsigned firstLetterLength(const String&);
41
42 void setRemainingTextRenderer(RenderTextFragment* fragment) { m_remainingTex tRenderer = fragment; }
43 RenderTextFragment* remainingTextRenderer() const { return m_remainingTextRe nderer; }
44
45 void setIsStale() { m_isStale = true; }
46 bool isStale() const { return m_isStale; }
47
48 virtual void attach(const AttachContext& = AttachContext()) OVERRIDE;
49 virtual void dispose() OVERRIDE;
50
51 private:
52 friend class PseudoElement; // For constructor.
esprehn 2014/10/07 00:17:40 remove friend, make the constructor protected.
dsinclair 2014/10/07 19:36:20 I can't in this case. We inherit from PseudoElemen
53
54 FirstLetterPseudoElement(Element*);
55
56 virtual void didRecalcStyle(StyleRecalcChange) OVERRIDE;
57
58 void attachFirstLetterTextRenderers();
59 RenderStyle* styleForFirstLetter(RenderObject*);
60
61 RenderTextFragment* m_remainingTextRenderer;
62 bool m_isStale;
63 };
64
65 DEFINE_ELEMENT_TYPE_CASTS(FirstLetterPseudoElement, isFirstLetterPseudoElement() );
66
67 } // namespace blink
68
69 #endif // FirstLetterPseudoElement_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698