Closed Bug 1682006 Opened 5 years ago Closed 5 years ago

Don't call Truncate() on the return string in GetPropertyValue.

Categories

(Core :: DOM: CSS Object Model, defect, P2)

defect

Tracking

()

RESOLVED FIXED
85 Branch
Tracking Status
firefox85 --- fixed

People

(Reporter: emilio, Assigned: emilio)

Details

Attachments

(2 files)

Instead, assert it's empty.

Turns out this causes a bit of overhead when appending to an AutoString,
because Truncate() calls SetToEmptyBuffer(), which makes it go from
inline-string to buffer string, and next time we append we need to turn
the string from a buffer-based string to an inline string again, which
is some minor, but measurable, work, while profiling some
micro-benchmarks.

Probably we should make Truncate() a no-op for a zero-length string, but
I'll send that separately.

Severity: -- → N/A
Priority: -- → P2
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/2809cb024474 Don't call Truncate() on the return string in GetPropertyValue. r=xidorn https://hg.mozilla.org/integration/autoland/rev/ca95578df71a Avoid silly propID -> string -> propID conversion in nsComputedDOMStyle. r=xidorn
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → 85 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: