Closed Bug 276236 Opened 20 years ago Closed 20 years ago

Contents w/ opacity in <button> laid out incorrectly

Categories

(Core :: Layout: Form Controls, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: harunaga, Assigned: MatsPalmgren_bugz)

References

()

Details

(Keywords: testcase)

Attachments

(2 files, 4 obsolete files)

Contents with opacity < 1 inside <button> are laid out incorrectly
as if other floater didn't exist.

Steps:
Load the URL.

Actual result:
Contents with opacity < 1 inside <button> are laid out too left.

Another testcase in which <button>s are not in floater:
http://bugzilla.mozilla.gr.jp/attachment.cgi?id=2522&action=view
This causes similar problem, although the result depends on reloading,
back/forward and Site Navigation Bar enabled/disabled.
Similar to bug 131698 - after re-parenting a frame we need to update
NS_FRAME_HAS_CHILD_WITH_VIEW on the new ancestors.
Assignee: nobody → mats.palmgren
Component: Layout: Floats → Layout: Form Controls
Attached file Testcase
Keywords: testcase
Summary: Contents w/ opacity in <button> laid out incorrectly as if other floater didn't exist → Contents w/ opacity in <button> laid out incorrectly
Attached patch Patch rev. 1 (obsolete) — Splinter Review
Attachment #169780 - Flags: superreview?(dbaron)
Attachment #169780 - Flags: review?(bzbarsky)
If this is always just moving frames constructed for the parent to the child,
then why not just propagate the ...HAS_CHILD_WITH_VIEW bit from the parent to
the child?  If not, then shouldn't you be making sure to reparent the views (as
the helper functions in nsHTMLContainerFrame do)?
(In reply to comment #4)
> If this is always just moving frames constructed for the parent to the child

ReParentFrameList() is called from SetInitialChildList(), AppendFrames(),
InsertFrames() and ReplaceFrame() - I wasn't sure I could trust the
parent pointers for the given list of frames to have any specific value...

After some tests it looks like it's always set to the ButtonControlFrame (this)
or its area frame (mFrames.FirstChild()). However, unless someone can say for
sure that this is always true, I will extend the current patch to do view
re-parenting also...
Attached patch Patch rev. 2 (obsolete) — Splinter Review
Reparent views also.
(I couldn't find a testcase where this was actually needed though).
Attachment #169780 - Attachment is obsolete: true
Attachment #169799 - Flags: superreview?(dbaron)
Attachment #169799 - Flags: review?(bzbarsky)
Attachment #169780 - Flags: superreview?(dbaron)
Attachment #169780 - Flags: review?(bzbarsky)
Well, it looks like it would be, since those methods should normally be called
when changing the child list of the frame itself.
> it looks like it's always set to the ButtonControlFrame (this)
> or its area frame (mFrames.FirstChild()). 

That's correct.  If it's not one of those two, someone screwed up badly.
Which means this should me much simpler -- just propagate the
NS_FRAME_HAS_CHILD_WITH_VIEW bit from parent to child.
Attached patch Patch rev. 3 (obsolete) — Splinter Review
Attachment #169799 - Attachment is obsolete: true
Attachment #169862 - Flags: superreview?(dbaron)
Attachment #169862 - Flags: review?(bzbarsky)
Attachment #169799 - Flags: superreview?(dbaron)
Attachment #169799 - Flags: review?(bzbarsky)
Comment on attachment 169862 [details] [diff] [review]
Patch rev. 3

We never remove NS_FRAME_HAS_CHILD_WITH_VIEW anywhere else, so

mFrames.FirstChild()->AddStatebits(GetStateBits() &
NS_FRAME_HAS_CHILD_WITH_VIEW);

should be sufficient.
Attached patch Patch rev. 4 (obsolete) — Splinter Review
Attachment #169862 - Attachment is obsolete: true
Attachment #169872 - Flags: superreview?(dbaron)
Attachment #169872 - Flags: review?(bzbarsky)
Attachment #169862 - Flags: superreview?(dbaron)
Attachment #169862 - Flags: review?(bzbarsky)
Comment on attachment 169872 [details] [diff] [review]
Patch rev. 4

r=bzbarsky
Attachment #169872 - Flags: review?(bzbarsky) → review+
Comment on attachment 169872 [details] [diff] [review]
Patch rev. 4

What I wrote in comment 11 is probably considerably more efficient (esp. on
heavily pipelined processors) and easier for compilers to optimize to the other
form in case it's not, but sr=dbaron.
Attachment #169872 - Flags: superreview?(dbaron) → superreview+
Attached patch Patch rev. 5Splinter Review
Sorry, I did not pay attention so I missed that you suggested an alternative.
Of course we should check in the most effecient version...
A quick r+ anyone?
Attachment #169872 - Attachment is obsolete: true
Attachment #170069 - Flags: review?(bzbarsky)
Comment on attachment 170069 [details] [diff] [review]
Patch rev. 5

r=bzbarsky
Attachment #170069 - Flags: review?(bzbarsky) → review+
Checked in 2005-01-02 23:27 PDT.

The leak stats on 'balsa' changed slightly, I find it hard to believe this
patch can have anything to do with it, but I'll keep an eye open.
Let's see what 'brad' says next...

-> FIXED
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
'balsa' went back to the original numbers on the next cycle,
'brad' did not show any difference, so there was no problem.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: