2017-10-27 20:33:53 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2012-05-21 15:12:37 +04: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/. */
|
2006-03-29 22:29:03 +04:00
|
|
|
|
|
|
|
/* representation of one line within a block frame, a CSS line box */
|
|
|
|
|
1998-12-01 19:13:49 +03:00
|
|
|
#include "nsLineBox.h"
|
2015-03-26 10:29:31 +03:00
|
|
|
|
2015-09-17 05:08:19 +03:00
|
|
|
#include "mozilla/ArenaObjectID.h"
|
2013-03-29 03:27:31 +04:00
|
|
|
#include "mozilla/Assertions.h"
|
2012-10-26 17:32:10 +04:00
|
|
|
#include "mozilla/Likely.h"
|
2015-03-26 10:29:31 +03:00
|
|
|
#include "mozilla/WritingModes.h"
|
|
|
|
#include "nsBidiPresUtils.h"
|
|
|
|
#include "nsFrame.h"
|
|
|
|
#include "nsIFrameInlines.h"
|
|
|
|
#include "nsPresArena.h"
|
2014-01-27 02:07:02 +04:00
|
|
|
#include "nsPrintfCString.h"
|
2016-08-15 09:43:21 +03:00
|
|
|
#include "mozilla/Sprintf.h"
|
1998-12-01 19:13:49 +03:00
|
|
|
|
1999-10-20 03:04:19 +04:00
|
|
|
#ifdef DEBUG
|
2012-08-22 19:56:38 +04:00
|
|
|
static int32_t ctorCount;
|
|
|
|
int32_t nsLineBox::GetCtorCount() { return ctorCount; }
|
1999-10-20 03:04:19 +04:00
|
|
|
#endif
|
|
|
|
|
2012-03-11 06:32:27 +04:00
|
|
|
#ifndef _MSC_VER
|
|
|
|
// static nsLineBox constant; initialized in the header file.
|
2012-08-22 19:56:38 +04:00
|
|
|
const uint32_t nsLineBox::kMinChildCountForHashtable;
|
2012-03-11 06:32:27 +04:00
|
|
|
#endif
|
|
|
|
|
2014-04-16 12:03:28 +04:00
|
|
|
using namespace mozilla;
|
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
nsLineBox::nsLineBox(nsIFrame* aFrame, int32_t aCount, bool aIsBlock)
|
2012-05-04 04:14:02 +04:00
|
|
|
: mFirstChild(aFrame)
|
2016-12-01 11:06:50 +03:00
|
|
|
, mWritingMode()
|
2015-07-16 12:07:57 +03:00
|
|
|
, mContainerSize(-1, -1)
|
2014-04-16 12:03:28 +04:00
|
|
|
, mBounds(WritingMode()) // mBounds will be initialized with the correct
|
|
|
|
// writing mode when it is set
|
2016-12-01 11:06:50 +03:00
|
|
|
, mFrames()
|
|
|
|
, mAscent()
|
|
|
|
, mAllFlags(0)
|
|
|
|
, mData(nullptr)
|
1998-12-01 19:13:49 +03:00
|
|
|
{
|
2016-12-01 11:06:50 +03:00
|
|
|
// Assert that the union elements chosen for initialisation are at
|
|
|
|
// least as large as all other elements in their respective unions, so
|
|
|
|
// as to ensure that no parts are missed.
|
|
|
|
static_assert(sizeof(mFrames) >= sizeof(mChildCount), "nsLineBox init #1");
|
|
|
|
static_assert(sizeof(mAllFlags) >= sizeof(mFlags), "nsLineBox init #2");
|
|
|
|
static_assert(sizeof(mData) >= sizeof(mBlockData), "nsLineBox init #3");
|
|
|
|
static_assert(sizeof(mData) >= sizeof(mInlineData), "nsLineBox init #4");
|
|
|
|
|
1999-10-09 00:41:19 +04:00
|
|
|
MOZ_COUNT_CTOR(nsLineBox);
|
1999-10-20 03:04:19 +04:00
|
|
|
#ifdef DEBUG
|
|
|
|
++ctorCount;
|
2005-03-23 06:35:08 +03:00
|
|
|
NS_ASSERTION(!aIsBlock || aCount == 1, "Blocks must have exactly one child");
|
|
|
|
nsIFrame* f = aFrame;
|
2012-08-22 19:56:38 +04:00
|
|
|
for (int32_t n = aCount; n > 0; f = f->GetNextSibling(), --n) {
|
2012-08-02 15:38:51 +04:00
|
|
|
NS_ASSERTION(aIsBlock == f->IsBlockOutside(),
|
2005-03-23 06:35:08 +03:00
|
|
|
"wrong kind of child frame");
|
|
|
|
}
|
1999-10-20 03:04:19 +04:00
|
|
|
#endif
|
2016-09-07 05:20:17 +03:00
|
|
|
static_assert(static_cast<int>(StyleClear::Max) <= 15,
|
2013-07-18 21:59:53 +04:00
|
|
|
"FlagBits needs more bits to store the full range of "
|
|
|
|
"break type ('clear') values");
|
2012-03-11 06:32:27 +04:00
|
|
|
mChildCount = aCount;
|
1999-10-15 03:10:03 +04:00
|
|
|
MarkDirty();
|
|
|
|
mFlags.mBlock = aIsBlock;
|
1998-12-01 19:13:49 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
nsLineBox::~nsLineBox()
|
|
|
|
{
|
1999-10-09 00:41:19 +04:00
|
|
|
MOZ_COUNT_DTOR(nsLineBox);
|
2012-10-26 17:32:10 +04:00
|
|
|
if (MOZ_UNLIKELY(mFlags.mHasHashedFrames)) {
|
2012-03-11 06:32:27 +04:00
|
|
|
delete mFrames;
|
2017-07-06 15:00:35 +03:00
|
|
|
}
|
1999-10-20 03:04:19 +04:00
|
|
|
Cleanup();
|
|
|
|
}
|
1999-10-15 03:10:03 +04:00
|
|
|
|
2000-03-12 06:00:51 +03:00
|
|
|
nsLineBox*
|
2012-03-11 06:32:27 +04:00
|
|
|
NS_NewLineBox(nsIPresShell* aPresShell, nsIFrame* aFrame, bool aIsBlock)
|
|
|
|
{
|
|
|
|
return new (aPresShell) nsLineBox(aFrame, 1, aIsBlock);
|
|
|
|
}
|
|
|
|
|
|
|
|
nsLineBox*
|
|
|
|
NS_NewLineBox(nsIPresShell* aPresShell, nsLineBox* aFromLine,
|
2012-08-22 19:56:38 +04:00
|
|
|
nsIFrame* aFrame, int32_t aCount)
|
2012-03-11 06:32:27 +04:00
|
|
|
{
|
|
|
|
nsLineBox* newLine = new (aPresShell) nsLineBox(aFrame, aCount, false);
|
2012-11-07 23:55:53 +04:00
|
|
|
newLine->NoteFramesMovedFrom(aFromLine);
|
2015-07-16 12:07:57 +03:00
|
|
|
newLine->mContainerSize = aFromLine->mContainerSize;
|
2012-03-11 06:32:27 +04:00
|
|
|
return newLine;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2012-08-22 19:56:38 +04:00
|
|
|
nsLineBox::StealHashTableFrom(nsLineBox* aFromLine, uint32_t aFromLineNewCount)
|
2012-03-11 06:32:27 +04:00
|
|
|
{
|
|
|
|
MOZ_ASSERT(!mFlags.mHasHashedFrames);
|
2012-08-22 19:56:38 +04:00
|
|
|
MOZ_ASSERT(GetChildCount() >= int32_t(aFromLineNewCount));
|
2012-03-11 06:32:27 +04:00
|
|
|
mFrames = aFromLine->mFrames;
|
|
|
|
mFlags.mHasHashedFrames = 1;
|
|
|
|
aFromLine->mFlags.mHasHashedFrames = 0;
|
|
|
|
aFromLine->mChildCount = aFromLineNewCount;
|
|
|
|
// remove aFromLine's frames that aren't on this line
|
|
|
|
nsIFrame* f = aFromLine->mFirstChild;
|
2012-08-22 19:56:38 +04:00
|
|
|
for (uint32_t i = 0; i < aFromLineNewCount; f = f->GetNextSibling(), ++i) {
|
2012-03-11 06:32:27 +04:00
|
|
|
mFrames->RemoveEntry(f);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
nsLineBox::NoteFramesMovedFrom(nsLineBox* aFromLine)
|
2000-03-12 06:00:51 +03:00
|
|
|
{
|
2012-08-22 19:56:38 +04:00
|
|
|
uint32_t fromCount = aFromLine->GetChildCount();
|
|
|
|
uint32_t toCount = GetChildCount();
|
2012-03-11 06:32:27 +04:00
|
|
|
MOZ_ASSERT(toCount <= fromCount, "moved more frames than aFromLine has");
|
2012-08-22 19:56:38 +04:00
|
|
|
uint32_t fromNewCount = fromCount - toCount;
|
2012-10-26 17:32:10 +04:00
|
|
|
if (MOZ_LIKELY(!aFromLine->mFlags.mHasHashedFrames)) {
|
2012-03-11 06:32:27 +04:00
|
|
|
aFromLine->mChildCount = fromNewCount;
|
|
|
|
MOZ_ASSERT(toCount < kMinChildCountForHashtable);
|
|
|
|
} else if (fromNewCount < kMinChildCountForHashtable) {
|
|
|
|
// aFromLine has a hash table but will not have it after moving the frames
|
|
|
|
// so this line can steal the hash table if it needs it.
|
|
|
|
if (toCount >= kMinChildCountForHashtable) {
|
|
|
|
StealHashTableFrom(aFromLine, fromNewCount);
|
|
|
|
} else {
|
|
|
|
delete aFromLine->mFrames;
|
|
|
|
aFromLine->mFlags.mHasHashedFrames = 0;
|
|
|
|
aFromLine->mChildCount = fromNewCount;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
// aFromLine still needs a hash table.
|
|
|
|
if (toCount < kMinChildCountForHashtable) {
|
|
|
|
// remove the moved frames from it
|
|
|
|
nsIFrame* f = mFirstChild;
|
2012-08-22 19:56:38 +04:00
|
|
|
for (uint32_t i = 0; i < toCount; f = f->GetNextSibling(), ++i) {
|
2012-03-11 06:32:27 +04:00
|
|
|
aFromLine->mFrames->RemoveEntry(f);
|
|
|
|
}
|
|
|
|
} else if (toCount <= fromNewCount) {
|
|
|
|
// This line needs a hash table, allocate a hash table for it since that
|
|
|
|
// means fewer hash ops.
|
|
|
|
nsIFrame* f = mFirstChild;
|
2012-08-22 19:56:38 +04:00
|
|
|
for (uint32_t i = 0; i < toCount; f = f->GetNextSibling(), ++i) {
|
2012-03-11 06:32:27 +04:00
|
|
|
aFromLine->mFrames->RemoveEntry(f); // toCount RemoveEntry
|
|
|
|
}
|
|
|
|
SwitchToHashtable(); // toCount PutEntry
|
|
|
|
} else {
|
|
|
|
// This line needs a hash table, but it's fewer hash ops to steal
|
|
|
|
// aFromLine's hash table and allocate a new hash table for that line.
|
|
|
|
StealHashTableFrom(aFromLine, fromNewCount); // fromNewCount RemoveEntry
|
|
|
|
aFromLine->SwitchToHashtable(); // fromNewCount PutEntry
|
|
|
|
}
|
|
|
|
}
|
2000-03-12 06:00:51 +03:00
|
|
|
}
|
|
|
|
|
2009-08-18 07:21:06 +04:00
|
|
|
void*
|
2016-08-17 22:28:45 +03:00
|
|
|
nsLineBox::operator new(size_t sz, nsIPresShell* aPresShell)
|
2000-03-12 06:00:51 +03:00
|
|
|
{
|
2015-09-17 05:08:19 +03:00
|
|
|
return aPresShell->AllocateByObjectID(eArenaObjectID_nsLineBox, sz);
|
2000-03-12 06:00:51 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
nsLineBox::Destroy(nsIPresShell* aPresShell)
|
|
|
|
{
|
2012-03-11 06:32:27 +04:00
|
|
|
this->nsLineBox::~nsLineBox();
|
2015-09-17 05:08:19 +03:00
|
|
|
aPresShell->FreeByObjectID(eArenaObjectID_nsLineBox, this);
|
2000-03-12 06:00:51 +03:00
|
|
|
}
|
|
|
|
|
1999-10-20 03:04:19 +04:00
|
|
|
void
|
|
|
|
nsLineBox::Cleanup()
|
|
|
|
{
|
1999-10-29 18:35:36 +04:00
|
|
|
if (mData) {
|
|
|
|
if (IsBlock()) {
|
1999-10-15 03:10:03 +04:00
|
|
|
delete mBlockData;
|
|
|
|
}
|
1999-10-29 18:35:36 +04:00
|
|
|
else {
|
1999-10-15 03:10:03 +04:00
|
|
|
delete mInlineData;
|
|
|
|
}
|
2012-07-30 18:20:58 +04:00
|
|
|
mData = nullptr;
|
1999-10-15 03:10:03 +04:00
|
|
|
}
|
1999-10-20 03:04:19 +04:00
|
|
|
}
|
|
|
|
|
2014-01-06 03:31:14 +04:00
|
|
|
#ifdef DEBUG_FRAME_DUMP
|
1998-12-01 19:13:49 +03:00
|
|
|
static void
|
2014-01-27 02:07:02 +04:00
|
|
|
ListFloats(FILE* out, const char* aPrefix, const nsFloatCacheList& aFloats)
|
1998-12-01 19:13:49 +03:00
|
|
|
{
|
2003-10-14 01:51:02 +04:00
|
|
|
nsFloatCache* fc = aFloats.Head();
|
1999-09-15 04:28:10 +04:00
|
|
|
while (fc) {
|
2014-01-27 02:07:02 +04:00
|
|
|
nsCString str(aPrefix);
|
2009-08-31 22:25:35 +04:00
|
|
|
nsIFrame* frame = fc->mFloat;
|
2014-01-27 02:07:02 +04:00
|
|
|
str += nsPrintfCString("floatframe@%p ", static_cast<void*>(frame));
|
2009-08-31 22:25:35 +04:00
|
|
|
if (frame) {
|
|
|
|
nsAutoString frameName;
|
|
|
|
frame->GetFrameName(frameName);
|
2014-01-27 02:07:02 +04:00
|
|
|
str += NS_ConvertUTF16toUTF8(frameName).get();
|
2009-08-31 22:25:35 +04:00
|
|
|
}
|
|
|
|
else {
|
2014-01-27 02:07:02 +04:00
|
|
|
str += "\n###!!! NULL out-of-flow frame";
|
1998-12-01 19:13:49 +03:00
|
|
|
}
|
2014-01-27 02:07:02 +04:00
|
|
|
fprintf_stderr(out, "%s\n", str.get());
|
1999-09-15 04:28:10 +04:00
|
|
|
fc = fc->Next();
|
1998-12-01 19:13:49 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-09-07 05:20:16 +03:00
|
|
|
const char*
|
2016-09-07 05:20:17 +03:00
|
|
|
nsLineBox::BreakTypeToString(StyleClear aBreakType) const
|
2002-01-09 06:04:29 +03:00
|
|
|
{
|
|
|
|
switch (aBreakType) {
|
2016-09-03 21:46:58 +03:00
|
|
|
case StyleClear::None: return "nobr";
|
2016-09-07 05:20:17 +03:00
|
|
|
case StyleClear::Left: return "leftbr";
|
|
|
|
case StyleClear::Right: return "rightbr";
|
|
|
|
case StyleClear::InlineStart: return "inlinestartbr";
|
|
|
|
case StyleClear::InlineEnd: return "inlineendbr";
|
|
|
|
case StyleClear::Both: return "leftbr+rightbr";
|
|
|
|
case StyleClear::Line: return "linebr";
|
2016-10-06 10:22:22 +03:00
|
|
|
case StyleClear::Max: return "leftbr+rightbr+linebr";
|
2002-01-09 06:04:29 +03:00
|
|
|
}
|
|
|
|
return "unknown";
|
|
|
|
}
|
|
|
|
|
1998-12-01 19:13:49 +03:00
|
|
|
char*
|
2012-08-22 19:56:38 +04:00
|
|
|
nsLineBox::StateToString(char* aBuf, int32_t aBufSize) const
|
1998-12-01 19:13:49 +03:00
|
|
|
{
|
2015-12-01 23:50:47 +03:00
|
|
|
snprintf(aBuf, aBufSize, "%s,%s,%s,%s,%s,before:%s,after:%s[0x%x]",
|
|
|
|
IsBlock() ? "block" : "inline",
|
|
|
|
IsDirty() ? "dirty" : "clean",
|
|
|
|
IsPreviousMarginDirty() ? "prevmargindirty" : "prevmarginclean",
|
|
|
|
IsImpactedByFloat() ? "impacted" : "not impacted",
|
|
|
|
IsLineWrapped() ? "wrapped" : "not wrapped",
|
|
|
|
BreakTypeToString(GetBreakTypeBefore()),
|
|
|
|
BreakTypeToString(GetBreakTypeAfter()),
|
|
|
|
mAllFlags);
|
1998-12-01 19:13:49 +03:00
|
|
|
return aBuf;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2012-09-19 18:36:35 +04:00
|
|
|
nsLineBox::List(FILE* out, int32_t aIndent, uint32_t aFlags) const
|
1998-12-01 19:13:49 +03:00
|
|
|
{
|
2014-01-27 02:07:02 +04:00
|
|
|
nsCString str;
|
|
|
|
while (aIndent-- > 0) {
|
|
|
|
str += " ";
|
|
|
|
}
|
|
|
|
List(out, str.get(), aFlags);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
nsLineBox::List(FILE* out, const char* aPrefix, uint32_t aFlags) const
|
|
|
|
{
|
|
|
|
nsCString str(aPrefix);
|
1999-01-16 03:00:50 +03:00
|
|
|
char cbuf[100];
|
2014-01-27 02:07:02 +04:00
|
|
|
str += nsPrintfCString("line %p: count=%d state=%s ",
|
2007-07-08 11:08:04 +04:00
|
|
|
static_cast<const void*>(this), GetChildCount(),
|
2001-10-25 05:08:40 +04:00
|
|
|
StateToString(cbuf, sizeof(cbuf)));
|
2014-06-20 13:55:35 +04:00
|
|
|
if (IsBlock() && !GetCarriedOutBEndMargin().IsZero()) {
|
|
|
|
str += nsPrintfCString("bm=%d ", GetCarriedOutBEndMargin().get());
|
1999-01-16 03:00:50 +03:00
|
|
|
}
|
2014-04-16 12:03:28 +04:00
|
|
|
nsRect bounds = GetPhysicalBounds();
|
2015-07-07 16:37:30 +03:00
|
|
|
str += nsPrintfCString("{%d,%d,%d,%d} ",
|
|
|
|
bounds.x, bounds.y, bounds.width, bounds.height);
|
|
|
|
if (mWritingMode.IsVertical() || !mWritingMode.IsBidiLTR()) {
|
2015-09-24 00:16:11 +03:00
|
|
|
str += nsPrintfCString("{%s: %d,%d,%d,%d; cs=%d,%d} ",
|
|
|
|
mWritingMode.DebugString(),
|
2015-07-07 16:37:30 +03:00
|
|
|
IStart(), BStart(), ISize(), BSize(),
|
2015-07-16 12:07:57 +03:00
|
|
|
mContainerSize.width, mContainerSize.height);
|
2015-07-07 16:37:30 +03:00
|
|
|
}
|
2013-04-30 22:38:52 +04:00
|
|
|
if (mData &&
|
2014-04-16 12:03:28 +04:00
|
|
|
(!mData->mOverflowAreas.VisualOverflow().IsEqualEdges(bounds) ||
|
|
|
|
!mData->mOverflowAreas.ScrollableOverflow().IsEqualEdges(bounds))) {
|
2014-01-27 02:07:02 +04:00
|
|
|
str += nsPrintfCString("vis-overflow=%d,%d,%d,%d scr-overflow=%d,%d,%d,%d ",
|
2010-10-07 08:25:45 +04:00
|
|
|
mData->mOverflowAreas.VisualOverflow().x,
|
|
|
|
mData->mOverflowAreas.VisualOverflow().y,
|
|
|
|
mData->mOverflowAreas.VisualOverflow().width,
|
|
|
|
mData->mOverflowAreas.VisualOverflow().height,
|
|
|
|
mData->mOverflowAreas.ScrollableOverflow().x,
|
|
|
|
mData->mOverflowAreas.ScrollableOverflow().y,
|
|
|
|
mData->mOverflowAreas.ScrollableOverflow().width,
|
|
|
|
mData->mOverflowAreas.ScrollableOverflow().height);
|
1999-10-15 03:10:03 +04:00
|
|
|
}
|
2014-01-27 02:07:02 +04:00
|
|
|
fprintf_stderr(out, "%s<\n", str.get());
|
1998-12-01 19:13:49 +03:00
|
|
|
|
|
|
|
nsIFrame* frame = mFirstChild;
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t n = GetChildCount();
|
2014-01-27 02:07:02 +04:00
|
|
|
nsCString pfx(aPrefix);
|
|
|
|
pfx += " ";
|
1998-12-01 19:13:49 +03:00
|
|
|
while (--n >= 0) {
|
2014-01-27 02:07:02 +04:00
|
|
|
frame->List(out, pfx.get(), aFlags);
|
2003-06-30 14:46:59 +04:00
|
|
|
frame = frame->GetNextSibling();
|
1998-12-01 19:13:49 +03:00
|
|
|
}
|
|
|
|
|
2003-10-14 01:51:02 +04:00
|
|
|
if (HasFloats()) {
|
2014-01-27 02:07:02 +04:00
|
|
|
fprintf_stderr(out, "%s> floats <\n", aPrefix);
|
|
|
|
ListFloats(out, pfx.get(), mInlineData->mFloats);
|
1998-12-01 19:13:49 +03:00
|
|
|
}
|
2014-01-27 02:07:02 +04:00
|
|
|
fprintf_stderr(out, "%s>\n", aPrefix);
|
1998-12-01 19:13:49 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
nsIFrame*
|
|
|
|
nsLineBox::LastChild() const
|
|
|
|
{
|
|
|
|
nsIFrame* frame = mFirstChild;
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t n = GetChildCount() - 1;
|
1998-12-01 19:13:49 +03:00
|
|
|
while (--n >= 0) {
|
2003-06-30 14:46:59 +04:00
|
|
|
frame = frame->GetNextSibling();
|
1998-12-01 19:13:49 +03:00
|
|
|
}
|
|
|
|
return frame;
|
|
|
|
}
|
2012-03-08 05:57:37 +04:00
|
|
|
#endif
|
1998-12-01 19:13:49 +03:00
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t
|
1999-04-21 01:52:22 +04:00
|
|
|
nsLineBox::IndexOf(nsIFrame* aFrame) const
|
1998-12-01 19:13:49 +03:00
|
|
|
{
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t i, n = GetChildCount();
|
1998-12-01 19:13:49 +03:00
|
|
|
nsIFrame* frame = mFirstChild;
|
1999-04-21 01:52:22 +04:00
|
|
|
for (i = 0; i < n; i++) {
|
1998-12-01 19:13:49 +03:00
|
|
|
if (frame == aFrame) {
|
1999-04-21 01:52:22 +04:00
|
|
|
return i;
|
1998-12-01 19:13:49 +03:00
|
|
|
}
|
2003-06-30 14:46:59 +04:00
|
|
|
frame = frame->GetNextSibling();
|
1998-12-01 19:13:49 +03:00
|
|
|
}
|
1999-04-21 01:52:22 +04:00
|
|
|
return -1;
|
1998-12-01 19:13:49 +03:00
|
|
|
}
|
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
bool
|
2003-11-11 02:36:06 +03:00
|
|
|
nsLineBox::IsEmpty() const
|
2001-10-25 05:08:40 +04:00
|
|
|
{
|
|
|
|
if (IsBlock())
|
2003-11-11 02:36:06 +03:00
|
|
|
return mFirstChild->IsEmpty();
|
2001-10-25 05:08:40 +04:00
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t n;
|
2001-10-25 05:08:40 +04:00
|
|
|
nsIFrame *kid;
|
|
|
|
for (n = GetChildCount(), kid = mFirstChild;
|
|
|
|
n > 0;
|
2003-06-30 14:46:59 +04:00
|
|
|
--n, kid = kid->GetNextSibling())
|
2001-10-25 05:08:40 +04:00
|
|
|
{
|
2003-11-11 02:36:06 +03:00
|
|
|
if (!kid->IsEmpty())
|
2011-10-17 18:59:28 +04:00
|
|
|
return false;
|
2001-10-25 05:08:40 +04:00
|
|
|
}
|
2009-08-11 06:48:42 +04:00
|
|
|
if (HasBullet()) {
|
2011-10-17 18:59:28 +04:00
|
|
|
return false;
|
2009-08-11 06:48:42 +04:00
|
|
|
}
|
2011-10-17 18:59:28 +04:00
|
|
|
return true;
|
2001-10-25 05:08:40 +04:00
|
|
|
}
|
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
bool
|
2011-11-07 09:25:56 +04:00
|
|
|
nsLineBox::CachedIsEmpty()
|
2004-11-24 16:22:10 +03:00
|
|
|
{
|
|
|
|
if (mFlags.mDirty) {
|
|
|
|
return IsEmpty();
|
|
|
|
}
|
2017-07-06 15:00:35 +03:00
|
|
|
|
2004-11-24 16:22:10 +03:00
|
|
|
if (mFlags.mEmptyCacheValid) {
|
|
|
|
return mFlags.mEmptyCacheState;
|
|
|
|
}
|
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
bool result;
|
2006-02-27 07:15:05 +03:00
|
|
|
if (IsBlock()) {
|
|
|
|
result = mFirstChild->CachedIsEmpty();
|
|
|
|
} else {
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t n;
|
2006-02-27 07:15:05 +03:00
|
|
|
nsIFrame *kid;
|
2011-10-17 18:59:28 +04:00
|
|
|
result = true;
|
2006-02-27 07:15:05 +03:00
|
|
|
for (n = GetChildCount(), kid = mFirstChild;
|
|
|
|
n > 0;
|
|
|
|
--n, kid = kid->GetNextSibling())
|
|
|
|
{
|
|
|
|
if (!kid->CachedIsEmpty()) {
|
2011-10-17 18:59:28 +04:00
|
|
|
result = false;
|
2006-02-27 07:15:05 +03:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2009-08-11 06:48:42 +04:00
|
|
|
if (HasBullet()) {
|
2011-10-17 18:59:28 +04:00
|
|
|
result = false;
|
2009-08-11 06:48:42 +04:00
|
|
|
}
|
2006-02-27 07:15:05 +03:00
|
|
|
}
|
|
|
|
|
2011-10-17 18:59:28 +04:00
|
|
|
mFlags.mEmptyCacheValid = true;
|
2004-11-24 16:22:10 +03:00
|
|
|
mFlags.mEmptyCacheState = result;
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
1998-12-01 19:13:49 +03:00
|
|
|
void
|
2009-12-24 08:21:15 +03:00
|
|
|
nsLineBox::DeleteLineList(nsPresContext* aPresContext, nsLineList& aLines,
|
2017-11-07 03:20:33 +03:00
|
|
|
nsIFrame* aDestructRoot, nsFrameList* aFrames,
|
|
|
|
PostDestroyData& aPostDestroyData)
|
1998-12-01 19:13:49 +03:00
|
|
|
{
|
2012-10-15 05:34:23 +04:00
|
|
|
nsIPresShell* shell = aPresContext->PresShell();
|
|
|
|
|
|
|
|
// Keep our line list and frame list up to date as we
|
|
|
|
// remove frames, in case something wants to traverse the
|
|
|
|
// frame tree while we're destroying.
|
|
|
|
while (!aLines.empty()) {
|
|
|
|
nsLineBox* line = aLines.front();
|
2012-10-26 17:32:10 +04:00
|
|
|
if (MOZ_UNLIKELY(line->mFlags.mHasHashedFrames)) {
|
2012-10-15 05:34:23 +04:00
|
|
|
line->SwitchToCounter(); // Avoid expensive has table removals.
|
|
|
|
}
|
|
|
|
while (line->GetChildCount() > 0) {
|
|
|
|
nsIFrame* child = aFrames->RemoveFirstChild();
|
|
|
|
MOZ_ASSERT(child == line->mFirstChild, "Lines out of sync");
|
|
|
|
line->mFirstChild = aFrames->FirstChild();
|
|
|
|
line->NoteFrameRemoved(child);
|
2017-11-07 03:20:33 +03:00
|
|
|
child->DestroyFrom(aDestructRoot, aPostDestroyData);
|
1998-12-01 19:13:49 +03:00
|
|
|
}
|
|
|
|
|
2012-10-15 05:34:23 +04:00
|
|
|
aLines.pop_front();
|
|
|
|
line->Destroy(shell);
|
1998-12-01 19:13:49 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
bool
|
2001-10-25 05:08:40 +04:00
|
|
|
nsLineBox::RFindLineContaining(nsIFrame* aFrame,
|
|
|
|
const nsLineList::iterator& aBegin,
|
|
|
|
nsLineList::iterator& aEnd,
|
2009-10-02 20:31:43 +04:00
|
|
|
nsIFrame* aLastFrameBeforeEnd,
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t* aFrameIndexInLine)
|
2001-10-25 05:08:40 +04:00
|
|
|
{
|
|
|
|
NS_PRECONDITION(aFrame, "null ptr");
|
2012-03-11 06:32:27 +04:00
|
|
|
|
2009-10-02 20:31:43 +04:00
|
|
|
nsIFrame* curFrame = aLastFrameBeforeEnd;
|
2001-10-25 05:08:40 +04:00
|
|
|
while (aBegin != aEnd) {
|
|
|
|
--aEnd;
|
2012-03-08 05:57:37 +04:00
|
|
|
NS_ASSERTION(aEnd->LastChild() == curFrame, "Unexpected curFrame");
|
2012-10-26 17:32:10 +04:00
|
|
|
if (MOZ_UNLIKELY(aEnd->mFlags.mHasHashedFrames) &&
|
2012-03-11 06:32:27 +04:00
|
|
|
!aEnd->Contains(aFrame)) {
|
|
|
|
if (aEnd->mFirstChild) {
|
|
|
|
curFrame = aEnd->mFirstChild->GetPrevSibling();
|
|
|
|
}
|
|
|
|
continue;
|
|
|
|
}
|
2009-10-02 20:31:43 +04:00
|
|
|
// i is the index of curFrame in aEnd
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t i = aEnd->GetChildCount() - 1;
|
2009-10-02 20:31:43 +04:00
|
|
|
while (i >= 0) {
|
|
|
|
if (curFrame == aFrame) {
|
|
|
|
*aFrameIndexInLine = i;
|
2011-10-17 18:59:28 +04:00
|
|
|
return true;
|
2009-10-02 20:31:43 +04:00
|
|
|
}
|
|
|
|
--i;
|
|
|
|
curFrame = curFrame->GetPrevSibling();
|
1998-12-01 19:13:49 +03:00
|
|
|
}
|
2012-03-11 06:32:27 +04:00
|
|
|
MOZ_ASSERT(!aEnd->mFlags.mHasHashedFrames, "Contains lied to us!");
|
1998-12-01 19:13:49 +03:00
|
|
|
}
|
1999-04-21 01:52:22 +04:00
|
|
|
*aFrameIndexInLine = -1;
|
2011-10-17 18:59:28 +04:00
|
|
|
return false;
|
1998-12-01 19:13:49 +03:00
|
|
|
}
|
|
|
|
|
2001-10-25 05:08:40 +04:00
|
|
|
nsCollapsingMargin
|
2014-06-20 13:55:35 +04:00
|
|
|
nsLineBox::GetCarriedOutBEndMargin() const
|
1999-10-15 03:10:03 +04:00
|
|
|
{
|
2001-10-25 05:08:40 +04:00
|
|
|
NS_ASSERTION(IsBlock(),
|
2014-06-20 13:55:35 +04:00
|
|
|
"GetCarriedOutBEndMargin called on non-block line.");
|
2001-10-25 05:08:40 +04:00
|
|
|
return (IsBlock() && mBlockData)
|
2014-06-20 13:55:35 +04:00
|
|
|
? mBlockData->mCarriedOutBEndMargin
|
2001-10-25 05:08:40 +04:00
|
|
|
: nsCollapsingMargin();
|
1999-10-15 03:10:03 +04:00
|
|
|
}
|
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
bool
|
2014-06-20 13:55:35 +04:00
|
|
|
nsLineBox::SetCarriedOutBEndMargin(nsCollapsingMargin aValue)
|
1999-10-15 03:10:03 +04:00
|
|
|
{
|
2011-09-29 10:19:26 +04:00
|
|
|
bool changed = false;
|
1999-10-15 03:10:03 +04:00
|
|
|
if (IsBlock()) {
|
2004-09-18 18:39:07 +04:00
|
|
|
if (!aValue.IsZero()) {
|
1999-10-15 03:10:03 +04:00
|
|
|
if (!mBlockData) {
|
2014-04-16 12:03:28 +04:00
|
|
|
mBlockData = new ExtraBlockData(GetPhysicalBounds());
|
1999-10-15 03:10:03 +04:00
|
|
|
}
|
2014-06-20 13:55:35 +04:00
|
|
|
changed = aValue != mBlockData->mCarriedOutBEndMargin;
|
|
|
|
mBlockData->mCarriedOutBEndMargin = aValue;
|
1999-10-15 03:10:03 +04:00
|
|
|
}
|
|
|
|
else if (mBlockData) {
|
2014-06-20 13:55:35 +04:00
|
|
|
changed = aValue != mBlockData->mCarriedOutBEndMargin;
|
|
|
|
mBlockData->mCarriedOutBEndMargin = aValue;
|
1999-10-15 03:10:03 +04:00
|
|
|
MaybeFreeData();
|
|
|
|
}
|
|
|
|
}
|
2004-09-18 18:39:07 +04:00
|
|
|
return changed;
|
1999-10-15 03:10:03 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
nsLineBox::MaybeFreeData()
|
|
|
|
{
|
2014-04-16 12:03:28 +04:00
|
|
|
nsRect bounds = GetPhysicalBounds();
|
|
|
|
if (mData && mData->mOverflowAreas == nsOverflowAreas(bounds, bounds)) {
|
1999-10-15 03:10:03 +04:00
|
|
|
if (IsInline()) {
|
2003-10-14 01:51:02 +04:00
|
|
|
if (mInlineData->mFloats.IsEmpty()) {
|
1999-10-15 03:10:03 +04:00
|
|
|
delete mInlineData;
|
2012-07-30 18:20:58 +04:00
|
|
|
mInlineData = nullptr;
|
1999-10-15 03:10:03 +04:00
|
|
|
}
|
|
|
|
}
|
2014-06-20 13:55:35 +04:00
|
|
|
else if (mBlockData->mCarriedOutBEndMargin.IsZero()) {
|
1999-10-15 03:10:03 +04:00
|
|
|
delete mBlockData;
|
2012-07-30 18:20:58 +04:00
|
|
|
mBlockData = nullptr;
|
1999-10-15 03:10:03 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// XXX get rid of this???
|
2003-10-14 01:51:02 +04:00
|
|
|
nsFloatCache*
|
|
|
|
nsLineBox::GetFirstFloat()
|
1999-10-15 03:10:03 +04:00
|
|
|
{
|
2015-02-10 01:34:50 +03:00
|
|
|
MOZ_ASSERT(IsInline(), "block line can't have floats");
|
2012-07-30 18:20:58 +04:00
|
|
|
return mInlineData ? mInlineData->mFloats.Head() : nullptr;
|
1999-10-15 03:10:03 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
// XXX this might be too eager to free memory
|
|
|
|
void
|
2003-10-14 01:51:02 +04:00
|
|
|
nsLineBox::FreeFloats(nsFloatCacheFreeList& aFreeList)
|
1999-10-15 03:10:03 +04:00
|
|
|
{
|
2015-02-10 01:34:50 +03:00
|
|
|
MOZ_ASSERT(IsInline(), "block line can't have floats");
|
2006-04-17 05:47:11 +04:00
|
|
|
if (IsInline() && mInlineData) {
|
|
|
|
if (mInlineData->mFloats.NotEmpty()) {
|
2003-10-14 01:51:02 +04:00
|
|
|
aFreeList.Append(mInlineData->mFloats);
|
1999-10-15 03:10:03 +04:00
|
|
|
}
|
2006-04-17 05:47:11 +04:00
|
|
|
MaybeFreeData();
|
1999-10-15 03:10:03 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2003-10-14 01:51:02 +04:00
|
|
|
nsLineBox::AppendFloats(nsFloatCacheFreeList& aFreeList)
|
2017-07-06 15:00:35 +03:00
|
|
|
{
|
2015-02-10 01:34:50 +03:00
|
|
|
MOZ_ASSERT(IsInline(), "block line can't have floats");
|
1999-10-15 03:10:03 +04:00
|
|
|
if (IsInline()) {
|
|
|
|
if (aFreeList.NotEmpty()) {
|
|
|
|
if (!mInlineData) {
|
2014-04-16 12:03:28 +04:00
|
|
|
mInlineData = new ExtraInlineData(GetPhysicalBounds());
|
1999-10-15 03:10:03 +04:00
|
|
|
}
|
2011-04-29 09:02:16 +04:00
|
|
|
mInlineData->mFloats.Append(aFreeList);
|
1999-10-15 03:10:03 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
bool
|
2003-10-14 01:51:02 +04:00
|
|
|
nsLineBox::RemoveFloat(nsIFrame* aFrame)
|
1998-12-05 19:01:11 +03:00
|
|
|
{
|
2015-02-10 01:34:50 +03:00
|
|
|
MOZ_ASSERT(IsInline(), "block line can't have floats");
|
1999-10-15 03:10:03 +04:00
|
|
|
if (IsInline() && mInlineData) {
|
2003-10-14 01:51:02 +04:00
|
|
|
nsFloatCache* fc = mInlineData->mFloats.Find(aFrame);
|
1999-10-15 03:10:03 +04:00
|
|
|
if (fc) {
|
|
|
|
// Note: the placeholder is part of the line's child list
|
|
|
|
// and will be removed later.
|
2003-10-14 01:51:02 +04:00
|
|
|
mInlineData->mFloats.Remove(fc);
|
2005-10-22 02:23:28 +04:00
|
|
|
delete fc;
|
1999-10-15 03:10:03 +04:00
|
|
|
MaybeFreeData();
|
2011-10-17 18:59:28 +04:00
|
|
|
return true;
|
1999-10-15 03:10:03 +04:00
|
|
|
}
|
|
|
|
}
|
2011-10-17 18:59:28 +04:00
|
|
|
return false;
|
1999-10-15 03:10:03 +04:00
|
|
|
}
|
|
|
|
|
2017-04-15 01:31:43 +03:00
|
|
|
void
|
|
|
|
nsLineBox::SetFloatEdges(nscoord aStart, nscoord aEnd)
|
|
|
|
{
|
|
|
|
MOZ_ASSERT(IsInline(), "block line can't have float edges");
|
|
|
|
if (!mInlineData) {
|
|
|
|
mInlineData = new ExtraInlineData(GetPhysicalBounds());
|
|
|
|
}
|
|
|
|
mInlineData->mFloatEdgeIStart = aStart;
|
|
|
|
mInlineData->mFloatEdgeIEnd = aEnd;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
nsLineBox::ClearFloatEdges()
|
|
|
|
{
|
|
|
|
MOZ_ASSERT(IsInline(), "block line can't have float edges");
|
|
|
|
if (mInlineData) {
|
2017-05-17 00:31:30 +03:00
|
|
|
mInlineData->mFloatEdgeIStart = nscoord_MIN;
|
|
|
|
mInlineData->mFloatEdgeIEnd = nscoord_MIN;
|
2017-04-15 01:31:43 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1999-10-15 03:10:03 +04:00
|
|
|
void
|
2010-10-07 08:25:45 +04:00
|
|
|
nsLineBox::SetOverflowAreas(const nsOverflowAreas& aOverflowAreas)
|
|
|
|
{
|
|
|
|
NS_FOR_FRAME_OVERFLOW_TYPES(otype) {
|
|
|
|
NS_ASSERTION(aOverflowAreas.Overflow(otype).width >= 0,
|
|
|
|
"illegal width for combined area");
|
|
|
|
NS_ASSERTION(aOverflowAreas.Overflow(otype).height >= 0,
|
|
|
|
"illegal height for combined area");
|
|
|
|
}
|
2014-04-16 12:03:28 +04:00
|
|
|
nsRect bounds = GetPhysicalBounds();
|
|
|
|
if (!aOverflowAreas.VisualOverflow().IsEqualInterior(bounds) ||
|
|
|
|
!aOverflowAreas.ScrollableOverflow().IsEqualEdges(bounds)) {
|
2010-10-07 08:25:45 +04:00
|
|
|
if (!mData) {
|
1999-10-15 03:10:03 +04:00
|
|
|
if (IsInline()) {
|
2014-04-16 12:03:28 +04:00
|
|
|
mInlineData = new ExtraInlineData(bounds);
|
1999-10-15 03:10:03 +04:00
|
|
|
}
|
|
|
|
else {
|
2014-04-16 12:03:28 +04:00
|
|
|
mBlockData = new ExtraBlockData(bounds);
|
1999-10-15 03:10:03 +04:00
|
|
|
}
|
|
|
|
}
|
2010-10-07 08:25:45 +04:00
|
|
|
mData->mOverflowAreas = aOverflowAreas;
|
1999-10-15 03:10:03 +04:00
|
|
|
}
|
2010-10-07 08:25:45 +04:00
|
|
|
else if (mData) {
|
|
|
|
// Store away new value so that MaybeFreeData compares against
|
|
|
|
// the right value.
|
|
|
|
mData->mOverflowAreas = aOverflowAreas;
|
1999-10-15 03:10:03 +04:00
|
|
|
MaybeFreeData();
|
|
|
|
}
|
1998-12-05 19:01:11 +03:00
|
|
|
}
|
1999-05-11 02:28:49 +04:00
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
|
1999-05-13 04:54:28 +04:00
|
|
|
|
1999-05-11 02:28:49 +04:00
|
|
|
static nsLineBox* gDummyLines[1];
|
|
|
|
|
|
|
|
nsLineIterator::nsLineIterator()
|
|
|
|
{
|
1999-05-13 04:54:28 +04:00
|
|
|
mLines = gDummyLines;
|
1999-05-11 02:28:49 +04:00
|
|
|
mNumLines = 0;
|
|
|
|
mIndex = 0;
|
2011-10-17 18:59:28 +04:00
|
|
|
mRightToLeft = false;
|
1999-05-13 04:54:28 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
nsLineIterator::~nsLineIterator()
|
|
|
|
{
|
|
|
|
if (mLines != gDummyLines) {
|
|
|
|
delete [] mLines;
|
|
|
|
}
|
1999-05-11 02:28:49 +04:00
|
|
|
}
|
|
|
|
|
2008-10-30 22:17:59 +03:00
|
|
|
/* virtual */ void
|
|
|
|
nsLineIterator::DisposeLineIterator()
|
|
|
|
{
|
|
|
|
delete this;
|
|
|
|
}
|
1999-05-13 04:54:28 +04:00
|
|
|
|
1999-05-11 02:28:49 +04:00
|
|
|
nsresult
|
2011-09-29 10:19:26 +04:00
|
|
|
nsLineIterator::Init(nsLineList& aLines, bool aRightToLeft)
|
1999-05-11 02:28:49 +04:00
|
|
|
{
|
1999-05-13 04:54:28 +04:00
|
|
|
mRightToLeft = aRightToLeft;
|
|
|
|
|
1999-05-11 02:28:49 +04:00
|
|
|
// Count the lines
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t numLines = aLines.size();
|
1999-05-11 02:28:49 +04:00
|
|
|
if (0 == numLines) {
|
|
|
|
// Use gDummyLines so that we don't need null pointer checks in
|
|
|
|
// the accessor methods
|
|
|
|
mLines = gDummyLines;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Make a linear array of the lines
|
|
|
|
mLines = new nsLineBox*[numLines];
|
|
|
|
if (!mLines) {
|
|
|
|
// Use gDummyLines so that we don't need null pointer checks in
|
|
|
|
// the accessor methods
|
|
|
|
mLines = gDummyLines;
|
|
|
|
return NS_ERROR_OUT_OF_MEMORY;
|
|
|
|
}
|
|
|
|
nsLineBox** lp = mLines;
|
2001-10-25 05:08:40 +04:00
|
|
|
for (nsLineList::iterator line = aLines.begin(), line_end = aLines.end() ;
|
|
|
|
line != line_end;
|
|
|
|
++line)
|
|
|
|
{
|
1999-05-11 02:28:49 +04:00
|
|
|
*lp++ = line;
|
|
|
|
}
|
|
|
|
mNumLines = numLines;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t
|
2008-10-30 22:17:59 +03:00
|
|
|
nsLineIterator::GetNumLines()
|
1999-05-11 02:28:49 +04:00
|
|
|
{
|
2008-10-30 22:17:59 +03:00
|
|
|
return mNumLines;
|
1999-05-13 04:54:28 +04:00
|
|
|
}
|
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
bool
|
2008-10-30 22:17:59 +03:00
|
|
|
nsLineIterator::GetDirection()
|
1999-05-13 04:54:28 +04:00
|
|
|
{
|
2008-10-30 22:17:59 +03:00
|
|
|
return mRightToLeft;
|
1999-05-13 04:54:28 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
2012-08-22 19:56:38 +04:00
|
|
|
nsLineIterator::GetLine(int32_t aLineNumber,
|
1999-05-13 04:54:28 +04:00
|
|
|
nsIFrame** aFirstFrameOnLine,
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t* aNumFramesOnLine,
|
2014-12-19 17:55:30 +03:00
|
|
|
nsRect& aLineBounds)
|
1999-05-13 04:54:28 +04:00
|
|
|
{
|
1999-10-13 03:24:22 +04:00
|
|
|
NS_ENSURE_ARG_POINTER(aFirstFrameOnLine);
|
|
|
|
NS_ENSURE_ARG_POINTER(aNumFramesOnLine);
|
|
|
|
|
1999-05-13 04:54:28 +04:00
|
|
|
if ((aLineNumber < 0) || (aLineNumber >= mNumLines)) {
|
2012-07-30 18:20:58 +04:00
|
|
|
*aFirstFrameOnLine = nullptr;
|
1999-05-13 04:54:28 +04:00
|
|
|
*aNumFramesOnLine = 0;
|
|
|
|
aLineBounds.SetRect(0, 0, 0, 0);
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
nsLineBox* line = mLines[aLineNumber];
|
|
|
|
*aFirstFrameOnLine = line->mFirstChild;
|
1999-10-15 03:10:03 +04:00
|
|
|
*aNumFramesOnLine = line->GetChildCount();
|
2014-04-16 12:03:28 +04:00
|
|
|
aLineBounds = line->GetPhysicalBounds();
|
1999-10-13 03:24:22 +04:00
|
|
|
|
1999-05-13 04:54:28 +04:00
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t
|
|
|
|
nsLineIterator::FindLineContaining(nsIFrame* aFrame, int32_t aStartLine)
|
1999-05-13 04:54:28 +04:00
|
|
|
{
|
2011-09-07 06:57:46 +04:00
|
|
|
NS_PRECONDITION(aStartLine <= mNumLines, "Bogus line numbers");
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t lineNumber = aStartLine;
|
2001-10-25 05:08:40 +04:00
|
|
|
while (lineNumber != mNumLines) {
|
2011-09-07 06:57:46 +04:00
|
|
|
nsLineBox* line = mLines[lineNumber];
|
1999-05-13 04:54:28 +04:00
|
|
|
if (line->Contains(aFrame)) {
|
2008-10-30 22:17:59 +03:00
|
|
|
return lineNumber;
|
1999-05-13 04:54:28 +04:00
|
|
|
}
|
2011-09-07 06:57:46 +04:00
|
|
|
++lineNumber;
|
1999-05-13 04:54:28 +04:00
|
|
|
}
|
2008-10-30 22:17:59 +03:00
|
|
|
return -1;
|
1999-05-13 04:54:28 +04:00
|
|
|
}
|
|
|
|
|
2001-03-09 06:29:00 +03:00
|
|
|
NS_IMETHODIMP
|
2012-08-22 19:56:38 +04:00
|
|
|
nsLineIterator::CheckLineOrder(int32_t aLine,
|
2011-09-29 10:19:26 +04:00
|
|
|
bool *aIsReordered,
|
2001-03-09 06:29:00 +03:00
|
|
|
nsIFrame **aFirstVisual,
|
|
|
|
nsIFrame **aLastVisual)
|
|
|
|
{
|
2006-03-20 12:20:49 +03:00
|
|
|
NS_ASSERTION (aLine >= 0 && aLine < mNumLines, "aLine out of range!");
|
2006-03-12 12:49:48 +03:00
|
|
|
nsLineBox* line = mLines[aLine];
|
2006-03-20 12:20:49 +03:00
|
|
|
|
|
|
|
if (!line->mFirstChild) { // empty line
|
2011-10-17 18:59:28 +04:00
|
|
|
*aIsReordered = false;
|
2012-07-30 18:20:58 +04:00
|
|
|
*aFirstVisual = nullptr;
|
|
|
|
*aLastVisual = nullptr;
|
2006-03-20 12:20:49 +03:00
|
|
|
return NS_OK;
|
|
|
|
}
|
2011-04-27 12:47:18 +04:00
|
|
|
|
2006-03-12 12:49:48 +03:00
|
|
|
nsIFrame* leftmostFrame;
|
|
|
|
nsIFrame* rightmostFrame;
|
2011-04-13 13:23:49 +04:00
|
|
|
*aIsReordered = nsBidiPresUtils::CheckLineOrder(line->mFirstChild, line->GetChildCount(), &leftmostFrame, &rightmostFrame);
|
2001-03-09 06:29:00 +03:00
|
|
|
|
2006-03-12 12:49:48 +03:00
|
|
|
// map leftmost/rightmost to first/last according to paragraph direction
|
|
|
|
*aFirstVisual = mRightToLeft ? rightmostFrame : leftmostFrame;
|
|
|
|
*aLastVisual = mRightToLeft ? leftmostFrame : rightmostFrame;
|
2001-03-09 06:29:00 +03:00
|
|
|
|
2006-03-12 12:49:48 +03:00
|
|
|
return NS_OK;
|
2001-03-09 06:29:00 +03:00
|
|
|
}
|
|
|
|
|
1999-05-13 04:54:28 +04:00
|
|
|
NS_IMETHODIMP
|
2012-08-22 19:56:38 +04:00
|
|
|
nsLineIterator::FindFrameAt(int32_t aLineNumber,
|
2014-11-22 17:39:03 +03:00
|
|
|
nsPoint aPos,
|
1999-05-13 04:54:28 +04:00
|
|
|
nsIFrame** aFrameFound,
|
2014-11-22 17:39:03 +03:00
|
|
|
bool* aPosIsBeforeFirstFrame,
|
|
|
|
bool* aPosIsAfterLastFrame)
|
1999-05-13 04:54:28 +04:00
|
|
|
{
|
2014-11-22 17:39:03 +03:00
|
|
|
NS_PRECONDITION(aFrameFound && aPosIsBeforeFirstFrame && aPosIsAfterLastFrame,
|
1999-05-13 04:54:28 +04:00
|
|
|
"null OUT ptr");
|
2014-11-22 17:39:03 +03:00
|
|
|
if (!aFrameFound || !aPosIsBeforeFirstFrame || !aPosIsAfterLastFrame) {
|
1999-05-13 04:54:28 +04:00
|
|
|
return NS_ERROR_NULL_POINTER;
|
|
|
|
}
|
|
|
|
if ((aLineNumber < 0) || (aLineNumber >= mNumLines)) {
|
|
|
|
return NS_ERROR_INVALID_ARG;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsLineBox* line = mLines[aLineNumber];
|
|
|
|
if (!line) {
|
2012-07-30 18:20:58 +04:00
|
|
|
*aFrameFound = nullptr;
|
2014-11-22 17:39:03 +03:00
|
|
|
*aPosIsBeforeFirstFrame = true;
|
|
|
|
*aPosIsAfterLastFrame = false;
|
1999-05-13 04:54:28 +04:00
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2014-04-16 12:03:28 +04:00
|
|
|
if (line->ISize() == 0 && line->BSize() == 0)
|
2003-04-02 16:05:43 +04:00
|
|
|
return NS_ERROR_FAILURE;
|
|
|
|
|
1999-05-13 04:54:28 +04:00
|
|
|
nsIFrame* frame = line->mFirstChild;
|
2014-11-22 17:39:03 +03:00
|
|
|
nsIFrame* closestFromStart = nullptr;
|
|
|
|
nsIFrame* closestFromEnd = nullptr;
|
|
|
|
|
|
|
|
WritingMode wm = line->mWritingMode;
|
2015-07-16 12:07:57 +03:00
|
|
|
nsSize containerSize = line->mContainerSize;
|
2014-11-22 17:39:03 +03:00
|
|
|
|
2015-07-16 12:07:57 +03:00
|
|
|
LogicalPoint pos(wm, aPos, containerSize);
|
2014-11-22 17:39:03 +03:00
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t n = line->GetChildCount();
|
2005-08-03 01:55:55 +04:00
|
|
|
while (n--) {
|
2015-07-16 12:07:57 +03:00
|
|
|
LogicalRect rect = frame->GetLogicalRect(wm, containerSize);
|
2014-11-22 17:39:03 +03:00
|
|
|
if (rect.ISize(wm) > 0) {
|
|
|
|
// If pos.I() is inside this frame - this is it
|
|
|
|
if (rect.IStart(wm) <= pos.I(wm) && rect.IEnd(wm) > pos.I(wm)) {
|
|
|
|
closestFromStart = closestFromEnd = frame;
|
1999-05-13 04:54:28 +04:00
|
|
|
break;
|
|
|
|
}
|
2014-11-22 17:39:03 +03:00
|
|
|
if (rect.IStart(wm) < pos.I(wm)) {
|
2017-07-06 15:00:35 +03:00
|
|
|
if (!closestFromStart ||
|
2015-07-16 12:07:57 +03:00
|
|
|
rect.IEnd(wm) > closestFromStart->
|
|
|
|
GetLogicalRect(wm, containerSize).IEnd(wm))
|
2014-11-22 17:39:03 +03:00
|
|
|
closestFromStart = frame;
|
1999-05-13 04:54:28 +04:00
|
|
|
}
|
|
|
|
else {
|
2014-11-22 17:39:03 +03:00
|
|
|
if (!closestFromEnd ||
|
2015-07-16 12:07:57 +03:00
|
|
|
rect.IStart(wm) < closestFromEnd->
|
|
|
|
GetLogicalRect(wm, containerSize).IStart(wm))
|
2014-11-22 17:39:03 +03:00
|
|
|
closestFromEnd = frame;
|
1999-05-13 04:54:28 +04:00
|
|
|
}
|
|
|
|
}
|
2005-08-03 01:55:55 +04:00
|
|
|
frame = frame->GetNextSibling();
|
1999-05-13 04:54:28 +04:00
|
|
|
}
|
2014-11-22 17:39:03 +03:00
|
|
|
if (!closestFromStart && !closestFromEnd) {
|
2005-08-03 01:55:55 +04:00
|
|
|
// All frames were zero-width. Just take the first one.
|
2014-11-22 17:39:03 +03:00
|
|
|
closestFromStart = closestFromEnd = line->mFirstChild;
|
2005-08-03 01:55:55 +04:00
|
|
|
}
|
2014-11-22 17:39:03 +03:00
|
|
|
*aPosIsBeforeFirstFrame = mRightToLeft ? !closestFromEnd : !closestFromStart;
|
|
|
|
*aPosIsAfterLastFrame = mRightToLeft ? !closestFromStart : !closestFromEnd;
|
|
|
|
if (closestFromStart == closestFromEnd) {
|
|
|
|
*aFrameFound = closestFromStart;
|
2005-08-03 01:55:55 +04:00
|
|
|
}
|
2014-11-22 17:39:03 +03:00
|
|
|
else if (!closestFromStart) {
|
|
|
|
*aFrameFound = closestFromEnd;
|
2005-08-03 01:55:55 +04:00
|
|
|
}
|
2014-11-22 17:39:03 +03:00
|
|
|
else if (!closestFromEnd) {
|
|
|
|
*aFrameFound = closestFromStart;
|
2005-08-03 01:55:55 +04:00
|
|
|
}
|
|
|
|
else { // we're between two frames
|
2015-07-16 12:07:57 +03:00
|
|
|
nscoord delta =
|
|
|
|
closestFromEnd->GetLogicalRect(wm, containerSize).IStart(wm) -
|
|
|
|
closestFromStart->GetLogicalRect(wm, containerSize).IEnd(wm);
|
|
|
|
if (pos.I(wm) < closestFromStart->
|
|
|
|
GetLogicalRect(wm, containerSize).IEnd(wm) + delta/2) {
|
2014-11-22 17:39:03 +03:00
|
|
|
*aFrameFound = closestFromStart;
|
2015-07-16 12:07:57 +03:00
|
|
|
} else {
|
2014-11-22 17:39:03 +03:00
|
|
|
*aFrameFound = closestFromEnd;
|
2015-07-16 12:07:57 +03:00
|
|
|
}
|
1999-05-13 04:54:28 +04:00
|
|
|
}
|
|
|
|
return NS_OK;
|
1999-05-11 02:28:49 +04:00
|
|
|
}
|
1999-09-15 04:28:10 +04:00
|
|
|
|
2000-05-11 05:04:39 +04:00
|
|
|
NS_IMETHODIMP
|
2012-08-22 19:56:38 +04:00
|
|
|
nsLineIterator::GetNextSiblingOnLine(nsIFrame*& aFrame, int32_t aLineNumber)
|
2000-05-11 05:04:39 +04:00
|
|
|
{
|
2003-06-30 14:46:59 +04:00
|
|
|
aFrame = aFrame->GetNextSibling();
|
|
|
|
return NS_OK;
|
2000-05-11 05:04:39 +04:00
|
|
|
}
|
|
|
|
|
1999-09-15 04:28:10 +04:00
|
|
|
//----------------------------------------------------------------------
|
|
|
|
|
2005-10-22 02:23:28 +04:00
|
|
|
#ifdef NS_BUILD_REFCNT_LOGGING
|
|
|
|
nsFloatCacheList::nsFloatCacheList() :
|
2012-07-30 18:20:58 +04:00
|
|
|
mHead(nullptr)
|
2005-10-22 02:23:28 +04:00
|
|
|
{
|
|
|
|
MOZ_COUNT_CTOR(nsFloatCacheList);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2003-10-14 01:51:02 +04:00
|
|
|
nsFloatCacheList::~nsFloatCacheList()
|
1999-09-15 04:28:10 +04:00
|
|
|
{
|
2006-06-29 05:19:48 +04:00
|
|
|
DeleteAll();
|
|
|
|
MOZ_COUNT_DTOR(nsFloatCacheList);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
nsFloatCacheList::DeleteAll()
|
|
|
|
{
|
|
|
|
nsFloatCache* c = mHead;
|
|
|
|
while (c) {
|
|
|
|
nsFloatCache* next = c->Next();
|
|
|
|
delete c;
|
|
|
|
c = next;
|
1999-09-15 04:28:10 +04:00
|
|
|
}
|
2012-07-30 18:20:58 +04:00
|
|
|
mHead = nullptr;
|
1999-09-15 04:28:10 +04:00
|
|
|
}
|
|
|
|
|
2003-10-14 01:51:02 +04:00
|
|
|
nsFloatCache*
|
|
|
|
nsFloatCacheList::Tail() const
|
1999-09-15 04:28:10 +04:00
|
|
|
{
|
2003-10-14 01:51:02 +04:00
|
|
|
nsFloatCache* fc = mHead;
|
1999-09-15 04:28:10 +04:00
|
|
|
while (fc) {
|
|
|
|
if (!fc->mNext) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
fc = fc->mNext;
|
|
|
|
}
|
|
|
|
return fc;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2003-10-14 01:51:02 +04:00
|
|
|
nsFloatCacheList::Append(nsFloatCacheFreeList& aList)
|
1999-09-15 04:28:10 +04:00
|
|
|
{
|
2006-04-17 05:47:11 +04:00
|
|
|
NS_PRECONDITION(aList.NotEmpty(), "Appending empty list will fail");
|
2017-07-06 15:00:35 +03:00
|
|
|
|
2003-10-14 01:51:02 +04:00
|
|
|
nsFloatCache* tail = Tail();
|
1999-09-15 04:28:10 +04:00
|
|
|
if (tail) {
|
2005-10-22 02:23:28 +04:00
|
|
|
NS_ASSERTION(!tail->mNext, "Bogus!");
|
1999-09-15 04:28:10 +04:00
|
|
|
tail->mNext = aList.mHead;
|
|
|
|
}
|
|
|
|
else {
|
2005-10-22 02:23:28 +04:00
|
|
|
NS_ASSERTION(!mHead, "Bogus!");
|
1999-09-15 04:28:10 +04:00
|
|
|
mHead = aList.mHead;
|
|
|
|
}
|
2012-07-30 18:20:58 +04:00
|
|
|
aList.mHead = nullptr;
|
|
|
|
aList.mTail = nullptr;
|
1999-09-15 04:28:10 +04:00
|
|
|
}
|
|
|
|
|
2003-10-14 01:51:02 +04:00
|
|
|
nsFloatCache*
|
|
|
|
nsFloatCacheList::Find(nsIFrame* aOutOfFlowFrame)
|
1999-09-15 04:28:10 +04:00
|
|
|
{
|
2003-10-14 01:51:02 +04:00
|
|
|
nsFloatCache* fc = mHead;
|
1999-09-15 04:28:10 +04:00
|
|
|
while (fc) {
|
2009-08-31 22:25:35 +04:00
|
|
|
if (fc->mFloat == aOutOfFlowFrame) {
|
1999-09-15 04:28:10 +04:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
fc = fc->Next();
|
|
|
|
}
|
|
|
|
return fc;
|
|
|
|
}
|
|
|
|
|
2006-06-29 05:19:48 +04:00
|
|
|
nsFloatCache*
|
|
|
|
nsFloatCacheList::RemoveAndReturnPrev(nsFloatCache* aElement)
|
1999-09-15 04:28:10 +04:00
|
|
|
{
|
2006-06-29 05:19:48 +04:00
|
|
|
nsFloatCache* fc = mHead;
|
2012-07-30 18:20:58 +04:00
|
|
|
nsFloatCache* prev = nullptr;
|
2006-06-29 05:19:48 +04:00
|
|
|
while (fc) {
|
1999-09-15 04:28:10 +04:00
|
|
|
if (fc == aElement) {
|
2006-06-29 05:19:48 +04:00
|
|
|
if (prev) {
|
|
|
|
prev->mNext = fc->mNext;
|
|
|
|
} else {
|
|
|
|
mHead = fc->mNext;
|
|
|
|
}
|
|
|
|
return prev;
|
1999-09-15 04:28:10 +04:00
|
|
|
}
|
2006-06-29 05:19:48 +04:00
|
|
|
prev = fc;
|
|
|
|
fc = fc->mNext;
|
1999-09-15 04:28:10 +04:00
|
|
|
}
|
2012-07-30 18:20:58 +04:00
|
|
|
return nullptr;
|
1999-09-15 04:28:10 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
|
2005-10-22 02:23:28 +04:00
|
|
|
#ifdef NS_BUILD_REFCNT_LOGGING
|
|
|
|
nsFloatCacheFreeList::nsFloatCacheFreeList() :
|
2012-07-30 18:20:58 +04:00
|
|
|
mTail(nullptr)
|
2005-10-22 02:23:28 +04:00
|
|
|
{
|
|
|
|
MOZ_COUNT_CTOR(nsFloatCacheFreeList);
|
|
|
|
}
|
|
|
|
|
|
|
|
nsFloatCacheFreeList::~nsFloatCacheFreeList()
|
|
|
|
{
|
|
|
|
MOZ_COUNT_DTOR(nsFloatCacheFreeList);
|
|
|
|
}
|
|
|
|
#endif
|
2017-07-06 15:00:35 +03:00
|
|
|
|
1999-09-15 04:28:10 +04:00
|
|
|
void
|
2003-10-14 01:51:02 +04:00
|
|
|
nsFloatCacheFreeList::Append(nsFloatCacheList& aList)
|
1999-09-15 04:28:10 +04:00
|
|
|
{
|
2006-04-17 05:47:11 +04:00
|
|
|
NS_PRECONDITION(aList.NotEmpty(), "Appending empty list will fail");
|
2017-07-06 15:00:35 +03:00
|
|
|
|
1999-09-15 04:28:10 +04:00
|
|
|
if (mTail) {
|
2005-10-22 02:23:28 +04:00
|
|
|
NS_ASSERTION(!mTail->mNext, "Bogus");
|
1999-09-15 04:28:10 +04:00
|
|
|
mTail->mNext = aList.mHead;
|
|
|
|
}
|
|
|
|
else {
|
2005-10-22 02:23:28 +04:00
|
|
|
NS_ASSERTION(!mHead, "Bogus");
|
1999-09-15 04:28:10 +04:00
|
|
|
mHead = aList.mHead;
|
|
|
|
}
|
|
|
|
mTail = aList.Tail();
|
2012-07-30 18:20:58 +04:00
|
|
|
aList.mHead = nullptr;
|
1999-09-15 04:28:10 +04:00
|
|
|
}
|
|
|
|
|
2006-06-29 05:19:48 +04:00
|
|
|
void
|
|
|
|
nsFloatCacheFreeList::Remove(nsFloatCache* aElement)
|
|
|
|
{
|
|
|
|
nsFloatCache* prev = nsFloatCacheList::RemoveAndReturnPrev(aElement);
|
|
|
|
if (mTail == aElement) {
|
|
|
|
mTail = prev;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
nsFloatCacheFreeList::DeleteAll()
|
|
|
|
{
|
|
|
|
nsFloatCacheList::DeleteAll();
|
2012-07-30 18:20:58 +04:00
|
|
|
mTail = nullptr;
|
2006-06-29 05:19:48 +04:00
|
|
|
}
|
|
|
|
|
2003-10-14 01:51:02 +04:00
|
|
|
nsFloatCache*
|
2009-08-31 22:25:36 +04:00
|
|
|
nsFloatCacheFreeList::Alloc(nsIFrame* aFloat)
|
1999-09-15 04:28:10 +04:00
|
|
|
{
|
2009-08-31 22:25:36 +04:00
|
|
|
NS_PRECONDITION(aFloat->GetStateBits() & NS_FRAME_OUT_OF_FLOW,
|
|
|
|
"This is a float cache, why isn't the frame out-of-flow?");
|
2003-10-14 01:51:02 +04:00
|
|
|
nsFloatCache* fc = mHead;
|
1999-09-15 04:28:10 +04:00
|
|
|
if (mHead) {
|
|
|
|
if (mHead == mTail) {
|
2012-07-30 18:20:58 +04:00
|
|
|
mHead = mTail = nullptr;
|
1999-09-15 04:28:10 +04:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
mHead = fc->mNext;
|
|
|
|
}
|
2012-07-30 18:20:58 +04:00
|
|
|
fc->mNext = nullptr;
|
1999-09-15 04:28:10 +04:00
|
|
|
}
|
|
|
|
else {
|
2003-10-14 01:51:02 +04:00
|
|
|
fc = new nsFloatCache();
|
1999-09-15 04:28:10 +04:00
|
|
|
}
|
2009-08-31 22:25:36 +04:00
|
|
|
fc->mFloat = aFloat;
|
1999-09-15 04:28:10 +04:00
|
|
|
return fc;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2003-10-14 01:51:02 +04:00
|
|
|
nsFloatCacheFreeList::Append(nsFloatCache* aFloat)
|
1999-09-15 04:28:10 +04:00
|
|
|
{
|
2005-10-22 02:23:28 +04:00
|
|
|
NS_ASSERTION(!aFloat->mNext, "Bogus!");
|
2012-07-30 18:20:58 +04:00
|
|
|
aFloat->mNext = nullptr;
|
1999-09-15 04:28:10 +04:00
|
|
|
if (mTail) {
|
2005-10-22 02:23:28 +04:00
|
|
|
NS_ASSERTION(!mTail->mNext, "Bogus!");
|
2003-10-14 01:51:02 +04:00
|
|
|
mTail->mNext = aFloat;
|
|
|
|
mTail = aFloat;
|
1999-09-15 04:28:10 +04:00
|
|
|
}
|
|
|
|
else {
|
2005-10-22 02:23:28 +04:00
|
|
|
NS_ASSERTION(!mHead, "Bogus!");
|
2003-10-14 01:51:02 +04:00
|
|
|
mHead = mTail = aFloat;
|
1999-09-15 04:28:10 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
|
2003-10-14 01:51:02 +04:00
|
|
|
nsFloatCache::nsFloatCache()
|
2012-07-30 18:20:58 +04:00
|
|
|
: mFloat(nullptr),
|
|
|
|
mNext(nullptr)
|
1999-09-15 04:28:10 +04:00
|
|
|
{
|
2003-10-14 01:51:02 +04:00
|
|
|
MOZ_COUNT_CTOR(nsFloatCache);
|
1999-09-15 04:28:10 +04:00
|
|
|
}
|
1999-10-09 00:41:19 +04:00
|
|
|
|
2000-12-16 21:56:06 +03:00
|
|
|
#ifdef NS_BUILD_REFCNT_LOGGING
|
2003-10-14 01:51:02 +04:00
|
|
|
nsFloatCache::~nsFloatCache()
|
1999-10-09 00:41:19 +04:00
|
|
|
{
|
2003-10-14 01:51:02 +04:00
|
|
|
MOZ_COUNT_DTOR(nsFloatCache);
|
1999-10-09 00:41:19 +04:00
|
|
|
}
|
|
|
|
#endif
|