diff options
author | Konstantin Tokarev <annulen@yandex.ru> | 2016-08-25 19:20:41 +0300 |
---|---|---|
committer | Konstantin Tokarev <annulen@yandex.ru> | 2017-02-02 12:30:55 +0000 |
commit | 6882a04fb36642862b11efe514251d32070c3d65 (patch) | |
tree | b7959826000b061fd5ccc7512035c7478742f7b0 /Source/WebCore/rendering/RenderRubyRun.h | |
parent | ab6df191029eeeb0b0f16f127d553265659f739e (diff) | |
download | qtwebkit-6882a04fb36642862b11efe514251d32070c3d65.tar.gz |
Imported QtWebKit TP3 (git b57bc6801f1876c3220d5a4bfea33d620d477443)
Change-Id: I3b1d8a2808782c9f34d50240000e20cb38d3680f
Reviewed-by: Konstantin Tokarev <annulen@yandex.ru>
Diffstat (limited to 'Source/WebCore/rendering/RenderRubyRun.h')
-rw-r--r-- | Source/WebCore/rendering/RenderRubyRun.h | 63 |
1 files changed, 31 insertions, 32 deletions
diff --git a/Source/WebCore/rendering/RenderRubyRun.h b/Source/WebCore/rendering/RenderRubyRun.h index 1e553a6a0..65cf224a5 100644 --- a/Source/WebCore/rendering/RenderRubyRun.h +++ b/Source/WebCore/rendering/RenderRubyRun.h @@ -31,67 +31,66 @@ #ifndef RenderRubyRun_h #define RenderRubyRun_h -#include "RenderBlock.h" +#include "RenderBlockFlow.h" namespace WebCore { class RenderRubyBase; class RenderRubyText; -// RenderRubyRun are 'inline-block/table' like objects,and wrap a single pairing of a ruby base with its ruby text(s). +// RenderRubyRuns are 'inline-block/table' like objects, and wrap a single pairing of a ruby base with its ruby text(s). // See RenderRuby.h for further comments on the structure -class RenderRubyRun : public RenderBlock { +class RenderRubyRun final : public RenderBlockFlow { public: + RenderRubyRun(Document&, Ref<RenderStyle>&&); virtual ~RenderRubyRun(); bool hasRubyText() const; bool hasRubyBase() const; - bool isEmpty() const; + virtual bool isEmpty() const override; RenderRubyText* rubyText() const; RenderRubyBase* rubyBase() const; RenderRubyBase* rubyBaseSafe(); // creates the base if it doesn't already exist - virtual RenderObject* layoutSpecialExcludedChild(bool relayoutChildren); - virtual void layout(); + virtual RenderObject* layoutSpecialExcludedChild(bool relayoutChildren) override; + virtual void layout() override; - virtual bool isChildAllowed(RenderObject*, RenderStyle*) const; - virtual void addChild(RenderObject* child, RenderObject* beforeChild = 0); - virtual void removeChild(RenderObject* child); + virtual bool isChildAllowed(const RenderObject&, const RenderStyle&) const override; + virtual void addChild(RenderObject* child, RenderObject* beforeChild = 0) override; + virtual void removeChild(RenderObject&) override; - virtual RenderBlock* firstLineBlock() const; - virtual void updateFirstLetter(); + virtual RenderBlock* firstLineBlock() const override; + virtual void updateFirstLetter() override; - void getOverhang(bool firstLine, RenderObject* startRenderer, RenderObject* endRenderer, int& startOverhang, int& endOverhang) const; + void getOverhang(bool firstLine, RenderObject* startRenderer, RenderObject* endRenderer, float& startOverhang, float& endOverhang) const; static RenderRubyRun* staticCreateRubyRun(const RenderObject* parentRuby); - + + void updatePriorContextFromCachedBreakIterator(LazyLineBreakIterator&) const; + void setCachedPriorCharacters(UChar last, UChar secondToLast) + { + m_lastCharacter = last; + m_secondToLastCharacter = secondToLast; + } + bool canBreakBefore(const LazyLineBreakIterator&) const; + protected: RenderRubyBase* createRubyBase() const; private: - RenderRubyRun(); + virtual bool isRubyRun() const override { return true; } + virtual const char* renderName() const override { return "RenderRubyRun (anonymous)"; } + virtual bool createsAnonymousWrapper() const override { return true; } + virtual void removeLeftoverAnonymousBlock(RenderBlock*) override { } - virtual bool isRubyRun() const { return true; } - virtual const char* renderName() const { return "RenderRubyRun (anonymous)"; } - virtual bool createsAnonymousWrapper() const { return true; } - virtual void removeLeftoverAnonymousBlock(RenderBlock*) { } +private: + UChar m_lastCharacter; + UChar m_secondToLastCharacter; }; -inline RenderRubyRun* toRenderRubyRun(RenderObject* object) -{ - ASSERT_WITH_SECURITY_IMPLICATION(!object || object->isRubyRun()); - return static_cast<RenderRubyRun*>(object); -} - -inline const RenderRubyRun* toRenderRubyRun(const RenderObject* object) -{ - ASSERT_WITH_SECURITY_IMPLICATION(!object || object->isBox()); - return static_cast<const RenderRubyRun*>(object); -} - -void toRenderRubyRun(const RenderRubyRun*); - } // namespace WebCore +SPECIALIZE_TYPE_TRAITS_RENDER_OBJECT(RenderRubyRun, isRubyRun()) + #endif // RenderRubyRun_h |