Open Bug 1536016 Opened 6 years ago Updated 3 years ago

[wpt-sync] Sync PR 15830 - Uses WTF::String::Number instead of WTF::String::format in CSSPrimitiveValue::CustomCSSText.

Categories

(Core :: CSS Parsing and Computation, enhancement, P4)

enhancement

Tracking

()

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 15830 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/15830
Details from upstream follow.

Johnny(Jianning) Ding <jnd@chromium.org> wrote:

Uses WTF::String::Number instead of WTF::String::format in CSSPrimitiveValue::CustomCSSText.

CSSPrimitiveValue::CustomCSSText can be called huge amount of times
through InspectorDOMSnapshotAgent::getSnapshot. It underlyingly calls
WTF::String::format which is sort of expensive by considering the huge
call volume.

Actually CustomCSSText only needs to convert number to string. And

WTF::String provides a cheaper way, String::Number, to achieve same
goal.
Change-Id: I896981f54aa0e327c85d6bc4cb87dd9a0291e124
Reviewed-on: https://chromium-review.googlesource.com/1512138
WPT-Export-Revision: b4735187cb5e0d6f24efbd4e75ba8a8bb0e69dbb

Component: web-platform-tests → CSS Parsing and Computation
Product: Testing → Core
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.