From: apavlov@chromium.org Date: Tue, 21 Feb 2012 16:17:03 +0000 (+0000) Subject: Web Inspector: [SuggestBox] textPrompt.css disablement displays garbled suggest box X-Git-Tag: 070512121124~12293 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f5abcbfd5d617486796c9c36063e000043b5d87d;p=profile%2Fivi%2Fwebkit-efl.git Web Inspector: [SuggestBox] textPrompt.css disablement displays garbled suggest box https://bugs.webkit.org/show_bug.cgi?id=79107 Reviewed by Pavel Feldman. * inspector/front-end/TextPrompt.js: (WebInspector.TextPrompt.SuggestBox): (WebInspector.TextPrompt.SuggestBox.prototype.get visible): (WebInspector.TextPrompt.SuggestBox.prototype.hide): (WebInspector.TextPrompt.SuggestBox.prototype.removeFromElement): (WebInspector.TextPrompt.SuggestBox.prototype._completionsReady): * inspector/front-end/textPrompt.css: (.suggest-box): git-svn-id: http://svn.webkit.org/repository/webkit/trunk@108356 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog index ec3a378..30d777a 100644 --- a/Source/WebCore/ChangeLog +++ b/Source/WebCore/ChangeLog @@ -1,3 +1,19 @@ +2012-02-21 Alexander Pavlov + + Web Inspector: [SuggestBox] textPrompt.css disablement displays garbled suggest box + https://bugs.webkit.org/show_bug.cgi?id=79107 + + Reviewed by Pavel Feldman. + + * inspector/front-end/TextPrompt.js: + (WebInspector.TextPrompt.SuggestBox): + (WebInspector.TextPrompt.SuggestBox.prototype.get visible): + (WebInspector.TextPrompt.SuggestBox.prototype.hide): + (WebInspector.TextPrompt.SuggestBox.prototype.removeFromElement): + (WebInspector.TextPrompt.SuggestBox.prototype._completionsReady): + * inspector/front-end/textPrompt.css: + (.suggest-box): + 2012-02-21 Yury Semikhatsky Web Inspector: timeline hangs on a page with deep chain of nested events. diff --git a/Source/WebCore/inspector/front-end/TextPrompt.js b/Source/WebCore/inspector/front-end/TextPrompt.js index b616e43..3c43f69 100644 --- a/Source/WebCore/inspector/front-end/TextPrompt.js +++ b/Source/WebCore/inspector/front-end/TextPrompt.js @@ -927,8 +927,9 @@ WebInspector.TextPrompt.SuggestBox = function(textPrompt, inputElement, classNam window.addEventListener("scroll", this._boundOnScroll, true); window.addEventListener("resize", this._boundOnResize, true); - var bodyElement = inputElement.ownerDocument.body; - this._element = bodyElement.createChild("div", "suggest-box " + (className || "")); + this._bodyElement = inputElement.ownerDocument.body; + this._element = inputElement.ownerDocument.createElement("div"); + this._element.className = "suggest-box " + (className || ""); this._element.addEventListener("mousedown", this._onboxmousedown.bind(this), true); this.containerElement = this._element.createChild("div", "container"); this.contentElement = this.containerElement.createChild("div", "content"); @@ -937,7 +938,7 @@ WebInspector.TextPrompt.SuggestBox = function(textPrompt, inputElement, classNam WebInspector.TextPrompt.SuggestBox.prototype = { get visible() { - return this._element.hasStyleClass("visible"); + return !!this._element.parentElement; }, get hasSelection() @@ -1020,7 +1021,7 @@ WebInspector.TextPrompt.SuggestBox.prototype = { if (!this.visible) return; - this._element.removeStyleClass("visible"); + this._element.parentElement.removeChild(this._element); delete this._selectedElement; }, @@ -1028,7 +1029,7 @@ WebInspector.TextPrompt.SuggestBox.prototype = { { window.removeEventListener("scroll", this._boundOnScroll, true); window.removeEventListener("resize", this._boundOnResize, true); - this._element.parentElement.removeChild(this._element); + this.hide(); }, /** @@ -1225,7 +1226,8 @@ WebInspector.TextPrompt.SuggestBox.prototype = { if (this._canShowBox(completions, canShowForSingleItem)) { this._updateItems(completions, canShowForSingleItem); this._updateBoxPosition(anchorBox); - this._element.addStyleClass("visible"); + if (!this.visible) + this._bodyElement.appendChild(this._element); this._rememberRowCountPerViewport(); } else this.hide(); diff --git a/Source/WebCore/inspector/front-end/textPrompt.css b/Source/WebCore/inspector/front-end/textPrompt.css index 217ae94..ca4ba07 100644 --- a/Source/WebCore/inspector/front-end/textPrompt.css +++ b/Source/WebCore/inspector/front-end/textPrompt.css @@ -31,16 +31,12 @@ .suggest-box { position: absolute; background-color: #FFFFFF; - display: none; + display: block; border: 1px solid black; padding: 2px; z-index: 100; } -.suggest-box.visible { - display: block; -} - .suggest-box .container { position: absolute; top: 0;