fune/servo/components/script/dom/webidls/BrowserElement.webidl
Corey Farwell 78470eed15 servo: Merge #6777 - Cleanup lint special cases, refactor flake8 linting (from frewsxcv:refactor-tidy); r=jdm
Currently, there are a few linting functions that only run on certain
filetypes (determined by the file extension). Prior to this commit, the
special cases were handled in a parent function with a conditional. This
commit changes the system so each linting function gets passed a
filename so the function can determine whether it should run or not
based on the file extension.

I also refactored flake8 linting slightly. From what I've read so far of
the code, flake8 itself will only print the results directly to stdout
(though the linter would report the quantity of errors detected).
Prior to this commit, we would let flake8 print directly to stdout and
just determine if there were >0 errors reported. This commit (sort of
hackily) temporarily captures stdout when we call flake8 so we can do
what we want with the output, allowing us to `yield` the line number
and message like we do with the other linting functions.

In my opinion, both of these changes isolate specific behaviors/checks
into their respective linting functions instead of having them handled
at a more global level.

In addition to the changes above:

* The whitespace linter now runs on WebIDL and TOML files
* The license header linter now runs on WebIDL files

Source-Repo: https://github.com/servo/servo
Source-Revision: 7c8922c0c39616559b580b4a363ebe2a8c6b3ba8
2015-07-27 04:39:04 -06:00

139 lines
4.1 KiB
Text

/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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 ();
//dictionary BrowserElementDownloadOptions {
// DOMString? filename;
//};
[NoInterfaceObject]
interface BrowserElement {
};
BrowserElement implements BrowserElementCommon;
BrowserElement implements BrowserElementPrivileged;
[NoInterfaceObject]
interface BrowserElementCommon {
//[Throws,
// Pref="dom.mozBrowserFramesEnabled",
// CheckPermissions="browser embed-widgets"]
//void setVisible(boolean visible);
//[Throws,
// Pref="dom.mozBrowserFramesEnabled",
// CheckPermissions="browser embed-widgets"]
//DOMRequest getVisible();
//[Throws,
// Pref="dom.mozBrowserFramesEnabled",
// CheckPermissions="browser embed-widgets"]
//void addNextPaintListener(BrowserElementNextPaintEventCallback listener);
//[Throws,
// Pref="dom.mozBrowserFramesEnabled",
// CheckPermissions="browser embed-widgets"]
//void removeNextPaintListener(BrowserElementNextPaintEventCallback listener);
};
[NoInterfaceObject]
interface BrowserElementPrivileged {
//[Throws,
// Pref="dom.mozBrowserFramesEnabled",
// CheckPermissions="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",
// CheckPermissions="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.mozBrowserFramesEnabled",
CheckPermissions="browser"]
void goBack();
[Throws,
Pref="dom.mozBrowserFramesEnabled",
CheckPermissions="browser"]
void goForward();
[Throws,
Pref="dom.mozBrowserFramesEnabled",
CheckPermissions="browser"]
void reload(optional boolean hardReload = false);
[Throws,
Pref="dom.mozBrowserFramesEnabled",
CheckPermissions="browser"]
void stop();
//[Throws,
// Pref="dom.mozBrowserFramesEnabled",
// CheckPermissions="browser"]
//DOMRequest download(DOMString url,
// optional BrowserElementDownloadOptions options);
//[Throws,
// Pref="dom.mozBrowserFramesEnabled",
// CheckPermissions="browser"]
//DOMRequest purgeHistory();
//[Throws,
// Pref="dom.mozBrowserFramesEnabled",
// CheckPermissions="browser"]
//DOMRequest getScreenshot([EnforceRange] unsigned long width,
// [EnforceRange] unsigned long height,
// optional DOMString mimeType="");
//[Throws,
// Pref="dom.mozBrowserFramesEnabled",
// CheckPermissions="browser"]
//void zoom(float zoom);
//[Throws,
// Pref="dom.mozBrowserFramesEnabled",
// CheckPermissions="browser"]
//DOMRequest getCanGoBack();
//[Throws,
// Pref="dom.mozBrowserFramesEnabled",
// CheckPermissions="browser"]
//DOMRequest getCanGoForward();
//[Throws,
// Pref="dom.mozBrowserFramesEnabled",
// CheckPermissions="browser"]
//DOMRequest getContentDimensions();
//[Throws,
// Pref="dom.mozBrowserFramesEnabled",
// CheckPermissions="browser"]
//DOMRequest setInputMethodActive(boolean isActive);
// Additional |nfc-manager| permission is required for setNFCFocus API
//[Throws,
// Pref="dom.mozBrowserFramesEnabled",
// CheckPermissions="browser"]
//void setNFCFocus(boolean isFocus);
};