RESOLVED FIXED 56334
Web Inspector: crash upon "//html//@id" search in elements panel.
https://bugs.webkit.org/show_bug.cgi?id=56334
Summary Web Inspector: crash upon "//html//@id" search in elements panel.
Pavel Feldman
Reported 2011-03-14 14:10:52 PDT
We can't return Attr results / highlight them.
Attachments
Patch (4.55 KB, patch)
2011-03-14 14:18 PDT, Pavel Feldman
no flags
[PATCH] Review comments addressed. (4.69 KB, patch)
2011-03-14 23:43 PDT, Pavel Feldman
no flags
Pavel Feldman
Comment 1 2011-03-14 14:18:15 PDT
Joseph Pecoraro
Comment 2 2011-03-14 14:31:12 PDT
Comment on attachment 85719 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=85719&action=review > Source/WebCore/inspector/InspectorDOMAgent.cpp:212 > + if (node->nodeType() == Node::ATTRIBUTE_NODE) > + node = static_cast<Attr*>(node)->ownerElement(); > if (!ec) > resultCollector.add(node); This should probably go inside the (!ec) block. Or make it an early continue check. "if (ec) continue;" Are there other node types we should avoid here? Should we whitelist certain types? Other then this, the patch looks good to me.
Alexey Proskuryakov
Comment 3 2011-03-14 16:52:21 PDT
Comment on attachment 85719 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=85719&action=review > Source/WebCore/inspector/InspectorDOMAgent.cpp:211 > if (!ec) In WebCore, any code that looks at exception codes is responsible for initializing them. So, there should be "ec = 0;" inside the loop.
Pavel Feldman
Comment 4 2011-03-14 23:21:11 PDT
Comment on attachment 85719 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=85719&action=review >> Source/WebCore/inspector/InspectorDOMAgent.cpp:211 >> if (!ec) > > In WebCore, any code that looks at exception codes is responsible for initializing them. So, there should be "ec = 0;" inside the loop. I don't follow. There is ExceptionCode ec = 0; above. I quit as soon as I hit ec != 0. See the for condition. >> Source/WebCore/inspector/InspectorDOMAgent.cpp:212 >> resultCollector.add(node); > > This should probably go inside the (!ec) block. Or make it an early continue check. "if (ec) continue;" > > Are there other node types we should avoid here? Should we whitelist certain types? > > Other then this, the patch looks good to me. Good catch. I can't think of any other type - we are only interested in node types with broken "parentNode" link.
Pavel Feldman
Comment 5 2011-03-14 23:43:21 PDT
Created attachment 85780 [details] [PATCH] Review comments addressed.
Adam Barth
Comment 6 2011-03-15 02:01:19 PDT
Comment on attachment 85780 [details] [PATCH] Review comments addressed. /me is super excited about the testing!
Pavel Feldman
Comment 7 2011-03-15 07:13:27 PDT
Comment on attachment 85780 [details] [PATCH] Review comments addressed. Clearing flags on attachment: 85780 Committed r81132: <http://trac.webkit.org/changeset/81132>
Pavel Feldman
Comment 8 2011-03-15 07:13:35 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.