зеркало из https://github.com/mozilla/gecko-dev.git
Merge m-c -> e10s.
This commit is contained in:
Коммит
c4c08588db
|
@ -319,9 +319,12 @@ getCharacterExtentsCB(AtkText *aText, gint aOffset,
|
|||
else
|
||||
geckoCoordType = nsIAccessibleCoordinateType::COORDTYPE_WINDOW_RELATIVE;
|
||||
|
||||
nsresult rv = accText->GetCharacterExtents(aOffset, &extX, &extY,
|
||||
&extWidth, &extHeight,
|
||||
geckoCoordType);
|
||||
#ifdef DEBUG
|
||||
nsresult rv =
|
||||
#endif
|
||||
accText->GetCharacterExtents(aOffset, &extX, &extY,
|
||||
&extWidth, &extHeight,
|
||||
geckoCoordType);
|
||||
*aX = extX;
|
||||
*aY = extY;
|
||||
*aWidth = extWidth;
|
||||
|
@ -353,10 +356,13 @@ getRangeExtentsCB(AtkText *aText, gint aStartOffset, gint aEndOffset,
|
|||
else
|
||||
geckoCoordType = nsIAccessibleCoordinateType::COORDTYPE_WINDOW_RELATIVE;
|
||||
|
||||
nsresult rv = accText->GetRangeExtents(aStartOffset, aEndOffset,
|
||||
&extX, &extY,
|
||||
&extWidth, &extHeight,
|
||||
geckoCoordType);
|
||||
#ifdef DEBUG
|
||||
nsresult rv =
|
||||
#endif
|
||||
accText->GetRangeExtents(aStartOffset, aEndOffset,
|
||||
&extX, &extY,
|
||||
&extWidth, &extHeight,
|
||||
geckoCoordType);
|
||||
aRect->x = extX;
|
||||
aRect->y = extY;
|
||||
aRect->width = extWidth;
|
||||
|
|
|
@ -390,10 +390,14 @@ NS_IMPL_ISUPPORTS_INHERITED1(nsAccTextChangeEvent, nsAccEvent,
|
|||
nsAccTextChangeEvent::
|
||||
nsAccTextChangeEvent(nsAccessible *aAccessible, PRInt32 aStart,
|
||||
nsAString& aModifiedText, PRBool aIsInserted,
|
||||
PRBool aIsAsynch, EIsFromUserInput aIsFromUserInput) :
|
||||
nsAccEvent(aIsInserted ? nsIAccessibleEvent::EVENT_TEXT_INSERTED : nsIAccessibleEvent::EVENT_TEXT_REMOVED,
|
||||
aAccessible, aIsAsynch, aIsFromUserInput, eAllowDupes),
|
||||
mStart(aStart), mIsInserted(aIsInserted), mModifiedText(aModifiedText)
|
||||
PRBool aIsAsynch, EIsFromUserInput aIsFromUserInput)
|
||||
: nsAccEvent(aIsInserted ?
|
||||
static_cast<PRUint32>(nsIAccessibleEvent::EVENT_TEXT_INSERTED) :
|
||||
static_cast<PRUint32>(nsIAccessibleEvent::EVENT_TEXT_REMOVED),
|
||||
aAccessible, aIsAsynch, aIsFromUserInput, eAllowDupes)
|
||||
, mStart(aStart)
|
||||
, mIsInserted(aIsInserted)
|
||||
, mModifiedText(aModifiedText)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -103,6 +103,8 @@
|
|||
#include "nsIDOMCharacterData.h"
|
||||
#endif
|
||||
|
||||
#include "mozilla/unused.h"
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// nsAccessible. nsISupports
|
||||
|
@ -2885,7 +2887,7 @@ PRInt32
|
|||
nsAccessible::GetIndexInParent()
|
||||
{
|
||||
// XXX: call GetParent() to repair the tree if it's broken.
|
||||
nsAccessible* parent = GetParent();
|
||||
GetParent();
|
||||
return mIndexInParent;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/* vim:expandtab:shiftwidth=4:tabstop=4:
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim:expandtab:shiftwidth=2:tabstop=2:
|
||||
*/
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
|
@ -63,6 +63,8 @@ class nsApplicationAccessible: public nsAccessibleWrap,
|
|||
public nsIAccessibleApplication
|
||||
{
|
||||
public:
|
||||
using nsAccessible::GetChildAtPoint;
|
||||
|
||||
nsApplicationAccessible();
|
||||
|
||||
// nsISupports
|
||||
|
|
|
@ -55,6 +55,8 @@
|
|||
class nsLeafAccessible : public nsAccessibleWrap
|
||||
{
|
||||
public:
|
||||
using nsAccessible::GetChildAtPoint;
|
||||
|
||||
nsLeafAccessible(nsIContent *aContent, nsIWeakReference *aShell);
|
||||
|
||||
// nsISupports
|
||||
|
|
|
@ -1710,9 +1710,11 @@ nsDocAccessible::InvalidateCacheSubtree(nsIContent *aChild,
|
|||
aChangeType == nsIAccessibilityService::FRAME_SHOW ||
|
||||
aChangeType == nsIAccessibilityService::NODE_APPEND;
|
||||
|
||||
#ifdef DEBUG
|
||||
PRBool isChanging =
|
||||
aChangeType == nsIAccessibilityService::NODE_SIGNIFICANT_CHANGE ||
|
||||
aChangeType == nsIAccessibilityService::FRAME_SIGNIFICANT_CHANGE;
|
||||
#endif
|
||||
|
||||
NS_ASSERTION(isChanging || isHiding || isShowing,
|
||||
"Incorrect aChangeEventType passed in");
|
||||
|
|
|
@ -82,6 +82,8 @@ class nsDocAccessible : public nsHyperTextAccessibleWrap,
|
|||
NS_DECL_NSIOBSERVER
|
||||
|
||||
public:
|
||||
using nsAccessible::GetParent;
|
||||
|
||||
nsDocAccessible(nsIDocument *aDocument, nsIContent *aRootContent,
|
||||
nsIWeakReference* aShell);
|
||||
virtual ~nsDocAccessible();
|
||||
|
|
|
@ -81,8 +81,9 @@ private:
|
|||
*/
|
||||
class nsHTMLAreaAccessible : public nsHTMLLinkAccessible
|
||||
{
|
||||
|
||||
public:
|
||||
using nsAccessible::GetChildAtPoint;
|
||||
|
||||
nsHTMLAreaAccessible(nsIContent *aContent, nsIWeakReference *aShell);
|
||||
|
||||
// nsIAccessible
|
||||
|
|
|
@ -2137,7 +2137,7 @@ nsHyperTextAccessible::GetChildIndexAtOffset(PRUint32 aOffset)
|
|||
if (high == offsetCount)
|
||||
return -1;
|
||||
|
||||
return low < offsetCount - 1 ? low + 1 : low;
|
||||
return low;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -197,8 +197,8 @@ nsXULTreeAccessible::GetRoleInternal(PRUint32 *aRole)
|
|||
cols->GetPrimaryColumn(getter_AddRefs(primaryCol));
|
||||
|
||||
*aRole = primaryCol ?
|
||||
nsIAccessibleRole::ROLE_OUTLINE :
|
||||
nsIAccessibleRole::ROLE_LIST;
|
||||
static_cast<PRUint32>(nsIAccessibleRole::ROLE_OUTLINE) :
|
||||
static_cast<PRUint32>(nsIAccessibleRole::ROLE_LIST);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -989,8 +989,8 @@ nsXULTreeItemAccessibleBase::GetStateInternal(PRUint32 *aState,
|
|||
PRBool isContainerOpen;
|
||||
mTreeView->IsContainerOpen(mRow, &isContainerOpen);
|
||||
*aState |= isContainerOpen ?
|
||||
nsIAccessibleStates::STATE_EXPANDED:
|
||||
nsIAccessibleStates::STATE_COLLAPSED;
|
||||
static_cast<PRUint32>(nsIAccessibleStates::STATE_EXPANDED) :
|
||||
static_cast<PRUint32>(nsIAccessibleStates::STATE_COLLAPSED);
|
||||
}
|
||||
|
||||
// selected state
|
||||
|
@ -1178,8 +1178,8 @@ nsXULTreeItemAccessible::GetRoleInternal(PRUint32 *aRole)
|
|||
columns->GetPrimaryColumn(getter_AddRefs(primaryColumn));
|
||||
|
||||
*aRole = primaryColumn ?
|
||||
nsIAccessibleRole::ROLE_OUTLINEITEM :
|
||||
nsIAccessibleRole::ROLE_LISTITEM;
|
||||
static_cast<PRUint32>(nsIAccessibleRole::ROLE_OUTLINEITEM) :
|
||||
static_cast<PRUint32>(nsIAccessibleRole::ROLE_LISTITEM);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -64,6 +64,10 @@ const PRUint32 kDefaultTreeCacheSize = 256;
|
|||
class nsXULTreeAccessible : public nsXULSelectableAccessible
|
||||
{
|
||||
public:
|
||||
using nsAccessible::GetChildCount;
|
||||
using nsAccessible::GetChildAt;
|
||||
using nsAccessible::GetChildAtPoint;
|
||||
|
||||
nsXULTreeAccessible(nsIContent *aContent, nsIWeakReference *aShell);
|
||||
|
||||
// nsISupports and cycle collection
|
||||
|
@ -162,6 +166,8 @@ NS_DEFINE_STATIC_IID_ACCESSOR(nsXULTreeAccessible,
|
|||
class nsXULTreeItemAccessibleBase : public nsAccessibleWrap
|
||||
{
|
||||
public:
|
||||
using nsAccessible::GetParent;
|
||||
|
||||
nsXULTreeItemAccessibleBase(nsIContent *aContent, nsIWeakReference *aShell,
|
||||
nsAccessible *aParent, nsITreeBoxObject *aTree,
|
||||
nsITreeView *aTreeView, PRInt32 aRow);
|
||||
|
|
|
@ -586,8 +586,8 @@ nsXULTreeGridAccessible::GetRoleInternal(PRUint32 *aRole)
|
|||
treeColumns->GetPrimaryColumn(getter_AddRefs(primaryColumn));
|
||||
|
||||
*aRole = primaryColumn ?
|
||||
nsIAccessibleRole::ROLE_TREE_TABLE :
|
||||
nsIAccessibleRole::ROLE_TABLE;
|
||||
static_cast<PRUint32>(nsIAccessibleRole::ROLE_TREE_TABLE) :
|
||||
static_cast<PRUint32>(nsIAccessibleRole::ROLE_TABLE);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -75,6 +75,10 @@ protected:
|
|||
class nsXULTreeGridRowAccessible : public nsXULTreeItemAccessibleBase
|
||||
{
|
||||
public:
|
||||
using nsAccessible::GetChildCount;
|
||||
using nsAccessible::GetChildAt;
|
||||
using nsAccessible::GetChildAtPoint;
|
||||
|
||||
nsXULTreeGridRowAccessible(nsIContent *aContent, nsIWeakReference *aShell,
|
||||
nsAccessible *aParent, nsITreeBoxObject *aTree,
|
||||
nsITreeView *aTreeView, PRInt32 aRow);
|
||||
|
@ -127,6 +131,8 @@ class nsXULTreeGridCellAccessible : public nsLeafAccessible,
|
|||
public nsIAccessibleTableCell
|
||||
{
|
||||
public:
|
||||
using nsAccessible::GetParent;
|
||||
|
||||
nsXULTreeGridCellAccessible(nsIContent *aContent, nsIWeakReference *aShell,
|
||||
nsXULTreeGridRowAccessible *aRowAcc,
|
||||
nsITreeBoxObject *aTree, nsITreeView *aTreeView,
|
||||
|
|
|
@ -18,10 +18,16 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=428248
|
|||
<script type="application/javascript">
|
||||
var gParagraphAcc;
|
||||
|
||||
function testLinkIndexAtOffset(aID, aOffset, aIndex)
|
||||
{
|
||||
var htAcc = getAccessible(aID, [nsIAccessibleHyperText]);
|
||||
is(htAcc.getLinkIndexAtOffset(aOffset), aIndex,
|
||||
"Wrong link index at offset " + aOffset + " for ID " + aID + "!");
|
||||
}
|
||||
|
||||
function testThis(aID, aCharIndex, aExpectedLinkIndex, aName)
|
||||
{
|
||||
is(gParagraphAcc.getLinkIndexAtOffset(aCharIndex), aExpectedLinkIndex,
|
||||
"Wrong link index at offset " + aCharIndex + " for ID " + aID + "!");
|
||||
testLinkIndexAtOffset(gParagraphAcc, aCharIndex, aExpectedLinkIndex);
|
||||
|
||||
var linkAcc = gParagraphAcc.getLinkAt(aExpectedLinkIndex);
|
||||
ok(linkAcc, "No accessible for link " + aID + "!");
|
||||
|
@ -95,6 +101,27 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=428248
|
|||
is(linkIdx, jdx, "Wrong link index for 'p3'!");
|
||||
};
|
||||
|
||||
// getLinkIndexAtOffset, causes the offsets to be cached;
|
||||
testLinkIndexAtOffset("p4", 0, 0); // 1st 'mozilla' link
|
||||
testLinkIndexAtOffset("p4", 1, 1); // 2nd 'mozilla' link
|
||||
testLinkIndexAtOffset("p4", 2, -1); // ' ' of ' te' text node
|
||||
testLinkIndexAtOffset("p4", 3, -1); // 't' of ' te' text node
|
||||
testLinkIndexAtOffset("p4", 5, -1); // 'x' of 'xt ' text node
|
||||
testLinkIndexAtOffset("p4", 7, -1); // ' ' of 'xt ' text node
|
||||
testLinkIndexAtOffset("p4", 8, 2); // 3d 'mozilla' link
|
||||
testLinkIndexAtOffset("p4", 9, 2); // the end, latest link
|
||||
|
||||
// the second pass to make sure link indexes are calculated propertly from
|
||||
// cached offsets.
|
||||
testLinkIndexAtOffset("p4", 0, 0); // 1st 'mozilla' link
|
||||
testLinkIndexAtOffset("p4", 1, 1); // 2nd 'mozilla' link
|
||||
testLinkIndexAtOffset("p4", 2, -1); // ' ' of ' te' text node
|
||||
testLinkIndexAtOffset("p4", 3, -1); // 't' of ' te' text node
|
||||
testLinkIndexAtOffset("p4", 5, -1); // 'x' of 'xt ' text node
|
||||
testLinkIndexAtOffset("p4", 7, -1); // ' ' of 'xt ' text node
|
||||
testLinkIndexAtOffset("p4", 8, 2); // 3d 'mozilla' link
|
||||
testLinkIndexAtOffset("p4", 9, 2); // the end, latest link
|
||||
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
|
@ -150,5 +177,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=428248
|
|||
</p>
|
||||
<p id="p2"><a href="http://mozilla.org">mozilla.org</a></p>
|
||||
<p id="p3"></p>
|
||||
<p id="p4"><a href="www">mozilla</a><a href="www">mozilla</a><span> te</span><span>xt </span><a href="www">mozilla</a></p>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
xmlns:em="http://www.mozilla.org/2004/em-rdf#">
|
||||
<Description about="urn:mozilla:install-manifest">
|
||||
<em:id>testpilot@labs.mozilla.com</em:id>
|
||||
<em:version>1.0.1</em:version>
|
||||
<em:version>1.0.2</em:version>
|
||||
<em:type>2</em:type>
|
||||
|
||||
<!-- Target Application this extension can install into,
|
||||
|
@ -13,7 +13,7 @@
|
|||
<Description>
|
||||
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
|
||||
<em:minVersion>3.5</em:minVersion>
|
||||
<em:maxVersion>4.0b3</em:maxVersion>
|
||||
<em:maxVersion>4.0b4</em:maxVersion>
|
||||
</Description>
|
||||
</em:targetApplication>
|
||||
|
||||
|
|
|
@ -925,7 +925,7 @@ pref("dom.ipc.plugins.enabled", false);
|
|||
#ifndef WINCE
|
||||
pref("browser.taskbar.previews.enable", true);
|
||||
pref("browser.taskbar.previews.max", 20);
|
||||
pref("browser.taskbar.previews.cachetime", 20);
|
||||
pref("browser.taskbar.previews.cachetime", 5);
|
||||
pref("browser.taskbar.lists.enabled", true);
|
||||
pref("browser.taskbar.lists.frequent.enabled", true);
|
||||
pref("browser.taskbar.lists.recent.enabled", false);
|
||||
|
|
|
@ -151,8 +151,6 @@
|
|||
<command id="Inspector:Next"
|
||||
oncommand="InspectorUI.inspectNext();"
|
||||
disabled="true"/>
|
||||
<command id="Inspector:Style"
|
||||
oncommand="InspectorUI.toggleStylePanel();"/>
|
||||
</commandset>
|
||||
|
||||
<broadcasterset id="mainBroadcasterSet">
|
||||
|
|
|
@ -5844,12 +5844,15 @@ function warnAboutClosingWindow() {
|
|||
return gBrowser.warnAboutClosingTabs(true);
|
||||
|
||||
// Figure out if there's at least one other browser window around.
|
||||
let foundOtherBrowserWindow = false;
|
||||
let e = Services.wm.getEnumerator("navigator:browser");
|
||||
while (e.hasMoreElements()) {
|
||||
while (e.hasMoreElements() && !foundOtherBrowserWindow) {
|
||||
let win = e.getNext();
|
||||
if (win != window && win.toolbar.visible)
|
||||
return gBrowser.warnAboutClosingTabs(true);
|
||||
foundOtherBrowserWindow = true;
|
||||
}
|
||||
if (foundOtherBrowserWindow)
|
||||
return gBrowser.warnAboutClosingTabs(true);
|
||||
|
||||
let os = Services.obs;
|
||||
|
||||
|
|
|
@ -265,7 +265,12 @@
|
|||
label="&inspectStyleButton.label;"
|
||||
accesskey="&inspectStyleButton.accesskey;"
|
||||
class="toolbarbutton-text"
|
||||
command="Inspector:Style"/>
|
||||
oncommand="InspectorUI.toggleStylePanel();'"/>
|
||||
<toolbarbutton id="inspector-dom-toolbutton"
|
||||
label="&inspectDOMButton.label;"
|
||||
accesskey="&inspectDOMButton.accesskey;"
|
||||
class="toolbarbutton-text"
|
||||
oncommand="InspectorUI.toggleDOMPanel();"/>
|
||||
</toolbar>
|
||||
<tree id="inspector-tree" class="plain"
|
||||
seltype="single"
|
||||
|
@ -298,7 +303,7 @@
|
|||
<listbox id="inspector-style-listbox" flex="1"/>
|
||||
<hbox align="end">
|
||||
<spacer flex="1" />
|
||||
<resizer dir="bottomend" />
|
||||
<resizer dir="bottomend"/>
|
||||
</hbox>
|
||||
</panel>
|
||||
|
||||
|
@ -528,6 +533,7 @@
|
|||
command="View:PageSource"/>
|
||||
<menuseparator/>
|
||||
<menuitem id="appmenu_pageInspect"
|
||||
type="checkbox"
|
||||
label="&inspectMenu.label;"
|
||||
command="Tools:Inspect"/>
|
||||
<menuitem id="appmenu_webConsole"
|
||||
|
|
|
@ -61,40 +61,16 @@ const INSPECTOR_INVISIBLE_ELEMENTS = {
|
|||
*
|
||||
* @param aBrowser
|
||||
* The XUL browser object for the content window being highlighted.
|
||||
* @param aColor
|
||||
* A string containing an RGB color for the panel background.
|
||||
* @param aBorderSize
|
||||
* A number representing the border thickness of the panel.
|
||||
* @param anOpacity
|
||||
* A number representing the alpha value of the panel background.
|
||||
*/
|
||||
function PanelHighlighter(aBrowser, aColor, aBorderSize, anOpacity)
|
||||
function PanelHighlighter(aBrowser)
|
||||
{
|
||||
this.panel = document.getElementById("highlighter-panel");
|
||||
this.panel.hidden = false;
|
||||
this.browser = aBrowser;
|
||||
this.win = this.browser.contentWindow;
|
||||
this.backgroundColor = aColor;
|
||||
this.border = aBorderSize;
|
||||
this.opacity = anOpacity;
|
||||
this.updatePanelStyles();
|
||||
}
|
||||
|
||||
PanelHighlighter.prototype = {
|
||||
|
||||
/**
|
||||
* Update the panel's style object with current settings.
|
||||
* TODO see bugXXXXXX, https://wiki.mozilla.org/Firefox/Projects/Inspector#0.7
|
||||
* and, https://wiki.mozilla.org/Firefox/Projects/Inspector#1.0.
|
||||
*/
|
||||
updatePanelStyles: function PanelHighlighter_updatePanelStyles()
|
||||
{
|
||||
let style = this.panel.style;
|
||||
style.backgroundColor = this.backgroundColor;
|
||||
style.border = "solid blue " + this.border + "px";
|
||||
style.MozBorderRadius = "4px";
|
||||
style.opacity = this.opacity;
|
||||
},
|
||||
|
||||
/**
|
||||
* Highlight this.node, unhilighting first if necessary.
|
||||
|
@ -517,12 +493,6 @@ InspectorTreeView.prototype = {
|
|||
*/
|
||||
var InspectorUI = {
|
||||
browser: null,
|
||||
_showTreePanel: true,
|
||||
_showStylePanel: true,
|
||||
_showDOMPanel: false,
|
||||
highlightColor: "#EEEE66",
|
||||
highlightThickness: 4,
|
||||
highlightOpacity: 0.4,
|
||||
selectEventsSuppressed: false,
|
||||
inspecting: false,
|
||||
|
||||
|
@ -559,7 +529,7 @@ var InspectorUI = {
|
|||
*/
|
||||
toggleStylePanel: function IUI_toggleStylePanel()
|
||||
{
|
||||
if (this._showStylePanel) {
|
||||
if (this.isStylePanelOpen) {
|
||||
this.stylePanel.hidePopup();
|
||||
} else {
|
||||
this.openStylePanel();
|
||||
|
@ -567,7 +537,21 @@ var InspectorUI = {
|
|||
this.updateStylePanel(this.treeView.selectedNode);
|
||||
}
|
||||
}
|
||||
this._showStylePanel = !this._showStylePanel;
|
||||
},
|
||||
|
||||
/**
|
||||
* Toggle the DOM panel. Invoked from the toolbar's DOM button.
|
||||
*/
|
||||
toggleDOMPanel: function IUI_toggleDOMPanel()
|
||||
{
|
||||
if (this.isDOMPanelOpen) {
|
||||
this.domPanel.hidePopup();
|
||||
} else {
|
||||
this.openDOMPanel();
|
||||
if (this.treeView.selectedNode) {
|
||||
this.updateDOMPanel(this.treeView.selectedNode);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -590,6 +574,16 @@ var InspectorUI = {
|
|||
return this.stylePanel && this.stylePanel.state == "open";
|
||||
},
|
||||
|
||||
/**
|
||||
* Is the DOM panel open?
|
||||
*
|
||||
* @returns boolean
|
||||
*/
|
||||
get isDOMPanelOpen()
|
||||
{
|
||||
return this.domPanel && this.domPanel.state == "open";
|
||||
},
|
||||
|
||||
/**
|
||||
* Open the inspector's tree panel and initialize it.
|
||||
*/
|
||||
|
@ -603,7 +597,8 @@ var InspectorUI = {
|
|||
const panelWidthRatio = 7 / 8;
|
||||
const panelHeightRatio = 1 / 5;
|
||||
let bar = document.getElementById("status-bar");
|
||||
this.treePanel.openPopup(bar, "overlap", 120, -120, false, false);
|
||||
this.treePanel.openPopupAtScreen(this.win.screenX + 80,
|
||||
this.win.outerHeight + this.win.screenY);
|
||||
this.treePanel.sizeTo(this.win.outerWidth * panelWidthRatio,
|
||||
this.win.outerHeight * panelHeightRatio);
|
||||
this.tree = document.getElementById("inspector-tree");
|
||||
|
@ -616,11 +611,10 @@ var InspectorUI = {
|
|||
*/
|
||||
openStylePanel: function IUI_openStylePanel()
|
||||
{
|
||||
if (!this.stylePanel) {
|
||||
if (!this.stylePanel)
|
||||
this.stylePanel = document.getElementById("inspector-style-panel");
|
||||
this.stylePanel.hidden = false;
|
||||
}
|
||||
if (!this.isStylePanelOpen) {
|
||||
this.stylePanel.hidden = false;
|
||||
// open at top right of browser panel, offset by 20px from top.
|
||||
this.stylePanel.openPopup(this.browser, "end_before", 0, 20, false, false);
|
||||
// size panel to 200px wide by half browser height - 60.
|
||||
|
@ -628,6 +622,20 @@ var InspectorUI = {
|
|||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Open the DOM panel if not already onscreen.
|
||||
*/
|
||||
openDOMPanel: function IUI_openDOMPanel()
|
||||
{
|
||||
if (!this.isDOMPanelOpen) {
|
||||
// open at middle right of browser panel, offset by 20px from middle.
|
||||
this.domPanel.openPopup(this.browser, "end_before", 0,
|
||||
this.win.outerHeight / 2 - 20, false, false);
|
||||
// size panel to 200px wide by half browser height - 60.
|
||||
this.domPanel.sizeTo(200, this.win.outerHeight / 2 - 60);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Toggle the dimmed (semi-transparent) state for a panel by setting or
|
||||
* removing a dimmed attribute.
|
||||
|
@ -644,11 +652,6 @@ var InspectorUI = {
|
|||
}
|
||||
},
|
||||
|
||||
openDOMPanel: function IUI_openDOMPanel()
|
||||
{
|
||||
// # todo bug 561782
|
||||
},
|
||||
|
||||
/**
|
||||
* Open inspector UI. tree, style and DOM panels if enabled. Add listeners for
|
||||
* document scrolling, resize and tabContainer.TabSelect.
|
||||
|
@ -658,24 +661,31 @@ var InspectorUI = {
|
|||
// initialization
|
||||
this.browser = gBrowser.selectedBrowser;
|
||||
this.win = this.browser.contentWindow;
|
||||
if (!this.style) {
|
||||
Cu.import("resource:///modules/stylePanel.jsm", this);
|
||||
this.style.initialize();
|
||||
}
|
||||
|
||||
// DOM panel initialization and loading (via PropertyPanel.jsm)
|
||||
let domPanelTitle = this.strings.GetStringFromName("dom.domPanelTitle");
|
||||
let parent = document.getElementById("inspector-style-panel").parentNode;
|
||||
this.propertyPanel = new (this.PropertyPanel)(parent, document, domPanelTitle, {});
|
||||
|
||||
// additional DOM panel setup needed for unittest identification and use
|
||||
this.domPanel = this.propertyPanel.panel;
|
||||
this.domPanel.setAttribute("id", "inspector-dom-panel");
|
||||
this.domBox = this.propertyPanel.tree;
|
||||
this.domTreeView = this.propertyPanel.treeView;
|
||||
|
||||
// open inspector UI
|
||||
if (this._showTreePanel) {
|
||||
this.openTreePanel();
|
||||
}
|
||||
if (this._showStylePanel) {
|
||||
this.styleBox = document.getElementById("inspector-style-listbox");
|
||||
this.clearStylePanel();
|
||||
this.openStylePanel();
|
||||
}
|
||||
if (this._showDOMPanel) {
|
||||
this.openDOMPanel();
|
||||
}
|
||||
this.inspectorBundle = Services.strings.createBundle("chrome://browser/locale/inspector.properties");
|
||||
this.openTreePanel();
|
||||
|
||||
// style panel setup and activation
|
||||
this.styleBox = document.getElementById("inspector-style-listbox");
|
||||
this.clearStylePanel();
|
||||
this.openStylePanel();
|
||||
|
||||
// DOM panel setup and activation
|
||||
this.clearDOMPanel();
|
||||
this.openDOMPanel();
|
||||
|
||||
// setup highlighter and start inspecting
|
||||
this.initializeHighlighter();
|
||||
this.startInspecting();
|
||||
this.win.document.addEventListener("scroll", this, false);
|
||||
|
@ -689,8 +699,7 @@ var InspectorUI = {
|
|||
*/
|
||||
initializeHighlighter: function IUI_initializeHighlighter()
|
||||
{
|
||||
this.highlighter = new PanelHighlighter(this.browser, this.highlightColor,
|
||||
this.highlightThickness, this.highlightOpacity);
|
||||
this.highlighter = new PanelHighlighter(this.browser);
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -714,6 +723,12 @@ var InspectorUI = {
|
|||
if (this.isStylePanelOpen) {
|
||||
this.stylePanel.hidePopup();
|
||||
}
|
||||
if (this.domPanel) {
|
||||
this.domPanel.hidePopup();
|
||||
this.domBox = null;
|
||||
this.domTreeView = null;
|
||||
this.propertyPanel.destroy();
|
||||
}
|
||||
this.inspectCmd.setAttribute("checked", false);
|
||||
this.browser = this.win = null; // null out references to browser and window
|
||||
},
|
||||
|
@ -727,6 +742,7 @@ var InspectorUI = {
|
|||
this.attachPageListeners();
|
||||
this.inspecting = true;
|
||||
this.toggleDimForPanel(this.stylePanel);
|
||||
this.toggleDimForPanel(this.domPanel);
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -740,8 +756,10 @@ var InspectorUI = {
|
|||
this.detachPageListeners();
|
||||
this.inspecting = false;
|
||||
this.toggleDimForPanel(this.stylePanel);
|
||||
this.toggleDimForPanel(this.domPanel);
|
||||
if (this.treeView.selection) {
|
||||
this.updateStylePanel(this.treeView.selectedNode);
|
||||
this.updateDOMPanel(this.treeView.selectedNode);
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -757,7 +775,7 @@ var InspectorUI = {
|
|||
},
|
||||
|
||||
/**
|
||||
* add a new item to the listbox
|
||||
* Add a new item to the style panel listbox.
|
||||
*
|
||||
* @param aLabel
|
||||
* A bit of text to put in the listitem's label attribute.
|
||||
|
@ -768,7 +786,7 @@ var InspectorUI = {
|
|||
*/
|
||||
addStyleItem: function IUI_addStyleItem(aLabel, aType, aContent)
|
||||
{
|
||||
let itemLabelString = this.inspectorBundle.GetStringFromName("style.styleItemLabel");
|
||||
let itemLabelString = this.strings.GetStringFromName("style.styleItemLabel");
|
||||
let item = document.createElement("listitem");
|
||||
|
||||
// Do not localize these strings
|
||||
|
@ -791,7 +809,7 @@ var InspectorUI = {
|
|||
*/
|
||||
createStyleRuleItems: function IUI_createStyleRuleItems(aRules)
|
||||
{
|
||||
let selectorLabel = this.inspectorBundle.GetStringFromName("style.selectorLabel");
|
||||
let selectorLabel = this.strings.GetStringFromName("style.selectorLabel");
|
||||
|
||||
aRules.forEach(function(rule) {
|
||||
this.addStyleItem(selectorLabel, "selector", rule.id);
|
||||
|
@ -821,7 +839,7 @@ var InspectorUI = {
|
|||
{
|
||||
this.createStyleRuleItems(aRules);
|
||||
let inheritedString =
|
||||
this.inspectorBundle.GetStringFromName("style.inheritedFrom");
|
||||
this.strings.GetStringFromName("style.inheritedFrom");
|
||||
aSections.forEach(function(section) {
|
||||
let sectionTitle = section.element.tagName;
|
||||
if (section.element.id)
|
||||
|
@ -841,6 +859,14 @@ var InspectorUI = {
|
|||
this.styleBox.removeItemAt(i);
|
||||
},
|
||||
|
||||
/**
|
||||
* Remove all items from the DOM Panel's listbox.
|
||||
*/
|
||||
clearDOMPanel: function IUI_clearStylePanel()
|
||||
{
|
||||
this.domTreeView.data = {};
|
||||
},
|
||||
|
||||
/**
|
||||
* Update the contents of the style panel with styles for the currently
|
||||
* inspected node.
|
||||
|
@ -850,8 +876,10 @@ var InspectorUI = {
|
|||
*/
|
||||
updateStylePanel: function IUI_updateStylePanel(aNode)
|
||||
{
|
||||
if (this.inspecting || !this.isStylePanelOpen)
|
||||
if (this.inspecting || !this.isStylePanelOpen) {
|
||||
return;
|
||||
}
|
||||
|
||||
let rules = [], styleSections = [], usedProperties = {};
|
||||
this.style.getInheritedRules(aNode, styleSections, usedProperties);
|
||||
this.style.getElementRules(aNode, rules, usedProperties);
|
||||
|
@ -859,6 +887,19 @@ var InspectorUI = {
|
|||
this.createStyleItems(rules, styleSections);
|
||||
},
|
||||
|
||||
/**
|
||||
* Update the contents of the DOM panel with name/value pairs for the
|
||||
* currently-inspected node.
|
||||
*/
|
||||
updateDOMPanel: function IUI_updateDOMPanel(aNode)
|
||||
{
|
||||
if (this.inspecting || !this.isDOMPanelOpen) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.domTreeView.data = aNode;
|
||||
},
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//// Event Handling
|
||||
|
||||
|
@ -908,11 +949,11 @@ var InspectorUI = {
|
|||
return false;
|
||||
}
|
||||
|
||||
let treeView = this.treeView;
|
||||
let node = treeView.selectedNode;
|
||||
let node = this.treeView.selectedNode;
|
||||
this.highlighter.highlightNode(node);
|
||||
this.stopInspecting();
|
||||
this.updateStylePanel(node);
|
||||
this.updateDOMPanel(node);
|
||||
return true;
|
||||
},
|
||||
|
||||
|
@ -955,6 +996,7 @@ var InspectorUI = {
|
|||
this.treeView.selectedNode = aNode;
|
||||
this.selectEventsSuppressed = false;
|
||||
this.updateStylePanel(aNode);
|
||||
this.updateDOMPanel(aNode);
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -1000,7 +1042,33 @@ var InspectorUI = {
|
|||
},
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//// Initializors
|
||||
|
||||
XPCOMUtils.defineLazyGetter(InspectorUI, "inspectCmd", function () {
|
||||
return document.getElementById("Tools:Inspect");
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyGetter(InspectorUI, "strings", function () {
|
||||
return Services.strings.createBundle("chrome://browser/locale/inspector.properties");
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyGetter(InspectorUI, "PropertyTreeView", function () {
|
||||
var obj = {};
|
||||
Cu.import("resource://gre/modules/PropertyPanel.jsm", obj);
|
||||
return obj.PropertyTreeView;
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyGetter(InspectorUI, "PropertyPanel", function () {
|
||||
var obj = {};
|
||||
Cu.import("resource://gre/modules/PropertyPanel.jsm", obj);
|
||||
return obj.PropertyPanel;
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyGetter(InspectorUI, "style", function () {
|
||||
var obj = {};
|
||||
Cu.import("resource:///modules/stylePanel.jsm", obj);
|
||||
obj.style.initialize();
|
||||
return obj.style;
|
||||
});
|
||||
|
||||
|
|
|
@ -1258,8 +1258,10 @@
|
|||
<parameter name="aAll"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
var tabsToClose = (aAll ? this.tabs.length : this.visibleTabs.length - 1)
|
||||
- gBrowser._numPinnedTabs;
|
||||
var tabsToClose = this.tabs.length;
|
||||
|
||||
if (!aAll)
|
||||
tabsToClose = this.visibleTabs.length - (1 + this._numPinnedTabs);
|
||||
if (tabsToClose <= 1)
|
||||
return true;
|
||||
|
||||
|
|
|
@ -153,6 +153,7 @@ _BROWSER_FILES = \
|
|||
browser_inspector_treeSelection.js \
|
||||
browser_inspector_highlighter.js \
|
||||
browser_inspector_stylePanel.js \
|
||||
browser_inspector_domPanel.js \
|
||||
browser_inspector_iframeTest.js \
|
||||
browser_inspector_scrolling.js \
|
||||
browser_pageInfo.js \
|
||||
|
|
|
@ -0,0 +1,128 @@
|
|||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=2 et sw=2 tw=80: */
|
||||
/* ***** 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 DOM Panel Tests.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* The Mozilla Foundation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2010
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Rob Campbell <rcampbell@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 ***** */
|
||||
|
||||
let doc;
|
||||
let testGen;
|
||||
|
||||
function createDocument()
|
||||
{
|
||||
doc.body.innerHTML = '<div id="first" style="{ margin: 10em; ' +
|
||||
'font-size: 14pt; font-family: helvetica, sans-serif; color: #AAA}">\n' +
|
||||
'<h1>Some header text</h1>\n' +
|
||||
'<p id="salutation" style="{font-size: 12pt}">hi.</p>\n' +
|
||||
'<p id="body" style="{font-size: 12pt}">I am a test-case. This text exists ' +
|
||||
'solely to provide some things to <span style="{color: yellow}">' +
|
||||
'highlight</span> and <span style="{font-weight: bold}">count</span> ' +
|
||||
'DOM list-items in the box at right. If you are reading this, ' +
|
||||
'you should go do something else instead. Maybe read a book. Or better ' +
|
||||
'yet, write some test-cases for another bit of code. ' +
|
||||
'<span style="{font-style: italic}">Maybe more inspector test-cases!</span></p>\n' +
|
||||
'<p id="closing">end transmission</p>\n' +
|
||||
'</div>';
|
||||
doc.title = "Inspector DOM Test";
|
||||
document.addEventListener("popupshown", runDOMTests, false);
|
||||
InspectorUI.openInspectorUI();
|
||||
}
|
||||
|
||||
function nodeGenerator()
|
||||
{
|
||||
let body = doc.body;
|
||||
InspectorUI.inspectNode(body);
|
||||
yield;
|
||||
let h1 = doc.querySelector("h1");
|
||||
InspectorUI.inspectNode(h1);
|
||||
yield;
|
||||
let first = doc.getElementById("first");
|
||||
InspectorUI.inspectNode(first);
|
||||
yield;
|
||||
let closing = doc.getElementById("#closing");
|
||||
InspectorUI.inspectNode(closing);
|
||||
yield;
|
||||
}
|
||||
|
||||
function runDOMTests(evt)
|
||||
{
|
||||
if (evt.target.id != "inspector-dom-panel")
|
||||
return true;
|
||||
InspectorUI._log("runDOMtests");
|
||||
document.removeEventListener("popupshown", runDOMTests, false);
|
||||
InspectorUI.stopInspecting();
|
||||
document.addEventListener("popupshown", performTestComparisons, false);
|
||||
testGen = nodeGenerator();
|
||||
testGen.next();
|
||||
}
|
||||
|
||||
function performTestComparisons(evt)
|
||||
{
|
||||
InspectorUI._log("performTestComparisons");
|
||||
if (evt.target.id != "highlighter-panel")
|
||||
return true;
|
||||
|
||||
ok(InspectorUI.treeView.selectedNode, "selection");
|
||||
ok(InspectorUI.isDOMPanelOpen, "DOM panel is open?");
|
||||
ok(InspectorUI.highlighter.isHighlighting, "panel is highlighting");
|
||||
ok(InspectorUI.domTreeView.rowCount > 0, "domBox has items");
|
||||
|
||||
try {
|
||||
testGen.next();
|
||||
} catch(StopIteration) {
|
||||
document.removeEventListener("popupshown", performTestComparisons, false);
|
||||
finishUp();
|
||||
}
|
||||
}
|
||||
|
||||
function finishUp() {
|
||||
InspectorUI.closeInspectorUI();
|
||||
gBrowser.removeCurrentTab();
|
||||
finish();
|
||||
}
|
||||
|
||||
function test()
|
||||
{
|
||||
waitForExplicitFinish();
|
||||
gBrowser.selectedTab = gBrowser.addTab();
|
||||
gBrowser.selectedBrowser.addEventListener("load", function() {
|
||||
gBrowser.selectedBrowser.removeEventListener("load", arguments.callee, true);
|
||||
doc = content.document;
|
||||
waitForFocus(createDocument, content);
|
||||
}, true);
|
||||
|
||||
content.location = "data:text/html,basic tests for inspector";
|
||||
}
|
||||
|
|
@ -48,20 +48,20 @@ function startInspectorTests()
|
|||
|
||||
function runInspectorTests(evt)
|
||||
{
|
||||
if (evt.target.id != "inspector-panel")
|
||||
if (evt.target.id != "inspector-dom-panel")
|
||||
return true;
|
||||
document.removeEventListener("popupshown", runInspectorTests, false);
|
||||
document.addEventListener("popuphidden", finishInspectorTests, false);
|
||||
ok(InspectorUI.inspecting, "Inspector is highlighting");
|
||||
ok(InspectorUI.isPanelOpen, "Inspector Tree Panel is open");
|
||||
ok(InspectorUI.isStylePanelOpen, "Inspector Style Panel is open");
|
||||
todo(InspectorUI.isDOMPanelOpen, "Inspector DOM Panel is open");
|
||||
ok(InspectorUI.isDOMPanelOpen, "Inspector DOM Panel is open");
|
||||
InspectorUI.toggleInspectorUI();
|
||||
}
|
||||
|
||||
function finishInspectorTests(evt)
|
||||
{
|
||||
if (evt.target.id != "inspector-style-panel")
|
||||
if (evt.target.id != "inspector-dom-panel")
|
||||
return true;
|
||||
document.removeEventListener("popuphidden", finishInspectorTests, false);
|
||||
ok(!InspectorUI.isDOMPanelOpen, "Inspector DOM Panel is closed");
|
||||
|
|
|
@ -93,8 +93,7 @@ function performTestComparisons(evt)
|
|||
return true;
|
||||
|
||||
ok(InspectorUI.treeView.selectedNode, "selection");
|
||||
ok(InspectorUI._showStylePanel, "_showStylePanel");
|
||||
is(InspectorUI.isStylePanelOpen, InspectorUI._showStylePanel, "style panel matches _showStylePanel?");
|
||||
ok(InspectorUI.isStylePanelOpen, "style panel is open?");
|
||||
ok(InspectorUI.highlighter.isHighlighting, "panel is highlighting");
|
||||
ok(InspectorUI.styleBox.itemCount > 0, "styleBox has items");
|
||||
|
||||
|
|
|
@ -853,8 +853,7 @@ nsDefaultCommandLineHandler.prototype = {
|
|||
}
|
||||
},
|
||||
|
||||
// XXX localize me... how?
|
||||
helpInfo : "Usage: firefox [-flags] [<url>]\n",
|
||||
helpInfo : "",
|
||||
};
|
||||
|
||||
var components = [nsBrowserContentHandler, nsDefaultCommandLineHandler];
|
||||
|
|
|
@ -438,7 +438,7 @@ BrowserGlue.prototype = {
|
|||
var browser = browserEnum.getNext();
|
||||
var tabbrowser = browser.document.getElementById("content");
|
||||
if (tabbrowser)
|
||||
pagecount += tabbrowser.browsers.length - tabbrowser._numPinnedTabs;
|
||||
pagecount += tabbrowser.browsers.length;
|
||||
}
|
||||
|
||||
this._saveSession = false;
|
||||
|
@ -469,7 +469,7 @@ BrowserGlue.prototype = {
|
|||
getService(Ci.nsIPrivateBrowsingService).
|
||||
privateBrowsingEnabled;
|
||||
if (!showPrompt || inPrivateBrowsing)
|
||||
return;
|
||||
return false;
|
||||
|
||||
var quitBundle = Services.strings.createBundle("chrome://browser/locale/quitDialog.properties");
|
||||
var brandBundle = Services.strings.createBundle("chrome://branding/locale/brand.properties");
|
||||
|
|
|
@ -157,14 +157,7 @@ SessionStartup.prototype = {
|
|||
|
||||
if (this._sessionType != Ci.nsISessionStartup.NO_SESSION) {
|
||||
// wait for the first browser window to open
|
||||
|
||||
// Don't reset the initial window's default args (i.e. the home page(s))
|
||||
// if all stored tabs are pinned.
|
||||
if (!initialState.windows ||
|
||||
!initialState.windows.every(function (win)
|
||||
win.tabs.every(function (tab) tab.pinned)))
|
||||
Services.obs.addObserver(this, "domwindowopened", true);
|
||||
|
||||
Services.obs.addObserver(this, "domwindowopened", true);
|
||||
Services.obs.addObserver(this, "browser:purge-session-history", true);
|
||||
}
|
||||
},
|
||||
|
|
|
@ -198,8 +198,10 @@ SessionStoreService.prototype = {
|
|||
// whether we clearing history on shutdown
|
||||
_clearingOnShutdown: false,
|
||||
|
||||
#ifndef XP_MACOSX
|
||||
// whether the last window was closed and should be restored
|
||||
_restoreLastWindow: false,
|
||||
#endif
|
||||
|
||||
/* ........ Global Event Handlers .............. */
|
||||
|
||||
|
@ -288,8 +290,10 @@ SessionStoreService.prototype = {
|
|||
catch (ex) { debug("The session file is invalid: " + ex); }
|
||||
}
|
||||
|
||||
if (this._resume_from_crash) {
|
||||
// create a backup if the session data file exists
|
||||
// remove the session data files if crash recovery is disabled
|
||||
if (!this._resume_from_crash)
|
||||
this._clearDisk();
|
||||
else { // create a backup if the session data file exists
|
||||
try {
|
||||
if (this._sessionFileBackup.exists())
|
||||
this._sessionFileBackup.remove(false);
|
||||
|
@ -314,14 +318,12 @@ SessionStoreService.prototype = {
|
|||
* quit-application-granted, quit-application
|
||||
*/
|
||||
_uninit: function sss_uninit() {
|
||||
// save all data for session resuming
|
||||
this.saveState(true);
|
||||
|
||||
if (!this._doResumeSession()) {
|
||||
// discard all session related data
|
||||
if (this._doResumeSession()) { // save all data for session resuming
|
||||
this.saveState(true);
|
||||
}
|
||||
else { // discard all session related data
|
||||
this._clearDisk();
|
||||
}
|
||||
|
||||
// Make sure to break our cycle with the save timer
|
||||
if (this._saveTimer) {
|
||||
this._saveTimer.cancel();
|
||||
|
@ -357,13 +359,15 @@ SessionStoreService.prototype = {
|
|||
// freeze the data at what we've got (ignoring closing windows)
|
||||
this._loadState = STATE_QUITTING;
|
||||
break;
|
||||
#ifndef XP_MACOSX
|
||||
case "browser-lastwindow-close-granted":
|
||||
// last browser window is quitting.
|
||||
// remember to restore the last window when another browser window is opened
|
||||
// remember to restore the last window when another browser window is openend
|
||||
// do not account for pref(resume_session_once) at this point, as it might be
|
||||
// set by another observer getting this notice after us
|
||||
this._restoreLastWindow = true;
|
||||
break;
|
||||
#endif
|
||||
case "quit-application":
|
||||
if (aData == "restart") {
|
||||
this._prefBranch.setBoolPref("sessionstore.resume_session_once", true);
|
||||
|
@ -477,9 +481,10 @@ SessionStoreService.prototype = {
|
|||
this._resume_from_crash = this._prefBranch.getBoolPref("sessionstore.resume_from_crash");
|
||||
// either create the file with crash recovery information or remove it
|
||||
// (when _loadState is not STATE_RUNNING, that file is used for session resuming instead)
|
||||
if (!this._resume_from_crash)
|
||||
if (this._resume_from_crash)
|
||||
this.saveState(true);
|
||||
else if (this._loadState == STATE_RUNNING)
|
||||
this._clearDisk();
|
||||
this.saveState(true);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
@ -606,8 +611,7 @@ SessionStoreService.prototype = {
|
|||
// make sure that the restored tabs are first in the window
|
||||
this._initialState._firstTabs = true;
|
||||
this._restoreCount = this._initialState.windows ? this._initialState.windows.length : 0;
|
||||
this.restoreWindow(aWindow, this._initialState,
|
||||
this._isCmdLineEmpty(aWindow, this._initialState));
|
||||
this.restoreWindow(aWindow, this._initialState, this._isCmdLineEmpty(aWindow));
|
||||
delete this._initialState;
|
||||
|
||||
// _loadState changed from "stopped" to "running"
|
||||
|
@ -627,13 +631,15 @@ SessionStoreService.prototype = {
|
|||
let followUp = this._statesToRestore[aWindow.__SS_restoreID].windows.length == 1;
|
||||
this.restoreWindow(aWindow, this._statesToRestore[aWindow.__SS_restoreID], true, followUp);
|
||||
}
|
||||
#ifndef XP_MACOSX
|
||||
else if (this._restoreLastWindow && aWindow.toolbar.visible &&
|
||||
this._closedWindows.length &&
|
||||
this._closedWindows.length && this._doResumeSession() &&
|
||||
!this._inPrivateBrowsing) {
|
||||
|
||||
// default to the most-recently closed window
|
||||
// don't use popup windows
|
||||
let state = null;
|
||||
let newClosedWindows = this._closedWindows.filter(function(aWinState) {
|
||||
this._closedWindows = this._closedWindows.filter(function(aWinState) {
|
||||
if (!state && !aWinState.isPopup) {
|
||||
state = aWinState;
|
||||
return false;
|
||||
|
@ -642,16 +648,9 @@ SessionStoreService.prototype = {
|
|||
});
|
||||
if (state) {
|
||||
delete state.hidden;
|
||||
#ifndef XP_MACOSX
|
||||
if (!this._doResumeSession())
|
||||
#endif
|
||||
state.tabs = state.tabs.filter(function (tab) tab.pinned);
|
||||
if (state.tabs.length > 0) {
|
||||
this._closedWindows = newClosedWindows;
|
||||
this._restoreCount = 1;
|
||||
state = { windows: [state] };
|
||||
this.restoreWindow(aWindow, state, this._isCmdLineEmpty(aWindow, state));
|
||||
}
|
||||
state = { windows: [state] };
|
||||
this._restoreCount = 1;
|
||||
this.restoreWindow(aWindow, state, this._isCmdLineEmpty(aWindow));
|
||||
}
|
||||
// we actually restored the session just now.
|
||||
this._prefBranch.setBoolPref("sessionstore.resume_session_once", false);
|
||||
|
@ -662,6 +661,7 @@ SessionStoreService.prototype = {
|
|||
// undoCloseWindow was executed.
|
||||
this._restoreLastWindow = false;
|
||||
}
|
||||
#endif
|
||||
|
||||
var tabbrowser = aWindow.gBrowser;
|
||||
|
||||
|
@ -1140,19 +1140,14 @@ SessionStoreService.prototype = {
|
|||
* Store all session data for a window
|
||||
* @param aWindow
|
||||
* Window reference
|
||||
* @param aPinnedOnly
|
||||
* Bool collect pinned tabs only
|
||||
*/
|
||||
_saveWindowHistory: function sss_saveWindowHistory(aWindow, aPinnedOnly) {
|
||||
_saveWindowHistory: function sss_saveWindowHistory(aWindow) {
|
||||
var tabbrowser = aWindow.gBrowser;
|
||||
var tabs = tabbrowser.tabs;
|
||||
var tabsData = this._windows[aWindow.__SSi].tabs = [];
|
||||
|
||||
for (var i = 0; i < tabs.length; i++) {
|
||||
if (aPinnedOnly && !tabs[i].pinned)
|
||||
break;
|
||||
for (var i = 0; i < tabs.length; i++)
|
||||
tabsData.push(this._collectTabData(tabs[i]));
|
||||
}
|
||||
|
||||
this._windows[aWindow.__SSi].selected = tabbrowser.mTabBox.selectedIndex + 1;
|
||||
},
|
||||
|
@ -1440,15 +1435,16 @@ SessionStoreService.prototype = {
|
|||
*/
|
||||
_updateTextAndScrollData: function sss_updateTextAndScrollData(aWindow) {
|
||||
var browsers = aWindow.gBrowser.browsers;
|
||||
this._windows[aWindow.__SSi].tabs.forEach(function (tabData, i) {
|
||||
if (browsers[i].__SS_data &&
|
||||
browsers[i].__SS_data._tabStillLoading)
|
||||
return; // ignore incompletely initialized tabs
|
||||
for (var i = 0; i < browsers.length; i++) {
|
||||
try {
|
||||
var tabData = this._windows[aWindow.__SSi].tabs[i];
|
||||
if (browsers[i].__SS_data &&
|
||||
browsers[i].__SS_data._tabStillLoading)
|
||||
continue; // ignore incompletely initialized tabs
|
||||
this._updateTextAndScrollDataForTab(aWindow, browsers[i], tabData);
|
||||
}
|
||||
catch (ex) { debug(ex); } // get as much data as possible, ignore failures (might succeed the next time)
|
||||
}, this);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -1755,14 +1751,12 @@ SessionStoreService.prototype = {
|
|||
},
|
||||
|
||||
/**
|
||||
* gather session data as object
|
||||
* serialize session data as Ini-formatted string
|
||||
* @param aUpdateAll
|
||||
* Bool update all windows
|
||||
* @param aPinnedOnly
|
||||
* Bool collect pinned tabs only
|
||||
* @returns object
|
||||
* @returns string
|
||||
*/
|
||||
_getCurrentState: function sss_getCurrentState(aUpdateAll, aPinnedOnly) {
|
||||
_getCurrentState: function sss_getCurrentState(aUpdateAll) {
|
||||
this._handleClosedWindows();
|
||||
|
||||
var activeWindow = this._getMostRecentBrowserWindow();
|
||||
|
@ -1773,7 +1767,7 @@ SessionStoreService.prototype = {
|
|||
if (!this._isWindowLoaded(aWindow)) // window data is still in _statesToRestore
|
||||
return;
|
||||
if (aUpdateAll || this._dirtyWindows[aWindow.__SSi] || aWindow == activeWindow) {
|
||||
this._collectWindowData(aWindow, aPinnedOnly);
|
||||
this._collectWindowData(aWindow);
|
||||
}
|
||||
else { // always update the window features (whose change alone never triggers a save operation)
|
||||
this._updateWindowFeatures(aWindow);
|
||||
|
@ -1819,17 +1813,6 @@ SessionStoreService.prototype = {
|
|||
}
|
||||
#endif
|
||||
|
||||
if (aPinnedOnly) {
|
||||
total = total.filter(function (win) {
|
||||
win.tabs = win.tabs.filter(function (tab) tab.pinned);
|
||||
return win.tabs.length > 0;
|
||||
});
|
||||
if (total.length == 0)
|
||||
return null;
|
||||
|
||||
lastClosedWindowsCopy = [];
|
||||
}
|
||||
|
||||
if (activeWindow) {
|
||||
this.activeWindowSSiCache = activeWindow.__SSi || "";
|
||||
}
|
||||
|
@ -1861,12 +1844,12 @@ SessionStoreService.prototype = {
|
|||
return { windows: total };
|
||||
},
|
||||
|
||||
_collectWindowData: function sss_collectWindowData(aWindow, aPinnedOnly) {
|
||||
_collectWindowData: function sss_collectWindowData(aWindow) {
|
||||
if (!this._isWindowLoaded(aWindow))
|
||||
return;
|
||||
|
||||
// update the internal state data for this window
|
||||
this._saveWindowHistory(aWindow, aPinnedOnly);
|
||||
this._saveWindowHistory(aWindow);
|
||||
this._updateTextAndScrollData(aWindow);
|
||||
this._updateCookieHosts(aWindow);
|
||||
this._updateWindowFeatures(aWindow);
|
||||
|
@ -2578,7 +2561,8 @@ SessionStoreService.prototype = {
|
|||
this._dirtyWindows[aWindow.__SSi] = true;
|
||||
}
|
||||
|
||||
if (!this._saveTimer && !this._inPrivateBrowsing) {
|
||||
if (!this._saveTimer && this._resume_from_crash &&
|
||||
!this._inPrivateBrowsing) {
|
||||
// interval until the next disk operation is allowed
|
||||
var minimalDelay = this._lastSaveTime + this._interval - Date.now();
|
||||
|
||||
|
@ -2600,23 +2584,15 @@ SessionStoreService.prototype = {
|
|||
* Bool update all windows
|
||||
*/
|
||||
saveState: function sss_saveState(aUpdateAll) {
|
||||
// if crash recovery is disabled, only save session resuming information
|
||||
if (!this._resume_from_crash && this._loadState == STATE_RUNNING)
|
||||
return;
|
||||
|
||||
// if we're in private browsing mode, do nothing
|
||||
if (this._inPrivateBrowsing)
|
||||
return;
|
||||
|
||||
var pinnedOnly = false;
|
||||
if (this._loadState == STATE_QUITTING && !this._doResumeSession() ||
|
||||
/* if crash recovery is disabled, only save session resuming information */
|
||||
this._loadState == STATE_RUNNING && !this._resume_from_crash)
|
||||
pinnedOnly = true;
|
||||
|
||||
var oState = this._getCurrentState(aUpdateAll, pinnedOnly);
|
||||
if (!oState)
|
||||
return;
|
||||
|
||||
if (pinnedOnly)
|
||||
this._prefBranch.setBoolPref("sessionstore.resume_session_once", true);
|
||||
|
||||
var oState = this._getCurrentState(aUpdateAll);
|
||||
oState.session = {
|
||||
state: this._loadState == STATE_RUNNING ? STATE_RUNNING_STR : STATE_STOPPED_STR,
|
||||
lastUpdate: Date.now()
|
||||
|
@ -2780,19 +2756,12 @@ SessionStoreService.prototype = {
|
|||
* C.f.: nsBrowserContentHandler's defaultArgs implementation.
|
||||
* @returns bool
|
||||
*/
|
||||
_isCmdLineEmpty: function sss_isCmdLineEmpty(aWindow, aState) {
|
||||
var pinnedOnly = aState.windows &&
|
||||
aState.windows.every(function (win)
|
||||
win.tabs.every(function (tab) tab.pinned));
|
||||
|
||||
if (!pinnedOnly) {
|
||||
let defaultArgs = Cc["@mozilla.org/browser/clh;1"].
|
||||
getService(Ci.nsIBrowserHandler).defaultArgs;
|
||||
if (aWindow.arguments &&
|
||||
aWindow.arguments[0] &&
|
||||
aWindow.arguments[0] == defaultArgs)
|
||||
aWindow.arguments[0] = null;
|
||||
}
|
||||
_isCmdLineEmpty: function sss_isCmdLineEmpty(aWindow) {
|
||||
var defaultArgs = Cc["@mozilla.org/browser/clh;1"].
|
||||
getService(Ci.nsIBrowserHandler).defaultArgs;
|
||||
if (aWindow.arguments && aWindow.arguments[0] &&
|
||||
aWindow.arguments[0] == defaultArgs)
|
||||
aWindow.arguments[0] = null;
|
||||
|
||||
return !aWindow.arguments || !aWindow.arguments[0];
|
||||
},
|
||||
|
|
|
@ -114,7 +114,6 @@ _BROWSER_TEST_FILES = \
|
|||
browser_524745.js \
|
||||
browser_528776.js \
|
||||
browser_579879.js \
|
||||
browser_580512.js \
|
||||
browser_586147.js \
|
||||
$(NULL)
|
||||
|
||||
|
|
|
@ -485,7 +485,7 @@ function test() {
|
|||
|
||||
/**
|
||||
* Test 8: Test if closing can be denied on Mac
|
||||
* Futhermore prepares the testNotificationCount test (Test 7)
|
||||
* Futhermore prepares the testNotificationCount test (Test 6)
|
||||
* @note: Mac only
|
||||
*/
|
||||
function testMacNotifications(nextFn, iteration) {
|
||||
|
|
|
@ -1,68 +0,0 @@
|
|||
const URIS_PINNED = ["about:license", "about:about"];
|
||||
const URIS_NORMAL_A = ["about:mozilla"];
|
||||
const URIS_NORMAL_B = ["about:buildconfig"];
|
||||
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
isnot(Services.prefs.getIntPref("browser.startup.page"), 3,
|
||||
"pref to save session must not be set for this test");
|
||||
ok(!Services.prefs.getBoolPref("browser.sessionstore.resume_session_once"),
|
||||
"pref to save session once must not be set for this test");
|
||||
|
||||
document.documentElement.setAttribute("windowtype", "navigator:browsertestdummy");
|
||||
|
||||
openWinWithCb(closeFirstWin, URIS_PINNED.concat(URIS_NORMAL_A));
|
||||
}
|
||||
|
||||
function closeFirstWin(win) {
|
||||
win.gBrowser.pinTab(win.gBrowser.tabs[0]);
|
||||
win.gBrowser.pinTab(win.gBrowser.tabs[1]);
|
||||
win.BrowserTryToCloseWindow();
|
||||
ok(win.closed, "window closed");
|
||||
|
||||
openWinWithCb(checkSecondWin, URIS_NORMAL_B, URIS_PINNED.concat(URIS_NORMAL_B));
|
||||
}
|
||||
|
||||
function checkSecondWin(win) {
|
||||
is(win.gBrowser.browsers[0].currentURI.spec, URIS_PINNED[0], "first pinned tab restored");
|
||||
is(win.gBrowser.browsers[1].currentURI.spec, URIS_PINNED[1], "second pinned tab restored");
|
||||
ok(win.gBrowser.tabs[0].pinned, "first pinned tab is still pinned");
|
||||
ok(win.gBrowser.tabs[1].pinned, "second pinned tab is still pinned");
|
||||
win.close();
|
||||
|
||||
// cleanup
|
||||
document.documentElement.setAttribute("windowtype", "navigator:browser");
|
||||
finish();
|
||||
}
|
||||
|
||||
function openWinWithCb(cb, argURIs, expectedURIs) {
|
||||
if (!expectedURIs)
|
||||
expectedURIs = argURIs;
|
||||
|
||||
var win = openDialog("chrome://browser/content/", "_blank",
|
||||
"chrome,all,dialog=no", argURIs.join("|"));
|
||||
|
||||
win.addEventListener("load", function () {
|
||||
info("the window loaded");
|
||||
|
||||
var expectedLoads = expectedURIs.length;
|
||||
|
||||
win.gBrowser.addTabsProgressListener({
|
||||
onStateChange: function (aBrowser, aWebProgress, aRequest, aStateFlags, aStatus) {
|
||||
if (aRequest &&
|
||||
aStateFlags & Ci.nsIWebProgressListener.STATE_STOP &&
|
||||
aStateFlags & Ci.nsIWebProgressListener.STATE_IS_NETWORK &&
|
||||
expectedURIs.indexOf(aRequest.QueryInterface(Ci.nsIChannel).originalURI.spec) > -1 &&
|
||||
--expectedLoads <= 0) {
|
||||
win.gBrowser.removeTabsProgressListener(this);
|
||||
info("all tabs loaded");
|
||||
is(win.gBrowser.tabs.length, expectedURIs.length, "didn't load any unexpected tabs");
|
||||
executeSoon(function () {
|
||||
cb(win);
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}, false);
|
||||
}
|
|
@ -41,6 +41,7 @@ MOZ_UPDATER=1
|
|||
MOZ_PHOENIX=1
|
||||
|
||||
MOZ_ENABLE_LIBXUL=1
|
||||
MOZ_CHROME_FILE_FORMAT=omni
|
||||
MOZ_STATIC_BUILD_UNSUPPORTED=1
|
||||
# always enabled for form history
|
||||
MOZ_MORKREADER=1
|
||||
|
|
|
@ -620,6 +620,8 @@ xpicleanup@BIN_SUFFIX@
|
|||
components/storage-Legacy.js
|
||||
components/storage-mozStorage.js
|
||||
components/txEXSLTRegExFunctions.js
|
||||
components/WeaveCrypto.js
|
||||
components/Weave.js
|
||||
components/WebContentConverter.js
|
||||
defaults/autoconfig/platform.js
|
||||
defaults/autoconfig/prefcalls.js
|
||||
|
@ -628,8 +630,8 @@ xpicleanup@BIN_SUFFIX@
|
|||
defaults/pref/firefox.js
|
||||
defaults/pref/firefox-l10n.js
|
||||
defaults/pref/reporter.js
|
||||
defaults/pref/services-sync.js
|
||||
defaults/profile/bookmarks.html
|
||||
defaults/profile/chrome
|
||||
defaults/profile/chrome/userChrome-example.css
|
||||
defaults/profile/chrome/userContent-example.css
|
||||
defaults/profile/localstore.rdf
|
||||
|
@ -668,8 +670,45 @@ xpicleanup@BIN_SUFFIX@
|
|||
modules/PluralForm.jsm
|
||||
modules/PopupNotifications.jsm
|
||||
modules/Services.jsm
|
||||
modules/services-sync/auth.js
|
||||
modules/services-sync/base_records/collection.js
|
||||
modules/services-sync/base_records/crypto.js
|
||||
modules/services-sync/base_records/keys.js
|
||||
modules/services-sync/base_records/wbo.js
|
||||
modules/services-sync/constants.js
|
||||
modules/services-sync/engines/bookmarks.js
|
||||
modules/services-sync/engines/clients.js
|
||||
modules/services-sync/engines/forms.js
|
||||
modules/services-sync/engines/history.js
|
||||
modules/services-sync/engines.js
|
||||
modules/services-sync/engines/passwords.js
|
||||
modules/services-sync/engines/prefs.js
|
||||
modules/services-sync/engines/tabs.js
|
||||
modules/services-sync/ext/Observers.js
|
||||
modules/services-sync/ext/Preferences.js
|
||||
modules/services-sync/ext/StringBundle.js
|
||||
modules/services-sync/ext/Sync.js
|
||||
modules/services-sync/identity.js
|
||||
modules/services-sync/log4moz.js
|
||||
modules/services-sync/notifications.js
|
||||
modules/services-sync/resource.js
|
||||
modules/services-sync/service.js
|
||||
modules/services-sync/status.js
|
||||
modules/services-sync/stores.js
|
||||
modules/services-sync/trackers.js
|
||||
modules/services-sync/type_records/bookmark.js
|
||||
modules/services-sync/type_records/clients.js
|
||||
modules/services-sync/type_records/forms.js
|
||||
modules/services-sync/type_records/history.js
|
||||
modules/services-sync/type_records/passwords.js
|
||||
modules/services-sync/type_records/prefs.js
|
||||
modules/services-sync/type_records/tabs.js
|
||||
modules/services-sync/util.js
|
||||
modules/SpatialNavigation.js
|
||||
modules/stylePanel.jsm
|
||||
modules/tabview/AllTabs.jsm
|
||||
modules/tabview/groups.jsm
|
||||
modules/tabview/utils.jsm
|
||||
modules/utils.js
|
||||
modules/WindowDraggingUtils.jsm
|
||||
#ifdef XP_WIN
|
||||
|
@ -683,7 +722,6 @@ xpicleanup@BIN_SUFFIX@
|
|||
res/dtd/mathml.dtd
|
||||
res/dtd/xhtml11.dtd
|
||||
res/EditorOverride.css
|
||||
res/entityTables
|
||||
res/entityTables/html40Latin1.properties
|
||||
res/entityTables/html40Special.properties
|
||||
res/entityTables/html40Symbols.properties
|
||||
|
@ -746,7 +784,6 @@ xpicleanup@BIN_SUFFIX@
|
|||
components/commandlines.xpt
|
||||
components/composer.xpt
|
||||
components/content.xpt
|
||||
components/content.xpt
|
||||
components/content_base.xpt
|
||||
components/content_html.xpt
|
||||
components/content_htmldoc.xpt
|
||||
|
|
|
@ -193,6 +193,12 @@
|
|||
<!ENTITY inspectStyleButton.label "Style">
|
||||
<!ENTITY inspectStyleButton.accesskey "S">
|
||||
<!ENTITY inspectStylePanelTitle.label "Style">
|
||||
<!-- LOCALIZATION NOTE (inspectDOMButton.label): This button label
|
||||
- stands for Document Object Model and appears on the inspector's toolbar.
|
||||
- It is used to open and closed the DOM panel. There is also a DOM label in
|
||||
- inspector.properties for the panel titlebar. -->
|
||||
<!ENTITY inspectDOMButton.label "DOM">
|
||||
<!ENTITY inspectDOMButton.accesskey "D">
|
||||
|
||||
<!ENTITY fileMenu.label "File">
|
||||
<!ENTITY fileMenu.accesskey "F">
|
||||
|
|
|
@ -6,6 +6,12 @@ style.selectorLabel=Selector
|
|||
# inspector. Describes which tagname[#id] the properties are inherited from.
|
||||
style.inheritedFrom=Inherited from: #1
|
||||
|
||||
# LOCALIZATION NOTE (style.styleItemLabel: used in Style panel in inspector.
|
||||
# LOCALIZATION NOTE (style.styleItemLabel): used in Style panel in inspector.
|
||||
# Used for construction of list items, #1 = label, #2 = content.
|
||||
style.styleItemLabel=#1: #2
|
||||
|
||||
# LOCALIZATION NOTE (dom.domPanelTitle): used in DOM Panel in inspector.
|
||||
# Stands for "Document Object Model". Also referenced in in browser.dtd
|
||||
# and used as a button title.
|
||||
# Unsure if this localizes well, but including just in case
|
||||
dom.domPanelTitle=DOM
|
||||
|
|
|
@ -1510,6 +1510,9 @@ toolbar[mode="text"] toolbarbutton.chevron > .toolbarbutton-icon {
|
|||
#highlighter-panel {
|
||||
-moz-appearance: none;
|
||||
-moz-window-shadow: none;
|
||||
background: -moz-linear-gradient(top -1deg, #ffdd88, #ffeeaa);
|
||||
border: none;
|
||||
opacity: 0.35;
|
||||
}
|
||||
|
||||
listitem.style-selector {
|
||||
|
|
|
@ -2092,6 +2092,9 @@ toolbarbutton.chevron > .toolbarbutton-menu-dropmarker {
|
|||
#highlighter-panel {
|
||||
-moz-appearance: none;
|
||||
-moz-window-shadow: none;
|
||||
background: -moz-linear-gradient(top -1deg, #ffdd88, #ffeeaa);
|
||||
border: none;
|
||||
opacity: 0.35;
|
||||
}
|
||||
|
||||
listitem.style-selector {
|
||||
|
|
|
@ -1798,6 +1798,9 @@ toolbarbutton.bookmark-item[dragover="true"][open="true"] {
|
|||
#highlighter-panel {
|
||||
-moz-appearance: none;
|
||||
-moz-window-shadow: none;
|
||||
background: -moz-linear-gradient(top -1deg, #ffdd88, #ffeeaa);
|
||||
border: none;
|
||||
opacity: 0.35;
|
||||
}
|
||||
|
||||
listitem.style-selector {
|
||||
|
|
|
@ -206,5 +206,5 @@ libs:: $(topsrcdir)/tools/rb/fix-linux-stack.pl
|
|||
$(INSTALL) $< $(DIST)/bin
|
||||
endif
|
||||
|
||||
GARBAGE += automationutils.pyc
|
||||
GARBAGE += $(srcdir)/automationutils.pyc
|
||||
endif # ENABLE_TESTS
|
||||
|
|
|
@ -51,6 +51,7 @@ from automation import Automation
|
|||
PORT = 8888
|
||||
SCRIPT_DIR = os.path.abspath(os.path.realpath(os.path.dirname(sys.argv[0])))
|
||||
PROFILE_DIRECTORY = os.path.abspath(os.path.join(SCRIPT_DIR, "./pgoprofile"))
|
||||
MOZ_JAR_LOG_DIR = os.path.abspath(os.path.join(os.path.join(os.getenv("OBJDIR"), "dist"), "jarlog"))
|
||||
os.chdir(SCRIPT_DIR)
|
||||
|
||||
class EasyServer(SocketServer.TCPServer):
|
||||
|
@ -67,6 +68,7 @@ if __name__ == '__main__':
|
|||
automation.initializeProfile(PROFILE_DIRECTORY)
|
||||
browserEnv = automation.environment()
|
||||
browserEnv["XPCOM_DEBUG_BREAK"] = "warn"
|
||||
browserEnv["MOZ_JAR_LOG_DIR"] = MOZ_JAR_LOG_DIR
|
||||
|
||||
url = "http://localhost:%d/index.html" % PORT
|
||||
appPath = os.path.join(SCRIPT_DIR, automation.DEFAULT_APP)
|
||||
|
|
|
@ -239,7 +239,6 @@ MOZ_UPDATE_XTERM = @MOZ_UPDATE_XTERM@
|
|||
MOZ_MATHML = @MOZ_MATHML@
|
||||
MOZ_PERMISSIONS = @MOZ_PERMISSIONS@
|
||||
MOZ_XTF = @MOZ_XTF@
|
||||
MOZ_NO_INSPECTOR_APIS = @MOZ_NO_INSPECTOR_APIS@
|
||||
MOZ_SVG = @MOZ_SVG@
|
||||
MOZ_CAIRO_CFLAGS = @MOZ_CAIRO_CFLAGS@
|
||||
MOZ_SMIL = @MOZ_SMIL@
|
||||
|
|
|
@ -845,3 +845,5 @@ ifdef TIERS
|
|||
DIRS += $(foreach tier,$(TIERS),$(tier_$(tier)_dirs))
|
||||
STATIC_DIRS += $(foreach tier,$(TIERS),$(tier_$(tier)_staticdirs))
|
||||
endif
|
||||
|
||||
OPTIMIZE_JARS_CMD = $(PYTHON) $(call core_abspath,$(topsrcdir)/config/optimizejars.py)
|
||||
|
|
|
@ -0,0 +1,279 @@
|
|||
# ***** 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 mozilla.org code
|
||||
#
|
||||
# The Initial Developer of the Original Code is
|
||||
# Mozilla Foundation.
|
||||
# Portions created by the Initial Developer are Copyright (C) 2010
|
||||
# the Initial Developer. All Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
# Taras Glek <tglek@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 *****
|
||||
|
||||
import sys, os, subprocess, struct
|
||||
|
||||
local_file_header = [
|
||||
("signature", "uint32"),
|
||||
("min_version", "uint16"),
|
||||
("general_flag", "uint16"),
|
||||
("compression", "uint16"),
|
||||
("lastmod_time", "uint16"),
|
||||
("lastmod_date", "uint16"),
|
||||
("crc32", "uint32"),
|
||||
("compressed_size", "uint32"),
|
||||
("uncompressed_size", "uint32"),
|
||||
("filename_size", "uint16"),
|
||||
("extra_field_size", "uint16"),
|
||||
("filename", "filename_size"),
|
||||
("extra_field", "extra_field_size"),
|
||||
("data", "compressed_size")
|
||||
]
|
||||
|
||||
cdir_entry = [
|
||||
("signature", "uint32"),
|
||||
("creator_version", "uint16"),
|
||||
("min_version", "uint16"),
|
||||
("general_flag", "uint16"),
|
||||
("compression", "uint16"),
|
||||
("lastmod_time", "uint16"),
|
||||
("lastmod_date", "uint16"),
|
||||
("crc32", "uint32"),
|
||||
("compressed_size", "uint32"),
|
||||
("uncompressed_size", "uint32"),
|
||||
("filename_size", "uint16"),
|
||||
("extrafield_size", "uint16"),
|
||||
("filecomment_size", "uint16"),
|
||||
("disknum", "uint16"),
|
||||
("internal_attr", "uint16"),
|
||||
("external_attr", "uint32"),
|
||||
("offset", "uint32"),
|
||||
("filename", "filename_size"),
|
||||
("extrafield", "extrafield_size"),
|
||||
("filecomment", "filecomment_size"),
|
||||
]
|
||||
|
||||
cdir_end = [
|
||||
("signature", "uint32"),
|
||||
("disk_num", "uint16"),
|
||||
("cdir_disk", "uint16"),
|
||||
("disk_entries", "uint16"),
|
||||
("cdir_entries", "uint16"),
|
||||
("cdir_size", "uint32"),
|
||||
("cdir_offset", "uint32"),
|
||||
("comment_size", "uint16"),
|
||||
]
|
||||
|
||||
type_mapping = { "uint32":"I", "uint16":"H"}
|
||||
|
||||
def format_struct (format):
|
||||
string_fields = {}
|
||||
fmt = "<"
|
||||
for (name,value) in iter(format):
|
||||
try:
|
||||
fmt += type_mapping[value][0]
|
||||
except KeyError:
|
||||
string_fields[name] = value
|
||||
return (fmt, string_fields)
|
||||
|
||||
def size_of(format):
|
||||
return struct.calcsize(format_struct(format)[0])
|
||||
|
||||
class MyStruct:
|
||||
def __init__(self, format, string_fields):
|
||||
self.__dict__["struct_members"] = {}
|
||||
self.__dict__["format"] = format
|
||||
self.__dict__["string_fields"] = string_fields
|
||||
|
||||
def addMember(self, name, value):
|
||||
self.__dict__["struct_members"][name] = value
|
||||
|
||||
def __getattr__(self, item):
|
||||
try:
|
||||
return self.__dict__["struct_members"][item]
|
||||
except:
|
||||
pass
|
||||
print("no %s" %item)
|
||||
print(self.__dict__["struct_members"])
|
||||
raise AttributeError
|
||||
|
||||
def __setattr__(self, item, value):
|
||||
if item in self.__dict__["struct_members"]:
|
||||
self.__dict__["struct_members"][item] = value
|
||||
else:
|
||||
raise AttributeError
|
||||
|
||||
def pack(self):
|
||||
extra_data = ""
|
||||
values = []
|
||||
string_fields = self.__dict__["string_fields"]
|
||||
struct_members = self.__dict__["struct_members"]
|
||||
format = self.__dict__["format"]
|
||||
for (name,_) in format:
|
||||
if name in string_fields:
|
||||
extra_data = extra_data + struct_members[name]
|
||||
else:
|
||||
values.append(struct_members[name]);
|
||||
return struct.pack(format_struct(format)[0], *values) + extra_data
|
||||
|
||||
ENDSIG = 0x06054b50
|
||||
|
||||
def assert_true(cond, msg):
|
||||
if not cond:
|
||||
raise Exception(msg)
|
||||
exit(1)
|
||||
|
||||
class BinaryBlob:
|
||||
def __init__(self, f):
|
||||
self.data = open(f, "rb").read()
|
||||
self.offset = 0
|
||||
self.length = len(self.data)
|
||||
|
||||
def readAt(self, pos, length):
|
||||
self.offset = pos + length
|
||||
return self.data[pos:self.offset]
|
||||
|
||||
def read_struct (self, format, offset = None):
|
||||
if offset == None:
|
||||
offset = self.offset
|
||||
(fstr, string_fields) = format_struct(format)
|
||||
size = struct.calcsize(fstr)
|
||||
data = self.readAt(offset, size)
|
||||
ret = struct.unpack(fstr, data)
|
||||
retstruct = MyStruct(format, string_fields)
|
||||
i = 0
|
||||
for (name,_) in iter(format):
|
||||
member_desc = None
|
||||
if not name in string_fields:
|
||||
member_data = ret[i]
|
||||
i = i + 1
|
||||
else:
|
||||
# zip has data fields which are described by other struct fields, this does
|
||||
# additional reads to fill em in
|
||||
member_desc = string_fields[name]
|
||||
member_data = self.readAt(self.offset, retstruct.__getattr__(member_desc))
|
||||
retstruct.addMember(name, member_data)
|
||||
# sanity check serialization code
|
||||
data = self.readAt(offset, self.offset - offset)
|
||||
out_data = retstruct.pack()
|
||||
assert_true(out_data == data, "Serialization fail %d !=%d"% (len(out_data), len(data)))
|
||||
return retstruct
|
||||
|
||||
def optimizejar(log, jar, outjar):
|
||||
entries = open(log).read().rstrip().split("\n")
|
||||
jarblob = BinaryBlob(jar)
|
||||
dirend = jarblob.read_struct(cdir_end, jarblob.length - size_of(cdir_end))
|
||||
assert_true(dirend.signature == ENDSIG, "no signature in the end");
|
||||
|
||||
cdir_offset = dirend.cdir_offset
|
||||
|
||||
jarblob.offset = cdir_offset
|
||||
central_directory = []
|
||||
for i in range(0, dirend.cdir_entries):
|
||||
entry = jarblob.read_struct(cdir_entry)
|
||||
central_directory.append(entry)
|
||||
|
||||
reordered_count = 0
|
||||
dup_guard = set()
|
||||
for ordered_name in entries:
|
||||
if ordered_name in dup_guard:
|
||||
continue
|
||||
else:
|
||||
dup_guard.add(ordered_name)
|
||||
found = False
|
||||
for i in range(reordered_count, len(central_directory)):
|
||||
if central_directory[i].filename == ordered_name:
|
||||
# swap the cdir entries
|
||||
tmp = central_directory[i]
|
||||
central_directory[i] = central_directory[reordered_count]
|
||||
central_directory[reordered_count] = tmp
|
||||
reordered_count = reordered_count + 1
|
||||
found = True
|
||||
break
|
||||
assert_true(found, "Can't find %s in %s\n" %(ordered_name, jar))
|
||||
|
||||
# have to put central directory at offset 1 cos 0 confuses some tools
|
||||
dirend.cdir_offset = 1
|
||||
dirend_data = dirend.pack()
|
||||
outfd = open(outjar, "wb")
|
||||
# make room for central dir + end of dir + 1 extra byte at front
|
||||
out_offset = dirend.cdir_offset + dirend.cdir_size + len(dirend_data)
|
||||
outfd.seek(out_offset)
|
||||
|
||||
cdir_data = ""
|
||||
written_count = 0
|
||||
for entry in central_directory:
|
||||
# read in the header twice..first for comparison, second time for convenience when writing out
|
||||
jarfile = jarblob.read_struct(local_file_header, entry.offset)
|
||||
assert_true(jarfile.filename == entry.filename, "Directory/Localheader mismatch")
|
||||
data = jarfile.pack()
|
||||
outfd.write(data)
|
||||
entry.offset = out_offset
|
||||
out_offset = out_offset + len(data)
|
||||
entry_data = entry.pack()
|
||||
cdir_data += entry_data
|
||||
expected_len = entry.filename_size + entry.extrafield_size + entry.filecomment_size
|
||||
assert_true(len(entry_data) != expected_len,
|
||||
"%s entry size - expected:%d got:%d" % (entry.filename, len(entry_data), expected_len))
|
||||
written_count += 1
|
||||
if written_count == reordered_count:
|
||||
print("%s: startup data ends at byte %d"%( outjar, out_offset));
|
||||
elif written_count < reordered_count:
|
||||
print("%s @ %d" % (entry.filename, entry.offset))
|
||||
|
||||
assert_true(size_of(cdir_end) == len(dirend_data), "Failed to serialize directory end correctly. Serialized size;%d, expected:%d"%(len(dirend_data), size_of(cdir_end)));
|
||||
outfd.write(dirend_data)
|
||||
outfd.seek(dirend.cdir_offset)
|
||||
assert_true(len(cdir_data) == dirend.cdir_size, "Failed to serialize central directory correctly. Serialized size;%d, expected:%d expected-size:%d" % (len(cdir_data), dirend.cdir_size, dirend.cdir_size - len(cdir_data)));
|
||||
outfd.write(cdir_data)
|
||||
outfd.write(dirend_data)
|
||||
outfd.close()
|
||||
print "Ordered %d/%d in %s" % (reordered_count, len(central_directory), outjar)
|
||||
|
||||
if len(sys.argv) != 4:
|
||||
print "Usage: %s JAR_LOG_DIR IN_JAR_DIR OUT_JAR_DIR" % sys.argv[0]
|
||||
exit(1)
|
||||
|
||||
JAR_LOG_DIR = sys.argv[1]
|
||||
IN_JAR_DIR = sys.argv[2]
|
||||
OUT_JAR_DIR = sys.argv[3]
|
||||
|
||||
if not os.path.exists(JAR_LOG_DIR):
|
||||
print "No jar logs found. No jars to optimize."
|
||||
exit(0)
|
||||
|
||||
ls = os.listdir(JAR_LOG_DIR)
|
||||
for logfile in ls:
|
||||
if logfile[-8:] != ".jar.log":
|
||||
continue
|
||||
injarfile = os.path.join(IN_JAR_DIR, logfile[:-4])
|
||||
outjarfile = os.path.join(OUT_JAR_DIR, logfile[:-4])
|
||||
if not os.path.exists(injarfile):
|
||||
print "Warning: Skipping %s, %s doesn't exist" % (logfile, injarfile)
|
||||
continue
|
||||
logfile = os.path.join(JAR_LOG_DIR, logfile)
|
||||
optimizejar(logfile, injarfile, outjarfile)
|
|
@ -13,18 +13,22 @@ TREEHYDRA_MODULES = \
|
|||
$(topsrcdir)/xpcom/analysis/outparams.js \
|
||||
$(topsrcdir)/xpcom/analysis/stack.js \
|
||||
$(topsrcdir)/xpcom/analysis/flow.js \
|
||||
$(topsrcdir)/xpcom/analysis/static-init.js \
|
||||
$(topsrcdir)/js/src/jsstack.js \
|
||||
$(topsrcdir)/layout/generic/frame-verify.js \
|
||||
$(NULL)
|
||||
|
||||
DEHYDRA_ARG_PREFIX=-fplugin-arg-gcc_treehydra-
|
||||
|
||||
DEHYDRA_ARGS = \
|
||||
--topsrcdir=$(topsrcdir) \
|
||||
--objdir=$(DEPTH) \
|
||||
--dehydra-modules=$(subst $(NULL) ,$(COMMA),$(strip $(DEHYDRA_MODULES))) \
|
||||
--treehydra-modules=$(subst $(NULL) ,$(COMMA),$(strip $(TREEHYDRA_MODULES))) \
|
||||
$(DEHYDRA_ARG_PREFIX)script=$(DEHYDRA_SCRIPT) \
|
||||
$(DEHYDRA_ARG_PREFIX)topsrcdir=$(topsrcdir) \
|
||||
$(DEHYDRA_ARG_PREFIX)objdir=$(DEPTH) \
|
||||
$(DEHYDRA_ARG_PREFIX)dehydra-modules=$(subst $(NULL) ,$(COMMA),$(strip $(DEHYDRA_MODULES))) \
|
||||
$(DEHYDRA_ARG_PREFIX)treehydra-modules=$(subst $(NULL) ,$(COMMA),$(strip $(TREEHYDRA_MODULES))) \
|
||||
$(NULL)
|
||||
|
||||
DEHYDRA_FLAGS = -fplugin=$(DEHYDRA_PATH) -fplugin-arg='$(DEHYDRA_SCRIPT) $(DEHYDRA_ARGS)'
|
||||
DEHYDRA_FLAGS = -fplugin=$(DEHYDRA_PATH) $(DEHYDRA_ARGS)
|
||||
|
||||
ifdef DEHYDRA_PATH
|
||||
OS_CXXFLAGS += $(DEHYDRA_FLAGS)
|
||||
|
|
|
@ -10,9 +10,6 @@ function treehydra_enabled() {
|
|||
return this.hasOwnProperty('TREE_CODE');
|
||||
}
|
||||
|
||||
include('unstable/getopt.js');
|
||||
[options, args] = getopt();
|
||||
|
||||
sys.include_path.push(options.topsrcdir);
|
||||
|
||||
include('string-format.js');
|
||||
|
@ -71,17 +68,55 @@ function signaturesMatch(m1, m2)
|
|||
|
||||
let p1 = m1.type.parameters;
|
||||
let p2 = m2.type.parameters;
|
||||
|
||||
|
||||
if (p1.length != p2.length)
|
||||
return false;
|
||||
|
||||
for (let i = 0; i < p1.length; ++i)
|
||||
if (p1[i] !== p2[i])
|
||||
if (!params_match(p1[i], p2[i]))
|
||||
return false;
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function params_match(p1, p2)
|
||||
{
|
||||
[p1, p2] = unwrap_types(p1, p2);
|
||||
|
||||
for (let i in p1)
|
||||
if (i == "type" && !types_match(p1.type, p2.type))
|
||||
return false;
|
||||
else if (i != "type" && p1[i] !== p2[i])
|
||||
return false;
|
||||
|
||||
for (let i in p2)
|
||||
if (!(i in p1))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function types_match(t1, t2)
|
||||
{
|
||||
if (!t1 || !t2)
|
||||
return false;
|
||||
|
||||
[t1, t2] = unwrap_types(t1, t2);
|
||||
|
||||
return t1 === t2;
|
||||
}
|
||||
|
||||
function unwrap_types(t1, t2)
|
||||
{
|
||||
while (t1.variantOf)
|
||||
t1 = t1.variantOf;
|
||||
|
||||
while (t2.variantOf)
|
||||
t2 = t2.variantOf;
|
||||
|
||||
return [t1, t2];
|
||||
}
|
||||
|
||||
const forward_functions = [
|
||||
'process_type',
|
||||
'process_tree_type',
|
||||
|
|
|
@ -4559,7 +4559,7 @@ MOZ_ARG_WITH_BOOL(system-nspr,
|
|||
_USE_SYSTEM_NSPR=1 )
|
||||
|
||||
if test -n "$_USE_SYSTEM_NSPR"; then
|
||||
AM_PATH_NSPR(4.8.0, [MOZ_NATIVE_NSPR=1], [MOZ_NATIVE_NSPR=])
|
||||
AM_PATH_NSPR(4.8.6, [MOZ_NATIVE_NSPR=1], [MOZ_NATIVE_NSPR=])
|
||||
fi
|
||||
|
||||
if test -n "$MOZ_NATIVE_NSPR"; then
|
||||
|
@ -4878,7 +4878,6 @@ MOZ_MORK=
|
|||
MOZ_MORKREADER=1
|
||||
MOZ_AUTH_EXTENSION=1
|
||||
MOZ_NO_ACTIVEX_SUPPORT=1
|
||||
MOZ_NO_INSPECTOR_APIS=
|
||||
MOZ_NO_FAST_LOAD=
|
||||
MOZ_OGG=1
|
||||
MOZ_RAW=1
|
||||
|
@ -5741,7 +5740,7 @@ dnl ========================================================
|
|||
dnl = Disable building dbm
|
||||
dnl ========================================================
|
||||
MOZ_ARG_DISABLE_BOOL(dbm,
|
||||
[ --disable-dbm Disable building dbm],
|
||||
[ --disable-dbm Disable building dbm],
|
||||
NSS_DISABLE_DBM=1,
|
||||
NSS_DISABLE_DBM=)
|
||||
|
||||
|
@ -5891,7 +5890,7 @@ dnl ========================================================
|
|||
dnl = Disable VP8 decoder support
|
||||
dnl ========================================================
|
||||
MOZ_ARG_DISABLE_BOOL(webm,
|
||||
[ --disable-webm Disable support for WebM media (VP8 video and Vorbis audio)],
|
||||
[ --disable-webm Disable support for WebM media (VP8 video and Vorbis audio)],
|
||||
MOZ_WEBM=,
|
||||
MOZ_WEBM=1)
|
||||
|
||||
|
@ -8703,7 +8702,6 @@ AC_SUBST(MOZ_AUTH_EXTENSION)
|
|||
AC_SUBST(MOZ_MATHML)
|
||||
AC_SUBST(MOZ_PERMISSIONS)
|
||||
AC_SUBST(MOZ_XTF)
|
||||
AC_SUBST(MOZ_NO_INSPECTOR_APIS)
|
||||
AC_SUBST(MOZ_PREF_EXTENSIONS)
|
||||
AC_SUBST(MOZ_SVG)
|
||||
AC_SUBST(MOZ_SMIL)
|
||||
|
|
|
@ -379,7 +379,6 @@ GK_ATOM(flex, "flex")
|
|||
GK_ATOM(flexgroup, "flexgroup")
|
||||
GK_ATOM(floating, "floating")
|
||||
GK_ATOM(floatList, "Float-list")
|
||||
GK_ATOM(floatContinuationsList, "FloatContinuations-list")
|
||||
GK_ATOM(floor, "floor")
|
||||
GK_ATOM(focus, "focus")
|
||||
GK_ATOM(following, "following")
|
||||
|
@ -780,6 +779,7 @@ GK_ATOM(prompt, "prompt")
|
|||
GK_ATOM(propagate, "propagate")
|
||||
GK_ATOM(properties, "properties")
|
||||
GK_ATOM(property, "property")
|
||||
GK_ATOM(pushedFloatsList, "PushedFloats-list")
|
||||
GK_ATOM(q, "q")
|
||||
GK_ATOM(query, "query")
|
||||
GK_ATOM(queryset, "queryset")
|
||||
|
|
|
@ -43,10 +43,9 @@
|
|||
#include "nsIDocShell.h"
|
||||
#include "gfxPattern.h"
|
||||
|
||||
// {b96168fd-6f13-4ca7-b820-e96f22e71fe5}
|
||||
// {EC90F32E-7848-4819-A1E3-02E64C682A72}
|
||||
#define NS_ICANVASRENDERINGCONTEXTINTERNAL_IID \
|
||||
{ 0xb96168fd, 0x6f13, 0x4ca7, \
|
||||
{ 0xb8, 0x20, 0xe9, 0x6f, 0x22, 0xe7, 0x1f, 0xe5 } }
|
||||
{ 0xec90f32e, 0x7848, 0x4819, { 0xa1, 0xe3, 0x2, 0xe6, 0x4c, 0x68, 0x2a, 0x72 } }
|
||||
|
||||
class nsHTMLCanvasElement;
|
||||
class gfxContext;
|
||||
|
@ -102,6 +101,10 @@ public:
|
|||
// defaults to false (not opaque).
|
||||
NS_IMETHOD SetIsOpaque(PRBool isOpaque) = 0;
|
||||
|
||||
// Invalidate this context and release any held resources, in preperation
|
||||
// for possibly reinitializing with SetDimensions/InitializeWithSurface.
|
||||
NS_IMETHOD Reset() = 0;
|
||||
|
||||
// Return the CanvasLayer for this context, creating
|
||||
// one for the given layer manager if not available.
|
||||
virtual already_AddRefed<CanvasLayer> GetCanvasLayer(CanvasLayer *aOldLayer,
|
||||
|
|
|
@ -279,6 +279,8 @@ public:
|
|||
NS_IMETHOD SetDimensions(PRInt32 width, PRInt32 height);
|
||||
NS_IMETHOD InitializeWithSurface(nsIDocShell *docShell, gfxASurface *surface, PRInt32 width, PRInt32 height)
|
||||
{ return NS_ERROR_NOT_IMPLEMENTED; }
|
||||
NS_IMETHOD Reset()
|
||||
{ /* (InitializeWithSurface) */ return NS_ERROR_NOT_IMPLEMENTED; }
|
||||
NS_IMETHOD Render(gfxContext *ctx, gfxPattern::GraphicsFilter f);
|
||||
NS_IMETHOD GetInputStream(const char* aMimeType,
|
||||
const PRUnichar* aEncoderOptions,
|
||||
|
|
|
@ -420,6 +420,7 @@ public:
|
|||
nsIInputStream **aStream);
|
||||
NS_IMETHOD GetThebesSurface(gfxASurface **surface);
|
||||
NS_IMETHOD SetIsOpaque(PRBool isOpaque);
|
||||
NS_IMETHOD Reset();
|
||||
already_AddRefed<CanvasLayer> GetCanvasLayer(CanvasLayer *aOldLayer,
|
||||
LayerManager *aManager);
|
||||
void MarkContextClean();
|
||||
|
@ -467,9 +468,6 @@ protected:
|
|||
*/
|
||||
static PRUint8 (*sPremultiplyTable)[256];
|
||||
|
||||
// destroy thebes/image stuff, in preparation for possibly recreating
|
||||
void Destroy();
|
||||
|
||||
// Some helpers. Doesn't modify acolor on failure.
|
||||
nsresult SetStyleFromStringOrInterface(const nsAString& aStr, nsISupports *aInterface, Style aWhichStyle);
|
||||
nsresult GetStyleAsStringOrInterface(nsAString& aStr, nsISupports **aInterface, PRInt32 *aType, Style aWhichStyle);
|
||||
|
@ -842,7 +840,7 @@ nsCanvasRenderingContext2D::nsCanvasRenderingContext2D()
|
|||
|
||||
nsCanvasRenderingContext2D::~nsCanvasRenderingContext2D()
|
||||
{
|
||||
Destroy();
|
||||
Reset();
|
||||
|
||||
#ifdef MOZ_IPC
|
||||
ContentParent* allocator = ContentParent::GetSingleton(PR_FALSE);
|
||||
|
@ -862,8 +860,8 @@ nsCanvasRenderingContext2D::~nsCanvasRenderingContext2D()
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
nsCanvasRenderingContext2D::Destroy()
|
||||
nsresult
|
||||
nsCanvasRenderingContext2D::Reset()
|
||||
{
|
||||
#ifdef MOZ_IPC
|
||||
ContentParent* allocator = ContentParent::GetSingleton(PR_FALSE);
|
||||
|
@ -882,6 +880,7 @@ nsCanvasRenderingContext2D::Destroy()
|
|||
mThebes = nsnull;
|
||||
mValid = PR_FALSE;
|
||||
mIsEntireFrameInvalid = PR_FALSE;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult
|
||||
|
@ -1083,7 +1082,7 @@ nsCanvasRenderingContext2D::Redraw(const gfxRect& r)
|
|||
NS_IMETHODIMP
|
||||
nsCanvasRenderingContext2D::SetDimensions(PRInt32 width, PRInt32 height)
|
||||
{
|
||||
Destroy();
|
||||
Reset();
|
||||
|
||||
nsRefPtr<gfxASurface> surface;
|
||||
|
||||
|
@ -1144,7 +1143,7 @@ nsCanvasRenderingContext2D::SetDimensions(PRInt32 width, PRInt32 height)
|
|||
|
||||
NS_IMETHODIMP
|
||||
nsCanvasRenderingContext2D::InitializeWithSurface(nsIDocShell *docShell, gfxASurface *surface, PRInt32 width, PRInt32 height) {
|
||||
Destroy();
|
||||
Reset();
|
||||
|
||||
NS_ASSERTION(!docShell ^ !mCanvasElement, "Cannot set both docshell and canvas element");
|
||||
mDocShell = docShell;
|
||||
|
|
|
@ -3292,6 +3292,7 @@ nsEventStateManager::PostHandleEvent(nsPresContext* aPresContext,
|
|||
|
||||
//Reset target frame to null to avoid mistargeting after reentrant event
|
||||
mCurrentTarget = nsnull;
|
||||
mCurrentTargetContent = nsnull;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -3611,6 +3612,7 @@ nsEventStateManager::DispatchMouseEvent(nsGUIEvent* aEvent, PRUint32 aMessage,
|
|||
event.inputSource = static_cast<nsMouseEvent*>(aEvent)->inputSource;
|
||||
|
||||
mCurrentTargetContent = aTargetContent;
|
||||
mCurrentTarget = nsnull;
|
||||
|
||||
nsIFrame* targetFrame = nsnull;
|
||||
if (aTargetContent) {
|
||||
|
@ -3627,6 +3629,7 @@ nsEventStateManager::DispatchMouseEvent(nsGUIEvent* aEvent, PRUint32 aMessage,
|
|||
}
|
||||
|
||||
mCurrentTargetContent = nsnull;
|
||||
mCurrentTarget = nsnull;
|
||||
|
||||
return targetFrame;
|
||||
}
|
||||
|
@ -3791,6 +3794,7 @@ nsEventStateManager::GenerateMouseEnterExit(nsGUIEvent* aEvent)
|
|||
|
||||
// reset mCurretTargetContent to what it was
|
||||
mCurrentTargetContent = targetBeforeEvent;
|
||||
mCurrentTarget = nsnull;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -79,7 +79,6 @@ _TEST_FILES = \
|
|||
test_bug428988.html \
|
||||
bug457672.html \
|
||||
test_draggableprop.html \
|
||||
test_dragstart.html \
|
||||
test_bug489671.html \
|
||||
test_bug493251.html \
|
||||
test_bug502818.html \
|
||||
|
@ -93,6 +92,13 @@ _TEST_FILES = \
|
|||
test_bug556493.html \
|
||||
$(NULL)
|
||||
|
||||
#bug 585630
|
||||
ifneq (mobile,$(MOZ_BUILD_APP))
|
||||
_TEST_FILES += \
|
||||
test_dragstart.html \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
_CHROME_FILES = \
|
||||
test_bug415498.xul \
|
||||
bug415498-doc1.html \
|
||||
|
|
|
@ -281,8 +281,12 @@ nsEditor::Init(nsIDOMDocument *aDoc, nsIPresShell* aPresShell, nsIContent *aRoot
|
|||
NS_IMETHODIMP
|
||||
nsEditor::PostCreate()
|
||||
{
|
||||
// Synchronize some stuff for the flags
|
||||
nsresult rv = SetFlags(mFlags);
|
||||
// Synchronize some stuff for the flags. SetFlags() will initialize
|
||||
// something by the flag difference. This is first time of that, so, all
|
||||
// initializations must be run. For such reason, we need to invert mFlags
|
||||
// value first.
|
||||
mFlags = ~mFlags;
|
||||
nsresult rv = SetFlags(~mFlags);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
// Set up listeners
|
||||
|
@ -368,9 +372,7 @@ nsEditor::GetDesiredSpellCheckState()
|
|||
return PR_FALSE; // Spellchecking forced off globally
|
||||
}
|
||||
|
||||
// Check for password/readonly/disabled, which are not spellchecked
|
||||
// regardless of DOM
|
||||
if (IsPasswordEditor() || IsReadonly() || IsDisabled()) {
|
||||
if (!CanEnableSpellCheck()) {
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
|
@ -443,6 +445,11 @@ nsEditor::GetFlags(PRUint32 *aFlags)
|
|||
NS_IMETHODIMP
|
||||
nsEditor::SetFlags(PRUint32 aFlags)
|
||||
{
|
||||
if (mFlags == aFlags) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
PRBool spellcheckerWasEnabled = CanEnableSpellCheck();
|
||||
mFlags = aFlags;
|
||||
|
||||
if (!mDocWeak || !mPresShellWeak) {
|
||||
|
@ -452,9 +459,11 @@ nsEditor::SetFlags(PRUint32 aFlags)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
// Changing the flags can change whether spellchecking is on, so re-sync it
|
||||
nsresult rv = SyncRealTimeSpell();
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
// The flag change may cause the spellchecker state change
|
||||
if (CanEnableSpellCheck() != spellcheckerWasEnabled) {
|
||||
nsresult rv = SyncRealTimeSpell();
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
|
||||
// Might be changing editable state, so, we need to reset current IME state
|
||||
// if we're focused and the flag change causes IME state change.
|
||||
|
@ -462,7 +471,7 @@ nsEditor::SetFlags(PRUint32 aFlags)
|
|||
// Use "enable" for the default value because if IME is disabled
|
||||
// unexpectedly, it makes serious a11y problem.
|
||||
PRUint32 newState = nsIContent::IME_STATUS_ENABLE;
|
||||
rv = GetPreferredIMEState(&newState);
|
||||
nsresult rv = GetPreferredIMEState(&newState);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
// NOTE: When the enabled state isn't going to be modified, this method
|
||||
// is going to do nothing.
|
||||
|
|
|
@ -360,6 +360,13 @@ protected:
|
|||
|
||||
nsKeyEvent* GetNativeKeyEvent(nsIDOMKeyEvent* aDOMKeyEvent);
|
||||
|
||||
PRBool CanEnableSpellCheck()
|
||||
{
|
||||
// Check for password/readonly/disabled, which are not spellchecked
|
||||
// regardless of DOM
|
||||
return !IsPasswordEditor() && !IsReadonly() && !IsDisabled();
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
/** All editor operations which alter the doc should be prefaced
|
||||
|
|
|
@ -114,7 +114,11 @@
|
|||
#include "nsIDOMSVGImageElement.h"
|
||||
#include "nsIDOMSVGScriptElement.h"
|
||||
#endif // MOZ_SVG
|
||||
|
||||
#ifdef MOZ_MEDIA
|
||||
#include "nsIDOMHTMLSourceElement.h"
|
||||
#include "nsIDOMHTMLMediaElement.h"
|
||||
#endif // MOZ_MEDIA
|
||||
|
||||
#include "nsIImageLoadingContent.h"
|
||||
|
||||
#include "ftpCore.h"
|
||||
|
@ -2796,6 +2800,21 @@ nsresult nsWebBrowserPersist::OnWalkDOMNode(nsIDOMNode *aNode)
|
|||
}
|
||||
#endif // MOZ_SVG
|
||||
|
||||
#ifdef MOZ_MEDIA
|
||||
nsCOMPtr<nsIDOMHTMLMediaElement> nodeAsMedia = do_QueryInterface(aNode);
|
||||
if (nodeAsMedia)
|
||||
{
|
||||
StoreURIAttribute(aNode, "src");
|
||||
return NS_OK;
|
||||
}
|
||||
nsCOMPtr<nsIDOMHTMLSourceElement> nodeAsSource = do_QueryInterface(aNode);
|
||||
if (nodeAsSource)
|
||||
{
|
||||
StoreURIAttribute(aNode, "src");
|
||||
return NS_OK;
|
||||
}
|
||||
#endif // MOZ_MEDIA
|
||||
|
||||
nsCOMPtr<nsIDOMHTMLBodyElement> nodeAsBody = do_QueryInterface(aNode);
|
||||
if (nodeAsBody)
|
||||
{
|
||||
|
@ -3145,6 +3164,32 @@ nsWebBrowserPersist::CloneNodeWithFixedUpAttributes(
|
|||
return rv;
|
||||
}
|
||||
|
||||
#ifdef MOZ_MEDIA
|
||||
nsCOMPtr<nsIDOMHTMLMediaElement> nodeAsMedia = do_QueryInterface(aNodeIn);
|
||||
if (nodeAsMedia)
|
||||
{
|
||||
rv = GetNodeToFixup(aNodeIn, aNodeOut);
|
||||
if (NS_SUCCEEDED(rv) && *aNodeOut)
|
||||
{
|
||||
FixupNodeAttribute(*aNodeOut, "src");
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDOMHTMLSourceElement> nodeAsSource = do_QueryInterface(aNodeIn);
|
||||
if (nodeAsSource)
|
||||
{
|
||||
rv = GetNodeToFixup(aNodeIn, aNodeOut);
|
||||
if (NS_SUCCEEDED(rv) && *aNodeOut)
|
||||
{
|
||||
FixupNodeAttribute(*aNodeOut, "src");
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
#endif // MOZ_MEDIA
|
||||
|
||||
#ifdef MOZ_SVG
|
||||
nsCOMPtr<nsIDOMSVGImageElement> nodeAsSVGImage = do_QueryInterface(aNodeIn);
|
||||
if (nodeAsSVGImage)
|
||||
|
|
Двоичный файл не отображается.
|
@ -46,6 +46,9 @@ include $(topsrcdir)/config/rules.mk
|
|||
_TEST_FILES = \
|
||||
test_bug293834.html \
|
||||
bug293834_form.html \
|
||||
320x240.ogv \
|
||||
test_bug449141.html \
|
||||
bug449141_page.html \
|
||||
test_bug499115.html \
|
||||
test_nsFind.html \
|
||||
$(NULL)
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
<!DOCTYPE html>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>Nested iframe for bug 449141</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
</head>
|
||||
<body>
|
||||
<video src='320x240.ogv'></video>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,107 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=449141
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 449141</title>
|
||||
<script type="text/javascript" src="/MochiKit/packed.js"></script>
|
||||
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=449141">Mozilla Bug 449141</a>
|
||||
<p id="display">
|
||||
|
||||
</p>
|
||||
<pre id="results"></pre>
|
||||
<div id="content" style="display: none">
|
||||
<iframe src="bug449141_page.html" id="source"></iframe>
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
/** Test for Bug 449141 **/
|
||||
|
||||
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
|
||||
const Cc = Components.classes;
|
||||
const Ci = Components.interfaces;
|
||||
|
||||
function getTempDir() {
|
||||
return Cc["@mozilla.org/file/directory_service;1"]
|
||||
.getService(Ci.nsIProperties)
|
||||
.get("TmpD", Ci.nsILocalFile);
|
||||
}
|
||||
|
||||
// STATE_STOP from nsIWebProgressListener.idl
|
||||
const STATE_STOP = 0x00000010;
|
||||
|
||||
var progressListener = {
|
||||
onProgressChange: function() {
|
||||
/* Ignore progress callback */
|
||||
},
|
||||
onStateChange: function(aProgress, aRequest, aStateFlag, aStatus) {
|
||||
if (aStateFlag & STATE_STOP) {
|
||||
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
|
||||
var dirExists = false;
|
||||
var videoExists = false;
|
||||
|
||||
var videoFile = getTempDir();
|
||||
videoFile.append(this.dirName);
|
||||
dirExists = videoFile.exists();
|
||||
videoFile.append("320x240.ogv");
|
||||
videoExists = videoFile.exists();
|
||||
this.folder.remove(true);
|
||||
this.file.remove(false);
|
||||
ok(dirExists, 'Directory containing video file should be created');
|
||||
ok(videoExists, 'Video should be persisted with document');
|
||||
SimpleTest.finish();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function persistDocument(aDoc) {
|
||||
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
|
||||
|
||||
const nsIWBP = Ci.nsIWebBrowserPersist;
|
||||
const persistFlags =
|
||||
nsIWBP.PERSIST_FLAGS_REPLACE_EXISTING_FILES
|
||||
| nsIWBP.PERSIST_FLAGS_AUTODETECT_APPLY_CONVERSION
|
||||
const encodingFlags =
|
||||
nsIWBP.ENCODE_FLAGS_ENCODE_BASIC_ENTITIES;
|
||||
|
||||
var ioService = Components.classes["@mozilla.org/network/io-service;1"]
|
||||
.getService(Ci.nsIIOService);
|
||||
|
||||
var id = Math.round(Math.random() * 10000);
|
||||
var dirName = "bug449141_serialized" + id;
|
||||
progressListener.dirName = dirName;
|
||||
|
||||
var file = getTempDir();
|
||||
file.append("bug449141-serialized" + id + ".html");
|
||||
|
||||
var persist = Cc["@mozilla.org/embedding/browser/nsWebBrowserPersist;1"]
|
||||
.createInstance(Ci.nsIWebBrowserPersist);
|
||||
persist.progressListener = progressListener;
|
||||
persist.persistFlags = persistFlags;
|
||||
const kWrapColumn = 80;
|
||||
var folder = getTempDir();
|
||||
folder.append(dirName);
|
||||
progressListener.folder = folder;
|
||||
progressListener.file = file;
|
||||
persist.saveDocument(aDoc, ioService.newFileURI(file),
|
||||
folder,
|
||||
aDoc.contentType,
|
||||
encodingFlags, kWrapColumn);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
addLoadEvent(function() {
|
||||
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
|
||||
var srcDoc = document.getElementById('source').contentDocument;
|
||||
persistDocument(srcDoc);
|
||||
});
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
|
@ -238,6 +238,7 @@ cairo_d2d_create_device_from_d3d10device(ID3D10Device1 *d3d10device)
|
|||
memset(&rastDesc, 0, sizeof(rastDesc));
|
||||
rastDesc.CullMode = D3D10_CULL_NONE;
|
||||
rastDesc.FillMode = D3D10_FILL_SOLID;
|
||||
rastDesc.DepthClipEnable = TRUE;
|
||||
hr = device->mD3D10Device->CreateRasterizerState(&rastDesc, &device->mRasterizerState);
|
||||
if (FAILED(hr)) {
|
||||
goto FAILED;
|
||||
|
|
|
@ -128,9 +128,13 @@ public:
|
|||
}
|
||||
|
||||
NS_IMETHOD GetMemoryUsed(PRInt64 *memoryUsed) {
|
||||
*memoryUsed = cairo_d2d_get_surface_vram_usage(
|
||||
gfxWindowsPlatform::GetPlatform()->GetD2DDevice()
|
||||
);
|
||||
cairo_device_t *device =
|
||||
gfxWindowsPlatform::GetPlatform()->GetD2DDevice();
|
||||
if (device) {
|
||||
*memoryUsed = cairo_d2d_get_surface_vram_usage(device);
|
||||
} else {
|
||||
*memoryUsed = 0;
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -54,6 +54,7 @@ SIMPLE_PROGRAMS = $(CPPSRCS:.cpp=$(BIN_SUFFIX))
|
|||
|
||||
LIBS = \
|
||||
$(DIST)/lib/$(LIB_PREFIX)xpcomglue_s.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/$(LIB_PREFIX)unicharutil_external_s.$(LIB_SUFFIX) \
|
||||
$(XPCOM_LIBS) \
|
||||
$(NSPR_LIBS) \
|
||||
$(NULL)
|
||||
|
|
|
@ -52,8 +52,8 @@
|
|||
#include "nsCOMPtr.h"
|
||||
#include "nsIUnicodeNormalizer.h"
|
||||
#include "nsStringAPI.h"
|
||||
#include "nsUnicharUtils.h"
|
||||
|
||||
NS_DEFINE_CID(kUnicharUtilCID, NS_UNICHARUTIL_CID);
|
||||
NS_DEFINE_CID(kEntityConverterCID, NS_ENTITYCONVERTER_CID);
|
||||
NS_DEFINE_CID(kSaveAsCharsetCID, NS_SAVEASCHARSET_CID);
|
||||
NS_DEFINE_CID(kUnicodeNormalizerCID, NS_UNICODE_NORMALIZER_CID);
|
||||
|
@ -284,104 +284,63 @@ static PRUnichar t4result[T4LEN+2] = {
|
|||
|
||||
void TestCaseConversion()
|
||||
{
|
||||
printf("==============================\n");
|
||||
printf("Start nsICaseConversion Test \n");
|
||||
printf("==============================\n");
|
||||
nsICaseConversion *t = NULL;
|
||||
nsresult res;
|
||||
res = CallGetService(kUnicharUtilCID, &t);
|
||||
|
||||
printf("Test 1 - GetService():\n");
|
||||
if(NS_FAILED(res) || ( t == NULL ) ) {
|
||||
printf("\t1st GetService failed\n");
|
||||
} else {
|
||||
NS_RELEASE(t);
|
||||
}
|
||||
printf("==========================\n");
|
||||
printf("Start case conversion test\n");
|
||||
printf("==========================\n");
|
||||
|
||||
res = CallGetService(kUnicharUtilCID, &t);
|
||||
|
||||
if(NS_FAILED(res) || ( t == NULL ) ) {
|
||||
printf("\t2nd GetService failed\n");
|
||||
} else {
|
||||
int i;
|
||||
PRUnichar ch;
|
||||
PRUnichar buf[256];
|
||||
int i;
|
||||
PRUnichar buf[256];
|
||||
|
||||
printf("Test 2 - ToUpper(PRUnichar, PRUnichar*):\n");
|
||||
for(i=0;i < T2LEN ; i++)
|
||||
{
|
||||
res = t->ToUpper(t2data[i], &ch);
|
||||
if(NS_FAILED(res)) {
|
||||
printf("\tFailed!! return value != NS_OK\n");
|
||||
break;
|
||||
}
|
||||
if(ch != t2result[i])
|
||||
printf("\tFailed!! result unexpected %d\n", i);
|
||||
printf("Test 2 - ToUpper(PRUnichar, PRUnichar*):\n");
|
||||
for(i=0;i < T2LEN ; i++)
|
||||
{
|
||||
PRUnichar ch = ToUpperCase(t2data[i]);
|
||||
if(ch != t2result[i])
|
||||
printf("\tFailed!! result unexpected %d\n", i);
|
||||
}
|
||||
|
||||
|
||||
printf("Test 3 - ToLower(PRUnichar, PRUnichar*):\n");
|
||||
for(i=0;i < T3LEN; i++)
|
||||
{
|
||||
PRUnichar ch = ToLowerCase(t3data[i]);
|
||||
if(ch != t3result[i])
|
||||
printf("\tFailed!! result unexpected %d\n", i);
|
||||
}
|
||||
|
||||
printf("Test 4 - ToTitle(PRUnichar, PRUnichar*):\n");
|
||||
for(i=0;i < T4LEN; i++)
|
||||
{
|
||||
PRUnichar ch = ToTitleCase(t4data[i]);
|
||||
if(ch != t4result[i])
|
||||
printf("\tFailed!! result unexpected %d\n", i);
|
||||
}
|
||||
|
||||
printf("Test 5 - ToUpper(PRUnichar*, PRUnichar*, PRUint32):\n");
|
||||
ToUpperCase(t2data, buf, T2LEN);
|
||||
for(i = 0; i < T2LEN; i++)
|
||||
{
|
||||
if(buf[i] != t2result[i])
|
||||
{
|
||||
printf("\tFailed!! result unexpected %d\n", i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
printf("Test 3 - ToLower(PRUnichar, PRUnichar*):\n");
|
||||
for(i=0;i < T3LEN; i++)
|
||||
{
|
||||
res = t->ToLower(t3data[i], &ch);
|
||||
if(NS_FAILED(res)) {
|
||||
printf("\tFailed!! return value != NS_OK\n");
|
||||
break;
|
||||
}
|
||||
if(ch != t3result[i])
|
||||
printf("\tFailed!! result unexpected %d\n", i);
|
||||
printf("Test 6 - ToLower(PRUnichar*, PRUnichar*, PRUint32):\n");
|
||||
ToLowerCase(t3data, buf, T3LEN);
|
||||
for(i = 0; i < T3LEN; i++)
|
||||
{
|
||||
if(buf[i] != t3result[i])
|
||||
{
|
||||
printf("\tFailed!! result unexpected %d\n", i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
printf("Test 4 - ToTitle(PRUnichar, PRUnichar*):\n");
|
||||
for(i=0;i < T4LEN; i++)
|
||||
{
|
||||
res = t->ToTitle(t4data[i], &ch);
|
||||
if(NS_FAILED(res)) {
|
||||
printf("\tFailed!! return value != NS_OK\n");
|
||||
break;
|
||||
}
|
||||
if(ch != t4result[i])
|
||||
printf("\tFailed!! result unexpected %d\n", i);
|
||||
}
|
||||
|
||||
|
||||
printf("Test 5 - ToUpper(PRUnichar*, PRUnichar*, PRUint32):\n");
|
||||
res = t->ToUpper(t2data, buf, T2LEN);
|
||||
if(NS_FAILED(res)) {
|
||||
printf("\tFailed!! return value != NS_OK\n");
|
||||
} else {
|
||||
for(i = 0; i < T2LEN; i++)
|
||||
{
|
||||
if(buf[i] != t2result[i])
|
||||
{
|
||||
printf("\tFailed!! result unexpected %d\n", i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
printf("Test 6 - ToLower(PRUnichar*, PRUnichar*, PRUint32):\n");
|
||||
res = t->ToLower(t3data, buf, T3LEN);
|
||||
if(NS_FAILED(res)) {
|
||||
printf("\tFailed!! return value != NS_OK\n");
|
||||
} else {
|
||||
for(i = 0; i < T3LEN; i++)
|
||||
{
|
||||
if(buf[i] != t3result[i])
|
||||
{
|
||||
printf("\tFailed!! result unexpected %d\n", i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
NS_RELEASE(t);
|
||||
}
|
||||
printf("==============================\n");
|
||||
printf("Finish nsICaseConversion Test \n");
|
||||
printf("==============================\n");
|
||||
|
||||
printf("===========================\n");
|
||||
printf("Finish case conversion test\n");
|
||||
printf("===========================\n");
|
||||
}
|
||||
|
||||
static void TestEntityConversion(PRUint32 version)
|
||||
|
|
|
@ -46,7 +46,7 @@ NEED_MDDEPDIR = 1
|
|||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
REDGREEN_FAILURE_TESTCASES = \
|
||||
REDGREEN_WARNING_TESTCASES = \
|
||||
green-callred.cpp \
|
||||
green-accessred.cpp \
|
||||
green-tored-badpath.cpp \
|
||||
|
@ -72,8 +72,8 @@ REDGREEN_SUCCESS_TESTCASES = \
|
|||
green-toredptr.cpp \
|
||||
$(NULL)
|
||||
|
||||
STATIC_FAILURE_TESTCASES = \
|
||||
$(REDGREEN_FAILURE_TESTCASES) \
|
||||
STATIC_WARNING_TESTCASES = \
|
||||
$(REDGREEN_WARNING_TESTCASES) \
|
||||
$(NULL)
|
||||
|
||||
STATIC_PASS_TESTCASES = \
|
||||
|
@ -85,19 +85,23 @@ include $(topsrcdir)/config/rules.mk
|
|||
LOCAL_INCLUDES += -I$(srcdir)/.. -I..
|
||||
|
||||
check:: \
|
||||
$(STATIC_FAILURE_TESTCASES:.cpp=.s-fail) \
|
||||
$(STATIC_WARNING_TESTCASES:.cpp=.s-warn) \
|
||||
$(STATIC_PASS_TESTCASES:.cpp=.s-pass) \
|
||||
$(NULL)
|
||||
|
||||
# We want to compile each file and invert the result to ensure that
|
||||
# compilation failed.
|
||||
%.s-fail: %.cpp $(GLOBAL_DEPS) $(DEHYDRA_SCRIPTS)
|
||||
%.s-warn: %.cpp $(GLOBAL_DEPS) $(DEHYDRA_SCRIPTS)
|
||||
@printf "Compiling $(<F) to check that the static-analysis script is checking properly..."
|
||||
@if $(CCC) $(OUTOPTION)/dev/null -S $(COMPILE_CXXFLAGS) $(_VPATH_SRCS) >$(*F).errlog 2>&1; then \
|
||||
printf "fail:\nerror: compilation of $(<F) succeeded. It shouldn't have!\n"; \
|
||||
@if $(CCC) -Werror $(OUTOPTION)/dev/null -S $(COMPILE_CXXFLAGS) $(_VPATH_SRCS) >$(*F).errlog 2>&1; then \
|
||||
printf "fail:\nerror: compilation of $(<F) succeeded with -Werror. It shouldn't have!\n"; \
|
||||
exit 1; \
|
||||
else \
|
||||
fi
|
||||
@if $(CCC) $(OUTOPTION)/dev/null -S $(COMPILE_CXXFLAGS) $(_VPATH_SRCS) >$(*F).werrlog 2>&1; then \
|
||||
printf "ok.\n"; \
|
||||
else \
|
||||
printf "fail:\nerror: compilation of $(<F) without -Werror failed. A warning should have been issued.\n"; \
|
||||
exit 1; \
|
||||
fi
|
||||
|
||||
%.s-pass: %.cpp $(GLOBAL_DEPS) $(DEHYDRA_SCRIPTS)
|
||||
|
|
|
@ -845,3 +845,5 @@ ifdef TIERS
|
|||
DIRS += $(foreach tier,$(TIERS),$(tier_$(tier)_dirs))
|
||||
STATIC_DIRS += $(foreach tier,$(TIERS),$(tier_$(tier)_staticdirs))
|
||||
endif
|
||||
|
||||
OPTIMIZE_JARS_CMD = $(PYTHON) $(call core_abspath,$(topsrcdir)/config/optimizejars.py)
|
||||
|
|
|
@ -7,14 +7,17 @@ TREEHYDRA_MODULES = \
|
|||
$(topsrcdir)/jsstack.js \
|
||||
$(NULL)
|
||||
|
||||
DEHYDRA_ARG_PREFIX=-fplugin-arg-gcc_treehydra-
|
||||
|
||||
DEHYDRA_ARGS = \
|
||||
--topsrcdir=$(topsrcdir) \
|
||||
--objdir=$(DEPTH) \
|
||||
--dehydra-modules=$(subst $(NULL) ,$(COMMA),$(strip $(DEHYDRA_MODULES))) \
|
||||
--treehydra-modules=$(subst $(NULL) ,$(COMMA),$(strip $(TREEHYDRA_MODULES))) \
|
||||
$(DEHYDRA_ARG_PREFIX)script=$(DEHYDRA_SCRIPT) \
|
||||
$(DEHYDRA_ARG_PREFIX)topsrcdir=$(topsrcdir) \
|
||||
$(DEHYDRA_ARG_PREFIX)objdir=$(DEPTH) \
|
||||
$(DEHYDRA_ARG_PREFIX)dehydra-modules=$(subst $(NULL) ,$(COMMA),$(strip $(DEHYDRA_MODULES))) \
|
||||
$(DEHYDRA_ARG_PREFIX)treehydra-modules=$(subst $(NULL) ,$(COMMA),$(strip $(TREEHYDRA_MODULES))) \
|
||||
$(NULL)
|
||||
|
||||
DEHYDRA_FLAGS = -fplugin=$(DEHYDRA_PATH) -fplugin-arg='$(DEHYDRA_SCRIPT) $(DEHYDRA_ARGS)'
|
||||
DEHYDRA_FLAGS = -fplugin=$(DEHYDRA_PATH) $(DEHYDRA_ARGS)
|
||||
|
||||
ifdef DEHYDRA_PATH
|
||||
OS_CXXFLAGS += $(DEHYDRA_FLAGS)
|
||||
|
|
|
@ -10,9 +10,6 @@ function treehydra_enabled() {
|
|||
return this.hasOwnProperty('TREE_CODE');
|
||||
}
|
||||
|
||||
include('unstable/getopt.js');
|
||||
[options, args] = getopt();
|
||||
|
||||
sys.include_path.push(options.topsrcdir);
|
||||
|
||||
include('string-format.js');
|
||||
|
@ -71,17 +68,55 @@ function signaturesMatch(m1, m2)
|
|||
|
||||
let p1 = m1.type.parameters;
|
||||
let p2 = m2.type.parameters;
|
||||
|
||||
|
||||
if (p1.length != p2.length)
|
||||
return false;
|
||||
|
||||
for (let i = 0; i < p1.length; ++i)
|
||||
if (p1[i] !== p2[i])
|
||||
if (!params_match(p1[i], p2[i]))
|
||||
return false;
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function params_match(p1, p2)
|
||||
{
|
||||
[p1, p2] = unwrap_types(p1, p2);
|
||||
|
||||
for (let i in p1)
|
||||
if (i == "type" && !types_match(p1.type, p2.type))
|
||||
return false;
|
||||
else if (i != "type" && p1[i] !== p2[i])
|
||||
return false;
|
||||
|
||||
for (let i in p2)
|
||||
if (!(i in p1))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function types_match(t1, t2)
|
||||
{
|
||||
if (!t1 || !t2)
|
||||
return false;
|
||||
|
||||
[t1, t2] = unwrap_types(t1, t2);
|
||||
|
||||
return t1 === t2;
|
||||
}
|
||||
|
||||
function unwrap_types(t1, t2)
|
||||
{
|
||||
while (t1.variantOf)
|
||||
t1 = t1.variantOf;
|
||||
|
||||
while (t2.variantOf)
|
||||
t2 = t2.variantOf;
|
||||
|
||||
return [t1, t2];
|
||||
}
|
||||
|
||||
const forward_functions = [
|
||||
'process_type',
|
||||
'process_tree_type',
|
||||
|
|
|
@ -62,16 +62,16 @@ function process_tree_type(d)
|
|||
|
||||
if (t.typedef !== undefined)
|
||||
if (isRed(TYPE_NAME(d)))
|
||||
error("Typedef declaration is annotated JS_REQUIRES_STACK: the annotation should be on the type itself", t.loc);
|
||||
warning("Typedef declaration is annotated JS_REQUIRES_STACK: the annotation should be on the type itself", t.loc);
|
||||
|
||||
if (hasAttribute(t, RED)) {
|
||||
error("Non-function is annotated JS_REQUIRES_STACK", t.loc);
|
||||
warning("Non-function is annotated JS_REQUIRES_STACK", t.loc);
|
||||
return;
|
||||
}
|
||||
|
||||
for (let st = t; st !== undefined && st.isPointer; st = st.type) {
|
||||
if (hasAttribute(st, RED)) {
|
||||
error("Non-function is annotated JS_REQUIRES_STACK", t.loc);
|
||||
warning("Non-function is annotated JS_REQUIRES_STACK", t.loc);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -166,7 +166,7 @@ function RedGreenCheck(fndecl, trace) {
|
|||
if (loc !== undefined)
|
||||
return loc;
|
||||
}
|
||||
return location_of(DECL_SAVED_TREE(fndecl));
|
||||
return location_of(fndecl);
|
||||
}
|
||||
|
||||
switch (TREE_CODE(t)) {
|
||||
|
@ -179,9 +179,9 @@ function RedGreenCheck(fndecl, trace) {
|
|||
self.hasRed = true;
|
||||
}
|
||||
break;
|
||||
case CALL_EXPR:
|
||||
case GIMPLE_CALL:
|
||||
{
|
||||
let callee = call_function_decl(t);
|
||||
let callee = gimple_call_fndecl(t);
|
||||
if (callee) {
|
||||
if (isRed(callee)) {
|
||||
let calleeName = dehydra_convert(callee).name;
|
||||
|
@ -196,7 +196,7 @@ function RedGreenCheck(fndecl, trace) {
|
|||
let fntype = TREE_CHECK(
|
||||
TREE_TYPE( // the function type
|
||||
TREE_TYPE( // the function pointer type
|
||||
CALL_EXPR_FN(t)
|
||||
gimple_call_fn(t)
|
||||
)
|
||||
),
|
||||
FUNCTION_TYPE, METHOD_TYPE);
|
||||
|
@ -240,7 +240,7 @@ RedGreenCheck.prototype.flowState = function(isn, state) {
|
|||
let green = stackState != 1 && stackState != ESP.NOT_REACHED;
|
||||
let redInfo = isn.redInfo;
|
||||
if (green && redInfo) {
|
||||
error(redInfo[0], redInfo[1]);
|
||||
warning(redInfo[0], redInfo[1]);
|
||||
isn.redInfo = undefined; // avoid duplicate messages about this instruction
|
||||
}
|
||||
|
||||
|
@ -283,15 +283,14 @@ function assignCheck(source, destType, locfunc)
|
|||
return;
|
||||
|
||||
if (isRed(sourcefn))
|
||||
error("Assigning non-JS_REQUIRES_STACK function pointer from JS_REQUIRES_STACK function " + dehydra_convert(sourcefn).name, locfunc());
|
||||
}
|
||||
else {
|
||||
let sourceType = TREE_TYPE(TREE_TYPE(source).tree_check(POINTER_TYPE));
|
||||
warning("Assigning non-JS_REQUIRES_STACK function pointer from JS_REQUIRES_STACK function " + dehydra_convert(sourcefn).name, locfunc());
|
||||
} else if (TREE_TYPE(source).tree_code() == POINTER_TYPE) {
|
||||
let sourceType = TREE_TYPE(TREE_TYPE(source));
|
||||
switch (TREE_CODE(sourceType)) {
|
||||
case FUNCTION_TYPE:
|
||||
case METHOD_TYPE:
|
||||
if (isRed(sourceType))
|
||||
error("Assigning non-JS_REQUIRES_STACK function pointer from JS_REQUIRES_STACK function pointer", locfunc());
|
||||
warning("Assigning non-JS_REQUIRES_STACK function pointer from JS_REQUIRES_STACK function pointer", locfunc());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -321,7 +320,7 @@ function functionPointerWalk(t, baseloc)
|
|||
}
|
||||
|
||||
switch (TREE_CODE(t)) {
|
||||
case GIMPLE_MODIFY_STMT: {
|
||||
case GIMPLE_ASSIGN: {
|
||||
let [dest, source] = t.operands();
|
||||
assignCheck(source, TREE_TYPE(dest), getLocation);
|
||||
break;
|
||||
|
@ -341,12 +340,15 @@ function functionPointerWalk(t, baseloc)
|
|||
assignCheck(ce.value, eltype, getLocation);
|
||||
break;
|
||||
}
|
||||
case LANG_TYPE:
|
||||
// these can be safely ignored
|
||||
break;
|
||||
default:
|
||||
warning("Unexpected type in initializer: " + TREE_CODE(TREE_TYPE(t)), getLocation());
|
||||
}
|
||||
break;
|
||||
}
|
||||
case CALL_EXPR: {
|
||||
case GIMPLE_CALL: {
|
||||
// Check that the arguments to a function and the declared types
|
||||
// of those arguments are compatible.
|
||||
let ops = t.operands();
|
||||
|
@ -369,5 +371,5 @@ function functionPointerCheck(fndecl)
|
|||
let cfg = function_decl_cfg(fndecl);
|
||||
for (let bb in cfg_bb_iterator(cfg))
|
||||
for (let isn in bb_isn_iterator(bb))
|
||||
functionPointerWalk(isn, DECL_SAVED_TREE(fndecl));
|
||||
functionPointerWalk(isn, fndecl);
|
||||
}
|
||||
|
|
|
@ -68,12 +68,10 @@ ifdef MOZ_SVG
|
|||
PARALLEL_DIRS += svg/base/src
|
||||
endif
|
||||
|
||||
ifndef MOZ_NO_INSPECTOR_APIS
|
||||
PARALLEL_DIRS += inspector/public inspector/src
|
||||
ifdef ENABLE_TESTS
|
||||
PARALLEL_DIRS += inspector/tests
|
||||
endif
|
||||
endif
|
||||
|
||||
DIRS += build
|
||||
|
||||
|
|
|
@ -3627,7 +3627,7 @@ ImageRenderer::PrepareImage()
|
|||
if (!((mFlags & FLAG_SYNC_DECODE_IMAGES) &&
|
||||
(mType == eStyleImageType_Image) &&
|
||||
(NS_SUCCEEDED(mImage->GetImageData()->GetImage(getter_AddRefs(img))) && img)))
|
||||
return PR_FALSE;
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
switch (mType) {
|
||||
|
|
|
@ -1004,6 +1004,9 @@ nsLayoutUtils::TranslateWidgetToView(nsPresContext* aPresContext,
|
|||
{
|
||||
nsPoint viewOffset;
|
||||
nsIWidget* viewWidget = aView->GetNearestWidget(&viewOffset);
|
||||
if (!viewWidget) {
|
||||
return nsPoint(NS_UNCONSTRAINEDSIZE, NS_UNCONSTRAINEDSIZE);
|
||||
}
|
||||
|
||||
nsIWidget* fromRoot;
|
||||
nsIntPoint fromOffset = GetWidgetOffset(aWidget, fromRoot);
|
||||
|
@ -1396,7 +1399,7 @@ nsLayoutUtils::PaintFrame(nsIRenderingContext* aRenderingContext, nsIFrame* aFra
|
|||
// paint in a window, so make sure we flush out any retained layer
|
||||
// trees before *and after* we draw
|
||||
flags |= nsDisplayList::PAINT_FLUSH_LAYERS;
|
||||
} else {
|
||||
} else if (widget) {
|
||||
// XXX we should simplify this API now that dirtyWindowRegion always
|
||||
// covers the entire window
|
||||
widget->UpdatePossiblyTransparentRegion(dirtyWindowRegion, visibleWindowRegion);
|
||||
|
|
|
@ -836,6 +836,7 @@ public:
|
|||
nsEventStatus* aStatus);
|
||||
NS_IMETHOD ResizeReflow(nsIView *aView, nscoord aWidth, nscoord aHeight);
|
||||
NS_IMETHOD_(PRBool) IsVisible();
|
||||
NS_IMETHOD_(PRBool) ShouldIgnoreInvalidation();
|
||||
NS_IMETHOD_(void) WillPaint(PRBool aWillSendDidPaint);
|
||||
NS_IMETHOD_(void) DidPaint();
|
||||
NS_IMETHOD_(void) DispatchSynthMouseMove(nsGUIEvent *aEvent,
|
||||
|
@ -7195,6 +7196,12 @@ PresShell::IsVisible()
|
|||
return res;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP_(PRBool)
|
||||
PresShell::ShouldIgnoreInvalidation()
|
||||
{
|
||||
return mPaintingSuppressed;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP_(void)
|
||||
PresShell::WillPaint(PRBool aWillSendDidPaint)
|
||||
{
|
||||
|
|
|
@ -136,14 +136,14 @@ LOCAL_INCLUDES += \
|
|||
else ifneq (,$(filter cocoa,$(MOZ_WIDGET_TOOLKIT)))
|
||||
SHARED_LIBRARY_LIBS += \
|
||||
$(DEPTH)/dom/system/cocoa/$(LIB_PREFIX)domsystemcocoa_s.$(LIB_SUFFIX) \
|
||||
$(NULL)
|
||||
$(NULL)
|
||||
LOCAL_INCLUDES += \
|
||||
-I$(topsrcdir)/dom/system/cocoa \
|
||||
$(NULL)
|
||||
else ifneq (,$(filter android,$(MOZ_WIDGET_TOOLKIT)))
|
||||
SHARED_LIBRARY_LIBS += \
|
||||
$(DEPTH)/dom/system/android/$(LIB_PREFIX)domsystemandroid_s.$(LIB_SUFFIX) \
|
||||
$(NULL)
|
||||
$(NULL)
|
||||
LOCAL_INCLUDES += \
|
||||
-I$(topsrcdir)/dom/system/android \
|
||||
$(NULL)
|
||||
|
@ -209,14 +209,10 @@ SHARED_LIBRARY_LIBS += \
|
|||
$(NULL)
|
||||
endif
|
||||
|
||||
ifndef MOZ_NO_INSPECTOR_APIS
|
||||
LOCAL_INCLUDES += \
|
||||
-I$(srcdir)/../inspector/src \
|
||||
$(NULL)
|
||||
SHARED_LIBRARY_LIBS += ../inspector/src/$(LIB_PREFIX)inspector_s.$(LIB_SUFFIX)
|
||||
else
|
||||
DEFINES += -DMOZ_NO_INSPECTOR_APIS
|
||||
endif
|
||||
|
||||
ifdef MOZ_MATHML
|
||||
SHARED_LIBRARY_LIBS += \
|
||||
|
|
|
@ -251,7 +251,6 @@ static NS_DEFINE_CID(kWindowCommandTableCID, NS_WINDOWCOMMANDTABLE_CID);
|
|||
|
||||
#include "nsIBoxObject.h"
|
||||
|
||||
#ifndef MOZ_NO_INSPECTOR_APIS
|
||||
#ifdef MOZ_XUL
|
||||
#include "inDOMView.h"
|
||||
#endif /* MOZ_XUL */
|
||||
|
@ -260,7 +259,6 @@ static NS_DEFINE_CID(kWindowCommandTableCID, NS_WINDOWCOMMANDTABLE_CID);
|
|||
#include "inFlasher.h"
|
||||
#include "inCSSValueSearch.h"
|
||||
#include "inDOMUtils.h"
|
||||
#endif /* MOZ_NO_INSPECTOR_APIS */
|
||||
|
||||
#ifdef MOZ_XUL
|
||||
#include "nsIXULDocument.h"
|
||||
|
@ -502,7 +500,6 @@ MAKE_CTOR(CreateNewTreeBoxObject, nsIBoxObject, NS_NewTreeBoxObj
|
|||
MAKE_CTOR(CreateNewContainerBoxObject, nsIBoxObject, NS_NewContainerBoxObject)
|
||||
#endif // MOZ_XUL
|
||||
|
||||
#ifndef MOZ_NO_INSPECTOR_APIS
|
||||
#ifdef MOZ_XUL
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(inDOMView)
|
||||
#endif
|
||||
|
@ -510,7 +507,6 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(inDeepTreeWalker)
|
|||
NS_GENERIC_FACTORY_CONSTRUCTOR(inFlasher)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(inCSSValueSearch)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(inDOMUtils)
|
||||
#endif
|
||||
|
||||
MAKE_CTOR(CreateNameSpaceManager, nsINameSpaceManager, NS_GetNameSpaceManager)
|
||||
MAKE_CTOR(CreateEventListenerManager, nsIEventListenerManager, NS_NewEventListenerManager)
|
||||
|
@ -755,7 +751,6 @@ NS_DEFINE_NAMED_CID(NS_CONTAINERBOXOBJECT_CID);
|
|||
NS_DEFINE_NAMED_CID(NS_SCROLLBOXOBJECT_CID);
|
||||
NS_DEFINE_NAMED_CID(NS_TREEBOXOBJECT_CID);
|
||||
#endif // MOZ_XUL
|
||||
#ifndef MOZ_NO_INSPECTOR_APIS
|
||||
#ifdef MOZ_XUL
|
||||
NS_DEFINE_NAMED_CID(IN_DOMVIEW_CID);
|
||||
#endif
|
||||
|
@ -763,7 +758,6 @@ NS_DEFINE_NAMED_CID(IN_DEEPTREEWALKER_CID);
|
|||
NS_DEFINE_NAMED_CID(IN_FLASHER_CID);
|
||||
NS_DEFINE_NAMED_CID(IN_CSSVALUESEARCH_CID);
|
||||
NS_DEFINE_NAMED_CID(IN_DOMUTILS_CID);
|
||||
#endif // MOZ_NO_INSPECTOR_APIS
|
||||
NS_DEFINE_NAMED_CID(NS_NAMESPACEMANAGER_CID);
|
||||
NS_DEFINE_NAMED_CID(NS_EVENTLISTENERMANAGER_CID);
|
||||
NS_DEFINE_NAMED_CID(NS_DOMEVENTGROUP_CID);
|
||||
|
@ -905,7 +899,6 @@ static const mozilla::Module::CIDEntry kLayoutCIDs[] = {
|
|||
{ &kNS_SCROLLBOXOBJECT_CID, false, NULL, CreateNewScrollBoxObject },
|
||||
{ &kNS_TREEBOXOBJECT_CID, false, NULL, CreateNewTreeBoxObject },
|
||||
#endif // MOZ_XUL
|
||||
#ifndef MOZ_NO_INSPECTOR_APIS
|
||||
#ifdef MOZ_XUL
|
||||
{ &kIN_DOMVIEW_CID, false, NULL, inDOMViewConstructor },
|
||||
#endif
|
||||
|
@ -913,7 +906,6 @@ static const mozilla::Module::CIDEntry kLayoutCIDs[] = {
|
|||
{ &kIN_FLASHER_CID, false, NULL, inFlasherConstructor },
|
||||
{ &kIN_CSSVALUESEARCH_CID, false, NULL, inCSSValueSearchConstructor },
|
||||
{ &kIN_DOMUTILS_CID, false, NULL, inDOMUtilsConstructor },
|
||||
#endif // MOZ_NO_INSPECTOR_APIS
|
||||
{ &kNS_NAMESPACEMANAGER_CID, false, NULL, CreateNameSpaceManager },
|
||||
{ &kNS_EVENTLISTENERMANAGER_CID, false, NULL, CreateEventListenerManager },
|
||||
{ &kNS_DOMEVENTGROUP_CID, false, NULL, CreateDOMEventGroup },
|
||||
|
@ -1050,7 +1042,6 @@ static const mozilla::Module::ContractIDEntry kLayoutContracts[] = {
|
|||
{ "@mozilla.org/layout/xul-boxobject-scrollbox;1", &kNS_SCROLLBOXOBJECT_CID },
|
||||
{ "@mozilla.org/layout/xul-boxobject-tree;1", &kNS_TREEBOXOBJECT_CID },
|
||||
#endif // MOZ_XUL
|
||||
#ifndef MOZ_NO_INSPECTOR_APIS
|
||||
#ifdef MOZ_XUL
|
||||
{ "@mozilla.org/inspector/dom-view;1", &kIN_DOMVIEW_CID },
|
||||
#endif
|
||||
|
@ -1058,7 +1049,6 @@ static const mozilla::Module::ContractIDEntry kLayoutContracts[] = {
|
|||
{ "@mozilla.org/inspector/flasher;1", &kIN_FLASHER_CID },
|
||||
{ "@mozilla.org/inspector/search;1?type=cssvalue", &kIN_CSSVALUESEARCH_CID },
|
||||
{ "@mozilla.org/inspector/dom-utils;1", &kIN_DOMUTILS_CID },
|
||||
#endif // MOZ_NO_INSPECTOR_APIS
|
||||
{ NS_NAMESPACEMANAGER_CONTRACTID, &kNS_NAMESPACEMANAGER_CID },
|
||||
{ "@mozilla.org/xml/xml-document;1", &kNS_XMLDOCUMENT_CID },
|
||||
#ifdef MOZ_SVG
|
||||
|
|
|
@ -100,10 +100,8 @@
|
|||
#include "nsXULPrototypeCache.h"
|
||||
#include "nsXULTooltipListener.h"
|
||||
|
||||
#ifndef MOZ_NO_INSPECTOR_APIS
|
||||
#include "inDOMView.h"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef MOZ_MATHML
|
||||
#include "nsMathMLAtoms.h"
|
||||
|
@ -216,9 +214,7 @@ nsLayoutStatics::Initialize()
|
|||
return rv;
|
||||
}
|
||||
|
||||
#ifndef MOZ_NO_INSPECTOR_APIS
|
||||
inDOMView::InitAtoms();
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
<html xmlns="http://www.w3.org/1999/xhtml" class="reftest-print">
|
||||
<span style="float: left;page-break-before: right;">
|
||||
<select style="float: left;">
|
||||
</select>
|
||||
</span>
|
||||
|
||||
</html>
|
|
@ -0,0 +1,29 @@
|
|||
<html class="reftest-wait">
|
||||
<head>
|
||||
<script>
|
||||
function doe2(i) {
|
||||
document.getElementById('b').style.position = 'static';
|
||||
document.getElementById('a').setAttribute('style', 'position: absolute; -moz-column-count: 2;');
|
||||
document.documentElement.removeAttribute("class");
|
||||
}
|
||||
setTimeout(doe2,100);
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<style>body * {border: 1px solid black;}</style>
|
||||
<body>
|
||||
<div style="width: 500px;border: 1px solid black;">
|
||||
<div style="display: inline-block; width: 100px; height: 100px;"></div>
|
||||
<span style="position: absolute;"></span>
|
||||
mmmmmmmmmmmmmmmmmmmmmmm
|
||||
|
||||
<span id="a">mmmmmmmmmmmmmmmmmmmm
|
||||
|
||||
<div id="b" style="display: inline-block; width: 240px; height: 100px; position: absolute;"></div>
|
||||
m mm mm mm mm mm mm mm mm m
|
||||
<span style="float: left;">m</span>
|
||||
</span>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
|
@ -0,0 +1 @@
|
|||
<div style="-moz-column-count: 2; width: 241px;"><div style="display: inline-block; width: 240px; height: 100px;"></div>m</div>
|
|
@ -0,0 +1,9 @@
|
|||
<body style="font-size: 16px">
|
||||
<div style="width: 400px;">
|
||||
mmmmmmmmmmmmmmmmmmmmmmm
|
||||
<span style="position: absolute; -moz-column-count: 2">mmmmmmmmmmmmmmmmmmmm
|
||||
<div style="display: inline-block; width: 240px; height: 100px"></div>
|
||||
m mm mm mm mm mm mm mm mm m
|
||||
<div style="float: left;">m</div>
|
||||
</span>
|
||||
</div>
|
|
@ -0,0 +1,9 @@
|
|||
<html>
|
||||
<head>
|
||||
<style>
|
||||
hr::before { content:"b"; float:right;}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<hr style="-moz-column-count: 1;">
|
||||
</html>
|
|
@ -328,3 +328,8 @@ load 564968.xhtml
|
|||
load 570160.html
|
||||
load 571618-1.svg
|
||||
load 574958.xhtml
|
||||
load 585598-1.xhtml
|
||||
load 586806-1.html
|
||||
load 586806-2.html
|
||||
load 586806-3.html
|
||||
load 586973-1.html
|
||||
|
|
|
@ -316,6 +316,11 @@ nsBlockFrame::DestroyFrom(nsIFrame* aDestructRoot)
|
|||
// Now clear mFrames, since we've destroyed all the frames in it.
|
||||
mFrames.Clear();
|
||||
|
||||
nsFrameList* pushedFloats = RemovePushedFloats();
|
||||
if (pushedFloats) {
|
||||
pushedFloats->DestroyFrom(aDestructRoot);
|
||||
}
|
||||
|
||||
// destroy overflow lines now
|
||||
nsLineList* overflowLines = RemoveOverflowLines();
|
||||
if (overflowLines) {
|
||||
|
@ -564,7 +569,7 @@ nsBlockFrame::GetChildList(nsIAtom* aListName) const
|
|||
const nsFrameList* list = GetOverflowOutOfFlows();
|
||||
return list ? *list : nsFrameList::EmptyList();
|
||||
}
|
||||
else if (aListName == nsGkAtoms::floatContinuationsList) {
|
||||
else if (aListName == nsGkAtoms::pushedFloatsList) {
|
||||
const nsFrameList* list = GetPushedFloats();
|
||||
return list ? *list : nsFrameList::EmptyList();
|
||||
}
|
||||
|
@ -601,7 +606,7 @@ nsBlockFrame::GetAdditionalChildListName(PRInt32 aIndex) const
|
|||
case NS_BLOCK_FRAME_ABSOLUTE_LIST_INDEX:
|
||||
return nsGkAtoms::absoluteList;
|
||||
case NS_BLOCK_FRAME_PUSHED_FLOATS_LIST_INDEX:
|
||||
return nsGkAtoms::floatContinuationsList;
|
||||
return nsGkAtoms::pushedFloatsList;
|
||||
default:
|
||||
return nsnull;
|
||||
}
|
||||
|
@ -3998,9 +4003,17 @@ nsBlockFrame::SplitLine(nsBlockReflowState& aState,
|
|||
if (0 != pushCount) {
|
||||
NS_ABORT_IF_FALSE(aLine->GetChildCount() > pushCount, "bad push");
|
||||
NS_ABORT_IF_FALSE(nsnull != aFrame, "whoops");
|
||||
NS_ASSERTION(nsFrameList(aFrame, nsLayoutUtils::GetLastSibling(aFrame))
|
||||
.GetLength() >= pushCount,
|
||||
"Not enough frames to push");
|
||||
#ifdef DEBUG
|
||||
{
|
||||
nsIFrame *f = aFrame;
|
||||
PRInt32 count = pushCount;
|
||||
while (f && count > 0) {
|
||||
f = f->GetNextSibling();
|
||||
--count;
|
||||
}
|
||||
NS_ASSERTION(count == 0, "Not enough frames to push");
|
||||
}
|
||||
#endif
|
||||
|
||||
// Put frames being split out into their own line
|
||||
nsLineBox* newLine = aState.NewLineBox(aFrame, pushCount, PR_FALSE);
|
||||
|
@ -6678,10 +6691,18 @@ void nsBlockFrame::CollectFloats(nsIFrame* aFrame, nsFrameList& aList,
|
|||
if (outOfFlowFrame->GetParent() == this) {
|
||||
nsFrameList* list = GetPushedFloats();
|
||||
if (!list || !list->RemoveFrameIfPresent(outOfFlowFrame)) {
|
||||
mFloats.RemoveFrame(outOfFlowFrame);
|
||||
if (aFromOverflow) {
|
||||
nsAutoOOFFrameList oofs(this);
|
||||
oofs.mList.RemoveFrame(outOfFlowFrame);
|
||||
} else {
|
||||
mFloats.RemoveFrame(outOfFlowFrame);
|
||||
}
|
||||
}
|
||||
aList.AppendFrame(nsnull, outOfFlowFrame);
|
||||
}
|
||||
// FIXME: By not pulling floats whose parent is one of our
|
||||
// later siblings, are we risking the pushed floats getting
|
||||
// out-of-order?
|
||||
} else {
|
||||
// Make sure that its parent is us. Otherwise we don't want
|
||||
// to mess around with it because it belongs to someone
|
||||
|
|
|
@ -690,9 +690,16 @@ nsBlockReflowState::FlowAndPlaceFloat(nsIFrame* aFloat)
|
|||
// Can the float fit here?
|
||||
PRBool keepFloatOnSameLine = PR_FALSE;
|
||||
|
||||
// Are we required to place at least part of the float because we're
|
||||
// at the top of the page (to avoid an infinite loop of pushing and
|
||||
// breaking).
|
||||
PRBool mustPlaceFloat =
|
||||
mReflowState.mFlags.mIsTopOfPage && IsAdjacentWithTop();
|
||||
|
||||
for (;;) {
|
||||
if (mReflowState.availableHeight != NS_UNCONSTRAINEDSIZE &&
|
||||
floatAvailableSpace.mRect.height <= 0) {
|
||||
floatAvailableSpace.mRect.height <= 0 &&
|
||||
!mustPlaceFloat) {
|
||||
// No space, nowhere to put anything.
|
||||
PushFloatPastBreak(aFloat);
|
||||
return PR_FALSE;
|
||||
|
@ -759,6 +766,8 @@ nsBlockReflowState::FlowAndPlaceFloat(nsIFrame* aFloat)
|
|||
adjustedAvailableSpace.width,
|
||||
aFloat, offsets);
|
||||
}
|
||||
|
||||
mustPlaceFloat = PR_FALSE;
|
||||
}
|
||||
|
||||
// If the float is continued, it will get the same absolute x value as its prev-in-flow
|
||||
|
@ -810,8 +819,7 @@ nsBlockReflowState::FlowAndPlaceFloat(nsIFrame* aFloat)
|
|||
// do the same.
|
||||
if ((mContentArea.height != NS_UNCONSTRAINEDSIZE &&
|
||||
adjustedAvailableSpace.height == NS_UNCONSTRAINEDSIZE &&
|
||||
(!mReflowState.mFlags.mIsTopOfPage || !IsAdjacentWithTop() ||
|
||||
pushedDown) &&
|
||||
!mustPlaceFloat &&
|
||||
aFloat->GetSize().height + floatMargin.TopBottom() >
|
||||
mContentArea.YMost() - floatY) ||
|
||||
NS_FRAME_IS_TRUNCATED(reflowStatus)) {
|
||||
|
@ -869,7 +877,7 @@ nsBlockReflowState::FlowAndPlaceFloat(nsIFrame* aFloat)
|
|||
mFloatManager->IncludeInDamage(top, bottom);
|
||||
}
|
||||
|
||||
if (NS_FRAME_IS_NOT_COMPLETE(reflowStatus)) {
|
||||
if (!NS_FRAME_IS_FULLY_COMPLETE(reflowStatus)) {
|
||||
mBlock->SplitFloat(*this, aFloat, reflowStatus);
|
||||
}
|
||||
|
||||
|
|
|
@ -4024,7 +4024,7 @@ nsIFrame::InvalidateRoot(const nsRect& aDamageRect, PRUint32 aFlags)
|
|||
|
||||
nsIView* view = GetView();
|
||||
NS_ASSERTION(view, "This can only be called on frames with views");
|
||||
view->GetViewManager()->UpdateView(view, rect, flags);
|
||||
view->GetViewManager()->UpdateViewNoSuppression(view, rect, flags);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -2306,6 +2306,16 @@ nsObjectFrame::StopPluginInternal(PRBool aDelayedStop)
|
|||
nsRootPresContext* rootPC = PresContext()->GetRootPresContext();
|
||||
NS_ASSERTION(rootPC, "unable to unregister the plugin frame");
|
||||
rootPC->UnregisterPluginForGeometryUpdates(this);
|
||||
|
||||
// Make sure the plugin is hidden in case an update of plugin geometry
|
||||
// hasn't happened since this plugin became hidden.
|
||||
nsIWidget* parent = mWidget->GetParent();
|
||||
if (parent) {
|
||||
nsTArray<nsIWidget::Configuration> configurations;
|
||||
GetEmptyClipConfiguration(&configurations);
|
||||
parent->ConfigureChildren(configurations);
|
||||
DidSetWidgetGeometry();
|
||||
}
|
||||
}
|
||||
|
||||
// Transfer the reference to the instance owner onto the stack so
|
||||
|
|
|
@ -163,7 +163,7 @@ nsPlaceholderFrame::DestroyFrom(nsIFrame* aDestructRoot)
|
|||
// then call RemoveFrame on it here.
|
||||
// Also destroy it here if it's a popup frame. (Bug 96291)
|
||||
if (shell->FrameManager() &&
|
||||
((GetStateBits() & PLACEHOLDER_FOR_FLOAT) ||
|
||||
((GetStateBits() & PLACEHOLDER_FOR_POPUP) ||
|
||||
!nsLayoutUtils::IsProperAncestorFrame(aDestructRoot, oof))) {
|
||||
nsIAtom* listName = nsLayoutUtils::GetChildListNameFor(oof);
|
||||
shell->FrameManager()->RemoveFrame(listName, oof);
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
<html xmlns="http://www.w3.org/1999/xhtml" class="reftest-print">
|
||||
<div style="page-break-before: always;">
|
||||
<select style="display:block">
|
||||
</select>
|
||||
</div>
|
||||
</html>
|
|
@ -0,0 +1,6 @@
|
|||
<html xmlns="http://www.w3.org/1999/xhtml" class="reftest-print">
|
||||
<span style="float: left;page-break-before: always;">
|
||||
<select style="float: left;">
|
||||
</select>
|
||||
</span>
|
||||
</html>
|
|
@ -1468,6 +1468,7 @@ random-if(d2d) == 555388-1.html 555388-1-ref.html
|
|||
== 564991-1.html 564991-1-ref.html
|
||||
== 565819-1.html 565819-ref.html
|
||||
== 565819-2.html 565819-ref.html
|
||||
== 568441.html 568441-ref.html
|
||||
== 569006-1.html 569006-1-ref.html
|
||||
== 571281-1a.html 571281-1-ref.html
|
||||
== 571281-1b.html 571281-1-ref.html
|
||||
|
@ -1481,15 +1482,15 @@ random-if(d2d) == 555388-1.html 555388-1-ref.html
|
|||
== 571347-3.html 571347-3-ref.html
|
||||
== 572598-1.html 572598-ref.html
|
||||
== 574898-1.html 574898-ref.html
|
||||
== 577838-1.html 577838-1-ref.html
|
||||
== 577838-2.html 577838-2-ref.html
|
||||
== 579349-1.html 579349-1-ref.html
|
||||
== 580160-1.html 580160-1-ref.html
|
||||
== 581317-1.html 581317-1-ref.html
|
||||
== 581579-1.html 581579-1-ref.html
|
||||
== 582037-1a.html 582037-1-ref.html
|
||||
== 582037-1b.html 582037-1-ref.html
|
||||
== 582037-2a.html 582037-2-ref.html
|
||||
== 582037-2b.html 582037-2-ref.html
|
||||
== 577838-1.html 577838-1-ref.html
|
||||
== 577838-2.html 577838-2-ref.html
|
||||
== 581579-1.html 581579-1-ref.html
|
||||
== 584400-dash-length.svg 584400-dash-length-ref.svg
|
||||
== 580160-1.html 580160-1-ref.html
|
||||
== 579349-1.html 579349-1-ref.html
|
||||
== 581317-1.html 581317-1-ref.html
|
||||
== 568441.html 568441-ref.html
|
||||
== 585598-2.xhtml 585598-2-ref.xhtml
|
||||
|
|
|
@ -369,6 +369,53 @@ __FBSDID("$FreeBSD: head/lib/libc/stdlib/malloc.c 180599 2008-07-18 19:35:44Z ja
|
|||
|
||||
#include "jemalloc.h"
|
||||
|
||||
/* Some tools, such as /dev/dsp wrappers, LD_PRELOAD libraries that
|
||||
* happen to override mmap() and call dlsym() from their overridden
|
||||
* mmap(). The problem is that dlsym() calls malloc(), and this ends
|
||||
* up in a dead lock in jemalloc.
|
||||
* On these systems, we prefer to directly use the system call.
|
||||
* We do that for Linux systems and kfreebsd with GNU userland.
|
||||
* Note sanity checks are not done (alignment of offset, ...) because
|
||||
* the uses of mmap are pretty limited, in jemalloc.
|
||||
*
|
||||
* On Alpha, glibc has a bug that prevents syscall() to work for system
|
||||
* calls with 6 arguments
|
||||
*/
|
||||
#if (defined(MOZ_MEMORY_LINUX) && !defined(__alpha__)) || \
|
||||
(defined(MOZ_MEMORY_BSD) && defined(__GLIBC__))
|
||||
#include <sys/syscall.h>
|
||||
#if defined(SYS_mmap) || defined(SYS_mmap2)
|
||||
static inline
|
||||
void *_mmap(void *addr, size_t length, int prot, int flags,
|
||||
int fd, off_t offset)
|
||||
{
|
||||
/* S390 only passes one argument to the mmap system call, which is a
|
||||
* pointer to a structure containing the arguments */
|
||||
#ifdef __s390__
|
||||
struct {
|
||||
void *addr;
|
||||
size_t length;
|
||||
int prot;
|
||||
int flags;
|
||||
int fd;
|
||||
off_t offset;
|
||||
} args = { addr, length, prot, flags, fd, offset };
|
||||
return (void *) syscall(SYS_mmap, &args);
|
||||
#else
|
||||
#ifdef SYS_mmap2
|
||||
return (void *) syscall(SYS_mmap2, addr, length, prot, flags,
|
||||
fd, offset >> 12);
|
||||
#else
|
||||
return (void *) syscall(SYS_mmap, addr, length, prot, flags,
|
||||
fd, offset);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
#define mmap _mmap
|
||||
#define munmap(a, l) syscall(SYS_munmap, a, l)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef MOZ_MEMORY_DARWIN
|
||||
static const bool __isthreaded = true;
|
||||
#endif
|
||||
|
@ -984,8 +1031,10 @@ struct arena_s {
|
|||
* Data.
|
||||
*/
|
||||
|
||||
#ifndef MOZ_MEMORY_NARENAS_DEFAULT_ONE
|
||||
/* Number of CPUs. */
|
||||
static unsigned ncpus;
|
||||
#endif
|
||||
|
||||
/* VM page size. */
|
||||
static size_t pagesize;
|
||||
|
@ -4913,6 +4962,7 @@ huge_dalloc(void *ptr)
|
|||
base_node_dealloc(node);
|
||||
}
|
||||
|
||||
#ifndef MOZ_MEMORY_NARENAS_DEFAULT_ONE
|
||||
#ifdef MOZ_MEMORY_BSD
|
||||
static inline unsigned
|
||||
malloc_ncpus(void)
|
||||
|
@ -5022,6 +5072,7 @@ malloc_ncpus(void)
|
|||
return (1);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
static void
|
||||
malloc_print_stats(void)
|
||||
|
@ -5061,7 +5112,9 @@ malloc_print_stats(void)
|
|||
#endif
|
||||
_malloc_message("\n", "", "", "");
|
||||
|
||||
#ifndef MOZ_MEMORY_NARENAS_DEFAULT_ONE
|
||||
_malloc_message("CPUs: ", umax2s(ncpus, s), "\n", "");
|
||||
#endif
|
||||
_malloc_message("Max arenas: ", umax2s(narenas, s), "\n", "");
|
||||
#ifdef MALLOC_BALANCE
|
||||
_malloc_message("Arena balance threshold: ",
|
||||
|
@ -5233,10 +5286,14 @@ malloc_init_hard(void)
|
|||
|
||||
pagesize = (unsigned) result;
|
||||
|
||||
#ifndef MOZ_MEMORY_NARENAS_DEFAULT_ONE
|
||||
ncpus = info.dwNumberOfProcessors;
|
||||
#endif
|
||||
}
|
||||
#else
|
||||
#ifndef MOZ_MEMORY_NARENAS_DEFAULT_ONE
|
||||
ncpus = malloc_ncpus();
|
||||
#endif
|
||||
|
||||
result = sysconf(_SC_PAGESIZE);
|
||||
assert(result != -1);
|
||||
|
|
|
@ -59,8 +59,9 @@
|
|||
#include "stdlib.h"
|
||||
#include "nsWildCard.h"
|
||||
#include "nsZipArchive.h"
|
||||
|
||||
#include "nsString.h"
|
||||
#include "mozilla/FunctionTimer.h"
|
||||
#include "prenv.h"
|
||||
|
||||
/**
|
||||
* Global allocator used with zlib. Destroyed in module shutdown.
|
||||
|
@ -101,6 +102,8 @@ nsRecyclingAllocator *gZlibAllocator = NULL;
|
|||
#endif /* XP_UNIX */
|
||||
|
||||
|
||||
using namespace mozilla;
|
||||
|
||||
static const PRUint32 kMaxNameLength = PATH_MAX; /* Maximum name length */
|
||||
// For synthetic zip entries. Date/time corresponds to 1980-01-01 00:00.
|
||||
static const PRUint16 kSyntheticTime = 0;
|
||||
|
@ -219,7 +222,6 @@ nsZipHandle::~nsZipHandle()
|
|||
// nsZipArchive -- public methods
|
||||
//***********************************************************
|
||||
|
||||
|
||||
//---------------------------------------------
|
||||
// nsZipArchive::OpenArchive
|
||||
//---------------------------------------------
|
||||
|
@ -242,7 +244,28 @@ nsresult nsZipArchive::OpenArchive(nsIFile *aZipFile)
|
|||
PL_INIT_ARENA_POOL(&mArena, "ZipArena", ZIP_ARENABLOCKSIZE);
|
||||
|
||||
//-- get table of contents for archive
|
||||
return BuildFileList();
|
||||
rv = BuildFileList();
|
||||
char *env = PR_GetEnv("MOZ_JAR_LOG_DIR");
|
||||
if (env && NS_SUCCEEDED(rv)) {
|
||||
nsCOMPtr<nsILocalFile> logFile;
|
||||
nsresult rv2 = NS_NewLocalFile(NS_ConvertUTF8toUTF16(env), PR_FALSE, getter_AddRefs(logFile));
|
||||
|
||||
if (!NS_SUCCEEDED(rv2))
|
||||
return rv;
|
||||
|
||||
// Create a directory for the log (in case it doesn't exist)
|
||||
logFile->Create(nsIFile::DIRECTORY_TYPE, 0700);
|
||||
|
||||
nsAutoString name;
|
||||
localFile->GetLeafName(name);
|
||||
name.Append(NS_LITERAL_STRING(".log"));
|
||||
logFile->Append(name);
|
||||
|
||||
rv2 = logFile->OpenNSPRFileDesc(PR_WRONLY|PR_CREATE_FILE|PR_APPEND, 0644, &fd);
|
||||
if (NS_SUCCEEDED(rv2))
|
||||
mLog = fd;
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
//---------------------------------------------
|
||||
|
@ -319,8 +342,17 @@ nsZipItem* nsZipArchive::GetItem(const char * aEntryName)
|
|||
nsZipItem* item = mFiles[ HashName(aEntryName, len) ];
|
||||
while (item) {
|
||||
if ((len == item->nameLength) &&
|
||||
(!memcmp(aEntryName, item->Name(), len)))
|
||||
(!memcmp(aEntryName, item->Name(), len))) {
|
||||
|
||||
if (mLog) {
|
||||
// Successful GetItem() is a good indicator that the file is about to be read
|
||||
char *tmp = PL_strdup(aEntryName);
|
||||
tmp[len]='\n';
|
||||
PR_Write(mLog, tmp, len+1);
|
||||
PL_strfree(tmp);
|
||||
}
|
||||
return item; //-- found it
|
||||
}
|
||||
item = item->next;
|
||||
}
|
||||
}
|
||||
|
@ -533,14 +565,18 @@ nsresult nsZipArchive::BuildFileList()
|
|||
PRUint8* buf;
|
||||
PRUint8* startp = mFd->mFileData;
|
||||
PRUint8* endp = startp + mFd->mLen;
|
||||
|
||||
PRUint32 centralOffset = 0;
|
||||
for (buf = endp - ZIPEND_SIZE; buf > startp; buf--)
|
||||
{
|
||||
if (xtolong(buf) == ENDSIG) {
|
||||
centralOffset = xtolong(((ZipEnd *)buf)->offset_central_dir);
|
||||
break;
|
||||
}
|
||||
|
||||
PRUint32 centralOffset = 1;
|
||||
if (mFd->mLen > ZIPCENTRAL_SIZE && *(PRUint32*)(startp + centralOffset) == CENTRALSIG) {
|
||||
// Success means optimized jar layout from bug 559961 is in effect
|
||||
} else {
|
||||
for (buf = endp - ZIPEND_SIZE; buf > startp; buf--)
|
||||
{
|
||||
if (xtolong(buf) == ENDSIG) {
|
||||
centralOffset = xtolong(((ZipEnd *)buf)->offset_central_dir);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!centralOffset)
|
||||
|
@ -673,7 +709,6 @@ nsZipHandle* nsZipArchive::GetFD()
|
|||
PRUint8* nsZipArchive::GetData(nsZipItem* aItem)
|
||||
{
|
||||
PR_ASSERT (aItem);
|
||||
|
||||
//-- read local header to get variable length values and calculate
|
||||
//-- the real data offset
|
||||
PRUint32 len = mFd->mLen;
|
||||
|
|
|
@ -53,6 +53,7 @@
|
|||
#include "zipstruct.h"
|
||||
#include "nsAutoPtr.h"
|
||||
#include "nsILocalFile.h"
|
||||
#include "mozilla/FileUtils.h"
|
||||
|
||||
class nsZipFind;
|
||||
|
||||
|
@ -206,6 +207,10 @@ private:
|
|||
|
||||
// file handle
|
||||
nsRefPtr<nsZipHandle> mFd;
|
||||
|
||||
// logging handle
|
||||
mozilla::AutoFDClose mLog;
|
||||
|
||||
//--- private methods ---
|
||||
|
||||
nsZipArchive& operator=(const nsZipArchive& rhs); // prevent assignments
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
*
|
||||
* Contributor(s):
|
||||
* Honza Bambas <honzab@firemni.cz>
|
||||
* Bjarne Geir Herland <bjarnw@runitsoft.com>
|
||||
* Bjarne Geir Herland <bjarne@runitsoft.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
|
||||
|
@ -37,6 +37,10 @@
|
|||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#ifdef MOZ_LOGGING
|
||||
#define FORCE_PR_LOG
|
||||
#endif
|
||||
|
||||
#include "prlog.h"
|
||||
#include "nsAsyncRedirectVerifyHelper.h"
|
||||
#include "nsThreadUtils.h"
|
||||
|
|
|
@ -4238,6 +4238,8 @@ nsresult
|
|||
nsHttpChannel::WaitForRedirectCallback()
|
||||
{
|
||||
nsresult rv;
|
||||
LOG(("nsHttpChannel::WaitForRedirectCallback [this=%p]\n", this));
|
||||
|
||||
if (mTransactionPump) {
|
||||
rv = mTransactionPump->Suspend();
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
|
|
@ -289,7 +289,7 @@ DEFAULT_GMAKE_FLAGS += \
|
|||
OS_RELEASE="2.6" \
|
||||
OS_LIBS= \
|
||||
STANDARDS_CFLAGS="-std=gnu89" \
|
||||
DSO_CFLAGS="$(CFLAGS) -DCHECK_FORK_GETPID -DRTLD_NOLOAD=0 -DANDROID_VERSION=$(ANDROID_VERSION) -include $(topsrcdir)/security/manager/android_stub.h" \
|
||||
DSO_CFLAGS="$(CFLAGS) -DCHECK_FORK_GETPID -DRTLD_NOLOAD=0 -DANDROID_VERSION=$(ANDROID_VERSION) -include $(ABS_topsrcdir)/security/manager/android_stub.h" \
|
||||
DSO_LDOPTS="-shared $(LDFLAGS) $(WRAP_MALLOC_CFLAGS) $(WRAP_MALLOC_LIB) " \
|
||||
$(NULL)
|
||||
endif
|
||||
|
|
|
@ -208,3 +208,16 @@ function isSecurityState(expectedState, message, test)
|
|||
throw "Invalid isSecurityState state";
|
||||
}
|
||||
}
|
||||
|
||||
function waitForSecurityState(expectedState, callback)
|
||||
{
|
||||
var roundsLeft = 200; // Wait for 20 seconds (=200*100ms)
|
||||
var interval =
|
||||
window.setInterval(function() {
|
||||
isSecurityState(expectedState, "", function(isok) {if (isok) {roundsLeft = 0;}});
|
||||
if (!roundsLeft--) {
|
||||
window.clearInterval(interval);
|
||||
callback();
|
||||
}
|
||||
}, 100);
|
||||
}
|
||||
|
|
|
@ -15,10 +15,11 @@
|
|||
document.getElementById("para").style.content =
|
||||
"url('http://example.com/tests/security/ssl/mixedcontent/moonsurface.jpg')";
|
||||
|
||||
window.setTimeout(function() {
|
||||
waitForSecurityState("broken", function()
|
||||
{
|
||||
isSecurityState("broken", "insecure content added by styling breaks security");
|
||||
finish();
|
||||
}, 500);
|
||||
});
|
||||
}
|
||||
|
||||
function afterNavigationTest()
|
||||
|
|
|
@ -18,10 +18,11 @@
|
|||
"http://example.com/tests/security/ssl/mixedcontent/moonsurface.jpg";
|
||||
}, 0);
|
||||
|
||||
window.setTimeout(function() {
|
||||
waitForSecurityState("broken", function()
|
||||
{
|
||||
isSecurityState("broken", "src='http://...' changed to broken");
|
||||
finish();
|
||||
}, 500);
|
||||
});
|
||||
}
|
||||
|
||||
function afterNavigationTest()
|
||||
|
|
|
@ -17,10 +17,11 @@
|
|||
document.body.background =
|
||||
"http://example.com/tests/security/ssl/mixedcontent/moonsurface.jpg";
|
||||
|
||||
window.setTimeout(function() {
|
||||
waitForSecurityState("broken", function()
|
||||
{
|
||||
isSecurityState("broken", "document.body.background='http://...' changed to broken");
|
||||
finish();
|
||||
}, 500);
|
||||
});
|
||||
}
|
||||
|
||||
function afterNavigationTest()
|
||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче