Bug 583514 - implement click and accesskey for all HTML elements r=smaug

This commit is contained in:
David Zbarsky 2011-04-01 18:50:58 -04:00
Родитель 9888ac84db
Коммит 57d8184118
88 изменённых файлов: 461 добавлений и 467 удалений

Просмотреть файл

@ -548,7 +548,7 @@ NS_IMETHODIMP nsHTMLTextFieldAccessible::GetActionName(PRUint8 aIndex, nsAString
NS_IMETHODIMP nsHTMLTextFieldAccessible::DoAction(PRUint8 index)
{
if (index == 0) {
nsCOMPtr<nsIDOMNSHTMLElement> element(do_QueryInterface(mContent));
nsCOMPtr<nsIDOMHTMLElement> element(do_QueryInterface(mContent));
if ( element ) {
return element->Focus();
}

Просмотреть файл

@ -171,7 +171,7 @@ enum {
NODE_DESCENDANTS_NEED_FRAMES = 0x00100000U,
// Set if the node is an element.
NODE_IS_ELEMENT = 0x00200000U,
NODE_HANDLING_CLICK = 0x00200000U,
// Set if the node has the accesskey attribute set.
NODE_HAS_ACCESSKEY = 0x00400000U,
@ -321,7 +321,8 @@ public:
mNextSibling(nsnull),
mPreviousSibling(nsnull),
mFirstChild(nsnull),
mNodeHasRenderingObservers(false)
mNodeHasRenderingObservers(false),
mIsElement(false)
{
}
@ -374,7 +375,7 @@ public:
* Return whether the node is an Element node
*/
PRBool IsElement() const {
return HasFlag(NODE_IS_ELEMENT);
return mIsElement;
}
/**
@ -1287,6 +1288,7 @@ protected:
// More flags
bool mNodeHasRenderingObservers : 1;
bool mIsElement : 1;
};

Просмотреть файл

@ -187,7 +187,7 @@ NS_NewDocumentFragment(nsIDOMDocumentFragment** aInstancePtrResult,
nsDocumentFragment::nsDocumentFragment(already_AddRefed<nsINodeInfo> aNodeInfo)
: nsGenericElement(aNodeInfo)
{
UnsetFlags(NODE_IS_ELEMENT);
mIsElement = false;
}
nsDocumentFragment::~nsDocumentFragment()

Просмотреть файл

@ -2160,8 +2160,8 @@ nsGenericElement::nsGenericElement(already_AddRefed<nsINodeInfo> aNodeInfo)
{
// Set the default scriptID to JS - but skip SetScriptTypeID as it
// does extra work we know isn't necessary here...
SetFlags(NODE_IS_ELEMENT |
(nsIProgrammingLanguage::JAVASCRIPT << NODE_SCRIPT_TYPE_OFFSET));
SetFlags(nsIProgrammingLanguage::JAVASCRIPT << NODE_SCRIPT_TYPE_OFFSET);
mIsElement = true;
}
nsGenericElement::~nsGenericElement()

Просмотреть файл

@ -22,14 +22,11 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=409604
var modifier = Components.interfaces.nsIDOMNSEvent.ALT_MASK |
Components.interfaces.nsIDOMNSEvent.SHIFT_MASK;
var expectedFocus = "d,g,h,k,l,m,n";
var expectedFocus = "a,c,d,e,f,g,h,i,j,k,l,m,n,p,x,y";
// XXX the "map" test is causing trouble, see bug 433089
// var expectedClick = "a,b,c,e,f,i,j";
var expectedClick = "a,c,e,f,i,j";
var focusArray = expectedFocus.split(",");
var clickArray = expectedClick.split(",");
var invalidElementId = "invalid";
var invalidTags = [
var unfocusableElementId = "invalid";
var unfocusableTags = [
{tag: "abbr", content: "text", attribs: {title: "something"}},
{tag: "acronym", content: "text", attribs: {title: "something"}},
{tag: "address", content: "text"},
@ -63,7 +60,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=409604
{tag: "li", content: "text", parent: "ol"},
{tag: "li", content: "text", parent: "ul"},
{tag: "noscript", content: "text"},
{tag: "object", content: "text"},
{tag: "ol", content: "<li>text</li>"},
{tag: "optgroup", content: "<option>text</option>", attribs: {label: "some label"}, parent: "select"},
{tag: "option", content: "text", parent: "select"},
@ -71,7 +67,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=409604
{tag: "pre", content: "text"},
{tag: "q", content: "text"},
{tag: "samp", content: "text"},
{tag: "select", content: "<option>text</option>"},
{tag: "small", content: "text"},
{tag: "span", content: "text"},
{tag: "strong", content: "text"},
@ -133,9 +128,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=409604
function handleClick(e) {
ok("accessKey" in e, "(click) accesskey property not found on element");
var expected = clickArray.shift();
ok(expected == e.accessKey, "(click) unexpected element: " + e.accessKey +
" expected: " + expected);
}
function handleInvalid(e) {
@ -154,19 +146,18 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=409604
utils.sendKeyEvent("keyup", key, key, modifier);
}
function testValidElements() {
for (var code = "a".charCodeAt(0); code <= "o".charCodeAt(0); ++ code) {
function testFocusableElements() {
for (var code = "a".charCodeAt(0); code <= "y".charCodeAt(0); ++ code) {
// XXX the "map" test is causing trouble, see bug 433089
if (code == "b".charCodeAt(0))
continue;
pressAccessKey(code);
}
ok(focusArray.length == 0, "(focus) unhandled elements remaining: " + focusArray.join(","));
ok(clickArray.length == 0, "(click) unhandled elements remaining: " + clickArray.join(","));
}
function createInvalidElement(elem, accesskey) {
ok("tag" in elem, "invalid object passed to createInvalidElement: " + elem.toString());
function createUnfocusableElement(elem, accesskey) {
ok("tag" in elem, "invalid object passed to createUnfocusableElement: " + elem.toString());
var e = document.createElement(elem.tag);
if ("content" in elem) {
e.innerHTML = elem.content;
@ -177,7 +168,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=409604
}
}
e.setAttribute("accesskey", accesskey);
e.setAttribute("onclick", "handleInvalid(event.target); event.preventDefault();");
e.setAttribute("onclick", "handleClick(event.target); event.preventDefault();");
e.setAttribute("onfocus", "handleInvalid(event.target);");
var parent = null;
var elementToInsert = null;
@ -196,7 +187,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=409604
}
ok(parent != null, "parent element not specified for element: " + elem.tag);
ok(elementToInsert != null, "elementToInsert not specified for element: " + elem.tag);
elementToInsert.setAttribute("id", invalidElementId);
elementToInsert.setAttribute("id", unfocusableElementId);
if ("where" in elem) {
if (elem.where == "first") {
parent.insertBefore(elementToInsert, parent.firstChild);
@ -208,25 +199,25 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=409604
}
}
function destroyInvalidElement() {
var el = document.getElementById(invalidElementId);
ok(el != null, "invalid element not found");
function destroyUnfocusableElement() {
var el = document.getElementById(unfocusableElementId);
ok(el != null, "unfocusable element not found");
el.parentNode.removeChild(el);
ok(document.getElementById(invalidElementId) == null, "invalid element not properly removed");
ok(document.getElementById(unfocusableElementId) == null, "unfocusable element not properly removed");
}
function testInvalidElements() {
function testUnfocusableElements() {
var i, e;
for (i = 0; i < invalidTags.length; ++ i) {
createInvalidElement(invalidTags[i], "z");
for (i = 0; i < unfocusableTags.length; ++ i) {
createUnfocusableElement(unfocusableTags[i], "z");
pressAccessKey("z".charCodeAt(0));
destroyInvalidElement();
destroyUnfocusableElement();
}
for (i = 0; i < invalidElements.length; ++ i) {
e = document.getElementById(invalidElements[i]);
ok(e != null, "element with ID " + invalidElements[i] + " not found");
e.setAttribute("accesskey", "z");
e.setAttribute("onclick", "handleInvalid(event.target); event.preventDefault();");
e.setAttribute("onclick", "handleClick(event.target); event.preventDefault();");
e.setAttribute("onfocus", "handleInvalid(event.target);");
pressAccessKey("z".charCodeAt(0));
e.removeAttribute("accesskey");
@ -236,8 +227,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=409604
}
function start() {
testValidElements();
testInvalidElements();
testFocusableElements();
testUnfocusableElements();
setOrRestoreContentAccess(0);
SimpleTest.finish();
}
@ -265,7 +256,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=409604
<col></col>
</colgroup>
<tr>
<td>a</td><td><a href="#" onclick="handleClick(event.target); return false;" accesskey="a">test link</a></td>
<td>a</td><td><a href="#" onclick="handleClick(event.target); return false;" accesskey="a" onfocus="handleFocus(event.target);">test link"</a></td>
</tr>
<!-- the "map" test is causing trouble, see bug 433089
<tr>
@ -276,48 +267,133 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=409604
</tr>
-->
<tr>
<td>button</td><td><button onclick="handleClick(event.target);" accesskey="c">test button</button></td>
<td>button</td><td><button onclick="handleClick(event.target);" accesskey="c" onfocus="handleFocus(event.target);">test button"</button></td>
</tr>
<tr>
<td>input type="text"</td><td><input type="text" value="" onfocus="handleFocus(event.target);" accesskey="d"></td>
<td>input type="text"</td><td><input type="text" value="" onclick="handleClick(event.target);" onfocus="handleFocus(event.target);" accesskey="d"></td>
</tr>
<tr>
<td>input type="button"</td><td><input type="button" value="type='button'" onclick="handleClick(event.target);" accesskey="e"></td>
<td>input type="button"</td><td><input type="button" value="type='button'" onclick="handleClick(event.target);" onfocus="handleFocus(event.target);" accesskey="e"></td>
</tr>
<tr>
<td>input type="checkbox"</td><td><input type="checkbox" onclick="handleClick(event.target);" accesskey="f"></td>
<td>input type="checkbox"</td><td><input type="checkbox" onclick="handleClick(event.target);" onfocus="handleFocus(event.target)" accesskey="f"></td>
</tr>
<tr>
<td>input type="radio"</td><td><input type="radio" name="radio" onfocus="handleFocus(event.target);" accesskey="g"></td>
<td>input type="radio"</td><td><input type="radio" name="radio" onclick="handleClick(event.target);" onfocus="handleFocus(event.target);" accesskey="g"></td>
</tr>
<tr>
<td>input type="password"</td><td><input type="password" onfocus="handleFocus(event.target);" accesskey="h"></td>
<td>input type="password"</td><td><input type="password" onclick="handleClick(event.target);" onfocus="handleFocus(event.target);" accesskey="h"></td>
</tr>
<tr>
<td>input type="submit"</td><td><input type="submit" value="type='submit'" onclick="handleClick(event.target); return false;" accesskey="i"></td>
<td>input type="submit"</td><td><input type="submit" value="type='submit'" onclick="handleClick(event.target); return false;"
onfocus="handleFocus(event.target);" accesskey="i"></td>
</tr>
<tr>
<td>input type="reset"</td><td><input type="submit" value="type='reset'" onclick="handleClick(event.target);" accesskey="j"></td>
<td>input type="reset"</td><td><input type="submit" value="type='reset'" onclick="handleClick(event.target);"
onfocus="handleFocus(event.target);" accesskey="j"></td>
</tr>
<tr>
<td>label</td><td><label accesskey="k">test label
<input type="text" value="test for label" onfocus="handleFocus(event.target);"></label></td>
<td>label</td><td><label accesskey="k" onclick="handleClick(event.target);" onfocus="handleInvalid(event.target);">test label
<input type="text" value="test for label" onfocus="handleFocus(event.target);" onclick="handleClick(event.target);"></label></td>
</tr>
<tr>
<td>legend</td><td><fieldset><legend accesskey="l">test legend</legend>
<input type="text" value="test for legend" onfocus="handleFocus(event.target);"></fieldset></td>
<input type="text" value="test for legend" onfocus="handleFocus(event.target);" onclick="handleClick(event.target);" ></fieldset></td>
</tr>
<tr>
<td>textarea</td><td><textarea onfocus="handleFocus(event.target);" accesskey="m">test text</textarea></td>
<td>textarea</td><td><textarea onfocus="handleFocus(event.target);" onclick="handleClick(event.target);" accesskey="m">test text</textarea></td>
</tr>
<tr>
<td>label (label invisible)</td><td><label for="txt1" accesskey="n" style="display:none">test label</label>
<input type="text" id="txt1" value="test for label" onfocus="handleFocus(event.target);"></td>
<td>label (label invisible)</td><td><label for="txt1" accesskey="n" style="display:none"
onclick="handleClick(event.target);" onfocus="handleInvalid(event.target);">test label</label>
<input type="text" id="txt1" value="test for label" onclick="handleClick(event.target);" onfocus="handleFocus(event.target);"></td>
</tr>
<tr>
<td>label (control invisible)</td><td><label for="txt2" accesskey="o">test label</label>
<input type="text" id="txt2" value="test for label" onfocus="handleInvalid(event.target);" style="display:none"></td>
<td>label (control invisible)</td><td><label for="txt2" accesskey="o"
onclick="handleClick(event.target);" onfocus="handleInvalid(event.target);">test label</label>
<input type="text" id="txt2" value="test for label" onclick="handleClick(event.target);"
onfocus="handleInvalid(event.target);" style="display:none"></td>
</tr>
<tr>
<td>select</td>
<td>
<select onclick="handleClick(event.target);" onfocus="handleFocus(event.target)" accesskey="p"><option>option</option></select>
</td>
</tr>
<tr>
<td>object</td>
<td>
<object onclick="handleClick(event.target);" onfocus="handleInvalid(event.target)" accesskey="q">an object</object>
</td>
</tr>
<tr>
<td>a without href</td>
<td>
<a onclick="handleClick(event.target);" onfocus="handleInvalid(event.target)" accesskey="r">an object</object>
</td>
</tr>
<tr>
<td>disabled button</td>
<td>
<button disabled="" onclick="handleClick(event.target);" onfocus="handleInvalid(event.target)" accesskey="s">disabled</button>
</td>
</tr>
<tr>
<td>disabled input</td>
<td>
<input disabled="" onclick="handleClick(event.target);" onfocus="handleInvalid(event.target)" accesskey="t"></input>
</td>
</tr>
<tr>
<td>hidden input</td>
<td>
<input type="hidden" onclick="handleClick(event.target);" onfocus="handleInvalid(event.target)" accesskey="u">disabled</input>
</td>
</tr>
<tr>
<td>disabled select</td>
<td>
<select disabled onclick="handleClick(event.target);" onfocus="handleInvalid(event.target)" accesskey="v">
<option>disabled</option>
</select>
</td>
</tr>
<tr>
<td>disabled textarea</td>
<td>
<textarea disabled onclick="handleClick(event.target);" onfocus="handleInvalid(event.target)" accesskey="w">disabled</textarea>
</td>
</tr>
<tr>
<td>scrollable div(focusable)</td>
<td>
<div onclick="handleClick(event.target);" onfocus="handleFocus(event.target)" accesskey="x" style="height: 50px; overflow: auto;">
The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy
dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the
lazy dog. The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy
dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the
lazy dog. The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy
dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the
lazy dog. The quick brown fox jumps over the lazy dog.
</div>
</td>
</tr>
<tr>
<td>contenteditable div(focusable)</td>
<td>
<div onclick="handleClick(event.target);" onfocus="handleFocus(event.target)" accesskey="y" contenteditable="true">
Test text.....
</div>
</td>
</tr>
</tbody>
</table>
<dl id="dl"></dl>

Просмотреть файл

@ -0,0 +1,6 @@
<!DOCTYPE html>
<html>
<body">
<div>pass</div>
</body>
</html>

Просмотреть файл

@ -0,0 +1,14 @@
<!DOCTYPE html>
<html class='reftest-wait'>
<script>
function onLoadHandler()
{
var v = document.createElement("input");
v.setAttribute("onclick", "document.getElementById('result').innerHTML += 'pass';");
v.click();
}
</script>
<body onload="onLoadHandler();">
<div id="result"></div>
</body>
</html>

Просмотреть файл

@ -0,0 +1,3 @@
<body>
<input>
<div>Results: div clicked body clicked input clicked div clicked body clicked input focused

Просмотреть файл

@ -0,0 +1,24 @@
<head>
<script>
function test()
{
document.getElementById("a").click();
document.getElementById("b").click();
document.getElementById("a").focus();
document.getElementById("b").focus();
// unfocus input to avoid failing due to caret
document.getElementById("b").blur();
}
function log(text)
{
document.getElementById("c").innerHTML+=text;
}
</script>
</head>
<body id="body" onload='javascript:test()' onclick='log("body clicked");'>
<div id=a onclick='log(" div clicked ");' onfocus='log(" div focused ");'>
<input id=b onclick='log(" input clicked ");' onfocus='log(" input focused ");'></div>
<div id="c">Results:

Просмотреть файл

@ -0,0 +1,2 @@
<!DOCTYPE html>
Pass

Просмотреть файл

@ -0,0 +1,13 @@
<!DOCTYPE html>
<head>
<script>
function test() {
var elem = document.createElement("input");
elem.setAttribute("onclick","document.getElementById('result').innerHTML = 'Pass'");
elem.click();
}
</script>
</head>
<body onload="test()">
<div id="result">Fail</div>
</body>

Просмотреть файл

@ -21,6 +21,9 @@ include autofocus/reftest.list
== 596455-2a.html 596455-ref-2.html
== 596455-2b.html 596455-ref-2.html
== 610935.html 610935-ref.html
== 583514-1.html 583514-1-ref.html
== 583514-2.html 583514-2-ref.html
== 409604-1.html 409604-1-ref.html
== hidden-1a.html hidden-1-ref.html
== hidden-1b.html hidden-1-ref.html
== hidden-1c.html hidden-1-ref.html

Просмотреть файл

@ -468,6 +468,8 @@ nsGenericHTMLElement::SetClassName(const nsAString& aClassName)
return NS_OK;
}
NS_IMPL_STRING_ATTR(nsGenericHTMLElement, AccessKey, accesskey)
static PRBool
IsBody(nsIContent *aContent)
{
@ -948,6 +950,7 @@ nsGenericHTMLElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
NS_ENSURE_SUCCESS(rv, rv);
if (aDocument) {
RegAccessKey();
if (HasFlag(NODE_HAS_NAME)) {
aDocument->
AddToNameTable(this, GetParsedAttr(nsGkAtoms::name)->GetAtomValue());
@ -966,6 +969,10 @@ nsGenericHTMLElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
void
nsGenericHTMLElement::UnbindFromTree(PRBool aDeep, PRBool aNullParent)
{
if (IsInDoc()) {
UnregAccessKey();
}
RemoveFromNameTable();
if (GetContentEditableValue() == eTrue) {
@ -1185,12 +1192,19 @@ nsGenericHTMLElement::SetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
{
PRBool contentEditable = aNameSpaceID == kNameSpaceID_None &&
aName == nsGkAtoms::contenteditable;
PRBool accessKey = aName == nsGkAtoms::accesskey &&
aNameSpaceID == kNameSpaceID_None;
PRInt32 change;
if (contentEditable) {
change = GetContentEditableValue() == eTrue ? -1 : 0;
SetFlags(NODE_MAY_HAVE_CONTENT_EDITABLE_ATTR);
}
if (accessKey) {
UnregAccessKey();
}
nsresult rv = nsStyledElement::SetAttr(aNameSpaceID, aName, aPrefix, aValue,
aNotify);
NS_ENSURE_SUCCESS(rv, rv);
@ -1203,6 +1217,11 @@ nsGenericHTMLElement::SetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
ChangeEditableState(change);
}
if (accessKey && !aValue.IsEmpty()) {
SetFlags(NODE_HAS_ACCESSKEY);
RegAccessKey();
}
return NS_OK;
}
@ -1224,6 +1243,11 @@ nsGenericHTMLElement::UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aAttribute,
contentEditable = PR_TRUE;
contentEditableChange = GetContentEditableValue() == eTrue ? -1 : 0;
}
else if (aAttribute == nsGkAtoms::accesskey) {
// Have to unregister before clearing flag. See UnregAccessKey
UnregAccessKey();
UnsetFlags(NODE_HAS_ACCESSKEY);
}
else if (nsContentUtils::IsEventAttributeName(aAttribute,
EventNameType_HTML)) {
nsIEventListenerManager* manager = GetListenerManager(PR_FALSE);
@ -3231,6 +3255,38 @@ nsGenericHTMLElement::Focus()
return fm ? fm->SetFocus(elem, 0) : NS_OK;
}
nsresult nsGenericHTMLElement::Click()
{
if (HasFlag(NODE_HANDLING_CLICK))
return NS_OK;
// Strong in case the event kills it
nsCOMPtr<nsIDocument> doc = GetCurrentDoc();
nsCOMPtr<nsIPresShell> shell = nsnull;
nsRefPtr<nsPresContext> context = nsnull;
if (doc) {
shell = doc->GetShell();
if (shell) {
context = shell->GetPresContext();
}
}
SetFlags(NODE_HANDLING_CLICK);
// Click() is never called from native code, but it may be
// called from chrome JS. Mark this event trusted if Click()
// is called from chrome code.
nsMouseEvent event(nsContentUtils::IsCallerChrome(),
NS_MOUSE_CLICK, nsnull, nsMouseEvent::eReal);
event.inputSource = nsIDOMNSMouseEvent::MOZ_SOURCE_UNKNOWN;
nsEventDispatcher::Dispatch(this, context, &event);
UnsetFlags(NODE_HANDLING_CLICK);
return NS_OK;
}
PRBool
nsGenericHTMLElement::IsHTMLFocusable(PRBool aWithMouse,
PRBool *aIsFocusable,

Просмотреть файл

@ -140,6 +140,7 @@ public:
// classes that inherit interfaces with those methods properly override them.
NS_IMETHOD Focus();
NS_IMETHOD Blur();
NS_IMETHOD Click();
NS_IMETHOD GetTabIndex(PRInt32 *aTabIndex);
NS_IMETHOD SetTabIndex(PRInt32 aTabIndex);
NS_IMETHOD GetHidden(PRBool* aHidden);
@ -148,7 +149,9 @@ public:
NS_IMETHOD SetSpellcheck(PRBool aSpellcheck);
NS_IMETHOD GetDraggable(PRBool* aDraggable);
NS_IMETHOD SetDraggable(PRBool aDraggable);
nsresult GetContentEditable(nsAString &aContentEditable);
NS_IMETHOD GetAccessKey(nsAString &aAccessKey);
NS_IMETHOD SetAccessKey(const nsAString& aAccessKey);
nsresult GetContentEditable(nsAString& aContentEditable);
nsresult GetIsContentEditable(PRBool* aContentEditable);
nsresult SetContentEditable(const nsAString &aContentEditable);
@ -1480,6 +1483,22 @@ protected:
NS_INTERFACE_TABLE_ENTRY(_class, _i10) \
NS_OFFSET_AND_INTERFACE_TABLE_END
/* Use this macro to declare functions that forward the behavior of this interface to another object.
This macro doesn't forward Focus or Click because sometimes elements will want to override them. */
#define NS_FORWARD_NSIDOMHTMLELEMENT_NOFOCUSCLICK(_to) \
NS_SCRIPTABLE NS_IMETHOD GetId(nsAString & aId) { return _to GetId(aId); } \
NS_SCRIPTABLE NS_IMETHOD SetId(const nsAString & aId) { return _to SetId(aId); } \
NS_SCRIPTABLE NS_IMETHOD GetTitle(nsAString & aTitle) { return _to GetTitle(aTitle); } \
NS_SCRIPTABLE NS_IMETHOD SetTitle(const nsAString & aTitle) { return _to SetTitle(aTitle); } \
NS_SCRIPTABLE NS_IMETHOD GetLang(nsAString & aLang) { return _to GetLang(aLang); } \
NS_SCRIPTABLE NS_IMETHOD SetLang(const nsAString & aLang) { return _to SetLang(aLang); } \
NS_SCRIPTABLE NS_IMETHOD GetDir(nsAString & aDir) { return _to GetDir(aDir); } \
NS_SCRIPTABLE NS_IMETHOD SetDir(const nsAString & aDir) { return _to SetDir(aDir); } \
NS_SCRIPTABLE NS_IMETHOD GetClassName(nsAString & aClassName) { return _to GetClassName(aClassName); } \
NS_SCRIPTABLE NS_IMETHOD SetClassName(const nsAString & aClassName) { return _to SetClassName(aClassName); } \
NS_SCRIPTABLE NS_IMETHOD GetAccessKey(nsAString & aAccessKey) { return _to GetAccessKey(aAccessKey); } \
NS_SCRIPTABLE NS_IMETHOD SetAccessKey(const nsAString & aAccessKey) { return _to SetAccessKey(aAccessKey); } \
NS_SCRIPTABLE NS_IMETHOD Blur(void) { return _to Blur(); }
/**
* A macro to declare the NS_NewHTMLXXXElement() functions.

Просмотреть файл

@ -167,7 +167,6 @@ NS_IMPL_STRING_ATTR(nsHTMLAnchorElement, Rev, rev)
NS_IMPL_STRING_ATTR(nsHTMLAnchorElement, Shape, shape)
NS_IMPL_INT_ATTR(nsHTMLAnchorElement, TabIndex, tabindex)
NS_IMPL_STRING_ATTR(nsHTMLAnchorElement, Type, type)
NS_IMPL_STRING_ATTR(nsHTMLAnchorElement, AccessKey, accesskey)
NS_IMETHODIMP
nsHTMLAnchorElement::GetDraggable(PRBool* aDraggable)
@ -196,10 +195,6 @@ nsHTMLAnchorElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
aCompileEventHandlers);
NS_ENSURE_SUCCESS(rv, rv);
if (aDocument) {
RegAccessKey();
}
// Prefetch links
if (aDocument && nsHTMLDNSPrefetch::IsAllowed(GetOwnerDoc())) {
nsHTMLDNSPrefetch::PrefetchLow(this);
@ -214,25 +209,9 @@ nsHTMLAnchorElement::UnbindFromTree(PRBool aDeep, PRBool aNullParent)
// be under a different xml:base, so forget the cached state now.
Link::ResetLinkState(false);
if (IsInDoc()) {
UnregAccessKey();
}
nsGenericHTMLElement::UnbindFromTree(aDeep, aNullParent);
}
NS_IMETHODIMP
nsHTMLAnchorElement::Blur()
{
return nsGenericHTMLElement::Blur();
}
NS_IMETHODIMP
nsHTMLAnchorElement::Focus()
{
return nsGenericHTMLElement::Focus();
}
PRBool
nsHTMLAnchorElement::IsHTMLFocusable(PRBool aWithMouse,
PRBool *aIsFocusable, PRInt32 *aTabIndex)
@ -401,10 +380,6 @@ nsHTMLAnchorElement::SetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
nsIAtom* aPrefix, const nsAString& aValue,
PRBool aNotify)
{
if (aName == nsGkAtoms::accesskey && kNameSpaceID_None == aNameSpaceID) {
UnregAccessKey();
}
bool reset = false;
if (aName == nsGkAtoms::href && kNameSpaceID_None == aNameSpaceID) {
// If we do not have a cached URI, we have some value here so we must reset
@ -434,12 +409,6 @@ nsHTMLAnchorElement::SetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
Link::ResetLinkState(!!aNotify);
}
if (aName == nsGkAtoms::accesskey && kNameSpaceID_None == aNameSpaceID &&
!aValue.IsEmpty()) {
SetFlags(NODE_HAS_ACCESSKEY);
RegAccessKey();
}
return rv;
}
@ -447,13 +416,6 @@ nsresult
nsHTMLAnchorElement::UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aAttribute,
PRBool aNotify)
{
if (aAttribute == nsGkAtoms::accesskey &&
kNameSpaceID_None == aNameSpaceID) {
// Have to unregister before clearing flag. See UnregAccessKey
UnregAccessKey();
UnsetFlags(NODE_HAS_ACCESSKEY);
}
nsresult rv = nsGenericHTMLElement::UnsetAttr(aNameSpaceID, aAttribute,
aNotify);

Просмотреть файл

@ -140,7 +140,6 @@ NS_HTML_CONTENT_INTERFACE_TABLE_TAIL_CLASSINFO(HTMLAreaElement)
NS_IMPL_ELEMENT_CLONE(nsHTMLAreaElement)
NS_IMPL_STRING_ATTR(nsHTMLAreaElement, AccessKey, accesskey)
NS_IMPL_STRING_ATTR(nsHTMLAreaElement, Alt, alt)
NS_IMPL_STRING_ATTR(nsHTMLAreaElement, Coords, coords)
NS_IMPL_URI_ATTR(nsHTMLAreaElement, Href, href)
@ -197,16 +196,9 @@ nsHTMLAreaElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
{
Link::ResetLinkState(false);
nsresult rv = nsGenericHTMLElement::BindToTree(aDocument, aParent,
return nsGenericHTMLElement::BindToTree(aDocument, aParent,
aBindingParent,
aCompileEventHandlers);
NS_ENSURE_SUCCESS(rv, rv);
if (aDocument) {
RegAccessKey();
}
return rv;
}
void
@ -216,10 +208,6 @@ nsHTMLAreaElement::UnbindFromTree(PRBool aDeep, PRBool aNullParent)
// be under a different xml:base, so forget the cached state now.
Link::ResetLinkState(false);
if (IsInDoc()) {
UnregAccessKey();
}
nsGenericHTMLElement::UnbindFromTree(aDeep, aNullParent);
}
@ -228,10 +216,6 @@ nsHTMLAreaElement::SetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
nsIAtom* aPrefix, const nsAString& aValue,
PRBool aNotify)
{
if (aName == nsGkAtoms::accesskey && aNameSpaceID == kNameSpaceID_None) {
UnregAccessKey();
}
nsresult rv =
nsGenericHTMLElement::SetAttr(aNameSpaceID, aName, aPrefix, aValue, aNotify);
@ -244,12 +228,6 @@ nsHTMLAreaElement::SetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
Link::ResetLinkState(!!aNotify);
}
if (aName == nsGkAtoms::accesskey && aNameSpaceID == kNameSpaceID_None &&
!aValue.IsEmpty()) {
SetFlags(NODE_HAS_ACCESSKEY);
RegAccessKey();
}
return rv;
}
@ -257,13 +235,6 @@ nsresult
nsHTMLAreaElement::UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aAttribute,
PRBool aNotify)
{
if (aAttribute == nsGkAtoms::accesskey &&
aNameSpaceID == kNameSpaceID_None) {
// Have to unregister before clearing flag. See UnregAccessKey
UnregAccessKey();
UnsetFlags(NODE_HAS_ACCESSKEY);
}
nsresult rv = nsGenericHTMLElement::UnsetAttr(aNameSpaceID, aAttribute,
aNotify);

Просмотреть файл

@ -138,7 +138,6 @@ public:
protected:
PRUint8 mType;
PRPackedBool mHandlingClick;
PRPackedBool mDisabledChanged;
PRPackedBool mInInternalActivate;
@ -158,7 +157,6 @@ NS_IMPL_NS_NEW_HTML_ELEMENT(Button)
nsHTMLButtonElement::nsHTMLButtonElement(already_AddRefed<nsINodeInfo> aNodeInfo)
: nsGenericHTMLFormElement(aNodeInfo),
mType(kButtonDefaultType->value),
mHandlingClick(PR_FALSE),
mDisabledChanged(PR_FALSE),
mInInternalActivate(PR_FALSE)
{
@ -204,7 +202,6 @@ nsHTMLButtonElement::GetForm(nsIDOMHTMLFormElement** aForm)
return nsGenericHTMLFormElement::GetForm(aForm);
}
NS_IMPL_STRING_ATTR(nsHTMLButtonElement, AccessKey, accesskey)
NS_IMPL_BOOL_ATTR(nsHTMLButtonElement, Autofocus, autofocus)
NS_IMPL_BOOL_ATTR(nsHTMLButtonElement, Disabled, disabled)
NS_IMPL_ACTION_ATTR(nsHTMLButtonElement, FormAction, formaction)
@ -220,53 +217,6 @@ NS_IMPL_STRING_ATTR(nsHTMLButtonElement, Value, value)
NS_IMPL_ENUM_ATTR_DEFAULT_VALUE(nsHTMLButtonElement, Type, type,
kButtonDefaultType->tag)
NS_IMETHODIMP
nsHTMLButtonElement::Blur()
{
return nsGenericHTMLElement::Blur();
}
NS_IMETHODIMP
nsHTMLButtonElement::Focus()
{
return nsGenericHTMLElement::Focus();
}
NS_IMETHODIMP
nsHTMLButtonElement::Click()
{
if (mHandlingClick)
return NS_OK;
mHandlingClick = PR_TRUE;
// Hold on to the document in case one of the events makes it die or
// something...
nsCOMPtr<nsIDocument> doc = GetCurrentDoc();
if (doc) {
nsIPresShell *shell = doc->GetShell();
if (shell) {
nsRefPtr<nsPresContext> context = shell->GetPresContext();
if (context) {
// Click() is never called from native code, but it may be
// called from chrome JS. Mark this event trusted if Click()
// is called from chrome code.
nsMouseEvent event(nsContentUtils::IsCallerChrome(),
NS_MOUSE_CLICK, nsnull,
nsMouseEvent::eReal);
event.inputSource = nsIDOMNSMouseEvent::MOZ_SOURCE_UNKNOWN;
nsEventStatus status = nsEventStatus_eIgnore;
nsEventDispatcher::Dispatch(static_cast<nsIContent*>(this), context,
&event, nsnull, &status);
}
}
}
mHandlingClick = PR_FALSE;
return NS_OK;
}
PRBool
nsHTMLButtonElement::IsHTMLFocusable(PRBool aWithMouse, PRBool *aIsFocusable, PRInt32 *aTabIndex)
{

Просмотреть файл

@ -973,7 +973,6 @@ nsHTMLInputElement::GetForm(nsIDOMHTMLFormElement** aForm)
NS_IMPL_STRING_ATTR(nsHTMLInputElement, DefaultValue, value)
NS_IMPL_BOOL_ATTR(nsHTMLInputElement, DefaultChecked, checked)
NS_IMPL_STRING_ATTR(nsHTMLInputElement, Accept, accept)
NS_IMPL_STRING_ATTR(nsHTMLInputElement, AccessKey, accesskey)
NS_IMPL_STRING_ATTR(nsHTMLInputElement, Align, align)
NS_IMPL_STRING_ATTR(nsHTMLInputElement, Alt, alt)
NS_IMPL_ENUM_ATTR_DEFAULT_VALUE(nsHTMLInputElement, Autocomplete, autocomplete,
@ -1746,12 +1745,6 @@ nsHTMLInputElement::SetCheckedInternal(PRBool aChecked, PRBool aNotify)
}
}
NS_IMETHODIMP
nsHTMLInputElement::Blur()
{
return nsGenericHTMLElement::Blur();
}
NS_IMETHODIMP
nsHTMLInputElement::Focus()
{
@ -1855,68 +1848,10 @@ nsHTMLInputElement::SelectAll(nsPresContext* aPresContext)
NS_IMETHODIMP
nsHTMLInputElement::Click()
{
nsresult rv = NS_OK;
if (mType == NS_FORM_INPUT_FILE)
FireAsyncClickHandler();
if (GET_BOOLBIT(mBitField, BF_HANDLING_CLICK)) // Fixes crash as in bug 41599
return rv; // --heikki@netscape.com
// first see if we are disabled or not. If disabled then do nothing.
nsAutoString disabled;
if (IsDisabled()) {
return NS_OK;
}
// see what type of input we are. Only click button, checkbox, radio,
// reset, submit, & image
if (mType == NS_FORM_INPUT_BUTTON ||
mType == NS_FORM_INPUT_CHECKBOX ||
mType == NS_FORM_INPUT_RADIO ||
mType == NS_FORM_INPUT_RESET ||
mType == NS_FORM_INPUT_SUBMIT ||
mType == NS_FORM_INPUT_IMAGE ||
mType == NS_FORM_INPUT_FILE) {
// Strong in case the event kills it
nsCOMPtr<nsIDocument> doc = GetCurrentDoc();
if (!doc) {
return rv;
}
nsCOMPtr<nsIPresShell> shell = doc->GetShell();
nsRefPtr<nsPresContext> context = nsnull;
if (shell) {
context = shell->GetPresContext();
}
if (!context) {
doc->FlushPendingNotifications(Flush_Frames);
shell = doc->GetShell();
if (shell) {
context = shell->GetPresContext();
}
}
if (context) {
// Click() is never called from native code, but it may be
// called from chrome JS. Mark this event trusted if Click()
// is called from chrome code.
nsMouseEvent event(nsContentUtils::IsCallerChrome(),
NS_MOUSE_CLICK, nsnull, nsMouseEvent::eReal);
event.inputSource = nsIDOMNSMouseEvent::MOZ_SOURCE_UNKNOWN;
nsEventStatus status = nsEventStatus_eIgnore;
SET_BOOLBIT(mBitField, BF_HANDLING_CLICK, PR_TRUE);
if (mType == NS_FORM_INPUT_FILE){
FireAsyncClickHandler();
}
nsEventDispatcher::Dispatch(static_cast<nsIContent*>(this), context,
&event, nsnull, &status);
SET_BOOLBIT(mBitField, BF_HANDLING_CLICK, PR_FALSE);
}
}
return NS_OK;
return nsGenericHTMLElement::Click();
}
NS_IMETHODIMP

Просмотреть файл

@ -55,19 +55,18 @@
// Accessors for mBitField
//
#define BF_DISABLED_CHANGED 0
#define BF_HANDLING_CLICK 1
#define BF_VALUE_CHANGED 2
#define BF_CHECKED_CHANGED 3
#define BF_CHECKED 4
#define BF_HANDLING_SELECT_EVENT 5
#define BF_SHOULD_INIT_CHECKED 6
#define BF_PARSER_CREATING 7
#define BF_IN_INTERNAL_ACTIVATE 8
#define BF_CHECKED_IS_TOGGLED 9
#define BF_INDETERMINATE 10
#define BF_INHIBIT_RESTORATION 11
#define BF_CAN_SHOW_INVALID_UI 12
#define BF_CAN_SHOW_VALID_UI 13
#define BF_VALUE_CHANGED 1
#define BF_CHECKED_CHANGED 2
#define BF_CHECKED 3
#define BF_HANDLING_SELECT_EVENT 4
#define BF_SHOULD_INIT_CHECKED 5
#define BF_PARSER_CREATING 6
#define BF_IN_INTERNAL_ACTIVATE 7
#define BF_CHECKED_IS_TOGGLED 8
#define BF_INDETERMINATE 9
#define BF_INHIBIT_RESTORATION 10
#define BF_CAN_SHOW_INVALID_UI 11
#define BF_CAN_SHOW_VALID_UI 12
#define GET_BOOLBIT(bitfield, field) (((bitfield) & (0x01 << (field))) \
? PR_TRUE : PR_FALSE)
@ -136,9 +135,6 @@ public:
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLFormElement::)
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLFormElement::)
// nsIDOMHTMLInputElement
NS_DECL_NSIDOMHTMLINPUTELEMENT
@ -150,6 +146,12 @@ public:
{
return nsGenericHTMLElement::GetEditor(aEditor);
}
// Forward nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT_NOFOCUSCLICK(nsGenericHTMLFormElement::)
NS_IMETHOD Focus();
NS_IMETHOD Click();
NS_IMETHOD SetUserInput(const nsAString& aInput);
// Overriden nsIFormControl methods

Просмотреть файл

@ -68,19 +68,21 @@ public:
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLFormElement::)
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLFormElement::)
// nsIDOMHTMLLabelElement
NS_DECL_NSIDOMHTMLLABELELEMENT
// Forward nsIDOMHTMLElement -- We don't override Click()
NS_FORWARD_NSIDOMHTMLELEMENT_NOFOCUSCLICK(nsGenericHTMLFormElement::)
NS_IMETHOD Click() {
return nsGenericHTMLFormElement::Click();
}
NS_IMETHOD Focus();
// nsIFormControl
NS_IMETHOD_(PRUint32) GetType() const { return NS_FORM_LABEL; }
NS_IMETHOD Reset();
NS_IMETHOD SubmitNamesValues(nsFormSubmission* aFormSubmission);
NS_IMETHOD Focus();
virtual bool IsDisabled() const { return PR_FALSE; }
// nsIContent
@ -174,7 +176,6 @@ nsHTMLLabelElement::GetControl(nsIDOMHTMLElement** aElement)
}
NS_IMPL_STRING_ATTR(nsHTMLLabelElement, AccessKey, accesskey)
NS_IMPL_STRING_ATTR(nsHTMLLabelElement, HtmlFor, _for)
NS_IMETHODIMP
@ -198,25 +199,14 @@ nsHTMLLabelElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
nsIContent* aBindingParent,
PRBool aCompileEventHandlers)
{
nsresult rv = nsGenericHTMLFormElement::BindToTree(aDocument, aParent,
aBindingParent,
aCompileEventHandlers);
NS_ENSURE_SUCCESS(rv, rv);
if (aDocument) {
RegAccessKey();
}
return rv;
return nsGenericHTMLFormElement::BindToTree(aDocument, aParent,
aBindingParent,
aCompileEventHandlers);
}
void
nsHTMLLabelElement::UnbindFromTree(PRBool aDeep, PRBool aNullParent)
{
if (IsInDoc()) {
UnregAccessKey();
}
nsGenericHTMLFormElement::UnbindFromTree(aDeep, aNullParent);
}
@ -356,34 +346,14 @@ nsresult
nsHTMLLabelElement::SetAttr(PRInt32 aNameSpaceID, nsIAtom* aName, nsIAtom* aPrefix,
const nsAString& aValue, PRBool aNotify)
{
if (aName == nsGkAtoms::accesskey && kNameSpaceID_None == aNameSpaceID) {
UnregAccessKey();
}
nsresult rv =
nsGenericHTMLFormElement::SetAttr(aNameSpaceID, aName, aPrefix, aValue,
aNotify);
if (aName == nsGkAtoms::accesskey && kNameSpaceID_None == aNameSpaceID &&
!aValue.IsEmpty()) {
SetFlags(NODE_HAS_ACCESSKEY);
RegAccessKey();
}
return rv;
return nsGenericHTMLFormElement::SetAttr(aNameSpaceID, aName, aPrefix, aValue,
aNotify);
}
nsresult
nsHTMLLabelElement::UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aAttribute,
PRBool aNotify)
{
if (aAttribute == nsGkAtoms::accesskey &&
kNameSpaceID_None == aNameSpaceID) {
// Have to unregister before clearing flag. See UnregAccessKey
UnregAccessKey();
UnsetFlags(NODE_HAS_ACCESSKEY);
}
return nsGenericHTMLFormElement::UnsetAttr(aNameSpaceID, aAttribute, aNotify);
}

Просмотреть файл

@ -90,7 +90,6 @@ nsHTMLLegendElement::GetForm(nsIDOMHTMLFormElement** aForm)
}
NS_IMPL_STRING_ATTR(nsHTMLLegendElement, AccessKey, accesskey)
NS_IMPL_STRING_ATTR(nsHTMLLegendElement, Align, align)
// this contains center, because IE4 does
@ -141,66 +140,34 @@ nsHTMLLegendElement::GetAttributeChangeHint(const nsIAtom* aAttribute,
return retval;
}
nsresult
nsHTMLLegendElement::SetAttr(PRInt32 aNameSpaceID, nsIAtom* aAttribute,
nsIAtom* aPrefix, const nsAString& aValue,
PRBool aNotify)
{
PRBool accesskey = (aAttribute == nsGkAtoms::accesskey &&
aNameSpaceID == kNameSpaceID_None);
if (accesskey) {
UnregAccessKey();
}
nsresult rv = nsGenericHTMLElement::SetAttr(aNameSpaceID, aAttribute,
aPrefix, aValue, aNotify);
if (accesskey && !aValue.IsEmpty()) {
SetFlags(NODE_HAS_ACCESSKEY);
RegAccessKey();
}
return rv;
}
nsresult
nsHTMLLegendElement::UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aAttribute,
PRBool aNotify)
{
if (aAttribute == nsGkAtoms::accesskey &&
aNameSpaceID == kNameSpaceID_None) {
// Have to unregister before clearing flag. See UnregAccessKey
UnregAccessKey();
UnsetFlags(NODE_HAS_ACCESSKEY);
}
return nsGenericHTMLElement::UnsetAttr(aNameSpaceID, aAttribute, aNotify);
}
nsresult
nsHTMLLegendElement::SetAttr(PRInt32 aNameSpaceID, nsIAtom* aAttribute,
nsIAtom* aPrefix, const nsAString& aValue,
PRBool aNotify)
{
return nsGenericHTMLElement::SetAttr(aNameSpaceID, aAttribute,
aPrefix, aValue, aNotify);
}
nsresult
nsHTMLLegendElement::UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aAttribute,
PRBool aNotify)
{
return nsGenericHTMLElement::UnsetAttr(aNameSpaceID, aAttribute, aNotify);
}
nsresult
nsHTMLLegendElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
nsIContent* aBindingParent,
PRBool aCompileEventHandlers)
{
nsresult rv = nsGenericHTMLElement::BindToTree(aDocument, aParent,
aBindingParent,
aCompileEventHandlers);
NS_ENSURE_SUCCESS(rv, rv);
if (aDocument) {
RegAccessKey();
}
return rv;
return nsGenericHTMLElement::BindToTree(aDocument, aParent,
aBindingParent,
aCompileEventHandlers);
}
void
nsHTMLLegendElement::UnbindFromTree(PRBool aDeep, PRBool aNullParent)
{
if (IsInDoc()) {
UnregAccessKey();
}
nsGenericHTMLElement::UnbindFromTree(aDeep, aNullParent);
}

Просмотреть файл

@ -64,14 +64,15 @@ public:
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLLegendElement
NS_DECL_NSIDOMHTMLLEGENDELEMENT
// nsGenericHTMLElement
NS_IMETHODIMP Focus();
// Forward nsIDOMHTMLElement -- We don't override Click()
NS_FORWARD_NSIDOMHTMLELEMENT_NOFOCUSCLICK(nsGenericHTMLElement::)
NS_IMETHOD Click() {
return nsGenericHTMLElement::Click();
}
NS_IMETHOD Focus();
virtual void PerformAccesskey(PRBool aKeyCausesActivation,
PRBool aIsTrustedEvent);

Просмотреть файл

@ -1272,18 +1272,6 @@ NS_IMPL_BOOL_ATTR(nsHTMLSelectElement, Required, required)
NS_IMPL_NON_NEGATIVE_INT_ATTR_DEFAULT_VALUE(nsHTMLSelectElement, Size, size, 0)
NS_IMPL_INT_ATTR(nsHTMLSelectElement, TabIndex, tabindex)
NS_IMETHODIMP
nsHTMLSelectElement::Blur()
{
return nsGenericHTMLElement::Blur();
}
NS_IMETHODIMP
nsHTMLSelectElement::Focus()
{
return nsGenericHTMLElement::Focus();
}
PRBool
nsHTMLSelectElement::IsHTMLFocusable(PRBool aWithMouse,
PRBool *aIsFocusable, PRInt32 *aTabIndex)

Просмотреть файл

@ -366,18 +366,6 @@ nsHTMLTextAreaElement::GetForm(nsIDOMHTMLFormElement** aForm)
// nsIContent
NS_IMETHODIMP
nsHTMLTextAreaElement::Blur()
{
return nsGenericHTMLElement::Blur();
}
NS_IMETHODIMP
nsHTMLTextAreaElement::Focus()
{
return nsGenericHTMLElement::Focus();
}
NS_IMETHODIMP
nsHTMLTextAreaElement::Select()
{
@ -449,7 +437,6 @@ nsHTMLTextAreaElement::IsHTMLFocusable(PRBool aWithMouse,
return PR_FALSE;
}
NS_IMPL_STRING_ATTR(nsHTMLTextAreaElement, AccessKey, accesskey)
NS_IMPL_BOOL_ATTR(nsHTMLTextAreaElement, Autofocus, autofocus)
NS_IMPL_UINT_ATTR_NON_ZERO_DEFAULT_VALUE(nsHTMLTextAreaElement, Cols, cols, DEFAULT_COLS)
NS_IMPL_BOOL_ATTR(nsHTMLTextAreaElement, Disabled, disabled)

Просмотреть файл

@ -0,0 +1,61 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=562932
-->
<head>
<title>Test for Bug 583514</title>
<script type="application/javascript" src="/MochiKit/packed.js"></script>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=583514">Mozilla Bug 583514</a>
<p id="display"></p>
<div id="content">
<div id="a" accesskey="a" onfocus="divfocus = true;" onclick="divclicked = true;">
<input id="b" accesskey = "b" onfocus="inputfocus = true;" onclick="inputclicked = true;">
</div>
</div>
<pre id="test">
<script type="application/javascript">
/** Test for Bug 583514 **/
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var Cc = Components.classes;
var Ci = Components.interfaces;
var modifier = Cc["@mozilla.org/preferences-service;1"].
getService(Ci.nsIPrefBranch).
getIntPref("ui.key.contentAccess");
var divfocus = false;
var divclicked = false;
var inputfocus = false;
var inputclicked = false;
var utils = window.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils);
//utils.sendNativeKeyEvent(0, 65, modifier, "a", "a");
utils.sendKeyEvent("keypress", "a", 65, modifier);
is(divfocus, false, "accesskey does not focus div");
is(divclicked, true, "accesskey fires click at div");
is(inputfocus, false, "input was not targeted");
is(inputclicked, false, "inpt was not targeted");
divclicked = false;
utils.sendKeyEvent("keypress", "b", 66, modifier);
is(divfocus, false, "focus cannot bubble to div");
is(divclicked, true, "click bubbles to div");
is(inputfocus, true, "accesskey focuses input");
is(inputclicked, true, "accesskey clicks input");
</script>
</pre>
</body>
</html>

Просмотреть файл

@ -50,7 +50,7 @@
* http://www.whatwg.org/specs/web-apps/current-work/
*/
[scriptable, uuid(4e237175-3628-4dc8-892f-5270edc3c71a)]
[scriptable, uuid(d4111310-29a9-42c7-a3fe-9b797ab85409)]
interface nsIDOMHTMLAnchorElement : nsIDOMHTMLElement
{
attribute DOMString href;
@ -78,7 +78,6 @@ interface nsIDOMHTMLAnchorElement : nsIDOMHTMLElement
attribute DOMString hash;
attribute DOMString accessKey;
attribute DOMString charset;
attribute DOMString coords;
attribute DOMString name;
@ -87,6 +86,4 @@ interface nsIDOMHTMLAnchorElement : nsIDOMHTMLElement
attribute long tabIndex;
DOMString toString();
void blur();
void focus();
};

Просмотреть файл

@ -50,7 +50,7 @@
* http://www.whatwg.org/specs/web-apps/current-work/
*/
[scriptable, uuid(a6cf90ae-15b3-11d2-932e-00805f8add32)]
[scriptable, uuid(2b50b3a0-a7ac-4802-aafe-aa2613dae1c8)]
interface nsIDOMHTMLAppletElement : nsIDOMHTMLElement
{
attribute DOMString align;

Просмотреть файл

@ -50,7 +50,7 @@
* http://www.whatwg.org/specs/web-apps/current-work/
*/
[scriptable, uuid(fca7d30d-c834-470d-9bb2-25eddfedd86b)]
[scriptable, uuid(c42d5c09-aafa-4390-80d3-d0b1d07e31b0)]
interface nsIDOMHTMLAreaElement : nsIDOMHTMLElement
{
attribute DOMString alt;
@ -71,7 +71,6 @@ interface nsIDOMHTMLAreaElement : nsIDOMHTMLElement
attribute DOMString hash;
attribute DOMString accessKey;
attribute long tabIndex;
attribute boolean noHref;
DOMString toString();

Просмотреть файл

@ -52,7 +52,7 @@
* @status UNDER_DEVELOPMENT
*/
[scriptable, uuid(cd1a6a6b-bc4c-4e5a-b7da-53dccc878ab8)]
[scriptable, uuid(223024c8-6a48-4b3d-8bec-1ea45523e306)]
interface nsIDOMHTMLAudioElement : nsIDOMHTMLMediaElement
{
// Setup the audio stream for writing

Просмотреть файл

@ -50,7 +50,7 @@
* http://www.whatwg.org/specs/web-apps/current-work/
*/
[scriptable, uuid(a6cf90a5-15b3-11d2-932e-00805f8add32)]
[scriptable, uuid(59160d7f-c33b-4e14-a105-0f5fe445304d)]
interface nsIDOMHTMLBRElement : nsIDOMHTMLElement
{
attribute DOMString clear;

Просмотреть файл

@ -50,7 +50,7 @@
* http://www.whatwg.org/specs/web-apps/current-work/
*/
[scriptable, uuid(a6cf908b-15b3-11d2-932e-00805f8add32)]
[scriptable, uuid(2fe75fbd-5d66-4145-b80b-95e4c89d5693)]
interface nsIDOMHTMLBaseElement : nsIDOMHTMLElement
{
attribute DOMString href;

Просмотреть файл

@ -50,7 +50,7 @@
* http://www.whatwg.org/specs/web-apps/current-work/
*/
[scriptable, uuid(a6cf908e-15b3-11d2-932e-00805f8add32)]
[scriptable, uuid(69540caf-da25-4543-a45c-383062fb1471)]
interface nsIDOMHTMLBodyElement : nsIDOMHTMLElement
{
attribute DOMString aLink;

Просмотреть файл

@ -52,7 +52,7 @@
interface nsIDOMValidityState;
[scriptable, uuid(bcae78a1-9f9b-46bf-abb5-a3fe410d97ae)]
[scriptable, uuid(832f7129-7f71-4692-81b5-eb8d5fd71e68)]
interface nsIDOMHTMLButtonElement : nsIDOMHTMLElement
{
attribute boolean autofocus;
@ -69,13 +69,9 @@ interface nsIDOMHTMLButtonElement : nsIDOMHTMLElement
attribute DOMString value;
attribute DOMString accessKey;
attribute long tabIndex;
void blur();
void focus();
void click();
// The following lines are parte of the constraint validation API, see:
// The following lines are part of the constraint validation API, see:
// http://www.whatwg.org/specs/web-apps/current-work/#the-constraint-validation-api
readonly attribute boolean willValidate;
readonly attribute nsIDOMValidityState validity;

Просмотреть файл

@ -54,7 +54,7 @@
interface nsIDOMFile;
[scriptable, uuid(6b44a95a-c0ad-41f9-beb5-579bdb8698f2)]
[scriptable, uuid(accc66d5-48a3-43b4-add9-af77e8fd6717)]
interface nsIDOMHTMLCanvasElement : nsIDOMHTMLElement
{
attribute unsigned long width;

Просмотреть файл

@ -50,7 +50,7 @@
* http://www.whatwg.org/specs/web-apps/current-work/
*/
[scriptable, uuid(a6cf9083-15b3-11d2-932e-00805f8add32)]
[scriptable, uuid(1af9e026-011d-4d0e-91db-09bcfa3e9622)]
interface nsIDOMHTMLCollection : nsISupports
{
readonly attribute unsigned long length;

Просмотреть файл

@ -50,7 +50,7 @@
* http://www.whatwg.org/specs/web-apps/current-work/
*/
[scriptable, uuid(a6cf909b-15b3-11d2-932e-00805f8add32)]
[scriptable, uuid(7f2fd6e0-fd97-43d1-ad1b-9e4ea5aa51a4)]
interface nsIDOMHTMLDListElement : nsIDOMHTMLElement
{
attribute boolean compact;

Просмотреть файл

@ -49,7 +49,7 @@
interface nsIDOMHTMLCollection;
[scriptable, uuid(ec66a63e-8a23-4a85-bd53-050b49a2b048)]
[scriptable, uuid(d7924061-3bd1-4446-8ba7-c1ad86e7c492)]
interface nsIDOMHTMLDataListElement : nsIDOMHTMLElement
{
readonly attribute nsIDOMHTMLCollection options;

Просмотреть файл

@ -50,7 +50,7 @@
* http://www.whatwg.org/specs/web-apps/current-work/
*/
[scriptable, uuid(a6cf909c-15b3-11d2-932e-00805f8add32)]
[scriptable, uuid(26b21995-f6f6-4ef9-8eec-0e9d8cb3125e)]
interface nsIDOMHTMLDirectoryElement : nsIDOMHTMLElement
{
attribute boolean compact;

Просмотреть файл

@ -50,7 +50,7 @@
* http://www.whatwg.org/specs/web-apps/current-work/
*/
[scriptable, uuid(a6cf90a0-15b3-11d2-932e-00805f8add32)]
[scriptable, uuid(02181d51-531c-4bca-908f-c426abcca32c)]
interface nsIDOMHTMLDivElement : nsIDOMHTMLElement
{
attribute DOMString align;

Просмотреть файл

@ -51,7 +51,7 @@
* http://www.whatwg.org/specs/web-apps/current-work/
*/
[scriptable, uuid(a6cf9085-15b3-11d2-932e-00805f8add32)]
[scriptable, uuid(cf054c24-22ea-49e9-a824-f9661636c2f3)]
interface nsIDOMHTMLElement : nsIDOMElement
{
attribute DOMString id;
@ -59,4 +59,10 @@ interface nsIDOMHTMLElement : nsIDOMElement
attribute DOMString lang;
attribute DOMString dir;
attribute DOMString className;
attribute DOMString accessKey;
void blur();
void focus();
void click();
};

Просмотреть файл

@ -47,7 +47,7 @@
* http://www.whatwg.org/specs/web-apps/current-work/#the-embed-element
*/
[scriptable, uuid(123f90ab-15b3-11d2-456e-00805f8add32)]
[scriptable, uuid(e9c14230-1e5c-41d4-98a7-34a0aafb448d)]
interface nsIDOMHTMLEmbedElement : nsIDOMHTMLElement
{
attribute DOMString align;

Просмотреть файл

@ -52,7 +52,7 @@
interface nsIDOMValidityState;
[scriptable, uuid(58db2166-36fc-482c-a9f8-84ad262537b2)]
[scriptable, uuid(b45e652e-b131-455e-93a8-c3832026f8aa)]
interface nsIDOMHTMLFieldSetElement : nsIDOMHTMLElement
{
attribute boolean disabled;

Просмотреть файл

@ -50,7 +50,7 @@
* http://www.whatwg.org/specs/web-apps/current-work/
*/
[scriptable, uuid(a6cf90a7-15b3-11d2-932e-00805f8add32)]
[scriptable, uuid(0f14f0f1-68cf-4760-a709-90a22276e421)]
interface nsIDOMHTMLFontElement : nsIDOMHTMLElement
{
attribute DOMString color;

Просмотреть файл

@ -50,7 +50,7 @@
* http://www.whatwg.org/specs/web-apps/current-work/
*/
[scriptable, uuid(0884ce23-e069-499e-a13c-a91c8ae0fc98)]
[scriptable, uuid(5449f8bd-0392-4cba-ab08-6c9a68d2a89f)]
interface nsIDOMHTMLFormElement : nsIDOMHTMLElement
{
attribute DOMString name;

Просмотреть файл

@ -50,7 +50,7 @@
* http://www.whatwg.org/specs/web-apps/current-work/
*/
[scriptable, uuid(a6cf90b9-15b3-11d2-932e-00805f8add32)]
[scriptable, uuid(00503771-9ff0-4664-a8a8-66a8246255b7)]
interface nsIDOMHTMLFrameElement : nsIDOMHTMLElement
{
attribute DOMString frameBorder;

Просмотреть файл

@ -50,7 +50,7 @@
* http://www.whatwg.org/specs/web-apps/current-work/
*/
[scriptable, uuid(a6cf90b8-15b3-11d2-932e-00805f8add32)]
[scriptable, uuid(903739a5-3ce5-4dc7-8abd-373aa07b84d9)]
interface nsIDOMHTMLFrameSetElement : nsIDOMHTMLElement
{
attribute DOMString cols;

Просмотреть файл

@ -50,7 +50,7 @@
* http://www.whatwg.org/specs/web-apps/current-work/
*/
[scriptable, uuid(a6cf90a8-15b3-11d2-932e-00805f8add32)]
[scriptable, uuid(8303ec1f-dc33-447a-8a10-7a28b5809dec)]
interface nsIDOMHTMLHRElement : nsIDOMHTMLElement
{
attribute DOMString align;

Просмотреть файл

@ -50,7 +50,7 @@
* http://www.whatwg.org/specs/web-apps/current-work/
*/
[scriptable, uuid(a6cf9087-15b3-11d2-932e-00805f8add32)]
[scriptable, uuid(a921d694-5e14-4ad7-8bdf-4abaac32c070)]
interface nsIDOMHTMLHeadElement : nsIDOMHTMLElement
{
[noscript] attribute DOMString profile;

Просмотреть файл

@ -50,7 +50,7 @@
* http://www.whatwg.org/specs/web-apps/current-work/
*/
[scriptable, uuid(a6cf90a2-15b3-11d2-932e-00805f8add32)]
[scriptable, uuid(f29c32bf-c597-420e-b38e-747dda978c94)]
interface nsIDOMHTMLHeadingElement : nsIDOMHTMLElement
{
attribute DOMString align;

Просмотреть файл

@ -50,7 +50,7 @@
* http://www.whatwg.org/specs/web-apps/current-work/
*/
[scriptable, uuid(a6cf9086-15b3-11d2-932e-00805f8add32)]
[scriptable, uuid(f5966a2b-acab-44eb-8f39-3246acb3ad40)]
interface nsIDOMHTMLHtmlElement : nsIDOMHTMLElement
{
attribute DOMString version;

Просмотреть файл

@ -50,7 +50,7 @@
* http://www.whatwg.org/specs/web-apps/current-work/
*/
[scriptable, uuid(a6cf90ba-15b3-11d2-932e-00805f8add32)]
[scriptable, uuid(eb2c9cf7-c9b4-454c-a1de-c83334f13ca0)]
interface nsIDOMHTMLIFrameElement : nsIDOMHTMLElement
{
attribute DOMString align;

Просмотреть файл

@ -50,7 +50,7 @@
* http://www.whatwg.org/specs/web-apps/current-work/
*/
[scriptable, uuid(3fc9c313-49b9-4315-b39f-7166cf362e10)]
[scriptable, uuid(1a903431-4968-4c45-b2f8-3123d5b802a1)]
interface nsIDOMHTMLImageElement : nsIDOMHTMLElement
{
attribute DOMString alt;

Просмотреть файл

@ -54,7 +54,7 @@ interface nsIDOMValidityState;
* http://www.whatwg.org/specs/web-apps/current-work/
*/
[scriptable, uuid(0805059d-f18f-4095-ae6b-0bf6df80b7b8)]
[scriptable, uuid(f7124276-4198-41d7-bc7d-9d37b942dfca)]
interface nsIDOMHTMLInputElement : nsIDOMHTMLElement
{
attribute DOMString accept;
@ -87,7 +87,6 @@ interface nsIDOMHTMLInputElement : nsIDOMHTMLElement
attribute boolean readOnly;
attribute boolean required;
attribute DOMString accessKey;
attribute DOMString align;
attribute unsigned long size;
@ -126,8 +125,4 @@ interface nsIDOMHTMLInputElement : nsIDOMHTMLElement
* element is a text field.
*/
boolean mozIsTextField(in boolean aExcludePassword);
void blur();
void focus();
void click();
};

Просмотреть файл

@ -50,7 +50,7 @@
* http://www.whatwg.org/specs/web-apps/current-work/
*/
[scriptable, uuid(a6cf908c-15b3-11d2-932e-00805f8add32)]
[scriptable, uuid(b1bd295b-40f1-48d7-bb26-d14b5052243d)]
interface nsIDOMHTMLIsIndexElement : nsIDOMHTMLElement
{
readonly attribute nsIDOMHTMLFormElement form;

Просмотреть файл

@ -50,7 +50,7 @@
* http://www.whatwg.org/specs/web-apps/current-work/
*/
[scriptable, uuid(a6cf909e-15b3-11d2-932e-00805f8add32)]
[scriptable, uuid(1bb231a0-48e3-453b-834e-3ac3828691ad)]
interface nsIDOMHTMLLIElement : nsIDOMHTMLElement
{
attribute DOMString type;

Просмотреть файл

@ -50,12 +50,10 @@
* http://www.whatwg.org/specs/web-apps/current-work/
*/
[scriptable, uuid(8a207452-e725-4a9e-beb6-9e0c0a65012c)]
[scriptable, uuid(d929a64e-4265-471c-89dc-13f9b24e233d)]
interface nsIDOMHTMLLabelElement : nsIDOMHTMLElement
{
readonly attribute nsIDOMHTMLFormElement form;
attribute DOMString htmlFor;
readonly attribute nsIDOMHTMLElement control;
attribute DOMString accessKey;
};

Просмотреть файл

@ -50,10 +50,9 @@
* http://www.whatwg.org/specs/web-apps/current-work/
*/
[scriptable, uuid(a6cf9098-15b3-11d2-932e-00805f8add32)]
[scriptable, uuid(633b72af-79b1-4b5e-b132-792e78caff81)]
interface nsIDOMHTMLLegendElement : nsIDOMHTMLElement
{
readonly attribute nsIDOMHTMLFormElement form;
attribute DOMString accessKey;
attribute DOMString align;
};

Просмотреть файл

@ -50,7 +50,7 @@
* http://www.whatwg.org/specs/web-apps/current-work/
*/
[scriptable, uuid(a6cf9088-15b3-11d2-932e-00805f8add32)]
[scriptable, uuid(42fc88fb-0361-4a56-9bd7-809c035f00c3)]
interface nsIDOMHTMLLinkElement : nsIDOMHTMLElement
{
attribute boolean disabled;

Просмотреть файл

@ -50,7 +50,7 @@
* http://www.whatwg.org/specs/web-apps/current-work/
*/
[scriptable, uuid(a6cf90af-15b3-11d2-932e-00805f8add32)]
[scriptable, uuid(851edc2f-ea1f-44fa-b1fc-0799152b7cdb)]
interface nsIDOMHTMLMapElement : nsIDOMHTMLElement
{
readonly attribute nsIDOMHTMLCollection areas;

Просмотреть файл

@ -57,7 +57,7 @@
#endif
%}
[scriptable, uuid(91f65f50-74ea-40ea-8e26-652290738730)]
[scriptable, uuid(f783b694-118b-44ec-982b-ad8a96e31db0)]
interface nsIDOMHTMLMediaElement : nsIDOMHTMLElement
{
// error state

Просмотреть файл

@ -50,7 +50,7 @@
* http://www.whatwg.org/specs/web-apps/current-work/
*/
[scriptable, uuid(a6cf909d-15b3-11d2-932e-00805f8add32)]
[scriptable, uuid(e4d49037-b0ae-40c5-805f-0115bb47f193)]
interface nsIDOMHTMLMenuElement : nsIDOMHTMLElement
{
attribute boolean compact;

Просмотреть файл

@ -50,7 +50,7 @@
* http://www.whatwg.org/specs/web-apps/current-work/
*/
[scriptable, uuid(a6cf908a-15b3-11d2-932e-00805f8add32)]
[scriptable, uuid(5f1bfd9f-1e57-46a4-8320-8a8316917cd2)]
interface nsIDOMHTMLMetaElement : nsIDOMHTMLElement
{
attribute DOMString content;

Просмотреть файл

@ -50,7 +50,7 @@
* http://www.whatwg.org/specs/web-apps/current-work/
*/
[scriptable, uuid(a6cf90a9-15b3-11d2-932e-00805f8add32)]
[scriptable, uuid(73b8aebe-01ed-40aa-bb23-e73b317bd36b)]
interface nsIDOMHTMLModElement : nsIDOMHTMLElement
{
attribute DOMString cite;

Просмотреть файл

@ -50,7 +50,7 @@
* http://www.whatwg.org/specs/web-apps/current-work/
*/
[scriptable, uuid(a6cf909a-15b3-11d2-932e-00805f8add32)]
[scriptable, uuid(4092f095-d9c5-4621-a10e-5b9baecfee3c)]
interface nsIDOMHTMLOListElement : nsIDOMHTMLElement
{
attribute boolean compact;

Просмотреть файл

@ -52,7 +52,7 @@
interface nsIDOMValidityState;
[scriptable, uuid(9b93aab4-7fe8-4f79-9ad2-0623178a0c46)]
[scriptable, uuid(8408203a-72cd-4d62-b618-81a4c8aba13e)]
interface nsIDOMHTMLObjectElement : nsIDOMHTMLElement
{
readonly attribute nsIDOMHTMLFormElement form;

Просмотреть файл

@ -50,7 +50,7 @@
* http://www.whatwg.org/specs/web-apps/current-work/
*/
[scriptable, uuid(a6cf9091-15b3-11d2-932e-00805f8add32)]
[scriptable, uuid(73627f70-10df-4568-858b-4636e16d4b41)]
interface nsIDOMHTMLOptGroupElement : nsIDOMHTMLElement
{
attribute boolean disabled;

Просмотреть файл

@ -50,7 +50,7 @@
* http://www.whatwg.org/specs/web-apps/current-work/
*/
[scriptable, uuid(611d00f5-1eb8-4571-b995-2a2019d2d11c)]
[scriptable, uuid(c50d24b5-a023-4179-a980-58feccf9ae1a)]
interface nsIDOMHTMLOptionElement : nsIDOMHTMLElement
{
attribute boolean disabled;

Просмотреть файл

@ -50,7 +50,7 @@
interface nsIDOMDOMSettableTokenList;
interface nsIDOMValidityState;
[scriptable, uuid(0f7f15a9-ea72-4feb-b2b5-2fcbc9c10ab8)]
[scriptable, uuid(13445f20-125f-4d4a-a2cc-b7315d06a690)]
interface nsIDOMHTMLOutputElement : nsIDOMHTMLElement
{
readonly attribute nsIDOMDOMSettableTokenList htmlFor;

Просмотреть файл

@ -50,7 +50,7 @@
* http://www.whatwg.org/specs/web-apps/current-work/
*/
[scriptable, uuid(a6cf90a1-15b3-11d2-932e-00805f8add32)]
[scriptable, uuid(7f2ad673-8c8f-4a05-b108-78c923be72ae)]
interface nsIDOMHTMLParagraphElement : nsIDOMHTMLElement
{
attribute DOMString align;

Просмотреть файл

@ -50,7 +50,7 @@
* http://www.whatwg.org/specs/web-apps/current-work/
*/
[scriptable, uuid(a6cf90ad-15b3-11d2-932e-00805f8add32)]
[scriptable, uuid(ffb1d4ba-454d-4002-a4e9-2a35d7d73cdf)]
interface nsIDOMHTMLParamElement : nsIDOMHTMLElement
{
attribute DOMString name;

Просмотреть файл

@ -50,7 +50,7 @@
* http://www.whatwg.org/specs/web-apps/current-work/
*/
[scriptable, uuid(a6cf90a4-15b3-11d2-932e-00805f8add32)]
[scriptable, uuid(bda4e12e-944e-4d5a-8fdf-a9a6a09a9d6f)]
interface nsIDOMHTMLPreElement : nsIDOMHTMLElement
{
attribute long width;

Просмотреть файл

@ -50,7 +50,7 @@
* http://www.whatwg.org/specs/web-apps/current-work/
*/
[scriptable, uuid(a6cf90a3-15b3-11d2-932e-00805f8add32)]
[scriptable, uuid(d287d084-efb3-4e12-8e4d-fee6a67c0eb3)]
interface nsIDOMHTMLQuoteElement : nsIDOMHTMLElement
{
attribute DOMString cite;

Просмотреть файл

@ -50,7 +50,7 @@
* http://www.whatwg.org/specs/web-apps/current-work/
*/
[scriptable, uuid(4af8568c-375c-42fd-a82f-b25a7c03fc3e)]
[scriptable, uuid(c4cd6bf6-eb08-4e8f-bd2b-eb9c940c8985)]
interface nsIDOMHTMLScriptElement : nsIDOMHTMLElement
{
attribute DOMString src;

Просмотреть файл

@ -53,7 +53,7 @@
interface nsIDOMValidityState;
[scriptable, uuid(da2be32d-63de-47ae-8c81-7ab8ac6b5aae)]
[scriptable, uuid(79ae1985-4751-42a1-99af-c4c657b4e377)]
interface nsIDOMHTMLSelectElement : nsIDOMHTMLElement
{
attribute boolean autofocus;
@ -78,10 +78,8 @@ interface nsIDOMHTMLSelectElement : nsIDOMHTMLElement
attribute DOMString value;
attribute long tabIndex;
void blur();
void focus();
// The following lines are parte of the constraint validation API, see:
// The following lines are part of the constraint validation API, see:
// http://www.whatwg.org/specs/web-apps/current-work/#the-constraint-validation-api
readonly attribute boolean willValidate;
readonly attribute nsIDOMValidityState validity;

Просмотреть файл

@ -48,7 +48,7 @@
* @status UNDER_DEVELOPMENT
*/
[scriptable, uuid(be281029-7dd9-4268-963e-96f5196acc19)]
[scriptable, uuid(11512cc3-8303-423a-b25c-a5cbe7d0a332)]
interface nsIDOMHTMLSourceElement : nsIDOMHTMLElement
{
attribute DOMString src;

Просмотреть файл

@ -50,7 +50,7 @@
* http://www.whatwg.org/specs/web-apps/current-work/
*/
[scriptable, uuid(a6cf908d-15b3-11d2-932e-00805f8add32)]
[scriptable, uuid(93905d93-6a58-4084-9be9-4368becc5687)]
interface nsIDOMHTMLStyleElement : nsIDOMHTMLElement
{
attribute boolean disabled;

Просмотреть файл

@ -50,7 +50,7 @@
* http://www.whatwg.org/specs/web-apps/current-work/
*/
[scriptable, uuid(a6cf90b3-15b3-11d2-932e-00805f8add32)]
[scriptable, uuid(3c6e8b95-5d33-44d5-9f3c-1d72ff6d46ef)]
interface nsIDOMHTMLTableCaptionElement : nsIDOMHTMLElement
{
attribute DOMString align;

Просмотреть файл

@ -50,7 +50,7 @@
* http://www.whatwg.org/specs/web-apps/current-work/
*/
[scriptable, uuid(a6cf90b7-15b3-11d2-932e-00805f8add32)]
[scriptable, uuid(2fcc14f0-8c36-4df5-879a-661f002860af)]
interface nsIDOMHTMLTableCellElement : nsIDOMHTMLElement
{
readonly attribute long cellIndex;

Просмотреть файл

@ -50,7 +50,7 @@
* http://www.whatwg.org/specs/web-apps/current-work/
*/
[scriptable, uuid(a6cf90b4-15b3-11d2-932e-00805f8add32)]
[scriptable, uuid(faf0f52d-bf1d-4d7b-9c42-59ee3dfe8c3a)]
interface nsIDOMHTMLTableColElement : nsIDOMHTMLElement
{
attribute DOMString align;

Просмотреть файл

@ -50,7 +50,7 @@
* http://www.whatwg.org/specs/web-apps/current-work/
*/
[scriptable, uuid(a6cf90b2-15b3-11d2-932e-00805f8add32)]
[scriptable, uuid(6d7871e7-cf0d-45f5-973b-e746cdf44a5b)]
interface nsIDOMHTMLTableElement : nsIDOMHTMLElement
{
// Modified in DOM Level 2:

Просмотреть файл

@ -50,7 +50,7 @@
* http://www.whatwg.org/specs/web-apps/current-work/
*/
[scriptable, uuid(a6cf90b6-15b3-11d2-932e-00805f8add32)]
[scriptable, uuid(45432e97-b2d1-4e54-ba5a-af6f021e39b4)]
interface nsIDOMHTMLTableRowElement : nsIDOMHTMLElement
{
// Modified in DOM Level 2:

Просмотреть файл

@ -50,7 +50,7 @@
* http://www.whatwg.org/specs/web-apps/current-work/
*/
[scriptable, uuid(a6cf90b5-15b3-11d2-932e-00805f8add32)]
[scriptable, uuid(be77c7dc-fdc4-4d14-9c8b-ee23098d4ff9)]
interface nsIDOMHTMLTableSectionElement : nsIDOMHTMLElement
{
attribute DOMString align;

Просмотреть файл

@ -50,13 +50,12 @@
* http://www.whatwg.org/specs/web-apps/current-work/
*/
[scriptable, uuid(7a403df9-8911-499b-afbf-98a1bbc20dd1)]
[scriptable, uuid(ab97985c-914c-4193-92ce-5a4d4b68927c)]
interface nsIDOMHTMLTextAreaElement : nsIDOMHTMLElement
{
// Modified in DOM Level 2:
attribute DOMString defaultValue;
readonly attribute nsIDOMHTMLFormElement form;
attribute DOMString accessKey;
attribute unsigned long cols;
attribute boolean disabled;
attribute DOMString name;
@ -65,7 +64,5 @@ interface nsIDOMHTMLTextAreaElement : nsIDOMHTMLElement
attribute long tabIndex;
readonly attribute DOMString type;
attribute DOMString value;
void blur();
void focus();
void select();
};

Просмотреть файл

@ -50,7 +50,7 @@
* http://www.whatwg.org/specs/web-apps/current-work/
*/
[scriptable, uuid(a6cf9089-15b3-11d2-932e-00805f8add32)]
[scriptable, uuid(98c88210-6291-482c-aaf4-2dbb958dd8c0)]
interface nsIDOMHTMLTitleElement : nsIDOMHTMLElement
{
attribute DOMString text;

Просмотреть файл

@ -50,7 +50,7 @@
* http://www.whatwg.org/specs/web-apps/current-work/
*/
[scriptable, uuid(a6cf9099-15b3-11d2-932e-00805f8add32)]
[scriptable, uuid(834c45a3-85a5-49ab-b947-f6a9383eb937)]
interface nsIDOMHTMLUListElement : nsIDOMHTMLElement
{
attribute boolean compact;

Просмотреть файл

@ -48,7 +48,7 @@
* @status UNDER_DEVELOPMENT
*/
[scriptable, uuid(e1f52aa5-9962-4019-b7b3-af3aee6e4d48)]
[scriptable, uuid(ef602186-7eee-410c-9c4a-eb750749b6ce)]
interface nsIDOMHTMLVideoElement : nsIDOMHTMLMediaElement
{
attribute long width;

Просмотреть файл

@ -38,7 +38,7 @@
#include "domstubs.idl"
[scriptable, uuid(f0ffe1d2-9615-492b-aae1-05428ebc2a70)]
[scriptable, uuid(4738f75d-9c6f-40f8-81d0-84b2e4726a8f)]
interface nsIDOMNSHTMLElement : nsISupports
{
readonly attribute long offsetTop;
@ -63,9 +63,6 @@ interface nsIDOMNSHTMLElement : nsISupports
// for WHAT-WG drag and drop
attribute boolean draggable;
void blur();
void focus();
[optional_argc] void scrollIntoView([optional] in boolean top);
attribute boolean spellcheck;

Просмотреть файл

@ -42,7 +42,7 @@
* interface for [X]HTML hr elements, for compatibility with IE.
*/
[scriptable, uuid(19b5879f-c125-447c-aaaf-719de3ef221a)]
[scriptable, uuid(63c0ae1b-8aa7-4e72-82a1-aff486bfdaf5)]
interface nsIDOMNSHTMLHRElement : nsISupports
{
attribute DOMString color;