Closed Bug 12747 Opened 25 years ago Closed 25 years ago

[perf] height/width: inherit cause massive performance hit

Categories

(Core :: Layout, defect, P2)

x86
Other
defect

Tracking

()

VERIFIED FIXED

People

(Reporter: allen.sam, Assigned: buster)

Details

(Whiteboard: [tescase] [perf])

Attachments

(1 file)

The rules height: inherit and width: inherit cause massive performance hits. See
attached testcase
Whiteboard: [tescase] [perf]
Attached file testcase
Assignee: peterl → troy
Component: Style System → Layout
Assignee: troy → kipp
The problem seems to be an infinite loop in HaveAutoWidth in nsBlockFrame.cpp

In particular this code:

    const nsHTMLReflowState* prs = (const nsHTMLReflowState*)
      aReflowState.parentReflowState;
    if (!prs) {
      return PR_TRUE;
    }
    pos = prs->mStylePosition;

If we're unlucky and the parent reflow state also has 'inherit' (as is the case
with this example), then we'll never exit.

It looks like:
    const nsHTMLReflowState* prs = (const nsHTMLReflowState*)
      aReflowState.parentReflowState;

should be doing something like this instead:
    prs = (const nsHTMLReflowState*)prs->parentReflowState;

Do we really need this code? The HTML reflow state takes 'inherit' into account
when calculating the computed width.
Severity: normal → major
Status: NEW → ASSIGNED
Priority: P3 → P2
Target Milestone: M11
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
A simple infinite loop...fixed
Status: RESOLVED → VERIFIED
verified fixed in 9/10/99 build.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: