better text frame invalidation

NEW
Unassigned

Status

()

Core
Layout
P3
normal
18 years ago
9 years ago

People

(Reporter: buster, Unassigned)

Tracking

Trunk
mozilla1.2alpha
x86
Windows NT
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

18 years ago
this is a better patch than the one I checked in for how text frames should
invalidate themselves:

Index: html/base/src/nsTextFrame.cpp
===================================================================
RCS file: /cvsroot/mozilla/layout/html/base/src/nsTextFrame.cpp,v
retrieving revision 1.283
diff -u -r1.283 nsTextFrame.cpp
--- nsTextFrame.cpp	2001/01/04 20:44:01	1.283
+++ nsTextFrame.cpp	2001/02/15 23:42:35
@@ -4379,16 +4379,16 @@
   else {
     mState &= ~TEXT_OPTIMIZE_RESIZE;
   }
-
+
   // If it's an incremental reflow command, then invalidate our existing
   // bounds.
   // XXX We need a finer granularity than this, but it isn't clear what
   // has actually changed...
-  if (eReflowReason_Incremental == aReflowState.reason ||
-      eReflowReason_Dirty == aReflowState.reason) {
+  if (NS_UNCONSTRAINEDSIZE!=aReflowState.availableWidth) {
     maxFrameWidth  = PR_MAX(maxFrameWidth,  mRect.width);
     maxFrameHeight = PR_MAX(maxFrameHeight, mRect.height);
-    Invalidate(aPresContext, nsRect(0,0,maxFrameWidth,maxFrameHeight));
+    nscoord invalidateWidth = PR_MAX(aReflowState.availableWidth, aMetrics.width);
+    Invalidate(aPresContext, nsRect(0,0,invalidateWidth,maxFrameHeight));
   }



This patch invalidates less frequently when text is inside of tables, and it
invalidates less in some cases.

Comment 1

18 years ago
Buster has attached the patch already, so I'll review it, get it approved and
get it in asap.
Status: NEW → ASSIGNED
Keywords: patch
Priority: -- → P3
Target Milestone: --- → mozilla0.9

Comment 2

18 years ago
Milestone shift --> Moz 0.8.1
Target Milestone: mozilla0.9 → mozilla0.8.1

Comment 3

18 years ago
Created attachment 27540 [details] [diff] [review]
Patch of buster's proposed change: needs more testing I think

Comment 4

18 years ago
Moving out to Moz1.0
Target Milestone: mozilla0.8.1 → mozilla1.0

Updated

17 years ago
Target Milestone: mozilla1.0 → mozilla1.2
roc, what do you think of this patch?
First, maxFrameWidth/Height are silly because they're always equal to
mRect.width/height coming in here.

I guess it looks okay. We might invalidate more when we're not reflowing
unconstrained, because we'll invalidate to the end of the line, but I guess in
most cases we'll invalidate that anyway due to next-in-flow text.

I wonder if we should move inline frame invalidation up to nsBlockFrame. In most
cases if anything's changed we need to invalidate the entire line anyway.
Assignee: attinasi → nobody
Status: ASSIGNED → NEW
QA Contact: chrispetersen → layout
You need to log in before you can comment on or make changes to this bug.