Closed
Bug 867540
Opened 12 years ago
Closed 12 years ago
Search by attribute treats missing attribute as the string "null"
Categories
(Other Applications :: DOM Inspector, defect)
Other Applications
DOM Inspector
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: neil, Assigned: neil)
References
Details
Attachments
(3 files)
1.01 KB,
patch
|
Details | Diff | Splinter Review | |
1.06 KB,
patch
|
Details | Diff | Splinter Review | |
1.17 KB,
patch
|
crussell
:
review+
|
Details | Diff | Splinter Review |
Steps to reproduce problem:
1. Inspect an HTML document
2. Find Nodes
3. Search by attr
4. Enter a bogus attribute name
5. Enter null as the value
Expected result: End of document reached.
Actual result: Matches every element in the document.
Assignee | ||
Comment 1•12 years ago
|
||
This doesn't work for empty attributes.
Assignee | ||
Comment 2•12 years ago
|
||
(untested)
Assignee | ||
Comment 3•12 years ago
|
||
Since an empty regexp matches any string, the test is unnecessary.
Comment 4•12 years ago
|
||
Comment on attachment 744079 [details] [diff] [review]
Proposed patch
Review of attachment 744079 [details] [diff] [review]:
-----------------------------------------------------------------
::: resources/content/viewers/dom/dom.js
@@ +953,5 @@
>
> return aWalker.currentNode &&
> aWalker.currentNode.nodeType == nsIDOMNode.ELEMENT_NODE &&
> + aWalker.currentNode.hasAttribute(this.mFindParams[0]) &&
> + re.test(aWalker.currentNode.getAttribute(this.mFindParams[0]));
Weird that we allow regular expressions everywhere else except this field's value for this type of search...
Attachment #744079 -
Flags: review?(Sevenspade) → review+
Assignee | ||
Comment 5•12 years ago
|
||
(In reply to Colby Russell from comment #4)
> Weird that we allow regular expressions everywhere else except this field's
> value for this type of search...
You mean for the attribute name? Could be done, I suppose...
Updated•12 years ago
|
Blocks: DOMi2.0.16
Comment 6•12 years ago
|
||
(neil@parkwaycc.co.uk wrote in comment #5)
> (In reply to Colby Russell from comment #4)
> > Weird that we allow regular expressions everywhere else except this field's
> > value for this type of search...
>
> You mean for the attribute name? Could be done, I suppose...
Dear meandering bugzilla reader, that's bug 867699.
Comment 7•12 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Blocks: DOMi2.0.15
No longer blocks: DOMi2.0.16
You need to log in
before you can comment on or make changes to this bug.
Description
•