From 4fd9ac37be4f538c7af98e854c054afb6e04f20b Mon Sep 17 00:00:00 2001 From: "commit-queue@webkit.org" Date: Thu, 12 Apr 2012 13:39:54 +0000 Subject: [PATCH] Web Inspector: Node Value should not get corrupt while jump over different matches in search. https://bugs.webkit.org/show_bug.cgi?id=83758 The order in which updateEntryHide is called for cached highlightResults is changed in "last changed first corrected" order to preserve the semantic of node. Patch by Sam D on 2012-04-12 Reviewed by Pavel Feldman. No new tests required. * inspector/front-end/ElementsTreeOutline.js: (WebInspector.ElementsTreeElement.prototype._updateSearchHighlight): git-svn-id: http://svn.webkit.org/repository/webkit/trunk@113970 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- Source/WebCore/ChangeLog | 15 +++++++++++++++ Source/WebCore/inspector/front-end/ElementsTreeOutline.js | 12 ++++++++---- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog index 7189a74..6f0e11d 100644 --- a/Source/WebCore/ChangeLog +++ b/Source/WebCore/ChangeLog @@ -1,3 +1,18 @@ +2012-04-12 Sam D + + Web Inspector: Node Value should not get corrupt while jump over different matches in search. + https://bugs.webkit.org/show_bug.cgi?id=83758 + + The order in which updateEntryHide is called for cached + highlightResults is changed in "last changed first corrected" order to preserve the semantic of node. + + Reviewed by Pavel Feldman. + + No new tests required. + + * inspector/front-end/ElementsTreeOutline.js: + (WebInspector.ElementsTreeElement.prototype._updateSearchHighlight): + 2012-03-05 Pierre Rossi [Qt] Use QRawFont when building with Qt 5 diff --git a/Source/WebCore/inspector/front-end/ElementsTreeOutline.js b/Source/WebCore/inspector/front-end/ElementsTreeOutline.js index a926282..c661269 100644 --- a/Source/WebCore/inspector/front-end/ElementsTreeOutline.js +++ b/Source/WebCore/inspector/front-end/ElementsTreeOutline.js @@ -634,10 +634,14 @@ WebInspector.ElementsTreeElement.prototype = { } } - var updater = show ? updateEntryShow : updateEntryHide; - - for (var i = 0, size = this._highlightResult.length; i < size; ++i) - updater(this._highlightResult[i]); + // Preserve the semantic of node by following the order of updates for hide and show. + if (show) { + for (var i = 0, size = this._highlightResult.length; i < size; ++i) + updateEntryShow(this._highlightResult[i]); + } else { + for (var i = (this._highlightResult.length - 1); i >= 0; --i) + updateEntryHide(this._highlightResult[i]); + } }, get hovered() -- 2.7.4