summaryrefslogtreecommitdiff
path: root/Source/WebCore/rendering/RenderRubyRun.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/rendering/RenderRubyRun.h')
-rw-r--r--Source/WebCore/rendering/RenderRubyRun.h53
1 files changed, 30 insertions, 23 deletions
diff --git a/Source/WebCore/rendering/RenderRubyRun.h b/Source/WebCore/rendering/RenderRubyRun.h
index 1fe20821c..c6677ec6f 100644
--- a/Source/WebCore/rendering/RenderRubyRun.h
+++ b/Source/WebCore/rendering/RenderRubyRun.h
@@ -28,8 +28,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef RenderRubyRun_h
-#define RenderRubyRun_h
+#pragma once
#include "RenderBlockFlow.h"
@@ -38,49 +37,57 @@ 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 final : public RenderBlockFlow {
public:
- RenderRubyRun(Document&, PassRef<RenderStyle>);
+ RenderRubyRun(Document&, RenderStyle&&);
virtual ~RenderRubyRun();
bool hasRubyText() const;
bool hasRubyBase() const;
- bool isEmpty() const;
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();
+ RenderObject* layoutSpecialExcludedChild(bool relayoutChildren) override;
+ void layout() override;
+ void layoutBlock(bool relayoutChildren, LayoutUnit pageHeight = 0) override;
- virtual bool isChildAllowed(const RenderObject&, const RenderStyle&) const;
- virtual void addChild(RenderObject* child, RenderObject* beforeChild = 0);
- virtual void removeChild(RenderObject&) override;
+ bool isChildAllowed(const RenderObject&, const RenderStyle&) const override;
+ void addChild(RenderObject* child, RenderObject* beforeChild = 0) override;
+ void removeChild(RenderObject&) override;
- virtual RenderBlock* firstLineBlock() const;
- virtual void updateFirstLetter();
+ RenderBlock* firstLineBlock() const override;
+ void updateFirstLetter(RenderTreeMutationIsAllowed = RenderTreeMutationIsAllowed::Yes) 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:
- virtual bool isRubyRun() const { return true; }
- virtual const char* renderName() const { return "RenderRubyRun (anonymous)"; }
- virtual bool createsAnonymousWrapper() const { return true; }
- virtual void removeLeftoverAnonymousBlock(RenderBlock*) { }
-};
-
-template<> inline bool isRendererOfType<const RenderRubyRun>(const RenderObject& renderer) { return renderer.isRubyRun(); }
+ bool isRubyRun() const override { return true; }
+ const char* renderName() const override { return "RenderRubyRun (anonymous)"; }
+ bool createsAnonymousWrapper() const override { return true; }
+ void removeLeftoverAnonymousBlock(RenderBlock*) override { }
-RENDER_OBJECT_TYPE_CASTS(RenderRubyRun, isRubyRun())
+private:
+ UChar m_lastCharacter;
+ UChar m_secondToLastCharacter;
+};
} // namespace WebCore
-#endif // RenderRubyRun_h
+SPECIALIZE_TYPE_TRAITS_RENDER_OBJECT(RenderRubyRun, isRubyRun())