mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 764535 - Remove unused bindings. r=mbrubeck
This commit is contained in:
parent
0c2db95ab0
commit
70923532db
@ -3,86 +3,10 @@
|
|||||||
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
- 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/. -->
|
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
||||||
|
|
||||||
|
|
||||||
<bindings
|
<bindings
|
||||||
xmlns="http://www.mozilla.org/xbl"
|
xmlns="http://www.mozilla.org/xbl"
|
||||||
xmlns:xbl="http://www.mozilla.org/xbl"
|
|
||||||
xmlns:svg="http://www.w3.org/2000/svg"
|
|
||||||
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||||
|
|
||||||
<binding id="richlistbox-batch" extends="chrome://global/content/bindings/richlistbox.xml#richlistbox">
|
|
||||||
<handlers>
|
|
||||||
<handler event="scroll">
|
|
||||||
<![CDATA[
|
|
||||||
// if there no more items to insert, just return early
|
|
||||||
if (this._items.length == 0)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (this._contentScrollHeight == -1) {
|
|
||||||
let scrollheight = {};
|
|
||||||
this.scrollBoxObject.getScrolledSize({}, scrollheight);
|
|
||||||
this._contentScrollHeight = scrollheight.value;
|
|
||||||
}
|
|
||||||
|
|
||||||
let y = {};
|
|
||||||
this.scrollBoxObject.getPosition({}, y);
|
|
||||||
let scrollRatio = (y.value + this._childrenHeight) / this._contentScrollHeight;
|
|
||||||
|
|
||||||
// If we're scrolled 80% to the bottom of the list, append the next
|
|
||||||
// set of items
|
|
||||||
if (scrollRatio > 0.8)
|
|
||||||
this._insertItems();
|
|
||||||
]]>
|
|
||||||
</handler>
|
|
||||||
</handlers>
|
|
||||||
<implementation>
|
|
||||||
<!-- Number of elements to add to the list initially. If there are more
|
|
||||||
than this many elements to display, only add them to the list once
|
|
||||||
the user has scrolled towards them. This is a performance
|
|
||||||
optimization to avoid locking up while attempting to append hundreds
|
|
||||||
of nodes to our richlistbox.
|
|
||||||
-->
|
|
||||||
<property name="batchSize" readonly="true" onget="return this.getAttribute('batch')"/>
|
|
||||||
|
|
||||||
<field name="_childrenHeight">this.scrollBoxObject.height;</field>
|
|
||||||
<field name="_items">[]</field>
|
|
||||||
|
|
||||||
<method name="setItems">
|
|
||||||
<parameter name="aItems"/>
|
|
||||||
<body><![CDATA[
|
|
||||||
this._items = aItems;
|
|
||||||
this._insertItems();
|
|
||||||
]]></body>
|
|
||||||
</method>
|
|
||||||
|
|
||||||
<method name="_insertItems">
|
|
||||||
<body><![CDATA[
|
|
||||||
let items = this._items.splice(0, this.batchSize);
|
|
||||||
if (!items.length)
|
|
||||||
return; // no items to insert
|
|
||||||
|
|
||||||
let count = items.length;
|
|
||||||
for (let i = 0; i<count; i++)
|
|
||||||
this.appendChild(items[i]);
|
|
||||||
|
|
||||||
|
|
||||||
// make sure we recalculate the scrollHeight of the content
|
|
||||||
this._contentScrollHeight = -1;
|
|
||||||
]]></body>
|
|
||||||
</method>
|
|
||||||
</implementation>
|
|
||||||
</binding>
|
|
||||||
|
|
||||||
<binding id="richlistitem" extends="chrome://global/content/bindings/richlistbox.xml#richlistitem">
|
|
||||||
<handlers>
|
|
||||||
<handler event="mousedown" phase="capturing">
|
|
||||||
<![CDATA[
|
|
||||||
event.stopPropagation();
|
|
||||||
]]>
|
|
||||||
</handler>
|
|
||||||
</handlers>
|
|
||||||
</binding>
|
|
||||||
|
|
||||||
<binding id="menulist" display="xul:box" extends="chrome://global/content/bindings/menulist.xml#menulist">
|
<binding id="menulist" display="xul:box" extends="chrome://global/content/bindings/menulist.xml#menulist">
|
||||||
<handlers>
|
<handlers>
|
||||||
<handler event="mousedown" phase="capturing">
|
<handler event="mousedown" phase="capturing">
|
||||||
@ -113,129 +37,4 @@
|
|||||||
</handlers>
|
</handlers>
|
||||||
</binding>
|
</binding>
|
||||||
|
|
||||||
<binding id="textbox" extends="chrome://global/content/bindings/textbox.xml#textbox">
|
|
||||||
<handlers>
|
|
||||||
<handler event="TapLong" phase="capturing">
|
|
||||||
<![CDATA[
|
|
||||||
let box = this.inputField.parentNode;
|
|
||||||
box.showContextMenu(this, false);
|
|
||||||
]]>
|
|
||||||
</handler>
|
|
||||||
</handlers>
|
|
||||||
</binding>
|
|
||||||
|
|
||||||
<binding id="textarea" extends="chrome://global/content/bindings/textbox.xml#textarea">
|
|
||||||
<handlers>
|
|
||||||
<handler event="TapLong" phase="capturing">
|
|
||||||
<![CDATA[
|
|
||||||
let box = this.inputField.parentNode;
|
|
||||||
box.showContextMenu(this, false);
|
|
||||||
]]>
|
|
||||||
</handler>
|
|
||||||
</handlers>
|
|
||||||
</binding>
|
|
||||||
|
|
||||||
<binding id="timed-textbox" extends="chrome://global/content/bindings/textbox.xml#timed-textbox">
|
|
||||||
<handlers>
|
|
||||||
<handler event="TapLong" phase="capturing">
|
|
||||||
<![CDATA[
|
|
||||||
let box = this.inputField.parentNode;
|
|
||||||
box.showContextMenu(this, false);
|
|
||||||
]]>
|
|
||||||
</handler>
|
|
||||||
</handlers>
|
|
||||||
</binding>
|
|
||||||
|
|
||||||
<binding id="search-textbox" extends="chrome://global/content/bindings/textbox.xml#search-textbox">
|
|
||||||
<implementation>
|
|
||||||
<field name="_searchClear">
|
|
||||||
<![CDATA[
|
|
||||||
document.getAnonymousElementByAttribute(this, "class", "textbox-search-clear");
|
|
||||||
]]>
|
|
||||||
</field>
|
|
||||||
</implementation>
|
|
||||||
|
|
||||||
<handlers>
|
|
||||||
<handler event="TapLong" phase="capturing">
|
|
||||||
<![CDATA[
|
|
||||||
let box = this.inputField.parentNode;
|
|
||||||
box.showContextMenu(this, false);
|
|
||||||
]]>
|
|
||||||
</handler>
|
|
||||||
|
|
||||||
<handler event="text" phase="bubbling"><![CDATA[
|
|
||||||
// Listen for composition update, some VKB that does suggestions does not
|
|
||||||
// update directly the content of the field but in this case we want to
|
|
||||||
// search as soon as something is entered in the field
|
|
||||||
let evt = document.createEvent("Event");
|
|
||||||
evt.initEvent("input", true, false);
|
|
||||||
this.dispatchEvent(evt);
|
|
||||||
]]></handler>
|
|
||||||
|
|
||||||
<handler event="click" phase="bubbling"><![CDATA[
|
|
||||||
// bug 629661. To reset the autosuggestions mechanism of Android, the
|
|
||||||
// textfield need to reset the IME state
|
|
||||||
if (event.originalTarget == this._searchClear) {
|
|
||||||
setTimeout(function(self) {
|
|
||||||
try {
|
|
||||||
let imeEditor = self.inputField.QueryInterface(Ci.nsIDOMNSEditableElement)
|
|
||||||
.editor
|
|
||||||
.QueryInterface(Ci.nsIEditorIMESupport);
|
|
||||||
if (imeEditor.composing)
|
|
||||||
imeEditor.forceCompositionEnd();
|
|
||||||
} catch(e) {}
|
|
||||||
}, 0, this);
|
|
||||||
}
|
|
||||||
]]></handler>
|
|
||||||
</handlers>
|
|
||||||
</binding>
|
|
||||||
|
|
||||||
<binding id="numberbox" extends="chrome://global/content/bindings/numberbox.xml#numberbox">
|
|
||||||
<handlers>
|
|
||||||
<handler event="TapLong" phase="capturing">
|
|
||||||
<![CDATA[
|
|
||||||
let box = this.inputField.parentNode;
|
|
||||||
box.showContextMenu(this, false);
|
|
||||||
]]>
|
|
||||||
</handler>
|
|
||||||
</handlers>
|
|
||||||
</binding>
|
|
||||||
|
|
||||||
<binding id="input-box" extends="xul:box">
|
|
||||||
<implementation>
|
|
||||||
<method name="showContextMenu">
|
|
||||||
<parameter name="aTextbox"/>
|
|
||||||
<parameter name="aIgnoreReadOnly"/>
|
|
||||||
<body><![CDATA[
|
|
||||||
let selectionStart = aTextbox.selectionStart;
|
|
||||||
let selectionEnd = aTextbox.selectionEnd;
|
|
||||||
|
|
||||||
let json = { types: ["input-text"], string: "" };
|
|
||||||
if (selectionStart != selectionEnd) {
|
|
||||||
json.types.push("copy");
|
|
||||||
json.string = aTextbox.value.slice(selectionStart, selectionEnd);
|
|
||||||
} else if (aTextbox.value) {
|
|
||||||
json.types.push("copy-all");
|
|
||||||
json.string = aTextbox.value;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (selectionStart > 0 || selectionEnd < aTextbox.textLength)
|
|
||||||
json.types.push("select-all");
|
|
||||||
|
|
||||||
let clipboard = Cc["@mozilla.org/widget/clipboard;1"].getService(Ci.nsIClipboard);
|
|
||||||
let flavors = ["text/unicode"];
|
|
||||||
let hasData = clipboard.hasDataMatchingFlavors(flavors, flavors.length, Ci.nsIClipboard.kGlobalClipboard);
|
|
||||||
|
|
||||||
if (hasData && (!aTextbox.readOnly || aIgnoreReadOnly)) {
|
|
||||||
json.types.push("paste");
|
|
||||||
if (aTextbox.type == "url") {
|
|
||||||
json.types.push("paste-url");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ContextHelper.showPopup({ target: aTextbox, json: json });
|
|
||||||
]]></body>
|
|
||||||
</method>
|
|
||||||
</implementation>
|
|
||||||
</binding>
|
|
||||||
</bindings>
|
</bindings>
|
||||||
|
@ -1,109 +0,0 @@
|
|||||||
<?xml version="1.0"?>
|
|
||||||
<!-- 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/. -->
|
|
||||||
|
|
||||||
<bindings
|
|
||||||
xmlns="http://www.mozilla.org/xbl"
|
|
||||||
xmlns:xbl="http://www.mozilla.org/xbl"
|
|
||||||
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
|
||||||
|
|
||||||
<binding id="dialog">
|
|
||||||
<content orient="vertical" xbl:inherits="orient, closebutton" flex="1">
|
|
||||||
<children/>
|
|
||||||
</content>
|
|
||||||
|
|
||||||
<implementation implements="nsIDOMEventListener">
|
|
||||||
<field name="arguments"/>
|
|
||||||
<field name="parent"/>
|
|
||||||
<property name="_scrollbox" readonly="true" onget="return this.getElementsByTagName('scrollbox')[0];"/>
|
|
||||||
|
|
||||||
<constructor><![CDATA[
|
|
||||||
this._closed = false;
|
|
||||||
if (this.hasAttribute("script")) {
|
|
||||||
try {
|
|
||||||
Services.scriptloader.loadSubScript(this.getAttribute("script"), this);
|
|
||||||
} catch(e) {
|
|
||||||
throw("Dialog : Unable to load script : " + this.getAttribute("script") + "\n");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
window.addEventListener("unload", this, true);
|
|
||||||
|
|
||||||
let scrollbox = this._scrollbox;
|
|
||||||
if (scrollbox) {
|
|
||||||
window.addEventListener("resize", this, true);
|
|
||||||
scrollbox.addEventListener("overflow", this, true);
|
|
||||||
}
|
|
||||||
setTimeout(this.load.bind(this), 0);
|
|
||||||
]]></constructor>
|
|
||||||
|
|
||||||
<method name="handleEvent">
|
|
||||||
<parameter name="aEvent"/>
|
|
||||||
<body><![CDATA[
|
|
||||||
switch(aEvent.type) {
|
|
||||||
case "unload":
|
|
||||||
if (aEvent.originalTarget == document)
|
|
||||||
this._removeDialog();
|
|
||||||
break;
|
|
||||||
|
|
||||||
case "resize":
|
|
||||||
case "overflow":
|
|
||||||
let scrollbox = this._scrollbox;
|
|
||||||
let style = document.defaultView.getComputedStyle(scrollbox, null);
|
|
||||||
let newHeight = Math.ceil(scrollbox.firstChild.getBoundingClientRect().height) +
|
|
||||||
parseInt(style.marginTop) +
|
|
||||||
parseInt(style.marginBottom);
|
|
||||||
scrollbox.style.minHeight = Math.min(window.innerHeight / 2, newHeight) + "px";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
]]></body>
|
|
||||||
</method>
|
|
||||||
|
|
||||||
<method name="load">
|
|
||||||
<body><![CDATA[
|
|
||||||
if (this.hasAttribute("onload")) {
|
|
||||||
let func = new Function(this.getAttribute("onload"));
|
|
||||||
func.call(this);
|
|
||||||
}
|
|
||||||
]]></body>
|
|
||||||
</method>
|
|
||||||
|
|
||||||
<method name="close">
|
|
||||||
<body><![CDATA[
|
|
||||||
if (this.hasAttribute("onclose")) {
|
|
||||||
let func = new Function(this.getAttribute("onclose"));
|
|
||||||
func.call(this);
|
|
||||||
}
|
|
||||||
this._removeDialog();
|
|
||||||
]]></body>
|
|
||||||
</method>
|
|
||||||
|
|
||||||
<method name="_removeDialog">
|
|
||||||
<body><![CDATA[
|
|
||||||
window.removeEventListener("unload", this, true);
|
|
||||||
let scrollbox = this._scrollbox;
|
|
||||||
if (scrollbox) {
|
|
||||||
window.removeEventListener("resize", this, true);
|
|
||||||
scrollbox.removeEventListener("overflow", this, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.parentNode.parentNode.removeChild(this.parentNode);
|
|
||||||
this._closed = true;
|
|
||||||
|
|
||||||
// emit DOMModalDialogClosed event
|
|
||||||
let event = document.createEvent("Events");
|
|
||||||
event.initEvent("DOMModalDialogClosed", true, false);
|
|
||||||
let dispatcher = this.parent || getBrowser();
|
|
||||||
dispatcher.dispatchEvent(event);
|
|
||||||
]]></body>
|
|
||||||
</method>
|
|
||||||
|
|
||||||
<method name="waitForClose">
|
|
||||||
<body><![CDATA[
|
|
||||||
while (!this._closed)
|
|
||||||
Services.tm.currentThread.processNextEvent(true);
|
|
||||||
]]></body>
|
|
||||||
</method>
|
|
||||||
</implementation>
|
|
||||||
</binding>
|
|
||||||
</bindings>
|
|
@ -1,59 +0,0 @@
|
|||||||
/* 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/. */
|
|
||||||
|
|
||||||
radio {
|
|
||||||
-moz-binding: url("chrome://global/content/bindings/radio.xml#radio");
|
|
||||||
}
|
|
||||||
|
|
||||||
checkbox {
|
|
||||||
-moz-binding: url("chrome://browser/content/bindings/checkbox.xml#checkbox-radio");
|
|
||||||
}
|
|
||||||
|
|
||||||
menulist {
|
|
||||||
-moz-binding: url("chrome://browser/content/bindings.xml#menulist");
|
|
||||||
}
|
|
||||||
|
|
||||||
/* richlist defaults ------------------------------------------------------- */
|
|
||||||
richlistbox[batch] {
|
|
||||||
-moz-binding: url("chrome://browser/content/bindings.xml#richlistbox-batch");
|
|
||||||
}
|
|
||||||
|
|
||||||
richlistitem {
|
|
||||||
-moz-binding: url("chrome://browser/content/bindings.xml#richlistitem");
|
|
||||||
}
|
|
||||||
|
|
||||||
dialog {
|
|
||||||
-moz-binding: url("chrome://browser/content/bindings/dialog.xml#dialog");
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Do not allow these to inherit from the toolkit binding */
|
|
||||||
dialog.content-dialog {
|
|
||||||
-moz-binding: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Disable context menus in textboxes */
|
|
||||||
.textbox-input-box,
|
|
||||||
.textbox-input-box[spellcheck="true"] {
|
|
||||||
-moz-binding: url("chrome://browser/content/bindings.xml#input-box");
|
|
||||||
}
|
|
||||||
|
|
||||||
textbox {
|
|
||||||
-moz-binding: url("chrome://browser/content/bindings.xml#textbox");
|
|
||||||
}
|
|
||||||
|
|
||||||
textbox[multiline="true"] {
|
|
||||||
-moz-binding: url("chrome://browser/content/bindings.xml#textarea");
|
|
||||||
}
|
|
||||||
|
|
||||||
textbox[type="timed"] {
|
|
||||||
-moz-binding: url("chrome://browser/content/bindings.xml#timed-textbox");
|
|
||||||
}
|
|
||||||
|
|
||||||
textbox[type="search"] {
|
|
||||||
-moz-binding: url("chrome://browser/content/bindings.xml#search-textbox");
|
|
||||||
}
|
|
||||||
|
|
||||||
textbox[type="number"] {
|
|
||||||
-moz-binding: url("chrome://browser/content/bindings.xml#numberbox");
|
|
||||||
}
|
|
@ -28,8 +28,6 @@ chrome.jar:
|
|||||||
* content/bindings.xml (content/bindings.xml)
|
* content/bindings.xml (content/bindings.xml)
|
||||||
content/bindings/checkbox.xml (content/bindings/checkbox.xml)
|
content/bindings/checkbox.xml (content/bindings/checkbox.xml)
|
||||||
content/bindings/settings.xml (content/bindings/settings.xml)
|
content/bindings/settings.xml (content/bindings/settings.xml)
|
||||||
content/bindings/dialog.xml (content/bindings/dialog.xml)
|
|
||||||
content/browser.css (content/browser.css)
|
|
||||||
content/cursor.css (content/cursor.css)
|
content/cursor.css (content/cursor.css)
|
||||||
% content branding %content/branding/
|
% content branding %content/branding/
|
||||||
content/sanitize.js (content/sanitize.js)
|
content/sanitize.js (content/sanitize.js)
|
||||||
|
Loading…
Reference in New Issue
Block a user