Commit Graph

1163 Commits

Author SHA1 Message Date
troy@netscape.com
e9fcec8bda Frame construction changes for tables 1998-09-16 17:19:20 +00:00
buster@netscape.com
279673f032 better handling of non-cell frames in rowFrames
support for the case where a nested table is in a cell that has colspan>1
1998-09-16 00:48:14 +00:00
buster@netscape.com
5184ca92f1 nsTableRowGroupFrame no longer assumes all its children are rows, or that all row children are cells. 1998-09-15 20:36:42 +00:00
buster@netscape.com
de1257f4bd nsStyleConsts.h added some HTML 4 consts for tables
nsHTMLAtoms.cpp,h             added some HTML 4 strings for tables
nsHTMLParts.h                 added constructors for new table content classes
nsGenericHTMLElement.cpp,h    added table frame creation, common table attribute parsing
nsHTMLTable*Element.cpp       these are the new table content classes
nsHTMLContentSink.cpp         enabled the new content and removed the old
nsHTMLStyleSheet.cpp          fixed the table style optimizations to work with new content
nsTable*Frame.cpp             these work with the new content
1998-09-15 17:58:24 +00:00
buster@netscape.com
651a6cfd70 fixed minColSpan to always be at least one. This helps support empty rows,
among other problems.
1998-09-03 06:15:18 +00:00
buster@netscape.com
11dada02d7 expanded nsIFrame::List to include nsIListFilter *aFilter param, by default nsnull.
aFilter is useful for determining if a frame should output itself during
a List().  In any event, the children of the frame are always processed.
added nsIListFilter, an interface for any object that wants to act like a filter for frame dumps
added   static NS_LAYOUT nsIListFilter * GetFilter(nsString *aFilterName);
currently, only TableListFilter implements nsIListFilter.
in response to List(...TableListFilter), the frame model is dumped in a way that is useful
for table layout regression testing.  Currently this is controlled by command line switches on the viewer app.
1998-09-02 21:59:54 +00:00
buster@netscape.com
83730647c4 reimplemented cell map in terms of nsVoidArrays for incremental building.
the cellmap is now built incrementally, driven by nsTableRowFrame::InitialReflow
1998-08-31 21:23:28 +00:00
kipp@netscape.com
d515f73150 XPCOM'ized nsIContent and nsIHTMLContent 1998-08-29 20:20:38 +00:00
buster@netscape.com
5f208e68e1 more content decoupling
support work for style optimizations
fixed a bug in table columns  -- the attribute repeat defaults to 1, not 0
1998-08-26 17:26:38 +00:00
joki@netscape.com
aebcd628e8 Modifying nsIContent's AppendChild -> AppendChildTo to stop conflict with
DOM interfaces.
1998-08-21 21:38:26 +00:00
buster@netscape.com
0f443c9118 improved colspan handling.
cells with colspans and specified widths divide their width provisionally between the columns they span. This provisional division is ammended by any cell in any of the effected columns that:
1) has a colspan=1, and
2) has a width specified
the widths of all other columns must be adjusted for cells like these.  Further complicating matters is that it seems <faith> that if multiple colspanning cells intersect a column and each has a width
specified such that the column would have a different width depending on which is used, only the first such cell is used </faith>.  I can neither confirm nor deny this reading the mozilla code.

I also taught the cell map how to deal with this situation:

 colspan=1 | colspan=2 | colspan=1
 colspan=1 | colspan=2 | colspan=1

This table "really" has 4 columns, but the middle cells are treated as if they have no colspan.
Trust me, it matters.  The original colspan attributes can't simply be thrown away because Mr. DOM
could come along at any time and add/remove a cell that would make them important.
1998-08-19 15:43:51 +00:00
buster@netscape.com
51041cd2c3 fixed nested tables for the case where both parent and child table are %-width,
and the columns are any variety of width types
1998-08-17 23:37:04 +00:00
buster@netscape.com
3ff321f8e8 fixed a memory leak where a style context was not being released when
the table cell set the table column's style.
1998-08-17 19:03:36 +00:00
buster@netscape.com
d1f77a833b * migrated and improved some fixes from the branch to the tip
* fixes sample6, yahoo resizing
* added BasicTableLayoutStrategy::ColIsSpecifiedAsMinimumWidth helper function,
which tells us if the given column has a width attribute that means "make me as small as possible"
* nsTableFrame methods now no longer use mCellMap directly, they ask for it from
GetCellMap which gets the cell map from the first-in-flow.  Only the first-in-flow has a
cell map because the cellmap refers to the table as a single object, not to each table frame.
* Likewise, continuing table frames do not call BalanceColumnWidths or SetTableWidth
which are "global" operations.  Responsibility for these lies with the first-in-flow.
1998-08-14 16:16:43 +00:00
buster@netscape.com
e70ed0c0ac percent-width nested tables in fixed-width cells now use the computed
column width if available for computing their own width.
1998-08-10 02:16:18 +00:00
buster@netscape.com
40b2eac56e bug #312932. fixes nested tables with percent widths that also have
content with percent widths.
1998-08-07 21:53:27 +00:00
troy@netscape.com
6d6cb5ca33 Removed MoveTo() and SizeTo() member functions that were for debug
purposes, and are no longer needed
1998-08-07 18:17:34 +00:00
buster@netscape.com
35fe484983 synch with branch
fixed the following bugs: 312653 312656 312655
the fixes were:

1. cells now inherit their bgcolor from the row, if available.  This is the
Nav4 way of drawing row bgcolor, rather than having the row paint its own bgcolor. (Troy, I intend to make this conditional
based on the compatibility mode)

2. colspans across cols that are all specified width no longer try to proportionately
divide the width of the span between the cols.  see http://www.city.net (now it's really fixed, without breaking nested tables in
constrained situations.)  A happy side effect is nested tables in general behave better when constrained.

3. min table sizes are fixed, so min width changes to content now effect the
table correctly during incremental reflow.  This fixes the table layout portion of the bugs on the http://www.aol.com/corp tree.
Rick will check in the other half of this fix soon.  Until then, don't expect to see much improvement.

4. fixed bug 312799.  Table cell now always reserve at least the maxElementSize
of its content, fixing problems when desiredSize<maxElementSize
1998-08-07 02:11:51 +00:00
buster@netscape.com
edd7ce7708 backed out a mistake from my last checkin. table min sizes are ok again 1998-08-04 00:56:57 +00:00
buster@netscape.com
f71d32961d fixed this case: (an image tag with no width attribute) inside (a specified-width column) inside
(a nested table with specified width) inside (an auto-width column)
inside (a specified-width table).  Got that?
The problem was that we we not setting state correctly during incremental reflow
when the image returned its proper metrics after giving default metrics that
were for its ALT text.
1998-08-03 20:27:59 +00:00
peterl@netscape.com
dda833cded rounding support 1998-07-31 23:34:45 +00:00
troy@netscape.com
d865d43ec9 Changed BuildCellMap() to iterate table cell frames using the sibling
list instead of ChildAt()
1998-07-30 04:50:38 +00:00
kipp@netscape.com
e97ebd0d50 Remove most compiler warnings on IRIX 1998-07-29 20:19:08 +00:00
buster@netscape.com
14deff94a9 COLS attribute ignored if any column width info is specified (like <TD width=100>)
fixed lots of COLS related bugs.
handle min width spec (<TD width=0 or width=0% or width=0*>)
major fix to colspan handling
1998-07-26 04:23:01 +00:00
buster@netscape.com
5971394e6f GetColCount now returns the effective column count of the table, adjusted
for nonsense COLSPANs at the edge of a table.  Fixed some bugs this uncovered
where the cell was being asked for its colspan attribute rather than the table
being asked for the cell's effective col span.
1998-07-24 16:51:16 +00:00
buster@netscape.com
7d4a398893 fixed table width problems when there are colspanning cells 1998-07-22 05:38:41 +00:00
troy@netscape.com
3d32e26332 Changed PaintBorder() to use the (x,y) that's passed in 1998-07-22 05:02:07 +00:00
buster@netscape.com
1f39275344 * reworked the way colspan and rowspans are handled in table layout strategy. We do less work, and we look better.
* fixed more margin code.  we're inching towards correctness.
* the width contributed by a colspanning cell is now proportionately distributed to the columns based on the columns "effective width"
* added logic for handling illegal COLS attribute on a table (like COLS=4 in a 3-column table).  See nsTableFrame::GetEffectiveCOLSAttribute()
* added logic for handling illegal COLSPAN attribute on a cell (like COLSPAN=4 in a 3-column table).  See nsTableFrame::GetEffectiveColSpan().  This is wrong, and will get reworked soon.
* added the ability for cell width attributes to effect column width like Nav4.
1998-07-22 03:53:43 +00:00
troy@netscape.com
2f1442d674 Changed nsCSSRendering::PaintBorder() so the entire rect is used
and not just the width and height
1998-07-22 02:46:00 +00:00
troy@netscape.com
3c005aebbc Fixed it so tables that don't want a border don't get a border 1998-07-21 08:12:22 +00:00
troy@netscape.com
bc6a258f3a Changed Paint() to use the parent frame's color style struct. We can't use our
color style struct because we're a pseudo frame and so the style system forces
us to have a transparent background
1998-07-20 23:58:00 +00:00
buster@netscape.com
bbbfa96ac5 fixed a space leak/logic error handling colspans
added backwards compatibility for percent width tables inside of auto width tables (see http://webreview.com/wr/pub  warning:  you'll have to look at a local copy until
Troy/Vidur/somebody fixes an image problem.)
1998-07-17 21:02:28 +00:00
buster@netscape.com
dd4bdb9539 fixed table maxElementSize 1998-07-17 17:51:55 +00:00
buster@netscape.com
dd50384b0a fundemental overhaul of the BasicTableLayoutStrategy
We now cache lots of useful info in the colframes
we now properly account for margins just as uniform cellspacing
1998-07-16 23:23:31 +00:00
troy
4335469bf3 Turned off some code that was accidently turned on 1998-07-15 04:46:51 +00:00
troy
26046305da Changed API for CreateContinuingFrame and GetReflowMetrics to take
a reference to a nsIPresContext
1998-07-15 03:23:23 +00:00
troy
26b49b4476 Changed Reflow() member function to take a reference to a nsIPresContext
instead of a pointer
1998-07-15 02:53:09 +00:00
buster
0f3a064a10 major hackage to the table data structures. slimmer, simpler, faster
this work exposed a few bugs and slow spots, which have been fixed
for the aol page, I added some additional backwards compatibility code
to proportionately distribute width when a fixed-width cell has colspans
1998-07-11 00:00:31 +00:00
troy
fa4e80a752 Deprecated the SetFirstContentOffset/SetLastContentOffset member
functions that take a nsIFrame*
1998-07-10 19:04:06 +00:00
buster
c5522f4239 fix for empty tables. we now support tables that have no content. 1998-07-07 00:20:21 +00:00
troy
9420340aea Incremental reflow work-in-progress 1998-07-06 21:39:23 +00:00
troy
f5e6a2afc1 Moved code that resized the table row cells from the row group frame
to the row frame. It's now handled as part of the DidReflow() post-
processing code
1998-07-02 20:35:23 +00:00
buster
b121968466 added an optimization that skips pass2 cell reflows when the new available width is unchanged
from the prior available width.  Some real-world test cases sped up
1-2 orders of magnitude for resize reflow.  Initial reflow is unchanged because
we still need to get pass1 metrics on all content.
fixed nsCSSBlockFrame.cpp to take margins into account when computing parent's available width
fixed distribution of excess space to table cells when table is bigger than the content it holds.
not quite finished yet, but better.
1998-07-02 17:40:56 +00:00
troy
6b86eb70cd Some work-in-progress for incremental reflow 1998-07-02 05:39:10 +00:00
troy
0780194275 Eliminated some usage of ChildAt() 1998-07-01 22:22:28 +00:00
troy
615498146d Moved shrink wrap code from table frame to table row group frame 1998-06-30 02:11:07 +00:00
buster
8cf8382f01 columns that are fixed-width due to an attribute on the corresponding cell in the first row
now work correctly.
extra space is now properly apportioned in the "table fits" case when the table contains auto-width cells.
1998-06-30 00:37:03 +00:00
atotic
772a07e2dc Fixed mac warnings 1998-06-27 02:47:44 +00:00
buster
1272ec01e8 support for Nav4 compatibility -- auto-width cells with 0-width content are 1 pixel wide 1998-06-26 23:31:33 +00:00
kipp
9e773c0a59 Eliminated IRIX compiler warnings (and a bug) 1998-06-26 15:07:09 +00:00