Closed
Bug 776536
Opened 12 years ago
Closed 12 years ago
Move NodeIterator to Paris bindings
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla22
People
(Reporter: Ms2ger, Assigned: bzbarsky)
References
(Blocks 1 open bug)
Details
Attachments
(5 files)
18.03 KB,
patch
|
Details | Diff | Splinter Review | |
16.07 KB,
patch
|
peterv
:
review+
|
Details | Diff | Splinter Review |
13.39 KB,
patch
|
peterv
:
review+
|
Details | Diff | Splinter Review |
29.92 KB,
patch
|
peterv
:
review+
|
Details | Diff | Splinter Review |
17.16 KB,
patch
|
peterv
:
review+
|
Details | Diff | Splinter Review |
I've got a patch, but it fails <http://mxr.mozilla.org/mozilla-central/source/js/xpconnect/tests/mochitest/test_bug502959.html?force=1>. IIRC, doublewrapped.acceptNode was undefined.
![]() |
Assignee | |
Comment 1•12 years ago
|
||
> IIRC, doublewrapped.acceptNode was undefined.
That's... quite odd. That should be taking the normal xpconnect codepaths....
![]() |
Assignee | |
Comment 2•12 years ago
|
||
I need this and TreeWalker to fix bug 838686. Stealing.
Assignee: nobody → bzbarsky
Blocks: 838686
![]() |
Assignee | |
Comment 3•12 years ago
|
||
On the other hand, there's a good chance that without bug 838686 fixing this bug will just make things fail too, because the WebIDL call won't prevent XPConnect from reporting the exception.
I need to think about patch ordering here a bit.
![]() |
Assignee | |
Updated•12 years ago
|
![]() |
Assignee | |
Comment 4•12 years ago
|
||
Attachment #712207 -
Flags: review?(peterv)
![]() |
Assignee | |
Comment 5•12 years ago
|
||
Attachment #712208 -
Flags: review?(peterv)
![]() |
Assignee | |
Comment 6•12 years ago
|
||
Attachment #712209 -
Flags: review?(peterv)
![]() |
Assignee | |
Comment 7•12 years ago
|
||
WebIDL object, so calling createNodeIterator or createTreeWalker via
an Xray will call the XPCOM versions of those methods. That means
that I can't just disable XPCOM-based wrapping for TreeWalker and
NodeIterator altogether, unfortunately, which means a web page could
try stashing a TreeWalker in something like userdata and then getting
it back and end up wrapping it as an XPCOM object the second time.
I could "fix" that by adding a wrapper cache and whatnot, I guess, if
desired... But the problem will go away once we convert Document in
any case.
Attachment #712210 -
Flags: review?(peterv)
![]() |
Assignee | |
Updated•12 years ago
|
Whiteboard: [need review]
![]() |
Assignee | |
Comment 8•12 years ago
|
||
Try run at https://tbpl.mozilla.org/?tree=Try&rev=84f47dbdf6ce
The M2 bits are all unexpected pass. I'll adjust the failure annotations to deal with that.
The M4 bit I'm looking into.
![]() |
Assignee | |
Comment 9•12 years ago
|
||
So the failures in js/xpconnect/tests/mochitest/test_bug502959.html are because it expects this:
26 var iter = document.createNodeIterator(document, NodeFilter.SHOW_ELEMENT, foo);
27 var doublewrapped = iter.filter;
to make doublewrapped an XPCWrappedNative around an XPCWrappedJS. But per WebIDL, doublewrapped === foo in this case.
So we should probably adjust the test... or something. Blake, any idea how?
Flags: needinfo?(mrbkap)
Reporter | ||
Comment 10•12 years ago
|
||
Comment on attachment 712209 [details] [diff] [review]
part 3. Add a WebIDL API to NodeIterator and TreeWalker.
Review of attachment 712209 [details] [diff] [review]:
-----------------------------------------------------------------
::: content/base/src/NodeIterator.cpp
@@ +183,5 @@
>
> /* readonly attribute nsIDOMNode root; */
> NS_IMETHODIMP NodeIterator::GetRoot(nsIDOMNode * *aRoot)
> {
> + return CallQueryInterface(Root(), aRoot);
Maybe
NS_ADDREF(*aRoot = Root().AsDOMNode());
Reporter | ||
Comment 11•12 years ago
|
||
Comment on attachment 712210 [details] [diff] [review]
part 4. Turn on WebIDL bindings for NodeIterator and TreeWalker. behavior here is a bit weird because Document is still not a
Review of attachment 712210 [details] [diff] [review]:
-----------------------------------------------------------------
::: content/base/src/nsDocument.cpp
@@ +5378,5 @@
> rv).get();
> return rv.ErrorCode();
> }
>
> +already_AddRefed<mozilla::dom::NodeIterator>
Nit: I don't think you need the namespace qualifications in the .cpp.
![]() |
Assignee | |
Comment 12•12 years ago
|
||
> NS_ADDREF(*aRoot = Root().AsDOMNode());
Done, with Root()->AsDOMNode(); and a "return NS_OK;"
> Nit: I don't think you need the namespace qualifications in the .cpp.
Indeed, done.
Comment 13•12 years ago
|
||
(In reply to Boris Zbarsky (:bz) from comment #9)
> So we should probably adjust the test... or something. Blake, any idea how?
Reading the test, I wonder if we can start ripping some of the code out as well as the tests. As I understand it, WebIDL mandates that in cases where we currently hand out double wrapped objects we should instead hand out the original object. Does that mean that we won't have to worry about double wrapped objects in content once we switch entirely over to the new bindings?
Flags: needinfo?(mrbkap)
![]() |
Assignee | |
Comment 14•12 years ago
|
||
For WebIDL objects, there is no double-wrapping. So if we completely stop exposing all JS objects not exposed via WebIDL to web pages, then you're probably right...
But that's a pretty long-term thing. In the short term, what do I do with this test? ;)
Flags: needinfo?(mrbkap)
Comment 15•12 years ago
|
||
I'd say nuke it unless you can think of a non-converted callback. They're getting harder and harder to find (and therefore less and less important).
Flags: needinfo?(mrbkap)
![]() |
Assignee | |
Comment 16•12 years ago
|
||
> I'd say nuke it unless you can think of a non-converted callback.
I nuked it as part of part 4.
Updated•12 years ago
|
Attachment #712207 -
Flags: review?(peterv) → review+
Updated•12 years ago
|
Attachment #712208 -
Flags: review?(peterv) → review+
Updated•12 years ago
|
Attachment #712209 -
Flags: review?(peterv) → review+
Updated•12 years ago
|
Attachment #712210 -
Flags: review?(peterv) → review+
![]() |
Assignee | |
Comment 17•12 years ago
|
||
Pushed:
https://hg.mozilla.org/integration/mozilla-inbound/rev/405218398a2d
https://hg.mozilla.org/integration/mozilla-inbound/rev/a61336552762
https://hg.mozilla.org/integration/mozilla-inbound/rev/0092982b496d
https://hg.mozilla.org/integration/mozilla-inbound/rev/9573386c7adf
Flags: in-testsuite+
Whiteboard: [need review]
Target Milestone: --- → mozilla22
Comment 18•12 years ago
|
||
Unfortunately, I had to backout because something in this push caused a spike in mochitest-a11y assertions.
https://hg.mozilla.org/integration/mozilla-inbound/rev/fb572a342efa
https://tbpl.mozilla.org/php/getParsedLog.php?id=20189591&tree=Mozilla-Inbound
A quick skim of the log shows them to be of the type:
###!!! ASSERTION: bad size recorded: 'aInstanceSize == 0 || entry->GetClassSize() == aInstanceSize', file ../../../xpcom/base/nsTraceRefcntImpl.cpp, line 441
![]() |
Assignee | |
Comment 19•12 years ago
|
||
Apparently refcount logging requires that all class names passed to it be unique. Since there's a "TreeWalker" in a11y code already, have to pass dom::TreeWalker to the addref/release macros. Did that, and:
https://hg.mozilla.org/integration/mozilla-inbound/rev/cbf95d0e6941
https://hg.mozilla.org/integration/mozilla-inbound/rev/5e0a9285a7aa
https://hg.mozilla.org/integration/mozilla-inbound/rev/2ff820824d40
https://hg.mozilla.org/integration/mozilla-inbound/rev/54d365f29ee5
Comment 20•12 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/cbf95d0e6941
https://hg.mozilla.org/mozilla-central/rev/5e0a9285a7aa
https://hg.mozilla.org/mozilla-central/rev/2ff820824d40
https://hg.mozilla.org/mozilla-central/rev/54d365f29ee5
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•