Closed
Bug 198506
Opened 22 years ago
Closed 22 years ago
Text in XML pretty printing overlaps (first time only)
Categories
(Core :: Layout: Tables, defect, P2)
Core
Layout: Tables
Tracking
()
RESOLVED
FIXED
mozilla1.5beta
People
(Reporter: piers, Assigned: bernd.mielke)
References
()
Details
(Keywords: fixed1.4.1, regression, Whiteboard: [patch] [reflow-reason])
Attachments
(5 files)
1.14 KB,
text/xml
|
Details | |
20.60 KB,
image/png
|
Details | |
1.57 KB,
patch
|
Details | Diff | Splinter Review | |
1.01 KB,
patch
|
dbaron
:
review+
dbaron
:
superreview+
asa
:
approval1.4.1+
brendan
:
approval1.5b+
|
Details | Diff | Splinter Review |
2.75 KB,
text/html; charset=UTF-8
|
Details |
The text in XML pretty printing seems to overlap. Collapsing then expanding the
element causes the text to be drawn correctly.
Test doc and screenshot to follow.
this looks like a layout bug
Component: XML → Layout: Block & Inline
![]() |
||
Comment 4•22 years ago
|
||
Actually, on 2003033108 Win2k XML pretty print settings are ignored and XML is
no longer display - my XML page is rendered as plain text.
that's bug 199484
Reassigning to default owners. Oh, and this is a regression.
Comment 7•22 years ago
|
||
*** Bug 203051 has been marked as a duplicate of this bug. ***
Looks like some sort of font or text measurement problem.
Assignee: block-and-inline → font
Component: Layout: Block & Inline → Layout: Fonts and Text
Comment 9•22 years ago
|
||
refreshing the page also makes it flow properly - only happens on the initial
load (but it happens on the initial load consistently).
*** Bug 206689 has been marked as a duplicate of this bug. ***
Comment 11•22 years ago
|
||
*** Bug 209028 has been marked as a duplicate of this bug. ***
Comment 12•22 years ago
|
||
*** Bug 210492 has been marked as a duplicate of this bug. ***
![]() |
||
Updated•22 years ago
|
Priority: -- → P3
Target Milestone: --- → Future
Priority: P3 → P2
![]() |
||
Comment 13•22 years ago
|
||
*** Bug 208816 has been marked as a duplicate of this bug. ***
![]() |
||
Comment 14•22 years ago
|
||
*** Bug 210577 has been marked as a duplicate of this bug. ***
![]() |
||
Comment 15•22 years ago
|
||
Since Bug#210577 has been judged a dupe of this, the following symptoms that are
not covered here are also worth noting (quoted):
Steps to Reproduce:
1. Coldstart Mozilla Browser
2. Enter "http://www.w3.org/2001/04/infoset" in the Location input
3. EXAMINE THE DISPLAY -- possible to use ViewSource to check
4. Click on "Reload"
5. EXAMINE THE DISPLAY AGAIN
Actual Results:
Got the heading panel notice about ". . . the document tree is shown"
The immediately obvious defects include --
The first block of comment ("this can be decoded . . ." )is not rendered at all,
only the "<!--" and "-->"
The third block, after <rdf:RDF>, ("This RDF schema's namespace name. . . .") is
just plain messy - bits of it are rendered.
Attribute names seem to run into the element names . . . (that's the
pretty-printing overlap described above).
And I can confirm the findings in comment#9: the failures are consistant on the
first rendering and go away if the page is refreshed.
![]() |
||
Comment 16•22 years ago
|
||
Same problem here (Mozilla 1.4 final on Windows 2000 - "Mozilla/5.0 (Windows; U;
Windows NT 5.0; en-US; rv:1.4) Gecko/20030624").
It shows the first time I view an XML document in a fresh Mozilla. The second
time I view an XML document, the display becomes correct. It doesn't matter
whether the second document is different from the first document, or identical
to the first document. It also doesn't matter what window it is in. Reload also
makes the display correct, as earlier mentioned -- this could also be seen as a
second display of an XML document.
Looks like an initialization problem?
(Maybe someone powerful (maybe the reporter) could change the Summary to "Text
in XML pretty printing overlaps on first display" or something like that? I
didn't find this bug when I first searched for it, because I searched for "first
xml". What is special about this bug is that it only appears on the *first* view.)
Updated•22 years ago
|
Summary: Text in XML pretty printing overlaps → Text in XML pretty printing overlaps (first time only)
Comment 17•22 years ago
|
||
*** Bug 212010 has been marked as a duplicate of this bug. ***
Comment 18•22 years ago
|
||
*** Bug 212615 has been marked as a duplicate of this bug. ***
Comment 19•22 years ago
|
||
FYI, I don't think reloading helps much. I like to look at XBL via the
Monospace style sheet, and what happens for me is I get the overlap every time I
go to that style sheet.
*** Bug 213321 has been marked as a duplicate of this bug. ***
Hmmm. A frame dump shows that the frames aren't overlapping, so it seems that
the text frames actually have the wrong size.
So here's a rough idea of what's happening:
* the XML prettyprinting code (triggered from nsXMLContentSink::DidBuildModel,
via MaybePrettyPrint) appends the entire transformed tree, which includes the
LINK elements that bring in stylesheets, as descendants of a DIV:
http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/content/xml/document/src/nsXMLPrettyPrinter.cpp&rev=1.6&mark=191#180
http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/content/xml/document/resources/XMLPrettyPrint.xml&rev=1.6&mark=54-55#48
* The insertion into the document kicks off the stylesheet loads for the two
stylesheets, which are asynchronous.
* We do the initial reflow of the document (also triggered from
nsXMLContentSink::DidBuildModel, via StartLayout) with the stylesheets not
loaded yet
* We go back to the main event loop, and the stylesheets are loaded, queueing
two style change reflows, one for a table frame and one for a block frame
* These two style change reflows are merged using the reflow tree and done as a
single reflow. In this reflow, the text frames aren't resized properly. I'm
only seeing calls of nsTextFrame::Reflow in this reflow, and the reason is
eReflowReason_StyleChange (as it needs to be), but I think this needs to be
called more times.
I probably need to figure out which frames are getting the style changes queued...
That should have said "only seeing *2* calls of nsTextFrame::Reflow"
The style change reflows are for the table and the div elements that are the
containers of the tree and the header, so that should cover things...
The two text frames that are reflown are the text nodes for the text node "\n
This XML file does not appear to have any style information\n
associated with it. The document tree is shown below.\n" (one text frame per
line, I presume). So I think the style change reflow for the table is somehow
being suppressed.
This fixes the bug. It depends on the patch in bug 213333.
Taking.
Assignee: font → dbaron
Component: Layout: Fonts and Text → Layout: Tables
Whiteboard: [patch]
Target Milestone: Future → mozilla1.5beta
Attachment #128189 -
Flags: review?(bernd.mielke)
I'm actually not sure if this is right, because the |switch
(aReflowState.reason)| in nsTableFrame::Reflow might already want to get
StyleChanged. We do need to do "pass 1" as well for a style change. But maybe
IR_StyleChanged should handle what needs to happen?
(This code seems far more complicated than it needs to be thanks to the
combination of our reflow reason/type system and the computation of min/max
widths using the same Reflow method as final size.)
Some comments I wrote in email:
If the reflow reason is style change, the style change reason has to be
propagated to the descendants. That's why I changed what I did. Right
now tables are acting vastly differently when a style change reflow is
targeted at an ancestor or when it is targeted at the table itself.
That's wrong. A table should do roughly the same thing when:
(a) the 'font-size' property is changed on its parent, or
(b) the 'font-size' property is changed on the table itself.
Style change reflows should only be used for style changes, so
propagating the reflow reason correctly shouldn't even affect that many
cases.
Furthermore, a style change reflow *cannot* be optimized away, since
style change reflows are coalesced -- if a style change affects the
style of an element and some of its descendants, we'll do a style change
reflow targeted only at the ancestor. This happens if it's an inherited
property that's changing and that's inherited, or even if multiple
properties are changing.
In other words, "style change" is the reflow type that says "wipe out
everything and start over". Resize reflow allow preservation of
intrinsic width information and other optimizations. All the other
reflow types (I think -- I'm saying this from memory, and I might have
forgotten one, but I hope not) mean whatever the caller in that
particular case wants them to mean.
Comment 30•22 years ago
|
||
I thought that I fixed all those style change -> resize reason changes in bug
108340. Obviously I missed one file :-(. With some more thought I think
nsTableFrame::IR_StyleChanged should be similiar to
http://lxr.mozilla.org/seamonkey/source/layout/html/table/src/nsTableRowFrame.cpp#1216
. Then the the reflow will be passed as a style change reflow . As this will
probably influence the table layout setting the flag to initialize the strategy
again will still be necessary. To bring the table in accordance with the new
layout a resize (nextReason = eReflowReason_Resize;) with all optimizations
would do the job.
This would also make the cases when the incremental reflow is targeted at the
table or its childs more symmetrical.
Whiteboard: [patch] → [patch] [reflow-reason]
*** Bug 214413 has been marked as a duplicate of this bug. ***
Comment 32•22 years ago
|
||
I believe it would be better to fix this inside the style change routine
*** Bug 214878 has been marked as a duplicate of this bug. ***
Comment 34•22 years ago
|
||
*** Bug 215014 has been marked as a duplicate of this bug. ***
This testcase shows that neither patch is correct.
Since neither patch actually does the right thing for resizing the tables, I
think I prefer my patch, since it at least doesn't cause more reflows than we
had before, whereas I think Bernd's patch does.
Comment 37•22 years ago
|
||
I dont see where my patch fails with the testcase (win98).
After pressing the "Resize TABLEs" button, the first table isn't resized, so its
text ends up on two lines, and the third and fourth tables aren't resized, so
that they don't contain all their text.
Comment 39•22 years ago
|
||
David are you sure that you applied my patch? I see that the current trunk and
your patch fail on the testcase, but with my patch it looks OK.
for the first table
trunk: table does not resize, text does exceed the table cell
your patch: table does not resize horizontal, text is wrapped
my patch: table does resize horizontal, text does not wrap, text is fully
contained in the table cell.
If you are sure that you applied the patch, could you attach a reflow log for
the first table.
Comment on attachment 128884 [details] [diff] [review]
patch
I must have tested the wrong tree.
Attachment #128884 -
Flags: superreview+
Attachment #128884 -
Flags: review+
Attachment #128884 -
Flags: approval1.5b?
![]() |
||
Comment 41•22 years ago
|
||
Try to activate autoscroll with middle click (Firebird) on the XML page, it will
mess the format even further.
that's bug 215762
![]() |
||
Comment 43•22 years ago
|
||
Comment on attachment 128884 [details] [diff] [review]
patch
approved for 1.5b.
/be
Attachment #128884 -
Flags: approval1.5b? → approval1.5b+
->Bernd
Assignee: dbaron → bernd.mielke
Fix checked in to trunk (at Bernd's request), 2003-08-13 23:15 -0700.
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
*** Bug 216205 has been marked as a duplicate of this bug. ***
*** Bug 216645 has been marked as a duplicate of this bug. ***
Comment 48•22 years ago
|
||
*** Bug 217338 has been marked as a duplicate of this bug. ***
Attachment #128884 -
Flags: approval1.4.x?
Comment 49•22 years ago
|
||
If this gets approved, David could you please check it in, I don't build
branches. Thanks
Comment 50•22 years ago
|
||
Comment on attachment 128884 [details] [diff] [review]
patch
This is not going to make 1.4.1. Please re-request aproval after 1.4.1 ships
if you'd like to get this in for 1.4.2.
Attachment #128884 -
Flags: approval1.4.x? → approval1.4.x-
Comment 51•22 years ago
|
||
Comment on attachment 128884 [details] [diff] [review]
patch
approved for 1.4.1
Attachment #128884 -
Flags: approval1.4.x- → approval1.4.x+
Fix checked in to MOZILLA_1_4_BRANCH, 2003-09-04 06:55 -0700.
Keywords: fixed1.4.1
Attachment #128189 -
Flags: review?(bernd.mielke)
![]() |
||
Comment 53•22 years ago
|
||
Note that this caused bug 222467
Comment 54•21 years ago
|
||
*** Bug 223524 has been marked as a duplicate of this bug. ***
Comment 55•21 years ago
|
||
*** Bug 201639 has been marked as a duplicate of this bug. ***
Comment 56•21 years ago
|
||
something similar happens here too
http://www.meyerweb.com/eric/css/edge/raggedfloat/demo.html
Is bug 237139 a duplicate
You need to log in
before you can comment on or make changes to this bug.
Description
•