2014-07-23 02:08:01 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=2 et sw=2 tw=80: */
|
|
|
|
/* This Source Code is subject to the terms of the Mozilla Public License
|
|
|
|
* version 2.0 (the "License"). You can obtain a copy of the License at
|
|
|
|
* http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
/* rendering object for CSS "display: ruby" */
|
|
|
|
|
|
|
|
#ifndef nsRubyFrame_h___
|
|
|
|
#define nsRubyFrame_h___
|
|
|
|
|
2015-01-15 09:02:11 +00:00
|
|
|
#include "nsInlineFrame.h"
|
2014-07-23 02:08:01 +00:00
|
|
|
|
2014-11-26 04:52:50 +00:00
|
|
|
class nsRubyBaseContainerFrame;
|
|
|
|
|
2014-07-23 02:08:01 +00:00
|
|
|
/**
|
|
|
|
* Factory function.
|
|
|
|
* @return a newly allocated nsRubyFrame (infallible)
|
|
|
|
*/
|
|
|
|
nsContainerFrame* NS_NewRubyFrame(nsIPresShell* aPresShell,
|
|
|
|
nsStyleContext* aContext);
|
|
|
|
|
2016-04-18 06:11:08 +00:00
|
|
|
class nsRubyFrame final : public nsInlineFrame
|
2014-07-23 02:08:01 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_DECL_FRAMEARENA_HELPERS
|
|
|
|
NS_DECL_QUERYFRAME_TARGET(nsRubyFrame)
|
|
|
|
NS_DECL_QUERYFRAME
|
|
|
|
|
|
|
|
// nsIFrame overrides
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual nsIAtom* GetType() const override;
|
|
|
|
virtual bool IsFrameOfType(uint32_t aFlags) const override;
|
2014-08-15 17:34:20 +00:00
|
|
|
virtual void AddInlineMinISize(nsRenderingContext *aRenderingContext,
|
2015-03-21 16:28:04 +00:00
|
|
|
InlineMinISizeData *aData) override;
|
2014-08-15 17:34:20 +00:00
|
|
|
virtual void AddInlinePrefISize(nsRenderingContext *aRenderingContext,
|
2015-03-21 16:28:04 +00:00
|
|
|
InlinePrefISizeData *aData) override;
|
2014-08-15 17:34:20 +00:00
|
|
|
virtual void Reflow(nsPresContext* aPresContext,
|
|
|
|
nsHTMLReflowMetrics& aDesiredSize,
|
2016-07-21 10:36:35 +00:00
|
|
|
const ReflowInput& aReflowState,
|
2015-03-21 16:28:04 +00:00
|
|
|
nsReflowStatus& aStatus) override;
|
2014-07-23 02:08:01 +00:00
|
|
|
|
|
|
|
#ifdef DEBUG_FRAME_DUMP
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual nsresult GetFrameName(nsAString& aResult) const override;
|
2014-07-23 02:08:01 +00:00
|
|
|
#endif
|
|
|
|
|
2015-12-04 02:08:17 +00:00
|
|
|
void GetBlockLeadings(nscoord& aStartLeading, nscoord& aEndLeading)
|
|
|
|
{
|
|
|
|
aStartLeading = mBStartLeading;
|
|
|
|
aEndLeading = mBEndLeading;
|
|
|
|
}
|
|
|
|
|
2014-07-23 02:08:01 +00:00
|
|
|
protected:
|
|
|
|
friend nsContainerFrame* NS_NewRubyFrame(nsIPresShell* aPresShell,
|
|
|
|
nsStyleContext* aContext);
|
2015-01-15 09:02:11 +00:00
|
|
|
explicit nsRubyFrame(nsStyleContext* aContext)
|
2016-04-18 06:11:08 +00:00
|
|
|
: nsInlineFrame(aContext) {}
|
2014-11-26 04:52:50 +00:00
|
|
|
|
|
|
|
void ReflowSegment(nsPresContext* aPresContext,
|
2016-07-21 10:36:35 +00:00
|
|
|
const ReflowInput& aReflowState,
|
2014-11-26 04:52:50 +00:00
|
|
|
nsRubyBaseContainerFrame* aBaseContainer,
|
|
|
|
nsReflowStatus& aStatus);
|
|
|
|
|
2016-01-27 05:58:53 +00:00
|
|
|
nsRubyBaseContainerFrame* PullOneSegment(const nsLineLayout* aLineLayout,
|
|
|
|
ContinuationTraversingState& aState);
|
2015-12-04 02:08:17 +00:00
|
|
|
|
|
|
|
// The leading required to put the annotations.
|
|
|
|
// They are not initialized until the first reflow.
|
|
|
|
nscoord mBStartLeading;
|
|
|
|
nscoord mBEndLeading;
|
2014-07-23 02:08:01 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* nsRubyFrame_h___ */
|