2017-10-27 20:33:53 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
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
|
|
|
|
|
|
|
/* base class of all rendering objects */
|
|
|
|
|
1998-04-14 00:24:54 +04:00
|
|
|
#ifndef nsFrame_h___
|
|
|
|
#define nsFrame_h___
|
|
|
|
|
2012-09-14 20:10:08 +04:00
|
|
|
#include "mozilla/Attributes.h"
|
2013-09-25 15:21:18 +04:00
|
|
|
#include "mozilla/EventForwards.h"
|
2012-10-26 17:32:10 +04:00
|
|
|
#include "mozilla/Likely.h"
|
2004-09-28 22:37:50 +04:00
|
|
|
#include "nsBox.h"
|
2015-05-19 21:15:34 +03:00
|
|
|
#include "mozilla/Logging.h"
|
1998-04-14 00:24:54 +04:00
|
|
|
|
1999-12-05 02:49:50 +03:00
|
|
|
#include "nsIPresShell.h"
|
2016-07-21 13:36:34 +03:00
|
|
|
#include "mozilla/ReflowInput.h"
|
2011-01-20 01:39:31 +03:00
|
|
|
#include "nsHTMLParts.h"
|
2013-08-22 22:32:52 +04:00
|
|
|
#include "nsISelectionDisplay.h"
|
1999-12-05 02:49:50 +03:00
|
|
|
|
2018-05-08 20:52:36 +03:00
|
|
|
namespace mozilla {
|
|
|
|
enum class TableSelection : uint32_t;
|
|
|
|
} // namespace mozilla
|
|
|
|
|
1998-05-20 20:24:36 +04:00
|
|
|
/**
|
|
|
|
* nsFrame logging constants. We redefine the nspr
|
|
|
|
* PRLogModuleInfo.level field to be a bitfield. Each bit controls a
|
|
|
|
* specific type of logging. Each logging operation has associated
|
|
|
|
* inline methods defined below.
|
2017-04-05 00:36:21 +03:00
|
|
|
*
|
|
|
|
* Due to the redefinition of the level field we cannot use MOZ_LOG directly
|
|
|
|
* as that will cause assertions due to invalid log levels.
|
1998-05-20 20:24:36 +04:00
|
|
|
*/
|
|
|
|
#define NS_FRAME_TRACE_CALLS 0x1
|
|
|
|
#define NS_FRAME_TRACE_PUSH_PULL 0x2
|
|
|
|
#define NS_FRAME_TRACE_CHILD_REFLOW 0x4
|
1998-06-25 20:33:10 +04:00
|
|
|
#define NS_FRAME_TRACE_NEW_FRAMES 0x8
|
1998-05-20 20:24:36 +04:00
|
|
|
|
2015-11-06 01:35:03 +03:00
|
|
|
#define NS_FRAME_LOG_TEST(_lm, _bit) \
|
|
|
|
(int(((mozilla::LogModule*)_lm)->Level()) & (_bit))
|
1998-05-20 20:24:36 +04:00
|
|
|
|
2012-06-25 23:59:42 +04:00
|
|
|
#ifdef DEBUG
|
1998-05-20 20:24:36 +04:00
|
|
|
# define NS_FRAME_LOG(_bit, _args) \
|
|
|
|
PR_BEGIN_MACRO \
|
2015-11-06 01:35:03 +03:00
|
|
|
if (NS_FRAME_LOG_TEST(nsFrame::sFrameLogModule, _bit)) { \
|
2017-04-05 00:36:21 +03:00
|
|
|
printf_stderr _args; \
|
1998-05-20 20:24:36 +04:00
|
|
|
} \
|
|
|
|
PR_END_MACRO
|
|
|
|
#else
|
|
|
|
# define NS_FRAME_LOG(_bit, _args)
|
|
|
|
#endif
|
|
|
|
|
1998-06-25 20:33:10 +04:00
|
|
|
// XXX Need to rework this so that logging is free when it's off
|
2012-06-25 23:59:42 +04:00
|
|
|
#ifdef DEBUG
|
2011-10-17 18:59:28 +04:00
|
|
|
# define NS_FRAME_TRACE_IN(_method) Trace(_method, true)
|
1998-06-25 20:33:10 +04:00
|
|
|
|
2011-10-17 18:59:28 +04:00
|
|
|
# define NS_FRAME_TRACE_OUT(_method) Trace(_method, false)
|
1998-06-25 20:33:10 +04:00
|
|
|
|
|
|
|
// XXX remove me
|
|
|
|
# define NS_FRAME_TRACE_MSG(_bit, _args) \
|
|
|
|
PR_BEGIN_MACRO \
|
2015-11-06 01:35:03 +03:00
|
|
|
if (NS_FRAME_LOG_TEST(nsFrame::sFrameLogModule, _bit)) { \
|
1998-06-25 20:33:10 +04:00
|
|
|
TraceMsg _args; \
|
|
|
|
} \
|
|
|
|
PR_END_MACRO
|
|
|
|
|
|
|
|
# define NS_FRAME_TRACE(_bit, _args) \
|
|
|
|
PR_BEGIN_MACRO \
|
2015-11-06 01:35:03 +03:00
|
|
|
if (NS_FRAME_LOG_TEST(nsFrame::sFrameLogModule, _bit)) { \
|
1998-06-25 20:33:10 +04:00
|
|
|
TraceMsg _args; \
|
|
|
|
} \
|
|
|
|
PR_END_MACRO
|
|
|
|
|
2011-10-17 18:59:28 +04:00
|
|
|
# define NS_FRAME_TRACE_REFLOW_IN(_method) Trace(_method, true)
|
1998-06-25 20:33:10 +04:00
|
|
|
|
1998-05-20 20:24:36 +04:00
|
|
|
# define NS_FRAME_TRACE_REFLOW_OUT(_method, _status) \
|
2011-10-17 18:59:28 +04:00
|
|
|
Trace(_method, false, _status)
|
1998-06-25 20:33:10 +04:00
|
|
|
|
1998-05-20 20:24:36 +04:00
|
|
|
#else
|
1998-07-08 02:07:35 +04:00
|
|
|
# define NS_FRAME_TRACE(_bits, _args)
|
1998-05-20 20:24:36 +04:00
|
|
|
# define NS_FRAME_TRACE_IN(_method)
|
|
|
|
# define NS_FRAME_TRACE_OUT(_method)
|
1998-06-25 20:33:10 +04:00
|
|
|
# define NS_FRAME_TRACE_MSG(_bits, _args)
|
1998-05-20 20:24:36 +04:00
|
|
|
# define NS_FRAME_TRACE_REFLOW_IN(_method)
|
|
|
|
# define NS_FRAME_TRACE_REFLOW_OUT(_method, _status)
|
|
|
|
#endif
|
|
|
|
|
2015-11-04 12:57:35 +03:00
|
|
|
// Frame allocation boilerplate macros. Every subclass of nsFrame must
|
|
|
|
// either use NS_{DECL,IMPL}_FRAMEARENA_HELPERS pair for allocating
|
|
|
|
// memory correctly, or use NS_DECL_ABSTRACT_FRAME to declare a frame
|
|
|
|
// class abstract and stop it from being instantiated. If a frame class
|
|
|
|
// without its own operator new and GetFrameId gets instantiated, the
|
|
|
|
// per-frame recycler lists in nsPresArena will not work correctly,
|
|
|
|
// with potentially catastrophic consequences (not enough memory is
|
|
|
|
// allocated for a frame object).
|
2009-09-12 20:49:24 +04:00
|
|
|
|
2017-05-26 13:11:11 +03:00
|
|
|
#define NS_DECL_FRAMEARENA_HELPERS(class) \
|
|
|
|
NS_DECL_QUERYFRAME_TARGET(class) \
|
2017-05-26 13:11:11 +03:00
|
|
|
static constexpr nsIFrame::ClassID kClassID = nsIFrame::ClassID::class##_id; \
|
2017-05-26 13:11:11 +03:00
|
|
|
void* operator new(size_t, nsIPresShell*) MOZ_MUST_OVERRIDE; \
|
|
|
|
nsQueryFrame::FrameIID GetFrameId() override MOZ_MUST_OVERRIDE { \
|
|
|
|
return nsQueryFrame::class##_id; \
|
|
|
|
}
|
2009-09-12 20:49:24 +04:00
|
|
|
|
|
|
|
#define NS_IMPL_FRAMEARENA_HELPERS(class) \
|
|
|
|
void* class ::operator new(size_t sz, nsIPresShell* aShell) { \
|
2009-09-16 02:00:04 +04:00
|
|
|
return aShell->AllocateFrame(nsQueryFrame::class##_id, sz); \
|
|
|
|
}
|
2009-09-12 20:49:24 +04:00
|
|
|
|
2015-11-04 12:57:35 +03:00
|
|
|
#define NS_DECL_ABSTRACT_FRAME(class) \
|
|
|
|
void* operator new(size_t, nsIPresShell*) MOZ_MUST_OVERRIDE = delete; \
|
|
|
|
virtual nsQueryFrame::FrameIID GetFrameId() override MOZ_MUST_OVERRIDE = 0;
|
|
|
|
|
1998-05-20 20:24:36 +04:00
|
|
|
//----------------------------------------------------------------------
|
1998-04-14 00:24:54 +04:00
|
|
|
|
2004-09-28 22:37:50 +04:00
|
|
|
struct nsBoxLayoutMetrics;
|
2013-09-07 06:15:49 +04:00
|
|
|
struct nsRect;
|
2004-09-28 22:37:50 +04:00
|
|
|
|
1998-10-17 00:09:32 +04:00
|
|
|
/**
|
|
|
|
* Implementation of a simple frame that's not splittable and has no
|
|
|
|
* child frames.
|
|
|
|
*
|
|
|
|
* Sets the NS_FRAME_SYNCHRONIZE_FRAME_AND_VIEW bit, so the default
|
|
|
|
* behavior is to keep the frame and view position and size in sync.
|
|
|
|
*/
|
2004-09-28 22:37:50 +04:00
|
|
|
class nsFrame : public nsBox {
|
1998-04-14 00:24:54 +04:00
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* Create a new "empty" frame that maps a given piece of content into a
|
|
|
|
* 0,0 area.
|
|
|
|
*/
|
2009-08-18 07:21:06 +04:00
|
|
|
friend nsIFrame* NS_NewEmptyFrame(nsIPresShell* aShell,
|
2018-03-22 21:20:41 +03:00
|
|
|
ComputedStyle* aStyle);
|
1999-12-05 02:49:50 +03:00
|
|
|
|
1999-12-05 05:24:02 +03:00
|
|
|
private:
|
2009-08-18 07:21:06 +04:00
|
|
|
// Left undefined; nsFrame objects are never allocated from the heap.
|
|
|
|
void* operator new(size_t sz) CPP_THROW_NEW;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
// Overridden to prevent the global delete from being called, since
|
|
|
|
// the memory came out of an arena instead of the heap.
|
|
|
|
//
|
|
|
|
// Ideally this would be private and undefined, like the normal
|
|
|
|
// operator new. Unfortunately, the C++ standard requires an
|
|
|
|
// overridden operator delete to be accessible to any subclass that
|
|
|
|
// defines a virtual destructor, so we can only make it protected;
|
|
|
|
// worse, some C++ compilers will synthesize calls to this function
|
|
|
|
// from the "deleting destructors" that they emit in case of
|
|
|
|
// delete-expressions, so it can't even be undefined.
|
|
|
|
void operator delete(void* aPtr, size_t sz);
|
1999-12-05 02:49:50 +03:00
|
|
|
|
|
|
|
public:
|
2009-01-12 22:20:59 +03:00
|
|
|
// nsQueryFrame
|
|
|
|
NS_DECL_QUERYFRAME
|
2017-05-26 13:11:11 +03:00
|
|
|
NS_DECL_QUERYFRAME_TARGET(nsFrame)
|
|
|
|
virtual nsQueryFrame::FrameIID GetFrameId() MOZ_MUST_OVERRIDE {
|
|
|
|
return kFrameIID;
|
|
|
|
}
|
2015-01-06 23:15:20 +03:00
|
|
|
void* operator new(size_t, nsIPresShell*) MOZ_MUST_OVERRIDE;
|
1998-04-14 00:24:54 +04:00
|
|
|
|
1998-06-02 09:28:11 +04:00
|
|
|
// nsIFrame
|
2017-01-18 03:27:03 +03:00
|
|
|
void Init(nsIContent* aContent, nsContainerFrame* aParent,
|
2017-01-18 03:27:03 +03:00
|
|
|
nsIFrame* aPrevInFlow) override;
|
2017-11-07 03:20:33 +03:00
|
|
|
void DestroyFrom(nsIFrame* aDestructRoot,
|
|
|
|
PostDestroyData& aPostDestroyData) override;
|
2018-03-22 21:20:41 +03:00
|
|
|
ComputedStyle* GetAdditionalComputedStyle(int32_t aIndex) const override;
|
|
|
|
void SetAdditionalComputedStyle(int32_t aIndex,
|
|
|
|
ComputedStyle* aComputedStyle) override;
|
2017-01-18 03:27:03 +03:00
|
|
|
nscoord GetLogicalBaseline(mozilla::WritingMode aWritingMode) const override;
|
|
|
|
const nsFrameList& GetChildList(ChildListID aListID) const override;
|
|
|
|
void GetChildLists(nsTArray<ChildList>* aLists) const override;
|
2011-08-25 00:54:29 +04:00
|
|
|
|
2017-01-18 03:27:03 +03:00
|
|
|
nsresult HandleEvent(nsPresContext* aPresContext,
|
|
|
|
mozilla::WidgetGUIEvent* aEvent,
|
|
|
|
nsEventStatus* aEventStatus) override;
|
2017-01-18 03:27:03 +03:00
|
|
|
nsresult GetContentForEvent(mozilla::WidgetEvent* aEvent,
|
2017-01-18 03:27:03 +03:00
|
|
|
nsIContent** aContent) override;
|
2017-01-18 03:27:03 +03:00
|
|
|
nsresult GetCursor(const nsPoint& aPoint, nsIFrame::Cursor& aCursor) override;
|
1999-02-12 03:02:31 +03:00
|
|
|
|
2017-01-18 03:27:03 +03:00
|
|
|
nsresult GetPointFromOffset(int32_t inOffset, nsPoint* outPoint) override;
|
|
|
|
nsresult GetCharacterRectsInRange(int32_t aInOffset, int32_t aLength,
|
2017-01-18 03:27:03 +03:00
|
|
|
nsTArray<nsRect>& aOutRect) override;
|
1999-02-12 03:02:31 +03:00
|
|
|
|
2017-01-18 03:27:03 +03:00
|
|
|
nsresult GetChildFrameContainingOffset(int32_t inContentOffset, bool inHint,
|
2017-01-18 03:27:03 +03:00
|
|
|
int32_t* outFrameContentOffset,
|
|
|
|
nsIFrame** outChildFrame) override;
|
1999-02-12 03:02:31 +03:00
|
|
|
|
2017-01-18 03:27:03 +03:00
|
|
|
static nsresult GetNextPrevLineFromeBlockFrame(nsPresContext* aPresContext,
|
2017-07-06 15:00:35 +03:00
|
|
|
nsPeekOffsetStruct* aPos,
|
|
|
|
nsIFrame* aBlockFrame,
|
|
|
|
int32_t aLineStart,
|
2017-01-18 03:27:03 +03:00
|
|
|
int8_t aOutSideLimit);
|
2006-06-16 05:54:31 +04:00
|
|
|
|
2018-02-27 17:30:27 +03:00
|
|
|
nsresult CharacterDataChanged(const CharacterDataChangeInfo& aInfo) override;
|
2017-01-18 03:27:03 +03:00
|
|
|
nsresult AttributeChanged(int32_t aNameSpaceID, nsAtom* aAttribute,
|
|
|
|
int32_t aModType) override;
|
2017-01-18 03:27:03 +03:00
|
|
|
nsIFrame* GetPrevContinuation() const override;
|
|
|
|
void SetPrevContinuation(nsIFrame*) override;
|
|
|
|
nsIFrame* GetNextContinuation() const override;
|
|
|
|
void SetNextContinuation(nsIFrame*) override;
|
|
|
|
nsIFrame* GetPrevInFlowVirtual() const override;
|
|
|
|
void SetPrevInFlow(nsIFrame*) override;
|
|
|
|
nsIFrame* GetNextInFlowVirtual() const override;
|
|
|
|
void SetNextInFlow(nsIFrame*) override;
|
|
|
|
|
2017-01-18 03:27:03 +03:00
|
|
|
nsresult GetSelectionController(nsPresContext* aPresContext,
|
|
|
|
nsISelectionController** aSelCon) override;
|
2017-01-18 03:27:03 +03:00
|
|
|
|
2017-01-18 03:27:03 +03:00
|
|
|
FrameSearchResult PeekOffsetNoAmount(bool aForward,
|
|
|
|
int32_t* aOffset) override;
|
Bug 1375825 - part2: ContentEventHandler::ExpandToClusterBoundary() should check the return value of nsTextFrame::PeekOffsetCharacter() r=jfkthame
ContentEventHandler::ExpandToClusterBoundary() doesn't check the return value of nsTextFrame::PeekOffsetCharacter(). Therefore, it may set its result to reversed offset. (e.g., when aForward is true and offset is 6, the result may be 5. When aForward is false and offset is 5, the result may be 6.)
For avoiding that, ContentEventHandler::ExpandToClusterBoundary() should check the result and only when it returns nsIFrame::FOUND, it should compute the proper offset.
On the other hand, it's too bad for ContentEventHandler that nsTextFrame::PeekOffsetCharacter() to return nsIFrame::CONTINUE_UNSELECTABLE when the user-select style is "all" because IME doesn't expect such cases.
Therefore, this patch adds additional argument to nsIFrame::PeekOffsetCharacter(), aOptions which is a struct containing bool members. The reason why it's not a bit mask enum is, such struct doesn't cause simple mistake at checking the value and the code is shorter. When mIgnoreUserStyleAll of it is true, this patch makes nsTextFrame not return nsIFrame::CONTINUE_UNSELECTABLE.
MozReview-Commit-ID: ACNNBTP92YZ
--HG--
extra : rebase_source : bd85da902e7fb59135d15514cb20a5599a4a640b
2017-06-29 04:58:16 +03:00
|
|
|
FrameSearchResult PeekOffsetCharacter(
|
|
|
|
bool aForward, int32_t* aOffset,
|
|
|
|
PeekOffsetCharacterOptions aOptions =
|
|
|
|
PeekOffsetCharacterOptions()) override;
|
2017-01-18 03:27:03 +03:00
|
|
|
FrameSearchResult PeekOffsetWord(bool aForward, bool aWordSelectEatSpace,
|
|
|
|
bool aIsKeyboardSelect, int32_t* aOffset,
|
|
|
|
PeekWordState* aState) override;
|
2007-08-30 07:10:19 +04:00
|
|
|
/**
|
|
|
|
* Check whether we should break at a boundary between punctuation and
|
2008-03-03 11:37:34 +03:00
|
|
|
* non-punctuation. Only call it at a punctuation boundary
|
|
|
|
* (i.e. exactly one of the previous and next characters are punctuation).
|
|
|
|
* @param aForward true if we're moving forward in content order
|
|
|
|
* @param aPunctAfter true if the next character is punctuation
|
|
|
|
* @param aWhitespaceAfter true if the next character is whitespace
|
2007-08-30 07:10:19 +04:00
|
|
|
*/
|
2011-09-29 10:19:26 +04:00
|
|
|
bool BreakWordBetweenPunctuation(const PeekWordState* aState, bool aForward,
|
2017-01-18 03:27:03 +03:00
|
|
|
bool aPunctAfter, bool aWhitespaceAfter,
|
|
|
|
bool aIsKeyboardSelect);
|
2008-03-03 11:37:34 +03:00
|
|
|
|
2017-01-18 03:27:03 +03:00
|
|
|
nsresult CheckVisibility(nsPresContext* aContext, int32_t aStartIndex,
|
|
|
|
int32_t aEndIndex, bool aRecurse, bool* aFinished,
|
|
|
|
bool* _retval) override;
|
2000-07-26 15:31:12 +04:00
|
|
|
|
2017-01-18 03:27:03 +03:00
|
|
|
nsresult GetOffsets(int32_t& aStart, int32_t& aEnd) const override;
|
2017-01-18 03:27:03 +03:00
|
|
|
void ChildIsDirty(nsIFrame* aChild) override;
|
1999-02-18 06:25:23 +03:00
|
|
|
|
2001-08-17 07:13:07 +04:00
|
|
|
#ifdef ACCESSIBILITY
|
2017-01-18 03:27:03 +03:00
|
|
|
mozilla::a11y::AccType AccessibleType() override;
|
2001-08-17 07:13:07 +04:00
|
|
|
#endif
|
2001-05-18 03:52:32 +04:00
|
|
|
|
2018-03-22 21:20:41 +03:00
|
|
|
ComputedStyle* GetParentComputedStyle(
|
|
|
|
nsIFrame** aProviderFrame) const override {
|
|
|
|
return DoGetParentComputedStyle(aProviderFrame);
|
2011-09-12 20:08:07 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2018-03-23 16:49:21 +03:00
|
|
|
* Do the work for getting the parent ComputedStyle frame so that
|
2018-03-22 21:20:41 +03:00
|
|
|
* other frame's |GetParentComputedStyle| methods can call this
|
2011-09-12 20:08:07 +04:00
|
|
|
* method on *another* frame. (This function handles out-of-flow
|
|
|
|
* frames by using the frame manager's placeholder map and it also
|
|
|
|
* handles block-within-inline and generated content wrappers.)
|
2014-11-20 21:24:10 +03:00
|
|
|
*
|
|
|
|
* @param aProviderFrame (out) the frame associated with the returned value
|
2018-03-23 16:49:21 +03:00
|
|
|
* or null if the ComputedStyle is for display:contents content.
|
|
|
|
* @return The ComputedStyle that should be the parent of this frame's
|
|
|
|
* ComputedStyle. Null is permitted, and means that this frame's
|
|
|
|
* ComputedStyle should be the root of the ComputedStyle tree.
|
2011-09-12 20:08:07 +04:00
|
|
|
*/
|
2018-03-22 21:20:41 +03:00
|
|
|
ComputedStyle* DoGetParentComputedStyle(nsIFrame** aProviderFrame) const;
|
2000-09-13 02:47:09 +04:00
|
|
|
|
2017-01-18 03:27:03 +03:00
|
|
|
bool IsEmpty() override;
|
|
|
|
bool IsSelfEmpty() override;
|
2001-10-25 05:08:40 +04:00
|
|
|
|
2017-01-18 03:27:03 +03:00
|
|
|
void MarkIntrinsicISizesDirty() override;
|
2017-06-09 22:14:53 +03:00
|
|
|
nscoord GetMinISize(gfxContext* aRenderingContext) override;
|
|
|
|
nscoord GetPrefISize(gfxContext* aRenderingContext) override;
|
|
|
|
void AddInlineMinISize(gfxContext* aRenderingContext,
|
2017-01-18 03:27:03 +03:00
|
|
|
InlineMinISizeData* aData) override;
|
2017-06-09 22:14:53 +03:00
|
|
|
void AddInlinePrefISize(gfxContext* aRenderingContext,
|
2017-01-18 03:27:03 +03:00
|
|
|
InlinePrefISizeData* aData) override;
|
2018-04-10 01:16:58 +03:00
|
|
|
IntrinsicISizeOffsetData IntrinsicISizeOffsets(
|
|
|
|
nscoord aPercentageBasis = NS_UNCONSTRAINEDSIZE) override;
|
2017-01-18 03:27:03 +03:00
|
|
|
mozilla::IntrinsicSize GetIntrinsicSize() override;
|
|
|
|
nsSize GetIntrinsicRatio() override;
|
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
|
|
|
|
2017-01-18 03:27:03 +03:00
|
|
|
mozilla::LogicalSize ComputeSize(
|
2017-06-09 22:14:53 +03:00
|
|
|
gfxContext* aRenderingContext, mozilla::WritingMode aWM,
|
2014-08-24 18:34:44 +04:00
|
|
|
const mozilla::LogicalSize& aCBSize, nscoord aAvailableISize,
|
|
|
|
const mozilla::LogicalSize& aMargin, const mozilla::LogicalSize& aBorder,
|
|
|
|
const mozilla::LogicalSize& aPadding, ComputeSizeFlags aFlags) override;
|
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
|
|
|
|
2016-11-05 04:57:06 +03:00
|
|
|
/**
|
|
|
|
* Calculate the used values for 'width' and 'height' for a replaced element.
|
|
|
|
* http://www.w3.org/TR/CSS21/visudet.html#min-max-widths
|
|
|
|
*/
|
|
|
|
mozilla::LogicalSize ComputeSizeWithIntrinsicDimensions(
|
2017-06-09 22:14:53 +03:00
|
|
|
gfxContext* aRenderingContext, mozilla::WritingMode aWM,
|
2016-11-05 04:57:06 +03:00
|
|
|
const mozilla::IntrinsicSize& aIntrinsicSize, nsSize aIntrinsicRatio,
|
|
|
|
const mozilla::LogicalSize& aCBSize, const mozilla::LogicalSize& aMargin,
|
2016-11-05 04:57:06 +03:00
|
|
|
const mozilla::LogicalSize& aBorder, const mozilla::LogicalSize& aPadding,
|
|
|
|
ComputeSizeFlags aFlags);
|
2016-11-05 04:57:06 +03:00
|
|
|
|
2007-10-12 12:30:54 +04:00
|
|
|
// Compute tight bounds assuming this frame honours its border, background
|
|
|
|
// and outline, its children's tight bounds, and nothing else.
|
2015-12-16 00:56:41 +03:00
|
|
|
nsRect ComputeSimpleTightBounds(mozilla::gfx::DrawTarget* aDrawTarget) const;
|
2017-07-06 15:00:35 +03: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
|
|
|
/**
|
|
|
|
* A helper, used by |nsFrame::ComputeSize| (for frames that need to
|
|
|
|
* override only this part of ComputeSize), that computes the size
|
|
|
|
* that should be returned when 'width', 'height', and
|
|
|
|
* min/max-width/height are all 'auto' or equivalent.
|
|
|
|
*
|
|
|
|
* In general, frames that can accept any computed width/height should
|
|
|
|
* override only ComputeAutoSize, and frames that cannot do so need to
|
|
|
|
* override ComputeSize to enforce their width/height invariants.
|
|
|
|
*
|
|
|
|
* Implementations may optimize by returning a garbage width if
|
2013-02-17 01:51:02 +04:00
|
|
|
* StylePosition()->mWidth.GetUnit() != eStyleUnit_Auto, and
|
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
|
|
|
* likewise for height, since in such cases the result is guaranteed
|
|
|
|
* to be unused.
|
|
|
|
*/
|
2014-08-24 18:34:51 +04:00
|
|
|
virtual mozilla::LogicalSize ComputeAutoSize(
|
2017-06-09 22:14:53 +03:00
|
|
|
gfxContext* aRenderingContext, mozilla::WritingMode aWM,
|
2014-08-24 18:34:51 +04:00
|
|
|
const mozilla::LogicalSize& aCBSize, nscoord aAvailableISize,
|
|
|
|
const mozilla::LogicalSize& aMargin, const mozilla::LogicalSize& aBorder,
|
|
|
|
const mozilla::LogicalSize& aPadding, ComputeSizeFlags aFlags);
|
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
|
|
|
|
|
|
|
/**
|
|
|
|
* Utility function for ComputeAutoSize implementations. Return
|
2016-11-05 04:57:06 +03:00
|
|
|
* max(GetMinISize(), min(aISizeInCB, GetPrefISize()))
|
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
|
|
|
*/
|
2017-06-09 22:14:53 +03:00
|
|
|
nscoord ShrinkWidthToFit(gfxContext* aRenderingContext, nscoord aISizeInCB,
|
2016-11-05 04:57:06 +03:00
|
|
|
ComputeSizeFlags aFlags);
|
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
|
|
|
|
2012-08-29 12:01:09 +04:00
|
|
|
/**
|
|
|
|
* Calculates the size of this frame after reflowing (calling Reflow on, and
|
|
|
|
* updating the size and position of) its children, as necessary. The
|
2016-07-21 13:36:38 +03:00
|
|
|
* calculated size is returned to the caller via the ReflowOutput
|
2012-08-29 12:01:09 +04:00
|
|
|
* outparam. (The caller is responsible for setting the actual size and
|
|
|
|
* position of this frame.)
|
|
|
|
*
|
|
|
|
* A frame's children must _all_ be reflowed if the frame is dirty (the
|
|
|
|
* NS_FRAME_IS_DIRTY bit is set on it). Otherwise, individual children
|
|
|
|
* must be reflowed if they are dirty or have the NS_FRAME_HAS_DIRTY_CHILDREN
|
|
|
|
* bit set on them. Otherwise, whether children need to be reflowed depends
|
|
|
|
* on the frame's type (it's up to individual Reflow methods), and on what
|
|
|
|
* has changed. For example, a change in the width of the frame may require
|
|
|
|
* all of its children to be reflowed (even those without dirty bits set on
|
|
|
|
* them), whereas a change in its height might not.
|
2016-07-21 13:36:35 +03:00
|
|
|
* (ReflowInput::ShouldReflowAllKids may be helpful in deciding whether
|
2012-08-29 12:01:09 +04:00
|
|
|
* to reflow all the children, but for some frame types it might result in
|
|
|
|
* over-reflow.)
|
|
|
|
*
|
|
|
|
* Note: if it's only the overflow rect(s) of a frame that need to be
|
|
|
|
* updated, then UpdateOverflow should be called instead of Reflow.
|
|
|
|
*/
|
2017-01-18 03:27:03 +03:00
|
|
|
void Reflow(nsPresContext* aPresContext, ReflowOutput& aDesiredSize,
|
|
|
|
const ReflowInput& aReflowInput,
|
|
|
|
nsReflowStatus& aStatus) override;
|
|
|
|
void DidReflow(nsPresContext* aPresContext,
|
2017-12-14 18:21:49 +03:00
|
|
|
const ReflowInput* aReflowInput) override;
|
2013-02-24 04:06:55 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* NOTE: aStatus is assumed to be already-initialized. The reflow statuses of
|
|
|
|
* any reflowed absolute children will be merged into aStatus; aside from
|
|
|
|
* that, this method won't modify aStatus.
|
|
|
|
*/
|
2017-01-18 03:27:03 +03:00
|
|
|
void ReflowAbsoluteFrames(nsPresContext* aPresContext,
|
|
|
|
ReflowOutput& aDesiredSize,
|
2016-07-21 13:36:39 +03:00
|
|
|
const ReflowInput& aReflowInput,
|
2017-01-18 03:27:03 +03:00
|
|
|
nsReflowStatus& aStatus,
|
|
|
|
bool aConstrainBSize = true);
|
|
|
|
void FinishReflowWithAbsoluteFrames(nsPresContext* aPresContext,
|
|
|
|
ReflowOutput& aDesiredSize,
|
2016-07-21 13:36:39 +03:00
|
|
|
const ReflowInput& aReflowInput,
|
2017-01-18 03:27:03 +03:00
|
|
|
nsReflowStatus& aStatus,
|
|
|
|
bool aConstrainBSize = true);
|
2014-08-21 04:48:56 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* If this frame is dirty, marks all absolutely-positioned children of this
|
|
|
|
* frame dirty. If this frame isn't dirty, or if there are no
|
|
|
|
* absolutely-positioned children, does nothing.
|
|
|
|
*
|
|
|
|
* It's necessary to use PushDirtyBitToAbsoluteFrames() when you plan to
|
|
|
|
* reflow this frame's absolutely-positioned children after the dirty bit on
|
2016-07-21 13:36:35 +03:00
|
|
|
* this frame has already been cleared, which prevents ReflowInput from
|
2014-08-21 04:48:56 +04:00
|
|
|
* propagating the dirty bit normally. This situation generally only arises
|
|
|
|
* when a multipass layout algorithm is used.
|
|
|
|
*/
|
|
|
|
void PushDirtyBitToAbsoluteFrames();
|
|
|
|
|
2017-01-18 03:27:03 +03:00
|
|
|
bool CanContinueTextRun() const override;
|
1998-10-01 08:46:11 +04:00
|
|
|
|
2017-01-18 03:27:03 +03:00
|
|
|
bool ComputeCustomOverflow(nsOverflowAreas& aOverflowAreas) override;
|
2016-05-04 03:27:43 +03:00
|
|
|
|
2017-01-18 03:27:03 +03:00
|
|
|
void UnionChildOverflow(nsOverflowAreas& aOverflowAreas) override;
|
2011-06-16 01:03:49 +04:00
|
|
|
|
1998-10-08 22:21:32 +04:00
|
|
|
// Selection Methods
|
2012-09-11 01:02:23 +04:00
|
|
|
|
2004-08-01 03:15:21 +04:00
|
|
|
NS_IMETHOD HandlePress(nsPresContext* aPresContext,
|
2013-10-02 07:46:03 +04:00
|
|
|
mozilla::WidgetGUIEvent* aEvent,
|
|
|
|
nsEventStatus* aEventStatus);
|
1998-08-28 19:58:37 +04:00
|
|
|
|
2004-08-01 03:15:21 +04:00
|
|
|
NS_IMETHOD HandleMultiplePress(nsPresContext* aPresContext,
|
2013-10-02 07:46:03 +04:00
|
|
|
mozilla::WidgetGUIEvent* aEvent,
|
|
|
|
nsEventStatus* aEventStatus,
|
|
|
|
bool aControlHeld);
|
1999-05-17 04:21:18 +04:00
|
|
|
|
2004-08-01 03:15:21 +04:00
|
|
|
NS_IMETHOD HandleDrag(nsPresContext* aPresContext,
|
2013-10-02 07:46:03 +04:00
|
|
|
mozilla::WidgetGUIEvent* aEvent,
|
|
|
|
nsEventStatus* aEventStatus);
|
1998-08-28 19:58:37 +04:00
|
|
|
|
2004-08-01 03:15:21 +04:00
|
|
|
NS_IMETHOD HandleRelease(nsPresContext* aPresContext,
|
2013-10-02 07:46:03 +04:00
|
|
|
mozilla::WidgetGUIEvent* aEvent,
|
|
|
|
nsEventStatus* aEventStatus);
|
1998-08-28 19:58:37 +04:00
|
|
|
|
2012-09-11 01:02:23 +04:00
|
|
|
enum { SELECT_ACCUMULATE = 0x01 };
|
|
|
|
|
|
|
|
nsresult PeekBackwardAndForward(nsSelectionAmount aAmountBack,
|
|
|
|
nsSelectionAmount aAmountForward,
|
|
|
|
int32_t aStartPos, bool aJumpLines,
|
|
|
|
uint32_t aSelectFlags);
|
1999-09-30 00:04:05 +04:00
|
|
|
|
2012-09-11 01:02:23 +04:00
|
|
|
nsresult SelectByTypeAtPoint(nsPresContext* aPresContext,
|
|
|
|
const nsPoint& aPoint,
|
|
|
|
nsSelectionAmount aBeginAmountType,
|
|
|
|
nsSelectionAmount aEndAmountType,
|
|
|
|
uint32_t aSelectFlags);
|
1999-09-30 00:04:05 +04:00
|
|
|
|
2006-02-27 08:57:37 +03:00
|
|
|
// Helper for GetContentAndOffsetsFromPoint; calculation of content offsets
|
|
|
|
// in this function assumes there is no child frame that can be targeted.
|
2017-11-15 12:55:36 +03:00
|
|
|
virtual ContentOffsets CalcContentOffsetsFromFramePoint(
|
|
|
|
const nsPoint& aPoint);
|
2006-02-27 08:57:37 +03:00
|
|
|
|
2004-09-28 22:37:50 +04:00
|
|
|
// Box layout methods
|
2017-01-18 03:27:03 +03:00
|
|
|
nsSize GetXULPrefSize(nsBoxLayoutState& aBoxLayoutState) override;
|
|
|
|
nsSize GetXULMinSize(nsBoxLayoutState& aBoxLayoutState) override;
|
|
|
|
nsSize GetXULMaxSize(nsBoxLayoutState& aBoxLayoutState) override;
|
|
|
|
nscoord GetXULFlex() override;
|
|
|
|
nscoord GetXULBoxAscent(nsBoxLayoutState& aBoxLayoutState) override;
|
2004-09-28 22:37:50 +04:00
|
|
|
|
2009-08-18 07:21:06 +04:00
|
|
|
// We compute and store the HTML content's overflow area. So don't
|
|
|
|
// try to compute it in the box code.
|
2017-01-18 03:27:03 +03:00
|
|
|
bool ComputesOwnOverflowArea() override { return true; }
|
2009-08-18 07:21:06 +04:00
|
|
|
|
1998-06-06 01:06:24 +04:00
|
|
|
//--------------------------------------------------
|
|
|
|
// Additional methods
|
1998-06-04 02:49:45 +04:00
|
|
|
|
2011-01-12 04:09:22 +03:00
|
|
|
// Helper function that tests if the frame tree is too deep; if it is
|
|
|
|
// it marks the frame as "unflowable", zeroes out the metrics, sets
|
2011-10-17 18:59:28 +04:00
|
|
|
// the reflow status, and returns true. Otherwise, the frame is
|
2011-01-12 04:09:22 +03:00
|
|
|
// unmarked "unflowable" and the metrics and reflow status are not
|
2011-10-17 18:59:28 +04:00
|
|
|
// touched and false is returned.
|
2016-07-21 13:36:39 +03:00
|
|
|
bool IsFrameTreeTooDeep(const ReflowInput& aReflowInput,
|
2011-01-12 04:09:22 +03:00
|
|
|
ReflowOutput& aMetrics, nsReflowStatus& aStatus);
|
1999-08-28 01:48:06 +04:00
|
|
|
|
2010-10-07 08:25:45 +04:00
|
|
|
// Incorporate the child overflow areas into aOverflowAreas.
|
|
|
|
// If the child does not have a overflow, use the child area.
|
|
|
|
void ConsiderChildOverflow(nsOverflowAreas& aOverflowAreas,
|
2004-12-27 18:05:18 +03:00
|
|
|
nsIFrame* aChildFrame);
|
2003-09-13 20:21:41 +04:00
|
|
|
|
2012-11-08 20:09:38 +04:00
|
|
|
/**
|
|
|
|
* @return true if we should avoid a page/column break in this frame.
|
|
|
|
*/
|
2018-02-15 20:38:03 +03:00
|
|
|
bool ShouldAvoidBreakInside(const ReflowInput& aReflowInput) const;
|
2012-11-08 20:09:38 +04:00
|
|
|
|
2012-06-25 23:59:42 +04:00
|
|
|
#ifdef DEBUG
|
1998-05-20 20:24:36 +04:00
|
|
|
/**
|
|
|
|
* Tracing method that writes a method enter/exit routine to the
|
|
|
|
* nspr log using the nsIFrame log module. The tracing is only
|
|
|
|
* done when the NS_FRAME_TRACE_CALLS bit is set in the log module's
|
|
|
|
* level field.
|
|
|
|
*/
|
2011-09-29 10:19:26 +04:00
|
|
|
void Trace(const char* aMethod, bool aEnter);
|
2017-09-13 10:47:51 +03:00
|
|
|
void Trace(const char* aMethod, bool aEnter, const nsReflowStatus& aStatus);
|
2016-12-10 03:03:53 +03:00
|
|
|
void TraceMsg(const char* fmt, ...) MOZ_FORMAT_PRINTF(2, 3);
|
1999-07-24 06:37:06 +04:00
|
|
|
|
|
|
|
// Helper function that verifies that each frame in the list has the
|
|
|
|
// NS_FRAME_IS_DIRTY bit set
|
2009-07-28 16:53:20 +04:00
|
|
|
static void VerifyDirtyBitSet(const nsFrameList& aFrameList);
|
1998-05-20 20:24:36 +04:00
|
|
|
|
2017-07-06 15:00:35 +03:00
|
|
|
// Display Reflow Debugging
|
2004-08-01 03:15:21 +04:00
|
|
|
static void* DisplayReflowEnter(nsPresContext* aPresContext, nsIFrame* aFrame,
|
2016-07-21 13:36:39 +03:00
|
|
|
const ReflowInput& aReflowInput);
|
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
|
|
|
static void* DisplayLayoutEnter(nsIFrame* aFrame);
|
2014-07-24 21:03:26 +04:00
|
|
|
static void* DisplayIntrinsicISizeEnter(nsIFrame* aFrame, const char* aType);
|
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
|
|
|
static void* DisplayIntrinsicSizeEnter(nsIFrame* aFrame, const char* aType);
|
2017-02-10 12:29:10 +03:00
|
|
|
static void DisplayReflowExit(nsPresContext* aPresContext, nsIFrame* aFrame,
|
|
|
|
ReflowOutput& aMetrics,
|
|
|
|
const nsReflowStatus& aStatus,
|
|
|
|
void* aFrameTreeNode);
|
2017-01-18 03:27:03 +03:00
|
|
|
static void DisplayLayoutExit(nsIFrame* aFrame, void* aFrameTreeNode);
|
|
|
|
static void DisplayIntrinsicISizeExit(nsIFrame* aFrame, const char* aType,
|
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 aResult, void* aFrameTreeNode);
|
2017-01-18 03:27:03 +03:00
|
|
|
static void DisplayIntrinsicSizeExit(nsIFrame* aFrame, const char* aType,
|
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
|
|
|
nsSize aResult, void* aFrameTreeNode);
|
2003-03-22 18:09:17 +03:00
|
|
|
|
|
|
|
static void DisplayReflowStartup();
|
|
|
|
static void DisplayReflowShutdown();
|
1999-11-02 01:12:45 +03:00
|
|
|
#endif
|
1998-12-05 19:03:07 +03:00
|
|
|
|
2009-07-22 04:44:51 +04:00
|
|
|
/**
|
2012-09-13 14:34:23 +04:00
|
|
|
* Adds display items for standard CSS background if necessary.
|
2009-07-22 04:44:51 +04:00
|
|
|
* Does not check IsVisibleForPainting.
|
|
|
|
* @param aForceBackground draw the background even if the frame
|
|
|
|
* background style appears to have no background --- this is useful
|
|
|
|
* for frames that might receive a propagated background via
|
|
|
|
* nsCSSRendering::FindBackground
|
2013-07-24 11:38:55 +04:00
|
|
|
* @return whether a themed background item was created.
|
2009-07-22 04:44:51 +04:00
|
|
|
*/
|
2013-07-24 11:38:55 +04:00
|
|
|
bool DisplayBackgroundUnconditional(nsDisplayListBuilder* aBuilder,
|
2013-02-14 15:12:27 +04:00
|
|
|
const nsDisplayListSet& aLists,
|
2013-07-24 11:38:55 +04:00
|
|
|
bool aForceBackground);
|
2006-01-26 05:29:17 +03:00
|
|
|
/**
|
|
|
|
* Adds display items for standard CSS borders, background and outline for
|
|
|
|
* for this frame, as necessary. Checks IsVisibleForPainting and won't
|
|
|
|
* display anything if the frame is not visible.
|
|
|
|
* @param aForceBackground draw the background even if the frame
|
|
|
|
* background style appears to have no background --- this is useful
|
|
|
|
* for frames that might receive a propagated background via
|
|
|
|
* nsCSSRendering::FindBackground
|
|
|
|
*/
|
2013-02-14 15:12:27 +04:00
|
|
|
void DisplayBorderBackgroundOutline(nsDisplayListBuilder* aBuilder,
|
|
|
|
const nsDisplayListSet& aLists,
|
|
|
|
bool aForceBackground = false);
|
2006-01-26 05:29:17 +03:00
|
|
|
/**
|
|
|
|
* Add a display item for the CSS outline. Does not check visibility.
|
|
|
|
*/
|
2013-02-14 15:12:27 +04:00
|
|
|
void DisplayOutlineUnconditional(nsDisplayListBuilder* aBuilder,
|
|
|
|
const nsDisplayListSet& aLists);
|
2006-01-26 05:29:17 +03:00
|
|
|
/**
|
|
|
|
* Add a display item for the CSS outline, after calling
|
|
|
|
* IsVisibleForPainting to confirm we are visible.
|
|
|
|
*/
|
2013-02-14 15:12:27 +04:00
|
|
|
void DisplayOutline(nsDisplayListBuilder* aBuilder,
|
|
|
|
const nsDisplayListSet& aLists);
|
2006-01-26 05:29:17 +03:00
|
|
|
|
2007-04-16 03:14:26 +04:00
|
|
|
/**
|
2018-03-23 16:49:21 +03:00
|
|
|
* Adjust the given parent frame to the right ComputedStyle parent frame for
|
2007-04-16 03:14:26 +04:00
|
|
|
* the child, given the pseudo-type of the prospective child. This handles
|
|
|
|
* things like walking out of table pseudos and so forth.
|
|
|
|
*
|
|
|
|
* @param aProspectiveParent what GetParent() on the child returns.
|
|
|
|
* Must not be null.
|
|
|
|
* @param aChildPseudo the child's pseudo type, if any.
|
|
|
|
*/
|
2017-10-03 01:05:19 +03:00
|
|
|
static nsIFrame* CorrectStyleParentFrame(nsIFrame* aProspectiveParent,
|
|
|
|
nsAtom* aChildPseudo);
|
2007-04-16 03:14:26 +04:00
|
|
|
|
1998-04-14 00:24:54 +04:00
|
|
|
protected:
|
1998-12-05 19:03:07 +03:00
|
|
|
// Protected constructor and destructor
|
2018-03-22 21:20:41 +03:00
|
|
|
nsFrame(ComputedStyle* aStyle, ClassID aID);
|
|
|
|
explicit nsFrame(ComputedStyle* aStyle)
|
|
|
|
: nsFrame(aStyle, ClassID::nsFrame_id) {}
|
1998-12-05 19:03:07 +03:00
|
|
|
virtual ~nsFrame();
|
|
|
|
|
2006-01-26 05:29:17 +03:00
|
|
|
/**
|
|
|
|
* To be called by |BuildDisplayLists| of this class or derived classes to add
|
|
|
|
* a translucent overlay if this frame's content is selected.
|
|
|
|
* @param aContentType an nsISelectionDisplay DISPLAY_ constant identifying
|
|
|
|
* which kind of content this is for
|
2002-12-24 01:05:47 +03:00
|
|
|
*/
|
2013-02-14 15:12:27 +04:00
|
|
|
void DisplaySelectionOverlay(
|
|
|
|
nsDisplayListBuilder* aBuilder, nsDisplayList* aList,
|
2012-08-22 19:56:38 +04:00
|
|
|
uint16_t aContentType = nsISelectionDisplay::DISPLAY_FRAMES);
|
2002-12-24 01:05:47 +03:00
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
int16_t DisplaySelection(nsPresContext* aPresContext,
|
|
|
|
bool isOkToTurnOn = false);
|
2017-07-06 15:00:35 +03:00
|
|
|
|
1998-05-08 22:33:42 +04:00
|
|
|
// Style post processing hook
|
2018-03-22 21:20:41 +03:00
|
|
|
void DidSetComputedStyle(ComputedStyle* aOldComputedStyle) override;
|
1998-05-08 22:33:42 +04:00
|
|
|
|
2004-11-29 23:28:46 +03:00
|
|
|
public:
|
2017-03-21 03:22:13 +03:00
|
|
|
/**
|
2017-03-21 03:22:13 +03:00
|
|
|
* Helper method to create a view for a frame. Only used by a few sub-classes
|
|
|
|
* that need a view.
|
2017-03-21 03:22:13 +03:00
|
|
|
*/
|
2017-03-21 03:22:13 +03:00
|
|
|
void CreateView();
|
2017-03-21 03:22:13 +03:00
|
|
|
|
1999-10-22 04:19:18 +04:00
|
|
|
// given a frame five me the first/last leaf available
|
2004-11-29 23:28:46 +03:00
|
|
|
// XXX Robert O'Callahan wants to move these elsewhere
|
2004-08-01 03:15:21 +04:00
|
|
|
static void GetLastLeaf(nsPresContext* aPresContext, nsIFrame** aFrame);
|
|
|
|
static void GetFirstLeaf(nsPresContext* aPresContext, nsIFrame** aFrame);
|
2006-08-07 14:54:56 +04:00
|
|
|
|
2008-10-09 14:22:30 +04:00
|
|
|
// Return the line number of the aFrame, and (optionally) the containing block
|
|
|
|
// frame.
|
|
|
|
// If aScrollLock is true, don't break outside scrollframes when looking for a
|
|
|
|
// containing block frame.
|
2012-08-22 19:56:38 +04:00
|
|
|
static int32_t GetLineNumber(nsIFrame* aFrame, bool aLockScroll,
|
2012-07-30 18:20:58 +04:00
|
|
|
nsIFrame** aContainingBlock = nullptr);
|
2006-08-07 14:54:56 +04:00
|
|
|
|
2012-01-19 00:04:51 +04:00
|
|
|
/**
|
|
|
|
* Returns true if aFrame should apply overflow clipping.
|
|
|
|
*/
|
2013-03-06 15:08:16 +04:00
|
|
|
static bool ShouldApplyOverflowClipping(const nsIFrame* aFrame,
|
|
|
|
const nsStyleDisplay* aDisp) {
|
2015-07-07 00:57:37 +03:00
|
|
|
// clip overflow:-moz-hidden-unscrollable, except for nsListControlFrame,
|
|
|
|
// which is an nsHTMLScrollFrame.
|
2018-12-11 03:50:32 +03:00
|
|
|
if (MOZ_UNLIKELY(aDisp->mOverflowX ==
|
|
|
|
mozilla::StyleOverflow::MozHiddenUnscrollable &&
|
2017-04-30 18:30:08 +03:00
|
|
|
!aFrame->IsListControlFrame())) {
|
2012-01-19 00:04:51 +04:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2018-11-20 02:45:19 +03:00
|
|
|
// contain: paint, which we interpret as -moz-hidden-unscrollable
|
|
|
|
// Exception: for scrollframes, we don't need contain:paint to add any
|
|
|
|
// clipping, because the scrollable frame will already clip overflowing
|
|
|
|
// content, and because contain:paint should prevent all means of escaping
|
|
|
|
// that clipping (e.g. because it forms a fixed-pos containing block).
|
|
|
|
if (aDisp->IsContainPaint() && !aFrame->IsScrollFrame()) {
|
2018-05-31 00:28:53 +03:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2012-01-19 00:04:51 +04:00
|
|
|
// and overflow:hidden that we should interpret as -moz-hidden-unscrollable
|
2018-12-11 03:50:32 +03:00
|
|
|
if (aDisp->mOverflowX == mozilla::StyleOverflow::Hidden &&
|
|
|
|
aDisp->mOverflowY == mozilla::StyleOverflow::Hidden) {
|
2012-01-19 00:04:51 +04:00
|
|
|
// REVIEW: these are the frame types that set up clipping.
|
2017-05-01 20:32:52 +03:00
|
|
|
mozilla::LayoutFrameType type = aFrame->Type();
|
|
|
|
if (type == mozilla::LayoutFrameType::Table ||
|
|
|
|
type == mozilla::LayoutFrameType::TableCell ||
|
|
|
|
type == mozilla::LayoutFrameType::BCTableCell ||
|
|
|
|
type == mozilla::LayoutFrameType::SVGOuterSVG ||
|
|
|
|
type == mozilla::LayoutFrameType::SVGInnerSVG ||
|
2017-06-14 16:53:34 +03:00
|
|
|
type == mozilla::LayoutFrameType::SVGSymbol ||
|
2017-05-01 20:32:52 +03:00
|
|
|
type == mozilla::LayoutFrameType::SVGForeignObject) {
|
2012-01-19 00:04:51 +04:00
|
|
|
return true;
|
|
|
|
}
|
2013-01-25 00:44:38 +04:00
|
|
|
if (aFrame->IsFrameOfType(nsIFrame::eReplacedContainsBlock)) {
|
2017-05-01 20:32:52 +03:00
|
|
|
if (type == mozilla::LayoutFrameType::TextInput) {
|
2014-05-12 15:45:27 +04:00
|
|
|
// It always has an anonymous scroll frame that handles any overflow.
|
|
|
|
return false;
|
|
|
|
}
|
2013-01-25 00:44:38 +04:00
|
|
|
return true;
|
|
|
|
}
|
2012-01-19 00:04:51 +04:00
|
|
|
}
|
2012-07-20 22:12:29 +04:00
|
|
|
|
|
|
|
if ((aFrame->GetStateBits() & NS_FRAME_SVG_LAYOUT)) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2011-01-20 01:39:31 +03:00
|
|
|
// If we're paginated and a block, and have NS_BLOCK_CLIP_PAGINATED_OVERFLOW
|
|
|
|
// set, then we want to clip our overflow.
|
2017-04-30 18:30:08 +03:00
|
|
|
return (aFrame->GetStateBits() & NS_BLOCK_CLIP_PAGINATED_OVERFLOW) != 0 &&
|
|
|
|
aFrame->PresContext()->IsPaginated() && aFrame->IsBlockFrame();
|
2011-01-20 01:39:31 +03:00
|
|
|
}
|
|
|
|
|
2017-01-18 03:27:03 +03:00
|
|
|
nsILineIterator* GetLineIterator() override;
|
2014-05-25 02:20:39 +04:00
|
|
|
|
2004-11-29 23:28:46 +03:00
|
|
|
protected:
|
2000-03-17 02:45:39 +03:00
|
|
|
// Test if we are selecting a table object:
|
2017-07-06 15:00:35 +03:00
|
|
|
// Most table/cell selection requires that Ctrl (Cmd on Mac) key is down
|
2000-05-31 04:07:58 +04:00
|
|
|
// during a mouse click or drag. Exception is using Shift+click when
|
|
|
|
// already in "table/cell selection mode" to extend a block selection
|
2017-07-06 15:00:35 +03:00
|
|
|
// Get the parent content node and offset of the frame
|
2000-03-17 02:45:39 +03:00
|
|
|
// of the enclosing cell or table (if not inside a cell)
|
|
|
|
// aTarget tells us what table element to select (currently only cell and
|
|
|
|
// table supported) (enums for this are defined in nsIFrame.h)
|
2018-05-08 20:52:36 +03:00
|
|
|
nsresult GetDataForTableSelection(const nsFrameSelection* aFrameSelection,
|
|
|
|
nsIPresShell* aPresShell,
|
|
|
|
mozilla::WidgetMouseEvent* aMouseEvent,
|
|
|
|
nsIContent** aParentContent,
|
|
|
|
int32_t* aContentOffset,
|
|
|
|
mozilla::TableSelection* aTarget);
|
2000-03-17 02:45:39 +03:00
|
|
|
|
2004-12-31 00:56:11 +03:00
|
|
|
// Fills aCursor with the appropriate information from ui
|
2018-08-14 11:37:37 +03:00
|
|
|
static void FillCursorInformationFromStyle(const nsStyleUI* ui,
|
2004-12-31 00:56:11 +03:00
|
|
|
nsIFrame::Cursor& aCursor);
|
2016-04-21 07:28:35 +03:00
|
|
|
NS_IMETHOD DoXULLayout(nsBoxLayoutState& aBoxLayoutState) override;
|
2004-09-28 22:37:50 +04:00
|
|
|
|
|
|
|
nsBoxLayoutMetrics* BoxMetrics() const;
|
|
|
|
|
2006-05-03 21:02:37 +04:00
|
|
|
// Fire DOM event. If no aContent argument use frame's mContent.
|
2012-07-30 18:20:58 +04:00
|
|
|
void FireDOMEvent(const nsAString& aDOMEventName,
|
|
|
|
nsIContent* aContent = nullptr);
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2004-09-28 22:37:50 +04:00
|
|
|
private:
|
2014-05-13 04:47:54 +04:00
|
|
|
void BoxReflow(nsBoxLayoutState& aState, nsPresContext* aPresContext,
|
2017-06-09 22:14:53 +03:00
|
|
|
ReflowOutput& aDesiredSize, gfxContext* aRenderingContext,
|
2014-05-13 04:47:54 +04:00
|
|
|
nscoord aX, nscoord aY, nscoord aWidth, nscoord aHeight,
|
|
|
|
bool aMoveFrame = true);
|
2004-09-28 22:37:50 +04:00
|
|
|
|
|
|
|
NS_IMETHODIMP RefreshSizeCache(nsBoxLayoutState& aState);
|
|
|
|
|
2015-11-06 01:21:38 +03:00
|
|
|
// Returns true if this frame has any kind of CSS animations.
|
|
|
|
bool HasCSSAnimations();
|
|
|
|
|
2016-04-10 22:29:00 +03:00
|
|
|
// Returns true if this frame has any kind of CSS transitions.
|
|
|
|
bool HasCSSTransitions();
|
|
|
|
|
2009-08-21 01:52:48 +04:00
|
|
|
public:
|
2018-04-02 06:30:51 +03:00
|
|
|
#ifdef DEBUG_FRAME_DUMP
|
2009-08-21 01:52:48 +04:00
|
|
|
/**
|
|
|
|
* Get a printable from of the name of the frame type.
|
|
|
|
* XXX This should be eliminated and we use GetType() instead...
|
|
|
|
*/
|
2017-01-18 03:27:03 +03:00
|
|
|
nsresult GetFrameName(nsAString& aResult) const override;
|
2014-01-06 03:31:14 +04:00
|
|
|
nsresult MakeFrameName(const nsAString& aKind, nsAString& aResult) const;
|
|
|
|
// Helper function to return the index in parent of the frame's content
|
|
|
|
// object. Returns -1 on error or if the frame doesn't have a content object
|
|
|
|
static int32_t ContentIndexInContainer(const nsIFrame* aFrame);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef DEBUG
|
2015-11-06 01:35:03 +03:00
|
|
|
static mozilla::LazyLogModule sFrameLogModule;
|
2009-08-21 01:52:48 +04:00
|
|
|
|
|
|
|
// Show frame borders when rendering
|
2011-09-29 10:19:26 +04:00
|
|
|
static void ShowFrameBorders(bool aEnable);
|
|
|
|
static bool GetShowFrameBorders();
|
2009-08-21 01:52:48 +04:00
|
|
|
|
|
|
|
// Show frame border of event target
|
2011-09-29 10:19:26 +04:00
|
|
|
static void ShowEventTargetFrameBorder(bool aEnable);
|
|
|
|
static bool GetShowEventTargetFrameBorder();
|
2011-11-17 07:44:16 +04:00
|
|
|
#endif
|
2014-12-31 23:17:39 +03:00
|
|
|
|
2009-08-21 01:52:48 +04:00
|
|
|
static void PrintDisplayList(nsDisplayListBuilder* aBuilder,
|
2012-03-01 12:26:09 +04:00
|
|
|
const nsDisplayList& aList,
|
2014-06-20 02:36:25 +04:00
|
|
|
bool aDumpHtml = false) {
|
|
|
|
std::stringstream ss;
|
|
|
|
PrintDisplayList(aBuilder, aList, ss, aDumpHtml);
|
|
|
|
fprintf_stderr(stderr, "%s", ss.str().c_str());
|
|
|
|
}
|
|
|
|
static void PrintDisplayList(nsDisplayListBuilder* aBuilder,
|
|
|
|
const nsDisplayList& aList,
|
|
|
|
std::stringstream& aStream,
|
2012-08-07 21:57:26 +04:00
|
|
|
bool aDumpHtml = false);
|
2018-07-19 22:30:30 +03:00
|
|
|
static void PrintDisplayItem(nsDisplayListBuilder* aBuilder,
|
|
|
|
nsDisplayItem* aItem, std::stringstream& aStream,
|
|
|
|
uint32_t aIndent = 0, bool aDumpSublist = false,
|
|
|
|
bool aDumpHtml = false);
|
2013-12-12 22:27:07 +04:00
|
|
|
static void PrintDisplayListSet(nsDisplayListBuilder* aBuilder,
|
|
|
|
const nsDisplayListSet& aList,
|
2014-06-20 02:36:25 +04:00
|
|
|
std::stringstream& aStream,
|
2013-12-12 22:27:07 +04:00
|
|
|
bool aDumpHtml = false);
|
1998-04-14 00:24:54 +04:00
|
|
|
};
|
|
|
|
|
2001-11-14 16:40:03 +03:00
|
|
|
// Start Display Reflow Debugging
|
2001-10-29 04:43:59 +03:00
|
|
|
#ifdef DEBUG
|
|
|
|
|
|
|
|
struct DR_cookie {
|
2004-08-01 03:15:21 +04:00
|
|
|
DR_cookie(nsPresContext* aPresContext, nsIFrame* aFrame,
|
2016-07-21 13:36:39 +03:00
|
|
|
const mozilla::ReflowInput& aReflowInput,
|
2016-07-21 13:36:38 +03:00
|
|
|
mozilla::ReflowOutput& aMetrics, nsReflowStatus& aStatus);
|
2001-10-29 04:43:59 +03:00
|
|
|
~DR_cookie();
|
2001-11-27 04:45:46 +03:00
|
|
|
void Change() const;
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2004-08-01 03:15:21 +04:00
|
|
|
nsPresContext* mPresContext;
|
2001-10-29 04:43:59 +03:00
|
|
|
nsIFrame* mFrame;
|
2016-07-21 13:36:39 +03:00
|
|
|
const mozilla::ReflowInput& mReflowInput;
|
2016-07-21 13:36:38 +03:00
|
|
|
mozilla::ReflowOutput& mMetrics;
|
2017-07-06 15:00:35 +03:00
|
|
|
nsReflowStatus& mStatus;
|
2001-10-29 04:43:59 +03:00
|
|
|
void* mValue;
|
|
|
|
};
|
2018-11-30 13:46:48 +03: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
|
|
|
struct DR_layout_cookie {
|
2014-08-08 03:48:38 +04:00
|
|
|
explicit DR_layout_cookie(nsIFrame* aFrame);
|
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
|
|
|
~DR_layout_cookie();
|
2018-11-30 13:46:48 +03: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
|
|
|
nsIFrame* mFrame;
|
|
|
|
void* mValue;
|
|
|
|
};
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2018-09-12 15:35:47 +03:00
|
|
|
struct DR_intrinsic_inline_size_cookie {
|
|
|
|
DR_intrinsic_inline_size_cookie(nsIFrame* aFrame, const char* aType,
|
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& aResult);
|
2018-09-12 15:35:47 +03:00
|
|
|
~DR_intrinsic_inline_size_cookie();
|
2018-11-30 13:46:48 +03: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
|
|
|
nsIFrame* mFrame;
|
|
|
|
const char* mType;
|
|
|
|
nscoord& mResult;
|
|
|
|
void* mValue;
|
|
|
|
};
|
2018-11-30 13:46:48 +03: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
|
|
|
struct DR_intrinsic_size_cookie {
|
|
|
|
DR_intrinsic_size_cookie(nsIFrame* aFrame, const char* aType,
|
|
|
|
nsSize& aResult);
|
|
|
|
~DR_intrinsic_size_cookie();
|
2018-11-30 13:46:48 +03: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
|
|
|
nsIFrame* mFrame;
|
|
|
|
const char* mType;
|
|
|
|
nsSize& mResult;
|
|
|
|
void* mValue;
|
|
|
|
};
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2010-05-02 01:40:16 +04:00
|
|
|
struct DR_init_constraints_cookie {
|
2016-07-21 13:36:35 +03:00
|
|
|
DR_init_constraints_cookie(nsIFrame* aFrame, mozilla::ReflowInput* aState,
|
2010-05-02 01:40:16 +04:00
|
|
|
nscoord aCBWidth, nscoord aCBHeight,
|
|
|
|
const nsMargin* aBorder, const nsMargin* aPadding);
|
|
|
|
~DR_init_constraints_cookie();
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2010-05-02 01:40:16 +04:00
|
|
|
nsIFrame* mFrame;
|
2016-07-21 13:36:35 +03:00
|
|
|
mozilla::ReflowInput* mState;
|
2010-05-02 01:40:16 +04:00
|
|
|
void* mValue;
|
|
|
|
};
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2010-05-02 01:40:16 +04:00
|
|
|
struct DR_init_offsets_cookie {
|
2016-07-21 13:36:35 +03:00
|
|
|
DR_init_offsets_cookie(nsIFrame* aFrame,
|
|
|
|
mozilla::SizeComputationInput* aState,
|
2018-01-31 06:24:55 +03:00
|
|
|
nscoord aPercentBasis,
|
2017-07-07 19:20:56 +03:00
|
|
|
mozilla::WritingMode aCBWritingMode,
|
2010-05-02 01:40:16 +04:00
|
|
|
const nsMargin* aBorder, const nsMargin* aPadding);
|
|
|
|
~DR_init_offsets_cookie();
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2010-05-02 01:40:16 +04:00
|
|
|
nsIFrame* mFrame;
|
2016-07-21 13:36:35 +03:00
|
|
|
mozilla::SizeComputationInput* mState;
|
2010-05-02 01:40:16 +04:00
|
|
|
void* mValue;
|
|
|
|
};
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2010-05-02 01:40:16 +04:00
|
|
|
struct DR_init_type_cookie {
|
2016-07-21 13:36:35 +03:00
|
|
|
DR_init_type_cookie(nsIFrame* aFrame, mozilla::ReflowInput* aState);
|
2010-05-02 01:40:16 +04:00
|
|
|
~DR_init_type_cookie();
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2010-05-02 01:40:16 +04:00
|
|
|
nsIFrame* mFrame;
|
2016-07-21 13:36:35 +03:00
|
|
|
mozilla::ReflowInput* mState;
|
2010-05-02 01:40:16 +04:00
|
|
|
void* mValue;
|
|
|
|
};
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2001-11-14 16:40:03 +03:00
|
|
|
# define DISPLAY_REFLOW(dr_pres_context, dr_frame, dr_rf_state, \
|
|
|
|
dr_rf_metrics, dr_rf_status) \
|
2017-07-06 15:00:35 +03:00
|
|
|
DR_cookie dr_cookie(dr_pres_context, dr_frame, dr_rf_state, dr_rf_metrics, \
|
|
|
|
dr_rf_status);
|
2001-11-27 04:45:46 +03:00
|
|
|
# define DISPLAY_REFLOW_CHANGE() dr_cookie.Change();
|
2017-07-06 15:00:35 +03:00
|
|
|
# define DISPLAY_LAYOUT(dr_frame) DR_layout_cookie dr_cookie(dr_frame);
|
2018-09-12 15:35:47 +03:00
|
|
|
# define DISPLAY_MIN_INLINE_SIZE(dr_frame, dr_result) \
|
|
|
|
DR_intrinsic_inline_size_cookie dr_cookie(dr_frame, "Min", dr_result)
|
|
|
|
# define DISPLAY_PREF_INLINE_SIZE(dr_frame, dr_result) \
|
|
|
|
DR_intrinsic_inline_size_cookie dr_cookie(dr_frame, "Pref", dr_result)
|
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
|
|
|
# define DISPLAY_PREF_SIZE(dr_frame, dr_result) \
|
|
|
|
DR_intrinsic_size_cookie dr_cookie(dr_frame, "Pref", dr_result)
|
|
|
|
# define DISPLAY_MIN_SIZE(dr_frame, dr_result) \
|
|
|
|
DR_intrinsic_size_cookie dr_cookie(dr_frame, "Min", dr_result)
|
|
|
|
# define DISPLAY_MAX_SIZE(dr_frame, dr_result) \
|
|
|
|
DR_intrinsic_size_cookie dr_cookie(dr_frame, "Max", dr_result)
|
2010-05-02 01:40:16 +04:00
|
|
|
# define DISPLAY_INIT_CONSTRAINTS(dr_frame, dr_state, dr_cbw, dr_cbh, dr_bdr, \
|
|
|
|
dr_pad) \
|
|
|
|
DR_init_constraints_cookie dr_cookie(dr_frame, dr_state, dr_cbw, dr_cbh, \
|
|
|
|
dr_bdr, dr_pad)
|
2017-07-07 19:20:56 +03:00
|
|
|
# define DISPLAY_INIT_OFFSETS(dr_frame, dr_state, dr_pb, dr_cbwm, dr_bdr, \
|
|
|
|
dr_pad) \
|
|
|
|
DR_init_offsets_cookie dr_cookie(dr_frame, dr_state, dr_pb, dr_cbwm, \
|
|
|
|
dr_bdr, dr_pad)
|
2010-05-02 01:40:16 +04:00
|
|
|
# define DISPLAY_INIT_TYPE(dr_frame, dr_result) \
|
|
|
|
DR_init_type_cookie dr_cookie(dr_frame, dr_result)
|
2001-10-29 04:43:59 +03:00
|
|
|
|
|
|
|
#else
|
|
|
|
|
2017-07-06 15:00:35 +03:00
|
|
|
# define DISPLAY_REFLOW(dr_pres_context, dr_frame, dr_rf_state, \
|
|
|
|
dr_rf_metrics, dr_rf_status)
|
|
|
|
# define DISPLAY_REFLOW_CHANGE()
|
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
|
|
|
# define DISPLAY_LAYOUT(dr_frame) PR_BEGIN_MACRO PR_END_MACRO
|
2018-09-12 15:35:47 +03:00
|
|
|
# define DISPLAY_MIN_INLINE_SIZE(dr_frame, dr_result) \
|
|
|
|
PR_BEGIN_MACRO PR_END_MACRO
|
|
|
|
# define DISPLAY_PREF_INLINE_SIZE(dr_frame, dr_result) \
|
|
|
|
PR_BEGIN_MACRO PR_END_MACRO
|
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
|
|
|
# define DISPLAY_PREF_SIZE(dr_frame, dr_result) PR_BEGIN_MACRO PR_END_MACRO
|
|
|
|
# define DISPLAY_MIN_SIZE(dr_frame, dr_result) PR_BEGIN_MACRO PR_END_MACRO
|
|
|
|
# define DISPLAY_MAX_SIZE(dr_frame, dr_result) PR_BEGIN_MACRO PR_END_MACRO
|
2010-05-02 01:40:16 +04:00
|
|
|
# define DISPLAY_INIT_CONSTRAINTS(dr_frame, dr_state, dr_cbw, dr_cbh, dr_bdr, \
|
|
|
|
dr_pad) \
|
|
|
|
PR_BEGIN_MACRO PR_END_MACRO
|
2017-07-07 19:20:56 +03:00
|
|
|
# define DISPLAY_INIT_OFFSETS(dr_frame, dr_state, dr_pb, dr_cbwm, dr_bdr, \
|
|
|
|
dr_pad) \
|
2010-05-02 01:40:16 +04:00
|
|
|
PR_BEGIN_MACRO PR_END_MACRO
|
|
|
|
# define DISPLAY_INIT_TYPE(dr_frame, dr_result) PR_BEGIN_MACRO PR_END_MACRO
|
|
|
|
|
2001-10-29 04:43:59 +03:00
|
|
|
#endif
|
|
|
|
// End Display Reflow Debugging
|
|
|
|
|
1998-04-14 00:24:54 +04:00
|
|
|
#endif /* nsFrame_h___ */
|