<commit_before>/* 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/. */

// https://developer.mozilla.org/en-US/docs/Web/API/Using_the_Browser_API

callback BrowserElementNextPaintEventCallback = void ();

//enum BrowserFindCaseSensitivity { "case-sensitive", "case-insensitive" };
//enum BrowserFindDirection { "forward", "backward" };

//dictionary BrowserElementDownloadOptions {
//  DOMString? filename;
//  DOMString? referrer;
//};

//dictionary BrowserElementExecuteScriptOptions {
//  DOMString? url;
//  DOMString? origin;
//};

[NoInterfaceObject]
interface BrowserElement {
};

dictionary BrowserElementSecurityChangeDetail {

  // state:
  //   "insecure" indicates that the data corresponding to
  //     the request was received over an insecure channel.
  //
  //   "broken" indicates an unknown security state.  This
  //     may mean that the request is being loaded as part
  //     of a page in which some content was received over
  //     an insecure channel.
  //
  //   "secure" indicates that the data corresponding to the
  //     request was received over a secure channel.
  DOMString state;

  // trackingState:
  //   "loaded_tracking_content": tracking content has been loaded.
  //   "blocked_tracking_content": tracking content has been blocked from loading.
  DOMString trackingState;

  // mixedState:
  //   "blocked_mixed_active_content": Mixed active content has been blocked from loading.
  //   "loaded_mixed_active_content": Mixed active content has been loaded.
  DOMString mixedState;

  boolean extendedValidation;
  boolean trackingContent;
  boolean mixedContent;
};

dictionary BrowserElementErrorEventDetail {
  // https://developer.mozilla.org/en-US/docs/Web/Events/mozbrowsererror
  // just requires a "type" field, but we also provide
  // an optional human-readable description, and
  // an optional machine-readable report (e.g. a backtrace for panics)
  DOMString type;
  DOMString description;
  DOMString report;
};

dictionary BrowserElementLocationChangeEventDetail {
  DOMString uri;
  boolean canGoBack;
  boolean canGoForward;
};

dictionary BrowserElementIconChangeEventDetail {
  DOMString rel;
  DOMString href;
  DOMString sizes;
};

dictionary BrowserShowModalPromptEventDetail {
  DOMString promptType;
  DOMString title;
  DOMString message;
  DOMString returnValue;
  // TODO(simartin) unblock() callback
};

BrowserElement implements BrowserElementCommon;
BrowserElement implements BrowserElementPrivileged;

[NoInterfaceObject]
interface BrowserElementCommon {
  //[Throws,
  // Pref="dom.mozBrowserFramesEnabled",
  // CheckAnyPermissions="browser embed-widgets"]
  //void setVisible(boolean visible);

  //[Throws,
  // Pref="dom.mozBrowserFramesEnabled",
  // CheckAnyPermissions="browser embed-widgets"]
  //DOMRequest getVisible();

  //[Throws,
  // Pref="dom.mozBrowserFramesEnabled",
  // CheckAnyPermissions="browser embed-widgets"]
  //void setActive(boolean active);

  //[Throws,
  // Pref="dom.mozBrowserFramesEnabled",
  // CheckAnyPermissions="browser embed-widgets"]
  //boolean getActive();

  //[Throws,
  // Pref="dom.mozBrowserFramesEnabled",
  // CheckAnyPermissions="browser embed-widgets"]
  //void addNextPaintListener(BrowserElementNextPaintEventCallback listener);

  //[Throws,
  // Pref="dom.mozBrowserFramesEnabled",
  // CheckAnyPermissions="browser embed-widgets"]
  //void removeNextPaintListener(BrowserElementNextPaintEventCallback listener);
};

[NoInterfaceObject]
interface BrowserElementPrivileged {
  //[Throws,
  // Pref="dom.mozBrowserFramesEnabled",
  // CheckAnyPermissions="browser"]
  //void sendMouseEvent(DOMString type,
  //                    unsigned long x,
  //                    unsigned long y,
  //                    unsigned long button,
  //                    unsigned long clickCount,
  //                    unsigned long modifiers);

  //[Throws,
  // Pref="dom.mozBrowserFramesEnabled",
  // Func="TouchEvent::PrefEnabled",
  // CheckAnyPermissions="browser"]
  //void sendTouchEvent(DOMString type,
  //                    sequence<unsigned long> identifiers,
  //                    sequence<long> x,
  //                    sequence<long> y,
  //                    sequence<unsigned long> rx,
  //                    sequence<unsigned long> ry,
  //                    sequence<float> rotationAngles,
  //                    sequence<float> forces,
  //                    unsigned long count,
  //                    unsigned long modifiers);

  [Throws,
   Pref="dom.mozbrowser.enabled",
   CheckAnyPermissions="browser"]
  void goBack();

  [Throws,
   Pref="dom.mozbrowser.enabled",
   CheckAnyPermissions="browser"]
  void goForward();

  [Throws,
   Pref="dom.mozbrowser.enabled",
   CheckAnyPermissions="browser"]
  void reload(optional boolean hardReload = false);

  [Throws,
   Pref="dom.mozbrowser.enabled",
   CheckAnyPermissions="browser"]
  void stop();

  //[Throws,
  // Pref="dom.mozBrowserFramesEnabled",
  // CheckAnyPermissions="browser"]
  //DOMRequest download(DOMString url,
  //                    optional BrowserElementDownloadOptions options);

  //[Throws,
  // Pref="dom.mozBrowserFramesEnabled",
  // CheckAnyPermissions="browser"]
  //DOMRequest purgeHistory();

  //[Throws,
  // Pref="dom.mozBrowserFramesEnabled",
  // CheckAnyPermissions="browser"]<commit_msg>Properly hide BrowserElementPrivileged members<commit_after>/* 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/. */

// https://developer.mozilla.org/en-US/docs/Web/API/Using_the_Browser_API

callback BrowserElementNextPaintEventCallback = void ();

//enum BrowserFindCaseSensitivity { "case-sensitive", "case-insensitive" };
//enum BrowserFindDirection { "forward", "backward" };

//dictionary BrowserElementDownloadOptions {
//  DOMString? filename;
//  DOMString? referrer;
//};

//dictionary BrowserElementExecuteScriptOptions {
//  DOMString? url;
//  DOMString? origin;
//};

[NoInterfaceObject]
interface BrowserElement {
};

dictionary BrowserElementSecurityChangeDetail {

  // state:
  //   "insecure" indicates that the data corresponding to
  //     the request was received over an insecure channel.
  //
  //   "broken" indicates an unknown security state.  This
  //     may mean that the request is being loaded as part
  //     of a page in which some content was received over
  //     an insecure channel.
  //
  //   "secure" indicates that the data corresponding to the
  //     request was received over a secure channel.
  DOMString state;

  // trackingState:
  //   "loaded_tracking_content": tracking content has been loaded.
  //   "blocked_tracking_content": tracking content has been blocked from loading.
  DOMString trackingState;

  // mixedState:
  //   "blocked_mixed_active_content": Mixed active content has been blocked from loading.
  //   "loaded_mixed_active_content": Mixed active content has been loaded.
  DOMString mixedState;

  boolean extendedValidation;
  boolean trackingContent;
  boolean mixedContent;
};

dictionary BrowserElementErrorEventDetail {
  // https://developer.mozilla.org/en-US/docs/Web/Events/mozbrowsererror
  // just requires a "type" field, but we also provide
  // an optional human-readable description, and
  // an optional machine-readable report (e.g. a backtrace for panics)
  DOMString type;
  DOMString description;
  DOMString report;
};

dictionary BrowserElementLocationChangeEventDetail {
  DOMString uri;
  boolean canGoBack;
  boolean canGoForward;
};

dictionary BrowserElementIconChangeEventDetail {
  DOMString rel;
  DOMString href;
  DOMString sizes;
};

dictionary BrowserShowModalPromptEventDetail {
  DOMString promptType;
  DOMString title;
  DOMString message;
  DOMString returnValue;
  // TODO(simartin) unblock() callback
};

BrowserElement implements BrowserElementCommon;
BrowserElement implements BrowserElementPrivileged;

[NoInterfaceObject]
interface BrowserElementCommon {
  //[Throws,
  // Pref="dom.mozBrowserFramesEnabled",
  // CheckAnyPermissions="browser embed-widgets"]
  //void setVisible(boolean visible);

  //[Throws,
  // Pref="dom.mozBrowserFramesEnabled",
  // CheckAnyPermissions="browser embed-widgets"]
  //DOMRequest getVisible();

  //[Throws,
  // Pref="dom.mozBrowserFramesEnabled",
  // CheckAnyPermissions="browser embed-widgets"]
  //void setActive(boolean active);

  //[Throws,
  // Pref="dom.mozBrowserFramesEnabled",
  // CheckAnyPermissions="browser embed-widgets"]
  //boolean getActive();

  //[Throws,
  // Pref="dom.mozBrowserFramesEnabled",
  // CheckAnyPermissions="browser embed-widgets"]
  //void addNextPaintListener(BrowserElementNextPaintEventCallback listener);

  //[Throws,
  // Pref="dom.mozBrowserFramesEnabled",
  // CheckAnyPermissions="browser embed-widgets"]
  //void removeNextPaintListener(BrowserElementNextPaintEventCallback listener);
};

[NoInterfaceObject]
interface BrowserElementPrivileged {
  //[Throws,
  // Pref="dom.mozBrowserFramesEnabled",
  // CheckAnyPermissions="browser"]
  //void sendMouseEvent(DOMString type,
  //                    unsigned long x,
  //                    unsigned long y,
  //                    unsigned long button,
  //                    unsigned long clickCount,
  //                    unsigned long modifiers);

  //[Throws,
  // Pref="dom.mozBrowserFramesEnabled",
  // Func="TouchEvent::PrefEnabled",
  // CheckAnyPermissions="browser"]
  //void sendTouchEvent(DOMString type,
  //                    sequence<unsigned long> identifiers,
  //                    sequence<long> x,
  //                    sequence<long> y,
  //                    sequence<unsigned long> rx,
  //                    sequence<unsigned long> ry,
  //                    sequence<float> rotationAngles,
  //                    sequence<float> forces,
  //                    unsigned long count,
  //                    unsigned long modifiers);

  [Func="Window::global_is_mozbrowser", Throws]
  void goBack();

  [Func="Window::global_is_mozbrowser", Throws]
  void goForward();

  [Func="Window::global_is_mozbrowser", Throws]
  void reload(optional boolean hardReload = false);

  [Func="Window::global_is_mozbrowser", Throws]
  void stop();

  //[Throws,
  // Pref="dom.mozBrowserFramesEnabled",
  // CheckAnyPermissions="browser"]
  //DOMRequest download(DOMString url,
  //                    optional BrowserElementDownloadOptions options);

  //[Throws,
  // Pref="dom.mozBrowserFramesEnabled",
  // CheckAnyPermissions="browser"]
  //DOMRequest purgeHistory();

  //[Throws,
  // Pref="dom.mozBrowserFramesEnabled",
  // CheckAnyPermissions="browser"]
{'fraction_non_alphanumeric': 0.1107533805537669, 'fraction_numerical': 0.0007359028608223715, 'mean_word_length': 3.1719109746738297, 'pattern_counts': {'":': 8, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '820868', 'n_tokens_mistral': 3115, 'n_tokens_neox': 2925, 'n_words': 744}