2014-07-22 19:08:01 -07: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-base-container" */
|
|
|
|
|
|
|
|
#ifndef nsRubyBaseContainerFrame_h___
|
|
|
|
#define nsRubyBaseContainerFrame_h___
|
|
|
|
|
|
|
|
#include "nsContainerFrame.h"
|
2015-04-07 14:23:57 -07:00
|
|
|
|
2014-07-22 19:08:01 -07:00
|
|
|
/**
|
|
|
|
* Factory function.
|
|
|
|
* @return a newly allocated nsRubyBaseContainerFrame (infallible)
|
|
|
|
*/
|
|
|
|
nsContainerFrame* NS_NewRubyBaseContainerFrame(nsIPresShell* aPresShell,
|
|
|
|
nsStyleContext* aContext);
|
|
|
|
|
2015-04-07 16:22:34 -07:00
|
|
|
namespace mozilla {
|
|
|
|
struct RubyColumn;
|
|
|
|
}
|
|
|
|
|
2015-03-21 09:28:04 -07:00
|
|
|
class nsRubyBaseContainerFrame final : public nsContainerFrame
|
2014-07-22 19:08:01 -07:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_DECL_FRAMEARENA_HELPERS
|
|
|
|
NS_DECL_QUERYFRAME_TARGET(nsRubyBaseContainerFrame)
|
|
|
|
NS_DECL_QUERYFRAME
|
|
|
|
|
|
|
|
// nsIFrame overrides
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual nsIAtom* GetType() const override;
|
|
|
|
virtual bool IsFrameOfType(uint32_t aFlags) const override;
|
|
|
|
virtual bool CanContinueTextRun() const override;
|
2014-11-25 20:52:48 -08:00
|
|
|
virtual void AddInlineMinISize(nsRenderingContext *aRenderingContext,
|
2015-03-21 09:28:04 -07:00
|
|
|
InlineMinISizeData *aData) override;
|
2014-11-25 20:52:48 -08:00
|
|
|
virtual void AddInlinePrefISize(nsRenderingContext *aRenderingContext,
|
2015-03-21 09:28:04 -07:00
|
|
|
InlinePrefISizeData *aData) override;
|
2014-11-25 20:52:49 -08:00
|
|
|
virtual mozilla::LogicalSize
|
|
|
|
ComputeSize(nsRenderingContext *aRenderingContext,
|
|
|
|
mozilla::WritingMode aWritingMode,
|
|
|
|
const mozilla::LogicalSize& aCBSize,
|
|
|
|
nscoord aAvailableISize,
|
|
|
|
const mozilla::LogicalSize& aMargin,
|
|
|
|
const mozilla::LogicalSize& aBorder,
|
|
|
|
const mozilla::LogicalSize& aPadding,
|
2015-03-21 09:28:04 -07:00
|
|
|
ComputeSizeFlags aFlags) override;
|
2014-08-15 10:34:20 -07:00
|
|
|
virtual void Reflow(nsPresContext* aPresContext,
|
|
|
|
nsHTMLReflowMetrics& aDesiredSize,
|
|
|
|
const nsHTMLReflowState& aReflowState,
|
2015-03-21 09:28:04 -07:00
|
|
|
nsReflowStatus& aStatus) override;
|
2014-07-22 19:08:01 -07:00
|
|
|
|
2014-11-25 20:52:49 -08:00
|
|
|
virtual nscoord
|
2015-03-21 09:28:04 -07:00
|
|
|
GetLogicalBaseline(mozilla::WritingMode aWritingMode) const override;
|
2014-11-25 20:52:49 -08:00
|
|
|
|
2014-07-22 19:08:01 -07:00
|
|
|
#ifdef DEBUG_FRAME_DUMP
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual nsresult GetFrameName(nsAString& aResult) const override;
|
2014-07-22 19:08:01 -07:00
|
|
|
#endif
|
|
|
|
|
|
|
|
protected:
|
|
|
|
friend nsContainerFrame*
|
|
|
|
NS_NewRubyBaseContainerFrame(nsIPresShell* aPresShell,
|
|
|
|
nsStyleContext* aContext);
|
2014-08-31 20:36:37 -07:00
|
|
|
explicit nsRubyBaseContainerFrame(nsStyleContext* aContext) : nsContainerFrame(aContext) {}
|
2014-11-25 20:52:48 -08:00
|
|
|
|
2014-12-28 20:03:38 -08:00
|
|
|
struct ReflowState;
|
|
|
|
nscoord ReflowColumns(const ReflowState& aReflowState,
|
2014-11-25 20:52:50 -08:00
|
|
|
nsReflowStatus& aStatus);
|
2014-12-28 20:03:38 -08:00
|
|
|
nscoord ReflowOneColumn(const ReflowState& aReflowState,
|
2014-12-29 15:05:54 -08:00
|
|
|
uint32_t aColumnIndex,
|
2014-12-28 20:22:19 -08:00
|
|
|
const mozilla::RubyColumn& aColumn,
|
2014-12-28 19:30:00 -08:00
|
|
|
nsReflowStatus& aStatus);
|
2014-12-28 20:03:38 -08:00
|
|
|
nscoord ReflowSpans(const ReflowState& aReflowState);
|
2014-11-25 20:52:50 -08:00
|
|
|
|
2014-11-25 20:52:50 -08:00
|
|
|
struct PullFrameState;
|
|
|
|
|
|
|
|
// Pull ruby base and corresponding ruby text frames from
|
|
|
|
// continuations after them.
|
2014-12-28 19:30:00 -08:00
|
|
|
void PullOneColumn(nsLineLayout* aLineLayout,
|
|
|
|
PullFrameState& aPullFrameState,
|
2014-12-28 20:22:19 -08:00
|
|
|
mozilla::RubyColumn& aColumn,
|
2014-12-28 19:30:00 -08:00
|
|
|
bool& aIsComplete);
|
2014-11-25 20:52:50 -08:00
|
|
|
|
2014-11-25 20:52:49 -08:00
|
|
|
nscoord mBaseline;
|
2014-07-22 19:08:01 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* nsRubyBaseContainerFrame_h___ */
|