2008-04-11 12:44:58 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 15:12:37 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2008-04-11 12:44:58 +04:00
|
|
|
|
|
|
|
#ifndef nsFirstLetterFrame_h__
|
|
|
|
#define nsFirstLetterFrame_h__
|
|
|
|
|
|
|
|
/* rendering object for CSS :first-letter pseudo-element */
|
|
|
|
|
2012-09-14 20:10:08 +04:00
|
|
|
#include "mozilla/Attributes.h"
|
2011-12-28 00:18:48 +04:00
|
|
|
#include "nsContainerFrame.h"
|
2008-04-11 12:44:58 +04:00
|
|
|
|
2014-01-12 08:05:49 +04:00
|
|
|
class nsFirstLetterFrame MOZ_FINAL : public nsContainerFrame {
|
2008-04-11 12:44:58 +04:00
|
|
|
public:
|
2010-11-27 18:21:00 +03:00
|
|
|
NS_DECL_QUERYFRAME_TARGET(nsFirstLetterFrame)
|
|
|
|
NS_DECL_QUERYFRAME
|
2009-09-12 20:49:24 +04:00
|
|
|
NS_DECL_FRAMEARENA_HELPERS
|
|
|
|
|
2014-09-01 07:36:37 +04:00
|
|
|
explicit nsFirstLetterFrame(nsStyleContext* aContext) : nsContainerFrame(aContext) {}
|
2011-12-28 00:18:48 +04:00
|
|
|
|
2013-02-14 15:12:27 +04:00
|
|
|
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|
|
|
const nsRect& aDirtyRect,
|
|
|
|
const nsDisplayListSet& aLists) MOZ_OVERRIDE;
|
2008-04-11 12:44:58 +04:00
|
|
|
|
2014-05-25 02:20:40 +04:00
|
|
|
virtual void Init(nsIContent* aContent,
|
|
|
|
nsContainerFrame* aParent,
|
|
|
|
nsIFrame* aPrevInFlow) MOZ_OVERRIDE;
|
2014-05-28 23:36:58 +04:00
|
|
|
virtual void SetInitialChildList(ChildListID aListID,
|
2014-05-28 23:36:58 +04:00
|
|
|
nsFrameList& aChildList) MOZ_OVERRIDE;
|
2014-01-06 03:31:14 +04:00
|
|
|
#ifdef DEBUG_FRAME_DUMP
|
2014-02-18 11:47:48 +04:00
|
|
|
virtual nsresult GetFrameName(nsAString& aResult) const MOZ_OVERRIDE;
|
2008-04-11 12:44:58 +04:00
|
|
|
#endif
|
2012-09-14 20:10:08 +04:00
|
|
|
virtual nsIAtom* GetType() const MOZ_OVERRIDE;
|
2008-04-11 12:44:58 +04:00
|
|
|
|
2012-02-22 03:50:16 +04:00
|
|
|
bool IsFloating() const { return GetStateBits() & NS_FRAME_OUT_OF_FLOW; }
|
|
|
|
|
2013-05-14 20:33:23 +04:00
|
|
|
virtual bool IsFrameOfType(uint32_t aFlags) const MOZ_OVERRIDE
|
2008-04-11 12:44:58 +04:00
|
|
|
{
|
2012-02-22 03:50:16 +04:00
|
|
|
if (!IsFloating())
|
2008-04-11 12:44:58 +04:00
|
|
|
aFlags = aFlags & ~(nsIFrame::eLineParticipant);
|
2011-12-28 00:18:48 +04:00
|
|
|
return nsContainerFrame::IsFrameOfType(aFlags &
|
2008-04-11 12:44:58 +04:00
|
|
|
~(nsIFrame::eBidiInlineContainer));
|
|
|
|
}
|
|
|
|
|
2014-07-24 21:03:25 +04:00
|
|
|
virtual nscoord GetMinISize(nsRenderingContext *aRenderingContext) MOZ_OVERRIDE;
|
|
|
|
virtual nscoord GetPrefISize(nsRenderingContext *aRenderingContext) MOZ_OVERRIDE;
|
2014-07-24 21:03:25 +04:00
|
|
|
virtual void AddInlineMinISize(nsRenderingContext *aRenderingContext,
|
|
|
|
InlineMinISizeData *aData) MOZ_OVERRIDE;
|
|
|
|
virtual void AddInlinePrefISize(nsRenderingContext *aRenderingContext,
|
|
|
|
InlinePrefISizeData *aData) MOZ_OVERRIDE;
|
2014-08-24 18:34:44 +04: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,
|
2014-11-11 14:02:41 +03:00
|
|
|
ComputeSizeFlags aFlags) MOZ_OVERRIDE;
|
2014-08-24 18:34:44 +04:00
|
|
|
|
2014-05-13 04:47:52 +04:00
|
|
|
virtual void Reflow(nsPresContext* aPresContext,
|
|
|
|
nsHTMLReflowMetrics& aDesiredSize,
|
|
|
|
const nsHTMLReflowState& aReflowState,
|
|
|
|
nsReflowStatus& aStatus) MOZ_OVERRIDE;
|
2008-04-11 12:44:58 +04:00
|
|
|
|
2012-09-14 20:10:08 +04:00
|
|
|
virtual bool CanContinueTextRun() const MOZ_OVERRIDE;
|
2014-06-17 16:19:38 +04:00
|
|
|
virtual nscoord GetLogicalBaseline(mozilla::WritingMode aWritingMode) const MOZ_OVERRIDE;
|
2014-06-28 14:13:13 +04:00
|
|
|
virtual LogicalSides GetLogicalSkipSides(const nsHTMLReflowState* aReflowState = nullptr) const MOZ_OVERRIDE;
|
2008-04-11 12:44:58 +04:00
|
|
|
|
|
|
|
//override of nsFrame method
|
2014-02-18 11:47:48 +04:00
|
|
|
virtual nsresult GetChildFrameContainingOffset(int32_t inContentOffset,
|
2014-02-18 12:36:33 +04:00
|
|
|
bool inHint,
|
|
|
|
int32_t* outFrameContentOffset,
|
|
|
|
nsIFrame** outChildFrame) MOZ_OVERRIDE;
|
2008-04-11 12:44:58 +04:00
|
|
|
|
|
|
|
nscoord GetFirstLetterBaseline() const { return mBaseline; }
|
|
|
|
|
2010-03-17 20:30:30 +03:00
|
|
|
// For floating first letter frames, create a continuation for aChild and
|
|
|
|
// place it in the correct place. aContinuation is an outparam for the
|
|
|
|
// continuation that is created. aIsFluid determines if the continuation is
|
|
|
|
// fluid or not.
|
|
|
|
nsresult CreateContinuationForFloatingParent(nsPresContext* aPresContext,
|
|
|
|
nsIFrame* aChild,
|
|
|
|
nsIFrame** aContinuation,
|
2011-09-29 10:19:26 +04:00
|
|
|
bool aIsFluid);
|
2010-03-17 20:30:30 +03:00
|
|
|
|
2008-04-11 12:44:58 +04:00
|
|
|
protected:
|
|
|
|
nscoord mBaseline;
|
|
|
|
|
|
|
|
void DrainOverflowFrames(nsPresContext* aPresContext);
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* nsFirstLetterFrame_h__ */
|