This does two somewhat-expensive operations: 1) A virtual GetType() call. Most consumers do it too, so we do it twice. I think we should just assert the type and fix the one consumer that currently doesn't do the type check. 2) Getting style data. We can use state bits on the placeholder to keep track of what kind of out-of-flow it's a placeholder for; this is a frame-lifetime invariant. This only shows up as a problem on things like the bug 424715 testcase, and is only about 3-4% of that testcase, so maybe not worrying about?
Yeah but it's simple and easy so why not? Maybe Mats can do it.
Created attachment 412601 [details] [diff] [review] Part 1: nix type check
Attachment #412601 - Flags: review?(roc)
Created attachment 412602 [details] [diff] [review] Part 2: use a bit for the placeholder type
Attachment #412602 - Flags: review?(roc)
8 years ago
Assignee: nobody → bzbarsky
Summary: Consider optimizing nsLayoutUtils::GetFloatFromPlaceholder a bit → [FIX]Consider optimizing nsLayoutUtils::GetFloatFromPlaceholder a bit
Attachment #412601 - Flags: review?(roc) → review+
Attachment #412602 - Flags: review?(roc) → review+
Pushed: http://hg.mozilla.org/mozilla-central/rev/564f5cc14da1 http://hg.mozilla.org/mozilla-central/rev/168606de059d
Status: NEW → RESOLVED
Last Resolved: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.3a1
You need to log in before you can comment on or make changes to this bug.