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