Files
palemoon27/layout/forms/nsListControlFrame.h
roytam1 6e5e89ee47 import changes from `dev' branch of rmottola/Arctic-Fox:
- Bug 1161686 - libmar's |SECU_GetModulePassword| can leak allocated string (command line build utility). Free unused return of GetPasswordString. r=bbondy (25107e4c3e)
- Bug 1253775 - Remove libmar and libbz2 Makefile.ins; r=ted (7d693933b8)
- Bug 1186934 - update jemalloc to upstream HEAD; r=glandium (cd4fdf0c93)
- Bug 1254850 - Update jemalloc 4 to version 4.1.0. r=njn (6cc351fb51)
- Bug 1254948 - Remove makefiles used to transition from jemalloc_config.c to jemalloc_config.cpp; r=glandium (c8e0684478)
- Bug 1263735: Update libcubeb to remove wasapi stubbing for enumeration r=kinetik (156c7e4ef8)
- Bug 1264594 - Update libcubeb to revision 727121. r=kinetik (e982bc0eef)
- Bug 1264892: Use system declaration of |__system_property_get| on B2G, r=padenot (b50185e037)
- Bug 1265692 - Update cubeb to 0bc02f9. r=padenot,kinetik (420c905a02)
- Bug 1251502 - Add a duplex AudioUnit implementation. r=kinetik,padenot (a4e00f217a)
- Bug 1266753 - Update cubeb to revision dbdfb to pick up OSX device notification changes. r=padenot (12532f1cf6)
- Bug 1266753 - Fix mac bustage: use the old enum values, on a CLOSED TREE. r=padenot (afe9874670)
- Bug 1251502 - Compile the resampling code in cubeb for OSX and Linux. r=kinetik (6f07d50796)
- Bug 1236937 - Use correct value for Pi in AAFilter.cpp. r=padenot (d54113bf18)
- Bug 1235675 - Add the source directory to the -include directive in media/libsoundtouch/src/moz.build. r=mshal (0d56029898)
- Bug 1135942 - Enable MMX/SSE code unconditionally in libsoundtouch, it does runtime detection anyways. r=padenot (1e1c3c6c84)
- Bug 1264208 - Enable libav assertions. r=jya (a89a7683ac)
- Bug 1134744 - Fix baseline for form controls when line is inverted relative to block dir. r=smontagu (8be618ce3f)
- Bug 1261284: Don't include <button>'s children in overflow areas, if we know we're going to clip them when painting. r=mats (094dd9c33b)
- Bug 1263773 - Mark a bunch of classes in layout as MOZ_RAII. r=dholbert (e28d735a60)
- Bug 1249664 - Save the combobox's dropped-down state across frame reconstruction. r=dbaron (6caf06c91e)
- Bug 1253977 part 1 - Update focus state on combobox frame destruction/construction properly. r=tn (0c1841dc35)
- Bug 1253977 part 2 - Reftests. (985b87a008)
- Bug 1212688 - Drill through any <optgroup> scroll frames to get at its <option> child frames when estimating the list's row size. r=roc (67b9ac481c)
- Bug 1228670 - Null-check GetContentInsertionFrame() before using it. r=bz (bffbf4769c)
- Bug 1208978 - Limit the size of a potentially-scrollable dropdown list to the actual size of its contents, as our estimate based on row count may be too large if the row heights vary. r=roc (b9447f9f1c)
- Bug 1121515 - Error tapping empty listitem in a <select> box, r=roc, wesj (bffe267a89)
- Bug 1194733 - Don't honor DefaultPrevented for mouseup events in list control frames. r=enndeakin@gmail.com (37c43372b6)
- remove JXR support which was partially broken anyway (3440b4e0ef)
- Bug 940103 - Import compare-locales in the tree. r=gps (b8dd4f7e14)
- Bug 1237678 - update compare-locales to version 1.0. r=mathjazz (09dc0e35aa)
- bits of 1225280 (1869476ed8)
- Bug 1239504 - Avoid ASan leak report by holding PseudoStack in ImageBridgeChild. r=sotaro (d9125680ad)
- Bug 1223193: P1. Make ImageBridgeChild::mShuttingDown atomic. r=nical (3a5b496dae)
- Bug 1223193: P2. Cancel ImageBridge proxy functions if shutdown has started. r=nical (a66cd45878)
- Bug 1243466 - Don't crash if DeallocPImageContainerChild is called prematurely. r=sotaro (e8d4776fde)
- Bug 1251808 (Followup) - Mark the new SourceSurfaceImage constructor explicit. r=me (1087add7d0)
- Bug 1260391: Fix |ImageBridgeChild::UseOverlaySource|, r=dvander (e423cc3a27)
- Bug 1255823 - Add a two-step destruction process to PAPZ. r=dvander (3d53adaecc)
- Bug 1261321 - Null-check when the CompositableClient when forcing its destruction at shutdown. r=jnicol (7180c6d737)
- Bug 1259301 - Remove GeckoContentController::RequestFlingSnap(). r=kats (d94da5f624)
- Bug 1264703 - Follow up: don't print unhandled BUILDSTATUS messages when running |./mach configure| r=gps (c3f0b8a9b3)
- Bug 1263506 - Ensure MOZ_GMP_PATH in gtests always has native dir separators. r=glandium (ea91c448ed)
- Bug 1253512 (part 1) - Overhaul DMD's "sampling". r=erahm. (536dcdf84e)
- Bug 1282185 (part 1) - Remove a bogus assertion in DMD. r=erahm. (ec09953fac)
- Bug 1253512 (part 2) - Aggregate live blocks. r=erahm. (57db2ffa75)
- Bug 1254029 - Do not wait in ImageBridgeChild::FlushAllImages() except gonk r=nical (aeac940199)
- Bug 1259174 - Fix absolute paths in TEST_HARNESS_FILES. r=mshal (d97df14fc0)
- Bug 1245701 - Allow absolute paths with wildcards in FINAL_TARGET_FILES; r=glandium (4434843c71)
- Bug 1255450 - [mach] Create setting for defining command aliases, r=gps (3a00add9bb)
- Bug 1262495 - [mach] Allow running root commands that have subcommands on their own, r=gps (4a1d3d4959)
- Bug 1255470 - [mach] don't raise if a subcommand exists and but wasn't found in args, r=gps (654dc84f95)
- Bug 1255450 - [mach] Implement 'wildcard' settings for enabling sections with user-defined options, r=gps (2b1ccdf573)
- Bug 1255450 - [mach] Simplify managing of locale documentation for settings, r=gps (44cfacff8b)
- Bug 1255450 - [mach] Enable runtime configuration files, r=gps (76cc69734c)
- Bug 1255450 - mach settings documentation fix, DONTBUILD, r=me (d3395c787a)
- Bug 991343 - Suppress time output when running inside emacs, r=gps (62193e5661)
- Bug 1255467 - Ability for a mach command to dispatch to another's subcommand, r=gps (adfff83191)
- Bug 1241989 - Speed up install manifests by avoiding path operations. r=gps (9e89d59d52)
- Bug 1249210 - Install files using multiple threads on Windows; r=glandium (003f19169d)
- Bug 1260241 - Pre: Add compress option to Jarrer.add. r=glandium (07e96dafee)
- Bug 1212427 - Reference extra Python paths in Sphinx config; r=mshal (8d2595fd10)
- Bug 1252294 - Add python/futures to sys.path when building Sphinx docs; r=chmanchester (78f2010814)
- Bug 1241398 - Remove the FilePurger class. r=gps (4852afa2db)
- No Bug - Add python/futures to mach search paths to avoid exception when running mach build or mach test. r=gps DONTBUILD (00dbc53adb)
- Bug 1252601 - Handle requests errors gracefully when submitting telemetry data r=gps (aaf93000d3)
- Bug 1250656 - Don't block mach command completion when submitting build telemetry data r=gps (eb0566eff4)
- Bug 1213959 - Set SHELL in Read the Docs environment; r=ted (eb960eb450)
- Bug 1175895 - separate tier start message for mach; r=ted (cd56ddae05)
- Bug 1077670 - Package tests in parallel. r=gps (28b531ba3d)
- Bug 1195870 - Upload android multi apk to Taskcluster; r=jlund (b934b74abb)
- Bug 1149164 - Report stripped size of libxul.so in treeherder builds;# (c987d5b361)
- Bug 1139911 - Set proper buildbot status on make-check errors and test failures, r=chmanchester (31fad0c64c)
- Bug 1217431 - Don't get 'latest' URLs for android updates; r=jlund (0af5cb0aaa)
- Bug 1247375 - Part 1: Add TaskCluster job building Fennec with --disable-compile-environment. r=dustin (2307971041)
- bug 1202811 - Invoke mozharness with python 2.7 from build-linux.sh. r=dustin (0f76400e1a)
- Bug 1231320: pull from secrets API in TaskCluster r=garndt,mshal,pmoore (f48267b79f)
- Bug 1198173 - Intermittent failures trying to clone tooltool. r=dustin (8fbc340092)
- Bug 1220684: use namespaced docker-worker caches; r=garndt (82f8ecf9d4)
- Bug 1226413 - Allow task images to be built upon push r=wcosta (01332cb4ac)
- Bug 1145682 - Remove commit descriptions from decision tasks r=me a=taskcluster-only (50ad583085)
- Bug 1140546 - Add automatic reruns to decision tasks r=me a=taskcluster-only (021cfe8bc2)
- Bug 1143069 - Add symbol to task graph for branch configs r=garndt (1c4d35b939)
- Bug 1169797: send decision tasks to production treeherder, too; r=lightsofapollo, r=ryanvm (89307f0ee6)
- Bug 1245538 - index decision task in taskcluster. r=dustin (264fe43463)
- Bug 1139590 - Do not escape source in decision task r=me a=taskcluster-only (02620c615b)
- Bug 1236655 - Use builder 0.5.11 image for decision tasks r=wcosta (84e0bd217d)
- Bug 1257619 - Add revision and revision_hash information to tasks r=dustin (a68f16782b)
- Bug 1140981 - Remove comment from task name in try decision task r=me a=taskcluster-only (89c4558261)
- Bug 1234076 - upgrade tc-vcs to 2.3.17 r=wcosta (46b7e181d1)
- Bug 1231318: pass MOZ_BUILD_DATE to builds based on pushdate; r=jlund (26b3a32288)
- bug 1238009 - in-tree tasks should link their source to the yml file they were generated from. r=dustin (04d42dfdd2)
- Bug 1264652 - Add scope to extend task graph to the decision task r=dustin (2969af45a7)
- Bug 1237740 - Fix build.sh error message typo. r=wcosta DONTBUILD (7a2c6b52f7)
- Bug 1212877: improve build.sh to run from any directory; r=wcosta DONTBUILD (18edc840df)
- bit of 1226413 (b580943caf)
- Bug 1237681: build desktop-build and desktop-test on demand; r=wcosta (f30d2d0fec)
- Bug 957951 - Use mach to invoke printconfigsetting.py. r=jlund (dfd953692e)
- Bug 1253478 - Use Atomic<uint64_t> in AsyncTransactionTracker r=nical (c1f2cf892f)
- Bug 1150338 - Use the tooltool gcc in automation rather than /tools, r=terrence (15f1fa12bc)
- Bug 1259848 - Various fixes for finding gcc in the correct location for spidermonkey TC builds and hazard shell builds, r=terrence (9963274899)
2024-07-12 10:33:28 +08:00

479 lines
15 KiB
C++

/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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/. */
#ifndef nsListControlFrame_h___
#define nsListControlFrame_h___
#ifdef DEBUG_evaughan
//#define DEBUG_rods
#endif
#ifdef DEBUG_rods
//#define DO_REFLOW_DEBUG
//#define DO_REFLOW_COUNTER
//#define DO_UNCONSTRAINED_CHECK
//#define DO_PIXELS
#endif
#include "mozilla/Attributes.h"
#include "nsGfxScrollFrame.h"
#include "nsIFormControlFrame.h"
#include "nsIListControlFrame.h"
#include "nsISelectControlFrame.h"
#include "nsAutoPtr.h"
#include "nsSelectsAreaFrame.h"
// X.h defines KeyPress
#ifdef KeyPress
#undef KeyPress
#endif
class nsIComboboxControlFrame;
class nsPresContext;
class nsListEventListener;
namespace mozilla {
namespace dom {
class HTMLOptionElement;
class HTMLOptionsCollection;
} // namespace dom
} // namespace mozilla
/**
* Frame-based listbox.
*/
class nsListControlFrame final : public nsHTMLScrollFrame,
public nsIFormControlFrame,
public nsIListControlFrame,
public nsISelectControlFrame
{
public:
friend nsContainerFrame* NS_NewListControlFrame(nsIPresShell* aPresShell,
nsStyleContext* aContext);
NS_DECL_QUERYFRAME
NS_DECL_FRAMEARENA_HELPERS
// nsIFrame
virtual nsresult HandleEvent(nsPresContext* aPresContext,
mozilla::WidgetGUIEvent* aEvent,
nsEventStatus* aEventStatus) override;
virtual void SetInitialChildList(ChildListID aListID,
nsFrameList& aChildList) override;
virtual nscoord GetPrefISize(nsRenderingContext *aRenderingContext) override;
virtual nscoord GetMinISize(nsRenderingContext *aRenderingContext) override;
virtual void Reflow(nsPresContext* aCX,
nsHTMLReflowMetrics& aDesiredSize,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus) override;
virtual void Init(nsIContent* aContent,
nsContainerFrame* aParent,
nsIFrame* aPrevInFlow) override;
virtual void DidReflow(nsPresContext* aPresContext,
const nsHTMLReflowState* aReflowState,
nsDidReflowStatus aStatus) override;
virtual void DestroyFrom(nsIFrame* aDestructRoot) override;
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) override;
virtual nsContainerFrame* GetContentInsertionFrame() override;
/**
* Get the "type" of the frame
*
* @see nsGkAtoms::scrollFrame
*/
virtual nsIAtom* GetType() const override;
virtual bool IsFrameOfType(uint32_t aFlags) const override
{
return nsHTMLScrollFrame::IsFrameOfType(aFlags &
~(nsIFrame::eReplaced | nsIFrame::eReplacedContainsBlock));
}
#ifdef DEBUG_FRAME_DUMP
virtual nsresult GetFrameName(nsAString& aResult) const override;
#endif
// nsIFormControlFrame
virtual nsresult SetFormProperty(nsIAtom* aName, const nsAString& aValue) override;
virtual void SetFocus(bool aOn = true, bool aRepaint = false) override;
virtual mozilla::ScrollbarStyles GetScrollbarStyles() const override;
virtual bool ShouldPropagateComputedBSizeToScrolledContent() const override;
// for accessibility purposes
#ifdef ACCESSIBILITY
virtual mozilla::a11y::AccType AccessibleType() override;
#endif
// nsIListControlFrame
virtual void SetComboboxFrame(nsIFrame* aComboboxFrame) override;
virtual int32_t GetSelectedIndex() override;
virtual mozilla::dom::HTMLOptionElement* GetCurrentOption() override;
/**
* Gets the text of the currently selected item.
* If the there are zero items then an empty string is returned
* If there is nothing selected, then the 0th item's text is returned.
*/
virtual void GetOptionText(uint32_t aIndex, nsAString& aStr) override;
virtual void CaptureMouseEvents(bool aGrabMouseEvents) override;
virtual nscoord GetBSizeOfARow() override;
virtual uint32_t GetNumberOfOptions() override;
virtual void AboutToDropDown() override;
/**
* @note This method might destroy the frame, pres shell and other objects.
*/
virtual void AboutToRollup() override;
/**
* Dispatch a DOM onchange event synchroniously.
* @note This method might destroy the frame, pres shell and other objects.
*/
virtual void FireOnChange() override;
/**
* Makes aIndex the selected option of a combobox list.
* @note This method might destroy the frame, pres shell and other objects.
*/
virtual void ComboboxFinish(int32_t aIndex) override;
virtual void OnContentReset() override;
// nsISelectControlFrame
NS_IMETHOD AddOption(int32_t index) override;
NS_IMETHOD RemoveOption(int32_t index) override;
NS_IMETHOD DoneAddingChildren(bool aIsDone) override;
/**
* Gets the content (an option) by index and then set it as
* being selected or not selected.
*/
NS_IMETHOD OnOptionSelected(int32_t aIndex, bool aSelected) override;
NS_IMETHOD OnSetSelectedIndex(int32_t aOldIndex, int32_t aNewIndex) override;
/**
* Mouse event listeners.
* @note These methods might destroy the frame, pres shell and other objects.
*/
nsresult MouseDown(nsIDOMEvent* aMouseEvent);
nsresult MouseUp(nsIDOMEvent* aMouseEvent);
nsresult MouseMove(nsIDOMEvent* aMouseEvent);
nsresult DragMove(nsIDOMEvent* aMouseEvent);
nsresult KeyDown(nsIDOMEvent* aKeyEvent);
nsresult KeyPress(nsIDOMEvent* aKeyEvent);
/**
* Returns the options collection for mContent, if any.
*/
mozilla::dom::HTMLOptionsCollection* GetOptions() const;
/**
* Returns the HTMLOptionElement for a given index in mContent's collection.
*/
mozilla::dom::HTMLOptionElement* GetOption(uint32_t aIndex) const;
static void ComboboxFocusSet();
// Helper
bool IsFocused() { return this == mFocused; }
/**
* Function to paint the focus rect when our nsSelectsAreaFrame is painting.
* @param aPt the offset of this frame, relative to the rendering reference
* frame
*/
void PaintFocus(mozilla::gfx::DrawTarget* aDrawTarget, nsPoint aPt);
/**
* If this frame IsFocused(), invalidates an area that includes anything
* that PaintFocus will or could have painted --- basically the whole
* GetOptionsContainer, plus some extra stuff if there are no options. This
* must be called every time mEndSelectionIndex changes.
*/
void InvalidateFocus();
/**
* Function to calculate the block size of a row, for use with the
* "size" attribute.
* Can't be const because GetNumberOfOptions() isn't const.
*/
nscoord CalcBSizeOfARow();
/**
* Function to ask whether we're currently in what might be the
* first pass of a two-pass reflow.
*/
bool MightNeedSecondPass() const {
return mMightNeedSecondPass;
}
void SetSuppressScrollbarUpdate(bool aSuppress) {
nsHTMLScrollFrame::SetSuppressScrollbarUpdate(aSuppress);
}
/**
* Return whether the list is in dropdown mode.
*/
bool IsInDropDownMode() const;
/**
* Return the number of displayed rows in the list.
*/
uint32_t GetNumDisplayRows() const { return mNumDisplayRows; }
/**
* Return true if the drop-down list can display more rows.
* (always false if not in drop-down mode)
*/
bool GetDropdownCanGrow() const { return mDropdownCanGrow; }
/**
* Dropdowns need views
*/
virtual bool NeedsView() override { return IsInDropDownMode(); }
/**
* Frees statics owned by this class.
*/
static void Shutdown();
#ifdef ACCESSIBILITY
/**
* Post a custom DOM event for the change, so that accessibility can
* fire a native focus event for accessibility
* (Some 3rd party products need to track our focus)
*/
void FireMenuItemActiveEvent(); // Inform assistive tech what got focused
#endif
protected:
/**
* Updates the selected text in a combobox and then calls FireOnChange().
* @note This method might destroy the frame, pres shell and other objects.
* Returns false if calling it destroyed |this|.
*/
bool UpdateSelection();
/**
* Returns whether mContent supports multiple selection.
*/
bool GetMultiple() const {
return mContent->HasAttr(kNameSpaceID_None, nsGkAtoms::multiple);
}
/**
* Toggles (show/hide) the combobox dropdown menu.
* @note This method might destroy the frame, pres shell and other objects.
*/
void DropDownToggleKey(nsIDOMEvent* aKeyEvent);
nsresult IsOptionDisabled(int32_t anIndex, bool &aIsDisabled);
/**
* @note This method might destroy the frame, pres shell and other objects.
*/
void ScrollToFrame(mozilla::dom::HTMLOptionElement& aOptElement);
/**
* @note This method might destroy the frame, pres shell and other objects.
*/
void ScrollToIndex(int32_t anIndex);
/**
* When the user clicks on the comboboxframe to show the dropdown
* listbox, they then have to move the mouse into the list. We don't
* want to process those mouse events as selection events (i.e., to
* scroll list items into view). So we ignore the events until
* the mouse moves below our border-inner-edge, when
* mItemSelectionStarted is set.
*
* @param aPoint relative to this frame
*/
bool IgnoreMouseEventForSelection(nsIDOMEvent* aEvent);
/**
* If the dropdown is showing and the mouse has moved below our
* border-inner-edge, then set mItemSelectionStarted.
*/
void UpdateInListState(nsIDOMEvent* aEvent);
void AdjustIndexForDisabledOpt(int32_t aStartIndex, int32_t &anNewIndex,
int32_t aNumOptions, int32_t aDoAdjustInc, int32_t aDoAdjustIncNext);
/**
* Resets the select back to it's original default values;
* those values as determined by the original HTML
*/
virtual void ResetList(bool aAllowScrolling);
explicit nsListControlFrame(nsStyleContext* aContext);
virtual ~nsListControlFrame();
/**
* Sets the mSelectedIndex and mOldSelectedIndex from figuring out what
* item was selected using content
* @param aPoint the event point, in listcontrolframe coordinates
* @return NS_OK if it successfully found the selection
*/
nsresult GetIndexFromDOMEvent(nsIDOMEvent* aMouseEvent, int32_t& aCurIndex);
bool CheckIfAllFramesHere();
bool IsLeftButton(nsIDOMEvent* aMouseEvent);
// guess at a row block size based on our own style.
nscoord CalcFallbackRowBSize(float aFontSizeInflation);
// CalcIntrinsicBSize computes our intrinsic block size (taking the
// "size" attribute into account). This should only be called in
// non-dropdown mode.
nscoord CalcIntrinsicBSize(nscoord aBSizeOfARow, int32_t aNumberOfOptions);
// Dropped down stuff
void SetComboboxItem(int32_t aIndex);
/**
* Method to reflow ourselves as a dropdown list. This differs from
* reflow as a listbox because the criteria for needing a second
* pass are different. This will be called from Reflow() as needed.
*/
void ReflowAsDropdown(nsPresContext* aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus);
// Selection
bool SetOptionsSelectedFromFrame(int32_t aStartIndex,
int32_t aEndIndex,
bool aValue,
bool aClearAll);
bool ToggleOptionSelectedFromFrame(int32_t aIndex);
/**
* @note This method might destroy the frame, pres shell and other objects.
*/
bool SingleSelection(int32_t aClickedIndex, bool aDoToggle);
bool ExtendedSelection(int32_t aStartIndex, int32_t aEndIndex,
bool aClearAll);
/**
* @note This method might destroy the frame, pres shell and other objects.
*/
bool PerformSelection(int32_t aClickedIndex, bool aIsShift,
bool aIsControl);
/**
* @note This method might destroy the frame, pres shell and other objects.
*/
bool HandleListSelection(nsIDOMEvent * aDOMEvent, int32_t selectedIndex);
void InitSelectionRange(int32_t aClickedIndex);
void PostHandleKeyEvent(int32_t aNewIndex, uint32_t aCharCode,
bool aIsShift, bool aIsControlOrMeta);
public:
nsSelectsAreaFrame* GetOptionsContainer() const {
return static_cast<nsSelectsAreaFrame*>(GetScrolledFrame());
}
protected:
nscoord BSizeOfARow() {
return GetOptionsContainer()->BSizeOfARow();
}
/**
* @return how many displayable options/optgroups this frame has.
*/
uint32_t GetNumberOfRows();
// Data Members
int32_t mStartSelectionIndex;
int32_t mEndSelectionIndex;
nsIComboboxControlFrame *mComboboxFrame;
uint32_t mNumDisplayRows;
bool mChangesSinceDragStart:1;
bool mButtonDown:1;
// Has the user selected a visible item since we showed the
// dropdown?
bool mItemSelectionStarted:1;
bool mIsAllContentHere:1;
bool mIsAllFramesHere:1;
bool mHasBeenInitialized:1;
bool mNeedToReset:1;
bool mPostChildrenLoadedReset:1;
//bool value for multiple discontiguous selection
bool mControlSelectMode:1;
// True if we're in the middle of a reflow and might need a second
// pass. This only happens for auto heights.
bool mMightNeedSecondPass:1;
/**
* Set to aPresContext->HasPendingInterrupt() at the start of Reflow.
* Set to false at the end of DidReflow.
*/
bool mHasPendingInterruptAtStartOfReflow:1;
// True if the drop-down can show more rows. Always false if this list
// is not in drop-down mode.
bool mDropdownCanGrow:1;
// True if the selection can be set to nothing or disabled options.
bool mForceSelection:1;
// The last computed block size we reflowed at if we're a combobox
// dropdown.
// XXXbz should we be using a subclass here? Or just not worry
// about the extra member on listboxes?
nscoord mLastDropdownComputedBSize;
// At the time of our last dropdown, the backstop color to draw in case we
// are translucent.
nscolor mLastDropdownBackstopColor;
RefPtr<nsListEventListener> mEventListener;
static nsListControlFrame * mFocused;
static nsString * sIncrementalString;
#ifdef DO_REFLOW_COUNTER
int32_t mReflowId;
#endif
private:
// for incremental typing navigation
static nsAString& GetIncrementalString ();
static DOMTimeStamp gLastKeyTime;
class MOZ_RAII AutoIncrementalSearchResetter
{
public:
AutoIncrementalSearchResetter() :
mCancelled(false)
{
}
~AutoIncrementalSearchResetter()
{
if (!mCancelled) {
nsListControlFrame::GetIncrementalString().Truncate();
}
}
void Cancel()
{
mCancelled = true;
}
private:
bool mCancelled;
};
};
#endif /* nsListControlFrame_h___ */