Closed Bug 1335305 Opened 8 years ago Closed 8 years ago

stylo: nsAttrValue::ToString mutates |this| in the eCSSDeclaration case

Categories

(Core :: CSS Parsing and Computation, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla54
Tracking Status
firefox54 --- fixed

People

(Reporter: bholley, Assigned: bholley)

References

Details

Attachments

(1 file)

Looks like this optimization was added in bug 582228, so presumably this caching is pretty important. However, I _think_ it's mostly important in the main-thread case when we're doing getAttribute("style"). It's technically possible to reach this path during selector matching for attribute selectors, but I doubt the perf is critical there. I'll attach a patch.
No longer depends on: stylo-static-analysis
Comment on attachment 8831939 [details] [diff] [review] Don't cache stringifications for CSS declaration blocks during parallel traversal. v1 r=me, though this is only OK because really no one ever matches on "style" attributes... and there is no way to wildcard-match on attribute name.
Attachment #8831939 - Flags: review?(bzbarsky) → review+
Actually, I think it's worth introducing an explicit flag that we can just set a global flag when we kick over to the parallel servo traversal. That way we can check for this case as needed without worrying about the TLS hit.
Depends on: 1335319
Actually, isn't the first selector-match always done with exclusive access to the element? Subsequent ones during the first restyle would only be in the same thread for the style sharing cache, and we don't bother caching elements with style attribute anyway.
(In reply to Emilio Cobos Álvarez [:emilio] from comment #5) > Actually, isn't the first selector-match always done with exclusive access > to the element? Subsequent ones during the first restyle would only be in > the same thread for the style sharing cache, and we don't bother caching > elements with style attribute anyway. Yes, but we have no way of enforcing this invariant, so I don't want to depend on it in Gecko.
(In reply to Boris Zbarsky [:bz] (still a bit busy) from comment #3) > Comment on attachment 8831939 [details] [diff] [review] > Don't cache stringifications for CSS declaration blocks during parallel > traversal. v1 > > r=me, though this is only OK because really no one ever matches on "style" > attributes... and there is no way to wildcard-match on attribute name. I'm updating this to use the flag in bug 1335319, which should eliminate the TLS overhead here.
Assignee: nobody → bobbyholley
Pushed by bholley@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/2869274f6532 Don't cache stringifications for CSS declaration blocks during parallel traversal. r=bz
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla54
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: