Attachment #445683: Patch - WIP for bug #556743

View | Details | Raw Unified | Return to bug 556743
Collapse All | Expand All

(-)a/content/base/src/nsGkAtomList.h (+1 lines)
Line     Link Here 
 Lines 468-483   GK_ATOM(keepcurrentinview, "keepcurrenti Link Here 
468
GK_ATOM(key, "key")
468
GK_ATOM(key, "key")
469
GK_ATOM(keycode, "keycode")
469
GK_ATOM(keycode, "keycode")
470
GK_ATOM(keydown, "keydown")
470
GK_ATOM(keydown, "keydown")
471
GK_ATOM(keypress, "keypress")
471
GK_ATOM(keypress, "keypress")
472
GK_ATOM(keyset, "keyset")
472
GK_ATOM(keyset, "keyset")
473
GK_ATOM(keytext, "keytext")
473
GK_ATOM(keytext, "keytext")
474
GK_ATOM(keyup, "keyup")
474
GK_ATOM(keyup, "keyup")
475
GK_ATOM(label, "label")
475
GK_ATOM(label, "label")
476
GK_ATOM(labels, "labels")
476
GK_ATOM(lang, "lang")
477
GK_ATOM(lang, "lang")
477
GK_ATOM(last, "last")
478
GK_ATOM(last, "last")
478
GK_ATOM(layer, "layer")
479
GK_ATOM(layer, "layer")
479
GK_ATOM(layout, "layout")
480
GK_ATOM(layout, "layout")
480
GK_ATOM(leading, "leading")
481
GK_ATOM(leading, "leading")
481
GK_ATOM(leaf, "leaf")
482
GK_ATOM(leaf, "leaf")
482
GK_ATOM(left, "left")
483
GK_ATOM(left, "left")
483
GK_ATOM(leftmargin, "leftmargin")
484
GK_ATOM(leftmargin, "leftmargin")
(-)a/content/html/content/public/Makefile.in (+1 lines)
Line     Link Here 
 Lines 63-74   EXPORTS = \ Link Here 
63
		nsITextControlElement.h \
63
		nsITextControlElement.h \
64
		nsIFileControlElement.h \
64
		nsIFileControlElement.h \
65
		nsIFormSubmission.h \
65
		nsIFormSubmission.h \
66
		nsIFrameSetElement.h \
66
		nsIFrameSetElement.h \
67
		nsHTMLAudioElement.h \
67
		nsHTMLAudioElement.h \
68
		nsHTMLMediaElement.h \
68
		nsHTMLMediaElement.h \
69
		nsHTMLVideoElement.h \
69
		nsHTMLVideoElement.h \
70
		nsIHTMLCollection.h \
70
		nsIHTMLCollection.h \
71
		nsILabelableElement.h \
71
                $(NULL)
72
                $(NULL)
72
73
73
include $(topsrcdir)/config/rules.mk
74
include $(topsrcdir)/config/rules.mk
74
75
(-)a/content/html/content/public/nsILabelableElement.h (+76 lines)
Line     Link Here 
Line 0    Link Here 
1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2
/* ***** BEGIN LICENSE BLOCK *****
3
 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
4
 *
5
 * The contents of this file are subject to the Mozilla Public License Version
6
 * 1.1 (the "License"); you may not use this file except in compliance with
7
 * the License. You may obtain a copy of the License at
8
 * http://www.mozilla.org/MPL/
9
 *
10
 * Software distributed under the License is distributed on an "AS IS" basis,
11
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12
 * for the specific language governing rights and limitations under the
13
 * License.
14
 *
15
 * The Original Code is mozilla.org code.
16
 *
17
 * The Initial Developer of the Original Code is Mozilla Foundation
18
 * Portions created by the Initial Developer are Copyright (C) 2010
19
 * the Initial Developer. All Rights Reserved.
20
 *
21
 * Contributor(s):
22
 *   Mounir Lamouri <mounir.lamouri@mozilla.com> (original author)
23
 *
24
 * Alternatively, the contents of this file may be used under the terms of
25
 * either of the GNU General Public License Version 2 or later (the "GPL"),
26
 * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27
 * in which case the provisions of the GPL or the LGPL are applicable instead
28
 * of those above. If you wish to allow use of your version of this file only
29
 * under the terms of either the GPL or the LGPL, and not to allow others to
30
 * use your version of this file under the terms of the MPL, indicate your
31
 * decision by deleting the provisions above and replace them with the notice
32
 * and other provisions required by the GPL or the LGPL. If you do not delete
33
 * the provisions above, a recipient may use your version of this file under
34
 * the terms of any one of the MPL, the GPL or the LGPL.
35
 *
36
 * ***** END LICENSE BLOCK ***** */
37
38
#ifndef nsILabelableElement_h___
39
#define nsILabelableElement_h___
40
41
#include "nsISupports.h"
42
#include "nsIContent.h"
43
#include "nsContentList.h"
44
45
#define NS_ILABELABLEELEMENT_IID \
46
{ 0x6108a3d2, 0xf607, 0x4215, \
47
 { 0xa6, 0xdc, 0xa3, 0xb7, 0xca, 0x1e, 0x0c, 0x8e } }
48
49
50
/**
51
 * Interface which labelable form controls have to use.
52
 */
53
class nsILabelableElement : public nsISupports
54
{
55
public:
56
57
  NS_DECLARE_STATIC_IID_ACCESSOR(NS_ILABELABLEELEMENT_IID);
58
59
  void AppendLabel(nsIContent* aContent)
60
  {
61
    mLabelList.AppendElement(aContent);
62
  }
63
64
  void RemoveLabel(nsIContent* aContent)
65
  {
66
    mLabelList.RemoveElement(aContent);
67
  }
68
69
protected:
70
  nsBaseContentList   mLabelList;
71
};
72
73
NS_DEFINE_STATIC_IID_ACCESSOR(nsILabelableElement, NS_ILABELABLEELEMENT_IID)
74
75
#endif /* nsILabelableElement_h___ */
76
(-)a/content/html/content/src/nsGenericHTMLElement.h (-2 / +3 lines)
Line     Link Here 
 Lines 1205-1233   NS_NewHTML##_elementName##Element(nsINod Link Here 
1205
    NS_INTERFACE_TABLE_ENTRY(_class, _i4)                                     \
1205
    NS_INTERFACE_TABLE_ENTRY(_class, _i4)                                     \
1206
    NS_INTERFACE_TABLE_ENTRY(_class, _i5)                                     \
1206
    NS_INTERFACE_TABLE_ENTRY(_class, _i5)                                     \
1207
    NS_INTERFACE_TABLE_ENTRY(_class, _i6)                                     \
1207
    NS_INTERFACE_TABLE_ENTRY(_class, _i6)                                     \
1208
    NS_INTERFACE_TABLE_ENTRY(_class, _i7)                                     \
1208
    NS_INTERFACE_TABLE_ENTRY(_class, _i7)                                     \
1209
    NS_INTERFACE_TABLE_ENTRY(_class, _i8)                                     \
1209
    NS_INTERFACE_TABLE_ENTRY(_class, _i8)                                     \
1210
    NS_INTERFACE_TABLE_ENTRY(_class, _i9)                                     \
1210
    NS_INTERFACE_TABLE_ENTRY(_class, _i9)                                     \
1211
  NS_OFFSET_AND_INTERFACE_TABLE_END
1211
  NS_OFFSET_AND_INTERFACE_TABLE_END
1212
1212
1213
#define NS_HTML_CONTENT_INTERFACE_TABLE10(_class, _i1, _i2, _i3, _i4, _i5,    \
1213
#define NS_HTML_CONTENT_INTERFACE_TABLE11(_class, _i1, _i2, _i3, _i4, _i5,    \
1214
                                          _i6, _i7, _i8, _i9, _i10)           \
1214
                                          _i6, _i7, _i8, _i9, _i10, _i11)     \
1215
  NS_HTML_CONTENT_INTERFACE_TABLE_BEGIN(_class)                               \
1215
  NS_HTML_CONTENT_INTERFACE_TABLE_BEGIN(_class)                               \
1216
    NS_INTERFACE_TABLE_ENTRY(_class, _i1)                                     \
1216
    NS_INTERFACE_TABLE_ENTRY(_class, _i1)                                     \
1217
    NS_INTERFACE_TABLE_ENTRY(_class, _i2)                                     \
1217
    NS_INTERFACE_TABLE_ENTRY(_class, _i2)                                     \
1218
    NS_INTERFACE_TABLE_ENTRY(_class, _i3)                                     \
1218
    NS_INTERFACE_TABLE_ENTRY(_class, _i3)                                     \
1219
    NS_INTERFACE_TABLE_ENTRY(_class, _i4)                                     \
1219
    NS_INTERFACE_TABLE_ENTRY(_class, _i4)                                     \
1220
    NS_INTERFACE_TABLE_ENTRY(_class, _i5)                                     \
1220
    NS_INTERFACE_TABLE_ENTRY(_class, _i5)                                     \
1221
    NS_INTERFACE_TABLE_ENTRY(_class, _i6)                                     \
1221
    NS_INTERFACE_TABLE_ENTRY(_class, _i6)                                     \
1222
    NS_INTERFACE_TABLE_ENTRY(_class, _i7)                                     \
1222
    NS_INTERFACE_TABLE_ENTRY(_class, _i7)                                     \
1223
    NS_INTERFACE_TABLE_ENTRY(_class, _i8)                                     \
1223
    NS_INTERFACE_TABLE_ENTRY(_class, _i8)                                     \
1224
    NS_INTERFACE_TABLE_ENTRY(_class, _i9)                                     \
1224
    NS_INTERFACE_TABLE_ENTRY(_class, _i9)                                     \
1225
    NS_INTERFACE_TABLE_ENTRY(_class, _i10)                                    \
1225
    NS_INTERFACE_TABLE_ENTRY(_class, _i10)                                    \
1226
    NS_INTERFACE_TABLE_ENTRY(_class, _i11)                                    \
1226
  NS_OFFSET_AND_INTERFACE_TABLE_END
1227
  NS_OFFSET_AND_INTERFACE_TABLE_END
1227
1228
1228
1229
1229
// Element class factory methods
1230
// Element class factory methods
1230
1231
1231
#define NS_DECLARE_NS_NEW_HTML_ELEMENT(_elementName)              \
1232
#define NS_DECLARE_NS_NEW_HTML_ELEMENT(_elementName)              \
1232
nsGenericHTMLElement*                                             \
1233
nsGenericHTMLElement*                                             \
1233
NS_NewHTML##_elementName##Element(nsINodeInfo *aNodeInfo,         \
1234
NS_NewHTML##_elementName##Element(nsINodeInfo *aNodeInfo,         \
(-)a/content/html/content/src/nsHTMLButtonElement.cpp (-3 / +15 lines)
Line     Link Here 
 Lines 42-57    Link Here 
42
#include "nsGkAtoms.h"
42
#include "nsGkAtoms.h"
43
#include "nsIPresShell.h"
43
#include "nsIPresShell.h"
44
#include "nsStyleConsts.h"
44
#include "nsStyleConsts.h"
45
#include "nsPresContext.h"
45
#include "nsPresContext.h"
46
#include "nsIFormControl.h"
46
#include "nsIFormControl.h"
47
#include "nsIForm.h"
47
#include "nsIForm.h"
48
#include "nsIFormSubmission.h"
48
#include "nsIFormSubmission.h"
49
#include "nsIURL.h"
49
#include "nsIURL.h"
50
#include "nsILabelableElement.h"
50
51
51
#include "nsIFrame.h"
52
#include "nsIFrame.h"
52
#include "nsIFormControlFrame.h"
53
#include "nsIFormControlFrame.h"
53
#include "nsIEventStateManager.h"
54
#include "nsIEventStateManager.h"
54
#include "nsIDOMEvent.h"
55
#include "nsIDOMEvent.h"
55
#include "nsIDOMNSEvent.h"
56
#include "nsIDOMNSEvent.h"
56
#include "nsIDocument.h"
57
#include "nsIDocument.h"
57
#include "nsGUIEvent.h"
58
#include "nsGUIEvent.h"
 Lines 73-89   static const nsAttrValue::EnumTable kBut Link Here 
73
  { 0 }
74
  { 0 }
74
};
75
};
75
76
76
// Default type is 'submit'.
77
// Default type is 'submit'.
77
static const nsAttrValue::EnumTable* kButtonDefaultType = &kButtonTypeTable[2];
78
static const nsAttrValue::EnumTable* kButtonDefaultType = &kButtonTypeTable[2];
78
79
79
class nsHTMLButtonElement : public nsGenericHTMLFormElement,
80
class nsHTMLButtonElement : public nsGenericHTMLFormElement,
80
                            public nsIDOMHTMLButtonElement,
81
                            public nsIDOMHTMLButtonElement,
81
                            public nsIDOMNSHTMLButtonElement
82
                            public nsIDOMNSHTMLButtonElement,
83
                            public nsILabelableElement
82
{
84
{
83
public:
85
public:
84
  nsHTMLButtonElement(nsINodeInfo *aNodeInfo);
86
  nsHTMLButtonElement(nsINodeInfo *aNodeInfo);
85
  virtual ~nsHTMLButtonElement();
87
  virtual ~nsHTMLButtonElement();
86
88
87
  // nsISupports
89
  // nsISupports
88
  NS_DECL_ISUPPORTS_INHERITED
90
  NS_DECL_ISUPPORTS_INHERITED
89
91
 Lines 101-116   public: Link Here 
101
103
102
  // nsIDOMNSHTMLButtonElement
104
  // nsIDOMNSHTMLButtonElement
103
  // Can't just use the macro, since it shares GetType with
105
  // Can't just use the macro, since it shares GetType with
104
  // nsIDOMHTMLButtonElement
106
  // nsIDOMHTMLButtonElement
105
  NS_IMETHOD Blur();
107
  NS_IMETHOD Blur();
106
  NS_IMETHOD Focus();
108
  NS_IMETHOD Focus();
107
  NS_IMETHOD Click();
109
  NS_IMETHOD Click();
108
  NS_IMETHOD SetType(const nsAString& aType);
110
  NS_IMETHOD SetType(const nsAString& aType);
111
  NS_IMETHOD GetLabels(nsIDOMNodeList** aLabels);
109
112
110
  // overriden nsIFormControl methods
113
  // overriden nsIFormControl methods
111
  NS_IMETHOD_(PRInt32) GetType() const { return mType; }
114
  NS_IMETHOD_(PRInt32) GetType() const { return mType; }
112
  NS_IMETHOD Reset();
115
  NS_IMETHOD Reset();
113
  NS_IMETHOD SubmitNamesValues(nsFormSubmission* aFormSubmission,
116
  NS_IMETHOD SubmitNamesValues(nsFormSubmission* aFormSubmission,
114
                               nsIContent* aSubmitElement);
117
                               nsIContent* aSubmitElement);
115
  NS_IMETHOD SaveState();
118
  NS_IMETHOD SaveState();
116
  PRBool RestoreState(nsPresState* aState);
119
  PRBool RestoreState(nsPresState* aState);
 Lines 175-193   nsHTMLButtonElement::~nsHTMLButtonElemen Link Here 
175
NS_IMPL_ADDREF_INHERITED(nsHTMLButtonElement, nsGenericElement)
178
NS_IMPL_ADDREF_INHERITED(nsHTMLButtonElement, nsGenericElement)
176
NS_IMPL_RELEASE_INHERITED(nsHTMLButtonElement, nsGenericElement)
179
NS_IMPL_RELEASE_INHERITED(nsHTMLButtonElement, nsGenericElement)
177
180
178
181
179
DOMCI_DATA(HTMLButtonElement, nsHTMLButtonElement)
182
DOMCI_DATA(HTMLButtonElement, nsHTMLButtonElement)
180
183
181
// QueryInterface implementation for nsHTMLButtonElement
184
// QueryInterface implementation for nsHTMLButtonElement
182
NS_INTERFACE_TABLE_HEAD(nsHTMLButtonElement)
185
NS_INTERFACE_TABLE_HEAD(nsHTMLButtonElement)
183
  NS_HTML_CONTENT_INTERFACE_TABLE2(nsHTMLButtonElement,
186
  NS_HTML_CONTENT_INTERFACE_TABLE3(nsHTMLButtonElement,
184
                                   nsIDOMHTMLButtonElement,
187
                                   nsIDOMHTMLButtonElement,
185
                                   nsIDOMNSHTMLButtonElement)
188
                                   nsIDOMNSHTMLButtonElement,
189
                                   nsILabelableElement)
186
  NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(nsHTMLButtonElement,
190
  NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(nsHTMLButtonElement,
187
                                               nsGenericHTMLFormElement)
191
                                               nsGenericHTMLFormElement)
188
NS_HTML_CONTENT_INTERFACE_TABLE_TAIL_CLASSINFO(HTMLButtonElement)
192
NS_HTML_CONTENT_INTERFACE_TABLE_TAIL_CLASSINFO(HTMLButtonElement)
189
193
190
// nsIDOMHTMLButtonElement
194
// nsIDOMHTMLButtonElement
191
195
192
196
193
NS_IMPL_ELEMENT_CLONE(nsHTMLButtonElement)
197
NS_IMPL_ELEMENT_CLONE(nsHTMLButtonElement)
 Lines 196-211   NS_IMPL_ELEMENT_CLONE(nsHTMLButtonElemen Link Here 
196
// nsIDOMHTMLButtonElement
200
// nsIDOMHTMLButtonElement
197
201
198
NS_IMETHODIMP
202
NS_IMETHODIMP
199
nsHTMLButtonElement::GetForm(nsIDOMHTMLFormElement** aForm)
203
nsHTMLButtonElement::GetForm(nsIDOMHTMLFormElement** aForm)
200
{
204
{
201
  return nsGenericHTMLFormElement::GetForm(aForm);
205
  return nsGenericHTMLFormElement::GetForm(aForm);
202
}
206
}
203
207
208
NS_IMETHODIMP
209
nsHTMLButtonElement::GetLabels(nsIDOMNodeList** aLabels)
210
{
211
  *aLabels = nsnull;
212
213
  return NS_OK;
214
}
215
204
NS_IMPL_STRING_ATTR(nsHTMLButtonElement, AccessKey, accesskey)
216
NS_IMPL_STRING_ATTR(nsHTMLButtonElement, AccessKey, accesskey)
205
NS_IMPL_BOOL_ATTR(nsHTMLButtonElement, Disabled, disabled)
217
NS_IMPL_BOOL_ATTR(nsHTMLButtonElement, Disabled, disabled)
206
NS_IMPL_STRING_ATTR(nsHTMLButtonElement, Name, name)
218
NS_IMPL_STRING_ATTR(nsHTMLButtonElement, Name, name)
207
NS_IMPL_INT_ATTR_DEFAULT_VALUE(nsHTMLButtonElement, TabIndex, tabindex, 0)
219
NS_IMPL_INT_ATTR_DEFAULT_VALUE(nsHTMLButtonElement, TabIndex, tabindex, 0)
208
NS_IMPL_STRING_ATTR(nsHTMLButtonElement, Value, value)
220
NS_IMPL_STRING_ATTR(nsHTMLButtonElement, Value, value)
209
NS_IMPL_ENUM_ATTR_DEFAULT_VALUE(nsHTMLButtonElement, Type, type,
221
NS_IMPL_ENUM_ATTR_DEFAULT_VALUE(nsHTMLButtonElement, Type, type,
210
                                kButtonDefaultType->tag)
222
                                kButtonDefaultType->tag)
211
223
(-)a/content/html/content/src/nsHTMLInputElement.cpp (-3 / +16 lines)
Line     Link Here 
 Lines 39-54    Link Here 
39
#include "nsIDOMHTMLInputElement.h"
39
#include "nsIDOMHTMLInputElement.h"
40
#include "nsIDOMNSHTMLInputElement.h"
40
#include "nsIDOMNSHTMLInputElement.h"
41
#include "nsITextControlElement.h"
41
#include "nsITextControlElement.h"
42
#include "nsIFileControlElement.h"
42
#include "nsIFileControlElement.h"
43
#include "nsIDOMNSEditableElement.h"
43
#include "nsIDOMNSEditableElement.h"
44
#include "nsIRadioControlElement.h"
44
#include "nsIRadioControlElement.h"
45
#include "nsIRadioVisitor.h"
45
#include "nsIRadioVisitor.h"
46
#include "nsIPhonetic.h"
46
#include "nsIPhonetic.h"
47
#include "nsILabelableElement.h"
47
48
48
#include "nsIControllers.h"
49
#include "nsIControllers.h"
49
#include "nsFocusManager.h"
50
#include "nsFocusManager.h"
50
#include "nsPIDOMWindow.h"
51
#include "nsPIDOMWindow.h"
51
#include "nsContentCID.h"
52
#include "nsContentCID.h"
52
#include "nsIComponentManager.h"
53
#include "nsIComponentManager.h"
53
#include "nsIDOMHTMLFormElement.h"
54
#include "nsIDOMHTMLFormElement.h"
54
#include "nsIDOMEventTarget.h"
55
#include "nsIDOMEventTarget.h"
 Lines 232-248   NS_DEFINE_STATIC_IID_ACCESSOR(nsHTMLInpu Link Here 
232
class nsHTMLInputElement : public nsGenericHTMLFormElement,
233
class nsHTMLInputElement : public nsGenericHTMLFormElement,
233
                           public nsImageLoadingContent,
234
                           public nsImageLoadingContent,
234
                           public nsIDOMHTMLInputElement,
235
                           public nsIDOMHTMLInputElement,
235
                           public nsIDOMNSHTMLInputElement,
236
                           public nsIDOMNSHTMLInputElement,
236
                           public nsITextControlElement,
237
                           public nsITextControlElement,
237
                           public nsIRadioControlElement,
238
                           public nsIRadioControlElement,
238
                           public nsIPhonetic,
239
                           public nsIPhonetic,
239
                           public nsIDOMNSEditableElement,
240
                           public nsIDOMNSEditableElement,
240
                           public nsIFileControlElement
241
                           public nsIFileControlElement,
242
                           public nsILabelableElement
241
{
243
{
242
public:
244
public:
243
  nsHTMLInputElement(nsINodeInfo *aNodeInfo, PRBool aFromParser);
245
  nsHTMLInputElement(nsINodeInfo *aNodeInfo, PRBool aFromParser);
244
  virtual ~nsHTMLInputElement();
246
  virtual ~nsHTMLInputElement();
245
247
246
  // nsISupports
248
  // nsISupports
247
  NS_DECL_ISUPPORTS_INHERITED
249
  NS_DECL_ISUPPORTS_INHERITED
248
250
 Lines 522-548   NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END Link Here 
522
NS_IMPL_ADDREF_INHERITED(nsHTMLInputElement, nsGenericElement) 
524
NS_IMPL_ADDREF_INHERITED(nsHTMLInputElement, nsGenericElement) 
523
NS_IMPL_RELEASE_INHERITED(nsHTMLInputElement, nsGenericElement) 
525
NS_IMPL_RELEASE_INHERITED(nsHTMLInputElement, nsGenericElement) 
524
526
525
527
526
DOMCI_DATA(HTMLInputElement, nsHTMLInputElement)
528
DOMCI_DATA(HTMLInputElement, nsHTMLInputElement)
527
529
528
// QueryInterface implementation for nsHTMLInputElement
530
// QueryInterface implementation for nsHTMLInputElement
529
NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(nsHTMLInputElement)
531
NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(nsHTMLInputElement)
530
  NS_HTML_CONTENT_INTERFACE_TABLE10(nsHTMLInputElement,
532
  NS_HTML_CONTENT_INTERFACE_TABLE11(nsHTMLInputElement,
531
                                    nsIDOMHTMLInputElement,
533
                                    nsIDOMHTMLInputElement,
532
                                    nsIDOMNSHTMLInputElement,
534
                                    nsIDOMNSHTMLInputElement,
533
                                    nsITextControlElement,
535
                                    nsITextControlElement,
534
                                    nsIFileControlElement,
536
                                    nsIFileControlElement,
535
                                    nsIRadioControlElement,
537
                                    nsIRadioControlElement,
536
                                    nsIPhonetic,
538
                                    nsIPhonetic,
537
                                    imgIDecoderObserver,
539
                                    imgIDecoderObserver,
538
                                    nsIImageLoadingContent,
540
                                    nsIImageLoadingContent,
539
                                    imgIContainerObserver,
541
                                    imgIContainerObserver,
540
                                    nsIDOMNSEditableElement)
542
                                    nsIDOMNSEditableElement,
543
                                    nsILabelableElement)
541
  NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(nsHTMLInputElement,
544
  NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(nsHTMLInputElement,
542
                                               nsGenericHTMLFormElement)
545
                                               nsGenericHTMLFormElement)
543
NS_HTML_CONTENT_INTERFACE_TABLE_TAIL_CLASSINFO(HTMLInputElement)
546
NS_HTML_CONTENT_INTERFACE_TABLE_TAIL_CLASSINFO(HTMLInputElement)
544
547
545
548
546
// nsIDOMNode
549
// nsIDOMNode
547
550
548
nsresult
551
nsresult
 Lines 2517-2532   nsHTMLInputElement::GetPhonetic(nsAStrin Link Here 
2517
    nsITextControlFrame* textControlFrame = do_QueryFrame(formControlFrame);
2520
    nsITextControlFrame* textControlFrame = do_QueryFrame(formControlFrame);
2518
    if (textControlFrame)
2521
    if (textControlFrame)
2519
      textControlFrame->GetPhonetic(aPhonetic);
2522
      textControlFrame->GetPhonetic(aPhonetic);
2520
  }
2523
  }
2521
2524
2522
  return NS_OK;
2525
  return NS_OK;
2523
}
2526
}
2524
2527
2528
NS_IMETHODIMP
2529
nsHTMLInputElement::GetLabels(nsIDOMNodeList** aLabels)
2530
{
2531
  *aLabels = nsnull;
2532
  // Use mLabelList from nsILabelableElement.
2533
  NS_IF_ADDREF(*aLabels = new nsBaseContentList(mLabelList));
2534
2535
  return NS_OK;
2536
}
2537
2525
#ifdef ACCESSIBILITY
2538
#ifdef ACCESSIBILITY
2526
/*static*/ nsresult
2539
/*static*/ nsresult
2527
FireEventForAccessibility(nsIDOMHTMLInputElement* aTarget,
2540
FireEventForAccessibility(nsIDOMHTMLInputElement* aTarget,
2528
                          nsPresContext* aPresContext,
2541
                          nsPresContext* aPresContext,
2529
                          const nsAString& aEventType)
2542
                          const nsAString& aEventType)
2530
{
2543
{
2531
  nsCOMPtr<nsIDOMEvent> event;
2544
  nsCOMPtr<nsIDOMEvent> event;
2532
  if (NS_SUCCEEDED(nsEventDispatcher::CreateEvent(aPresContext, nsnull,
2545
  if (NS_SUCCEEDED(nsEventDispatcher::CreateEvent(aPresContext, nsnull,
(-)a/content/html/content/src/nsHTMLLabelElement.cpp (-17 / +166 lines)
Line     Link Here 
 Lines 47-66    Link Here 
47
#include "nsIForm.h"
47
#include "nsIForm.h"
48
#include "nsIDOMDocument.h"
48
#include "nsIDOMDocument.h"
49
#include "nsIDocument.h"
49
#include "nsIDocument.h"
50
#include "nsGUIEvent.h"
50
#include "nsGUIEvent.h"
51
#include "nsIEventStateManager.h"
51
#include "nsIEventStateManager.h"
52
#include "nsEventDispatcher.h"
52
#include "nsEventDispatcher.h"
53
#include "nsPIDOMWindow.h"
53
#include "nsPIDOMWindow.h"
54
#include "nsFocusManager.h"
54
#include "nsFocusManager.h"
55
#include "nsILabelableElement.h"
55
56
56
class nsHTMLLabelElement : public nsGenericHTMLFormElement,
57
class nsHTMLLabelElement : public nsGenericHTMLFormElement,
57
                           public nsIDOMHTMLLabelElement,
58
                           public nsIDOMHTMLLabelElement,
58
                           public nsIDOMNSHTMLLabelElement
59
                           public nsIDOMNSHTMLLabelElement,
60
                           public nsStubMutationObserver
59
{
61
{
60
public:
62
public:
61
  nsHTMLLabelElement(nsINodeInfo *aNodeInfo);
63
  nsHTMLLabelElement(nsINodeInfo *aNodeInfo);
62
  virtual ~nsHTMLLabelElement();
64
  virtual ~nsHTMLLabelElement();
63
65
64
  // nsISupports
66
  // nsISupports
65
  NS_DECL_ISUPPORTS_INHERITED
67
  NS_DECL_ISUPPORTS_INHERITED
66
68
 Lines 105-158   public: Link Here 
105
                           nsIAtom* aPrefix, const nsAString& aValue,
107
                           nsIAtom* aPrefix, const nsAString& aValue,
106
                           PRBool aNotify);
108
                           PRBool aNotify);
107
  virtual nsresult UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aAttribute,
109
  virtual nsresult UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aAttribute,
108
                             PRBool aNotify);
110
                             PRBool aNotify);
109
  virtual void PerformAccesskey(PRBool aKeyCausesActivation,
111
  virtual void PerformAccesskey(PRBool aKeyCausesActivation,
110
                                PRBool aIsTrustedEvent);
112
                                PRBool aIsTrustedEvent);
111
  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
113
  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
112
114
115
  // nsIMutationObserver
116
  void ContentAppended    (nsIDocument* aDocument,
117
                           nsIContent* aContainer,
118
                           nsIContent* aFirstNewContent,
119
                           PRInt32 aNewIndexInContainer);
120
  void ContentInserted    (nsIDocument* aDocument,
121
                           nsIContent* aContainer,
122
                           nsIContent* aChild,
123
                           PRInt32 aIndexInContainer);
124
  void ContentRemoved     (nsIDocument* aDocument,
125
                           nsIContent* aContainer,
126
                           nsIContent* aChild,
127
                           PRInt32 aIndexInContainer);
128
  void NodeWillBeDestroyed(const nsINode* aNode);
129
130
  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(nsHTMLLabelElement,
131
                                           nsGenericHTMLFormElement)
132
113
protected:
133
protected:
114
  already_AddRefed<nsIContent> GetControlContent();
134
  already_AddRefed<nsIContent> GetControlContent();
115
  already_AddRefed<nsIContent> GetFirstFormControl(nsIContent *current);
135
  already_AddRefed<nsIContent> GetFirstFormControl(nsIContent *current);
136
  void SetControl();
116
137
117
  // XXX It would be nice if we could use an event flag instead.
138
  // XXX It would be nice if we could use an event flag instead.
118
  PRPackedBool mHandlingEvent;
139
  PRPackedBool           mHandlingEvent;
140
141
  // The form control the label element is labeling.
142
  nsCOMPtr<nsILabelableElement>   mControl;
143
144
  // Whether we are observing the parent node.
145
  PRBool                 mObservingParent;
119
};
146
};
120
147
121
// construction, destruction
148
// construction, destruction
122
149
123
150
124
NS_IMPL_NS_NEW_HTML_ELEMENT(Label)
151
NS_IMPL_NS_NEW_HTML_ELEMENT(Label)
125
152
126
153
127
nsHTMLLabelElement::nsHTMLLabelElement(nsINodeInfo *aNodeInfo)
154
nsHTMLLabelElement::nsHTMLLabelElement(nsINodeInfo *aNodeInfo)
128
  : nsGenericHTMLFormElement(aNodeInfo)
155
  : nsGenericHTMLFormElement(aNodeInfo)
129
  , mHandlingEvent(PR_FALSE)
156
  , mHandlingEvent(PR_FALSE)
157
  , mObservingParent(PR_FALSE)
130
{
158
{
131
}
159
}
132
160
133
nsHTMLLabelElement::~nsHTMLLabelElement()
161
nsHTMLLabelElement::~nsHTMLLabelElement()
134
{
162
{
163
  if (mControl) {
164
    mControl->RemoveLabel(this);
165
    mControl = nsnull;
166
  }
135
}
167
}
136
168
137
// nsISupports 
169
// nsISupports 
138
170
171
NS_IMPL_CYCLE_COLLECTION_CLASS(nsHTMLLabelElement)
139
172
140
NS_IMPL_ADDREF_INHERITED(nsHTMLLabelElement, nsGenericElement) 
173
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(nsHTMLLabelElement, nsGenericHTMLFormElement)
141
NS_IMPL_RELEASE_INHERITED(nsHTMLLabelElement, nsGenericElement) 
174
  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mControl)
175
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
176
177
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(nsHTMLLabelElement, nsGenericHTMLFormElement)
178
  NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mControl)
179
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
180
181
NS_IMPL_ADDREF_INHERITED(nsHTMLLabelElement, nsGenericHTMLElement)
182
NS_IMPL_RELEASE_INHERITED(nsHTMLLabelElement, nsGenericHTMLElement)
142
183
143
184
144
DOMCI_DATA(HTMLLabelElement, nsHTMLLabelElement)
185
DOMCI_DATA(HTMLLabelElement, nsHTMLLabelElement)
145
186
146
// QueryInterface implementation for nsHTMLLabelElement
187
// QueryInterface implementation for nsHTMLLabelElement
147
NS_INTERFACE_TABLE_HEAD(nsHTMLLabelElement)
188
NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(nsHTMLLabelElement)
148
  NS_HTML_CONTENT_INTERFACE_TABLE2(nsHTMLLabelElement,
189
  NS_HTML_CONTENT_INTERFACE_TABLE3(nsHTMLLabelElement,
149
                                   nsIDOMHTMLLabelElement,
190
                                   nsIDOMHTMLLabelElement,
150
                                   nsIDOMNSHTMLLabelElement)
191
                                   nsIDOMNSHTMLLabelElement,
192
                                   nsIMutationObserver)
151
  NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(nsHTMLLabelElement,
193
  NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(nsHTMLLabelElement,
152
                                               nsGenericHTMLFormElement)
194
                                               nsGenericHTMLFormElement)
153
NS_HTML_CONTENT_INTERFACE_TABLE_TAIL_CLASSINFO(HTMLLabelElement)
195
NS_HTML_CONTENT_INTERFACE_TABLE_TAIL_CLASSINFO(HTMLLabelElement)
154
196
155
197
156
// nsIDOMHTMLLabelElement
198
// nsIDOMHTMLLabelElement
157
199
158
200
 Lines 206-231   nsHTMLLabelElement::BindToTree(nsIDocume Link Here 
206
                                                     aBindingParent,
248
                                                     aBindingParent,
207
                                                     aCompileEventHandlers);
249
                                                     aCompileEventHandlers);
208
  NS_ENSURE_SUCCESS(rv, rv);
250
  NS_ENSURE_SUCCESS(rv, rv);
209
251
210
  if (aDocument) {
252
  if (aDocument) {
211
    RegUnRegAccessKey(PR_TRUE);
253
    RegUnRegAccessKey(PR_TRUE);
212
  }
254
  }
213
255
256
  if (aParent) {
257
    aParent->AddMutationObserver(this);
258
    mObservingParent = PR_TRUE;
259
  }
260
214
  return rv;
261
  return rv;
215
}
262
}
216
263
217
void
264
void
218
nsHTMLLabelElement::UnbindFromTree(PRBool aDeep, PRBool aNullParent)
265
nsHTMLLabelElement::UnbindFromTree(PRBool aDeep, PRBool aNullParent)
219
{
266
{
220
  if (IsInDoc()) {
267
  if (IsInDoc()) {
221
    RegUnRegAccessKey(PR_FALSE);
268
    RegUnRegAccessKey(PR_FALSE);
222
  }
269
  }
223
270
271
  if (mControl) {
272
    mControl->RemoveLabel(this);
273
  }
274
275
  nsIContent* parent = GetParent();
276
  if (mObservingParent && parent) {
277
    parent->RemoveMutationObserver(this);
278
  }
279
224
  nsGenericHTMLFormElement::UnbindFromTree(aDeep, aNullParent);
280
  nsGenericHTMLFormElement::UnbindFromTree(aDeep, aNullParent);
225
}
281
}
226
282
227
static PRBool
283
static PRBool
228
EventTargetIn(nsEvent *aEvent, nsIContent *aChild, nsIContent *aStop)
284
EventTargetIn(nsEvent *aEvent, nsIContent *aChild, nsIContent *aStop)
229
{
285
{
230
  nsCOMPtr<nsIContent> c = do_QueryInterface(aEvent->target);
286
  nsCOMPtr<nsIContent> c = do_QueryInterface(aEvent->target);
231
  nsIContent *content = c;
287
  nsIContent *content = c;
 Lines 356-373   nsHTMLLabelElement::SubmitNamesValues(ns Link Here 
356
{
412
{
357
  return NS_OK;
413
  return NS_OK;
358
}
414
}
359
415
360
nsresult
416
nsresult
361
nsHTMLLabelElement::SetAttr(PRInt32 aNameSpaceID, nsIAtom* aName, nsIAtom* aPrefix,
417
nsHTMLLabelElement::SetAttr(PRInt32 aNameSpaceID, nsIAtom* aName, nsIAtom* aPrefix,
362
                            const nsAString& aValue, PRBool aNotify)
418
                            const nsAString& aValue, PRBool aNotify)
363
{
419
{
364
  if (aName == nsGkAtoms::accesskey && kNameSpaceID_None == aNameSpaceID) {
420
  if (kNameSpaceID_None == aNameSpaceID) {
365
    RegUnRegAccessKey(PR_FALSE);
421
    if (aName == nsGkAtoms::accesskey) {
422
      RegUnRegAccessKey(PR_FALSE);
423
    }
424
    if (aName == nsGkAtoms::_for && !aValue.IsEmpty()) {
425
      if (mControl) {
426
        mControl->RemoveLabel(this);
427
        mControl = nsnull;
428
      }
429
    }
366
  }
430
  }
367
431
368
  nsresult rv =
432
  nsresult rv =
369
      nsGenericHTMLElement::SetAttr(aNameSpaceID, aName, aPrefix, aValue,
433
      nsGenericHTMLElement::SetAttr(aNameSpaceID, aName, aPrefix, aValue,
370
                                    aNotify);
434
                                    aNotify);
371
435
372
  if (aName == nsGkAtoms::accesskey && kNameSpaceID_None == aNameSpaceID &&
436
  if (aName == nsGkAtoms::accesskey && kNameSpaceID_None == aNameSpaceID &&
373
      !aValue.IsEmpty()) {
437
      !aValue.IsEmpty()) {
 Lines 376-394   nsHTMLLabelElement::SetAttr(PRInt32 aNam Link Here 
376
440
377
  return rv;
441
  return rv;
378
}
442
}
379
443
380
nsresult
444
nsresult
381
nsHTMLLabelElement::UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aAttribute,
445
nsHTMLLabelElement::UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aAttribute,
382
                              PRBool aNotify)
446
                              PRBool aNotify)
383
{
447
{
384
  if (aAttribute == nsGkAtoms::accesskey &&
448
  if (kNameSpaceID_None == aNameSpaceID) {
385
      kNameSpaceID_None == aNameSpaceID) {
449
    if (aAttribute == nsGkAtoms::accesskey) {
386
    RegUnRegAccessKey(PR_FALSE);
450
      RegUnRegAccessKey(PR_FALSE);
451
    }
452
    if (aAttribute == nsGkAtoms::_for) {
453
      SetControl();
454
    }
387
  }
455
  }
388
456
389
  return nsGenericHTMLElement::UnsetAttr(aNameSpaceID, aAttribute, aNotify);
457
  return nsGenericHTMLElement::UnsetAttr(aNameSpaceID, aAttribute, aNotify);
390
}
458
}
391
459
392
void
460
void
393
nsHTMLLabelElement::PerformAccesskey(PRBool aKeyCausesActivation,
461
nsHTMLLabelElement::PerformAccesskey(PRBool aKeyCausesActivation,
394
                                     PRBool aIsTrustedEvent)
462
                                     PRBool aIsTrustedEvent)
 Lines 410-450   nsHTMLLabelElement::PerformAccesskey(PRB Link Here 
410
    nsAutoPopupStatePusher popupStatePusher(aIsTrustedEvent ?
478
    nsAutoPopupStatePusher popupStatePusher(aIsTrustedEvent ?
411
                                            openAllowed : openAbused);
479
                                            openAllowed : openAbused);
412
480
413
    nsEventDispatcher::Dispatch(static_cast<nsIContent*>(this), presContext,
481
    nsEventDispatcher::Dispatch(static_cast<nsIContent*>(this), presContext,
414
                                &event);
482
                                &event);
415
  }
483
  }
416
}
484
}
417
485
486
void
487
nsHTMLLabelElement::SetControl()
488
{
489
  nsAutoString elementId;
490
491
  if (!GetAttr(kNameSpaceID_None, nsGkAtoms::_for, elementId)) {
492
    nsCOMPtr<nsIContent> content = GetFirstFormControl(this);
493
    mControl = do_QueryInterface(content);
494
    if (mControl) {
495
      mControl->AppendLabel(this);
496
    }
497
  } else {
498
    if (mControl) {
499
      mControl->RemoveLabel(this);
500
      mControl = nsnull;
501
    }
502
  }
503
}
504
418
already_AddRefed<nsIContent>
505
already_AddRefed<nsIContent>
419
nsHTMLLabelElement::GetControlContent()
506
nsHTMLLabelElement::GetControlContent()
420
{
507
{
421
  nsAutoString elementId;
508
  nsAutoString elementId;
422
509
423
  if (!GetAttr(kNameSpaceID_None, nsGkAtoms::_for, elementId)) {
510
  if (!GetAttr(kNameSpaceID_None, nsGkAtoms::_for, elementId)) {
424
    // No @for, so we are a label for our first form control element.
511
    // No @for, so we are a label for our first form control element.
425
    // Do a depth-first traversal to look for the first form control element.
512
    // Do a depth-first traversal to look for the first form control element.
426
    return GetFirstFormControl(this);
513
    if (!mControl) {
514
      SetControl();
515
    }
516
    nsCOMPtr<nsIContent> content = do_QueryInterface(mControl);
517
    return content.get();
427
  }
518
  }
428
519
429
  // We have a @for. The id has to be linked to an element in the same document
520
  // We have a @for. The id has to be linked to an element in the same document
430
  // and this element should be a labelable form control.
521
  // and this element should be a labelable form control.
431
  nsIDocument* doc = GetCurrentDoc();
522
  nsIDocument* doc = GetCurrentDoc();
432
  if (!doc) {
523
  if (!doc) {
433
    return nsnull;
524
    return nsnull;
434
  }
525
  }
435
526
436
  nsIContent* content = doc->GetElementById(elementId);
527
  nsIContent* content = doc->GetElementById(elementId);
437
  if (!content) {
528
  if (!content) {
438
    return nsnull;
529
    return nsnull;
439
  }
530
  }
440
531
441
  nsCOMPtr<nsIFormControl> element = do_QueryInterface(content);
532
  nsCOMPtr<nsILabelableElement> element = do_QueryInterface(content);
442
  if (element && element->IsLabelableControl()) {
533
  if (element) {
443
    NS_ADDREF(content);
534
    NS_ADDREF(content);
444
    return content;
535
    return content;
445
  }
536
  }
446
537
447
  return nsnull;
538
  return nsnull;
448
}
539
}
449
540
450
already_AddRefed<nsIContent>
541
already_AddRefed<nsIContent>
 Lines 453-475   nsHTMLLabelElement::GetFirstFormControl( Link Here 
453
  PRUint32 numNodes = current->GetChildCount();
544
  PRUint32 numNodes = current->GetChildCount();
454
545
455
  for (PRUint32 i = 0; i < numNodes; i++) {
546
  for (PRUint32 i = 0; i < numNodes; i++) {
456
    nsIContent *child = current->GetChildAt(i);
547
    nsIContent *child = current->GetChildAt(i);
457
    if (!child) {
548
    if (!child) {
458
      continue;
549
      continue;
459
    }
550
    }
460
551
461
    nsCOMPtr<nsIFormControl> element = do_QueryInterface(child);
552
    nsCOMPtr<nsILabelableElement> element = do_QueryInterface(child);
462
    if (element && element->IsLabelableControl()) {
553
    if (element) {
463
      NS_ADDREF(child);
554
      NS_ADDREF(child);
464
      return child;
555
      return child;
465
    }
556
    }
466
557
467
    nsIContent* content = GetFirstFormControl(child).get();
558
    nsIContent* content = GetFirstFormControl(child).get();
468
    if (content) {
559
    if (content) {
469
      return content;
560
      return content;
470
    }
561
    }
471
  }
562
  }
472
563
473
  return nsnull;
564
  return nsnull;
474
}
565
}
475
566
567
// nsIMutationObserver
568
569
void
570
nsHTMLLabelElement::ContentAppended(nsIDocument* aDocument,
571
                                         nsIContent* aContainer,
572
                                         nsIContent* aFirstNewContent,
573
                                         PRInt32 aNewIndexInContainer)
574
{
575
  if (mObservingParent && aFirstNewContent == this) {
576
      GetParent()->RemoveMutationObserver(this);
577
      AddMutationObserver(this);
578
      mObservingParent = PR_FALSE;
579
  } else {
580
    SetControl();
581
  }
582
}
583
584
void
585
nsHTMLLabelElement::ContentInserted(nsIDocument* aDocument,
586
                                         nsIContent* aContainer,
587
                                         nsIContent* aChild,
588
                                         PRInt32 aIndexInContainer)
589
{
590
  if (mObservingParent) {
591
    if (aContainer == this) {
592
      SetControl();
593
    } else if (aChild == this) {
594
      GetParent()->RemoveMutationObserver(this);
595
      AddMutationObserver(this);
596
      mObservingParent = PR_FALSE;
597
    }
598
  } else {
599
    SetControl();
600
  }
601
}
602
603
void
604
nsHTMLLabelElement::ContentRemoved(nsIDocument* aDocument,
605
                                        nsIContent* aContainer,
606
                                        nsIContent* aChild,
607
                                        PRInt32 aIndexInContainer)
608
{
609
  if (!mObservingParent) {
610
    SetControl();
611
  }
612
}
613
614
void
615
nsHTMLLabelElement::NodeWillBeDestroyed(const nsINode *aNode)
616
{
617
  if (!mObservingParent) {
618
    // TODO: useful ?
619
#ifdef DEBUG
620
    printf(" === nsHTMLLabelElement::NodeWillBeDestroyed\n");
621
#endif // DEBUG
622
  }
623
}
624
(-)a/content/html/content/src/nsHTMLOutputElement.cpp (-3 / +14 lines)
Line     Link Here 
 Lines 35-55    Link Here 
35
 *
35
 *
36
 * ***** END LICENSE BLOCK ***** */
36
 * ***** END LICENSE BLOCK ***** */
37
37
38
#include "nsIDOMHTMLOutputElement.h"
38
#include "nsIDOMHTMLOutputElement.h"
39
#include "nsGenericHTMLElement.h"
39
#include "nsGenericHTMLElement.h"
40
#include "nsIFormSubmission.h"
40
#include "nsIFormSubmission.h"
41
#include "nsDOMSettableTokenList.h"
41
#include "nsDOMSettableTokenList.h"
42
#include "nsStubMutationObserver.h"
42
#include "nsStubMutationObserver.h"
43
#include "nsILabelableElement.h"
43
44
44
45
45
class nsHTMLOutputElement : public nsGenericHTMLFormElement,
46
class nsHTMLOutputElement : public nsGenericHTMLFormElement,
46
                            public nsIDOMHTMLOutputElement,
47
                            public nsIDOMHTMLOutputElement,
47
                            public nsStubMutationObserver
48
                            public nsStubMutationObserver,
49
                            public nsILabelableElement
48
{
50
{
49
public:
51
public:
50
  nsHTMLOutputElement(nsINodeInfo *aNodeInfo);
52
  nsHTMLOutputElement(nsINodeInfo *aNodeInfo);
51
  virtual ~nsHTMLOutputElement();
53
  virtual ~nsHTMLOutputElement();
52
54
53
  // nsISupports
55
  // nsISupports
54
  NS_DECL_ISUPPORTS_INHERITED
56
  NS_DECL_ISUPPORTS_INHERITED
55
57
 Lines 120-138   nsHTMLOutputElement::~nsHTMLOutputElemen Link Here 
120
122
121
123
122
NS_IMPL_ADDREF_INHERITED(nsHTMLOutputElement, nsGenericElement)
124
NS_IMPL_ADDREF_INHERITED(nsHTMLOutputElement, nsGenericElement)
123
NS_IMPL_RELEASE_INHERITED(nsHTMLOutputElement, nsGenericElement)
125
NS_IMPL_RELEASE_INHERITED(nsHTMLOutputElement, nsGenericElement)
124
126
125
DOMCI_DATA(HTMLOutputElement, nsHTMLOutputElement)
127
DOMCI_DATA(HTMLOutputElement, nsHTMLOutputElement)
126
128
127
NS_INTERFACE_TABLE_HEAD(nsHTMLOutputElement)
129
NS_INTERFACE_TABLE_HEAD(nsHTMLOutputElement)
128
  NS_HTML_CONTENT_INTERFACE_TABLE2(nsHTMLOutputElement,
130
  NS_HTML_CONTENT_INTERFACE_TABLE3(nsHTMLOutputElement,
129
                                   nsIDOMHTMLOutputElement,
131
                                   nsIDOMHTMLOutputElement,
130
                                   nsIMutationObserver)
132
                                   nsIMutationObserver,
133
                                   nsILabelableElement)
131
  NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(nsHTMLOutputElement,
134
  NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(nsHTMLOutputElement,
132
                                               nsGenericHTMLFormElement)
135
                                               nsGenericHTMLFormElement)
133
NS_HTML_CONTENT_INTERFACE_TABLE_TAIL_CLASSINFO(HTMLOutputElement)
136
NS_HTML_CONTENT_INTERFACE_TABLE_TAIL_CLASSINFO(HTMLOutputElement)
134
137
135
NS_IMPL_ELEMENT_CLONE(nsHTMLOutputElement)
138
NS_IMPL_ELEMENT_CLONE(nsHTMLOutputElement)
136
139
137
140
138
NS_IMPL_STRING_ATTR(nsHTMLOutputElement, Name, name)
141
NS_IMPL_STRING_ATTR(nsHTMLOutputElement, Name, name)
 Lines 221-236   nsHTMLOutputElement::GetHtmlFor(nsIDOMDO Link Here 
221
    mTokenList = new nsDOMSettableTokenList(this, nsGkAtoms::_for);
224
    mTokenList = new nsDOMSettableTokenList(this, nsGkAtoms::_for);
222
  }
225
  }
223
226
224
  NS_ADDREF(*aResult = mTokenList);
227
  NS_ADDREF(*aResult = mTokenList);
225
228
226
  return NS_OK;
229
  return NS_OK;
227
}
230
}
228
231
232
NS_IMETHODIMP
233
nsHTMLOutputElement::GetLabels(nsIDOMNodeList** aLabels)
234
{
235
  *aLabels = nsnull;
236
237
  return NS_OK;
238
}
239
229
void nsHTMLOutputElement::DescendantsChanged()
240
void nsHTMLOutputElement::DescendantsChanged()
230
{
241
{
231
  if (mValueModeFlag == eModeDefault) {
242
  if (mValueModeFlag == eModeDefault) {
232
    nsContentUtils::GetNodeTextContent(this, PR_TRUE, mDefaultValue);
243
    nsContentUtils::GetNodeTextContent(this, PR_TRUE, mDefaultValue);
233
  }
244
  }
234
}
245
}
235
246
236
// nsIMutationObserver
247
// nsIMutationObserver
(-)a/content/html/content/src/nsHTMLSelectElement.cpp (-2 / +10 lines)
Line     Link Here 
 Lines 170-189   NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END Link Here 
170
NS_IMPL_ADDREF_INHERITED(nsHTMLSelectElement, nsGenericElement)
170
NS_IMPL_ADDREF_INHERITED(nsHTMLSelectElement, nsGenericElement)
171
NS_IMPL_RELEASE_INHERITED(nsHTMLSelectElement, nsGenericElement)
171
NS_IMPL_RELEASE_INHERITED(nsHTMLSelectElement, nsGenericElement)
172
172
173
173
174
DOMCI_DATA(HTMLSelectElement, nsHTMLSelectElement)
174
DOMCI_DATA(HTMLSelectElement, nsHTMLSelectElement)
175
175
176
// QueryInterface implementation for nsHTMLSelectElement
176
// QueryInterface implementation for nsHTMLSelectElement
177
NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(nsHTMLSelectElement)
177
NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(nsHTMLSelectElement)
178
  NS_HTML_CONTENT_INTERFACE_TABLE3(nsHTMLSelectElement,
178
  NS_HTML_CONTENT_INTERFACE_TABLE4(nsHTMLSelectElement,
179
                                   nsIDOMHTMLSelectElement,
179
                                   nsIDOMHTMLSelectElement,
180
                                   nsIDOMNSHTMLSelectElement,
180
                                   nsIDOMNSHTMLSelectElement,
181
                                   nsISelectElement)
181
                                   nsISelectElement,
182
                                   nsILabelableElement)
182
  NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(nsHTMLSelectElement,
183
  NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(nsHTMLSelectElement,
183
                                               nsGenericHTMLFormElement)
184
                                               nsGenericHTMLFormElement)
184
NS_HTML_CONTENT_INTERFACE_TABLE_TAIL_CLASSINFO(HTMLSelectElement)
185
NS_HTML_CONTENT_INTERFACE_TABLE_TAIL_CLASSINFO(HTMLSelectElement)
185
186
186
187
187
// nsIDOMHTMLSelectElement
188
// nsIDOMHTMLSelectElement
188
189
189
190
 Lines 1196-1211   nsHTMLSelectElement::SetValue(const nsAS Link Here 
1196
        }
1197
        }
1197
      }
1198
      }
1198
    }
1199
    }
1199
  }
1200
  }
1200
1201
1201
  return rv;
1202
  return rv;
1202
}
1203
}
1203
1204
1205
NS_IMETHODIMP
1206
nsHTMLSelectElement::GetLabels(nsIDOMNodeList** aLabels)
1207
{
1208
  *aLabels = nsnull;
1209
1210
  return NS_OK;
1211
}
1204
1212
1205
NS_IMPL_BOOL_ATTR(nsHTMLSelectElement, Disabled, disabled)
1213
NS_IMPL_BOOL_ATTR(nsHTMLSelectElement, Disabled, disabled)
1206
NS_IMPL_BOOL_ATTR(nsHTMLSelectElement, Multiple, multiple)
1214
NS_IMPL_BOOL_ATTR(nsHTMLSelectElement, Multiple, multiple)
1207
NS_IMPL_STRING_ATTR(nsHTMLSelectElement, Name, name)
1215
NS_IMPL_STRING_ATTR(nsHTMLSelectElement, Name, name)
1208
NS_IMPL_INT_ATTR_DEFAULT_VALUE(nsHTMLSelectElement, Size, size, 0)
1216
NS_IMPL_INT_ATTR_DEFAULT_VALUE(nsHTMLSelectElement, Size, size, 0)
1209
NS_IMPL_INT_ATTR_DEFAULT_VALUE(nsHTMLSelectElement, TabIndex, tabindex, 0)
1217
NS_IMPL_INT_ATTR_DEFAULT_VALUE(nsHTMLSelectElement, TabIndex, tabindex, 0)
1210
1218
1211
NS_IMETHODIMP
1219
NS_IMETHODIMP
(-)a/content/html/content/src/nsHTMLSelectElement.h (-1 / +3 lines)
Line     Link Here 
 Lines 48-63    Link Here 
48
#include "nsIDOMNSHTMLSelectElement.h"
48
#include "nsIDOMNSHTMLSelectElement.h"
49
#include "nsIDOMHTMLFormElement.h"
49
#include "nsIDOMHTMLFormElement.h"
50
#include "nsIDOMHTMLOptionElement.h"
50
#include "nsIDOMHTMLOptionElement.h"
51
#include "nsIDOMHTMLOptionsCollection.h"
51
#include "nsIDOMHTMLOptionsCollection.h"
52
#include "nsIDOMNSHTMLOptionCollectn.h"
52
#include "nsIDOMNSHTMLOptionCollectn.h"
53
#include "nsISelectControlFrame.h"
53
#include "nsISelectControlFrame.h"
54
#include "nsContentUtils.h"
54
#include "nsContentUtils.h"
55
#include "nsIHTMLCollection.h"
55
#include "nsIHTMLCollection.h"
56
#include "nsILabelableElement.h"
56
57
57
// PresState
58
// PresState
58
#include "nsXPCOM.h"
59
#include "nsXPCOM.h"
59
#include "nsPresState.h"
60
#include "nsPresState.h"
60
#include "nsIComponentManager.h"
61
#include "nsIComponentManager.h"
61
#include "nsCheapSets.h"
62
#include "nsCheapSets.h"
62
#include "nsLayoutErrors.h"
63
#include "nsLayoutErrors.h"
63
64
 Lines 236-252   private: Link Here 
236
237
237
238
238
/**
239
/**
239
 * Implementation of &lt;select&gt;
240
 * Implementation of &lt;select&gt;
240
 */
241
 */
241
class nsHTMLSelectElement : public nsGenericHTMLFormElement,
242
class nsHTMLSelectElement : public nsGenericHTMLFormElement,
242
                            public nsIDOMHTMLSelectElement,
243
                            public nsIDOMHTMLSelectElement,
243
                            public nsIDOMNSHTMLSelectElement,
244
                            public nsIDOMNSHTMLSelectElement,
244
                            public nsISelectElement
245
                            public nsISelectElement,
246
                            public nsILabelableElement
245
{
247
{
246
public:
248
public:
247
  nsHTMLSelectElement(nsINodeInfo *aNodeInfo, PRBool aFromParser = PR_FALSE);
249
  nsHTMLSelectElement(nsINodeInfo *aNodeInfo, PRBool aFromParser = PR_FALSE);
248
  virtual ~nsHTMLSelectElement();
250
  virtual ~nsHTMLSelectElement();
249
251
250
  // nsISupports
252
  // nsISupports
251
  NS_DECL_ISUPPORTS_INHERITED
253
  NS_DECL_ISUPPORTS_INHERITED
252
254
(-)a/content/html/content/src/nsHTMLTextAreaElement.cpp (-3 / +14 lines)
Line     Link Here 
 Lines 71-97    Link Here 
71
#include "nsReadableUtils.h"
71
#include "nsReadableUtils.h"
72
#include "nsEventDispatcher.h"
72
#include "nsEventDispatcher.h"
73
#include "nsLayoutUtils.h"
73
#include "nsLayoutUtils.h"
74
#include "nsLayoutErrors.h"
74
#include "nsLayoutErrors.h"
75
#include "nsStubMutationObserver.h"
75
#include "nsStubMutationObserver.h"
76
#include "nsDOMError.h"
76
#include "nsDOMError.h"
77
#include "mozAutoDocUpdate.h"
77
#include "mozAutoDocUpdate.h"
78
#include "nsISupportsPrimitives.h"
78
#include "nsISupportsPrimitives.h"
79
#include "nsILabelableElement.h"
79
80
80
static NS_DEFINE_CID(kXULControllersCID,  NS_XULCONTROLLERS_CID);
81
static NS_DEFINE_CID(kXULControllersCID,  NS_XULCONTROLLERS_CID);
81
82
82
#define NS_NO_CONTENT_DISPATCH (1 << 0)
83
#define NS_NO_CONTENT_DISPATCH (1 << 0)
83
84
84
class nsHTMLTextAreaElement : public nsGenericHTMLFormElement,
85
class nsHTMLTextAreaElement : public nsGenericHTMLFormElement,
85
                              public nsIDOMHTMLTextAreaElement,
86
                              public nsIDOMHTMLTextAreaElement,
86
                              public nsIDOMNSHTMLTextAreaElement,
87
                              public nsIDOMNSHTMLTextAreaElement,
87
                              public nsITextControlElement,
88
                              public nsITextControlElement,
88
                              public nsIDOMNSEditableElement,
89
                              public nsIDOMNSEditableElement,
89
                              public nsStubMutationObserver
90
                              public nsStubMutationObserver,
91
                              public nsILabelableElement
90
{
92
{
91
public:
93
public:
92
  nsHTMLTextAreaElement(nsINodeInfo *aNodeInfo, PRBool aFromParser = PR_FALSE);
94
  nsHTMLTextAreaElement(nsINodeInfo *aNodeInfo, PRBool aFromParser = PR_FALSE);
93
  virtual ~nsHTMLTextAreaElement();
95
  virtual ~nsHTMLTextAreaElement();
94
96
95
  // nsISupports
97
  // nsISupports
96
  NS_DECL_ISUPPORTS_INHERITED
98
  NS_DECL_ISUPPORTS_INHERITED
97
99
 Lines 248-269   NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END Link Here 
248
NS_IMPL_ADDREF_INHERITED(nsHTMLTextAreaElement, nsGenericElement) 
250
NS_IMPL_ADDREF_INHERITED(nsHTMLTextAreaElement, nsGenericElement) 
249
NS_IMPL_RELEASE_INHERITED(nsHTMLTextAreaElement, nsGenericElement) 
251
NS_IMPL_RELEASE_INHERITED(nsHTMLTextAreaElement, nsGenericElement) 
250
252
251
253
252
DOMCI_DATA(HTMLTextAreaElement, nsHTMLTextAreaElement)
254
DOMCI_DATA(HTMLTextAreaElement, nsHTMLTextAreaElement)
253
255
254
// QueryInterface implementation for nsHTMLTextAreaElement
256
// QueryInterface implementation for nsHTMLTextAreaElement
255
NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(nsHTMLTextAreaElement)
257
NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(nsHTMLTextAreaElement)
256
  NS_HTML_CONTENT_INTERFACE_TABLE5(nsHTMLTextAreaElement,
258
  NS_HTML_CONTENT_INTERFACE_TABLE6(nsHTMLTextAreaElement,
257
                                   nsIDOMHTMLTextAreaElement,
259
                                   nsIDOMHTMLTextAreaElement,
258
                                   nsIDOMNSHTMLTextAreaElement,
260
                                   nsIDOMNSHTMLTextAreaElement,
259
                                   nsITextControlElement,
261
                                   nsITextControlElement,
260
                                   nsIDOMNSEditableElement,
262
                                   nsIDOMNSEditableElement,
261
                                   nsIMutationObserver)
263
                                   nsIMutationObserver,
264
                                   nsILabelableElement)
262
  NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(nsHTMLTextAreaElement,
265
  NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(nsHTMLTextAreaElement,
263
                                               nsGenericHTMLFormElement)
266
                                               nsGenericHTMLFormElement)
264
NS_HTML_CONTENT_INTERFACE_TABLE_TAIL_CLASSINFO(HTMLTextAreaElement)
267
NS_HTML_CONTENT_INTERFACE_TABLE_TAIL_CLASSINFO(HTMLTextAreaElement)
265
268
266
269
267
// nsIDOMHTMLTextAreaElement
270
// nsIDOMHTMLTextAreaElement
268
271
269
272
 Lines 356-371   nsHTMLTextAreaElement::IsHTMLFocusable(P Link Here 
356
    return PR_TRUE;
359
    return PR_TRUE;
357
  }
360
  }
358
361
359
  // disabled textareas are not focusable
362
  // disabled textareas are not focusable
360
  *aIsFocusable = !HasAttr(kNameSpaceID_None, nsGkAtoms::disabled);
363
  *aIsFocusable = !HasAttr(kNameSpaceID_None, nsGkAtoms::disabled);
361
  return PR_FALSE;
364
  return PR_FALSE;
362
}
365
}
363
366
367
NS_IMETHODIMP
368
nsHTMLTextAreaElement::GetLabels(nsIDOMNodeList** aLabels)
369
{
370
  *aLabels = nsnull;
371
372
  return NS_OK;
373
}
374
364
NS_IMPL_STRING_ATTR(nsHTMLTextAreaElement, AccessKey, accesskey)
375
NS_IMPL_STRING_ATTR(nsHTMLTextAreaElement, AccessKey, accesskey)
365
NS_IMPL_INT_ATTR(nsHTMLTextAreaElement, Cols, cols)
376
NS_IMPL_INT_ATTR(nsHTMLTextAreaElement, Cols, cols)
366
NS_IMPL_BOOL_ATTR(nsHTMLTextAreaElement, Disabled, disabled)
377
NS_IMPL_BOOL_ATTR(nsHTMLTextAreaElement, Disabled, disabled)
367
NS_IMPL_NON_NEGATIVE_INT_ATTR(nsHTMLTextAreaElement, MaxLength, maxlength)
378
NS_IMPL_NON_NEGATIVE_INT_ATTR(nsHTMLTextAreaElement, MaxLength, maxlength)
368
NS_IMPL_STRING_ATTR(nsHTMLTextAreaElement, Name, name)
379
NS_IMPL_STRING_ATTR(nsHTMLTextAreaElement, Name, name)
369
NS_IMPL_BOOL_ATTR(nsHTMLTextAreaElement, ReadOnly, readonly)
380
NS_IMPL_BOOL_ATTR(nsHTMLTextAreaElement, ReadOnly, readonly)
370
NS_IMPL_INT_ATTR(nsHTMLTextAreaElement, Rows, rows)
381
NS_IMPL_INT_ATTR(nsHTMLTextAreaElement, Rows, rows)
371
NS_IMPL_INT_ATTR_DEFAULT_VALUE(nsHTMLTextAreaElement, TabIndex, tabindex, 0)
382
NS_IMPL_INT_ATTR_DEFAULT_VALUE(nsHTMLTextAreaElement, TabIndex, tabindex, 0)
(-)a/dom/interfaces/html/nsIDOMHTMLOutputElement.idl (-5 / +2 lines)
Line     Link Here 
 Lines 44-60    Link Here 
44
 * For more information on this interface, please see
44
 * For more information on this interface, please see
45
 * http://dev.w3.org/html5/spec/forms.html#the-output-element
45
 * http://dev.w3.org/html5/spec/forms.html#the-output-element
46
 *
46
 *
47
 * @status UNDER_DEVELOPMENT
47
 * @status UNDER_DEVELOPMENT
48
 */
48
 */
49
49
50
interface nsIDOMDOMSettableTokenList;
50
interface nsIDOMDOMSettableTokenList;
51
51
52
[scriptable, uuid(0f7f15a9-ea72-4feb-b2b5-2fcbc9c10ab8)]
52
[scriptable, uuid(ca1a9f35-510d-4730-b450-5999e6447392)]
53
interface nsIDOMHTMLOutputElement : nsIDOMHTMLElement
53
interface nsIDOMHTMLOutputElement : nsIDOMHTMLElement
54
{
54
{
55
  readonly attribute nsIDOMDOMSettableTokenList htmlFor;
55
  readonly attribute nsIDOMDOMSettableTokenList htmlFor;
56
  readonly attribute nsIDOMHTMLFormElement      form;
56
  readonly attribute nsIDOMHTMLFormElement      form;
57
           attribute DOMString                  name;
57
           attribute DOMString                  name;
58
58
59
  readonly attribute DOMString                  type;
59
  readonly attribute DOMString                  type;
60
           attribute DOMString                  defaultValue;
60
           attribute DOMString                  defaultValue;
 Lines 66-79   interface nsIDOMHTMLOutputElement : nsID Link Here 
66
   * See bug bug 345624.
66
   * See bug bug 345624.
67
   */
67
   */
68
  //readonly attribute boolean willValidate;
68
  //readonly attribute boolean willValidate;
69
  //readonly attribute ValidityState validity;
69
  //readonly attribute ValidityState validity;
70
  //readonly attribute DOMString validationMessage;
70
  //readonly attribute DOMString validationMessage;
71
  //boolean checkValidity();
71
  //boolean checkValidity();
72
  //void setCustomValidity(in DOMString error);
72
  //void setCustomValidity(in DOMString error);
73
73
74
  /**
74
  readonly attribute nsIDOMNodeList             labels;
75
   * The labels IDL attribute will be added with bug 556743.
76
   */
77
  //readonly attribute nsIDOMNodeList             labels;
78
};
75
};
79
76
(-)a/dom/interfaces/html/nsIDOMNSHTMLButtonElement.idl (-1 / +3 lines)
Line     Link Here 
 Lines 34-49    Link Here 
34
 * and other provisions required by the GPL or the LGPL. If you do not delete
34
 * and other provisions required by the GPL or the LGPL. If you do not delete
35
 * the provisions above, a recipient may use your version of this file under
35
 * the provisions above, a recipient may use your version of this file under
36
 * the terms of any one of the MPL, the GPL or the LGPL.
36
 * the terms of any one of the MPL, the GPL or the LGPL.
37
 *
37
 *
38
 * ***** END LICENSE BLOCK ***** */
38
 * ***** END LICENSE BLOCK ***** */
39
39
40
#include "domstubs.idl"
40
#include "domstubs.idl"
41
41
42
[scriptable, uuid(c914d7a4-63b3-4d40-943f-91a3c7ab0d4d)]
42
[scriptable, uuid(41693745-9c56-43c9-9c64-6b303afabf6e)]
43
interface nsIDOMNSHTMLButtonElement : nsISupports
43
interface nsIDOMNSHTMLButtonElement : nsISupports
44
{
44
{
45
  void                      blur();
45
  void                      blur();
46
  void                      focus();
46
  void                      focus();
47
  void                      click();
47
  void                      click();
48
  attribute DOMString       type;
48
  attribute DOMString       type;
49
50
  readonly attribute nsIDOMNodeList labels;
49
};
51
};
(-)a/dom/interfaces/html/nsIDOMNSHTMLInputElement.idl (-1 / +3 lines)
Line     Link Here 
 Lines 37-53    Link Here 
37
 *
37
 *
38
 * ***** END LICENSE BLOCK ***** */
38
 * ***** END LICENSE BLOCK ***** */
39
39
40
#include "domstubs.idl"
40
#include "domstubs.idl"
41
41
42
interface nsIControllers;
42
interface nsIControllers;
43
interface nsIDOMFileList;
43
interface nsIDOMFileList;
44
44
45
[scriptable, uuid(e79806b8-7788-4229-ac69-debe395cb0e1)]
45
[scriptable, uuid(7daebcd1-a917-45fa-bdc6-df7c8e15d3ae)]
46
interface nsIDOMNSHTMLInputElement : nsISupports
46
interface nsIDOMNSHTMLInputElement : nsISupports
47
{
47
{
48
	readonly attribute nsIControllers   controllers;
48
	readonly attribute nsIControllers   controllers;
49
	
49
	
50
	readonly attribute long             textLength;
50
	readonly attribute long             textLength;
51
	
51
	
52
           attribute long             selectionStart;
52
           attribute long             selectionStart;
53
           attribute long             selectionEnd;
53
           attribute long             selectionEnd;
 Lines 60-71   interface nsIDOMNSHTMLInputElement : nsI Link Here 
60
60
61
           attribute DOMString        placeholder;
61
           attribute DOMString        placeholder;
62
62
63
  void mozGetFileNameArray([optional] out unsigned long aLength,
63
  void mozGetFileNameArray([optional] out unsigned long aLength,
64
                           [array,size_is(aLength), retval] out wstring aFileNames);
64
                           [array,size_is(aLength), retval] out wstring aFileNames);
65
  void mozSetFileNameArray([array,size_is(aLength)] in wstring aFileNames,
65
  void mozSetFileNameArray([array,size_is(aLength)] in wstring aFileNames,
66
                           in unsigned long aLength);
66
                           in unsigned long aLength);
67
67
68
  readonly attribute nsIDOMNodeList labels;
69
68
	/* convenience */
70
	/* convenience */
69
  void                      setSelectionRange(in long selectionStart,
71
  void                      setSelectionRange(in long selectionStart,
70
                                              in long selectionEnd);
72
                                              in long selectionEnd);
71
};
73
};
(-)a/dom/interfaces/html/nsIDOMNSHTMLSelectElement.idl (-1 / +3 lines)
Line     Link Here 
 Lines 34-47    Link Here 
34
 * and other provisions required by the GPL or the LGPL. If you do not delete
34
 * and other provisions required by the GPL or the LGPL. If you do not delete
35
 * the provisions above, a recipient may use your version of this file under
35
 * the provisions above, a recipient may use your version of this file under
36
 * the terms of any one of the MPL, the GPL or the LGPL.
36
 * the terms of any one of the MPL, the GPL or the LGPL.
37
 *
37
 *
38
 * ***** END LICENSE BLOCK ***** */
38
 * ***** END LICENSE BLOCK ***** */
39
39
40
#include "domstubs.idl"
40
#include "domstubs.idl"
41
41
42
[scriptable, uuid(a6cf9105-15b3-11d2-932e-00805f8add32)]
42
[scriptable, uuid(8e1faa12-f704-45c0-9f81-334b8c9abcd7)]
43
interface nsIDOMNSHTMLSelectElement : nsISupports
43
interface nsIDOMNSHTMLSelectElement : nsISupports
44
{
44
{
45
  nsIDOMNode                item(in unsigned long index);
45
  nsIDOMNode                item(in unsigned long index);
46
  nsIDOMNode                namedItem(in DOMString name);
46
  nsIDOMNode                namedItem(in DOMString name);
47
48
  readonly attribute nsIDOMNodeList labels;
47
};
49
};
(-)a/dom/interfaces/html/nsIDOMNSHTMLTextAreaElement.idl (-1 / +3 lines)
Line     Link Here 
 Lines 36-62    Link Here 
36
 * the terms of any one of the MPL, the GPL or the LGPL.
36
 * the terms of any one of the MPL, the GPL or the LGPL.
37
 *
37
 *
38
 * ***** END LICENSE BLOCK ***** */
38
 * ***** END LICENSE BLOCK ***** */
39
39
40
#include "domstubs.idl"
40
#include "domstubs.idl"
41
41
42
interface nsIControllers;
42
interface nsIControllers;
43
43
44
[scriptable, uuid(dd9f7df2-c06c-4c2d-b33a-90124e5ddea1)]
44
[scriptable, uuid(9bc51cd7-6191-4328-a029-464ddd23a3b1)]
45
interface nsIDOMNSHTMLTextAreaElement : nsISupports
45
interface nsIDOMNSHTMLTextAreaElement : nsISupports
46
{
46
{
47
  readonly attribute nsIControllers   controllers;
47
  readonly attribute nsIControllers   controllers;
48
48
49
  readonly attribute long    textLength;
49
  readonly attribute long    textLength;
50
  attribute long             selectionStart;
50
  attribute long             selectionStart;
51
  attribute long             selectionEnd;
51
  attribute long             selectionEnd;
52
  attribute long             maxLength;
52
  attribute long             maxLength;
53
  attribute DOMString        placeholder;
53
  attribute DOMString        placeholder;
54
54
55
  readonly attribute nsIDOMNodeList labels;
56
55
  /**
57
  /**
56
   * Reflects the wrap content attribute. Possible values are "soft, "hard" and
58
   * Reflects the wrap content attribute. Possible values are "soft, "hard" and
57
   * "off". "soft" is the default.
59
   * "off". "soft" is the default.
58
   */
60
   */
59
  [Null(Stringify)] attribute DOMString wrap;
61
  [Null(Stringify)] attribute DOMString wrap;
60
62
61
  void                       setSelectionRange(in long selectionStart,
63
  void                       setSelectionRange(in long selectionStart,
62
                                               in long selectionEnd);
64
                                               in long selectionEnd);
(-)a/xpcom/base/nsCycleCollector.h (-1 / +1 lines)
Line     Link Here 
 Lines 35-51    Link Here 
35
 *
35
 *
36
 * ***** END LICENSE BLOCK ***** */
36
 * ***** END LICENSE BLOCK ***** */
37
37
38
#ifndef nsCycleCollector_h__
38
#ifndef nsCycleCollector_h__
39
#define nsCycleCollector_h__
39
#define nsCycleCollector_h__
40
40
41
// NOTE: If you use header files to define DEBUG_CC, you must do so here
41
// NOTE: If you use header files to define DEBUG_CC, you must do so here
42
// *and* in nsCycleCollectionParticipant.h
42
// *and* in nsCycleCollectionParticipant.h
43
//#define DEBUG_CC
43
#define DEBUG_CC
44
44
45
class nsISupports;
45
class nsISupports;
46
class nsCycleCollectionParticipant;
46
class nsCycleCollectionParticipant;
47
class nsCycleCollectionTraversalCallback;
47
class nsCycleCollectionTraversalCallback;
48
48
49
// An nsCycleCollectionLanguageRuntime is a per-language object that
49
// An nsCycleCollectionLanguageRuntime is a per-language object that
50
// implements language-specific aspects of the cycle collection task.
50
// implements language-specific aspects of the cycle collection task.
51
51
(-)a/xpcom/glue/nsCycleCollectionParticipant.h (-1 / +1 lines)
Line     Link Here 
 Lines 37-53    Link Here 
37
37
38
#ifndef nsCycleCollectionParticipant_h__
38
#ifndef nsCycleCollectionParticipant_h__
39
#define nsCycleCollectionParticipant_h__
39
#define nsCycleCollectionParticipant_h__
40
40
41
#include "nsISupports.h"
41
#include "nsISupports.h"
42
42
43
// NOTE: If you use header files to define DEBUG_CC, you must do so here
43
// NOTE: If you use header files to define DEBUG_CC, you must do so here
44
// *and* in nsCycleCollector.h
44
// *and* in nsCycleCollector.h
45
//#define DEBUG_CC
45
#define DEBUG_CC
46
46
47
#define NS_CYCLECOLLECTIONPARTICIPANT_IID                                      \
47
#define NS_CYCLECOLLECTIONPARTICIPANT_IID                                      \
48
{                                                                              \
48
{                                                                              \
49
    0x9674489b,                                                                \
49
    0x9674489b,                                                                \
50
    0x1f6f,                                                                    \
50
    0x1f6f,                                                                    \
51
    0x4550,                                                                    \
51
    0x4550,                                                                    \
52
    { 0xa7, 0x30, 0xcc, 0xae, 0xdd, 0x10, 0x4c, 0xf9 }                         \
52
    { 0xa7, 0x30, 0xcc, 0xae, 0xdd, 0x10, 0x4c, 0xf9 }                         \
53
}
53
}

Return to bug 556743