Closed
Bug 1424816
Opened 8 years ago
Closed 8 years ago
The Document state cache is not great, and doesn't look very useful
Categories
(Core :: CSS Parsing and Computation, enhancement)
Core
CSS Parsing and Computation
Tracking
()
RESOLVED
FIXED
mozilla59
Tracking | Status | |
---|---|---|
firefox59 | --- | fixed |
People
(Reporter: emilio, Assigned: emilio)
References
Details
Attachments
(1 file)
See bug 1422633, there are assertions missing, and servo doesn't assert at all anymore.
I don't think it's worth optimizing / lazily resolving it, each time the document state changes we usually just restyle the world anyway, and the changes that it's optimizing (nsWindow::SetActive() and xul <browser> attribute changes) aren't common enough to warrant the complexity I'd say.
Comment hidden (mozreview-request) |
Assignee | ||
Comment 2•8 years ago
|
||
Comment on attachment 8936330 [details]
Bug 1424816: Remove the document state cache.
Err, this fails browser_windowactivation.js, but I bet it's because of the method living in nsPresContext...
Attachment #8936330 -
Flags: review?(bugs)
Comment hidden (mozreview-request) |
Comment 4•8 years ago
|
||
Comment on attachment 8936330 [details]
Bug 1424816: Remove the document state cache.
Manish added ThreadSafeGetDocumentState(), perhaps he recalls why it was done that way.
Attachment #8936330 -
Flags: feedback?(manishearth)
Assignee | ||
Comment 5•8 years ago
|
||
(In reply to Olli Pettay [:smaug] (won't be in Austin) from comment #4)
> Comment on attachment 8936330 [details]
> Bug 1424816: Remove the document state cache.
>
> Manish added ThreadSafeGetDocumentState(), perhaps he recalls why it was
> done that way.
The cache was added in bug 508482, fwiw, and there doesn't seem to be any reason for that.
Comment 6•8 years ago
|
||
> Manish added ThreadSafeGetDocumentState(), perhaps he recalls why it was done that way.
That was just to bypass the cache so that Stylo can safely use this. If you remove the cache you can just remove all the threadsafe stuff.
Updated•8 years ago
|
Attachment #8936330 -
Flags: feedback?(manishearth) → feedback+
Comment 7•8 years ago
|
||
I still don't understand what ThreadSafeGetDocumentState is about. Nothing there seems to be threadsafe as such. No atomic being used or mutexes or such.
Comment 8•8 years ago
|
||
Comment on attachment 8936330 [details]
Bug 1424816: Remove the document state cache.
I think I should not review this, since I really don't understand what ThreadSafeGetDocumentState() was trying to capture and why the patch removing it is ok.
Attachment #8936330 -
Flags: review?(bugs)
Comment 9•8 years ago
|
||
It's threadsafe because it *doesn't* hit the cache. It does more work as a tradeoff.
Comment 10•8 years ago
|
||
ThreadSafeGetDocumentState doesn't do much work. It just returns mDocumentState.
And I don't even understand why accessing that is threadsafe. The underlying code doesn't seem to use atomic or such for the value.
Assignee | ||
Comment 11•8 years ago
|
||
Comment on attachment 8936330 [details]
Bug 1424816: Remove the document state cache.
(Talked with Olli on IRC)
Attachment #8936330 -
Flags: review?(bugs)
Comment 12•8 years ago
|
||
It was name ThreadSafeGetDocumentState which is confusing. That method as such isn't thread safe. It is safe only if no one sets the value while that is being called.
So, it is safe in Stylo case, but not in general.
Comment 13•8 years ago
|
||
mozreview-review |
Comment on attachment 8936330 [details]
Bug 1424816: Remove the document state cache.
https://reviewboard.mozilla.org/r/207062/#review213400
::: dom/base/nsIDocument.h:1567
(Diff revision 2)
> {
> nsPIDOMWindowInner* window = GetInnerWindow();
> return window ? window->WindowID() : 0;
> }
>
> + bool IsTopLevelWindowInactive() const;
Rather oddly named method for nsIDocument, but I see we use similar name in PresContext too, so fine.
Attachment #8936330 -
Flags: review?(bugs) → review+
Comment 14•8 years ago
|
||
Pushed by ecoal95@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/5b18567e1737
Remove the document state cache. r=smaug
Comment 15•8 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 8 years ago
status-firefox59:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla59
Updated•8 years ago
|
Assignee: nobody → emilio
You need to log in
before you can comment on or make changes to this bug.
Description
•