2001-09-29 00:14:13 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 15:12:37 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
1998-09-23 21:16:51 +04:00
|
|
|
|
|
|
|
#include "nsFileControlFrame.h"
|
2000-05-02 07:40:44 +04:00
|
|
|
|
2006-12-26 20:47:52 +03:00
|
|
|
#include "nsGkAtoms.h"
|
1999-02-18 03:13:39 +03:00
|
|
|
#include "nsCOMPtr.h"
|
2000-12-30 22:22:22 +03:00
|
|
|
#include "nsIDocument.h"
|
|
|
|
#include "nsINodeInfo.h"
|
2013-12-03 18:40:10 +04:00
|
|
|
#include "mozilla/dom/Element.h"
|
2014-02-27 07:23:31 +04:00
|
|
|
#include "mozilla/dom/DataTransfer.h"
|
2013-08-08 00:23:08 +04:00
|
|
|
#include "mozilla/dom/HTMLButtonElement.h"
|
2013-03-28 23:41:32 +04:00
|
|
|
#include "mozilla/dom/HTMLInputElement.h"
|
2004-06-25 16:26:02 +04:00
|
|
|
#include "nsNodeInfoManager.h"
|
|
|
|
#include "nsContentCreatorFunctions.h"
|
2004-12-17 23:40:48 +03:00
|
|
|
#include "nsContentUtils.h"
|
2014-04-03 08:18:36 +04:00
|
|
|
#include "mozilla/EventStates.h"
|
2013-07-09 21:54:21 +04:00
|
|
|
#include "mozilla/dom/DOMStringList.h"
|
2011-06-01 10:06:38 +04:00
|
|
|
#include "nsIDOMDragEvent.h"
|
2013-09-06 10:40:45 +04:00
|
|
|
#include "nsIDOMFileList.h"
|
2012-09-06 00:49:53 +04:00
|
|
|
#include "nsContentList.h"
|
2013-02-09 18:57:30 +04:00
|
|
|
#include "nsIDOMMutationEvent.h"
|
2013-04-04 16:01:08 +04:00
|
|
|
#include "nsTextNode.h"
|
2011-06-01 10:06:38 +04:00
|
|
|
|
2012-10-16 02:44:34 +04:00
|
|
|
using namespace mozilla;
|
2013-03-28 23:41:32 +04:00
|
|
|
using namespace mozilla::dom;
|
2010-10-25 16:17:38 +04:00
|
|
|
|
2005-11-04 05:38:33 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewFileControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
|
1998-09-23 21:16:51 +04:00
|
|
|
{
|
2006-03-27 01:30:36 +04:00
|
|
|
return new (aPresShell) nsFileControlFrame(aContext);
|
1998-09-23 21:16:51 +04:00
|
|
|
}
|
|
|
|
|
2009-09-12 20:49:24 +04:00
|
|
|
NS_IMPL_FRAMEARENA_HELPERS(nsFileControlFrame)
|
|
|
|
|
2013-03-22 21:15:13 +04:00
|
|
|
nsFileControlFrame::nsFileControlFrame(nsStyleContext* aContext)
|
|
|
|
: nsBlockFrame(aContext)
|
1998-09-23 21:16:51 +04:00
|
|
|
{
|
2009-01-19 21:31:32 +03:00
|
|
|
AddStateBits(NS_BLOCK_FLOAT_MGR);
|
1999-07-01 02:17:43 +04:00
|
|
|
}
|
|
|
|
|
1999-08-19 18:03:53 +04:00
|
|
|
|
2013-03-20 05:47:48 +04:00
|
|
|
void
|
2014-05-25 02:20:40 +04:00
|
|
|
nsFileControlFrame::Init(nsIContent* aContent,
|
|
|
|
nsContainerFrame* aParent,
|
|
|
|
nsIFrame* aPrevInFlow)
|
2006-11-14 01:05:25 +03:00
|
|
|
{
|
2013-03-20 05:47:48 +04:00
|
|
|
nsBlockFrame::Init(aContent, aParent, aPrevInFlow);
|
2006-11-14 01:05:25 +03:00
|
|
|
|
2013-03-27 15:32:00 +04:00
|
|
|
mMouseListener = new DnDListener(this);
|
2006-11-14 01:05:25 +03:00
|
|
|
}
|
|
|
|
|
2006-04-10 04:16:29 +04:00
|
|
|
void
|
2009-12-24 08:21:15 +03:00
|
|
|
nsFileControlFrame::DestroyFrom(nsIFrame* aDestructRoot)
|
2004-05-22 05:17:00 +04:00
|
|
|
{
|
2008-01-11 00:55:38 +03:00
|
|
|
ENSURE_TRUE(mContent);
|
|
|
|
|
2013-03-22 21:15:13 +04:00
|
|
|
// Remove the events.
|
2011-11-29 08:39:21 +04:00
|
|
|
if (mContent) {
|
|
|
|
mContent->RemoveSystemEventListener(NS_LITERAL_STRING("drop"),
|
|
|
|
mMouseListener, false);
|
|
|
|
mContent->RemoveSystemEventListener(NS_LITERAL_STRING("dragover"),
|
|
|
|
mMouseListener, false);
|
2011-06-01 10:06:38 +04:00
|
|
|
}
|
|
|
|
|
2011-06-24 06:18:02 +04:00
|
|
|
nsContentUtils::DestroyAnonymousContent(&mTextContent);
|
2013-03-27 15:35:22 +04:00
|
|
|
nsContentUtils::DestroyAnonymousContent(&mBrowse);
|
2006-11-14 01:05:25 +03:00
|
|
|
|
|
|
|
mMouseListener->ForgetFrame();
|
2009-12-24 08:21:15 +03:00
|
|
|
nsBlockFrame::DestroyFrom(aDestructRoot);
|
2002-12-20 08:40:37 +03:00
|
|
|
}
|
|
|
|
|
2007-02-18 20:34:09 +03:00
|
|
|
nsresult
|
2011-05-07 00:04:44 +04:00
|
|
|
nsFileControlFrame::CreateAnonymousContent(nsTArray<ContentInfo>& aElements)
|
1999-07-01 02:17:43 +04:00
|
|
|
{
|
2003-07-29 01:25:13 +04:00
|
|
|
nsCOMPtr<nsIDocument> doc = mContent->GetDocument();
|
2013-02-09 19:09:14 +04:00
|
|
|
|
|
|
|
// Create and setup the file picking button.
|
2013-12-03 18:40:10 +04:00
|
|
|
mBrowse = doc->CreateHTMLElement(nsGkAtoms::button);
|
2013-09-25 00:29:27 +04:00
|
|
|
// NOTE: SetIsNativeAnonymousRoot() has to be called before setting any
|
|
|
|
// attribute.
|
|
|
|
mBrowse->SetIsNativeAnonymousRoot();
|
2013-02-09 19:09:14 +04:00
|
|
|
mBrowse->SetAttr(kNameSpaceID_None, nsGkAtoms::type,
|
|
|
|
NS_LITERAL_STRING("button"), false);
|
2001-02-20 00:50:04 +03:00
|
|
|
|
2013-02-09 14:48:20 +04:00
|
|
|
// Set the file picking button text depending on the current locale.
|
2013-03-29 16:32:47 +04:00
|
|
|
nsXPIDLString buttonTxt;
|
2013-02-09 14:48:20 +04:00
|
|
|
nsContentUtils::GetLocalizedString(nsContentUtils::eFORMS_PROPERTIES,
|
2013-03-29 16:32:47 +04:00
|
|
|
"Browse", buttonTxt);
|
|
|
|
|
|
|
|
// Set the browse button text. It's a bit of a pain to do because we want to
|
|
|
|
// make sure we are not notifying.
|
2013-04-04 16:01:08 +04:00
|
|
|
nsRefPtr<nsTextNode> textContent =
|
|
|
|
new nsTextNode(mBrowse->NodeInfo()->NodeInfoManager());
|
2013-03-29 16:32:47 +04:00
|
|
|
|
|
|
|
textContent->SetText(buttonTxt, false);
|
|
|
|
|
2013-04-04 16:01:08 +04:00
|
|
|
nsresult rv = mBrowse->AppendChildTo(textContent, false);
|
2013-03-29 16:32:47 +04:00
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
2013-02-09 14:48:20 +04:00
|
|
|
|
2013-02-09 19:09:14 +04:00
|
|
|
// Make sure access key and tab order for the element actually redirect to the
|
|
|
|
// file picking button.
|
2013-08-08 00:23:08 +04:00
|
|
|
nsRefPtr<HTMLInputElement> fileContent = HTMLInputElement::FromContentOrNull(mContent);
|
|
|
|
nsRefPtr<HTMLButtonElement> browseControl = HTMLButtonElement::FromContentOrNull(mBrowse);
|
2013-02-09 19:09:14 +04:00
|
|
|
|
|
|
|
nsAutoString accessKey;
|
|
|
|
fileContent->GetAccessKey(accessKey);
|
|
|
|
browseControl->SetAccessKey(accessKey);
|
|
|
|
|
|
|
|
int32_t tabIndex;
|
|
|
|
fileContent->GetTabIndex(&tabIndex);
|
|
|
|
browseControl->SetTabIndex(tabIndex);
|
|
|
|
|
|
|
|
if (!aElements.AppendElement(mBrowse)) {
|
2007-02-18 20:34:09 +03:00
|
|
|
return NS_ERROR_OUT_OF_MEMORY;
|
2013-02-09 19:09:14 +04:00
|
|
|
}
|
2007-02-18 20:34:09 +03:00
|
|
|
|
2013-02-09 19:09:14 +04:00
|
|
|
// Create and setup the text showing the selected files.
|
2013-12-03 18:40:10 +04:00
|
|
|
nsCOMPtr<nsINodeInfo> nodeInfo;
|
2013-02-09 19:09:14 +04:00
|
|
|
nodeInfo = doc->NodeInfoManager()->GetNodeInfo(nsGkAtoms::label, nullptr,
|
|
|
|
kNameSpaceID_XUL,
|
|
|
|
nsIDOMNode::ELEMENT_NODE);
|
|
|
|
NS_TrustedNewXULElement(getter_AddRefs(mTextContent), nodeInfo.forget());
|
2013-09-25 00:29:27 +04:00
|
|
|
// NOTE: SetIsNativeAnonymousRoot() has to be called before setting any
|
|
|
|
// attribute.
|
|
|
|
mTextContent->SetIsNativeAnonymousRoot();
|
2013-02-09 18:57:30 +04:00
|
|
|
mTextContent->SetAttr(kNameSpaceID_None, nsGkAtoms::crop,
|
|
|
|
NS_LITERAL_STRING("center"), false);
|
2007-02-18 20:34:09 +03:00
|
|
|
|
2013-02-09 19:09:14 +04:00
|
|
|
// Update the displayed text to reflect the current element's value.
|
2010-09-05 22:00:05 +04:00
|
|
|
nsAutoString value;
|
2013-03-28 23:41:32 +04:00
|
|
|
HTMLInputElement::FromContent(mContent)->GetDisplayFileName(value);
|
2013-02-09 18:57:30 +04:00
|
|
|
UpdateDisplayedValue(value, false);
|
1999-07-01 02:17:43 +04:00
|
|
|
|
2013-02-09 19:09:14 +04:00
|
|
|
if (!aElements.AppendElement(mTextContent)) {
|
2007-02-18 20:34:09 +03:00
|
|
|
return NS_ERROR_OUT_OF_MEMORY;
|
2013-02-09 19:09:14 +04:00
|
|
|
}
|
1999-07-01 02:17:43 +04:00
|
|
|
|
2013-03-27 15:32:00 +04:00
|
|
|
// We should be able to interact with the element by doing drag and drop.
|
2011-11-29 08:39:21 +04:00
|
|
|
mContent->AddSystemEventListener(NS_LITERAL_STRING("drop"),
|
|
|
|
mMouseListener, false);
|
|
|
|
mContent->AddSystemEventListener(NS_LITERAL_STRING("dragover"),
|
|
|
|
mMouseListener, false);
|
2007-02-18 20:34:09 +03:00
|
|
|
|
2010-12-14 21:00:57 +03:00
|
|
|
SyncDisabledState();
|
2000-01-14 02:34:01 +03:00
|
|
|
|
1999-07-01 02:17:43 +04:00
|
|
|
return NS_OK;
|
1998-09-23 21:16:51 +04:00
|
|
|
}
|
|
|
|
|
2010-02-11 20:34:01 +03:00
|
|
|
void
|
2010-10-15 19:34:35 +04:00
|
|
|
nsFileControlFrame::AppendAnonymousContentTo(nsBaseContentList& aElements,
|
2012-08-22 19:56:38 +04:00
|
|
|
uint32_t aFilter)
|
2010-02-11 20:34:01 +03:00
|
|
|
{
|
|
|
|
aElements.MaybeAppendElement(mBrowse);
|
2013-03-27 15:35:22 +04:00
|
|
|
aElements.MaybeAppendElement(mTextContent);
|
2010-02-11 20:34:01 +03:00
|
|
|
}
|
|
|
|
|
2009-01-12 22:20:59 +03:00
|
|
|
NS_QUERYFRAME_HEAD(nsFileControlFrame)
|
|
|
|
NS_QUERYFRAME_ENTRY(nsIAnonymousContentCreator)
|
|
|
|
NS_QUERYFRAME_ENTRY(nsIFormControlFrame)
|
|
|
|
NS_QUERYFRAME_TAIL_INHERITING(nsBlockFrame)
|
1998-09-23 21:16:51 +04:00
|
|
|
|
1998-10-23 03:00:37 +04:00
|
|
|
void
|
2011-09-29 10:19:26 +04:00
|
|
|
nsFileControlFrame::SetFocus(bool aOn, bool aRepaint)
|
1998-10-23 03:00:37 +04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2011-06-01 10:06:38 +04:00
|
|
|
/**
|
2013-03-27 15:32:00 +04:00
|
|
|
* This is called when we receive a drop or a dragover.
|
2011-06-01 10:06:38 +04:00
|
|
|
*/
|
|
|
|
NS_IMETHODIMP
|
2013-03-27 15:32:00 +04:00
|
|
|
nsFileControlFrame::DnDListener::HandleEvent(nsIDOMEvent* aEvent)
|
2011-06-01 10:06:38 +04:00
|
|
|
{
|
|
|
|
NS_ASSERTION(mFrame, "We should have been unregistered");
|
2011-06-29 22:07:57 +04:00
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
bool defaultPrevented = false;
|
2013-05-26 01:05:36 +04:00
|
|
|
aEvent->GetDefaultPrevented(&defaultPrevented);
|
2011-06-01 10:06:38 +04:00
|
|
|
if (defaultPrevented) {
|
|
|
|
return NS_OK;
|
|
|
|
}
|
2013-03-27 15:32:00 +04:00
|
|
|
|
2011-06-01 10:06:38 +04:00
|
|
|
nsCOMPtr<nsIDOMDragEvent> dragEvent = do_QueryInterface(aEvent);
|
|
|
|
if (!dragEvent || !IsValidDropData(dragEvent)) {
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2013-03-27 15:32:00 +04:00
|
|
|
nsAutoString eventType;
|
|
|
|
aEvent->GetType(eventType);
|
2011-06-01 10:06:38 +04:00
|
|
|
if (eventType.EqualsLiteral("dragover")) {
|
|
|
|
// Prevent default if we can accept this drag data
|
|
|
|
aEvent->PreventDefault();
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (eventType.EqualsLiteral("drop")) {
|
|
|
|
aEvent->StopPropagation();
|
|
|
|
aEvent->PreventDefault();
|
|
|
|
|
|
|
|
nsIContent* content = mFrame->GetContent();
|
|
|
|
NS_ASSERTION(content, "The frame has no content???");
|
|
|
|
|
2013-03-28 23:41:32 +04:00
|
|
|
HTMLInputElement* inputElement = HTMLInputElement::FromContent(content);
|
2011-06-01 10:06:38 +04:00
|
|
|
NS_ASSERTION(inputElement, "No input element for this file upload control frame!");
|
|
|
|
|
|
|
|
nsCOMPtr<nsIDOMDataTransfer> dataTransfer;
|
|
|
|
dragEvent->GetDataTransfer(getter_AddRefs(dataTransfer));
|
|
|
|
|
|
|
|
nsCOMPtr<nsIDOMFileList> fileList;
|
|
|
|
dataTransfer->GetFiles(getter_AddRefs(fileList));
|
2011-06-10 16:44:53 +04:00
|
|
|
|
2011-06-01 10:06:38 +04:00
|
|
|
inputElement->SetFiles(fileList, true);
|
2012-09-14 18:38:04 +04:00
|
|
|
nsContentUtils::DispatchTrustedEvent(content->OwnerDoc(), content,
|
|
|
|
NS_LITERAL_STRING("change"), true,
|
|
|
|
false);
|
2011-06-01 10:06:38 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
/* static */ bool
|
2013-03-27 15:32:00 +04:00
|
|
|
nsFileControlFrame::DnDListener::IsValidDropData(nsIDOMDragEvent* aEvent)
|
2011-06-01 10:06:38 +04:00
|
|
|
{
|
2013-07-09 21:54:21 +04:00
|
|
|
nsCOMPtr<nsIDOMDataTransfer> domDataTransfer;
|
|
|
|
aEvent->GetDataTransfer(getter_AddRefs(domDataTransfer));
|
|
|
|
nsCOMPtr<DataTransfer> dataTransfer = do_QueryInterface(domDataTransfer);
|
2011-10-17 18:59:28 +04:00
|
|
|
NS_ENSURE_TRUE(dataTransfer, false);
|
2011-06-01 10:06:38 +04:00
|
|
|
|
|
|
|
// We only support dropping files onto a file upload control
|
2013-07-09 21:54:21 +04:00
|
|
|
nsRefPtr<DOMStringList> types = dataTransfer->Types();
|
|
|
|
return types->Contains(NS_LITERAL_STRING("Files"));
|
2011-06-01 10:06:38 +04:00
|
|
|
}
|
|
|
|
|
Bug 300030: Move intrinsic width computation out of nsIFrame::Reflow and into its own methods on nsIFrame. Replace reflow reasons, types, and commands with dirty bits/notifications. Thanks to bzbarsky for almost all of the HTML form controls (mozilla/layout/forms) changes, and many others for help testing and patching. For detailed commit logs, see REFLOW_YYYYMMDD_BRANCH, where YYYYMMDD is one of 20061031, 20060830, 20060603, 20060302, 20060119, 20051011, 20050804, 20050429, 20050315, 20050111, and 20041213.
2006-12-08 08:38:33 +03:00
|
|
|
nscoord
|
2011-04-08 05:04:40 +04:00
|
|
|
nsFileControlFrame::GetMinWidth(nsRenderingContext *aRenderingContext)
|
Bug 300030: Move intrinsic width computation out of nsIFrame::Reflow and into its own methods on nsIFrame. Replace reflow reasons, types, and commands with dirty bits/notifications. Thanks to bzbarsky for almost all of the HTML form controls (mozilla/layout/forms) changes, and many others for help testing and patching. For detailed commit logs, see REFLOW_YYYYMMDD_BRANCH, where YYYYMMDD is one of 20061031, 20060830, 20060603, 20060302, 20060119, 20051011, 20050804, 20050429, 20050315, 20050111, and 20041213.
2006-12-08 08:38:33 +03:00
|
|
|
{
|
|
|
|
nscoord result;
|
|
|
|
DISPLAY_MIN_WIDTH(this, result);
|
|
|
|
|
|
|
|
// Our min width is our pref width
|
|
|
|
result = GetPrefWidth(aRenderingContext);
|
|
|
|
return result;
|
|
|
|
}
|
1998-09-23 21:16:51 +04:00
|
|
|
|
2010-12-14 21:00:57 +03:00
|
|
|
void
|
|
|
|
nsFileControlFrame::SyncDisabledState()
|
|
|
|
{
|
2014-04-03 08:18:36 +04:00
|
|
|
EventStates eventStates = mContent->AsElement()->State();
|
2010-12-14 21:00:57 +03:00
|
|
|
if (eventStates.HasState(NS_EVENT_STATE_DISABLED)) {
|
|
|
|
mBrowse->SetAttr(kNameSpaceID_None, nsGkAtoms::disabled, EmptyString(),
|
2011-10-17 18:59:28 +04:00
|
|
|
true);
|
2010-12-14 21:00:57 +03:00
|
|
|
} else {
|
2011-10-17 18:59:28 +04:00
|
|
|
mBrowse->UnsetAttr(kNameSpaceID_None, nsGkAtoms::disabled, true);
|
2010-12-14 21:00:57 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-02-18 11:47:48 +04:00
|
|
|
nsresult
|
2013-02-09 18:57:30 +04:00
|
|
|
nsFileControlFrame::AttributeChanged(int32_t aNameSpaceID,
|
|
|
|
nsIAtom* aAttribute,
|
|
|
|
int32_t aModType)
|
1999-08-19 18:03:53 +04:00
|
|
|
{
|
2013-02-09 18:57:30 +04:00
|
|
|
if (aNameSpaceID == kNameSpaceID_None && aAttribute == nsGkAtoms::tabindex) {
|
|
|
|
if (aModType == nsIDOMMutationEvent::REMOVAL) {
|
|
|
|
mBrowse->UnsetAttr(aNameSpaceID, aAttribute, true);
|
|
|
|
} else {
|
|
|
|
nsAutoString value;
|
|
|
|
mContent->GetAttr(aNameSpaceID, aAttribute, value);
|
|
|
|
mBrowse->SetAttr(aNameSpaceID, aAttribute, value, true);
|
2008-12-17 10:33:33 +03:00
|
|
|
}
|
1999-08-19 18:03:53 +04:00
|
|
|
}
|
|
|
|
|
2008-12-29 18:07:38 +03:00
|
|
|
return nsBlockFrame::AttributeChanged(aNameSpaceID, aAttribute, aModType);
|
1999-08-19 18:03:53 +04:00
|
|
|
}
|
|
|
|
|
2010-12-14 21:00:57 +03:00
|
|
|
void
|
2014-04-03 08:18:36 +04:00
|
|
|
nsFileControlFrame::ContentStatesChanged(EventStates aStates)
|
2010-12-14 21:00:57 +03:00
|
|
|
{
|
|
|
|
if (aStates.HasState(NS_EVENT_STATE_DISABLED)) {
|
|
|
|
nsContentUtils::AddScriptRunner(new SyncDisabledStateEvent(this));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-01-06 03:31:14 +04:00
|
|
|
#ifdef DEBUG_FRAME_DUMP
|
2014-02-18 11:47:48 +04:00
|
|
|
nsresult
|
2001-11-14 04:33:42 +03:00
|
|
|
nsFileControlFrame::GetFrameName(nsAString& aResult) const
|
1998-11-19 20:22:29 +03:00
|
|
|
{
|
2001-11-14 04:33:42 +03:00
|
|
|
return MakeFrameName(NS_LITERAL_STRING("FileControl"), aResult);
|
1998-11-19 20:22:29 +03:00
|
|
|
}
|
1999-11-02 01:12:45 +03:00
|
|
|
#endif
|
1999-01-22 18:32:57 +03:00
|
|
|
|
2013-02-09 18:57:30 +04:00
|
|
|
void
|
|
|
|
nsFileControlFrame::UpdateDisplayedValue(const nsAString& aValue, bool aNotify)
|
|
|
|
{
|
2013-02-07 17:58:05 +04:00
|
|
|
mTextContent->SetAttr(kNameSpaceID_None, nsGkAtoms::value, aValue, aNotify);
|
2013-02-09 18:57:30 +04:00
|
|
|
}
|
|
|
|
|
2005-12-13 03:57:56 +03:00
|
|
|
nsresult
|
|
|
|
nsFileControlFrame::SetFormProperty(nsIAtom* aName,
|
|
|
|
const nsAString& aValue)
|
1999-01-26 01:16:27 +03:00
|
|
|
{
|
2006-12-26 20:47:52 +03:00
|
|
|
if (nsGkAtoms::value == aName) {
|
2013-02-09 18:57:30 +04:00
|
|
|
UpdateDisplayedValue(aValue, true);
|
1999-02-11 04:13:28 +03:00
|
|
|
}
|
2005-12-13 02:53:06 +03:00
|
|
|
return NS_OK;
|
2013-02-09 18:57:30 +04:00
|
|
|
}
|
1999-01-26 01:16:27 +03:00
|
|
|
|
2013-02-14 15:12:27 +04:00
|
|
|
void
|
2006-01-26 05:29:17 +03:00
|
|
|
nsFileControlFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|
|
|
const nsRect& aDirtyRect,
|
|
|
|
const nsDisplayListSet& aLists)
|
1999-02-11 04:13:28 +03:00
|
|
|
{
|
2013-05-17 21:40:14 +04:00
|
|
|
BuildDisplayListForInline(aBuilder, aDirtyRect, aLists);
|
2006-01-26 05:29:17 +03:00
|
|
|
}
|
2006-11-14 01:05:25 +03:00
|
|
|
|
2007-09-28 05:09:14 +04:00
|
|
|
#ifdef ACCESSIBILITY
|
2012-09-29 01:53:44 +04:00
|
|
|
a11y::AccType
|
|
|
|
nsFileControlFrame::AccessibleType()
|
2007-09-28 05:09:14 +04:00
|
|
|
{
|
2012-12-18 05:25:52 +04:00
|
|
|
return a11y::eHTMLFileInputType;
|
2007-09-28 05:09:14 +04:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2006-11-14 01:05:25 +03:00
|
|
|
////////////////////////////////////////////////////////////
|
|
|
|
// Mouse listener implementation
|
|
|
|
|
2014-04-27 11:06:00 +04:00
|
|
|
NS_IMPL_ISUPPORTS(nsFileControlFrame::MouseListener,
|
|
|
|
nsIDOMEventListener)
|