Merge the last PGO-green inbound changeset to m-c

This commit is contained in:
Ryan VanderMeulen 2012-06-10 18:21:22 -04:00
commit 9c1d160da3
49 changed files with 606 additions and 595 deletions

View File

@ -881,89 +881,15 @@ Accessible::GetDeepestChildAtPoint(PRInt32 aX, PRInt32 aY,
void
Accessible::GetBoundsRect(nsRect& aTotalBounds, nsIFrame** aBoundingFrame)
{
/*
* This method is used to determine the bounds of a content node.
* Because HTML wraps and links are not always rectangular, this
* method uses the following algorithm:
*
* 1) Start with an empty rectangle
* 2) Add the rect for the primary frame from for the DOM node.
* 3) For each next frame at the same depth with the same DOM node, add that rect to total
* 4) If that frame is an inline frame, search deeper at that point in the tree, adding all rects
*/
// Initialization area
*aBoundingFrame = nsnull;
nsIFrame* firstFrame = GetFrame();
if (!firstFrame)
return;
// Find common relative parent
// This is an ancestor frame that will incompass all frames for this content node.
// We need the relative parent so we can get absolute screen coordinates
nsIFrame *ancestorFrame = firstFrame;
while (ancestorFrame) {
*aBoundingFrame = ancestorFrame;
// If any other frame type, we only need to deal with the primary frame
// Otherwise, there may be more frames attached to the same content node
if (ancestorFrame->GetType() != nsGkAtoms::inlineFrame &&
ancestorFrame->GetType() != nsGkAtoms::textFrame)
break;
ancestorFrame = ancestorFrame->GetParent();
}
nsIFrame *iterFrame = firstFrame;
nsCOMPtr<nsIContent> firstContent(mContent);
nsIContent* iterContent = firstContent;
PRInt32 depth = 0;
// Look only at frames below this depth, or at this depth (if we're still on the content node we started with)
while (iterContent == firstContent || depth > 0) {
// Coordinates will come back relative to parent frame
nsRect currFrameBounds = iterFrame->GetRect();
// Make this frame's bounds relative to common parent frame
currFrameBounds +=
iterFrame->GetParent()->GetOffsetToExternal(*aBoundingFrame);
// Add this frame's bounds to total
aTotalBounds.UnionRect(aTotalBounds, currFrameBounds);
nsIFrame *iterNextFrame = nsnull;
if (iterFrame->GetType() == nsGkAtoms::inlineFrame) {
// Only do deeper bounds search if we're on an inline frame
// Inline frames can contain larger frames inside of them
iterNextFrame = iterFrame->GetFirstPrincipalChild();
}
if (iterNextFrame)
++depth; // Child was found in code above this: We are going deeper in this iteration of the loop
else {
// Use next sibling if it exists, or go back up the tree to get the first next-in-flow or next-sibling
// within our search
while (iterFrame) {
iterNextFrame = iterFrame->GetNextContinuation();
if (!iterNextFrame)
iterNextFrame = iterFrame->GetNextSibling();
if (iterNextFrame || --depth < 0)
break;
iterFrame = iterFrame->GetParent();
}
}
// Get ready for the next round of our loop
iterFrame = iterNextFrame;
if (iterFrame == nsnull)
break;
iterContent = nsnull;
if (depth == 0)
iterContent = iterFrame->GetContent();
nsIFrame* frame = GetFrame();
if (frame) {
*aBoundingFrame = nsLayoutUtils::GetContainingBlockForClientRect(frame);
aTotalBounds = nsLayoutUtils::
GetAllInFlowRectsUnion(frame, *aBoundingFrame,
nsLayoutUtils::RECTS_ACCOUNT_FOR_TRANSFORMS);
}
}
/* void getBounds (out long x, out long y, out long width, out long height); */
NS_IMETHODIMP
Accessible::GetBounds(PRInt32* aX, PRInt32* aY,

View File

@ -31,7 +31,7 @@
#include "nsISelectionPrivate.h"
#include "nsIServiceManager.h"
#include "nsTextFragment.h"
#include "nsTypedSelection.h"
#include "mozilla/Selection.h"
#include "gfxSkipChars.h"
using namespace mozilla::a11y;

View File

@ -117,10 +117,11 @@ struct nsIntMargin;
class nsPIDOMWindow;
class nsIDocumentLoaderFactory;
class nsIDOMHTMLInputElement;
class nsTypedSelection;
namespace mozilla {
class Selection;
namespace layers {
class LayerManager;
} // namespace layers
@ -2040,7 +2041,7 @@ public:
* @param aOutStartOffset Output start offset
* @param aOutEndOffset Output end offset
*/
static void GetSelectionInTextControl(nsTypedSelection* aSelection,
static void GetSelectionInTextControl(mozilla::Selection* aSelection,
Element* aRoot,
PRInt32& aOutStartOffset,
PRInt32& aOutEndOffset);

View File

@ -142,7 +142,7 @@ static NS_DEFINE_CID(kXTFServiceCID, NS_XTFSERVICE_CID);
#include "nsIDOMHTMLInputElement.h"
#include "nsParserConstants.h"
#include "nsIWebNavigation.h"
#include "nsTypedSelection.h"
#include "mozilla/Selection.h"
#ifdef IBMBIDI
#include "nsIBidiKeyboard.h"
@ -6858,7 +6858,7 @@ nsContentUtils::IsOnPrefWhitelist(nsPIDOMWindow* aWindow,
// static
void
nsContentUtils::GetSelectionInTextControl(nsTypedSelection* aSelection,
nsContentUtils::GetSelectionInTextControl(Selection* aSelection,
Element* aRoot,
PRInt32& aOutStartOffset,
PRInt32& aOutEndOffset)

View File

@ -81,10 +81,7 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN_INHERITED(nsDOMFileReader,
nsDOMEventTargetHelper)
if(tmp->mResultArrayBuffer) {
NS_IMPL_CYCLE_COLLECTION_TRACE_JS_CALLBACK(tmp->mResultArrayBuffer,
"mResultArrayBuffer")
}
NS_IMPL_CYCLE_COLLECTION_TRACE_JS_MEMBER_CALLBACK(mResultArrayBuffer)
NS_IMPL_CYCLE_COLLECTION_TRACE_END
DOMCI_DATA(FileReader, nsDOMFileReader)

View File

@ -671,14 +671,8 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN_INHERITED(nsXMLHttpRequest,
nsXHREventTarget)
if(tmp->mResultArrayBuffer) {
NS_IMPL_CYCLE_COLLECTION_TRACE_JS_CALLBACK(tmp->mResultArrayBuffer,
"mResultArrayBuffer")
}
if (JSVAL_IS_GCTHING(tmp->mResultJSON)) {
void *gcThing = JSVAL_TO_GCTHING(tmp->mResultJSON);
NS_IMPL_CYCLE_COLLECTION_TRACE_JS_CALLBACK(gcThing, "mResultJSON")
}
NS_IMPL_CYCLE_COLLECTION_TRACE_JS_MEMBER_CALLBACK(mResultArrayBuffer)
NS_IMPL_CYCLE_COLLECTION_TRACE_JSVAL_MEMBER_CALLBACK(mResultJSON)
NS_IMPL_CYCLE_COLLECTION_TRACE_END
DOMCI_DATA(XMLHttpRequest, nsXMLHttpRequest)

View File

@ -28,7 +28,7 @@ NS_INTERFACE_MAP_END
NS_IMPL_CYCLE_COLLECTION_CLASS(ImageData)
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(ImageData)
NS_IMPL_CYCLE_COLLECTION_TRACE_JS_CALLBACK(tmp->mData, "mData")
NS_IMPL_CYCLE_COLLECTION_TRACE_JS_MEMBER_CALLBACK(mData)
NS_IMPL_CYCLE_COLLECTION_TRACE_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(ImageData)

View File

@ -22,10 +22,7 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(nsDOMMessageEvent, nsDOMEvent)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(nsDOMMessageEvent)
if (JSVAL_IS_GCTHING(tmp->mData)) {
void *gcThing = JSVAL_TO_GCTHING(tmp->mData);
NS_IMPL_CYCLE_COLLECTION_TRACE_JS_CALLBACK(gcThing, "mData")
}
NS_IMPL_CYCLE_COLLECTION_TRACE_JSVAL_MEMBER_CALLBACK(mData)
NS_IMPL_CYCLE_COLLECTION_TRACE_END
DOMCI_DATA(MessageEvent, nsDOMMessageEvent)

View File

@ -33,10 +33,11 @@
#include "nsServiceManagerUtils.h"
#include "nsIEditor.h"
#include "nsTextEditRules.h"
#include "nsTypedSelection.h"
#include "mozilla/Selection.h"
#include "nsEventListenerManager.h"
#include "nsContentUtils.h"
using namespace mozilla;
using namespace mozilla::dom;
static NS_DEFINE_CID(kTextEditorCID, NS_TEXTEDITOR_CID);

View File

@ -51,10 +51,7 @@ NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN_INHERITED(DOMRequest,
nsDOMEventTargetHelper)
// Don't need NS_IMPL_CYCLE_COLLECTION_TRACE_PRESERVED_WRAPPER because
// nsDOMEventTargetHelper does it for us.
if (JSVAL_IS_GCTHING(tmp->mResult)) {
void *gcThing = JSVAL_TO_GCTHING(tmp->mResult);
NS_IMPL_CYCLE_COLLECTION_TRACE_JS_CALLBACK(gcThing, "mResult")
}
NS_IMPL_CYCLE_COLLECTION_TRACE_JSVAL_MEMBER_CALLBACK(mResult)
NS_IMPL_CYCLE_COLLECTION_TRACE_END
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(DOMRequest)

View File

@ -44,7 +44,7 @@
#include "nsIBaseWindow.h"
#include "nsIViewManager.h"
#include "nsFrameSelection.h"
#include "nsTypedSelection.h"
#include "mozilla/Selection.h"
#include "nsXULPopupManager.h"
#include "nsIDOMNodeFilter.h"
#include "nsIScriptObjectPrincipal.h"

View File

@ -29,6 +29,7 @@
#include "IndexedDatabaseInlines.h"
USING_INDEXEDDB_NAMESPACE
using namespace mozilla::dom::indexedDB::ipc;
MOZ_STATIC_ASSERT(sizeof(size_t) >= sizeof(IDBCursor::Direction),
"Relying on conversion between size_t and "
@ -39,8 +40,6 @@ namespace {
class CursorHelper : public AsyncConnectionHelper
{
public:
typedef ipc::CursorRequestParams CursorRequestParams;
CursorHelper(IDBCursor* aCursor)
: AsyncConnectionHelper(aCursor->Transaction(), aCursor->Request()),
mCursor(aCursor), mActor(nsnull)
@ -457,22 +456,10 @@ NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(IDBCursor)
"Should have a cached primary key");
NS_ASSERTION(tmp->mHaveCachedValue || JSVAL_IS_VOID(tmp->mCachedValue),
"Should have a cached value");
if (tmp->mScriptOwner) {
NS_IMPL_CYCLE_COLLECTION_TRACE_JS_CALLBACK(tmp->mScriptOwner,
"mScriptOwner")
}
if (JSVAL_IS_GCTHING(tmp->mCachedKey)) {
void *gcThing = JSVAL_TO_GCTHING(tmp->mCachedKey);
NS_IMPL_CYCLE_COLLECTION_TRACE_JS_CALLBACK(gcThing, "mCachedKey")
}
if (JSVAL_IS_GCTHING(tmp->mCachedPrimaryKey)) {
void *gcThing = JSVAL_TO_GCTHING(tmp->mCachedPrimaryKey);
NS_IMPL_CYCLE_COLLECTION_TRACE_JS_CALLBACK(gcThing, "mCachedPrimaryKey")
}
if (JSVAL_IS_GCTHING(tmp->mCachedValue)) {
void *gcThing = JSVAL_TO_GCTHING(tmp->mCachedValue);
NS_IMPL_CYCLE_COLLECTION_TRACE_JS_CALLBACK(gcThing, "mCachedValue")
}
NS_IMPL_CYCLE_COLLECTION_TRACE_JS_MEMBER_CALLBACK(mScriptOwner)
NS_IMPL_CYCLE_COLLECTION_TRACE_JSVAL_MEMBER_CALLBACK(mCachedKey)
NS_IMPL_CYCLE_COLLECTION_TRACE_JSVAL_MEMBER_CALLBACK(mCachedPrimaryKey)
NS_IMPL_CYCLE_COLLECTION_TRACE_JSVAL_MEMBER_CALLBACK(mCachedValue)
NS_IMPL_CYCLE_COLLECTION_TRACE_END
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(IDBCursor)
@ -889,7 +876,7 @@ ContinueHelper::GetSuccessResult(JSContext* aCx,
nsresult
ContinueHelper::PackArgumentsForParentProcess(CursorRequestParams& aParams)
{
ipc::ContinueParams params;
ContinueParams params;
params.key() = mCursor->mContinueToKey;
params.count() = uint32_t(mCount);
@ -914,12 +901,12 @@ ContinueHelper::MaybeSendResponseToChildProcess(nsresult aResultCode)
return Error;
}
ipc::ResponseValue response;
ResponseValue response;
if (NS_FAILED(aResultCode)) {
response = aResultCode;
}
else {
ipc::ContinueResponse continueResponse;
ContinueResponse continueResponse;
continueResponse.key() = mKey;
continueResponse.objectKey() = mObjectKey;
continueResponse.cloneInfo() = mCloneReadInfo;
@ -942,7 +929,7 @@ ContinueHelper::UnpackResponseFromParentProcess(
NS_ASSERTION(aResponseValue.type() == ResponseValue::TContinueResponse,
"Bad response type!");
const ipc::ContinueResponse& response = aResponseValue.get_ContinueResponse();
const ContinueResponse& response = aResponseValue.get_ContinueResponse();
mKey = response.key();
mObjectKey = response.objectKey();

View File

@ -416,10 +416,7 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(IDBFactory)
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(IDBFactory)
if (tmp->mOwningObject) {
NS_IMPL_CYCLE_COLLECTION_TRACE_JS_CALLBACK(tmp->mOwningObject,
"mOwningObject")
}
NS_IMPL_CYCLE_COLLECTION_TRACE_JS_MEMBER_CALLBACK(mOwningObject)
NS_IMPL_CYCLE_COLLECTION_TRACE_END
DOMCI_DATA(IDBFactory, IDBFactory)

View File

@ -31,14 +31,13 @@
#include "IndexedDatabaseInlines.h"
USING_INDEXEDDB_NAMESPACE
using namespace mozilla::dom::indexedDB::ipc;
namespace {
class IndexHelper : public AsyncConnectionHelper
{
public:
typedef ipc::IndexRequestParams IndexRequestParams;
IndexHelper(IDBTransaction* aTransaction,
IDBRequest* aRequest,
IDBIndex* aIndex)
@ -374,15 +373,15 @@ IDBIndex::Create(IDBObjectStore* aObjectStore,
nsAutoPtr<IndexedDBIndexChild> actor(new IndexedDBIndexChild(index));
ipc::IndexConstructorParams params;
IndexConstructorParams params;
if (aCreating) {
ipc::CreateIndexParams createParams;
CreateIndexParams createParams;
createParams.info() = *aIndexInfo;
params = createParams;
}
else {
ipc::GetIndexParams getParams;
GetIndexParams getParams;
getParams.name() = aIndexInfo->name;
params = getParams;
}
@ -1081,7 +1080,7 @@ GetKeyHelper::PackArgumentsForParentProcess(IndexRequestParams& aParams)
{
NS_ASSERTION(mKeyRange, "This should never be null!");
ipc::GetKeyParams params;
GetKeyParams params;
mKeyRange->ToSerializedKeyRange(params.keyRange());
@ -1100,12 +1099,12 @@ GetKeyHelper::MaybeSendResponseToChildProcess(nsresult aResultCode)
return Success_NotSent;
}
ipc::ResponseValue response;
ResponseValue response;
if (NS_FAILED(aResultCode)) {
response = aResultCode;
}
else {
ipc::GetKeyResponse getKeyResponse;
GetKeyResponse getKeyResponse;
getKeyResponse.key() = mKey;
response = getKeyResponse;
}
@ -1203,7 +1202,7 @@ GetHelper::PackArgumentsForParentProcess(IndexRequestParams& aParams)
{
NS_ASSERTION(mKeyRange, "This should never be null!");
ipc::FIXME_Bug_521898_index::GetParams params;
FIXME_Bug_521898_index::GetParams params;
mKeyRange->ToSerializedKeyRange(params.keyRange());
@ -1227,14 +1226,14 @@ GetHelper::MaybeSendResponseToChildProcess(nsresult aResultCode)
return Error;
}
ipc::ResponseValue response;
ResponseValue response;
if (NS_FAILED(aResultCode)) {
response = aResultCode;
}
else {
SerializedStructuredCloneReadInfo readInfo;
readInfo = mCloneReadInfo;
ipc::GetResponse getResponse = readInfo;
GetResponse getResponse = readInfo;
response = getResponse;
}
@ -1377,10 +1376,10 @@ GetAllKeysHelper::GetSuccessResult(JSContext* aCx,
nsresult
GetAllKeysHelper::PackArgumentsForParentProcess(IndexRequestParams& aParams)
{
ipc::GetAllKeysParams params;
GetAllKeysParams params;
if (mKeyRange) {
ipc::FIXME_Bug_521898_index::KeyRange keyRange;
FIXME_Bug_521898_index::KeyRange keyRange;
mKeyRange->ToSerializedKeyRange(keyRange);
params.optionalKeyRange() = keyRange;
}
@ -1405,12 +1404,12 @@ GetAllKeysHelper::MaybeSendResponseToChildProcess(nsresult aResultCode)
return Success_NotSent;
}
ipc::ResponseValue response;
ResponseValue response;
if (NS_FAILED(aResultCode)) {
response = aResultCode;
}
else {
ipc::GetAllKeysResponse getAllKeysResponse;
GetAllKeysResponse getAllKeysResponse;
getAllKeysResponse.keys().AppendElements(mKeys);
response = getAllKeysResponse;
}
@ -1525,10 +1524,10 @@ GetAllHelper::ReleaseMainThreadObjects()
nsresult
GetAllHelper::PackArgumentsForParentProcess(IndexRequestParams& aParams)
{
ipc::FIXME_Bug_521898_index::GetAllParams params;
FIXME_Bug_521898_index::GetAllParams params;
if (mKeyRange) {
ipc::FIXME_Bug_521898_index::KeyRange keyRange;
FIXME_Bug_521898_index::KeyRange keyRange;
mKeyRange->ToSerializedKeyRange(keyRange);
params.optionalKeyRange() = keyRange;
}
@ -1560,12 +1559,12 @@ GetAllHelper::MaybeSendResponseToChildProcess(nsresult aResultCode)
}
}
ipc::ResponseValue response;
ResponseValue response;
if (NS_FAILED(aResultCode)) {
response = aResultCode;
}
else {
ipc::GetAllResponse getAllResponse;
GetAllResponse getAllResponse;
InfallibleTArray<SerializedStructuredCloneReadInfo>& infos =
getAllResponse.cloneInfos();
@ -1821,10 +1820,10 @@ OpenKeyCursorHelper::ReleaseMainThreadObjects()
nsresult
OpenKeyCursorHelper::PackArgumentsForParentProcess(IndexRequestParams& aParams)
{
ipc::OpenKeyCursorParams params;
OpenKeyCursorParams params;
if (mKeyRange) {
ipc::FIXME_Bug_521898_index::KeyRange keyRange;
FIXME_Bug_521898_index::KeyRange keyRange;
mKeyRange->ToSerializedKeyRange(keyRange);
params.optionalKeyRange() = keyRange;
}
@ -1859,12 +1858,12 @@ OpenKeyCursorHelper::MaybeSendResponseToChildProcess(nsresult aResultCode)
}
}
ipc::ResponseValue response;
ResponseValue response;
if (NS_FAILED(aResultCode)) {
response = aResultCode;
}
else {
ipc::OpenCursorResponse openCursorResponse;
OpenCursorResponse openCursorResponse;
if (!mCursor) {
openCursorResponse = mozilla::void_t();
@ -1876,7 +1875,7 @@ OpenKeyCursorHelper::MaybeSendResponseToChildProcess(nsresult aResultCode)
IndexedDBRequestParentBase* requestActor = mRequest->GetActorParent();
NS_ASSERTION(requestActor, "Must have an actor here!");
ipc::IndexCursorConstructorParams params;
IndexCursorConstructorParams params;
params.requestParent() = requestActor;
params.direction() = mDirection;
params.key() = mKey;
@ -1909,20 +1908,20 @@ OpenKeyCursorHelper::UnpackResponseFromParentProcess(
NS_ASSERTION(aResponseValue.type() == ResponseValue::TOpenCursorResponse,
"Bad response type!");
NS_ASSERTION(aResponseValue.get_OpenCursorResponse().type() ==
ipc::OpenCursorResponse::Tvoid_t ||
OpenCursorResponse::Tvoid_t ||
aResponseValue.get_OpenCursorResponse().type() ==
ipc::OpenCursorResponse::TPIndexedDBCursorChild,
OpenCursorResponse::TPIndexedDBCursorChild,
"Bad response union type!");
NS_ASSERTION(!mCursor, "Shouldn't have this yet!");
const ipc::OpenCursorResponse& response =
const OpenCursorResponse& response =
aResponseValue.get_OpenCursorResponse();
switch (response.type()) {
case ipc::OpenCursorResponse::Tvoid_t:
case OpenCursorResponse::Tvoid_t:
break;
case ipc::OpenCursorResponse::TPIndexedDBCursorChild: {
case OpenCursorResponse::TPIndexedDBCursorChild: {
IndexedDBCursorChild* actor =
static_cast<IndexedDBCursorChild*>(
response.get_PIndexedDBCursorChild());
@ -2157,10 +2156,10 @@ OpenCursorHelper::ReleaseMainThreadObjects()
nsresult
OpenCursorHelper::PackArgumentsForParentProcess(IndexRequestParams& aParams)
{
ipc::FIXME_Bug_521898_index::OpenCursorParams params;
FIXME_Bug_521898_index::OpenCursorParams params;
if (mKeyRange) {
ipc::FIXME_Bug_521898_index::KeyRange keyRange;
FIXME_Bug_521898_index::KeyRange keyRange;
mKeyRange->ToSerializedKeyRange(keyRange);
params.optionalKeyRange() = keyRange;
}
@ -2200,12 +2199,12 @@ OpenCursorHelper::MaybeSendResponseToChildProcess(nsresult aResultCode)
}
}
ipc::ResponseValue response;
ResponseValue response;
if (NS_FAILED(aResultCode)) {
response = aResultCode;
}
else {
ipc::OpenCursorResponse openCursorResponse;
OpenCursorResponse openCursorResponse;
if (!mCursor) {
openCursorResponse = mozilla::void_t();
@ -2221,7 +2220,7 @@ OpenCursorHelper::MaybeSendResponseToChildProcess(nsresult aResultCode)
mSerializedCloneReadInfo.dataLength,
"Shouldn't be possible!");
ipc::IndexCursorConstructorParams params;
IndexCursorConstructorParams params;
params.requestParent() = requestActor;
params.direction() = mDirection;
params.key() = mKey;
@ -2328,10 +2327,10 @@ CountHelper::ReleaseMainThreadObjects()
nsresult
CountHelper::PackArgumentsForParentProcess(IndexRequestParams& aParams)
{
ipc::FIXME_Bug_521898_index::CountParams params;
FIXME_Bug_521898_index::CountParams params;
if (mKeyRange) {
ipc::FIXME_Bug_521898_index::KeyRange keyRange;
FIXME_Bug_521898_index::KeyRange keyRange;
mKeyRange->ToSerializedKeyRange(keyRange);
params.optionalKeyRange() = keyRange;
}
@ -2354,12 +2353,12 @@ CountHelper::MaybeSendResponseToChildProcess(nsresult aResultCode)
return Success_NotSent;
}
ipc::ResponseValue response;
ResponseValue response;
if (NS_FAILED(aResultCode)) {
response = aResultCode;
}
else {
ipc::CountResponse countResponse = mCount;
CountResponse countResponse = mCount;
response = countResponse;
}

View File

@ -21,6 +21,7 @@
#include "mozilla/dom/indexedDB/PIndexedDBObjectStore.h"
USING_INDEXEDDB_NAMESPACE
using namespace mozilla::dom::indexedDB::ipc;
namespace {
@ -315,14 +316,8 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(IDBKeyRange)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(IDBKeyRange)
if (JSVAL_IS_GCTHING(tmp->mCachedLowerVal)) {
void *gcThing = JSVAL_TO_GCTHING(tmp->mCachedLowerVal);
NS_IMPL_CYCLE_COLLECTION_TRACE_JS_CALLBACK(gcThing, "mCachedLowerVal")
}
if (JSVAL_IS_GCTHING(tmp->mCachedUpperVal)) {
void *gcThing = JSVAL_TO_GCTHING(tmp->mCachedUpperVal);
NS_IMPL_CYCLE_COLLECTION_TRACE_JS_CALLBACK(gcThing, "mCachedUpperVal")
}
NS_IMPL_CYCLE_COLLECTION_TRACE_JSVAL_MEMBER_CALLBACK(mCachedLowerVal)
NS_IMPL_CYCLE_COLLECTION_TRACE_JSVAL_MEMBER_CALLBACK(mCachedUpperVal)
NS_IMPL_CYCLE_COLLECTION_TRACE_END
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(IDBKeyRange)
@ -419,17 +414,17 @@ IDBKeyRange::GetUpperOpen(bool* aUpperOpen)
// Explicitly instantiate for all our key range types... Grumble.
template already_AddRefed<IDBKeyRange>
IDBKeyRange::FromSerializedKeyRange<ipc::FIXME_Bug_521898_objectstore::KeyRange>
(const ipc::FIXME_Bug_521898_objectstore::KeyRange& aKeyRange);
IDBKeyRange::FromSerializedKeyRange<FIXME_Bug_521898_objectstore::KeyRange>
(const FIXME_Bug_521898_objectstore::KeyRange& aKeyRange);
template already_AddRefed<IDBKeyRange>
IDBKeyRange::FromSerializedKeyRange<ipc::FIXME_Bug_521898_index::KeyRange>
(const ipc::FIXME_Bug_521898_index::KeyRange& aKeyRange);
IDBKeyRange::FromSerializedKeyRange<FIXME_Bug_521898_index::KeyRange>
(const FIXME_Bug_521898_index::KeyRange& aKeyRange);
template void
IDBKeyRange::ToSerializedKeyRange<ipc::FIXME_Bug_521898_objectstore::KeyRange>
(ipc::FIXME_Bug_521898_objectstore::KeyRange& aKeyRange);
IDBKeyRange::ToSerializedKeyRange<FIXME_Bug_521898_objectstore::KeyRange>
(FIXME_Bug_521898_objectstore::KeyRange& aKeyRange);
template void
IDBKeyRange::ToSerializedKeyRange<ipc::FIXME_Bug_521898_index::KeyRange>
(ipc::FIXME_Bug_521898_index::KeyRange& aKeyRange);
IDBKeyRange::ToSerializedKeyRange<FIXME_Bug_521898_index::KeyRange>
(FIXME_Bug_521898_index::KeyRange& aKeyRange);

View File

@ -46,14 +46,13 @@
#define FILE_COPY_BUFFER_SIZE 32768
USING_INDEXEDDB_NAMESPACE
using namespace mozilla::dom::indexedDB::ipc;
namespace {
class ObjectStoreHelper : public AsyncConnectionHelper
{
public:
typedef ipc::ObjectStoreRequestParams ObjectStoreRequestParams;
ObjectStoreHelper(IDBTransaction* aTransaction,
IDBRequest* aRequest,
IDBObjectStore* aObjectStore)
@ -677,15 +676,15 @@ IDBObjectStore::Create(IDBTransaction* aTransaction,
IndexedDBTransactionChild* transactionActor = aTransaction->GetActorChild();
NS_ASSERTION(transactionActor, "Must have an actor here!");
ipc::ObjectStoreConstructorParams params;
ObjectStoreConstructorParams params;
if (aCreating) {
ipc::CreateObjectStoreParams createParams;
CreateObjectStoreParams createParams;
createParams.info() = *aStoreInfo;
params = createParams;
}
else {
ipc::GetObjectStoreParams getParams;
GetObjectStoreParams getParams;
getParams.name() = aStoreInfo->name;
params = getParams;
}
@ -2779,18 +2778,18 @@ AddHelper::ReleaseMainThreadObjects()
nsresult
AddHelper::PackArgumentsForParentProcess(ObjectStoreRequestParams& aParams)
{
ipc::AddPutParams commonParams;
AddPutParams commonParams;
commonParams.cloneInfo() = mCloneWriteInfo;
commonParams.key() = mKey;
commonParams.indexUpdateInfos().AppendElements(mIndexUpdateInfo);
if (mOverwrite) {
ipc::PutParams putParams;
PutParams putParams;
putParams.commonParams() = commonParams;
aParams = putParams;
}
else {
ipc::AddParams addParams;
AddParams addParams;
addParams.commonParams() = commonParams;
aParams = addParams;
}
@ -2809,17 +2808,17 @@ AddHelper::MaybeSendResponseToChildProcess(nsresult aResultCode)
return Success_NotSent;
}
ipc::ResponseValue response;
ResponseValue response;
if (NS_FAILED(aResultCode)) {
response = aResultCode;
}
else if (mOverwrite) {
ipc::PutResponse putResponse;
PutResponse putResponse;
putResponse.key() = mKey;
response = putResponse;
}
else {
ipc::AddResponse addResponse;
AddResponse addResponse;
addResponse.key() = mKey;
response = addResponse;
}
@ -2909,7 +2908,7 @@ GetHelper::PackArgumentsForParentProcess(ObjectStoreRequestParams& aParams)
{
NS_ASSERTION(mKeyRange, "This should never be null!");
ipc::FIXME_Bug_521898_objectstore::GetParams params;
FIXME_Bug_521898_objectstore::GetParams params;
mKeyRange->ToSerializedKeyRange(params.keyRange());
@ -2933,14 +2932,14 @@ GetHelper::MaybeSendResponseToChildProcess(nsresult aResultCode)
return Error;
}
ipc::ResponseValue response;
ResponseValue response;
if (NS_FAILED(aResultCode)) {
response = aResultCode;
}
else {
SerializedStructuredCloneReadInfo readInfo;
readInfo = mCloneReadInfo;
ipc::GetResponse getResponse = readInfo;
GetResponse getResponse = readInfo;
response = getResponse;
}
@ -3017,7 +3016,7 @@ DeleteHelper::PackArgumentsForParentProcess(ObjectStoreRequestParams& aParams)
{
NS_ASSERTION(mKeyRange, "This should never be null!");
ipc::DeleteParams params;
DeleteParams params;
mKeyRange->ToSerializedKeyRange(params.keyRange());
@ -3036,12 +3035,12 @@ DeleteHelper::MaybeSendResponseToChildProcess(nsresult aResultCode)
return Success_NotSent;
}
ipc::ResponseValue response;
ResponseValue response;
if (NS_FAILED(aResultCode)) {
response = aResultCode;
}
else {
response = ipc::DeleteResponse();
response = DeleteResponse();
}
if (!actor->Send__delete__(actor, response)) {
@ -3087,7 +3086,7 @@ ClearHelper::DoDatabaseWork(mozIStorageConnection* aConnection)
nsresult
ClearHelper::PackArgumentsForParentProcess(ObjectStoreRequestParams& aParams)
{
aParams = ipc::ClearParams();
aParams = ClearParams();
return NS_OK;
}
@ -3102,12 +3101,12 @@ ClearHelper::MaybeSendResponseToChildProcess(nsresult aResultCode)
return Success_NotSent;
}
ipc::ResponseValue response;
ResponseValue response;
if (NS_FAILED(aResultCode)) {
response = aResultCode;
}
else {
response = ipc::ClearResponse();
response = ClearResponse();
}
if (!actor->Send__delete__(actor, response)) {
@ -3309,10 +3308,10 @@ nsresult
OpenCursorHelper::PackArgumentsForParentProcess(
ObjectStoreRequestParams& aParams)
{
ipc::FIXME_Bug_521898_objectstore::OpenCursorParams params;
FIXME_Bug_521898_objectstore::OpenCursorParams params;
if (mKeyRange) {
ipc::FIXME_Bug_521898_objectstore::KeyRange keyRange;
FIXME_Bug_521898_objectstore::KeyRange keyRange;
mKeyRange->ToSerializedKeyRange(keyRange);
params.optionalKeyRange() = keyRange;
}
@ -3352,12 +3351,12 @@ OpenCursorHelper::MaybeSendResponseToChildProcess(nsresult aResultCode)
}
}
ipc::ResponseValue response;
ResponseValue response;
if (NS_FAILED(aResultCode)) {
response = aResultCode;
}
else {
ipc::OpenCursorResponse openCursorResponse;
OpenCursorResponse openCursorResponse;
if (!mCursor) {
openCursorResponse = mozilla::void_t();
@ -3374,7 +3373,7 @@ OpenCursorHelper::MaybeSendResponseToChildProcess(nsresult aResultCode)
mSerializedCloneReadInfo.dataLength,
"Shouldn't be possible!");
ipc::ObjectStoreCursorConstructorParams params;
ObjectStoreCursorConstructorParams params;
params.requestParent() = requestActor;
params.direction() = mDirection;
params.key() = mKey;
@ -3407,20 +3406,20 @@ OpenCursorHelper::UnpackResponseFromParentProcess(
NS_ASSERTION(aResponseValue.type() == ResponseValue::TOpenCursorResponse,
"Bad response type!");
NS_ASSERTION(aResponseValue.get_OpenCursorResponse().type() ==
ipc::OpenCursorResponse::Tvoid_t ||
OpenCursorResponse::Tvoid_t ||
aResponseValue.get_OpenCursorResponse().type() ==
ipc::OpenCursorResponse::TPIndexedDBCursorChild,
OpenCursorResponse::TPIndexedDBCursorChild,
"Bad response union type!");
NS_ASSERTION(!mCursor, "Shouldn't have this yet!");
const ipc::OpenCursorResponse& response =
const OpenCursorResponse& response =
aResponseValue.get_OpenCursorResponse();
switch (response.type()) {
case ipc::OpenCursorResponse::Tvoid_t:
case OpenCursorResponse::Tvoid_t:
break;
case ipc::OpenCursorResponse::TPIndexedDBCursorChild: {
case OpenCursorResponse::TPIndexedDBCursorChild: {
IndexedDBCursorChild* actor =
static_cast<IndexedDBCursorChild*>(
response.get_PIndexedDBCursorChild());
@ -3750,10 +3749,10 @@ GetAllHelper::ReleaseMainThreadObjects()
nsresult
GetAllHelper::PackArgumentsForParentProcess(ObjectStoreRequestParams& aParams)
{
ipc::FIXME_Bug_521898_objectstore::GetAllParams params;
FIXME_Bug_521898_objectstore::GetAllParams params;
if (mKeyRange) {
ipc::FIXME_Bug_521898_objectstore::KeyRange keyRange;
FIXME_Bug_521898_objectstore::KeyRange keyRange;
mKeyRange->ToSerializedKeyRange(keyRange);
params.optionalKeyRange() = keyRange;
}
@ -3785,12 +3784,12 @@ GetAllHelper::MaybeSendResponseToChildProcess(nsresult aResultCode)
}
}
ipc::ResponseValue response;
ResponseValue response;
if (NS_FAILED(aResultCode)) {
response = aResultCode;
}
else {
ipc::GetAllResponse getAllResponse;
GetAllResponse getAllResponse;
InfallibleTArray<SerializedStructuredCloneReadInfo>& infos =
getAllResponse.cloneInfos();
@ -3924,10 +3923,10 @@ CountHelper::ReleaseMainThreadObjects()
nsresult
CountHelper::PackArgumentsForParentProcess(ObjectStoreRequestParams& aParams)
{
ipc::FIXME_Bug_521898_objectstore::CountParams params;
FIXME_Bug_521898_objectstore::CountParams params;
if (mKeyRange) {
ipc::FIXME_Bug_521898_objectstore::KeyRange keyRange;
FIXME_Bug_521898_objectstore::KeyRange keyRange;
mKeyRange->ToSerializedKeyRange(keyRange);
params.optionalKeyRange() = keyRange;
}
@ -3950,12 +3949,12 @@ CountHelper::MaybeSendResponseToChildProcess(nsresult aResultCode)
return Success_NotSent;
}
ipc::ResponseValue response;
ResponseValue response;
if (NS_FAILED(aResultCode)) {
response = aResultCode;
}
else {
ipc::CountResponse countResponse = mCount;
CountResponse countResponse = mCount;
response = countResponse;
}

View File

@ -306,10 +306,7 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN_INHERITED(IDBRequest, IDBWrapperCache)
// Don't need NS_IMPL_CYCLE_COLLECTION_TRACE_PRESERVED_WRAPPER because
// nsDOMEventTargetHelper does it for us.
if (JSVAL_IS_GCTHING(tmp->mResultVal)) {
void *gcThing = JSVAL_TO_GCTHING(tmp->mResultVal);
NS_IMPL_CYCLE_COLLECTION_TRACE_JS_CALLBACK(gcThing, "mResultVal")
}
NS_IMPL_CYCLE_COLLECTION_TRACE_JSVAL_MEMBER_CALLBACK(mResultVal)
NS_IMPL_CYCLE_COLLECTION_TRACE_END
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(IDBRequest)

View File

@ -29,10 +29,7 @@ NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN_INHERITED(IDBWrapperCache,
nsDOMEventTargetHelper)
// Don't need NS_IMPL_CYCLE_COLLECTION_TRACE_PRESERVED_WRAPPER because
// nsDOMEventTargetHelper does it for us.
if (tmp->mScriptOwner) {
NS_IMPL_CYCLE_COLLECTION_TRACE_JS_CALLBACK(tmp->mScriptOwner,
"mScriptOwner")
}
NS_IMPL_CYCLE_COLLECTION_TRACE_JS_MEMBER_CALLBACK(mScriptOwner)
NS_IMPL_CYCLE_COLLECTION_TRACE_END
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(IDBWrapperCache)

View File

@ -44,10 +44,7 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN_INHERITED(SmsRequest,
nsDOMEventTargetHelper)
if (JSVAL_IS_GCTHING(tmp->mResult)) {
void *gcThing = JSVAL_TO_GCTHING(tmp->mResult);
NS_IMPL_CYCLE_COLLECTION_TRACE_JS_CALLBACK(gcThing, "mResult")
}
NS_IMPL_CYCLE_COLLECTION_TRACE_JSVAL_MEMBER_CALLBACK(mResult)
NS_IMPL_CYCLE_COLLECTION_TRACE_END
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(SmsRequest)

View File

@ -195,7 +195,7 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN_INHERITED(Telephony,
nsDOMEventTargetHelper)
NS_IMPL_CYCLE_COLLECTION_TRACE_JS_CALLBACK(tmp->mCallsArray, "mCallsArray")
NS_IMPL_CYCLE_COLLECTION_TRACE_JS_MEMBER_CALLBACK(mCallsArray)
NS_IMPL_CYCLE_COLLECTION_TRACE_END
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(Telephony,

View File

@ -46,7 +46,7 @@ public:
nsIEditor::EDirection aDirection) = 0;
NS_IMETHOD AfterEdit(nsEditor::OperationID action,
nsIEditor::EDirection aDirection) = 0;
NS_IMETHOD WillDoAction(nsTypedSelection* aSelection, nsRulesInfo* aInfo,
NS_IMETHOD WillDoAction(mozilla::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

@ -597,8 +597,8 @@ nsEditor::GetSelection(nsISelection **aSelection)
return selcon->GetSelection(nsISelectionController::SELECTION_NORMAL, aSelection); // does an addref
}
nsTypedSelection*
nsEditor::GetTypedSelection()
Selection*
nsEditor::GetSelection()
{
nsCOMPtr<nsISelection> sel;
nsresult res = GetSelection(getter_AddRefs(sel));

View File

@ -16,8 +16,7 @@
#include "nsIAtom.h"
#include "nsIDOMDocument.h"
#include "nsISelection.h"
#include "nsTypedSelection.h"
#include "mozilla/Selection.h"
#include "nsIDOMCharacterData.h"
#include "nsIPrivateTextRange.h"
#include "nsITransactionManager.h"
@ -595,7 +594,7 @@ public:
#if DEBUG_JOE
static void DumpNode(nsIDOMNode *aNode, PRInt32 indent=0);
#endif
nsTypedSelection* GetTypedSelection();
mozilla::Selection* GetSelection();
// Helpers to add a node to the selection.
// Used by table cell selection methods

View File

@ -46,7 +46,7 @@ nsHTMLEditor::AbsolutePositionSelection(bool aEnabled)
// the line below does not match the code; should it be removed?
// Find out if the selection is collapsed:
nsRefPtr<nsTypedSelection> selection = GetTypedSelection();
nsRefPtr<Selection> selection = GetSelection();
NS_ENSURE_TRUE(selection, NS_ERROR_NULL_POINTER);
nsTextRulesInfo ruleInfo(aEnabled ? kOpSetAbsolutePosition :
@ -159,7 +159,7 @@ nsHTMLEditor::RelativeChangeZIndex(PRInt32 aChange)
// brade: can we get rid of this comment?
// Find out if the selection is collapsed:
nsRefPtr<nsTypedSelection> selection = GetTypedSelection();
nsRefPtr<Selection> selection = GetSelection();
NS_ENSURE_TRUE(selection, NS_ERROR_NULL_POINTER);
nsTextRulesInfo ruleInfo(aChange < 0 ? kOpDecreaseZIndex :
kOpIncreaseZIndex);

View File

@ -152,7 +152,7 @@ NS_IMETHODIMP nsHTMLEditor::LoadHTML(const nsAString & aInputString)
nsAutoRules beginRulesSniffing(this, kOpLoadHTML, nsIEditor::eNext);
// Get selection
nsRefPtr<nsTypedSelection> selection = GetTypedSelection();
nsRefPtr<Selection> selection = GetSelection();
NS_ENSURE_STATE(selection);
nsTextRulesInfo ruleInfo(kOpLoadHTML);
@ -249,7 +249,7 @@ nsHTMLEditor::DoInsertHTMLWithContext(const nsAString & aInputString,
nsAutoRules beginRulesSniffing(this, kOpHTMLPaste, nsIEditor::eNext);
// Get selection
nsRefPtr<nsTypedSelection> selection = GetTypedSelection();
nsRefPtr<Selection> selection = GetSelection();
NS_ENSURE_STATE(selection);
// create a dom document fragment that represents the structure to paste
@ -1729,7 +1729,7 @@ NS_IMETHODIMP nsHTMLEditor::PasteAsCitedQuotation(const nsAString & aCitation,
nsAutoRules beginRulesSniffing(this, kOpInsertQuotation, nsIEditor::eNext);
// get selection
nsRefPtr<nsTypedSelection> selection = GetTypedSelection();
nsRefPtr<Selection> selection = GetSelection();
NS_ENSURE_TRUE(selection, NS_ERROR_NULL_POINTER);
// give rules a chance to handle or cancel
@ -1926,7 +1926,7 @@ nsHTMLEditor::InsertAsPlaintextQuotation(const nsAString & aQuotedText,
nsCOMPtr<nsIDOMNode> newNode;
// get selection
nsRefPtr<nsTypedSelection> selection = GetTypedSelection();
nsRefPtr<Selection> selection = GetSelection();
NS_ENSURE_TRUE(selection, NS_ERROR_NULL_POINTER);
nsAutoEditBatch beginBatching(this);
@ -2018,7 +2018,7 @@ nsHTMLEditor::InsertAsCitedQuotation(const nsAString & aQuotedText,
nsCOMPtr<nsIDOMNode> newNode;
// get selection
nsRefPtr<nsTypedSelection> selection = GetTypedSelection();
nsRefPtr<Selection> selection = GetSelection();
NS_ENSURE_TRUE(selection, NS_ERROR_NULL_POINTER);
nsAutoEditBatch beginBatching(this);

View File

@ -515,7 +515,7 @@ nsHTMLEditRules::AfterEditInner(nsEditor::OperationID action,
NS_IMETHODIMP
nsHTMLEditRules::WillDoAction(nsTypedSelection* aSelection,
nsHTMLEditRules::WillDoAction(Selection* aSelection,
nsRulesInfo* aInfo,
bool* aCancel,
bool* aHandled)
@ -1237,7 +1237,7 @@ nsHTMLEditRules::WillInsert(nsISelection *aSelection, bool *aCancel)
nsresult
nsHTMLEditRules::WillInsertText(nsEditor::OperationID aAction,
nsTypedSelection* aSelection,
Selection* aSelection,
bool *aCancel,
bool *aHandled,
const nsAString *inString,
@ -1463,7 +1463,7 @@ nsHTMLEditRules::WillLoadHTML(nsISelection *aSelection, bool *aCancel)
}
nsresult
nsHTMLEditRules::WillInsertBreak(nsTypedSelection* aSelection,
nsHTMLEditRules::WillInsertBreak(Selection* aSelection,
bool* aCancel, bool* aHandled)
{
if (!aSelection || !aCancel || !aHandled) {
@ -1779,7 +1779,7 @@ nsHTMLEditRules::SplitMailCites(nsISelection *aSelection, bool aPlaintext, bool
nsresult
nsHTMLEditRules::WillDeleteSelection(nsTypedSelection* aSelection,
nsHTMLEditRules::WillDeleteSelection(Selection* aSelection,
nsIEditor::EDirection aAction,
nsIEditor::EStripWrappers aStripWrappers,
bool* aCancel,
@ -7244,7 +7244,7 @@ nsHTMLEditRules::ReapplyCachedStyles()
bool useCSS = mHTMLEditor->IsCSSEnabled();
// get selection point; if it doesn't exist, we have nothing to do
nsRefPtr<nsTypedSelection> selection = mHTMLEditor->GetTypedSelection();
nsRefPtr<Selection> selection = mHTMLEditor->GetSelection();
MOZ_ASSERT(selection);
if (!selection->GetRangeCount()) {
// Nothing to do

View File

@ -60,7 +60,7 @@ public:
nsIEditor::EDirection aDirection);
NS_IMETHOD AfterEdit(nsEditor::OperationID action,
nsIEditor::EDirection aDirection);
NS_IMETHOD WillDoAction(nsTypedSelection* aSelection, nsRulesInfo* aInfo,
NS_IMETHOD WillDoAction(mozilla::Selection* aSelection, nsRulesInfo* aInfo,
bool* aCancel, bool* aHandled);
NS_IMETHOD DidDoAction(nsISelection *aSelection, nsRulesInfo *aInfo, nsresult aResult);
NS_IMETHOD DocumentModified();
@ -108,19 +108,19 @@ protected:
// nsHTMLEditRules implementation methods
nsresult WillInsert(nsISelection *aSelection, bool *aCancel);
nsresult WillInsertText( nsEditor::OperationID aAction,
nsTypedSelection* aSelection,
mozilla::Selection* aSelection,
bool *aCancel,
bool *aHandled,
const nsAString *inString,
nsAString *outString,
PRInt32 aMaxLength);
nsresult WillLoadHTML(nsISelection *aSelection, bool *aCancel);
nsresult WillInsertBreak(nsTypedSelection* aSelection,
nsresult WillInsertBreak(mozilla::Selection* aSelection,
bool* aCancel, bool* aHandled);
nsresult StandardBreakImpl(nsIDOMNode *aNode, PRInt32 aOffset, nsISelection *aSelection);
nsresult DidInsertBreak(nsISelection *aSelection, nsresult aResult);
nsresult SplitMailCites(nsISelection *aSelection, bool aPlaintext, bool *aHandled);
nsresult WillDeleteSelection(nsTypedSelection* aSelection,
nsresult WillDeleteSelection(mozilla::Selection* aSelection,
nsIEditor::EDirection aAction,
nsIEditor::EStripWrappers aStripWrappers,
bool* aCancel, bool* aHandled);

View File

@ -1694,7 +1694,7 @@ nsHTMLEditor::InsertElementAtSelection(nsIDOMElement* aElement, bool aDeleteSele
nsAutoEditBatch beginBatching(this);
nsAutoRules beginRulesSniffing(this, kOpInsertElement, nsIEditor::eNext);
nsRefPtr<nsTypedSelection> selection = GetTypedSelection();
nsRefPtr<Selection> selection = GetSelection();
if (!selection) {
return NS_ERROR_FAILURE;
}
@ -2179,7 +2179,7 @@ nsHTMLEditor::MakeOrChangeList(const nsAString& aListType, bool entireList, cons
nsAutoRules beginRulesSniffing(this, kOpMakeList, nsIEditor::eNext);
// pre-process
nsRefPtr<nsTypedSelection> selection = GetTypedSelection();
nsRefPtr<Selection> selection = GetSelection();
NS_ENSURE_TRUE(selection, NS_ERROR_NULL_POINTER);
nsTextRulesInfo ruleInfo(kOpMakeList);
@ -2255,7 +2255,7 @@ nsHTMLEditor::RemoveList(const nsAString& aListType)
nsAutoRules beginRulesSniffing(this, kOpRemoveList, nsIEditor::eNext);
// pre-process
nsRefPtr<nsTypedSelection> selection = GetTypedSelection();
nsRefPtr<Selection> selection = GetSelection();
NS_ENSURE_TRUE(selection, NS_ERROR_NULL_POINTER);
nsTextRulesInfo ruleInfo(kOpRemoveList);
@ -2286,7 +2286,7 @@ nsHTMLEditor::MakeDefinitionItem(const nsAString& aItemType)
nsAutoRules beginRulesSniffing(this, kOpMakeDefListItem, nsIEditor::eNext);
// pre-process
nsRefPtr<nsTypedSelection> selection = GetTypedSelection();
nsRefPtr<Selection> selection = GetSelection();
NS_ENSURE_TRUE(selection, NS_ERROR_NULL_POINTER);
nsTextRulesInfo ruleInfo(kOpMakeDefListItem);
ruleInfo.blockType = &aItemType;
@ -2317,7 +2317,7 @@ nsHTMLEditor::InsertBasicBlock(const nsAString& aBlockType)
nsAutoRules beginRulesSniffing(this, kOpMakeBasicBlock, nsIEditor::eNext);
// pre-process
nsRefPtr<nsTypedSelection> selection = GetTypedSelection();
nsRefPtr<Selection> selection = GetSelection();
NS_ENSURE_TRUE(selection, NS_ERROR_NULL_POINTER);
nsTextRulesInfo ruleInfo(kOpMakeBasicBlock);
ruleInfo.blockType = &aBlockType;
@ -2391,7 +2391,7 @@ nsHTMLEditor::Indent(const nsAString& aIndent)
nsAutoRules beginRulesSniffing(this, opID, nsIEditor::eNext);
// pre-process
nsRefPtr<nsTypedSelection> selection = GetTypedSelection();
nsRefPtr<Selection> selection = GetSelection();
NS_ENSURE_TRUE(selection, NS_ERROR_NULL_POINTER);
nsTextRulesInfo ruleInfo(opID);
@ -2468,7 +2468,7 @@ nsHTMLEditor::Align(const nsAString& aAlignType)
bool cancel, handled;
// Find out if the selection is collapsed:
nsRefPtr<nsTypedSelection> selection = GetTypedSelection();
nsRefPtr<Selection> selection = GetSelection();
NS_ENSURE_TRUE(selection, NS_ERROR_NULL_POINTER);
nsTextRulesInfo ruleInfo(kOpAlign);
ruleInfo.alignType = &aAlignType;
@ -3389,14 +3389,14 @@ nsHTMLEditor::DeleteSelectionImpl(EDirection aAction,
return NS_OK;
}
nsRefPtr<nsTypedSelection> typedSel = GetTypedSelection();
nsRefPtr<Selection> selection = GetSelection();
// Just checking that the selection itself is collapsed doesn't seem to work
// right in the multi-range case
NS_ENSURE_STATE(typedSel);
NS_ENSURE_STATE(typedSel->GetAnchorFocusRange());
NS_ENSURE_STATE(typedSel->GetAnchorFocusRange()->Collapsed());
NS_ENSURE_STATE(selection);
NS_ENSURE_STATE(selection->GetAnchorFocusRange());
NS_ENSURE_STATE(selection->GetAnchorFocusRange()->Collapsed());
nsCOMPtr<nsIContent> content = do_QueryInterface(typedSel->GetAnchorNode());
nsCOMPtr<nsIContent> content = do_QueryInterface(selection->GetAnchorNode());
NS_ENSURE_STATE(content);
// Don't strip wrappers if this is the only wrapper in the block. Then we'll
@ -4887,7 +4887,7 @@ nsHTMLEditor::SetCSSBackgroundColor(const nsAString& aColor)
// Protect the edit rules object from dying
nsCOMPtr<nsIEditRules> kungFuDeathGrip(mRules);
nsRefPtr<nsTypedSelection> selection = GetTypedSelection();
nsRefPtr<Selection> selection = GetSelection();
bool isCollapsed = selection->Collapsed();

View File

@ -88,7 +88,7 @@ nsHTMLEditor::SetInlineProperty(nsIAtom *aProperty,
}
ForceCompositionEnd();
nsRefPtr<nsTypedSelection> selection = GetTypedSelection();
nsRefPtr<Selection> selection = GetSelection();
NS_ENSURE_TRUE(selection, NS_ERROR_NULL_POINTER);
if (selection->Collapsed()) {
@ -1333,7 +1333,7 @@ nsresult nsHTMLEditor::RemoveInlinePropertyImpl(nsIAtom *aProperty, const nsAStr
ForceCompositionEnd();
nsresult res;
nsRefPtr<nsTypedSelection> selection = GetTypedSelection();
nsRefPtr<Selection> selection = GetSelection();
NS_ENSURE_TRUE(selection, NS_ERROR_NULL_POINTER);
bool useCSS = IsCSSEnabled();

View File

@ -630,7 +630,7 @@ nsPlaintextEditor::DeleteSelection(EDirection aAction,
nsAutoRules beginRulesSniffing(this, kOpDeleteSelection, aAction);
// pre-process
nsRefPtr<nsTypedSelection> selection = GetTypedSelection();
nsRefPtr<Selection> selection = GetSelection();
NS_ENSURE_TRUE(selection, NS_ERROR_NULL_POINTER);
// If there is an existing selection when an extended delete is requested,
@ -688,7 +688,7 @@ NS_IMETHODIMP nsPlaintextEditor::InsertText(const nsAString &aStringToInsert)
nsAutoRules beginRulesSniffing(this, opID, nsIEditor::eNext);
// pre-process
nsRefPtr<nsTypedSelection> selection = GetTypedSelection();
nsRefPtr<Selection> selection = GetSelection();
NS_ENSURE_TRUE(selection, NS_ERROR_NULL_POINTER);
nsAutoString resultString;
// XXX can we trust instring to outlive ruleInfo,
@ -725,7 +725,7 @@ NS_IMETHODIMP nsPlaintextEditor::InsertLineBreak()
nsAutoRules beginRulesSniffing(this, kOpInsertBreak, nsIEditor::eNext);
// pre-process
nsRefPtr<nsTypedSelection> selection = GetTypedSelection();
nsRefPtr<Selection> selection = GetSelection();
NS_ENSURE_TRUE(selection, NS_ERROR_NULL_POINTER);
// Batching the selection and moving nodes out from under the caret causes
@ -1073,7 +1073,7 @@ nsPlaintextEditor::Undo(PRUint32 aCount)
nsAutoRules beginRulesSniffing(this, kOpUndo, nsIEditor::eNone);
nsTextRulesInfo ruleInfo(kOpUndo);
nsRefPtr<nsTypedSelection> selection = GetTypedSelection();
nsRefPtr<Selection> selection = GetSelection();
bool cancel, handled;
nsresult result = mRules->WillDoAction(selection, &ruleInfo, &cancel, &handled);
@ -1102,7 +1102,7 @@ nsPlaintextEditor::Redo(PRUint32 aCount)
nsAutoRules beginRulesSniffing(this, kOpRedo, nsIEditor::eNone);
nsTextRulesInfo ruleInfo(kOpRedo);
nsRefPtr<nsTypedSelection> selection = GetTypedSelection();
nsRefPtr<Selection> selection = GetSelection();
bool cancel, handled;
nsresult result = mRules->WillDoAction(selection, &ruleInfo, &cancel, &handled);
@ -1376,7 +1376,7 @@ nsPlaintextEditor::InsertAsQuotation(const nsAString& aQuotedText,
quotedStuff.Append(PRUnichar('\n'));
// get selection
nsRefPtr<nsTypedSelection> selection = GetTypedSelection();
nsRefPtr<Selection> selection = GetSelection();
NS_ENSURE_TRUE(selection, NS_ERROR_NULL_POINTER);
nsAutoEditBatch beginBatching(this);

View File

@ -210,7 +210,7 @@ nsTextEditRules::AfterEdit(nsEditor::OperationID action,
NS_IMETHODIMP
nsTextEditRules::WillDoAction(nsTypedSelection* aSelection,
nsTextEditRules::WillDoAction(Selection* aSelection,
nsRulesInfo* aInfo,
bool* aCancel,
bool* aHandled)
@ -334,7 +334,7 @@ nsTextEditRules::DidInsert(nsISelection *aSelection, nsresult aResult)
}
nsresult
nsTextEditRules::WillInsertBreak(nsTypedSelection* aSelection,
nsTextEditRules::WillInsertBreak(Selection* aSelection,
bool *aCancel,
bool *aHandled,
PRInt32 aMaxLength)
@ -541,7 +541,7 @@ nsTextEditRules::HandleNewLines(nsString &aString,
nsresult
nsTextEditRules::WillInsertText(nsEditor::OperationID aAction,
nsTypedSelection* aSelection,
Selection* aSelection,
bool *aCancel,
bool *aHandled,
const nsAString *inString,
@ -753,7 +753,7 @@ nsTextEditRules::DidRemoveTextProperty(nsISelection *aSelection, nsresult aResul
}
nsresult
nsTextEditRules::WillDeleteSelection(nsTypedSelection* aSelection,
nsTextEditRules::WillDeleteSelection(Selection* aSelection,
nsIEditor::EDirection aCollapsedAction,
bool *aCancel,
bool *aHandled)
@ -1138,7 +1138,7 @@ nsTextEditRules::CreateBogusNodeIfNeeded(nsISelection *aSelection)
nsresult
nsTextEditRules::TruncateInsertionIfNeeded(nsTypedSelection* aSelection,
nsTextEditRules::TruncateInsertionIfNeeded(Selection* aSelection,
const nsAString *aInString,
nsAString *aOutString,
PRInt32 aMaxLength,
@ -1240,7 +1240,7 @@ nsresult nsTextEditRules::HideLastPWInput() {
nsAutoString hiddenText;
FillBufWithPWChars(&hiddenText, mLastLength);
nsRefPtr<nsTypedSelection> selection = mEditor->GetTypedSelection();
nsRefPtr<Selection> selection = mEditor->GetSelection();
NS_ENSURE_TRUE(selection, NS_ERROR_NULL_POINTER);
PRInt32 start, end;
nsContentUtils::GetSelectionInTextControl(selection, mEditor->GetRoot(),

View File

@ -42,7 +42,7 @@ public:
nsIEditor::EDirection aDirection);
NS_IMETHOD AfterEdit(nsEditor::OperationID action,
nsIEditor::EDirection aDirection);
NS_IMETHOD WillDoAction(nsTypedSelection* aSelection, nsRulesInfo* aInfo,
NS_IMETHOD WillDoAction(mozilla::Selection* aSelection, nsRulesInfo* aInfo,
bool* aCancel, bool* aHandled);
NS_IMETHOD DidDoAction(nsISelection *aSelection, nsRulesInfo *aInfo, nsresult aResult);
NS_IMETHOD DocumentIsEmpty(bool *aDocumentIsEmpty);
@ -91,7 +91,7 @@ protected:
// nsTextEditRules implementation methods
nsresult WillInsertText( nsEditor::OperationID aAction,
nsTypedSelection* aSelection,
mozilla::Selection* aSelection,
bool *aCancel,
bool *aHandled,
const nsAString *inString,
@ -100,14 +100,14 @@ protected:
nsresult DidInsertText(nsISelection *aSelection, nsresult aResult);
nsresult GetTopEnclosingPre(nsIDOMNode *aNode, nsIDOMNode** aOutPreNode);
nsresult WillInsertBreak(nsTypedSelection* aSelection, bool* aCancel,
nsresult WillInsertBreak(mozilla::Selection* aSelection, bool* aCancel,
bool *aHandled, PRInt32 aMaxLength);
nsresult DidInsertBreak(nsISelection *aSelection, nsresult aResult);
nsresult WillInsert(nsISelection *aSelection, bool *aCancel);
nsresult DidInsert(nsISelection *aSelection, nsresult aResult);
nsresult WillDeleteSelection(nsTypedSelection* aSelection,
nsresult WillDeleteSelection(mozilla::Selection* aSelection,
nsIEditor::EDirection aCollapsedAction,
bool *aCancel,
bool *aHandled);
@ -156,7 +156,7 @@ protected:
/** returns a truncated insertion string if insertion would place us
over aMaxLength */
nsresult TruncateInsertionIfNeeded(nsTypedSelection* aSelection,
nsresult TruncateInsertionIfNeeded(mozilla::Selection* aSelection,
const nsAString *aInString,
nsAString *aOutString,
PRInt32 aMaxLength,

View File

@ -71,6 +71,7 @@ enum Type {
TYPE_WRAP_LIST,
TYPE_ZOOM,
TYPE_EXCLUDE_GLASS_FRAME,
TYPE_SIMPLE_SCROLL_LAYER,
#if defined(MOZ_REFLOW_PERF_DSP) && defined(MOZ_REFLOW_PERF)
TYPE_REFLOW_COUNT,

View File

@ -2072,15 +2072,12 @@ nsDisplayScrollLayer::BuildLayer(nsDisplayListBuilder* aBuilder,
nsIContent* content = mScrolledFrame->GetContent();
ViewID scrollId = nsLayoutUtils::FindIDFor(content);
nsRect viewport = mScrollFrame->GetRect() -
mScrollFrame->GetPosition() +
aBuilder->ToReferenceFrame(mScrollFrame);
nsRect viewport =
nsRect(aBuilder->ToReferenceFrame(mScrollFrame), mScrollFrame->GetSize());
bool usingDisplayport = false;
nsRect displayport;
if (content) {
usingDisplayport = nsLayoutUtils::GetDisplayPort(content, &displayport);
}
usingDisplayport = nsLayoutUtils::GetDisplayPort(content, &displayport);
RecordFrameMetrics(mScrolledFrame, mScrollFrame, layer, mVisibleRect, viewport,
(usingDisplayport ? &displayport : nsnull), scrollId,
aContainerParameters);
@ -2233,6 +2230,71 @@ nsDisplayScrollInfoLayer::ShouldFlattenAway(nsDisplayListBuilder* aBuilder)
return RemoveScrollLayerCount() == 1;
}
nsDisplaySimpleScrollLayer::nsDisplaySimpleScrollLayer(nsDisplayListBuilder* aBuilder,
nsIFrame* aFrame, nsDisplayList* aList)
: nsDisplayWrapList(aBuilder, aFrame, aList) {
MOZ_COUNT_CTOR(nsDisplaySimpleScrollLayer);
}
#ifdef NS_BUILD_REFCNT_LOGGING
nsDisplaySimpleScrollLayer::~nsDisplaySimpleScrollLayer() {
MOZ_COUNT_DTOR(nsDisplaySimpleScrollLayer);
}
#endif
already_AddRefed<Layer>
nsDisplaySimpleScrollLayer::BuildLayer(nsDisplayListBuilder* aBuilder,
LayerManager* aManager,
const ContainerParameters& aContainerParameters) {
nsRefPtr<ContainerLayer> layer = aBuilder->LayerBuilder()->
BuildContainerLayerFor(aBuilder, aManager, mFrame, this, mList,
aContainerParameters, nsnull);
// Get the already set unique ID for scrolling this content remotely.
// Or, if not set, generate a new ID.
nsIContent* content = mFrame->PresContext()->Document()->GetRootElement();
ViewID scrollId = nsLayoutUtils::FindIDFor(content);
nsRect viewport = nsRect(ToReferenceFrame(), mFrame->GetSize());
bool usingDisplayport = false;
nsRect displayport;
usingDisplayport = nsLayoutUtils::GetDisplayPort(content, &displayport);
RecordFrameMetrics(mFrame, nsnull, layer, mVisibleRect, viewport,
(usingDisplayport ? &displayport : nsnull), scrollId,
aContainerParameters);
return layer.forget();
}
bool
nsDisplaySimpleScrollLayer::ComputeVisibility(nsDisplayListBuilder* aBuilder,
nsRegion* aVisibleRegion,
const nsRect& aAllowVisibleRegionExpansion)
{
nsRect displayport;
if (nsLayoutUtils::GetDisplayPort(mFrame->PresContext()->Document()->GetRootElement(), &displayport)) {
// The visible region for the children may be much bigger than the hole we
// are viewing the children from, so that the compositor process has enough
// content to asynchronously pan while content is being refreshed.
nsRegion childVisibleRegion = displayport + ToReferenceFrame();
nsRect boundedRect =
childVisibleRegion.GetBounds().Intersect(mList.GetBounds(aBuilder));
nsRect allowExpansion = boundedRect.Intersect(aAllowVisibleRegionExpansion);
bool visible = mList.ComputeVisibilityForSublist(
aBuilder, &childVisibleRegion, boundedRect, allowExpansion);
mVisibleRect = boundedRect;
return visible;
} else {
return nsDisplayWrapList::ComputeVisibility(aBuilder, aVisibleRegion,
aAllowVisibleRegionExpansion);
}
}
nsDisplayClip::nsDisplayClip(nsDisplayListBuilder* aBuilder,
nsIFrame* aFrame, nsDisplayItem* aItem,
const nsRect& aRect)

View File

@ -2015,6 +2015,39 @@ public:
virtual bool ShouldFlattenAway(nsDisplayListBuilder* aBuilder);
};
/**
* A display item that has no purpose but to ensure its contents get
* their own layer and that FrameMetrics are recorded, if the frame's
* document's root element has a displayport.
*/
class nsDisplaySimpleScrollLayer : public nsDisplayWrapList {
public:
nsDisplaySimpleScrollLayer(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame,
nsDisplayList* aList);
#ifdef NS_BUILD_REFCNT_LOGGING
virtual ~nsDisplaySimpleScrollLayer();
#endif
virtual bool ComputeVisibility(nsDisplayListBuilder* aBuilder,
nsRegion* aVisibleRegion,
const nsRect& aAllowVisibleRegionExpansion);
virtual already_AddRefed<Layer> BuildLayer(nsDisplayListBuilder* aBuilder,
LayerManager* aManager,
const ContainerParameters& aContainerParameters);
virtual LayerState GetLayerState(nsDisplayListBuilder* aBuilder,
LayerManager* aManager,
const ContainerParameters& aParameters)
{
return mozilla::LAYER_ACTIVE;
}
virtual bool TryMerge(nsDisplayListBuilder* aBuilder, nsDisplayItem* aItem)
{
return false;
}
NS_DISPLAY_DECL_NAME("SimpleScrollLayer", TYPE_SIMPLE_SCROLL_LAYER)
};
/**
* nsDisplayClip can clip a list of items, but we take a single item
* initially and then later merge other items into it when we merge

View File

@ -53,7 +53,7 @@
#include "nsHTMLParts.h"
#include "nsISelection.h"
#include "nsISelectionPrivate.h"
#include "nsTypedSelection.h"
#include "mozilla/Selection.h"
#include "nsLayoutCID.h"
#include "nsGkAtoms.h"
#include "nsIDOMRange.h"

View File

@ -77,6 +77,8 @@
#define DEFAULT_COLUMN_WIDTH 20
using namespace mozilla;
nsIFrame*
NS_NewTextControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
{
@ -1064,7 +1066,7 @@ nsTextControlFrame::GetSelectionRange(PRInt32* aSelectionStart,
rv = selPriv->GetFrameSelection(getter_AddRefs(frameSel));
NS_ENSURE_SUCCESS(rv, rv);
NS_ENSURE_TRUE(frameSel, NS_ERROR_FAILURE);
nsRefPtr<nsTypedSelection> typedSel =
nsRefPtr<Selection> typedSel =
frameSel->GetSelection(nsISelectionController::SELECTION_NORMAL);
NS_ENSURE_TRUE(typedSel, NS_ERROR_FAILURE);

View File

@ -34,16 +34,20 @@ EXPORTS = \
nsIStatefulFrame.h \
nsFrameSelection.h \
nsSubDocumentFrame.h \
nsTypedSelection.h \
Selection.h \
nsObjectFrame.h \
$(NULL)
EXPORTS_NAMESPACES = mozilla/layout
EXPORTS_NAMESPACES = mozilla/layout mozilla
EXPORTS_mozilla/layout = \
FrameChildList.h \
$(NULL)
EXPORTS_mozilla = \
Selection.h \
$(NULL)
CPPSRCS = \
FrameChildList.cpp \
nsAbsoluteContainingBlock.cpp \

View File

@ -4,8 +4,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef nsTypedSelection_h
#define nsTypedSelection_h
#ifndef mozilla_Selection_h__
#define mozilla_Selection_h__
#include "nsIWeakReference.h"
@ -19,6 +19,7 @@ class nsAutoScrollTimer;
class nsIContentIterator;
class nsIFrame;
struct SelectionDetails;
class nsSelectionIterator;
struct RangeData
{
@ -30,22 +31,23 @@ struct RangeData
nsTextRangeStyle mTextRangeStyle;
};
// Note, the ownership of nsTypedSelection depends on which way the object is
// created. When nsFrameSelection has created nsTypedSelection,
// addreffing/releasing nsTypedSelection object is aggregated to
// nsFrameSelection. Otherwise normal addref/release is used.
// This ensures that nsFrameSelection is never deleted before its
// nsTypedSelections.
class nsTypedSelection : public nsISelectionPrivate,
public nsSupportsWeakReference
// Note, the ownership of mozilla::Selection depends on which way the object is
// created. When nsFrameSelection has created Selection, addreffing/releasing
// the Selection object is aggregated to nsFrameSelection. Otherwise normal
// addref/release is used. This ensures that nsFrameSelection is never deleted
// before its Selections.
namespace mozilla {
class Selection : public nsISelectionPrivate,
public nsSupportsWeakReference
{
public:
nsTypedSelection();
nsTypedSelection(nsFrameSelection *aList);
virtual ~nsTypedSelection();
Selection();
Selection(nsFrameSelection *aList);
virtual ~Selection();
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsTypedSelection, nsISelectionPrivate)
NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(Selection, nsISelectionPrivate)
NS_DECL_NSISELECTION
NS_DECL_NSISELECTIONPRIVATE
@ -127,7 +129,7 @@ public:
nsresult StopAutoScrollTimer();
private:
friend class nsAutoScrollTimer;
friend class ::nsAutoScrollTimer;
// Note: DoAutoScroll might destroy arbitrary frames etc.
nsresult DoAutoScroll(nsIFrame *aFrame, nsPoint& aPoint);
@ -139,7 +141,7 @@ public:
nsresult NotifySelectionListeners();
private:
friend class nsSelectionIterator;
friend class ::nsSelectionIterator;
class ScrollSelectionIntoViewEvent;
friend class ScrollSelectionIntoViewEvent;
@ -147,21 +149,21 @@ private:
class ScrollSelectionIntoViewEvent : public nsRunnable {
public:
NS_DECL_NSIRUNNABLE
ScrollSelectionIntoViewEvent(nsTypedSelection *aTypedSelection,
ScrollSelectionIntoViewEvent(Selection* aSelection,
SelectionRegion aRegion,
nsIPresShell::ScrollAxis aVertical,
nsIPresShell::ScrollAxis aHorizontal,
bool aFirstAncestorOnly)
: mTypedSelection(aTypedSelection),
: mSelection(aSelection),
mRegion(aRegion),
mVerticalScroll(aVertical),
mHorizontalScroll(aHorizontal),
mFirstAncestorOnly(aFirstAncestorOnly) {
NS_ASSERTION(aTypedSelection, "null parameter");
NS_ASSERTION(aSelection, "null parameter");
}
void Revoke() { mTypedSelection = nsnull; }
void Revoke() { mSelection = nsnull; }
private:
nsTypedSelection *mTypedSelection;
Selection *mSelection;
SelectionRegion mRegion;
nsIPresShell::ScrollAxis mVerticalScroll;
nsIPresShell::ScrollAxis mHorizontalScroll;
@ -218,4 +220,6 @@ private:
SelectionType mType;
};
#endif // nsTypedSelection_h
} // namespace mozilla
#endif // mozilla_Selection_h__

View File

@ -173,7 +173,9 @@ struct nsPrevNextBidiLevels
PRUint8 mLevelAfter;
};
class nsTypedSelection;
namespace mozilla {
class Selection;
}
class nsIScrollableFrame;
/**
@ -351,7 +353,7 @@ public:
* no query interface for selection. must use this method now.
* @param aSelectionType enum value defined in nsISelection for the seleciton you want.
*/
nsTypedSelection* GetSelection(SelectionType aType) const;
mozilla::Selection* GetSelection(SelectionType aType) const;
/**
* ScrollSelectionIntoView scrolls a region of the selection,
@ -618,7 +620,7 @@ private:
return retval;
}
friend class nsTypedSelection;
friend class mozilla::Selection;
#ifdef DEBUG
void printSelection(); // for debugging
#endif /* DEBUG */
@ -645,7 +647,7 @@ private:
// so remember to use nsCOMPtr when needed.
nsresult NotifySelectionListeners(SelectionType aType); // add parameters to say collapsed etc?
nsRefPtr<nsTypedSelection> mDomSelections[nsISelectionController::NUM_SELECTIONTYPES];
nsRefPtr<mozilla::Selection> mDomSelections[nsISelectionController::NUM_SELECTIONTYPES];
// Table selection support.
// Interfaces that let us get info based on cellmap locations

File diff suppressed because it is too large Load Diff

View File

@ -54,6 +54,7 @@
#include "nsObjectFrame.h"
#include "nsIServiceManager.h"
#include "nsContentUtils.h"
#include "nsIHTMLDocument.h"
#ifdef MOZ_XUL
#include "nsXULPopupManager.h"
@ -344,6 +345,27 @@ nsSubDocumentFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
}
}
if (subdocRootFrame && !aBuilder->IsForEventDelivery()) {
bool framesetUsingDisplayPort = false;
nsIDocument* doc = presContext->Document();
if (doc) {
nsCOMPtr<nsIHTMLDocument> htmlDoc = do_QueryInterface(doc);
if (htmlDoc && htmlDoc->GetIsFrameset()) {
nsIContent* root = doc->GetRootElement();
if (root) {
framesetUsingDisplayPort = nsLayoutUtils::GetDisplayPort(root, nsnull);
}
}
}
// Frameset document's don't have a scroll frame but we still need to
// communicate the basic metrics of the document.
if (framesetUsingDisplayPort) {
nsDisplaySimpleScrollLayer* item =
new (aBuilder) nsDisplaySimpleScrollLayer(aBuilder, subdocRootFrame, &childItems);
childItems.AppendToTop(item);
}
}
bool addedLayer = false;
if (subdocRootFrame && parentAPD != subdocAPD) {

View File

@ -116,7 +116,7 @@ public:
* This is called only on the primary text frame. It indicates that
* the selection state of the given character range has changed.
* Text in the range is unconditionally invalidated
* (nsTypedSelection::Repaint depends on this).
* (Selection::Repaint depends on this).
* @param aSelected true if the selection has been added to the range,
* false otherwise
* @param aType the type of selection added or removed

View File

@ -20,7 +20,7 @@
// 2) #include IPDL boilerplate, and then undef LOG so our LOG wins.
// 3) nsNetModule.cpp does its own crazy stuff with #including prlog.h
// multiple times; allow it to define ALLOW_LATE_NSHTTP_H_INCLUDE to bypass
// check.
// check.
#if defined(PR_LOG) && !defined(ALLOW_LATE_NSHTTP_H_INCLUDE)
#error "If nsHttp.h #included it must come before any IPDL-generated files or other files that #include prlog.h"
#endif
@ -181,7 +181,7 @@ struct nsHttp
}
// Declare all atoms
//
//
// The atom names and values are stored in nsHttpAtomList.h and are brought
// to you by the magic of C preprocessing. Add new atoms to nsHttpAtomList
// and all support logic will be auto-generated.
@ -204,7 +204,7 @@ PRTimeToSeconds(PRTime t_usec)
#define NowInSeconds() PRTimeToSeconds(PR_Now())
// round q-value to one decimal place; return most significant digit as uint.
#define QVAL_TO_UINT(q) ((unsigned int) ((q + 0.05) * 10.0))
#define QVAL_TO_UINT(q) ((unsigned int) ((q + 0.0005) * 1000.0))
#define HTTP_LWS " \t"
#define HTTP_HEADER_VALUE_SEPS HTTP_LWS ","

View File

@ -234,7 +234,7 @@ nsHttpHandler::Init()
if (prefBranch) {
prefBranch->AddObserver(HTTP_PREF_PREFIX, this, true);
prefBranch->AddObserver(UA_PREF_PREFIX, this, true);
prefBranch->AddObserver(INTL_ACCEPT_LANGUAGES, this, true);
prefBranch->AddObserver(INTL_ACCEPT_LANGUAGES, this, true);
prefBranch->AddObserver(NETWORK_ENABLEIDN, this, true);
prefBranch->AddObserver(BROWSER_PREF("disk_cache_ssl"), this, true);
prefBranch->AddObserver(DONOTTRACK_HEADER_ENABLED, this, true);
@ -290,8 +290,8 @@ nsHttpHandler::Init()
// Bring alive the objects in the http-protocol-startup category
NS_CreateServicesFromCategory(NS_HTTP_STARTUP_CATEGORY,
static_cast<nsISupports*>(static_cast<void*>(this)),
NS_HTTP_STARTUP_TOPIC);
NS_HTTP_STARTUP_TOPIC);
mObserverService = mozilla::services::GetObserverService();
if (mObserverService) {
mObserverService->AddObserver(this, "profile-change-net-teardown", true);
@ -301,7 +301,7 @@ nsHttpHandler::Init()
mObserverService->AddObserver(this, "net:prune-dead-connections", true);
mObserverService->AddObserver(this, "net:failed-to-process-uri-content", true);
}
return NS_OK;
}
@ -363,10 +363,10 @@ nsHttpHandler::AddStandardRequestHeaders(nsHttpHeaderArray *request,
// transparent proxies) can result.
//
// However, we need to send something so that we can use keepalive
// with HTTP/1.0 servers/proxies. We use "Proxy-Connection:" when
// with HTTP/1.0 servers/proxies. We use "Proxy-Connection:" when
// we're talking to an http proxy, and "Connection:" otherwise.
// We no longer send the Keep-Alive request header.
NS_NAMED_LITERAL_CSTRING(close, "close");
NS_NAMED_LITERAL_CSTRING(keepAlive, "keep-alive");
@ -402,7 +402,7 @@ nsHttpHandler::IsAcceptableEncoding(const char *enc)
// to accept.
if (!PL_strncasecmp(enc, "x-", 2))
enc += 2;
return nsHttp::FindToken(mAcceptEncodings.get(), enc, HTTP_LWS ",") != nsnull;
}
@ -435,7 +435,7 @@ nsHttpHandler::GetCookieService()
return mCookieService;
}
nsresult
nsresult
nsHttpHandler::GetIOService(nsIIOService** result)
{
NS_ADDREF(*result = mIOService);
@ -452,7 +452,7 @@ nsHttpHandler::Get32BitsOfPseudoRandom()
// 15 or 31 bits are common amounts.
PR_STATIC_ASSERT(RAND_MAX >= 0xfff);
#if RAND_MAX < 0xffffU
return ((PRUint16) rand() << 20) |
(((PRUint16) rand() & 0xfff) << 8) |
@ -523,10 +523,10 @@ nsHttpHandler::BuildUserAgent()
// preallocate to worst-case size, which should always be better
// than if we didn't preallocate at all.
mUserAgent.SetCapacity(mLegacyAppName.Length() +
mLegacyAppVersion.Length() +
mUserAgent.SetCapacity(mLegacyAppName.Length() +
mLegacyAppVersion.Length() +
#ifndef UA_SPARE_PLATFORM
mPlatform.Length() +
mPlatform.Length() +
#endif
mOscpu.Length() +
mMisc.Length() +
@ -672,7 +672,7 @@ nsHttpHandler::InitUserAgentComponents()
}
#elif defined (XP_UNIX)
struct utsname name;
int ret = uname(&name);
if (ret >= 0) {
nsCAutoString buf;
@ -1015,7 +1015,7 @@ nsHttpHandler::PrefsChanged(nsIPrefBranch *prefs, const char *pref)
if (NS_SUCCEEDED(rv))
SetAccept(accept);
}
if (PREF_CHANGED(HTTP_PREF("accept-encoding"))) {
nsXPIDLCString acceptEncodings;
rv = prefs->GetCharPref(HTTP_PREF("accept-encoding"),
@ -1068,7 +1068,7 @@ nsHttpHandler::PrefsChanged(nsIPrefBranch *prefs, const char *pref)
mEnforceAssocReq = cVar;
}
// enable Persistent caching for HTTPS - bug#205921
// enable Persistent caching for HTTPS - bug#205921
if (PREF_CHANGED(BROWSER_PREF("disk_cache_ssl"))) {
cVar = false;
rv = prefs->GetBoolPref(BROWSER_PREF("disk_cache_ssl"), &cVar);
@ -1157,7 +1157,7 @@ nsHttpHandler::PrefsChanged(nsIPrefBranch *prefs, const char *pref)
pls->ToString(getter_Copies(uval));
if (uval)
SetAcceptLanguages(NS_ConvertUTF16toUTF8(uval).get());
}
}
}
//
@ -1275,8 +1275,8 @@ PrepareAcceptLanguages(const char *i_AcceptLanguages, nsACString &o_AcceptLangua
if (*token != '\0') {
comma = n++ != 0 ? "," : ""; // delimiter if not first item
PRUint32 u = QVAL_TO_UINT(q);
if (u < 10)
wrote = PR_snprintf(p2, available, "%s%s;q=0.%u", comma, token, u);
if (u < 1000)
wrote = PR_snprintf(p2, available, "%s%s;q=0.%03u", comma, token, u);
else
wrote = PR_snprintf(p2, available, "%s%s", comma, token);
q -= dec;
@ -1294,7 +1294,7 @@ PrepareAcceptLanguages(const char *i_AcceptLanguages, nsACString &o_AcceptLangua
}
nsresult
nsHttpHandler::SetAcceptLanguages(const char *aAcceptLanguages)
nsHttpHandler::SetAcceptLanguages(const char *aAcceptLanguages)
{
nsCAutoString buf;
nsresult rv = PrepareAcceptLanguages(aAcceptLanguages, buf);
@ -1304,14 +1304,14 @@ nsHttpHandler::SetAcceptLanguages(const char *aAcceptLanguages)
}
nsresult
nsHttpHandler::SetAccept(const char *aAccept)
nsHttpHandler::SetAccept(const char *aAccept)
{
mAccept = aAccept;
return NS_OK;
}
nsresult
nsHttpHandler::SetAcceptEncodings(const char *aAcceptEncodings)
nsHttpHandler::SetAcceptEncodings(const char *aAcceptEncodings)
{
mAcceptEncodings = aAcceptEncodings;
return NS_OK;
@ -1385,14 +1385,14 @@ nsHttpHandler::NewChannel(nsIURI *uri, nsIChannel **result)
return NS_ERROR_UNEXPECTED;
}
}
return NewProxiedChannel(uri, nsnull, result);
}
NS_IMETHODIMP
NS_IMETHODIMP
nsHttpHandler::AllowPort(PRInt32 port, const char *scheme, bool *_retval)
{
// don't override anything.
// don't override anything.
*_retval = false;
return NS_OK;
}
@ -1410,7 +1410,7 @@ nsHttpHandler::NewProxiedChannel(nsIURI *uri,
LOG(("nsHttpHandler::NewProxiedChannel [proxyInfo=%p]\n",
givenProxyInfo));
nsCOMPtr<nsProxyInfo> proxyInfo;
if (givenProxyInfo) {
proxyInfo = do_QueryInterface(givenProxyInfo);
@ -1562,7 +1562,7 @@ nsHttpHandler::Observe(nsISupports *subject,
if (uri && mConnMgr)
mConnMgr->ReportFailedToProcess(uri);
}
return NS_OK;
}
@ -1577,7 +1577,7 @@ nsHttpHandler::SpeculativeConnect(nsIURI *aURI,
bool isStsHost = false;
if (!stss)
return NS_OK;
nsCOMPtr<nsIURI> clone;
if (NS_SUCCEEDED(stss->IsStsURI(aURI, &isStsHost)) && isStsHost) {
if (NS_SUCCEEDED(aURI->Clone(getter_AddRefs(clone)))) {
@ -1687,7 +1687,7 @@ nsHttpsHandler::NewChannel(nsIURI *aURI, nsIChannel **_retval)
NS_IMETHODIMP
nsHttpsHandler::AllowPort(PRInt32 aPort, const char *aScheme, bool *_retval)
{
// don't override anything.
// don't override anything.
*_retval = false;
return NS_OK;
}

View File

@ -0,0 +1,44 @@
//
// HTTP Accept-Language header test
//
const Cc = Components.classes;
const Ci = Components.interfaces;
var testpath = "/bug672448";
function run_test() {
test_accepted_languages();
}
function test_accepted_languages() {
let channel = setupChannel(testpath);
let AcceptLanguage = channel.getRequestHeader("Accept-Language");
let acceptedLanguages = AcceptLanguage.split(",");
for( let i = 0; i < acceptedLanguages.length; i++ ) {
let acceptedLanguage, qualityValue;
try {
[_, acceptedLanguage, qualityValue] = acceptedLanguages[i].trim().match(/^([a-z0-9_-]*?)(?:;q=([0-9.]+))?$/i);
} catch(e) {
do_print("Invalid language tag or quality value: " + e);
}
if( i == 0 ) {
do_check_eq(qualityValue, undefined); // First language shouldn't have a quality value.
} else {
do_check_eq(qualityValue.length, 5); // All other languages should have quality value of the format '0.123'.
}
}
}
function setupChannel(path) {
let ios = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService);
let chan = ios.newChannel("http://localhost:4444" + path, "", null);
chan.QueryInterface(Ci.nsIHttpChannel);
chan.requestMethod = "GET";
return chan;
}

View File

@ -1,6 +1,6 @@
[DEFAULT]
head = head_channels.js
tail =
tail =
[test_307_redirect.js]
[test_NetUtil.js]
@ -40,7 +40,7 @@ skip-if = os == "android"
[test_bug455311.js]
[test_bug455598.js]
[test_bug468426.js]
# Bug 675039: test hangs consistently on Android
# Bug 675039: test hangs consistently on Android
skip-if = os == "android"
[test_bug468594.js]
[test_bug470716.js]
@ -51,7 +51,7 @@ skip-if = os == "android"
[test_bug490095.js]
[test_bug504014.js]
[test_bug510359.js]
# Bug 675039: test hangs consistently on Android
# Bug 675039: test hangs consistently on Android
skip-if = os == "android"
[test_bug515583.js]
[test_bug528292.js]
@ -69,16 +69,16 @@ skip-if = os == "android"
[test_bug652761.js]
[test_bug651100.js]
# Bug 675044: test fails consistently on Android
fail-if = os == "android"
fail-if = os == "android"
[test_bug654926.js]
# Bug 675049: test fails consistently on Android
fail-if = os == "android"
fail-if = os == "android"
[test_bug654926_doom_and_read.js]
# Bug 675049: test fails consistently on Android
fail-if = os == "android"
fail-if = os == "android"
[test_bug654926_test_seek.js]
# Bug 675049: test fails consistently on Android
fail-if = os == "android"
fail-if = os == "android"
[test_bug659569.js]
[test_bug660066.js]
[test_bug667907.js]
@ -99,28 +99,28 @@ fail-if = os == "android"
[test_event_sink.js]
[test_extract_charset_from_content_type.js]
[test_fallback_no-cache-entry_canceled.js]
# Bug 675039: test hangs consistently on Android
# Bug 675039: test hangs consistently on Android
skip-if = os == "android"
[test_fallback_no-cache-entry_passing.js]
# Bug 675039: test hangs consistently on Android
# Bug 675039: test hangs consistently on Android
skip-if = os == "android"
[test_fallback_redirect-to-different-origin_canceled.js]
# Bug 675039: test hangs consistently on Android
# Bug 675039: test hangs consistently on Android
skip-if = os == "android"
[test_fallback_redirect-to-different-origin_passing.js]
# Bug 675039: test hangs consistently on Android
# Bug 675039: test hangs consistently on Android
skip-if = os == "android"
[test_fallback_request-error_canceled.js]
# Bug 675039: test hangs consistently on Android
# Bug 675039: test hangs consistently on Android
skip-if = os == "android"
[test_fallback_request-error_passing.js]
# Bug 675039: test hangs consistently on Android
# Bug 675039: test hangs consistently on Android
skip-if = os == "android"
[test_fallback_response-error_canceled.js]
# Bug 675039: test hangs consistently on Android
# Bug 675039: test hangs consistently on Android
skip-if = os == "android"
[test_fallback_response-error_passing.js]
# Bug 675039: test hangs consistently on Android
# Bug 675039: test hangs consistently on Android
skip-if = os == "android"
[test_file_partial_inputstream.js]
[test_file_protocol.js]
@ -128,6 +128,7 @@ skip-if = os == "android"
[test_gre_resources.js]
[test_gzipped_206.js]
[test_head.js]
[test_header_Accept-Language.js]
[test_headers.js]
[test_http_headers.js]
[test_httpcancel.js]

View File

@ -1877,7 +1877,7 @@ nsWindow::GetNonClientMargins(nsIntMargin &margins)
margins.top = GetSystemMetrics(SM_CYCAPTION);
margins.bottom = GetSystemMetrics(SM_CYFRAME);
margins.top += margins.bottom;
margins.left = margins.right = GetSystemMetrics(SM_CYFRAME);
margins.left = margins.right = GetSystemMetrics(SM_CXFRAME);
return NS_OK;
}

View File

@ -535,6 +535,12 @@ public:
#define NS_IMPL_CYCLE_COLLECTION_TRACE_JS_MEMBER_CALLBACK(_field) \
NS_IMPL_CYCLE_COLLECTION_TRACE_JS_CALLBACK(tmp->_field, #_field)
#define NS_IMPL_CYCLE_COLLECTION_TRACE_JSVAL_MEMBER_CALLBACK(_field) \
if (JSVAL_IS_TRACEABLE(tmp->_field)) { \
void *gcThing = JSVAL_TO_TRACEABLE(tmp->_field); \
aCallback(gcThing, #_field, aClosure); \
}
// NB: The (void)tmp; hack in the TRACE_END macro exists to support
// implementations that don't need to do anything in their Trace method.
// Without this hack, some compilers warn about the unused tmp local.