зеркало из https://github.com/mozilla/pjs.git
Bug 391158 – popup.xml & xul.css cleanup (remove obsolete bindings). r=enndeakin
This commit is contained in:
Родитель
45f9bdc3bb
Коммит
b359d4a567
|
@ -331,367 +331,6 @@
|
|||
]]></handler>
|
||||
</handlers>
|
||||
</binding>
|
||||
|
||||
<!-- XXXben this binding is not currently used -->
|
||||
<binding id="resizerbase" extends="xul:box">
|
||||
<implementation>
|
||||
<property name="popup">
|
||||
<getter>
|
||||
<![CDATA[
|
||||
var currNode = this.parentNode;
|
||||
while (currNode) {
|
||||
try {
|
||||
var bo = currNode.boxObject.QueryInterface(Components.interfaces.nsIPopupBoxObject);
|
||||
if (bo)
|
||||
return currNode;
|
||||
}
|
||||
catch (e) {
|
||||
}
|
||||
currNode = currNode.parentNode;
|
||||
}
|
||||
return null;
|
||||
]]>
|
||||
</getter>
|
||||
</property>
|
||||
|
||||
<method name="handleMouseMove">
|
||||
<parameter name="aEvent"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
||||
<field name="screenLeft">0</field>
|
||||
<field name="screenTop">0</field>
|
||||
<field name="resizerDirection">0</field>
|
||||
</implementation>
|
||||
|
||||
<handlers>
|
||||
<handler event="mousedown" phase="capturing">
|
||||
<![CDATA[
|
||||
var popup = event.target.popup;
|
||||
var boxObject = popup.boxObject;
|
||||
boxObject.captureMouseEvents = true;
|
||||
event.target.screenLeft = event.screenX;
|
||||
event.target.screenTop = event.screenY;
|
||||
event.target.setMode();
|
||||
event.preventDefault();
|
||||
]]>
|
||||
</handler>
|
||||
<handler event="mouseup" phase="capturing">
|
||||
<![CDATA[
|
||||
var popup = event.target.popup;
|
||||
var boxObject = popup.boxObject;
|
||||
boxObject.captureMouseEvents = false;
|
||||
event.target.screenLeft = event.screenX;
|
||||
event.target.screenTop = event.screenY;
|
||||
event.target.direction = 0;
|
||||
event.preventDefault();
|
||||
]]>
|
||||
</handler>
|
||||
<handler event="mousemove" phase="capturing">
|
||||
<![CDATA[
|
||||
event.target.handleMouseMove(event);
|
||||
event.preventDefault();
|
||||
]]>
|
||||
</handler>
|
||||
</handlers>
|
||||
</binding>
|
||||
|
||||
<!-- East-West resizer -->
|
||||
<binding id="ew-resizer" extends="xul:box"> <!-- extends="chrome://global/content/bindings/popup.xml#resizerbase"> -->
|
||||
<content>
|
||||
<xul:hbox class="ew-resizer-box" flex="1"/>
|
||||
</content>
|
||||
<!--
|
||||
<implementation>
|
||||
<method name="handleMouseMove">
|
||||
<parameter name="aEvent"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
var boxObject = aEvent.target.boxObject;
|
||||
if (boxObject.captureMouseEvents && this.resizerDirection == "right") {
|
||||
var delta = aEvent.screenX - this.screenLeft;
|
||||
this.screenLeft = aEvent.screenX;
|
||||
|
||||
// We can set this directly as we're only modifying one dimension
|
||||
aEvent.target.width += delta;
|
||||
}
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
<method name="setMode">
|
||||
<body>
|
||||
<![CDATA[
|
||||
this.resizerDirection = "right";
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
</implementation>
|
||||
-->
|
||||
</binding>
|
||||
|
||||
<!-- North-South resizer -->
|
||||
<binding id="ns-resizer" extends="xul:box"> <!-- extends="chrome://global/content/bindings/popup.xml#resizerbase"> -->
|
||||
<content>
|
||||
<xul:hbox class="ns-resizer-box" flex="1"/>
|
||||
</content>
|
||||
<!--
|
||||
<implementation>
|
||||
<method name="handleMouseMove">
|
||||
<parameter name="aEvent"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
var boxObject = aEvent.target.boxObject;
|
||||
if (boxObject.captureMouseEvents && this.resizerDirection == "bottom") {
|
||||
var delta = aEvent.screenY - this.screenTop;
|
||||
this.screenTop = aEvent.screenY;
|
||||
var currWidth = aEvent.target.boxObject.width;
|
||||
|
||||
// We can set this directly as we're only modifying one dimension
|
||||
aEvent.target.height += delta;
|
||||
}
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
<method name="setMode">
|
||||
<body>
|
||||
<![CDATA[
|
||||
this.resizerDirection = "bottom";
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
</implementation>
|
||||
-->
|
||||
</binding>
|
||||
|
||||
<!-- Diagonal resizer -->
|
||||
<binding id="diag-resizer" extends="xul:box"> <!-- extends="chrome://global/content/bindings/popup.xml#resizerbase"> -->
|
||||
<content>
|
||||
<xul:hbox class="diag-resizer-box" align="center" flex="1">
|
||||
<xul:image class="diag-resizer-image"/>
|
||||
</xul:hbox>
|
||||
</content>
|
||||
<!--
|
||||
<implementation>
|
||||
<method name="handleMouseMove">
|
||||
<parameter name="aEvent"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
var boxObject = aEvent.target.boxObject;
|
||||
if (boxObject.captureMouseEvents && this.resizerDirection == "bottomright") {
|
||||
if (!this.screenLeft || !this.screenTop) {
|
||||
this.screenLeft = aEvent.screenX;
|
||||
this.screenTop = aEvent.screenY;
|
||||
}
|
||||
var deltaX = aEvent.screenX - this.screenLeft;
|
||||
var deltaY = aEvent.screenY - this.screenTop;
|
||||
this.screenLeft = aEvent.screenX;
|
||||
this.screenTop = aEvent.screenY;
|
||||
var currWidth = aEvent.target.boxObject.width;
|
||||
var currHeight = aEvent.target.boxObject.height;
|
||||
aEvent.target.sizeTo(currWidth + deltaX, currHeight + deltaY);
|
||||
}
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
<method name="setMode">
|
||||
<body>
|
||||
<![CDATA[
|
||||
this.resizerDirection = "bottomright";
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
</implementation>
|
||||
-->
|
||||
</binding>
|
||||
|
||||
<binding id="titlebar" extends="xul:box"> <!-- extends="chrome://global/content/bindings/popup.xml#resizerbase"> -->
|
||||
<content>
|
||||
<xul:hbox class="titlebar-box" flex="1">
|
||||
<xul:hbox class="titlebar-title-box" flex="1" tooltiptext="Click and drag to float">
|
||||
<xul:label class="titlebar-title" xbl:inherits="value=title" flex="1" crop="right"/>
|
||||
</xul:hbox>
|
||||
<xul:button class="popupClose" tooltiptext="Close"/>
|
||||
</xul:hbox>
|
||||
</content>
|
||||
<!--
|
||||
<implementation>
|
||||
<method name="handleMouseMove">
|
||||
<parameter name="aEvent"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
if (!this.popup) this.popup = aEvent.target.popup;
|
||||
var boxObject = this.popup.boxObject;
|
||||
if (boxObject.captureMouseEvents && this.direction == "titlebar") {
|
||||
if (!this.screenLeft || !this.screenTop) {
|
||||
this.screenLeft = aEvent.screenX;
|
||||
this.screenTop = aEvent.screenY;
|
||||
}
|
||||
var deltaX = aEvent.screenX - this.screenLeft;
|
||||
var deltaY = aEvent.screenY - this.screenTop;
|
||||
this.screenLeft = aEvent.screenX;
|
||||
this.screenTop = aEvent.screenY;
|
||||
var currX = aEvent.target.boxObject.screenX;
|
||||
var currY = aEvent.target.boxObject.screenY;
|
||||
aEvent.target.moveTo(currX + deltaX, currY + deltaY);
|
||||
}
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
<method name="setMode">
|
||||
<body>
|
||||
<![CDATA[
|
||||
this.direction = "titlebar";
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
</implementation>
|
||||
-->
|
||||
</binding>
|
||||
|
||||
<binding id="floater-base" display="xul:popup" extends="chrome://global/content/bindings/popup.xml#popup">
|
||||
<implementation>
|
||||
|
||||
<!-- Popup Manipulation Constants -->
|
||||
<field name="MANIPULATE_NONE" readonly="true">0</field>
|
||||
<field name="MANIPULATE_MOVE" readonly="true">1</field>
|
||||
<field name="MANIPULATE_SIZE_EW" readonly="true">2</field>
|
||||
<field name="MANIPULATE_SIZE_NS" readonly="true">3</field>
|
||||
<field name="MANIPULATE_SIZE_DIAG" readonly="true">4</field>
|
||||
|
||||
<method name="handleMouseMove">
|
||||
<parameter name="aEvent"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
var boxObject = this.boxObject;
|
||||
if (boxObject.captureMouseEvents) {
|
||||
var dX, dY;
|
||||
var eScreenX = aEvent.screenX;
|
||||
var eScreenY = aEvent.screenY;
|
||||
switch (this.manipulateMode) {
|
||||
case this.MANIPULATE_SIZE_EW:
|
||||
var width = boxObject.width;
|
||||
dX = eScreenX - this.screenLeft;
|
||||
this.sizeTo(width + dX, this.height);
|
||||
break;
|
||||
case this.MANIPULATE_SIZE_NS:
|
||||
var height = boxObject.height;
|
||||
dY = eScreenY - this.screenTop;
|
||||
this.sizeTo(this.width, height + dY);
|
||||
break;
|
||||
case this.MANIPULATE_SIZE_DIAG:
|
||||
dX = eScreenX - this.screenLeft;
|
||||
dY = eScreenY - this.screenTop;
|
||||
this.sizeTo(this.width + dX, this.height + dY);
|
||||
break;
|
||||
case this.MANIPULATE_MOVE:
|
||||
// XXXben this may not yet be complete. When we drag away from the
|
||||
// owner, we set some properties to ensure that we aren't
|
||||
// positioned as a menu, automatically closed or steal
|
||||
// keyboard navigation in an inappropriate way.
|
||||
this.autoPosition = false;
|
||||
this.enableRollup(false);
|
||||
this.enableKeyboardNavigator(false);
|
||||
dX = eScreenX - this.screenLeft;
|
||||
dY = eScreenY - this.screenTop;
|
||||
this.moveTo(this.left + dX, this.top + dY);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
this.screenLeft = eScreenX;
|
||||
this.screenTop = eScreenY;
|
||||
}
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
<method name="findParentByLocalName">
|
||||
<parameter name="aNode"/>
|
||||
<parameter name="aLocalName"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
var parent = aNode;
|
||||
var names = [].concat(aLocalName);
|
||||
while (parent) {
|
||||
for (var i = 0; i < names.length; ++i) {
|
||||
if (parent.localName == names[i])
|
||||
return parent;
|
||||
}
|
||||
parent = parent.parentNode;
|
||||
}
|
||||
return null;
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
<method name="setMode">
|
||||
<parameter name="aEvent"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
var widget = this.findParentByLocalName(aEvent.originalTarget, ["resizer", "titlebar"]);
|
||||
if (widget) {
|
||||
if (widget.localName == "titlebar")
|
||||
this.manipulateMode = this.MANIPULATE_MOVE;
|
||||
else
|
||||
this.sizeDirection = widget.getAttribute("direction");
|
||||
}
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
<method name="cleanUp">
|
||||
<parameter name="aEvent"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
this.boxObject.captureMouseEvents = false;
|
||||
this.screenLeft = aEvent.screenX;
|
||||
this.screenTop = aEvent.screenY;
|
||||
this.manipulateMode = this.MANIPULATE_NONE;
|
||||
aEvent.preventDefault();
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
<field name="screenLeft">0</field>
|
||||
<field name="screenTop">0</field>
|
||||
<field name="manipulateMode">0</field>
|
||||
</implementation>
|
||||
<handlers>
|
||||
<handler event="mousedown" phase="capturing">
|
||||
<![CDATA[
|
||||
this.boxObject.captureMouseEvents = true;
|
||||
this.screenLeft = event.screenX;
|
||||
this.screenTop = event.screenY;
|
||||
this.setMode(event);
|
||||
]]>
|
||||
</handler>
|
||||
<handler event="mouseup" phase="capturing">
|
||||
<![CDATA[
|
||||
this.cleanUp(event);
|
||||
]]>
|
||||
</handler>
|
||||
<handler event="mousemove" phase="capturing">
|
||||
<![CDATA[
|
||||
this.handleMouseMove(event);
|
||||
event.preventDefault();
|
||||
]]>
|
||||
</handler>
|
||||
<!-- clean up, release the mouse, etc -->
|
||||
<handler event="popuphiding">
|
||||
<![CDATA[
|
||||
this.cleanUp(event);
|
||||
]]>
|
||||
</handler>
|
||||
<handler event="click">
|
||||
<![CDATA[
|
||||
// Hide the popup if the [X] box is clicked.
|
||||
// XXXben this may not really belong here, but rather in a derived binding.
|
||||
if (event.originalTarget.className.indexOf("popupClose") != -1)
|
||||
this.popupBoxObject.hidePopup();
|
||||
]]>
|
||||
</handler>
|
||||
</handlers>
|
||||
</binding>
|
||||
|
||||
<binding id="popup-scrollbars" extends="chrome://global/content/bindings/popup.xml#popup">
|
||||
<content>
|
||||
|
@ -701,48 +340,5 @@
|
|||
</content>
|
||||
</binding>
|
||||
|
||||
<binding id="floater-normal" extends="chrome://global/content/bindings/popup.xml#floater-base">
|
||||
<content xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" >
|
||||
<vbox class="floater-box" flex="1">
|
||||
<box class="floater-box-top">
|
||||
<titlebar flex="1" xbl:inherits="title" style="border: 1px outset grey; background-color: grey;"/>
|
||||
</box>
|
||||
<box class="floater-box-center" flex="1">
|
||||
<box class="floater-children" flex="1">
|
||||
<children/>
|
||||
</box>
|
||||
</box>
|
||||
<box class="floater-box-bottom">
|
||||
<resizer direction="bottom" flex="1"/>
|
||||
<resizer direction="bottomright" tooltiptext="Click and drag to resize"/>
|
||||
</box>
|
||||
</vbox>
|
||||
</content>
|
||||
</binding>
|
||||
|
||||
<binding id="floater-dock-left" extends="chrome://global/content/bindings/popup.xml#floater-base">
|
||||
<content xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" >
|
||||
<vbox class="floater-box" flex="1">
|
||||
<box class="floater-box-top">
|
||||
<titlebar flex="1" xbl:inherits="title"/>
|
||||
</box>
|
||||
<box class="floater-box-center" flex="1">
|
||||
<box class="floater-children" flex="1">
|
||||
<children/>
|
||||
</box>
|
||||
<resizer direction="right" tooltiptext="Click and drag to resize"/>
|
||||
</box>
|
||||
</vbox>
|
||||
</content>
|
||||
</binding>
|
||||
|
||||
<binding id="close-button" extends="chrome://global/content/bindings/button.xml#button-base">
|
||||
<content>
|
||||
<xul:hbox align="center" flex="1">
|
||||
<xul:image class="close-button-x"/>
|
||||
</xul:hbox>
|
||||
</content>
|
||||
</binding>
|
||||
|
||||
</bindings>
|
||||
|
||||
|
|
|
@ -21,13 +21,13 @@
|
|||
}
|
||||
|
||||
/* hide the content and destroy the frame */
|
||||
*[hidden="true"] {
|
||||
[hidden="true"] {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* hide the content, but don't destroy the frames */
|
||||
*[collapsed="true"],
|
||||
*[moz-collapsed="true"] {
|
||||
[collapsed="true"],
|
||||
[moz-collapsed="true"] {
|
||||
visibility: collapse;
|
||||
}
|
||||
|
||||
|
@ -43,8 +43,7 @@ window[chromehidden~="status"] .chromeclass-status,
|
|||
window[chromehidden~="extrachrome"] .chromeclass-extrachrome,
|
||||
window[chromehidden~="location"] .chromeclass-location,
|
||||
window[chromehidden~="location"][chromehidden~="toolbar"] .chromeclass-toolbar,
|
||||
window[chromehidden~="toolbar"] .chromeclass-toolbar-additional
|
||||
{
|
||||
window[chromehidden~="toolbar"] .chromeclass-toolbar-additional {
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
@ -53,8 +52,7 @@ window[chromehidden~="toolbar"] .chromeclass-toolbar-additional
|
|||
:: or URI elements
|
||||
::::: */
|
||||
|
||||
.uri-element
|
||||
{
|
||||
.uri-element {
|
||||
direction: ltr !important;
|
||||
}
|
||||
|
||||
|
@ -360,40 +358,6 @@ window[sizemode="maximized"] statusbarpanel.statusbar-resizerpanel {
|
|||
}
|
||||
%endif
|
||||
|
||||
/********** floating popups **********/
|
||||
|
||||
/*
|
||||
titlebar {
|
||||
-moz-binding: url("chrome://global/content/bindings/popup.xml#titlebar");
|
||||
}
|
||||
|
||||
resizer[resizerdirection="right"] {
|
||||
-moz-binding: url("chrome://global/content/bindings/popup.xml#ew-resizer");
|
||||
}
|
||||
|
||||
resizer[resizerdirection="bottom"] {
|
||||
-moz-binding: url("chrome://global/content/bindings/popup.xml#ns-resizer");
|
||||
}
|
||||
|
||||
resizer[resizerdirection="bottomright"] {
|
||||
-moz-binding: url("chrome://global/content/bindings/popup.xml#diag-resizer");
|
||||
}
|
||||
|
||||
floatingwindow {
|
||||
-moz-binding: url("chrome://global/content/bindings/popup.xml#floater-normal");
|
||||
-moz-box-orient: vertical;
|
||||
display: none;
|
||||
z-index: 2147483647;
|
||||
}
|
||||
|
||||
floatingwindow[docked="left"] {
|
||||
-moz-binding: url("chrome://global/content/bindings/popup.xml#floater-dock-left");
|
||||
}
|
||||
|
||||
button.popupClose {
|
||||
-moz-binding: url("chrome://global/content/bindings/popup.xml#close-button") !important;
|
||||
}
|
||||
*/
|
||||
/******** grid **********/
|
||||
|
||||
grid {
|
||||
|
@ -640,11 +604,11 @@ progressmeter {
|
|||
/********** basic rule for anonymous content that needs to pass box properties through
|
||||
********** to an insertion point parent that holds the real kids **************/
|
||||
|
||||
.box-inherit {
|
||||
-moz-box-orient: inherit;
|
||||
-moz-box-pack: inherit;
|
||||
-moz-box-align: inherit;
|
||||
-moz-box-direction: inherit;
|
||||
.box-inherit {
|
||||
-moz-box-orient: inherit;
|
||||
-moz-box-pack: inherit;
|
||||
-moz-box-align: inherit;
|
||||
-moz-box-direction: inherit;
|
||||
}
|
||||
|
||||
/********** label **********/
|
||||
|
@ -949,8 +913,7 @@ autorepeatbutton {
|
|||
|
||||
/********** statusbar **********/
|
||||
|
||||
statusbar
|
||||
{
|
||||
statusbar {
|
||||
-moz-binding: url("chrome://global/content/bindings/general.xml#statusbar");
|
||||
%ifdef XP_MACOSX
|
||||
padding-right: 14px;
|
||||
|
@ -1081,8 +1044,7 @@ radio[pane] {
|
|||
-moz-box-align: center;
|
||||
}
|
||||
|
||||
prefwindow[chromehidden~="toolbar"] .chromeclass-toolbar
|
||||
{
|
||||
prefwindow[chromehidden~="toolbar"] .chromeclass-toolbar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче