mirror of
https://github.com/roytam1/palemoon27.git
synced 2026-05-26 14:30:27 +00:00
696c195395
- 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 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)
- 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 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 1175895 - separate tier start message for mach; r=ted (cd56ddae05)
- Bug 1077670 - Package tests in parallel. r=gps (28b531ba3d)
- 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)
226 lines
6.9 KiB
C++
226 lines
6.9 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/. */
|
|
|
|
#include "nsFormControlFrame.h"
|
|
|
|
#include "nsGkAtoms.h"
|
|
#include "nsLayoutUtils.h"
|
|
#include "nsIDOMHTMLInputElement.h"
|
|
#include "mozilla/EventStateManager.h"
|
|
#include "mozilla/LookAndFeel.h"
|
|
#include "nsDeviceContext.h"
|
|
#include "nsIContent.h"
|
|
|
|
using namespace mozilla;
|
|
|
|
//#define FCF_NOISY
|
|
|
|
nsFormControlFrame::nsFormControlFrame(nsStyleContext* aContext)
|
|
: nsAtomicContainerFrame(aContext)
|
|
{
|
|
}
|
|
|
|
nsFormControlFrame::~nsFormControlFrame()
|
|
{
|
|
}
|
|
|
|
nsIAtom*
|
|
nsFormControlFrame::GetType() const
|
|
{
|
|
return nsGkAtoms::formControlFrame;
|
|
}
|
|
|
|
void
|
|
nsFormControlFrame::DestroyFrom(nsIFrame* aDestructRoot)
|
|
{
|
|
// Unregister the access key registered in reflow
|
|
nsFormControlFrame::RegUnRegAccessKey(static_cast<nsIFrame*>(this), false);
|
|
nsAtomicContainerFrame::DestroyFrom(aDestructRoot);
|
|
}
|
|
|
|
NS_QUERYFRAME_HEAD(nsFormControlFrame)
|
|
NS_QUERYFRAME_ENTRY(nsIFormControlFrame)
|
|
NS_QUERYFRAME_TAIL_INHERITING(nsAtomicContainerFrame)
|
|
|
|
/* virtual */ nscoord
|
|
nsFormControlFrame::GetMinISize(nsRenderingContext *aRenderingContext)
|
|
{
|
|
nscoord result;
|
|
DISPLAY_MIN_WIDTH(this, result);
|
|
result = GetIntrinsicISize();
|
|
return result;
|
|
}
|
|
|
|
/* virtual */ nscoord
|
|
nsFormControlFrame::GetPrefISize(nsRenderingContext *aRenderingContext)
|
|
{
|
|
nscoord result;
|
|
DISPLAY_PREF_WIDTH(this, result);
|
|
result = GetIntrinsicISize();
|
|
return result;
|
|
}
|
|
|
|
/* virtual */
|
|
LogicalSize
|
|
nsFormControlFrame::ComputeAutoSize(nsRenderingContext *aRenderingContext,
|
|
WritingMode aWM,
|
|
const LogicalSize& aCBSize,
|
|
nscoord aAvailableISize,
|
|
const LogicalSize& aMargin,
|
|
const LogicalSize& aBorder,
|
|
const LogicalSize& aPadding,
|
|
bool aShrinkWrap)
|
|
{
|
|
const WritingMode wm = GetWritingMode();
|
|
LogicalSize result(wm, GetIntrinsicISize(), GetIntrinsicBSize());
|
|
return result.ConvertTo(aWM, wm);
|
|
}
|
|
|
|
nscoord
|
|
nsFormControlFrame::GetIntrinsicISize()
|
|
{
|
|
// Provide a reasonable default for sites that use an "auto" height.
|
|
// Note that if you change this, you should change the values in forms.css
|
|
// as well. This is the 13px default width minus the 2px default border.
|
|
return nsPresContext::CSSPixelsToAppUnits(13 - 2 * 2);
|
|
}
|
|
|
|
nscoord
|
|
nsFormControlFrame::GetIntrinsicBSize()
|
|
{
|
|
// Provide a reasonable default for sites that use an "auto" height.
|
|
// Note that if you change this, you should change the values in forms.css
|
|
// as well. This is the 13px default width minus the 2px default border.
|
|
return nsPresContext::CSSPixelsToAppUnits(13 - 2 * 2);
|
|
}
|
|
|
|
nscoord
|
|
nsFormControlFrame::GetLogicalBaseline(WritingMode aWritingMode) const
|
|
{
|
|
NS_ASSERTION(!NS_SUBTREE_DIRTY(this),
|
|
"frame must not be dirty");
|
|
// Treat radio buttons and checkboxes as having an intrinsic baseline
|
|
// at the block-end of the control (use the block-end content edge rather
|
|
// than the margin edge).
|
|
// For "inverted" lines (typically in writing-mode:vertical-lr), use the
|
|
// block-start end instead.
|
|
return aWritingMode.IsLineInverted()
|
|
? GetLogicalUsedBorderAndPadding(aWritingMode).BStart(aWritingMode)
|
|
: BSize(aWritingMode) -
|
|
GetLogicalUsedBorderAndPadding(aWritingMode).BEnd(aWritingMode);
|
|
}
|
|
|
|
void
|
|
nsFormControlFrame::Reflow(nsPresContext* aPresContext,
|
|
nsHTMLReflowMetrics& aDesiredSize,
|
|
const nsHTMLReflowState& aReflowState,
|
|
nsReflowStatus& aStatus)
|
|
{
|
|
MarkInReflow();
|
|
DO_GLOBAL_REFLOW_COUNT("nsFormControlFrame");
|
|
DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
|
|
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,
|
|
("enter nsFormControlFrame::Reflow: aMaxSize=%d,%d",
|
|
aReflowState.AvailableWidth(), aReflowState.AvailableHeight()));
|
|
|
|
if (mState & NS_FRAME_FIRST_REFLOW) {
|
|
RegUnRegAccessKey(static_cast<nsIFrame*>(this), true);
|
|
}
|
|
|
|
aStatus = NS_FRAME_COMPLETE;
|
|
aDesiredSize.SetSize(aReflowState.GetWritingMode(),
|
|
aReflowState.ComputedSizeWithBorderPadding());
|
|
|
|
if (nsLayoutUtils::FontSizeInflationEnabled(aPresContext)) {
|
|
float inflation = nsLayoutUtils::FontSizeInflationFor(this);
|
|
aDesiredSize.Width() *= inflation;
|
|
aDesiredSize.Height() *= inflation;
|
|
}
|
|
|
|
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,
|
|
("exit nsFormControlFrame::Reflow: size=%d,%d",
|
|
aDesiredSize.Width(), aDesiredSize.Height()));
|
|
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
|
|
|
|
aDesiredSize.SetOverflowAreasToDesiredBounds();
|
|
FinishAndStoreOverflow(&aDesiredSize);
|
|
}
|
|
|
|
nsresult
|
|
nsFormControlFrame::RegUnRegAccessKey(nsIFrame * aFrame, bool aDoReg)
|
|
{
|
|
NS_ENSURE_ARG_POINTER(aFrame);
|
|
|
|
nsPresContext* presContext = aFrame->PresContext();
|
|
|
|
NS_ASSERTION(presContext, "aPresContext is NULL in RegUnRegAccessKey!");
|
|
|
|
nsAutoString accessKey;
|
|
|
|
nsIContent* content = aFrame->GetContent();
|
|
content->GetAttr(kNameSpaceID_None, nsGkAtoms::accesskey, accessKey);
|
|
if (!accessKey.IsEmpty()) {
|
|
EventStateManager* stateManager = presContext->EventStateManager();
|
|
if (aDoReg) {
|
|
stateManager->RegisterAccessKey(content, (uint32_t)accessKey.First());
|
|
} else {
|
|
stateManager->UnregisterAccessKey(content, (uint32_t)accessKey.First());
|
|
}
|
|
return NS_OK;
|
|
}
|
|
return NS_ERROR_FAILURE;
|
|
}
|
|
|
|
void
|
|
nsFormControlFrame::SetFocus(bool aOn, bool aRepaint)
|
|
{
|
|
}
|
|
|
|
nsresult
|
|
nsFormControlFrame::HandleEvent(nsPresContext* aPresContext,
|
|
WidgetGUIEvent* aEvent,
|
|
nsEventStatus* aEventStatus)
|
|
{
|
|
// Check for user-input:none style
|
|
const nsStyleUserInterface* uiStyle = StyleUserInterface();
|
|
if (uiStyle->mUserInput == NS_STYLE_USER_INPUT_NONE ||
|
|
uiStyle->mUserInput == NS_STYLE_USER_INPUT_DISABLED)
|
|
return nsFrame::HandleEvent(aPresContext, aEvent, aEventStatus);
|
|
|
|
return NS_OK;
|
|
}
|
|
|
|
void
|
|
nsFormControlFrame::GetCurrentCheckState(bool *aState)
|
|
{
|
|
nsCOMPtr<nsIDOMHTMLInputElement> inputElement = do_QueryInterface(mContent);
|
|
if (inputElement) {
|
|
inputElement->GetChecked(aState);
|
|
}
|
|
}
|
|
|
|
nsresult
|
|
nsFormControlFrame::SetFormProperty(nsIAtom* aName, const nsAString& aValue)
|
|
{
|
|
return NS_OK;
|
|
}
|
|
|
|
// static
|
|
nsRect
|
|
nsFormControlFrame::GetUsableScreenRect(nsPresContext* aPresContext)
|
|
{
|
|
nsRect screen;
|
|
|
|
nsDeviceContext *context = aPresContext->DeviceContext();
|
|
int32_t dropdownCanOverlapOSBar =
|
|
LookAndFeel::GetInt(LookAndFeel::eIntID_MenusCanOverlapOSBar, 0);
|
|
if ( dropdownCanOverlapOSBar )
|
|
context->GetRect(screen);
|
|
else
|
|
context->GetClientRect(screen);
|
|
|
|
return screen;
|
|
}
|