Status

()

enhancement
RESOLVED FIXED
5 months ago
5 months ago

People

(Reporter: emilio, Assigned: emilio)

Tracking

unspecified
mozilla66
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox66 fixed)

Details

Attachments

(17 attachments)

47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
I have some patches that turn nsDocument.h into:

  https://hg.mozilla.org/try/file/07a5f837ca68/dom/base/nsDocument.h

Which means that we can merge it with nsIDocument and rename that to mozilla::dom::Document trivially after that. Still trying to make it build on windows but after that's done I plan to post those patches here.
Assignee

Comment 1

5 months ago
This will be needed for the next patches since the cast from nsIDocument* to
nsISupports* will become ambiguous, and I don't really want to replace all users
of nsCOMPtr<nsIDocument> with RefPtr.

We have ToSupports to handle this, so use it.
Assignee

Comment 2

5 months ago
Just use nsTArray. They're used to keep an array of strong references to
documents, and never use nsISupports-specific methods.

Plus they're are allocated on the stack so it should be safe to access them via
ranged for, so do that.

This is needed because nsCOMArray<T> depends on the cast from T to nsISupports
not to be ambiguous. I could fix that if needed, but it seems easier to just not
use it in these two cases.

Depends on D15350
Assignee

Comment 3

5 months ago
This is a big step in order to merge both.

Also allows to remove some very silly casts, though it causes us to add some
ToSupports around to deal with ambiguity of casts from nsIDocument to
nsISupports, and add a dummy nsISupports implementation that will go away later
in the series.

Depends on D15351
Assignee

Comment 4

5 months ago
This is done via SetBaseURIUsingFirstBaseWithHref now.

Depends on D15352
Assignee

Comment 8

5 months ago
Now that bindgen can represent it properly (bug 1516365) we can do this.

Depends on D15356
Assignee

Comment 16

5 months ago
This allows us to remove the MOZ_CRASH-ing implementation I added earlier in
this series.

Depends on D15364
Assignee

Comment 17

5 months ago
This needs to add a few of includes in other places which were relying on the
massive (now gone) list in nsDocument.h.

I also needed to move an AnimationTimeline destructor out of line because it
relied on dom::Animation being defined, yet Animation.h includes
AnimationTimeline.h, so include hell.

Depends on D15365
Assignee

Comment 18

5 months ago
I didn't know who of bz or smaug was going to be busiest, so just whoever gets to review the patches first works for me, really :)

Comment 19

5 months ago
Pushed by emilio@crisal.io:
https://hg.mozilla.org/integration/mozilla-inbound/rev/0b47b25aa767
Sprinkle some ToSupports around xpcom. r=froydnj
https://hg.mozilla.org/integration/mozilla-inbound/rev/afc9a2a4fbf9
Remove uses of nsCOMArray<nsIDocument>. r=bzbarsky,smaug
https://hg.mozilla.org/integration/mozilla-inbound/rev/83c1af1bfaaf
Move base classes from nsDocument to nsIDocument. r=smaug
https://hg.mozilla.org/integration/mozilla-inbound/rev/d3d4a2c095db
Remove unused mFirstBaseNodeWithHref member. r=smaug
https://hg.mozilla.org/integration/mozilla-inbound/rev/04d2bdfcd3c2
Remove unused declaration. r=smaug
https://hg.mozilla.org/integration/mozilla-inbound/rev/567f4ee5bcbe
Move some static functions from nsDocument to nsIDocument. r=smaug
https://hg.mozilla.org/integration/mozilla-inbound/rev/944265c10475
Move some setters from nsDocument to nsIDocument. r=smaug
https://hg.mozilla.org/integration/mozilla-inbound/rev/684eb521216e
Move mExpandoAndGeneration from nsDocument to nsIDocument. r=smaug
https://hg.mozilla.org/integration/mozilla-inbound/rev/599dfe52907f
Merge nsIDocument::DocAddSizeOfExcludingThis and nsDocument::DocAddSizeOfExcludingThis. r=smaug
https://hg.mozilla.org/integration/mozilla-inbound/rev/2909ddd2f7b1
Move various miscellaneous methods from nsDocument to nsIDocument. r=smaug
https://hg.mozilla.org/integration/mozilla-inbound/rev/0afa3b75fd66
Move EventTarget methods to nsIDocument. r=smaug
https://hg.mozilla.org/integration/mozilla-inbound/rev/57acc0f12815
Move BlockOnload and UnlockOnload to nsIDocument, and devirtualize them. r=smaug
https://hg.mozilla.org/integration/mozilla-inbound/rev/b6772da1eff1
Move Init, Destroy and RemovedFromDocShell to nsIDocument. r=smaug
https://hg.mozilla.org/integration/mozilla-inbound/rev/87aa3be318fa
Move CloneDocHelper to nsIDocument. r=smaug
https://hg.mozilla.org/integration/mozilla-inbound/rev/947bf2c04aa5
Move NS_DOCUMENT_NOTIFY_OBSERVERS to nsIDocument.h. r=smaug
https://hg.mozilla.org/integration/mozilla-inbound/rev/1c324add4b92
Move CC / nsISupports bits to nsIDocument. r=smaug
https://hg.mozilla.org/integration/mozilla-inbound/rev/16a7aabf4fea
Move nsOnloadBlocker and nsDocumentOnStack to nsDocument.cpp, and shrink nsDocument.h to the minimmum. r=smaug
Assignee

Updated

5 months ago
Blocks: 1516853
You need to log in before you can comment on or make changes to this bug.