-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Web Inspector: Fix issues with go to property arrow in Computed CSS pane when details sidebar is unified #27503
Conversation
EWS run on previous version of this PR (hash 0497d2a) |
Source/WebInspectorUI/UserInterface/Views/ComputedStyleDetailsSidebarPanel.js
Outdated
Show resolved
Hide resolved
0497d2a
to
556c629
Compare
EWS run on previous version of this PR (hash 556c629) |
556c629
to
390ff95
Compare
EWS run on previous version of this PR (hash 390ff95) |
Source/WebInspectorUI/UserInterface/Views/GeneralStyleDetailsSidebarPanel.js
Outdated
Show resolved
Hide resolved
Source/WebInspectorUI/UserInterface/Views/GeneralStyleDetailsSidebarPanel.js
Outdated
Show resolved
Hide resolved
Source/WebInspectorUI/UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js
Outdated
Show resolved
Hide resolved
Source/WebInspectorUI/UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js
Outdated
Show resolved
Hide resolved
section.deselectProperties(); | ||
section.highlightProperty(property); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rather than call deselectProperties
here i wonder if instead we should have WI.SpreadsheetCSSStyleDeclarationEditor.prototype.highlightProperty
call this if nothing matches (i.e. right before the final return false;
) as that would solve this bug and any like that also exist today or are accidentally added in the future
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This breaks when the old selection and new selection are under the same rule. I'd have to add it for both branches of WI.SpreadsheetCSSStyleDeclarationEditor.prototype.highlightProperty
to work.
Also in the future there may be other features where the property is highlighted but the selection isn't invalidated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what exactly do you mean by "under the same rule"? can you give an example?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I.e. within the same CSS rule set or section
.foo {
color: blue;
background: red;
}
.bar {
border: 1px solid green;
}
If I select color
and then go to the computed tab and click on the goto arrow for border
, it will work, but if I click on the goto arrow next to background
it will still break
390ff95
to
e19f0a1
Compare
EWS run on previous version of this PR (hash e19f0a1) |
e19f0a1
to
d770b63
Compare
EWS run on previous version of this PR (hash d770b63) |
if (this._selectionFocusOverride) | ||
this._selectionFocusOverride = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you explain more why this is needed? is it that this.editing
is now true
? perhaps the issue is with this._style.locked
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The layout()
function of this class terminates when editing
is true. Until this commit, _focused
was always set to true, as usually focusing meanings that we are editing the CSS and we shouldn't layout. However focusing is also done when an item is highlighted (which AFAIK is either when it is arrived at from a go to arrow or other UI element, or when it is selected manually by the user by clicking in the row but outside the text field).
So when the go to arrow was clicked, it would prevent the initial layout and therefore all of the properties could appear blank. This didn't occur with two-column view since the styles pane was already layouted.
this._style.locked
doesn't seem to be checked as part of this initial condition in the layout()
function, so I don't think that's the cause.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm that makes me think the real issue is that we consider highlighting as a form of focus, but i can see how it might be difficult/annoying to untangle those two concepts π€
maybe we could have the "focus"
event handler only do something if it's user initiated (i.e. isTrusted
)?
is the issue only on the first layout
or in any layout
? if the former, perhaps we instead just adjust the this.focus
check inside layout
to also check for this.didInitialLayout
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I did think the same thing - that ideally focus wouldn't do double-duty for two disparate things, but it's probably not something to do rn. I also think there may be AX concerns with unbundling it, given that both of them are "focusing" in an accessibility sense.
I have already tried this.didInitialLayout
but it's not false when necessary (since it's changed after initialLayout
but before the first layout
in View
). Similarly isTrusted
is always true.
Source/WebInspectorUI/UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js
Outdated
Show resolved
Hide resolved
d770b63
to
0326b45
Compare
EWS run on previous version of this PR (hash 0326b45) |
0326b45
to
c4c8329
Compare
EWS run on current version of this PR (hash c4c8329) |
@mirnovov Is this patch ready to land? |
I believe so, unless anyone has any issues. |
β¦ane when details sidebar is unified https://bugs.webkit.org/show_bug.cgi?id=272876 Reviewed by Devin Rousso. When using the Elements tab of the Inspector, the Computed pane has a button to jump to the respective CSS property. This works well with the default two-column view, but when "show independent Styles sidebar" is disabled, it can fail to scroll the respective CSS into view or replace it with white space. This commit fixes this problem: - When opening details panes, do not reset the scroll position. - Fix a bug that meant that focused/highlighted properties failed to update the layout when being initialised (this also can happen for other reasons, but is outside the scope of this commit). - Ensure that all previous properties are always deselected, as occurs already in the two-column view. Combined changes: * Source/WebInspectorUI/UserInterface/Views/GeneralStyleDetailsSidebarPanel.js: (WI.GeneralStyleDetailsSidebarPanel.prototype.layout): * Source/WebInspectorUI/UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js: (WI.SpreadsheetCSSStyleDeclarationEditor): (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.initialLayout): (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.selectProperties): * Source/WebInspectorUI/UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js: (WI.SpreadsheetCSSStyleDeclarationSection.prototype.deselectProperties): * Source/WebInspectorUI/UserInterface/Views/SpreadsheetRulesStyleDetailsPanel.js: (WI.SpreadsheetRulesStyleDetailsPanel.prototype.scrollToSectionAndHighlightProperty): * Source/WebInspectorUI/UserInterface/Views/StyleDetailsPanel.js: Canonical link: https://commits.webkit.org/278686@main
c4c8329
to
b8288eb
Compare
Committed 278686@main (b8288eb): https://commits.webkit.org/278686@main Reviewed commits have been landed. Closing PR #27503 and removing active labels. |
b8288eb
c4c8329