import FIREFOX_52_6_0esr_RELEASE from mozilla-esr52 hg repo

This commit is contained in:
Roy Tam 2018-01-19 03:59:58 +08:00
commit dcd9973243
150858 changed files with 23884658 additions and 0 deletions

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,81 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
// vim:cindent:ts=4:et:sw=4:
/* 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/. */
/*
* Web-compatible algorithms that determine column and table isizes,
* used for CSS2's 'table-layout: auto'.
*/
#ifndef BasicTableLayoutStrategy_h_
#define BasicTableLayoutStrategy_h_
#include "mozilla/Attributes.h"
#include "nsITableLayoutStrategy.h"
class nsTableFrame;
class BasicTableLayoutStrategy : public nsITableLayoutStrategy
{
public:
explicit BasicTableLayoutStrategy(nsTableFrame *aTableFrame);
virtual ~BasicTableLayoutStrategy();
// nsITableLayoutStrategy implementation
virtual nscoord GetMinISize(nsRenderingContext* aRenderingContext) override;
virtual nscoord GetPrefISize(nsRenderingContext* aRenderingContext,
bool aComputingSize) override;
virtual void MarkIntrinsicISizesDirty() override;
virtual void ComputeColumnISizes(const ReflowInput& aReflowInput) override;
private:
// NOTE: Using prefix "BTLS" to avoid overlapping names with
// the values of nsLayoutUtils::IntrinsicISizeType
enum BtlsISizeType { BTLS_MIN_ISIZE,
BTLS_PREF_ISIZE,
BTLS_FINAL_ISIZE };
// Compute intrinsic isize member variables on the columns.
void ComputeColumnIntrinsicISizes(nsRenderingContext* aRenderingContext);
// Distribute a colspanning cell's percent isize (if any) to its columns.
void DistributePctISizeToColumns(float aSpanPrefPct,
int32_t aFirstCol,
int32_t aColCount);
// Distribute an isize of some BltsISizeType type to a set of columns.
// aISize: The amount of isize to be distributed
// aFirstCol: The index (in the table) of the first column to be
// considered for receiving isize
// aColCount: The number of consecutive columns (starting with aFirstCol)
// to be considered for receiving isize
// aISizeType: The type of isize being distributed. (BTLS_MIN_ISIZE and
// BTLS_PREF_ISIZE are intended to be used for dividing up
// colspan's min & pref isize. BTLS_FINAL_ISIZE is intended
// to be used for distributing the table's final isize across
// all its columns)
// aSpanHasSpecifiedISize: Should be true iff:
// - We're distributing a colspanning cell's
// pref or min isize to its columns
// - The colspanning cell has a specified isize.
void DistributeISizeToColumns(nscoord aISize,
int32_t aFirstCol,
int32_t aColCount,
BtlsISizeType aISizeType,
bool aSpanHasSpecifiedISize);
// Compute the min and pref isizes of the table from the isize
// variables on the columns.
void ComputeIntrinsicISizes(nsRenderingContext* aRenderingContext);
nsTableFrame *mTableFrame;
nscoord mMinISize;
nscoord mPrefISize;
nscoord mPrefISizePctExpand;
nscoord mLastCalcISize;
};
#endif /* !defined(BasicTableLayoutStrategy_h_) */

View file

@ -0,0 +1,422 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
// vim:cindent:ts=2:et:sw=2:
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/*
* Algorithms that determine column and table inline sizes used for
* CSS2's 'table-layout: fixed'.
*/
#include "FixedTableLayoutStrategy.h"
#include "nsTableFrame.h"
#include "nsTableColFrame.h"
#include "nsTableCellFrame.h"
#include <algorithm>
FixedTableLayoutStrategy::FixedTableLayoutStrategy(nsTableFrame *aTableFrame)
: nsITableLayoutStrategy(nsITableLayoutStrategy::Fixed)
, mTableFrame(aTableFrame)
{
MarkIntrinsicISizesDirty();
}
/* virtual */
FixedTableLayoutStrategy::~FixedTableLayoutStrategy()
{
}
/* virtual */ nscoord
FixedTableLayoutStrategy::GetMinISize(nsRenderingContext* aRenderingContext)
{
DISPLAY_MIN_WIDTH(mTableFrame, mMinISize);
if (mMinISize != NS_INTRINSIC_WIDTH_UNKNOWN) {
return mMinISize;
}
// It's theoretically possible to do something much better here that
// depends only on the columns and the first row (where we look at
// intrinsic inline sizes inside the first row and then reverse the
// algorithm to find the narrowest inline size that would hold all of
// those intrinsic inline sizes), but it wouldn't be compatible with
// other browsers, or with the use of GetMinISize by
// nsTableFrame::ComputeSize to determine the inline size of a fixed
// layout table, since CSS2.1 says:
// The width of the table is then the greater of the value of the
// 'width' property for the table element and the sum of the column
// widths (plus cell spacing or borders).
// XXX Should we really ignore 'min-width' and 'max-width'?
// XXX Should we really ignore widths on column groups?
nsTableCellMap *cellMap = mTableFrame->GetCellMap();
int32_t colCount = cellMap->GetColCount();
nscoord result = 0;
if (colCount > 0) {
result += mTableFrame->GetColSpacing(-1, colCount);
}
WritingMode wm = mTableFrame->GetWritingMode();
for (int32_t col = 0; col < colCount; ++col) {
nsTableColFrame *colFrame = mTableFrame->GetColFrame(col);
if (!colFrame) {
NS_ERROR("column frames out of sync with cell map");
continue;
}
nscoord spacing = mTableFrame->GetColSpacing(col);
const nsStyleCoord *styleISize = &colFrame->StylePosition()->ISize(wm);
if (styleISize->ConvertsToLength()) {
result += colFrame->ComputeISizeValue(aRenderingContext,
0, 0, 0, *styleISize);
} else if (styleISize->GetUnit() == eStyleUnit_Percent) {
// do nothing
} else {
NS_ASSERTION(styleISize->GetUnit() == eStyleUnit_Auto ||
styleISize->GetUnit() == eStyleUnit_Enumerated ||
(styleISize->IsCalcUnit() && styleISize->CalcHasPercent()),
"bad inline size");
// The 'table-layout: fixed' algorithm considers only cells in the
// first row.
bool originates;
int32_t colSpan;
nsTableCellFrame *cellFrame = cellMap->GetCellInfoAt(0, col, &originates,
&colSpan);
if (cellFrame) {
styleISize = &cellFrame->StylePosition()->ISize(wm);
if (styleISize->ConvertsToLength() ||
(styleISize->GetUnit() == eStyleUnit_Enumerated &&
(styleISize->GetIntValue() == NS_STYLE_WIDTH_MAX_CONTENT ||
styleISize->GetIntValue() == NS_STYLE_WIDTH_MIN_CONTENT))) {
nscoord cellISize =
nsLayoutUtils::IntrinsicForContainer(aRenderingContext, cellFrame,
nsLayoutUtils::MIN_ISIZE);
if (colSpan > 1) {
// If a column-spanning cell is in the first row, split up
// the space evenly. (XXX This isn't quite right if some of
// the columns it's in have specified inline sizes. Should
// we care?)
cellISize = ((cellISize + spacing) / colSpan) - spacing;
}
result += cellISize;
} else if (styleISize->GetUnit() == eStyleUnit_Percent) {
if (colSpan > 1) {
// XXX Can this force columns to negative inline sizes?
result -= spacing * (colSpan - 1);
}
}
// else, for 'auto', '-moz-available', '-moz-fit-content',
// and 'calc()' with percentages, do nothing
}
}
}
return (mMinISize = result);
}
/* virtual */ nscoord
FixedTableLayoutStrategy::GetPrefISize(nsRenderingContext* aRenderingContext,
bool aComputingSize)
{
// It's theoretically possible to do something much better here that
// depends only on the columns and the first row (where we look at
// intrinsic inline sizes inside the first row and then reverse the
// algorithm to find the narrowest inline size that would hold all of
// those intrinsic inline sizes), but it wouldn't be compatible with
// other browsers.
nscoord result = nscoord_MAX;
DISPLAY_PREF_WIDTH(mTableFrame, result);
return result;
}
/* virtual */ void
FixedTableLayoutStrategy::MarkIntrinsicISizesDirty()
{
mMinISize = NS_INTRINSIC_WIDTH_UNKNOWN;
mLastCalcISize = nscoord_MIN;
}
static inline nscoord
AllocateUnassigned(nscoord aUnassignedSpace, float aShare)
{
if (aShare == 1.0f) {
// This happens when the numbers we're dividing to get aShare are
// equal. We want to return unassignedSpace exactly, even if it
// can't be precisely round-tripped through float.
return aUnassignedSpace;
}
return NSToCoordRound(float(aUnassignedSpace) * aShare);
}
/* virtual */ void
FixedTableLayoutStrategy::ComputeColumnISizes(const ReflowInput& aReflowInput)
{
nscoord tableISize = aReflowInput.ComputedISize();
if (mLastCalcISize == tableISize) {
return;
}
mLastCalcISize = tableISize;
nsTableCellMap *cellMap = mTableFrame->GetCellMap();
int32_t colCount = cellMap->GetColCount();
if (colCount == 0) {
// No Columns - nothing to compute
return;
}
// border-spacing isn't part of the basis for percentages.
tableISize -= mTableFrame->GetColSpacing(-1, colCount);
// store the old column inline sizes. We might call SetFinalISize
// multiple times on the columns, due to this we can't compare at the
// last call that the inline size has changed with respect to the last
// call to ComputeColumnISizes. In order to overcome this we store the
// old values in this array. A single call to SetFinalISize would make
// it possible to call GetFinalISize before and to compare when
// setting the final inline size.
nsTArray<nscoord> oldColISizes;
// XXX This ignores the 'min-width' and 'max-width' properties
// throughout. Then again, that's what the CSS spec says to do.
// XXX Should we really ignore widths on column groups?
uint32_t unassignedCount = 0;
nscoord unassignedSpace = tableISize;
const nscoord unassignedMarker = nscoord_MIN;
// We use the PrefPercent on the columns to store the percentages
// used to compute column inline sizes in case we need to shrink or
// expand the columns.
float pctTotal = 0.0f;
// Accumulate the total specified (non-percent) on the columns for
// distributing excess inline size to the columns.
nscoord specTotal = 0;
WritingMode wm = mTableFrame->GetWritingMode();
for (int32_t col = 0; col < colCount; ++col) {
nsTableColFrame *colFrame = mTableFrame->GetColFrame(col);
if (!colFrame) {
oldColISizes.AppendElement(0);
NS_ERROR("column frames out of sync with cell map");
continue;
}
oldColISizes.AppendElement(colFrame->GetFinalISize());
colFrame->ResetPrefPercent();
const nsStyleCoord *styleISize = &colFrame->StylePosition()->ISize(wm);
nscoord colISize;
if (styleISize->ConvertsToLength()) {
colISize = colFrame->ComputeISizeValue(aReflowInput.mRenderingContext,
0, 0, 0, *styleISize);
specTotal += colISize;
} else if (styleISize->GetUnit() == eStyleUnit_Percent) {
float pct = styleISize->GetPercentValue();
colISize = NSToCoordFloor(pct * float(tableISize));
colFrame->AddPrefPercent(pct);
pctTotal += pct;
} else {
NS_ASSERTION(styleISize->GetUnit() == eStyleUnit_Auto ||
styleISize->GetUnit() == eStyleUnit_Enumerated ||
(styleISize->IsCalcUnit() && styleISize->CalcHasPercent()),
"bad inline size");
// The 'table-layout: fixed' algorithm considers only cells in the
// first row.
bool originates;
int32_t colSpan;
nsTableCellFrame *cellFrame = cellMap->GetCellInfoAt(0, col, &originates,
&colSpan);
if (cellFrame) {
const nsStylePosition* cellStylePos = cellFrame->StylePosition();
styleISize = &cellStylePos->ISize(wm);
if (styleISize->ConvertsToLength() ||
(styleISize->GetUnit() == eStyleUnit_Enumerated &&
(styleISize->GetIntValue() == NS_STYLE_WIDTH_MAX_CONTENT ||
styleISize->GetIntValue() == NS_STYLE_WIDTH_MIN_CONTENT))) {
// XXX This should use real percentage padding
// Note that the difference between MIN_ISIZE and PREF_ISIZE
// shouldn't matter for any of these values of styleISize; use
// MIN_ISIZE for symmetry with GetMinISize above, just in case
// there is a difference.
colISize =
nsLayoutUtils::IntrinsicForContainer(aReflowInput.mRenderingContext,
cellFrame,
nsLayoutUtils::MIN_ISIZE);
} else if (styleISize->GetUnit() == eStyleUnit_Percent) {
// XXX This should use real percentage padding
float pct = styleISize->GetPercentValue();
colISize = NSToCoordFloor(pct * float(tableISize));
if (cellStylePos->mBoxSizing == StyleBoxSizing::Content) {
nsIFrame::IntrinsicISizeOffsetData offsets =
cellFrame->IntrinsicISizeOffsets();
colISize += offsets.hPadding + offsets.hBorder;
}
pct /= float(colSpan);
colFrame->AddPrefPercent(pct);
pctTotal += pct;
} else {
// 'auto', '-moz-available', '-moz-fit-content', and 'calc()'
// with percentages
colISize = unassignedMarker;
}
if (colISize != unassignedMarker) {
if (colSpan > 1) {
// If a column-spanning cell is in the first row, split up
// the space evenly. (XXX This isn't quite right if some of
// the columns it's in have specified iSizes. Should we
// care?)
nscoord spacing = mTableFrame->GetColSpacing(col);
colISize = ((colISize + spacing) / colSpan) - spacing;
if (colISize < 0) {
colISize = 0;
}
}
if (styleISize->GetUnit() != eStyleUnit_Percent) {
specTotal += colISize;
}
}
} else {
colISize = unassignedMarker;
}
}
colFrame->SetFinalISize(colISize);
if (colISize == unassignedMarker) {
++unassignedCount;
} else {
unassignedSpace -= colISize;
}
}
if (unassignedSpace < 0) {
if (pctTotal > 0) {
// If the columns took up too much space, reduce those that had
// percentage inline sizes. The spec doesn't say to do this, but
// we've always done it in the past, and so does WinIE6.
nscoord pctUsed = NSToCoordFloor(pctTotal * float(tableISize));
nscoord reduce = std::min(pctUsed, -unassignedSpace);
float reduceRatio = float(reduce) / pctTotal;
for (int32_t col = 0; col < colCount; ++col) {
nsTableColFrame *colFrame = mTableFrame->GetColFrame(col);
if (!colFrame) {
NS_ERROR("column frames out of sync with cell map");
continue;
}
nscoord colISize = colFrame->GetFinalISize();
colISize -= NSToCoordFloor(colFrame->GetPrefPercent() * reduceRatio);
if (colISize < 0) {
colISize = 0;
}
colFrame->SetFinalISize(colISize);
}
}
unassignedSpace = 0;
}
if (unassignedCount > 0) {
// The spec says to distribute the remaining space evenly among
// the columns.
nscoord toAssign = unassignedSpace / unassignedCount;
for (int32_t col = 0; col < colCount; ++col) {
nsTableColFrame *colFrame = mTableFrame->GetColFrame(col);
if (!colFrame) {
NS_ERROR("column frames out of sync with cell map");
continue;
}
if (colFrame->GetFinalISize() == unassignedMarker) {
colFrame->SetFinalISize(toAssign);
}
}
} else if (unassignedSpace > 0) {
// The spec doesn't say how to distribute the unassigned space.
if (specTotal > 0) {
// Distribute proportionally to non-percentage columns.
nscoord specUndist = specTotal;
for (int32_t col = 0; col < colCount; ++col) {
nsTableColFrame *colFrame = mTableFrame->GetColFrame(col);
if (!colFrame) {
NS_ERROR("column frames out of sync with cell map");
continue;
}
if (colFrame->GetPrefPercent() == 0.0f) {
NS_ASSERTION(colFrame->GetFinalISize() <= specUndist,
"inline sizes don't add up");
nscoord toAdd = AllocateUnassigned(unassignedSpace,
float(colFrame->GetFinalISize()) /
float(specUndist));
specUndist -= colFrame->GetFinalISize();
colFrame->SetFinalISize(colFrame->GetFinalISize() + toAdd);
unassignedSpace -= toAdd;
if (specUndist <= 0) {
NS_ASSERTION(specUndist == 0, "math should be exact");
break;
}
}
}
NS_ASSERTION(unassignedSpace == 0, "failed to redistribute");
} else if (pctTotal > 0) {
// Distribute proportionally to percentage columns.
float pctUndist = pctTotal;
for (int32_t col = 0; col < colCount; ++col) {
nsTableColFrame *colFrame = mTableFrame->GetColFrame(col);
if (!colFrame) {
NS_ERROR("column frames out of sync with cell map");
continue;
}
if (pctUndist < colFrame->GetPrefPercent()) {
// This can happen with floating-point math.
NS_ASSERTION(colFrame->GetPrefPercent() - pctUndist < 0.0001,
"inline sizes don't add up");
pctUndist = colFrame->GetPrefPercent();
}
nscoord toAdd = AllocateUnassigned(unassignedSpace,
colFrame->GetPrefPercent() /
pctUndist);
colFrame->SetFinalISize(colFrame->GetFinalISize() + toAdd);
unassignedSpace -= toAdd;
pctUndist -= colFrame->GetPrefPercent();
if (pctUndist <= 0.0f) {
break;
}
}
NS_ASSERTION(unassignedSpace == 0, "failed to redistribute");
} else {
// Distribute equally to the zero-iSize columns.
int32_t colsRemaining = colCount;
for (int32_t col = 0; col < colCount; ++col) {
nsTableColFrame *colFrame = mTableFrame->GetColFrame(col);
if (!colFrame) {
NS_ERROR("column frames out of sync with cell map");
continue;
}
NS_ASSERTION(colFrame->GetFinalISize() == 0, "yikes");
nscoord toAdd = AllocateUnassigned(unassignedSpace,
1.0f / float(colsRemaining));
colFrame->SetFinalISize(toAdd);
unassignedSpace -= toAdd;
--colsRemaining;
}
NS_ASSERTION(unassignedSpace == 0, "failed to redistribute");
}
}
for (int32_t col = 0; col < colCount; ++col) {
nsTableColFrame *colFrame = mTableFrame->GetColFrame(col);
if (!colFrame) {
NS_ERROR("column frames out of sync with cell map");
continue;
}
if (oldColISizes.ElementAt(col) != colFrame->GetFinalISize()) {
mTableFrame->DidResizeColumns();
break;
}
}
}

View file

@ -0,0 +1,40 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
// vim:cindent:ts=2:et:sw=2:
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/*
* Algorithms that determine column and table isizes used for CSS2's
* 'table-layout: fixed'.
*/
#ifndef FixedTableLayoutStrategy_h_
#define FixedTableLayoutStrategy_h_
#include "mozilla/Attributes.h"
#include "nsITableLayoutStrategy.h"
class nsTableFrame;
class FixedTableLayoutStrategy : public nsITableLayoutStrategy
{
public:
explicit FixedTableLayoutStrategy(nsTableFrame *aTableFrame);
virtual ~FixedTableLayoutStrategy();
// nsITableLayoutStrategy implementation
virtual nscoord GetMinISize(nsRenderingContext* aRenderingContext) override;
virtual nscoord GetPrefISize(nsRenderingContext* aRenderingContext,
bool aComputingSize) override;
virtual void MarkIntrinsicISizesDirty() override;
virtual void ComputeColumnISizes(const ReflowInput& aReflowInput)
override;
private:
nsTableFrame *mTableFrame;
nscoord mMinISize;
nscoord mLastCalcISize;
};
#endif /* !defined(FixedTableLayoutStrategy_h_) */

View file

@ -0,0 +1,160 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
// vim:cindent:ts=4:et:sw=4:
/* 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/. */
/*
* Code to sort cells by their colspan, used by BasicTableLayoutStrategy.
*/
#include "SpanningCellSorter.h"
#include "nsQuickSort.h"
#include "nsIPresShell.h"
//#define DEBUG_SPANNING_CELL_SORTER
SpanningCellSorter::SpanningCellSorter()
: mState(ADDING)
, mHashTable(&HashTableOps, sizeof(HashTableEntry))
, mSortedHashTable(nullptr)
{
memset(mArray, 0, sizeof(mArray));
}
SpanningCellSorter::~SpanningCellSorter()
{
delete [] mSortedHashTable;
}
/* static */ const PLDHashTableOps
SpanningCellSorter::HashTableOps = {
HashTableHashKey,
HashTableMatchEntry,
PLDHashTable::MoveEntryStub,
PLDHashTable::ClearEntryStub,
nullptr
};
/* static */ PLDHashNumber
SpanningCellSorter::HashTableHashKey(const void *key)
{
return NS_PTR_TO_INT32(key);
}
/* static */ bool
SpanningCellSorter::HashTableMatchEntry(const PLDHashEntryHdr *hdr,
const void *key)
{
const HashTableEntry *entry = static_cast<const HashTableEntry*>(hdr);
return NS_PTR_TO_INT32(key) == entry->mColSpan;
}
bool
SpanningCellSorter::AddCell(int32_t aColSpan, int32_t aRow, int32_t aCol)
{
NS_ASSERTION(mState == ADDING, "cannot call AddCell after GetNext");
NS_ASSERTION(aColSpan >= ARRAY_BASE, "cannot add cells with colspan<2");
Item *i = (Item*) mozilla::AutoStackArena::Allocate(sizeof(Item));
NS_ENSURE_TRUE(i != nullptr, false);
i->row = aRow;
i->col = aCol;
if (UseArrayForSpan(aColSpan)) {
int32_t index = SpanToIndex(aColSpan);
i->next = mArray[index];
mArray[index] = i;
} else {
auto entry = static_cast<HashTableEntry*>
(mHashTable.Add(NS_INT32_TO_PTR(aColSpan), fallible));
NS_ENSURE_TRUE(entry, false);
NS_ASSERTION(entry->mColSpan == 0 || entry->mColSpan == aColSpan,
"wrong entry");
NS_ASSERTION((entry->mColSpan == 0) == (entry->mItems == nullptr),
"entry should be either new or properly initialized");
entry->mColSpan = aColSpan;
i->next = entry->mItems;
entry->mItems = i;
}
return true;
}
/* static */ int
SpanningCellSorter::SortArray(const void *a, const void *b, void *closure)
{
int32_t spanA = (*static_cast<HashTableEntry*const*>(a))->mColSpan;
int32_t spanB = (*static_cast<HashTableEntry*const*>(b))->mColSpan;
if (spanA < spanB)
return -1;
if (spanA == spanB)
return 0;
return 1;
}
SpanningCellSorter::Item*
SpanningCellSorter::GetNext(int32_t *aColSpan)
{
NS_ASSERTION(mState != DONE, "done enumerating, stop calling");
switch (mState) {
case ADDING:
/* prepare to enumerate the array */
mState = ENUMERATING_ARRAY;
mEnumerationIndex = 0;
MOZ_FALLTHROUGH;
case ENUMERATING_ARRAY:
while (mEnumerationIndex < ARRAY_SIZE && !mArray[mEnumerationIndex])
++mEnumerationIndex;
if (mEnumerationIndex < ARRAY_SIZE) {
Item *result = mArray[mEnumerationIndex];
*aColSpan = IndexToSpan(mEnumerationIndex);
NS_ASSERTION(result, "logic error");
#ifdef DEBUG_SPANNING_CELL_SORTER
printf("SpanningCellSorter[%p]:"
" returning list for colspan=%d from array\n",
static_cast<void*>(this), *aColSpan);
#endif
++mEnumerationIndex;
return result;
}
/* prepare to enumerate the hash */
mState = ENUMERATING_HASH;
mEnumerationIndex = 0;
if (mHashTable.EntryCount() > 0) {
HashTableEntry **sh =
new HashTableEntry*[mHashTable.EntryCount()];
int32_t j = 0;
for (auto iter = mHashTable.Iter(); !iter.Done(); iter.Next()) {
sh[j++] = static_cast<HashTableEntry*>(iter.Get());
}
NS_QuickSort(sh, mHashTable.EntryCount(), sizeof(sh[0]),
SortArray, nullptr);
mSortedHashTable = sh;
}
MOZ_FALLTHROUGH;
case ENUMERATING_HASH:
if (mEnumerationIndex < mHashTable.EntryCount()) {
Item *result = mSortedHashTable[mEnumerationIndex]->mItems;
*aColSpan = mSortedHashTable[mEnumerationIndex]->mColSpan;
NS_ASSERTION(result, "holes in hash table");
#ifdef DEBUG_SPANNING_CELL_SORTER
printf("SpanningCellSorter[%p]:"
" returning list for colspan=%d from hash\n",
static_cast<void*>(this), *aColSpan);
#endif
++mEnumerationIndex;
return result;
}
mState = DONE;
MOZ_FALLTHROUGH;
case DONE:
;
}
return nullptr;
}

View file

@ -0,0 +1,91 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
// vim:cindent:ts=4:et:sw=4:
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef SpanningCellSorter_h
#define SpanningCellSorter_h
/*
* Code to sort cells by their colspan, used by BasicTableLayoutStrategy.
*/
#include "PLDHashTable.h"
#include "nsDebug.h"
#include "StackArena.h"
/**
* The SpanningCellSorter is responsible for accumulating lists of cells
* with colspans so that those cells can later be enumerated, sorted
* from lowest number of columns spanned to highest. It does not use a
* stable sort (in fact, it currently reverses).
*/
class MOZ_STACK_CLASS SpanningCellSorter {
public:
SpanningCellSorter();
~SpanningCellSorter();
struct Item {
int32_t row, col;
Item *next;
};
/**
* Add a cell to the sorter. Returns false on out of memory.
* aColSpan is the number of columns spanned, and aRow/aCol are the
* position of the cell in the table (for GetCellInfoAt).
*/
bool AddCell(int32_t aColSpan, int32_t aRow, int32_t aCol);
/**
* Get the next *list* of cells. Each list contains all the cells
* for a colspan value, and the lists are given in order from lowest
* to highest colspan. The colspan value is filled in to *aColSpan.
*/
Item* GetNext(int32_t *aColSpan);
private:
enum State { ADDING, ENUMERATING_ARRAY, ENUMERATING_HASH, DONE };
State mState;
// store small colspans in an array for fast sorting and
// enumeration, and large colspans in a hash table
enum { ARRAY_BASE = 2 };
enum { ARRAY_SIZE = 8 };
Item *mArray[ARRAY_SIZE];
int32_t SpanToIndex(int32_t aSpan) { return aSpan - ARRAY_BASE; }
int32_t IndexToSpan(int32_t aIndex) { return aIndex + ARRAY_BASE; }
bool UseArrayForSpan(int32_t aSpan) {
NS_ASSERTION(SpanToIndex(aSpan) >= 0, "cell without colspan");
return SpanToIndex(aSpan) < ARRAY_SIZE;
}
PLDHashTable mHashTable;
struct HashTableEntry : public PLDHashEntryHdr {
int32_t mColSpan;
Item *mItems;
};
static const PLDHashTableOps HashTableOps;
static PLDHashNumber HashTableHashKey(const void *key);
static bool
HashTableMatchEntry(const PLDHashEntryHdr *hdr, const void *key);
static int SortArray(const void *a, const void *b, void *closure);
/* state used only during enumeration */
uint32_t mEnumerationIndex; // into mArray or mSortedHashTable
HashTableEntry **mSortedHashTable;
/*
* operator new is forbidden since we use the pres shell's stack
* memory, which much be pushed and popped at points matching a
* push/pop on the C++ stack.
*/
void* operator new(size_t sz) CPP_THROW_NEW { return nullptr; }
};
#endif

41
layout/tables/TableArea.h Normal file
View file

@ -0,0 +1,41 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef mozilla_TableArea_h_
#define mozilla_TableArea_h_
#include "nsRect.h"
namespace mozilla {
struct TableArea
{
TableArea() : mRect() { }
TableArea(int32_t aStartCol, int32_t aStartRow,
int32_t aColCount, int32_t aRowCount)
: mRect(aStartCol, aStartRow, aColCount, aRowCount) { }
int32_t& StartCol() { return mRect.x; }
int32_t& StartRow() { return mRect.y; }
int32_t& ColCount() { return mRect.width; }
int32_t& RowCount() { return mRect.height; }
int32_t StartCol() const { return mRect.x; }
int32_t StartRow() const { return mRect.y; }
int32_t ColCount() const { return mRect.width; }
int32_t RowCount() const { return mRect.height; }
int32_t EndCol() const { return mRect.XMost(); }
int32_t EndRow() const { return mRect.YMost(); }
void UnionArea(const TableArea& aArea1, const TableArea& aArea2)
{ mRect.UnionRect(aArea1.mRect, aArea2.mRect); }
private:
nsIntRect mRect;
};
} // namespace mozilla
#endif // mozilla_TableArea_h_

459
layout/tables/celldata.h Normal file
View file

@ -0,0 +1,459 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef CellData_h__
#define CellData_h__
#include "nsISupports.h"
#include "nsCoord.h"
#include "mozilla/gfx/Types.h"
#include "mozilla/WritingModes.h"
#include <stdint.h>
class nsTableCellFrame;
class nsCellMap;
class BCCellData;
#define MAX_ROWSPAN 65534 // the cellmap can not handle more.
#define MAX_COLSPAN 1000 // limit as IE and opera do. If this ever changes,
// change COL_SPAN_OFFSET/COL_SPAN_SHIFT accordingly.
/**
* Data stored by nsCellMap to rationalize rowspan and colspan cells.
*/
class CellData
{
public:
/** Initialize the mOrigCell pointer
* @param aOrigCell the table cell frame which will be stored in mOrigCell.
*/
void Init(nsTableCellFrame* aCellFrame);
/** does a cell originate from here
* @return is true if a cell corresponds to this cellmap entry
*/
bool IsOrig() const;
/** is the celldata valid
* @return is true if no cell originates and the cell is not spanned by
* a row- or colspan. mBits are 0 in this case and mOrigCell is
* nullptr
*/
bool IsDead() const;
/** is the entry spanned by row- or a colspan
* @return is true if the entry is spanned by a row- or colspan
*/
bool IsSpan() const;
/** is the entry spanned by rowspan
* @return is true if the entry is spanned by a rowspan
*/
bool IsRowSpan() const;
/** is the entry spanned by a zero rowspan
* zero rowspans span all cells starting from the originating cell down to
* the end of the rowgroup or a cell originating in the same column
* @return is true if the entry is spanned by a zero rowspan
*/
bool IsZeroRowSpan() const;
/** mark the current entry as spanned by a zero rowspan
* @param aIsZero if true mark the entry as covered by a zero rowspan
*/
void SetZeroRowSpan(bool aIsZero);
/** get the distance from the current entry to the corresponding origin of the rowspan
* @return containing the distance in the column to the originating cell
*/
uint32_t GetRowSpanOffset() const;
/** set the distance from the current entry to the corresponding origin of the rowspan
* @param the distance in the column to the originating cell
*/
void SetRowSpanOffset(uint32_t aSpan);
/** is the entry spanned by colspan
* @return is true if the entry is spanned by a colspan
*/
bool IsColSpan() const;
/** get the distance from the current entry to the corresponding origin of the colspan
* @return containing the distance in the row to the originating cell
*/
uint32_t GetColSpanOffset() const;
/** set the distance from the current entry to the corresponding origin of the colspan
* @param the distance in the column to the originating cell
*/
void SetColSpanOffset(uint32_t aSpan);
/** is the entry spanned by a row- and a colspan
* @return is true if the entry is spanned by a row- and a colspan
*/
bool IsOverlap() const;
/** mark the current entry as spanned by a row- and a colspan
* @param aOverlap if true mark the entry as covered by a row- and a colspan
*/
void SetOverlap(bool aOverlap);
/** get the table cell frame for this entry
* @return a pointer to the cellframe, this will be nullptr when the entry
* is only a spanned entry
*/
nsTableCellFrame* GetCellFrame() const;
private:
friend class nsCellMap;
friend class BCCellData;
/** constructor.
* @param aOrigCell the table cell frame which will be stored in mOrigCell.
*/
explicit CellData(nsTableCellFrame* aOrigCell); // implemented in nsCellMap.cpp
/** destructor */
~CellData(); // implemented in nsCellMap.cpp
protected:
// this union relies on the assumption that an object (not primitive type) does
// not start on an odd bit boundary. If mSpan is 0 then mOrigCell is in effect
// and the data does not represent a span. If mSpan is 1, then mBits is in
// effect and the data represents a span.
// mBits must match the size of mOrigCell on both 32- and 64-bit platforms.
union {
nsTableCellFrame* mOrigCell;
uintptr_t mBits;
};
};
// Border Collapsing Cell Data
enum BCBorderOwner
{
eTableOwner = 0,
eColGroupOwner = 1,
eAjaColGroupOwner = 2, // col group to the left
eColOwner = 3,
eAjaColOwner = 4, // col to the left
eRowGroupOwner = 5,
eAjaRowGroupOwner = 6, // row group above
eRowOwner = 7,
eAjaRowOwner = 8, // row above
eCellOwner = 9,
eAjaCellOwner = 10 // cell to the top or to the left
};
typedef uint16_t BCPixelSize;
// These are the max sizes that are stored. If they are exceeded, then the max is stored and
// the actual value is computed when needed.
#define MAX_BORDER_WIDTH nscoord((1u << (sizeof(BCPixelSize) * 8)) - 1)
// The half of border on inline/block-axis start side
static inline BCPixelSize
BC_BORDER_START_HALF(BCPixelSize px) { return px - px / 2; }
// The half of border on inline/block-axis end side
static inline BCPixelSize
BC_BORDER_END_HALF(BCPixelSize px) { return px / 2; }
static inline nscoord
BC_BORDER_START_HALF_COORD(int32_t p2t, BCPixelSize px)
{ return BC_BORDER_START_HALF(px) * p2t; }
static inline nscoord
BC_BORDER_END_HALF_COORD(int32_t p2t, BCPixelSize px)
{ return BC_BORDER_END_HALF(px) * p2t; }
// BCData stores the bstart and istart border info and the corner connecting the two.
class BCData
{
public:
BCData();
~BCData();
nscoord GetIStartEdge(BCBorderOwner& aOwner,
bool& aStart) const;
void SetIStartEdge(BCBorderOwner aOwner,
nscoord aSize,
bool aStart);
nscoord GetBStartEdge(BCBorderOwner& aOwner,
bool& aStart) const;
void SetBStartEdge(BCBorderOwner aOwner,
nscoord aSize,
bool aStart);
BCPixelSize GetCorner(mozilla::LogicalSide& aCornerOwner,
bool& aBevel) const;
void SetCorner(BCPixelSize aSubSize,
mozilla::LogicalSide aOwner,
bool aBevel);
bool IsIStartStart() const;
void SetIStartStart(bool aValue);
bool IsBStartStart() const;
void SetBStartStart(bool aValue);
protected:
BCPixelSize mIStartSize; // size in pixels of iStart border
BCPixelSize mBStartSize; // size in pixels of bStart border
BCPixelSize mCornerSubSize; // size of the largest border not in the
// dominant plane (for example, if corner is
// owned by the segment to its bStart or bEnd,
// then the size is the max of the border
// sizes of the segments to its iStart or iEnd.
unsigned mIStartOwner: 4; // owner of iStart border
unsigned mBStartOwner: 4; // owner of bStart border
unsigned mIStartStart: 1; // set if this is the start of a block-dir border segment
unsigned mBStartStart: 1; // set if this is the start of an inline-dir border segment
unsigned mCornerSide: 2; // LogicalSide of the owner of the bStart-iStart corner relative to the corner
unsigned mCornerBevel: 1; // is the corner beveled (only two segments, perpendicular, not dashed or dotted).
};
// BCCellData entries replace CellData entries in the cell map if the border collapsing model is in
// effect. BCData for a row and col entry contains the left and top borders of cell at that row and
// col and the corner connecting the two. The right borders of the cells in the last col and the bottom
// borders of the last row are stored in separate BCData entries in the cell map.
class BCCellData : public CellData
{
public:
explicit BCCellData(nsTableCellFrame* aOrigCell);
~BCCellData();
BCData mData;
};
// The layout of a celldata is as follows. The top 10 bits are the colspan
// offset (which is enough to represent our allowed values 1-1000 for colspan).
// Then there are two bits of flags.
// XXXmats Then one unused bit that we should decide how to use in bug 862624.
// Then 16 bits of rowspan offset (which
// lets us represent numbers up to 65535. Then another 3 bits of flags.
// num bits to shift right to get right aligned col span
#define COL_SPAN_SHIFT 22
// num bits to shift right to get right aligned row span
#define ROW_SPAN_SHIFT 3
// the col offset to the data containing the original cell.
#define COL_SPAN_OFFSET (0x3FF << COL_SPAN_SHIFT)
// the row offset to the data containing the original cell
#define ROW_SPAN_OFFSET (0xFFFF << ROW_SPAN_SHIFT)
// And the flags
#define SPAN 0x00000001 // there a row or col span
#define ROW_SPAN 0x00000002 // there is a row span
#define ROW_SPAN_0 0x00000004 // the row span is 0
#define COL_SPAN (1 << (COL_SPAN_SHIFT - 2)) // there is a col span
#define OVERLAP (1 << (COL_SPAN_SHIFT - 1)) // there is a row span and
// col span but not by
// same cell
inline nsTableCellFrame* CellData::GetCellFrame() const
{
if (SPAN != (SPAN & mBits)) {
return mOrigCell;
}
return nullptr;
}
inline void CellData::Init(nsTableCellFrame* aCellFrame)
{
mOrigCell = aCellFrame;
}
inline bool CellData::IsOrig() const
{
return ((nullptr != mOrigCell) && (SPAN != (SPAN & mBits)));
}
inline bool CellData::IsDead() const
{
return (0 == mBits);
}
inline bool CellData::IsSpan() const
{
return (SPAN == (SPAN & mBits));
}
inline bool CellData::IsRowSpan() const
{
return (SPAN == (SPAN & mBits)) &&
(ROW_SPAN == (ROW_SPAN & mBits));
}
inline bool CellData::IsZeroRowSpan() const
{
return (SPAN == (SPAN & mBits)) &&
(ROW_SPAN == (ROW_SPAN & mBits)) &&
(ROW_SPAN_0 == (ROW_SPAN_0 & mBits));
}
inline void CellData::SetZeroRowSpan(bool aIsZeroSpan)
{
if (SPAN == (SPAN & mBits)) {
if (aIsZeroSpan) {
mBits |= ROW_SPAN_0;
}
else {
mBits &= ~ROW_SPAN_0;
}
}
}
inline uint32_t CellData::GetRowSpanOffset() const
{
if ((SPAN == (SPAN & mBits)) && ((ROW_SPAN == (ROW_SPAN & mBits)))) {
return (uint32_t)((mBits & ROW_SPAN_OFFSET) >> ROW_SPAN_SHIFT);
}
return 0;
}
inline void CellData::SetRowSpanOffset(uint32_t aSpan)
{
mBits &= ~ROW_SPAN_OFFSET;
mBits |= (aSpan << ROW_SPAN_SHIFT);
mBits |= SPAN;
mBits |= ROW_SPAN;
}
inline bool CellData::IsColSpan() const
{
return (SPAN == (SPAN & mBits)) &&
(COL_SPAN == (COL_SPAN & mBits));
}
inline uint32_t CellData::GetColSpanOffset() const
{
if ((SPAN == (SPAN & mBits)) && ((COL_SPAN == (COL_SPAN & mBits)))) {
return (uint32_t)((mBits & COL_SPAN_OFFSET) >> COL_SPAN_SHIFT);
}
return 0;
}
inline void CellData::SetColSpanOffset(uint32_t aSpan)
{
mBits &= ~COL_SPAN_OFFSET;
mBits |= (aSpan << COL_SPAN_SHIFT);
mBits |= SPAN;
mBits |= COL_SPAN;
}
inline bool CellData::IsOverlap() const
{
return (SPAN == (SPAN & mBits)) && (OVERLAP == (OVERLAP & mBits));
}
inline void CellData::SetOverlap(bool aOverlap)
{
if (SPAN == (SPAN & mBits)) {
if (aOverlap) {
mBits |= OVERLAP;
}
else {
mBits &= ~OVERLAP;
}
}
}
inline BCData::BCData()
{
mIStartOwner = mBStartOwner = eCellOwner;
mIStartStart = mBStartStart = 1;
mIStartSize = mCornerSubSize = mBStartSize = 0;
mCornerSide = mozilla::eLogicalSideBStart;
mCornerBevel = false;
}
inline BCData::~BCData()
{
}
inline nscoord BCData::GetIStartEdge(BCBorderOwner& aOwner,
bool& aStart) const
{
aOwner = (BCBorderOwner)mIStartOwner;
aStart = (bool)mIStartStart;
return (nscoord)mIStartSize;
}
inline void BCData::SetIStartEdge(BCBorderOwner aOwner,
nscoord aSize,
bool aStart)
{
mIStartOwner = aOwner;
mIStartSize = (aSize > MAX_BORDER_WIDTH) ? MAX_BORDER_WIDTH : aSize;
mIStartStart = aStart;
}
inline nscoord BCData::GetBStartEdge(BCBorderOwner& aOwner,
bool& aStart) const
{
aOwner = (BCBorderOwner)mBStartOwner;
aStart = (bool)mBStartStart;
return (nscoord)mBStartSize;
}
inline void BCData::SetBStartEdge(BCBorderOwner aOwner,
nscoord aSize,
bool aStart)
{
mBStartOwner = aOwner;
mBStartSize = (aSize > MAX_BORDER_WIDTH) ? MAX_BORDER_WIDTH : aSize;
mBStartStart = aStart;
}
inline BCPixelSize BCData::GetCorner(mozilla::LogicalSide& aOwnerSide,
bool& aBevel) const
{
aOwnerSide = mozilla::LogicalSide(mCornerSide);
aBevel = (bool)mCornerBevel;
return mCornerSubSize;
}
inline void BCData::SetCorner(BCPixelSize aSubSize,
mozilla::LogicalSide aOwnerSide,
bool aBevel)
{
mCornerSubSize = aSubSize;
mCornerSide = aOwnerSide;
mCornerBevel = aBevel;
}
inline bool BCData::IsIStartStart() const
{
return (bool)mIStartStart;
}
inline void BCData::SetIStartStart(bool aValue)
{
mIStartStart = aValue;
}
inline bool BCData::IsBStartStart() const
{
return (bool)mBStartStart;
}
inline void BCData::SetBStartStart(bool aValue)
{
mBStartStart = aValue;
}
#endif

View file

@ -0,0 +1,24 @@
<!DOCTYPE html>
<html class="reftest-print">
<head>
<style>
thead {
position: relative;
}
tr {
height: 60px;
}
</style>
</head>
<body>
<table>
<thead>
<tr></tr>
</thead>
<tbody>
<tr></tr>
<tr></tr>
</tbody>
</table>
</body>
</html>

View file

@ -0,0 +1,18 @@
<html>
<head>
</head>
<body>
<table>
<tbody style="visibility: collapse;">
<tr><td hidden=""></td></tr>
</tbody>
</table>
<table>
<tbody>
<tr style="visibility: collapse;"><td hidden=""></td></tr>
</tbody>
</table>
</body>
</html>

View file

@ -0,0 +1,45 @@
<html>
<head>
<title></title>
<script type="text/javascript">
function toggle(b) {
var adv = document.getElementById("it_guru");
var ns = 'none';
if (b) {
ns= "table-row";
}
adv.style.display = ns;
}
function boom()
{
toggle(true);
document.documentElement.offsetHeight;
toggle(false);
document.documentElement.offsetHeight;
toggle(true);
document.documentElement.offsetHeight;
toggle(false);
document.documentElement.offsetHeight;
}
</script></head><body onload="boom();">
<form action="http://localhost/">
<table>
<tbody>
<tr>
<td>Without the &lt;tbody&gt; tags Mozilla doesn't crash
</td>
</tr>
</tbody>
<tr id="it_guru">
<td>I disappear
</td>
</tr>
<tr>
<td>Without this row Mozilla doesn't crash
</td>
</tr>
</table>
</form>
</body>
</html>

View file

@ -0,0 +1,25 @@
<!DOCTYPE html>
<html>
<head>
<script>
function boom()
{
row1.style.textAlign = "left";
}
</script>
</head>
<body onload="boom();">
<table>
<tbody>
<tr id="row1"></tr>
<tr>
<td style="position: sticky;"></td>
</tr>
</tbody>
</table>
</body>
</html>

View file

@ -0,0 +1,6 @@
<!DOCTYPE html>
<html>
<body>
<div style="border-style: dotted; position: sticky; display: table-row;"><input style="width: 400px; position: absolute;"></div>
</body>
</html>

View file

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
</head>
<body>
<div style="display: table-caption; margin-left: 20000%;"></div>
</body>
</html>

View file

@ -0,0 +1,27 @@
<!DOCTYPE html>
<html>
<style>
p {
writing-mode:tb;
float:right;
font-size:2000px;
}
#bb {
position:sticky;
display:table-footer-group;
}
#dd {
transition:2s ease-in;
}
</style>
<body>
<div id="dd"></div>
<div id="bb">
<p>grilling it up
</div>
</body>
<script>
document.body.offsetTop;
dd.style.marginTop = "100px";
</script>
</html>

View file

@ -0,0 +1,32 @@
<html>
<body>
<table>
<tr>
<td>
<span>
<span>
<head>
<title></title>
</head>
<table>
<tr>
<td>
<table align="left">
<tr>
<td>
<form>
<input type="submit" value="ApplyForThisPosition">
</form>
</td>
</tr>
</table>
</td>
</tr>
</table>
</span>
</span>
</td>
</tr>
</table>
</body>
</html>

View file

@ -0,0 +1,13 @@
<html>
<head>
<title>Crash test</title>
</head>
<body>
<table style="position: fixed; top: 0px;"> <!-- Crashes Mozilla -->
<tr>
<form>
</form>
</tr>
</table>
</body>
</html>

View file

@ -0,0 +1,19 @@
<html>
<head>
<title>bug</title>
</head>
<body>
<table>
<tr>
</tr>
<tr>
<form>
<input name="url" size="20" type="text">
</form>
</tr>
</table>
</body>
</html>

View file

@ -0,0 +1,3 @@
<form method="post">
<table><tr><td><input type="browse"></td></tr></table>
</form>

View file

@ -0,0 +1,10 @@
<html>
<head><title>bug 197015</title></head>
<body>
<table>
<!-- The "htp" typo is an essential part of this testcase. -->
<link rel="stylesheet" type="text/css" href="htp://www.mozilla.org/foo.css">
foo
</table>
</body>
</html>

View file

@ -0,0 +1,93 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Essai</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript" language="javascript">
function remove_col2() {
var colp = document.getElementById("colp");
var c4= document.getElementById("c4");
colp.colSpan=0;
colp.style.display="none";
c4.style.display="none";
}
function remove_col() {
var tr1 = document.getElementById("tr1");
var tr2 = document.getElementById("tr2");
var tr3 = document.getElementById("tr3");
var colp = document.getElementById("colp");
var c1 = document.getElementById("c1");
var c2 = document.getElementById("c2");
var c3 = document.getElementById("c3");
var c4= document.getElementById("c4");
c1.style.display="none";
colp.colSpan=1;
c3.style.display="none";
c2.style.display="none";
document.documentElement.offsetHeight;
remove_col2();
}
</script>
</head>
<body onload="remove_col()">
<table border="1" id="t_0">
<thead>
<tr id="tr1">
<th rowspan="2">aaaa</th>
<th rowspan="2">bbbb</th>
<th colspan="2" id ="colp">cccc</th>
<th rowspan="2">dddd</th>
</tr>
<tr id="tr2">
<th id="c1">eeee</th>
<th id="c2">ffff</th>
</tr>
</thead>
<tbody>
<tr id="tr3">
<td>1111</td>
<td>2222</td>
<td id="c3">3333</td>
<td id="c4">4444</td>
<td>5555</td>
</tr>
</tbody>
</table>
</body>
</html>

View file

@ -0,0 +1,25 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>bug 223458</title>
<body>
<table style="margin-bottom: 1em; border: 1px solid red; border-collapse:collapse;">
<tr><td>mod_ssl</td></tr>
<tr><td>mod_ssl</td></tr>
<tr><td>mod_ssl</td></tr>
<tr><td>mod_ssl</td></tr>
<tr><td>mod_ssl</td></tr>
<tr><td>mod_ssl</td></tr>
<tr><td>mod_ssl</td></tr>
<tr><td>mod_ssl</td></tr>
<tr><td>mod_ssl</td></tr>
<tr><td>mod_ssl</td></tr>
<tr><td>mod_ssl</td></tr>
<tr><td>mod_ssl</td></tr>
<tr><td>mod_ssl</td></tr>
<tr><td>mod_ssl</td></tr>
<tr><td>mod_ssl</td></tr>
<tr><td>mod_ssl</td></tr>
</table>
</body>
</html>

View file

@ -0,0 +1,16 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<title>bug 237421: test1</title>
</head>
<body>
<table>
<tr id="foo"><td></td></tr>
<tr><td colspan="2"></td></tr>
</table>
<script>
document.getElementById("foo").style.display="table-row";
document.getElementById("foo").style.display="none";
</script>
</body>
</html>

View file

@ -0,0 +1,47 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en" class="reftest-wait">
<head>
<title>bug 237421: test2a</title>
<script type="text/javascript">
function remove_second_row() {
var r2 = document.getElementById("row2");
r2.style.display ="none";
setTimeout('remove_first_row()', 10);
}
function remove_first_row() {
var r1 = document.getElementById("row1");
r1.style.display ="none";
document.documentElement.removeAttribute("class");
}
</script>
</head>
<body onload="setTimeout( 'remove_second_row()', 10)">
<table border>
<tr id="row1"><td rowspan="3">a</td><td rowspan="3">b</td></tr>
<tr id="row2"></tr>
<tr></tr>
<tr><td>c</td></tr>
</table>
</body>
</html>

View file

@ -0,0 +1,8 @@
<html>
<head>
<title>bug 238909</title>
</head>
<body>
<table style="border-collapse: collapse;" width="100" height="100"></table>
</body>
</html>

View file

@ -0,0 +1,38 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
<title>Watch Mozilla Go Boom</title>
</head>
<body>
<!--
To make mozilla render this properly, take out the "display: inline"
style, or take out the colgroup - getting rid of either makes
everything work fine!!!
-->
<table style="display: inline">
<col></col>
<colgroup span="12"></colgroup>
<tr>
<th>Year</th>
<th colspan="12">Month</th>
</tr><tr>
<td>2001</td>
<td colspan="8">&nbsp;</td>
<td>Sep</td>
<td>Oct</td>
<td>Nov</td>
<td>Dec</td>
</tr><tr>
<td>2002</td>
<td>Jan</td>
<td>Feb</td>
<td>Mar</td>
<td colspan="9">&nbsp;</td>
</tr></table>
</body></html>

View file

@ -0,0 +1,40 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<title>Table dom Column Handling crash</title>
<SCRIPT>
function doIt() {
var t = document.getElementById('t1');
var c1 =document.getElementById('col2');
t.removeChild(c1);
}
</SCRIPT>
</HEAD>
<BODY onload="doIt()">
The 2 tables should look the same
<table id="t1" bgcolor=orange border>
<col width=100>
<col width=200>
<col id="col2" width=300>
<tr>
<td>100</td><td>200</td><td>auto</td>
</tr>
</table>
<BR>
<table bgcolor=orange border>
<col width=100>
<col width=200>
<tr>
<td>100</td><td>200</td><td>auto</td>
</tr>
</table>
</BODY>
</HTML>

View file

@ -0,0 +1,18 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head>
<meta http-equiv="Content-type" content="text/html; charset=ISO-8859-1">
<title>col crash 1</title><style type="text/css">
#table { display: table}
#col {display: table-column}
</style></head>
<body>
<div id="table">
<div id="col">
</div>
<div>this text should be visible</div>
</div></body></html>

View file

@ -0,0 +1,122 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en-US" class="reftest-wait">
<head>
<title>Testcase, bug 174470</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css">
table {
border-collapse: collapse;
margin: 1em;
border: thick solid;
border-color: #f0f #c0c #909 #606; /* purple */
}
colgroup:first-child + colgroup {
border: thick solid;
border-color: #f66 #f00 #a00 #600; /* red */
}
colgroup:first-child + colgroup + colgroup > col:first-child + col {
border: thick solid;
border-color: #ff0 #cc0 #990 #660; /* yellow */
}
colgroup + tbody + tbody {
border: thick solid;
border-color: #6f6 #0f0 #0a0 #060; /* green */
}
colgroup + tbody > tr:first-child + tr {
border: thick solid;
border-color: #0ff #0cc #099 #066; /* aqua */
}
colgroup + tbody + tbody + tbody > tr:first-child + tr > td:first-child + td {
border: thick solid;
border-color: #66f #00f #00a #006; /* blue */
}
</style>
<script>
function doTest() {
var s1 = document.getElementById("screen");
s1.parentNode.removeChild(s1);
document.documentElement.removeAttribute('class');
}
document.addEventListener("MozReftestInvalidate", doTest, false);
</script>
</head>
<body>
<div id="screen" style="position: fixed; left:50px; height:200px; width: 200px; background-color:white; border:1px solid green;"></div>
<p>The following two tables should be mirrors of each other, except that
(1) the digits should still be normal left-to-right digits and (2) the
color changes for each of the 6 colors should, in both, be lightest on top
clockwise to darkest on the left.</p>
<table dir="ltr" >
<colgroup>
<col>
</colgroup>
<colgroup>
<col>
<col>
</colgroup>
<colgroup>
<col>
<col>
<col>
</colgroup>
<tbody>
<tr><td>1</td><td>22</td><td>333</td><td>4444</td><td>55555</td><td>666666</td></tr>
<tr><td>1</td><td>22</td><td>333</td><td>4444</td><td>55555</td><td>666666</td></tr>
<tr><td>1</td><td>22</td><td>333</td><td>4444</td><td>55555</td><td>666666</td></tr>
</tbody>
<tbody>
<tr><td>1</td><td>22</td><td>333</td><td>4444</td><td>55555</td><td>666666</td></tr>
<tr><td>1</td><td>22</td><td>333</td><td>4444</td><td>55555</td><td>666666</td></tr>
<tr><td>1</td><td>22</td><td>333</td><td>4444</td><td>55555</td><td>666666</td></tr>
</tbody>
<tbody>
<tr><td>1</td><td>22</td><td>333</td><td>4444</td><td>55555</td><td>666666</td></tr>
<tr><td>1</td><td>22</td><td>333</td><td>4444</td><td>55555</td><td>666666</td></tr>
<tr><td>1</td><td>22</td><td>333</td><td>4444</td><td>55555</td><td>666666</td></tr>
</tbody>
</table>
<table dir="rtl">
<colgroup>
<col>
</colgroup>
<colgroup>
<col>
<col>
</colgroup>
<colgroup>
<col>
<col>
<col>
</colgroup>
<tbody>
<tr><td>1</td><td>22</td><td>333</td><td>4444</td><td>55555</td><td>666666</td></tr>
<tr><td>1</td><td>22</td><td>333</td><td>4444</td><td>55555</td><td>666666</td></tr>
<tr><td>1</td><td>22</td><td>333</td><td>4444</td><td>55555</td><td>666666</td></tr>
</tbody>
<tbody>
<tr><td>1</td><td>22</td><td>333</td><td>4444</td><td>55555</td><td>666666</td></tr>
<tr><td>1</td><td>22</td><td>333</td><td>4444</td><td>55555</td><td>666666</td></tr>
<tr><td>1</td><td>22</td><td>333</td><td>4444</td><td>55555</td><td>666666</td></tr>
</tbody>
<tbody>
<tr><td>1</td><td>22</td><td>333</td><td>4444</td><td>55555</td><td>666666</td></tr>
<tr><td>1</td><td>22</td><td>333</td><td>4444</td><td>55555</td><td>666666</td></tr>
<tr><td>1</td><td>22</td><td>333</td><td>4444</td><td>55555</td><td>666666</td></tr>
</tbody>
</table>
</body>
</html>

View file

@ -0,0 +1,8 @@
<html><head><title>Testcase bug 275625 - Crash with a:hover, a:hover+br{display:table-row;}</title>
<style>
a:hover, a:hover+br{display:table-row;}
</style>
</head>
<body>
<a href="#">Hovering over the link should not crash Mozilla</a><br>
</body></html>

View file

@ -0,0 +1,4 @@
<html>
<body>
<TABLE><bla><TD><TD><COLGROUP></COLGROUP><COLGROUP></COLGROUP>

View file

@ -0,0 +1,25 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<title>Firefox Test</title>
</head>
<body>
<table border=1>
<tr>
<th>
<td>
<p>TWO</p>
</td>
<title>Firefox Test</title>
</tr>
<col>
<tr>
<td>
<p>ONE</p>
</td>
</tr>
<col>
</table>
</body>
</html>

View file

@ -0,0 +1,26 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>bug 282175</title>
<script type="text/javascript">
function modifyPosition2()
{
document.getElementById("table").style.position = "inherit";
document.body.offsetHeight;
document.getElementById("tr").style.position = "inherit";
document.getElementById("table").style.position = "fixed";
document.body.offsetHeight;
document.getElementById("table").style.position = "inherit";
}
</script>
</head>
<body onload="modifyPosition2()">
<table style="position: fixed" id="table">
<tbody style="position: inherit">
<tr style="position: fixed" id="tr">
<td>0.2 miles</td>
</tr>
</tbody>
</table>
</body>
</html>

View file

@ -0,0 +1,13 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<title>Testcase for bug 284844</title>
</head>
<body>
<table style="height:100px; width:100px; background:lime" border="0" cellspacing="0" cellpadding="0">
<tr><td style="background:red" ></td></tr>
</table>
</body>
</html>

View file

@ -0,0 +1,130 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Testcase for bug 284852</title>
<style type="text/css">
table {
border-collapse: collapse;
border:3px dashed blue;
}
td {
border:3px dotted black;
}
</style>
<script>
function insertCell(id,rowspan) {
var tr = document.getElementById(id);
var td = document.createElement('td');
td.setAttribute('rowspan',rowspan);
tr.insertBefore(td,tr.firstChild)
}
</script>
</head>
<body>
<table>
<tbody>
<tr><td>g1row1</td></tr>
<tr><td>g1row2</td></tr>
<tr><td>g1row3</td></tr>
</tbody>
<tbody>
<tr><td>g2row1</td></tr>
<tr><td>g2row2</td></tr>
<tr><td>g2row3</td></tr>
<tr id="r1"><td rowspan="0">g2row4</td></tr>
</tbody>
</table>
<script>
insertCell('r1','0');
insertCell('r1','0');
insertCell('r1','0');
insertCell('r1','0');
insertCell('r1','0');
insertCell('r1','0');
insertCell('r1','0');
insertCell('r1','0');
insertCell('r1','0');
insertCell('r1','0');
</script>
<button onclick="insertCell('r1','0')">insert cell</button>
<pre>
Clicking the button above five times or more gives:
###!!! ASSERTION: invalid BC damage area: 'PR_FALSE', file nsTableFrame.cpp, line 4567
</pre>
<table>
<tbody>
<tr><td>g1row1</td></tr>
<tr><td>g1row2</td></tr>
<tr><td>g1row3</td></tr>
</tbody>
<tbody>
<tr><td>g2row1</td></tr>
<tr><td>g2row2</td></tr>
<tr><td>g2row3</td></tr>
<tr id="r2"><td rowspan="2">g2row4</td></tr>
</tbody>
</table>
<script>
insertCell('r2','2');
insertCell('r2','2');
insertCell('r2','2');
insertCell('r2','2');
insertCell('r2','2');
insertCell('r2','2');
insertCell('r2','2');
insertCell('r2','2');
insertCell('r2','2');
insertCell('r2','2');
</script>
<button onclick="insertCell('r2','2')">insert cell</button>
<pre>
Clicking the button gives:
###!!! ASSERTION: invalid BC damage area: 'PR_FALSE', file nsTableFrame.cpp, line 4567
</pre>
<table>
<tbody>
<tr><td>g1row1</td></tr>
<tr><td>g1row2</td></tr>
<tr><td>g1row3</td></tr>
</tbody>
<tbody>
<tr><td>g2row1</td></tr>
<tr><td>g2row2</td></tr>
<tr><td>g2row3</td></tr>
<tr id="r3"></tr>
</tbody>
</table>
<script>
insertCell('r3','0');
insertCell('r3','0');
insertCell('r3','0');
insertCell('r3','0');
insertCell('r3','0');
insertCell('r3','0');
insertCell('r3','0');
insertCell('r3','0');
insertCell('r3','0');
insertCell('r3','0');
</script>
<button onclick="insertCell('r3','0')">insert cell</button>
<pre>
Clicking the button the first time gives:
###!!! ASSERTION: invalid BC damage area: 'PR_FALSE', file nsTableFrame.cpp, line 4567
</pre>
</body>
</html>

View file

@ -0,0 +1,10 @@
<title>test</title>
<table style='border-collapse:collapse;'>
<tr>
<td rowspan=2></td>
</tr>
<tr>
<td></td>
</tr>
</table>

View file

@ -0,0 +1,28 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>test</TITLE>
</HEAD>
<BODY>
<TABLE BORDER=1 ID="TABLE1">
<TR><TD>cell data</TD><TD>cell data</TD></TR>
<TR><TD>cell data</TD><TD>cell data</TD></TR>
<TR><TD>cell data</TD><TD>cell data</TD></TR>
</TABLE>
<SCRIPT TYPE="text/javascript">
var t=document.getElementById("TABLE1");
document.write(t);
t.createCaption();
</SCRIPT>
</BODY>
</HTML>

View file

@ -0,0 +1,19 @@
<html>
<head><title>Testcase for assertion</title></head>
<body>
<table>
<tr>
<td width="367" colSpan="2">
<table width="100%">
<tr>
<td>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>

View file

@ -0,0 +1,43 @@
<html>
<head>
<script>
function init2() {
var one = document.getElementById('one');
var two = document.getElementById('two');
var three = document.getElementById('three');
var four = document.getElementById('four');
four.appendChild(two);
document.getElementsByTagName('tbody')[0].appendChild(three);
four.appendChild(three);
one.appendChild(four);
document.getElementsByTagName('table')[0].appendChild(one);
setTimeout('clickit()', 0);
}
function doe(){
four.parentNode.removeChild(four);
}
function clickit()
{
var evt = document.createEvent("MouseEvents");
evt.initMouseEvent("click", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
document.body.dispatchEvent(evt);
}
window.addEventListener("load", init2, 0);
window.addEventListener("click", doe, 0);
</script>
</head>
<body>
<table style="border-collapse: collapse;"><tbody>
<tr> <td rowspan="5">P</td> <td id="three">6</td> <td>O</td> </tr>
<tr> <td id="four">5</td> <td>P</td> </tr>
<tr id="five"> <td>5</td> <td>U</td> </tr>
<tr id="one"> <td>6</td> <td>S</td> </tr>
<tr id="two"> <td>S</td> <td>9</td> </tr>
</tbody></table>
Mozilla should not crash when clicking in the document
</body></html>

View file

@ -0,0 +1,9 @@
<html class="reftest-wait">
<head>
<script>
setTimeout('document.documentElement.className = ""', 500);
</script>
<body>
<iframe src="308752-1-inner.html"></iframe>
</body>
</html>

View file

@ -0,0 +1,35 @@
<html>
<head>
<script>
function init2() {
var one = document.getElementById('one');
var four = document.getElementById('two');
document.getElementsByTagName('table')[0].appendChild(one);
setTimeout('clickit()', 0);
}
function doe(){
two.parentNode.removeChild(two);
}
function clickit()
{
var evt = document.createEvent("MouseEvents");
evt.initMouseEvent("click", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
document.body.dispatchEvent(evt);
}
window.addEventListener("load", init2, 0);
window.addEventListener("click", doe, 0);
</script>
</head>
<body>
<table style="border-collapse: collapse;">
<tbody>
<tr><td rowspan="2">r11</td></tr>
<tr id="one"><td id="two">r21</td></tr>
<tr></tr>
</tbody>
</table>
Mozilla should not crash when clicking in the document
</body>
</html>

View file

@ -0,0 +1,9 @@
<html class="reftest-wait">
<head>
<script>
setTimeout('document.documentElement.className = ""', 500);
</script>
<body>
<iframe src="308752-2-inner.html"></iframe>
</body>
</html>

View file

@ -0,0 +1,19 @@
<!doctype html public "-//w3c//dtd html 3.2//en">
<html>
<head>
<title>(Type a title for your page here)</title>
<meta name="GENERATOR" content="Arachnophilia 4.0">
<meta name="FORMATTER" content="Arachnophilia 4.0">
</head>
<body bgcolor="#ffffff" text="#000000" link="#0000ff" vlink="#800080" alink="#ff0000">
<table border>
<tr><td rowspan="2">foo</td><td>bar</td><td>zap</td></tr>
<tr style="visibility:collapse"><td colspan="2">boom</td></tr>
</table>
</body>
</html>

View file

@ -0,0 +1,16 @@
<HTML>
<HEAD>
<title>Testcase bug 317876 - Crash with evil testcase on hovering after reload with display:table-row, display:inherit</title>
</HEAD>
<BODY>
<div onmouseover="this.removeAttribute('style')" style="width: 20px; height: 30px;">
<div style="display: table-row;">
<span style="display: table-row;">
</span>
<span style="display: inherit;">
Hovering over this should not crash Mozilla
</span>
</div>
</div>
</BODY>
</HTML>

View file

@ -0,0 +1,8 @@
<?xml version="1.0"?>
<window xmlns:html="http://www.w3.org/1999/xhtml" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<html:table>
<scrollbar height="656119391080747862" />
</html:table>
</window>

View file

@ -0,0 +1,22 @@
<html>
<head>
<style type="text/css">
body {
overflow: auto;
display: -moz-stack;
}
</style>
</head>
<body>
<table><tbody><tr><td>Cell</td></tr></tbody></table>
</body>
</html>

View file

@ -0,0 +1,10 @@
<script> function init() {
document.getElementById("three").appendChild(document.getElementById("two"))
setTimeout(function(){
document.getElementById("two").appendChild(document.getElementById("one"))
}, 200);
} window.addEventListener("load", init, 0); </script>
<table style="border-collapse: collapse;" border="1"><tr><td id="one">1</td><td id="two">2</td></tr><tr><td id="three">3</td><td>4</td></tr></table>

View file

@ -0,0 +1,43 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script>
var HTML_NS = "http://www.w3.org/1999/xhtml";
function foo() {
var table = document.getElementById("table");
var newRow = document.createElementNS(HTML_NS, 'tr');
table.insertBefore(newRow, document.getElementById('lastrow'));
}
doc = document;
</script>
</head>
<body onload="setTimeout(foo, 300);">
<h3>Tables</h3>
<table id="table" border="1" style="border-collapse: collapse">
<tr>
<col></col>
<td rowspan="2">TD</td>
</tr>
<tr id="lastrow">
<td width="50%">TD</td>
</tr>
</table>
</body>
</html>

View file

@ -0,0 +1,13 @@
<html>
<body>
<TABLE STYLE="position: absolute;">
<FORM>
<TR>
<TD> Test
</TR>
</TABLE>
</FORM>
</body>

View file

@ -0,0 +1,11 @@
<html>
<body>
<div style="direction: rtl;">
<table> <tr> <td colspan="3">A</td> </tr>
<tr style="visibility: collapse;"> <td>B</td> </tr>
</table>
</div>
</body>
</html>

View file

@ -0,0 +1,42 @@
<html xmlns="http://www.w3.org/1999/xhtml" class="reftest-wait">
<head>
<style id="styles"></style>
<script>
window.addEventListener("load", f1, false);
function f1()
{
document.getElementById("div2").setAttribute("style", "position: absolute;");
document.getElementById("table").setAttribute("style", "width: 200%;");
setTimeout(f2, 30);
}
function f2()
{
document.getElementById("styles").textContent = ".thisMatchesNothing { }";
document.documentElement.removeAttribute("class");
}
</script>
</head>
<body style="position: relative; -moz-column-width: 1px;">
<table id="table">
<tr>
<td>Table</td>
</tr>
</table>
<div>A</div>
<div id="div2">B</div>
<div style="display: table; width: 200%;">C</div>
</body>
</html>

View file

@ -0,0 +1,38 @@
<html class="reftest-wait">
<head>
<style id="s"></style>
<script>
window.addEventListener("load", f1, false);
function f1()
{
document.getElementsByTagName('head')[0].style.display = "table-row-group";
setTimeout(f2, 30);
}
function f2()
{
document.body.style.display = "table-caption";
setTimeout(f3, 30);
}
function f3()
{
document.body.style.display = "table-column-group";
document.getElementById('s').textContent += "body { }";
document.documentElement.removeAttribute("class");
}
</script>
</head>
<body>
<span style="position: absolute">f</span>
</body>
</html>

View file

@ -0,0 +1,37 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<script>
function boom()
{
var table = document.getElementById("table");
table.insertBefore(document.createElement("thead"), document.getElementById("A"));
var tb2 = document.createElement("tfoot");
var tr1 = document.createElement("tr");
tb2.appendChild(tr1);
table.appendChild(tb2);
var tr = document.createElement("tr");
var td = document.createElement("td");
td.appendChild(document.createTextNode("td"));
td.setAttribute("rowspan", 0);
tr.appendChild(td);
document.getElementById("B").appendChild(tr);
}
</script>
</head>
<body onload="boom();">
<table id="table">
<tfoot id="A"><tr><td>td</td></tr></tfoot>
<tfoot id="B"><tr><td>td</td></tr></tfoot>
<thead></thead>
</table>
</body>
</html>

View file

@ -0,0 +1,32 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<script>
function boom()
{
var doomed = document.getElementById("doomed");
doomed.parentNode.removeChild(doomed);
}
</script>
</head>
<body onload="boom();">
<table>
<tr style="visibility: collapse;">
<td>td</td>
</tr>
<tr>
<td id="doomed">td</td>
<td rowspan="0" colspan="0">td</td>
</tr>
<tr>
<td>td</td>
</tr>
</table>
</body>
</html>

View file

@ -0,0 +1,38 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<script>
function boom() {
var table = document.getElementById("table");
var doomed = document.getElementById("doomed");
doomed.parentNode.removeChild(doomed);
var colgroup1 = document.createElement("colgroup");
table.appendChild(colgroup1);
var thead = document.createElement("thead");
var tr = document.createElement("tr");
var td = document.createElement("td");
td.setAttribute("colspan", 0);
tr.appendChild(td);
thead.appendChild(tr);
table.insertBefore(thead, colgroup1);
colgroup1.parentNode.removeChild(colgroup1);
var colgroup2 = document.createElement("colgroup");
table.appendChild(colgroup2);
}
</script>
</head>
<body onload="boom();">
<table id="table"><tbody><tr id="doomed"><td>x</tr></tbody></table>
</body>
</html>

View file

@ -0,0 +1,30 @@
<html xmlns="http://www.w3.org/1999/xhtml" class="reftest-wait">
<head>
<script>
function boom()
{
var table = document.getElementById('table');
var newTR = document.createElement('tr');
var newTD = document.createElement('td');
newTR.appendChild(newTD);
table.appendChild(newTR);
newTD.setAttribute('rowspan', 3);
document.documentElement.removeAttribute("class");
}
</script>
</head>
<body onload="setTimeout(boom, 30);">
<table id="table"><tr><td></td><td></td></tr></table>
</body>
</html>

View file

@ -0,0 +1,40 @@
<!doctype html public "-//w3c//dtd html 3.2//en">
<html>
<head>
<title>testcase</title>
<script>
function doit()
{
var doc = window.document;
var t1 = doc.getElementById('table1');
var tb = doc.createElement('tfoot');
var tr = doc.createElement('tr');
tb.appendChild(tr);
t1.appendChild(tb);
var tb = doc.createElement('tfoot');
var tr = doc.createElement('tr');
tb.appendChild(tr);
t1.appendChild(tb);
var tb = doc.createElement('tfoot');
var td = doc.createElement('td');
tr.appendChild(td);
tb.appendChild(tr);
t1.insertBefore(tb, doc.getElementById("colg1"));
tr.parentNode.removeChild(tr);
}
</script>
</head>
<body onload="doit()">
<table id="table1"><tbody id="tbody1"><tr id="tr1"><td id="td1">x</td></tr></tbody><colgroup id ="colg1"></table>
</body>
</html>

View file

@ -0,0 +1,35 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script>
function boo()
{
document.getElementById("td46").setAttribute("rowspan", 3);
document.getElementById("tbody6").appendChild(document.createTextNode('X'));
}
window.addEventListener("load", boo, false);
</script>
</head>
<body>
<table border="1">
<tbody id="tbody6">
<tr id="tr7">
<td>A</td>
<td>B</td>
Y
</tr>
<tr>
<td>C</td>
<td id="td46">D</td>
</tr>
</tbody>
</table>
</body>
</html>

View file

@ -0,0 +1,45 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>dom cellmap crash</title>
<script>
function doit()
{
var doc = window.document;
var t1= doc.getElementById('table1');
var tbA = doc.createElement('tbody');
t1.appendChild(tbA);
var trA = doc.createElement('tr');
var td = doc.createElement('td');
td.setAttribute('rowspan', 2);
trA.appendChild(td);
tbA.appendChild(trA);
var trB = doc.createElement('tr');
var tdB = doc.createElement('td');
tdB.setAttribute('rowspan', 2);
trB.appendChild(tdB);
tbA.appendChild(trB);
tdB.parentNode.removeChild(tdB);
trA.parentNode.removeChild(trA);
trB.parentNode.removeChild(trB);
var tb = doc.createElement('tbody');
trB.appendChild(tdB);
tb.appendChild(trB);
t1.appendChild(tb);
}
</script>
</head>
<body onload="doit()">
<table id="table1"><tbody id="tbody1"><tr id="tr1"><td id="td1">x</td></tr></tbody></table>
</body>
</html>

View file

@ -0,0 +1,78 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" class="reftest-print"><head>
<title>Testcase bug 347367 - crash when print preview is opened on a certain file styled with meda=print [@ BasicTableLayoutStrategy::CalcPctAdjTableWidth]</title>
<style>
div.page
{
float:left;
clear:both;
}
table.display td
{
width:50%;
}
</style>
</head><body>
<div id="display_container">
<div class="page"><table class="display" border="0" rules="cols">
<tbody><tr><th colspan="2"><h2>Customer Information</h2></th></tr>
<tr><td>Company Name</td><td>TenSen.net</td></tr>
<tr><td>Address</td><td>208</td></tr>
<tr><td>City</td><td>Carthage</td></tr>
<tr><td>State</td><td>TX</td></tr>
<tr><td>Zipcode</td><td>75633</td></tr>
<tr><td>Contact Name</td><td>Dakota</td></tr>
<tr><td>Phone Number</td><td>9032353248</td></tr>
<tr><td>Email Address</td><td>dakota@tensen.net</td></tr>
<tr><td>Customer Information Additional Notes</td><td>This is a rather long "additional notes" field, just a test to see what will happen on the display page.</td></tr>
</tbody></table></div>
<div class="page"><table class="display" border="0" rules="cols">
<tbody><tr><th colspan="2"><h2>Customer Information</h2></th></tr>
<tr><td>Company Name</td><td>TenSen.net</td></tr>
<tr><td>Address</td><td>208</td></tr>
<tr><td>City</td><td>Carthage</td></tr>
<tr><td>State</td><td>TX</td></tr>
<tr><td>Zipcode</td><td>75633</td></tr>
<tr><td>Contact Name</td><td>Dakota</td></tr>
<tr><td>Phone Number</td><td>9032353248</td></tr>
<tr><td>Email Address</td><td>dakota@tensen.net</td></tr>
<tr><td>Customer Information Additional Notes</td><td>This is a rather long "additional notes" field, just a test to see what will happen on the display page.</td></tr>
</tbody></table></div>
<div class="page"><table class="display" border="0" rules="cols">
<tbody><tr><th colspan="2"><h2>Customer Information</h2></th></tr>
<tr><td>Company Name</td><td>TenSen.net</td></tr>
<tr><td>Address</td><td>208</td></tr>
<tr><td>City</td><td>Carthage</td></tr>
<tr><td>State</td><td>TX</td></tr>
<tr><td>Zipcode</td><td>75633</td></tr>
<tr><td>Contact Name</td><td>Dakota</td></tr>
<tr><td>Phone Number</td><td>9032353248</td></tr>
<tr><td>Email Address</td><td>dakota@tensen.net</td></tr>
<tr><td>Customer Information Additional Notes</td><td>This is a rather long "additional notes" field, just a test to see what will happen on the display page.</td></tr>
</tbody></table></div>
<div class="page"><table class="display" border="0" rules="cols">
<tbody><tr><th colspan="2"><h2>Customer Information</h2></th></tr>
<tr><td>Company Name</td><td>TenSen.net</td></tr>
<tr><td>Address</td><td>208</td></tr>
<tr><td>City</td><td>Carthage</td></tr>
<tr><td>State</td><td>TX</td></tr>
<tr><td>Zipcode</td><td>75633</td></tr>
<tr><td>Contact Name</td><td>Dakota</td></tr>
<tr><td>Phone Number</td><td>9032353248</td></tr>
<tr><td>Email Address</td><td>dakota@tensen.net</td></tr>
<tr><td>Customer Information Additional Notes</td><td>This is a rather long "additional notes" field, just a test to see what will happen on the display page.</td></tr>
</tbody></table></div>
</div>
</body></html>

View file

@ -0,0 +1,23 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<body>
<div><math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mtable>
<mtr>
<mtd><mi>x</mi></mtd>
<mtd rowspan="4" columnspan="4"><mi>y</mi></mtd>
</mtr>
<mtr>
<mtd rowspan="0" columnspan="0"><mi>z</mi></mtd>
<mtd><mi>w</mi></mtd>
</mtr>
</mtable>
</math></div>
</body>
</html>

View file

@ -0,0 +1,14 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<body>
<table>
<tr>
<td>x</td>
<td rowspan="4" colspan="4">y</td>
</tr>
<tr>
<td rowspan="0" colspan="0">z</td>
<td>w</td>
</tr>
</table>
</body>
</html>

View file

@ -0,0 +1,39 @@
<html xmlns="http://www.w3.org/1999/xhtml" class="reftest-wait">
<head>
<script>
function foo()
{
var e = document.createElement("td");
document.getElementById("h").appendChild(e);
e.setAttribute("rowspan", 2);
e.setAttribute("colspan", 3);
var tbody = document.getElementById("tbody");
tbody.parentNode.removeChild(tbody);
document.documentElement.removeAttribute("class");
}
</script>
</head>
<body onload="setTimeout(foo, 30)">
<table id="table1">
<thead style="visibility: collapse">
<tr id="h"><td rowspan="2">A</td></tr>
</thead>
<tfoot>
<tr><td rowspan="2" colspan="0">B</td></tr>
<tr><td>C</td></tr>
</tfoot>
<tbody id="tbody">
<tr><td>D</td></tr>
</tbody>
</table>
</body>
</html>

View file

@ -0,0 +1,7 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<body>
<div style="border-collapse: collapse;">
<tr style="outline: 5px solid blue;"/>
</div>
</body>
</html>

View file

@ -0,0 +1,33 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
</head>
<body>
<h3>Tables</h3>
<table style="border-collapse: collapse;">
<tbody>
<tr>
<td>td</td>
</tr>
</tbody>
<tbody>
<tr style="visibility: collapse;">
<td colspan="0">td</td>
</tr>
<tr>
<td>td</td>
<td colspan="0">td</td>
</tr>
</tbody>
</table>
</body>
</html>

View file

@ -0,0 +1,14 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<body onload="document.getElementById('w').setAttribute('rowspan', 0);">
<table>
<tbody>
<tr></tr>
<tr>
<td id="w">y</td>
</tr>
</tbody>
</table>
</body>
</html>

View file

@ -0,0 +1,21 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<body onload="var doomed = document.getElementById('doomed'); doomed.parentNode.removeChild(doomed); ">
<table id="table1" style="border-collapse: collapse;">
<tbody>
<tr>
</tr>
</tbody>
<tbody id="doomed">
<tr>
<td>td</td>
</tr>
</tbody>
<colgroup>
</colgroup>
</table>
</body>
</html>

View file

@ -0,0 +1,26 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script>
function boom()
{
document.getElementById('A').setAttribute('colspan', 0);
document.getElementById('B').setAttribute('rowspan', 3);
}
</script>
</head>
<body onload="boom();">
<table>
<tr>
<td id="A">TD</td>
<td id="B" colspan="3">TD</td>
</tr>
</table>
</body>
</html>

View file

@ -0,0 +1,14 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
</head>
<body onload="var yy = document.getElementById('yy'); yy.parentNode.removeChild(yy);">
<table border="1" style="border-collapse: collapse;">
<tr>
<td> <td id="yy"/> </td>
</tr>
</table>
</body>
</html>

View file

@ -0,0 +1,31 @@
<html xmlns="http://www.w3.org/1999/xhtml" class="reftest-wait">
<head>
<script>
function foo() {
var cell2 = document.createElementNS("http://www.w3.org/1999/xhtml", "td");
cell2.appendChild(document.createTextNode('2'));
document.getElementById("row2").appendChild(cell2);
document.documentElement.removeAttribute("class");
}
</script>
</head>
<body onload="setTimeout(foo, 30);">
<table border="1">
<tr>
<td>A</td>
<td>B</td>
</tr>
<tr id="row2">
<td colspan="0">1</td>
</tr>
</table>
</body>
</html>

View file

@ -0,0 +1,19 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<body>
<table border="1">
<tbody>
<tr>
<td>A</td>
<td rowspan="3" colspan="0">B</td>
</tr>
<tr>
<td colspan="2">C</td>
<td>D</td>
</tr>
</tbody>
</table>
</body>
</html>

View file

@ -0,0 +1,14 @@
<html class="reftest-print"><head>
<title>Testcase bug 362275 - Hang with testcase on print preview, using -moz-column-count and table related stuff</title>
</head>
<body>
This page should not hang Mozilla on print preview
<div style="-moz-column-count: 2;">
<span style="display: table-cell;">
<span>
<textarea style="display: table-cell;"></textarea>
</span>
</span>
<span style="display: table-header-group;"></span>
</div>
</body></html>

View file

@ -0,0 +1,20 @@
<html>
<body>
<table border="1">
<tbody style="overflow: hidden;">
<tr>
<td>
Foo
</td>
</tr>
<tr>
<td>
<p style="height: 200%;">Bar</p>
</td>
</tr>
</tbody>
</table>
</body>
</html>

View file

@ -0,0 +1,50 @@
<html xmlns="http://www.w3.org/1999/xhtml" class="reftest-wait">
<head>
<script>
function boom()
{
var HTML_NS = "http://www.w3.org/1999/xhtml";
document.getElementById("www").appendChild(document.createTextNode('עִבְרִית'));
document.getElementById("yyy").appendChild(document.createElementNS(HTML_NS, 'div'));
document.documentElement.removeAttribute("class")
}
</script>
</head>
<body onload="setTimeout(boom, 30);" style="width: 20em;">
<p>This page should not trigger assertions.</p>
<table border="1">
<tbody>
<tr>
<td>Foo bar baz zap</td>
<td>
<table width="100%" height="100%" border="1">
<tbody>
<tr>
<td>
<table border="1">
<tbody>
<tr>
<td><span id="www">This text wraps</span></td>
<td>Foo</td>
</tr>
</tbody>
</table>
<div id="yyy">YYY</div>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</body>
</html>

View file

@ -0,0 +1,38 @@
<html xmlns="http://www.w3.org/1999/xhtml" class="reftest-wait">
<head>
<script>
function boom()
{
document.getElementById("wantstobeatable").style.display = "table";
document.documentElement.removeAttribute("class");
}
</script>
</head>
<body onload="setTimeout(boom, 30)">
<table width="100%" border="1">
<tr>
<td>
<table border="1" width="100%" style="table-layout: fixed;">
<tr>
<td>Foo</td>
</tr>
</table>
</td>
<td width="22">Bar</td>
<td id="wantstobeatable">
<table border="1" style="table-layout: fixed;">
<tr>
<td>Baz</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>

View file

@ -0,0 +1,14 @@
<html><head>
<title>Testcase bug 362275 - Hang with testcase on print preview, using -moz-column-count and table related stuff</title>
</head>
<body>
This page should not hang Mozilla on print preview
<div style="-moz-column-count: 2;">
<span style="display: table-cell;">
<span>
<textarea style="display: table-cell;"></textarea>
</span>
</span>
<span style="display: table-header-group;"></span>
</div>
</body></html>

View file

@ -0,0 +1,24 @@
<html xmlns="http://www.w3.org/1999/xhtml" class="reftest-wait">
<head>
<script>
function boom()
{
document.getElementById("tr").style.cssFloat = "right";
document.documentElement.removeAttribute("class");
}
</script>
</head>
<body onload="setTimeout(boom, 300);">
<table border="1">
<tr id="tr">
<td>Foo</td>
</tr>
</table>
</body>
</html>

View file

@ -0,0 +1,13 @@
<!DOCTYPE html>
<html>
<head><title>Bug 368013</title></head>
<body>
<table>
<thead>
<col>1</col>
</thead>
<tr>
<td>1</td>
</tr>
</table>
</html>

View file

@ -0,0 +1,21 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script>
function boom()
{
var doomed = document.getElementById("doomed");
doomed.parentNode.removeChild(doomed);
}
</script>
</head>
<body onload="boom()">
<table><tbody><tr><td id="doomed" rowspan="3"></td></tr></tbody><div/></table>
</body>
</html>

View file

@ -0,0 +1,34 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<style>
html {font-size: 70px}
</style>
<table>
<tr>
<td>test</td>
<td>a variable-height box within the area defined by the left margin
and adjacent to the bottom of the top-left-corner.</td>
<td rowspan="3"> </td>
<tr>
<td>test</td>
<td>a variable-height box within the area defined by the left margin
and adjacent to the bottom of the top-left-corner.</td>
<tr>
<td>test</td>
<td>a variable-height box within the area defined by the left margin
and adjacent to the bottom of the top-left-corner.</td>
<tr>
<td>test</td>
<td>a variable-height box within the area defined by the left margin
and adjacent to the bottom of the top-left-corner.</td>
<td rowspan="3"> </td>
<tr>
<td>test</td>
<td>a variable-height box within the area defined by the left margin
and adjacent to the bottom of the top-left-corner.</td>
<tr>
<td>test</td>
<td>a variable-height box within the area defined by the left margin
and adjacent to the bottom of the top-left-corner.</td>
</table>

View file

@ -0,0 +1,39 @@
<html xmlns="http://www.w3.org/1999/xhtml" class="reftest-wait">
<head>
<script>
function boom()
{
var tr2 = document.getElementById('tr2');
var newTD = document.createElement('td');
newTD.setAttribute('colspan', 2);
newTD.appendChild(document.createTextNode('x'));
tr2.insertBefore(newTD, document.getElementById('b'));
document.getElementById('a').setAttribute('colspan', 1);
document.getElementById('b').setAttribute('colspan', 3);
document.documentElement.removeAttribute("class");
}
</script>
</head>
<body onload="setTimeout(boom, 250);">
<table style="border-collapse: collapse;" border="1">
<tbody>
<tr>
<td id="a" colspan="3">A</td>
</tr>
<tr id="tr2">
<td id="b">B</td>
</tr>
<tr>
<td>C</td>
</tr>
</tbody>
</table>
</body>
</html>

View file

@ -0,0 +1,13 @@
<!DOCTYPE html>
<html><head>
<title>Testcase #2 for bug 370713</title>
<script>
function boom() {
document.getElementById('tbody').appendChild(document.createElement('tr'));
}
window.addEventListener("load", boom, false);
</script>
</head>
<body><table style="border-collapse:collapse"><tbody id="tbody"><tr><td></td></tr><tr></tr></tbody></table></body>
</html>

View file

@ -0,0 +1,41 @@
<html class="reftest-wait">
<head>
<script>
function boom()
{
var a = document.getElementById("a");
var b = document.getElementById("b");
var x = document.getElementById("x");
a.parentNode.insertBefore(x, a);
x.parentNode.removeChild(x);
b.parentNode.removeChild(b);
document.documentElement.removeAttribute("class");
}
</script>
</head>
<body onload="setTimeout(boom, 30);">
<table>
<tr>
<td id="x">X</td>
</tr>
</table>
<table border="1" style="border-collapse: collapse;">
<tr>
<td id="a">A</td>
</tr>
<tr>
<td id="b" colspan="2">B</td>
</tr>
</table>
</body>
</html>

View file

@ -0,0 +1,45 @@
<html>
<head>
<script type="text/javascript">
var w_inc = 1;
var h_inc = 1;
function resizeContainer(id) {
var e = document.getElementById(id);
var w = e.clientWidth;
if (w > 800 && w_inc==1)
w_inc=-1;
if (w < 100 && w_inc==-1)
w_inc=1;
e.style.width=(w+w_inc)+'px';
var h = e.clientHeight;
if (h > 800 && h_inc==1)
h_inc=-1;
if (h < 100 && h_inc==-1)
h_inc=1;
e.style.height=(h+h_inc)+'px';
}
function boom() {
var table = document.getElementById('table');
var newNode = document.createElement('caption');
table.appendChild(newNode);
resizeContainer('test');
newNode = document.createElement('caption');
table.appendChild(newNode);
}
</script>
<title></title>
</head>
<body onload="boom()">
<div id="test">
<table id="table" width="100%" height="100%"><tbody><tr><td></td></tr></tbody></table>
</div>
</body>
</html>

View file

@ -0,0 +1,33 @@
<html class="reftest-wait">
<head>
<title>BC crash</title>
<script>
function doit() {
var C = document.getElementById('C');
var newNode = document.createElement('td');
newNode.setAttribute('id', 'D');
C.insertBefore(newNode, document.getElementById('B'));
var D = document.getElementById('D');
D.parentNode.removeChild(D);
var A = document.getElementById('A');
A.parentNode.removeChild(A);
document.documentElement.removeAttribute("class");
}
</script>
</head>
<body onload="doit()">
<table style="border-collapse: collapse">
<tbody>
<tr id="C">
<th id="B"></th>
</tr>
<tr>
<td id="A" colspan="2"></th>
</tr>
<tbody><tr><th></th></tr></tbody>
</table>
</body>
</html>

View file

@ -0,0 +1,34 @@
<html class="reftest-print"><head>
<style>
td {
height: 670px;
}
</style>
</head>
<body>
<table border="1"><tbody>
<tr><td rowspan="1"></td></tr>
<tr><td rowspan="3">L!</td></tr>
<tr><td rowspan="1"></td></tr>
<tr><td rowspan="9">L-RLk:715KB</td></tr>
<tr><td rowspan="6"></td></tr>
<tr><td> jonas</td><td rowspan="7">LZ:13.34MBmZ:2.447MB</td></tr>
<tr><td> jonas</td></tr>
<tr><td rowspan="10">LTp:673msTp2:531.5125msTdhtml:1263msTxul:562msTs:1906ms</td><td rowspan="1"></td></tr>
<tr><td rowspan="9">L</td></tr>
<tr><td rowspan="5">L TUnit223/0 reftest435/03953/0/455 chrome25/0/0</td></tr>
<tr><td rowspan="4">L-</td></tr>
<tr><td rowspan="1"></td><td rowspan="12">LTp:748msTp2:541.15msTdhtml:1294msTxul:774msTs:2302ms</td></tr>
<tr><td rowspan="3">LZ:13.34MBmZ:2.447MB</td></tr>
<tr><td rowspan="29"></td><td rowspan="57"></td><td rowspan="34"></td></tr>
<tr><td> surkov.alexander</td><td rowspan="5">L-</td></tr>
</tbody></table>
<script>
function doe() {
var x=document.getElementsByTagName('table')[0];
alert(x.offsetHeight);
}
//setTimeout(doe, 100);
</script>
</body></html>

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,64 @@
<html class="reftest-print">
<body>
<table border>
<tr>
<td rowspan="2" valign="top">
<p>Location: </p>
<p>
We are located at 333 West San Carlos Street, Suite 1650, San Jose.
Our building has a parking garage, and we will validate your parking.
After you park, as you are walking out of the parking garage, you will
see a bank of elevators. These elevators only go up and down in the
garage &#150; they don&#x2019;t connect to the office building. You
should walk past those elevators, walk out of the garage, walk across a
courtyard, and into the doors for the main building. There is another
bank of elevators in that building. Take these elevators to the 16th
Floor.
</p>
<p>
From Highway 280 heading northbound to San Jose: Take the Guadalupe
Parkway exit, also called Highway 87. This exit splits into a
northbound and a southbound direction. Take the northbound direction.
Once on the Guadalupe Parkway take the first exit, which is the Santa
Clara Street exit. Bear right on Santa Clara Street as you come off
that exit. The first light you come to is Almaden Blvd. Turn right on
Almaden. Go down 3 lights to West San Carlos Street. Turn right on
West San Carlos. The next light you come to is a small street called
Woz Way. Turn right on Woz. The parking garage for our building is on
your right. Turn right into the garage. Then follow the directions
above from the garage to our office.
</p>
<p>
From Highway 101 heading southbound to San Jose: Take the Guadalupe
Parkway exit, also called Highway 87. Stay on the Guadalupe as it
turns into a surface street and you cross over Hedding and Coleman.
Once it turns into an expressway again, the second exit is the Park
Avenue exit. Take this exit. Turn left on Park Avenue. After you
turn left you will come under the freeway and immediately come to a
traffic light at a small street called Woz Way. Turn right on Woz
Way. The parking garage for our building is on your left. Turn left
into the garage. Then follow the directions above from the garage to
our office.
</p>
<p>
From Highway 101 heading northbound to San Jose: Turn on to Highway
280 headed north. Then follow directions above for Highway 280 heading
northbound to San Jose.
</p>
<p>
From Highway 880: Take Highway 880 to Highway 280 South, and then
follow directions above from Highway 280 heading southbound to San
Jose.
</p>
</td>
</tr>
<tr height="1087">
</tr>
</table>
</body>
</html>

View file

@ -0,0 +1,22 @@
<html>
<head>
<script>
function boom()
{
document.getElementById("a").style.clear = "right";
}
</script>
</head>
<body onload="boom();">
<div style="display: table;">
<div id="a">a</div>
<div id="b" style="height: 18000000px;">b</div>
<div id="c">c c c</div>
</div>
</body>
</html>

View file

@ -0,0 +1,6 @@
<html><head>
<title>ASSERTION: no common ancestor at all??? with iframe in display: table-caption</title>
</head>
<body style="display: table-caption;">
<iframe></iframe>
</body></html>

View file

@ -0,0 +1,28 @@
<html>
<head>
<script>
function boom()
{
var tbody = document.getElementById("tbody");
tbody.style.overflow = "auto";
document.body.offsetWidth;
tbody.style.overflow = "";
}
</script>
</head>
<body onload="boom();">
<table border="1">
<tbody id="tbody">
<tr>
<td>
<p>A</p>
<p style="height: 18000000px">B</p>
</td>
</tr>
</tbody>
</table>
</body>
</html>

View file

@ -0,0 +1,16 @@
<!DOCTYPE html>
<html>
<body>
<table>
<tr>
<td>A B</td>
<td>C</td>
</tr>
<tr>
<td width="100" colspan="3">D</td>
</tr>
</table>
</body>
</html>

View file

@ -0,0 +1,16 @@
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td>hello</td>
<td>
<!-- contents of the cell with 0 min width and non-0 pref width -->
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td width="5"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="2" width="100"></td>
</tr>
</table>

View file

@ -0,0 +1,10 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style>
td { font-family: monospace; white-space: pre; }
</style>
</head>
<body>
<table border="1"><tbody><tr><td>&#9;TabIndented</td></tr></tbody></table>
</body>
</html>

View file

@ -0,0 +1,12 @@
<html>
<body onload="document.getElementById('table').style.position = 'fixed';">
<table id="table" border="1">
<tr>
<td>td</td>
<caption>caption</caption>
</tr>
</table>
</body>
</html>

View file

@ -0,0 +1,14 @@
<html style="display: inline-table;" class="reftest-wait">
<head>
<script>
function boom()
{
document.documentElement.style.overflow = "auto";
document.documentElement.removeAttribute("class");
}
</script>
</head>
<body onload="setTimeout(boom, 30);">
Foo
</body>
</html>

View file

@ -0,0 +1,24 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<body onload="document.getElementById('table1').style.position = 'fixed';">
<table border="1" id="table1" style="border-collapse: collapse; color: red">
<tr>
<td style="float: left; overflow: auto;">1</td>
</tr>
</table>
<table border="1" style="border-collapse: collapse; color: green">
<tr>
<td>x</td>
</tr>
<tr style="display: inline-table">
<td>a</td>
<td style="display: table-column-group">b</td>
<td style="display: inline-table">c</td>
</tr>
</table>
</body>
</html>

View file

@ -0,0 +1,21 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style>
.pad { padding: 100%; }
</style>
</head>
<body>
<table>
<div class="pad">x</div>
<tr>
<td>a</td>
<td>b</td>
<div class="pad">c</div>
</tr>
</table>
</body>
</html>

View file

@ -0,0 +1,17 @@
<html>
<head>
<style>
.pad { padding: 50%; }
</style>
</head>
<body>
<table cellspacing=0 cellpadding=0>
<tr>
<td><div class="pad">a</div></td>
<td><div class="pad">b</div></td>
</tr>
</table>
</body>
</html>

View file

@ -0,0 +1,15 @@
<!DOCTYPE html>
<html>
<head>
</head>
<body onload="document.getElementById('d').style.margin = '60%';">
<div style="display: table-caption;">
<div id="d" >
a
b
<span style="float: left;">c</span>
<span style="float: left;">d</span>
</div>
</div>
</body>
</html>

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