2001-09-29 00:14:13 +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/. */
|
2006-03-29 22:29:03 +04:00
|
|
|
|
|
|
|
/* rendering object for HTML <br> elements */
|
|
|
|
|
1999-09-10 00:53:18 +04:00
|
|
|
#include "nsCOMPtr.h"
|
1998-09-09 02:34:40 +04:00
|
|
|
#include "nsFrame.h"
|
2004-08-01 03:15:21 +04:00
|
|
|
#include "nsPresContext.h"
|
1998-09-15 04:19:49 +04:00
|
|
|
#include "nsLineLayout.h"
|
1998-09-09 02:34:40 +04:00
|
|
|
#include "nsStyleConsts.h"
|
2007-01-30 03:06:41 +03:00
|
|
|
#include "nsGkAtoms.h"
|
2011-04-08 05:04:40 +04:00
|
|
|
#include "nsRenderingContext.h"
|
2007-05-05 10:09:50 +04:00
|
|
|
#include "nsLayoutUtils.h"
|
1998-09-09 02:34:40 +04:00
|
|
|
|
1999-11-23 23:30:21 +03:00
|
|
|
//FOR SELECTION
|
|
|
|
#include "nsIContent.h"
|
|
|
|
//END INCLUDES FOR SELECTION
|
|
|
|
|
2012-09-29 01:53:44 +04:00
|
|
|
using namespace mozilla;
|
|
|
|
|
1998-10-03 08:28:05 +04:00
|
|
|
class BRFrame : public nsFrame {
|
1998-09-09 02:34:40 +04:00
|
|
|
public:
|
2009-09-12 20:49:24 +04:00
|
|
|
NS_DECL_FRAMEARENA_HELPERS
|
|
|
|
|
2006-03-27 01:30:36 +04:00
|
|
|
friend nsIFrame* NS_NewBRFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
|
|
|
|
2014-02-24 18:41:56 +04:00
|
|
|
virtual ContentOffsets CalcContentOffsetsFromFramePoint(nsPoint aPoint) MOZ_OVERRIDE;
|
2005-12-08 02:08:39 +03:00
|
|
|
|
2014-03-13 18:14:37 +04:00
|
|
|
virtual FrameSearchResult PeekOffsetNoAmount(bool aForward, int32_t* aOffset) MOZ_OVERRIDE;
|
|
|
|
virtual FrameSearchResult PeekOffsetCharacter(bool aForward, int32_t* aOffset,
|
2014-02-24 18:41:56 +04:00
|
|
|
bool aRespectClusters = true) MOZ_OVERRIDE;
|
2014-03-13 18:14:37 +04:00
|
|
|
virtual FrameSearchResult PeekOffsetWord(bool aForward, bool aWordSelectEatSpace,
|
2014-02-24 18:41:56 +04:00
|
|
|
bool aIsKeyboardSelect, int32_t* aOffset,
|
|
|
|
PeekWordState* aState) MOZ_OVERRIDE;
|
1998-09-09 02:34:40 +04:00
|
|
|
|
2014-05-13 04:47:52 +04:00
|
|
|
virtual void Reflow(nsPresContext* aPresContext,
|
2014-02-18 12:36:33 +04:00
|
|
|
nsHTMLReflowMetrics& aDesiredSize,
|
|
|
|
const nsHTMLReflowState& aReflowState,
|
2014-02-24 18:41:56 +04:00
|
|
|
nsReflowStatus& aStatus) MOZ_OVERRIDE;
|
2011-04-08 05:04:40 +04:00
|
|
|
virtual void AddInlineMinWidth(nsRenderingContext *aRenderingContext,
|
2014-02-24 18:41:56 +04:00
|
|
|
InlineMinWidthData *aData) MOZ_OVERRIDE;
|
2011-04-08 05:04:40 +04:00
|
|
|
virtual void AddInlinePrefWidth(nsRenderingContext *aRenderingContext,
|
2014-02-24 18:41:56 +04:00
|
|
|
InlinePrefWidthData *aData) MOZ_OVERRIDE;
|
|
|
|
virtual nscoord GetMinWidth(nsRenderingContext *aRenderingContext) MOZ_OVERRIDE;
|
|
|
|
virtual nscoord GetPrefWidth(nsRenderingContext *aRenderingContext) MOZ_OVERRIDE;
|
|
|
|
virtual nsIAtom* GetType() const MOZ_OVERRIDE;
|
|
|
|
virtual nscoord GetBaseline() const MOZ_OVERRIDE;
|
2007-02-24 21:33:33 +03:00
|
|
|
|
2014-02-24 18:41:56 +04:00
|
|
|
virtual bool IsFrameOfType(uint32_t aFlags) const MOZ_OVERRIDE
|
2007-02-24 21:33:33 +03:00
|
|
|
{
|
2007-05-18 10:04:04 +04:00
|
|
|
return nsFrame::IsFrameOfType(aFlags & ~(nsIFrame::eReplaced |
|
|
|
|
nsIFrame::eLineParticipant));
|
2007-02-24 21:33:33 +03:00
|
|
|
}
|
2006-07-12 18:35:43 +04:00
|
|
|
|
2010-06-28 16:02:03 +04:00
|
|
|
#ifdef ACCESSIBILITY
|
2012-09-29 01:53:44 +04:00
|
|
|
virtual mozilla::a11y::AccType AccessibleType() MOZ_OVERRIDE;
|
2006-07-12 18:35:43 +04:00
|
|
|
#endif
|
2006-07-12 17:51:50 +04:00
|
|
|
|
1998-09-09 02:34:40 +04:00
|
|
|
protected:
|
2006-03-27 01:30:36 +04:00
|
|
|
BRFrame(nsStyleContext* aContext) : nsFrame(aContext) {}
|
1998-09-09 02:34:40 +04:00
|
|
|
virtual ~BRFrame();
|
2011-11-24 06:48:23 +04:00
|
|
|
|
|
|
|
nscoord mAscent;
|
1998-09-09 02:34:40 +04:00
|
|
|
};
|
|
|
|
|
2005-11-01 23:40:54 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewBRFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
|
1998-09-09 02:34:40 +04:00
|
|
|
{
|
2006-03-27 01:30:36 +04:00
|
|
|
return new (aPresShell) BRFrame(aContext);
|
1998-09-09 02:34:40 +04:00
|
|
|
}
|
|
|
|
|
2009-09-12 20:49:24 +04:00
|
|
|
NS_IMPL_FRAMEARENA_HELPERS(BRFrame)
|
|
|
|
|
1998-09-09 02:34:40 +04:00
|
|
|
BRFrame::~BRFrame()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2014-05-13 04:47:52 +04:00
|
|
|
void
|
2004-08-01 03:15:21 +04:00
|
|
|
BRFrame::Reflow(nsPresContext* aPresContext,
|
1998-10-03 08:28:05 +04:00
|
|
|
nsHTMLReflowMetrics& aMetrics,
|
|
|
|
const nsHTMLReflowState& aReflowState,
|
|
|
|
nsReflowStatus& aStatus)
|
1998-09-09 02:34:40 +04:00
|
|
|
{
|
Bug 300030: Move intrinsic width computation out of nsIFrame::Reflow and into its own methods on nsIFrame. Replace reflow reasons, types, and commands with dirty bits/notifications. Thanks to bzbarsky for almost all of the HTML form controls (mozilla/layout/forms) changes, and many others for help testing and patching. For detailed commit logs, see REFLOW_YYYYMMDD_BRANCH, where YYYYMMDD is one of 20061031, 20060830, 20060603, 20060302, 20060119, 20051011, 20050804, 20050429, 20050315, 20050111, and 20041213.
2006-12-08 08:38:33 +03:00
|
|
|
DO_GLOBAL_REFLOW_COUNT("BRFrame");
|
2001-11-14 16:40:03 +03:00
|
|
|
DISPLAY_REFLOW(aPresContext, this, aReflowState, aMetrics, aStatus);
|
2013-12-27 21:59:52 +04:00
|
|
|
aMetrics.Height() = 0; // BR frames with height 0 are ignored in quirks
|
2000-02-15 07:26:44 +03:00
|
|
|
// mode by nsLineLayout::VerticalAlignFrames .
|
|
|
|
// However, it's not always 0. See below.
|
2013-12-27 21:59:52 +04:00
|
|
|
aMetrics.Width() = 0;
|
|
|
|
aMetrics.SetTopAscent(0);
|
1998-09-09 02:34:40 +04:00
|
|
|
|
1999-03-26 03:37:22 +03:00
|
|
|
// Only when the BR is operating in a line-layout situation will it
|
|
|
|
// behave like a BR.
|
1999-10-29 18:32:11 +04:00
|
|
|
nsLineLayout* ll = aReflowState.mLineLayout;
|
|
|
|
if (ll) {
|
2002-08-11 22:00:07 +04:00
|
|
|
// Note that the compatibility mode check excludes AlmostStandards
|
|
|
|
// mode, since this is the inline box model. See bug 161691.
|
2008-06-14 12:28:07 +04:00
|
|
|
if ( ll->LineIsEmpty() ||
|
2007-10-02 06:36:26 +04:00
|
|
|
aPresContext->CompatibilityMode() == eCompatibility_FullStandards ) {
|
2008-06-14 12:28:07 +04:00
|
|
|
// The line is logically empty; any whitespace is trimmed away.
|
1999-04-03 22:57:30 +04:00
|
|
|
//
|
2000-02-15 07:26:44 +03:00
|
|
|
// If this frame is going to terminate the line we know
|
1999-04-03 22:57:30 +04:00
|
|
|
// that nothing else will go on the line. Therefore, in this
|
2000-02-15 07:26:44 +03:00
|
|
|
// case, we provide some height for the BR frame so that it
|
|
|
|
// creates some vertical whitespace. It's necessary to use the
|
|
|
|
// line-height rather than the font size because the
|
|
|
|
// quirks-mode fix that doesn't apply the block's min
|
|
|
|
// line-height makes this necessary to make BR cause a line
|
|
|
|
// of the full line-height
|
|
|
|
|
|
|
|
// We also do this in strict mode because BR should act like a
|
|
|
|
// normal inline frame. That line-height is used is important
|
2009-04-22 21:13:48 +04:00
|
|
|
// here for cases where the line-height is less than 1.
|
2011-08-14 21:08:04 +04:00
|
|
|
nsRefPtr<nsFontMetrics> fm;
|
2011-11-24 06:48:23 +04:00
|
|
|
nsLayoutUtils::GetFontMetricsForFrame(this, getter_AddRefs(fm),
|
2012-05-21 09:18:28 +04:00
|
|
|
nsLayoutUtils::FontSizeInflationFor(this));
|
2011-08-14 21:08:04 +04:00
|
|
|
aReflowState.rendContext->SetFont(fm); // FIXME: maybe not needed?
|
1999-09-10 00:53:18 +04:00
|
|
|
if (fm) {
|
2009-05-19 02:13:12 +04:00
|
|
|
nscoord logicalHeight = aReflowState.CalcLineHeight();
|
2013-12-27 21:59:52 +04:00
|
|
|
aMetrics.Height() = logicalHeight;
|
|
|
|
aMetrics.SetTopAscent(nsLayoutUtils::GetCenteredFontBaseline(fm, logicalHeight));
|
1999-09-10 00:53:18 +04:00
|
|
|
}
|
|
|
|
else {
|
2013-12-27 21:59:52 +04:00
|
|
|
aMetrics.SetTopAscent(aMetrics.Height() = 0);
|
1999-09-10 00:53:18 +04:00
|
|
|
}
|
2014-05-23 02:10:20 +04:00
|
|
|
|
|
|
|
// XXX temporary until I figure out a better solution; see the
|
|
|
|
// code in nsLineLayout::VerticalAlignFrames that zaps minY/maxY
|
|
|
|
// if the width is zero.
|
|
|
|
// XXX This also fixes bug 10036!
|
|
|
|
// Warning: nsTextControlFrame::CalculateSizeStandard depends on
|
|
|
|
// the following line, see bug 228752.
|
|
|
|
aMetrics.Width() = 1;
|
1999-04-03 22:57:30 +04:00
|
|
|
}
|
1999-03-26 03:37:22 +03:00
|
|
|
|
|
|
|
// Return our reflow status
|
2012-08-22 19:56:38 +04:00
|
|
|
uint32_t breakType = aReflowState.mStyleDisplay->mBreakType;
|
1999-03-26 03:37:22 +03:00
|
|
|
if (NS_STYLE_CLEAR_NONE == breakType) {
|
|
|
|
breakType = NS_STYLE_CLEAR_LINE;
|
|
|
|
}
|
1998-10-03 08:28:05 +04:00
|
|
|
|
1999-03-26 03:37:22 +03:00
|
|
|
aStatus = NS_INLINE_BREAK | NS_INLINE_BREAK_AFTER |
|
|
|
|
NS_INLINE_MAKE_BREAK_TYPE(breakType);
|
2011-10-17 18:59:28 +04:00
|
|
|
ll->SetLineEndsInBR(true);
|
1999-03-26 03:37:22 +03:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
aStatus = NS_FRAME_COMPLETE;
|
|
|
|
}
|
2010-10-07 08:25:46 +04:00
|
|
|
|
|
|
|
aMetrics.SetOverflowAreasToDesiredBounds();
|
2002-05-29 02:50:43 +04:00
|
|
|
|
2013-12-27 21:59:52 +04:00
|
|
|
mAscent = aMetrics.TopAscent();
|
2011-11-24 06:48:23 +04:00
|
|
|
|
2002-05-29 02:50:43 +04:00
|
|
|
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aMetrics);
|
1998-09-09 02:34:40 +04:00
|
|
|
}
|
1999-06-20 00:36:44 +04:00
|
|
|
|
Bug 300030: Move intrinsic width computation out of nsIFrame::Reflow and into its own methods on nsIFrame. Replace reflow reasons, types, and commands with dirty bits/notifications. Thanks to bzbarsky for almost all of the HTML form controls (mozilla/layout/forms) changes, and many others for help testing and patching. For detailed commit logs, see REFLOW_YYYYMMDD_BRANCH, where YYYYMMDD is one of 20061031, 20060830, 20060603, 20060302, 20060119, 20051011, 20050804, 20050429, 20050315, 20050111, and 20041213.
2006-12-08 08:38:33 +03:00
|
|
|
/* virtual */ void
|
2011-04-08 05:04:40 +04:00
|
|
|
BRFrame::AddInlineMinWidth(nsRenderingContext *aRenderingContext,
|
Bug 300030: Move intrinsic width computation out of nsIFrame::Reflow and into its own methods on nsIFrame. Replace reflow reasons, types, and commands with dirty bits/notifications. Thanks to bzbarsky for almost all of the HTML form controls (mozilla/layout/forms) changes, and many others for help testing and patching. For detailed commit logs, see REFLOW_YYYYMMDD_BRANCH, where YYYYMMDD is one of 20061031, 20060830, 20060603, 20060302, 20060119, 20051011, 20050804, 20050429, 20050315, 20050111, and 20041213.
2006-12-08 08:38:33 +03:00
|
|
|
nsIFrame::InlineMinWidthData *aData)
|
|
|
|
{
|
2007-06-22 02:32:47 +04:00
|
|
|
aData->ForceBreak(aRenderingContext);
|
Bug 300030: Move intrinsic width computation out of nsIFrame::Reflow and into its own methods on nsIFrame. Replace reflow reasons, types, and commands with dirty bits/notifications. Thanks to bzbarsky for almost all of the HTML form controls (mozilla/layout/forms) changes, and many others for help testing and patching. For detailed commit logs, see REFLOW_YYYYMMDD_BRANCH, where YYYYMMDD is one of 20061031, 20060830, 20060603, 20060302, 20060119, 20051011, 20050804, 20050429, 20050315, 20050111, and 20041213.
2006-12-08 08:38:33 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
/* virtual */ void
|
2011-04-08 05:04:40 +04:00
|
|
|
BRFrame::AddInlinePrefWidth(nsRenderingContext *aRenderingContext,
|
Bug 300030: Move intrinsic width computation out of nsIFrame::Reflow and into its own methods on nsIFrame. Replace reflow reasons, types, and commands with dirty bits/notifications. Thanks to bzbarsky for almost all of the HTML form controls (mozilla/layout/forms) changes, and many others for help testing and patching. For detailed commit logs, see REFLOW_YYYYMMDD_BRANCH, where YYYYMMDD is one of 20061031, 20060830, 20060603, 20060302, 20060119, 20051011, 20050804, 20050429, 20050315, 20050111, and 20041213.
2006-12-08 08:38:33 +03:00
|
|
|
nsIFrame::InlinePrefWidthData *aData)
|
|
|
|
{
|
2007-06-22 02:32:47 +04:00
|
|
|
aData->ForceBreak(aRenderingContext);
|
Bug 300030: Move intrinsic width computation out of nsIFrame::Reflow and into its own methods on nsIFrame. Replace reflow reasons, types, and commands with dirty bits/notifications. Thanks to bzbarsky for almost all of the HTML form controls (mozilla/layout/forms) changes, and many others for help testing and patching. For detailed commit logs, see REFLOW_YYYYMMDD_BRANCH, where YYYYMMDD is one of 20061031, 20060830, 20060603, 20060302, 20060119, 20051011, 20050804, 20050429, 20050315, 20050111, and 20041213.
2006-12-08 08:38:33 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
/* virtual */ nscoord
|
2011-04-08 05:04:40 +04:00
|
|
|
BRFrame::GetMinWidth(nsRenderingContext *aRenderingContext)
|
Bug 300030: Move intrinsic width computation out of nsIFrame::Reflow and into its own methods on nsIFrame. Replace reflow reasons, types, and commands with dirty bits/notifications. Thanks to bzbarsky for almost all of the HTML form controls (mozilla/layout/forms) changes, and many others for help testing and patching. For detailed commit logs, see REFLOW_YYYYMMDD_BRANCH, where YYYYMMDD is one of 20061031, 20060830, 20060603, 20060302, 20060119, 20051011, 20050804, 20050429, 20050315, 20050111, and 20041213.
2006-12-08 08:38:33 +03:00
|
|
|
{
|
|
|
|
nscoord result = 0;
|
|
|
|
DISPLAY_MIN_WIDTH(this, result);
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* virtual */ nscoord
|
2011-04-08 05:04:40 +04:00
|
|
|
BRFrame::GetPrefWidth(nsRenderingContext *aRenderingContext)
|
Bug 300030: Move intrinsic width computation out of nsIFrame::Reflow and into its own methods on nsIFrame. Replace reflow reasons, types, and commands with dirty bits/notifications. Thanks to bzbarsky for almost all of the HTML form controls (mozilla/layout/forms) changes, and many others for help testing and patching. For detailed commit logs, see REFLOW_YYYYMMDD_BRANCH, where YYYYMMDD is one of 20061031, 20060830, 20060603, 20060302, 20060119, 20051011, 20050804, 20050429, 20050315, 20050111, and 20041213.
2006-12-08 08:38:33 +03:00
|
|
|
{
|
|
|
|
nscoord result = 0;
|
|
|
|
DISPLAY_PREF_WIDTH(this, result);
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2003-10-31 23:19:18 +03:00
|
|
|
nsIAtom*
|
|
|
|
BRFrame::GetType() const
|
2000-02-15 07:26:44 +03:00
|
|
|
{
|
2006-12-26 20:47:52 +03:00
|
|
|
return nsGkAtoms::brFrame;
|
2000-02-15 07:26:44 +03:00
|
|
|
}
|
1999-06-20 00:36:44 +04:00
|
|
|
|
2010-08-31 22:54:44 +04:00
|
|
|
nscoord
|
|
|
|
BRFrame::GetBaseline() const
|
|
|
|
{
|
2011-11-24 06:48:23 +04:00
|
|
|
return mAscent;
|
2010-08-31 22:54:44 +04:00
|
|
|
}
|
|
|
|
|
2006-02-27 08:57:37 +03:00
|
|
|
nsIFrame::ContentOffsets BRFrame::CalcContentOffsetsFromFramePoint(nsPoint aPoint)
|
1999-09-30 00:04:05 +04:00
|
|
|
{
|
2006-02-27 08:57:37 +03:00
|
|
|
ContentOffsets offsets;
|
|
|
|
offsets.content = mContent->GetParent();
|
|
|
|
if (offsets.content) {
|
|
|
|
offsets.offset = offsets.content->IndexOf(mContent);
|
|
|
|
offsets.secondaryOffset = offsets.offset;
|
2011-10-17 18:59:28 +04:00
|
|
|
offsets.associateWithNext = true;
|
2005-12-08 02:08:39 +03:00
|
|
|
}
|
2006-02-27 08:57:37 +03:00
|
|
|
return offsets;
|
1999-11-23 23:30:21 +03:00
|
|
|
}
|
|
|
|
|
2014-03-13 18:14:37 +04:00
|
|
|
nsIFrame::FrameSearchResult
|
2012-08-22 19:56:38 +04:00
|
|
|
BRFrame::PeekOffsetNoAmount(bool aForward, int32_t* aOffset)
|
1999-11-23 23:30:21 +03:00
|
|
|
{
|
2006-09-12 00:43:01 +04:00
|
|
|
NS_ASSERTION (aOffset && *aOffset <= 1, "aOffset out of range");
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t startOffset = *aOffset;
|
2006-09-12 00:43:01 +04:00
|
|
|
// If we hit the end of a BR going backwards, go to its beginning and stay there.
|
|
|
|
if (!aForward && startOffset != 0) {
|
|
|
|
*aOffset = 0;
|
2014-03-13 18:14:37 +04:00
|
|
|
return FOUND;
|
2006-07-12 02:11:02 +04:00
|
|
|
}
|
2006-09-12 00:43:01 +04:00
|
|
|
// Otherwise, stop if we hit the beginning, continue (forward) if we hit the end.
|
2014-03-13 18:14:37 +04:00
|
|
|
return (startOffset == 0) ? FOUND : CONTINUE;
|
2006-09-12 00:43:01 +04:00
|
|
|
}
|
2005-09-19 09:16:25 +04:00
|
|
|
|
2014-03-13 18:14:37 +04:00
|
|
|
nsIFrame::FrameSearchResult
|
2012-08-22 19:56:38 +04:00
|
|
|
BRFrame::PeekOffsetCharacter(bool aForward, int32_t* aOffset,
|
2011-09-29 10:19:26 +04:00
|
|
|
bool aRespectClusters)
|
2006-09-12 00:43:01 +04:00
|
|
|
{
|
|
|
|
NS_ASSERTION (aOffset && *aOffset <= 1, "aOffset out of range");
|
|
|
|
// Keep going. The actual line jumping will stop us.
|
2014-03-13 18:14:37 +04:00
|
|
|
return CONTINUE;
|
2006-09-12 00:43:01 +04:00
|
|
|
}
|
1999-11-23 23:30:21 +03:00
|
|
|
|
2014-03-13 18:14:37 +04:00
|
|
|
nsIFrame::FrameSearchResult
|
2011-09-29 10:19:26 +04:00
|
|
|
BRFrame::PeekOffsetWord(bool aForward, bool aWordSelectEatSpace, bool aIsKeyboardSelect,
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t* aOffset, PeekWordState* aState)
|
2006-09-12 00:43:01 +04:00
|
|
|
{
|
|
|
|
NS_ASSERTION (aOffset && *aOffset <= 1, "aOffset out of range");
|
|
|
|
// Keep going. The actual line jumping will stop us.
|
2014-03-13 18:14:37 +04:00
|
|
|
return CONTINUE;
|
1999-09-30 00:04:05 +04:00
|
|
|
}
|
2006-07-12 17:51:50 +04:00
|
|
|
|
|
|
|
#ifdef ACCESSIBILITY
|
2012-09-29 01:53:44 +04:00
|
|
|
a11y::AccType
|
|
|
|
BRFrame::AccessibleType()
|
2006-07-12 17:51:50 +04:00
|
|
|
{
|
2008-07-23 08:50:20 +04:00
|
|
|
nsIContent *parent = mContent->GetParent();
|
2012-09-29 01:53:44 +04:00
|
|
|
if (parent && parent->IsRootOfNativeAnonymousSubtree() &&
|
2008-07-23 08:50:20 +04:00
|
|
|
parent->GetChildCount() == 1) {
|
2008-01-14 17:34:40 +03:00
|
|
|
// This <br> is the only node in a text control, therefore it is the hacky
|
|
|
|
// "bogus node" used when there is no text in the control
|
2012-12-12 14:04:12 +04:00
|
|
|
return a11y::eNoType;
|
2006-07-12 17:51:50 +04:00
|
|
|
}
|
2012-09-29 01:53:44 +04:00
|
|
|
|
2012-12-18 05:25:52 +04:00
|
|
|
return a11y::eHTMLBRType;
|
2006-07-12 17:51:50 +04:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|