Closed Bug 372365 Opened 19 years ago Closed 19 years ago

Clientwidth returns something differently now for tables

Categories

(Core :: Layout, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: martijn.martijn, Assigned: MatsPalmgren_bugz)

References

()

Details

(Keywords: regression, testcase)

Attachments

(7 files, 1 obsolete file)

Attached file testcase
This was mentioned at Hendrix feedback: http://groups.google.com/group/mozilla.feedback/browse_thread/thread/1149af0cac4ea0d9/f0f1b01485de0d1e#f0f1b01485de0d1e This regressed between 2006-01-25 and 2006-01-26, so probably a regression from the frame display lists patch. See also testcase, you should see 3 squares inside the gray area.
Attached file Testcase #2
OS: Windows XP → All
Hardware: PC → All
Attached image Screenshot, IE7
Attached image Screenshot, Opera 9.02
Attached patch Patch rev. 1 (obsolete) — Splinter Review
The problem is that bug 317375 removed *|*::-moz-table-outer { ... - border: inherit; so that GetUsedBorder() is zero for the outer table frame. layout/style/nsComputedDOMStyle.cpp was updated: http://bonsai.mozilla.org/cvsblame.cgi?file=/mozilla/layout/style/nsComputedDOMStyle.cpp&rev=1.166&root=/cvsroot&mark=2482-2489#2477 but we need to do it for other DOM stuff that calculates dimensions too. With this patch we get the same result as Firefox 2.0.0.2 for the testcase.
Assignee: nobody → mats.palmgren
Status: NEW → ASSIGNED
Attachment #257153 - Flags: superreview?(roc)
Attachment #257153 - Flags: review?(roc)
Why do you need to modify GetClientAreaSize? Isn't the frame already corrected by GetScrollInfo? nsIFrame *frame = presShell->GetPrimaryFrameFor(this); if (!frame) { return; } + if (frame->GetType() == nsGkAtoms::tableOuterFrame) { + frame = frame->GetFirstChild(nsnull); + } How about moving this code to a shared static helper, say GetStyledFrameFor? You'd call it from GetScrollInfo and GetOffsetRect. Hmm, you could also share GetCurrentDoc, GetShellAt and FlushPendingNotifications calls in there. Otherwise OK.
Attached patch Patch rev. 2Splinter Review
Nits fixed. I found that there is a base class method that does the flush-then-get-frame thing. Additionally, I made GetScrollInfo() always initialize its out params and improved the documentation a bit. There are a few code sharing improvements also in bug 111207, in case you want to look at those at the same time... ;-)
Attachment #257519 - Flags: superreview?(roc)
Attachment #257519 - Flags: review?(roc)
Attachment #257153 - Attachment is obsolete: true
Attachment #257153 - Flags: superreview?(roc)
Attachment #257153 - Flags: review?(roc)
Attachment #257519 - Flags: superreview?(roc)
Attachment #257519 - Flags: superreview+
Attachment #257519 - Flags: review?(roc)
Attachment #257519 - Flags: review+
Checked in to trunk at 2007-03-15 13:43 PST. -> FIXED
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Flags: in-testsuite?
Resolution: --- → FIXED
This may have caused bug 375003.
Depends on: 375003
Depends on: 380962
Depends on: 383898
So how come tests were not checked in with the patch? What's the plan for getting them in, Mats? Is something blocking them? Also, see bug 383898.
(In reply to comment #11) > So how come tests were not checked in with the patch? What's the plan for > getting them in, Mats? Is something blocking them? I will add mochitests on bug 375003 that covers this bug and more. > Also, see bug 383898. Fixed by the patch on bug 375003. Sorry for the regression.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: