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)
Core
CSS Parsing and Computation
Tracking
()
RESOLVED
FIXED
mozilla54
Tracking | Status | |
---|---|---|
firefox54 | --- | fixed |
People
(Reporter: bholley, Assigned: bholley)
References
Details
Attachments
(1 file)
1.28 KB,
patch
|
bzbarsky
:
review+
|
Details | Diff | Splinter Review |
Discovered by the static analysis in bug 1294915. This isn't threadsafe:
http://searchfox.org/mozilla-central/rev/f31f538622d0dfb2d869d4babc4951f6001e9be2/dom/base/nsAttrValue.cpp#650
Assignee | ||
Comment 1•8 years ago
|
||
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.
Assignee | ||
Comment 2•8 years ago
|
||
Attachment #8831939 -
Flags: review?(bzbarsky)
Assignee | ||
Updated•8 years ago
|
Blocks: stylo-static-analysis
No longer depends on: stylo-static-analysis
Comment 3•8 years ago
|
||
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+
Assignee | ||
Comment 4•8 years ago
|
||
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.
Comment 5•8 years ago
|
||
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.
Assignee | ||
Comment 6•8 years ago
|
||
(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.
Assignee | ||
Comment 7•8 years ago
|
||
(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 | ||
Updated•8 years ago
|
Assignee: nobody → bobbyholley
Assignee | ||
Comment 8•8 years ago
|
||
Assignee | ||
Comment 9•8 years ago
|
||
Comment 10•8 years ago
|
||
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
Comment 11•8 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 8 years ago
status-firefox54:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla54
You need to log in
before you can comment on or make changes to this bug.
Description
•