Cleanup BindToTree a bit.
Categories
(Core :: DOM: Core & HTML, task)
Tracking
()
Tracking | Status | |
---|---|---|
firefox69 | --- | fixed |
People
(Reporter: emilio, Assigned: emilio)
References
Details
Attachments
(4 files)
Add a struct argument that can pass more information if wanted via members.
This was going to be more fancy when I initially thought about it, but as it turns out most of the information we need is already in the parent node.
Assignee | ||
Comment 1•5 years ago
|
||
This is all automatic, and thus there are some things that may break because of
this and will be fixed in the next patch.
Steps are:
$ for file in $(rg 'nsresult BindToTree(' | cut -d : -f 1 | sort | uniq); do sed -i 's#nsresult BindToTree(Document* aDocument, nsIContent* aParent,#nsresult BindToTree(BindContext&, nsINode& aParent)#g' $file; done
$ for file in $(rg 'nsresult BindToTree(' | cut -d : -f 1 | sort | uniq); do sed -i 's# nsIContent* aBindingParent) override#override#g' $file; done
$ for file in $(rg '::BindToTree(' | cut -d : -f 1 | sort | uniq); do sed -i 's#::BindToTree(Document* aDocument, nsIContent* aParent,#::BindToTree(BindContext& aContext, nsINode& aParent)#g' $file; done
$ for file in $(rg '::BindToTree(' | cut -d : -f 1 | sort | uniq); do sed -i 's#nsIContent* aBindingParent)##g' $file; done
$ for file in $(rg '::BindToTree(' | cut -d : -f 1 | sort | uniq); do sed -i 's#::BindToTree(aDocument, aParent, aBindingParent)#::BindToTree(aContext, aParent)#g' $file; done
$ ./mach clang-format
Assignee | ||
Comment 2•5 years ago
|
||
This patch is to be squashed with the previous one.
BindContext was going to have way more information at first, but then I realized
that most of the things I wanted to know were basically a flag away using the
parent node.
Still I think it's worth it, now experimenting with BindToTree will only mean
adding a field to a struct that's included from three cpp files, instead of a
massive pain.
I also think this is clearer, and doing this highlights quite a few
inconsistencies in our code which I've left untouched, but commented with
FIXMEs.
Depends on D32948
Assignee | ||
Comment 3•5 years ago
|
||
They're supposed to be, but they have diverged quite a bit...
This unifies them again.
Depends on D32949
Updated•5 years ago
|
Assignee | ||
Comment 4•5 years ago
|
||
And use it to avoid some pointer chases per the review comments of D32949.
Depends on D32950
Pushed by emilio@crisal.io: https://hg.mozilla.org/integration/autoland/rev/1ec6f486c83f Change the signature of BindToTree to be (BindContext&, nsINode& aParentNode). r=bzbarsky https://hg.mozilla.org/integration/autoland/rev/5ec67eb98069 Make CharacterData::BindToTree and Element::BindToTree more parallel. r=bzbarsky https://hg.mozilla.org/integration/autoland/rev/eebaba0f3ed7 Cache owner doc in the BindContext. r=bzbarsky
Comment 6•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/1ec6f486c83f
https://hg.mozilla.org/mozilla-central/rev/5ec67eb98069
https://hg.mozilla.org/mozilla-central/rev/eebaba0f3ed7
Description
•