Closed Bug 420069 Opened 18 years ago Closed 18 years ago

PGO layout regression with horizontal lists of links

Categories

(Core :: Layout, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

VERIFIED FIXED

People

(Reporter: stevee, Assigned: dbaron)

References

Details

(Keywords: regression, testcase, Whiteboard: [pgo])

Attachments

(6 files)

Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9b4pre) Gecko/2008022714 Minefield/3.0b4pre ID:2008022714 Samson from the mz forum noticed this and provided the start of this testcase. 1. New profile, start firefox 2. Load testcase Expected: - Mozilla Mozilla Mozilla Mozilla Mozilla Mozilla Actual: - MozillaMozillaMozillaMozillaMozillaMozilla Works: 20080227_1215_firefox-3.0b4pre.en-US.win32 Broken: 20080227_1248_N_firefox-3.0b4pre.en-US.win32 Checkins to module PhoenixTinderbox between 2008-02-27 12:15 and 2008-02-27 12:47 : http://bonsai.mozilla.org/cvsquery.cgi?module=PhoenixTinderbox&date=explicit&mindate=1204143300&maxdate=1204145279 The turning on off PGO lies within this range: http://bonsai.mozilla.org/cvsquery.cgi?treeid=default&module=all&branch=HEAD&branchtype=match&dir=&file=&filetype=match&who=&whotype=match&sortby=Date&hours=2&date=explicit&mindate=1204143300&maxdate=1204145279&cvsroot=%2Fcvsroot
Flags: blocking1.9?
Whiteboard: pgo
Whiteboard: pgo → [pgo]
When the bug appears, does DOM Inspector report the right specified style for the padding? The right computed style? Would be nice to pin down whether it's CSS parsing, style computation, or layout that's being miscompiled...
Firebug reports that computed padding is 8px for each of top/right/bottom/left on the <a> element.
OK, so the issue is somewhere in the layout code... Someone want to spin up a PGO-enabled debug build with the layout-debugger extension and see what the frame tree looks like?
I have debug symbols on this PGO build I just made, but I didn't --enable-debug. I'm out of luck there, aren't I? My plan was to run this through TUnit and mochitest anyway.
For what it's worth, I suspect it's probably the same bug that's causing two of the text-indent reftests to fail in a PGO build. We're misrendering the first case in mozilla/layout/reftests/text-indent/text-indent-intrinsic-pref-ref.html and mozilla/layout/reftests/text-indent/text-indent-intrinsic-min-ref.html by putting the margin-left on both sides of the span instead of just the left side. (This is from bug 420092 comment 2; skip to bug 420092 comment 14 after reading that.)
Yeah, I think you need to --enable-debug and enable the layoutdebug extension (or whatever it's called) to get the frame dump.
The behavior is consistent with a bug where nsContainerFrame::DoInlineIntrinsicWidth is somehow crossing padding and margin and thus handling the margin twice and the padding not at all.
And now that I look at it, I think this code is probably invalid: nsStyleCoord tmp; // This goes at the beginning no matter how things are broken and how // messy the bidi situations are, since per CSS2.1 section 8.6 // (implemented in bug 328168), the startSide border is always on the // first line. aData->currentLine += GetCoord(stylePadding->mPadding.Get(startSide, tmp), 0) + styleBorder->GetBorderWidth(startSide) + GetCoord(styleMargin->mMargin.Get(startSide, tmp), 0); since it's using tmp for both temporaries and assuming the result comes out of one before the other starts.
Attached patch possible patchSplinter Review
I bet this fixes it (though I don't have a setup to test; I haven't even run the patch yet, but it does compile). The code that this patches was depending on undefined order-of-evaluation.
Attachment #306353 - Flags: superreview?(roc)
Attachment #306353 - Flags: review?(roc)
And in the longer term I think we should probably inline nsStyleCoord's copy constructor and then make nsStyleSides::Get* just return nsStyleCoords by value. I should also add reftests for the various cases to test this function better; we only tested margin-left in current reftests.
This applies on top of the previous patch, and fixes the broken API (from back when we had rules against returning structs by value). Still want to run a few more tests on this one before requesting reviews, and I think it can wait until after beta4.
Assignee: nobody → dbaron
Status: NEW → ASSIGNED
Oh, and while writing attachment 306396 [details] [diff] [review], I was paying attention to whether there were any more occurrences of the broken pattern. I didn't find any. All other uses seemed to be separated by ";", "||", or "&&".
Attachment #306353 - Flags: superreview?(roc)
Attachment #306353 - Flags: superreview+
Attachment #306353 - Flags: review?(roc)
Attachment #306353 - Flags: review+
Attached patch reftestsSplinter Review
These cover the broken code better; I'll land them when the tree reopens.
Comment on attachment 306396 [details] [diff] [review] ... and fix the broken API This passes reftests (except mozilla/layout/reftests/text/zwnj-02.html and mozilla/layout/reftests/bidi/386339.html, which don't seem at all related to this patch and I presume fail without it) and passes style system mochitests.
Attachment #306396 - Flags: superreview?(roc)
Attachment #306396 - Flags: review?(roc)
Comment on attachment 306353 [details] [diff] [review] possible patch Want to get the simple fix in for beta4.
Attachment #306353 - Flags: approval1.9b4?
Attached file Dehydra GCC script
I took a crack at making a Dehydra GCC script to detect bugs of this sort. The pattern I am looking for is an subexpression that does not contain internal sequence points that has a variable that is either (a) written more than once (as in this bug) or (b) written and read. The script does detect this bug, but when I ran it on the rest of layout, all else I got was a few false positives. This may be evidence that there aren't other bugs of this sort, at least in layout.
Comment on attachment 306353 [details] [diff] [review] possible patch a1.9b4+=damons
Attachment #306353 - Flags: approval1.9b4? → approval1.9b4+
I assume this is causing weird layout issues I'm seeing on facebook.com?
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9b4pre) Gecko/2008022901 Minefield/3.0b4pre ID:2008022901 Testcase now WFM.
Testcase WFM also XP 2008022906. And an issue I saw on yahoo.com is also fixed that was the same bug as this.
Gmail tags alignment fixed aswell
The issue that prompted me to post in the build forums for www.iguanadons.net is fixed as well.
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
--> VERIFIED per comments 23, 24, 25 and 26.
Status: RESOLVED → VERIFIED
Attachment #306396 - Flags: superreview?(roc)
Attachment #306396 - Flags: superreview+
Attachment #306396 - Flags: review?(roc)
Attachment #306396 - Flags: review+
Comment on attachment 306396 [details] [diff] [review] ... and fix the broken API a1.9=beltzner
Attachment #306396 - Flags: approval1.9? → approval1.9+
Attachment 306396 [details] [diff] checked in to trunk, 2008-03-05 16:05 -0800.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: