зеркало из https://github.com/mozilla/gecko-dev.git
Merging mozilla-central and mozilla-inbound.
This commit is contained in:
Коммит
fbfb5d07d2
|
@ -500,3 +500,6 @@ statuspanel[label=""] {
|
|||
.panel-inner-arrowcontentfooter[footertype="promobox"] {
|
||||
-moz-binding: url("chrome://browser/content/urlbarBindings.xml#promobox");
|
||||
}
|
||||
|
||||
/* highlighter */
|
||||
%include highlighter.css
|
||||
|
|
|
@ -1024,12 +1024,6 @@
|
|||
#endif
|
||||
|
||||
</vbox>
|
||||
# <iframe id="highlighter-frame"
|
||||
# transparent="true"
|
||||
# type="content"
|
||||
# src="chrome://content/base/highlighter.html"/> is dynamically appended as
|
||||
# the last child of #tab-view-deck, only when it is needed, for minimal
|
||||
# performance impact.
|
||||
# <iframe id="tab-view"> is dynamically appended as the 2nd child of #tab-view-deck.
|
||||
# Introducing the iframe dynamically, as needed, was found to be better than
|
||||
# starting with an empty iframe here in browser.xul from a Ts standpoint.
|
||||
|
|
|
@ -0,0 +1,36 @@
|
|||
#highlighter-container {
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
#highlighter-controls {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
#highlighter-veil-container {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.highlighter-veil,
|
||||
#highlighter-veil-middlebox,
|
||||
#highlighter-veil-transparentbox {
|
||||
-moz-transition-property: width, height;
|
||||
-moz-transition-duration: 0.1s;
|
||||
-moz-transition-timing-function: linear;
|
||||
}
|
||||
|
||||
#highlighter-veil-bottombox,
|
||||
#highlighter-veil-rightbox {
|
||||
-moz-box-flex: 1;
|
||||
}
|
||||
|
||||
#highlighter-veil-middlebox:-moz-locale-dir(rtl) {
|
||||
-moz-box-direction: reverse;
|
||||
}
|
||||
|
||||
#highlighter-close-button {
|
||||
position: absolute;
|
||||
pointer-events: auto;
|
||||
z-index: 1;
|
||||
}
|
|
@ -1,63 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE html>
|
||||
<!-- ***** BEGIN LICENSE BLOCK *****
|
||||
- Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
-
|
||||
- The contents of this file are subject to the Mozilla Public License Version
|
||||
- 1.1 (the "License"); you may not use this file except in compliance with
|
||||
- the License. You may obtain a copy of the License at
|
||||
- http://www.mozilla.org/MPL/
|
||||
-
|
||||
- Software distributed under the License is distributed on an "AS IS" basis,
|
||||
- WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
- for the specific language governing rights and limitations under the
|
||||
- License.
|
||||
-
|
||||
- The Original Code is Inspector Highlighter code.
|
||||
-
|
||||
- The Initial Developer of the Original Code is The Mozilla Foundation.
|
||||
- Portions created by the Initial Developer are Copyright (C) 2011
|
||||
- the Initial Developer. All Rights Reserved.
|
||||
-
|
||||
- Contributor(s):
|
||||
- Rob Campbell <rcampbell@mozilla.com> (Original Author)
|
||||
- Paul Rouget <paul@mozilla.com>
|
||||
-
|
||||
- Alternatively, the contents of this file may be used under the terms of
|
||||
- either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
- the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
- in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
- of those above. If you wish to allow use of your version of this file only
|
||||
- under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
- use your version of this file under the terms of the MPL, indicate your
|
||||
- decision by deleting the provisions above and replace them with the notice
|
||||
- and other provisions required by the LGPL or the GPL. If you do not delete
|
||||
- the provisions above, a recipient may use your version of this file under
|
||||
- the terms of any one of the MPL, the GPL or the LGPL.
|
||||
-
|
||||
- ***** END LICENSE BLOCK ***** -->
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<link rel="stylesheet" href="chrome://browser/skin/highlighter.css" type="text/css"/>
|
||||
</head>
|
||||
<body>
|
||||
<div id="close-button" role="button" class="clickable"/>
|
||||
|
||||
<!--
|
||||
To darken the page around the selected node, we use black-transparent
|
||||
divs, organized in 3 rows, keeping the div in the middle transparent.
|
||||
-->
|
||||
<div id="veil-container">
|
||||
<div id="veil">
|
||||
<div id="veil-topbox" class="veil"/>
|
||||
<div id="veil-middlebox">
|
||||
<div id="veil-leftbox" class="veil"/>
|
||||
<div id="veil-transparentbox"/>
|
||||
<div id="veil-rightbox" class="veil"/>
|
||||
</div>
|
||||
<div id="veil-bottombox" class="veil"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -58,9 +58,6 @@ const INSPECTOR_INVISIBLE_ELEMENTS = {
|
|||
|
||||
// Inspector notifications dispatched through the nsIObserverService.
|
||||
const INSPECTOR_NOTIFICATIONS = {
|
||||
// Fires once the Inspector highlighter is initialized and ready for use.
|
||||
HIGHLIGHTER_READY: "highlighter-ready",
|
||||
|
||||
// Fires once the Inspector highlights an element in the page.
|
||||
HIGHLIGHTING: "inspector-highlighting",
|
||||
|
||||
|
@ -76,86 +73,153 @@ const INSPECTOR_NOTIFICATIONS = {
|
|||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
//// IFrameHighlighter
|
||||
//// Highlighter
|
||||
|
||||
/**
|
||||
* A highlighter mechanism using a transparent xul iframe.
|
||||
* A highlighter mechanism.
|
||||
*
|
||||
* The highlighter is built dynamically once the Inspector is invoked:
|
||||
* <stack id="highlighter-container">
|
||||
* <vbox id="highlighter-veil-container">...</vbox>
|
||||
* <box id="highlighter-controls>...</vbox>
|
||||
* </stack>
|
||||
*
|
||||
* @param nsIDOMNode aBrowser
|
||||
* The xul:browser object for the content window being highlighted.
|
||||
*/
|
||||
function IFrameHighlighter(aBrowser)
|
||||
function Highlighter(aBrowser)
|
||||
{
|
||||
this._init(aBrowser);
|
||||
}
|
||||
|
||||
IFrameHighlighter.prototype = {
|
||||
Highlighter.prototype = {
|
||||
|
||||
_init: function IFH__init(aBrowser)
|
||||
_init: function Highlighter__init(aBrowser)
|
||||
{
|
||||
this.browser = aBrowser;
|
||||
let stack = this.browser.parentNode;
|
||||
this.win = this.browser.contentWindow;
|
||||
this._highlighting = false;
|
||||
|
||||
let div = document.createElement("div");
|
||||
div.flex = 1;
|
||||
div.setAttribute("style", "pointer-events: none; -moz-user-focus: ignore");
|
||||
this.highlighterContainer = document.createElement("stack");
|
||||
this.highlighterContainer.id = "highlighter-container";
|
||||
|
||||
let iframe = document.createElement("iframe");
|
||||
iframe.setAttribute("id", "highlighter-frame");
|
||||
iframe.setAttribute("transparent", "true");
|
||||
iframe.setAttribute("type", "content");
|
||||
iframe.addEventListener("DOMTitleChanged", function(aEvent) {
|
||||
aEvent.stopPropagation();
|
||||
}, true);
|
||||
iframe.flex = 1;
|
||||
iframe.setAttribute("style", "-moz-user-focus: ignore");
|
||||
let veilBox = document.createElement("vbox");
|
||||
veilBox.id = "highlighter-veil-container";
|
||||
|
||||
this.listenOnce(iframe, "load", (function iframeLoaded() {
|
||||
this.iframeDoc = iframe.contentDocument;
|
||||
let controlsBox = document.createElement("box");
|
||||
controlsBox.id = "highlighter-controls";
|
||||
|
||||
this.veilTopDiv = this.iframeDoc.getElementById("veil-topbox");
|
||||
this.veilLeftDiv = this.iframeDoc.getElementById("veil-leftbox");
|
||||
this.veilMiddleDiv = this.iframeDoc.getElementById("veil-middlebox");
|
||||
this.veilTransparentDiv = this.iframeDoc.getElementById("veil-transparentbox");
|
||||
// The veil will make the whole page darker except
|
||||
// for the region of the selected box.
|
||||
this.buildVeil(veilBox);
|
||||
|
||||
let closeButton = this.iframeDoc.getElementById("close-button");
|
||||
this.listenOnce(closeButton, "click",
|
||||
InspectorUI.closeInspectorUI.bind(InspectorUI, false), false);
|
||||
// The controlsBox will host the different interactive
|
||||
// elements of the highlighter (buttons, toolbars, ...).
|
||||
this.buildControls(controlsBox);
|
||||
|
||||
this.browser.addEventListener("click", this, true);
|
||||
iframe.contentWindow.addEventListener("resize", this, false);
|
||||
this.handleResize();
|
||||
Services.obs.notifyObservers(null,
|
||||
INSPECTOR_NOTIFICATIONS.HIGHLIGHTER_READY, null);
|
||||
}).bind(this), true);
|
||||
this.highlighterContainer.appendChild(veilBox);
|
||||
this.highlighterContainer.appendChild(controlsBox);
|
||||
|
||||
iframe.setAttribute("src", "chrome://browser/content/highlighter.xhtml");
|
||||
stack.appendChild(this.highlighterContainer);
|
||||
|
||||
div.appendChild(iframe);
|
||||
stack.appendChild(div);
|
||||
this.iframe = iframe;
|
||||
this.iframeContainer = div;
|
||||
this.browser.addEventListener("resize", this, true);
|
||||
this.browser.addEventListener("scroll", this, true);
|
||||
|
||||
this.handleResize();
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Build the veil:
|
||||
*
|
||||
* <vbox id="highlighter-veil-container">
|
||||
* <box id="highlighter-veil-topbox" class="highlighter-veil"/>
|
||||
* <hbox id="highlighter-veil-middlebox">
|
||||
* <box id="highlighter-veil-leftbox" class="highlighter-veil"/>
|
||||
* <box id="highlighter-veil-transparentbox"/>
|
||||
* <box id="highlighter-veil-rightbox" class="highlighter-veil"/>
|
||||
* </hbox>
|
||||
* <box id="highlighter-veil-bottombox" class="highlighter-veil"/>
|
||||
* </vbox>
|
||||
*
|
||||
* @param nsIDOMNode aParent
|
||||
*/
|
||||
buildVeil: function Highlighter_buildVeil(aParent)
|
||||
{
|
||||
|
||||
// We will need to resize these boxes to surround a node.
|
||||
// See highlightRectangle().
|
||||
|
||||
this.veilTopBox = document.createElement("box");
|
||||
this.veilTopBox.id = "highlighter-veil-topbox";
|
||||
this.veilTopBox.className = "highlighter-veil";
|
||||
|
||||
this.veilMiddleBox = document.createElement("hbox");
|
||||
this.veilMiddleBox.id = "highlighter-veil-middlebox";
|
||||
|
||||
this.veilLeftBox = document.createElement("box");
|
||||
this.veilLeftBox.id = "highlighter-veil-leftbox";
|
||||
this.veilLeftBox.className = "highlighter-veil";
|
||||
|
||||
this.veilTransparentBox = document.createElement("box");
|
||||
this.veilTransparentBox.id = "highlighter-veil-transparentbox";
|
||||
|
||||
// We don't need any references to veilRightBox and veilBottomBox.
|
||||
// These boxes are automatically resized (flex=1)
|
||||
|
||||
let veilRightBox = document.createElement("box");
|
||||
veilRightBox.id = "highlighter-veil-rightbox";
|
||||
veilRightBox.className = "highlighter-veil";
|
||||
|
||||
let veilBottomBox = document.createElement("box");
|
||||
veilBottomBox.id = "highlighter-veil-bottombox";
|
||||
veilBottomBox.className = "highlighter-veil";
|
||||
|
||||
this.veilMiddleBox.appendChild(this.veilLeftBox);
|
||||
this.veilMiddleBox.appendChild(this.veilTransparentBox);
|
||||
this.veilMiddleBox.appendChild(veilRightBox);
|
||||
|
||||
aParent.appendChild(this.veilTopBox);
|
||||
aParent.appendChild(this.veilMiddleBox);
|
||||
aParent.appendChild(veilBottomBox);
|
||||
},
|
||||
|
||||
/**
|
||||
* Destroy the iframe and its nodes.
|
||||
* Build the controls:
|
||||
*
|
||||
* <box id="highlighter-close-button"/>
|
||||
*
|
||||
* @param nsIDOMNode aParent
|
||||
*/
|
||||
destroy: function IFH_destroy()
|
||||
buildControls: function Highlighter_buildControls(aParent)
|
||||
{
|
||||
this.browser.removeEventListener("click", this, true);
|
||||
let closeButton = document.createElement("box");
|
||||
closeButton.id = "highlighter-close-button";
|
||||
closeButton.appendChild(document.createElement("image"));
|
||||
|
||||
closeButton.setAttribute("onclick", "InspectorUI.closeInspectorUI(false);");
|
||||
|
||||
aParent.appendChild(closeButton);
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Destroy the nodes.
|
||||
*/
|
||||
destroy: function Highlighter_destroy()
|
||||
{
|
||||
this.browser.removeEventListener("scroll", this, true);
|
||||
this.browser.removeEventListener("resize", this, true);
|
||||
this._highlightRect = null;
|
||||
this._highlighting = false;
|
||||
this.veilTopDiv = null;
|
||||
this.veilLeftDiv = null;
|
||||
this.veilMiddleDiv = null;
|
||||
this.veilTransparentDiv = null;
|
||||
this.veilTopBox = null;
|
||||
this.veilLeftBox = null;
|
||||
this.veilMiddleBox = null;
|
||||
this.veilTransparentBox = null;
|
||||
this.node = null;
|
||||
this.iframeDoc = null;
|
||||
this.browser.parentNode.removeChild(this.iframeContainer);
|
||||
this.iframeContainer = null;
|
||||
this.iframe = null;
|
||||
this.highlighterContainer.parentNode.removeChild(this.highlighterContainer);
|
||||
this.highlighterContainer = null;
|
||||
this.win = null
|
||||
this.browser = null;
|
||||
},
|
||||
|
@ -174,7 +238,7 @@ IFrameHighlighter.prototype = {
|
|||
* @param boolean aScroll
|
||||
* Boolean determining whether to scroll or not.
|
||||
*/
|
||||
highlight: function IFH_highlight(aScroll)
|
||||
highlight: function Highlighter_highlight(aScroll)
|
||||
{
|
||||
// node is not set or node is not highlightable, bail
|
||||
if (!this.node || !this.isNodeHighlightable()) {
|
||||
|
@ -188,12 +252,6 @@ IFrameHighlighter.prototype = {
|
|||
left: clientRect.left,
|
||||
width: clientRect.width,
|
||||
height: clientRect.height};
|
||||
let oldRect = this._highlightRect;
|
||||
|
||||
if (oldRect && rect.top == oldRect.top && rect.left == oldRect.left &&
|
||||
rect.width == oldRect.width && rect.height == oldRect.height) {
|
||||
return; // same rectangle
|
||||
}
|
||||
|
||||
if (aScroll) {
|
||||
this.node.scrollIntoView();
|
||||
|
@ -248,7 +306,7 @@ IFrameHighlighter.prototype = {
|
|||
* @param object aParams
|
||||
* extra parameters object
|
||||
*/
|
||||
highlightNode: function IFH_highlightNode(aNode, aParams)
|
||||
highlightNode: function Highlighter_highlightNode(aNode, aParams)
|
||||
{
|
||||
this.node = aNode;
|
||||
this.highlight(aParams && aParams.scroll);
|
||||
|
@ -262,16 +320,23 @@ IFrameHighlighter.prototype = {
|
|||
* @returns boolean
|
||||
* True if the rectangle was highlighted, false otherwise.
|
||||
*/
|
||||
highlightRectangle: function IFH_highlightRectangle(aRect)
|
||||
highlightRectangle: function Highlighter_highlightRectangle(aRect)
|
||||
{
|
||||
let oldRect = this._highlightRect;
|
||||
|
||||
if (oldRect && aRect.top == oldRect.top && aRect.left == oldRect.left &&
|
||||
aRect.width == oldRect.width && aRect.height == oldRect.height) {
|
||||
return this._highlighting; // same rectangle
|
||||
}
|
||||
|
||||
if (aRect.left >= 0 && aRect.top >= 0 &&
|
||||
aRect.width > 0 && aRect.height > 0) {
|
||||
// The bottom div and the right div are flexibles (flex=1).
|
||||
// We don't need to resize them.
|
||||
this.veilTopDiv.style.height = aRect.top + "px";
|
||||
this.veilLeftDiv.style.width = aRect.left + "px";
|
||||
this.veilMiddleDiv.style.height = aRect.height + "px";
|
||||
this.veilTransparentDiv.style.width = aRect.width + "px";
|
||||
this.veilTopBox.style.height = aRect.top + "px";
|
||||
this.veilLeftBox.style.width = aRect.left + "px";
|
||||
this.veilMiddleBox.style.height = aRect.height + "px";
|
||||
this.veilTransparentBox.style.width = aRect.width + "px";
|
||||
|
||||
this._highlighting = true;
|
||||
} else {
|
||||
|
@ -286,11 +351,11 @@ IFrameHighlighter.prototype = {
|
|||
/**
|
||||
* Clear the highlighter surface.
|
||||
*/
|
||||
unhighlight: function IFH_unhighlight()
|
||||
unhighlight: function Highlighter_unhighlight()
|
||||
{
|
||||
this._highlighting = false;
|
||||
this.veilMiddleDiv.style.height = 0;
|
||||
this.veilTransparentDiv.style.width = 0;
|
||||
this.veilMiddleBox.style.height = 0;
|
||||
this.veilTransparentBox.style.width = 0;
|
||||
Services.obs.notifyObservers(null,
|
||||
INSPECTOR_NOTIFICATIONS.UNHIGHLIGHTING, null);
|
||||
},
|
||||
|
@ -305,7 +370,7 @@ IFrameHighlighter.prototype = {
|
|||
* @returns object
|
||||
* An object with x and y properties.
|
||||
*/
|
||||
midPoint: function IFH_midPoint(aPointA, aPointB)
|
||||
midPoint: function Highlighter_midPoint(aPointA, aPointB)
|
||||
{
|
||||
let pointC = { };
|
||||
pointC.x = (aPointB.x - aPointA.x) / 2 + aPointA.x;
|
||||
|
@ -352,7 +417,7 @@ IFrameHighlighter.prototype = {
|
|||
* @returns boolean
|
||||
* True if the node is highlightable or false otherwise.
|
||||
*/
|
||||
isNodeHighlightable: function IFH_isNodeHighlightable()
|
||||
isNodeHighlightable: function Highlighter_isNodeHighlightable()
|
||||
{
|
||||
if (!this.node || this.node.nodeType != Node.ELEMENT_NODE) {
|
||||
return false;
|
||||
|
@ -364,29 +429,32 @@ IFrameHighlighter.prototype = {
|
|||
/////////////////////////////////////////////////////////////////////////
|
||||
//// Event Handling
|
||||
|
||||
attachInspectListeners: function IFH_attachInspectListeners()
|
||||
attachInspectListeners: function Highlighter_attachInspectListeners()
|
||||
{
|
||||
this.browser.addEventListener("mousemove", this, true);
|
||||
this.browser.addEventListener("click", this, true);
|
||||
this.browser.addEventListener("dblclick", this, true);
|
||||
this.browser.addEventListener("mousedown", this, true);
|
||||
this.browser.addEventListener("mouseup", this, true);
|
||||
},
|
||||
|
||||
detachInspectListeners: function IFH_detachInspectListeners()
|
||||
detachInspectListeners: function Highlighter_detachInspectListeners()
|
||||
{
|
||||
this.browser.removeEventListener("mousemove", this, true);
|
||||
this.browser.removeEventListener("click", this, true);
|
||||
this.browser.removeEventListener("dblclick", this, true);
|
||||
this.browser.removeEventListener("mousedown", this, true);
|
||||
this.browser.removeEventListener("mouseup", this, true);
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Generic event handler.
|
||||
*
|
||||
* @param nsIDOMEvent aEvent
|
||||
* The DOM event object.
|
||||
*/
|
||||
handleEvent: function IFH_handleEvent(aEvent)
|
||||
handleEvent: function Highlighter_handleEvent(aEvent)
|
||||
{
|
||||
switch (aEvent.type) {
|
||||
case "click":
|
||||
|
@ -404,54 +472,28 @@ IFrameHighlighter.prototype = {
|
|||
aEvent.stopPropagation();
|
||||
aEvent.preventDefault();
|
||||
break;
|
||||
case "scroll":
|
||||
this.highlight();
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Handle clicks on the iframe.
|
||||
* Handle clicks.
|
||||
*
|
||||
* @param nsIDOMEvent aEvent
|
||||
* The DOM event.
|
||||
*/
|
||||
handleClick: function IFH_handleClick(aEvent)
|
||||
handleClick: function Highlighter_handleClick(aEvent)
|
||||
{
|
||||
// Proxy the click event to the iframe.
|
||||
let x = aEvent.clientX;
|
||||
let y = aEvent.clientY;
|
||||
let frameWin = aEvent.view;
|
||||
while (frameWin != this.win) {
|
||||
if (frameWin.frameElement) {
|
||||
let frameRect = frameWin.frameElement.getBoundingClientRect();
|
||||
x += frameRect.left;
|
||||
y += frameRect.top;
|
||||
}
|
||||
frameWin = frameWin.parent;
|
||||
}
|
||||
|
||||
let element = this.iframeDoc.elementFromPoint(x, y);
|
||||
if (element && element.classList &&
|
||||
element.classList.contains("clickable")) {
|
||||
let newEvent = this.iframeDoc.createEvent("MouseEvents");
|
||||
newEvent.initMouseEvent(aEvent.type, aEvent.bubbles, aEvent.cancelable,
|
||||
this.iframeDoc.defaultView, aEvent.detail, aEvent.screenX,
|
||||
aEvent.screenY, x, y, aEvent.ctrlKey, aEvent.altKey, aEvent.shiftKey,
|
||||
aEvent.metaKey, aEvent.button, null);
|
||||
element.dispatchEvent(newEvent);
|
||||
aEvent.preventDefault();
|
||||
aEvent.stopPropagation();
|
||||
return;
|
||||
}
|
||||
|
||||
// Stop inspection when the user clicks on a node.
|
||||
if (InspectorUI.inspecting) {
|
||||
if (aEvent.button == 0) {
|
||||
let win = aEvent.target.ownerDocument.defaultView;
|
||||
InspectorUI.stopInspecting();
|
||||
win.focus();
|
||||
}
|
||||
aEvent.preventDefault();
|
||||
aEvent.stopPropagation();
|
||||
if (aEvent.button == 0) {
|
||||
let win = aEvent.target.ownerDocument.defaultView;
|
||||
InspectorUI.stopInspecting();
|
||||
win.focus();
|
||||
}
|
||||
aEvent.preventDefault();
|
||||
aEvent.stopPropagation();
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -460,12 +502,8 @@ IFrameHighlighter.prototype = {
|
|||
* @param nsiDOMEvent aEvent
|
||||
* The MouseEvent triggering the method.
|
||||
*/
|
||||
handleMouseMove: function IFH_handleMouseMove(aEvent)
|
||||
handleMouseMove: function Highlighter_handleMouseMove(aEvent)
|
||||
{
|
||||
if (!InspectorUI.inspecting) {
|
||||
return;
|
||||
}
|
||||
|
||||
let element = InspectorUI.elementFromPoint(aEvent.target.ownerDocument,
|
||||
aEvent.clientX, aEvent.clientY);
|
||||
if (element && element != this.node) {
|
||||
|
@ -476,69 +514,10 @@ IFrameHighlighter.prototype = {
|
|||
/**
|
||||
* Handle window resize events.
|
||||
*/
|
||||
handleResize: function IFH_handleResize()
|
||||
handleResize: function Highlighter_handleResize()
|
||||
{
|
||||
let style = this.iframeContainer.style;
|
||||
if (this.win.scrollMaxY && this.win.scrollbars.visible) {
|
||||
style.paddingRight = this.getScrollbarWidth() + "px";
|
||||
} else {
|
||||
style.paddingRight = 0;
|
||||
}
|
||||
if (this.win.scrollMaxX && this.win.scrollbars.visible) {
|
||||
style.paddingBottom = this.getScrollbarWidth() + "px";
|
||||
} else {
|
||||
style.paddingBottom = 0;
|
||||
}
|
||||
|
||||
this.highlight();
|
||||
},
|
||||
|
||||
/**
|
||||
* Determine the scrollbar width in the current document.
|
||||
*
|
||||
* @returns number
|
||||
* The scrollbar width in pixels.
|
||||
*/
|
||||
getScrollbarWidth: function IFH_getScrollbarWidth()
|
||||
{
|
||||
if (this._scrollbarWidth) {
|
||||
return this._scrollbarWidth;
|
||||
}
|
||||
|
||||
let hbox = document.createElement("hbox");
|
||||
hbox.setAttribute("style", "height: 0%; overflow: hidden");
|
||||
|
||||
let scrollbar = document.createElement("scrollbar");
|
||||
scrollbar.setAttribute("orient", "vertical");
|
||||
hbox.appendChild(scrollbar);
|
||||
|
||||
document.documentElement.appendChild(hbox);
|
||||
this._scrollbarWidth = scrollbar.clientWidth;
|
||||
document.documentElement.removeChild(hbox);
|
||||
|
||||
return this._scrollbarWidth;
|
||||
},
|
||||
|
||||
/**
|
||||
* Helper to listen for an event only once.
|
||||
*
|
||||
* @param nsIDOMEventTarget aTarget
|
||||
* The DOM event target you want to add an event listener to.
|
||||
* @param string aName
|
||||
* The event name you want to listen for.
|
||||
* @param function aCallback
|
||||
* The function you want to execute once for the given event.
|
||||
* @param boolean aCapturing
|
||||
* Tells if you want to use capture for the event listener.
|
||||
* @returns void
|
||||
*/
|
||||
listenOnce: function IFH_listenOnce(aTarget, aName, aCallback, aCapturing)
|
||||
{
|
||||
aTarget.addEventListener(aName, function listenOnce_handler(aEvent) {
|
||||
aTarget.removeEventListener(aName, listenOnce_handler, aCapturing);
|
||||
aCallback.call(this, aEvent);
|
||||
}, aCapturing);
|
||||
},
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
@ -785,7 +764,6 @@ var InspectorUI = {
|
|||
|
||||
this.openTreePanel();
|
||||
|
||||
this.browser.addEventListener("scroll", this, true);
|
||||
this.inspectCmd.setAttribute("checked", true);
|
||||
},
|
||||
|
||||
|
@ -794,9 +772,8 @@ var InspectorUI = {
|
|||
*/
|
||||
initializeHighlighter: function IUI_initializeHighlighter()
|
||||
{
|
||||
Services.obs.addObserver(this.highlighterReady,
|
||||
INSPECTOR_NOTIFICATIONS.HIGHLIGHTER_READY, false);
|
||||
this.highlighter = new IFrameHighlighter(this.browser);
|
||||
this.highlighter = new Highlighter(this.browser);
|
||||
this.highlighterReady();
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -857,7 +834,6 @@ var InspectorUI = {
|
|||
gBrowser.tabContainer.removeEventListener("TabSelect", this, false);
|
||||
}
|
||||
|
||||
this.browser.removeEventListener("scroll", this, true);
|
||||
this.stopInspecting();
|
||||
if (this.highlighter) {
|
||||
this.highlighter.destroy();
|
||||
|
@ -953,7 +929,7 @@ var InspectorUI = {
|
|||
/////////////////////////////////////////////////////////////////////////
|
||||
//// Event Handling
|
||||
|
||||
notifyReady: function IUI_notifyReady()
|
||||
highlighterReady: function IUI_highlighterReady()
|
||||
{
|
||||
// Setup the InspectorStore or restore state
|
||||
this.initializeStore();
|
||||
|
@ -966,13 +942,6 @@ var InspectorUI = {
|
|||
Services.obs.notifyObservers(null, INSPECTOR_NOTIFICATIONS.OPENED, null);
|
||||
},
|
||||
|
||||
highlighterReady: function IUI_highlighterReady()
|
||||
{
|
||||
Services.obs.removeObserver(InspectorUI.highlighterReady,
|
||||
INSPECTOR_NOTIFICATIONS.HIGHLIGHTER_READY, false);
|
||||
InspectorUI.notifyReady();
|
||||
},
|
||||
|
||||
/**
|
||||
* Main callback handler for events.
|
||||
*
|
||||
|
@ -1040,9 +1009,6 @@ var InspectorUI = {
|
|||
break;
|
||||
}
|
||||
break;
|
||||
case "scroll":
|
||||
this.highlighter.highlight();
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -30,7 +30,6 @@ browser.jar:
|
|||
* content/browser/browser.xul (content/browser.xul)
|
||||
* content/browser/browser-tabPreviews.xml (content/browser-tabPreviews.xml)
|
||||
* content/browser/fullscreen-video.xhtml (content/fullscreen-video.xhtml)
|
||||
content/browser/highlighter.xhtml (content/highlighter.xhtml)
|
||||
* content/browser/inspector.html (content/inspector.html)
|
||||
* content/browser/scratchpad.xul (content/scratchpad.xul)
|
||||
* content/browser/scratchpad.js (content/scratchpad.js)
|
||||
|
|
|
@ -1935,3 +1935,27 @@ panel[dimmed="true"] {
|
|||
border-top-left-radius: .3em;
|
||||
margin-left: 1em;
|
||||
}
|
||||
|
||||
/* Highlighter */
|
||||
|
||||
.highlighter-veil {
|
||||
background-color: rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
|
||||
#highlighter-close-button {
|
||||
list-style-image: url("chrome://browser/skin/KUI-close.png");
|
||||
top: 12px;
|
||||
right: 12px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#highlighter-close-button:-moz-locale-dir(rtl) {
|
||||
right: auto;
|
||||
left: 12px;
|
||||
}
|
||||
|
||||
#highlighter-veil-transparentbox {
|
||||
box-shadow: 0 0 0 1px rgba(0,0,0,0.5);
|
||||
outline: 1px dashed rgba(255,255,255,0.5);
|
||||
outline-offset: -1px;
|
||||
}
|
||||
|
|
|
@ -1,104 +0,0 @@
|
|||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is the Mozilla Inspector Module.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* The Mozilla Foundation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2011
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Rob Campbell <rcampbell@mozilla.com> (original author)
|
||||
* Paul Rouget <paul@mozilla.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#close-button {
|
||||
background-image: url("KUI-close.png");
|
||||
border: none;
|
||||
padding: 0;
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
position: fixed;
|
||||
top: 12px;
|
||||
right: 12px;
|
||||
z-index: 1;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.veil {
|
||||
background-color: rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
|
||||
.veil, #veil-middlebox, #veil-transparentbox {
|
||||
-moz-transition: 0.1s;
|
||||
-moz-transition-timing-function: linear;
|
||||
}
|
||||
|
||||
#veil-container {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
#veil {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: -moz-box;
|
||||
-moz-box-orient: vertical;
|
||||
}
|
||||
|
||||
#veil-topbox, #veil-bottombox {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#veil-bottombox {
|
||||
-moz-box-flex: 1;
|
||||
}
|
||||
|
||||
#veil-middlebox {
|
||||
display: -moz-box;
|
||||
-moz-box-orient: horizontal;
|
||||
}
|
||||
|
||||
#veil-leftbox, #veil-rightbox {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
#veil-rightbox {
|
||||
-moz-box-flex: 1;
|
||||
}
|
||||
|
||||
#veil {
|
||||
vertical-align: top;
|
||||
}
|
|
@ -17,7 +17,6 @@ browser.jar:
|
|||
skin/classic/browser/Geolocation-16.png
|
||||
skin/classic/browser/Geolocation-64.png
|
||||
skin/classic/browser/Go-arrow.png
|
||||
* skin/classic/browser/highlighter.css
|
||||
skin/classic/browser/identity.png
|
||||
skin/classic/browser/Info.png
|
||||
skin/classic/browser/KUI-close.png
|
||||
|
|
|
@ -2508,3 +2508,28 @@ panel[dimmed="true"] {
|
|||
border-top-left-radius: .3em;
|
||||
margin-left: 1em;
|
||||
}
|
||||
|
||||
|
||||
/* Highlighter */
|
||||
|
||||
.highlighter-veil {
|
||||
background-color: rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
|
||||
#highlighter-close-button {
|
||||
list-style-image: url("chrome://browser/skin/KUI-close.png");
|
||||
top: 12px;
|
||||
right: 12px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#highlighter-close-button:-moz-locale-dir(rtl) {
|
||||
right: auto;
|
||||
left: 12px;
|
||||
}
|
||||
|
||||
#highlighter-veil-transparentbox {
|
||||
box-shadow: 0 0 0 1px rgba(0,0,0,0.5);
|
||||
outline: 1px dashed rgba(255,255,255,0.5);
|
||||
outline-offset: -1px;
|
||||
}
|
||||
|
|
|
@ -1,104 +0,0 @@
|
|||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is the Mozilla Inspector Module.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* The Mozilla Foundation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2011
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Rob Campbell <rcampbell@mozilla.com> (original author)
|
||||
* Paul Rouget <paul@mozilla.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#close-button {
|
||||
background-image: url("KUI-close.png");
|
||||
border: none;
|
||||
padding: 0;
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
position: fixed;
|
||||
top: 12px;
|
||||
right: 12px;
|
||||
z-index: 1;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.veil {
|
||||
background-color: rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
|
||||
.veil, #veil-middlebox, #veil-transparentbox {
|
||||
-moz-transition: 0.1s;
|
||||
-moz-transition-timing-function: linear;
|
||||
}
|
||||
|
||||
#veil-container {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
#veil {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: -moz-box;
|
||||
-moz-box-orient: vertical;
|
||||
}
|
||||
|
||||
#veil-topbox, #veil-bottombox {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#veil-bottombox {
|
||||
-moz-box-flex: 1;
|
||||
}
|
||||
|
||||
#veil-middlebox {
|
||||
display: -moz-box;
|
||||
-moz-box-orient: horizontal;
|
||||
}
|
||||
|
||||
#veil-leftbox, #veil-rightbox {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
#veil-rightbox {
|
||||
-moz-box-flex: 1;
|
||||
}
|
||||
|
||||
#veil {
|
||||
vertical-align: top;
|
||||
}
|
|
@ -15,7 +15,6 @@ browser.jar:
|
|||
skin/classic/browser/Geolocation-16.png
|
||||
skin/classic/browser/Geolocation-64.png
|
||||
skin/classic/browser/Go-arrow.png
|
||||
* skin/classic/browser/highlighter.css
|
||||
skin/classic/browser/home.png
|
||||
skin/classic/browser/hud-style-check-box-checked.png
|
||||
skin/classic/browser/hud-style-check-box-empty.png
|
||||
|
|
|
@ -2434,3 +2434,27 @@ panel[dimmed="true"] {
|
|||
border-top-left-radius: .3em;
|
||||
margin-left: 1em;
|
||||
}
|
||||
|
||||
/* Highlighter */
|
||||
|
||||
.highlighter-veil {
|
||||
background-color: rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
|
||||
#highlighter-close-button {
|
||||
list-style-image: url("chrome://browser/skin/KUI-close.png");
|
||||
top: 12px;
|
||||
right: 12px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#highlighter-close-button:-moz-locale-dir(rtl) {
|
||||
right: auto;
|
||||
left: 12px;
|
||||
}
|
||||
|
||||
#highlighter-veil-transparentbox {
|
||||
box-shadow: 0 0 0 1px rgba(0,0,0,0.5);
|
||||
outline: 1px dashed rgba(255,255,255,0.5);
|
||||
outline-offset: -1px;
|
||||
}
|
||||
|
|
|
@ -1,105 +0,0 @@
|
|||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is the Mozilla Inspector Module.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* The Mozilla Foundation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2011
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Rob Campbell <rcampbell@mozilla.com> (original author)
|
||||
* Paul Rouget <paul@mozilla.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#close-button {
|
||||
background-image: url("KUI-close.png");
|
||||
border: none;
|
||||
padding: 0;
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
position: fixed;
|
||||
top: 12px;
|
||||
right: 12px;
|
||||
z-index: 1;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.veil {
|
||||
background-color: rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
|
||||
.veil, #veil-middlebox, #veil-transparentbox {
|
||||
-moz-transition: 0.1s;
|
||||
-moz-transition-timing-function: linear;
|
||||
}
|
||||
|
||||
#veil-container {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
#veil {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: -moz-box;
|
||||
-moz-box-orient: vertical;
|
||||
}
|
||||
|
||||
#veil-topbox, #veil-bottombox {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#veil-bottombox {
|
||||
-moz-box-flex: 1;
|
||||
}
|
||||
|
||||
#veil-middlebox {
|
||||
display: -moz-box;
|
||||
-moz-box-orient: horizontal;
|
||||
}
|
||||
|
||||
#veil-leftbox, #veil-rightbox {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
#veil-rightbox {
|
||||
-moz-box-flex: 1;
|
||||
}
|
||||
|
||||
#veil {
|
||||
vertical-align: top;
|
||||
}
|
||||
|
|
@ -19,7 +19,6 @@ browser.jar:
|
|||
skin/classic/browser/fullscreen-video.css
|
||||
skin/classic/browser/Geolocation-16.png
|
||||
skin/classic/browser/Geolocation-64.png
|
||||
* skin/classic/browser/highlighter.css
|
||||
skin/classic/browser/Info.png (Info.png)
|
||||
skin/classic/browser/identity.png (identity.png)
|
||||
skin/classic/browser/keyhole-forward-mask.svg
|
||||
|
@ -134,7 +133,6 @@ browser.jar:
|
|||
skin/classic/aero/browser/fullscreen-video.css
|
||||
skin/classic/aero/browser/Geolocation-16.png
|
||||
skin/classic/aero/browser/Geolocation-64.png
|
||||
* skin/classic/aero/browser/highlighter.css
|
||||
skin/classic/aero/browser/Info.png (Info-aero.png)
|
||||
skin/classic/aero/browser/identity.png (identity-aero.png)
|
||||
skin/classic/aero/browser/keyhole-forward-mask.svg
|
||||
|
|
|
@ -46,6 +46,7 @@
|
|||
#include "nsServiceManagerUtils.h"
|
||||
#include "nsITimelineService.h"
|
||||
#include "nsPlatformCharset.h"
|
||||
#include "nsEncoderDecoderUtils.h"
|
||||
|
||||
static const char* kWinCharsets[][3] = {
|
||||
#include "wincharset.properties.h"
|
||||
|
@ -79,6 +80,7 @@ nsPlatformCharset::MapToCharset(nsAString& inANSICodePage, nsACString& outCharse
|
|||
NS_ARRAY_LENGTH(kWinCharsets), key, outCharset);
|
||||
if (NS_FAILED(rv)) {
|
||||
outCharset.AssignLiteral("windows-1252");
|
||||
return NS_SUCCESS_USING_FALLBACK_LOCALE;
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
|
|
@ -548,14 +548,6 @@ GC(JSContext *cx, uintN argc, jsval *vp)
|
|||
rt = cx->runtime;
|
||||
preBytes = rt->gcBytes;
|
||||
JS_GC(cx);
|
||||
fprintf(gOutFile, "before %lu, after %lu, break %08lx\n",
|
||||
(unsigned long)preBytes, (unsigned long)rt->gcBytes,
|
||||
#if defined(XP_UNIX) && !defined(__SYMBIAN32__)
|
||||
(unsigned long)sbrk(0)
|
||||
#else
|
||||
0
|
||||
#endif
|
||||
);
|
||||
#ifdef JS_GCMETER
|
||||
js_DumpGCStats(rt, stdout);
|
||||
#endif
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
<html xmlns="http://www.w3.org/1999/xhtml" style="width: 1px; white-space: pre-wrap;">y
|
||||
<style>
|
||||
|
||||
html:first-letter { }
|
||||
|
||||
</style><script>
|
||||
|
||||
window.addEventListener("load", function(){
|
||||
document.documentElement.offsetHeight;
|
||||
document.documentElement.style.direction = "rtl";
|
||||
document.documentElement.offsetHeight;
|
||||
document.documentElement.style.margin = "3em";
|
||||
document.documentElement.offsetHeight;
|
||||
}, false);
|
||||
|
||||
</script></html>
|
|
@ -0,0 +1,10 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<style>body:first-letter { float: left; }</style>
|
||||
</head>
|
||||
|
||||
<body style="white-space: pre-line;">ت
|
||||
</body>
|
||||
|
||||
</html>
|
|
@ -340,3 +340,5 @@ load 663295.html
|
|||
load 663662-1.html
|
||||
load 663662-2.html
|
||||
load 665837.html
|
||||
load 668941.xhtml
|
||||
load 670226.html
|
||||
|
|
|
@ -603,27 +603,30 @@ nsBidiPresUtils::ResolveParagraph(nsBlockFrame* aBlockFrame)
|
|||
// finished processing the current run, and that the current frame
|
||||
// doesn't have a fluid continuation (it could have a fluid continuation
|
||||
// of zero length, so testing runLength alone is not sufficient).
|
||||
if (numRun + 1 < runCount && runLength <= 0 && !frame->GetNextInFlow()) {
|
||||
nsIFrame* child = frame;
|
||||
nsIFrame* parent = frame->GetParent();
|
||||
// As long as we're on the last sibling, the parent doesn't have to be split.
|
||||
// However, if the parent has a fluid continuation, we do have to make
|
||||
// it non-fluid. This can happen e.g. when we have a first-letter frame
|
||||
// and the end of the first-letter coincides with the end of a
|
||||
// directional run.
|
||||
while (parent &&
|
||||
IsBidiSplittable(parent) &&
|
||||
!child->GetNextSibling()) {
|
||||
nsIFrame* next = parent->GetNextInFlow();
|
||||
if (next) {
|
||||
parent->SetNextContinuation(next);
|
||||
next->SetPrevContinuation(parent);
|
||||
if (runLength <= 0 && !frame->GetNextInFlow()) {
|
||||
if (numRun + 1 < runCount) {
|
||||
nsIFrame* child = frame;
|
||||
nsIFrame* parent = frame->GetParent();
|
||||
// As long as we're on the last sibling, the parent doesn't have to
|
||||
// be split.
|
||||
// However, if the parent has a fluid continuation, we do have to make
|
||||
// it non-fluid. This can happen e.g. when we have a first-letter
|
||||
// frame and the end of the first-letter coincides with the end of a
|
||||
// directional run.
|
||||
while (parent &&
|
||||
IsBidiSplittable(parent) &&
|
||||
!child->GetNextSibling()) {
|
||||
nsIFrame* next = parent->GetNextInFlow();
|
||||
if (next) {
|
||||
parent->SetNextContinuation(next);
|
||||
next->SetPrevContinuation(parent);
|
||||
}
|
||||
child = parent;
|
||||
parent = child->GetParent();
|
||||
}
|
||||
child = parent;
|
||||
parent = child->GetParent();
|
||||
if (parent && IsBidiSplittable(parent))
|
||||
SplitInlineAncestors(child);
|
||||
}
|
||||
if (parent && IsBidiSplittable(parent))
|
||||
SplitInlineAncestors(child);
|
||||
}
|
||||
else {
|
||||
// We're not at an end of a run. If |frame| is the last child of its
|
||||
|
@ -814,8 +817,13 @@ nsBidiPresUtils::TraverseFrames(nsBlockFrame* aBlockFrame,
|
|||
NS_MIN(end, endLine) - start));
|
||||
}
|
||||
|
||||
if (end < endLine) {
|
||||
mPrevContent = nsnull;
|
||||
break;
|
||||
}
|
||||
|
||||
PRBool createdContinuation = PR_FALSE;
|
||||
if (end >= endLine && PRUint32(endLine) < text.Length()) {
|
||||
if (PRUint32(endLine) < text.Length()) {
|
||||
/*
|
||||
* Timing is everything here: if the frame already has a bidi
|
||||
* continuation, we need to make the continuation fluid *before*
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Bug 670226</title>
|
||||
<style type="text/css">
|
||||
pre:first-letter { float:left; color: lime}
|
||||
pre { font-size: 16pt }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<pre dir="rtl">a+b
|
||||
c</pre>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,20 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Bug 670226</title>
|
||||
<style type="text/css">
|
||||
pre:first-letter { float:left; color: lime}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
function boom()
|
||||
{
|
||||
var p = document.getElementById("p");
|
||||
p.style.fontSize="16pt";
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body onload="boom()">
|
||||
<pre id="p" dir="rtl">a+b
|
||||
c</pre>
|
||||
</body>
|
||||
</html>
|
|
@ -82,3 +82,4 @@ fails-if(Android) == 386339.html 386339-ref.html
|
|||
== 612843-1.html 612843-1-ref.html
|
||||
== 613157-1.html 613157-1-ref.html
|
||||
== 613157-2.html 613157-2-ref.html
|
||||
== 670226-1.html 670226-1-ref.html
|
||||
|
|
|
@ -408,19 +408,23 @@ NON_OMNIJAR_FILES += \
|
|||
PACK_OMNIJAR = \
|
||||
rm -f omni.jar components/binary.manifest && \
|
||||
grep -h '^binary-component' components/*.manifest > binary.manifest ; \
|
||||
sed -e 's/^binary-component/\#binary-component/' components/components.manifest > components.manifest && \
|
||||
mv components.manifest components && \
|
||||
zip -r9m omni.jar $(OMNIJAR_FILES) -x $(NON_OMNIJAR_FILES) && \
|
||||
for m in components/*.manifest; do \
|
||||
sed -e 's/^binary-component/\#binary-component/' $$m > tmp.manifest && \
|
||||
mv tmp.manifest $$m; \
|
||||
done; \
|
||||
$(ZIP) -r9m omni.jar $(OMNIJAR_FILES) -x $(NON_OMNIJAR_FILES) && \
|
||||
$(GENERATE_CACHE) && \
|
||||
$(OPTIMIZE_JARS_CMD) --optimize $(JARLOG_DIR_AB_CD) ./ ./ && \
|
||||
mv binary.manifest components && \
|
||||
printf "manifest components/binary.manifest\n" > chrome.manifest
|
||||
UNPACK_OMNIJAR = \
|
||||
$(OPTIMIZE_JARS_CMD) --deoptimize $(JARLOG_DIR_AB_CD) ./ ./ && \
|
||||
unzip -o omni.jar && \
|
||||
$(UNZIP) -o omni.jar && \
|
||||
rm -f components/binary.manifest && \
|
||||
sed -e 's/^\#binary-component/binary-component/' components/components.manifest > components.manifest && \
|
||||
mv components.manifest components
|
||||
for m in components/*.manifest; do \
|
||||
sed -e 's/^\#binary-component/binary-component/' $$m > tmp.manifest && \
|
||||
mv tmp.manifest $$m; \
|
||||
done
|
||||
|
||||
MAKE_PACKAGE = (cd $(STAGEPATH)$(MOZ_PKG_DIR)$(_BINPATH) && $(PACK_OMNIJAR)) && \
|
||||
(cd $(STAGEPATH)$(MOZ_PKG_DIR)$(_BINPATH) && $(CREATE_PRECOMPLETE_CMD)) && $(INNER_MAKE_PACKAGE)
|
||||
|
|
Загрузка…
Ссылка в новой задаче