WebKit Bugzilla
Attachment 358237 Details for
Bug 193098
: Web Inspector: Styles: pressing Down key on empty value field shouldn't discard completion popover
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
patch.txt (text/plain), 4.45 KB, created by
Nikita Vasilyev
on 2019-01-02 18:30:10 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Nikita Vasilyev
Created:
2019-01-02 18:30:10 PST
Size:
4.45 KB
patch
obsolete
>diff --git a/Source/WebInspectorUI/ChangeLog b/Source/WebInspectorUI/ChangeLog >index d0d8c6c2cb9..625100b88fe 100644 >--- a/Source/WebInspectorUI/ChangeLog >+++ b/Source/WebInspectorUI/ChangeLog >@@ -1,3 +1,22 @@ >+2019-01-02 Nikita Vasilyev <nvasilyev@apple.com> >+ >+ Web Inspector: Styles: pressing Down key on empty value field shouldn't discard completion popover >+ https://bugs.webkit.org/show_bug.cgi?id=193098 >+ <rdar://problem/47016036> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * UserInterface/Views/CompletionSuggestionsView.js: >+ (WI.CompletionSuggestionsView.prototype.showUntilAnchorMovesVertically): Renamed from showUntilAnchorMoves. >+ This method is only used by the styles sidebar, which doesn't scroll horizontally. >+ >+ * UserInterface/Views/SpreadsheetTextField.js: >+ (WI.SpreadsheetTextField.prototype.set suggestionHint): >+ (WI.SpreadsheetTextField.prototype.completionSuggestionsSelectedCompletion): >+ (WI.SpreadsheetTextField.prototype._updateCompletions): >+ (WI.SpreadsheetTextField.prototype._reAttachSuggestionHint): >+ Drive-by: abstract out repeating code into a private method. >+ > 2018-12-21 Devin Rousso <drousso@apple.com> > > Web Inspector: Styles Redesign: remove unused CSS style icons >diff --git a/Source/WebInspectorUI/UserInterface/Views/CompletionSuggestionsView.js b/Source/WebInspectorUI/UserInterface/Views/CompletionSuggestionsView.js >index 30cc228e6f6..6842a35ec1d 100644 >--- a/Source/WebInspectorUI/UserInterface/Views/CompletionSuggestionsView.js >+++ b/Source/WebInspectorUI/UserInterface/Views/CompletionSuggestionsView.js >@@ -158,7 +158,7 @@ WI.CompletionSuggestionsView = class CompletionSuggestionsView extends WI.Object > document.body.appendChild(this._element); > } > >- showUntilAnchorMoves(getAnchorBounds) >+ showUntilAnchorMovesVertically(getAnchorBounds) > { > this._anchorBounds = getAnchorBounds(); > if (!this._anchorBounds) { >@@ -170,7 +170,7 @@ WI.CompletionSuggestionsView = class CompletionSuggestionsView extends WI.Object > > let hideWhenMoved = () => { > let anchorBounds = getAnchorBounds(); >- if (!anchorBounds || !anchorBounds.equals(this._anchorBounds)) >+ if (!anchorBounds || anchorBounds.origin.y !== this._anchorBounds.origin.y) > this.hide(); > }; > >diff --git a/Source/WebInspectorUI/UserInterface/Views/SpreadsheetTextField.js b/Source/WebInspectorUI/UserInterface/Views/SpreadsheetTextField.js >index 109bbce34b0..49c1f10f003 100644 >--- a/Source/WebInspectorUI/UserInterface/Views/SpreadsheetTextField.js >+++ b/Source/WebInspectorUI/UserInterface/Views/SpreadsheetTextField.js >@@ -75,8 +75,7 @@ WI.SpreadsheetTextField = class SpreadsheetTextField > this._suggestionHintElement.textContent = value; > > if (value) { >- if (this._suggestionHintElement.parentElement !== this._element) >- this._element.append(this._suggestionHintElement); >+ this._reAttachSuggestionHint(); > } else > this._suggestionHintElement.remove(); > } >@@ -144,8 +143,7 @@ WI.SpreadsheetTextField = class SpreadsheetTextField > > this.suggestionHint = selectedText.slice(completionPrefix.length); > >- if (this._suggestionHintElement.parentElement !== this._element) >- this._element.append(this._suggestionHintElement); >+ this._reAttachSuggestionHint(); > > if (this._delegate && typeof this._delegate.spreadsheetTextFieldDidChange === "function") > this._delegate.spreadsheetTextFieldDidChange(this); >@@ -392,7 +390,9 @@ WI.SpreadsheetTextField = class SpreadsheetTextField > this._suggestionsView.hide(); > } else { > let startOffset = prefix.length - completionPrefix.length; >- this._suggestionsView.showUntilAnchorMoves(() => { >+ >+ // Hide completion popover when the outer view is scrolled or the anchor element is removed from the DOM. >+ this._suggestionsView.showUntilAnchorMovesVertically(() => { > return this._getCaretRect(startOffset); > }); > } >@@ -450,4 +450,12 @@ WI.SpreadsheetTextField = class SpreadsheetTextField > > this._element.textContent = this._element.textContent; > } >+ >+ _reAttachSuggestionHint() >+ { >+ if (this._suggestionHintElement.parentElement === this._element) >+ return; >+ >+ this._element.append(this._suggestionHintElement); >+ } > };
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
hi
:
review-
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 193098
:
358236
|
358237
|
358238
|
358986
|
358987
|
359065