Merge m-c to fx-team

This commit is contained in:
Carsten "Tomcat" Book 2014-04-25 13:37:42 +02:00
commit 80f313572c
242 changed files with 4857 additions and 3881 deletions

View File

@ -12,7 +12,7 @@
#include "States.h"
#include "mozilla/EventStateManager.h"
#include "mozilla/Selection.h"
#include "mozilla/dom/Selection.h"
using namespace mozilla;
using namespace mozilla::a11y;
@ -127,7 +127,7 @@ AccShowEvent::
////////////////////////////////////////////////////////////////////////////////
AccTextSelChangeEvent::AccTextSelChangeEvent(HyperTextAccessible* aTarget,
Selection* aSelection,
dom::Selection* aSelection,
int32_t aReason) :
AccEvent(nsIAccessibleEvent::EVENT_TEXT_SELECTION_CHANGED, aTarget,
eAutoDetect, eCoalesceTextSelChange),

View File

@ -12,7 +12,9 @@
namespace mozilla {
namespace dom {
class Selection;
}
namespace a11y {
@ -367,7 +369,8 @@ private:
class AccTextSelChangeEvent : public AccEvent
{
public:
AccTextSelChangeEvent(HyperTextAccessible* aTarget, Selection* aSelection,
AccTextSelChangeEvent(HyperTextAccessible* aTarget,
dom::Selection* aSelection,
int32_t aReason);
virtual ~AccTextSelChangeEvent();
@ -386,7 +389,7 @@ public:
bool IsCaretMoveOnly() const;
private:
nsRefPtr<Selection> mSel;
nsRefPtr<dom::Selection> mSel;
int32_t mReason;
friend class EventQueue;

View File

@ -14,11 +14,12 @@
#include "nsIAccessibleTypes.h"
#include "nsIDOMDocument.h"
#include "nsIPresShell.h"
#include "mozilla/Selection.h"
#include "mozilla/dom/Selection.h"
#include "mozilla/dom/Element.h"
using namespace mozilla;
using namespace mozilla::a11y;
using mozilla::dom::Selection;
struct mozilla::a11y::SelData MOZ_FINAL
{

View File

@ -42,7 +42,7 @@ HyperTextAccessible::IsValidRange(int32_t aStartOffset, int32_t aEndOffset)
inline bool
HyperTextAccessible::AddToSelection(int32_t aStartOffset, int32_t aEndOffset)
{
Selection* domSel = DOMSelection();
dom::Selection* domSel = DOMSelection();
return domSel &&
SetSelectionBoundsAt(domSel->GetRangeCount(), aStartOffset, aEndOffset);
}
@ -149,7 +149,7 @@ HyperTextAccessible::FrameSelection() const
return frame ? frame->GetFrameSelection() : nullptr;
}
inline Selection*
inline dom::Selection*
HyperTextAccessible::DOMSelection() const
{
nsRefPtr<nsFrameSelection> frameSelection = FrameSelection();

View File

@ -33,7 +33,7 @@
#include "nsTextFragment.h"
#include "mozilla/dom/Element.h"
#include "mozilla/EventStates.h"
#include "mozilla/Selection.h"
#include "mozilla/dom/Selection.h"
#include "mozilla/MathAlgorithms.h"
#include "gfxSkipChars.h"
#include <algorithm>
@ -1117,7 +1117,7 @@ HyperTextAccessible::SetSelectionRange(int32_t aStartPos, int32_t aEndPos)
if (isFocusable)
TakeFocus();
Selection* domSel = DOMSelection();
dom::Selection* domSel = DOMSelection();
NS_ENSURE_STATE(domSel);
// Set up the selection.
@ -1164,7 +1164,7 @@ HyperTextAccessible::CaretOffset() const
// Turn the focus node and offset of the selection into caret hypretext
// offset.
Selection* domSel = DOMSelection();
dom::Selection* domSel = DOMSelection();
NS_ENSURE_TRUE(domSel, -1);
nsINode* focusNode = domSel->GetFocusNode();
@ -1194,7 +1194,7 @@ HyperTextAccessible::CaretLineNumber()
if (!frameSelection)
return -1;
Selection* domSel =
dom::Selection* domSel =
frameSelection->GetSelection(nsISelectionController::SELECTION_NORMAL);
if (!domSel)
return - 1;
@ -1310,7 +1310,7 @@ HyperTextAccessible::GetSelectionDOMRanges(int16_t aType,
frameSelection->GetDisplaySelection() <= nsISelectionController::SELECTION_HIDDEN)
return;
Selection* domSel = frameSelection->GetSelection(aType);
dom::Selection* domSel = frameSelection->GetSelection(aType);
if (!domSel)
return;
@ -1397,7 +1397,7 @@ HyperTextAccessible::SetSelectionBoundsAt(int32_t aSelectionNum,
int32_t startOffset = ConvertMagicOffset(aStartOffset);
int32_t endOffset = ConvertMagicOffset(aEndOffset);
Selection* domSel = DOMSelection();
dom::Selection* domSel = DOMSelection();
if (!domSel)
return false;
@ -1426,7 +1426,7 @@ HyperTextAccessible::SetSelectionBoundsAt(int32_t aSelectionNum,
bool
HyperTextAccessible::RemoveFromSelection(int32_t aSelectionNum)
{
Selection* domSel = DOMSelection();
dom::Selection* domSel = DOMSelection();
if (!domSel)
return false;
@ -1521,7 +1521,7 @@ HyperTextAccessible::SelectionRanges(nsTArray<a11y::TextRange>* aRanges) const
{
NS_ASSERTION(aRanges->Length() != 0, "TextRange array supposed to be empty");
Selection* sel = DOMSelection();
dom::Selection* sel = DOMSelection();
if (!sel)
return;
@ -1848,7 +1848,7 @@ HyperTextAccessible::GetSpellTextAttribute(nsINode* aNode,
if (!fs)
return NS_OK;
Selection* domSel = fs->GetSelection(nsISelectionController::SELECTION_SPELLCHECK);
dom::Selection* domSel = fs->GetSelection(nsISelectionController::SELECTION_SPELLCHECK);
if (!domSel)
return NS_OK;

View File

@ -489,7 +489,7 @@ protected:
* Return frame/DOM selection object for the accessible.
*/
already_AddRefed<nsFrameSelection> FrameSelection() const;
Selection* DOMSelection() const;
dom::Selection* DOMSelection() const;
/**
* Return selection ranges within the accessible subtree.

View File

@ -86,4 +86,9 @@ contract @mozilla.org/helperapplauncherdialog;1 {710322af-e6ae-4b0c-b2c9-1474a87
component {c83c02c0-5d43-4e3e-987f-9173b313e880} SimulatorScreen.js
contract @mozilla.org/simulator-screen;1 {c83c02c0-5d43-4e3e-987f-9173b313e880}
category profile-after-change SimulatorScreen @mozilla.org/simulator-screen;1
component {e30b0e13-2d12-4cb0-bc4c-4e617a1bf76e} OopCommandLine.js
contract @mozilla.org/commandlinehandler/general-startup;1?type=b2goop {e30b0e13-2d12-4cb0-bc4c-4e617a1bf76e}
category command-line-handler m-b2goop @mozilla.org/commandlinehandler/general-startup;1?type=b2goop
#endif

View File

@ -0,0 +1,47 @@
/* 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/. */
const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Services", "resource://gre/modules/Services.jsm");
function oopCommandlineHandler() {
}
oopCommandlineHandler.prototype = {
handle: function(cmdLine) {
let oopFlag = cmdLine.handleFlag("oop", false);
if (oopFlag) {
/**
* Manipulate preferences by adding to the *default* branch. Adding
* to the default branch means the changes we make won"t get written
* back to user preferences.
*/
let prefs = Services.prefs
let branch = prefs.getDefaultBranch("");
try {
// Turn on all OOP services, making desktop run similar to phone
// environment
branch.setBoolPref("dom.ipc.tabs.disabled", false);
branch.setBoolPref("layers.acceleration.disabled", false);
branch.setBoolPref("layers.offmainthreadcomposition.enabled", true);
branch.setBoolPref("layers.offmainthreadcomposition.async-animations", true);
branch.setBoolPref("layers.async-video.enabled", true);
branch.setBoolPref("layers.async-pan-zoom.enabled", true);
branch.setCharPref("gfx.content.azure.backends", "cairo");
} catch (e) { }
}
if (cmdLine.state == Ci.nsICommandLine.STATE_REMOTE_AUTO) {
cmdLine.preventDefault = true;
}
},
helpInfo: " -oop Use out-of-process model in B2G\n",
classID: Components.ID("{e30b0e13-2d12-4cb0-bc4c-4e617a1bf76e}"),
QueryInterface: XPCOMUtils.generateQI([Ci.nsICommandLineHandler]),
};
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([oopCommandlineHandler]);

View File

@ -25,6 +25,7 @@ EXTRA_COMPONENTS += [
if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'gonk':
EXTRA_COMPONENTS += [
'OopCommandLine.js',
'SimulatorScreen.js'
]

View File

@ -19,7 +19,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="73b5d6a8773aa048054119bf5b3ca0d005b5494e"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="facd91d31db983a60c7f1035ca01b727c7a1de65"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="0292e64ef8451df104dcf9ac3b2c6749b81684dd"/>

View File

@ -17,7 +17,7 @@
</project>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="73b5d6a8773aa048054119bf5b3ca0d005b5494e"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="facd91d31db983a60c7f1035ca01b727c7a1de65"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="8d6c36d74ba9aefbc8c3618fc93dd4907a0dbf5e"/>

View File

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="65fba428f8d76336b33ddd9e15900357953600ba">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="73b5d6a8773aa048054119bf5b3ca0d005b5494e"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="facd91d31db983a60c7f1035ca01b727c7a1de65"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/>

View File

@ -19,7 +19,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="73b5d6a8773aa048054119bf5b3ca0d005b5494e"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="facd91d31db983a60c7f1035ca01b727c7a1de65"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="0292e64ef8451df104dcf9ac3b2c6749b81684dd"/>

View File

@ -1,6 +1,6 @@
[
{"size": 169226356,
"digest": "f9456848fd661b8be05d6a30607fad4787bcecfe676b53f9a4074653fdda6a377c961038c866c5d83355e3afd89f1a3bd947a142aeaf7dd7d81b6c376185badd",
{"size": 156447892,
"digest": "02b2e6bcaff4ccadfd85a75cc1dfb526be7937673ed18b2c6fb7fe2256a725bc778d513e3820d86adaec1636e1771bd0c5663e17bf2d3f1d6b445ff1e0a136f2",
"filename": "backup-flame.tar.xz",
"algorithm": "sha512"
}

View File

@ -18,7 +18,7 @@
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1f6a1fe07f81c5bc5e1d079c9b60f7f78ca2bf4f"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="73b5d6a8773aa048054119bf5b3ca0d005b5494e"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="facd91d31db983a60c7f1035ca01b727c7a1de65"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="8d6c36d74ba9aefbc8c3618fc93dd4907a0dbf5e"/>
@ -120,7 +120,7 @@
<project name="device/generic/armv7-a-neon" path="device/generic/armv7-a-neon" revision="e8a318f7690092e639ba88891606f4183e846d3f"/>
<project name="device/qcom/common" path="device/qcom/common" revision="234ed34543345f58c0d4dcb1aa012de68802b9dc"/>
<project name="device-flame" path="device/t2m/flame" remote="b2g" revision="9729afa15ae3362db1852eee60422947db614dd6"/>
<project name="kernel/msm" path="kernel" revision="b3092c54430df89636fb0670d32058bc63474017"/>
<project name="kernel/msm" path="kernel" revision="3f7af9ae7ef30dc1c37972ed0ad957fc64219f31"/>
<project name="platform/bootable/recovery" path="bootable/recovery" revision="f2914eacee9120680a41463708bb6ee8291749fc"/>
<project name="platform/external/bluetooth/bluedroid" path="external/bluetooth/bluedroid" revision="fa892235a9bd8983f8b591129fc1a9398f64e514"/>
<project name="platform/external/bluetooth/bluez" path="external/bluetooth/bluez" revision="f0689ac1914cdbc59e53bdc9edd9013dc157c299"/>

View File

@ -4,6 +4,6 @@
"remote": "",
"branch": ""
},
"revision": "d3ee2aca1f8e4d7e1c721f445d6956d73066126b",
"revision": "2fccee502f455ba2ca7178efa5cf247d90df8afb",
"repo_path": "/integration/gaia-central"
}

View File

@ -17,7 +17,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="73b5d6a8773aa048054119bf5b3ca0d005b5494e"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="facd91d31db983a60c7f1035ca01b727c7a1de65"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1f6a1fe07f81c5bc5e1d079c9b60f7f78ca2bf4f"/>

View File

@ -15,7 +15,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="73b5d6a8773aa048054119bf5b3ca0d005b5494e"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="facd91d31db983a60c7f1035ca01b727c7a1de65"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1f6a1fe07f81c5bc5e1d079c9b60f7f78ca2bf4f"/>

View File

@ -19,7 +19,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="73b5d6a8773aa048054119bf5b3ca0d005b5494e"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="facd91d31db983a60c7f1035ca01b727c7a1de65"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1f6a1fe07f81c5bc5e1d079c9b60f7f78ca2bf4f"/>

View File

@ -17,7 +17,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="73b5d6a8773aa048054119bf5b3ca0d005b5494e"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="facd91d31db983a60c7f1035ca01b727c7a1de65"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1f6a1fe07f81c5bc5e1d079c9b60f7f78ca2bf4f"/>

View File

@ -17,7 +17,7 @@
</project>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="73b5d6a8773aa048054119bf5b3ca0d005b5494e"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="facd91d31db983a60c7f1035ca01b727c7a1de65"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="8d6c36d74ba9aefbc8c3618fc93dd4907a0dbf5e"/>

View File

@ -17,7 +17,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="73b5d6a8773aa048054119bf5b3ca0d005b5494e"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="facd91d31db983a60c7f1035ca01b727c7a1de65"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1f6a1fe07f81c5bc5e1d079c9b60f7f78ca2bf4f"/>

View File

@ -139,7 +139,6 @@
@BINPATH@/components/composer.xpt
@BINPATH@/components/content_base.xpt
@BINPATH@/components/content_events.xpt
@BINPATH@/components/content_canvas.xpt
@BINPATH@/components/content_htmldoc.xpt
@BINPATH@/components/content_html.xpt
@BINPATH@/components/content_xslt.xpt
@ -432,6 +431,7 @@
@BINPATH@/components/amContentHandler.js
@BINPATH@/components/amWebInstallListener.js
@BINPATH@/components/nsBlocklistService.js
@BINPATH@/components/OopCommandLine.js
#endif
#ifdef MOZ_UPDATER

View File

@ -286,6 +286,10 @@ let SessionHistoryListener = {
return true;
},
OnHistoryReplaceEntry: function (index) {
this.collect();
},
QueryInterface: XPCOMUtils.generateQI([
Ci.nsISHistoryListener,
Ci.nsISupportsWeakReference

View File

@ -369,6 +369,7 @@ HistoryListener.prototype = {
OnHistoryGoForward: function(forwardURI) { return true; },
OnHistoryGotoIndex: function(index, gotoURI) { return true; },
OnHistoryPurge: function(numEntries) { return true; },
OnHistoryReplaceEntry: function(index) {},
OnHistoryReload: function(reloadURI, reloadFlags) {
this.callback();

View File

@ -2581,6 +2581,12 @@ let SessionStoreInternal = {
// Save the index in case we updated it above.
tabData.index = activeIndex + 1;
// In electrolysis, we may need to change the browser's remote
// attribute so that it runs in a content process.
let activePageData = tabData.entries[activeIndex] || null;
let uri = activePageData ? activePageData.url || null : null;
tabbrowser.updateBrowserRemoteness(browser, uri);
// Start a new epoch and include the epoch in the restoreHistory
// message. If a message is received that relates to a previous epoch, we
// discard it.
@ -2604,12 +2610,6 @@ let SessionStoreInternal = {
pageStyle: tabData.pageStyle || null
});
// In electrolysis, we may need to change the browser's remote
// attribute so that it runs in a content process.
let activePageData = tabData.entries[activeIndex] || null;
let uri = activePageData ? activePageData.url || null : null;
tabbrowser.updateBrowserRemoteness(browser, uri);
browser.messageManager.sendAsyncMessage("SessionStore:restoreHistory",
{tabData: tabData, epoch: epoch});

View File

@ -220,15 +220,15 @@ add_task(function test_pushstate_replacestate() {
is(entries[1].url, "http://example.com/test-entry/", "url is correct");
// Disabled until replaceState invalidation is supported. See Bug 967028.
// browser.messageManager.
// sendAsyncMessage("ss-test:historyReplaceState", {url: 'test-entry2/'});
// yield promiseContentMessage(browser, "ss-test:historyReplaceState");
browser.messageManager.
sendAsyncMessage("ss-test:historyReplaceState", {url: 'test-entry2/'});
yield promiseContentMessage(browser, "ss-test:historyReplaceState");
// // Check that we have modified the history entry.
// SyncHandlers.get(browser).flush();
// let {entries} = JSON.parse(ss.getTabState(tab));
// is(entries.length, 2, "there is still two shistory entries");
// is(entries[1].url, "http://example.com/test-entry/test-entry2/", "url is correct");
// Check that we have modified the history entry.
SyncHandlers.get(browser).flush();
let {entries} = JSON.parse(ss.getTabState(tab));
is(entries.length, 2, "there is still two shistory entries");
is(entries[1].url, "http://example.com/test-entry/test-entry2/", "url is correct");
// Cleanup.
gBrowser.removeTab(tab);

View File

@ -170,7 +170,6 @@
@BINPATH@/components/composer.xpt
@BINPATH@/components/content_base.xpt
@BINPATH@/components/content_events.xpt
@BINPATH@/components/content_canvas.xpt
@BINPATH@/components/content_htmldoc.xpt
@BINPATH@/components/content_html.xpt
#ifdef MOZ_WEBRTC

View File

@ -109,12 +109,12 @@ template<class T> class nsReadingIterator;
namespace mozilla {
class ErrorResult;
class EventListenerManager;
class Selection;
namespace dom {
class DocumentFragment;
class Element;
class EventTarget;
class Selection;
} // namespace dom
namespace layers {
@ -2086,7 +2086,7 @@ public:
* @param aOutStartOffset Output start offset
* @param aOutEndOffset Output end offset
*/
static void GetSelectionInTextControl(mozilla::Selection* aSelection,
static void GetSelectionInTextControl(mozilla::dom::Selection* aSelection,
Element* aRoot,
int32_t& aOutStartOffset,
int32_t& aOutEndOffset);

View File

@ -331,7 +331,7 @@ interface nsIXMLHttpRequest : nsISupports
readonly attribute boolean mozSystem;
};
[scriptable, uuid(840d0d00-e83e-4a29-b3c7-67e96e90a499)]
[uuid(840d0d00-e83e-4a29-b3c7-67e96e90a499)]
interface nsIXHRSendable : nsISupports {
void getSendInfo(out nsIInputStream body,
out uint64_t contentLength,

View File

@ -50,7 +50,7 @@
#include "mozilla/Likely.h"
#include "mozilla/MouseEvents.h"
#include "mozilla/Preferences.h"
#include "mozilla/Selection.h"
#include "mozilla/dom/Selection.h"
#include "mozilla/TextEvents.h"
#include "nsAString.h"
#include "nsAttrName.h"

View File

@ -49,7 +49,7 @@
#include "mozilla/dom/Element.h"
#include "mozilla/EventDispatcher.h"
#include "mozilla/Preferences.h"
#include "mozilla/Selection.h"
#include "mozilla/dom/Selection.h"
using namespace mozilla;
using namespace mozilla::dom;

View File

@ -38,7 +38,7 @@
#include "nsIScriptContext.h"
#include "nsIScriptGlobalObject.h"
#include "nsIScriptSecurityManager.h"
#include "mozilla/Selection.h"
#include "mozilla/dom/Selection.h"
#include "nsISelectionPrivate.h"
#include "nsITransferable.h" // for kUnicodeMime
#include "nsContentUtils.h"

View File

@ -4,12 +4,6 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
XPIDL_SOURCES += [
'nsICanvasGLPrivate.idl',
]
XPIDL_MODULE = 'content_canvas'
EXPORTS += [
'nsICanvasRenderingContextInternal.h',
]

View File

@ -1,20 +0,0 @@
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsISupports.idl"
/* These are private interface that's used to identify
* specific concrete classes so we know what we can cast.
*/
[scriptable, uuid(eba2aa03-ae19-46e2-bad7-6b966037e22c)]
interface nsICanvasGLBuffer : nsISupports
{
};
[scriptable, uuid(27310aab-1988-43e8-882e-6293c8c9df60)]
interface nsICanvasGLTexture : nsISupports
{
};

View File

@ -12,8 +12,7 @@
* which implements the phonetic interface.
*/
[scriptable, uuid(BC6EA726-AB56-46b6-A21A-AA7B76D6818F)]
[uuid(BC6EA726-AB56-46b6-A21A-AA7B76D6818F)]
interface nsIPhonetic : nsISupports
{
/**

View File

@ -35,7 +35,7 @@
#include "nsServiceManagerUtils.h"
#include "nsIEditor.h"
#include "nsTextEditRules.h"
#include "mozilla/Selection.h"
#include "mozilla/dom/Selection.h"
#include "mozilla/EventListenerManager.h"
#include "nsContentUtils.h"
#include "mozilla/Preferences.h"

View File

@ -234,7 +234,7 @@ public:
{
// Deprecated
}
mozilla::Selection* GetSelection(mozilla::ErrorResult& aRv);
mozilla::dom::Selection* GetSelection(mozilla::ErrorResult& aRv);
// The XPCOM CaptureEvents works fine for us.
// The XPCOM ReleaseEvents works fine for us.
// We're picking up GetLocation from Document

View File

@ -10871,21 +10871,31 @@ nsDocShell::AddState(JS::Handle<JS::Value> aData, const nsAString& aTitle,
// Step 5: If aReplace is false, indicating that we're doing a pushState
// rather than a replaceState, notify bfcache that we've added a page to
// the history so it can evict content viewers if appropriate.
// the history so it can evict content viewers if appropriate. Otherwise
// call ReplaceEntry so that we notify nsIHistoryListeners that an entry
// was replaced.
nsCOMPtr<nsISHistory> rootSH;
GetRootSessionHistory(getter_AddRefs(rootSH));
NS_ENSURE_TRUE(rootSH, NS_ERROR_UNEXPECTED);
nsCOMPtr<nsISHistoryInternal> internalSH =
do_QueryInterface(rootSH);
NS_ENSURE_TRUE(internalSH, NS_ERROR_UNEXPECTED);
if (!aReplace) {
nsCOMPtr<nsISHistory> rootSH;
GetRootSessionHistory(getter_AddRefs(rootSH));
NS_ENSURE_TRUE(rootSH, NS_ERROR_UNEXPECTED);
nsCOMPtr<nsISHistoryInternal> internalSH =
do_QueryInterface(rootSH);
NS_ENSURE_TRUE(internalSH, NS_ERROR_UNEXPECTED);
int32_t curIndex = -1;
rv = rootSH->GetIndex(&curIndex);
if (NS_SUCCEEDED(rv) && curIndex > -1) {
internalSH->EvictOutOfRangeContentViewers(curIndex);
}
} else {
nsCOMPtr<nsISHEntry> rootSHEntry = GetRootSHEntry(newSHEntry);
int32_t index = -1;
rv = rootSH->GetIndexOfEntry(rootSHEntry, &index);
if (NS_SUCCEEDED(rv) && index > -1) {
internalSH->ReplaceEntry(index, rootSHEntry);
}
}
// Step 6: If the document's URI changed, update document's URI and update

View File

@ -22,12 +22,12 @@ interface nsISimpleEnumerator;
%{C++
#define NS_SHISTORY_CID \
{0x7294fe9c, 0x14d8, 0x11d5, {0x98, 0x82, 0x00, 0xC0, 0x4f, 0xa0, 0x2f, 0x40}}
{0x7b807041, 0xe60a, 0x4384, {0x93, 0x5f, 0xaf, 0x30, 0x61, 0xd8, 0xb8, 0x15}}
#define NS_SHISTORY_CONTRACTID "@mozilla.org/browser/shistory;1"
%}
[scriptable, uuid(b4440e2e-0fc2-11e3-971f-59e799890b3c)]
[scriptable, uuid(7b807041-e60a-4384-935f-af3061d8b815)]
interface nsISHistory: nsISupports
{
/**
@ -147,4 +147,16 @@ interface nsISHistory: nsISupports
readonly attribute nsISimpleEnumerator SHistoryEnumerator;
void reloadCurrentEntry();
/**
* Called to obtain the index to a given history entry.
*
* @param aEntry The entry to obtain the index of.
*
* @return <code>NS_OK</code> index for the history entry
* is obtained successfully.
* <code>NS_ERROR_FAILURE</code> Error in obtaining
* index for the given history entry.
*/
long getIndexOfEntry(in nsISHEntry aEntry);
};

View File

@ -21,7 +21,7 @@ interface nsIURI;
* A session history listener can be registered on a particular nsISHistory
* instance via the nsISHistory::addSHistoryListener() method.
*/
[scriptable, uuid(3b07f591-e8e1-11d4-9882-00c04fa02f40)]
[scriptable, uuid(125c0833-746a-400e-9b89-d2d18545c08a)]
interface nsISHistoryListener : nsISupports
{
/**
@ -87,4 +87,14 @@ interface nsISHistoryListener : nsISupports
* @return Whether the operation can proceed.
*/
boolean OnHistoryPurge(in long aNumEntries);
/**
* Called when an entry is replaced in the session history. Entries are
* replaced when navigating away from non-persistent history entries (such as
* about pages) and when history.replaceState is called.
*
* @param aIndex The index in session history of the entry being
* replaced
*/
void OnHistoryReplaceEntry(in long aIndex);
};

View File

@ -415,8 +415,11 @@ nsSHistory::AddEntry(nsISHEntry * aSHEntry, bool aPersist)
if(currentTxn)
currentTxn->GetPersist(&currentPersist);
int32_t currentIndex = mIndex;
if(!currentPersist)
{
NOTIFY_LISTENERS(OnHistoryReplaceEntry, (currentIndex));
NS_ENSURE_SUCCESS(currentTxn->SetSHEntry(aSHEntry),NS_ERROR_FAILURE);
currentTxn->SetPersist(aPersist);
return NS_OK;
@ -426,7 +429,6 @@ nsSHistory::AddEntry(nsISHEntry * aSHEntry, bool aPersist)
NS_ENSURE_TRUE(txn, NS_ERROR_FAILURE);
nsCOMPtr<nsIURI> uri;
int32_t currentIndex = mIndex;
aSHEntry->GetURI(getter_AddRefs(uri));
NOTIFY_LISTENERS(OnHistoryNewEntry, (uri));
@ -555,6 +557,50 @@ nsSHistory::GetTransactionAtIndex(int32_t aIndex, nsISHTransaction ** aResult)
return NS_OK;
}
/* Get the index of a given entry */
NS_IMETHODIMP
nsSHistory::GetIndexOfEntry(nsISHEntry* aSHEntry, int32_t* aResult) {
NS_ENSURE_ARG(aSHEntry);
NS_ENSURE_ARG_POINTER(aResult);
*aResult = -1;
if (mLength <= 0) {
return NS_ERROR_FAILURE;
}
nsCOMPtr<nsISHTransaction> currentTxn;
int32_t cnt = 0;
nsresult rv = GetRootTransaction(getter_AddRefs(currentTxn));
if (NS_FAILED(rv) || !currentTxn) {
return NS_ERROR_FAILURE;
}
while (true) {
nsCOMPtr<nsISHEntry> entry;
rv = currentTxn->GetSHEntry(getter_AddRefs(entry));
if (NS_FAILED(rv) || !entry) {
return NS_ERROR_FAILURE;
}
if (aSHEntry == entry) {
*aResult = cnt;
break;
}
rv = currentTxn->GetNext(getter_AddRefs(currentTxn));
if (NS_FAILED(rv) || !currentTxn) {
return NS_ERROR_FAILURE;
}
cnt++;
}
return NS_OK;
}
#ifdef DEBUG
nsresult
nsSHistory::PrintHistory()
@ -734,6 +780,8 @@ nsSHistory::ReplaceEntry(int32_t aIndex, nsISHEntry * aReplaceEntry)
if(currentTxn)
{
NOTIFY_LISTENERS(OnHistoryReplaceEntry, (aIndex));
// Set the replacement entry in the transaction
rv = currentTxn->SetSHEntry(aReplaceEntry);
rv = currentTxn->SetPersist(true);

View File

@ -39,6 +39,8 @@ SHistoryListener.prototype = {
return this.retval;
},
OnHistoryReplaceEntry: function (aIndex) {},
QueryInterface: XPCOMUtils.generateQI([Ci.nsISHistoryListener,
Ci.nsISupportsWeakReference])
};

View File

@ -39,6 +39,7 @@ function test() {
OnHistoryGoForward: function () true,
OnHistoryGotoIndex: function () true,
OnHistoryPurge: function () true,
OnHistoryReplaceEntry: function () true,
QueryInterface: XPCOMUtils.generateQI([Ci.nsISHistoryListener,
Ci.nsISupportsWeakReference])

View File

@ -6,7 +6,7 @@
interface nsIDOMWindow;
[scriptable, uuid(194b55d9-39c0-45c6-b8ef-b8049f978ea5)]
[uuid(194b55d9-39c0-45c6-b8ef-b8049f978ea5)]
interface nsIAudioChannelAgentCallback : nsISupports
{
/**
@ -40,7 +40,7 @@ interface nsIAudioChannelAgentCallback : nsISupports
* 1. Changes to the playable status of this channel.
*/
[scriptable, uuid(2b0222a5-8f7b-49d2-9ab8-cd01b744b23e)]
[uuid(2b0222a5-8f7b-49d2-9ab8-cd01b744b23e)]
interface nsIAudioChannelAgent : nsISupports
{
const long AUDIO_AGENT_CHANNEL_NORMAL = 0;

View File

@ -75,7 +75,6 @@
// DOM core includes
#include "nsError.h"
#include "nsIDOMUserDataHandler.h"
#include "nsIDOMXPathNamespace.h"
#include "nsIDOMXULButtonElement.h"
#include "nsIDOMXULCheckboxElement.h"
#include "nsIDOMXULPopupElement.h"
@ -223,7 +222,6 @@ DOMCI_DATA_NO_CLASS(DOMPrototype)
DOMCI_DATA_NO_CLASS(DOMConstructor)
DOMCI_DATA_NO_CLASS(UserDataHandler)
DOMCI_DATA_NO_CLASS(XPathNamespace)
DOMCI_DATA_NO_CLASS(XULControlElement)
DOMCI_DATA_NO_CLASS(XULLabeledControlElement)
DOMCI_DATA_NO_CLASS(XULButtonElement)
@ -448,8 +446,6 @@ static nsDOMClassInfoData sClassInfoData[] = {
NS_DEFINE_CHROME_XBL_CLASSINFO_DATA(UserDataHandler, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(XPathNamespace, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CHROME_XBL_CLASSINFO_DATA(XULControlElement, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CHROME_XBL_CLASSINFO_DATA(XULLabeledControlElement, nsDOMGenericSH,
@ -1121,10 +1117,6 @@ nsDOMClassInfo::Init()
DOM_CLASSINFO_MAP_ENTRY(nsIDOMUserDataHandler)
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN_NO_CLASS_IF(XPathNamespace, nsIDOMXPathNamespace)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMXPathNamespace)
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN_NO_CLASS_IF(XULControlElement, nsIDOMXULControlElement)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMXULControlElement)
DOM_CLASSINFO_MAP_END
@ -3166,7 +3158,6 @@ const InterfaceShimEntry kInterfaceShimMap[] =
{ "nsIDOMRange", "Range" },
{ "nsIDOMSVGLength", "SVGLength" },
{ "nsIDOMNodeFilter", "NodeFilter" },
{ "nsIDOMXPathNamespace", "XPathNamespace" },
{ "nsIDOMXPathResult", "XPathResult" } };
static nsresult

View File

@ -93,7 +93,6 @@ DOMCI_CLASS(CSSPageRule)
DOMCI_CLASS(CSSFontFeatureValuesRule)
DOMCI_CLASS(UserDataHandler)
DOMCI_CLASS(XPathNamespace)
DOMCI_CLASS(XULControlElement)
DOMCI_CLASS(XULLabeledControlElement)
DOMCI_CLASS(XULButtonElement)

View File

@ -27,7 +27,7 @@
#include "nsIBaseWindow.h"
#include "nsViewManager.h"
#include "nsFrameSelection.h"
#include "mozilla/Selection.h"
#include "mozilla/dom/Selection.h"
#include "nsXULPopupManager.h"
#include "nsIScriptObjectPrincipal.h"
#include "nsIPrincipal.h"

View File

@ -172,7 +172,7 @@
#include "nsIDragService.h"
#include "mozilla/dom/Element.h"
#include "mozilla/Selection.h"
#include "mozilla/dom/Selection.h"
#include "nsFrameLoader.h"
#include "nsISupportsPrimitives.h"
#include "nsXPCOMCID.h"
@ -1607,6 +1607,8 @@ nsGlobalWindow::FreeInnerObjects()
mAudioContexts.Clear();
#ifdef MOZ_GAMEPAD
DisableGamepadUpdates();
mHasGamepad = false;
mGamepads.Clear();
#endif
}

View File

@ -104,7 +104,6 @@ class nsWindowSizes;
namespace mozilla {
class DOMEventTargetHelper;
class Selection;
namespace dom {
class BarProp;
class Console;
@ -114,6 +113,7 @@ class Gamepad;
class MediaQueryList;
class Navigator;
class OwningExternalOrWindowProxy;
class Selection;
class SpeechSynthesis;
class WakeLock;
namespace indexedDB {
@ -882,7 +882,7 @@ public:
mozilla::ErrorResult& aError);
nsIDOMStorage* GetSessionStorage(mozilla::ErrorResult& aError);
nsIDOMStorage* GetLocalStorage(mozilla::ErrorResult& aError);
mozilla::Selection* GetSelection(mozilla::ErrorResult& aError);
mozilla::dom::Selection* GetSelection(mozilla::ErrorResult& aError);
mozilla::dom::indexedDB::IDBFactory* GetIndexedDB(mozilla::ErrorResult& aError);
already_AddRefed<nsICSSDeclaration>
GetComputedStyle(mozilla::dom::Element& aElt, const nsAString& aPseudoElt,

View File

@ -974,7 +974,6 @@ DOMInterfaces = {
},
'Selection': {
'nativeType': 'mozilla::Selection',
'resultNotAddRefed': [ 'anchorNode', 'focusNode', 'getRangeAt' ],
},

View File

@ -1378,6 +1378,37 @@ BluetoothHfpManager::GetNumberOfCalls(uint16_t aState)
return num;
}
uint32_t
BluetoothHfpManager::GetNumberOfConCalls()
{
uint32_t num = 0;
uint32_t callLength = mCurrentCallArray.Length();
for (uint32_t i = 1; i < callLength; ++i) {
if (mCurrentCallArray[i].mIsConference) {
++num;
}
}
return num;
}
uint32_t
BluetoothHfpManager::GetNumberOfConCalls(uint16_t aState)
{
uint32_t num = 0;
uint32_t callLength = mCurrentCallArray.Length();
for (uint32_t i = 1; i < callLength; ++i) {
if (mCurrentCallArray[i].mIsConference
&& mCurrentCallArray[i].mState == aState) {
++num;
}
}
return num;
}
void
BluetoothHfpManager::HandleCallStateChanged(uint32_t aCallIndex,
uint16_t aCallState,
@ -1422,15 +1453,59 @@ BluetoothHfpManager::HandleCallStateChanged(uint32_t aCallIndex,
switch (aCallState) {
case nsITelephonyProvider::CALL_STATE_HELD:
if (prevCallState == nsITelephonyProvider::CALL_STATE_CONNECTED) {
if (mCurrentCallArray.Length() == 1) {
// A single active call is put on hold (+CIEV, callheld=2)
sCINDItems[CINDType::CALLHELD].value = CallHeldState::ONHOLD_NOACTIVE;
} else {
// Releases all active calls and accepts the other (+CIEV, callheld=1)
sCINDItems[CINDType::CALLHELD].value = CallHeldState::ONHOLD_ACTIVE;
switch (prevCallState) {
case nsITelephonyProvider::CALL_STATE_CONNECTED: {
uint32_t numActive = GetNumberOfCalls(nsITelephonyProvider::CALL_STATE_CONNECTED);
uint32_t numHeld = GetNumberOfCalls(nsITelephonyProvider::CALL_STATE_HELD);
uint32_t numConCalls = GetNumberOfConCalls();
/**
* An active call becomes a held call.
*
* If this call is not a conference call,
* - callheld state = ONHOLD_NOACTIVE if no active call remains;
* - callheld state = ONHOLD_ACTIVE otherwise.
* If this call belongs to a conference call and all other members of
* the conference call have become held calls,
* - callheld state = ONHOLD_NOACTIVE if no active call remains;
* - callheld state = ONHOLD_ACTIVE otherwise.
*
* Note number of active calls may be 0 in-between state transition
* (c1 has become held but c2 has not become active yet), so we regard
* no active call remains if there is no other active/held call
* besides this changed call/group of conference call.
*/
if (!aIsConference) {
if (numActive + numHeld == 1) {
// A single active call is put on hold.
sCINDItems[CINDType::CALLHELD].value = CallHeldState::ONHOLD_NOACTIVE;
} else {
// An active call is placed on hold or active/held calls swapped.
sCINDItems[CINDType::CALLHELD].value = CallHeldState::ONHOLD_ACTIVE;
}
SendCommand(RESPONSE_CIEV, CINDType::CALLHELD);
} else if (GetNumberOfConCalls(nsITelephonyProvider::CALL_STATE_HELD)
== numConCalls) {
if (numActive + numHeld == numConCalls) {
// An active conference call is put on hold.
sCINDItems[CINDType::CALLHELD].value = CallHeldState::ONHOLD_NOACTIVE;
} else {
// Active calls are placed on hold or active/held calls swapped.
sCINDItems[CINDType::CALLHELD].value = CallHeldState::ONHOLD_ACTIVE;
}
SendCommand(RESPONSE_CIEV, CINDType::CALLHELD);
}
break;
}
SendCommand(RESPONSE_CIEV, CINDType::CALLHELD);
case nsITelephonyProvider::CALL_STATE_DISCONNECTED:
// The call state changed from DISCONNECTED to HELD. It could happen
// when user held a call before Bluetooth got connected.
if (FindFirstCall(nsITelephonyProvider::CALL_STATE_CONNECTED)) {
// callheld = ONHOLD_ACTIVE if an active call already exists.
sCINDItems[CINDType::CALLHELD].value = CallHeldState::ONHOLD_ACTIVE;
SendCommand(RESPONSE_CIEV, CINDType::CALLHELD);
}
break;
}
break;
case nsITelephonyProvider::CALL_STATE_INCOMING:
@ -1476,6 +1551,12 @@ BluetoothHfpManager::HandleCallStateChanged(uint32_t aCallIndex,
ConnectSco();
break;
case nsITelephonyProvider::CALL_STATE_CONNECTED:
/**
* A call becomes active because:
* - user answers an incoming call,
* - user dials a outgoing call and it is answered, or
* - SLC is connected when a call is active.
*/
switch (prevCallState) {
case nsITelephonyProvider::CALL_STATE_INCOMING:
case nsITelephonyProvider::CALL_STATE_DISCONNECTED:
@ -1488,10 +1569,15 @@ BluetoothHfpManager::HandleCallStateChanged(uint32_t aCallIndex,
// Outgoing call
UpdateCIND(CINDType::CALL, CallState::IN_PROGRESS, aSend);
UpdateCIND(CINDType::CALLSETUP, CallSetupState::NO_CALLSETUP, aSend);
if (FindFirstCall(nsITelephonyProvider::CALL_STATE_HELD)) {
// callheld state = ONHOLD_ACTIVE if a held call already exists.
UpdateCIND(CINDType::CALLHELD, CallHeldState::ONHOLD_ACTIVE, aSend);
}
break;
// User wants to add a held call to the conversation.
// The original connected call become a conference call here.
case nsITelephonyProvider::CALL_STATE_CONNECTED:
// User wants to add a held call to the conversation.
// The original connected call becomes a conference call here.
if (aIsConference) {
UpdateCIND(CINDType::CALLHELD, CallHeldState::NO_CALLHELD, aSend);
}
@ -1499,7 +1585,7 @@ BluetoothHfpManager::HandleCallStateChanged(uint32_t aCallIndex,
case nsITelephonyProvider::CALL_STATE_HELD:
if (!FindFirstCall(nsITelephonyProvider::CALL_STATE_HELD)) {
if (aIsConference && !prevCallIsConference) {
// The held call was merged and become a conference call.
// The held call was merged and becomes a conference call.
UpdateCIND(CINDType::CALLHELD, CallHeldState::NO_CALLHELD, aSend);
} else if (sCINDItems[CINDType::CALLHELD].value ==
CallHeldState::ONHOLD_NOACTIVE) {

View File

@ -157,6 +157,8 @@ private:
void ResetCallArray();
uint32_t FindFirstCall(uint16_t aState);
uint32_t GetNumberOfCalls(uint16_t aState);
uint32_t GetNumberOfConCalls();
uint32_t GetNumberOfConCalls(uint16_t aState);
PhoneType GetPhoneType(const nsAString& aType);
#endif

View File

@ -276,28 +276,6 @@ KeyboardEvent::InitKeyEvent(const nsAString& aType,
return NS_OK;
}
void
KeyboardEvent::InitKeyboardEvent(const nsAString& aType,
bool aCanBubble,
bool aCancelable,
nsIDOMWindow* aView,
uint32_t aDetail,
const nsAString& aKey,
uint32_t aLocation,
const nsAString& aModifiersList,
bool aRepeat,
ErrorResult& aRv)
{
aRv = UIEvent::InitUIEvent(aType, aCanBubble, aCancelable, aView, aDetail);
WidgetKeyboardEvent* keyEvent = mEvent->AsKeyboardEvent();
keyEvent->modifiers = UIEvent::ComputeModifierState(aModifiersList);
keyEvent->location = aLocation;
keyEvent->mIsRepeat = aRepeat;
keyEvent->mKeyNameIndex = KEY_NAME_INDEX_USE_STRING;
keyEvent->mKeyValue = aKey;
}
} // namespace dom
} // namespace mozilla

View File

@ -69,13 +69,6 @@ public:
aKeyCode, aCharCode);
}
void InitKeyboardEvent(const nsAString& aType,
bool aCanBubble, bool aCancelable,
nsIDOMWindow* aView, uint32_t aDetail,
const nsAString& aKey, uint32_t aLocation,
const nsAString& aModifiersList, bool aRepeat,
ErrorResult& aRv);
private:
// True, if the instance is created with Constructor().
bool mInitializedByCtor;

View File

@ -20,126 +20,55 @@ SimpleTest.waitForFocus(runTests, window);
function testInitializingUntrustedEvent()
{
const kTests = [
// initKeyEvent
{ createEventArg: "KeyboardEvent", useInitKeyboardEvent: false,
{ createEventArg: "KeyboardEvent",
type: "keydown", bubbles: true, cancelable: true, view: null,
ctrlKey: false, altKey: false, shiftKey: false, metaKey: false,
keyCode: 0x00, charCode: 0x00,
detail: 0, key: "", location: 0, modifiersList: "", repeat: false,
}, // 0
keyCode: 0x00, charCode: 0x00 },
{ createEventArg: "keyboardevent", useInitKeyboardEvent: false,
{ createEventArg: "keyboardevent",
type: "keyup", bubbles: false, cancelable: true, view: window,
ctrlKey: true, altKey: false, shiftKey: false, metaKey: false,
keyCode: 0x10, charCode: 0x00,
detail: 0, key: "", location: 0, modifiersList: "", repeat: false,
}, // 1
keyCode: 0x10, charCode: 0x00 },
{ createEventArg: "Keyboardevent", useInitKeyboardEvent: false,
{ createEventArg: "Keyboardevent",
type: "keypess", bubbles: true, cancelable: false, view: null,
ctrlKey: false, altKey: true, shiftKey: false, metaKey: false,
keyCode: 0x11, charCode: 0x30,
detail: 0, key: "", location: 0, modifiersList: "", repeat: false,
}, // 2
keyCode: 0x11, charCode: 0x30 },
{ createEventArg: "keyboardEvent", useInitKeyboardEvent: false,
{ createEventArg: "keyboardEvent",
type: "boo", bubbles: false, cancelable: false, view: window,
ctrlKey: false, altKey: false, shiftKey: true, metaKey: false,
keyCode: 0x30, charCode: 0x40,
detail: 0, key: "", location: 0, modifiersList: "", repeat: false,
}, // 3
keyCode: 0x30, charCode: 0x40 },
{ createEventArg: "KeyEvents", useInitKeyboardEvent: false,
{ createEventArg: "KeyEvents",
type: "foo", bubbles: true, cancelable: true, view: null,
ctrlKey: false, altKey: false, shiftKey: false, metaKey: true,
keyCode: 0x00, charCode: 0x50,
detail: 0, key: "", location: 0, modifiersList: "", repeat: false,
}, // 4
keyCode: 0x00, charCode: 0x50 },
{ createEventArg: "keyevents", useInitKeyboardEvent: false,
{ createEventArg: "keyevents",
type: "bar", bubbles: false, cancelable: true, view: window,
ctrlKey: true, altKey: true, shiftKey: false, metaKey: false,
keyCode: 0x00, charCode: 0x60,
detail: 0, key: "", location: 0, modifiersList: "", repeat: false,
}, // 5
keyCode: 0x00, charCode: 0x60 },
{ createEventArg: "Keyevents", useInitKeyboardEvent: false,
{ createEventArg: "Keyevents",
type: "keydown", bubbles: true, cancelable: false, view: null,
ctrlKey: false, altKey: true, shiftKey: false, metaKey: true,
keyCode: 0x30, charCode: 0x00,
detail: 0, key: "", location: 0, modifiersList: "", repeat: false,
}, // 6
keyCode: 0x30, charCode: 0x00 },
{ createEventArg: "keyEvents", useInitKeyboardEvent: false,
{ createEventArg: "keyEvents",
type: "keyup", bubbles: false, cancelable: false, view: window,
ctrlKey: true, altKey: false, shiftKey: true, metaKey: false,
keyCode: 0x10, charCode: 0x80,
detail: 0, key: "", location: 0, modifiersList: "", repeat: false,
}, // 7
keyCode: 0x10, charCode: 0x80 },
{ createEventArg: "KeyboardEvent", useInitKeyboardEvent: false,
{ createEventArg: "KeyboardEvent",
type: "keypress", bubbles: false, cancelable: false, view: window,
ctrlKey: true, altKey: false, shiftKey: true, metaKey: true,
keyCode: 0x10, charCode: 0x80,
detail: 0, key: "", location: 0, modifiersList: "", repeat: false,
}, // 8
keyCode: 0x10, charCode: 0x80 },
{ createEventArg: "KeyboardEvent", useInitKeyboardEvent: false,
{ createEventArg: "KeyboardEvent",
type: "foo", bubbles: false, cancelable: false, view: window,
ctrlKey: true, altKey: true, shiftKey: true, metaKey: true,
keyCode: 0x10, charCode: 0x80,
detail: 0, key: "", location: 0, modifiersList: "", repeat: false,
}, // 9
// initKeyboardEvent
{ createEventArg: "KeyboardEvent", useInitKeyboardEvent: true,
type: "keydown", bubbles: true, cancelable: true, view: null,
ctrlKey: false, altKey: false, shiftKey: false, metaKey: false,
keyCode: 0x00, charCode: 0x00,
detail: 0, key: "", location: 0, modifiersList: "", repeat: false,
}, // 10
{ createEventArg: "keyboardevent", useInitKeyboardEvent: true,
type: "keyup", bubbles: false, cancelable: true, view: window,
ctrlKey: true, altKey: false, shiftKey: false, metaKey: false,
keyCode: 0x00, charCode: 0x00,
detail: 2, key: "Unidentified", location: 1, modifiersList: "Control", repeat: false,
}, // 11
{ createEventArg: "Keyboardevent", useInitKeyboardEvent: true,
type: "keypess", bubbles: true, cancelable: false, view: null,
ctrlKey: false, altKey: true, shiftKey: false, metaKey: false,
keyCode: 0x00, charCode: 0x00,
detail: 0, key: "FooBar", location: 2, modifiersList: "Alt", repeat: true,
}, // 12
{ createEventArg: "keyboardevent", useInitKeyboardEvent: true,
type: "foo", bubbles: true, cancelable: true, view: null,
ctrlKey: false, altKey: false, shiftKey: false, metaKey: true,
keyCode: 0x00, charCode: 0x00,
detail: 0, key: "a", location: 0, modifiersList: "Meta", repeat: false,
}, // 13
{ createEventArg: "Keyevents", useInitKeyboardEvent: true,
type: "", bubbles: false, cancelable: false, view: null,
ctrlKey: true, altKey: true, shiftKey: true, metaKey: true,
keyCode: 0x00, charCode: 0x00,
detail: 0, key: "3", location: 0, modifiersList: "Control Alt Meta Shift", repeat: true,
}, // 14
{ createEventArg: "keyevents", useInitKeyboardEvent: true,
type: "", bubbles: false, cancelable: false, view: null,
ctrlKey: false, altKey: false, shiftKey: true, metaKey: false,
keyCode: 0x00, charCode: 0x00,
detail: 0, key: "3", location: 6, modifiersList: "Shift", repeat: true,
}, // 15
{ createEventArg: "keyevents", useInitKeyboardEvent: true,
type: "", bubbles: false, cancelable: false, view: null,
ctrlKey: false, altKey: true, shiftKey: false, metaKey: false,
keyCode: 0x00, charCode: 0x00,
detail: 0, key: "", location: 4, modifiersList: "Shift, Alt", repeat: false,
}, // 16
keyCode: 0x10, charCode: 0x80 },
];
const kOtherModifierName = [
@ -156,23 +85,17 @@ function testInitializingUntrustedEvent()
var description = "testInitializingUntrustedEvent, Index: " + i + ", ";
const kTest = kTests[i];
var e = document.createEvent(kTest.createEventArg);
if (kTest.useInitKeyboardEvent) {
// IE has extra argument for |.locale|. Calling with it shouldn't cause error for compatibility with IE.
e.initKeyboardEvent(kTest.type, kTest.bubbles, kTest.cancelable, kTest.view, kTest.detail,
kTest.key, kTest.location, kTest.modifiersList, kTest.repeat, "locale");
} else {
e.initKeyEvent(kTest.type, kTest.bubbles, kTest.cancelable, kTest.view,
kTest.ctrlKey, kTest.altKey, kTest.shiftKey, kTest.metaKey,
kTest.keyCode, kTest.charCode);
}
e.initKeyEvent(kTest.type, kTest.bubbles, kTest.cancelable, kTest.view,
kTest.ctrlKey, kTest.altKey, kTest.shiftKey, kTest.metaKey,
kTest.keyCode, kTest.charCode);
is(e.toString(), "[object KeyboardEvent]",
description + 'class string should be "KeyboardEvent"');
for (var attr in kTest) {
if (attr == "createEventArg" || attr == "useInitKeyboardEvent" || attr == "modifiersList") {
if (attr == "createEventArg") {
continue;
}
if (!kTest.useInitKeyboardEvent && attr == "keyCode") {
if (attr == "keyCode") {
// If this is keydown, keyup of keypress event, keycod must be correct.
if (kTest.type == "keydown" || kTest.type == "keyup" || kTest.type == "keypress") {
is(e[attr], kTest[attr], description + attr + " returns wrong value");
@ -180,7 +103,7 @@ function testInitializingUntrustedEvent()
} else {
is(e[attr], 0, description + attr + " returns non-zero for invalid event");
}
} else if (!kTest.useInitKeyboardEvent && attr == "charCode") {
} else if (attr == "charCode") {
// If this is keydown or keyup event, charCode always 0.
if (kTest.type == "keydown" || kTest.type == "keyup") {
is(e[attr], 0, description + attr + " returns non-zero for keydown or keyup event");
@ -199,6 +122,9 @@ function testInitializingUntrustedEvent()
}
is(e.isTrusted, false, description + "isTrusted returns wrong value");
// Currently, there is no way to initialize char and key attribute values.
ok(e.key === "", description + "key must return empty string - got " + e.key);
// getModifierState() tests
is(e.getModifierState("Shift"), kTest.shiftKey,
description + "getModifierState(\"Shift\") returns wrong value");

View File

@ -37,8 +37,8 @@
[ "Callback message", msg, "Error: hello" ],
[ "Event error-object", errorEvent.error, thrown],
[ "Callback error-object", error, thrown ],
[ "Event column", errorEvent.colno, 0 ], // Sadly not correct right now
[ "Callback column", column, 0 ]
[ "Event column", errorEvent.colno, 6 ], // Sadly not correct right now
[ "Callback column", column, 6 ]
]);
</script>
<script>

View File

@ -10,7 +10,7 @@
* collection of DOM window objects.
*/
[scriptable, uuid(a6cf906f-15b3-11d2-932e-00805f8add32)]
[uuid(a6cf906f-15b3-11d2-932e-00805f8add32)]
interface nsIDOMWindowCollection : nsISupports
{
/**

View File

@ -8,7 +8,6 @@ XPIDL_SOURCES += [
'nsIDOMNSXPathExpression.idl',
'nsIDOMXPathEvaluator.idl',
'nsIDOMXPathExpression.idl',
'nsIDOMXPathNamespace.idl',
'nsIDOMXPathNSResolver.idl',
'nsIDOMXPathResult.idl',
]

View File

@ -1,19 +0,0 @@
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/**
* Corresponds to http://www.w3.org/TR/2002/WD-DOM-Level-3-XPath-20020208
*/
#include "nsIDOMNode.idl"
[scriptable, uuid(558c2ab9-513e-43c2-afea-4930024b15b3)]
interface nsIDOMXPathNamespace : nsIDOMNode
{
// XPathNodeType
const unsigned short XPATH_NAMESPACE_NODE = 13;
readonly attribute nsIDOMElement ownerElement;
};

View File

@ -747,6 +747,7 @@ TabChild::Observe(nsISupports *aSubject,
if (SameCOMIdentity(subject, doc)) {
nsCOMPtr<nsIDOMWindowUtils> utils(GetDOMWindowUtils());
utils->SetIsFirstPaint(true);
mContentDocumentIsDisplayed = true;
@ -810,9 +811,6 @@ TabChild::OnLocationChange(nsIWebProgress* aWebProgress,
return NS_OK;
}
nsCOMPtr<nsIDOMWindowUtils> utils(do_GetInterface(window));
utils->SetIsFirstPaint(true);
nsCOMPtr<nsIDOMDocument> progressDoc;
window->GetDocument(getter_AddRefs(progressDoc));
if (!progressDoc) {

View File

@ -584,7 +584,6 @@ exports.browser = {
XPathEvaluator : false,
XPathException : false,
XPathExpression : false,
XPathNamespace : false,
XPathNSResolver : false,
XPathResult : false
};

View File

@ -1189,8 +1189,6 @@ var interfaceNamesInGlobalScope =
"XPathEvaluator",
// IMPORTANT: Do not change this list without review from a DOM peer!
"XPathExpression",
// IMPORTANT: Do not change this list without review from a DOM peer!
"XPathNamespace",
// IMPORTANT: Do not change this list without review from a DOM peer!
"XPathNSResolver",
// IMPORTANT: Do not change this list without review from a DOM peer!

View File

@ -31,17 +31,6 @@ interface KeyboardEvent : UIEvent
readonly attribute boolean isComposing;
readonly attribute DOMString key;
[Throws]
void initKeyboardEvent(DOMString typeArg,
boolean bubblesArg,
boolean cancelableArg,
WindowProxy? viewArg,
long detailArg,
DOMString keyArg,
unsigned long locationArg,
DOMString modifiersListArg,
boolean repeatArg);
};
dictionary KeyboardEventInit : UIEventInit

View File

@ -66,7 +66,12 @@ nsXBLPrototypeResources::FlushSkinSheets()
nsCOMPtr<nsIDocument> doc =
mLoader->mBinding->XBLDocumentInfo()->GetDocument();
mozilla::css::Loader* cssLoader = doc->CSSLoader();
// If doc is null, we're in the process of tearing things down, so just
// return without rebuilding anything.
if (!doc) {
return NS_OK;
}
// We have scoped stylesheets. Reload any chrome stylesheets we
// encounter. (If they aren't skin sheets, it doesn't matter, since
@ -76,6 +81,8 @@ nsXBLPrototypeResources::FlushSkinSheets()
sheet_array_type oldSheets(mStyleSheetList);
mStyleSheetList.Clear();
mozilla::css::Loader* cssLoader = doc->CSSLoader();
for (sheet_array_type::size_type i = 0, count = oldSheets.Length();
i < count; ++i) {
nsCSSStyleSheet* oldSheet = oldSheets[i];

View File

@ -10,7 +10,6 @@
#include "nsIDOMCharacterData.h"
#include "nsDOMClassInfoID.h"
#include "nsIDOMDocument.h"
#include "nsIDOMXPathNamespace.h"
#include "nsXPathResult.h"
#include "txURIUtils.h"
#include "txXPathTreeWalker.h"
@ -94,8 +93,7 @@ nsXPathExpression::EvaluateWithContext(nsIDOMNode *aContextNode,
nodeType != nsIDOMNode::ELEMENT_NODE &&
nodeType != nsIDOMNode::ATTRIBUTE_NODE &&
nodeType != nsIDOMNode::COMMENT_NODE &&
nodeType != nsIDOMNode::PROCESSING_INSTRUCTION_NODE &&
nodeType != nsIDOMXPathNamespace::XPATH_NAMESPACE_NODE) {
nodeType != nsIDOMNode::PROCESSING_INSTRUCTION_NODE) {
return NS_ERROR_DOM_NOT_SUPPORTED_ERR;
}

View File

@ -7,7 +7,7 @@
#include "DeleteRangeTxn.h"
#include "DeleteTextTxn.h"
#include "mozilla/Assertions.h"
#include "mozilla/Selection.h"
#include "mozilla/dom/Selection.h"
#include "mozilla/mozalloc.h"
#include "nsCOMPtr.h"
#include "nsDebug.h"
@ -22,6 +22,7 @@
class nsIDOMRange;
using namespace mozilla;
using namespace mozilla::dom;
// note that aEditor is not refcounted
DeleteRangeTxn::DeleteRangeTxn()

View File

@ -5,7 +5,7 @@
#include "DeleteTextTxn.h"
#include "mozilla/Assertions.h"
#include "mozilla/Selection.h"
#include "mozilla/dom/Selection.h"
#include "nsAutoPtr.h"
#include "nsDebug.h"
#include "nsEditor.h"
@ -17,6 +17,7 @@
#include "nsAString.h"
using namespace mozilla;
using namespace mozilla::dom;
DeleteTextTxn::DeleteTextTxn() :
EditTxn(),

View File

@ -7,9 +7,10 @@
#include "nsEditor.h"
#include "IMETextTxn.h"
#include "nsGkAtoms.h"
#include "mozilla/Selection.h"
#include "mozilla/dom/Selection.h"
using namespace mozilla;
using namespace mozilla::dom;
PlaceholderTxn::PlaceholderTxn() : EditAggregateTxn(),
mAbsorb(true),

View File

@ -48,7 +48,7 @@ public:
nsIEditor::EDirection aDirection) = 0;
NS_IMETHOD AfterEdit(EditAction action,
nsIEditor::EDirection aDirection) = 0;
NS_IMETHOD WillDoAction(mozilla::Selection* aSelection, nsRulesInfo* aInfo,
NS_IMETHOD WillDoAction(mozilla::dom::Selection* aSelection, nsRulesInfo* aInfo,
bool* aCancel, bool* aHandled) = 0;
NS_IMETHOD DidDoAction(nsISelection *aSelection, nsRulesInfo *aInfo, nsresult aResult)=0;
NS_IMETHOD DocumentIsEmpty(bool *aDocumentIsEmpty)=0;

View File

@ -26,7 +26,7 @@
#include "mozInlineSpellChecker.h" // for mozInlineSpellChecker
#include "mozilla/IMEStateManager.h" // for IMEStateManager
#include "mozilla/Preferences.h" // for Preferences
#include "mozilla/Selection.h" // for Selection, etc
#include "mozilla/dom/Selection.h" // for Selection, etc
#include "mozilla/Services.h" // for GetObserverService
#include "mozilla/TextComposition.h" // for TextComposition
#include "mozilla/TextEvents.h"

View File

@ -67,13 +67,13 @@ class nsString;
class nsTransactionManager;
namespace mozilla {
class Selection;
class TextComposition;
namespace dom {
class DataTransfer;
class Element;
class EventTarget;
class Selection;
} // namespace dom
} // namespace mozilla
@ -435,7 +435,7 @@ public:
/** routines for managing the preservation of selection across
* various editor actions */
bool ArePreservingSelection();
void PreserveSelectionAcrossActions(mozilla::Selection* aSel);
void PreserveSelectionAcrossActions(mozilla::dom::Selection* aSel);
nsresult RestorePreservedSelection(nsISelection *aSel);
void StopPreservingSelection();
@ -623,17 +623,17 @@ public:
static nsCOMPtr<nsIDOMNode> GetNodeAtRangeOffsetPoint(nsIDOMNode* aParentOrNode, int32_t aOffset);
static nsresult GetStartNodeAndOffset(nsISelection *aSelection, nsIDOMNode **outStartNode, int32_t *outStartOffset);
static nsresult GetStartNodeAndOffset(mozilla::Selection* aSelection,
static nsresult GetStartNodeAndOffset(mozilla::dom::Selection* aSelection,
nsINode** aStartNode,
int32_t* aStartOffset);
static nsresult GetEndNodeAndOffset(nsISelection *aSelection, nsIDOMNode **outEndNode, int32_t *outEndOffset);
static nsresult GetEndNodeAndOffset(mozilla::Selection* aSelection,
static nsresult GetEndNodeAndOffset(mozilla::dom::Selection* aSelection,
nsINode** aEndNode,
int32_t* aEndOffset);
#if DEBUG_JOE
static void DumpNode(nsIDOMNode *aNode, int32_t indent=0);
#endif
mozilla::Selection* GetSelection();
mozilla::dom::Selection* GetSelection();
// Helpers to add a node to the selection.
// Used by table cell selection methods

View File

@ -3,7 +3,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "mozilla/Selection.h"
#include "mozilla/dom/Selection.h"
#include "nsCOMArray.h"
#include "nsComponentManagerUtils.h"
#include "nsEditorUtils.h"
@ -24,6 +24,7 @@ class nsIDOMRange;
class nsISupports;
using namespace mozilla;
using namespace mozilla::dom;
/******************************************************************************
* nsAutoSelectionReset

View File

@ -56,12 +56,12 @@ class MOZ_STACK_CLASS nsAutoSelectionReset
{
private:
/** ref-counted reference to the selection that we are supposed to restore */
nsRefPtr<mozilla::Selection> mSel;
nsRefPtr<mozilla::dom::Selection> mSel;
nsEditor *mEd; // non-owning ref to nsEditor
public:
/** constructor responsible for remembering all state needed to restore aSel */
nsAutoSelectionReset(mozilla::Selection* aSel, nsEditor* aEd);
nsAutoSelectionReset(mozilla::dom::Selection* aSel, nsEditor* aEd);
/** destructor restores mSel to its former state */
~nsAutoSelectionReset();

View File

@ -4,7 +4,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "mozilla/Assertions.h" // for MOZ_ASSERT, etc
#include "mozilla/Selection.h" // for Selection
#include "mozilla/dom/Selection.h" // for Selection
#include "nsAString.h" // for nsAString_internal::Length
#include "nsAutoPtr.h" // for nsRefPtr, getter_AddRefs, etc
#include "nsCycleCollectionParticipant.h"
@ -21,6 +21,7 @@
#include "nsSelectionState.h"
using namespace mozilla;
using namespace mozilla::dom;
/***************************************************************************
* class for recording selection info. stores selection as collection of

View File

@ -18,8 +18,10 @@ class nsIDOMRange;
class nsISelection;
class nsRange;
namespace mozilla {
namespace dom {
class Selection;
}
}
/***************************************************************************
* class for recording selection info. stores selection as collection of
@ -59,7 +61,7 @@ class nsSelectionState
void DoTraverse(nsCycleCollectionTraversalCallback &cb);
void DoUnlink() { MakeEmpty(); }
void SaveSelection(mozilla::Selection *aSel);
void SaveSelection(mozilla::dom::Selection *aSel);
nsresult RestoreSelection(nsISelection *aSel);
bool IsCollapsed();
bool IsEqual(nsSelectionState *aSelState);

View File

@ -5,7 +5,7 @@
#include <math.h>
#include "mozilla/Preferences.h"
#include "mozilla/Selection.h"
#include "mozilla/dom/Selection.h"
#include "mozilla/dom/Element.h"
#include "mozilla/mozalloc.h"
#include "nsAString.h"
@ -52,6 +52,7 @@
#include <algorithm>
using namespace mozilla;
using namespace mozilla::dom;
#define BLACK_BG_RGB_TRIGGER 0xd0

View File

@ -11,7 +11,7 @@
#include "mozilla/Base64.h"
#include "mozilla/BasicEvents.h"
#include "mozilla/Preferences.h"
#include "mozilla/Selection.h"
#include "mozilla/dom/Selection.h"
#include "nsAString.h"
#include "nsAutoPtr.h"
#include "nsCOMArray.h"

View File

@ -9,7 +9,7 @@
#include "mozilla/Assertions.h"
#include "mozilla/MathAlgorithms.h"
#include "mozilla/Preferences.h"
#include "mozilla/Selection.h"
#include "mozilla/dom/Selection.h"
#include "mozilla/dom/Element.h"
#include "mozilla/mozalloc.h"
#include "nsAString.h"
@ -61,6 +61,7 @@ class nsISupports;
class nsRulesInfo;
using namespace mozilla;
using namespace mozilla::dom;
//const static char* kMOZEditorBogusNodeAttr="MOZ_EDITOR_BOGUS_NODE";
//const static char* kMOZEditorBogusNodeValue="TRUE";

View File

@ -33,9 +33,9 @@ class nsPlaintextEditor;
class nsRange;
class nsRulesInfo;
namespace mozilla {
class Selection;
namespace dom {
class Element;
class Selection;
} // namespace dom
} // namespace mozilla
struct DOMPoint;
@ -79,7 +79,7 @@ public:
nsIEditor::EDirection aDirection);
NS_IMETHOD AfterEdit(EditAction action,
nsIEditor::EDirection aDirection);
NS_IMETHOD WillDoAction(mozilla::Selection* aSelection, nsRulesInfo* aInfo,
NS_IMETHOD WillDoAction(mozilla::dom::Selection* aSelection, nsRulesInfo* aInfo,
bool* aCancel, bool* aHandled);
NS_IMETHOD DidDoAction(nsISelection *aSelection, nsRulesInfo *aInfo, nsresult aResult);
NS_IMETHOD DocumentModified();
@ -127,19 +127,19 @@ protected:
// nsHTMLEditRules implementation methods
nsresult WillInsert(nsISelection *aSelection, bool *aCancel);
nsresult WillInsertText( EditAction aAction,
mozilla::Selection* aSelection,
mozilla::dom::Selection* aSelection,
bool *aCancel,
bool *aHandled,
const nsAString *inString,
nsAString *outString,
int32_t aMaxLength);
nsresult WillLoadHTML(nsISelection *aSelection, bool *aCancel);
nsresult WillInsertBreak(mozilla::Selection* aSelection,
nsresult WillInsertBreak(mozilla::dom::Selection* aSelection,
bool* aCancel, bool* aHandled);
nsresult StandardBreakImpl(nsIDOMNode *aNode, int32_t aOffset, nsISelection *aSelection);
nsresult DidInsertBreak(nsISelection *aSelection, nsresult aResult);
nsresult SplitMailCites(nsISelection *aSelection, bool aPlaintext, bool *aHandled);
nsresult WillDeleteSelection(mozilla::Selection* aSelection,
nsresult WillDeleteSelection(mozilla::dom::Selection* aSelection,
nsIEditor::EDirection aAction,
nsIEditor::EStripWrappers aStripWrappers,
bool* aCancel, bool* aHandled);
@ -154,36 +154,36 @@ protected:
nsresult MoveNodeSmart(nsIDOMNode *aSource, nsIDOMNode *aDest, int32_t *aOffset);
nsresult MoveContents(nsIDOMNode *aSource, nsIDOMNode *aDest, int32_t *aOffset);
nsresult DeleteNonTableElements(nsINode* aNode);
nsresult WillMakeList(mozilla::Selection* aSelection,
nsresult WillMakeList(mozilla::dom::Selection* aSelection,
const nsAString* aListType,
bool aEntireList,
const nsAString* aBulletType,
bool* aCancel, bool* aHandled,
const nsAString* aItemType = nullptr);
nsresult WillRemoveList(mozilla::Selection* aSelection,
nsresult WillRemoveList(mozilla::dom::Selection* aSelection,
bool aOrdered, bool* aCancel, bool* aHandled);
nsresult WillIndent(mozilla::Selection* aSelection,
nsresult WillIndent(mozilla::dom::Selection* aSelection,
bool* aCancel, bool* aHandled);
nsresult WillCSSIndent(mozilla::Selection* aSelection,
nsresult WillCSSIndent(mozilla::dom::Selection* aSelection,
bool* aCancel, bool* aHandled);
nsresult WillHTMLIndent(mozilla::Selection* aSelection,
nsresult WillHTMLIndent(mozilla::dom::Selection* aSelection,
bool* aCancel, bool* aHandled);
nsresult WillOutdent(mozilla::Selection* aSelection,
nsresult WillOutdent(mozilla::dom::Selection* aSelection,
bool* aCancel, bool* aHandled);
nsresult WillAlign(mozilla::Selection* aSelection,
nsresult WillAlign(mozilla::dom::Selection* aSelection,
const nsAString* alignType,
bool* aCancel, bool* aHandled);
nsresult WillAbsolutePosition(mozilla::Selection* aSelection,
nsresult WillAbsolutePosition(mozilla::dom::Selection* aSelection,
bool* aCancel, bool* aHandled);
nsresult WillRemoveAbsolutePosition(mozilla::Selection* aSelection,
nsresult WillRemoveAbsolutePosition(mozilla::dom::Selection* aSelection,
bool* aCancel, bool* aHandled);
nsresult WillRelativeChangeZIndex(mozilla::Selection* aSelection,
nsresult WillRelativeChangeZIndex(mozilla::dom::Selection* aSelection,
int32_t aChange,
bool* aCancel, bool* aHandled);
nsresult WillMakeDefListItem(mozilla::Selection* aSelection,
nsresult WillMakeDefListItem(mozilla::dom::Selection* aSelection,
const nsAString* aBlockType, bool aEntireList,
bool* aCancel, bool* aHandled);
nsresult WillMakeBasicBlock(mozilla::Selection* aSelection,
nsresult WillMakeBasicBlock(mozilla::dom::Selection* aSelection,
const nsAString* aBlockType,
bool* aCancel, bool* aHandled);
nsresult DidMakeBasicBlock(nsISelection *aSelection, nsRulesInfo *aInfo, nsresult aResult);

View File

@ -69,13 +69,14 @@
#include "nsIFrame.h"
#include "nsIParserService.h"
#include "mozilla/Selection.h"
#include "mozilla/dom/Selection.h"
#include "mozilla/dom/Element.h"
#include "mozilla/dom/EventTarget.h"
#include "mozilla/dom/HTMLBodyElement.h"
#include "nsTextFragment.h"
using namespace mozilla;
using namespace mozilla::dom;
using namespace mozilla::widget;
// Some utilities to handle annoying overloading of "A" tag for link and named anchor

View File

@ -4,7 +4,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "TypeInState.h"
#include "mozilla/Assertions.h"
#include "mozilla/Selection.h"
#include "mozilla/dom/Selection.h"
#include "mozilla/dom/Element.h"
#include "mozilla/mozalloc.h"
#include "nsAString.h"
@ -52,6 +52,7 @@
class nsISupports;
using namespace mozilla;
using namespace mozilla::dom;
static bool
IsEmptyTextNode(nsHTMLEditor* aThis, nsINode* aNode)

View File

@ -6,7 +6,7 @@
#include <stdio.h>
#include "mozilla/Assertions.h"
#include "mozilla/Selection.h"
#include "mozilla/dom/Selection.h"
#include "mozilla/dom/Element.h"
#include "nsAString.h"
#include "nsAlgorithm.h"
@ -42,6 +42,7 @@
#include <algorithm>
using namespace mozilla;
using namespace mozilla::dom;
/***************************************************************************
* stack based helper class for restoring selection after table edit

View File

@ -336,7 +336,7 @@ class MOZ_STACK_CLASS nsWSRunObject
int32_t aOffset,
nsIDOMNode *aBlockParent,
nsCOMPtr<nsIDOMNode> *aPriorNode);
nsresult GetPreviousWSNode(DOMPoint aPoint,
nsresult GetPreviousWSNode(::DOMPoint aPoint,
nsIDOMNode *aBlockParent,
nsCOMPtr<nsIDOMNode> *aPriorNode);
nsresult GetNextWSNode(nsIDOMNode *aStartNode,
@ -346,7 +346,7 @@ class MOZ_STACK_CLASS nsWSRunObject
int32_t aOffset,
nsIDOMNode *aBlockParent,
nsCOMPtr<nsIDOMNode> *aNextNode);
nsresult GetNextWSNode(DOMPoint aPoint,
nsresult GetNextWSNode(::DOMPoint aPoint,
nsIDOMNode *aBlockParent,
nsCOMPtr<nsIDOMNode> *aNextNode);
nsresult PrepareToDeleteRangePriv(nsWSRunObject* aEndObject);

View File

@ -6,7 +6,7 @@
#include "mozilla/Assertions.h"
#include "mozilla/Preferences.h"
#include "mozilla/Selection.h"
#include "mozilla/dom/Selection.h"
#include "mozilla/TextComposition.h"
#include "mozilla/TextEvents.h"
#include "mozilla/dom/Element.h"
@ -64,6 +64,7 @@ class nsISupports;
class nsISupportsArray;
using namespace mozilla;
using namespace mozilla::dom;
nsPlaintextEditor::nsPlaintextEditor()
: nsEditor()

View File

@ -6,7 +6,7 @@
#include "mozilla/Assertions.h"
#include "mozilla/LookAndFeel.h"
#include "mozilla/Preferences.h"
#include "mozilla/Selection.h"
#include "mozilla/dom/Selection.h"
#include "mozilla/TextComposition.h"
#include "mozilla/dom/Element.h"
#include "nsAString.h"
@ -43,6 +43,7 @@
#include "nsUnicharUtils.h"
using namespace mozilla;
using namespace mozilla::dom;
#define CANCEL_OPERATION_IF_READONLY_OR_DISABLED \
if (IsReadonly() || IsDisabled()) \

View File

@ -21,7 +21,9 @@ class nsIDOMElement;
class nsIDOMNode;
class nsISelection;
namespace mozilla {
namespace dom {
class Selection;
} // namespace dom
} // namespace mozilla
/** Object that encapsulates HTML text-specific editing rules.
@ -53,8 +55,8 @@ public:
nsIEditor::EDirection aDirection);
NS_IMETHOD AfterEdit(EditAction action,
nsIEditor::EDirection aDirection);
NS_IMETHOD WillDoAction(mozilla::Selection* aSelection, nsRulesInfo* aInfo,
bool* aCancel, bool* aHandled);
NS_IMETHOD WillDoAction(mozilla::dom::Selection* aSelection,
nsRulesInfo* aInfo, bool* aCancel, bool* aHandled);
NS_IMETHOD DidDoAction(nsISelection *aSelection, nsRulesInfo *aInfo, nsresult aResult);
NS_IMETHOD DocumentIsEmpty(bool *aDocumentIsEmpty);
NS_IMETHOD DocumentModified();
@ -102,7 +104,7 @@ protected:
// nsTextEditRules implementation methods
nsresult WillInsertText( EditAction aAction,
mozilla::Selection* aSelection,
mozilla::dom::Selection* aSelection,
bool *aCancel,
bool *aHandled,
const nsAString *inString,
@ -111,14 +113,14 @@ protected:
nsresult DidInsertText(nsISelection *aSelection, nsresult aResult);
nsresult GetTopEnclosingPre(nsIDOMNode *aNode, nsIDOMNode** aOutPreNode);
nsresult WillInsertBreak(mozilla::Selection* aSelection, bool* aCancel,
nsresult WillInsertBreak(mozilla::dom::Selection* aSelection, bool* aCancel,
bool *aHandled, int32_t aMaxLength);
nsresult DidInsertBreak(nsISelection *aSelection, nsresult aResult);
nsresult WillInsert(nsISelection *aSelection, bool *aCancel);
nsresult DidInsert(nsISelection *aSelection, nsresult aResult);
nsresult WillDeleteSelection(mozilla::Selection* aSelection,
nsresult WillDeleteSelection(mozilla::dom::Selection* aSelection,
nsIEditor::EDirection aCollapsedAction,
bool *aCancel,
bool *aHandled);
@ -167,7 +169,7 @@ protected:
/** returns a truncated insertion string if insertion would place us
over aMaxLength */
nsresult TruncateInsertionIfNeeded(mozilla::Selection* aSelection,
nsresult TruncateInsertionIfNeeded(mozilla::dom::Selection* aSelection,
const nsAString *aInString,
nsAString *aOutString,
int32_t aMaxLength,

View File

@ -12,7 +12,7 @@
#include "nsIDOMNode.h"
#include "nsIEditor.h"
#include "nsIPresShell.h"
#include "mozilla/Selection.h"
#include "mozilla/dom/Selection.h"
#include "nsISelectionPrivate.h"
#include "nsISupportsImpl.h"
#include "nsPlaintextEditor.h"
@ -21,6 +21,7 @@
#include "nscore.h"
using namespace mozilla;
using namespace mozilla::dom;
// Test for distance between caret and text that will be deleted
nsresult

View File

@ -366,6 +366,12 @@ WebBrowserChrome::OnHistoryPurge(int32_t aNumEntries, bool *aContinue)
return SendHistoryStatusMessage(nullptr, "purge", aNumEntries);
}
NS_IMETHODIMP
WebBrowserChrome::OnHistoryReplaceEntry(int32_t aIndex)
{
return SendHistoryStatusMessage(nullptr, "replace", aIndex);
}
static void
AppendIntToCString(int32_t info1, nsCString& aResult)
{
@ -438,6 +444,11 @@ WebBrowserChrome::SendHistoryStatusMessage(nsIURI * aURI, char * operation, int3
AppendIntToCString(info1, status);
status.Append(" purged from Session History");
}
else if (!(strcmp(operation, "replace")))
{
status.Assign("Replacing HistoryIndex: ");
AppentIntToCString(info1, status);
}
nsString wstatus;
NS_CStringToUTF16(status, NS_CSTRING_ENCODING_UTF8, wstatus);

View File

@ -41,7 +41,9 @@ ActiveElementManager::SetTargetElement(nsIDOMEventTarget* aTarget)
{
if (mTarget) {
// Multiple fingers on screen (since HandleTouchEnd clears mTarget).
CancelTask();
ResetActive();
mTarget = nullptr;
return;
}

View File

@ -12,8 +12,8 @@
#include "mozilla/dom/ScreenOrientation.h" // for ScreenOrientation
#include "mozilla/dom/TabChild.h" // for TabChild
#include "mozilla/hal_sandbox/PHal.h" // for ScreenConfiguration
#include "mozilla/layers/CompositableClient.h" // for CompositableChild, etc
#include "mozilla/layers/ContentClient.h" // for ContentClientRemote
#include "mozilla/layers/CompositableClient.h"
#include "mozilla/layers/ContentClient.h"
#include "mozilla/layers/ISurfaceAllocator.h"
#include "mozilla/layers/LayersMessages.h" // for EditReply, etc
#include "mozilla/layers/LayersSurfaces.h" // for SurfaceDescriptor
@ -379,10 +379,10 @@ ClientLayerManager::ForwardTransaction(bool aScheduleComposite)
const OpContentBufferSwap& obs = reply.get_OpContentBufferSwap();
CompositableChild* compositableChild =
static_cast<CompositableChild*>(obs.compositableChild());
CompositableClient* compositable =
CompositableClient::FromIPDLActor(obs.compositableChild());
ContentClientRemote* contentClient =
static_cast<ContentClientRemote*>(compositableChild->GetCompositableClient());
static_cast<ContentClientRemote*>(compositable);
MOZ_ASSERT(contentClient);
contentClient->SwapBuffers(obs.frontUpdatedRegion());
@ -394,12 +394,10 @@ ClientLayerManager::ForwardTransaction(bool aScheduleComposite)
const OpTextureSwap& ots = reply.get_OpTextureSwap();
CompositableChild* compositableChild =
static_cast<CompositableChild*>(ots.compositableChild());
MOZ_ASSERT(compositableChild);
compositableChild->GetCompositableClient()
->SetDescriptorFromReply(ots.textureId(), ots.image());
CompositableClient* compositable =
CompositableClient::FromIPDLActor(ots.compositableChild());
MOZ_ASSERT(compositable);
compositable->SetDescriptorFromReply(ots.textureId(), ots.image());
break;
}
case EditReply::TReturnReleaseFence: {

View File

@ -21,6 +21,67 @@ using namespace mozilla::gfx;
namespace mozilla {
namespace layers {
/**
* IPDL actor used by CompositableClient to match with its corresponding
* CompositableHost on the compositor side.
*
* CompositableChild is owned by a CompositableClient.
*/
class CompositableChild : public PCompositableChild
{
public:
CompositableChild()
: mCompositableClient(nullptr), mAsyncID(0)
{
MOZ_COUNT_CTOR(CompositableChild);
}
~CompositableChild()
{
MOZ_COUNT_DTOR(CompositableChild);
}
virtual void ActorDestroy(ActorDestroyReason) MOZ_OVERRIDE {
if (mCompositableClient) {
mCompositableClient->mCompositableChild = nullptr;
}
}
CompositableClient* mCompositableClient;
uint64_t mAsyncID;
};
PCompositableChild*
CompositableClient::CreateIPDLActor()
{
return new CompositableChild();
}
bool
CompositableClient::DestroyIPDLActor(PCompositableChild* actor)
{
delete actor;
return true;
}
void
CompositableClient::InitIPDLActor(PCompositableChild* aActor, uint64_t aAsyncID)
{
MOZ_ASSERT(aActor);
CompositableChild* child = static_cast<CompositableChild*>(aActor);
mCompositableChild = child;
child->mCompositableClient = this;
child->mAsyncID = aAsyncID;
}
CompositableClient*
CompositableClient::FromIPDLActor(PCompositableChild* aActor)
{
MOZ_ASSERT(aActor);
return static_cast<CompositableChild*>(aActor)->mCompositableClient;
}
CompositableClient::CompositableClient(CompositableForwarder* aForwarder,
TextureFlags aTextureFlags)
: mCompositableChild(nullptr)
@ -48,7 +109,7 @@ CompositableClient::SetIPDLActor(CompositableChild* aChild)
mCompositableChild = aChild;
}
CompositableChild*
PCompositableChild*
CompositableClient::GetIPDLActor() const
{
return mCompositableChild;
@ -70,8 +131,8 @@ CompositableClient::Destroy()
if (!mCompositableChild) {
return;
}
mCompositableChild->SetClient(nullptr);
mCompositableChild->Destroy();
mCompositableChild->mCompositableClient = nullptr;
PCompositableChild::Send__delete__(mCompositableChild);
mCompositableChild = nullptr;
}
@ -79,18 +140,11 @@ uint64_t
CompositableClient::GetAsyncID() const
{
if (mCompositableChild) {
return mCompositableChild->GetAsyncID();
return mCompositableChild->mAsyncID;
}
return 0; // zero is always an invalid async ID
}
void
CompositableChild::Destroy()
{
Send__delete__(this);
}
TemporaryRef<BufferTextureClient>
CompositableClient::CreateBufferTextureClient(SurfaceFormat aFormat,
TextureFlags aTextureFlags,

View File

@ -105,7 +105,7 @@ public:
void Destroy();
CompositableChild* GetIPDLActor() const;
PCompositableChild* GetIPDLActor() const;
// should only be called by a CompositableForwarder
virtual void SetIPDLActor(CompositableChild* aChild);
@ -146,6 +146,22 @@ public:
*/
virtual void ClearCachedResources() {}
static CompositableClient* FromIPDLActor(PCompositableChild* aActor);
/**
* Allocate and deallocate a CompositableChild actor.
*
* CompositableChild is an implementation detail of CompositableClient that is not
* exposed to the rest of the code base. CreateIPDLActor and DestroyIPDLActor
* are for use with the managing IPDL protocols only (so that they can
* implement AllocCompositableChild and DeallocPCompositableChild).
*/
static PCompositableChild* CreateIPDLActor();
static bool DestroyIPDLActor(PCompositableChild* actor);
void InitIPDLActor(PCompositableChild* aActor, uint64_t aAsyncID = 0);
protected:
CompositableChild* mCompositableChild;
CompositableForwarder* mForwarder;
@ -156,53 +172,6 @@ protected:
friend class CompositableChild;
};
/**
* IPDL actor used by CompositableClient to match with its corresponding
* CompositableHost on the compositor side.
*
* CompositableChild is owned by a CompositableClient.
*/
class CompositableChild : public PCompositableChild
{
public:
CompositableChild()
: mCompositableClient(nullptr), mID(0)
{
MOZ_COUNT_CTOR(CompositableChild);
}
~CompositableChild()
{
MOZ_COUNT_DTOR(CompositableChild);
}
void Destroy();
void SetClient(CompositableClient* aClient)
{
mCompositableClient = aClient;
}
CompositableClient* GetCompositableClient() const
{
return mCompositableClient;
}
virtual void ActorDestroy(ActorDestroyReason) MOZ_OVERRIDE {
if (mCompositableClient) {
mCompositableClient->mCompositableChild = nullptr;
}
}
void SetAsyncID(uint64_t aID) { mID = aID; }
uint64_t GetAsyncID() const
{
return mID;
}
private:
CompositableClient* mCompositableClient;
uint64_t mID;
};
} // namespace
} // namespace

View File

@ -236,9 +236,9 @@ public:
/**
* Allocate and deallocate a TextureChild actor.
*
* TextureChild is an implementation detail of TextureHost that is not
* TextureChild is an implementation detail of TextureClient that is not
* exposed to the rest of the code base. CreateIPDLActor and DestroyIPDLActor
* are for use with the maging IPDL protocols only (so that they can
* are for use with the managing IPDL protocols only (so that they can
* implement AllocPextureChild and DeallocPTextureChild).
*/
static PTextureChild* CreateIPDLActor();

View File

@ -264,26 +264,22 @@ ImageBridgeChild::Connect(CompositableClient* aCompositable)
{
MOZ_ASSERT(aCompositable);
uint64_t id = 0;
CompositableChild* child = static_cast<CompositableChild*>(
SendPCompositableConstructor(aCompositable->GetTextureInfo(), &id));
PCompositableChild* child =
SendPCompositableConstructor(aCompositable->GetTextureInfo(), &id);
MOZ_ASSERT(child);
child->SetAsyncID(id);
aCompositable->SetIPDLActor(child);
MOZ_ASSERT(child->GetAsyncID() == id);
child->SetClient(aCompositable);
aCompositable->InitIPDLActor(child, id);
}
PCompositableChild*
ImageBridgeChild::AllocPCompositableChild(const TextureInfo& aInfo, uint64_t* aID)
{
return new CompositableChild();
return CompositableClient::CreateIPDLActor();
}
bool
ImageBridgeChild::DeallocPCompositableChild(PCompositableChild* aActor)
{
delete aActor;
return true;
return CompositableClient::DestroyIPDLActor(aActor);
}
@ -491,13 +487,12 @@ ImageBridgeChild::EndTransaction()
case EditReply::TOpTextureSwap: {
const OpTextureSwap& ots = reply.get_OpTextureSwap();
CompositableChild* compositableChild =
static_cast<CompositableChild*>(ots.compositableChild());
CompositableClient* compositable =
CompositableClient::FromIPDLActor(ots.compositableChild());
MOZ_ASSERT(compositableChild);
MOZ_ASSERT(compositable);
compositableChild->GetCompositableClient()
->SetDescriptorFromReply(ots.textureId(), ots.image());
compositable->SetDescriptorFromReply(ots.textureId(), ots.image());
break;
}
case EditReply::TReturnReleaseFence: {

View File

@ -73,14 +73,13 @@ LayerTransactionChild::DeallocPLayerChild(PLayerChild* actor)
PCompositableChild*
LayerTransactionChild::AllocPCompositableChild(const TextureInfo& aInfo)
{
return new CompositableChild();
return CompositableClient::CreateIPDLActor();
}
bool
LayerTransactionChild::DeallocPCompositableChild(PCompositableChild* actor)
{
delete actor;
return true;
return CompositableClient::DestroyIPDLActor(actor);
}
void

View File

@ -648,11 +648,10 @@ ShadowLayerForwarder::Connect(CompositableClient* aCompositable)
if (!mShadowManager->IPCOpen()) {
return;
}
CompositableChild* child = static_cast<CompositableChild*>(
mShadowManager->SendPCompositableConstructor(aCompositable->GetTextureInfo()));
MOZ_ASSERT(child);
aCompositable->SetIPDLActor(child);
child->SetClient(aCompositable);
PCompositableChild* actor =
mShadowManager->SendPCompositableConstructor(aCompositable->GetTextureInfo());
MOZ_ASSERT(actor);
aCompositable->InitIPDLActor(actor);
}
void

View File

@ -3436,6 +3436,8 @@ EmitVariables(ExclusiveContext *cx, BytecodeEmitter *bce, ParseNode *pn, VarEmit
ParseNode *next;
for (ParseNode *pn2 = pn->pn_head; ; pn2 = next) {
if (!UpdateSourceCoordNotes(cx, bce, pn2->pn_pos.begin))
return false;
next = pn2->pn_next;
ParseNode *pn3;
@ -5904,6 +5906,9 @@ EmitObject(ExclusiveContext *cx, BytecodeEmitter *bce, ParseNode *pn)
}
for (ParseNode *pn2 = pn->pn_head; pn2; pn2 = pn2->pn_next) {
if (!UpdateSourceCoordNotes(cx, bce, pn2->pn_pos.begin))
return false;
/* Emit an index for t[2] for later consumption by JSOP_INITELEM. */
ParseNode *pn3 = pn2->pn_left;
bool isIndex = false;
@ -6065,6 +6070,8 @@ EmitArray(ExclusiveContext *cx, BytecodeEmitter *bce, ParseNode *pn, uint32_t co
if (nspread && !EmitNumberOp(cx, 0, bce))
return false;
for (atomIndex = 0; pn2; atomIndex++, pn2 = pn2->pn_next) {
if (!UpdateSourceCoordNotes(cx, bce, pn2->pn_pos.begin))
return false;
if (pn2->isKind(PNK_ELISION)) {
if (Emit1(cx, bce, JSOP_HOLE) < 0)
return false;
@ -6372,6 +6379,8 @@ frontend::EmitTree(ExclusiveContext *cx, BytecodeEmitter *bce, ParseNode *pn)
case PNK_COMMA:
{
for (ParseNode *pn2 = pn->pn_head; ; pn2 = pn2->pn_next) {
if (!UpdateSourceCoordNotes(cx, bce, pn2->pn_pos.begin))
return false;
if (!EmitTree(cx, bce, pn2))
return false;
if (!pn2->pn_next)

View File

@ -1,38 +1,93 @@
load(libdir + "asm.js");
load(libdir + "asserts.js");
var callFFI1 = asmCompile('global', 'ffis', USE_ASM + "var ffi=ffis.ffi; function asmfun1() { return ffi(1)|0 } return asmfun1");
var callFFI2 = asmCompile('global', 'ffis', USE_ASM + "var ffi=ffis.ffi; function asmfun2() { return ffi(2)|0 } return asmfun2");
function matchStack(stackString, stackArray)
{
var match = 0;
for (name of stackArray) {
match = stackString.indexOf(name, match);
if (match === -1)
throw name + " not found in the stack " + stack;
}
}
var stack;
function dumpStack(i) { stack = new Error().stack; return i+11 }
function dumpStack()
{
stack = new Error().stack
}
var asmfun1 = asmLink(callFFI1, null, {ffi:dumpStack});
assertEq(asmfun1(), 12);
assertEq(stack.indexOf("asmfun1") === -1, false);
var callFFI = asmCompile('global', 'ffis', USE_ASM + "var ffi=ffis.ffi; function f() { return ffi()|0 } return f");
var asmfun2 = asmLink(callFFI2, null, {ffi:function ffi(i){return asmfun1()+20}});
assertEq(asmfun2(), 32);
assertEq(stack.indexOf("asmfun1") == -1, false);
assertEq(stack.indexOf("asmfun2") == -1, false);
assertEq(stack.indexOf("asmfun2") > stack.indexOf("asmfun1"), true);
var f = asmLink(callFFI, null, {ffi:dumpStack});
for (var i = 0; i < 5000; i++) {
stack = null;
f();
matchStack(stack, ['dumpStack', 'f']);
}
if (isAsmJSCompilationAvailable() && isCachingEnabled()) {
var callFFI = asmCompile('global', 'ffis', USE_ASM + "var ffi=ffis.ffi; function f() { return ffi()|0 } return f");
assertEq(isAsmJSModuleLoadedFromCache(callFFI), true);
stack = null;
f();
matchStack(stack, ['dumpStack', 'f']);
}
var f1 = asmLink(callFFI, null, {ffi:dumpStack});
var f2 = asmLink(callFFI, null, {ffi:function middle() { f1() }});
stack = null;
(function outer() { f2() })();
matchStack(stack, ["dumpStack", "f", "middle", "f"]);
function returnStackDumper() { return { valueOf:function() { stack = new Error().stack } } }
var f = asmLink(callFFI, null, {ffi:returnStackDumper});
for (var i = 0; i < 5000; i++) {
stack = null;
f();
matchStack(stack, ['valueOf', 'f']);
}
var caught = false;
try {
stack = null;
asmLink(asmCompile(USE_ASM + "function asmRec() { asmRec() } return asmRec"))();
} catch (e) {
caught = true;
matchStack(e.stack, ['asmRec', 'asmRec', 'asmRec', 'asmRec']);
}
assertEq(caught, true);
var caught = false;
try {
callFFI1(null, {ffi:Object.preventExtensions})();
callFFI(null, {ffi:Object.preventExtensions})();
} catch (e) {
caught = true;
}
assertEq(caught, true);
assertEq(asmLink(callFFI1, null, {ffi:eval})(), 1);
assertEq(asmLink(callFFI1, null, {ffi:Function})(), 0);
assertEq(asmLink(callFFI1, null, {ffi:Error})(), 0);
asmLink(callFFI, null, {ffi:eval})();
asmLink(callFFI, null, {ffi:Function})();
asmLink(callFFI, null, {ffi:Error})();
var manyCalls = asmCompile('global', 'ffis',
USE_ASM +
"var ffi=ffis.ffi;\
function f1(a,b,c,d,e,f,g,h,i,j,k) { \
a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;k=k|0; \
ffi(); \
return (a+b+c+d+e+f+g+h+i+j+k)|0; \
} \
function f2() { \
return f1(1,2,3,4,5,6,7,8,f1(1,2,3,4,5,6,7,8,9,10,11)|0,10,11)|0; \
} \
function f3() { return 13 } \
function f4(i) { \
i=i|0; \
return TBL[i&3]()|0; \
} \
var TBL=[f3, f3, f2, f3]; \
return f4;");
stack = null;
assertEq(asmLink(manyCalls, null, {ffi:dumpStack})(2), 123);
matchStack(stack, ['dumpStack', 'f1', 'f2', 'f4']);

View File

@ -8,11 +8,7 @@ dbg.onDebuggerStatement = function (frame) {
assertEq(exc.message, "diaf");
assertEq(exc.fileName, "fail");
assertEq(exc.lineNumber, 4);
// Arrant nonsense? Sure -- but different from lineNumber is all this
// test exists to verify. If you're the person to make column numbers
// actually work, change this accordingly.
assertEq(exc.columnNumber, 0);
assertEq(exc.columnNumber, 20);
return;
}
throw new Error("deleteProperty should throw");

Some files were not shown because too many files have changed in this diff Show More