+2012-02-21 Alexander Pavlov <apavlov@chromium.org>
+
+ 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 <yurys@chromium.org>
Web Inspector: timeline hangs on a page with deep chain of nested events.
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");
WebInspector.TextPrompt.SuggestBox.prototype = {
get visible()
{
- return this._element.hasStyleClass("visible");
+ return !!this._element.parentElement;
},
get hasSelection()
if (!this.visible)
return;
- this._element.removeStyleClass("visible");
+ this._element.parentElement.removeChild(this._element);
delete this._selectedElement;
},
{
window.removeEventListener("scroll", this._boundOnScroll, true);
window.removeEventListener("resize", this._boundOnResize, true);
- this._element.parentElement.removeChild(this._element);
+ this.hide();
},
/**
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();