Closed
Bug 1325850
Opened 7 years ago
Closed 5 years ago
Need automated tests of nsIContentIterator
Categories
(Core :: DOM: Core & HTML, task, P3)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla66
Tracking | Status | |
---|---|---|
firefox66 | --- | fixed |
People
(Reporter: masayuki, Assigned: masayuki)
References
Details
Attachments
(2 files)
nsIContentIterator initializes its member with complicated logic. On the other hand, it's not tested so many cases. However, we've found some bugs in some edge cases. So, for reducing the risk of touching the implementation, we should have automated tests for this. I think that we should make nsIContentIterator scriptable and its instance creatable with nsIDOMWIndowUtils.
Updated•7 years ago
|
Priority: -- → P3
Assignee | ||
Comment 1•5 years ago
|
||
I think I can fix this by new-year vacation.
Assignee: nobody → masayuki
Status: NEW → ASSIGNED
status-firefox53:
affected → ---
OS: Unspecified → All
Hardware: Unspecified → All
Assignee | ||
Comment 2•5 years ago
|
||
And I think that we shouldn't make nsIContentIterator scriptable directly because we already have some methods which take non-scriptable concrete classes for improving its performance. So, I think that there should be nsIScriptableContentIterator and its implementation should be simple delegator for nsIContentIterator.
Assignee | ||
Comment 3•5 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=3a9f694a60474c37166f80c1643ffac4e5774400
Assignee | ||
Comment 4•5 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=f0abb3ee8ada9ae4139228c7992b8f91cc7cf25c
Assignee | ||
Comment 5•5 years ago
|
||
The concrete classes of nsIContentIterator are enough complicated, but they are not tested simply. Therefore, it's dangerous to touch them even if we meed bugs of them. Additionally, it's used in some hot paths, therefore, I'd like to keep them simple as far as possible. Therefore, this patch creates a mediator class between script and each nsIContentIterator instance. So, this change shouldn't affect any of actual behavior nor performance.
Assignee | ||
Comment 6•5 years ago
|
||
nsContentIterator in post-order collects nodes starting from deepest first child to next siblings and parents. I.e., collecting end points (i.e., "close tag" if element node). This is tested by test_content_iterator_post_order.html. nsContentIterator in pre-order collects nodes starting from most ancestor to last deepest child node. I.e., collecting start points (i.e., "open tag" if element node). This is tested by test_content_iterator_pre_order.html. nsContentSubtreeIterator collects most ancestor nodes which are selected entirely by specified range or positions. This is tested by test_content_iterator_subtree.html I.e., all of them start with "test_content_iterator_" for making find easier.
Pushed by masayuki@d-toybox.com: https://hg.mozilla.org/integration/autoland/rev/7cf2438bcd34 part 1: Create ScriptableContentIterator to make each concrete class of nsIContentIterator scriptable r=smaug https://hg.mozilla.org/integration/autoland/rev/154121847683 part 2: Add automated tests for nsIContentIterator concrete classes r=smaug
Comment 8•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/7cf2438bcd34 https://hg.mozilla.org/mozilla-central/rev/154121847683
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
status-firefox66:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla66
Updated•5 years ago
|
Component: DOM → DOM: Core & HTML
Updated•5 years ago
|
Type: defect → task
You need to log in
before you can comment on or make changes to this bug.
Description
•