Closed Bug 290362 Opened 20 years ago Closed 20 years ago

[FIX]Border-color changes can cause reflow hints

Categories

(Core :: CSS Parsing and Computation, defect, P1)

defect

Tracking

()

RESOLVED FIXED
mozilla1.8beta2

People

(Reporter: bzbarsky, Assigned: bzbarsky)

References

Details

Attachments

(2 files, 1 obsolete file)

See bug 290297.  Should have caught this while fixing bug 275139, really... :(
Blocks: 290297
Attached patch Patch (obsolete) — Splinter Review
The comments say it all.  The header change is removing an unused (and wrong,
looks to me) method.
Attachment #180739 - Flags: superreview?(dbaron)
Attachment #180739 - Flags: review?(dbaron)
Priority: -- → P1
Target Milestone: --- → mozilla1.8beta2
Comment on attachment 180739 [details] [diff] [review]
Patch

>         return NS_STYLE_HINT_VISUAL;
>       }
>     }
>     if (mBorderRadius != aOther.mBorderRadius) {
>       return NS_STYLE_HINT_VISUAL;
>     }

While we're fixing obvious bugs in this code, how about also adding a PRBool
visual = PR_FALSE; at the beginning of the function and changing the above to:

    visual = PR_TRUE;
  }
}
if (visual || mBorderRadius != aOther.mBorderRadius) {
  return NS_STYLE_HINT_VISUAL;
}

Currently a style change from solid to dotted on the top border combined with a
change from none to dotted on the right border will only cause a repaint. 
(That's a pretty easy change to make with shorthands, never mind batching.)
Attachment #180739 - Flags: superreview?(dbaron)
Attachment #180739 - Flags: superreview+
Attachment #180739 - Flags: review?(dbaron)
Attachment #180739 - Flags: review+
(This also led me to filing bug 290377 when I noticed that this gives a reflow
hint for 'border-width' changes even when 'border-style' is 'none'.)
Attachment #180739 - Attachment is obsolete: true
Attachment #180769 - Flags: superreview?(dbaron)
Attachment #180769 - Flags: review?(dbaron)
Comment on attachment 180769 [details] [diff] [review]
Patch fixing both issues

r+sr=dbaron, although these two could be condensed:

>+        (mBorderColors && !aOther.mBorderColors) ||
>+        (!mBorderColors && aOther.mBorderColors)) {

into

 !mBorderColors != !aOther.mBorderColors
Attachment #180769 - Flags: superreview?(dbaron)
Attachment #180769 - Flags: superreview+
Attachment #180769 - Flags: review?(dbaron)
Attachment #180769 - Flags: review+
Comment on attachment 180769 [details] [diff] [review]
Patch fixing both issues

Requesting 1.8 approval for this pretty simple fix.  This should be quite safe.
Attachment #180769 - Flags: approval1.8b2?
Comment on attachment 180769 [details] [diff] [review]
Patch fixing both issues

a=asa
Attachment #180769 - Flags: approval1.8b2? → approval1.8b2+
Fixed.
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: