mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-03 12:35:58 +00:00
Merge inbound to m-c.
This commit is contained in:
commit
b47f71f8ba
@ -19,7 +19,6 @@ XPIDL_SOURCES += [
|
||||
'nsIAccessibleHyperText.idl',
|
||||
'nsIAccessibleImage.idl',
|
||||
'nsIAccessiblePivot.idl',
|
||||
'nsIAccessibleProvider.idl',
|
||||
'nsIAccessibleRelation.idl',
|
||||
'nsIAccessibleRetrieval.idl',
|
||||
'nsIAccessibleRole.idl',
|
||||
|
@ -1,83 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "nsISupports.idl"
|
||||
|
||||
/**
|
||||
* nsIAccessibleProvider interface is used to link element and accessible
|
||||
object. For that XBL binding of element should implement the interface.
|
||||
*/
|
||||
|
||||
[scriptable, uuid(f7e531b6-bc29-4d3d-8c91-60fc2b71eb40)]
|
||||
interface nsIAccessibleProvider : nsISupports
|
||||
{
|
||||
/**
|
||||
* Constants set of common use.
|
||||
*/
|
||||
|
||||
/** Do not create an accessible for this object
|
||||
* This is useful if an ancestor binding already implements nsIAccessibleProvider,
|
||||
* but no accessible is desired for the inheriting binding
|
||||
*/
|
||||
const long NoAccessible = 0;
|
||||
|
||||
/** For elements that spawn a new document. For example now it is used by
|
||||
<xul:iframe>, <xul:browser> and <xul:editor>. */
|
||||
const long OuterDoc = 0x00000001;
|
||||
|
||||
/**
|
||||
* Constants set is used by XUL controls.
|
||||
*/
|
||||
|
||||
const long XULAlert = 0x00001001;
|
||||
const long XULButton = 0x00001002;
|
||||
const long XULCheckbox = 0x00001003;
|
||||
const long XULColorPicker = 0x00001004;
|
||||
const long XULColorPickerTile = 0x00001005;
|
||||
const long XULCombobox = 0x00001006;
|
||||
const long XULDropmarker = 0x00001007;
|
||||
const long XULGroupbox = 0x00001008;
|
||||
const long XULImage = 0x00001009;
|
||||
const long XULLink = 0x0000100A;
|
||||
const long XULListbox = 0x0000100B;
|
||||
const long XULListCell = 0x00001026;
|
||||
const long XULListHead = 0x00001024;
|
||||
const long XULListHeader = 0x00001025;
|
||||
const long XULListitem = 0x0000100C;
|
||||
const long XULMenubar = 0x0000100D;
|
||||
const long XULMenuitem = 0x0000100E;
|
||||
const long XULMenupopup = 0x0000100F;
|
||||
const long XULMenuSeparator = 0x00001010;
|
||||
const long XULPane = 0x00001011;
|
||||
const long XULProgressMeter = 0x00001012;
|
||||
const long XULScale = 0x00001013;
|
||||
const long XULStatusBar = 0x00001014;
|
||||
const long XULRadioButton = 0x00001015;
|
||||
const long XULRadioGroup = 0x00001016;
|
||||
|
||||
/** Used for XUL tab element */
|
||||
const long XULTab = 0x00001017;
|
||||
/** Used for XUL tabs element, a container for tab elements */
|
||||
const long XULTabs = 0x00001018;
|
||||
/** Used for XUL tabpanels element */
|
||||
const long XULTabpanels = 0x00001019;
|
||||
|
||||
const long XULText = 0x0000101A;
|
||||
const long XULTextBox = 0x0000101B;
|
||||
const long XULThumb = 0x0000101C;
|
||||
const long XULTree = 0x0000101D;
|
||||
const long XULTreeColumns = 0x0000101E;
|
||||
const long XULTreeColumnItem = 0x0000101F;
|
||||
const long XULToolbar = 0x00001020;
|
||||
const long XULToolbarSeparator = 0x00001021;
|
||||
const long XULTooltip = 0x00001022;
|
||||
const long XULToolbarButton = 0x00001023;
|
||||
|
||||
/**
|
||||
* Return one of constants declared above.
|
||||
*/
|
||||
readonly attribute long accessibleType;
|
||||
};
|
@ -17,6 +17,7 @@ LOCAL_INCLUDES += \
|
||||
-I$(srcdir)/../html \
|
||||
-I$(srcdir)/../xpcom \
|
||||
-I$(srcdir)/../xul \
|
||||
-I$(srcdir)/../../../content/xbl/src \
|
||||
-I$(srcdir)/../../../layout/generic \
|
||||
-I$(srcdir)/../../../layout/style \
|
||||
-I$(srcdir)/../../../layout/svg \
|
||||
|
@ -23,7 +23,6 @@
|
||||
#include "nsAccessiblePivot.h"
|
||||
#include "nsAccUtils.h"
|
||||
#include "nsEventShell.h"
|
||||
#include "nsIAccessibleProvider.h"
|
||||
#include "OuterDocAccessible.h"
|
||||
#include "Platform.h"
|
||||
#include "Role.h"
|
||||
@ -61,6 +60,9 @@
|
||||
#include "nsTreeBodyFrame.h"
|
||||
#include "nsTreeColumns.h"
|
||||
#include "nsTreeUtils.h"
|
||||
#include "nsBindingManager.h"
|
||||
#include "nsXBLPrototypeBinding.h"
|
||||
#include "nsXBLBinding.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/Services.h"
|
||||
@ -1137,204 +1139,187 @@ already_AddRefed<Accessible>
|
||||
nsAccessibilityService::CreateAccessibleByType(nsIContent* aContent,
|
||||
DocAccessible* aDoc)
|
||||
{
|
||||
nsCOMPtr<nsIAccessibleProvider> accessibleProvider(do_QueryInterface(aContent));
|
||||
if (!accessibleProvider)
|
||||
nsAutoString role;
|
||||
for (const nsXBLBinding* binding = aContent->GetXBLBinding(); binding; binding = binding->GetBaseBinding()) {
|
||||
nsIContent* bindingElm = binding->PrototypeBinding()->GetBindingElement();
|
||||
bindingElm->GetAttr(kNameSpaceID_None, nsGkAtoms::role, role);
|
||||
if (!role.IsEmpty())
|
||||
break;
|
||||
}
|
||||
|
||||
if (role.IsEmpty() || role.EqualsLiteral("none"))
|
||||
return nullptr;
|
||||
|
||||
int32_t type;
|
||||
nsresult rv = accessibleProvider->GetAccessibleType(&type);
|
||||
if (NS_FAILED(rv))
|
||||
return nullptr;
|
||||
|
||||
if (type == nsIAccessibleProvider::OuterDoc) {
|
||||
if (role.EqualsLiteral("outerdoc")) {
|
||||
nsRefPtr<Accessible> accessible = new OuterDocAccessible(aContent, aDoc);
|
||||
return accessible.forget();
|
||||
}
|
||||
|
||||
|
||||
nsRefPtr<Accessible> accessible;
|
||||
switch (type)
|
||||
{
|
||||
#ifdef MOZ_XUL
|
||||
case nsIAccessibleProvider::NoAccessible:
|
||||
return nullptr;
|
||||
// XUL controls
|
||||
if (role.EqualsLiteral("xul:alert")) {
|
||||
accessible = new XULAlertAccessible(aContent, aDoc);
|
||||
|
||||
// XUL controls
|
||||
case nsIAccessibleProvider::XULAlert:
|
||||
accessible = new XULAlertAccessible(aContent, aDoc);
|
||||
break;
|
||||
} else if (role.EqualsLiteral("xul:button")) {
|
||||
accessible = new XULButtonAccessible(aContent, aDoc);
|
||||
|
||||
case nsIAccessibleProvider::XULButton:
|
||||
accessible = new XULButtonAccessible(aContent, aDoc);
|
||||
break;
|
||||
} else if (role.EqualsLiteral("xul:checkbox")) {
|
||||
accessible = new XULCheckboxAccessible(aContent, aDoc);
|
||||
|
||||
case nsIAccessibleProvider::XULCheckbox:
|
||||
accessible = new XULCheckboxAccessible(aContent, aDoc);
|
||||
break;
|
||||
} else if (role.EqualsLiteral("xul:colorpicker")) {
|
||||
accessible = new XULColorPickerAccessible(aContent, aDoc);
|
||||
|
||||
case nsIAccessibleProvider::XULColorPicker:
|
||||
accessible = new XULColorPickerAccessible(aContent, aDoc);
|
||||
break;
|
||||
} else if (role.EqualsLiteral("xul:colorpickertile")) {
|
||||
accessible = new XULColorPickerTileAccessible(aContent, aDoc);
|
||||
|
||||
case nsIAccessibleProvider::XULColorPickerTile:
|
||||
accessible = new XULColorPickerTileAccessible(aContent, aDoc);
|
||||
break;
|
||||
} else if (role.EqualsLiteral("xul:combobox")) {
|
||||
accessible = new XULComboboxAccessible(aContent, aDoc);
|
||||
|
||||
case nsIAccessibleProvider::XULCombobox:
|
||||
accessible = new XULComboboxAccessible(aContent, aDoc);
|
||||
break;
|
||||
|
||||
case nsIAccessibleProvider::XULTabpanels:
|
||||
} else if (role.EqualsLiteral("xul:tabpanels")) {
|
||||
accessible = new XULTabpanelsAccessible(aContent, aDoc);
|
||||
break;
|
||||
|
||||
case nsIAccessibleProvider::XULDropmarker:
|
||||
} else if (role.EqualsLiteral("xul:dropmarker")) {
|
||||
accessible = new XULDropmarkerAccessible(aContent, aDoc);
|
||||
break;
|
||||
|
||||
case nsIAccessibleProvider::XULGroupbox:
|
||||
} else if (role.EqualsLiteral("xul:groupbox")) {
|
||||
accessible = new XULGroupboxAccessible(aContent, aDoc);
|
||||
break;
|
||||
|
||||
case nsIAccessibleProvider::XULImage:
|
||||
{
|
||||
} else if (role.EqualsLiteral("xul:image")) {
|
||||
if (aContent->HasAttr(kNameSpaceID_None, nsGkAtoms::onclick)) {
|
||||
accessible = new XULToolbarButtonAccessible(aContent, aDoc);
|
||||
|
||||
} else {
|
||||
// Don't include nameless images in accessible tree.
|
||||
if (!aContent->HasAttr(kNameSpaceID_None,
|
||||
nsGkAtoms::tooltiptext))
|
||||
return nullptr;
|
||||
|
||||
accessible = new ImageAccessibleWrap(aContent, aDoc);
|
||||
break;
|
||||
|
||||
}
|
||||
case nsIAccessibleProvider::XULLink:
|
||||
accessible = new XULLinkAccessible(aContent, aDoc);
|
||||
break;
|
||||
|
||||
case nsIAccessibleProvider::XULListbox:
|
||||
} else if (role.EqualsLiteral("xul:link")) {
|
||||
accessible = new XULLinkAccessible(aContent, aDoc);
|
||||
|
||||
} else if (role.EqualsLiteral("xul:listbox")) {
|
||||
accessible = new XULListboxAccessibleWrap(aContent, aDoc);
|
||||
break;
|
||||
|
||||
case nsIAccessibleProvider::XULListCell:
|
||||
accessible = new XULListCellAccessibleWrap(aContent, aDoc);
|
||||
break;
|
||||
|
||||
case nsIAccessibleProvider::XULListHead:
|
||||
accessible = new XULColumAccessible(aContent, aDoc);
|
||||
break;
|
||||
|
||||
case nsIAccessibleProvider::XULListHeader:
|
||||
accessible = new XULColumnItemAccessible(aContent, aDoc);
|
||||
break;
|
||||
|
||||
case nsIAccessibleProvider::XULListitem:
|
||||
accessible = new XULListitemAccessible(aContent, aDoc);
|
||||
break;
|
||||
|
||||
case nsIAccessibleProvider::XULMenubar:
|
||||
accessible = new XULMenubarAccessible(aContent, aDoc);
|
||||
break;
|
||||
|
||||
case nsIAccessibleProvider::XULMenuitem:
|
||||
accessible = new XULMenuitemAccessibleWrap(aContent, aDoc);
|
||||
break;
|
||||
|
||||
case nsIAccessibleProvider::XULMenupopup:
|
||||
{
|
||||
#ifdef MOZ_ACCESSIBILITY_ATK
|
||||
// ATK considers this node to be redundant when within menubars, and it makes menu
|
||||
// navigation with assistive technologies more difficult
|
||||
// XXX In the future we will should this for consistency across the nsIAccessible
|
||||
// implementations on each platform for a consistent scripting environment, but
|
||||
// then strip out redundant accessibles in the AccessibleWrap class for each platform.
|
||||
nsIContent *parent = aContent->GetParent();
|
||||
if (parent && parent->NodeInfo()->Equals(nsGkAtoms::menu,
|
||||
kNameSpaceID_XUL))
|
||||
return nullptr;
|
||||
#endif
|
||||
accessible = new XULMenupopupAccessible(aContent, aDoc);
|
||||
break;
|
||||
|
||||
}
|
||||
case nsIAccessibleProvider::XULMenuSeparator:
|
||||
accessible = new XULMenuSeparatorAccessible(aContent, aDoc);
|
||||
break;
|
||||
|
||||
case nsIAccessibleProvider::XULPane:
|
||||
accessible = new EnumRoleAccessible(aContent, aDoc, roles::PANE);
|
||||
break;
|
||||
|
||||
case nsIAccessibleProvider::XULProgressMeter:
|
||||
accessible = new XULProgressMeterAccessible(aContent, aDoc);
|
||||
break;
|
||||
|
||||
case nsIAccessibleProvider::XULStatusBar:
|
||||
accessible = new XULStatusBarAccessible(aContent, aDoc);
|
||||
break;
|
||||
|
||||
case nsIAccessibleProvider::XULScale:
|
||||
accessible = new XULSliderAccessible(aContent, aDoc);
|
||||
break;
|
||||
|
||||
case nsIAccessibleProvider::XULRadioButton:
|
||||
accessible = new XULRadioButtonAccessible(aContent, aDoc);
|
||||
break;
|
||||
|
||||
case nsIAccessibleProvider::XULRadioGroup:
|
||||
accessible = new XULRadioGroupAccessible(aContent, aDoc);
|
||||
break;
|
||||
|
||||
case nsIAccessibleProvider::XULTab:
|
||||
accessible = new XULTabAccessible(aContent, aDoc);
|
||||
break;
|
||||
|
||||
case nsIAccessibleProvider::XULTabs:
|
||||
accessible = new XULTabsAccessible(aContent, aDoc);
|
||||
break;
|
||||
|
||||
case nsIAccessibleProvider::XULText:
|
||||
accessible = new XULLabelAccessible(aContent, aDoc);
|
||||
break;
|
||||
|
||||
case nsIAccessibleProvider::XULTextBox:
|
||||
accessible = new XULTextFieldAccessible(aContent, aDoc);
|
||||
break;
|
||||
|
||||
case nsIAccessibleProvider::XULThumb:
|
||||
accessible = new XULThumbAccessible(aContent, aDoc);
|
||||
break;
|
||||
|
||||
case nsIAccessibleProvider::XULTree:
|
||||
return CreateAccessibleForXULTree(aContent, aDoc);
|
||||
|
||||
case nsIAccessibleProvider::XULTreeColumns:
|
||||
accessible = new XULTreeColumAccessible(aContent, aDoc);
|
||||
break;
|
||||
|
||||
case nsIAccessibleProvider::XULTreeColumnItem:
|
||||
accessible = new XULColumnItemAccessible(aContent, aDoc);
|
||||
break;
|
||||
|
||||
case nsIAccessibleProvider::XULToolbar:
|
||||
accessible = new XULToolbarAccessible(aContent, aDoc);
|
||||
break;
|
||||
|
||||
case nsIAccessibleProvider::XULToolbarSeparator:
|
||||
accessible = new XULToolbarSeparatorAccessible(aContent, aDoc);
|
||||
break;
|
||||
|
||||
case nsIAccessibleProvider::XULTooltip:
|
||||
accessible = new XULTooltipAccessible(aContent, aDoc);
|
||||
break;
|
||||
|
||||
case nsIAccessibleProvider::XULToolbarButton:
|
||||
accessible = new XULToolbarButtonAccessible(aContent, aDoc);
|
||||
break;
|
||||
|
||||
#endif // MOZ_XUL
|
||||
|
||||
default:
|
||||
} else if (role.EqualsLiteral("xul:listcell")) {
|
||||
// Only create cells if there's more than one per row.
|
||||
nsIContent* listItem = aContent->GetParent();
|
||||
if (!listItem)
|
||||
return nullptr;
|
||||
|
||||
for (nsIContent* child = listItem->GetFirstChild(); child;
|
||||
child = child->GetNextSibling()) {
|
||||
if (child->IsXUL(nsGkAtoms::listcell) && child != aContent) {
|
||||
accessible = new XULListCellAccessibleWrap(aContent, aDoc);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
} else if (role.EqualsLiteral("xul:listhead")) {
|
||||
accessible = new XULColumAccessible(aContent, aDoc);
|
||||
|
||||
} else if (role.EqualsLiteral("xul:listheader")) {
|
||||
accessible = new XULColumnItemAccessible(aContent, aDoc);
|
||||
|
||||
} else if (role.EqualsLiteral("xul:listitem")) {
|
||||
accessible = new XULListitemAccessible(aContent, aDoc);
|
||||
|
||||
} else if (role.EqualsLiteral("xul:menubar")) {
|
||||
accessible = new XULMenubarAccessible(aContent, aDoc);
|
||||
|
||||
} else if (role.EqualsLiteral("xul:menulist")) {
|
||||
if (aContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::droppable,
|
||||
nsGkAtoms::_false, eCaseMatters))
|
||||
accessible = new XULTextFieldAccessible(aContent, aDoc);
|
||||
else
|
||||
accessible = new XULComboboxAccessible(aContent, aDoc);
|
||||
|
||||
} else if (role.EqualsLiteral("xul:menuitem")) {
|
||||
accessible = new XULMenuitemAccessibleWrap(aContent, aDoc);
|
||||
|
||||
} else if (role.EqualsLiteral("xul:menupopup")) {
|
||||
#ifdef MOZ_ACCESSIBILITY_ATK
|
||||
// ATK considers this node to be redundant when within menubars, and it makes menu
|
||||
// navigation with assistive technologies more difficult
|
||||
// XXX In the future we will should this for consistency across the nsIAccessible
|
||||
// implementations on each platform for a consistent scripting environment, but
|
||||
// then strip out redundant accessibles in the AccessibleWrap class for each platform.
|
||||
nsIContent *parent = aContent->GetParent();
|
||||
if (parent && parent->IsXUL() && parent->Tag() == nsGkAtoms::menu)
|
||||
return nullptr;
|
||||
#endif
|
||||
|
||||
accessible = new XULMenupopupAccessible(aContent, aDoc);
|
||||
|
||||
} else if(role.EqualsLiteral("xul:menuseparator")) {
|
||||
accessible = new XULMenuSeparatorAccessible(aContent, aDoc);
|
||||
|
||||
} else if(role.EqualsLiteral("xul:pane")) {
|
||||
accessible = new EnumRoleAccessible(aContent, aDoc, roles::PANE);
|
||||
|
||||
} else if (role.EqualsLiteral("xul:panel")) {
|
||||
if (aContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::noautofocus,
|
||||
nsGkAtoms::_true, eCaseMatters))
|
||||
accessible = new XULAlertAccessible(aContent, aDoc);
|
||||
else
|
||||
accessible = new EnumRoleAccessible(aContent, aDoc, roles::PANE);
|
||||
|
||||
} else if (role.EqualsLiteral("xul:progressmeter")) {
|
||||
accessible = new XULProgressMeterAccessible(aContent, aDoc);
|
||||
|
||||
} else if (role.EqualsLiteral("xulstatusbar")) {
|
||||
accessible = new XULStatusBarAccessible(aContent, aDoc);
|
||||
|
||||
} else if (role.EqualsLiteral("xul:scale")) {
|
||||
accessible = new XULSliderAccessible(aContent, aDoc);
|
||||
|
||||
} else if (role.EqualsLiteral("xul:radiobutton")) {
|
||||
accessible = new XULRadioButtonAccessible(aContent, aDoc);
|
||||
|
||||
} else if (role.EqualsLiteral("xul:radiogroup")) {
|
||||
accessible = new XULRadioGroupAccessible(aContent, aDoc);
|
||||
|
||||
} else if (role.EqualsLiteral("xul:tab")) {
|
||||
accessible = new XULTabAccessible(aContent, aDoc);
|
||||
|
||||
} else if (role.EqualsLiteral("xul:tabs")) {
|
||||
accessible = new XULTabsAccessible(aContent, aDoc);
|
||||
|
||||
} else if (role.EqualsLiteral("xul:text")) {
|
||||
accessible = new XULLabelAccessible(aContent, aDoc);
|
||||
|
||||
} else if (role.EqualsLiteral("xul:textbox")) {
|
||||
accessible = new XULTextFieldAccessible(aContent, aDoc);
|
||||
|
||||
} else if (role.EqualsLiteral("xul:thumb")) {
|
||||
accessible = new XULThumbAccessible(aContent, aDoc);
|
||||
|
||||
} else if (role.EqualsLiteral("xul:tree")) {
|
||||
accessible = CreateAccessibleForXULTree(aContent, aDoc);
|
||||
|
||||
} else if (role.EqualsLiteral("xul:treecolumns")) {
|
||||
accessible = new XULTreeColumAccessible(aContent, aDoc);
|
||||
|
||||
} else if (role.EqualsLiteral("xul:treecolumnitem")) {
|
||||
accessible = new XULColumnItemAccessible(aContent, aDoc);
|
||||
|
||||
} else if (role.EqualsLiteral("xul:toolbar")) {
|
||||
accessible = new XULToolbarAccessible(aContent, aDoc);
|
||||
|
||||
} else if (role.EqualsLiteral("xul:toolbarseparator")) {
|
||||
accessible = new XULToolbarSeparatorAccessible(aContent, aDoc);
|
||||
|
||||
} else if (role.EqualsLiteral("xul:tooltip")) {
|
||||
accessible = new XULTooltipAccessible(aContent, aDoc);
|
||||
|
||||
} else if (role.EqualsLiteral("xul:toolbarbutton")) {
|
||||
accessible = new XULToolbarButtonAccessible(aContent, aDoc);
|
||||
|
||||
}
|
||||
#endif // MOZ_XUL
|
||||
|
||||
return accessible.forget();
|
||||
}
|
||||
|
@ -22,7 +22,6 @@
|
||||
#include "nsIDOMHTMLTextAreaElement.h"
|
||||
#include "nsIEditor.h"
|
||||
#include "nsIFormControl.h"
|
||||
#include "nsIFrame.h"
|
||||
#include "nsINameSpaceManager.h"
|
||||
#include "nsISelectionController.h"
|
||||
#include "jsapi.h"
|
||||
|
@ -10,20 +10,11 @@
|
||||
xmlns:xbl="http://www.mozilla.org/xbl">
|
||||
|
||||
<!-- based on preferences.xml paneButton -->
|
||||
<binding id="viewbutton" extends="chrome://global/content/bindings/radio.xml#radio">
|
||||
<binding id="viewbutton" extends="chrome://global/content/bindings/radio.xml#radio" role="xullistitem">
|
||||
<content>
|
||||
<xul:image class="viewButtonIcon" xbl:inherits="src"/>
|
||||
<xul:label class="viewButtonLabel" xbl:inherits="value=label"/>
|
||||
</content>
|
||||
<implementation implements="nsIAccessibleProvider">
|
||||
<property name="accessibleType" readonly="true">
|
||||
<getter>
|
||||
<![CDATA[
|
||||
return Components.interfaces.nsIAccessibleProvider.XULListitem;
|
||||
]]>
|
||||
</getter>
|
||||
</property>
|
||||
</implementation>
|
||||
</binding>
|
||||
|
||||
</bindings>
|
||||
|
@ -7,10 +7,9 @@
|
||||
|
||||
let tmp = {};
|
||||
Cu.import("resource://gre/modules/osfile.jsm", tmp);
|
||||
Cu.import("resource://gre/modules/Task.jsm", tmp);
|
||||
Cu.import("resource:///modules/sessionstore/_SessionFile.jsm", tmp);
|
||||
|
||||
const {OS, Task, _SessionFile} = tmp;
|
||||
const {OS, _SessionFile} = tmp;
|
||||
|
||||
const PREF_SS_INTERVAL = "browser.sessionstore.interval";
|
||||
// Full paths for sessionstore.js and sessionstore.bak.
|
||||
|
@ -15,7 +15,7 @@
|
||||
|
||||
<binding id="local-browser" extends="chrome://global/content/bindings/browser.xml#browser">
|
||||
<implementation type="application/javascript"
|
||||
implements="nsIAccessibleProvider, nsIObserver, nsIDOMEventListener, nsIMessageListener">
|
||||
implements="nsIObserver, nsIDOMEventListener, nsIMessageListener">
|
||||
|
||||
<constructor>
|
||||
<![CDATA[
|
||||
@ -782,15 +782,7 @@
|
||||
</binding>
|
||||
|
||||
<binding id="remote-browser" extends="#local-browser">
|
||||
<implementation type="application/javascript" implements="nsIAccessibleProvider, nsIObserver, nsIDOMEventListener, nsIMessageListener">
|
||||
<property name="accessibleType" readonly="true">
|
||||
<getter>
|
||||
<![CDATA[
|
||||
throw "accessibleType: Supports Remote?";
|
||||
]]>
|
||||
</getter>
|
||||
</property>
|
||||
|
||||
<implementation type="application/javascript" implements="nsIObserver, nsIDOMEventListener, nsIMessageListener">
|
||||
<property name="autoscrollEnabled">
|
||||
<getter>
|
||||
<![CDATA[
|
||||
|
@ -537,6 +537,9 @@ class Automation(object):
|
||||
|
||||
return env
|
||||
|
||||
def killPid(self, pid):
|
||||
os.kill(pid, getattr(signal, "SIGKILL", signal.SIGTERM))
|
||||
|
||||
if IS_WIN32:
|
||||
PeekNamedPipe = ctypes.windll.kernel32.PeekNamedPipe
|
||||
GetLastError = ctypes.windll.kernel32.GetLastError
|
||||
@ -587,14 +590,6 @@ class Automation(object):
|
||||
ctypes.windll.kernel32.CloseHandle(pHandle)
|
||||
return pExitCode.value == STILL_ACTIVE
|
||||
|
||||
def killPid(self, pid):
|
||||
PROCESS_TERMINATE = 0x0001
|
||||
pHandle = ctypes.windll.kernel32.OpenProcess(PROCESS_TERMINATE, 0, pid)
|
||||
if not pHandle:
|
||||
return
|
||||
ctypes.windll.kernel32.TerminateProcess(pHandle, 1)
|
||||
ctypes.windll.kernel32.CloseHandle(pHandle)
|
||||
|
||||
else:
|
||||
|
||||
def readWithTimeout(self, f, timeout):
|
||||
@ -624,9 +619,6 @@ class Automation(object):
|
||||
return False
|
||||
raise
|
||||
|
||||
def killPid(self, pid):
|
||||
os.kill(pid, signal.SIGKILL)
|
||||
|
||||
def dumpScreen(self, utilityPath):
|
||||
if self.haveDumpedScreen:
|
||||
self.log.info("Not taking screenshot here: see the one that was previously logged")
|
||||
|
@ -1539,12 +1539,12 @@ public:
|
||||
|
||||
// Call EnterMicroTask when you're entering JS execution.
|
||||
// Usually the best way to do this is to use nsAutoMicroTask.
|
||||
static void EnterMicroTask() { ++sMicroTaskLevel; }
|
||||
static void EnterMicroTask();
|
||||
static void LeaveMicroTask();
|
||||
|
||||
static bool IsInMicroTask() { return sMicroTaskLevel != 0; }
|
||||
static uint32_t MicroTaskLevel() { return sMicroTaskLevel; }
|
||||
static void SetMicroTaskLevel(uint32_t aLevel) { sMicroTaskLevel = aLevel; }
|
||||
static bool IsInMicroTask();
|
||||
static uint32_t MicroTaskLevel();
|
||||
static void SetMicroTaskLevel(uint32_t aLevel);
|
||||
|
||||
/* Process viewport META data. This gives us information for the scale
|
||||
* and zoom of a page on mobile devices. We stick the information in
|
||||
|
@ -296,6 +296,11 @@ public:
|
||||
return IsInNamespace(kNameSpaceID_XUL);
|
||||
}
|
||||
|
||||
inline bool IsXUL(nsIAtom* aTag) const
|
||||
{
|
||||
return mNodeInfo->Equals(aTag, kNameSpaceID_XUL);
|
||||
}
|
||||
|
||||
inline bool IsMathML() const
|
||||
{
|
||||
return IsInNamespace(kNameSpaceID_MathML);
|
||||
|
@ -3,7 +3,7 @@
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "nsDOMParser.h"
|
||||
#include "mozilla/dom/DOMParser.h"
|
||||
|
||||
#include "nsIDOMDocument.h"
|
||||
#include "nsNetUtil.h"
|
||||
@ -20,28 +20,28 @@
|
||||
using namespace mozilla;
|
||||
using namespace mozilla::dom;
|
||||
|
||||
nsDOMParser::nsDOMParser()
|
||||
DOMParser::DOMParser()
|
||||
: mAttemptedInit(false)
|
||||
{
|
||||
SetIsDOMBinding();
|
||||
}
|
||||
|
||||
nsDOMParser::~nsDOMParser()
|
||||
DOMParser::~DOMParser()
|
||||
{
|
||||
}
|
||||
|
||||
// QueryInterface implementation for nsDOMParser
|
||||
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsDOMParser)
|
||||
// QueryInterface implementation for DOMParser
|
||||
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(DOMParser)
|
||||
NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
|
||||
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDOMParser)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMParser)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
|
||||
NS_INTERFACE_MAP_END
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_1(nsDOMParser, mOwner)
|
||||
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_1(DOMParser, mOwner)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTING_ADDREF(nsDOMParser)
|
||||
NS_IMPL_CYCLE_COLLECTING_RELEASE(nsDOMParser)
|
||||
NS_IMPL_CYCLE_COLLECTING_ADDREF(DOMParser)
|
||||
NS_IMPL_CYCLE_COLLECTING_RELEASE(DOMParser)
|
||||
|
||||
static const char*
|
||||
StringFromSupportedType(SupportedType aType)
|
||||
@ -50,8 +50,8 @@ StringFromSupportedType(SupportedType aType)
|
||||
}
|
||||
|
||||
already_AddRefed<nsIDocument>
|
||||
nsDOMParser::ParseFromString(const nsAString& aStr, SupportedType aType,
|
||||
ErrorResult& rv)
|
||||
DOMParser::ParseFromString(const nsAString& aStr, SupportedType aType,
|
||||
ErrorResult& rv)
|
||||
{
|
||||
nsCOMPtr<nsIDOMDocument> domDocument;
|
||||
rv = ParseFromString(aStr,
|
||||
@ -62,9 +62,9 @@ nsDOMParser::ParseFromString(const nsAString& aStr, SupportedType aType,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDOMParser::ParseFromString(const PRUnichar *str,
|
||||
const char *contentType,
|
||||
nsIDOMDocument **aResult)
|
||||
DOMParser::ParseFromString(const PRUnichar *str,
|
||||
const char *contentType,
|
||||
nsIDOMDocument **aResult)
|
||||
{
|
||||
NS_ENSURE_ARG(str);
|
||||
// Converting a string to an enum value manually is a bit of a pain,
|
||||
@ -73,9 +73,9 @@ nsDOMParser::ParseFromString(const PRUnichar *str,
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsDOMParser::ParseFromString(const nsAString& str,
|
||||
const char *contentType,
|
||||
nsIDOMDocument **aResult)
|
||||
DOMParser::ParseFromString(const nsAString& str,
|
||||
const char *contentType,
|
||||
nsIDOMDocument **aResult)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aResult);
|
||||
|
||||
@ -120,31 +120,31 @@ nsDOMParser::ParseFromString(const nsAString& str,
|
||||
}
|
||||
|
||||
already_AddRefed<nsIDocument>
|
||||
nsDOMParser::ParseFromBuffer(const Sequence<uint8_t>& aBuf, uint32_t aBufLen,
|
||||
SupportedType aType, ErrorResult& rv)
|
||||
DOMParser::ParseFromBuffer(const Sequence<uint8_t>& aBuf, uint32_t aBufLen,
|
||||
SupportedType aType, ErrorResult& rv)
|
||||
{
|
||||
if (aBufLen > aBuf.Length()) {
|
||||
rv.Throw(NS_ERROR_XPC_NOT_ENOUGH_ELEMENTS_IN_ARRAY);
|
||||
return nullptr;
|
||||
}
|
||||
nsCOMPtr<nsIDOMDocument> domDocument;
|
||||
rv = nsDOMParser::ParseFromBuffer(aBuf.Elements(), aBufLen,
|
||||
StringFromSupportedType(aType),
|
||||
getter_AddRefs(domDocument));
|
||||
rv = DOMParser::ParseFromBuffer(aBuf.Elements(), aBufLen,
|
||||
StringFromSupportedType(aType),
|
||||
getter_AddRefs(domDocument));
|
||||
nsCOMPtr<nsIDocument> document(do_QueryInterface(domDocument));
|
||||
return document.forget();
|
||||
}
|
||||
|
||||
already_AddRefed<nsIDocument>
|
||||
nsDOMParser::ParseFromBuffer(const Uint8Array& aBuf, uint32_t aBufLen,
|
||||
SupportedType aType, ErrorResult& rv)
|
||||
DOMParser::ParseFromBuffer(const Uint8Array& aBuf, uint32_t aBufLen,
|
||||
SupportedType aType, ErrorResult& rv)
|
||||
{
|
||||
if (aBufLen > aBuf.Length()) {
|
||||
rv.Throw(NS_ERROR_XPC_NOT_ENOUGH_ELEMENTS_IN_ARRAY);
|
||||
return nullptr;
|
||||
}
|
||||
nsCOMPtr<nsIDOMDocument> domDocument;
|
||||
rv = nsDOMParser::ParseFromBuffer(aBuf.Data(), aBufLen,
|
||||
rv = DOMParser::ParseFromBuffer(aBuf.Data(), aBufLen,
|
||||
StringFromSupportedType(aType),
|
||||
getter_AddRefs(domDocument));
|
||||
nsCOMPtr<nsIDocument> document(do_QueryInterface(domDocument));
|
||||
@ -152,10 +152,10 @@ nsDOMParser::ParseFromBuffer(const Uint8Array& aBuf, uint32_t aBufLen,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDOMParser::ParseFromBuffer(const uint8_t *buf,
|
||||
uint32_t bufLen,
|
||||
const char *contentType,
|
||||
nsIDOMDocument **aResult)
|
||||
DOMParser::ParseFromBuffer(const uint8_t *buf,
|
||||
uint32_t bufLen,
|
||||
const char *contentType,
|
||||
nsIDOMDocument **aResult)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(buf);
|
||||
NS_ENSURE_ARG_POINTER(aResult);
|
||||
@ -173,28 +173,28 @@ nsDOMParser::ParseFromBuffer(const uint8_t *buf,
|
||||
|
||||
|
||||
already_AddRefed<nsIDocument>
|
||||
nsDOMParser::ParseFromStream(nsIInputStream* aStream,
|
||||
const nsAString& aCharset,
|
||||
int32_t aContentLength,
|
||||
SupportedType aType,
|
||||
ErrorResult& rv)
|
||||
DOMParser::ParseFromStream(nsIInputStream* aStream,
|
||||
const nsAString& aCharset,
|
||||
int32_t aContentLength,
|
||||
SupportedType aType,
|
||||
ErrorResult& rv)
|
||||
{
|
||||
nsCOMPtr<nsIDOMDocument> domDocument;
|
||||
rv = nsDOMParser::ParseFromStream(aStream,
|
||||
NS_ConvertUTF16toUTF8(aCharset).get(),
|
||||
aContentLength,
|
||||
StringFromSupportedType(aType),
|
||||
getter_AddRefs(domDocument));
|
||||
rv = DOMParser::ParseFromStream(aStream,
|
||||
NS_ConvertUTF16toUTF8(aCharset).get(),
|
||||
aContentLength,
|
||||
StringFromSupportedType(aType),
|
||||
getter_AddRefs(domDocument));
|
||||
nsCOMPtr<nsIDocument> document(do_QueryInterface(domDocument));
|
||||
return document.forget();
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDOMParser::ParseFromStream(nsIInputStream *stream,
|
||||
const char *charset,
|
||||
int32_t contentLength,
|
||||
const char *contentType,
|
||||
nsIDOMDocument **aResult)
|
||||
DOMParser::ParseFromStream(nsIInputStream *stream,
|
||||
const char *charset,
|
||||
int32_t contentLength,
|
||||
const char *contentType,
|
||||
nsIDOMDocument **aResult)
|
||||
{
|
||||
NS_ENSURE_ARG(stream);
|
||||
NS_ENSURE_ARG(contentType);
|
||||
@ -304,8 +304,8 @@ nsDOMParser::ParseFromStream(nsIInputStream *stream,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDOMParser::Init(nsIPrincipal* principal, nsIURI* documentURI,
|
||||
nsIURI* baseURI, nsIScriptGlobalObject* aScriptObject)
|
||||
DOMParser::Init(nsIPrincipal* principal, nsIURI* documentURI,
|
||||
nsIURI* baseURI, nsIScriptGlobalObject* aScriptObject)
|
||||
{
|
||||
NS_ENSURE_STATE(!mAttemptedInit);
|
||||
mAttemptedInit = true;
|
||||
@ -360,16 +360,16 @@ nsDOMParser::Init(nsIPrincipal* principal, nsIURI* documentURI,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/*static */already_AddRefed<nsDOMParser>
|
||||
nsDOMParser::Constructor(const GlobalObject& aOwner,
|
||||
nsIPrincipal* aPrincipal, nsIURI* aDocumentURI,
|
||||
nsIURI* aBaseURI, ErrorResult& rv)
|
||||
/*static */already_AddRefed<DOMParser>
|
||||
DOMParser::Constructor(const GlobalObject& aOwner,
|
||||
nsIPrincipal* aPrincipal, nsIURI* aDocumentURI,
|
||||
nsIURI* aBaseURI, ErrorResult& rv)
|
||||
{
|
||||
if (!nsContentUtils::IsCallerChrome()) {
|
||||
rv.Throw(NS_ERROR_DOM_SECURITY_ERR);
|
||||
return nullptr;
|
||||
}
|
||||
nsRefPtr<nsDOMParser> domParser = new nsDOMParser(aOwner.GetAsSupports());
|
||||
nsRefPtr<DOMParser> domParser = new DOMParser(aOwner.GetAsSupports());
|
||||
rv = domParser->InitInternal(aOwner.GetAsSupports(), aPrincipal, aDocumentURI,
|
||||
aBaseURI);
|
||||
if (rv.Failed()) {
|
||||
@ -378,9 +378,9 @@ nsDOMParser::Constructor(const GlobalObject& aOwner,
|
||||
return domParser.forget();
|
||||
}
|
||||
|
||||
/*static */already_AddRefed<nsDOMParser>
|
||||
nsDOMParser::Constructor(const GlobalObject& aOwner,
|
||||
ErrorResult& rv)
|
||||
/*static */already_AddRefed<DOMParser>
|
||||
DOMParser::Constructor(const GlobalObject& aOwner,
|
||||
ErrorResult& rv)
|
||||
{
|
||||
nsCOMPtr<nsIPrincipal> prin;
|
||||
nsCOMPtr<nsIURI> documentURI;
|
||||
@ -403,7 +403,7 @@ nsDOMParser::Constructor(const GlobalObject& aOwner,
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
nsRefPtr<nsDOMParser> domParser = new nsDOMParser(aOwner.GetAsSupports());
|
||||
nsRefPtr<DOMParser> domParser = new DOMParser(aOwner.GetAsSupports());
|
||||
rv = domParser->InitInternal(aOwner.GetAsSupports(), prin, documentURI, baseURI);
|
||||
if (rv.Failed()) {
|
||||
return nullptr;
|
||||
@ -412,8 +412,8 @@ nsDOMParser::Constructor(const GlobalObject& aOwner,
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsDOMParser::InitInternal(nsISupports* aOwner, nsIPrincipal* prin,
|
||||
nsIURI* documentURI, nsIURI* baseURI)
|
||||
DOMParser::InitInternal(nsISupports* aOwner, nsIPrincipal* prin,
|
||||
nsIURI* documentURI, nsIURI* baseURI)
|
||||
{
|
||||
AttemptedInitMarker marker(&mAttemptedInit);
|
||||
if (!documentURI) {
|
||||
@ -446,8 +446,8 @@ nsDOMParser::InitInternal(nsISupports* aOwner, nsIPrincipal* prin,
|
||||
}
|
||||
|
||||
void
|
||||
nsDOMParser::Init(nsIPrincipal* aPrincipal, nsIURI* aDocumentURI,
|
||||
nsIURI* aBaseURI, mozilla::ErrorResult& rv)
|
||||
DOMParser::Init(nsIPrincipal* aPrincipal, nsIURI* aDocumentURI,
|
||||
nsIURI* aBaseURI, mozilla::ErrorResult& rv)
|
||||
{
|
||||
AttemptedInitMarker marker(&mAttemptedInit);
|
||||
|
||||
@ -485,7 +485,7 @@ nsDOMParser::Init(nsIPrincipal* aPrincipal, nsIURI* aDocumentURI,
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsDOMParser::SetUpDocument(DocumentFlavor aFlavor, nsIDOMDocument** aResult)
|
||||
DOMParser::SetUpDocument(DocumentFlavor aFlavor, nsIDOMDocument** aResult)
|
||||
{
|
||||
nsCOMPtr<nsIScriptGlobalObject> scriptHandlingObject =
|
||||
do_QueryReferent(mScriptHandlingObject);
|
@ -3,8 +3,8 @@
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#ifndef nsDOMParser_h_
|
||||
#define nsDOMParser_h_
|
||||
#ifndef mozilla_dom_DOMParser_h_
|
||||
#define mozilla_dom_DOMParser_h_
|
||||
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsIDocument.h"
|
||||
@ -17,28 +17,31 @@
|
||||
|
||||
class nsIDocument;
|
||||
|
||||
class nsDOMParser MOZ_FINAL : public nsIDOMParser,
|
||||
public nsSupportsWeakReference,
|
||||
public nsWrapperCache
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
class DOMParser MOZ_FINAL : public nsIDOMParser,
|
||||
public nsSupportsWeakReference,
|
||||
public nsWrapperCache
|
||||
{
|
||||
typedef mozilla::dom::GlobalObject GlobalObject;
|
||||
public:
|
||||
nsDOMParser();
|
||||
virtual ~nsDOMParser();
|
||||
DOMParser();
|
||||
virtual ~DOMParser();
|
||||
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_AMBIGUOUS(nsDOMParser,
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_AMBIGUOUS(DOMParser,
|
||||
nsIDOMParser)
|
||||
|
||||
// nsIDOMParser
|
||||
NS_DECL_NSIDOMPARSER
|
||||
|
||||
// WebIDL API
|
||||
static already_AddRefed<nsDOMParser>
|
||||
static already_AddRefed<DOMParser>
|
||||
Constructor(const GlobalObject& aOwner,
|
||||
mozilla::ErrorResult& rv);
|
||||
|
||||
static already_AddRefed<nsDOMParser>
|
||||
static already_AddRefed<DOMParser>
|
||||
Constructor(const GlobalObject& aOwner,
|
||||
nsIPrincipal* aPrincipal, nsIURI* aDocumentURI, nsIURI* aBaseURI,
|
||||
mozilla::ErrorResult& rv);
|
||||
@ -77,7 +80,7 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
nsDOMParser(nsISupports* aOwner) : mOwner(aOwner), mAttemptedInit(false)
|
||||
DOMParser(nsISupports* aOwner) : mOwner(aOwner), mAttemptedInit(false)
|
||||
{
|
||||
MOZ_ASSERT(aOwner);
|
||||
SetIsDOMBinding();
|
||||
@ -116,4 +119,7 @@ private:
|
||||
bool mAttemptedInit;
|
||||
};
|
||||
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
||||
#endif
|
@ -485,29 +485,26 @@ WebSocket::WrapObject(JSContext* cx, JS::Handle<JSObject*> scope)
|
||||
// Constructor:
|
||||
already_AddRefed<WebSocket>
|
||||
WebSocket::Constructor(const GlobalObject& aGlobal,
|
||||
JSContext* aCx,
|
||||
const nsAString& aUrl,
|
||||
ErrorResult& aRv)
|
||||
{
|
||||
Sequence<nsString> protocols;
|
||||
return WebSocket::Constructor(aGlobal, aCx, aUrl, protocols, aRv);
|
||||
return WebSocket::Constructor(aGlobal, aUrl, protocols, aRv);
|
||||
}
|
||||
|
||||
already_AddRefed<WebSocket>
|
||||
WebSocket::Constructor(const GlobalObject& aGlobal,
|
||||
JSContext* aCx,
|
||||
const nsAString& aUrl,
|
||||
const nsAString& aProtocol,
|
||||
ErrorResult& aRv)
|
||||
{
|
||||
Sequence<nsString> protocols;
|
||||
protocols.AppendElement(aProtocol);
|
||||
return WebSocket::Constructor(aGlobal, aCx, aUrl, protocols, aRv);
|
||||
return WebSocket::Constructor(aGlobal, aUrl, protocols, aRv);
|
||||
}
|
||||
|
||||
already_AddRefed<WebSocket>
|
||||
WebSocket::Constructor(const GlobalObject& aGlobal,
|
||||
JSContext* aCx,
|
||||
const nsAString& aUrl,
|
||||
const Sequence<nsString>& aProtocols,
|
||||
ErrorResult& aRv)
|
||||
@ -565,7 +562,8 @@ WebSocket::Constructor(const GlobalObject& aGlobal,
|
||||
}
|
||||
|
||||
nsRefPtr<WebSocket> webSocket = new WebSocket();
|
||||
nsresult rv = webSocket->Init(aCx, principal, ownerWindow, aUrl, protocolArray);
|
||||
nsresult rv = webSocket->Init(aGlobal.GetContext(), principal, ownerWindow,
|
||||
aUrl, protocolArray);
|
||||
if (NS_FAILED(rv)) {
|
||||
aRv.Throw(rv);
|
||||
return nullptr;
|
||||
|
@ -92,18 +92,15 @@ public: // WebIDL interface:
|
||||
|
||||
// Constructor:
|
||||
static already_AddRefed<WebSocket> Constructor(const GlobalObject& aGlobal,
|
||||
JSContext *aCx,
|
||||
const nsAString& aUrl,
|
||||
ErrorResult& rv);
|
||||
|
||||
static already_AddRefed<WebSocket> Constructor(const GlobalObject& aGlobal,
|
||||
JSContext *aCx,
|
||||
const nsAString& aUrl,
|
||||
const nsAString& aProtocol,
|
||||
ErrorResult& rv);
|
||||
|
||||
static already_AddRefed<WebSocket> Constructor(const GlobalObject& aGlobal,
|
||||
JSContext *aCx,
|
||||
const nsAString& aUrl,
|
||||
const Sequence<nsString>& aProtocols,
|
||||
ErrorResult& rv);
|
||||
|
@ -54,6 +54,7 @@ EXPORTS.mozilla.dom += [
|
||||
'Attr.h',
|
||||
'Comment.h',
|
||||
'DOMImplementation.h',
|
||||
'DOMParser.h',
|
||||
'DocumentFragment.h',
|
||||
'DocumentType.h',
|
||||
'EventSource.h',
|
||||
@ -70,6 +71,7 @@ CPP_SOURCES += [
|
||||
'DirectionalityUtils.cpp',
|
||||
'DocumentFragment.cpp',
|
||||
'DocumentType.cpp',
|
||||
'DOMParser.cpp',
|
||||
'Element.cpp',
|
||||
'EventSource.cpp',
|
||||
'FileIOObject.cpp',
|
||||
@ -103,7 +105,6 @@ CPP_SOURCES += [
|
||||
'nsDOMFileReader.cpp',
|
||||
'nsDOMLists.cpp',
|
||||
'nsDOMMutationObserver.cpp',
|
||||
'nsDOMParser.cpp',
|
||||
'nsDOMSerializer.cpp',
|
||||
'nsDOMSettableTokenList.cpp',
|
||||
'nsDOMTokenList.cpp',
|
||||
|
@ -4807,14 +4807,43 @@ nsContentUtils::AddScriptRunner(nsIRunnable* aRunnable)
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
nsContentUtils::EnterMicroTask()
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
++sMicroTaskLevel;
|
||||
}
|
||||
|
||||
void
|
||||
nsContentUtils::LeaveMicroTask()
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
if (--sMicroTaskLevel == 0) {
|
||||
nsDOMMutationObserver::HandleMutations();
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
nsContentUtils::IsInMicroTask()
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
return sMicroTaskLevel != 0;
|
||||
}
|
||||
|
||||
uint32_t
|
||||
nsContentUtils::MicroTaskLevel()
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
return sMicroTaskLevel;
|
||||
}
|
||||
|
||||
void
|
||||
nsContentUtils::SetMicroTaskLevel(uint32_t aLevel)
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
sMicroTaskLevel = aLevel;
|
||||
}
|
||||
|
||||
/*
|
||||
* Helper function for nsContentUtils::ProcessViewportInfo.
|
||||
*
|
||||
|
@ -61,7 +61,6 @@
|
||||
#include "nsIDOMUserDataHandler.h"
|
||||
#include "nsIEditor.h"
|
||||
#include "nsIEditorIMESupport.h"
|
||||
#include "nsIFrame.h"
|
||||
#include "nsILinkHandler.h"
|
||||
#include "nsINameSpaceManager.h"
|
||||
#include "nsINodeInfo.h"
|
||||
|
@ -5755,30 +5755,50 @@ HTMLInputElement::IsValidEmailAddress(const nsAString& aValue)
|
||||
uint32_t i = 0;
|
||||
uint32_t length = value.Length();
|
||||
|
||||
// Email addresses can't be empty and can't end with a '.' or '-'.
|
||||
if (length == 0 || value[length - 1] == '.' || value[length - 1] == '-') {
|
||||
return false;
|
||||
}
|
||||
|
||||
uint32_t atPos = (uint32_t)value.FindChar('@');
|
||||
// Email addresses must contain a '@', but can't begin or end with it.
|
||||
if (atPos == (uint32_t)kNotFound || atPos == 0 || atPos == length - 1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Puny-encode the string if needed before running the validation algorithm.
|
||||
nsCOMPtr<nsIIDNService> idnSrv = do_GetService(NS_IDNSERVICE_CONTRACTID);
|
||||
if (idnSrv) {
|
||||
// ConvertUTF8toACE() treats 'username@domain' as a single label so we need
|
||||
// to puny-encode the username and domain parts separately.
|
||||
const nsDependentCSubstring username = Substring(value, 0, atPos);
|
||||
bool ace;
|
||||
if (NS_SUCCEEDED(idnSrv->IsACE(value, &ace)) && !ace) {
|
||||
nsAutoCString punyCodedValue;
|
||||
if (NS_SUCCEEDED(idnSrv->ConvertUTF8toACE(value, punyCodedValue))) {
|
||||
value = punyCodedValue;
|
||||
length = value.Length();
|
||||
if (NS_SUCCEEDED(idnSrv->IsACE(username, &ace)) && !ace) {
|
||||
nsAutoCString usernameACE;
|
||||
// TODO: Bug 901347: Usernames longer than 63 chars are not converted by
|
||||
// ConvertUTF8toACE(). For now, continue on even if the conversion fails.
|
||||
if (NS_SUCCEEDED(idnSrv->ConvertUTF8toACE(username, usernameACE))) {
|
||||
value.Replace(0, atPos, usernameACE);
|
||||
atPos = usernameACE.Length();
|
||||
}
|
||||
}
|
||||
|
||||
const nsDependentCSubstring domain = Substring(value, atPos + 1);
|
||||
if (NS_SUCCEEDED(idnSrv->IsACE(domain, &ace)) && !ace) {
|
||||
nsAutoCString domainACE;
|
||||
if (NS_FAILED(idnSrv->ConvertUTF8toACE(domain, domainACE))) {
|
||||
return false;
|
||||
}
|
||||
value.Replace(atPos + 1, domain.Length(), domainACE);
|
||||
}
|
||||
|
||||
length = value.Length();
|
||||
} else {
|
||||
NS_ERROR("nsIIDNService isn't present!");
|
||||
}
|
||||
|
||||
// If the email address is empty, begins with an '@'
|
||||
// or ends with a '.' or '-', we know it's invalid.
|
||||
if (length == 0 || value[0] == '@' || value[length-1] == '.' ||
|
||||
value[length-1] == '-') {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Parsing the username.
|
||||
for (; i < length && value[i] != '@'; ++i) {
|
||||
for (; i < atPos; ++i) {
|
||||
PRUnichar c = value[i];
|
||||
|
||||
// The username characters have to be in this list to be valid.
|
||||
@ -5791,10 +5811,8 @@ HTMLInputElement::IsValidEmailAddress(const nsAString& aValue)
|
||||
}
|
||||
}
|
||||
|
||||
// If there is no domain name, that's not a valid email address.
|
||||
if (++i >= length) {
|
||||
return false;
|
||||
}
|
||||
// Skip the '@'.
|
||||
++i;
|
||||
|
||||
// The domain name can't begin with a dot or a dash.
|
||||
if (value[i] == '.' || value[i] == '-') {
|
||||
|
@ -25,7 +25,6 @@
|
||||
#include "nsIFormControlFrame.h"
|
||||
#include "nsIForm.h"
|
||||
#include "nsIFormProcessor.h"
|
||||
#include "nsIFrame.h"
|
||||
#include "nsIListControlFrame.h"
|
||||
#include "nsLayoutUtils.h"
|
||||
#include "nsMappedAttributes.h"
|
||||
|
@ -25,7 +25,6 @@
|
||||
#include "nsIDocument.h"
|
||||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsIDOMHTMLMediaElement.h"
|
||||
#include "nsIFrame.h"
|
||||
#include "nsIHttpChannel.h"
|
||||
#include "nsIInterfaceRequestor.h"
|
||||
#include "nsILoadGroup.h"
|
||||
|
@ -112,6 +112,20 @@ var values = [
|
||||
// Long strings with UTF-8.
|
||||
[ 'this.is.email.should.be.longer.than.sixty.four.characters.föö@mözillä.tld', true ],
|
||||
[ 'this-is-email-should-be-longer-than-sixty-four-characters-föö@mözillä.tld', true, true ],
|
||||
// Long labels.
|
||||
[ 'foo@thislabelisexactly63characterssssssssssssssssssssssssssssssssss', true ],
|
||||
[ 'foo@thislabelisexactly63characterssssssssssssssssssssssssssssssssss.com', true ],
|
||||
[ 'foo@foo.thislabelisexactly63characterssssssssssssssssssssssssssssssssss.com', true ],
|
||||
[ 'foo@foo.thislabelisexactly63characterssssssssssssssssssssssssssssssssss', true ],
|
||||
[ 'foo@thislabelisexactly64charactersssssssssssssssssssssssssssssssssss', false ],
|
||||
[ 'foo@thislabelisexactly64charactersssssssssssssssssssssssssssssssssss.com', false ],
|
||||
[ 'foo@foo.thislabelisexactly64charactersssssssssssssssssssssssssssssssssss.com', false ],
|
||||
[ 'foo@foo.thislabelisexactly64charactersssssssssssssssssssssssssssssssssss', false ],
|
||||
// Long labels with UTF-8.
|
||||
[ 'foo@thisläbelisexäctly63charäcterssssssssssssssssssssssssssssssssss', false ],
|
||||
[ 'foo@thisläbelisexäctly63charäcterssssssssssssssssssssssssssssssssss.com', false ],
|
||||
[ 'foo@foo.thisläbelisexäctly63charäcterssssssssssssssssssssssssssssssssss.com', false ],
|
||||
[ 'foo@foo.thisläbelisexäctly63charäcterssssssssssssssssssssssssssssssssss', false ],
|
||||
// The domains labels (sub-domains or tld) can't start or finish with a '-'
|
||||
[ 'foo@foo-bar', true ],
|
||||
[ 'foo@-foo', false ],
|
||||
@ -179,7 +193,7 @@ for (c of legalCharacters) {
|
||||
values.push(["foo@foo.bar" + c, true]);
|
||||
}
|
||||
// Add the concatenation of all legal characters too.
|
||||
values.push(["foo@bar.com" + legalCharacters, true]);
|
||||
values.push(["foo@bar." + legalCharacters, true]);
|
||||
|
||||
// Add domain illegal characters.
|
||||
illegalCharacters = "()<>[]:;@\\,!#$%&'*+/=?^_`{|}~ \t";
|
||||
|
@ -95,8 +95,8 @@ function runNextTest() {
|
||||
}
|
||||
}
|
||||
|
||||
if (isOSXMtnLion) {
|
||||
todo(false, "Mountain Lion doesn't like this test (bug 802504)");
|
||||
if (isOSXLion || isOSXMtnLion) {
|
||||
todo(false, "Can't reliably run full-screen tests on OS X (bug 900453 comment 18 & bug 802504)");
|
||||
} else {
|
||||
try {
|
||||
window.fullScreen = true;
|
||||
|
@ -7,7 +7,6 @@
|
||||
#include "mozilla/dom/SVGTextPathElementBinding.h"
|
||||
#include "nsSVGElement.h"
|
||||
#include "nsGkAtoms.h"
|
||||
#include "nsIFrame.h"
|
||||
#include "nsError.h"
|
||||
|
||||
NS_IMPL_NS_NEW_NAMESPACED_SVG_ELEMENT(TextPath)
|
||||
|
@ -57,11 +57,11 @@ public:
|
||||
|
||||
NS_DECL_CYCLE_COLLECTION_NATIVE_CLASS(nsXBLBinding)
|
||||
|
||||
nsXBLPrototypeBinding* PrototypeBinding() { return mPrototypeBinding; }
|
||||
nsXBLPrototypeBinding* PrototypeBinding() const { return mPrototypeBinding; }
|
||||
nsIContent* GetAnonymousContent() { return mContent.get(); }
|
||||
nsXBLBinding* GetBindingWithContent();
|
||||
|
||||
nsXBLBinding* GetBaseBinding() { return mNextBinding; }
|
||||
nsXBLBinding* GetBaseBinding() const { return mNextBinding; }
|
||||
void SetBaseBinding(nsXBLBinding *aBinding);
|
||||
|
||||
nsIContent* GetBoundElement() { return mBoundElement; }
|
||||
|
@ -201,13 +201,6 @@ nsXBLPrototypeBinding::SetBasePrototype(nsXBLPrototypeBinding* aBinding)
|
||||
mBaseBinding = aBinding;
|
||||
}
|
||||
|
||||
already_AddRefed<nsIContent>
|
||||
nsXBLPrototypeBinding::GetBindingElement()
|
||||
{
|
||||
nsCOMPtr<nsIContent> result = mBinding;
|
||||
return result.forget();
|
||||
}
|
||||
|
||||
void
|
||||
nsXBLPrototypeBinding::SetBindingElement(nsIContent* aElement)
|
||||
{
|
||||
|
@ -36,7 +36,7 @@ class nsCSSStyleSheet;
|
||||
class nsXBLPrototypeBinding
|
||||
{
|
||||
public:
|
||||
already_AddRefed<nsIContent> GetBindingElement();
|
||||
nsIContent* GetBindingElement() const { return mBinding; }
|
||||
void SetBindingElement(nsIContent* aElement);
|
||||
|
||||
nsIURI* BindingURI() const { return mBindingURI; }
|
||||
|
@ -776,7 +776,7 @@ nsXBLService::GetBinding(nsIContent* aBoundElement, nsIURI* aURI,
|
||||
|
||||
nsRefPtr<nsXBLBinding> baseBinding;
|
||||
if (baseBindingURI) {
|
||||
nsCOMPtr<nsIContent> child = protoBinding->GetBindingElement();
|
||||
nsIContent* child = protoBinding->GetBindingElement();
|
||||
rv = GetBinding(aBoundElement, baseBindingURI, aPeekOnly,
|
||||
child->NodePrincipal(), aIsReady,
|
||||
getter_AddRefs(baseBinding), aDontExtendURIs);
|
||||
|
@ -558,8 +558,8 @@ static nsDOMClassInfoData sClassInfoData[] = {
|
||||
NS_DEFINE_CLASSINFO_DATA(CSSFontFeatureValuesRule, nsDOMGenericSH,
|
||||
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
||||
|
||||
NS_DEFINE_CLASSINFO_DATA(UserDataHandler, nsDOMGenericSH,
|
||||
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
||||
NS_DEFINE_CHROME_XBL_CLASSINFO_DATA(UserDataHandler, nsDOMGenericSH,
|
||||
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
||||
NS_DEFINE_CLASSINFO_DATA(LoadStatus, nsDOMGenericSH,
|
||||
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
||||
NS_DEFINE_CLASSINFO_DATA(XPathNamespace, nsDOMGenericSH,
|
||||
@ -3507,7 +3507,6 @@ const InterfaceShimEntry kInterfaceShimMap[] =
|
||||
{ "nsIXMLHttpRequest", "XMLHttpRequest" },
|
||||
{ "nsIDOMDOMException", "DOMException" },
|
||||
{ "nsIDOMNode", "Node" },
|
||||
{ "nsIDOMUserDataHandler", "UserDataHandler" },
|
||||
{ "nsIDOMCSSPrimitiveValue", "CSSPrimitiveValue" },
|
||||
{ "nsIDOMCSSRule", "CSSRule" },
|
||||
{ "nsIDOMCSSValue", "CSSValue" },
|
||||
|
@ -241,8 +241,8 @@ DOMInterfaces = {
|
||||
},
|
||||
|
||||
'Crypto' : {
|
||||
'implicitJSContext': [ 'generateCRMFRequest', 'signText' ],
|
||||
'headerFile': 'Crypto.h'
|
||||
'implicitJSContext': [ 'generateCRMFRequest', 'signText' ],
|
||||
'headerFile': 'Crypto.h'
|
||||
},
|
||||
|
||||
'CSS': {
|
||||
@ -250,7 +250,7 @@ DOMInterfaces = {
|
||||
},
|
||||
|
||||
'CSS2Properties': {
|
||||
'nativeType': 'nsDOMCSSDeclaration'
|
||||
'nativeType': 'nsDOMCSSDeclaration'
|
||||
},
|
||||
|
||||
'CSSPrimitiveValue': {
|
||||
@ -259,7 +259,7 @@ DOMInterfaces = {
|
||||
},
|
||||
|
||||
'CSSStyleDeclaration': {
|
||||
'nativeType': 'nsICSSDeclaration'
|
||||
'nativeType': 'nsICSSDeclaration'
|
||||
},
|
||||
|
||||
'CSSStyleSheet': {
|
||||
@ -268,11 +268,11 @@ DOMInterfaces = {
|
||||
},
|
||||
|
||||
'CSSValue': {
|
||||
'concrete': False
|
||||
'concrete': False
|
||||
},
|
||||
|
||||
'CSSValueList': {
|
||||
'nativeType': 'nsDOMCSSValueList'
|
||||
'nativeType': 'nsDOMCSSValueList'
|
||||
},
|
||||
|
||||
'DataChannel': {
|
||||
@ -315,10 +315,6 @@ DOMInterfaces = {
|
||||
'skipGen': True
|
||||
}],
|
||||
|
||||
'DOMParser': {
|
||||
'nativeType': 'nsDOMParser',
|
||||
},
|
||||
|
||||
'DocumentFragment': {
|
||||
'resultNotAddRefed': [ 'querySelector' ]
|
||||
},
|
||||
@ -653,8 +649,8 @@ DOMInterfaces = {
|
||||
|
||||
'ImageData': [
|
||||
{
|
||||
'wrapperCache': False,
|
||||
'wantsQI': False,
|
||||
'wrapperCache': False,
|
||||
'wantsQI': False,
|
||||
}],
|
||||
|
||||
'InputStream': [
|
||||
@ -1190,7 +1186,6 @@ DOMInterfaces = {
|
||||
},
|
||||
|
||||
'TextMetrics': {
|
||||
'wrapperCache': False,
|
||||
'nativeOwnership': 'owned',
|
||||
},
|
||||
|
||||
@ -1242,156 +1237,155 @@ DOMInterfaces = {
|
||||
}],
|
||||
|
||||
'VTTCue': {
|
||||
'nativeType': 'mozilla::dom::TextTrackCue'
|
||||
'nativeType': 'mozilla::dom::TextTrackCue'
|
||||
},
|
||||
|
||||
'WebGLActiveInfo': {
|
||||
'nativeType': 'mozilla::WebGLActiveInfo',
|
||||
'headerFile': 'WebGLActiveInfo.h',
|
||||
'wrapperCache': False
|
||||
'nativeType': 'mozilla::WebGLActiveInfo',
|
||||
'headerFile': 'WebGLActiveInfo.h',
|
||||
'wrapperCache': False
|
||||
},
|
||||
|
||||
'WebGLBuffer': {
|
||||
'nativeType': 'mozilla::WebGLBuffer',
|
||||
'headerFile': 'WebGLBuffer.h'
|
||||
'nativeType': 'mozilla::WebGLBuffer',
|
||||
'headerFile': 'WebGLBuffer.h'
|
||||
},
|
||||
|
||||
'WebGLExtensionCompressedTextureATC': {
|
||||
'nativeType': 'mozilla::WebGLExtensionCompressedTextureATC',
|
||||
'headerFile': 'WebGLExtensions.h'
|
||||
'nativeType': 'mozilla::WebGLExtensionCompressedTextureATC',
|
||||
'headerFile': 'WebGLExtensions.h'
|
||||
},
|
||||
|
||||
'WebGLExtensionCompressedTexturePVRTC': {
|
||||
'nativeType': 'mozilla::WebGLExtensionCompressedTexturePVRTC',
|
||||
'headerFile': 'WebGLExtensions.h'
|
||||
'nativeType': 'mozilla::WebGLExtensionCompressedTexturePVRTC',
|
||||
'headerFile': 'WebGLExtensions.h'
|
||||
},
|
||||
|
||||
'WebGLExtensionCompressedTextureS3TC': {
|
||||
'nativeType': 'mozilla::WebGLExtensionCompressedTextureS3TC',
|
||||
'headerFile': 'WebGLExtensions.h'
|
||||
'nativeType': 'mozilla::WebGLExtensionCompressedTextureS3TC',
|
||||
'headerFile': 'WebGLExtensions.h'
|
||||
},
|
||||
|
||||
'WebGLExtensionDepthTexture': {
|
||||
'nativeType': 'mozilla::WebGLExtensionDepthTexture',
|
||||
'headerFile': 'WebGLExtensions.h'
|
||||
'nativeType': 'mozilla::WebGLExtensionDepthTexture',
|
||||
'headerFile': 'WebGLExtensions.h'
|
||||
},
|
||||
|
||||
'WebGLExtensionDebugRendererInfo': {
|
||||
'nativeType': 'mozilla::WebGLExtensionDebugRendererInfo',
|
||||
'headerFile': 'WebGLExtensions.h'
|
||||
'nativeType': 'mozilla::WebGLExtensionDebugRendererInfo',
|
||||
'headerFile': 'WebGLExtensions.h'
|
||||
},
|
||||
|
||||
'WebGLExtensionElementIndexUint': {
|
||||
'nativeType': 'mozilla::WebGLExtensionElementIndexUint',
|
||||
'headerFile': 'WebGLExtensions.h'
|
||||
'nativeType': 'mozilla::WebGLExtensionElementIndexUint',
|
||||
'headerFile': 'WebGLExtensions.h'
|
||||
},
|
||||
|
||||
'WebGLExtensionLoseContext': {
|
||||
'nativeType': 'mozilla::WebGLExtensionLoseContext',
|
||||
'headerFile': 'WebGLExtensions.h'
|
||||
'nativeType': 'mozilla::WebGLExtensionLoseContext',
|
||||
'headerFile': 'WebGLExtensions.h'
|
||||
},
|
||||
|
||||
'WebGLExtensionStandardDerivatives': {
|
||||
'nativeType': 'mozilla::WebGLExtensionStandardDerivatives',
|
||||
'headerFile': 'WebGLExtensions.h'
|
||||
'nativeType': 'mozilla::WebGLExtensionStandardDerivatives',
|
||||
'headerFile': 'WebGLExtensions.h'
|
||||
},
|
||||
|
||||
'WebGLExtensionTextureFilterAnisotropic': {
|
||||
'nativeType': 'mozilla::WebGLExtensionTextureFilterAnisotropic',
|
||||
'headerFile': 'WebGLExtensions.h'
|
||||
'nativeType': 'mozilla::WebGLExtensionTextureFilterAnisotropic',
|
||||
'headerFile': 'WebGLExtensions.h'
|
||||
},
|
||||
|
||||
'WebGLExtensionTextureFloat': {
|
||||
'nativeType': 'mozilla::WebGLExtensionTextureFloat',
|
||||
'headerFile': 'WebGLExtensions.h'
|
||||
'nativeType': 'mozilla::WebGLExtensionTextureFloat',
|
||||
'headerFile': 'WebGLExtensions.h'
|
||||
},
|
||||
|
||||
'WebGLExtensionTextureFloatLinear': {
|
||||
'nativeType': 'mozilla::WebGLExtensionTextureFloatLinear',
|
||||
'headerFile': 'WebGLExtensions.h'
|
||||
'nativeType': 'mozilla::WebGLExtensionTextureFloatLinear',
|
||||
'headerFile': 'WebGLExtensions.h'
|
||||
},
|
||||
|
||||
'WebGLExtensionDrawBuffers': {
|
||||
'nativeType': 'mozilla::WebGLExtensionDrawBuffers',
|
||||
'headerFile': 'WebGLExtensions.h'
|
||||
'nativeType': 'mozilla::WebGLExtensionDrawBuffers',
|
||||
'headerFile': 'WebGLExtensions.h'
|
||||
},
|
||||
|
||||
'WebGLExtensionVertexArray': {
|
||||
'nativeType': 'mozilla::WebGLExtensionVertexArray',
|
||||
'headerFile': 'WebGLExtensions.h'
|
||||
'nativeType': 'mozilla::WebGLExtensionVertexArray',
|
||||
'headerFile': 'WebGLExtensions.h'
|
||||
},
|
||||
|
||||
'WebGLExtensionInstancedArrays': {
|
||||
'nativeType': 'mozilla::WebGLExtensionInstancedArrays',
|
||||
'headerFile': 'WebGLExtensions.h'
|
||||
'nativeType': 'mozilla::WebGLExtensionInstancedArrays',
|
||||
'headerFile': 'WebGLExtensions.h'
|
||||
},
|
||||
|
||||
'WebGLFramebuffer': {
|
||||
'nativeType': 'mozilla::WebGLFramebuffer',
|
||||
'headerFile': 'WebGLFramebuffer.h'
|
||||
'nativeType': 'mozilla::WebGLFramebuffer',
|
||||
'headerFile': 'WebGLFramebuffer.h'
|
||||
},
|
||||
|
||||
'WebGLProgram': {
|
||||
'nativeType': 'mozilla::WebGLProgram',
|
||||
'headerFile': 'WebGLProgram.h'
|
||||
'nativeType': 'mozilla::WebGLProgram',
|
||||
'headerFile': 'WebGLProgram.h'
|
||||
},
|
||||
|
||||
'WebGLQuery': {
|
||||
'nativeType': 'mozilla::WebGLQuery',
|
||||
'headerFile': 'WebGLQuery.h'
|
||||
'nativeType': 'mozilla::WebGLQuery',
|
||||
'headerFile': 'WebGLQuery.h'
|
||||
},
|
||||
|
||||
'WebGLRenderbuffer': {
|
||||
'nativeType': 'mozilla::WebGLRenderbuffer',
|
||||
'headerFile': 'WebGLRenderbuffer.h'
|
||||
'nativeType': 'mozilla::WebGLRenderbuffer',
|
||||
'headerFile': 'WebGLRenderbuffer.h'
|
||||
},
|
||||
|
||||
'WebGLRenderingContext': {
|
||||
'nativeType': 'mozilla::WebGLContext',
|
||||
'headerFile': 'WebGLContext.h',
|
||||
'resultNotAddRefed': [ 'canvas', 'getContextAttributes', 'getExtension',
|
||||
'getAttachedShaders' ],
|
||||
'implicitJSContext': [ 'getSupportedExtensions' ],
|
||||
'nativeType': 'mozilla::WebGLContext',
|
||||
'headerFile': 'WebGLContext.h',
|
||||
'resultNotAddRefed': [ 'canvas', 'getContextAttributes', 'getExtension',
|
||||
'getAttachedShaders' ],
|
||||
'implicitJSContext': [ 'getSupportedExtensions' ],
|
||||
},
|
||||
|
||||
'WebGL2RenderingContext': {
|
||||
'nativeType': 'mozilla::WebGLContext',
|
||||
'headerFile': 'WebGLContext.h',
|
||||
'resultNotAddRefed': [ 'canvas', 'getContextAttributes', 'getExtension',
|
||||
'getAttachedShaders' ],
|
||||
'implicitJSContext': [ 'getSupportedExtensions' ],
|
||||
'nativeType': 'mozilla::WebGLContext',
|
||||
'headerFile': 'WebGLContext.h',
|
||||
'resultNotAddRefed': [ 'canvas', 'getContextAttributes', 'getExtension',
|
||||
'getAttachedShaders' ],
|
||||
'implicitJSContext': [ 'getSupportedExtensions' ],
|
||||
},
|
||||
|
||||
'WebGLShader': {
|
||||
'nativeType': 'mozilla::WebGLShader',
|
||||
'headerFile': 'WebGLShader.h'
|
||||
'nativeType': 'mozilla::WebGLShader',
|
||||
'headerFile': 'WebGLShader.h'
|
||||
},
|
||||
|
||||
'WebGLShaderPrecisionFormat': {
|
||||
'nativeType': 'mozilla::WebGLShaderPrecisionFormat',
|
||||
'headerFile': 'WebGLShaderPrecisionFormat.h',
|
||||
'wrapperCache': False
|
||||
'nativeType': 'mozilla::WebGLShaderPrecisionFormat',
|
||||
'headerFile': 'WebGLShaderPrecisionFormat.h',
|
||||
'wrapperCache': False
|
||||
},
|
||||
|
||||
'WebGLTexture': {
|
||||
'nativeType': 'mozilla::WebGLTexture',
|
||||
'headerFile': 'WebGLTexture.h'
|
||||
'nativeType': 'mozilla::WebGLTexture',
|
||||
'headerFile': 'WebGLTexture.h'
|
||||
},
|
||||
|
||||
'WebGLUniformLocation': {
|
||||
'nativeType': 'mozilla::WebGLUniformLocation',
|
||||
'headerFile': 'WebGLUniformLocation.h',
|
||||
'wrapperCache': False
|
||||
'nativeType': 'mozilla::WebGLUniformLocation',
|
||||
'headerFile': 'WebGLUniformLocation.h',
|
||||
'wrapperCache': False
|
||||
},
|
||||
|
||||
'WebGLVertexArray': {
|
||||
'nativeType': 'mozilla::WebGLVertexArray',
|
||||
'headerFile': 'WebGLVertexArray.h'
|
||||
'nativeType': 'mozilla::WebGLVertexArray',
|
||||
'headerFile': 'WebGLVertexArray.h'
|
||||
},
|
||||
|
||||
'WebSocket': {
|
||||
'headerFile': 'WebSocket.h',
|
||||
'implicitJSContext': [ 'constructor' ]
|
||||
},
|
||||
|
||||
'WheelEvent': {
|
||||
|
@ -1,6 +1,5 @@
|
||||
{
|
||||
"Historical DOM features must be removed: CDATASection": true,
|
||||
"Historical DOM features must be removed: UserDataHandler": true,
|
||||
"Historical DOM features must be removed: createCDATASection": true,
|
||||
"Historical DOM features must be removed: createAttribute": true,
|
||||
"Historical DOM features must be removed: createAttributeNS": true,
|
||||
|
@ -12,6 +12,7 @@
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script type="application/javascript">
|
||||
var defaultEnabled = ('mozMobileMessage' in frames[0].navigator);
|
||||
|
||||
/** Test for WebSMS **/
|
||||
|
||||
@ -23,7 +24,7 @@ function checkSmsDisabled() {
|
||||
|
||||
function checkSmsEnabled() {
|
||||
// Bug 784617: WebSms is disabled on all platforms except Android for the moment.
|
||||
if (navigator.appVersion.indexOf("Android") == -1) {
|
||||
if (navigator.appVersion.indexOf("Android") == -1 && SpecialPowers.Services.appinfo.name != "B2G") {
|
||||
checkSmsDisabled();
|
||||
return;
|
||||
}
|
||||
@ -34,65 +35,89 @@ function checkSmsEnabled() {
|
||||
"navigator.mozMobileMessage is an MobileMessageManager object");
|
||||
}
|
||||
|
||||
function checkSmsDisabledOrEnabled() {
|
||||
if (!defaultEnabled)
|
||||
checkSmsDisabled();
|
||||
else
|
||||
checkSmsEnabled();
|
||||
}
|
||||
|
||||
function checkInterface(aInterface) {
|
||||
ok(!(aInterface in window), aInterface + " should be prefixed");
|
||||
ok(("Moz" + aInterface) in window, aInterface + " should be prefixed");
|
||||
}
|
||||
|
||||
function test() {
|
||||
var gSmsEnabled = SpecialPowers.getBoolPref("dom.sms.enabled");
|
||||
|
||||
checkInterface("SmsMessage");
|
||||
checkInterface("SmsEvent");
|
||||
checkInterface("SmsFilter");
|
||||
|
||||
// If sms is disabled and permission is removed, sms is disabled.
|
||||
SpecialPowers.setBoolPref("dom.sms.enabled", false);
|
||||
SpecialPowers.removePermission("sms", document);
|
||||
checkSmsDisabled();
|
||||
SpecialPowers.pushPrefEnv({"set": [["dom.sms.enabled", false]]}, function() {
|
||||
SpecialPowers.pushPermissions([{'type': 'sms', 'remove': true, 'context': document}], test2);
|
||||
});
|
||||
}
|
||||
|
||||
function test2() {
|
||||
checkSmsDisabledOrEnabled();
|
||||
|
||||
// If sms is enabled and permission is removed, sms is disabled.
|
||||
SpecialPowers.setBoolPref("dom.sms.enabled", true);
|
||||
SpecialPowers.removePermission("sms", document);
|
||||
checkSmsDisabled();
|
||||
SpecialPowers.pushPrefEnv({"set": [["dom.sms.enabled", true]]}, function() {
|
||||
SpecialPowers.pushPermissions([{'type': 'sms', 'remove': true, 'context': document}], test3);
|
||||
});
|
||||
}
|
||||
|
||||
function test3() {
|
||||
checkSmsDisabledOrEnabled();
|
||||
|
||||
// If sms is disabled and permission is granted, sms is disabled.
|
||||
SpecialPowers.setBoolPref("dom.sms.enabled", false);
|
||||
SpecialPowers.addPermission("sms", true, document);
|
||||
checkSmsDisabled();
|
||||
SpecialPowers.pushPrefEnv({"set": [["dom.sms.enabled", false]]}, function() {
|
||||
SpecialPowers.pushPermissions([{'type': 'sms', 'allow': true, 'context': document}], test4);
|
||||
});
|
||||
}
|
||||
|
||||
function test4() {
|
||||
checkSmsDisabledOrEnabled();
|
||||
|
||||
// If sms is enabled and permission is granted, sms is enabled.
|
||||
SpecialPowers.setBoolPref("dom.sms.enabled", true);
|
||||
SpecialPowers.addPermission("sms", true, document);
|
||||
checkSmsEnabled();
|
||||
SpecialPowers.pushPrefEnv({"set": [["dom.sms.enabled", true]]}, function() {
|
||||
SpecialPowers.pushPermissions([{'type': 'sms', 'allow': true, 'context': document}], test5);
|
||||
});
|
||||
}
|
||||
|
||||
function test5() {
|
||||
checkSmsDisabledOrEnabled();
|
||||
|
||||
// Now, if sms are disabled with the pref, they will still be enabled.
|
||||
// The page has to be reloaded.
|
||||
SpecialPowers.setBoolPref("dom.sms.enabled", false);
|
||||
checkSmsEnabled();
|
||||
SpecialPowers.pushPrefEnv({"set": [["dom.sms.enabled", false]]}, test6);
|
||||
}
|
||||
|
||||
function test6() {
|
||||
checkSmsDisabledOrEnabled();
|
||||
|
||||
var iframeElt = document.getElementsByTagName('iframe')[0];
|
||||
iframeElt.addEventListener("load", function() {
|
||||
iframeElt.removeEventListener("load", arguments.callee);
|
||||
checkSmsEnabled();
|
||||
|
||||
// Disabling sms takes effect on reload.
|
||||
SpecialPowers.setBoolPref("dom.sms.enabled", false);
|
||||
iframeElt.addEventListener("load", function() {
|
||||
iframeElt.removeEventListener("load", arguments.callee);
|
||||
|
||||
checkSmsDisabled();
|
||||
|
||||
// Cleanup and quit.
|
||||
SpecialPowers.setBoolPref("dom.sms.enabled", gSmsEnabled);
|
||||
SpecialPowers.removePermission("sms", document);
|
||||
SimpleTest.finish();
|
||||
});
|
||||
frames[0].location.reload();
|
||||
|
||||
// Disabling sms takes effect on reload.
|
||||
SpecialPowers.pushPrefEnv({"set": [["dom.sms.enabled", false]]}, function() {
|
||||
frames[0].location.reload();
|
||||
});
|
||||
});
|
||||
|
||||
SpecialPowers.setBoolPref("dom.sms.enabled", true);
|
||||
frames[0].location.reload();
|
||||
SpecialPowers.pushPrefEnv({"set": [["dom.sms.enabled", true]]}, function() {
|
||||
frames[0].location.reload();
|
||||
});
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
@ -89,42 +89,21 @@ function test3() {
|
||||
synthesizeKey("VK_RIGHT", { });
|
||||
synthesizeKey("VK_RIGHT", { });
|
||||
expectedResult = [ $("a3").firstChild, 7, $("a3") ]
|
||||
nextTest = endTest;
|
||||
nextTest = SimpleTest.finish;
|
||||
testFocus();
|
||||
}
|
||||
|
||||
function endTest() {
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||
var prefs = Components.classes["@mozilla.org/preferences-service;1"].
|
||||
getService(Components.interfaces.nsIPrefBranch);
|
||||
try {
|
||||
prefs.setBoolPref("accessibility.browsewithcaret", false);
|
||||
} finally {
|
||||
SimpleTest.finish();
|
||||
}
|
||||
}
|
||||
|
||||
function startTest() {
|
||||
if (gTestStarted)
|
||||
return;
|
||||
gTestStarted = true;
|
||||
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||
var prefs = Components.classes["@mozilla.org/preferences-service;1"].
|
||||
getService(Components.interfaces.nsIPrefBranch);
|
||||
try {
|
||||
prefs.setBoolPref("accessibility.browsewithcaret", true);
|
||||
test0();
|
||||
} catch(e) {
|
||||
endTest();
|
||||
}
|
||||
SpecialPowers.pushPrefEnv({"set": [["accessibility.browsewithcaret", true]]}, test0);
|
||||
}
|
||||
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
SimpleTest.waitForFocus(startTest);
|
||||
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
|
@ -20,7 +20,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=369306
|
||||
/** Test for Bug 369306 **/
|
||||
|
||||
var originatingWindow = self;
|
||||
var gOldPrefValue = null;
|
||||
|
||||
function focusShouldNotChange(aAction, nextTest)
|
||||
{
|
||||
@ -107,7 +106,7 @@ function test5()
|
||||
SimpleTest.waitForFocus(function () {
|
||||
ok(true, "The last opened window should be able to get focus");
|
||||
w.close();
|
||||
SimpleTest.executeSoon(finished);
|
||||
SimpleTest.executeSoon(SimpleTest.finish);
|
||||
}, w, true);
|
||||
|
||||
w.focus();
|
||||
@ -116,32 +115,21 @@ function test5()
|
||||
SimpleTest.executeSoon(function() {
|
||||
// We have to focus back the originating window but we can't do that with
|
||||
// .focus() or .blur() anymore.
|
||||
var fm = SpecialPowers.Cc["@mozilla.org/focus-manager;1"]
|
||||
.getService(SpecialPowers.Ci.nsIFocusManager);
|
||||
fm.focusedWindow = window;
|
||||
SpecialPowers.focus(window);
|
||||
});
|
||||
}, w, true);
|
||||
}
|
||||
|
||||
function finished()
|
||||
{
|
||||
SpecialPowers.Cc["@mozilla.org/preferences-service;1"]
|
||||
.getService(SpecialPowers.Ci.nsIPrefBranch)
|
||||
.setBoolPref("dom.disable_window_flip", gOldPrefValue);
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
|
||||
// dom.disable_window_flip has to be set to true for this test.
|
||||
var prefs = SpecialPowers.Cc["@mozilla.org/preferences-service;1"]
|
||||
.getService(SpecialPowers.Ci.nsIPrefBranch);
|
||||
gOldPrefValue = prefs.getBoolPref("dom.disable_window_flip");
|
||||
prefs.setBoolPref("dom.disable_window_flip", true);
|
||||
function startTest() {
|
||||
// dom.disable_window_flip has to be set to true for this test.
|
||||
SpecialPowers.pushPrefEnv({"set": [["dom.disable_window_flip", true]]}, test1);
|
||||
}
|
||||
|
||||
// test1 is going to call the next tests.
|
||||
SimpleTest.waitForFocus(test1);
|
||||
// startTest is going to call the next tests.
|
||||
SimpleTest.waitForFocus(startTest);
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
|
@ -14,23 +14,30 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=629535
|
||||
<script type="application/javascript">
|
||||
|
||||
const dntPref = 'privacy.donottrackheader.enabled';
|
||||
const oldDNT = SpecialPowers.getBoolPref(dntPref);
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
is(SpecialPowers.getBoolPref(dntPref), false,
|
||||
'DNT should be disabled by default');
|
||||
is(navigator.doNotTrack, 'unspecified',
|
||||
'navigator.doNotTrack should initially be "unspecified".');
|
||||
|
||||
SpecialPowers.clearUserPref(dntPref);
|
||||
is(navigator.doNotTrack, "unspecified", 'after clearing pref');
|
||||
SpecialPowers.pushPrefEnv({"clear": [[dntPref]]}, test1);
|
||||
|
||||
SpecialPowers.setBoolPref(dntPref, true);
|
||||
is(navigator.doNotTrack, "yes", 'after setting pref to true');
|
||||
function test1() {
|
||||
is(navigator.doNotTrack, "unspecified", 'after clearing pref');
|
||||
SpecialPowers.pushPrefEnv({"set": [[dntPref, true]]}, test2);
|
||||
}
|
||||
|
||||
SpecialPowers.setBoolPref(dntPref, false);
|
||||
is(navigator.doNotTrack, "unspecified", 'after setting pref to false');
|
||||
function test2() {
|
||||
is(navigator.doNotTrack, "yes", 'after setting pref to true');
|
||||
SpecialPowers.pushPrefEnv({"set": [[dntPref, false]]}, test3);
|
||||
}
|
||||
|
||||
SpecialPowers.setBoolPref(dntPref, oldDNT);
|
||||
function test3() {
|
||||
is(navigator.doNotTrack, "unspecified", 'after setting pref to false');
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
|
@ -522,7 +522,7 @@ var interfaceNamesInGlobalScope =
|
||||
"UIEvent",
|
||||
"UndoManager",
|
||||
"URL",
|
||||
"UserDataHandler",
|
||||
{name: "UserDataHandler", xbl: true},
|
||||
"UserProximityEvent",
|
||||
"ValidityState",
|
||||
"VideoStreamTrack",
|
||||
|
@ -76,15 +76,15 @@ public:
|
||||
Dispatch(JSContext* aCx)
|
||||
{
|
||||
mWorkerPrivate->AssertIsOnWorkerThread();
|
||||
mSyncQueueKey = mWorkerPrivate->CreateNewSyncLoop();
|
||||
AutoSyncLoopHolder syncLoop(mWorkerPrivate);
|
||||
mSyncQueueKey = syncLoop.SyncQueueKey();
|
||||
|
||||
if (NS_FAILED(NS_DispatchToMainThread(this, NS_DISPATCH_NORMAL))) {
|
||||
JS_ReportError(aCx, "Failed to dispatch to main thread!");
|
||||
mWorkerPrivate->StopSyncLoop(mSyncQueueKey, false);
|
||||
return false;
|
||||
}
|
||||
|
||||
return mWorkerPrivate->RunSyncLoop(aCx, mSyncQueueKey);
|
||||
return syncLoop.RunAndForget(aCx);
|
||||
}
|
||||
|
||||
private:
|
||||
|
@ -254,14 +254,16 @@ public:
|
||||
MOZ_ASSERT(mProfile != ContextProfile::Unknown, "unknown context profile");
|
||||
MOZ_ASSERT(mVersion != 0, "unknown context version");
|
||||
|
||||
if (profile == ContextProfile::OpenGL) {
|
||||
return (profile == ContextProfile::OpenGLCore ||
|
||||
profile == ContextProfile::OpenGLCompatibility) &&
|
||||
version >= mVersion;
|
||||
if (version > mVersion) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return profile == mProfile &&
|
||||
version >= mVersion;
|
||||
if (profile == ContextProfile::OpenGL) {
|
||||
return profile == ContextProfile::OpenGLCore ||
|
||||
profile == ContextProfile::OpenGLCompatibility;
|
||||
}
|
||||
|
||||
return profile == mProfile;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -937,7 +937,7 @@ TRY_AGAIN_NO_SHARING:
|
||||
|
||||
bool TextureImageSupportsGetBackingSurface()
|
||||
{
|
||||
return mGLX->UseTextureFromPixmap();
|
||||
return false;
|
||||
}
|
||||
|
||||
virtual already_AddRefed<TextureImage>
|
||||
|
@ -45,6 +45,9 @@ namespace layers {
|
||||
static bool
|
||||
UsingXCompositing()
|
||||
{
|
||||
if (!PR_GetEnv("MOZ_LAYERS_ENABLE_XLIB_SURFACES")) {
|
||||
return false;
|
||||
}
|
||||
return (gfxASurface::SurfaceTypeXlib ==
|
||||
gfxPlatform::GetPlatform()->ScreenReferenceSurface()->GetType());
|
||||
}
|
||||
@ -117,9 +120,6 @@ ISurfaceAllocator::PlatformAllocSurfaceDescriptor(const gfxIntSize& aSize,
|
||||
uint32_t aCaps,
|
||||
SurfaceDescriptor* aBuffer)
|
||||
{
|
||||
if (!PR_GetEnv("MOZ_LAYERS_ENABLE_XLIB_SURFACES")) {
|
||||
return false;
|
||||
}
|
||||
if (!UsingXCompositing()) {
|
||||
// If we're not using X compositing, we're probably compositing on
|
||||
// the client side, in which case X surfaces would just slow
|
||||
|
@ -11,9 +11,7 @@ include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
EXPORT_LIBRARY = 1
|
||||
|
||||
# gfxSVGGlyphs needs nsDOMParser.h
|
||||
LOCAL_INCLUDES += \
|
||||
-I$(topsrcdir)/content/base/public \
|
||||
-I$(topsrcdir)/content/xml/document/src \
|
||||
$(NULL)
|
||||
|
||||
|
@ -18,7 +18,6 @@
|
||||
#include "nsIStreamListener.h"
|
||||
#include "nsServiceManagerUtils.h"
|
||||
#include "nsIPresShell.h"
|
||||
#include "nsIFrame.h"
|
||||
#include "nsQueryFrame.h"
|
||||
#include "nsIContentSink.h"
|
||||
#include "nsXMLContentSink.h"
|
||||
@ -27,7 +26,7 @@
|
||||
#include "nsStringStream.h"
|
||||
#include "nsStreamUtils.h"
|
||||
#include "nsIPrincipal.h"
|
||||
#include "Element.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
#include "nsSVGUtils.h"
|
||||
#include "nsIScriptSecurityManager.h"
|
||||
#include "nsHostObjectProtocolHandler.h"
|
||||
|
@ -27,7 +27,7 @@ function String_repeat(count) {
|
||||
n = n & ((1 << 28) - 1);
|
||||
|
||||
// Steps 8-9.
|
||||
var T = '';
|
||||
var T = "";
|
||||
for (;;) {
|
||||
if (n & 1)
|
||||
T += S;
|
||||
|
@ -24,9 +24,9 @@
|
||||
*/
|
||||
|
||||
/* Utility macros */
|
||||
#define TO_INT32(x) (x | 0)
|
||||
#define TO_UINT32(x) (x >>> 0)
|
||||
#define IS_UINT32(x) (x >>> 0 === x)
|
||||
#define TO_INT32(x) ((x) | 0)
|
||||
#define TO_UINT32(x) ((x) >>> 0)
|
||||
#define IS_UINT32(x) ((x) >>> 0 === (x))
|
||||
|
||||
/* Assertions */
|
||||
#ifdef DEBUG
|
||||
|
@ -32,12 +32,12 @@ using mozilla::FloorLog2;
|
||||
void
|
||||
analyze::PrintBytecode(JSContext *cx, HandleScript script, jsbytecode *pc)
|
||||
{
|
||||
printf("#%u:", script->id());
|
||||
fprintf(stderr, "#%u:", script->id());
|
||||
Sprinter sprinter(cx);
|
||||
if (!sprinter.init())
|
||||
return;
|
||||
js_Disassemble1(cx, script, pc, pc - script->code, true, &sprinter);
|
||||
fprintf(stdout, "%s", sprinter.string());
|
||||
fprintf(stderr, "%s", sprinter.string());
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -232,9 +232,9 @@ types::InferSpew(SpewChannel channel, const char *fmt, ...)
|
||||
|
||||
va_list ap;
|
||||
va_start(ap, fmt);
|
||||
fprintf(stdout, "[infer] ");
|
||||
vfprintf(stdout, fmt, ap);
|
||||
fprintf(stdout, "\n");
|
||||
fprintf(stderr, "[infer] ");
|
||||
vfprintf(stderr, fmt, ap);
|
||||
fprintf(stderr, "\n");
|
||||
va_end(ap);
|
||||
}
|
||||
|
||||
@ -427,47 +427,47 @@ void
|
||||
TypeSet::print()
|
||||
{
|
||||
if (flags & TYPE_FLAG_OWN_PROPERTY)
|
||||
printf(" [own]");
|
||||
fprintf(stderr, " [own]");
|
||||
if (flags & TYPE_FLAG_CONFIGURED_PROPERTY)
|
||||
printf(" [configured]");
|
||||
fprintf(stderr, " [configured]");
|
||||
|
||||
if (definiteProperty())
|
||||
printf(" [definite:%d]", definiteSlot());
|
||||
fprintf(stderr, " [definite:%d]", definiteSlot());
|
||||
|
||||
if (baseFlags() == 0 && !baseObjectCount()) {
|
||||
printf(" missing");
|
||||
fprintf(stderr, " missing");
|
||||
return;
|
||||
}
|
||||
|
||||
if (flags & TYPE_FLAG_UNKNOWN)
|
||||
printf(" unknown");
|
||||
fprintf(stderr, " unknown");
|
||||
if (flags & TYPE_FLAG_ANYOBJECT)
|
||||
printf(" object");
|
||||
fprintf(stderr, " object");
|
||||
|
||||
if (flags & TYPE_FLAG_UNDEFINED)
|
||||
printf(" void");
|
||||
fprintf(stderr, " void");
|
||||
if (flags & TYPE_FLAG_NULL)
|
||||
printf(" null");
|
||||
fprintf(stderr, " null");
|
||||
if (flags & TYPE_FLAG_BOOLEAN)
|
||||
printf(" bool");
|
||||
fprintf(stderr, " bool");
|
||||
if (flags & TYPE_FLAG_INT32)
|
||||
printf(" int");
|
||||
fprintf(stderr, " int");
|
||||
if (flags & TYPE_FLAG_DOUBLE)
|
||||
printf(" float");
|
||||
fprintf(stderr, " float");
|
||||
if (flags & TYPE_FLAG_STRING)
|
||||
printf(" string");
|
||||
fprintf(stderr, " string");
|
||||
if (flags & TYPE_FLAG_LAZYARGS)
|
||||
printf(" lazyargs");
|
||||
fprintf(stderr, " lazyargs");
|
||||
|
||||
uint32_t objectCount = baseObjectCount();
|
||||
if (objectCount) {
|
||||
printf(" object[%u]", objectCount);
|
||||
fprintf(stderr, " object[%u]", objectCount);
|
||||
|
||||
unsigned count = getObjectCount();
|
||||
for (unsigned i = 0; i < count; i++) {
|
||||
TypeObjectKey *object = getObject(i);
|
||||
if (object)
|
||||
printf(" %s", TypeString(Type::ObjectType(object)));
|
||||
fprintf(stderr, " %s", TypeString(Type::ObjectType(object)));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2976,6 +2976,7 @@ ScriptAnalysis::addSingletonTypeBarrier(JSContext *cx, const jsbytecode *pc, Typ
|
||||
void
|
||||
TypeCompartment::print(JSContext *cx, bool force)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
gc::AutoSuppressGC suppressGC(cx);
|
||||
|
||||
JSCompartment *compartment = this->compartment();
|
||||
@ -2985,25 +2986,18 @@ TypeCompartment::print(JSContext *cx, bool force)
|
||||
return;
|
||||
|
||||
for (gc::CellIter i(compartment->zone(), gc::FINALIZE_SCRIPT); !i.done(); i.next()) {
|
||||
RootedScript script(cx, i.get<JSScript>());
|
||||
if (script->hasAnalysis() && script->analysis()->ranInference())
|
||||
script->analysis()->printTypes(cx);
|
||||
// Note: use cx->runtime() instead of cx to work around IsInRequest(cx)
|
||||
// assertion failures when we're called from DestroyContext.
|
||||
RootedScript script(cx->runtime(), i.get<JSScript>());
|
||||
if (script->types)
|
||||
script->types->printTypes(cx, script);
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
for (gc::CellIter i(compartment->zone(), gc::FINALIZE_TYPE_OBJECT); !i.done(); i.next()) {
|
||||
TypeObject *object = i.get<TypeObject>();
|
||||
object->print();
|
||||
}
|
||||
#endif
|
||||
|
||||
printf("Counts: ");
|
||||
for (unsigned count = 0; count < TYPE_COUNT_LIMIT; count++) {
|
||||
if (count)
|
||||
printf("/");
|
||||
printf("%u", typeCounts[count]);
|
||||
}
|
||||
printf(" (%u over)\n", typeCountOver);
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
@ -3852,46 +3846,46 @@ void
|
||||
TypeObject::print()
|
||||
{
|
||||
TaggedProto tagged(proto);
|
||||
printf("%s : %s",
|
||||
fprintf(stderr, "%s : %s",
|
||||
TypeObjectString(this),
|
||||
tagged.isObject() ? TypeString(Type::ObjectType(proto))
|
||||
: (tagged.isLazy() ? "(lazy)" : "(null)"));
|
||||
|
||||
if (unknownProperties()) {
|
||||
printf(" unknown");
|
||||
fprintf(stderr, " unknown");
|
||||
} else {
|
||||
if (!hasAnyFlags(OBJECT_FLAG_SPARSE_INDEXES))
|
||||
printf(" dense");
|
||||
fprintf(stderr, " dense");
|
||||
if (!hasAnyFlags(OBJECT_FLAG_NON_PACKED))
|
||||
printf(" packed");
|
||||
fprintf(stderr, " packed");
|
||||
if (!hasAnyFlags(OBJECT_FLAG_LENGTH_OVERFLOW))
|
||||
printf(" noLengthOverflow");
|
||||
fprintf(stderr, " noLengthOverflow");
|
||||
if (hasAnyFlags(OBJECT_FLAG_EMULATES_UNDEFINED))
|
||||
printf(" emulatesUndefined");
|
||||
fprintf(stderr, " emulatesUndefined");
|
||||
if (hasAnyFlags(OBJECT_FLAG_ITERATED))
|
||||
printf(" iterated");
|
||||
fprintf(stderr, " iterated");
|
||||
if (interpretedFunction)
|
||||
printf(" ifun");
|
||||
fprintf(stderr, " ifun");
|
||||
}
|
||||
|
||||
unsigned count = getPropertyCount();
|
||||
|
||||
if (count == 0) {
|
||||
printf(" {}\n");
|
||||
fprintf(stderr, " {}\n");
|
||||
return;
|
||||
}
|
||||
|
||||
printf(" {");
|
||||
fprintf(stderr, " {");
|
||||
|
||||
for (unsigned i = 0; i < count; i++) {
|
||||
Property *prop = getProperty(i);
|
||||
if (prop) {
|
||||
printf("\n %s:", TypeIdString(prop->id));
|
||||
fprintf(stderr, "\n %s:", TypeIdString(prop->id));
|
||||
prop->types.print();
|
||||
}
|
||||
}
|
||||
|
||||
printf("\n}\n");
|
||||
fprintf(stderr, "\n}\n");
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
@ -5253,130 +5247,6 @@ CheckNewScriptProperties(JSContext *cx, HandleTypeObject type, HandleFunction fu
|
||||
state.initializerList.length());
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
// Printing
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
|
||||
void
|
||||
ScriptAnalysis::printTypes(JSContext *cx)
|
||||
{
|
||||
AutoEnterAnalysis enter(NULL, script_->compartment());
|
||||
TypeCompartment *compartment = &script_->compartment()->types;
|
||||
|
||||
/*
|
||||
* Check if there are warnings for used values with unknown types, and build
|
||||
* statistics about the size of type sets found for stack values.
|
||||
*/
|
||||
for (unsigned offset = 0; offset < script_->length; offset++) {
|
||||
if (!maybeCode(offset))
|
||||
continue;
|
||||
|
||||
unsigned defCount = GetDefCount(script_, offset);
|
||||
if (!defCount)
|
||||
continue;
|
||||
|
||||
for (unsigned i = 0; i < defCount; i++) {
|
||||
TypeSet *types = pushedTypes(offset, i);
|
||||
|
||||
if (types->unknown()) {
|
||||
compartment->typeCountOver++;
|
||||
continue;
|
||||
}
|
||||
|
||||
unsigned typeCount = 0;
|
||||
|
||||
if (types->hasAnyFlag(TYPE_FLAG_ANYOBJECT) || types->getObjectCount() != 0)
|
||||
typeCount++;
|
||||
for (TypeFlags flag = 1; flag < TYPE_FLAG_ANYOBJECT; flag <<= 1) {
|
||||
if (types->hasAnyFlag(flag))
|
||||
typeCount++;
|
||||
}
|
||||
|
||||
/*
|
||||
* Adjust the type counts for floats: values marked as floats
|
||||
* are also marked as ints by the inference, but for counting
|
||||
* we don't consider these to be separate types.
|
||||
*/
|
||||
if (types->hasAnyFlag(TYPE_FLAG_DOUBLE)) {
|
||||
JS_ASSERT(types->hasAnyFlag(TYPE_FLAG_INT32));
|
||||
typeCount--;
|
||||
}
|
||||
|
||||
if (typeCount > TypeCompartment::TYPE_COUNT_LIMIT) {
|
||||
compartment->typeCountOver++;
|
||||
} else if (typeCount == 0) {
|
||||
/* Ignore values without types, this may be unreached code. */
|
||||
} else {
|
||||
compartment->typeCounts[typeCount-1]++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
|
||||
if (script_->function())
|
||||
printf("Function");
|
||||
else if (script_->isCachedEval)
|
||||
printf("Eval");
|
||||
else
|
||||
printf("Main");
|
||||
printf(" #%u %s (line %d):\n", script_->id(), script_->filename(), script_->lineno);
|
||||
|
||||
printf("locals:");
|
||||
printf("\n return:");
|
||||
TypeScript::ReturnTypes(script_)->print();
|
||||
printf("\n this:");
|
||||
TypeScript::ThisTypes(script_)->print();
|
||||
|
||||
for (unsigned i = 0; script_->function() && i < script_->function()->nargs; i++) {
|
||||
printf("\n arg%u:", i);
|
||||
TypeScript::ArgTypes(script_, i)->print();
|
||||
}
|
||||
printf("\n");
|
||||
|
||||
RootedScript script(cx, script_);
|
||||
for (unsigned offset = 0; offset < script_->length; offset++) {
|
||||
if (!maybeCode(offset))
|
||||
continue;
|
||||
|
||||
jsbytecode *pc = script_->code + offset;
|
||||
|
||||
PrintBytecode(cx, script, pc);
|
||||
|
||||
if (js_CodeSpec[*pc].format & JOF_TYPESET) {
|
||||
TypeSet *types = TypeScript::BytecodeTypes(script_, pc);
|
||||
printf(" typeset %d:", (int) (types - script_->types->typeArray()));
|
||||
types->print();
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
unsigned defCount = GetDefCount(script_, offset);
|
||||
for (unsigned i = 0; i < defCount; i++) {
|
||||
printf(" type %d:", i);
|
||||
pushedTypes(offset, i)->print();
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
if (getCode(offset).monitoredTypes)
|
||||
printf(" monitored\n");
|
||||
|
||||
TypeBarrier *barrier = getCode(offset).typeBarriers;
|
||||
if (barrier != NULL) {
|
||||
printf(" barrier:");
|
||||
while (barrier) {
|
||||
printf(" %s", TypeString(barrier->type));
|
||||
barrier = barrier->next;
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
}
|
||||
|
||||
printf("\n");
|
||||
|
||||
#endif /* DEBUG */
|
||||
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
// Interface functions
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
@ -6774,6 +6644,61 @@ TypeZone::sweep(FreeOp *fop, bool releaseTypes)
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
void
|
||||
TypeScript::printTypes(JSContext *cx, HandleScript script) const
|
||||
{
|
||||
JS_ASSERT(script->types == this);
|
||||
|
||||
if (!bytecodeMap)
|
||||
return;
|
||||
|
||||
AutoEnterAnalysis enter(NULL, script->compartment());
|
||||
|
||||
if (script->function())
|
||||
fprintf(stderr, "Function");
|
||||
else if (script->isForEval())
|
||||
fprintf(stderr, "Eval");
|
||||
else
|
||||
fprintf(stderr, "Main");
|
||||
fprintf(stderr, " #%u %s:%d ", script->id(), script->filename(), script->lineno);
|
||||
|
||||
if (script->function()) {
|
||||
if (js::PropertyName *name = script->function()->name()) {
|
||||
const jschar *chars = name->getChars(NULL);
|
||||
JSString::dumpChars(chars, name->length());
|
||||
}
|
||||
}
|
||||
|
||||
fprintf(stderr, "\n return:");
|
||||
TypeScript::ReturnTypes(script)->print();
|
||||
fprintf(stderr, "\n this:");
|
||||
TypeScript::ThisTypes(script)->print();
|
||||
|
||||
for (unsigned i = 0; script->function() && i < script->function()->nargs; i++) {
|
||||
fprintf(stderr, "\n arg%u:", i);
|
||||
TypeScript::ArgTypes(script, i)->print();
|
||||
}
|
||||
fprintf(stderr, "\n");
|
||||
|
||||
for (jsbytecode *pc = script->code;
|
||||
pc < script->code + script->length;
|
||||
pc += GetBytecodeLength(pc))
|
||||
{
|
||||
PrintBytecode(cx, script, pc);
|
||||
|
||||
if (js_CodeSpec[*pc].format & JOF_TYPESET) {
|
||||
TypeSet *types = TypeScript::BytecodeTypes(script, pc);
|
||||
fprintf(stderr, " typeset %u:", unsigned(types - typeArray()));
|
||||
types->print();
|
||||
fprintf(stderr, "\n");
|
||||
}
|
||||
}
|
||||
|
||||
fprintf(stderr, "\n");
|
||||
}
|
||||
#endif /* DEBUG */
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
// Binary data
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
|
@ -1269,7 +1269,7 @@ class TypeScript
|
||||
HeapTypeSet *propertyReadTypes;
|
||||
|
||||
/* Array of type type sets for variables and JOF_TYPESET ops. */
|
||||
TypeSet *typeArray() { return (TypeSet *) (uintptr_t(this) + sizeof(TypeScript)); }
|
||||
TypeSet *typeArray() const { return (TypeSet *) (uintptr_t(this) + sizeof(TypeScript)); }
|
||||
|
||||
static inline unsigned NumTypeSets(JSScript *script);
|
||||
|
||||
@ -1329,6 +1329,10 @@ class TypeScript
|
||||
|
||||
static void Sweep(FreeOp *fop, JSScript *script);
|
||||
void destroy();
|
||||
|
||||
#ifdef DEBUG
|
||||
void printTypes(JSContext *cx, HandleScript script) const;
|
||||
#endif
|
||||
};
|
||||
|
||||
struct ArrayTableKey;
|
||||
@ -1455,13 +1459,6 @@ struct TypeCompartment
|
||||
|
||||
JSObject *newTypedObject(JSContext *cx, IdValuePair *properties, size_t nproperties);
|
||||
|
||||
/* Logging fields */
|
||||
|
||||
/* Counts of stack type sets with some number of possible operand types. */
|
||||
static const unsigned TYPE_COUNT_LIMIT = 4;
|
||||
unsigned typeCounts[TYPE_COUNT_LIMIT];
|
||||
unsigned typeCountOver;
|
||||
|
||||
TypeCompartment();
|
||||
~TypeCompartment();
|
||||
|
||||
|
@ -603,7 +603,7 @@ js_Disassemble1(JSContext *cx, HandleScript script, jsbytecode *pc,
|
||||
|
||||
case JOF_OBJECT: {
|
||||
/* Don't call obj.toSource if analysis/inference is active. */
|
||||
if (cx->compartment()->activeAnalysis) {
|
||||
if (script->compartment()->activeAnalysis) {
|
||||
Sprint(sp, " object");
|
||||
break;
|
||||
}
|
||||
|
@ -110,8 +110,6 @@ JSString::dump()
|
||||
if (const jschar *chars = getChars(NULL)) {
|
||||
fprintf(stderr, "JSString* (%p) = jschar * (%p) = ",
|
||||
(void *) this, (void *) chars);
|
||||
|
||||
extern void DumpChars(const jschar *s, size_t n);
|
||||
dumpChars(chars, length());
|
||||
} else {
|
||||
fprintf(stderr, "(oom in JSString::dump)");
|
||||
|
@ -17,6 +17,7 @@
|
||||
|
||||
#include "nsIMemoryReporter.h"
|
||||
#include "nsIObserverService.h"
|
||||
#include "nsIDebug2.h"
|
||||
#include "amIAddonManager.h"
|
||||
#include "nsPIDOMWindow.h"
|
||||
#include "nsPrintfCString.h"
|
||||
@ -1186,7 +1187,12 @@ WatchdogMain(void *arg)
|
||||
if (manager->IsRuntimeActive() &&
|
||||
manager->TimeSinceLastRuntimeStateChange() >= PRTime(PR_USEC_PER_SEC))
|
||||
{
|
||||
JS_TriggerOperationCallback(manager->Runtime()->Runtime());
|
||||
bool debuggerAttached = false;
|
||||
nsCOMPtr<nsIDebug2> dbg = do_GetService("@mozilla.org/xpcom/debug;1");
|
||||
if (dbg)
|
||||
dbg->GetIsDebuggerAttached(&debuggerAttached);
|
||||
if (!debuggerAttached)
|
||||
JS_TriggerOperationCallback(manager->Runtime()->Runtime());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -24,7 +24,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=790732
|
||||
is(Ci.nsIXMLHttpRequest.HEADERS_RECEIVED, XMLHttpRequest.HEADERS_RECEIVED);
|
||||
is(Ci.nsIDOMDOMException.DATA_CLONE_ERR, DOMException.DATA_CLONE_ERR);
|
||||
is(Ci.nsIDOMNode.DOCUMENT_NODE, Node.DOCUMENT_NODE);
|
||||
is(Ci.nsIDOMUserDataHandler.NODE_CLONED, UserDataHandler.NODE_CLONED);
|
||||
is(Ci.nsIDOMCSSPrimitiveValue.CSS_PX, CSSPrimitiveValue.CSS_PX);
|
||||
is(Ci.nsIDOMCSSRule.NAMESPACE_RULE, CSSRule.NAMESPACE_RULE);
|
||||
is(Ci.nsIDOMCSSValue.CSS_PRIMITIVE_VALUE, CSSValue.CSS_PRIMITIVE_VALUE);
|
||||
|
@ -58,7 +58,7 @@
|
||||
#include "txMozillaXSLTProcessor.h"
|
||||
#include "txNodeSetAdaptor.h"
|
||||
|
||||
#include "nsDOMParser.h"
|
||||
#include "mozilla/dom/DOMParser.h"
|
||||
#include "nsDOMSerializer.h"
|
||||
#include "nsXMLHttpRequest.h"
|
||||
#include "nsChannelPolicy.h"
|
||||
@ -275,7 +275,7 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsMediaStreamProtocolHandler)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsMediaSourceProtocolHandler)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsFontTableProtocolHandler)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsHostObjectURI)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsDOMParser)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(DOMParser)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(DOMSessionStorageManager)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(DOMLocalStorageManager)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsChannelPolicy)
|
||||
@ -1032,7 +1032,7 @@ static const mozilla::Module::CIDEntry kLayoutCIDs[] = {
|
||||
{ &kNS_XMLHTTPREQUEST_CID, false, NULL, nsXMLHttpRequestConstructor },
|
||||
{ &kNS_EVENTSOURCE_CID, false, NULL, EventSourceConstructor },
|
||||
{ &kNS_DOMACTIVITY_CID, false, NULL, ActivityConstructor },
|
||||
{ &kNS_DOMPARSER_CID, false, NULL, nsDOMParserConstructor },
|
||||
{ &kNS_DOMPARSER_CID, false, NULL, DOMParserConstructor },
|
||||
{ &kNS_DOMSESSIONSTORAGEMANAGER_CID, false, NULL, DOMSessionStorageManagerConstructor },
|
||||
{ &kNS_DOMLOCALSTORAGEMANAGER_CID, false, NULL, DOMLocalStorageManagerConstructor },
|
||||
{ &kNS_DOMJSON_CID, false, NULL, NS_NewJSON },
|
||||
|
@ -11,9 +11,10 @@
|
||||
#ifndef nsIObjectFrame_h___
|
||||
#define nsIObjectFrame_h___
|
||||
|
||||
#include "nsIFrame.h"
|
||||
#include "nsQueryFrame.h"
|
||||
|
||||
class nsNPAPIPluginInstance;
|
||||
class nsIWidget;
|
||||
|
||||
class nsIObjectFrame : public nsQueryFrame
|
||||
{
|
||||
|
@ -6,12 +6,13 @@
|
||||
#ifndef nsIMathMLFrame_h___
|
||||
#define nsIMathMLFrame_h___
|
||||
|
||||
#include "nsIFrame.h"
|
||||
#include "nsQueryFrame.h"
|
||||
|
||||
struct nsPresentationData;
|
||||
struct nsEmbellishData;
|
||||
struct nsHTMLReflowMetrics;
|
||||
class nsRenderingContext;
|
||||
class nsIFrame;
|
||||
|
||||
// For MathML, this 'type' will be used to determine the spacing between frames
|
||||
// Subclasses can return a 'type' that will give them a particular spacing
|
||||
|
@ -3,23 +3,18 @@
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "nsMathMLChar.h"
|
||||
#include "mozilla/MathAlgorithms.h"
|
||||
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsFrame.h"
|
||||
#include "nsIFrame.h"
|
||||
#include "nsPresContext.h"
|
||||
#include "nsStyleContext.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsString.h"
|
||||
#include "nsUnicharUtils.h"
|
||||
#include "nsRenderingContext.h"
|
||||
#include "gfxPlatform.h"
|
||||
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "nsISupportsPrimitives.h"
|
||||
#include "nsIComponentManager.h"
|
||||
#include "nsIPersistentProperties2.h"
|
||||
#include "nsIServiceManager.h"
|
||||
#include "nsIObserverService.h"
|
||||
#include "nsIObserver.h"
|
||||
#include "nsNetUtil.h"
|
||||
@ -31,7 +26,6 @@
|
||||
#include "nsDisplayList.h"
|
||||
|
||||
#include "nsMathMLOperators.h"
|
||||
#include "nsMathMLChar.h"
|
||||
#include <algorithm>
|
||||
|
||||
using namespace mozilla;
|
||||
@ -613,6 +607,12 @@ InitGlobals(nsPresContext* aPresContext)
|
||||
// -----------------------------------------------------------------------------
|
||||
// And now the implementation of nsMathMLChar
|
||||
|
||||
nsMathMLChar::~nsMathMLChar()
|
||||
{
|
||||
MOZ_COUNT_DTOR(nsMathMLChar);
|
||||
mStyleContext->Release();
|
||||
}
|
||||
|
||||
nsStyleContext*
|
||||
nsMathMLChar::GetStyleContext() const
|
||||
{
|
||||
|
@ -7,9 +7,21 @@
|
||||
#define nsMathMLChar_h___
|
||||
|
||||
#include "nsMathMLOperators.h"
|
||||
#include "nsMathMLFrame.h"
|
||||
#include "nsPoint.h"
|
||||
#include "nsRect.h"
|
||||
#include "nsString.h"
|
||||
#include "nsBoundingMetrics.h"
|
||||
|
||||
class nsGlyphTable;
|
||||
class nsIFrame;
|
||||
class nsDisplayListBuilder;
|
||||
class nsDisplayListSet;
|
||||
class nsRect;
|
||||
class nsPresContext;
|
||||
class nsRenderingContext;
|
||||
class nsBoundingMetrics;
|
||||
class nsStyleContext;
|
||||
class nsFont;
|
||||
|
||||
// Hints for Stretch() to indicate criteria for stretching
|
||||
enum {
|
||||
@ -71,10 +83,7 @@ public:
|
||||
}
|
||||
|
||||
// not a virtual destructor: this class is not intended to be subclassed
|
||||
~nsMathMLChar() {
|
||||
MOZ_COUNT_DTOR(nsMathMLChar);
|
||||
mStyleContext->Release();
|
||||
}
|
||||
~nsMathMLChar();
|
||||
|
||||
void Display(nsDisplayListBuilder* aBuilder,
|
||||
nsIFrame* aForFrame,
|
||||
|
@ -3,32 +3,21 @@
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsHTMLParts.h"
|
||||
#include "nsFrame.h"
|
||||
#include "nsMathMLContainerFrame.h"
|
||||
#include "nsPresContext.h"
|
||||
#include "nsIPresShell.h"
|
||||
#include "nsCSSAnonBoxes.h"
|
||||
#include "nsStyleContext.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsINameSpaceManager.h"
|
||||
#include "nsRenderingContext.h"
|
||||
|
||||
#include "nsIDOMMutationEvent.h"
|
||||
#include "nsFrameManager.h"
|
||||
#include "nsStyleChangeList.h"
|
||||
|
||||
#include "nsGkAtoms.h"
|
||||
#include "nsMathMLParts.h"
|
||||
#include "nsMathMLContainerFrame.h"
|
||||
#include "nsAutoPtr.h"
|
||||
#include "nsStyleSet.h"
|
||||
#include "nsDisplayList.h"
|
||||
#include "nsCSSFrameConstructor.h"
|
||||
#include "nsIReflowCallback.h"
|
||||
#include "mozilla/Likely.h"
|
||||
#include "nsIScriptError.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsMathMLElement.h"
|
||||
|
||||
using namespace mozilla;
|
||||
|
||||
|
@ -7,15 +7,11 @@
|
||||
#define nsMathMLContainerFrame_h___
|
||||
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsContainerFrame.h"
|
||||
#include "nsBlockFrame.h"
|
||||
#include "nsInlineFrame.h"
|
||||
#include "nsMathMLAtoms.h"
|
||||
#include "nsMathMLOperators.h"
|
||||
#include "nsMathMLChar.h"
|
||||
#include "nsMathMLFrame.h"
|
||||
#include "nsMathMLParts.h"
|
||||
#include "mozilla/Likely.h"
|
||||
|
||||
/*
|
||||
|
@ -3,18 +3,17 @@
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "nsINameSpaceManager.h"
|
||||
#include "nsMathMLFrame.h"
|
||||
#include "nsINameSpaceManager.h"
|
||||
#include "nsMathMLChar.h"
|
||||
#include "nsCSSPseudoElements.h"
|
||||
#include "nsMathMLElement.h"
|
||||
|
||||
// used to map attributes into CSS rules
|
||||
#include "nsStyleSet.h"
|
||||
#include "nsAutoPtr.h"
|
||||
#include "nsDisplayList.h"
|
||||
#include "nsRenderingContext.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsIScriptError.h"
|
||||
|
||||
eMathMLFrameType
|
||||
nsMathMLFrame::GetMathMLFrameType()
|
||||
|
@ -7,16 +7,9 @@
|
||||
#define nsMathMLFrame_h___
|
||||
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsPresContext.h"
|
||||
#include "nsFontMetrics.h"
|
||||
#include "nsStyleContext.h"
|
||||
#include "nsMathMLAtoms.h"
|
||||
#include "nsMathMLOperators.h"
|
||||
#include "nsIMathMLFrame.h"
|
||||
#include "nsFrame.h"
|
||||
#include "nsCSSValue.h"
|
||||
#include "nsMathMLElement.h"
|
||||
#include "nsLayoutUtils.h"
|
||||
|
||||
class nsMathMLChar;
|
||||
|
@ -3,18 +3,15 @@
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "nsMathMLOperators.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsString.h"
|
||||
#include "nsHashtable.h"
|
||||
#include "nsTArray.h"
|
||||
|
||||
#include "nsIComponentManager.h"
|
||||
#include "nsIPersistentProperties2.h"
|
||||
#include "nsNetUtil.h"
|
||||
#include "nsCRT.h"
|
||||
|
||||
#include "nsMathMLOperators.h"
|
||||
|
||||
// operator dictionary entry
|
||||
struct OperatorData {
|
||||
OperatorData(void)
|
||||
|
@ -6,7 +6,8 @@
|
||||
#ifndef nsMathMLOperators_h___
|
||||
#define nsMathMLOperators_h___
|
||||
|
||||
#include "nsCoord.h"
|
||||
#include <stdint.h>
|
||||
#include "nsStringFwd.h"
|
||||
|
||||
enum nsStretchDirection {
|
||||
NS_STRETCH_DIRECTION_UNSUPPORTED = -1,
|
||||
|
@ -3,11 +3,6 @@
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsFrame.h"
|
||||
#include "nsPresContext.h"
|
||||
#include "nsStyleContext.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsMathMLSelectedFrame.h"
|
||||
#include "nsDisplayList.h"
|
||||
|
||||
|
@ -3,14 +3,9 @@
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsFrame.h"
|
||||
#include "nsPresContext.h"
|
||||
#include "nsStyleContext.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsCSSFrameConstructor.h"
|
||||
#include "nsMathMLTokenFrame.h"
|
||||
#include "nsPresContext.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsTextFrame.h"
|
||||
#include "RestyleManager.h"
|
||||
#include <algorithm>
|
||||
|
@ -7,7 +7,6 @@
|
||||
#define nsMathMLTokenFrame_h___
|
||||
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsMathMLContainerFrame.h"
|
||||
|
||||
//
|
||||
|
@ -3,28 +3,17 @@
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "nsMathMLmactionFrame.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsFrame.h"
|
||||
#include "nsPresContext.h"
|
||||
#include "nsStyleContext.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsINameSpaceManager.h"
|
||||
|
||||
#include "nsCSSRendering.h"
|
||||
#include "prprf.h" // For PR_snprintf()
|
||||
|
||||
#include "nsIDocShellTreeItem.h"
|
||||
#include "nsIDocShellTreeOwner.h"
|
||||
#include "nsIWebBrowserChrome.h"
|
||||
#include "nsIInterfaceRequestor.h"
|
||||
#include "nsIInterfaceRequestorUtils.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsTextFragment.h"
|
||||
|
||||
#include "nsMathMLmactionFrame.h"
|
||||
#include "nsAutoPtr.h"
|
||||
#include "nsStyleSet.h"
|
||||
#include "nsDisplayList.h"
|
||||
#include "nsIDOMEvent.h"
|
||||
|
||||
//
|
||||
// <maction> -- bind actions to a subexpression - implementation
|
||||
|
@ -3,18 +3,14 @@
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsFrame.h"
|
||||
#include "nsMathMLmencloseFrame.h"
|
||||
#include "nsPresContext.h"
|
||||
#include "nsStyleContext.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsRenderingContext.h"
|
||||
#include "nsWhitespaceTokenizer.h"
|
||||
|
||||
#include "nsMathMLmencloseFrame.h"
|
||||
#include "nsDisplayList.h"
|
||||
#include "gfxContext.h"
|
||||
#include "nsMathMLChar.h"
|
||||
#include <algorithm>
|
||||
|
||||
//
|
||||
|
@ -8,7 +8,6 @@
|
||||
#define nsMathMLmencloseFrame_h___
|
||||
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsMathMLContainerFrame.h"
|
||||
|
||||
//
|
||||
|
@ -4,14 +4,9 @@
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsFrame.h"
|
||||
#include "nsPresContext.h"
|
||||
#include "nsStyleContext.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsRenderingContext.h"
|
||||
|
||||
#include "nsMathMLmfencedFrame.h"
|
||||
#include "nsRenderingContext.h"
|
||||
#include "nsMathMLChar.h"
|
||||
#include <algorithm>
|
||||
|
||||
//
|
||||
|
@ -7,7 +7,6 @@
|
||||
#define nsMathMLmfencedFrame_h
|
||||
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsMathMLContainerFrame.h"
|
||||
|
||||
//
|
||||
|
@ -4,16 +4,12 @@
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsFrame.h"
|
||||
#include "nsPresContext.h"
|
||||
#include "nsStyleContext.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsRenderingContext.h"
|
||||
|
||||
#include "nsMathMLmfracFrame.h"
|
||||
#include "nsPresContext.h"
|
||||
#include "nsRenderingContext.h"
|
||||
#include "nsDisplayList.h"
|
||||
#include "gfxContext.h"
|
||||
#include "nsMathMLElement.h"
|
||||
#include <algorithm>
|
||||
|
||||
//
|
||||
|
@ -7,7 +7,6 @@
|
||||
#define nsMathMLmfracFrame_h___
|
||||
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsMathMLContainerFrame.h"
|
||||
|
||||
//
|
||||
|
@ -4,14 +4,9 @@
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsFrame.h"
|
||||
#include "nsPresContext.h"
|
||||
#include "nsStyleContext.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsRenderingContext.h"
|
||||
|
||||
#include "nsMathMLmmultiscriptsFrame.h"
|
||||
#include "nsPresContext.h"
|
||||
#include "nsRenderingContext.h"
|
||||
#include <algorithm>
|
||||
|
||||
//
|
||||
|
@ -7,7 +7,6 @@
|
||||
#define nsMathMLmmultiscriptsFrame_h___
|
||||
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsMathMLContainerFrame.h"
|
||||
|
||||
//
|
||||
|
@ -3,16 +3,12 @@
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsFrame.h"
|
||||
#include "nsMathMLmoFrame.h"
|
||||
#include "nsPresContext.h"
|
||||
#include "nsStyleContext.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsRenderingContext.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsFrameSelection.h"
|
||||
|
||||
#include "nsMathMLmoFrame.h"
|
||||
#include "nsMathMLElement.h"
|
||||
#include <algorithm>
|
||||
|
||||
//
|
||||
|
@ -7,8 +7,8 @@
|
||||
#define nsMathMLmoFrame_h___
|
||||
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsMathMLTokenFrame.h"
|
||||
#include "nsMathMLChar.h"
|
||||
|
||||
//
|
||||
// <mo> -- operator, fence, or separator
|
||||
|
@ -4,14 +4,8 @@
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsCRT.h" // to get NS_IS_SPACE
|
||||
#include "nsFrame.h"
|
||||
#include "nsPresContext.h"
|
||||
#include "nsStyleContext.h"
|
||||
#include "nsStyleConsts.h"
|
||||
|
||||
#include "nsMathMLmpaddedFrame.h"
|
||||
#include "nsMathMLElement.h"
|
||||
#include <algorithm>
|
||||
|
||||
//
|
||||
|
@ -7,7 +7,6 @@
|
||||
#define nsMathMLmpaddedFrame_h___
|
||||
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsMathMLContainerFrame.h"
|
||||
|
||||
//
|
||||
|
@ -4,11 +4,6 @@
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsFrame.h"
|
||||
#include "nsPresContext.h"
|
||||
#include "nsStyleConsts.h"
|
||||
|
||||
#include "nsMathMLmphantomFrame.h"
|
||||
|
||||
//
|
||||
|
@ -7,7 +7,6 @@
|
||||
#define nsMathMLmphantomFrame_h___
|
||||
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsMathMLContainerFrame.h"
|
||||
|
||||
//
|
||||
|
@ -3,15 +3,9 @@
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsFrame.h"
|
||||
#include "nsPresContext.h"
|
||||
#include "nsStyleContext.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsRenderingContext.h"
|
||||
|
||||
#include "nsMathMLmrootFrame.h"
|
||||
#include "nsPresContext.h"
|
||||
#include "nsRenderingContext.h"
|
||||
#include <algorithm>
|
||||
|
||||
//
|
||||
|
@ -7,8 +7,8 @@
|
||||
#define nsMathMLmrootFrame_h___
|
||||
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsMathMLContainerFrame.h"
|
||||
#include "nsMathMLChar.h"
|
||||
|
||||
//
|
||||
// <msqrt> and <mroot> -- form a radical
|
||||
|
@ -3,12 +3,6 @@
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsFrame.h"
|
||||
#include "nsStyleContext.h"
|
||||
#include "nsStyleConsts.h"
|
||||
|
||||
#include "nsMathMLmrowFrame.h"
|
||||
|
||||
//
|
||||
|
@ -7,7 +7,6 @@
|
||||
#define nsMathMLmrowFrame_h___
|
||||
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsMathMLContainerFrame.h"
|
||||
|
||||
//
|
||||
|
@ -3,14 +3,8 @@
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsFrame.h"
|
||||
#include "nsPresContext.h"
|
||||
#include "nsStyleContext.h"
|
||||
#include "nsStyleConsts.h"
|
||||
|
||||
#include "nsMathMLmspaceFrame.h"
|
||||
#include "nsMathMLElement.h"
|
||||
#include <algorithm>
|
||||
|
||||
|
||||
|
@ -7,7 +7,6 @@
|
||||
#define nsMathMLmspaceFrame_h___
|
||||
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsMathMLContainerFrame.h"
|
||||
|
||||
//
|
||||
|
@ -3,13 +3,6 @@
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsFrame.h"
|
||||
#include "nsStyleContext.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsINameSpaceManager.h"
|
||||
|
||||
#include "nsMathMLmstyleFrame.h"
|
||||
|
||||
//
|
||||
|
@ -7,7 +7,6 @@
|
||||
#define nsMathMLmstyleFrame_h___
|
||||
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsMathMLContainerFrame.h"
|
||||
|
||||
//
|
||||
|
@ -3,24 +3,17 @@
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsFrame.h"
|
||||
#include "nsBlockFrame.h"
|
||||
#include "nsMathMLmtableFrame.h"
|
||||
#include "nsPresContext.h"
|
||||
#include "nsStyleContext.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsTableRowFrame.h"
|
||||
#include "nsINameSpaceManager.h"
|
||||
#include "nsRenderingContext.h"
|
||||
|
||||
#include "nsTArray.h"
|
||||
#include "nsCSSFrameConstructor.h"
|
||||
#include "nsTableOuterFrame.h"
|
||||
#include "nsTableFrame.h"
|
||||
#include "nsTableCellFrame.h"
|
||||
#include "celldata.h"
|
||||
|
||||
#include "nsMathMLmtableFrame.h"
|
||||
#include "RestyleManager.h"
|
||||
#include <algorithm>
|
||||
|
||||
|
@ -7,8 +7,11 @@
|
||||
#define nsMathMLmtableFrame_h___
|
||||
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsMathMLContainerFrame.h"
|
||||
#include "nsBlockFrame.h"
|
||||
#include "nsTableOuterFrame.h"
|
||||
#include "nsTableRowFrame.h"
|
||||
#include "nsTableCellFrame.h"
|
||||
|
||||
//
|
||||
// <mtable> -- table or matrix
|
||||
|
@ -3,16 +3,9 @@
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsFrame.h"
|
||||
#include "nsPresContext.h"
|
||||
#include "nsStyleContext.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsINameSpaceManager.h"
|
||||
#include "nsRenderingContext.h"
|
||||
|
||||
#include "nsMathMLmunderoverFrame.h"
|
||||
#include "nsPresContext.h"
|
||||
#include "nsRenderingContext.h"
|
||||
#include "nsMathMLmmultiscriptsFrame.h"
|
||||
#include <algorithm>
|
||||
|
||||
|
@ -7,7 +7,6 @@
|
||||
#define nsMathMLmunderoverFrame_h___
|
||||
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsMathMLContainerFrame.h"
|
||||
|
||||
//
|
||||
|
@ -4,6 +4,7 @@
|
||||
|
||||
#include "CSFLog.h"
|
||||
|
||||
#include "base/histogram.h"
|
||||
#include "CallControlManager.h"
|
||||
#include "CC_Device.h"
|
||||
#include "CC_Call.h"
|
||||
@ -20,6 +21,8 @@
|
||||
#include "cpr_socket.h"
|
||||
#include "debug-psipcc-types.h"
|
||||
|
||||
#include "mozilla/Telemetry.h"
|
||||
|
||||
#include "nsIObserverService.h"
|
||||
#include "nsIObserver.h"
|
||||
#include "mozilla/Services.h"
|
||||
@ -233,6 +236,11 @@ nsresult PeerConnectionCtx::Initialize() {
|
||||
PR_NotifyAllCondVar(ccAppReadyToStartCond);
|
||||
PR_Unlock(ccAppReadyToStartLock);
|
||||
|
||||
mConnectionCounter = 0;
|
||||
#ifdef MOZILLA_INTERNAL_API
|
||||
Telemetry::GetHistogramById(Telemetry::WEBRTC_CALL_COUNT)->Add(0);
|
||||
#endif
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -72,6 +72,9 @@ class PeerConnectionCtx : public CSF::CC_Observer {
|
||||
mSipccState = aState;
|
||||
}
|
||||
|
||||
// Telemetry Peer conection counter
|
||||
int mConnectionCounter;
|
||||
|
||||
// SIPCC objects
|
||||
PeerConnectionImpl::SipccState mSipccState; // TODO(ekr@rtfm.com): refactor this out? What does it do?
|
||||
CSF::CallControlManagerPtr mCCM;
|
||||
|
@ -4,6 +4,7 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "base/histogram.h"
|
||||
#include "vcm.h"
|
||||
#include "CSFLog.h"
|
||||
#include "ccapi_call_info.h"
|
||||
@ -248,7 +249,7 @@ public:
|
||||
mPC->ClearSdpParseErrorMessages();
|
||||
mObserver->OnSetRemoteDescriptionSuccess();
|
||||
#ifdef MOZILLA_INTERNAL_API
|
||||
mPC->setStartTime();
|
||||
mPC->startCallTelem();
|
||||
#endif
|
||||
break;
|
||||
|
||||
@ -1557,10 +1558,19 @@ PeerConnectionImpl::GetSdpParseErrors() {
|
||||
}
|
||||
|
||||
#ifdef MOZILLA_INTERNAL_API
|
||||
//Telemetry set start time
|
||||
//Telemetry for when calls start
|
||||
void
|
||||
PeerConnectionImpl::setStartTime() {
|
||||
PeerConnectionImpl::startCallTelem() {
|
||||
// Start time for calls
|
||||
mStartTime = mozilla::TimeStamp::Now();
|
||||
|
||||
// Increment session call counter
|
||||
#ifdef MOZILLA_INTERNAL_API
|
||||
int &cnt = PeerConnectionCtx::GetInstance()->mConnectionCounter;
|
||||
Telemetry::GetHistogramById(Telemetry::WEBRTC_CALL_COUNT)->Subtract(cnt);
|
||||
cnt++;
|
||||
Telemetry::GetHistogramById(Telemetry::WEBRTC_CALL_COUNT)->Add(cnt);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -283,8 +283,8 @@ public:
|
||||
void SetSignalingState_m(SignalingState aSignalingState);
|
||||
|
||||
#ifdef MOZILLA_INTERNAL_API
|
||||
// Set start time for Telemetry
|
||||
void setStartTime();
|
||||
// initialize telemetry for when calls start
|
||||
void startCallTelem();
|
||||
#endif
|
||||
|
||||
private:
|
||||
|
@ -16,7 +16,9 @@
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
|
||||
#if defined(_WIN32)
|
||||
#if defined(WEBRTC_DUMMY_AUDIO_BUILD)
|
||||
// do not include platform specific headers
|
||||
#elif defined(_WIN32)
|
||||
#include "audio_device_utility_win.h"
|
||||
#include "audio_device_wave_win.h"
|
||||
#if defined(WEBRTC_WINDOWS_CORE_AUDIO_BUILD)
|
||||
@ -37,11 +39,8 @@
|
||||
#include <stdlib.h>
|
||||
#include "audio_device_utility_android.h"
|
||||
#include "audio_device_jni_android.h"
|
||||
#elif defined(WEBRTC_LINUX)
|
||||
#elif defined(WEBRTC_LINUX) || defined(WEBRTC_BSD)
|
||||
#include "audio_device_utility_linux.h"
|
||||
#if defined(LINUX_ALSA)
|
||||
#include "audio_device_alsa_linux.h"
|
||||
#endif
|
||||
#elif defined(WEBRTC_IOS)
|
||||
#include "audio_device_utility_ios.h"
|
||||
#include "audio_device_ios.h"
|
||||
@ -49,6 +48,9 @@
|
||||
#include "audio_device_utility_mac.h"
|
||||
#include "audio_device_mac.h"
|
||||
#endif
|
||||
#if defined(LINUX_ALSA)
|
||||
#include "audio_device_alsa_linux.h"
|
||||
#endif
|
||||
#if defined(LINUX_PULSE)
|
||||
#include "audio_device_pulse_linux.h"
|
||||
#endif
|
||||
@ -166,7 +168,7 @@ int32_t AudioDeviceModuleImpl::CheckPlatform()
|
||||
#elif defined(WEBRTC_ANDROID)
|
||||
platform = kPlatformAndroid;
|
||||
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "current platform is ANDROID");
|
||||
#elif defined(WEBRTC_LINUX)
|
||||
#elif defined(WEBRTC_LINUX) || defined(WEBRTC_BSD)
|
||||
platform = kPlatformLinux;
|
||||
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "current platform is LINUX");
|
||||
#elif defined(WEBRTC_IOS)
|
||||
@ -309,7 +311,7 @@ int32_t AudioDeviceModuleImpl::CreatePlatformSpecificObjects()
|
||||
|
||||
// Create the *Linux* implementation of the Audio Device
|
||||
//
|
||||
#elif defined(WEBRTC_LINUX)
|
||||
#elif defined(WEBRTC_LINUX) || defined(WEBRTC_BSD)
|
||||
if ((audioLayer == kLinuxPulseAudio) || (audioLayer == kPlatformDefaultAudio))
|
||||
{
|
||||
#if defined(LINUX_PULSE)
|
||||
@ -355,7 +357,7 @@ int32_t AudioDeviceModuleImpl::CreatePlatformSpecificObjects()
|
||||
//
|
||||
ptrAudioDeviceUtility = new AudioDeviceUtilityLinux(Id());
|
||||
}
|
||||
#endif // #if defined(WEBRTC_LINUX)
|
||||
#endif // #if defined(WEBRTC_LINUX) || defined(WEBRTC_BSD)
|
||||
|
||||
// Create the *iPhone* implementation of the Audio Device
|
||||
//
|
||||
|
@ -197,7 +197,7 @@ class AudioDeviceAPITest: public testing::Test {
|
||||
// Create default implementation instance
|
||||
EXPECT_TRUE((audio_device_ = AudioDeviceModuleImpl::Create(
|
||||
kId, AudioDeviceModule::kPlatformDefaultAudio)) != NULL);
|
||||
#elif defined(WEBRTC_LINUX)
|
||||
#elif defined(WEBRTC_LINUX) || defined(WEBRTC_BSD)
|
||||
EXPECT_TRUE((audio_device_ = AudioDeviceModuleImpl::Create(
|
||||
kId, AudioDeviceModule::kWindowsWaveAudio)) == NULL);
|
||||
EXPECT_TRUE((audio_device_ = AudioDeviceModuleImpl::Create(
|
||||
@ -1690,7 +1690,7 @@ TEST_F(AudioDeviceAPITest, CPULoad) {
|
||||
|
||||
// TODO(kjellander): Fix flakiness causing failures on Windows.
|
||||
// TODO(phoglund): Fix flakiness causing failures on Linux.
|
||||
#if !defined(_WIN32) && !defined(WEBRTC_LINUX)
|
||||
#if !defined(_WIN32) && !defined(WEBRTC_LINUX) && !defined(WEBRTC_BSD)
|
||||
TEST_F(AudioDeviceAPITest, StartAndStopRawOutputFileRecording) {
|
||||
// NOTE: this API is better tested in a functional test
|
||||
CheckInitialPlayoutStates();
|
||||
@ -1759,7 +1759,7 @@ TEST_F(AudioDeviceAPITest, StartAndStopRawInputFileRecording) {
|
||||
// - size of raw_input_not_recording.pcm shall be 0
|
||||
// - size of raw_input_not_recording.pcm shall be > 0
|
||||
}
|
||||
#endif // !WIN32 && !WEBRTC_LINUX
|
||||
#endif // !WIN32 && !WEBRTC_LINUX && !defined(WEBRTC_BSD)
|
||||
|
||||
TEST_F(AudioDeviceAPITest, RecordingSampleRate) {
|
||||
uint32_t sampleRate(0);
|
||||
|
@ -43,7 +43,7 @@
|
||||
# define MOZ_USING_STLPORT 1
|
||||
# define MOZ_STLPORT_VERSION_AT_LEAST(major, minor, patch) \
|
||||
(_STLPORT_VERSION >= ((major) << 8 | (minor) << 4 | (patch)))
|
||||
# elif defined(__LIBCPP_VERSION)
|
||||
# elif defined(_LIBCPP_VERSION)
|
||||
/*
|
||||
* libc++, unfortunately, doesn't appear to have useful versioning macros.
|
||||
* Hopefully, the recommendations of N3694 with respect to standard libraries
|
||||
|
@ -37,6 +37,7 @@ sk
|
||||
sl
|
||||
sq
|
||||
sr
|
||||
sv-SE
|
||||
th
|
||||
tr
|
||||
uk
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user