зеркало из https://github.com/mozilla/gecko-dev.git
Merge fx-team and mozilla-central ready for MPL2 update
This commit is contained in:
Коммит
7756488dff
|
@ -18,6 +18,7 @@ ID
|
|||
/configure
|
||||
/config.cache
|
||||
/config.log
|
||||
/.clang_complete
|
||||
|
||||
# Empty marker file that's generated when we check out NSS
|
||||
security/manager/.nss.checkout
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
^configure$
|
||||
^config\.cache$
|
||||
^config\.log$
|
||||
^\.clang_complete
|
||||
|
||||
# Empty marker file that's generated when we check out NSS
|
||||
^security/manager/\.nss\.checkout$
|
||||
|
|
|
@ -395,8 +395,7 @@ nsAccDocManager::CreateDocOrRootAccessible(nsIDocument* aDocument)
|
|||
new nsDocAccessibleWrap(aDocument, rootElm, presShell);
|
||||
|
||||
// Cache the document accessible into document cache.
|
||||
if (!docAcc || !mDocAccessibleCache.Put(aDocument, docAcc))
|
||||
return nsnull;
|
||||
mDocAccessibleCache.Put(aDocument, docAcc);
|
||||
|
||||
// Initialize the document accessible.
|
||||
if (!docAcc->Init()) {
|
||||
|
|
|
@ -746,13 +746,21 @@ nsAccessible::NativeState()
|
|||
if (mContent->HasAttr(kNameSpaceID_None, nsGkAtoms::popup))
|
||||
state |= states::HASPOPUP;
|
||||
|
||||
// Add 'linked' state for simple xlink.
|
||||
if (nsCoreUtils::IsXLink(mContent))
|
||||
state |= states::LINKED;
|
||||
// Bypass the link states specialization for non links.
|
||||
if (!mRoleMapEntry || mRoleMapEntry->roleRule == kUseNativeRole ||
|
||||
mRoleMapEntry->role == roles::LINK)
|
||||
state |= NativeLinkState();
|
||||
|
||||
return state;
|
||||
}
|
||||
|
||||
PRUint64
|
||||
nsAccessible::NativeLinkState() const
|
||||
{
|
||||
// Expose linked state for simple xlink.
|
||||
return nsCoreUtils::IsXLink(mContent) ? states::LINKED : 0;
|
||||
}
|
||||
|
||||
/* readonly attribute boolean focusedChild; */
|
||||
NS_IMETHODIMP
|
||||
nsAccessible::GetFocusedChild(nsIAccessible** aChild)
|
||||
|
@ -1618,7 +1626,7 @@ nsAccessible::State()
|
|||
}
|
||||
|
||||
void
|
||||
nsAccessible::ApplyARIAState(PRUint64* aState)
|
||||
nsAccessible::ApplyARIAState(PRUint64* aState) const
|
||||
{
|
||||
if (!mContent->IsElement())
|
||||
return;
|
||||
|
|
|
@ -185,7 +185,7 @@ public:
|
|||
*
|
||||
* @param [in/out] where to fill the states into.
|
||||
*/
|
||||
virtual void ApplyARIAState(PRUint64* aState);
|
||||
virtual void ApplyARIAState(PRUint64* aState) const;
|
||||
|
||||
/**
|
||||
* Returns the accessible name provided by native markup. It doesn't take
|
||||
|
@ -227,12 +227,27 @@ public:
|
|||
*/
|
||||
virtual PRUint64 State();
|
||||
|
||||
/**
|
||||
* Return link states present on the accessible.
|
||||
*/
|
||||
PRUint64 LinkState() const
|
||||
{
|
||||
PRUint64 state = NativeLinkState();
|
||||
ApplyARIAState(&state);
|
||||
return state;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the states of accessible, not taking into account ARIA states.
|
||||
* Use State() to get complete set of states.
|
||||
*/
|
||||
virtual PRUint64 NativeState();
|
||||
|
||||
/**
|
||||
* Return native link states present on the accessible.
|
||||
*/
|
||||
virtual PRUint64 NativeLinkState() const;
|
||||
|
||||
/**
|
||||
* Return bit set of invisible and offscreen states.
|
||||
*/
|
||||
|
|
|
@ -113,16 +113,12 @@ nsLinkableAccessible::TakeFocus()
|
|||
}
|
||||
|
||||
PRUint64
|
||||
nsLinkableAccessible::NativeState()
|
||||
nsLinkableAccessible::NativeLinkState() const
|
||||
{
|
||||
PRUint64 states = nsAccessibleWrap::NativeState();
|
||||
if (mIsLink) {
|
||||
states |= states::LINKED;
|
||||
if (mActionAcc->State() & states::TRAVERSED)
|
||||
states |= states::TRAVERSED;
|
||||
}
|
||||
if (mIsLink)
|
||||
return states::LINKED | (mActionAcc->LinkState() & states::TRAVERSED);
|
||||
|
||||
return states;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -235,11 +231,10 @@ nsLinkableAccessible::BindToParent(nsAccessible* aParent,
|
|||
// is traversed.
|
||||
nsAccessible* walkUpAcc = this;
|
||||
while ((walkUpAcc = walkUpAcc->Parent()) && !walkUpAcc->IsDoc()) {
|
||||
if (walkUpAcc->Role() == roles::LINK &&
|
||||
walkUpAcc->State() & states::LINKED) {
|
||||
mIsLink = true;
|
||||
mActionAcc = walkUpAcc;
|
||||
return;
|
||||
if (walkUpAcc->LinkState() & states::LINKED) {
|
||||
mIsLink = true;
|
||||
mActionAcc = walkUpAcc;
|
||||
return;
|
||||
}
|
||||
|
||||
if (nsCoreUtils::HasClickListener(walkUpAcc->GetContent())) {
|
||||
|
|
|
@ -96,7 +96,7 @@ public:
|
|||
|
||||
// nsAccessible
|
||||
virtual void Value(nsString& aValue);
|
||||
virtual PRUint64 NativeState();
|
||||
virtual PRUint64 NativeLinkState() const;
|
||||
|
||||
// ActionAccessible
|
||||
virtual PRUint8 ActionCount();
|
||||
|
|
|
@ -341,7 +341,7 @@ nsDocAccessible::NativeState()
|
|||
|
||||
// nsAccessible public method
|
||||
void
|
||||
nsDocAccessible::ApplyARIAState(PRUint64* aState)
|
||||
nsDocAccessible::ApplyARIAState(PRUint64* aState) const
|
||||
{
|
||||
// Combine with states from outer doc
|
||||
//
|
||||
|
@ -1369,17 +1369,11 @@ nsDocAccessible::BindToDocument(nsAccessible* aAccessible,
|
|||
return false;
|
||||
|
||||
// Put into DOM node cache.
|
||||
if (aAccessible->IsPrimaryForNode() &&
|
||||
!mNodeToAccessibleMap.Put(aAccessible->GetNode(), aAccessible))
|
||||
return false;
|
||||
if (aAccessible->IsPrimaryForNode())
|
||||
mNodeToAccessibleMap.Put(aAccessible->GetNode(), aAccessible);
|
||||
|
||||
// Put into unique ID cache.
|
||||
if (!mAccessibleCache.Put(aAccessible->UniqueID(), aAccessible)) {
|
||||
if (aAccessible->IsPrimaryForNode())
|
||||
mNodeToAccessibleMap.Remove(aAccessible->GetNode());
|
||||
|
||||
return false;
|
||||
}
|
||||
mAccessibleCache.Put(aAccessible->UniqueID(), aAccessible);
|
||||
|
||||
// Initialize the accessible.
|
||||
if (!aAccessible->Init()) {
|
||||
|
@ -1621,10 +1615,7 @@ nsDocAccessible::AddDependentIDsFor(nsAccessible* aRelProvider,
|
|||
if (!providers) {
|
||||
providers = new AttrRelProviderArray();
|
||||
if (providers) {
|
||||
if (!mDependentIDsHash.Put(id, providers)) {
|
||||
delete providers;
|
||||
providers = nsnull;
|
||||
}
|
||||
mDependentIDsHash.Put(id, providers);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -115,7 +115,7 @@ public:
|
|||
virtual nsAccessible* FocusedChild();
|
||||
virtual mozilla::a11y::role NativeRole();
|
||||
virtual PRUint64 NativeState();
|
||||
virtual void ApplyARIAState(PRUint64* aState);
|
||||
virtual void ApplyARIAState(PRUint64* aState) const;
|
||||
|
||||
virtual void SetRoleMapEntry(nsRoleMapEntry* aRoleMapEntry);
|
||||
|
||||
|
|
|
@ -1045,7 +1045,7 @@ ARIAGridCellAccessible::IsSelected(bool* aIsSelected)
|
|||
// nsAccessible
|
||||
|
||||
void
|
||||
ARIAGridCellAccessible::ApplyARIAState(PRUint64* aState)
|
||||
ARIAGridCellAccessible::ApplyARIAState(PRUint64* aState) const
|
||||
{
|
||||
nsHyperTextAccessibleWrap::ApplyARIAState(aState);
|
||||
|
||||
|
|
|
@ -138,7 +138,7 @@ public:
|
|||
NS_DECL_NSIACCESSIBLETABLECELL
|
||||
|
||||
// nsAccessible
|
||||
virtual void ApplyARIAState(PRUint64* aState);
|
||||
virtual void ApplyARIAState(PRUint64* aState) const;
|
||||
virtual nsresult GetAttributesInternal(nsIPersistentProperties *aAttributes);
|
||||
};
|
||||
|
||||
|
|
|
@ -333,7 +333,7 @@ ApplicationAccessible::IsPrimaryForNode() const
|
|||
// nsAccessible public methods
|
||||
|
||||
void
|
||||
ApplicationAccessible::ApplyARIAState(PRUint64* aState)
|
||||
ApplicationAccessible::ApplyARIAState(PRUint64* aState) const
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -104,7 +104,7 @@ public:
|
|||
|
||||
// nsAccessible
|
||||
virtual mozilla::a11y::ENameValueFlag Name(nsString& aName);
|
||||
virtual void ApplyARIAState(PRUint64* aState);
|
||||
virtual void ApplyARIAState(PRUint64* aState) const;
|
||||
virtual void Description(nsString& aDescription);
|
||||
virtual void Value(nsString& aValue);
|
||||
virtual mozilla::a11y::role NativeRole();
|
||||
|
|
|
@ -437,7 +437,7 @@ HTMLTextFieldAccessible::Value(nsString& aValue)
|
|||
}
|
||||
|
||||
void
|
||||
HTMLTextFieldAccessible::ApplyARIAState(PRUint64* aState)
|
||||
HTMLTextFieldAccessible::ApplyARIAState(PRUint64* aState) const
|
||||
{
|
||||
nsHyperTextAccessibleWrap::ApplyARIAState(aState);
|
||||
|
||||
|
|
|
@ -145,7 +145,7 @@ public:
|
|||
|
||||
// nsAccessible
|
||||
virtual void Value(nsString& aValue);
|
||||
virtual void ApplyARIAState(PRUint64* aState);
|
||||
virtual void ApplyARIAState(PRUint64* aState) const;
|
||||
virtual nsresult GetNameInternal(nsAString& aName);
|
||||
virtual mozilla::a11y::role NativeRole();
|
||||
virtual PRUint64 State();
|
||||
|
|
|
@ -231,19 +231,6 @@ nsHTMLAreaAccessible::IsPrimaryForNode() const
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
// nsHTMLAreaAccessible: nsAccessible public
|
||||
|
||||
PRUint64
|
||||
nsHTMLAreaAccessible::NativeState()
|
||||
{
|
||||
// Bypass the link states specialization for non links.
|
||||
if (mRoleMapEntry &&
|
||||
mRoleMapEntry->role != roles::NOTHING &&
|
||||
mRoleMapEntry->role != roles::LINK) {
|
||||
return nsAccessible::NativeState();
|
||||
}
|
||||
|
||||
return nsHTMLLinkAccessible::NativeState();
|
||||
}
|
||||
|
||||
nsAccessible*
|
||||
nsHTMLAreaAccessible::ChildAtPoint(PRInt32 aX, PRInt32 aY,
|
||||
EWhichChildAtPoint aWhichChild)
|
||||
|
|
|
@ -102,7 +102,6 @@ public:
|
|||
// nsAccessible
|
||||
virtual void Description(nsString& aDescription);
|
||||
virtual nsresult GetNameInternal(nsAString& aName);
|
||||
virtual PRUint64 NativeState();
|
||||
virtual nsAccessible* ChildAtPoint(PRInt32 aX, PRInt32 aY,
|
||||
EWhichChildAtPoint aWhichChild);
|
||||
virtual void GetBoundsRect(nsRect& aBounds, nsIFrame** aBoundingFrame);
|
||||
|
|
|
@ -86,24 +86,23 @@ nsHTMLLinkAccessible::NativeState()
|
|||
states |= states::SELECTABLE;
|
||||
}
|
||||
|
||||
nsEventStates state = mContent->AsElement()->State();
|
||||
if (state.HasAtLeastOneOfStates(NS_EVENT_STATE_VISITED |
|
||||
NS_EVENT_STATE_UNVISITED)) {
|
||||
states |= states::LINKED;
|
||||
return states;
|
||||
}
|
||||
|
||||
if (state.HasState(NS_EVENT_STATE_VISITED))
|
||||
states |= states::TRAVERSED;
|
||||
PRUint64
|
||||
nsHTMLLinkAccessible::NativeLinkState() const
|
||||
{
|
||||
nsEventStates eventState = mContent->AsElement()->State();
|
||||
if (eventState.HasState(NS_EVENT_STATE_UNVISITED))
|
||||
return states::LINKED;
|
||||
|
||||
return states;
|
||||
}
|
||||
if (eventState.HasState(NS_EVENT_STATE_VISITED))
|
||||
return states::LINKED | states::TRAVERSED;
|
||||
|
||||
// This is a either named anchor (a link with also a name attribute) or
|
||||
// it doesn't have any attributes. Check if 'click' event handler is
|
||||
// registered, otherwise bail out.
|
||||
if (nsCoreUtils::HasClickListener(mContent))
|
||||
states |= states::LINKED;
|
||||
|
||||
return states;
|
||||
return nsCoreUtils::HasClickListener(mContent) ? states::LINKED : 0;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -57,6 +57,7 @@ public:
|
|||
virtual void Value(nsString& aValue);
|
||||
virtual mozilla::a11y::role NativeRole();
|
||||
virtual PRUint64 NativeState();
|
||||
virtual PRUint64 NativeLinkState() const;
|
||||
|
||||
// ActionAccessible
|
||||
virtual PRUint8 ActionCount();
|
||||
|
|
|
@ -1498,7 +1498,7 @@ nsHyperTextAccessible::DeleteText(PRInt32 aStartPos, PRInt32 aEndPos)
|
|||
nsresult rv = SetSelectionRange(aStartPos, aEndPos);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
return editor->DeleteSelection(nsIEditor::eNone);
|
||||
return editor->DeleteSelection(nsIEditor::eNone, nsIEditor::eStrip);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
|
@ -39,12 +39,12 @@ var AccessFu = {
|
|||
this.presenters = [];
|
||||
|
||||
this.prefsBranch = Cc['@mozilla.org/preferences-service;1']
|
||||
.getService(Ci.nsIPrefService).getBranch('accessibility.');
|
||||
this.prefsBranch.addObserver('accessfu', this, false);
|
||||
.getService(Ci.nsIPrefService).getBranch('accessibility.accessfu.');
|
||||
this.prefsBranch.addObserver('activate', this, false);
|
||||
|
||||
let accessPref = ACCESSFU_DISABLE;
|
||||
try {
|
||||
accessPref = this.prefsBranch.getIntPref('accessfu');
|
||||
accessPref = this.prefsBranch.getIntPref('activate');
|
||||
} catch (x) {
|
||||
}
|
||||
|
||||
|
@ -176,8 +176,8 @@ var AccessFu = {
|
|||
this._disable();
|
||||
break;
|
||||
case 'nsPref:changed':
|
||||
if (aData == 'accessfu')
|
||||
this._processPreferences(this.prefsBranch.getIntPref('accessfu'));
|
||||
if (aData == 'activate')
|
||||
this._processPreferences(this.prefsBranch.getIntPref('activate'));
|
||||
break;
|
||||
case 'accessible-event':
|
||||
let event;
|
||||
|
@ -215,12 +215,10 @@ var AccessFu = {
|
|||
doc.defaultView, null, Ci.nsIFocusManager.MOVEFOCUS_CARET, 0);
|
||||
}
|
||||
|
||||
let newContext = this.getNewContext(event.oldAccessible,
|
||||
pivot.position);
|
||||
let presenterContext = new PresenterContext(pivot.position,
|
||||
event.oldAccessible);
|
||||
this.presenters.forEach(
|
||||
function(p) {
|
||||
p.pivotChanged(pivot.position, newContext);
|
||||
});
|
||||
function(p) { p.pivotChanged(presenterContext); });
|
||||
break;
|
||||
}
|
||||
case Ci.nsIAccessibleEvent.EVENT_STATE_CHANGE:
|
||||
|
@ -313,8 +311,13 @@ var AccessFu = {
|
|||
{
|
||||
if (this._isBrowserDoc(aEvent.accessible)) {
|
||||
// The document recieved focus, call tabSelected to present current tab.
|
||||
let docContext = new PresenterContext(aEvent.accessible, null);
|
||||
let cursorable = aEvent.accessible.
|
||||
QueryInterface(Ci.nsIAccessibleCursorable);
|
||||
let vcContext = new PresenterContext(
|
||||
(cursorable) ? cursorable.virtualCursor.position : null, null);
|
||||
this.presenters.forEach(
|
||||
function(p) { p.tabSelected(aEvent.accessible); });
|
||||
function(p) { p.tabSelected(docContext, vcContext); });
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -383,41 +386,6 @@ var AccessFu = {
|
|||
return location.protocol != "about:";
|
||||
},
|
||||
|
||||
getNewContext: function getNewContext(aOldObject, aNewObject) {
|
||||
let newLineage = [];
|
||||
let oldLineage = [];
|
||||
|
||||
let parent = aNewObject;
|
||||
while ((parent = parent.parent))
|
||||
newLineage.push(parent);
|
||||
|
||||
if (aOldObject) {
|
||||
parent = aOldObject;
|
||||
while ((parent = parent.parent))
|
||||
oldLineage.push(parent);
|
||||
}
|
||||
|
||||
// newLineage.reverse();
|
||||
// oldLineage.reverse();
|
||||
|
||||
let i = 0;
|
||||
let newContext = [];
|
||||
|
||||
while (true) {
|
||||
let newAncestor = newLineage.pop();
|
||||
let oldAncestor = oldLineage.pop();
|
||||
|
||||
if (newAncestor == undefined)
|
||||
break;
|
||||
|
||||
if (newAncestor != oldAncestor)
|
||||
newContext.push(newAncestor);
|
||||
i++;
|
||||
}
|
||||
|
||||
return newContext;
|
||||
},
|
||||
|
||||
// A hash of documents that don't yet have an accessible tree.
|
||||
_pendingDocuments: {},
|
||||
|
||||
|
|
|
@ -14,7 +14,8 @@ Cu.import('resource://gre/modules/Services.jsm');
|
|||
|
||||
var EXPORTED_SYMBOLS = ['VisualPresenter',
|
||||
'AndroidPresenter',
|
||||
'DummyAndroidPresenter'];
|
||||
'DummyAndroidPresenter',
|
||||
'PresenterContext'];
|
||||
|
||||
/**
|
||||
* The interface for all presenter classes. A presenter could be, for example,
|
||||
|
@ -36,11 +37,10 @@ Presenter.prototype = {
|
|||
|
||||
/**
|
||||
* The virtual cursor's position changed.
|
||||
* @param {nsIAccessible} aObject the new position.
|
||||
* @param {nsIAccessible[]} aNewContext the ancestry of the new position that
|
||||
* is different from the old virtual cursor position.
|
||||
* @param {PresenterContext} aContext the context object for the new pivot
|
||||
* position.
|
||||
*/
|
||||
pivotChanged: function pivotChanged(aObject, aNewContext) {},
|
||||
pivotChanged: function pivotChanged(aContext) {},
|
||||
|
||||
/**
|
||||
* An object's action has been invoked.
|
||||
|
@ -78,11 +78,12 @@ Presenter.prototype = {
|
|||
|
||||
/**
|
||||
* The current tab has changed.
|
||||
* @param {nsIAccessible} aObject the document contained by the tab
|
||||
* accessible, or null if it is a new tab with no attached
|
||||
* document yet.
|
||||
* @param {PresenterContext} aDocContext context object for tab's
|
||||
* document.
|
||||
* @param {PresenterContext} aVCContext context object for tab's current
|
||||
* virtual cursor position.
|
||||
*/
|
||||
tabSelected: function tabSelected(aDocObj) {},
|
||||
tabSelected: function tabSelected(aDocContext, aVCContext) {},
|
||||
|
||||
/**
|
||||
* The viewport has changed, either a scroll, pan, zoom, or
|
||||
|
@ -139,34 +140,32 @@ VisualPresenter.prototype = {
|
|||
this._highlight(this._currentObject);
|
||||
},
|
||||
|
||||
pivotChanged: function VisualPresenter_pivotChanged(aObject, aNewContext) {
|
||||
this._currentObject = aObject;
|
||||
pivotChanged: function VisualPresenter_pivotChanged(aContext) {
|
||||
this._currentObject = aContext.accessible;
|
||||
|
||||
if (!aObject) {
|
||||
if (!aContext.accessible) {
|
||||
this._hide();
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
aObject.scrollTo(Ci.nsIAccessibleScrollType.SCROLL_TYPE_ANYWHERE);
|
||||
this._highlight(aObject);
|
||||
aContext.accessible.scrollTo(
|
||||
Ci.nsIAccessibleScrollType.SCROLL_TYPE_ANYWHERE);
|
||||
this._highlight(aContext.accessible);
|
||||
} catch (e) {
|
||||
dump('Error getting bounds: ' + e);
|
||||
return;
|
||||
}
|
||||
},
|
||||
|
||||
tabSelected: function VisualPresenter_tabSelected(aDocObj) {
|
||||
let vcPos = aDocObj ? aDocObj.QueryInterface(Ci.nsIAccessibleCursorable).
|
||||
virtualCursor.position : null;
|
||||
|
||||
this.pivotChanged(vcPos);
|
||||
tabSelected: function VisualPresenter_tabSelected(aDocContext, aVCContext) {
|
||||
this.pivotChanged(aVCContext);
|
||||
},
|
||||
|
||||
tabStateChanged: function VisualPresenter_tabStateChanged(aDocObj,
|
||||
aPageState) {
|
||||
if (aPageState == 'newdoc')
|
||||
this.pivotChanged(null);
|
||||
this._hide();
|
||||
},
|
||||
|
||||
// Internals
|
||||
|
@ -234,14 +233,15 @@ AndroidPresenter.prototype = {
|
|||
ANDROID_VIEW_TEXT_CHANGED: 0x10,
|
||||
ANDROID_WINDOW_STATE_CHANGED: 0x20,
|
||||
|
||||
pivotChanged: function AndroidPresenter_pivotChanged(aObject, aNewContext) {
|
||||
pivotChanged: function AndroidPresenter_pivotChanged(aContext) {
|
||||
let output = [];
|
||||
for (let i in aNewContext)
|
||||
output.push.apply(output,
|
||||
UtteranceGenerator.genForObject(aNewContext[i]));
|
||||
for (let i in aContext.newAncestry)
|
||||
output.push.apply(
|
||||
output, UtteranceGenerator.genForObject(aContext.newAncestry[i]));
|
||||
|
||||
output.push.apply(output,
|
||||
UtteranceGenerator.genForObject(aObject, true));
|
||||
UtteranceGenerator.genForObject(aContext.accessible,
|
||||
true));
|
||||
|
||||
this.sendMessageToJava({
|
||||
gecko: {
|
||||
|
@ -262,21 +262,9 @@ AndroidPresenter.prototype = {
|
|||
});
|
||||
},
|
||||
|
||||
tabSelected: function AndroidPresenter_tabSelected(aDocObj) {
|
||||
tabSelected: function AndroidPresenter_tabSelected(aDocContext, aVCContext) {
|
||||
// Send a pivot change message with the full context utterance for this doc.
|
||||
let vcDoc = aDocObj.QueryInterface(Ci.nsIAccessibleCursorable);
|
||||
let context = [];
|
||||
|
||||
let parent = vcDoc.virtualCursor.position || aDocObj;
|
||||
while ((parent = parent.parent)) {
|
||||
context.push(parent);
|
||||
if (parent == aDocObj)
|
||||
break;
|
||||
}
|
||||
|
||||
context.reverse();
|
||||
|
||||
this.pivotChanged(vcDoc.virtualCursor.position || aDocObj, context);
|
||||
this.pivotChanged(aVCContext);
|
||||
},
|
||||
|
||||
tabStateChanged: function AndroidPresenter_tabStateChanged(aDocObj,
|
||||
|
@ -342,3 +330,62 @@ DummyAndroidPresenter.prototype = {
|
|||
dump(JSON.stringify(aMsg, null, 2) + '\n');
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* PresenterContext: An object that generates and caches context information
|
||||
* for a given accessible and its relationship with another accessible.
|
||||
*/
|
||||
function PresenterContext(aAccessible, aOldAccessible) {
|
||||
this._accessible = aAccessible;
|
||||
this._oldAccessible = aOldAccessible;
|
||||
}
|
||||
|
||||
PresenterContext.prototype = {
|
||||
get accessible() {
|
||||
return this._accessible;
|
||||
},
|
||||
|
||||
get oldAccessible() {
|
||||
return this._oldAccessible;
|
||||
},
|
||||
|
||||
/*
|
||||
* This is a list of the accessible's ancestry up to the common ancestor
|
||||
* of the accessible and the old accessible. It is useful for giving the
|
||||
* user context as to where they are in the heirarchy.
|
||||
*/
|
||||
get newAncestry() {
|
||||
if (!this._newAncestry) {
|
||||
let newLineage = [];
|
||||
let oldLineage = [];
|
||||
|
||||
let parent = this._accessible;
|
||||
while ((parent = parent.parent))
|
||||
newLineage.push(parent);
|
||||
|
||||
if (this._oldAccessible) {
|
||||
parent = this._oldAccessible;
|
||||
while ((parent = parent.parent))
|
||||
oldLineage.push(parent);
|
||||
}
|
||||
|
||||
let i = 0;
|
||||
this._newAncestry = [];
|
||||
|
||||
while (true) {
|
||||
let newAncestor = newLineage.pop();
|
||||
let oldAncestor = oldLineage.pop();
|
||||
|
||||
if (newAncestor == undefined)
|
||||
break;
|
||||
|
||||
if (newAncestor != oldAncestor)
|
||||
this._newAncestry.push(newAncestor);
|
||||
i++;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return this._newAncestry;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -754,12 +754,11 @@ XULTextFieldAccessible::Value(nsString& aValue)
|
|||
}
|
||||
|
||||
void
|
||||
XULTextFieldAccessible::ApplyARIAState(PRUint64* aState)
|
||||
XULTextFieldAccessible::ApplyARIAState(PRUint64* aState) const
|
||||
{
|
||||
nsHyperTextAccessibleWrap::ApplyARIAState(aState);
|
||||
|
||||
aria::MapToState(aria::eARIAAutoComplete, mContent->AsElement(), aState);
|
||||
|
||||
}
|
||||
|
||||
PRUint64
|
||||
|
|
|
@ -265,7 +265,7 @@ public:
|
|||
|
||||
// nsAccessible
|
||||
virtual void Value(nsString& aValue);
|
||||
virtual void ApplyARIAState(PRUint64* aState);
|
||||
virtual void ApplyARIAState(PRUint64* aState) const;
|
||||
virtual mozilla::a11y::role NativeRole();
|
||||
virtual PRUint64 NativeState();
|
||||
virtual bool CanHaveAnonChildren();
|
||||
|
|
|
@ -178,9 +178,9 @@ nsXULLinkAccessible::NativeRole()
|
|||
|
||||
|
||||
PRUint64
|
||||
nsXULLinkAccessible::NativeState()
|
||||
nsXULLinkAccessible::NativeLinkState() const
|
||||
{
|
||||
return nsHyperTextAccessible::NativeState() | states::LINKED;
|
||||
return states::LINKED;
|
||||
}
|
||||
|
||||
PRUint8
|
||||
|
|
|
@ -88,7 +88,7 @@ public:
|
|||
virtual void Value(nsString& aValue);
|
||||
virtual nsresult GetNameInternal(nsAString& aName);
|
||||
virtual mozilla::a11y::role NativeRole();
|
||||
virtual PRUint64 NativeState();
|
||||
virtual PRUint64 NativeLinkState() const;
|
||||
|
||||
// ActionAccessible
|
||||
virtual PRUint8 ActionCount();
|
||||
|
|
|
@ -574,12 +574,11 @@ nsXULTreeAccessible::GetTreeItemAccessible(PRInt32 aRow)
|
|||
|
||||
nsRefPtr<nsAccessible> treeItem = CreateTreeItemAccessible(aRow);
|
||||
if (treeItem) {
|
||||
if (mAccessibleCache.Put(key, treeItem)) {
|
||||
if (Document()->BindToDocument(treeItem, nsnull))
|
||||
return treeItem;
|
||||
mAccessibleCache.Put(key, treeItem);
|
||||
if (Document()->BindToDocument(treeItem, nsnull))
|
||||
return treeItem;
|
||||
|
||||
mAccessibleCache.Remove(key);
|
||||
}
|
||||
mAccessibleCache.Remove(key);
|
||||
}
|
||||
|
||||
return nsnull;
|
||||
|
|
|
@ -732,12 +732,11 @@ nsXULTreeGridRowAccessible::GetCellAccessible(nsITreeColumn* aColumn)
|
|||
new nsXULTreeGridCellAccessibleWrap(mContent, mDoc, this, mTree,
|
||||
mTreeView, mRow, aColumn);
|
||||
if (cell) {
|
||||
if (mAccessibleCache.Put(key, cell)) {
|
||||
if (Document()->BindToDocument(cell, nsnull))
|
||||
return cell;
|
||||
mAccessibleCache.Put(key, cell);
|
||||
if (Document()->BindToDocument(cell, nsnull))
|
||||
return cell;
|
||||
|
||||
mAccessibleCache.Remove(key);
|
||||
}
|
||||
mAccessibleCache.Remove(key);
|
||||
}
|
||||
|
||||
return nsnull;
|
||||
|
|
|
@ -8,6 +8,8 @@
|
|||
|
||||
<script type="application/javascript"
|
||||
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
|
||||
|
||||
<script type="application/javascript"
|
||||
src="../common.js"></script>
|
||||
|
@ -15,19 +17,53 @@
|
|||
src="../role.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../states.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../events.js"></script>
|
||||
|
||||
<script type="application/javascript">
|
||||
function doTest()
|
||||
{
|
||||
testStates("link1", STATE_LINKED);
|
||||
testStates("link2", STATE_LINKED);
|
||||
testStates("link3", STATE_LINKED);
|
||||
testStates("link4", STATE_LINKED);
|
||||
testStates("link5", 0, 0, STATE_LINKED);
|
||||
// a@href and its text node
|
||||
testStates("link_href", STATE_LINKED);
|
||||
testStates(getAccessible("link_href").firstChild, STATE_LINKED);
|
||||
|
||||
SimpleTest.finish();
|
||||
// a@onclick
|
||||
testStates("link_click", STATE_LINKED);
|
||||
|
||||
// a@onmousedown
|
||||
testStates("link_mousedown", STATE_LINKED);
|
||||
|
||||
// a@onmouseup
|
||||
testStates("link_mouseup", STATE_LINKED);
|
||||
|
||||
// a@role="link"
|
||||
testStates("link_arialink", STATE_LINKED);
|
||||
|
||||
// a@role="button"
|
||||
testStates("link_ariabutton", 0, 0, STATE_LINKED);
|
||||
|
||||
// a (no @href, no click event listener)
|
||||
testStates("link_notlink", 0, 0, STATE_LINKED);
|
||||
|
||||
// a: traversal state
|
||||
testStates("link_traversed", 0, 0, STATE_TRAVERSED);
|
||||
registerA11yEventListener(EVENT_DOCUMENT_LOAD_COMPLETE,
|
||||
traversedLinkTester);
|
||||
|
||||
synthesizeMouse(getNode("link_traversed"), 1, 1, { shiftKey: true });
|
||||
}
|
||||
|
||||
var traversedLinkTester = {
|
||||
handleEvent: function traversedLinkTester_handleEvent(aEvent) {
|
||||
unregisterA11yEventListener(EVENT_DOCUMENT_LOAD_COMPLETE,
|
||||
traversedLinkTester);
|
||||
aEvent.accessible.rootDocument.window.close();
|
||||
|
||||
testStates("link_traversed", STATE_TRAVERSED);
|
||||
SimpleTest.finish();
|
||||
}
|
||||
};
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
addA11yLoadEvent(doTest);
|
||||
</script>
|
||||
|
@ -41,16 +77,25 @@
|
|||
title="Expose click action if mouseup and mousedown are registered">
|
||||
Mozilla Bug 423409
|
||||
</a>
|
||||
<a target="_blank"
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=754830"
|
||||
title="Calculate link states separately">
|
||||
Mozilla Bug 754830
|
||||
</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none"></div>
|
||||
<pre id="test">
|
||||
</pre>
|
||||
|
||||
<a id="link1" href="http://mozilla.org">link</a>
|
||||
<a id="link2" onclick="">link</a>
|
||||
<a id="link3" onmousedown="">link</a>
|
||||
<a id="link4" onmouseup="">link</a>
|
||||
<a id="link5">not link</a>
|
||||
<a id="link_href" href="http://mozilla.org">link</a>
|
||||
<a id="link_click" onclick="">link</a>
|
||||
<a id="link_mousedown" onmousedown="">link</a>
|
||||
<a id="link_mouseup" onmouseup="">link</a>
|
||||
<a id="link_arialink" role="link">aria link</a>
|
||||
<a id="link_ariabutton" role="button">aria button</a>
|
||||
<a id="link_notlink">not link</a>
|
||||
|
||||
<a id="link_traversed" href="http://www.example.com" target="_top">example.com</a>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -9,17 +9,14 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=441737
|
|||
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
|
||||
|
||||
<script type="application/javascript"
|
||||
src="common.js"></script>
|
||||
src="common.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="role.js"></script>
|
||||
src="role.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="states.js"></script>
|
||||
src="states.js"></script>
|
||||
|
||||
<!-- chrome-harness.js breaks this test (bug 736886) -->
|
||||
<!--
|
||||
<script type="application/javascript"
|
||||
src="chrome://mochikit/content/chrome-harness.js"/>
|
||||
-->
|
||||
src="chrome://mochikit/content/chrome-harness.js"></script>
|
||||
|
||||
<script type="application/javascript">
|
||||
function doTest()
|
||||
|
@ -43,19 +40,17 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=441737
|
|||
is(attributes.getStringProperty("tag"), "body",
|
||||
"Wrong attribute on document!");
|
||||
|
||||
// nsIAccessibleDocument
|
||||
// getRootDirectory() depends on broken chrome-harness.js include (bug
|
||||
// 736886)
|
||||
/*
|
||||
// Document URL.
|
||||
var rootDir = getRootDirectory(window.location.href);
|
||||
is(docAcc.URL, rootDir.path + "test_nsIAccessibleDocument.html",
|
||||
is(docAcc.URL, rootDir + "test_nsIAccessibleDocument.html",
|
||||
"Wrong URL for document!");
|
||||
*/
|
||||
todo(false, "chrome-harness.js include is broken (bug 736886)");
|
||||
is(docAcc.title, "nsIAccessibleDocument chrome tests",
|
||||
|
||||
// Document title and mime type.
|
||||
is(docAcc.title, "nsIAccessibleDocument chrome tests",
|
||||
"Wrong title for document!");
|
||||
is(docAcc.mimeType, "text/html",
|
||||
"Wrong mime type for document!");
|
||||
|
||||
// nsDocAccessible::getDocType currently returns NS_ERROR_FAILURE.
|
||||
// See bug 442005. After fixing, please remove this comment and
|
||||
// uncomment the below two lines to enable the test.
|
||||
|
|
|
@ -624,7 +624,7 @@ SettingsListener.observe('language.current', 'en-US', function(value) {
|
|||
power.addWakeLockListener(wakeLockHandler);
|
||||
};
|
||||
|
||||
SettingsListener.observe('power.screen.timeout', 30, function(value) {
|
||||
SettingsListener.observe('power.screen.timeout', idleTimeout, function(value) {
|
||||
if (!value)
|
||||
return;
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0"?>
|
||||
<blocklist xmlns="http://www.mozilla.org/2006/addons-blocklist" lastupdate="1336406310000">
|
||||
<blocklist xmlns="http://www.mozilla.org/2006/addons-blocklist" lastupdate="1337190282000">
|
||||
<emItems>
|
||||
<emItem blockID="i58" id="webmaster@buzzzzvideos.info">
|
||||
<versionRange minVersion="0" maxVersion="*">
|
||||
|
@ -61,8 +61,12 @@
|
|||
<versionRange minVersion="0.1" maxVersion="4.3.1.00" severity="1">
|
||||
</versionRange>
|
||||
</emItem>
|
||||
<emItem blockID="i42" id="{D19CA586-DD6C-4a0a-96F8-14644F340D60}">
|
||||
<versionRange minVersion="0.1" maxVersion="14.4.0" severity="1">
|
||||
<emItem blockID="i92" id="play5@vide04flash.com">
|
||||
<versionRange minVersion="0" maxVersion="*">
|
||||
</versionRange>
|
||||
</emItem>
|
||||
<emItem blockID="i93" id="{68b8676b-99a5-46d1-b390-22411d8bcd61}">
|
||||
<versionRange minVersion="0" maxVersion="*">
|
||||
</versionRange>
|
||||
</emItem>
|
||||
<emItem blockID="i61" id="youtube@youtube3.com">
|
||||
|
@ -156,10 +160,18 @@
|
|||
<versionRange minVersion="0" maxVersion="*">
|
||||
</versionRange>
|
||||
</emItem>
|
||||
<emItem blockID="i91" id="crossriderapp4926@crossrider.com">
|
||||
<versionRange minVersion="0" maxVersion="0.81.43" severity="1">
|
||||
</versionRange>
|
||||
</emItem>
|
||||
<emItem blockID="i84" id="pink@rosaplugin.info">
|
||||
<versionRange minVersion="0" maxVersion="*">
|
||||
</versionRange>
|
||||
</emItem>
|
||||
<emItem blockID="i42" id="{D19CA586-DD6C-4a0a-96F8-14644F340D60}">
|
||||
<versionRange minVersion="0.1" maxVersion="14.4.0" severity="1">
|
||||
</versionRange>
|
||||
</emItem>
|
||||
<emItem blockID="i67" id="youtube2@youtube2.com">
|
||||
<versionRange minVersion="0" maxVersion="*">
|
||||
</versionRange>
|
||||
|
|
|
@ -122,8 +122,8 @@ let gBrowserThumbnails = {
|
|||
if (aBrowser != gBrowser.selectedBrowser)
|
||||
return false;
|
||||
|
||||
// Don't capture in private browsing mode.
|
||||
if (gPrivateBrowsingUI.privateBrowsingEnabled)
|
||||
// Don't capture in per-window private browsing mode.
|
||||
if (gPrivateBrowsingUI.privateWindow)
|
||||
return false;
|
||||
|
||||
let doc = aBrowser.contentDocument;
|
||||
|
|
|
@ -8868,7 +8868,8 @@ let gPrivateBrowsingUI = {
|
|||
* and the setter should only be used in tests.
|
||||
*/
|
||||
get privateWindow() {
|
||||
return window.getInterface(Ci.nsIWebNavigation)
|
||||
return window.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Ci.nsIWebNavigation)
|
||||
.QueryInterface(Ci.nsIDocShellTreeItem)
|
||||
.treeOwner
|
||||
.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
|
@ -8878,7 +8879,8 @@ let gPrivateBrowsingUI = {
|
|||
},
|
||||
|
||||
set privateWindow(val) {
|
||||
return window.getInterface(Ci.nsIWebNavigation)
|
||||
return window.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Ci.nsIWebNavigation)
|
||||
.QueryInterface(Ci.nsIDocShellTreeItem)
|
||||
.treeOwner
|
||||
.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
|
|
|
@ -61,6 +61,9 @@ var gAdvancedPane = {
|
|||
advancedPrefs.selectedIndex = preference.value;
|
||||
}
|
||||
|
||||
#ifdef HAVE_SHELL_SERVICE
|
||||
this.updateSetDefaultBrowser();
|
||||
#endif
|
||||
#ifdef MOZ_UPDATER
|
||||
this.updateReadPrefs();
|
||||
#endif
|
||||
|
@ -704,37 +707,26 @@ var gAdvancedPane = {
|
|||
*/
|
||||
|
||||
/**
|
||||
* Checks whether the browser is currently registered with the operating
|
||||
* system as the default browser. If the browser is not currently the
|
||||
* default browser, the user is given the option of making it the default;
|
||||
* otherwise, the user is informed that this browser already is the browser.
|
||||
* Show button for setting browser as default browser or information that
|
||||
* browser is already the default browser.
|
||||
*/
|
||||
checkNow: function ()
|
||||
updateSetDefaultBrowser: function()
|
||||
{
|
||||
var shellSvc = Components.classes["@mozilla.org/browser/shell-service;1"]
|
||||
.getService(Components.interfaces.nsIShellService);
|
||||
var brandBundle = document.getElementById("bundleBrand");
|
||||
var shellBundle = document.getElementById("bundleShell");
|
||||
var brandShortName = brandBundle.getString("brandShortName");
|
||||
var promptTitle = shellBundle.getString("setDefaultBrowserTitle");
|
||||
var promptMessage;
|
||||
const IPS = Components.interfaces.nsIPromptService;
|
||||
var psvc = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
|
||||
.getService(IPS);
|
||||
if (!shellSvc.isDefaultBrowser(false)) {
|
||||
promptMessage = shellBundle.getFormattedString("setDefaultBrowserMessage",
|
||||
[brandShortName]);
|
||||
var rv = psvc.confirmEx(window, promptTitle, promptMessage,
|
||||
IPS.STD_YES_NO_BUTTONS,
|
||||
null, null, null, null, { });
|
||||
if (rv == 0)
|
||||
shellSvc.setDefaultBrowser(true, false);
|
||||
}
|
||||
else {
|
||||
promptMessage = shellBundle.getFormattedString("alreadyDefaultBrowser",
|
||||
[brandShortName]);
|
||||
psvc.alert(window, promptTitle, promptMessage);
|
||||
}
|
||||
let selectedIndex = shellSvc.isDefaultBrowser(false) ? 1 : 0;
|
||||
document.getElementById("setDefaultPane").selectedIndex = selectedIndex;
|
||||
},
|
||||
|
||||
/**
|
||||
* Set browser as the operating system default browser.
|
||||
*/
|
||||
setDefaultBrowser: function()
|
||||
{
|
||||
var shellSvc = Components.classes["@mozilla.org/browser/shell-service;1"]
|
||||
.getService(Components.interfaces.nsIShellService);
|
||||
shellSvc.setDefaultBrowser(true, false);
|
||||
document.getElementById("setDefaultPane").selectedIndex = 1;
|
||||
}
|
||||
#endif
|
||||
};
|
||||
|
|
|
@ -204,14 +204,17 @@
|
|||
<caption label="&systemDefaults.label;"/>
|
||||
|
||||
#ifdef HAVE_SHELL_SERVICE
|
||||
<hbox id="checkDefaultBox" align="center" flex="1">
|
||||
<checkbox id="alwaysCheckDefault" preference="browser.shell.checkDefaultBrowser"
|
||||
label="&alwaysCheckDefault.label;" accesskey="&alwaysCheckDefault.accesskey;"
|
||||
flex="1"/>
|
||||
<button id="checkDefaultButton"
|
||||
label="&checkNow.label;" accesskey="&checkNow.accesskey;"
|
||||
oncommand="gAdvancedPane.checkNow()"
|
||||
preference="pref.general.disable_button.default_browser"/>
|
||||
<checkbox id="alwaysCheckDefault" preference="browser.shell.checkDefaultBrowser"
|
||||
label="&alwaysCheckDefault.label;" accesskey="&alwaysCheckDefault.accesskey;"
|
||||
flex="1"/>
|
||||
<hbox class="indent">
|
||||
<deck id="setDefaultPane">
|
||||
<button id="setDefaultButton"
|
||||
label="&setDefault.label;" accesskey="&setDefault.accesskey;"
|
||||
oncommand="gAdvancedPane.setDefaultBrowser();"
|
||||
preference="pref.general.disable_button.default_browser"/>
|
||||
<description>&isDefault.label;</description>
|
||||
</deck>
|
||||
</hbox>
|
||||
#ifdef MOZ_CRASHREPORTER
|
||||
<checkbox id="submitCrashesBox" flex="1"
|
||||
|
|
|
@ -20,6 +20,9 @@ var gAdvancedPane = {
|
|||
if (preference.value !== null)
|
||||
advancedPrefs.selectedIndex = preference.value;
|
||||
|
||||
#ifdef HAVE_SHELL_SERVICE
|
||||
this.updateSetDefaultBrowser();
|
||||
#endif
|
||||
#ifdef MOZ_UPDATER
|
||||
this.updateReadPrefs();
|
||||
#endif
|
||||
|
@ -667,37 +670,26 @@ var gAdvancedPane = {
|
|||
*/
|
||||
|
||||
/**
|
||||
* Checks whether the browser is currently registered with the operating
|
||||
* system as the default browser. If the browser is not currently the
|
||||
* default browser, the user is given the option of making it the default;
|
||||
* otherwise, the user is informed that this browser already is the browser.
|
||||
* Show button for setting browser as default browser or information that
|
||||
* browser is already the default browser.
|
||||
*/
|
||||
checkNow: function ()
|
||||
updateSetDefaultBrowser: function()
|
||||
{
|
||||
var shellSvc = Components.classes["@mozilla.org/browser/shell-service;1"]
|
||||
.getService(Components.interfaces.nsIShellService);
|
||||
var brandBundle = document.getElementById("bundleBrand");
|
||||
var shellBundle = document.getElementById("bundleShell");
|
||||
var brandShortName = brandBundle.getString("brandShortName");
|
||||
var promptTitle = shellBundle.getString("setDefaultBrowserTitle");
|
||||
var promptMessage;
|
||||
const IPS = Components.interfaces.nsIPromptService;
|
||||
var psvc = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
|
||||
.getService(IPS);
|
||||
if (!shellSvc.isDefaultBrowser(false)) {
|
||||
promptMessage = shellBundle.getFormattedString("setDefaultBrowserMessage",
|
||||
[brandShortName]);
|
||||
var rv = psvc.confirmEx(window, promptTitle, promptMessage,
|
||||
IPS.STD_YES_NO_BUTTONS,
|
||||
null, null, null, null, { });
|
||||
if (rv == 0)
|
||||
shellSvc.setDefaultBrowser(true, false);
|
||||
}
|
||||
else {
|
||||
promptMessage = shellBundle.getFormattedString("alreadyDefaultBrowser",
|
||||
[brandShortName]);
|
||||
psvc.alert(window, promptTitle, promptMessage);
|
||||
}
|
||||
let selectedIndex = shellSvc.isDefaultBrowser(false) ? 1 : 0;
|
||||
document.getElementById("setDefaultPane").selectedIndex = selectedIndex;
|
||||
},
|
||||
|
||||
/**
|
||||
* Set browser as the operating system default browser.
|
||||
*/
|
||||
setDefaultBrowser: function()
|
||||
{
|
||||
var shellSvc = Components.classes["@mozilla.org/browser/shell-service;1"]
|
||||
.getService(Components.interfaces.nsIShellService);
|
||||
shellSvc.setDefaultBrowser(true, false);
|
||||
document.getElementById("setDefaultPane").selectedIndex = 1;
|
||||
}
|
||||
#endif
|
||||
};
|
||||
|
|
|
@ -189,14 +189,17 @@
|
|||
<caption label="&systemDefaults.label;"/>
|
||||
|
||||
#ifdef HAVE_SHELL_SERVICE
|
||||
<hbox id="checkDefaultBox" align="center" flex="1">
|
||||
<checkbox id="alwaysCheckDefault" preference="browser.shell.checkDefaultBrowser"
|
||||
label="&alwaysCheckDefault.label;" accesskey="&alwaysCheckDefault.accesskey;"
|
||||
flex="1"/>
|
||||
<button id="checkDefaultButton"
|
||||
label="&checkNow.label;" accesskey="&checkNow.accesskey;"
|
||||
oncommand="gAdvancedPane.checkNow()"
|
||||
preference="pref.general.disable_button.default_browser"/>
|
||||
<checkbox id="alwaysCheckDefault" preference="browser.shell.checkDefaultBrowser"
|
||||
label="&alwaysCheckDefault.label;" accesskey="&alwaysCheckDefault.accesskey;"
|
||||
flex="1"/>
|
||||
<hbox class="indent">
|
||||
<deck id="setDefaultPane">
|
||||
<button id="setDefaultButton"
|
||||
label="&setDefault.label;" accesskey="&setDefault.accesskey;"
|
||||
oncommand="gAdvancedPane.setDefaultBrowser();"
|
||||
preference="pref.general.disable_button.default_browser"/>
|
||||
<description>&isDefault.label;</description>
|
||||
</deck>
|
||||
</hbox>
|
||||
#ifdef MOZ_CRASHREPORTER
|
||||
<checkbox id="submitCrashesBox" flex="1"
|
||||
|
|
|
@ -65,7 +65,7 @@ let gSyncPane = {
|
|||
this.needsUpdate();
|
||||
} else {
|
||||
this.page = PAGE_HAS_ACCOUNT;
|
||||
document.getElementById("accountName").value = Weave.Service.account;
|
||||
document.getElementById("accountName").value = Weave.Identity.account;
|
||||
document.getElementById("syncComputerName").value = Weave.Clients.localName;
|
||||
document.getElementById("tosPP").hidden = this._usingCustomServer;
|
||||
}
|
||||
|
|
|
@ -95,6 +95,7 @@ function PrivateBrowsingService() {
|
|||
this._obs.addObserver(this, "private-browsing", true);
|
||||
this._obs.addObserver(this, "command-line-startup", true);
|
||||
this._obs.addObserver(this, "sessionstore-browser-state-restored", true);
|
||||
this._obs.addObserver(this, "domwindowopened", true);
|
||||
|
||||
// List of nsIXULWindows we are going to be closing during the transition
|
||||
this._windowsToClose = [];
|
||||
|
@ -152,6 +153,17 @@ PrivateBrowsingService.prototype = {
|
|||
this.privateBrowsingEnabled = false;
|
||||
},
|
||||
|
||||
_setPerWindowPBFlag: function PBS__setPerWindowPBFlag(aWindow, aFlag) {
|
||||
aWindow.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Ci.nsIWebNavigation)
|
||||
.QueryInterface(Ci.nsIDocShellTreeItem)
|
||||
.treeOwner
|
||||
.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Ci.nsIXULWindow)
|
||||
.docShell.QueryInterface(Ci.nsILoadContext)
|
||||
.usePrivateBrowsing = aFlag;
|
||||
},
|
||||
|
||||
_onBeforePrivateBrowsingModeChange: function PBS__onBeforePrivateBrowsingModeChange() {
|
||||
// nothing needs to be done here if we're enabling at startup
|
||||
if (!this._autoStarted) {
|
||||
|
@ -222,23 +234,15 @@ PrivateBrowsingService.prototype = {
|
|||
.docShell.contentViewer.resetCloseWindow();
|
||||
}
|
||||
}
|
||||
|
||||
if (!this._quitting) {
|
||||
var windowsEnum = Services.wm.getEnumerator("navigator:browser");
|
||||
while (windowsEnum.hasMoreElements()) {
|
||||
var window = windowsEnum.getNext();
|
||||
window.getInterface(Ci.nsIWebNavigation)
|
||||
.QueryInterface(Ci.nsIDocShellTreeItem)
|
||||
.treeOwner
|
||||
.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Ci.nsIXULWindow)
|
||||
.docShell.QueryInterface(Ci.nsILoadContext)
|
||||
.usePrivateBrowsing = this._inPrivateBrowsing;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
this._saveSession = false;
|
||||
|
||||
var windowsEnum = Services.wm.getEnumerator("navigator:browser");
|
||||
while (windowsEnum.hasMoreElements()) {
|
||||
var window = windowsEnum.getNext();
|
||||
this._setPerWindowPBFlag(window, this._inPrivateBrowsing);
|
||||
}
|
||||
},
|
||||
|
||||
_onAfterPrivateBrowsingModeChange: function PBS__onAfterPrivateBrowsingModeChange() {
|
||||
|
@ -523,6 +527,18 @@ PrivateBrowsingService.prototype = {
|
|||
this._notifyIfTransitionComplete();
|
||||
}
|
||||
break;
|
||||
case "domwindowopened":
|
||||
let aWindow = aSubject;
|
||||
let self = this;
|
||||
aWindow.addEventListener("load", function PBS__onWindowLoad(aEvent) {
|
||||
aWindow.removeEventListener("load", arguments.callee);
|
||||
if (aWindow.document
|
||||
.documentElement
|
||||
.getAttribute("windowtype") == "navigator:browser") {
|
||||
self._setPerWindowPBFlag(aWindow, self._inPrivateBrowsing);
|
||||
}
|
||||
}, false);
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
|
||||
function test() {
|
||||
// initialization
|
||||
waitForExplicitFinish();
|
||||
gPrefService.setBoolPref("browser.privatebrowsing.keep_current_session", true);
|
||||
let pb = Cc["@mozilla.org/privatebrowsing;1"].
|
||||
getService(Ci.nsIPrivateBrowsingService);
|
||||
|
@ -54,6 +55,27 @@ function test() {
|
|||
gBrowser.selectedTab = gBrowser.addTab();
|
||||
let originalTitle = document.title;
|
||||
|
||||
function testNewWindow(aCallback, expected) {
|
||||
Services.obs.addObserver(function observer1(aSubject, aTopic, aData) {
|
||||
aSubject.addEventListener("load", function() {
|
||||
aSubject.removeEventListener("load", arguments.callee);
|
||||
executeSoon(function() {
|
||||
let ui = aSubject.gPrivateBrowsingUI;
|
||||
is(ui.privateBrowsingEnabled, expected, "The privateBrowsingEnabled property on the new window is set correctly");
|
||||
is(ui.privateWindow, expected, "The privateWindow property on the new window is set correctly");
|
||||
|
||||
Services.obs.addObserver(function observer2(aSubject, aTopic, aData) {
|
||||
aCallback();
|
||||
Services.obs.removeObserver(observer2, "domwindowclosed");
|
||||
}, "domwindowclosed", false);
|
||||
aSubject.close();
|
||||
});
|
||||
Services.obs.removeObserver(observer1, "domwindowopened");
|
||||
}, false);
|
||||
}, "domwindowopened", false);
|
||||
OpenBrowserWindow();
|
||||
}
|
||||
|
||||
// test the gPrivateBrowsingUI object
|
||||
ok(gPrivateBrowsingUI, "The gPrivateBrowsingUI object exists");
|
||||
is(pb.privateBrowsingEnabled, false, "The private browsing mode should not be started initially");
|
||||
|
@ -61,45 +83,53 @@ function test() {
|
|||
is(gPrivateBrowsingUI.privateWindow, false, "gPrivateBrowsingUI should expose the correct per-window private browsing status");
|
||||
ok(pbMenuItem, "The Private Browsing menu item exists");
|
||||
is(pbMenuItem.getAttribute("label"), pbMenuItem.getAttribute("startlabel"), "The Private Browsing menu item should read \"Start Private Browsing\"");
|
||||
gPrivateBrowsingUI.toggleMode();
|
||||
is(pb.privateBrowsingEnabled, true, "The private browsing mode should be started");
|
||||
is(gPrivateBrowsingUI.privateBrowsingEnabled, true, "gPrivateBrowsingUI should expose the correct private browsing status");
|
||||
is(gPrivateBrowsingUI.privateWindow, true, "gPrivateBrowsingUI should expose the correct per-window private browsing status");
|
||||
// check to see if the Private Browsing mode was activated successfully
|
||||
is(observerData, "enter", "Private Browsing mode was activated using the gPrivateBrowsingUI object");
|
||||
is(pbMenuItem.getAttribute("label"), pbMenuItem.getAttribute("stoplabel"), "The Private Browsing menu item should read \"Stop Private Browsing\"");
|
||||
gPrivateBrowsingUI.toggleMode()
|
||||
is(pb.privateBrowsingEnabled, false, "The private browsing mode should not be started");
|
||||
is(gPrivateBrowsingUI.privateBrowsingEnabled, false, "gPrivateBrowsingUI should expose the correct private browsing status");
|
||||
is(gPrivateBrowsingUI.privateWindow, false, "gPrivateBrowsingUI should expose the correct per-window private browsing status");
|
||||
// check to see if the Private Browsing mode was deactivated successfully
|
||||
is(observerData, "exit", "Private Browsing mode was deactivated using the gPrivateBrowsingUI object");
|
||||
is(pbMenuItem.getAttribute("label"), pbMenuItem.getAttribute("startlabel"), "The Private Browsing menu item should read \"Start Private Browsing\"");
|
||||
testNewWindow(function() {
|
||||
gPrivateBrowsingUI.toggleMode();
|
||||
is(pb.privateBrowsingEnabled, true, "The private browsing mode should be started");
|
||||
is(gPrivateBrowsingUI.privateBrowsingEnabled, true, "gPrivateBrowsingUI should expose the correct private browsing status");
|
||||
is(gPrivateBrowsingUI.privateWindow, true, "gPrivateBrowsingUI should expose the correct per-window private browsing status");
|
||||
// check to see if the Private Browsing mode was activated successfully
|
||||
is(observerData, "enter", "Private Browsing mode was activated using the gPrivateBrowsingUI object");
|
||||
is(pbMenuItem.getAttribute("label"), pbMenuItem.getAttribute("stoplabel"), "The Private Browsing menu item should read \"Stop Private Browsing\"");
|
||||
testNewWindow(function() {
|
||||
gPrivateBrowsingUI.toggleMode()
|
||||
is(pb.privateBrowsingEnabled, false, "The private browsing mode should not be started");
|
||||
is(gPrivateBrowsingUI.privateBrowsingEnabled, false, "gPrivateBrowsingUI should expose the correct private browsing status");
|
||||
is(gPrivateBrowsingUI.privateWindow, false, "gPrivateBrowsingUI should expose the correct per-window private browsing status");
|
||||
// check to see if the Private Browsing mode was deactivated successfully
|
||||
is(observerData, "exit", "Private Browsing mode was deactivated using the gPrivateBrowsingUI object");
|
||||
is(pbMenuItem.getAttribute("label"), pbMenuItem.getAttribute("startlabel"), "The Private Browsing menu item should read \"Start Private Browsing\"");
|
||||
|
||||
// These are tests for the privateWindow setter. Note that the setter should
|
||||
// not be used anywhere else for now!
|
||||
gPrivateBrowsingUI.privateWindow = true;
|
||||
is(gPrivateBrowsingUI.privateWindow, true, "gPrivateBrowsingUI should accept the correct per-window private browsing status");
|
||||
gPrivateBrowsingUI.privateWindow = false;
|
||||
is(gPrivateBrowsingUI.privateWindow, false, "gPrivateBrowsingUI should accept the correct per-window private browsing status");
|
||||
testNewWindow(function() {
|
||||
// These are tests for the privateWindow setter. Note that the setter should
|
||||
// not be used anywhere else for now!
|
||||
gPrivateBrowsingUI.privateWindow = true;
|
||||
is(gPrivateBrowsingUI.privateWindow, true, "gPrivateBrowsingUI should accept the correct per-window private browsing status");
|
||||
gPrivateBrowsingUI.privateWindow = false;
|
||||
is(gPrivateBrowsingUI.privateWindow, false, "gPrivateBrowsingUI should accept the correct per-window private browsing status");
|
||||
|
||||
// now, test using the <command> object
|
||||
let cmd = document.getElementById("Tools:PrivateBrowsing");
|
||||
isnot(cmd, null, "XUL command object for the private browsing service exists");
|
||||
var func = new Function("", cmd.getAttribute("oncommand"));
|
||||
func.call(cmd);
|
||||
// check to see if the Private Browsing mode was activated successfully
|
||||
is(observerData, "enter", "Private Browsing mode was activated using the command object");
|
||||
// check to see that the window title has been changed correctly
|
||||
isnot(document.title, originalTitle, "Private browsing mode has correctly changed the title");
|
||||
func.call(cmd);
|
||||
// check to see if the Private Browsing mode was deactivated successfully
|
||||
is(observerData, "exit", "Private Browsing mode was deactivated using the command object");
|
||||
// check to see that the window title has been restored correctly
|
||||
is(document.title, originalTitle, "Private browsing mode has correctly restored the title");
|
||||
// now, test using the <command> object
|
||||
let cmd = document.getElementById("Tools:PrivateBrowsing");
|
||||
isnot(cmd, null, "XUL command object for the private browsing service exists");
|
||||
var func = new Function("", cmd.getAttribute("oncommand"));
|
||||
func.call(cmd);
|
||||
// check to see if the Private Browsing mode was activated successfully
|
||||
is(observerData, "enter", "Private Browsing mode was activated using the command object");
|
||||
// check to see that the window title has been changed correctly
|
||||
isnot(document.title, originalTitle, "Private browsing mode has correctly changed the title");
|
||||
func.call(cmd);
|
||||
// check to see if the Private Browsing mode was deactivated successfully
|
||||
is(observerData, "exit", "Private Browsing mode was deactivated using the command object");
|
||||
// check to see that the window title has been restored correctly
|
||||
is(document.title, originalTitle, "Private browsing mode has correctly restored the title");
|
||||
|
||||
// cleanup
|
||||
gBrowser.removeCurrentTab();
|
||||
Services.obs.removeObserver(observer, "private-browsing");
|
||||
gPrefService.clearUserPref("browser.privatebrowsing.keep_current_session");
|
||||
// cleanup
|
||||
gBrowser.removeCurrentTab();
|
||||
Services.obs.removeObserver(observer, "private-browsing");
|
||||
gPrefService.clearUserPref("browser.privatebrowsing.keep_current_session");
|
||||
|
||||
finish();
|
||||
}, false);
|
||||
}, true);
|
||||
}, false);
|
||||
}
|
||||
|
|
|
@ -24,3 +24,9 @@ fi
|
|||
|
||||
# Package js shell.
|
||||
export MOZ_PACKAGE_JSSHELL=1
|
||||
|
||||
# For known full-clobber builds on Windows (like nightlies/try),
|
||||
# this speeds things up. IS_NIGHTLY is set by the build automation.
|
||||
if test "$IS_NIGHTLY" != ""; then
|
||||
ac_add_options --disable-auto-deps
|
||||
fi
|
||||
|
|
|
@ -22,4 +22,10 @@ mk_add_options MOZ_MAKE_FLAGS=-j1
|
|||
# Package js shell.
|
||||
export MOZ_PACKAGE_JSSHELL=1
|
||||
|
||||
# For known full-clobber builds on Windows (like nightlies/try),
|
||||
# this speeds things up. IS_NIGHTLY is set by the build automation.
|
||||
if test "$IS_NIGHTLY" != ""; then
|
||||
ac_add_options --disable-auto-deps
|
||||
fi
|
||||
|
||||
. $topsrcdir/build/win64/mozconfig.vs2010
|
||||
|
|
|
@ -76,17 +76,18 @@ function testFrameParameters()
|
|||
is(localNodes[6].querySelector(".info").textContent, "undefined",
|
||||
"Should have the right property value for 'fArg'.");
|
||||
|
||||
is(localNodes[7].querySelector(".info").textContent, "1",
|
||||
"Should have the right property value for 'a'.");
|
||||
// FIXME bug TODO: reenable
|
||||
//is(localNodes[7].querySelector(".info").textContent, "1",
|
||||
// "Should have the right property value for 'a'.");
|
||||
|
||||
is(localNodes[8].querySelector(".info").textContent, "[object Object]",
|
||||
"Should have the right property value for 'b'.");
|
||||
//is(localNodes[8].querySelector(".info").textContent, "[object Object]",
|
||||
// "Should have the right property value for 'b'.");
|
||||
|
||||
is(localNodes[9].querySelector(".info").textContent, "[object Object]",
|
||||
"Should have the right property value for 'c'.");
|
||||
//is(localNodes[9].querySelector(".info").textContent, "[object Object]",
|
||||
// "Should have the right property value for 'c'.");
|
||||
|
||||
is(localNodes[10].querySelector(".info").textContent, "[object Arguments]",
|
||||
"Should have the right property value for 'arguments'.");
|
||||
//is(localNodes[10].querySelector(".info").textContent, "[object Arguments]",
|
||||
// "Should have the right property value for 'arguments'.");
|
||||
|
||||
resumeAndFinish();
|
||||
}}, 0);
|
||||
|
|
|
@ -96,17 +96,17 @@ function testFrameParameters()
|
|||
.textContent, 1,
|
||||
"Should have the right value for 'c.a'.");
|
||||
|
||||
is(localNodes[10].querySelector(".info").textContent,
|
||||
"[object Arguments]",
|
||||
"Should have the right property value for 'arguments'.");
|
||||
//is(localNodes[10].querySelector(".info").textContent,
|
||||
// "[object Arguments]",
|
||||
// "Should have the right property value for 'arguments'.");
|
||||
|
||||
is(localNodes[10].querySelector(".property > .title > .key")
|
||||
.textContent, "length",
|
||||
"Should have the right property name for 'length'.");
|
||||
//is(localNodes[10].querySelector(".property > .title > .key")
|
||||
// .textContent, "length",
|
||||
// "Should have the right property name for 'length'.");
|
||||
|
||||
is(localNodes[10].querySelector(".property > .title > .value")
|
||||
.textContent, 5,
|
||||
"Should have the right argument length.");
|
||||
//is(localNodes[10].querySelector(".property > .title > .value")
|
||||
// .textContent, 5,
|
||||
// "Should have the right argument length.");
|
||||
|
||||
resumeAndFinish();
|
||||
}, 100);
|
||||
|
|
|
@ -11275,7 +11275,7 @@ define("examples/textview/textStyler", ['orion/textview/annotations'], function(
|
|||
"target", "target-name", "target-new", "target-position", "text-align", "text-align-last", "text-decoration", "text-emphasis",
|
||||
"text-height", "text-indent", "text-justify", "text-outline", "text-shadow", "text-transform", "text-wrap", "top", "transform",
|
||||
"transform-origin", "transform-style", "transition", "transition-delay", "transition-duration", "transition-property",
|
||||
"transition-timing-function", "unicode-bidi", "vertical-align", "visibility", "voice-balance", "voice-duration", "voice-family",
|
||||
"transition-timing-function", "unicode-bidi", "vector-effect", "vertical-align", "visibility", "voice-balance", "voice-duration", "voice-family",
|
||||
"voice-pitch", "voice-pitch-range", "voice-rate", "voice-stress", "voice-volume", "volume", "white-space", "white-space-collapse",
|
||||
"widows", "width", "word-break", "word-spacing", "word-wrap", "z-index"
|
||||
];
|
||||
|
|
|
@ -25,8 +25,9 @@
|
|||
<!ENTITY systemDefaults.label "System Defaults">
|
||||
<!ENTITY alwaysCheckDefault.label "Always check to see if &brandShortName; is the default browser on startup"><!--XXX-->
|
||||
<!ENTITY alwaysCheckDefault.accesskey "w">
|
||||
<!ENTITY checkNow.label "Check Now">
|
||||
<!ENTITY checkNow.accesskey "N">
|
||||
<!ENTITY setDefault.label "Make &brandShortName; the default browser">
|
||||
<!ENTITY setDefault.accesskey "d">
|
||||
<!ENTITY isDefault.label "&brandShortName; is currently your default browser">
|
||||
<!ENTITY submitCrashes.label "Submit crash reports">
|
||||
<!ENTITY submitCrashes.accesskey "S">
|
||||
<!ENTITY submitTelemetry.label "Submit performance data">
|
||||
|
|
|
@ -120,7 +120,7 @@ sub check_getTopDir
|
|||
## as the makemakefile.pm module.
|
||||
ok($path ? 1 : 0, 1, "getTopDir failed");
|
||||
ok(-d $path ? 1 : 0, 1, "getTopDir: directory $path does not exist");
|
||||
ok($FindBin::RealBin =~ m%$path/% ? 1 : 0, 1, 'Invalid topdir path');
|
||||
ok($FindBin::RealBin =~ m%\Q$path/% ? 1 : 0, 1, 'Invalid topdir path');
|
||||
ok(-e "$path/client.mk" ? 1 : 0, 1, "client.mk not found in $path");
|
||||
} # check_getTopDir
|
||||
|
||||
|
|
|
@ -459,7 +459,7 @@ class ShutdownLeakLogger(object):
|
|||
DOM windows (that are still around after test suite shutdown, despite running
|
||||
the GC) to the tests that created them and prints leak statistics.
|
||||
"""
|
||||
MAX_LEAK_COUNT = 10
|
||||
MAX_LEAK_COUNT = 7
|
||||
|
||||
def __init__(self, logger):
|
||||
self.logger = logger
|
||||
|
|
|
@ -45,7 +45,7 @@ include $(DEPTH)/config/autoconf.mk
|
|||
|
||||
MODULE = robocop
|
||||
|
||||
ROBOTIUM_PATH = $(srcdir)/robotium-solo-3.1.jar
|
||||
ROBOTIUM_PATH = $(srcdir)/robotium-solo-3.2.1.jar
|
||||
|
||||
JAVAFILES = \
|
||||
R.java \
|
||||
|
|
|
@ -4,6 +4,6 @@ Robotium is an open source tool licensed under the Apache 2.0 license and the or
|
|||
source can be found here:
|
||||
http://code.google.com/p/robotium/
|
||||
|
||||
We are including robotium-solo-3.1.jar as a binary and are not modifying it in anyway
|
||||
We are including robotium-solo-3.2.1.jar as a binary and are not modifying it in anyway
|
||||
from the original download found at:
|
||||
http://code.google.com/p/robotium/
|
||||
|
|
Двоичные данные
build/mobile/robocop/robotium-solo-3.1.jar
Двоичные данные
build/mobile/robocop/robotium-solo-3.1.jar
Двоичный файл не отображается.
Двоичный файл не отображается.
|
@ -48,7 +48,8 @@ def patch(patch, plevel, srcdir):
|
|||
|
||||
def build_package(package_source_dir, package_build_dir, configure_args,
|
||||
make = old_make):
|
||||
os.mkdir(package_build_dir)
|
||||
if not os.path.exists(package_build_dir):
|
||||
os.mkdir(package_build_dir)
|
||||
run_in(package_build_dir,
|
||||
["%s/configure" % package_source_dir] + configure_args)
|
||||
run_in(package_build_dir, [make, "-j8"])
|
||||
|
@ -161,6 +162,12 @@ def build_one_stage_aux(stage_dir, is_stage_one):
|
|||
|
||||
build_linux_headers(tool_inst_dir)
|
||||
|
||||
# zlib's configure only works if run from the source dir, copy the source
|
||||
zlib_build_dir = stage_dir + '/zlib'
|
||||
shutil.copytree(zlib_source_dir, zlib_build_dir)
|
||||
build_package(zlib_build_dir, zlib_build_dir,
|
||||
["--prefix=%s" % tool_inst_dir])
|
||||
|
||||
binutils_build_dir = stage_dir + '/binutils'
|
||||
build_package(binutils_source_dir, binutils_build_dir,
|
||||
["--prefix=%s" % tool_inst_dir,
|
||||
|
@ -197,6 +204,7 @@ gawk_version = "3.1.5"
|
|||
make_version = "3.81"
|
||||
gcc_version = "4.5.2"
|
||||
mpfr_version = "2.4.2"
|
||||
zlib_version = "1.2.3"
|
||||
gmp_version = "5.0.1"
|
||||
mpc_version = "0.8.1"
|
||||
unifdef_version = "2.6"
|
||||
|
@ -219,6 +227,7 @@ gcc_source_uri = "http://ftp.gnu.org/gnu/gcc/gcc-%s/gcc-%s.tar.bz2" % \
|
|||
(gcc_version, gcc_version)
|
||||
mpfr_source_uri = "http://www.mpfr.org/mpfr-%s/mpfr-%s.tar.bz2" % \
|
||||
(mpfr_version, mpfr_version)
|
||||
zlib_source_uri = "http://iweb.dl.sourceforge.net/project/libpng/zlib/%s/zlib-%s.tar.bz2" % (zlib_version, zlib_version)
|
||||
gmp_source_uri = "http://ftp.gnu.org/gnu/gmp/gmp-%s.tar.bz2" % gmp_version
|
||||
mpc_source_uri = "http://www.multiprecision.org/mpc/download/mpc-%s.tar.gz" % \
|
||||
mpc_version
|
||||
|
@ -232,6 +241,7 @@ make_source_tar = download_uri(make_source_uri)
|
|||
unifdef_source_tar = download_uri(unifdef_source_uri)
|
||||
mpc_source_tar = download_uri(mpc_source_uri)
|
||||
mpfr_source_tar = download_uri(mpfr_source_uri)
|
||||
zlib_source_tar = download_uri(zlib_source_uri)
|
||||
gmp_source_tar = download_uri(gmp_source_uri)
|
||||
gcc_source_tar = download_uri(gcc_source_uri)
|
||||
|
||||
|
@ -244,6 +254,7 @@ make_source_dir = build_source_dir('make-', make_version)
|
|||
unifdef_source_dir = build_source_dir('unifdef-', unifdef_version)
|
||||
mpc_source_dir = build_source_dir('mpc-', mpc_version)
|
||||
mpfr_source_dir = build_source_dir('mpfr-', mpfr_version)
|
||||
zlib_source_dir = build_source_dir('zlib-', zlib_version)
|
||||
gmp_source_dir = build_source_dir('gmp-', gmp_version)
|
||||
gcc_source_dir = build_source_dir('gcc-', gcc_version)
|
||||
|
||||
|
@ -261,6 +272,7 @@ if not os.path.exists(source_dir):
|
|||
extract(unifdef_source_tar, source_dir)
|
||||
extract(mpc_source_tar, source_dir)
|
||||
extract(mpfr_source_tar, source_dir)
|
||||
extract(zlib_source_tar, source_dir)
|
||||
extract(gmp_source_tar, source_dir)
|
||||
extract(gcc_source_tar, source_dir)
|
||||
patch('plugin_finish_decl.diff', 0, gcc_source_dir)
|
||||
|
@ -284,21 +296,16 @@ build_one_stage({"PATH" : basic_path,
|
|||
"CXX" : "g++" },
|
||||
stage1_dir, True)
|
||||
|
||||
stage1_tool_inst_dir = stage1_dir + '/inst'
|
||||
stage2_dir = build_dir + '/stage2'
|
||||
build_one_stage({"PATH" : stage1_tool_inst_dir + "/bin:" + basic_path,
|
||||
"CC" : "gcc -fgnu89-inline",
|
||||
"CXX" : "g++",
|
||||
"RANLIB" : "true" },
|
||||
stage2_dir, False)
|
||||
for stage_num in range(2, 4):
|
||||
prev_stage_dir = build_dir + '/stage' + str(stage_num - 1)
|
||||
prev_stage_inst_dir = prev_stage_dir + '/inst'
|
||||
cur_stage_dir = build_dir + '/stage' + str(stage_num)
|
||||
build_one_stage({"PATH" : prev_stage_inst_dir + "/bin:" + basic_path,
|
||||
"CC" : "gcc -fgnu89-inline",
|
||||
"CXX" : "g++",
|
||||
"RANLIB" : "true" },
|
||||
cur_stage_dir, False)
|
||||
|
||||
stage2_tool_inst_dir = stage2_dir + '/inst'
|
||||
stage3_dir = build_dir + '/stage3'
|
||||
build_one_stage({"PATH" : stage2_tool_inst_dir + "/bin:" + basic_path,
|
||||
"CC" : "gcc -fgnu89-inline",
|
||||
"CXX" : "g++",
|
||||
"RANLIB" : "true" },
|
||||
stage3_dir, False)
|
||||
|
||||
build_tar_package(aux_inst_dir + "/bin/tar",
|
||||
"toolchain.tar", stage3_dir, "inst")
|
||||
|
|
|
@ -426,8 +426,8 @@ private:
|
|||
virtual ~nsScriptSecurityManager();
|
||||
|
||||
static JSBool
|
||||
CheckObjectAccess(JSContext *cx, JSObject *obj,
|
||||
jsid id, JSAccessMode mode,
|
||||
CheckObjectAccess(JSContext *cx, JSHandleObject obj,
|
||||
JSHandleId id, JSAccessMode mode,
|
||||
jsval *vp);
|
||||
|
||||
static JSPrincipals *
|
||||
|
|
|
@ -44,6 +44,7 @@
|
|||
#include "mozilla/Util.h"
|
||||
|
||||
#include "xpcprivate.h"
|
||||
#include "XPCWrapper.h"
|
||||
#include "nsScriptSecurityManager.h"
|
||||
#include "nsIServiceManager.h"
|
||||
#include "nsIScriptObjectPrincipal.h"
|
||||
|
@ -630,8 +631,8 @@ nsScriptSecurityManager::ContentSecurityPolicyPermitsJSAction(JSContext *cx)
|
|||
|
||||
|
||||
JSBool
|
||||
nsScriptSecurityManager::CheckObjectAccess(JSContext *cx, JSObject *obj,
|
||||
jsid id, JSAccessMode mode,
|
||||
nsScriptSecurityManager::CheckObjectAccess(JSContext *cx, JSHandleObject obj,
|
||||
JSHandleId id, JSAccessMode mode,
|
||||
jsval *vp)
|
||||
{
|
||||
// Get the security manager
|
||||
|
|
|
@ -175,8 +175,7 @@ nsChromeRegistry::GetService()
|
|||
nsresult
|
||||
nsChromeRegistry::Init()
|
||||
{
|
||||
if (!mOverrideTable.Init())
|
||||
return NS_ERROR_FAILURE;
|
||||
mOverrideTable.Init();
|
||||
|
||||
// This initialization process is fairly complicated and may cause reentrant
|
||||
// getservice calls to resolve chrome URIs (especially locale files). We
|
||||
|
|
|
@ -155,9 +155,8 @@ nsChromeRegistryChrome::Init()
|
|||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
|
||||
if (!mOverlayHash.Init() ||
|
||||
!mStyleHash.Init())
|
||||
return NS_ERROR_FAILURE;
|
||||
mOverlayHash.Init();
|
||||
mStyleHash.Init();
|
||||
|
||||
mSelectedLocale = NS_LITERAL_CSTRING("en-US");
|
||||
mSelectedSkin = NS_LITERAL_CSTRING("classic/1.0");
|
||||
|
|
|
@ -171,7 +171,7 @@ class nsChromeRegistryChrome : public nsChromeRegistry
|
|||
OverlayListHash() { }
|
||||
~OverlayListHash() { }
|
||||
|
||||
bool Init() { return mTable.Init(); }
|
||||
void Init() { mTable.Init(); }
|
||||
void Add(nsIURI* aBase, nsIURI* aOverlay);
|
||||
void Clear() { mTable.Clear(); }
|
||||
const nsCOMArray<nsIURI>* GetArray(nsIURI* aBase);
|
||||
|
|
|
@ -117,9 +117,7 @@ nsChromeRegistryContent::RegisterPackage(const ChromePackage& aPackage)
|
|||
entry->localeBaseURI = locale;
|
||||
entry->skinBaseURI = skin;
|
||||
|
||||
nsresult rv = mPackagesHash.Put(aPackage.package, entry);
|
||||
if (NS_FAILED(rv))
|
||||
return;
|
||||
mPackagesHash.Put(aPackage.package, entry);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -125,7 +125,7 @@ class ExpandArgsMore(ExpandArgs):
|
|||
if not len(objs): return
|
||||
fd, tmp = tempfile.mkstemp(suffix=".list",dir=os.curdir)
|
||||
if conf.EXPAND_LIBS_LIST_STYLE == "linkerscript":
|
||||
content = ["INPUT(%s)\n" % obj for obj in objs]
|
||||
content = ['INPUT("%s")\n' % obj for obj in objs]
|
||||
ref = tmp
|
||||
elif conf.EXPAND_LIBS_LIST_STYLE == "list":
|
||||
content = ["%s\n" % obj for obj in objs]
|
||||
|
|
|
@ -237,7 +237,7 @@ class TestExpandArgsMore(TestExpandInit):
|
|||
if config.EXPAND_LIBS_LIST_STYLE == "linkerscript":
|
||||
self.assertNotEqual(args[3][0], '@')
|
||||
filename = args[3]
|
||||
content = ["INPUT(%s)" % relativize(f) for f in objs]
|
||||
content = ['INPUT("%s")' % relativize(f) for f in objs]
|
||||
with open(filename, 'r') as f:
|
||||
self.assertEqual([l.strip() for l in f.readlines() if len(l.strip())], content)
|
||||
elif config.EXPAND_LIBS_LIST_STYLE == "list":
|
||||
|
|
|
@ -50,7 +50,7 @@ interface nsINode;
|
|||
* @version 1.0
|
||||
*/
|
||||
|
||||
[scriptable, uuid(5ac0cd5d-3c08-4c4c-8e70-230c433f5d5c)]
|
||||
[scriptable, uuid(dd40d5b8-1fe1-487f-b66e-28f4b837024f)]
|
||||
interface nsISelection : nsISupports
|
||||
{
|
||||
/**
|
||||
|
@ -77,6 +77,7 @@ interface nsISelection : nsISupports
|
|||
* Indicates if the selection is collapsed or not.
|
||||
*/
|
||||
readonly attribute boolean isCollapsed;
|
||||
[noscript,notxpcom,nostdcall] boolean collapsed();
|
||||
|
||||
/**
|
||||
* Returns the number of ranges in the selection.
|
||||
|
@ -106,6 +107,7 @@ interface nsISelection : nsISupports
|
|||
* @param offset Where in node to place the offset in the new selection end
|
||||
*/
|
||||
void extend(in nsIDOMNode parentNode, in long offset);
|
||||
[noscript] void extendNative(in nsINode parentNode, in long offset);
|
||||
|
||||
/**
|
||||
* Collapses the whole selection to a single point at the start
|
||||
|
|
|
@ -66,7 +66,7 @@ struct ScrollAxis;
|
|||
native nsDirection(nsDirection);
|
||||
native ScrollAxis(nsIPresShell::ScrollAxis);
|
||||
|
||||
[scriptable, uuid(0ced91b9-3e77-4191-943f-95bcde5e2d14)]
|
||||
[scriptable, uuid(719a803f-aa1e-436c-8919-c42908f00599)]
|
||||
interface nsISelectionPrivate : nsISelection
|
||||
{
|
||||
const short ENDOFPRECEDINGLINE=0;
|
||||
|
|
|
@ -548,30 +548,14 @@ nsContentUtils::InitializeEventTable() {
|
|||
sAtomEventTable = new nsDataHashtable<nsISupportsHashKey, EventNameMapping>;
|
||||
sStringEventTable = new nsDataHashtable<nsStringHashKey, EventNameMapping>;
|
||||
sUserDefinedEvents = new nsCOMArray<nsIAtom>(64);
|
||||
|
||||
if (!sAtomEventTable || !sStringEventTable || !sUserDefinedEvents ||
|
||||
!sAtomEventTable->Init(int(ArrayLength(eventArray) / 0.75) + 1) ||
|
||||
!sStringEventTable->Init(int(ArrayLength(eventArray) / 0.75) + 1)) {
|
||||
delete sAtomEventTable;
|
||||
sAtomEventTable = nsnull;
|
||||
delete sStringEventTable;
|
||||
sStringEventTable = nsnull;
|
||||
delete sUserDefinedEvents;
|
||||
sUserDefinedEvents = nsnull;
|
||||
return false;
|
||||
}
|
||||
sAtomEventTable->Init(int(ArrayLength(eventArray) / 0.75) + 1);
|
||||
sStringEventTable->Init(int(ArrayLength(eventArray) / 0.75) + 1);
|
||||
|
||||
// Subtract one from the length because of the trailing null
|
||||
for (PRUint32 i = 0; i < ArrayLength(eventArray) - 1; ++i) {
|
||||
if (!sAtomEventTable->Put(eventArray[i].mAtom, eventArray[i]) ||
|
||||
!sStringEventTable->Put(Substring(nsDependentAtomString(eventArray[i].mAtom), 2),
|
||||
eventArray[i])) {
|
||||
delete sAtomEventTable;
|
||||
sAtomEventTable = nsnull;
|
||||
delete sStringEventTable;
|
||||
sStringEventTable = nsnull;
|
||||
return false;
|
||||
}
|
||||
sAtomEventTable->Put(eventArray[i].mAtom, eventArray[i]);
|
||||
sStringEventTable->Put(Substring(nsDependentAtomString(eventArray[i].mAtom), 2),
|
||||
eventArray[i]);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -594,15 +578,9 @@ nsContentUtils::InitializeTouchEventTable()
|
|||
};
|
||||
// Subtract one from the length because of the trailing null
|
||||
for (PRUint32 i = 0; i < ArrayLength(touchEventArray) - 1; ++i) {
|
||||
if (!sAtomEventTable->Put(touchEventArray[i].mAtom, touchEventArray[i]) ||
|
||||
!sStringEventTable->Put(Substring(nsDependentAtomString(touchEventArray[i].mAtom), 2),
|
||||
touchEventArray[i])) {
|
||||
delete sAtomEventTable;
|
||||
sAtomEventTable = nsnull;
|
||||
delete sStringEventTable;
|
||||
sStringEventTable = nsnull;
|
||||
return;
|
||||
}
|
||||
sAtomEventTable->Put(touchEventArray[i].mAtom, touchEventArray[i]);
|
||||
sStringEventTable->Put(Substring(nsDependentAtomString(touchEventArray[i].mAtom), 2),
|
||||
touchEventArray[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -6415,6 +6393,21 @@ nsContentUtils::FindInternalContentViewer(const char* aType,
|
|||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef MOZ_GSTREAMER
|
||||
if (nsHTMLMediaElement::IsH264Enabled()) {
|
||||
for (unsigned int i = 0; i < ArrayLength(nsHTMLMediaElement::gH264Types); ++i) {
|
||||
const char* type = nsHTMLMediaElement::gH264Types[i];
|
||||
if (!strcmp(aType, type)) {
|
||||
docFactory = do_GetService("@mozilla.org/content/document-loader-factory;1");
|
||||
if (docFactory && aLoaderType) {
|
||||
*aLoaderType = TYPE_CONTENT;
|
||||
}
|
||||
return docFactory.forget();
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif // MOZ_MEDIA
|
||||
|
||||
return NULL;
|
||||
|
|
|
@ -113,7 +113,8 @@ public:
|
|||
|
||||
bool Initialize()
|
||||
{
|
||||
return mTable.Init();
|
||||
mTable.Init();
|
||||
return true;
|
||||
}
|
||||
|
||||
CacheEntry* GetEntry(nsIURI* aURI, nsIPrincipal* aPrincipal,
|
||||
|
@ -260,14 +261,7 @@ nsPreflightCache::GetEntry(nsIURI* aURI,
|
|||
}
|
||||
}
|
||||
|
||||
if (!mTable.Put(key, entry)) {
|
||||
// Failed, clean up the new entry.
|
||||
delete entry;
|
||||
|
||||
NS_WARNING("Failed to add entry to the CORS preflight cache!");
|
||||
return nsnull;
|
||||
}
|
||||
|
||||
mTable.Put(key, entry);
|
||||
PR_INSERT_LINK(entry, &mList);
|
||||
|
||||
return entry;
|
||||
|
|
|
@ -65,7 +65,8 @@ nsDOMAttributeMap::nsDOMAttributeMap(Element* aContent)
|
|||
bool
|
||||
nsDOMAttributeMap::Init()
|
||||
{
|
||||
return mAttributeCache.Init();
|
||||
mAttributeCache.Init();
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -212,9 +213,8 @@ nsDOMAttributeMap::GetAttribute(nsINodeInfo* aNodeInfo, bool aNsAware)
|
|||
nsCOMPtr<nsINodeInfo> ni = aNodeInfo;
|
||||
nsRefPtr<nsDOMAttribute> newAttr =
|
||||
new nsDOMAttribute(this, ni.forget(), EmptyString(), aNsAware);
|
||||
if (newAttr && mAttributeCache.Put(attr, newAttr)) {
|
||||
node = newAttr;
|
||||
}
|
||||
mAttributeCache.Put(attr, newAttr);
|
||||
node = newAttr;
|
||||
}
|
||||
|
||||
return node;
|
||||
|
@ -352,8 +352,7 @@ nsDOMAttributeMap::SetNamedItemInternal(nsIDOMNode *aNode,
|
|||
// Add the new attribute to the attribute map before updating
|
||||
// its value in the element. @see bug 364413.
|
||||
nsAttrKey attrkey(ni->NamespaceID(), ni->NameAtom());
|
||||
rv = mAttributeCache.Put(attrkey, attribute);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
mAttributeCache.Put(attrkey, attribute);
|
||||
iAttribute->SetMap(this);
|
||||
|
||||
rv = mContent->SetAttr(ni->NamespaceID(), ni->NameAtom(),
|
||||
|
|
|
@ -211,19 +211,18 @@ nsDOMMultipartFile::InitInternal(JSContext* aCx,
|
|||
if (d.endings.EqualsLiteral("native")) {
|
||||
nativeEOL = true;
|
||||
} else if (!d.endings.EqualsLiteral("transparent")) {
|
||||
return NS_ERROR_DOM_INVALID_STATE_ERR;
|
||||
return NS_ERROR_TYPE_ERR;
|
||||
}
|
||||
}
|
||||
|
||||
if (aArgc > 0) {
|
||||
if (!aArgv[0].isObject()) {
|
||||
return NS_ERROR_INVALID_ARG; // We're not interested
|
||||
return NS_ERROR_TYPE_ERR; // We're not interested
|
||||
}
|
||||
|
||||
JSObject& obj = aArgv[0].toObject();
|
||||
|
||||
if (!JS_IsArrayObject(aCx, &obj)) {
|
||||
return NS_ERROR_INVALID_ARG; // We're not interested
|
||||
return NS_ERROR_TYPE_ERR; // We're not interested
|
||||
}
|
||||
|
||||
BlobSet blobSet;
|
||||
|
@ -233,7 +232,7 @@ nsDOMMultipartFile::InitInternal(JSContext* aCx,
|
|||
for (uint32_t i = 0; i < length; ++i) {
|
||||
jsval element;
|
||||
if (!JS_GetElement(aCx, &obj, i, &element))
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
return NS_ERROR_TYPE_ERR;
|
||||
|
||||
if (element.isObject()) {
|
||||
JSObject& obj = element.toObject();
|
||||
|
@ -249,18 +248,26 @@ nsDOMMultipartFile::InitInternal(JSContext* aCx,
|
|||
} else {
|
||||
blobSet.AppendBlob(blob);
|
||||
}
|
||||
} else if (JS_IsArrayBufferObject(&obj, aCx)) {
|
||||
blobSet.AppendArrayBuffer(&obj, aCx);
|
||||
} else {
|
||||
// neither arraybuffer nor blob
|
||||
return NS_ERROR_DOM_INVALID_STATE_ERR;
|
||||
continue;
|
||||
}
|
||||
if (JS_IsArrayBufferViewObject(&obj, aCx)) {
|
||||
blobSet.AppendVoidPtr(JS_GetArrayBufferViewData(&obj, aCx),
|
||||
JS_GetArrayBufferViewByteLength(&obj, aCx));
|
||||
continue;
|
||||
}
|
||||
if (JS_IsArrayBufferObject(&obj, aCx)) {
|
||||
blobSet.AppendArrayBuffer(&obj, aCx);
|
||||
continue;
|
||||
}
|
||||
// neither Blob nor ArrayBuffer(View)
|
||||
} else if (element.isString()) {
|
||||
blobSet.AppendString(element.toString(), nativeEOL, aCx);
|
||||
} else {
|
||||
// neither object nor string
|
||||
return NS_ERROR_DOM_INVALID_STATE_ERR;
|
||||
continue;
|
||||
}
|
||||
// coerce it to a string
|
||||
JSString* str = JS_ValueToString(aCx, element);
|
||||
NS_ENSURE_TRUE(str, NS_ERROR_TYPE_ERR);
|
||||
blobSet.AppendString(str, nativeEOL, aCx);
|
||||
}
|
||||
|
||||
mBlobs = blobSet.GetBlobs();
|
||||
|
|
|
@ -350,7 +350,7 @@ nsDOMFileReader::DoOnDataAvailable(nsIRequest *aRequest,
|
|||
"unexpected mResult length");
|
||||
PRUint32 oldLen = mResult.Length();
|
||||
PRUnichar *buf = nsnull;
|
||||
mResult.GetMutableData(&buf, oldLen + aCount);
|
||||
mResult.GetMutableData(&buf, oldLen + aCount, fallible_t());
|
||||
NS_ENSURE_TRUE(buf, NS_ERROR_OUT_OF_MEMORY);
|
||||
|
||||
PRUint32 bytesRead = 0;
|
||||
|
@ -563,8 +563,8 @@ nsDOMFileReader::ConvertStream(const char *aFileData,
|
|||
rv = unicodeDecoder->GetMaxLength(aFileData, aDataLen, &destLength);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
aResult.SetLength(destLength); //Make sure we have enough space for the conversion
|
||||
destLength = aResult.Length();
|
||||
if (!aResult.SetLength(destLength, fallible_t()))
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
PRInt32 srcLength = aDataLen;
|
||||
rv = unicodeDecoder->Convert(aFileData, &srcLength, aResult.BeginWriting(), &destLength);
|
||||
|
|
|
@ -726,9 +726,7 @@ nsExternalResourceMap::RequestResource(nsIURI* aURI,
|
|||
|
||||
load = new PendingLoad(aDisplayDocument);
|
||||
|
||||
if (!mPendingLoads.Put(clone, load)) {
|
||||
return nsnull;
|
||||
}
|
||||
mPendingLoads.Put(clone, load);
|
||||
|
||||
if (NS_FAILED(load->StartLoad(clone, aRequestingNode))) {
|
||||
// Make sure we don't thrash things by trying this load again, since
|
||||
|
@ -920,22 +918,14 @@ nsExternalResourceMap::AddExternalResource(nsIURI* aURI,
|
|||
}
|
||||
|
||||
ExternalResource* newResource = new ExternalResource();
|
||||
if (newResource && !mMap.Put(aURI, newResource)) {
|
||||
delete newResource;
|
||||
newResource = nsnull;
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
rv = NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
}
|
||||
mMap.Put(aURI, newResource);
|
||||
|
||||
if (newResource) {
|
||||
newResource->mDocument = doc;
|
||||
newResource->mViewer = aViewer;
|
||||
newResource->mLoadGroup = aLoadGroup;
|
||||
if (doc) {
|
||||
TransferZoomLevels(aDisplayDocument, doc);
|
||||
TransferShowingState(aDisplayDocument, doc);
|
||||
}
|
||||
newResource->mDocument = doc;
|
||||
newResource->mViewer = aViewer;
|
||||
newResource->mLoadGroup = aLoadGroup;
|
||||
if (doc) {
|
||||
TransferZoomLevels(aDisplayDocument, doc);
|
||||
TransferShowingState(aDisplayDocument, doc);
|
||||
}
|
||||
|
||||
const nsTArray< nsCOMPtr<nsIObserver> > & obs = load->Observers();
|
||||
|
@ -2000,7 +1990,7 @@ nsDocument::Init()
|
|||
}
|
||||
|
||||
mIdentifierMap.Init();
|
||||
(void)mStyledLinks.Init();
|
||||
mStyledLinks.Init();
|
||||
mRadioGroups.Init();
|
||||
|
||||
// Force initialization.
|
||||
|
@ -2041,10 +2031,8 @@ nsDocument::Init()
|
|||
mScriptLoader = new nsScriptLoader(this);
|
||||
NS_ENSURE_TRUE(mScriptLoader, NS_ERROR_OUT_OF_MEMORY);
|
||||
|
||||
if (!mImageTracker.Init() ||
|
||||
!mPlugins.Init()) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
mImageTracker.Init();
|
||||
mPlugins.Init();
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -5355,9 +5343,7 @@ nsDocument::GetBoxObjectFor(nsIDOMElement* aElement, nsIBoxObject** aResult)
|
|||
|
||||
if (!mBoxObjectTable) {
|
||||
mBoxObjectTable = new nsInterfaceHashtable<nsPtrHashKey<nsIContent>, nsPIBoxObject>;
|
||||
if (mBoxObjectTable && !mBoxObjectTable->Init(12)) {
|
||||
mBoxObjectTable = nsnull;
|
||||
}
|
||||
mBoxObjectTable->Init(12);
|
||||
} else {
|
||||
// Want to use Get(content, aResult); but it's the wrong type
|
||||
*aResult = mBoxObjectTable->GetWeak(content);
|
||||
|
@ -6502,7 +6488,7 @@ nsDocument::GetRadioGroup(const nsAString& aName)
|
|||
}
|
||||
|
||||
nsAutoPtr<nsRadioGroupStruct> newRadioGroup(new nsRadioGroupStruct());
|
||||
NS_ENSURE_TRUE(mRadioGroups.Put(tmKey, newRadioGroup), nsnull);
|
||||
mRadioGroups.Put(tmKey, newRadioGroup);
|
||||
|
||||
return newRadioGroup.forget();
|
||||
}
|
||||
|
@ -8285,9 +8271,7 @@ nsDocument::AddImage(imgIRequest* aImage)
|
|||
mImageTracker.Get(aImage, &oldCount);
|
||||
|
||||
// Put the image in the hashtable, with the proper count.
|
||||
bool success = mImageTracker.Put(aImage, oldCount + 1);
|
||||
if (!success)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
mImageTracker.Put(aImage, oldCount + 1);
|
||||
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
|
|
|
@ -53,6 +53,7 @@
|
|||
#include "nsGkAtoms.h"
|
||||
#include "nsDOMString.h"
|
||||
#include "nsIDOMUserDataHandler.h"
|
||||
#include "nsContentUtils.h"
|
||||
|
||||
class nsDocumentFragment : public nsGenericElement,
|
||||
public nsIDOMDocumentFragment
|
||||
|
@ -161,12 +162,25 @@ nsDocumentFragment::GetIDAttributeName() const
|
|||
DOMCI_NODE_DATA(DocumentFragment, nsDocumentFragment)
|
||||
|
||||
// QueryInterface implementation for nsDocumentFragment
|
||||
NS_INTERFACE_TABLE_HEAD(nsDocumentFragment)
|
||||
NS_NODE_INTERFACE_TABLE2(nsDocumentFragment, nsIDOMNode,
|
||||
nsIDOMDocumentFragment)
|
||||
NS_INTERFACE_MAP_BEGIN(nsDocumentFragment)
|
||||
NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
|
||||
NS_INTERFACE_MAP_ENTRIES_CYCLE_COLLECTION(nsDocumentFragment)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIContent)
|
||||
NS_INTERFACE_MAP_ENTRY(nsINode)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMDocumentFragment)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMNode)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMEventTarget)
|
||||
NS_INTERFACE_MAP_ENTRY_TEAROFF(nsISupportsWeakReference,
|
||||
new nsNodeSupportsWeakRefTearoff(this))
|
||||
NS_INTERFACE_MAP_ENTRY_TEAROFF(nsIDOMNodeSelector,
|
||||
new nsNodeSelectorTearoff(this))
|
||||
// nsNodeSH::PreCreate() depends on the identity pointer being the
|
||||
// same as nsINode (which nsIContent inherits), so if you change the
|
||||
// below line, make sure nsNodeSH::PreCreate() still does the right
|
||||
// thing!
|
||||
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIContent)
|
||||
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(DocumentFragment)
|
||||
NS_INTERFACE_MAP_END_INHERITING(nsGenericElement)
|
||||
|
||||
NS_INTERFACE_MAP_END
|
||||
|
||||
NS_IMPL_ADDREF_INHERITED(nsDocumentFragment, nsGenericElement)
|
||||
NS_IMPL_RELEASE_INHERITED(nsDocumentFragment, nsGenericElement)
|
||||
|
|
|
@ -153,7 +153,7 @@
|
|||
#include "nsWrapperCacheInlines.h"
|
||||
#include "nsCycleCollector.h"
|
||||
#include "xpcpublic.h"
|
||||
#include "xpcprivate.h"
|
||||
#include "nsIScriptError.h"
|
||||
#include "nsLayoutStatics.h"
|
||||
#include "mozilla/Telemetry.h"
|
||||
|
||||
|
|
|
@ -1364,6 +1364,7 @@ GK_ATOM(unicode_bidi, "unicode-bidi")
|
|||
GK_ATOM(userSpaceOnUse, "userSpaceOnUse")
|
||||
GK_ATOM(view, "view")
|
||||
GK_ATOM(viewBox, "viewBox")
|
||||
GK_ATOM(viewTarget, "viewTarget")
|
||||
GK_ATOM(vkern, "vkern")
|
||||
GK_ATOM(word_spacing, "word-spacing")
|
||||
GK_ATOM(x, "x")
|
||||
|
@ -1377,6 +1378,7 @@ GK_ATOM(y2, "y2")
|
|||
GK_ATOM(yChannelSelector, "yChannelSelector")
|
||||
GK_ATOM(z, "z")
|
||||
GK_ATOM(zoomAndPan, "zoomAndPan")
|
||||
GK_ATOM(vector_effect, "vector-effect")
|
||||
|
||||
GK_ATOM(accumulate, "accumulate")
|
||||
GK_ATOM(additive, "additive")
|
||||
|
@ -1716,6 +1718,7 @@ GK_ATOM(onMozTouchUp, "onMozTouchUp")
|
|||
GK_ATOM(ondevicemotion, "ondevicemotion")
|
||||
GK_ATOM(ondeviceorientation, "ondeviceorientation")
|
||||
GK_ATOM(ondeviceproximity, "ondeviceproximity")
|
||||
GK_ATOM(onuserproximity, "onuserproximity")
|
||||
|
||||
// light sensor support
|
||||
GK_ATOM(ondevicelight, "ondevicelight")
|
||||
|
|
|
@ -140,9 +140,9 @@ NS_IMPL_ISUPPORTS1(NameSpaceManagerImpl, nsINameSpaceManager)
|
|||
|
||||
nsresult NameSpaceManagerImpl::Init()
|
||||
{
|
||||
nsresult rv = mURIToIDTable.Init(32);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
mURIToIDTable.Init(32);
|
||||
|
||||
nsresult rv;
|
||||
#define REGISTER_NAMESPACE(uri, id) \
|
||||
rv = AddNameSpace(NS_LITERAL_STRING(uri), id); \
|
||||
NS_ENSURE_SUCCESS(rv, rv)
|
||||
|
@ -288,11 +288,7 @@ nsresult NameSpaceManagerImpl::AddNameSpace(const nsAString& aURI,
|
|||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
if (!mURIToIDTable.Put(uri, aNameSpaceID)) {
|
||||
mURIArray.RemoveElementAt(aNameSpaceID - 1);
|
||||
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
mURIToIDTable.Put(uri, aNameSpaceID);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -628,12 +628,13 @@ nsIAtom** const kAttributesSVG[] = {
|
|||
// v-ideographic
|
||||
// v-mathematical
|
||||
&nsGkAtoms::values, // values
|
||||
&nsGkAtoms::vector_effect, // vector-effect
|
||||
// vert-adv-y
|
||||
// vert-origin-x
|
||||
// vert-origin-y
|
||||
&nsGkAtoms::viewBox, // viewBox
|
||||
&nsGkAtoms::viewTarget, // viewTarget
|
||||
&nsGkAtoms::visibility, // visibility
|
||||
// viewTarget
|
||||
&nsGkAtoms::width, // width
|
||||
// widths
|
||||
&nsGkAtoms::word_spacing, // word-spacing
|
||||
|
|
|
@ -390,10 +390,14 @@ nsWebSocket::OnServerClose(nsISupports *aContext, PRUint16 aCode,
|
|||
CopyUTF8toUTF16(aReason, mCloseEventReason);
|
||||
|
||||
if (mReadyState == nsIWebSocket::OPEN) {
|
||||
// Send reciprocal Close frame.
|
||||
// 5.5.1: "When sending a Close frame in response, the endpoint typically
|
||||
// echos the status code it received"
|
||||
CloseConnection(aCode, aReason);
|
||||
// RFC 6455, 5.5.1: "When sending a Close frame in response, the endpoint
|
||||
// typically echos the status code it received".
|
||||
// But never send certain codes, per section 7.4.1
|
||||
if (aCode == 1005 || aCode == 1006 || aCode == 1015) {
|
||||
CloseConnection(0, EmptyCString());
|
||||
} else {
|
||||
CloseConnection(aCode, aReason);
|
||||
}
|
||||
} else {
|
||||
// Nothing else to do: OnStop does the rest of the work.
|
||||
NS_ASSERTION (mReadyState == nsIWebSocket::CLOSING, "unknown state");
|
||||
|
|
|
@ -579,6 +579,7 @@ _TEST_FILES2 = \
|
|||
test_bug737087.html \
|
||||
test_bug433662.html \
|
||||
test_bug749367.html \
|
||||
test_bug753278.html \
|
||||
$(NULL)
|
||||
|
||||
_CHROME_FILES = \
|
||||
|
|
|
@ -31,6 +31,19 @@ def web_socket_do_extra_handshake(request):
|
|||
else:
|
||||
pass
|
||||
|
||||
# Behave according to recommendation of RFC 6455, section # 5.5.1:
|
||||
# "When sending a Close frame in response, the endpoint typically echos the
|
||||
# status code it received."
|
||||
# - Without this, pywebsocket replies with 1000 to any close code.
|
||||
#
|
||||
# Note that this function is only called when the client initiates the close
|
||||
def web_socket_passive_closing_handshake(request):
|
||||
if request.ws_close_code == 1005:
|
||||
return None, None
|
||||
else:
|
||||
return request.ws_close_code, request.ws_close_reason
|
||||
|
||||
|
||||
def web_socket_transfer_data(request):
|
||||
if request.ws_protocol == "test-2.1" or request.ws_protocol == "test-2.2":
|
||||
msgutil.close_connection(request)
|
||||
|
@ -57,7 +70,6 @@ def web_socket_transfer_data(request):
|
|||
if msgutil.receive_message(request) == "client data":
|
||||
resp = "server data"
|
||||
msgutil.send_message(request, resp.decode('utf-8'))
|
||||
msgutil.close_connection(request)
|
||||
elif request.ws_protocol == "test-12":
|
||||
msgutil.close_connection(request)
|
||||
elif request.ws_protocol == "test-13":
|
||||
|
|
|
@ -137,6 +137,17 @@ let testData =
|
|||
{start: 8, length:10, contents: "IJKLMNOPsq"},
|
||||
{start: 17, length: 3, contents: "qui"},
|
||||
{start: 4, length: 8, contents: "EFGHIJKL"}]],
|
||||
// Test an ArrayBufferView
|
||||
[[int8View, blob1, "foo"], {},
|
||||
[{start: 0, length: 8, contents: "ABCDEFGH"},
|
||||
{start: 8, length:10, contents: "IJKLMNOPsq"},
|
||||
{start: 17, length: 3, contents: "qui"},
|
||||
{start: 4, length: 8, contents: "EFGHIJKL"}]],
|
||||
// Test a partial ArrayBufferView
|
||||
[[new Uint8Array(aB, 3, 5), blob1, "foo"], {},
|
||||
[{start: 0, length: 8, contents: "DEFGHsqu"},
|
||||
{start: 8, length:10, contents: "igglefoo"},
|
||||
{start: 4, length: 8, contents: "Hsquiggl"}]],
|
||||
// Test transparent line endings
|
||||
[["foo\r\n", "bar\r", "baz\n"], { endings: "transparent" },
|
||||
[{start: 0, length: 5, contents: "foo\r\n"},
|
||||
|
@ -157,7 +168,11 @@ let testData =
|
|||
{start: 4, length: 4, contents: "bar\n"},
|
||||
{start: 8, length: 4, contents: "baz\n"}]],
|
||||
// Test type coercion of a number
|
||||
[[3, aB, "foo"], {}, "InvalidStateError"]
|
||||
[[3, int8View, "foo"], {},
|
||||
[{start: 0, length: 8, contents: "3ABCDEFG"},
|
||||
{start: 8, length:10, contents: "HIJKLMNOPf"},
|
||||
{start: 17, length: 4, contents: "foo"},
|
||||
{start: 4, length: 8, contents: "DEFGHIJK"}]]
|
||||
];
|
||||
|
||||
let testCounter = 0;
|
||||
|
|
|
@ -0,0 +1,46 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=753278
|
||||
-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test for Bug 753278</title>
|
||||
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
</head>
|
||||
<body onload="runTest();">
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=753278">Mozilla Bug 753278</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
<iframe></iframe>
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script type="application/javascript">
|
||||
|
||||
/** Test for Bug 753278 **/
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
var f = document.getElementsByTagName("iframe")[0];
|
||||
|
||||
function runTest() {
|
||||
f.contentDocument.open();
|
||||
f.contentDocument.write('<script>window.location = "data:text/html;charset=utf-8,\\u003Cscript>parent.pass();\\u003C/script>"; document.close(); document.open(); document.write("\\u003Cscript>parent.fail();\\u003C/script>"); document.close();\u003c/script>');
|
||||
f.contentDocument.close();
|
||||
}
|
||||
|
||||
function pass() {
|
||||
ok(true, "window.location took precedence");
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
function fail() {
|
||||
ok(false, "window.location should have taken precedence");
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
|
@ -25,8 +25,8 @@
|
|||
* 5. client uses an invalid protocol value;
|
||||
* 6. counter and encoding check;
|
||||
* 7. onmessage event origin property check
|
||||
* 8. client calls close() and the server sends the close frame in
|
||||
* acknowledgement;
|
||||
* 8. client calls close() and the server sends the close frame (with no code
|
||||
* or reason) in acknowledgement;
|
||||
* 9. client closes the connection before the ws connection is established;
|
||||
* 10. client sends a message before the ws connection is established;
|
||||
* 11. a simple hello echo;
|
||||
|
@ -55,7 +55,7 @@
|
|||
* 31. ctor using valid 2 element sub-protocol array with 1 element server
|
||||
* will reject and one server will accept.
|
||||
* 32. ctor using invalid sub-protocol array that contains duplicate items
|
||||
* 33. default close code test
|
||||
* 33. test for sending/receiving custom close code (but no close reason)
|
||||
* 34. test for receiving custom close code and reason
|
||||
* 35. test for sending custom close code and reason
|
||||
* 36. negative test for sending out of range close code
|
||||
|
@ -387,6 +387,10 @@ function test8()
|
|||
ws.onclose = function(e)
|
||||
{
|
||||
shouldCloseCleanly(e);
|
||||
// We called close() with no close code: so pywebsocket will also send no
|
||||
// close code, which translates to code 1005
|
||||
ok(e.code == 1005, "test-8 close code has wrong value:" + e.code);
|
||||
ok(e.reason == "", "test-8 close reason has wrong value:" + e.reason);
|
||||
doTest(9);
|
||||
};
|
||||
}
|
||||
|
@ -461,7 +465,7 @@ function test11()
|
|||
ws.onmessage = function(e)
|
||||
{
|
||||
ok(e.data == "server data", "bad received message in test-11!");
|
||||
ws.close();
|
||||
ws.close(1000, "Have a nice day");
|
||||
|
||||
// this ok() is disabled due to a race condition - it state may have
|
||||
// advanced through 2 (closing) and into 3 (closed) before it is evald
|
||||
|
@ -471,6 +475,8 @@ function test11()
|
|||
{
|
||||
ok(ws.readyState == 3, "onclose bad readyState in test-11!");
|
||||
shouldCloseCleanly(e);
|
||||
ok(e.code == 1000, "test 11 got wrong close code: " + e.code);
|
||||
ok(e.reason == "Have a nice day", "test 11 got wrong close reason: " + e.reason);
|
||||
doTest(12);
|
||||
}
|
||||
}
|
||||
|
@ -942,14 +948,15 @@ function test33()
|
|||
ws.onopen = function(e)
|
||||
{
|
||||
ok(true, "test 33 open");
|
||||
ws.close();
|
||||
ws.close(3131); // pass code but not reason
|
||||
};
|
||||
|
||||
ws.onclose = function(e)
|
||||
{
|
||||
ok(true, "test 33 close");
|
||||
ok(e.wasClean, "test 33 closed cleanly");
|
||||
ok(e.code == 1000, "test 33 had normal 1000 error code");
|
||||
shouldCloseCleanly(e);
|
||||
ok(e.code == 3131, "test 33 got wrong close code: " + e.code);
|
||||
ok(e.reason === "", "test 33 got wrong close reason: " + e.reason);
|
||||
doTest(34);
|
||||
};
|
||||
}
|
||||
|
|
|
@ -135,25 +135,25 @@ Canvas2D_GetStyleHelper(JSContext *cx, JSObject *obj, jsid id, jsval *vp,
|
|||
}
|
||||
|
||||
static JSBool
|
||||
nsIDOMCanvasRenderingContext2D_SetStrokeStyle(JSContext *cx, JSObject *obj, jsid id, JSBool strict, jsval *vp)
|
||||
nsIDOMCanvasRenderingContext2D_SetStrokeStyle(JSContext *cx, JSHandleObject obj, JSHandleId id, JSBool strict, jsval *vp)
|
||||
{
|
||||
return Canvas2D_SetStyleHelper(cx, obj, id, vp, &nsIDOMCanvasRenderingContext2D::SetStrokeStyle_multi);
|
||||
}
|
||||
|
||||
static JSBool
|
||||
nsIDOMCanvasRenderingContext2D_GetStrokeStyle(JSContext *cx, JSObject *obj, jsid id, jsval *vp)
|
||||
nsIDOMCanvasRenderingContext2D_GetStrokeStyle(JSContext *cx, JSHandleObject obj, JSHandleId id, jsval *vp)
|
||||
{
|
||||
return Canvas2D_GetStyleHelper(cx, obj, id, vp, &nsIDOMCanvasRenderingContext2D::GetStrokeStyle_multi);
|
||||
}
|
||||
|
||||
static JSBool
|
||||
nsIDOMCanvasRenderingContext2D_SetFillStyle(JSContext *cx, JSObject *obj, jsid id, JSBool strict, jsval *vp)
|
||||
nsIDOMCanvasRenderingContext2D_SetFillStyle(JSContext *cx, JSHandleObject obj, JSHandleId id, JSBool strict, jsval *vp)
|
||||
{
|
||||
return Canvas2D_SetStyleHelper(cx, obj, id, vp, &nsIDOMCanvasRenderingContext2D::SetFillStyle_multi);
|
||||
}
|
||||
|
||||
static JSBool
|
||||
nsIDOMCanvasRenderingContext2D_GetFillStyle(JSContext *cx, JSObject *obj, jsid id, jsval *vp)
|
||||
nsIDOMCanvasRenderingContext2D_GetFillStyle(JSContext *cx, JSHandleObject obj, JSHandleId id, jsval *vp)
|
||||
{
|
||||
return Canvas2D_GetStyleHelper(cx, obj, id, vp, &nsIDOMCanvasRenderingContext2D::GetFillStyle_multi);
|
||||
}
|
||||
|
|
|
@ -109,7 +109,6 @@ INCLUDES += \
|
|||
-I$(srcdir)/../../../layout/generic \
|
||||
-I$(srcdir)/../../base/src \
|
||||
-I$(srcdir)/../../html/content/src \
|
||||
-I$(srcdir)/../../../js/xpconnect/src \
|
||||
-I$(srcdir)/../../../dom/base \
|
||||
$(NULL)
|
||||
|
||||
|
|
|
@ -54,6 +54,7 @@ EXPORTS = \
|
|||
nsEventDispatcher.h \
|
||||
nsEventStates.h \
|
||||
nsEventNameList.h \
|
||||
nsVKList.h \
|
||||
$(NULL)
|
||||
|
||||
XPIDLSRCS = \
|
||||
|
|
|
@ -459,6 +459,10 @@ WINDOW_ONLY_EVENT(deviceproximity,
|
|||
NS_DEVICE_PROXIMITY,
|
||||
EventNameType_None,
|
||||
NS_EVENT)
|
||||
WINDOW_ONLY_EVENT(userproximity,
|
||||
NS_USER_PROXIMITY,
|
||||
EventNameType_None,
|
||||
NS_EVENT)
|
||||
WINDOW_ONLY_EVENT(devicelight,
|
||||
NS_DEVICE_LIGHT,
|
||||
EventNameType_None,
|
||||
|
|
|
@ -94,6 +94,8 @@ NS_NewDOMPopupBlockedEvent(nsIDOMEvent** aResult, nsPresContext* aPresContext, n
|
|||
nsresult
|
||||
NS_NewDOMDeviceProximityEvent(nsIDOMEvent** aInstancePtrResult, nsPresContext* aPresContext, nsEvent *aEvent);
|
||||
nsresult
|
||||
NS_NewDOMUserProximityEvent(nsIDOMEvent** aInstancePtrResult, nsPresContext* aPresContext, nsEvent *aEvent);
|
||||
nsresult
|
||||
NS_NewDOMDeviceOrientationEvent(nsIDOMEvent** aResult, nsPresContext* aPresContext, nsEvent* aEvent);
|
||||
nsresult
|
||||
NS_NewDOMDeviceLightEvent(nsIDOMEvent** aResult, nsPresContext* aPresContext, nsEvent* aEvent);
|
||||
|
|
|
@ -0,0 +1,191 @@
|
|||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=2 et sw=2 tw=80: */
|
||||
/* 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/. */
|
||||
|
||||
/**
|
||||
* This header file defines all DOM keys which are defined in nsIDOMKeyEvent.
|
||||
* You must define NS_DEFINE_VK macro before including this.
|
||||
*
|
||||
* It must have two arguments, (aDOMKeyName, aDOMKeyCode)
|
||||
* aDOMKeyName is a key name in DOM.
|
||||
* aDOMKeyCode is one of nsIDOMKeyEvent::DOM_VK_*.
|
||||
*/
|
||||
|
||||
#define DEFINE_VK_INTERNAL(aKeyName) \
|
||||
NS_DEFINE_VK(VK##aKeyName, nsIDOMKeyEvent::DOM_VK##aKeyName)
|
||||
|
||||
// Some keycode may have different name in nsIDOMKeyEvent from its key name.
|
||||
#define DEFINE_VK_INTERNAL2(aKeyName, aKeyCodeName) \
|
||||
NS_DEFINE_VK(VK##aKeyName, nsIDOMKeyEvent::DOM_VK##aKeyCodeName)
|
||||
|
||||
DEFINE_VK_INTERNAL(_CANCEL),
|
||||
DEFINE_VK_INTERNAL(_HELP),
|
||||
DEFINE_VK_INTERNAL2(_BACK, _BACK_SPACE),
|
||||
DEFINE_VK_INTERNAL(_TAB),
|
||||
DEFINE_VK_INTERNAL(_CLEAR),
|
||||
DEFINE_VK_INTERNAL(_RETURN),
|
||||
DEFINE_VK_INTERNAL(_ENTER),
|
||||
DEFINE_VK_INTERNAL(_SHIFT),
|
||||
DEFINE_VK_INTERNAL(_CONTROL),
|
||||
DEFINE_VK_INTERNAL(_ALT),
|
||||
DEFINE_VK_INTERNAL(_PAUSE),
|
||||
DEFINE_VK_INTERNAL(_CAPS_LOCK),
|
||||
DEFINE_VK_INTERNAL(_KANA),
|
||||
DEFINE_VK_INTERNAL(_HANGUL),
|
||||
DEFINE_VK_INTERNAL(_EISU),
|
||||
DEFINE_VK_INTERNAL(_JUNJA),
|
||||
DEFINE_VK_INTERNAL(_FINAL),
|
||||
DEFINE_VK_INTERNAL(_HANJA),
|
||||
DEFINE_VK_INTERNAL(_KANJI),
|
||||
DEFINE_VK_INTERNAL(_ESCAPE),
|
||||
DEFINE_VK_INTERNAL(_CONVERT),
|
||||
DEFINE_VK_INTERNAL(_NONCONVERT),
|
||||
DEFINE_VK_INTERNAL(_ACCEPT),
|
||||
DEFINE_VK_INTERNAL(_MODECHANGE),
|
||||
DEFINE_VK_INTERNAL(_SPACE),
|
||||
DEFINE_VK_INTERNAL(_PAGE_UP),
|
||||
DEFINE_VK_INTERNAL(_PAGE_DOWN),
|
||||
DEFINE_VK_INTERNAL(_END),
|
||||
DEFINE_VK_INTERNAL(_HOME),
|
||||
DEFINE_VK_INTERNAL(_LEFT),
|
||||
DEFINE_VK_INTERNAL(_UP),
|
||||
DEFINE_VK_INTERNAL(_RIGHT),
|
||||
DEFINE_VK_INTERNAL(_DOWN),
|
||||
DEFINE_VK_INTERNAL(_SELECT),
|
||||
DEFINE_VK_INTERNAL(_PRINT),
|
||||
DEFINE_VK_INTERNAL(_EXECUTE),
|
||||
DEFINE_VK_INTERNAL(_PRINTSCREEN),
|
||||
DEFINE_VK_INTERNAL(_INSERT),
|
||||
DEFINE_VK_INTERNAL(_DELETE),
|
||||
|
||||
DEFINE_VK_INTERNAL(_0),
|
||||
DEFINE_VK_INTERNAL(_1),
|
||||
DEFINE_VK_INTERNAL(_2),
|
||||
DEFINE_VK_INTERNAL(_3),
|
||||
DEFINE_VK_INTERNAL(_4),
|
||||
DEFINE_VK_INTERNAL(_5),
|
||||
DEFINE_VK_INTERNAL(_6),
|
||||
DEFINE_VK_INTERNAL(_7),
|
||||
DEFINE_VK_INTERNAL(_8),
|
||||
DEFINE_VK_INTERNAL(_9),
|
||||
|
||||
DEFINE_VK_INTERNAL(_COLON),
|
||||
DEFINE_VK_INTERNAL(_SEMICOLON),
|
||||
DEFINE_VK_INTERNAL(_LESS_THAN),
|
||||
DEFINE_VK_INTERNAL(_EQUALS),
|
||||
DEFINE_VK_INTERNAL(_GREATER_THAN),
|
||||
DEFINE_VK_INTERNAL(_QUESTION_MARK),
|
||||
DEFINE_VK_INTERNAL(_AT),
|
||||
|
||||
DEFINE_VK_INTERNAL(_A),
|
||||
DEFINE_VK_INTERNAL(_B),
|
||||
DEFINE_VK_INTERNAL(_C),
|
||||
DEFINE_VK_INTERNAL(_D),
|
||||
DEFINE_VK_INTERNAL(_E),
|
||||
DEFINE_VK_INTERNAL(_F),
|
||||
DEFINE_VK_INTERNAL(_G),
|
||||
DEFINE_VK_INTERNAL(_H),
|
||||
DEFINE_VK_INTERNAL(_I),
|
||||
DEFINE_VK_INTERNAL(_J),
|
||||
DEFINE_VK_INTERNAL(_K),
|
||||
DEFINE_VK_INTERNAL(_L),
|
||||
DEFINE_VK_INTERNAL(_M),
|
||||
DEFINE_VK_INTERNAL(_N),
|
||||
DEFINE_VK_INTERNAL(_O),
|
||||
DEFINE_VK_INTERNAL(_P),
|
||||
DEFINE_VK_INTERNAL(_Q),
|
||||
DEFINE_VK_INTERNAL(_R),
|
||||
DEFINE_VK_INTERNAL(_S),
|
||||
DEFINE_VK_INTERNAL(_T),
|
||||
DEFINE_VK_INTERNAL(_U),
|
||||
DEFINE_VK_INTERNAL(_V),
|
||||
DEFINE_VK_INTERNAL(_W),
|
||||
DEFINE_VK_INTERNAL(_X),
|
||||
DEFINE_VK_INTERNAL(_Y),
|
||||
DEFINE_VK_INTERNAL(_Z),
|
||||
|
||||
DEFINE_VK_INTERNAL(_WIN),
|
||||
DEFINE_VK_INTERNAL(_CONTEXT_MENU),
|
||||
DEFINE_VK_INTERNAL(_SLEEP),
|
||||
|
||||
DEFINE_VK_INTERNAL(_NUMPAD0),
|
||||
DEFINE_VK_INTERNAL(_NUMPAD1),
|
||||
DEFINE_VK_INTERNAL(_NUMPAD2),
|
||||
DEFINE_VK_INTERNAL(_NUMPAD3),
|
||||
DEFINE_VK_INTERNAL(_NUMPAD4),
|
||||
DEFINE_VK_INTERNAL(_NUMPAD5),
|
||||
DEFINE_VK_INTERNAL(_NUMPAD6),
|
||||
DEFINE_VK_INTERNAL(_NUMPAD7),
|
||||
DEFINE_VK_INTERNAL(_NUMPAD8),
|
||||
DEFINE_VK_INTERNAL(_NUMPAD9),
|
||||
DEFINE_VK_INTERNAL(_MULTIPLY),
|
||||
DEFINE_VK_INTERNAL(_ADD),
|
||||
DEFINE_VK_INTERNAL(_SEPARATOR),
|
||||
DEFINE_VK_INTERNAL(_SUBTRACT),
|
||||
DEFINE_VK_INTERNAL(_DECIMAL),
|
||||
DEFINE_VK_INTERNAL(_DIVIDE),
|
||||
|
||||
DEFINE_VK_INTERNAL(_F1),
|
||||
DEFINE_VK_INTERNAL(_F2),
|
||||
DEFINE_VK_INTERNAL(_F3),
|
||||
DEFINE_VK_INTERNAL(_F4),
|
||||
DEFINE_VK_INTERNAL(_F5),
|
||||
DEFINE_VK_INTERNAL(_F6),
|
||||
DEFINE_VK_INTERNAL(_F7),
|
||||
DEFINE_VK_INTERNAL(_F8),
|
||||
DEFINE_VK_INTERNAL(_F9),
|
||||
DEFINE_VK_INTERNAL(_F10),
|
||||
DEFINE_VK_INTERNAL(_F11),
|
||||
DEFINE_VK_INTERNAL(_F12),
|
||||
DEFINE_VK_INTERNAL(_F13),
|
||||
DEFINE_VK_INTERNAL(_F14),
|
||||
DEFINE_VK_INTERNAL(_F15),
|
||||
DEFINE_VK_INTERNAL(_F16),
|
||||
DEFINE_VK_INTERNAL(_F17),
|
||||
DEFINE_VK_INTERNAL(_F18),
|
||||
DEFINE_VK_INTERNAL(_F19),
|
||||
DEFINE_VK_INTERNAL(_F20),
|
||||
DEFINE_VK_INTERNAL(_F21),
|
||||
DEFINE_VK_INTERNAL(_F22),
|
||||
DEFINE_VK_INTERNAL(_F23),
|
||||
DEFINE_VK_INTERNAL(_F24),
|
||||
|
||||
DEFINE_VK_INTERNAL(_NUM_LOCK),
|
||||
DEFINE_VK_INTERNAL(_SCROLL_LOCK),
|
||||
|
||||
DEFINE_VK_INTERNAL(_CIRCUMFLEX),
|
||||
DEFINE_VK_INTERNAL(_EXCLAMATION),
|
||||
DEFINE_VK_INTERNAL(_DOUBLE_QUOTE),
|
||||
DEFINE_VK_INTERNAL(_HASH),
|
||||
DEFINE_VK_INTERNAL(_DOLLAR),
|
||||
DEFINE_VK_INTERNAL(_PERCENT),
|
||||
DEFINE_VK_INTERNAL(_AMPERSAND),
|
||||
DEFINE_VK_INTERNAL(_UNDERSCORE),
|
||||
DEFINE_VK_INTERNAL(_OPEN_PAREN),
|
||||
DEFINE_VK_INTERNAL(_CLOSE_PAREN),
|
||||
DEFINE_VK_INTERNAL(_ASTERISK),
|
||||
DEFINE_VK_INTERNAL(_PLUS),
|
||||
DEFINE_VK_INTERNAL(_PIPE),
|
||||
DEFINE_VK_INTERNAL(_HYPHEN_MINUS),
|
||||
|
||||
DEFINE_VK_INTERNAL(_OPEN_CURLY_BRACKET),
|
||||
DEFINE_VK_INTERNAL(_CLOSE_CURLY_BRACKET),
|
||||
|
||||
DEFINE_VK_INTERNAL(_TILDE),
|
||||
|
||||
DEFINE_VK_INTERNAL(_COMMA),
|
||||
DEFINE_VK_INTERNAL(_PERIOD),
|
||||
DEFINE_VK_INTERNAL(_SLASH),
|
||||
DEFINE_VK_INTERNAL(_BACK_QUOTE),
|
||||
DEFINE_VK_INTERNAL(_OPEN_BRACKET),
|
||||
DEFINE_VK_INTERNAL(_BACK_SLASH),
|
||||
DEFINE_VK_INTERNAL(_CLOSE_BRACKET),
|
||||
DEFINE_VK_INTERNAL(_QUOTE),
|
||||
|
||||
DEFINE_VK_INTERNAL(_META),
|
||||
DEFINE_VK_INTERNAL(_ALTGR)
|
||||
|
||||
#undef DEFINE_VK_INTERNAL
|
||||
#undef DEFINE_VK_INTERNAL2
|
|
@ -66,6 +66,7 @@ CPPSRCS = \
|
|||
nsDOMMutationEvent.cpp \
|
||||
nsDOMPopupBlockedEvent.cpp \
|
||||
nsDOMDeviceProximityEvent.cpp \
|
||||
nsDOMUserProximityEvent.cpp \
|
||||
nsDOMDeviceLightEvent.cpp \
|
||||
nsDOMDeviceOrientationEvent.cpp \
|
||||
nsDOMDeviceMotionEvent.cpp \
|
||||
|
|
|
@ -89,7 +89,8 @@ nsDOMDataContainerEvent::SetData(const nsAString& aKey, nsIVariant *aData)
|
|||
// Make sure this event isn't already being dispatched.
|
||||
NS_ENSURE_STATE(!(NS_IS_EVENT_IN_DISPATCH(mEvent)));
|
||||
NS_ENSURE_STATE(mData.IsInitialized());
|
||||
return mData.Put(aKey, aData) ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
|
||||
mData.Put(aKey, aData);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult
|
||||
|
|
|
@ -128,6 +128,7 @@ static const char* const sEventNames[] = {
|
|||
"devicemotion",
|
||||
"deviceorientation",
|
||||
"deviceproximity",
|
||||
"userproximity",
|
||||
"devicelight"
|
||||
};
|
||||
|
||||
|
@ -1557,6 +1558,8 @@ const char* nsDOMEvent::GetEventName(PRUint32 aEventType)
|
|||
return sEventNames[eDOMEvents_deviceorientation];
|
||||
case NS_DEVICE_PROXIMITY:
|
||||
return sEventNames[eDOMEvents_deviceproximity];
|
||||
case NS_USER_PROXIMITY:
|
||||
return sEventNames[eDOMEvents_userproximity];
|
||||
case NS_DEVICE_LIGHT:
|
||||
return sEventNames[eDOMEvents_devicelight];
|
||||
case NS_FULLSCREENCHANGE:
|
||||
|
|
|
@ -211,6 +211,7 @@ public:
|
|||
eDOMEvents_devicemotion,
|
||||
eDOMEvents_deviceorientation,
|
||||
eDOMEvents_deviceproximity,
|
||||
eDOMEvents_userproximity,
|
||||
eDOMEvents_devicelight
|
||||
};
|
||||
|
||||
|
|
|
@ -0,0 +1,57 @@
|
|||
/* 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 "nsDOMUserProximityEvent.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "DictionaryHelpers.h"
|
||||
|
||||
NS_IMPL_ADDREF_INHERITED(nsDOMUserProximityEvent, nsDOMEvent)
|
||||
NS_IMPL_RELEASE_INHERITED(nsDOMUserProximityEvent, nsDOMEvent)
|
||||
|
||||
DOMCI_DATA(UserProximityEvent, nsDOMUserProximityEvent)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN(nsDOMUserProximityEvent)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMUserProximityEvent)
|
||||
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(UserProximityEvent)
|
||||
NS_INTERFACE_MAP_END_INHERITING(nsDOMEvent)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDOMUserProximityEvent::InitUserProximityEvent(const nsAString & aEventTypeArg,
|
||||
bool aCanBubbleArg,
|
||||
bool aCancelableArg,
|
||||
bool aNear)
|
||||
{
|
||||
nsresult rv = nsDOMEvent::InitEvent(aEventTypeArg, aCanBubbleArg, aCancelableArg);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
mNear = aNear;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDOMUserProximityEvent::GetNear(bool *aNear)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aNear);
|
||||
*aNear = mNear;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsDOMUserProximityEvent::InitFromCtor(const nsAString& aType,
|
||||
JSContext* aCx, jsval* aVal)
|
||||
{
|
||||
mozilla::dom::UserProximityEventInit d;
|
||||
nsresult rv = d.Init(aCx, aVal);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
return InitUserProximityEvent(aType, d.bubbles, d.cancelable, d.near);
|
||||
}
|
||||
|
||||
nsresult
|
||||
NS_NewDOMUserProximityEvent(nsIDOMEvent** aInstancePtrResult,
|
||||
nsPresContext* aPresContext,
|
||||
nsEvent *aEvent)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aInstancePtrResult);
|
||||
nsDOMUserProximityEvent* it = new nsDOMUserProximityEvent(aPresContext, aEvent);
|
||||
return CallQueryInterface(it, aInstancePtrResult);
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
/* 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/. */
|
||||
|
||||
#ifndef nsDOMUserProximityEvent_h__
|
||||
#define nsDOMUserProximityEvent_h__
|
||||
|
||||
#include "nsIDOMUserProximityEvent.h"
|
||||
#include "nsDOMEvent.h"
|
||||
|
||||
class nsDOMUserProximityEvent
|
||||
: public nsDOMEvent
|
||||
, public nsIDOMUserProximityEvent
|
||||
{
|
||||
public:
|
||||
|
||||
nsDOMUserProximityEvent(nsPresContext* aPresContext, nsEvent* aEvent)
|
||||
: nsDOMEvent(aPresContext, aEvent),
|
||||
mNear(false) {}
|
||||
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
|
||||
// Forward to nsDOMEvent
|
||||
NS_FORWARD_TO_NSDOMEVENT
|
||||
|
||||
// nsIDOMUserProximityEvent Interface
|
||||
NS_DECL_NSIDOMUSERPROXIMITYEVENT
|
||||
|
||||
virtual nsresult InitFromCtor(const nsAString& aType,
|
||||
JSContext* aCx,
|
||||
jsval* aVal);
|
||||
protected:
|
||||
bool mNear;
|
||||
};
|
||||
|
||||
#endif
|
|
@ -290,7 +290,7 @@ nsEventListenerManager::AddEventListener(nsIDOMEventListener *aListener,
|
|||
}
|
||||
} else if (aTypeAtom == nsGkAtoms::ondeviceorientation) {
|
||||
EnableDevice(NS_DEVICE_ORIENTATION);
|
||||
} else if (aTypeAtom == nsGkAtoms::ondeviceproximity) {
|
||||
} else if (aTypeAtom == nsGkAtoms::ondeviceproximity || aTypeAtom == nsGkAtoms::onuserproximity) {
|
||||
EnableDevice(NS_DEVICE_PROXIMITY);
|
||||
} else if (aTypeAtom == nsGkAtoms::ondevicelight) {
|
||||
EnableDevice(NS_DEVICE_LIGHT);
|
||||
|
@ -351,6 +351,7 @@ nsEventListenerManager::EnableDevice(PRUint32 aType)
|
|||
window->EnableDeviceSensor(SENSOR_ORIENTATION);
|
||||
break;
|
||||
case NS_DEVICE_PROXIMITY:
|
||||
case NS_USER_PROXIMITY:
|
||||
window->EnableDeviceSensor(SENSOR_PROXIMITY);
|
||||
break;
|
||||
case NS_DEVICE_LIGHT:
|
||||
|
@ -387,6 +388,7 @@ nsEventListenerManager::DisableDevice(PRUint32 aType)
|
|||
window->DisableDeviceSensor(SENSOR_GYROSCOPE);
|
||||
break;
|
||||
case NS_DEVICE_PROXIMITY:
|
||||
case NS_USER_PROXIMITY:
|
||||
window->DisableDeviceSensor(SENSOR_PROXIMITY);
|
||||
break;
|
||||
case NS_DEVICE_LIGHT:
|
||||
|
|
|
@ -2222,6 +2222,8 @@ nsEventStateManager::DetermineDragTarget(nsPresContext* aPresContext,
|
|||
|
||||
nsCOMPtr<nsISupports> container = aPresContext->GetContainer();
|
||||
nsCOMPtr<nsIDOMWindow> window = do_GetInterface(container);
|
||||
if (!window)
|
||||
return;
|
||||
|
||||
// GetDragData determines if a selection, link or image in the content
|
||||
// should be dragged, and places the data associated with the drag in the
|
||||
|
@ -3538,6 +3540,13 @@ void
|
|||
nsEventStateManager::NotifyDestroyPresContext(nsPresContext* aPresContext)
|
||||
{
|
||||
nsIMEStateManager::OnDestroyPresContext(aPresContext);
|
||||
if (mHoverContent) {
|
||||
// Bug 70855: Presentation is going away, possibly for a reframe.
|
||||
// Reset the hover state so that if we're recreating the presentation,
|
||||
// we won't have the old hover state still set in the new presentation,
|
||||
// as if the new presentation is resized, a new element may be hovered.
|
||||
SetContentState(nsnull, NS_EVENT_STATE_HOVER);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -379,6 +379,14 @@ is(e.max, 2, "max should be 2");
|
|||
document.dispatchEvent(e);
|
||||
is(receivedEvent, e, "Wrong event!");
|
||||
|
||||
// UserProximityEvent
|
||||
e = new UserProximityEvent("hello", {near: true});
|
||||
ok(e.type, "hello", "Wrong event type!");
|
||||
ok(!e.isTrusted, "Event should not be trusted");
|
||||
is(e.near, true, "near should be true");
|
||||
document.dispatchEvent(e);
|
||||
is(receivedEvent, e, "Wrong event!");
|
||||
|
||||
// DeviceLightEvent
|
||||
e = new DeviceLightEvent("hello", {value: 1} );
|
||||
ok(e.type, "hello", "Wrong event type!");
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
<!doctype html>
|
||||
<script>
|
||||
var c = document.createElement("canvas");
|
||||
c.getContext("experimental-webgl", {
|
||||
get a() { throw 7; },
|
||||
get b() { throw 8; }
|
||||
});
|
||||
</script>
|
|
@ -27,6 +27,7 @@ load 602117.html
|
|||
load 613027.html
|
||||
load 614279.html
|
||||
load 614988-1.html
|
||||
load 616401.html
|
||||
load 620078-1.html
|
||||
load 620078-2.html
|
||||
load 680922-1.xul
|
||||
|
|
|
@ -149,7 +149,6 @@ INCLUDES += \
|
|||
-I$(srcdir)/../../../../editor/libeditor/base \
|
||||
-I$(srcdir)/../../../../editor/libeditor/text \
|
||||
-I$(srcdir) \
|
||||
-I$(topsrcdir)/js/xpconnect/src \
|
||||
-I$(topsrcdir)/xpcom/ds \
|
||||
$(NULL)
|
||||
|
||||
|
|
|
@ -820,7 +820,7 @@ nsGenericHTMLElement::SetInnerHTML(const nsAString& aInnerHTML)
|
|||
NS_IMETHODIMP
|
||||
nsGenericHTMLElement::SetOuterHTML(const nsAString& aOuterHTML)
|
||||
{
|
||||
nsINode* parent = GetNodeParent();
|
||||
nsCOMPtr<nsINode> parent = GetNodeParent();
|
||||
if (!parent) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -833,8 +833,8 @@ nsGenericHTMLElement::SetOuterHTML(const nsAString& aOuterHTML)
|
|||
nsIAtom* localName;
|
||||
PRInt32 namespaceID;
|
||||
if (parent->IsElement()) {
|
||||
localName = static_cast<nsIContent*>(parent)->Tag();
|
||||
namespaceID = static_cast<nsIContent*>(parent)->GetNameSpaceID();
|
||||
localName = static_cast<nsIContent*>(parent.get())->Tag();
|
||||
namespaceID = static_cast<nsIContent*>(parent.get())->GetNameSpaceID();
|
||||
} else {
|
||||
NS_ASSERTION(parent->NodeType() == nsIDOMNode::DOCUMENT_FRAGMENT_NODE,
|
||||
"How come the parent isn't a document, a fragment or an element?");
|
||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче