Closed
Bug 312770
Opened 19 years ago
Closed 19 years ago
Table too wide because of marquee
Categories
(Core :: Layout: Tables, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: martijn.martijn, Assigned: martijn.martijn)
References
()
Details
(Keywords: regression, testcase)
Attachments
(6 files, 4 obsolete files)
297 bytes,
text/html
|
Details | |
542 bytes,
text/html
|
Details | |
1.52 KB,
text/html
|
Details | |
496 bytes,
text/html
|
Details | |
3.58 KB,
patch
|
doronr
:
review+
bzbarsky
:
superreview+
|
Details | Diff | Splinter Review |
3.57 KB,
patch
|
Details | Diff | Splinter Review |
At the url, the tables surrounding the marquees have become wider since the fix
for bug 277208. That should not have happened.
Assignee | ||
Comment 1•19 years ago
|
||
Assignee | ||
Comment 2•19 years ago
|
||
This happens because for some reason the offsetWidth of a display:table div is
calculated including the margins it has, I think that is an incorrect thing to
do.
Assignee | ||
Comment 3•19 years ago
|
||
Testcase2 should give approximately/precisely the same value for the two alerts,
not something completely different.
Assignee | ||
Updated•19 years ago
|
Component: Layout → Layout: Tables
QA Contact: layout → layout.tables
Assignee | ||
Comment 4•19 years ago
|
||
So I guess the offsetWidth gets calculated here:
http://lxr.mozilla.org/seamonkey/source/content/html/content/src/nsGenericHTMLElement.cpp#579
and for some reason nsTableOuterFrame.cpp is used as frame or something like that?
Martijn, tables have a very bizarre frame structure:
the outer table frame
the caption
the inner table frame
The inner table frame is the frame that corresponds to the table tag. The outer
table frame is a place holder that inherits a couple of style properties from
the the table frame (http://lxr.mozilla.org/seamonkey/source/layout/style/ua.css#60)
However if you look fromt the parent frame point of view it sees first the outer
table frame. Currently the outer table frame includes the margin around the
inner table frame and caption and adjusts the margins for the different
caption-side scenarios.
>sees first the outer table frame
with a 0 margin, so it probably reports the outer width which includes the table
margin as the offset width. I think Boris did file a bug about this but I can't
find it now.
Assignee | ||
Comment 7•19 years ago
|
||
Sorry, my previous analysis was wrong (although it still is a bug, but it is
not what is causing this bug).
This bug happens because of this line:
http://lxr.mozilla.org/seamonkey/source/layout/style/xbl-marquee/xbl-marquee.xml#231
this.innerDiv.style.padding = "0px";
Here, the padding is changed and that seems to trigger an incremental reflow
bug, which you can see in the testcase3 that I attached.
Assignee | ||
Comment 8•19 years ago
|
||
Well, this fixes it for the marquees on the url, but for particular pages with
the same layout and where there is a script which sets marquee.innerHTML to
some other text dynamically, this bug could still be seen.
The border-collapse: collapse; rule is necessary, because the marquees were
also a bit too high on the page, and I think this also fixes the remaining
issue in bug 269257.
The xbl-marquee.css print rule is for printing. Alhough IE6 doesn't wrap on
print preview, I think it's more print-friendly to wrap.
Assignee | ||
Comment 9•19 years ago
|
||
The patch also fixes the issue mentioned in bug 276729, comment 8.
Assignee | ||
Updated•19 years ago
|
Attachment #199926 -
Flags: review?(bzbarsky)
Comment 10•19 years ago
|
||
>border-collapse: collapse;
means asking for trouble
Assignee | ||
Comment 11•19 years ago
|
||
(In reply to comment #10)
> >border-collapse: collapse;
> means asking for trouble
What trouble?
What should I use instead? border:0px?
Comment 12•19 years ago
|
||
border-collapse is not a happy camper in Gecko, unfortunately. :( There are
lots of bugs, esp with incremental stuff.
Martijn, I'm not sure I follow what the patch is doing...
Comment 13•19 years ago
|
||
Martijn, border collapse, short BC, is 160k of nearly assembly code masceraded
as C++ inside nsTableFrame.cpp. See http://en.wikipedia.org/wiki/Katorga when
people work on this code. It needs to be rewritten. If you can acchieve the same
without border-collapse then do it.
Assignee | ||
Comment 14•19 years ago
|
||
Well, I need the border-collapse: collapse rule for this testcase. I get the
following results in various browsers:
Browser offsetwidth offsetheight
IE6: 261 19
Mozilla1.7 261 20
patched trunk without border-collapse 261 24
patched trunk with border-collapse 261 20
Adding a border:0; rule doesn't make any difference, so it seems I can only use
border-collapse:collapse to correct this.
I can't really imagine it would cause many problems in this case, but if you
say so. On the other hand, this isn't really a big deal and seems only to
happen when the marquee is inside a table.
Assignee | ||
Comment 15•19 years ago
|
||
This is the same as patch1, but without the border-collapse: collapse rule.
You decide which one is preferred.
> Martijn, I'm not sure I follow what the patch is doing...
Instead of adding the style rules dynamically with javascript, the style rules
are directly applied. That way, I don't trigger this incremental reflow bug
(which is I guess, part of bug 47710).
I've tested this on the majority of testcases in bugzilla and some urls, no
regressions that I know of.
Maybe you know somebody else who can review this? Doron?
Ultimately, I think returning to xul:hbox is the best solution, because then
the white-space:nowrap hack is not necessary. But currently that would regress
bug 277208, which is a worse issue than the issues that the use of
display:table hasve introduced.
Comment 16•19 years ago
|
||
Can you get away with border-spacing:0 instead of using border-collapse? Or
does that do nothing here?
And yes, if doron can review I could sr...
Assignee | ||
Comment 17•19 years ago
|
||
(In reply to comment #16)
> Can you get away with border-spacing:0 instead of using border-collapse? Or
> does that do nothing here?
Oops, I forgot about that one. Yes, that works.
Attachment #199926 -
Attachment is obsolete: true
Attachment #200185 -
Attachment is obsolete: true
Attachment #200208 -
Flags: review?(doronr)
Assignee | ||
Updated•19 years ago
|
Attachment #199926 -
Flags: review?(bzbarsky)
Comment 18•19 years ago
|
||
} /* This hack is needed until bug 119078 gets fixed */
-
+
+ marquee > * > * > *{
+ white-space: normal !important;
+ }
}
Please explain why that is needed. Are you trying to style the <html:div
anonid="innerDiv">? If so, you should give it a class and style it using a
classname rather.
Assignee | ||
Comment 19•19 years ago
|
||
You're right. But I can use the [anonid="innerDiv"] attribute selector, instead
of adding a classname.
Attachment #200208 -
Attachment is obsolete: true
Attachment #200214 -
Flags: review?(doronr)
Comment 20•19 years ago
|
||
For what it's worth, class selectors are a good bit faster than attribute
selectors...
Updated•19 years ago
|
Attachment #200208 -
Flags: review?(doronr)
Comment 21•19 years ago
|
||
Comment on attachment 200214 [details] [diff] [review]
patch4
Please use a class selector
Attachment #200214 -
Flags: review?(doronr) → review-
Assignee | ||
Comment 22•19 years ago
|
||
Ok, so like this?
Assignee | ||
Updated•19 years ago
|
Attachment #200214 -
Attachment is obsolete: true
Attachment #200226 -
Flags: review?(doronr)
Comment 23•19 years ago
|
||
Comment on attachment 200226 [details] [diff] [review]
patch5
>Index: layout/style/xbl-marquee/xbl-marquee.css
>===================================================================
>RCS file: /cvsroot/mozilla/layout/style/xbl-marquee/xbl-marquee.css,v
>retrieving revision 1.1
>diff -u -8 -p -r1.1 xbl-marquee.css
>--- layout/style/xbl-marquee/xbl-marquee.css 18 Jul 2005 21:15:42 -0000 1.1
>+++ layout/style/xbl-marquee/xbl-marquee.css 20 Oct 2005 16:42:25 -0000
>@@ -45,10 +45,13 @@ marquee[height*="7"], marquee[height*="8
>
> /* PRINT ONLY rules follow */
> @media print {
>
> marquee > * > * {
> margin: 0 !important;
> padding: 0 !important;
> } /* This hack is needed until bug 119078 gets fixed */
>-
>+
>+ marquee .innerDiv {
>+ white-space: normal !important;
>+ }
> }
You probably should just do:
div.innerDiv {
since the stylesheet is included only by the marquee anyways I believe.
Attachment #200226 -
Flags: review?(doronr) → review+
Assignee | ||
Comment 24•19 years ago
|
||
(In reply to comment #23)
> You probably should just do:
>
> div.innerDiv {
>
> since the stylesheet is included only by the marquee anyways I believe.
Yes, you're right, but somehow, I'm scared of that.
Comment 25•19 years ago
|
||
(In reply to comment #24)
> (In reply to comment #23)
> > You probably should just do:
> >
> > div.innerDiv {
> >
> > since the stylesheet is included only by the marquee anyways I believe.
> Yes, you're right, but somehow, I'm scared of that.
>
>
>
Should be fine.
Assignee | ||
Updated•19 years ago
|
Attachment #200226 -
Flags: superreview?(bzbarsky)
Comment 26•19 years ago
|
||
Comment on attachment 200226 [details] [diff] [review]
patch5
Yeah, please use a straight class selector. That's actually faster than using
a descendant like that.
sr=bzbarsky with that.
Attachment #200226 -
Flags: superreview?(bzbarsky) → superreview+
Assignee | ||
Comment 27•19 years ago
|
||
Ok, this uses a straight class selector.
Ready for checkin.
Assignee | ||
Updated•19 years ago
|
Assignee: nobody → martijn.martijn
Comment 28•19 years ago
|
||
Fixed on trunk. Please make sure we have a bug filed on the actual underlying incremental reflow issue!
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 29•19 years ago
|
||
Ok, I filed bug 313520 about that.
Updated•17 years ago
|
Flags: in-testsuite?
You need to log in
before you can comment on or make changes to this bug.
Description
•