2018-09-13 23:04:55 +03:00
|
|
|
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-12-26 06:00:47 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
|
|
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*/
|
|
|
|
|
2013-04-20 20:04:09 +04:00
|
|
|
[OverrideBuiltins]
|
2012-12-26 06:00:47 +04:00
|
|
|
interface HTMLDocument : Document {
|
2014-12-12 15:04:00 +03:00
|
|
|
[SetterThrows]
|
2018-06-07 22:29:23 +03:00
|
|
|
attribute DOMString domain;
|
2012-12-26 06:00:47 +04:00
|
|
|
// DOM tree accessors
|
2012-12-20 13:56:11 +04:00
|
|
|
[Throws]
|
|
|
|
getter object (DOMString name);
|
2012-12-26 06:00:47 +04:00
|
|
|
|
|
|
|
// dynamic markup insertion
|
2017-06-29 17:26:00 +03:00
|
|
|
[CEReactions, Throws]
|
2018-03-29 01:01:46 +03:00
|
|
|
Document open(optional DOMString type, optional DOMString replace = ""); // type is ignored
|
2017-06-29 17:26:00 +03:00
|
|
|
[CEReactions, Throws]
|
2016-01-05 19:51:08 +03:00
|
|
|
WindowProxy? open(DOMString url, DOMString name, DOMString features, optional boolean replace = false);
|
2017-06-29 17:26:00 +03:00
|
|
|
[CEReactions, Throws]
|
2012-12-26 06:00:47 +04:00
|
|
|
void close();
|
2017-06-29 17:26:00 +03:00
|
|
|
[CEReactions, Throws]
|
2012-12-26 06:00:47 +04:00
|
|
|
void write(DOMString... text);
|
2017-06-29 17:26:00 +03:00
|
|
|
[CEReactions, Throws]
|
2012-12-26 06:00:47 +04:00
|
|
|
void writeln(DOMString... text);
|
|
|
|
|
2017-12-06 00:03:18 +03:00
|
|
|
[CEReactions, SetterThrows, SetterNeedsSubjectPrincipal]
|
2012-12-26 06:00:47 +04:00
|
|
|
attribute DOMString designMode;
|
2017-06-29 17:26:00 +03:00
|
|
|
[CEReactions, Throws, NeedsSubjectPrincipal]
|
2012-12-26 06:00:47 +04:00
|
|
|
boolean execCommand(DOMString commandId, optional boolean showUI = false,
|
|
|
|
optional DOMString value = "");
|
2017-02-01 23:43:36 +03:00
|
|
|
[Throws, NeedsSubjectPrincipal]
|
2012-12-26 06:00:47 +04:00
|
|
|
boolean queryCommandEnabled(DOMString commandId);
|
|
|
|
[Throws]
|
|
|
|
boolean queryCommandIndeterm(DOMString commandId);
|
|
|
|
[Throws]
|
|
|
|
boolean queryCommandState(DOMString commandId);
|
2016-11-15 08:18:33 +03:00
|
|
|
[NeedsCallerType]
|
2012-12-26 06:00:47 +04:00
|
|
|
boolean queryCommandSupported(DOMString commandId);
|
|
|
|
[Throws]
|
|
|
|
DOMString queryCommandValue(DOMString commandId);
|
|
|
|
|
2019-03-02 07:22:05 +03:00
|
|
|
[CEReactions] attribute [TreatNullAs=EmptyString] DOMString fgColor;
|
|
|
|
[CEReactions] attribute [TreatNullAs=EmptyString] DOMString linkColor;
|
|
|
|
[CEReactions] attribute [TreatNullAs=EmptyString] DOMString vlinkColor;
|
|
|
|
[CEReactions] attribute [TreatNullAs=EmptyString] DOMString alinkColor;
|
|
|
|
[CEReactions] attribute [TreatNullAs=EmptyString] DOMString bgColor;
|
2012-12-26 06:00:47 +04:00
|
|
|
|
|
|
|
void clear();
|
|
|
|
|
2014-05-20 23:52:21 +04:00
|
|
|
readonly attribute HTMLAllCollection all;
|
2013-06-12 10:55:00 +04:00
|
|
|
|
2013-08-01 01:44:51 +04:00
|
|
|
// @deprecated These are old Netscape 4 methods. Do not use,
|
|
|
|
// the implementation is no-op.
|
|
|
|
// XXXbz do we actually need these anymore?
|
2014-02-09 12:04:39 +04:00
|
|
|
void captureEvents();
|
|
|
|
void releaseEvents();
|
2012-12-26 06:00:47 +04:00
|
|
|
};
|
2014-06-25 04:37:03 +04:00
|
|
|
|
|
|
|
partial interface HTMLDocument {
|
|
|
|
/*
|
2019-01-30 15:43:34 +03:00
|
|
|
* Number of nodes that have been blocked by the Safebrowsing API to prevent
|
|
|
|
* tracking, cryptomining and so on. This method is for testing only.
|
2014-06-25 04:37:03 +04:00
|
|
|
*/
|
|
|
|
[ChromeOnly, Pure]
|
2019-01-30 15:43:34 +03:00
|
|
|
readonly attribute long blockedNodeByClassifierCount;
|
2014-06-25 04:37:03 +04:00
|
|
|
|
|
|
|
/*
|
2019-01-30 15:43:34 +03:00
|
|
|
* List of nodes that have been blocked by the Safebrowsing API to prevent
|
|
|
|
* tracking, fingerprinting, cryptomining and so on. This method is for
|
|
|
|
* testing only.
|
2014-06-25 04:37:03 +04:00
|
|
|
*/
|
|
|
|
[ChromeOnly, Pure]
|
2019-01-30 15:43:34 +03:00
|
|
|
readonly attribute NodeList blockedNodesByClassifier;
|
2018-07-10 11:09:59 +03:00
|
|
|
|
|
|
|
[ChromeOnly]
|
|
|
|
void userInteractionForTesting();
|
Bug 1514940 - part 1: Forcibly disable new keyCode/charCode value of keypress events if the document is Confluence r=smaug,Ehsan,kmag
Old Confluence does not aware of conflated model keypress event (see UI Events
spec, https://w3c.github.io/uievents/#determine-keypress-keyCode).
Additionally, Confluence can be hosted with any domains. Therefore, we cannot
use blacklist to disable the conflated model keypress event only on it.
This patch checks whether current or parent document is Confluence with JS
module, called KeyPressEventModelCheckerChild. For kicking this module,
nsHTMLDocument dispatches an custom event, CheckKeyPressEventModel, when it
becomes editable only first time. Finally, if it's a Confluence instance, the
module let PresShell know that we need to use split model keypress event in it.
Differential Revision: https://phabricator.services.mozilla.com/D17907
--HG--
extra : moz-landing-system : lando
2019-02-05 14:35:43 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* setKeyPressEventModel() is called when we need to check whether the web
|
|
|
|
* app requires specific keypress event model or not.
|
|
|
|
*
|
|
|
|
* @param aKeyPressEventModel Proper keypress event model for the web app.
|
|
|
|
* KEYPRESS_EVENT_MODEL_DEFAULT:
|
|
|
|
* Use default keypress event model. I.e., depending on
|
|
|
|
* "dom.keyboardevent.keypress.set_keycode_and_charcode_to_same_value"
|
|
|
|
* pref.
|
|
|
|
* KEYPRESS_EVENT_MODEL_SPLIT:
|
|
|
|
* Use split model. I.e, if keypress event inputs a character,
|
|
|
|
* keyCode should be 0. Otherwise, charCode should be 0.
|
|
|
|
* KEYPRESS_EVENT_MODEL_CONFLATED:
|
|
|
|
* Use conflated model. I.e., keyCode and charCode values of each
|
|
|
|
* keypress event should be set to same value.
|
|
|
|
*/
|
|
|
|
[ChromeOnly]
|
|
|
|
const unsigned short KEYPRESS_EVENT_MODEL_DEFAULT = 0;
|
|
|
|
[ChromeOnly]
|
|
|
|
const unsigned short KEYPRESS_EVENT_MODEL_SPLIT = 1;
|
|
|
|
[ChromeOnly]
|
|
|
|
const unsigned short KEYPRESS_EVENT_MODEL_CONFLATED = 2;
|
|
|
|
[ChromeOnly]
|
|
|
|
void setKeyPressEventModel(unsigned short aKeyPressEventModel);
|
2014-06-25 04:37:03 +04:00
|
|
|
};
|