summaryrefslogtreecommitdiff
path: root/Source/WebCore/rendering/RenderRubyBase.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/rendering/RenderRubyBase.h')
-rw-r--r--Source/WebCore/rendering/RenderRubyBase.h37
1 files changed, 26 insertions, 11 deletions
diff --git a/Source/WebCore/rendering/RenderRubyBase.h b/Source/WebCore/rendering/RenderRubyBase.h
index 0e1f0c396..977dd7708 100644
--- a/Source/WebCore/rendering/RenderRubyBase.h
+++ b/Source/WebCore/rendering/RenderRubyBase.h
@@ -28,8 +28,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef RenderRubyBase_h
-#define RenderRubyBase_h
+#pragma once
#include "RenderBlockFlow.h"
@@ -39,28 +38,44 @@ class RenderRubyRun;
class RenderRubyBase final : public RenderBlockFlow {
public:
- RenderRubyBase(Document&, PassRef<RenderStyle>);
+ RenderRubyBase(Document&, RenderStyle&&);
virtual ~RenderRubyBase();
- virtual const char* renderName() const { return "RenderRubyBase (anonymous)"; }
+ const char* renderName() const override { return "RenderRubyBase (anonymous)"; }
+
+ RenderRubyRun* rubyRun() const;
+
+ void setIsAfterExpansion(bool isAfterExpansion) { m_isAfterExpansion = isAfterExpansion; }
+ bool isAfterExpansion() { return m_isAfterExpansion; }
+
+ void setInitialOffset(float initialOffset) { m_initialOffset = initialOffset; }
- virtual bool isRubyBase() const { return true; }
+ void reset()
+ {
+ m_initialOffset = 0;
+ m_isAfterExpansion = true;
+ }
+
+ void cachePriorCharactersIfNeeded(const LazyLineBreakIterator&) override;
private:
- virtual bool isChildAllowed(const RenderObject&, const RenderStyle&) const;
- virtual ETextAlign textAlignmentForLine(bool endsWithSoftBreak) const;
- virtual void adjustInlineDirectionLineBounds(int expansionOpportunityCount, float& logicalLeft, float& logicalWidth) const;
+ bool isRubyBase() const override { return true; }
+ bool isChildAllowed(const RenderObject&, const RenderStyle&) const override;
+ ETextAlign textAlignmentForLine(bool endsWithSoftBreak) const override;
+ void adjustInlineDirectionLineBounds(int expansionOpportunityCount, float& logicalLeft, float& logicalWidth) const override;
+ void mergeChildrenWithBase(RenderRubyBase& toBlock);
void moveChildren(RenderRubyBase* toBase, RenderObject* beforeChild = 0);
void moveInlineChildren(RenderRubyBase* toBase, RenderObject* beforeChild = 0);
void moveBlockChildren(RenderRubyBase* toBase, RenderObject* beforeChild = 0);
- RenderRubyRun* rubyRun() const;
-
// Allow RenderRubyRun to manipulate the children within ruby bases.
friend class RenderRubyRun;
+
+ float m_initialOffset;
+ unsigned m_isAfterExpansion : 1;
};
} // namespace WebCore
-#endif // RenderRubyBase_h
+SPECIALIZE_TYPE_TRAITS_RENDER_OBJECT(RenderRubyBase, isRubyBase())