2007-03-22 10:30:00 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 04:12:37 -07:00
|
|
|
/* 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/. */
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
/*
|
|
|
|
* a list of the recomputation that needs to be done in response to a
|
|
|
|
* style change
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef nsStyleChangeList_h___
|
|
|
|
#define nsStyleChangeList_h___
|
|
|
|
|
2011-12-16 11:42:07 -08:00
|
|
|
#include "mozilla/Attributes.h"
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
#include "nsError.h"
|
|
|
|
#include "nsChangeHint.h"
|
|
|
|
|
|
|
|
class nsIFrame;
|
|
|
|
class nsIContent;
|
|
|
|
|
|
|
|
// XXX would all platforms support putting this inside the list?
|
|
|
|
struct nsStyleChangeData {
|
|
|
|
nsIFrame* mFrame;
|
|
|
|
nsIContent* mContent;
|
|
|
|
nsChangeHint mHint;
|
|
|
|
};
|
|
|
|
|
2012-08-22 08:56:38 -07:00
|
|
|
static const uint32_t kStyleChangeBufferSize = 10;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2008-03-15 02:01:18 -07:00
|
|
|
// Note: nsStyleChangeList owns a reference to
|
|
|
|
// nsIContent pointers in its list.
|
2007-03-22 10:30:00 -07:00
|
|
|
class nsStyleChangeList {
|
|
|
|
public:
|
2008-03-15 02:01:18 -07:00
|
|
|
nsStyleChangeList();
|
|
|
|
~nsStyleChangeList();
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2012-08-22 08:56:38 -07:00
|
|
|
int32_t Count(void) const {
|
2007-03-22 10:30:00 -07:00
|
|
|
return mCount;
|
|
|
|
}
|
|
|
|
|
2008-03-15 02:01:18 -07:00
|
|
|
/**
|
|
|
|
* Fills in pointers without reference counting.
|
|
|
|
*/
|
2012-08-22 08:56:38 -07:00
|
|
|
nsresult ChangeAt(int32_t aIndex, nsIFrame*& aFrame, nsIContent*& aContent,
|
2007-03-22 10:30:00 -07:00
|
|
|
nsChangeHint& aHint) const;
|
|
|
|
|
2008-03-15 02:01:18 -07:00
|
|
|
/**
|
|
|
|
* Fills in a pointer to the list entry storage (no reference counting
|
|
|
|
* involved).
|
|
|
|
*/
|
2012-08-22 08:56:38 -07:00
|
|
|
nsresult ChangeAt(int32_t aIndex, const nsStyleChangeData** aChangeData) const;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
nsresult AppendChange(nsIFrame* aFrame, nsIContent* aContent, nsChangeHint aHint);
|
|
|
|
|
|
|
|
void Clear(void);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
nsStyleChangeList& operator=(const nsStyleChangeList& aCopy);
|
2011-09-28 23:19:26 -07:00
|
|
|
bool operator==(const nsStyleChangeList& aOther) const;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
nsStyleChangeData* mArray;
|
2012-08-22 08:56:38 -07:00
|
|
|
int32_t mArraySize;
|
|
|
|
int32_t mCount;
|
2007-03-22 10:30:00 -07:00
|
|
|
nsStyleChangeData mBuffer[kStyleChangeBufferSize];
|
2008-03-15 02:01:18 -07:00
|
|
|
|
|
|
|
private:
|
2015-01-06 15:35:02 -08:00
|
|
|
nsStyleChangeList(const nsStyleChangeList&) = delete;
|
2007-03-22 10:30:00 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* nsStyleChangeList_h___ */
|