[webkit-changes] [295733] trunk

2022-06-22 Thread pangle
Title: [295733] trunk








Revision 295733
Author pan...@apple.com
Date 2022-06-22 09:33:23 -0700 (Wed, 22 Jun 2022)


Log Message
Web Inspector: Some CSS rules for Cocoa media controls defined in inline styles inside user agent shadow root are not correctly parsed
https://bugs.webkit.org/show_bug.cgi?id=241815
rdar://85053718

Reviewed by Devin Rousso.

New test case: inspector/css/getMatchedStylesForNodeUserAgentShadowRoot.html

CSSSelectorParser has an exception that allows it to parse the following rules when the parser is in UASheetMode:
video[controls]::-webkit-media-text-track-container.visible-controls-bar
video::-webkit-media-text-track-container b
video::-webkit-media-text-track-container u
video::-webkit-media-text-track-container i
video::-webkit-media-text-track-container .hidden

These are technically invalid CSS selectors because only user action pseudo classes should be allowed after pseudo
element selectors, however exceptions exist in CSSSelectorParser to explicitly allow these otherwise invalid selectors
when the pseudo element is a WebKit-specific selector and the parsing mode is UASheetMode.

Web Inspector's InspectorStyleSheet did not previously set any special parsing mode because in a majority of cases we
never need to do this parsing of UA styles text because we do not need to resolve the actual locations of rules in a
source file since they are uneditable. These rules, being declared in the shadow root, are actually editable. To support
these rules, we now check if the owner node of the style sheet is part of a user agent shadow root, and set the parsing
mode to UASheetMode if it is.

* Source/WebCore/inspector/InspectorStyleSheet.cpp:
(ParsedStyleSheet::isInUserAgentShadowTree const):
(ParsedStyleSheet::ParsedStyleSheet):
(WebCore::InspectorStyleSheet::InspectorStyleSheet):
(WebCore::InspectorStyleSheet::ensureSourceData):

* LayoutTests/inspector/css/getMatchedStylesForNodeUserAgentShadowRoot-expected.txt: Added.
* LayoutTests/inspector/css/getMatchedStylesForNodeUserAgentShadowRoot.html: Added.

Canonical link: https://commits.webkit.org/251738@main

Modified Paths

trunk/Source/WebCore/inspector/InspectorStyleSheet.cpp


Added Paths

trunk/LayoutTests/inspector/css/getMatchedStylesForNodeUserAgentShadowRoot-expected.txt
trunk/LayoutTests/inspector/css/getMatchedStylesForNodeUserAgentShadowRoot.html




Diff

Added: trunk/LayoutTests/inspector/css/getMatchedStylesForNodeUserAgentShadowRoot-expected.txt (0 => 295733)

--- trunk/LayoutTests/inspector/css/getMatchedStylesForNodeUserAgentShadowRoot-expected.txt	(rev 0)
+++ trunk/LayoutTests/inspector/css/getMatchedStylesForNodeUserAgentShadowRoot-expected.txt	2022-06-22 16:33:23 UTC (rev 295733)
@@ -0,0 +1,12 @@
+Tests for the CSS.getMatchedStylesForNode command styles inside user-agent shadow roots.
+
+
+
+== Running test suite: CSS.getMatchedStylesForNode.UserAgentShadowRoot
+-- Running test case: CSS.getMatchedStylesForNode.UserAgentShadowRoot.StyleFollowingNormallyInvalidSelector
+PASS: Should have matched rule for selector '.media-controls .time-label, .media-controls .status-label'
+PASS: Should have matched rule for selector '.time-label'
+PASS: Should have matched rule for selector '.media-controls-container, .media-controls-container *'
+PASS: Should have matched rule for selector ':host(audio), :host(video.media-document.audio), *'
+PASS: Should have matched rule for selector '*'
+


Added: trunk/LayoutTests/inspector/css/getMatchedStylesForNodeUserAgentShadowRoot.html (0 => 295733)

--- trunk/LayoutTests/inspector/css/getMatchedStylesForNodeUserAgentShadowRoot.html	(rev 0)
+++ trunk/LayoutTests/inspector/css/getMatchedStylesForNodeUserAgentShadowRoot.html	2022-06-22 16:33:23 UTC (rev 295733)
@@ -0,0 +1,73 @@
+
+
+
+
+function test()
+{
+let suite = InspectorTest.createAsyncSuite("CSS.getMatchedStylesForNode.UserAgentShadowRoot");
+
+function nodeForId(id) {
+return WI.domManager.nodeForId(id)
+}
+
+function addTestCase({name, description, resolveTargetDOMNode, expectedSelectors})
+{
+suite.addTestCase({
+name,
+description,
+async test() {
+let documentNode = await WI.domManager.requestDocument();
+let domNode = await resolveTargetDOMNode(documentNode);
+InspectorTest.assert(domNode, `Should find DOM Node.`);
+
+let domNodeStyles = WI.cssManager.stylesForNode(domNode);
+await domNodeStyles.refreshIfNeeded();
+
+let matchedSelectorTexts = [];
+for (let rule of domNodeStyles.matchedRules) {
+let selectorText = rule.selectorText
+matchedSelectorTexts.push(selectorText)
+
+// A sign of bad parsing from the backend is a disagreement between the individual selectors and the combined selector text.
+for (let selector 

[webkit-changes] [295699] trunk/Source/WebInspectorUI/UserInterface/Views/ GeneralStyleDetailsSidebarPanel.js

2022-06-21 Thread pangle
Title: [295699] trunk/Source/WebInspectorUI/UserInterface/Views/GeneralStyleDetailsSidebarPanel.js








Revision 295699
Author pan...@apple.com
Date 2022-06-21 16:22:07 -0700 (Tue, 21 Jun 2022)


Log Message
Web Inspector: Fonts details sidebar in Elements tab has empty space for filter bar
https://bugs.webkit.org/show_bug.cgi?id=241817
rdar://problem/95634156

Reviewed by Devin Rousso.

As pointed out by Devin, passing undefined to `toggle` here acts as if we didn't pass a value, not as a falsy value.

* Source/WebInspectorUI/UserInterface/Views/GeneralStyleDetailsSidebarPanel.js:
(WI.GeneralStyleDetailsSidebarPanel.prototype._showPanel):

Canonical link: https://commits.webkit.org/251703@main

Modified Paths

trunk/Source/WebInspectorUI/UserInterface/Views/GeneralStyleDetailsSidebarPanel.js




Diff

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/GeneralStyleDetailsSidebarPanel.js (295698 => 295699)

--- trunk/Source/WebInspectorUI/UserInterface/Views/GeneralStyleDetailsSidebarPanel.js	2022-06-21 23:21:07 UTC (rev 295698)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/GeneralStyleDetailsSidebarPanel.js	2022-06-21 23:22:07 UTC (rev 295699)
@@ -213,7 +213,7 @@
 _showPanel()
 {
 this.contentView.addSubview(this._panel);
-this.contentView.element.classList.toggle("has-filter-bar", this._filterBar);
+this.contentView.element.classList.toggle("has-filter-bar", !!this._filterBar);
 if (this._filterBar)
 this.contentView.element.classList.toggle(WI.GeneralStyleDetailsSidebarPanel.FilterInProgressClassName, this._filterBar.hasActiveFilters());
 }






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [295580] trunk/LayoutTests

2022-06-15 Thread pangle
Title: [295580] trunk/LayoutTests








Revision 295580
Author pan...@apple.com
Date 2022-06-15 16:55:06 -0700 (Wed, 15 Jun 2022)


Log Message
Web Inspector: inspector/page/setShowPaintRects.html is a flakey failure since introduction
https://bugs.webkit.org/show_bug.cgi?id=233047
rdar://85345706

Reviewed by Antoine Quint.

Adding test results to the page causes a paint to be scheduled, which can cause paint rects to be requested at times we
are not expecting them as part of the flow of the test. We expect only our explicit change to an element to cause paints
to occur, but currently those paints end up interleaved with paints for adding results to the test page.

To resolve this, we now defer writing results to the test page until the end of each test case. This allows us to wait
to start each test case until there are no paint rects, and to avoid accidently causing a paint rect to appear at
inopportune times for our testing.

* LayoutTests/inspector/page/setShowPaintRects-expected.txt:
* LayoutTests/inspector/page/setShowPaintRects.html:
* LayoutTests/platform/mac/TestExpectations:

Canonical link: https://commits.webkit.org/251585@main

Modified Paths

trunk/LayoutTests/inspector/page/setShowPaintRects-expected.txt
trunk/LayoutTests/inspector/page/setShowPaintRects.html
trunk/LayoutTests/platform/mac/TestExpectations




Diff

Modified: trunk/LayoutTests/inspector/page/setShowPaintRects-expected.txt (295579 => 295580)

--- trunk/LayoutTests/inspector/page/setShowPaintRects-expected.txt	2022-06-15 23:32:32 UTC (rev 295579)
+++ trunk/LayoutTests/inspector/page/setShowPaintRects-expected.txt	2022-06-15 23:55:06 UTC (rev 295580)
@@ -2,12 +2,16 @@
 
 
 == Running test suite: Page.setShowPaintRects
+-- Running test setup.
 -- Running test case: Page.setShowPaintRects.Enabled
 PASS: Should not have paint rects displayed.
 PASS: Should have paint rects displayed.
 PASS: Should not have paint rects displayed.
+-- Running test teardown.
 
+-- Running test setup.
 -- Running test case: Page.setShowPaintRects.Disabled
 PASS: Should not have paint rects displayed.
 PASS: Should not have had any paint rects displayed.
+-- Running test teardown.
 


Modified: trunk/LayoutTests/inspector/page/setShowPaintRects.html (295579 => 295580)

--- trunk/LayoutTests/inspector/page/setShowPaintRects.html	2022-06-15 23:32:32 UTC (rev 295579)
+++ trunk/LayoutTests/inspector/page/setShowPaintRects.html	2022-06-15 23:55:06 UTC (rev 295580)
@@ -17,6 +17,21 @@
 
 function test()
 {
+// Because adding test results to the page also causes painting (of the new result elements) we need to defer adding
+// results to the page until we are between test cases.
+let deferredTestResults = [];
+
+const inspectorTestOriginalAddResult = InspectorTest.addResult.bind(InspectorTest);
+InspectorTest.addResult = function(result) {
+deferredTestResults.push(result);
+}
+
+function writeDeferredTestOutputToPage() {
+for (let result of deferredTestResults)
+inspectorTestOriginalAddResult(result);
+deferredTestResults = [];
+}
+
 async function expectHasPaintRectsDidChangeTo(expected) {
 await InspectorTest.awaitEvent("TestHasPaintRectsDidChange");
 await expectHasPaintRects(expected);
@@ -27,11 +42,27 @@
 InspectorTest.expectEqual(hasPaintRects, expected, `Should ${expected ? "" : "not "}have paint rects displayed.`);
 }
 
+async function setup() {
+await PageAgent.setShowPaintRects(false);
+
+// Existing paint rects still need to fade out, so it isn't safe to assume we will immediately have zero paint
+// rects visible.
+if (!(await InspectorTest.evaluateInPage(`window._test_hasPaintRects`)))
+return;
+await InspectorTest.awaitEvent("TestHasPaintRectsDidChange");
+}
+
+async function teardown() {
+writeDeferredTestOutputToPage();
+}
+
 let suite = InspectorTest.createAsyncSuite("Page.setShowPaintRects");
 
 suite.addTestCase({
 name: "Page.setShowPaintRects.Enabled",
 description: "Test that paint rects are correctly created and removed while enabled.",
+setup,
+teardown,
 async test() {
 await PageAgent.setShowPaintRects(true);
 await expectHasPaintRects(false);
@@ -47,6 +78,8 @@
 suite.addTestCase({
 name: "Page.setShowPaintRects.Disabled",
 description: "Test that paint rects are not created while disabled.",
+setup,
+teardown,
 async test() {
 await PageAgent.setShowPaintRects(false);
 await expectHasPaintRects(false);


Modified: trunk/LayoutTests/platform/mac/TestExpectations (295579 => 295580)

--- trunk/LayoutTests/platform/mac/TestExpectations	2022-06-15 23:32:32 UTC (rev 295579)
+++ trunk/LayoutTests/platform/mac/TestExpectations	2022-06-15 23:55:06 UTC (rev 295580)
@@ -2245,8 +2245,6 @@
 
 webkit.org/b/237172 

[webkit-changes] [295579] trunk/.github/CODEOWNERS

2022-06-15 Thread pangle
Title: [295579] trunk/.github/CODEOWNERS








Revision 295579
Author pan...@apple.com
Date 2022-06-15 16:32:32 -0700 (Wed, 15 Jun 2022)


Log Message
Add myself (patrickangle) to GitHub CODEOWNERS for Web Inspector

Reviewed by Jonathan Bedard.

* .github/CODEOWNERS:

Canonical link: https://commits.webkit.org/251584@main

Modified Paths

trunk/.github/CODEOWNERS




Diff

Modified: trunk/.github/CODEOWNERS (295578 => 295579)

--- trunk/.github/CODEOWNERS	2022-06-15 23:01:11 UTC (rev 295578)
+++ trunk/.github/CODEOWNERS	2022-06-15 23:32:32 UTC (rev 295579)
@@ -54,16 +54,16 @@
 
 # 
 
-/Source/_javascript_Core/debugger @dcrousso
-/Source/_javascript_Core/inspector @dcrousso
-/Source/WebCore/inspector @dcrousso
-/Source/WebInspectorUI @dcrousso
-/Source/WebKit/UIProcess/Inspector @dcrousso
-/Source/WebKit/WebProcess/Inspector @dcrousso
-/Tools/Scripts/webkitpy/inspector @dcrousso
-/LayoutTests/http/tests/inspector @dcrousso
-/LayoutTests/http/tests/websocket/tests/hybi/inspector @dcrousso
-/LayoutTests/inspector @dcrousso
+/Source/_javascript_Core/debugger @dcrousso @patrickangle
+/Source/_javascript_Core/inspector @dcrousso @patrickangle
+/Source/WebCore/inspector @dcrousso @patrickangle
+/Source/WebInspectorUI @dcrousso @patrickangle
+/Source/WebKit/UIProcess/Inspector @dcrousso @patrickangle
+/Source/WebKit/WebProcess/Inspector @dcrousso @patrickangle
+/Tools/Scripts/webkitpy/inspector @dcrousso @patrickangle
+/LayoutTests/http/tests/inspector @dcrousso @patrickangle
+/LayoutTests/http/tests/websocket/tests/hybi/inspector @dcrousso @patrickangle
+/LayoutTests/inspector @dcrousso @patrickangle
 
 /Source/WebCore/Modules/apple-pay @dcrousso
 /Source/WebCore/Modules/paymentrequest @dcrousso






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [295502] trunk/Source

2022-06-13 Thread pangle
Title: [295502] trunk/Source








Revision 295502
Author pan...@apple.com
Date 2022-06-13 14:30:25 -0700 (Mon, 13 Jun 2022)


Log Message
Web Inspector: [Cocoa] Web Inspector windows open in separate window collection instead of on current stage when using Stage Manager
https://bugs.webkit.org/show_bug.cgi?id=241521
rdar://91964707

Reviewed by Devin Rousso.

For Stage Manager, the Web Inspector window should appear in the same workspace as the active Safari window. Currently
the best way to accomplish this without negatively impacting our fullscreen behavior is to appear as if we are a
preferences window with a toolbar and NSWindowToolbarStylePreference. By hiding the toolbar, there is no visual or
functional change to Web Inspector, and we now get classified as an auxiliary window only in Stage Manager.

* Source/WebKit/UIProcess/Inspector/mac/WebInspectorUIProxyMac.mm:
(WebKit::WebInspectorUIProxy::createFrontendWindow):
* Source/WebKitLegacy/mac/WebCoreSupport/WebInspectorClient.mm:
(-[WebInspectorWindowController window]):

Canonical link: https://commits.webkit.org/251507@main

Modified Paths

trunk/Source/WebKit/UIProcess/Inspector/mac/WebInspectorUIProxyMac.mm
trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebInspectorClient.mm




Diff

Modified: trunk/Source/WebKit/UIProcess/Inspector/mac/WebInspectorUIProxyMac.mm (295501 => 295502)

--- trunk/Source/WebKit/UIProcess/Inspector/mac/WebInspectorUIProxyMac.mm	2022-06-13 20:52:26 UTC (rev 295501)
+++ trunk/Source/WebKit/UIProcess/Inspector/mac/WebInspectorUIProxyMac.mm	2022-06-13 21:30:25 UTC (rev 295502)
@@ -372,6 +372,11 @@
 [window setMinFullScreenContentSize:NSMakeSize(minimumFullScreenWidth, minimumWindowHeight)];
 [window setCollectionBehavior:([window collectionBehavior] | NSWindowCollectionBehaviorFullScreenAllowsTiling)];
 
+// FIXME:  Replace Stage Manager auxiliary window workaround.
+[window setToolbar:[NSToolbar new]];
+[[window toolbar] setVisible:NO];
+[window setToolbarStyle:NSWindowToolbarStylePreference];
+
 [window setTitlebarAppearsTransparent:YES];
 
 // Center the window if the saved frame was empty.


Modified: trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebInspectorClient.mm (295501 => 295502)

--- trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebInspectorClient.mm	2022-06-13 20:52:26 UTC (rev 295501)
+++ trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebInspectorClient.mm	2022-06-13 21:30:25 UTC (rev 295502)
@@ -562,6 +562,11 @@
 [window setMinFullScreenContentSize:NSMakeSize(minimumFullScreenWidth, minimumWindowHeight)];
 [window setCollectionBehavior:([window collectionBehavior] | NSWindowCollectionBehaviorFullScreenAllowsTiling)];
 
+// FIXME:  Replace Stage Manager auxiliary window workaround.
+[window setToolbar:[NSToolbar new]];
+[[window toolbar] setVisible:NO];
+[window setToolbarStyle:NSWindowToolbarStylePreference];
+
 [window setTitlebarAppearsTransparent:YES];
 
 [self setWindow:window.get()];






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [295451] trunk

2022-06-10 Thread pangle
Title: [295451] trunk








Revision 295451
Author pan...@apple.com
Date 2022-06-10 07:51:23 -0700 (Fri, 10 Jun 2022)


Log Message
WebDriver: [Cocoa] Regression(r290743) Automated mouse movement does not result in JS mouse event being fired
https://bugs.webkit.org/show_bug.cgi?id=241484
rdar://94026001

Reviewed by Devin Rousso.

r290743 changed WKWebView on macOS to no longer forward NSEventTypeMouseMoved events to the underlying view
implementation since it does its own mouse tracking. Unfortuantely, this means that WebDriver on Cocoa platforms can not
just dispatch an event to the window and have that event reach the WKWebView's underlying view implementation. This
change was made because events for genuine cursor movement were being received twice by the underlying view previously.
We need to explicitly tell the underlying view about automated mouse movements (as well as the NSWindow to maintain any
existing behavior caused by the mouse move event being sent to the window).

This patch was verified by comparing WPT test results for tests in /webdriver/tests/perform_actions and
/webdriver/tests/release_actions and ensuring that results now match Safari 15.5 again, which does not have the
regressing change included.

* Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h:
* Source/WebKit/UIProcess/API/mac/WKWebViewMac.mm:
(-[WKWebView _simulateMouseMove:]):
* Source/WebKit/UIProcess/API/mac/WKWebViewPrivateForTestingMac.h:
* Source/WebKit/UIProcess/API/mac/WKWebViewTestingMac.mm:
(-[WKWebView _simulateMouseMove:]): Deleted.
- Move _simulateMouseMove to be private instead of private for testing.

* Source/WebKit/UIProcess/Automation/mac/WebAutomationSessionMac.mm:
(WebKit::WebAutomationSession::sendSynthesizedEventsToPage):
- For mouse move events, make sure the view implementation receives the events.

* Tools/WebKitTestRunner/mac/EventSenderProxy.mm:

Canonical link: https://commits.webkit.org/251457@main

Modified Paths

trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h
trunk/Source/WebKit/UIProcess/API/mac/WKWebViewMac.mm
trunk/Source/WebKit/UIProcess/API/mac/WKWebViewPrivateForTestingMac.h
trunk/Source/WebKit/UIProcess/API/mac/WKWebViewTestingMac.mm
trunk/Source/WebKit/UIProcess/Automation/mac/WebAutomationSessionMac.mm
trunk/Tools/WebKitTestRunner/mac/EventSenderProxy.mm




Diff

Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h (295450 => 295451)

--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h	2022-06-10 12:26:02 UTC (rev 295450)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h	2022-06-10 14:51:23 UTC (rev 295451)
@@ -725,6 +725,8 @@
 
 - (void)_prepareForMoveToWindow:(NSWindow *)targetWindow completionHandler:(void(^)(void))completionHandler WK_API_AVAILABLE(macos(10.13));
 
+- (void)_simulateMouseMove:(NSEvent *)event WK_API_AVAILABLE(macos(13.0));
+
 @end
 
 #endif // !TARGET_OS_IPHONE


Modified: trunk/Source/WebKit/UIProcess/API/mac/WKWebViewMac.mm (295450 => 295451)

--- trunk/Source/WebKit/UIProcess/API/mac/WKWebViewMac.mm	2022-06-10 12:26:02 UTC (rev 295450)
+++ trunk/Source/WebKit/UIProcess/API/mac/WKWebViewMac.mm	2022-06-10 14:51:23 UTC (rev 295451)
@@ -1690,6 +1690,11 @@
 });
 }
 
+- (void)_simulateMouseMove:(NSEvent *)event
+{
+return _impl->mouseMoved(event);
+}
+
 @end // WKWebView (WKPrivateMac)
 
 #endif // PLATFORM(MAC)


Modified: trunk/Source/WebKit/UIProcess/API/mac/WKWebViewPrivateForTestingMac.h (295450 => 295451)

--- trunk/Source/WebKit/UIProcess/API/mac/WKWebViewPrivateForTestingMac.h	2022-06-10 12:26:02 UTC (rev 295450)
+++ trunk/Source/WebKit/UIProcess/API/mac/WKWebViewPrivateForTestingMac.h	2022-06-10 14:51:23 UTC (rev 295451)
@@ -52,7 +52,6 @@
 - (void)_setFooterBannerHeight:(int)height;
 - (NSSet *)_pdfHUDs;
 
-- (void)_simulateMouseMove:(NSEvent *)event;
 - (void)_retrieveAccessibilityTreeData:(void (^)(NSData *, NSError *))completionHandler;
 
 @property (nonatomic, readonly) BOOL _secureEventInputEnabledForTesting;


Modified: trunk/Source/WebKit/UIProcess/API/mac/WKWebViewTestingMac.mm (295450 => 295451)

--- trunk/Source/WebKit/UIProcess/API/mac/WKWebViewTestingMac.mm	2022-06-10 12:26:02 UTC (rev 295450)
+++ trunk/Source/WebKit/UIProcess/API/mac/WKWebViewTestingMac.mm	2022-06-10 14:51:23 UTC (rev 295451)
@@ -121,11 +121,6 @@
 return nil;
 }
 
-- (void)_simulateMouseMove:(NSEvent *)event
-{
-return _impl->mouseMoved(event);
-}
-
 - (void)_retrieveAccessibilityTreeData:(void (^)(NSData *, NSError *))completionHandler
 {
 _page->getAccessibilityTreeData([completionHandler = makeBlockPtr(completionHandler)] (API::Data* data) {


Modified: trunk/Source/WebKit/UIProcess/Automation/mac/WebAutomationSessionMac.mm (295450 => 295451)

--- trunk/Source/WebKit/UIProcess/Automation/mac/WebAutomationSessionMac.mm	2022-06-10 12:26:02 UTC (rev 295450)
+++ trunk/Source/WebKit/UIProcess/Automation/mac/WebAutomationSessionMac.mm	2022-06-10 14:51:23 UTC (rev 295451)
@@ -32,6 +32,7 @@
 #import 

[webkit-changes] [295166] trunk/Source/WebInspectorUI/UserInterface/Views/ LayoutDetailsSidebarPanel.js

2022-06-02 Thread pangle
Title: [295166] trunk/Source/WebInspectorUI/UserInterface/Views/LayoutDetailsSidebarPanel.js








Revision 295166
Author pan...@apple.com
Date 2022-06-02 18:31:02 -0700 (Thu, 02 Jun 2022)


Log Message
Web Inspector: Layout details sidebar panel does unnecessary tracking of the selected DOM node's styles
https://bugs.webkit.org/show_bug.cgi?id=241245
rdar://94318782

Reviewed by Devin Rousso.

Code that, among other things, causes a layout when the selected DOM node's styles change should have been removed when
the Box Model diagram was removed from this sidebar panel. Additionally, because that was the only node-specific thing
in this panel, we can persist the sidebar panel even when the selected node is not an element.

* Source/WebInspectorUI/UserInterface/Views/LayoutDetailsSidebarPanel.js:
(WI.LayoutDetailsSidebarPanel):
(WI.LayoutDetailsSidebarPanel.prototype.inspect): Deleted.
(WI.LayoutDetailsSidebarPanel.prototype.supportsDOMNode): Deleted.
(WI.LayoutDetailsSidebarPanel.prototype._nodeStylesRefreshed): Deleted.
(WI.LayoutDetailsSidebarPanel.prototype._nodeStylesNeedsRefreshed): Deleted.

Canonical link: https://commits.webkit.org/251250@main

Modified Paths

trunk/Source/WebInspectorUI/UserInterface/Views/LayoutDetailsSidebarPanel.js




Diff

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/LayoutDetailsSidebarPanel.js (295165 => 295166)

--- trunk/Source/WebInspectorUI/UserInterface/Views/LayoutDetailsSidebarPanel.js	2022-06-03 01:07:37 UTC (rev 295165)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/LayoutDetailsSidebarPanel.js	2022-06-03 01:31:02 UTC (rev 295166)
@@ -31,47 +31,9 @@
 
 this._flexNodeSet = null;
 this._gridNodeSet = null;
-this._nodeStyles = null;
 this.element.classList.add("layout-panel");
 }
 
-// Public
-
-inspect(objects)
-{
-// Layout panel doesn't show when hasDOMNode is false.
-let hasDOMNode = super.inspect(objects);
-if (!hasDOMNode)
-return false;
-
-let stylesForNode = WI.cssManager.stylesForNode(this.domNode);
-stylesForNode.refreshIfNeeded().then((nodeStyles) => {
-if (nodeStyles === this._nodeStyles)
-return;
-
-if (this._nodeStyles) {
-this._nodeStyles.removeEventListener(WI.DOMNodeStyles.Event.Refreshed, this._nodeStylesRefreshed, this);
-this._nodeStyles.removeEventListener(WI.DOMNodeStyles.Event.NeedsRefresh, this._nodeStylesNeedsRefreshed, this);
-}
-
-this._nodeStyles = nodeStyles;
-
-if (this._nodeStyles) {
-this._nodeStyles.addEventListener(WI.DOMNodeStyles.Event.Refreshed, this._nodeStylesRefreshed, this);
-this._nodeStyles.addEventListener(WI.DOMNodeStyles.Event.NeedsRefresh, this._nodeStylesNeedsRefreshed, this);
-}
-
-this.needsLayout();
-});
-
-return hasDOMNode;
-}
-
-supportsDOMNode(nodeToInspect)
-{
-return nodeToInspect.nodeType() === Node.ELEMENT_NODE;
-}
-
 // Protected
 
 attached()
@@ -190,18 +152,6 @@
 this.needsLayout();
 }
 
-_nodeStylesRefreshed()
-{
-if (this.isAttached)
-this.needsLayout();
-}
-
-_nodeStylesNeedsRefreshed()
-{
-if (this.isAttached)
-this._nodeStyles?.refresh();
-}
-
 _removeNodeFromNodeSets(domNode)
 {
 this._flexNodeSet?.delete(domNode);






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [295164] trunk/Source/WebInspectorUI/UserInterface

2022-06-02 Thread pangle
Title: [295164] trunk/Source/WebInspectorUI/UserInterface








Revision 295164
Author pan...@apple.com
Date 2022-06-02 18:04:41 -0700 (Thu, 02 Jun 2022)


Log Message
Web Inspector: Layout overlay color swatches don't update saved color until popover is dismissed
https://bugs.webkit.org/show_bug.cgi?id=241244
rdar://94318762

Reviewed by Devin Rousso.

We should save all changes to layout overlay color, not just the state when you close the color picker popover. Not
doing this causes a few issues:
1. DOM node badge colors don't update as you dynamically adjust the color for an overlay.
2. The new "sample color from screen" can be used without opening the popover for the color picker, which means these
changes are never saved.

Canonical link: https://commits.webkit.org/251248@main

Modified Paths

trunk/Source/WebInspectorUI/UserInterface/Models/DOMNode.js
trunk/Source/WebInspectorUI/UserInterface/Views/NodeOverlayListSection.js




Diff

Modified: trunk/Source/WebInspectorUI/UserInterface/Models/DOMNode.js (295163 => 295164)

--- trunk/Source/WebInspectorUI/UserInterface/Models/DOMNode.js	2022-06-03 00:54:43 UTC (rev 295163)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/DOMNode.js	2022-06-03 01:04:41 UTC (rev 295164)
@@ -709,6 +709,9 @@
 
 this._createLayoutOverlayColorSettingIfNeeded();
 this._layoutOverlayColorSetting.value = color.hsl;
+
+if (this._layoutOverlayShowing)
+this.showLayoutOverlay({color});
 }
 
 scrollIntoView()


Modified: trunk/Source/WebInspectorUI/UserInterface/Views/NodeOverlayListSection.js (295163 => 295164)

--- trunk/Source/WebInspectorUI/UserInterface/Views/NodeOverlayListSection.js	2022-06-03 00:54:43 UTC (rev 295163)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/NodeOverlayListSection.js	2022-06-03 01:04:41 UTC (rev 295164)
@@ -125,11 +125,6 @@
 itemContainerElement.append(swatch.element);
 
 swatch.addEventListener(WI.InlineSwatch.Event.ValueChanged, (event) => {
-if (checkboxElement?.checked)
-domNode.showLayoutOverlay({color: event.data.value});
-}, swatch);
-
-swatch.addEventListener(WI.InlineSwatch.Event.Deactivated, (event) => {
 domNode.layoutOverlayColor = event.target.value;
 }, swatch);
 






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [295147] trunk/Source

2022-06-02 Thread pangle
Title: [295147] trunk/Source








Revision 295147
Author pan...@apple.com
Date 2022-06-02 14:43:23 -0700 (Thu, 02 Jun 2022)


Log Message
Web Inspector: Color picker should allow picking a color from any pixel on screen
https://bugs.webkit.org/show_bug.cgi?id=124357
rdar://15469621

Reviewed by Devin Rousso.

Add the long-missing "eyedropper" for picking a color from the screen to the Color Picker in Web Inspector. This
implementation supports both sRGB color space as well as Display P3 (the two colorspaces currently supported by the Web
Inspector frontend). The existing value format and gamut is preserved as best as possible while not clamping the color
(unless interacting with a color swatch/picker that does not allow changing the format). For example, on macOS the color
picker will return a Display-P3 color on supported displays, but the color itself may be representable in sRGB. If the
existing color you are overwriting is already in sRGB, that is preserved by converting the system's Display-P3 color
into sRGB. If the sampled color can not be represented in sRGB, we update the CSS value to support the new wider gamut
of the selected color in order to provide the best fidelity in color matching.

The picker is implemented in two places. The first is the Color Picker popovers used in Web Inspector. The second place
is as an Option-Click action for inline swatches to allow you to quickly begin color selection without opening the
picker itself.

* Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js:
* Source/WebInspectorUI/UserInterface/Images/Pipette.svg: Added.

* Source/WebInspectorUI/UserInterface/Models/Color.js:
(WI.Color.prototype.fromStringBestMatchingSuggestedFormatAndGamut):
- New convencience "constructor" for creating a color from a String while attempting (or forcing) preservation of an
existing format and gamut.

* Source/WebInspectorUI/UserInterface/Views/ColorPicker.css:
(.color-picker > .color-inputs-wrapper):
(.color-picker > .color-inputs-wrapper > .color-inputs):
(.color-picker > .color-inputs-wrapper > .color-inputs > div):
(.color-picker > .color-inputs-wrapper > .color-inputs > div + div):
(.color-picker > .color-inputs-wrapper > .color-inputs input):
(.color-picker > .color-inputs-wrapper > .pick-color-from-screen):
(.color-picker > .color-inputs-wrapper > .pick-color-from-screen.active):
(.color-picker > .color-inputs): Deleted.
(.color-picker > .color-inputs > div): Deleted.
(.color-picker > .color-inputs > div + div): Deleted.
(.color-picker > .color-inputs input): Deleted.
* Source/WebInspectorUI/UserInterface/Views/ColorPicker.js:
(WI.ColorPicker.async pickColorFromScreen):
- Add new static method to picking a color from the screen (so that InlineSwatch can use it), and add a new Pipette icon
to begin the modal color picking mode.

* Source/WebInspectorUI/UserInterface/Views/InlineSwatch.js:
(WI.InlineSwatch.prototype._updateSwatch):
- Add Option-Click for color swatches to immediately enter the modal color picking mode.

* Source/WebCore/inspector/InspectorFrontendClient.h:
* Source/WebCore/inspector/InspectorFrontendClientLocal.h:
* Source/WebCore/inspector/InspectorFrontendHost.cpp:
(WebCore::InspectorFrontendHost::canPickColorFromScreen):
(WebCore::InspectorFrontendHost::pickColorFromScreen):
* Source/WebCore/inspector/InspectorFrontendHost.h:
* Source/WebCore/inspector/InspectorFrontendHost.idl:
* Source/WebKit/UIProcess/Inspector/RemoteWebInspectorUIProxy.cpp:
(WebKit::RemoteWebInspectorUIProxy::pickColorFromScreen):
(WebKit::RemoteWebInspectorUIProxy::platformPickColorFromScreen):
* Source/WebKit/UIProcess/Inspector/RemoteWebInspectorUIProxy.h:
* Source/WebKit/UIProcess/Inspector/RemoteWebInspectorUIProxy.messages.in:
* Source/WebKit/UIProcess/Inspector/WebInspectorUIProxy.cpp:
(WebKit::WebInspectorUIProxy::pickColorFromScreen):
(WebKit::WebInspectorUIProxy::platformPickColorFromScreen):
* Source/WebKit/UIProcess/Inspector/WebInspectorUIProxy.h:
* Source/WebKit/UIProcess/Inspector/WebInspectorUIProxy.messages.in:
* Source/WebKit/WebProcess/Inspector/RemoteWebInspectorUI.cpp:
(WebKit::RemoteWebInspectorUI::pickColorFromScreen):
* Source/WebKit/WebProcess/Inspector/RemoteWebInspectorUI.h:
* Source/WebKit/WebProcess/Inspector/WebInspectorUI.cpp:
(WebKit::WebInspectorUI::pickColorFromScreen):
(WebKit::WebInspectorUI::canPickColorFromScreen):
* Source/WebKit/WebProcess/Inspector/WebInspectorUI.h:
- Add plubming for picking a color from the screen.

* Source/WebKit/UIProcess/Inspector/mac/RemoteWebInspectorUIProxyMac.mm:
(WebKit::RemoteWebInspectorUIProxy::platformPickColorFromScreen):
* Source/WebKit/UIProcess/Inspector/mac/WebInspectorUIProxyMac.mm:
(WebKit::WebInspectorUIProxy::platformPickColorFromScreen):
- Use NSColorSampler to get the system "pick a color from the screen" UI.

* Source/WebKit/UIProcess/Inspector/gtk/RemoteWebInspectorUIProxyGtk.cpp:
(WebKit::RemoteWebInspectorUIProxy::platformPickColorFromScreen):
* 

[webkit-changes] [295100] trunk

2022-06-01 Thread pangle
Title: [295100] trunk








Revision 295100
Author pan...@apple.com
Date 2022-06-01 11:52:36 -0700 (Wed, 01 Jun 2022)


Log Message
Web Inspector: Even after r293565, button/select elements created after Web Inspector is open are considered Flexbox containers
https://bugs.webkit.org/show_bug.cgi?id=241054
rdar://94063718

Reviewed by Devin Rousso.

r293565 updated the logic for determining the layout type for RenderObjects, but that fix did not account for the fact
that `InspectorCSSAgent::nodeLayoutContextTypeChanged` is called during the creation of `RenderFlexibleBox`, at which
point the creation of subclass-specific bits, including overrides will not have occurred, including `isFlexibleBoxImpl`
which we use to determine if the flexbox container is a "real" flexbox container, or an internal implementation detail.
We should instead determine the layout context type later just before we send the event to the frontend (it is already
delayed specifically because `nodeLayoutContextTypeChanged` can be called in destructors, which can be the result of
garbage collection). This doesn't change when the frontend receives any information, only adjust when we resolve the
layout context type.

* LayoutTests/inspector/css/nodeLayoutContextTypeChanged-expected.txt:
* LayoutTests/inspector/css/nodeLayoutContextTypeChanged.html:
* Source/WebCore/inspector/agents/InspectorCSSAgent.cpp:
* Source/WebCore/inspector/agents/InspectorCSSAgent.h:

Canonical link: https://commits.webkit.org/251195@main

Modified Paths

trunk/LayoutTests/inspector/css/nodeLayoutContextTypeChanged-expected.txt
trunk/LayoutTests/inspector/css/nodeLayoutContextTypeChanged.html
trunk/Source/WebCore/inspector/agents/InspectorCSSAgent.cpp
trunk/Source/WebCore/inspector/agents/InspectorCSSAgent.h




Diff

Modified: trunk/LayoutTests/inspector/css/nodeLayoutContextTypeChanged-expected.txt (295099 => 295100)

--- trunk/LayoutTests/inspector/css/nodeLayoutContextTypeChanged-expected.txt	2022-06-01 18:51:03 UTC (rev 295099)
+++ trunk/LayoutTests/inspector/css/nodeLayoutContextTypeChanged-expected.txt	2022-06-01 18:52:36 UTC (rev 295100)
@@ -32,3 +32,7 @@
 -- Running test case: CSS.nodeLayoutContextTypeChanged.NotFlex.Button
 PASS: Layout context should be `null`.
 
+-- Running test setup.
+-- Running test case: CSS.nodeLayoutContextTypeChanged.NotFlex.DynamicallyAddedButton
+PASS: Layout context should be `null`.
+


Modified: trunk/LayoutTests/inspector/css/nodeLayoutContextTypeChanged.html (295099 => 295100)

--- trunk/LayoutTests/inspector/css/nodeLayoutContextTypeChanged.html	2022-06-01 18:51:03 UTC (rev 295099)
+++ trunk/LayoutTests/inspector/css/nodeLayoutContextTypeChanged.html	2022-06-01 18:52:36 UTC (rev 295100)
@@ -8,6 +8,13 @@
 document.getElementById(id).style.display = value;
 }
 
+function appendElementToBody(tag, id)
+{
+let element = document.createElement(tag);
+element.id = id;
+document.body.appendChild(element);
+}
+
 function test()
 {
 let documentNode;
@@ -14,11 +21,12 @@
 
 let suite = InspectorTest.createAsyncSuite("CSS.nodeLayoutContextTypeChanged");
 
-function addTestCase({name, description, selector, domNodeHandler})
+function addTestCase({name, description, selector, setup, domNodeHandler})
 {
 suite.addTestCase({
 name,
 description,
+setup,
 async test() {
 let nodeId = await documentNode.querySelector(selector);
 let domNode = WI.domManager.nodeForId(nodeId);
@@ -33,6 +41,11 @@
 await InspectorTest.evaluateInPage(`changeElementDisplayValue("${id}", "${value}")`);
 }
 
+async function appendElementToBody(tag, id)
+{
+await InspectorTest.evaluateInPage(`appendElementToBody("${tag}", "${id}")`);
+}
+
 addTestCase({
 name: "CSS.nodeLayoutContextTypeChanged.GridToNonGrid",
 description: "Change a `grid` to a non-grid.",
@@ -113,9 +126,9 @@
 }
 });
 
-function addEnsureLayoutContextTypeTestCase({name, description, selector, expectedLayoutContextType})
+function addEnsureLayoutContextTypeTestCase({name, description, selector, expectedLayoutContextType, setup})
 {
-addTestCase({name, description, selector, async domNodeHandler(domNode) {
+addTestCase({name, description, selector, setup, async domNodeHandler(domNode) {
 InspectorTest.expectEqual(domNode.layoutContextType, expectedLayoutContextType, `Layout context should be \`${expectedLayoutContextType}\`.`);
 }
 });
@@ -142,6 +155,16 @@
 expectedLayoutContextType: null,
 });
 
+addEnsureLayoutContextTypeTestCase({
+name: "CSS.nodeLayoutContextTypeChanged.NotFlex.DynamicallyAddedButton",
+description: "Make sure a `button` that is added dynamically is not considered a flex container.",
+selector: "#dynamicallyAddedFlexButton",
+expectedLayoutContextType: null,
+async setup() {

[webkit-changes] [295089] trunk/LayoutTests/platform/mac-wk1

2022-06-01 Thread pangle
Title: [295089] trunk/LayoutTests/platform/mac-wk1








Revision 295089
Author pan...@apple.com
Date 2022-06-01 08:36:18 -0700 (Wed, 01 Jun 2022)


Log Message
[Mac] http/tests/inspector/network/har/har-page.html constant failure on wk1
https://bugs.webkit.org/show_bug.cgi?id=229458
rdar://82301476

Reviewed by Devin Rousso.

This test ensures that the _serverPort, _priority, and request cookies are as-expected when exporting a HAR, but that
data is part of `AdditionalNetworkLoadMetricsForWebInspector` internally, which is not implemented for WK1. In order to
defend the rest of the results going forward, create WK1-specific expectations that exclude those three specific pieces
of data that are unavailable.

* LayoutTests/platform/mac-wk1/TestExpectations:
* LayoutTests/platform/mac-wk1/http/tests/inspector/network/har/har-page-expected.txt: Added.

Canonical link: https://commits.webkit.org/251184@main

Modified Paths

trunk/LayoutTests/platform/mac-wk1/TestExpectations


Added Paths

trunk/LayoutTests/platform/mac-wk1/http/tests/inspector/
trunk/LayoutTests/platform/mac-wk1/http/tests/inspector/network/
trunk/LayoutTests/platform/mac-wk1/http/tests/inspector/network/har/
trunk/LayoutTests/platform/mac-wk1/http/tests/inspector/network/har/har-page-expected.txt




Diff

Modified: trunk/LayoutTests/platform/mac-wk1/TestExpectations (295088 => 295089)

--- trunk/LayoutTests/platform/mac-wk1/TestExpectations	2022-06-01 15:06:41 UTC (rev 295088)
+++ trunk/LayoutTests/platform/mac-wk1/TestExpectations	2022-06-01 15:36:18 UTC (rev 295089)
@@ -902,7 +902,6 @@
 http/tests/inspector/network/resource-request-headers.html [ Failure ]
 http/tests/inspector/network/resource-sizes-network.html [ Failure ]
 http/tests/inspector/network/resource-sizes-memory-cache.html [ Failure ]
-http/tests/inspector/network/har/har-page.html [ Failure ]
 [ Release ] http/tests/inspector/network/har/har-page-aggressive-gc.html [ Failure ]
 [ Debug ] http/tests/inspector/network/har/har-page-aggressive-gc.html [ Slow Failure ]
 


Added: trunk/LayoutTests/platform/mac-wk1/http/tests/inspector/network/har/har-page-expected.txt (0 => 295089)

--- trunk/LayoutTests/platform/mac-wk1/http/tests/inspector/network/har/har-page-expected.txt	(rev 0)
+++ trunk/LayoutTests/platform/mac-wk1/http/tests/inspector/network/har/har-page-expected.txt	2022-06-01 15:36:18 UTC (rev 295089)
@@ -0,0 +1,638 @@
+HAR Page Test.
+
+
+== Running test suite: HAR.Page
+-- Running test case: HAR.Basic.Page
+{
+  "log": {
+"version": "1.2",
+"creator": {
+  "name": "WebKit Web Inspector",
+  "version": ""
+},
+"pages": [
+  {
+"startedDateTime": "",
+"id": "page_0",
+"title": "http://127.0.0.1:8000/inspector/network/har/har-page.html",
+"pageTimings": {
+  "onContentLoad": "",
+  "onLoad": ""
+}
+  }
+],
+"entries": [
+  {
+"pageref": "page_0",
+"startedDateTime": "",
+"time": "",
+"request": {
+  "method": "GET",
+  "url": "http://127.0.0.1:8000/inspector/network/har/har-page.html",
+  "httpVersion": "",
+  "cookies": [],
+  "headers": "",
+  "queryString": [],
+  "headersSize": "",
+  "bodySize": ""
+},
+"response": {
+  "status": 200,
+  "statusText": "OK",
+  "httpVersion": "",
+  "cookies": [],
+  "headers": "",
+  "content": {
+"size": "",
+"compression": 0,
+"mimeType": "text/html",
+"text": ""
+  },
+  "redirectURL": "",
+  "headersSize": "",
+  "bodySize": ""
+},
+"cache": {},
+"timings": {
+  "blocked": "",
+  "dns": "",
+  "connect": "",
+  "ssl": -1,
+  "send": "",
+  "wait": "",
+  "receive": ""
+}
+  },
+  {
+"pageref": "page_0",
+"startedDateTime": "",
+"time": "",
+"request": {
+  "method": "GET",
+  "url": "http://127.0.0.1:8000/inspector/resources/inspector-test.js",
+  "httpVersion": "",
+  "cookies": [],
+  "headers": "",
+  "queryString": [],
+  "headersSize": "",
+  "bodySize": ""
+},
+"response": {
+  "status": 200,
+  "statusText": "OK",
+  "httpVersion": "",
+  "cookies": [],
+  "headers": "",
+  "content": {
+"size": "",
+"compression": 0,
+"mimeType": "application/x-_javascript_",
+"text": ""
+  },
+  "redirectURL": "",
+  "headersSize": "",
+  "bodySize": ""
+},
+"cache": {},
+"timings": {
+  "blocked": "",
+  "dns": "",
+  "connect": "",
+  "ssl": -1,
+  "send": "",
+  "wait": 

[webkit-changes] [294907] trunk/LayoutTests/inspector/debugger/breakpoints

2022-05-26 Thread pangle
Title: [294907] trunk/LayoutTests/inspector/debugger/breakpoints








Revision 294907
Author pan...@apple.com
Date 2022-05-26 16:41:11 -0700 (Thu, 26 May 2022)


Log Message
Web Inspector: `inspector/debugger/breakpoints/resolved-dump-all-pause-locations.html` is a flakey failure
https://bugs.webkit.org/show_bug.cgi?id=239134
rdar://91639437

Reviewed by Devin Rousso.

This test was flaky because the only piece of code in the test keeping the SourceProvider alive for `dump-multiline.js`
was the `function test()`, which is replaced by the `function test()` in the test page itself. This meant that the
function from dump-multiline.js would be garbage collected at some point, and since it was the last possible way to
reach source code in `dump-multiline.js`, the SourceProvider was also disposed of at the same time.

Normally this would not be an issue for users because the source code itself is still viewable in Web Inspector, and
breakpoints can still be set (and will be triggered after a reload). The issue here is that when we attach Web Inspector
the source code is longer reachable, so the backend doesn't send information for it to the frontend for it (until a page
reload), but this test is assuming the script will have been sent from the backend to associate with the resource.

* LayoutTests/inspector/debugger/breakpoints/resolved-dump-all-pause-locations-expected.txt:
* LayoutTests/inspector/debugger/breakpoints/resources/dump-multiline.js:

Canonical link: https://commits.webkit.org/251030@main

Modified Paths

trunk/LayoutTests/inspector/debugger/breakpoints/resolved-dump-all-pause-locations-expected.txt
trunk/LayoutTests/inspector/debugger/breakpoints/resources/dump-multiline.js




Diff

Modified: trunk/LayoutTests/inspector/debugger/breakpoints/resolved-dump-all-pause-locations-expected.txt (294906 => 294907)

--- trunk/LayoutTests/inspector/debugger/breakpoints/resolved-dump-all-pause-locations-expected.txt	2022-05-26 23:13:12 UTC (rev 294906)
+++ trunk/LayoutTests/inspector/debugger/breakpoints/resolved-dump-all-pause-locations-expected.txt	2022-05-26 23:41:11 UTC (rev 294907)
@@ -2818,7 +2818,7 @@
 
 INSERTING AT: 0:0
 PAUSES AT: 1:4
- ->   0#function test() {
+ ->   0#function multilineTest() {
  =>   1|var x;
   2}
   3
@@ -2826,7 +2826,7 @@
 
 INSERTING AT: 1:5
 PAUSES AT: 2:0
-  0function test() {
+  0function multilineTest() {
  ->   1v#ar x;
  =>   2|}
   3
@@ -2835,13 +2835,13 @@
 
 INSERTING AT: 2:1
 PAUSES AT: 5:0
-  0function test() {
+  0function multilineTest() {
   1var x;
  ->   2}#
   3
   4// Strings
  =>   5|let multiline1 = "test\
-  6string", multiline2 = test();
+  6string", multiline2 = multilineTest();
   7
   8// Template Strings
 
@@ -2851,7 +2851,7 @@
   3
   4// Strings
  ->   5l#et multiline1 = "test\
- =>   6string", |multiline2 = test();
+ =>   6string", |multiline2 = multilineTest();
   7
   8// Template Strings
   9let multiline3 = `test
@@ -2861,21 +2861,21 @@
   3
   4// Strings
   5let multiline1 = "test\
- ->   6string", m#ultiline2 = test();
+ ->   6string", m#ultiline2 = multilineTest();
   7
   8// Template Strings
  =>   9|let multiline3 = `test
- 10string`, multiline4 = test();
+ 10string`, multiline4 = multilineTest();
  11
  12// Comments
 
 INSERTING AT: 9:1
 PAUSES AT: 10:9
-  6string", multiline2 = test();
+  6string", multiline2 = multilineTest();
   7
   8// Template Strings
  ->   9l#et multiline3 = `test
- =>  10string`, |multiline4 = test();
+ =>  10string`, |multiline4 = multilineTest();
  11
  12// Comments
  13/* test
@@ -2885,11 +2885,11 @@
   7
   8// Template Strings
   9let multiline3 = `test
- ->  10string`, m#ultiline4 = test();
+ ->  10string`, m#ultiline4 = multilineTest();
  11
  12// Comments
  13/* test
- =>  14comment */ |let multiline5 = test();
+ =>  14comment */ |let multiline5 = multilineTest();
  15
 
 


Modified: trunk/LayoutTests/inspector/debugger/breakpoints/resources/dump-multiline.js (294906 => 294907)

--- trunk/LayoutTests/inspector/debugger/breakpoints/resources/dump-multiline.js	2022-05-26 23:13:12 UTC (rev 294906)
+++ trunk/LayoutTests/inspector/debugger/breakpoints/resources/dump-multiline.js	2022-05-26 23:41:11 UTC (rev 294907)
@@ -1,15 +1,15 @@
-function test() {
+function multilineTest() {
 var x;
 }
 
 // Strings
 let multiline1 = "test\
-string", multiline2 = test();
+string", multiline2 = multilineTest();
 
 // Template Strings
 let multiline3 = `test
-string`, multiline4 = test();
+string`, multiline4 = multilineTest();
 
 // Comments
 /* test
-comment */ let multiline5 = test();
+comment */ let multiline5 = multilineTest();







[webkit-changes] [294823] trunk/LayoutTests/platform/mac-wk2/TestExpectations

2022-05-25 Thread pangle
Title: [294823] trunk/LayoutTests/platform/mac-wk2/TestExpectations








Revision 294823
Author pan...@apple.com
Date 2022-05-25 14:36:01 -0700 (Wed, 25 May 2022)


Log Message
Re-enable http/tests/inspector/network/har/har-page.html for mac-wk2
https://bugs.webkit.org/show_bug.cgi?id=229458

Unreviewed test expectations update.

* LayoutTests/platform/mac-wk2/TestExpectations:

Canonical link: https://commits.webkit.org/250975@main

Modified Paths

trunk/LayoutTests/platform/mac-wk2/TestExpectations




Diff

Modified: trunk/LayoutTests/platform/mac-wk2/TestExpectations (294822 => 294823)

--- trunk/LayoutTests/platform/mac-wk2/TestExpectations	2022-05-25 21:26:21 UTC (rev 294822)
+++ trunk/LayoutTests/platform/mac-wk2/TestExpectations	2022-05-25 21:36:01 UTC (rev 294823)
@@ -1515,8 +1515,6 @@
 
 webkit.org/b/229454 [ BigSur Debug ] http/tests/inspector/network/resource-timing.html [ Pass Failure ]
 
-webkit.org/b/229458 http/tests/inspector/network/har/har-page.html [ Pass Failure ]
-
 webkit.org/b/229460 [ BigSur Debug ] http/tests/inspector/network/ping-type.html [ Pass Failure ]
 
 webkit.org/b/230056 [ BigSur Debug ] http/tests/inspector/network/resource-request-headers.html [ Pass Failure ]






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [294695] trunk

2022-05-23 Thread pangle
Title: [294695] trunk








Revision 294695
Author pan...@apple.com
Date 2022-05-23 16:42:31 -0700 (Mon, 23 May 2022)


Log Message
Web Inspector: Layout panel doesn't always match visible nodes/order of nodes in document
https://bugs.webkit.org/show_bug.cgi?id=240775
rdar://93727833

Reviewed by Devin Rousso.

There were a couple issues preventing the layout panel from showing nodes that could actually have an overlay shown in
a predictable order.

First, DOMManager.prototype.nodesWithLayoutContextType provided an array of nodes sorted by nodeId, not their order in
the document. This meant that nodes created later and inserted into the page did not get placed in their logical order
relative to other containers, but at the end of the list. This is fixed with a new iterator that iterated through the
document and its tree in a way the preserves the order of elements as they would appear in a Tree view.

Second, LayoutDetailsSidebarPanel was not instrumenting the insertion/deletion of nodes, which meant that a node with a
layout context could be removed from the DOM tree, but still exist. These nodes weren't actually useful in the list
because you can't turn on the overlay for them. A similar issue existed for inserting a known node back into the DOM
tree.

Also fix an assertion reached from NodeOverlayListSection when toggling all overlays off.

* Source/WebInspectorUI/UserInterface/Controllers/DOMManager.js:
(WI.DOMManager.prototype.attachedNodes):
(WI.DOMManager.prototype.nodesWithLayoutContextType):

* Source/WebInspectorUI/UserInterface/Views/LayoutDetailsSidebarPanel.js:
(WI.LayoutDetailsSidebarPanel.prototype.attached):
(WI.LayoutDetailsSidebarPanel.prototype.detached):
(WI.LayoutDetailsSidebarPanel.prototype._handleNodeInserted):
(WI.LayoutDetailsSidebarPanel.prototype._handleNodeRemoved):
(WI.LayoutDetailsSidebarPanel.prototype._handleLayoutContextTypeChanged):
(WI.LayoutDetailsSidebarPanel.prototype._removeNodeFromNodeSets):
(WI.LayoutDetailsSidebarPanel.prototype._invalidateNodeSets):
(WI.LayoutDetailsSidebarPanel.prototype._refreshNodeSets):
- Instead of iterating all the nodes twice every time something changes, iterate all the nodes once, an only do so when
doing layout to prevent multiple iterations for an eventual single layout.

* Source/WebInspectorUI/UserInterface/Views/NodeOverlayListSection.js:
(WI.NodeOverlayListSection.prototype._handleToggleAllCheckboxChanged):
- Fix for an assertion reachable while manually testing this patch. Toggling the overlay off when it is already off is
not allowed, and turning an overlay on that is already on is needlessly chatty over the protocol (unless changing the
settings/color, which is left untouched).

* LayoutTests/inspector/dom/attachedNodes-expected.txt: Added.
* LayoutTests/inspector/dom/attachedNodes.html: Added.

* LayoutTests/inspector/css/setLayoutContextTypeChangedMode.html:
- Update to use WI.domManager.attachedNodes() iterator.

Canonical link: https://commits.webkit.org/250897@main

Modified Paths

trunk/LayoutTests/inspector/css/setLayoutContextTypeChangedMode.html
trunk/Source/WebInspectorUI/UserInterface/Controllers/DOMManager.js
trunk/Source/WebInspectorUI/UserInterface/Views/LayoutDetailsSidebarPanel.js
trunk/Source/WebInspectorUI/UserInterface/Views/NodeOverlayListSection.js


Added Paths

trunk/LayoutTests/inspector/dom/attachedNodes-expected.txt
trunk/LayoutTests/inspector/dom/attachedNodes.html




Diff

Modified: trunk/LayoutTests/inspector/css/setLayoutContextTypeChangedMode.html (294694 => 294695)

--- trunk/LayoutTests/inspector/css/setLayoutContextTypeChangedMode.html	2022-05-23 23:28:36 UTC (rev 294694)
+++ trunk/LayoutTests/inspector/css/setLayoutContextTypeChangedMode.html	2022-05-23 23:42:31 UTC (rev 294695)
@@ -22,17 +22,22 @@
 WI.cssManager.layoutContextTypeChangedMode = layoutContextTypeChangedMode;
 }
 
+function nodesWithLayoutContextType(type)
+{
+return Array.from(WI.domManager.attachedNodes({filter: (node) => node.layoutContextType === type}));
+}
+
 suite.addTestCase({
 name: "CSS.setLayoutContextTypeChangedMode.queryGrid",
 description: "Test that the expected number of grids are instrumented without chagning the LayoutContextTypeChangedMode.",
 async test() {
-InspectorTest.expectEqual(WI.domManager.nodesWithLayoutContextType(WI.DOMNode.LayoutContextType.Grid).length, 0, "0 grid nodes should be instrumented.");
+InspectorTest.expectEqual(nodesWithLayoutContextType(WI.DOMNode.LayoutContextType.Grid).length, 0, "0 grid nodes should be instrumented.");
 
 // Query for the node, sending it to the frontend.
 InspectorTest.log("Querying document for selector `#queryGrid`...");
 let documentNode = await WI.domManager.requestDocument();
 let queryNode = WI.domManager.nodeForId(await documentNode.querySelector("#queryGrid"));
-

[webkit-changes] [294621] trunk

2022-05-22 Thread pangle
Title: [294621] trunk








Revision 294621
Author pan...@apple.com
Date 2022-05-22 11:00:55 -0700 (Sun, 22 May 2022)


Log Message
Unreviewed, reverting r249538 & r249598.
https://bugs.webkit.org/show_bug.cgi?id=240769

Introduced inconsistencies between backend and frontend DOM tree state.

Reverted changesets:

"Web Inspector: preserve DOM.NodeId if a node is removed and re-added"
https://bugs.webkit.org/show_bug.cgi?id=189687
https://commits.webkit.org/249538

"Web Inspector: Clean up `WI.DOMNode` to no longer require the shared `WI.DOMManager` be passed during construction"
https://bugs.webkit.org/show_bug.cgi?id=239129
https://commits.webkit.org/249598

Canonical link: https://commits.webkit.org/250847@main

Modified Paths

trunk/LayoutTests/inspector/dom-debugger/dom-breakpoint-node-removed-ancestor-expected.txt
trunk/LayoutTests/inspector/dom-debugger/dom-breakpoint-node-removed-ancestor.html
trunk/LayoutTests/inspector/dom-debugger/dom-breakpoint-node-removed-direct-expected.txt
trunk/LayoutTests/inspector/dom-debugger/resources/dom-breakpoint-utilities.js
trunk/Source/WebCore/inspector/agents/InspectorCSSAgent.cpp
trunk/Source/WebCore/inspector/agents/InspectorDOMAgent.cpp
trunk/Source/WebCore/inspector/agents/InspectorDOMAgent.h
trunk/Source/WebInspectorUI/UserInterface/Controllers/DOMDebuggerManager.js
trunk/Source/WebInspectorUI/UserInterface/Controllers/DOMManager.js
trunk/Source/WebInspectorUI/UserInterface/Models/DOMNode.js




Diff

Modified: trunk/LayoutTests/inspector/dom-debugger/dom-breakpoint-node-removed-ancestor-expected.txt (294620 => 294621)

--- trunk/LayoutTests/inspector/dom-debugger/dom-breakpoint-node-removed-ancestor-expected.txt	2022-05-22 14:36:15 UTC (rev 294620)
+++ trunk/LayoutTests/inspector/dom-debugger/dom-breakpoint-node-removed-ancestor-expected.txt	2022-05-22 18:00:55 UTC (rev 294621)
@@ -16,8 +16,6 @@
 CALL STACK:
 0: [F] testNodeRemovedAncestor
 1: [P] Global Code
-Breakpoint "domNode" set to "null".
-Breakpoint "domNode" set to "div#node-removed-ancestor-test".
 -- Running test teardown.
 
 -- Running test case: DOMBreakpoint.NodeRemoved.Ancestor.BreakpointDisabled
@@ -24,8 +22,6 @@
 Adding "node-removed:1,HTML,1,BODY,1,DIV,0,DIV,0,DIV" DOM Breakpoint...
 Disabling breakpoint...
 Triggering breakpoint...
-Breakpoint "domNode" set to "null".
-Breakpoint "domNode" set to "div#node-removed-ancestor-test".
 PASS: Should not pause for disabled breakpoint.
 -- Running test teardown.
 
@@ -33,8 +29,6 @@
 Adding "node-removed:1,HTML,1,BODY,1,DIV,0,DIV,0,DIV" DOM Breakpoint...
 Disabling all breakpoints...
 Triggering breakpoint...
-Breakpoint "domNode" set to "null".
-Breakpoint "domNode" set to "div#node-removed-ancestor-test".
 Enabling all breakpoints...
 PASS: Should not pause when all breakpoints disabled.
 -- Running test teardown.
@@ -52,25 +46,17 @@
 Setting condition to 'false'...
 
 Triggering breakpoint...
-Breakpoint "domNode" set to "null".
-Breakpoint "domNode" set to "div#node-removed-ancestor-test".
 PASS: Should not pause.
 
 Triggering breakpoint...
-Breakpoint "domNode" set to "null".
-Breakpoint "domNode" set to "div#node-removed-ancestor-test".
 PASS: Should not pause.
 
 Setting condition to 'true'...
 
 Triggering breakpoint...
-Breakpoint "domNode" set to "null".
-Breakpoint "domNode" set to "div#node-removed-ancestor-test".
 PASS: Should pause.
 
 Triggering breakpoint...
-Breakpoint "domNode" set to "null".
-Breakpoint "domNode" set to "div#node-removed-ancestor-test".
 PASS: Should pause.
 
 -- Running test case: DOMBreakpoint.NodeRemoved.Ancestor.Options.Condition.ConsoleCommandLineAPI
@@ -80,13 +66,9 @@
 Setting condition to saved console value...
 
 Triggering breakpoint...
-Breakpoint "domNode" set to "null".
-Breakpoint "domNode" set to "div#node-removed-ancestor-test".
 PASS: Should not pause.
 
 Triggering breakpoint...
-Breakpoint "domNode" set to "null".
-Breakpoint "domNode" set to "div#node-removed-ancestor-test".
 PASS: Should not pause.
 
 Adding saved console value 'true'...
@@ -93,13 +75,9 @@
 Setting condition to saved console value...
 
 Triggering breakpoint...
-Breakpoint "domNode" set to "null".
-Breakpoint "domNode" set to "div#node-removed-ancestor-test".
 PASS: Should pause.
 
 Triggering breakpoint...
-Breakpoint "domNode" set to "null".
-Breakpoint "domNode" set to "div#node-removed-ancestor-test".
 PASS: Should pause.
 
 -- Running test case: DOMBreakpoint.NodeRemoved.Ancestor.Options.Action.Log
@@ -108,8 +86,6 @@
 Adding log action...
 
 Triggering breakpoint...
-Breakpoint "domNode" set to "null".
-Breakpoint "domNode" set to "div#node-removed-ancestor-test".
 PASS: Should execute breakpoint action.
 PASS: Should pause.
 
@@ -116,8 +92,6 @@
 Editing log action...
 
 Triggering breakpoint...
-Breakpoint "domNode" set to "null".
-Breakpoint "domNode" set to "div#node-removed-ancestor-test".
 PASS: Should execute breakpoint action.
 PASS: Should pause.
 
@@ -125,8 +99,6 @@
 Enabling auto-continue...
 
 Triggering 

[webkit-changes] [294512] trunk

2022-05-19 Thread pangle
Title: [294512] trunk








Revision 294512
Author pan...@apple.com
Date 2022-05-19 16:42:23 -0700 (Thu, 19 May 2022)


Log Message
Web Inspector: Getting style data via WebCore::InspectorCSSAgent::getMatchedStylesForNode for a detached node crashes
https://bugs.webkit.org/show_bug.cgi?id=240608
rdar://93473674

Reviewed by Devin Rousso.

Added test case to inspector/css/node-styles-refreshed.html

Previously it was possible under at least two different circumstances that
`WebCore::InspectorCSSAgent::getMatchedStylesForNode` could be called with the NodeId of a detached node, which means
that `computedStyle` for that Node will be `nullptr`, and calls to `Style::Scope::forNode` will fail.

The first failure state is timing based. If the Inspector frontend makes a request for updated styles for a node, the
node may already have been detached by some other means (webpage JS, for example). In this case by the time
`getMatchedStylesForNode` is invoked the `computedStyle` is no longer available.

The second failure state is easier to get into. In a DOM tree with elements A, B, and C, each a child of the
previous such that A is the parent of B and B is the parent of C, imagine C is the selected DOM node. Now if
we right click and delete A from the DOM tree, we will have removed all three elements from the tree (both the
frontend representation as well as the actual tree in the backend). Previously C remained the selected node in the
tree, which means that we continue to show the Styles sidebar panel, where the user could then attempt to edit the style
of the node. These style changes trigger the need to refresh the frontend's style information, at which point we will
call `getMatchedStylesForNode` with a detached node id.

The fix to the underlying problem is to check in the backend that a node is actually attached before determining its
style information. Additionally, we should always update the selection of a TreeOutline when the current selection is
part of the subtree being removed from the tree. This prevents the user being able to easily get into the state in the
first place as well as prevents folks from getting confused about what the open sidebars are showing information for,
since visually no node _appears_ selected.

* Source/WebCore/inspector/agents/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::getMatchedStylesForNode):
(WebCore::InspectorCSSAgent::getComputedStyleForNode):
- Guard the functions that will eventually use `computedStyle` or `Style::Scope::forNode`, both of which only work for
"connected" (in Web Inspector parlance "attached") nodes. Note there are a few other uses in our code where
`computedStyle` is used without this check, but we do explicitly check the result of computed styles in those cases,
which also works since `computedStyle` returns early if the node is not connected.

(WebCore::InspectorCSSAgent::buildObjectForRule):
- Add an assertion that we never call buildObjectForRule with a disconnected Element.

* Source/WebInspectorUI/UserInterface/Views/TreeOutline.js:
(WI.TreeOutline.prototype.removeChildAtIndex):
- Fix selection updating to account for the fact the selected node may be part of the descendants tree of the removed
item, in which case we would still want to update the selection to something else.

* LayoutTests/inspector/css/node-styles-refreshed-expected.txt:
* LayoutTests/inspector/css/node-styles-refreshed.html:
- Add test case to try getting styles of a detached node, and update other test cases with a new helper function instead
of relying on a "global" `nodeStyles`.

Canonical link: https://commits.webkit.org/250769@main

Modified Paths

trunk/LayoutTests/inspector/css/node-styles-refreshed-expected.txt
trunk/LayoutTests/inspector/css/node-styles-refreshed.html
trunk/Source/WebCore/inspector/agents/InspectorCSSAgent.cpp
trunk/Source/WebInspectorUI/UserInterface/Views/TreeOutline.js




Diff

Modified: trunk/LayoutTests/inspector/css/node-styles-refreshed-expected.txt (294511 => 294512)

--- trunk/LayoutTests/inspector/css/node-styles-refreshed-expected.txt	2022-05-19 23:00:40 UTC (rev 294511)
+++ trunk/LayoutTests/inspector/css/node-styles-refreshed-expected.txt	2022-05-19 23:42:23 UTC (rev 294512)
@@ -14,3 +14,10 @@
 -- Running test case: NodeStylesRefreshed.IrrelevantClassRemoved
 PASS: Removing '.blah' class shouldn't cause a significant change.
 
+-- Running test case: NodeStylesRefreshed.DisconnectedNode
+Refreshing styles before removal.
+PASS: Refreshing styles of an unchanged node should not be a significant change.
+Removing node from DOM tree.
+Refreshing styles after removal.
+PASS: Refreshing styles of a now detached node should be a significant change.
+


Modified: trunk/LayoutTests/inspector/css/node-styles-refreshed.html (294511 => 294512)

--- trunk/LayoutTests/inspector/css/node-styles-refreshed.html	2022-05-19 23:00:40 UTC (rev 294511)
+++ trunk/LayoutTests/inspector/css/node-styles-refreshed.html	2022-05-19 23:42:23 UTC (rev 294512)

[webkit-changes] [294361] trunk/Source/JavaScriptCore/inspector/remote

2022-05-17 Thread pangle
Title: [294361] trunk/Source/_javascript_Core/inspector/remote








Revision 294361
Author pan...@apple.com
Date 2022-05-17 16:23:29 -0700 (Tue, 17 May 2022)


Log Message
[Cocoa] Web Driver: `RemoteAutomationTarget`s marked for termination and targets that have never been paired may briefly be indistinguishable in application target listing
https://bugs.webkit.org/show_bug.cgi?id=240524


Reviewed by BJ Burg and Devin Rousso.

A `RemoteAutomationTarget` has multiple possible entries it may provide in an application listing to webinspectord,
which are then interpreted by webinspectord to determine the current state of that target. The key pieces for this bug
are that a `WIRConnectionIdentifierKey` which when present is taken to mean that the target is no longer pristine and
`WIRAutomationTargetIsPairedKey` which when true indicates that the target is paired. When a connection identifier is
present and we are no longer paired, the connection is considered terminated.

There exists a race condition where webinspectord preemptively set the targets state to "Terminated" upon sending a
close request in order to make sure that the target is no longer used. Upon receiving the close message for the target
the connection identifier is removed from the map of known connection identifiers before scheduling the actual target to
be torn down asyncronously. In most cases this works fine, but sometimes an application listing is created and sent
between removing the identifier from the map of known connections and actually tearing down the target, and that is
where this issue occurs. We will in that case send a listing for the automation target with no connection identifier
(since we removed it from the map already), which is then interpreted as a listing for a pristine automation target. At
that point, it is possible that automation sessions that are being rapidly created and destroyed will attempt to pair
with the seemingly pristine existing session, even though that session is about to be torn down.

* Source/_javascript_Core/inspector/remote/RemoteAutomationTarget.h:
* Source/_javascript_Core/inspector/remote/cocoa/RemoteConnectionToTargetCocoa.mm:
(Inspector::RemoteConnectionToTarget::close):
* Source/_javascript_Core/inspector/remote/cocoa/RemoteInspectorCocoa.mm:
(Inspector::RemoteInspector::listingForAutomationTarget const):

Canonical link: https://commits.webkit.org/250664@main

Modified Paths

trunk/Source/_javascript_Core/inspector/remote/RemoteAutomationTarget.h
trunk/Source/_javascript_Core/inspector/remote/cocoa/RemoteConnectionToTargetCocoa.mm
trunk/Source/_javascript_Core/inspector/remote/cocoa/RemoteInspectorCocoa.mm




Diff

Modified: trunk/Source/_javascript_Core/inspector/remote/RemoteAutomationTarget.h (294360 => 294361)

--- trunk/Source/_javascript_Core/inspector/remote/RemoteAutomationTarget.h	2022-05-17 23:19:06 UTC (rev 294360)
+++ trunk/Source/_javascript_Core/inspector/remote/RemoteAutomationTarget.h	2022-05-17 23:23:29 UTC (rev 294361)
@@ -41,6 +41,9 @@
 bool isPaired() const { return m_paired; }
 void setIsPaired(bool);
 
+bool isPendingTermination() const { return m_pendingTermination; }
+void setIsPendingTermination() { m_pendingTermination = true; }
+
 virtual String name() const = 0;
 RemoteControllableTarget::Type type() const override { return RemoteControllableTarget::Type::Automation; }
 bool remoteControlAllowed() const override { return !m_paired; };
@@ -47,6 +50,7 @@
 
 private:
 bool m_paired { false };
+bool m_pendingTermination { false };
 };
 
 } // namespace Inspector


Modified: trunk/Source/_javascript_Core/inspector/remote/cocoa/RemoteConnectionToTargetCocoa.mm (294360 => 294361)

--- trunk/Source/_javascript_Core/inspector/remote/cocoa/RemoteConnectionToTargetCocoa.mm	2022-05-17 23:19:06 UTC (rev 294360)
+++ trunk/Source/_javascript_Core/inspector/remote/cocoa/RemoteConnectionToTargetCocoa.mm	2022-05-17 23:23:29 UTC (rev 294361)
@@ -198,6 +198,9 @@
 void RemoteConnectionToTarget::close()
 {
 auto targetIdentifier = m_target ? m_target->targetIdentifier() : 0;
+
+if (auto* automationTarget = dynamicDowncast(m_target))
+automationTarget->setIsPendingTermination();
 
 dispatchAsyncOnTarget([this, targetIdentifier, strongThis = Ref { *this }]() {
 Locker locker { m_targetMutex };


Modified: trunk/Source/_javascript_Core/inspector/remote/cocoa/RemoteInspectorCocoa.mm (294360 => 294361)

--- trunk/Source/_javascript_Core/inspector/remote/cocoa/RemoteInspectorCocoa.mm	2022-05-17 23:19:06 UTC (rev 294360)
+++ trunk/Source/_javascript_Core/inspector/remote/cocoa/RemoteInspectorCocoa.mm	2022-05-17 23:23:29 UTC (rev 294361)
@@ -466,6 +466,9 @@
 // implemented by non-threadsafe JSC / WebCore classes such as JSGlobalObject or WebCore::Page.
 ASSERT(isMainThread());
 
+if (target.isPendingTermination())
+return nullptr;
+
 RetainPtr listing = adoptNS([[NSMutableDictionary alloc] init]);
   

[webkit-changes] [294234] trunk

2022-05-16 Thread pangle
Title: [294234] trunk








Revision 294234
Author pan...@apple.com
Date 2022-05-16 08:52:10 -0700 (Mon, 16 May 2022)


Log Message
Web Inspector: Regression(r266885) Crash sometimes when rehydrating imported audit results
https://bugs.webkit.org/show_bug.cgi?id=240366

Reviewed by Devin Rousso.

Source/_javascript_Core:

* inspector/protocol/DOM.json:

Source/WebCore:

Added test cases to inspector/model/dom-node.html

After r266885, there is no path to handle the possibility that there may not be a resulting node for calls to
`DOM.querySelector`. To correct this, mark the return value as optional (Web Inspector frontend already treats
it as optional) and return early if there was no Element matching the selector.

* inspector/agents/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::querySelector):
* inspector/agents/InspectorDOMAgent.h:

LayoutTests:

* inspector/model/dom-node.html:
* inspector/model/dom-node-expected.txt:

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/inspector/model/dom-node-expected.txt
trunk/LayoutTests/inspector/model/dom-node.html
trunk/Source/_javascript_Core/ChangeLog
trunk/Source/_javascript_Core/inspector/protocol/DOM.json
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/inspector/agents/InspectorDOMAgent.cpp
trunk/Source/WebCore/inspector/agents/InspectorDOMAgent.h




Diff

Modified: trunk/LayoutTests/ChangeLog (294233 => 294234)

--- trunk/LayoutTests/ChangeLog	2022-05-16 15:08:11 UTC (rev 294233)
+++ trunk/LayoutTests/ChangeLog	2022-05-16 15:52:10 UTC (rev 294234)
@@ -1,3 +1,13 @@
+2022-05-16  Patrick Angle  
+
+Web Inspector: Regression(r266885) Crash sometimes when rehydrating imported audit results
+https://bugs.webkit.org/show_bug.cgi?id=240366
+
+Reviewed by Devin Rousso.
+
+* inspector/model/dom-node.html:
+* inspector/model/dom-node-expected.txt:
+
 2022-05-16  Rob Buis  
 
 Remove some custom-element tests


Modified: trunk/LayoutTests/inspector/model/dom-node-expected.txt (294233 => 294234)

--- trunk/LayoutTests/inspector/model/dom-node-expected.txt	2022-05-16 15:08:11 UTC (rev 294233)
+++ trunk/LayoutTests/inspector/model/dom-node-expected.txt	2022-05-16 15:52:10 UTC (rev 294234)
@@ -7,3 +7,11 @@
 class="test-class"
 data-item="test-data"
 
+-- Running test case: WI.DOMNode.querySelector
+Calling querySelector("#test-id") on document node.
+PASS: `querySelector("#test-id")` should return a WI.DOMNode
+Calling querySelector("#non-existent-id") on document node.
+PASS: `querySelector("#non-existent-id")` should return null.
+Calling querySelector("^\_(invalid selector)_/^") on document node.
+PASS: `querySelector` with an invalid selector should throw a SyntaxError.
+


Modified: trunk/LayoutTests/inspector/model/dom-node.html (294233 => 294234)

--- trunk/LayoutTests/inspector/model/dom-node.html	2022-05-16 15:08:11 UTC (rev 294233)
+++ trunk/LayoutTests/inspector/model/dom-node.html	2022-05-16 15:52:10 UTC (rev 294234)
@@ -25,6 +25,34 @@
 }
 });
 
+suite.addTestCase({
+name: "WI.DOMNode.querySelector",
+description: "Test getting a child node via querySelector.",
+async test() {
+let documentNode = await WI.domManager.requestDocument();
+
+function querySelector(selector) {
+InspectorTest.log(`Calling querySelector("${selector}") on document node.`);
+return documentNode.querySelector(selector).then((nodeId) => {
+if (!nodeId)
+return null;
+return WI.domManager.nodeForId(nodeId);
+});
+}
+
+let nodeFromQueryingExistingId = await querySelector("#test-id");
+InspectorTest.expectThat(nodeFromQueryingExistingId instanceof WI.DOMNode, "`querySelector(\"#test-id\")` should return a WI.DOMNode");
+
+let nodeFromQueryingNonExistantId = await querySelector("#non-existent-id");
+InspectorTest.expectNull(nodeFromQueryingNonExistantId, "`querySelector(\"#non-existent-id\")` should return null.");
+
+await querySelector("^\\_(invalid selector)_/^").catch((error) => {
+InspectorTest.expectEqual(error.message, "SyntaxError", "`querySelector` with an invalid selector should throw a SyntaxError.");
+});
+
+}
+});
+
 suite.runTestCasesAndFinish();
 }
 


Modified: trunk/Source/_javascript_Core/ChangeLog (294233 => 294234)

--- trunk/Source/_javascript_Core/ChangeLog	2022-05-16 15:08:11 UTC (rev 294233)
+++ trunk/Source/_javascript_Core/ChangeLog	2022-05-16 15:52:10 UTC (rev 294234)
@@ -1,3 +1,12 @@
+2022-05-16  Patrick Angle  
+
+Web Inspector: Regression(r266885) Crash sometimes when rehydrating imported audit results
+https://bugs.webkit.org/show_bug.cgi?id=240366
+
+Reviewed by Devin Rousso.
+
+* inspector/protocol/DOM.json:
+
 2022-05-13  Mark Lam  
 
 Enhance the 

[webkit-changes] [293727] trunk

2022-05-03 Thread pangle
Title: [293727] trunk








Revision 293727
Author pan...@apple.com
Date 2022-05-03 09:02:48 -0700 (Tue, 03 May 2022)


Log Message
Web Inspector: Importing a timeline leaves timeline overview non-scrollable/non-zoomable until windows is resized
https://bugs.webkit.org/show_bug.cgi?id=239880

Reviewed by Devin Rousso.

Source/WebInspectorUI:

Cancelling an in-progress layout (or the layout of a child of a view in middle of laying out) led to
`_dirtyDescendantsCount` being in an inconsistent state. Views had their `_dirtyDescendantsCount` cleared before
they are laid out, so every non-zero `_dirtyDescendantsCount` of a view in the process of being laid out meant
that during layout `needsLayout()` was called to dirty that view or one of its children. In this case, a
previous cancellation meant that the TimelineOverview ended up in an inconsistent state where its parent view
tree was not aware that it needed layout because it reached a zero `_dirtyDescendantsCount` while walking down
the view hierarchy, which meant that the TimelineOverview was perpetually stuck until the entire view hierarchy
needed re-laid out due to a window resize or similar event.

Our current accounting for `_dirtyDescendantsCount` in View makes assumptions that are not always true during
layout. Specifically that parents of views undergoing layout will have a non-zero `_dirtyDescendantsCount` still
from which to subtract in `_cancelScheduledLayoutForView`. This wasn't always true because as soon as we began
laying out a parent view, we cleared both the `_dirty` flag as well as zeroed out `_dirtyDescendantsCount`. In
the case of cancelling a layout from within a layout, the cancellation wouldn't actually take effect anyways,
and since `cancelLayout` was only ever invoked from `updateLayout`, the relevant layout flags should instead be
cleared as part of actually performing the layout. `cancelLayout` at most saved us a rAF callback only to
realize we no longer have any views in need of layout, but this benefit was negligible, and in general we should
prefer not to be calling `updateLayout` for performance reasons anyways.

This patch improves the accounting around `_dirtyDescendantsCount`, making sure to decrement it as we perform
layout, instead of all at once. This reduces our reliance on assumptions about who will modify the
`_dirtyDescendantsCount` and at what times relative to layout.

The only time in this patch that we do not do a +1/-1 adjustment to the layout count is in the special case of
attaching/detaching a view. In that case, the parent tree from which we are detaching the view will have the
`_dirtyDescendantsCount` of the detached parent adjusted by the `_dirtyDescendantsCount` of the former child
view. This is done by `_setSelfAndDescendantsNotDirty`, which allows us to avoid an exponential walking of the
tree for this otherwise self-contained operation (we don't call into any overridable functions that could modify
the `_dirty` flag or `_dirtyDescendantsCount`).

After we have cleaned up the former parent branch of the tree, we mark the newly attached view as needing
layout, which will then ensure the child view gets laid out again by marking it as `dirty` and incrementing its
new parent branch of the tree's `_dirtyDescendantsCount`.

* UserInterface/Views/View.js:
(WI.View.prototype.insertSubviewBefore):
- Add assertion that the view is not currently a child of a different view in addition to the existing check
that a view is not already a child of the target view.

(WI.View.prototype._setDirty):
- New utility method through which (almost) all marking of dirty/not dirty should be done in order to ensure
that `_dirtyDescendantsCount` is correctly adjusted.

(WI.View.prototype._didMoveToParent):
- Mark the view and all subviews as not dirty before removing it from its previous parent in order to adjust
`_dirtyDescendantsCount` appropriately, and then mark the view as dirty once attached to its new parent.
- Inline the logic from WI.View.prototype._didMoveToWindow in order to also handle marking children as not dirty
and having a zeroed `_dirtyDescendantsCount`.
- This method contains the exception to the rule that _dirtyDescendantsCount is always incremented/decremented
by one. Here we are able to optimize away the need to walk the entire parent tree for each subview/subviews of
subviews/etc. because the operation takes place all at once with no overridable function being called where we
have to worry about mutations to `_dirty`/`_dirtyDescendantsCount`.

(WI.View.prototype._layoutSubtree):
(WI.View._visitViewTreeForLayout):
- Don't zero out the `_dirtyDescendantsCount`, and instead use the new `_setDirty` helper.

(WI.View._scheduleLayoutForView):
- Don't zero out the `_dirtyDescendantsCount`, and instead use the new `_setDirty` helper.
- Mark the view as dirty after checking if its attached a view so that detached views have no dirty state until
they are attached, at which point the root of the previous detached 

[webkit-changes] [293631] trunk/Source/WebInspectorUI

2022-04-29 Thread pangle
Title: [293631] trunk/Source/WebInspectorUI








Revision 293631
Author pan...@apple.com
Date 2022-04-29 14:50:20 -0700 (Fri, 29 Apr 2022)


Log Message
Web Inspector: Regression(r267038) Import a timeline does not render the timeline, only lists the events
https://bugs.webkit.org/show_bug.cgi?id=239872

Reviewed by Devin Rousso.

Two issues existed after r267038 that prevented the timeline overview from rendering correctly for imported
recordings. The first is that the timeline view itself was not visible as the result of assuming that we would
already be in middle of layout when inside `WI.TimelineRecordingContentView.prototype._updateTimes`, which isn't
true for the updating of times when importing a recording. In that case, syncronously attempting to lay out the
view means that the layout, including initial layout, will be performed before the view is attached, which means
we are unable to get the clientWidth of the view's element during layout, which in turn prevents us from
painting the timeline ruler.

The second issue is that when importing a timeline, we should ignore the current capturing state when setting
the current, start, and end times, otherwise not all the values will be kept.

* UserInterface/Views/TimelineRecordingContentView.js:
(WI.TimelineRecordingContentView):
(WI.TimelineRecordingContentView.prototype._updateTimes):

Modified Paths

trunk/Source/WebInspectorUI/ChangeLog
trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRecordingContentView.js




Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (293630 => 293631)

--- trunk/Source/WebInspectorUI/ChangeLog	2022-04-29 21:38:40 UTC (rev 293630)
+++ trunk/Source/WebInspectorUI/ChangeLog	2022-04-29 21:50:20 UTC (rev 293631)
@@ -1,3 +1,25 @@
+2022-04-29  Patrick Angle  
+
+Web Inspector: Regression(r267038) Import a timeline does not render the timeline, only lists the events
+https://bugs.webkit.org/show_bug.cgi?id=239872
+
+Reviewed by Devin Rousso.
+
+Two issues existed after r267038 that prevented the timeline overview from rendering correctly for imported
+recordings. The first is that the timeline view itself was not visible as the result of assuming that we would
+already be in middle of layout when inside `WI.TimelineRecordingContentView.prototype._updateTimes`, which isn't
+true for the updating of times when importing a recording. In that case, syncronously attempting to lay out the
+view means that the layout, including initial layout, will be performed before the view is attached, which means
+we are unable to get the clientWidth of the view's element during layout, which in turn prevents us from
+painting the timeline ruler.
+
+The second issue is that when importing a timeline, we should ignore the current capturing state when setting
+the current, start, and end times, otherwise not all the values will be kept.
+
+* UserInterface/Views/TimelineRecordingContentView.js:
+(WI.TimelineRecordingContentView):
+(WI.TimelineRecordingContentView.prototype._updateTimes):
+
 2022-04-27  Devin Rousso  
 
 Web Inspector: Uncaught Exception: undefined is not an object (evaluating 'this.resource.hadLoadingError')


Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRecordingContentView.js (293630 => 293631)

--- trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRecordingContentView.js	2022-04-29 21:38:40 UTC (rev 293630)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRecordingContentView.js	2022-04-29 21:50:20 UTC (rev 293631)
@@ -476,11 +476,11 @@
 this._startTimeNeedsReset = false;
 }
 
-if (WI.timelineManager.capturingState !== WI.TimelineManager.CapturingState.Stopping) {
+if (WI.timelineManager.capturingState !== WI.TimelineManager.CapturingState.Stopping || this._recording.imported) {
 // Only update end time while not stopping, otherwise the interface continues scrolling.
 this._timelineOverview.endTime = Math.max(endTime, currentTime);
 
-if (WI.timelineManager.capturingState !== WI.TimelineManager.CapturingState.Inactive) {
+if (WI.timelineManager.capturingState !== WI.TimelineManager.CapturingState.Inactive || this._recording.imported) {
 // Only update current time while active/starting or else the interface continues scrolling.
 this._currentTime = currentTime;
 this._timelineOverview.currentTime = currentTime;
@@ -490,10 +490,14 @@
 if (this.currentTimelineView)
 this._updateTimelineViewTimes(this.currentTimelineView);
 
-// Force a layout now since we are already in an animation frame and don't need to delay it until the next.
-this._timelineOverview.updateLayoutIfNeeded();
-if (this.currentTimelineView)
-this.currentTimelineView.updateLayoutIfNeeded();
+if 

[webkit-changes] [293565] trunk

2022-04-27 Thread pangle
Title: [293565] trunk








Revision 293565
Author pan...@apple.com
Date 2022-04-27 22:32:05 -0700 (Wed, 27 Apr 2022)


Log Message
Web Inspector: [Flexbox] `` and `` elements are appearing in list of Flex containers
https://bugs.webkit.org/show_bug.cgi?id=239425

Reviewed by Devin Rousso.

Source/WebCore:

Added test cases to inspector/css/nodeLayoutContextTypeChanged.html.

* inspector/agents/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::layoutContextTypeForRenderer):

LayoutTests:

* inspector/css/nodeLayoutContextTypeChanged-expected.txt:
* inspector/css/nodeLayoutContextTypeChanged.html:

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/inspector/css/nodeLayoutContextTypeChanged-expected.txt
trunk/LayoutTests/inspector/css/nodeLayoutContextTypeChanged.html
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/inspector/agents/InspectorCSSAgent.cpp




Diff

Modified: trunk/LayoutTests/ChangeLog (293564 => 293565)

--- trunk/LayoutTests/ChangeLog	2022-04-28 05:01:24 UTC (rev 293564)
+++ trunk/LayoutTests/ChangeLog	2022-04-28 05:32:05 UTC (rev 293565)
@@ -1,3 +1,13 @@
+2022-04-27  Patrick Angle  
+
+Web Inspector: [Flexbox] `` and `` elements are appearing in list of Flex containers
+https://bugs.webkit.org/show_bug.cgi?id=239425
+
+Reviewed by Devin Rousso.
+
+* inspector/css/nodeLayoutContextTypeChanged-expected.txt:
+* inspector/css/nodeLayoutContextTypeChanged.html:
+
 2022-04-27  Karl Rackler  
 
 [ macOS wk1 ] Fourteen webgl/2.0.0/conformance tests are a flaky timeout


Modified: trunk/LayoutTests/inspector/css/nodeLayoutContextTypeChanged-expected.txt (293564 => 293565)

--- trunk/LayoutTests/inspector/css/nodeLayoutContextTypeChanged-expected.txt	2022-04-28 05:01:24 UTC (rev 293564)
+++ trunk/LayoutTests/inspector/css/nodeLayoutContextTypeChanged-expected.txt	2022-04-28 05:32:05 UTC (rev 293565)
@@ -1,6 +1,7 @@
 Tests for the CSS.nodeLayoutContextTypeChanged event.
 
 
+
 == Running test suite: CSS.nodeLayoutContextTypeChanged
 -- Running test case: CSS.nodeLayoutContextTypeChanged.GridToNonGrid
 PASS: Layout context should be `grid`.
@@ -22,3 +23,12 @@
 PASS: Layout context should now be `grid`.
 PASS: Layout context should now be `flex`.
 
+-- Running test case: CSS.nodeLayoutContextTypeChanged.NotFlex.SubmitInput
+PASS: Layout context should be `null`.
+
+-- Running test case: CSS.nodeLayoutContextTypeChanged.NotFlex.Select
+PASS: Layout context should be `null`.
+
+-- Running test case: CSS.nodeLayoutContextTypeChanged.NotFlex.Button
+PASS: Layout context should be `null`.
+


Modified: trunk/LayoutTests/inspector/css/nodeLayoutContextTypeChanged.html (293564 => 293565)

--- trunk/LayoutTests/inspector/css/nodeLayoutContextTypeChanged.html	2022-04-28 05:01:24 UTC (rev 293564)
+++ trunk/LayoutTests/inspector/css/nodeLayoutContextTypeChanged.html	2022-04-28 05:32:05 UTC (rev 293565)
@@ -113,6 +113,35 @@
 }
 });
 
+function addEnsureLayoutContextTypeTestCase({name, description, selector, expectedLayoutContextType})
+{
+addTestCase({name, description, selector, async domNodeHandler(domNode) {
+InspectorTest.expectEqual(domNode.layoutContextType, expectedLayoutContextType, `Layout context should be \`${expectedLayoutContextType}\`.`);
+}
+});
+}
+
+addEnsureLayoutContextTypeTestCase({
+name: "CSS.nodeLayoutContextTypeChanged.NotFlex.SubmitInput",
+description: "Make sure an `input` element of type `submit` is not considered a flex container.",
+selector: "#flexSubmitInput",
+expectedLayoutContextType: null,
+});
+
+addEnsureLayoutContextTypeTestCase({
+name: "CSS.nodeLayoutContextTypeChanged.NotFlex.Select",
+description: "Make sure a `select` element is not considered a flex container.",
+selector: "#flexSelect",
+expectedLayoutContextType: null,
+});
+
+addEnsureLayoutContextTypeTestCase({
+name: "CSS.nodeLayoutContextTypeChanged.NotFlex.Button",
+description: "Make sure a `button` is not considered a flex container.",
+selector: "#flexButton",
+expectedLayoutContextType: null,
+});
+
 WI.domManager.requestDocument().then((doc) => {
 documentNode = doc;
 suite.runTestCasesAndFinish();
@@ -155,5 +184,9 @@
 
 
 
+
+
+
+
 
 


Modified: trunk/Source/WebCore/ChangeLog (293564 => 293565)

--- trunk/Source/WebCore/ChangeLog	2022-04-28 05:01:24 UTC (rev 293564)
+++ trunk/Source/WebCore/ChangeLog	2022-04-28 05:32:05 UTC (rev 293565)
@@ -1,3 +1,15 @@
+2022-04-27  Patrick Angle  
+
+Web Inspector: [Flexbox] `` and `` elements are appearing in list of Flex containers
+https://bugs.webkit.org/show_bug.cgi?id=239425
+
+Reviewed by Devin Rousso.
+
+Added test cases to inspector/css/nodeLayoutContextTypeChanged.html.
+
+* inspector/agents/InspectorCSSAgent.cpp:
+  

[webkit-changes] [293264] trunk

2022-04-22 Thread pangle
Title: [293264] trunk








Revision 293264
Author pan...@apple.com
Date 2022-04-22 16:19:24 -0700 (Fri, 22 Apr 2022)


Log Message
Web Inspector: Regression(r287684) Resources from the memory cache show empty content in Network, Sources, and Search tabs
https://bugs.webkit.org/show_bug.cgi?id=239667

Reviewed by Devin Rousso.

Source/WebCore:

Updated tests:
- http/tests/inspector/network/resource-response-source-disk-cache.html
- http/tests/inspector/network/resource-response-source-memory-cache.html

r287684 introduced a subtle bug when calling InspectorInstrumentation::didReceiveData. We rely
on there being a difference between real, but empty, data buffer and not having a data buffer,
but after r287684 an empty SharedBuffer would be passed in the later case. Instead, we should
continue to pass nullptr if there is no buffer so that InspectorNetworkAgent::didReceiveData
can distiguish between the two.

The bug is the result of having a non-nullptr `data` in `InspectorNetworkAgent::didReceiveData`,
which causes us to call `maybeAddResourceData`, which means by the time
`InspectorNetworkAgent::getResponseBody` is called, the ResourceData for the request will have
an empty, not non-existant, `content()`, which means we will return the empty content instead,
since we believe the response had actual content.

* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::didReceiveDataImpl):
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::didReceiveData):
* loader/ResourceLoadNotifier.cpp:
(WebCore::ResourceLoadNotifier::dispatchDidReceiveData):

LayoutTests:

Add test steps to ensure that the resource has content, and that the base64Encoded value matches our
expectations. While only the memory cache was affected by this regression, add the test steps to both
the memory and disk caches to defend this functionality.

* http/tests/inspector/network/resource-response-source-memory-cache-expected.txt:
* http/tests/inspector/network/resource-response-source-memory-cache.html:
* http/tests/inspector/network/resource-response-source-disk-cache-expected.txt:
* http/tests/inspector/network/resource-response-source-disk-cache.html:

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/http/tests/inspector/network/resource-response-source-disk-cache-expected.txt
trunk/LayoutTests/http/tests/inspector/network/resource-response-source-disk-cache.html
trunk/LayoutTests/http/tests/inspector/network/resource-response-source-memory-cache-expected.txt
trunk/LayoutTests/http/tests/inspector/network/resource-response-source-memory-cache.html
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp
trunk/Source/WebCore/inspector/InspectorInstrumentation.h
trunk/Source/WebCore/loader/ResourceLoadNotifier.cpp




Diff

Modified: trunk/LayoutTests/ChangeLog (293263 => 293264)

--- trunk/LayoutTests/ChangeLog	2022-04-22 23:06:32 UTC (rev 293263)
+++ trunk/LayoutTests/ChangeLog	2022-04-22 23:19:24 UTC (rev 293264)
@@ -1,3 +1,19 @@
+2022-04-22  Patrick Angle  
+
+Web Inspector: Regression(r287684) Resources from the memory cache show empty content in Network, Sources, and Search tabs
+https://bugs.webkit.org/show_bug.cgi?id=239667
+
+Reviewed by Devin Rousso.
+
+Add test steps to ensure that the resource has content, and that the base64Encoded value matches our
+expectations. While only the memory cache was affected by this regression, add the test steps to both
+the memory and disk caches to defend this functionality.
+
+* http/tests/inspector/network/resource-response-source-memory-cache-expected.txt:
+* http/tests/inspector/network/resource-response-source-memory-cache.html:
+* http/tests/inspector/network/resource-response-source-disk-cache-expected.txt:
+* http/tests/inspector/network/resource-response-source-disk-cache.html:
+
 2022-04-22  Simon Fraser  
 
 Focusing scroll container before scrolling breaks smooth scrolling


Modified: trunk/LayoutTests/http/tests/inspector/network/resource-response-source-disk-cache-expected.txt (293263 => 293264)

--- trunk/LayoutTests/http/tests/inspector/network/resource-response-source-disk-cache-expected.txt	2022-04-22 23:06:32 UTC (rev 293263)
+++ trunk/LayoutTests/http/tests/inspector/network/resource-response-source-disk-cache-expected.txt	2022-04-22 23:19:24 UTC (rev 293264)
@@ -6,6 +6,8 @@
 -- Running test case: PossibleNetworkLoad
 PASS: Resource should be created.
 PASS: Resource should receive a Response.
+PASS: Response `body` should not be empty.
+PASS: Response should be base64 encoded.
 
 -- Running test case: Resource.ResponseSource.DiskCache
 PASS: Resource should be created.
@@ -12,4 +14,6 @@
 PASS: Resource should receive a Response.
 PASS: statusCode should be 200
 PASS: responseSource should be Symbol(disk-cache)
+PASS: Response `body` should not be empty.
+PASS: Response should be base64 encoded.
 

[webkit-changes] [292818] trunk/Source/WebInspectorUI

2022-04-13 Thread pangle
Title: [292818] trunk/Source/WebInspectorUI








Revision 292818
Author pan...@apple.com
Date 2022-04-13 11:53:13 -0700 (Wed, 13 Apr 2022)


Log Message
Web Inspector: Clean up `WI.DOMNode` to no longer require the shared `WI.DOMManager` be passed during construction
https://bugs.webkit.org/show_bug.cgi?id=239129

Reviewed by Devin Rousso.

* UserInterface/Controllers/DOMManager.js:
(WI.DOMManager.prototype._setDocument):
(WI.DOMManager.prototype._childNodeInserted):
(WI.DOMManager.prototype._pseudoElementAdded):
- Update to use new syntax for `WI.DOMNode` constructor/`newOrExistingFromPayload`. Additionally, there is no
need to explicitly map node ids to nodes here since `WI.DOMNode`'s constructor does this.

(WI.DOMManager.prototype._setChildNodes):
(WI.DOMManager.prototype._setDetachedRoot): Deleted.
- Inline _setDetachedRoot with a comment instead and update to use `WI.DOMNode.newOrExistingFromPayload` instead
of always creating a new node.

* UserInterface/Models/DOMNode.js:
(WI.DOMNode):
- Remove the _domManager property since it will always be `WI.domManager`, the shared singleton and update the
required arguments to use an options object for non-required parameters.

(WI.DOMNode.prototype.newOrExistingFromPayload):
(WI.DOMNode.prototype._insertChild):
(WI.DOMNode.prototype._setChildrenPayload):
- Update to use new constructor syntax.

Modified Paths

trunk/Source/WebInspectorUI/ChangeLog
trunk/Source/WebInspectorUI/UserInterface/Controllers/DOMManager.js
trunk/Source/WebInspectorUI/UserInterface/Models/DOMNode.js




Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (292817 => 292818)

--- trunk/Source/WebInspectorUI/ChangeLog	2022-04-13 18:50:18 UTC (rev 292817)
+++ trunk/Source/WebInspectorUI/ChangeLog	2022-04-13 18:53:13 UTC (rev 292818)
@@ -1,3 +1,33 @@
+2022-04-13  Patrick Angle  
+
+Web Inspector: Clean up `WI.DOMNode` to no longer require the shared `WI.DOMManager` be passed during construction
+https://bugs.webkit.org/show_bug.cgi?id=239129
+
+Reviewed by Devin Rousso.
+
+* UserInterface/Controllers/DOMManager.js:
+(WI.DOMManager.prototype._setDocument):
+(WI.DOMManager.prototype._childNodeInserted):
+(WI.DOMManager.prototype._pseudoElementAdded):
+- Update to use new syntax for `WI.DOMNode` constructor/`newOrExistingFromPayload`. Additionally, there is no
+need to explicitly map node ids to nodes here since `WI.DOMNode`'s constructor does this.
+
+(WI.DOMManager.prototype._setChildNodes):
+(WI.DOMManager.prototype._setDetachedRoot): Deleted.
+- Inline _setDetachedRoot with a comment instead and update to use `WI.DOMNode.newOrExistingFromPayload` instead
+of always creating a new node.
+
+* UserInterface/Models/DOMNode.js:
+(WI.DOMNode):
+- Remove the _domManager property since it will always be `WI.domManager`, the shared singleton and update the
+required arguments to use an options object for non-required parameters.
+
+(WI.DOMNode.prototype.newOrExistingFromPayload):
+(WI.DOMNode.prototype._insertChild):
+(WI.DOMNode.prototype._setChildrenPayload):
+- Update to use new constructor syntax.
+
+
 2022-04-12  Elliott Williams  
 
 [Xcode] In open-source builds, disable bitcode in xcconfigs instead of build-webkit


Modified: trunk/Source/WebInspectorUI/UserInterface/Controllers/DOMManager.js (292817 => 292818)

--- trunk/Source/WebInspectorUI/UserInterface/Controllers/DOMManager.js	2022-04-13 18:50:18 UTC (rev 292817)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/DOMManager.js	2022-04-13 18:53:13 UTC (rev 292818)
@@ -406,7 +406,7 @@
 
 let newDocument = null;
 if (payload && "nodeId" in payload)
-newDocument = new WI.DOMNode(this, null, false, payload);
+newDocument = new WI.DOMNode(payload);
 
 if (this._document === newDocument)
 return;
@@ -422,15 +422,12 @@
 this.dispatchEventToListeners(WI.DOMManager.Event.DocumentUpdated, {document: this._document});
 }
 
-_setDetachedRoot(payload)
-{
-new WI.DOMNode(this, null, false, payload);
-}
-
 _setChildNodes(parentId, payloads)
 {
 if (!parentId && payloads.length) {
-this._setDetachedRoot(payloads[0]);
+// `InspectorDOMAgent::pushNodePathToFrontend` can provide a single child as a detached root node.
+let node = WI.DOMNode.newOrExistingFromPayload(payloads[0]);
+console.assert(!node.parentNode);
 return;
 }
 
@@ -459,7 +456,6 @@
 var parent = this._idToDOMNode[parentId];
 var prev = this._idToDOMNode[prevId];
 var node = parent._insertChild(prev, payload);
-this._idToDOMNode[node.id] = node;
 this.dispatchEventToListeners(WI.DOMManager.Event.NodeInserted, {node, parent});
 }
 
@@ -485,9 +481,8 @@
 if 

[webkit-changes] [292781] trunk/Source/WebInspectorUI

2022-04-12 Thread pangle
Title: [292781] trunk/Source/WebInspectorUI








Revision 292781
Author pan...@apple.com
Date 2022-04-12 12:26:56 -0700 (Tue, 12 Apr 2022)


Log Message
Web Inspector: Add engineering-build-only ability to dump the current known bound nodes tree in Inspector^2 or layout tests
https://bugs.webkit.org/show_bug.cgi?id=239086

Reviewed by Devin Rousso.

* UserInterface/Debug/DOMManager.js: Added.
(appendLine):
(appendChildren):
(get let):
- To assist with debugging layout tests and patches to the DOMManager, add a utility getter to dump the current
node tree.

* UserInterface/Main.html:
* UserInterface/Test.html:

Modified Paths

trunk/Source/WebInspectorUI/ChangeLog
trunk/Source/WebInspectorUI/UserInterface/Main.html
trunk/Source/WebInspectorUI/UserInterface/Test.html


Added Paths

trunk/Source/WebInspectorUI/UserInterface/Debug/DOMManager.js




Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (292780 => 292781)

--- trunk/Source/WebInspectorUI/ChangeLog	2022-04-12 18:52:27 UTC (rev 292780)
+++ trunk/Source/WebInspectorUI/ChangeLog	2022-04-12 19:26:56 UTC (rev 292781)
@@ -1,3 +1,20 @@
+2022-04-12  Patrick Angle  
+
+Web Inspector: Add engineering-build-only ability to dump the current known bound nodes tree in Inspector^2 or layout tests
+https://bugs.webkit.org/show_bug.cgi?id=239086
+
+Reviewed by Devin Rousso.
+
+* UserInterface/Debug/DOMManager.js: Added.
+(appendLine):
+(appendChildren):
+(get let):
+- To assist with debugging layout tests and patches to the DOMManager, add a utility getter to dump the current
+node tree.
+
+* UserInterface/Main.html:
+* UserInterface/Test.html:
+
 2022-04-11  Patrick Angle  
 
 Web Inspector: preserve DOM.NodeId if a node is removed and re-added


Added: trunk/Source/WebInspectorUI/UserInterface/Debug/DOMManager.js (0 => 292781)

--- trunk/Source/WebInspectorUI/UserInterface/Debug/DOMManager.js	(rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Debug/DOMManager.js	2022-04-12 19:26:56 UTC (rev 292781)
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2022 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+Object.defineProperty(WI.DOMManager.prototype, "boundNodesDebugDescription", {
+get() {
+let debugDescription = "";
+function appendLine(line) {
+debugDescription += line + "\n";
+}
+
+const singleLevelSpacePrefix = "";
+function appendChildren(parent, level) {
+let spacePrefix = singleLevelSpacePrefix.repeat(level + 1);
+
+for (let child of parent.children) {
+appendLine(`${spacePrefix}id(${child.id}) displayName(${child.displayName})`);
+
+for (let pseudoElement of child.pseudoElements().values())
+appendLine(`${spacePrefix}${singleLevelSpacePrefix}id(${pseudoElement.id}) displayName(${pseudoElement.displayName})`);
+
+if (child.children)
+appendChildren(child, level + 1);
+}
+}
+
+let rootNodes = Object.values(this._idToDOMNode).filter((value) => !value.parentNode);
+for (let rootNode of rootNodes) {
+appendLine(`<${rootNode === this._document ? "Document" : "Detached"} Root> id(${rootNode.id}) displayName(${rootNode.displayName})`);
+if (rootNode.children)
+appendChildren(rootNode, 0);
+}
+
+return debugDescription;
+}
+});
\ No newline at end of file


Modified: trunk/Source/WebInspectorUI/UserInterface/Main.html (292780 => 292781)

--- trunk/Source/WebInspectorUI/UserInterface/Main.html	

[webkit-changes] [292754] trunk

2022-04-11 Thread pangle
Title: [292754] trunk








Revision 292754
Author pan...@apple.com
Date 2022-04-11 18:34:15 -0700 (Mon, 11 Apr 2022)


Log Message
Web Inspector: preserve DOM.NodeId if a node is removed and re-added
https://bugs.webkit.org/show_bug.cgi?id=189687

Reviewed by Devin Rousso.

Source/WebCore:

Instead of unbinding and rebinding nodes upon removal/reinsertion to the DOM tree, we should only perform the
unbinding actions on a `Node` that is being destroyed.

This resolves an issue where console messages with DOM nodes would behave unexpectedly because the node for a
visible console message could have its children removed in `DOMManager.prototype._unbind`, even though the node
would still have its children when it is removed from the DOM tree (unless it is being destroyed, which is
handled by `DOMManager.prototype.willDestroyDOMNode`).

While not a cause of an issue here, it is worth noting (due to confusion it caused me while investigating) that
even after we stopped keeping `RefPtr` for nodes in r278785 the nodes themselves continued to be kept
alive as part of the `RemoteObject` mechanism because the inspector injected script holds on to nodes until the
`RemoteObject` is released.

* inspector/agents/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::nodeLayoutContextTypeChanged):

* inspector/agents/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::reset):
(WebCore::InspectorDOMAgent::bind):
(WebCore::InspectorDOMAgent::didCommitLoad):
(WebCore::InspectorDOMAgent::didInsertDOMNode):
(WebCore::InspectorDOMAgent::didRemoveDOMNode):
(WebCore::InspectorDOMAgent::pseudoElementDestroyed):
(WebCore::InspectorDOMAgent::unbind): Deleted.
- We should no longer be unbinding and rebinding nodes on insertion/removal, since nodes should keep the same ID
for their lifetime, and we will clean up the binding upon the Node's destruction.

(WebCore::InspectorDOMAgent::willDestroyDOMNode):
(WebCore::InspectorDOMAgent::destroyedNodesTimerFired):
- A Node in middle of being destroyed will no longer have a parent.

* inspector/agents/InspectorDOMAgent.h:

Source/WebInspectorUI:

Instead of unbinding and rebinding nodes upon removal/reinsertion to the DOM tree, we should only perform the
unbinding actions on a `Node` that is being destroyed.

* UserInterface/Controllers/DOMDebuggerManager.js:

* UserInterface/Controllers/DOMManager.js:
(WI.DOMManager.prototype._pseudoElementAdded):

(WI.DOMManager.prototype.willDestroyDOMNode):
(WI.DOMManager.prototype._unbind):
- To match the backend, we should only unbind nodes when they are destroyed, not removed.

* UserInterface/Models/DOMNode.js:
(WI.DOMNode.prototype.newOrExistingFromPayload):
- Reuse an existing orphaned DOMNode if it already exists. In the future, we want to stop sending entire node
payloads to the frontend in those situations.

(WI.DOMNode.prototype._insertChild):
(WI.DOMNode.prototype._setChildrenPayload):

LayoutTests:

Update test to reflect that DOM breakpoints are now able to be reattached to their original node upon insertion
following removal.

* inspector/dom-debugger/dom-breakpoint-node-removed-ancestor.html:
* inspector/dom-debugger/dom-breakpoint-node-removed-ancestor-expected.txt:
* inspector/dom-debugger/dom-breakpoint-node-removed-direct-expected.txt:

* inspector/dom-debugger/resources/dom-breakpoint-utilities.js:
(TestPage.registerInitializer.InspectorTest.DOMBreakpoint.createBreakpoint):
- Add an event handler to log the setting of the domNode for breakpoints. In order to prevent spurious output
when removing breakpoints, instrument the removal of breakpoints to remove the testing event handler before the
node is changed.

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/inspector/dom-debugger/dom-breakpoint-node-removed-ancestor-expected.txt
trunk/LayoutTests/inspector/dom-debugger/dom-breakpoint-node-removed-ancestor.html
trunk/LayoutTests/inspector/dom-debugger/dom-breakpoint-node-removed-direct-expected.txt
trunk/LayoutTests/inspector/dom-debugger/resources/dom-breakpoint-utilities.js
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/inspector/agents/InspectorCSSAgent.cpp
trunk/Source/WebCore/inspector/agents/InspectorDOMAgent.cpp
trunk/Source/WebCore/inspector/agents/InspectorDOMAgent.h
trunk/Source/WebInspectorUI/ChangeLog
trunk/Source/WebInspectorUI/UserInterface/Controllers/DOMDebuggerManager.js
trunk/Source/WebInspectorUI/UserInterface/Controllers/DOMManager.js
trunk/Source/WebInspectorUI/UserInterface/Models/DOMNode.js




Diff

Modified: trunk/LayoutTests/ChangeLog (292753 => 292754)

--- trunk/LayoutTests/ChangeLog	2022-04-12 01:32:43 UTC (rev 292753)
+++ trunk/LayoutTests/ChangeLog	2022-04-12 01:34:15 UTC (rev 292754)
@@ -1,3 +1,23 @@
+2022-04-11  Patrick Angle  
+
+Web Inspector: preserve DOM.NodeId if a node is removed and re-added
+https://bugs.webkit.org/show_bug.cgi?id=189687
+
+Reviewed by Devin Rousso.
+
+Update test to reflect that DOM breakpoints are now able to be reattached to 

[webkit-changes] [292441] trunk/Source/WebInspectorUI

2022-04-05 Thread pangle
Title: [292441] trunk/Source/WebInspectorUI








Revision 292441
Author pan...@apple.com
Date 2022-04-05 16:52:51 -0700 (Tue, 05 Apr 2022)


Log Message
Web Inspector: Regression(r291729) The result of logging $0 to the console shows overlapping `$0` and `$[n]` after the node
https://bugs.webkit.org/show_bug.cgi?id=238843

Reviewed by Devin Rousso.

r291729 was missing a check that the `DOMTreeOutline` is actually supposed to show an indicator for the
inspected node, which means other uses of `DOMTreeOutline` (the console, the sources tab, etc.) were showing the
$0 indicator as well.

* UserInterface/Views/DOMTreeOutline.js:
(WI.DOMTreeOutline.prototype.update):

Modified Paths

trunk/Source/WebInspectorUI/ChangeLog
trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeOutline.js




Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (292440 => 292441)

--- trunk/Source/WebInspectorUI/ChangeLog	2022-04-05 23:28:55 UTC (rev 292440)
+++ trunk/Source/WebInspectorUI/ChangeLog	2022-04-05 23:52:51 UTC (rev 292441)
@@ -1,3 +1,17 @@
+2022-04-05  Patrick Angle  
+
+Web Inspector: Regression(r291729) The result of logging $0 to the console shows overlapping `$0` and `$[n]` after the node
+https://bugs.webkit.org/show_bug.cgi?id=238843
+
+Reviewed by Devin Rousso.
+
+r291729 was missing a check that the `DOMTreeOutline` is actually supposed to show an indicator for the
+inspected node, which means other uses of `DOMTreeOutline` (the console, the sources tab, etc.) were showing the
+$0 indicator as well.
+
+* UserInterface/Views/DOMTreeOutline.js:
+(WI.DOMTreeOutline.prototype.update):
+
 2022-04-01  Michael Saboff  
 
 Stop copying StagedFrameworks to the secondary path by default


Modified: trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeOutline.js (292440 => 292441)

--- trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeOutline.js	2022-04-05 23:28:55 UTC (rev 292440)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeOutline.js	2022-04-05 23:52:51 UTC (rev 292441)
@@ -61,7 +61,8 @@
 this._hideElementsKeyboardShortcut = new WI.KeyboardShortcut(null, "H", this._hideElements.bind(this), this.element);
 this._hideElementsKeyboardShortcut.implicitlyPreventsDefault = false;
 
-if (showInspectedNode)
+this._showInspectedNode = !!showInspectedNode;
+if (this._showInspectedNode)
 WI.domManager.addEventListener(WI.DOMManager.Event.InspectedNodeChanged, this._handleInspectedNodeChanged, this);
 }
 
@@ -189,7 +190,7 @@
 }
 }
 
-if (WI.domManager.inspectedNode) {
+if (this._showInspectedNode && WI.domManager.inspectedNode) {
 let inspectedNodeTreeElement = this.findTreeElement(WI.domManager.inspectedNode);
 if (inspectedNodeTreeElement) {
 inspectedNodeTreeElement.reveal();






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [292181] trunk

2022-03-31 Thread pangle
Title: [292181] trunk








Revision 292181
Author pan...@apple.com
Date 2022-03-31 14:50:47 -0700 (Thu, 31 Mar 2022)


Log Message
Web Inspector: Support Container Queries in the Styles sidebar
https://bugs.webkit.org/show_bug.cgi?id=238346

Reviewed by Devin Rousso.

Source/_javascript_Core:

Add new `container-rule` type for `CSS::Grouping::Type`.

* inspector/protocol/CSS.json:

Source/WebCore:

Test: inspector/css/getMatchedStylesForNodeContainerGrouping.html

Add basic support to Web Inspector for viewing styles in `@container` rules.

* css/CSSContainerRule.cpp:
(WebCore::CSSContainerRule::nameFilterText const):
* css/CSSContainerRule.h:
- Provide a way to get the name that is used to filter the rule to specific containers.

* inspector/InspectorStyleSheet.cpp:
(flattenSourceData):
- In order to prevent future rule types from being added without some consideration for how they are inspected,
use an exhaustive switch-case statement here. This will at minimum allow us to make sure we have opened a bug
and put a FIXME here for new values in the future.

(WebCore::asCSSRuleList):
(WebCore::buildArrayForGroupings):

* style/InspectorCSSOMWrappers.cpp:
(WebCore::Style::InspectorCSSOMWrappers::collect):

Source/WebInspectorUI:

* UserInterface/Models/CSSGrouping.js:
(WI.CSSGrouping.prototype.get isContainer):
(WI.CSSGrouping.prototype.get prefix):
(WI.CSSGrouping):

LayoutTests:

* inspector/css/getMatchedStylesForNodeContainerGrouping-expected.txt: Added.
* inspector/css/getMatchedStylesForNodeContainerGrouping.html: Added.

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/Source/_javascript_Core/ChangeLog
trunk/Source/_javascript_Core/inspector/protocol/CSS.json
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/css/CSSContainerRule.cpp
trunk/Source/WebCore/css/CSSContainerRule.h
trunk/Source/WebCore/inspector/InspectorStyleSheet.cpp
trunk/Source/WebCore/style/InspectorCSSOMWrappers.cpp
trunk/Source/WebInspectorUI/ChangeLog
trunk/Source/WebInspectorUI/UserInterface/Models/CSSGrouping.js


Added Paths

trunk/LayoutTests/inspector/css/getMatchedStylesForNodeContainerGrouping-expected.txt
trunk/LayoutTests/inspector/css/getMatchedStylesForNodeContainerGrouping.html




Diff

Modified: trunk/LayoutTests/ChangeLog (292180 => 292181)

--- trunk/LayoutTests/ChangeLog	2022-03-31 21:35:11 UTC (rev 292180)
+++ trunk/LayoutTests/ChangeLog	2022-03-31 21:50:47 UTC (rev 292181)
@@ -1,3 +1,13 @@
+2022-03-31  Patrick Angle  
+
+Web Inspector: Support Container Queries in the Styles sidebar
+https://bugs.webkit.org/show_bug.cgi?id=238346
+
+Reviewed by Devin Rousso.
+
+* inspector/css/getMatchedStylesForNodeContainerGrouping-expected.txt: Added.
+* inspector/css/getMatchedStylesForNodeContainerGrouping.html: Added.
+
 2022-03-31  Robert Jenner  
 
 REGRESSION(r292051-r292022): [ iOS ] media/video-object-fit.html is a constant image failure


Added: trunk/LayoutTests/inspector/css/getMatchedStylesForNodeContainerGrouping-expected.txt (0 => 292181)

--- trunk/LayoutTests/inspector/css/getMatchedStylesForNodeContainerGrouping-expected.txt	(rev 0)
+++ trunk/LayoutTests/inspector/css/getMatchedStylesForNodeContainerGrouping-expected.txt	2022-03-31 21:50:47 UTC (rev 292181)
@@ -0,0 +1,53 @@
+Tests for the CSS.getMatchedStyleForNode command and container rule groups.
+
+
+== Running test suite: CSS.getMatchedStyleForNode.ContainerGrouping
+-- Running test case: CSS.getMatchedStyleForNode.ContainerGrouping.Narrow
+PASS: Should have 1 authored rules.
+- Testing rule #0
+PASS: Selector text should be "#item".
+PASS: "color" property value should be "peachpuff".
+PASS: Source code for rule should be in file named "getMatchedStylesForNodeContainerGrouping.html".
+PASS: Rule should have no groupings.
+
+-- Running test case: CSS.getMatchedStyleForNode.ContainerGrouping.Medium
+PASS: Should have 2 authored rules.
+- Testing rule #0
+PASS: Selector text should be "#item".
+PASS: "color" property value should be "lemonchiffon".
+PASS: Source code for rule should be in file named "getMatchedStylesForNodeContainerGrouping.html".
+PASS: Rule should have 2 grouping(s).
+PASS: Grouping 0 should have a type of "container-rule".
+PASS: Grouping 0 should have a text of "usedName (width >= 200px)".
+PASS: Grouping 1 should have a type of "supports-rule".
+PASS: Grouping 1 should have a text of "(color: red)".
+- Testing rule #1
+PASS: Selector text should be "#item".
+PASS: "color" property value should be "peachpuff".
+PASS: Source code for rule should be in file named "getMatchedStylesForNodeContainerGrouping.html".
+PASS: Rule should have no groupings.
+
+-- Running test case: CSS.getMatchedStyleForNode.ContainerGrouping.Wide
+PASS: Should have 3 authored rules.
+- Testing rule #0
+PASS: Selector text should be "#item".
+PASS: "color" property value should be "thistle".
+PASS: Source code for rule should be in file named 

[webkit-changes] [292075] trunk/Source/JavaScriptCore

2022-03-29 Thread pangle
Title: [292075] trunk/Source/_javascript_Core








Revision 292075
Author pan...@apple.com
Date 2022-03-29 15:10:45 -0700 (Tue, 29 Mar 2022)


Log Message
Web Inspector: Add check for null `entryScope` in JSC::Debugger::detach
https://bugs.webkit.org/show_bug.cgi?id=238518

Reviewed by Devin Rousso.

A virtual machine may not always have an `entryScope`, which can occur if a `JSGlobalObject` is being destructed
(which will call into `JSC::Debugger::Detach`) before a `VMEntryScope` is created or after a `VMEntryScope` has
fallen out of scope, causing the VM's `entryScope` to be null again. In the original internal issue that led to
finding this, this most commonly occurred in conjunction with page refresh while the debugger was paused.

Because it is possible that we were previously paused in the VM that now has no `entryScope`, we should go ahead
and unpause.

* debugger/Debugger.cpp:
(JSC::Debugger::detach):

Modified Paths

trunk/Source/_javascript_Core/ChangeLog
trunk/Source/_javascript_Core/debugger/Debugger.cpp




Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (292074 => 292075)

--- trunk/Source/_javascript_Core/ChangeLog	2022-03-29 21:57:50 UTC (rev 292074)
+++ trunk/Source/_javascript_Core/ChangeLog	2022-03-29 22:10:45 UTC (rev 292075)
@@ -1,5 +1,23 @@
 2022-03-29  Patrick Angle  
 
+Web Inspector: Add check for null `entryScope` in JSC::Debugger::detach
+https://bugs.webkit.org/show_bug.cgi?id=238518
+
+Reviewed by Devin Rousso.
+
+A virtual machine may not always have an `entryScope`, which can occur if a `JSGlobalObject` is being destructed
+(which will call into `JSC::Debugger::Detach`) before a `VMEntryScope` is created or after a `VMEntryScope` has
+fallen out of scope, causing the VM's `entryScope` to be null again. In the original internal issue that led to
+finding this, this most commonly occurred in conjunction with page refresh while the debugger was paused.
+
+Because it is possible that we were previously paused in the VM that now has no `entryScope`, we should go ahead
+and unpause.
+
+* debugger/Debugger.cpp:
+(JSC::Debugger::detach):
+
+2022-03-29  Patrick Angle  
+
 Web Inspector: [Cocoa] Indicate a request was sent through proxy/private relay in Network tab
 https://bugs.webkit.org/show_bug.cgi?id=233202
 


Modified: trunk/Source/_javascript_Core/debugger/Debugger.cpp (292074 => 292075)

--- trunk/Source/_javascript_Core/debugger/Debugger.cpp	2022-03-29 21:57:50 UTC (rev 292074)
+++ trunk/Source/_javascript_Core/debugger/Debugger.cpp	2022-03-29 22:10:45 UTC (rev 292075)
@@ -171,7 +171,7 @@
 VM& vm = globalObject->vm();
 JSLockHolder locker(vm);
 
-if (m_isPaused && m_currentCallFrame && vm.entryScope->globalObject() == globalObject) {
+if (m_isPaused && m_currentCallFrame && (!vm.isEntered() || vm.entryScope->globalObject() == globalObject)) {
 m_currentCallFrame = nullptr;
 m_pauseOnCallFrame = nullptr;
 continueProgram();






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [292037] trunk/Source

2022-03-29 Thread pangle
Title: [292037] trunk/Source








Revision 292037
Author pan...@apple.com
Date 2022-03-29 10:26:24 -0700 (Tue, 29 Mar 2022)


Log Message
Web Inspector: [Cocoa] Indicate a request was sent through proxy/private relay in Network tab
https://bugs.webkit.org/show_bug.cgi?id=233202

Reviewed by Devin Rousso.

Source/_javascript_Core:

Add new `isProxyConnection` property to network metrics protocol object.

* inspector/protocol/Network.json:

Source/WebCore:

Add plumbing for the new `isProxyConnection` network metric.

* inspector/agents/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::buildObjectForMetrics):
* platform/network/NetworkLoadMetrics.cpp:
(WebCore::AdditionalNetworkLoadMetricsForWebInspector::isolatedCopy):
* platform/network/NetworkLoadMetrics.h:
(WebCore::AdditionalNetworkLoadMetricsForWebInspector::encode const):
(WebCore::AdditionalNetworkLoadMetricsForWebInspector::decode):

Source/WebInspectorUI:

For resources that are sent through a proxy or relay (like iCloud Private Relay), the remoteAddress will be that
of the proxy or relay server, not the server that provided the page to the proxy or relay. To indicate this, we
now append `(Proxy)` to these remote IP addresses in Web Inspector so that it is clearer what server the remote
address actually represents in these cases.

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Models/LocalResource.js:
* UserInterface/Models/Resource.js:
(WI.Resource.prototype.get displayRemoteAddress):
- Similar to `displayName` and `displayURL` which provide user-facing strings, add a `displayRemoteAddress` that
will denote the address is a proxy if applicable.

(WI.Resource.prototype.updateWithMetrics):
* UserInterface/Views/NetworkTableContentView.js:
(WI.NetworkTableContentView.prototype._entryForResource):
* UserInterface/Views/ResourceDetailsSidebarPanel.js:
(WI.ResourceDetailsSidebarPanel.prototype._refreshRequestAndResponse):
* UserInterface/Views/ResourceHeadersContentView.js:
(WI.ResourceHeadersContentView.prototype._refreshSummarySection):
* UserInterface/Views/ResourceTimelineDataGridNode.js:
(WI.ResourceTimelineDataGridNode.prototype.get data):

Source/WebKit:

Add plumbing for the new `isProxyConnection` network metric.

* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]):

Modified Paths

trunk/Source/_javascript_Core/ChangeLog
trunk/Source/_javascript_Core/inspector/protocol/Network.json
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp
trunk/Source/WebCore/platform/network/NetworkLoadMetrics.cpp
trunk/Source/WebCore/platform/network/NetworkLoadMetrics.h
trunk/Source/WebInspectorUI/ChangeLog
trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js
trunk/Source/WebInspectorUI/UserInterface/Models/LocalResource.js
trunk/Source/WebInspectorUI/UserInterface/Models/Resource.js
trunk/Source/WebInspectorUI/UserInterface/Views/NetworkTableContentView.js
trunk/Source/WebInspectorUI/UserInterface/Views/ResourceDetailsSidebarPanel.js
trunk/Source/WebInspectorUI/UserInterface/Views/ResourceHeadersContentView.js
trunk/Source/WebInspectorUI/UserInterface/Views/ResourceTimelineDataGridNode.js
trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm




Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (292036 => 292037)

--- trunk/Source/_javascript_Core/ChangeLog	2022-03-29 17:21:17 UTC (rev 292036)
+++ trunk/Source/_javascript_Core/ChangeLog	2022-03-29 17:26:24 UTC (rev 292037)
@@ -1,3 +1,14 @@
+2022-03-29  Patrick Angle  
+
+Web Inspector: [Cocoa] Indicate a request was sent through proxy/private relay in Network tab
+https://bugs.webkit.org/show_bug.cgi?id=233202
+
+Reviewed by Devin Rousso.
+
+Add new `isProxyConnection` property to network metrics protocol object.
+
+* inspector/protocol/Network.json:
+
 2022-03-28  Yusuke Suzuki  
 
 [JSC] Clean up some 32bit load/store with 64bit load/store


Modified: trunk/Source/_javascript_Core/inspector/protocol/Network.json (292036 => 292037)

--- trunk/Source/_javascript_Core/inspector/protocol/Network.json	2022-03-29 17:21:17 UTC (rev 292036)
+++ trunk/Source/_javascript_Core/inspector/protocol/Network.json	2022-03-29 17:26:24 UTC (rev 292037)
@@ -95,7 +95,8 @@
 { "name": "responseHeaderBytesReceived", "type": "number", "optional": true, "description": "Total HTTP response header bytes received over the network." },
 { "name": "responseBodyBytesReceived", "type": "number", "optional": true, "description": "Total HTTP response body bytes received over the network." },
 { "name": "responseBodyDecodedSize", "type": "number", "optional": true, "description": "Total decoded response body size in bytes." },
-{ "name": "securityConnection", "$ref": "Security.Connection", "optional": true, "description": "Connection 

[webkit-changes] [291824] trunk/Source/WebCore

2022-03-24 Thread pangle
Title: [291824] trunk/Source/WebCore








Revision 291824
Author pan...@apple.com
Date 2022-03-24 16:29:30 -0700 (Thu, 24 Mar 2022)


Log Message
Web Inspector: Blank inspector in a page with container queries
https://bugs.webkit.org/show_bug.cgi?id=238338

Reviewed by Devin Rousso.

Because there is no CSSOM implementation for container queries, we are unable to inspect them currently.
However, we should be resilient to the absence of that implementation and expect that not all rules have a
matching CSSOM implementation, instead of just crashing when it happens. This patch only resolves crashes as the
result of the presence of container queries, and followup work will be done to actually plumb the correct
information to Web Inspector to show these rules.

* inspector/InspectorStyleSheet.cpp:
(WebCore::InspectorStyleSheet::collectFlatRules):
* inspector/agents/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::collectStyleSheets):
* style/InspectorCSSOMWrappers.cpp:
(WebCore::Style::InspectorCSSOMWrappers::collect):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/inspector/InspectorStyleSheet.cpp
trunk/Source/WebCore/inspector/agents/InspectorCSSAgent.cpp
trunk/Source/WebCore/style/InspectorCSSOMWrappers.cpp




Diff

Modified: trunk/Source/WebCore/ChangeLog (291823 => 291824)

--- trunk/Source/WebCore/ChangeLog	2022-03-24 23:23:53 UTC (rev 291823)
+++ trunk/Source/WebCore/ChangeLog	2022-03-24 23:29:30 UTC (rev 291824)
@@ -1,3 +1,23 @@
+2022-03-24  Patrick Angle  
+
+Web Inspector: Blank inspector in a page with container queries
+https://bugs.webkit.org/show_bug.cgi?id=238338
+
+Reviewed by Devin Rousso.
+
+Because there is no CSSOM implementation for container queries, we are unable to inspect them currently.
+However, we should be resilient to the absence of that implementation and expect that not all rules have a
+matching CSSOM implementation, instead of just crashing when it happens. This patch only resolves crashes as the
+result of the presence of container queries, and followup work will be done to actually plumb the correct
+information to Web Inspector to show these rules.
+
+* inspector/InspectorStyleSheet.cpp:
+(WebCore::InspectorStyleSheet::collectFlatRules):
+* inspector/agents/InspectorCSSAgent.cpp:
+(WebCore::InspectorCSSAgent::collectStyleSheets):
+* style/InspectorCSSOMWrappers.cpp:
+(WebCore::Style::InspectorCSSOMWrappers::collect):
+
 2022-03-24  Antoine Quint  
 
 DOM GPUP: paintSystemPreviewBadge (AR QuickLook element badge)


Modified: trunk/Source/WebCore/inspector/InspectorStyleSheet.cpp (291823 => 291824)

--- trunk/Source/WebCore/inspector/InspectorStyleSheet.cpp	2022-03-24 23:23:53 UTC (rev 291823)
+++ trunk/Source/WebCore/inspector/InspectorStyleSheet.cpp	2022-03-24 23:29:30 UTC (rev 291824)
@@ -1526,6 +1526,9 @@
 
 for (unsigned i = 0, size = ruleList->length(); i < size; ++i) {
 CSSRule* rule = ruleList->item(i);
+if (!rule)
+continue;
+
 CSSStyleRule* styleRule = InspectorCSSAgent::asCSSStyleRule(*rule);
 if (styleRule)
 result->append(styleRule);


Modified: trunk/Source/WebCore/inspector/agents/InspectorCSSAgent.cpp (291823 => 291824)

--- trunk/Source/WebCore/inspector/agents/InspectorCSSAgent.cpp	2022-03-24 23:23:53 UTC (rev 291823)
+++ trunk/Source/WebCore/inspector/agents/InspectorCSSAgent.cpp	2022-03-24 23:29:30 UTC (rev 291824)
@@ -648,9 +648,8 @@
 result.append(styleSheet);
 
 for (unsigned i = 0, size = styleSheet->length(); i < size; ++i) {
-CSSRule* rule = styleSheet->item(i);
-if (is(*rule)) {
-if (CSSStyleSheet* importedStyleSheet = downcast(*rule).styleSheet())
+if (auto* rule = dynamicDowncast(styleSheet->item(i))) {
+if (CSSStyleSheet* importedStyleSheet = rule->styleSheet())
 collectStyleSheets(importedStyleSheet, result);
 }
 }


Modified: trunk/Source/WebCore/style/InspectorCSSOMWrappers.cpp (291823 => 291824)

--- trunk/Source/WebCore/style/InspectorCSSOMWrappers.cpp	2022-03-24 23:23:53 UTC (rev 291823)
+++ trunk/Source/WebCore/style/InspectorCSSOMWrappers.cpp	2022-03-24 23:29:30 UTC (rev 291824)
@@ -59,6 +59,9 @@
 unsigned size = listType->length();
 for (unsigned i = 0; i < size; ++i) {
 CSSRule* cssRule = listType->item(i);
+if (!cssRule)
+continue;
+
 switch (cssRule->styleRuleType()) {
 case StyleRuleType::Import:
 collect(downcast(*cssRule).styleSheet());






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [291823] trunk/Source/WebKit

2022-03-24 Thread pangle
Title: [291823] trunk/Source/WebKit








Revision 291823
Author pan...@apple.com
Date 2022-03-24 16:23:53 -0700 (Thu, 24 Mar 2022)


Log Message
REGRESSION(STP142): "A _javascript_ exception occured: Can't find variable: utils" from SafariDriver
https://bugs.webkit.org/show_bug.cgi?id=238335

Reviewed by Devin Rousso.

Following r289467, we can't just copy the WebDriver atom scripts to the build products, since they now need to
have `utils.js` in any script that uses the `utils` namespace. The `WebKit.framework` copy of these scripts are
later used while building safaridriver, so they need to include the scripts as well.

* WebKit.xcodeproj/project.pbxproj:

Modified Paths

trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj




Diff

Modified: trunk/Source/WebKit/ChangeLog (291822 => 291823)

--- trunk/Source/WebKit/ChangeLog	2022-03-24 23:22:51 UTC (rev 291822)
+++ trunk/Source/WebKit/ChangeLog	2022-03-24 23:23:53 UTC (rev 291823)
@@ -1,3 +1,16 @@
+2022-03-24  Patrick Angle  
+
+REGRESSION(STP142): "A _javascript_ exception occured: Can't find variable: utils" from SafariDriver
+https://bugs.webkit.org/show_bug.cgi?id=238335
+
+Reviewed by Devin Rousso.
+
+Following r289467, we can't just copy the WebDriver atom scripts to the build products, since they now need to
+have `utils.js` in any script that uses the `utils` namespace. The `WebKit.framework` copy of these scripts are
+later used while building safaridriver, so they need to include the scripts as well.
+
+* WebKit.xcodeproj/project.pbxproj:
+
 2022-03-24  Per Arne Vollan  
 
 REGRESSION(r286590): Links with URL schemes are not clickable in Mail


Modified: trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj (291822 => 291823)

--- trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj	2022-03-24 23:22:51 UTC (rev 291822)
+++ trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj	2022-03-24 23:23:53 UTC (rev 291823)
@@ -16685,7 +16685,7 @@
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 			shellPath = /bin/sh;
-			shellScript = "DST_DIR=\"$TARGET_BUILD_DIR/$PRIVATE_HEADERS_FOLDER_PATH/atoms\"\nmkdir -p \"$DST_DIR\"\n\nfor ((i = 0; i < ${SCRIPT_INPUT_FILE_COUNT}; ++i)); do\neval WEBDRIVER_ATOM=\\${SCRIPT_INPUT_FILE_${i}}\nditto \"${WEBDRIVER_ATOM}\" \"${DST_DIR}/${WEBDRIVER_ATOM##*/}\"\ndone\n";
+			shellScript = "DST_DIR=\"$TARGET_BUILD_DIR/$PRIVATE_HEADERS_FOLDER_PATH/atoms\"\nmkdir -p \"$DST_DIR\"\n\nfor ((i = 0; i < ${SCRIPT_INPUT_FILE_COUNT}; ++i)); do\neval WEBDRIVER_ATOM=\\${SCRIPT_INPUT_FILE_${i}}\npython3 ${SRCROOT}/Scripts/generate-automation-atom.py \"${WEBDRIVER_ATOM}\" \"${DST_DIR}/${WEBDRIVER_ATOM##*/}\"\ndone\n";
 		};
 		A55DEAA61670402E003DB841 /* Check For Inappropriate Macros in External Headers */ = {
 			isa = PBXShellScriptBuildPhase;






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [291746] trunk

2022-03-23 Thread pangle
Title: [291746] trunk








Revision 291746
Author pan...@apple.com
Date 2022-03-23 09:40:09 -0700 (Wed, 23 Mar 2022)


Log Message
No breakpoints hit on github.com, and some are invalid
https://bugs.webkit.org/show_bug.cgi?id=235607

Reviewed by Yusuke Suzuki.

JSTests:

Add test for multi-line parsing errors.

* stress/regress-88440831.js: Added.

Source/_javascript_Core:

New test: JSTests/stress/regress-88440831.js
Added test case in: inspector/debugger/breakpoints/resolved-dump-all-pause-locations.html

Previously not all line terminations resulted in setting the `m_lineStart` to the current m_code, which meant
that the location for pause-able locations and stack traces were inaccurate when they were on a line that
terminated multi-line comments, strings, or template strings. We now always update m_lineStart when shifting for
a line terminator, instead of only when the terminator appears outside a string or comment.

* debugger/Breakpoint.cpp:
(JSC::Breakpoint::resolve):
- The existing assertions were somewhat in conflict with each other. If we permit the line number to increase,
there is no guarantee that the column number will remain the same or increase, which can now more easily occur
with multi-line strings. Instead, we should make sure that the overall offset has increased.

* parser/Lexer.cpp:
(JSC::Lexer::shiftLineTerminator):
(JSC::Lexer::lexWithoutClearingLineTerminator):
(JSC::Lexer::scanTemplateString):

LayoutTests:

Add test cases for resolving breakpoints on lines that begin with the end of multi-line strings, comments, and
template strings.

* inspector/debugger/breakpoints/resolved-dump-all-pause-locations-expected.txt:
* inspector/debugger/breakpoints/resolved-dump-all-pause-locations.html:
* inspector/debugger/breakpoints/resources/dump-multiline.js: Added.
(test):

Modified Paths

trunk/JSTests/ChangeLog
trunk/LayoutTests/ChangeLog
trunk/LayoutTests/inspector/debugger/breakpoints/resolved-dump-all-pause-locations-expected.txt
trunk/LayoutTests/inspector/debugger/breakpoints/resolved-dump-all-pause-locations.html
trunk/Source/_javascript_Core/ChangeLog
trunk/Source/_javascript_Core/debugger/Breakpoint.cpp
trunk/Source/_javascript_Core/parser/Lexer.cpp


Added Paths

trunk/JSTests/stress/regress-88440831.js
trunk/LayoutTests/inspector/debugger/breakpoints/resources/dump-multiline.js




Diff

Modified: trunk/JSTests/ChangeLog (291745 => 291746)

--- trunk/JSTests/ChangeLog	2022-03-23 14:12:54 UTC (rev 291745)
+++ trunk/JSTests/ChangeLog	2022-03-23 16:40:09 UTC (rev 291746)
@@ -1,3 +1,14 @@
+2022-03-23  Patrick Angle  
+
+No breakpoints hit on github.com, and some are invalid
+https://bugs.webkit.org/show_bug.cgi?id=235607
+
+Reviewed by Yusuke Suzuki.
+
+Add test for multi-line parsing errors.
+
+* stress/regress-88440831.js: Added.
+
 2022-03-22  Yusuke Suzuki  
 
 [JSC] Test DFG / FTL DataIC


Added: trunk/JSTests/stress/regress-88440831.js (0 => 291746)

--- trunk/JSTests/stress/regress-88440831.js	(rev 0)
+++ trunk/JSTests/stress/regress-88440831.js	2022-03-23 16:40:09 UTC (rev 291746)
@@ -0,0 +1,11 @@
+// This test passes if it does not crash in Debug builds
+
+(function() {
+try {
+eval('\'\\\n\n\'');
+} catch {}
+
+try {
+new Function("/* comment */\n(/*;");
+} catch {}
+})();
\ No newline at end of file


Modified: trunk/LayoutTests/ChangeLog (291745 => 291746)

--- trunk/LayoutTests/ChangeLog	2022-03-23 14:12:54 UTC (rev 291745)
+++ trunk/LayoutTests/ChangeLog	2022-03-23 16:40:09 UTC (rev 291746)
@@ -1,3 +1,18 @@
+2022-03-23  Patrick Angle  
+
+No breakpoints hit on github.com, and some are invalid
+https://bugs.webkit.org/show_bug.cgi?id=235607
+
+Reviewed by Yusuke Suzuki.
+
+Add test cases for resolving breakpoints on lines that begin with the end of multi-line strings, comments, and
+template strings.
+
+* inspector/debugger/breakpoints/resolved-dump-all-pause-locations-expected.txt:
+* inspector/debugger/breakpoints/resolved-dump-all-pause-locations.html:
+* inspector/debugger/breakpoints/resources/dump-multiline.js: Added.
+(test):
+
 2022-03-23  Ziran Sun  
 
 [InputElement] Add HTMLInputElement::showPicker() method


Modified: trunk/LayoutTests/inspector/debugger/breakpoints/resolved-dump-all-pause-locations-expected.txt (291745 => 291746)

--- trunk/LayoutTests/inspector/debugger/breakpoints/resolved-dump-all-pause-locations-expected.txt	2022-03-23 14:12:54 UTC (rev 291745)
+++ trunk/LayoutTests/inspector/debugger/breakpoints/resolved-dump-all-pause-locations-expected.txt	2022-03-23 16:40:09 UTC (rev 291746)
@@ -2814,3 +2814,82 @@
   4
 
 
+-- Running test case: Debugger.resolvedBreakpoint.dumpAllLocations.Multiline
+
+INSERTING AT: 0:0
+PAUSES AT: 1:4
+ ->   0#function test() {
+ =>   1|var x;
+  2}
+  3
+  4// Strings
+
+INSERTING AT: 1:5

[webkit-changes] [291729] trunk/Source/WebInspectorUI

2022-03-22 Thread pangle
Title: [291729] trunk/Source/WebInspectorUI








Revision 291729
Author pan...@apple.com
Date 2022-03-22 17:19:32 -0700 (Tue, 22 Mar 2022)


Log Message
Web Inspector: Elements tab: selection variable not displayed after losing focus
https://bugs.webkit.org/show_bug.cgi?id=238226

Reviewed by Devin Rousso.

When rebuilding the underlying `DOMTreeElements`, we should make sure the inspected node is marked as such,
otherwise we won't update this until a different element becomes the inspected node.

* UserInterface/Views/DOMTreeOutline.js:
(WI.DOMTreeOutline.prototype.update):

Modified Paths

trunk/Source/WebInspectorUI/ChangeLog
trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeOutline.js




Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (291728 => 291729)

--- trunk/Source/WebInspectorUI/ChangeLog	2022-03-23 00:11:38 UTC (rev 291728)
+++ trunk/Source/WebInspectorUI/ChangeLog	2022-03-23 00:19:32 UTC (rev 291729)
@@ -1,5 +1,18 @@
 2022-03-22  Patrick Angle  
 
+Web Inspector: Elements tab: selection variable not displayed after losing focus
+https://bugs.webkit.org/show_bug.cgi?id=238226
+
+Reviewed by Devin Rousso.
+
+When rebuilding the underlying `DOMTreeElements`, we should make sure the inspected node is marked as such,
+otherwise we won't update this until a different element becomes the inspected node.
+
+* UserInterface/Views/DOMTreeOutline.js:
+(WI.DOMTreeOutline.prototype.update):
+
+2022-03-22  Patrick Angle  
+
 Web Inspector: `console.log` format strings containing invalid specifiers results in `[Object object]` replacing the specifier instead of ignoring the invalid specifier
 https://bugs.webkit.org/show_bug.cgi?id=235061
 


Modified: trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeOutline.js (291728 => 291729)

--- trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeOutline.js	2022-03-23 00:11:38 UTC (rev 291728)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeOutline.js	2022-03-23 00:19:32 UTC (rev 291729)
@@ -189,6 +189,14 @@
 }
 }
 
+if (WI.domManager.inspectedNode) {
+let inspectedNodeTreeElement = this.findTreeElement(WI.domManager.inspectedNode);
+if (inspectedNodeTreeElement) {
+inspectedNodeTreeElement.reveal();
+inspectedNodeTreeElement.listItemElement.classList.add("inspected-node");
+}
+}
+
 if (!selectedTreeElements.length)
 return;
 






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [291712] trunk

2022-03-22 Thread pangle
Title: [291712] trunk








Revision 291712
Author pan...@apple.com
Date 2022-03-22 15:22:09 -0700 (Tue, 22 Mar 2022)


Log Message
Source/WebInspectorUI:
Web Inspector: `console.log` format strings containing invalid specifiers results in `[Object object]` replacing the specifier instead of ignoring the invalid specifier
https://bugs.webkit.org/show_bug.cgi?id=235061

Reviewed by Devin Rousso.

Logged console messages previously allows an specifier, even invalid ones, to be replaced with values. We should
instead ignore the invalid specifier to match Firefox's behavior. (Chrome's behavior currently is to remove the
invalid specifier from the result without replacing it with the first next available substitution value.)

Other call sites using `String.format` are handling localized strings or other backend-provided strings that
should always be well-formatted, so falling back to handling a format specifier as a string is not a particularly
useful behavior.

* UserInterface/Base/Utilities.js:
(value):

LayoutTests:
Web Inspector: console.log print strings contains '%_' result is Object
https://bugs.webkit.org/show_bug.cgi?id=235061

Reviewed by Devin Rousso.

* inspector/unit-tests/string-utilities-expected.txt:
* inspector/unit-tests/string-utilities.html:

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/inspector/unit-tests/string-utilities-expected.txt
trunk/LayoutTests/inspector/unit-tests/string-utilities.html
trunk/Source/WebInspectorUI/ChangeLog
trunk/Source/WebInspectorUI/UserInterface/Base/Utilities.js




Diff

Modified: trunk/LayoutTests/ChangeLog (291711 => 291712)

--- trunk/LayoutTests/ChangeLog	2022-03-22 22:18:50 UTC (rev 291711)
+++ trunk/LayoutTests/ChangeLog	2022-03-22 22:22:09 UTC (rev 291712)
@@ -1,3 +1,13 @@
+2022-03-22  Patrick Angle  
+
+Web Inspector: console.log print strings contains '%_' result is Object
+https://bugs.webkit.org/show_bug.cgi?id=235061
+
+Reviewed by Devin Rousso.
+
+* inspector/unit-tests/string-utilities-expected.txt:
+* inspector/unit-tests/string-utilities.html:
+
 2022-03-22  Matteo Flores  
 
 REGRESSION(r291523-r291501): [ iOS ] fast/dom/intersection-observer-document-leak.html is a flaky text failure


Modified: trunk/LayoutTests/inspector/unit-tests/string-utilities-expected.txt (291711 => 291712)

--- trunk/LayoutTests/inspector/unit-tests/string-utilities-expected.txt	2022-03-22 22:18:50 UTC (rev 291711)
+++ trunk/LayoutTests/inspector/unit-tests/string-utilities-expected.txt	2022-03-22 22:22:09 UTC (rev 291712)
@@ -19,6 +19,10 @@
 PASS: integer format specifier with string argument should attempt conversion to integer
 PASS: integer format specifier with Infinity argument should show "NaN"
 PASS: integer format specifier with NaN argument should show "NaN"
+Testing string with unknown specifier.
+WARN: String.format("%_ %s", "first", "second"): Unsupported format specifier "%_" will be ignored.
+PASS: Formatter string with unknown specifier should not replace unknown specifier.
+PASS: Formatter string with unknown specifier should have an unused substitution value.
 
 -- Running test case: String.prototype.extendedLocaleCompare
 PASS: "1" < "2"


Modified: trunk/LayoutTests/inspector/unit-tests/string-utilities.html (291711 => 291712)

--- trunk/LayoutTests/inspector/unit-tests/string-utilities.html	2022-03-22 22:18:50 UTC (rev 291711)
+++ trunk/LayoutTests/inspector/unit-tests/string-utilities.html	2022-03-22 22:22:09 UTC (rev 291712)
@@ -30,6 +30,12 @@
 InspectorTest.expectThat("%d".format("137") === "137", "integer format specifier with string argument should attempt conversion to integer");
 InspectorTest.expectThat("%d".format(Infinity) === "NaN", "integer format specifier with Infinity argument should show \"NaN\"");
 InspectorTest.expectThat("%d".format(NaN) === "NaN", "integer format specifier with NaN argument should show \"NaN\"");
+
+InspectorTest.log("Testing string with unknown specifier.");
+let formatWithUnknownSpecifiers = String.format("%_ %s", ["first", "second"], String.standardFormatters, "", function(a, b) { return a + b; });
+InspectorTest.expectThat(formatWithUnknownSpecifiers.formattedResult === "%_ first", "Formatter string with unknown specifier should not replace unknown specifier.");
+InspectorTest.expectThat(formatWithUnknownSpecifiers.unusedSubstitutions[0] === "second", "Formatter string with unknown specifier should have an unused substitution value.");
+
 return true;
 }
 });


Modified: trunk/Source/WebInspectorUI/ChangeLog (291711 => 291712)

--- trunk/Source/WebInspectorUI/ChangeLog	2022-03-22 22:18:50 UTC (rev 291711)
+++ trunk/Source/WebInspectorUI/ChangeLog	2022-03-22 22:22:09 UTC (rev 291712)
@@ -1,3 +1,21 @@
+2022-03-22  Patrick Angle  
+
+Web Inspector: `console.log` format strings containing invalid specifiers results in 

[webkit-changes] [291519] trunk/Source/WebCore

2022-03-18 Thread pangle
Title: [291519] trunk/Source/WebCore








Revision 291519
Author pan...@apple.com
Date 2022-03-18 20:25:35 -0700 (Fri, 18 Mar 2022)


Log Message
Web Inspector: `console.screenshot` has extra transparent pixels at bottom of screenshot on platforms with viewports that are obscured by browser chrome
https://bugs.webkit.org/show_bug.cgi?id=238060

Reviewed by Devin Rousso.

ScrollView::sizeForVisibleRect includes partially-visible portions of the viewport, including in Safari's case
the part of the viewport under the semi-translucent title bar. Because we force an origin of zero, this meant
that we were overshooting the bottom of the viewport by the height of this area when taking a snapshot for
`console.screenshot()`. Instead, we should use unobscured viewport rectangle and provide coordinates in
document-space, not view-space to `WebCore::snapshotFrameRect`.

* page/PageConsoleClient.cpp:
(WebCore::PageConsoleClient::screenshot):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/page/PageConsoleClient.cpp




Diff

Modified: trunk/Source/WebCore/ChangeLog (291518 => 291519)

--- trunk/Source/WebCore/ChangeLog	2022-03-19 02:00:37 UTC (rev 291518)
+++ trunk/Source/WebCore/ChangeLog	2022-03-19 03:25:35 UTC (rev 291519)
@@ -1,3 +1,19 @@
+2022-03-18  Patrick Angle  
+
+Web Inspector: `console.screenshot` has extra transparent pixels at bottom of screenshot on platforms with viewports that are obscured by browser chrome
+https://bugs.webkit.org/show_bug.cgi?id=238060
+
+Reviewed by Devin Rousso.
+
+ScrollView::sizeForVisibleRect includes partially-visible portions of the viewport, including in Safari's case
+the part of the viewport under the semi-translucent title bar. Because we force an origin of zero, this meant
+that we were overshooting the bottom of the viewport by the height of this area when taking a snapshot for
+`console.screenshot()`. Instead, we should use unobscured viewport rectangle and provide coordinates in
+document-space, not view-space to `WebCore::snapshotFrameRect`.
+
+* page/PageConsoleClient.cpp:
+(WebCore::PageConsoleClient::screenshot):
+
 2022-03-18  Devin Rousso  
 
 Web Inspector: REGRESSION(?): Emulate User Gesture doesn't work


Modified: trunk/Source/WebCore/page/PageConsoleClient.cpp (291518 => 291519)

--- trunk/Source/WebCore/page/PageConsoleClient.cpp	2022-03-19 02:00:37 UTC (rev 291518)
+++ trunk/Source/WebCore/page/PageConsoleClient.cpp	2022-03-19 03:25:35 UTC (rev 291519)
@@ -411,8 +411,8 @@
 if (UNLIKELY(InspectorInstrumentation::hasFrontends())) {
 if (!target) {
 // If no target is provided, capture an image of the viewport.
-IntRect imageRect(IntPoint::zero(), m_page.mainFrame().view()->sizeForVisibleContent());
-if (auto snapshot = WebCore::snapshotFrameRect(m_page.mainFrame(), imageRect, { { SnapshotFlags::InViewCoordinates }, PixelFormat::BGRA8, DestinationColorSpace::SRGB() }))
+auto viewportRect = m_page.mainFrame().view()->unobscuredContentRect();
+if (auto snapshot = WebCore::snapshotFrameRect(m_page.mainFrame(), viewportRect, { { }, PixelFormat::BGRA8, DestinationColorSpace::SRGB() }))
 dataURL = snapshot->toDataURL("image/png"_s, std::nullopt, PreserveResolution::Yes);
 }
 






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [290856] trunk/Source

2022-03-04 Thread pangle
Title: [290856] trunk/Source








Revision 290856
Author pan...@apple.com
Date 2022-03-04 17:06:41 -0800 (Fri, 04 Mar 2022)


Log Message
REGRESSION (r284472): [ Monterey ] http/tests/websocket/tests/hybi/inspector/send-and-recieve-debugger.html is failing
https://bugs.webkit.org/show_bug.cgi?id=237280

Reviewed by Devin Rousso.

Source/WebCore:

Covered by existing http/tests/websocket/tests/hybi/inspector/* test cases.

On macOS Monterey we use NSURLSession-based WebSockets by default, unlike earlier versions of macOS. The channel
for these sockets is implemented in `WebKit::WebSocketChannel`. The non-NSURLSession WebSockets channel (at
least on Cocoa platforms) is implemented in `WebCore::WebSocketChannel`.

As of r284472 the logic to delay the dispatch of received WebSocket message on platforms using
NSURLSession-based WebSockets is handled by `WebCore::WebSocket`, not the `WebKit::WebSocketChannel`.
`WebKit::WebSocketChannel` now immediately does the work it needs to, and only the delegated work to `WebSocket`
is queued and taken care of when the socket has resumed. This resulted in some of the instrumentation in
`WebKit::WebSocketChannel` being able to be called while the socket was suspended leading to events being logged
in the frontend "in the future" (e.g. before the paused script would have been able to be aware of them). To
correct this the `WebKit::WebSocketChannel` now provides a hook into its helper `WebSocketChannelInspector`
object to allow the `WebCore::WebSocket` to notify Web Inspector of events at the same time it is being
logically handled by the page.

Other `ThreadableWebSocketChannel` implementations will instead provide `nullptr` in place of a pointer to a
`WebInspectorChannelInspector`. `WebCore::WebSocketChannel` was not affected by the changes in r284472 as it has
a different way to guarantee that the methods containing InspectorInstrumentation were not called while the
channel was suspended (and enforced with numerous `ASSERT(!m_suspended)` checks).

* Modules/websockets/ThreadableWebSocketChannel.h:
(WebCore::ThreadableWebSocketChannel::channelInspector const):

* Modules/websockets/WebSocketChannelClient.h:
- Add `reason` for error messages so they can be sent to Web Inspector.

* Modules/websockets/WebSocket.cpp:
(WebCore::WebSocket::didReceiveMessage):
(WebCore::WebSocket::didReceiveBinaryData):
(WebCore::WebSocket::didReceiveMessageError):
(WebCore::WebSocket::didClose):
* Modules/websockets/WebSocket.h:
- Move inspector instrumentation calls from `WebKit::WebSocketChannel` to here so that they are not called until
the socket is resumed.
- We also now wrap these instrumentation calls in an unlikely check for frontends to avoid allocating the
simulated call frames when Web Inspector isn't even open.

* Modules/websockets/WebSocketChannelInspector.cpp:
(WebCore::WebSocketChannelInspector::WebSocketChannelInspector):
(WebCore::WebSocketChannelInspector::didCreateWebSocket const):
(WebCore::WebSocketChannelInspector::willSendWebSocketHandshakeRequest const):
(WebCore::WebSocketChannelInspector::didReceiveWebSocketHandshakeResponse const):
(WebCore::WebSocketChannelInspector::didCloseWebSocket const):
(WebCore::WebSocketChannelInspector::didReceiveWebSocketFrame const):
(WebCore::WebSocketChannelInspector::didSendWebSocketFrame const):
(WebCore::WebSocketChannelInspector::didReceiveWebSocketFrameError const):
(WebCore::WebSocketChannelInspector::createFrame):
(WebCore::WebSocketChannelInspector::didCreateWebSocket): Deleted.
(WebCore::WebSocketChannelInspector::willSendWebSocketHandshakeRequest): Deleted.
(WebCore::WebSocketChannelInspector::didReceiveWebSocketHandshakeResponse): Deleted.
(WebCore::WebSocketChannelInspector::didCloseWebSocket): Deleted.
(WebCore::WebSocketChannelInspector::didReceiveWebSocketFrame): Deleted.
(WebCore::WebSocketChannelInspector::didSendWebSocketFrame): Deleted.
(WebCore::WebSocketChannelInspector::didReceiveWebSocketFrameError): Deleted.
* Modules/websockets/WebSocketChannelInspector.h:
- Update to keep a WeakRef to the `Document` to reduce the amount of plumbing necessary to call these methods
from `WebSocket`.
- Move static utility method `createFrame` here from `WebKit::WebSocketChannel` since it is only used for
inspector instrumentation.

* Modules/websockets/WorkerThreadableWebSocketChannel.cpp:
(WebCore::WorkerThreadableWebSocketChannel::Peer::didReceiveMessageError):
(WebCore::WorkerThreadableWebSocketChannel::Bridge::connect):
* Modules/websockets/WorkerThreadableWebSocketChannel.h:
* Modules/websockets/ThreadableWebSocketChannelClientWrapper.cpp:
(WebCore::ThreadableWebSocketChannelClientWrapper::didReceiveMessageError):
* Modules/websockets/ThreadableWebSocketChannelClientWrapper.h:
* Modules/websockets/WebSocketChannel.cpp:
(WebCore::WebSocketChannel::fail):
(WebCore::WebSocketChannel::didFailSocketStream):
* Modules/websockets/WebSocketChannel.h:
- Update these classes to pass along a reason, if available, for errors.


[webkit-changes] [290855] trunk/Source/WebKit

2022-03-04 Thread pangle
Title: [290855] trunk/Source/WebKit








Revision 290855
Author pan...@apple.com
Date 2022-03-04 17:01:11 -0800 (Fri, 04 Mar 2022)


Log Message
Web Inspector: [Cocoa] Continually opening and closing Web Inspector sometimes crashes
https://bugs.webkit.org/show_bug.cgi?id=237484

Reviewed by Darin Adler.

We need to handle operations on the main queue because `webView:stopURLSchemeTask:` will be called from the main
queue, and we must not be in middle the operation when we get the request to stop said operation, otherwise we
may attempt to call `[urlSchemeTask did*]`, which is not permitted after we have been asked to stop that task.
If we add the operation for the `WKURLSchemeTask` to a different queue it is possible we will have already
started the operation on a background queue while at the same time are receiving a request to stop that same
`WKURLSchemeTask`.

* UIProcess/Inspector/mac/WKInspectorResourceURLSchemeHandler.mm:
(-[WKInspectorResourceURLSchemeHandler webView:startURLSchemeTask:]):
(-[WKInspectorResourceURLSchemeHandler webView:stopURLSchemeTask:]):

Modified Paths

trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/UIProcess/Inspector/mac/WKInspectorResourceURLSchemeHandler.mm




Diff

Modified: trunk/Source/WebKit/ChangeLog (290854 => 290855)

--- trunk/Source/WebKit/ChangeLog	2022-03-05 00:48:00 UTC (rev 290854)
+++ trunk/Source/WebKit/ChangeLog	2022-03-05 01:01:11 UTC (rev 290855)
@@ -1,3 +1,21 @@
+2022-03-04  Patrick Angle  
+
+Web Inspector: [Cocoa] Continually opening and closing Web Inspector sometimes crashes
+https://bugs.webkit.org/show_bug.cgi?id=237484
+
+Reviewed by Darin Adler.
+
+We need to handle operations on the main queue because `webView:stopURLSchemeTask:` will be called from the main
+queue, and we must not be in middle the operation when we get the request to stop said operation, otherwise we
+may attempt to call `[urlSchemeTask did*]`, which is not permitted after we have been asked to stop that task.
+If we add the operation for the `WKURLSchemeTask` to a different queue it is possible we will have already
+started the operation on a background queue while at the same time are receiving a request to stop that same
+`WKURLSchemeTask`.
+
+* UIProcess/Inspector/mac/WKInspectorResourceURLSchemeHandler.mm:
+(-[WKInspectorResourceURLSchemeHandler webView:startURLSchemeTask:]):
+(-[WKInspectorResourceURLSchemeHandler webView:stopURLSchemeTask:]):
+
 2022-03-04  Myles C. Maxfield  
 
 [iOS] Books ASSERTs upon opening a book with a debug build of WebKit


Modified: trunk/Source/WebKit/UIProcess/Inspector/mac/WKInspectorResourceURLSchemeHandler.mm (290854 => 290855)

--- trunk/Source/WebKit/UIProcess/Inspector/mac/WKInspectorResourceURLSchemeHandler.mm	2022-03-05 00:48:00 UTC (rev 290854)
+++ trunk/Source/WebKit/UIProcess/Inspector/mac/WKInspectorResourceURLSchemeHandler.mm	2022-03-05 01:01:11 UTC (rev 290855)
@@ -38,7 +38,6 @@
 @implementation WKInspectorResourceURLSchemeHandler {
 RetainPtr, NSOperation *>> _fileLoadOperations;
 RetainPtr _cachedBundle;
-RetainPtr _operationQueue;
 
 RetainPtr> _allowedURLSchemesForCSP;
 RetainPtr> _mainResourceURLsForCSP;
@@ -66,6 +65,7 @@
 
 - (void)webView:(WKWebView *)webView startURLSchemeTask:(id )urlSchemeTask
 {
+dispatch_assert_queue(dispatch_get_main_queue());
 if (!_cachedBundle) {
 _cachedBundle = [NSBundle bundleWithIdentifier:@"com.apple.WebInspectorUI"];
 
@@ -77,20 +77,8 @@
 if (!_fileLoadOperations)
 _fileLoadOperations = adoptNS([[NSMapTable alloc] initWithKeyOptions:NSPointerFunctionsStrongMemory valueOptions:NSPointerFunctionsStrongMemory capacity:5]);
 
-if (!_operationQueue) {
-_operationQueue = adoptNS([[NSOperationQueue alloc] init]);
-_operationQueue.get().underlyingQueue = dispatch_get_global_queue(QOS_CLASS_USER_INTERACTIVE, 0);
-_operationQueue.get().qualityOfService = NSOperationQualityOfServiceUserInteractive;
-
-// The default value (NSOperationQueueDefaultMaxConcurrentOperationCount) results in a large number of threads
-// that can exceed the soft limit if two Web Inspector instances are being loaded simultaneously.
-_operationQueue.get().maxConcurrentOperationCount = 4;
-}
-
 NSBlockOperation *operation = [NSBlockOperation blockOperationWithBlock:^{
-dispatch_async(dispatch_get_main_queue(), ^{
-[_fileLoadOperations removeObjectForKey:urlSchemeTask];
-});
+[_fileLoadOperations removeObjectForKey:urlSchemeTask];
 
 NSURL *requestURL = urlSchemeTask.request.URL;
 NSURL *fileURLForRequest = [_cachedBundle URLForResource:requestURL.relativePath withExtension:@""];
@@ -134,18 +122,16 @@
 }];
 
 [_fileLoadOperations setObject:operation forKey:urlSchemeTask];
-[_operationQueue addOperation:operation];
+[[NSOperationQueue 

[webkit-changes] [290671] trunk/Source/WebCore

2022-03-01 Thread pangle
Title: [290671] trunk/Source/WebCore








Revision 290671
Author pan...@apple.com
Date 2022-03-01 13:19:10 -0800 (Tue, 01 Mar 2022)


Log Message
Web app fails only when dev tools is open
https://bugs.webkit.org/show_bug.cgi?id=235017

Reviewed by Devin Rousso.

Using the `ScriptExecutionContext` from `event.target()->scriptExecutionContext()` can result the either having a
different script context from the one used when calling `willHandleEvent`, or the event target's context could be
`nullptr`. This can occur when handling the event in `EventTarget::innerInvokeEventListeners` results in a
context change for the event's target, like a MessagePort that has been `disentangle`d, which sets the script
execution context to `nullptr`. Because we only need the script execution context to get the correct injected
script, and the correct injected script for the action below will always be the same injected script used in
`willHandleEvent`, we ignore the current script execution context of the event's target and use the context the
event's target had when it began invoking event listeners.

This change protects us both from the reported crash, as well as leaving an injected script in a bad state
because we did not call `setEventValue` and `clearEventValue` on matching injected scripts for a single event.

* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::willHandleEventImpl):
(WebCore::InspectorInstrumentation::didHandleEventImpl):
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::willHandleEvent):
(WebCore::InspectorInstrumentation::didHandleEvent):
* inspector/agents/InspectorDOMDebuggerAgent.cpp:
(WebCore::InspectorDOMDebuggerAgent::willHandleEvent):
(WebCore::InspectorDOMDebuggerAgent::didHandleEvent):
* inspector/agents/InspectorDOMDebuggerAgent.h:

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp
trunk/Source/WebCore/inspector/InspectorInstrumentation.h
trunk/Source/WebCore/inspector/agents/InspectorDOMDebuggerAgent.cpp
trunk/Source/WebCore/inspector/agents/InspectorDOMDebuggerAgent.h




Diff

Modified: trunk/Source/WebCore/ChangeLog (290670 => 290671)

--- trunk/Source/WebCore/ChangeLog	2022-03-01 21:02:20 UTC (rev 290670)
+++ trunk/Source/WebCore/ChangeLog	2022-03-01 21:19:10 UTC (rev 290671)
@@ -1,3 +1,33 @@
+2022-03-01  Patrick Angle  
+
+Web app fails only when dev tools is open
+https://bugs.webkit.org/show_bug.cgi?id=235017
+
+Reviewed by Devin Rousso.
+
+Using the `ScriptExecutionContext` from `event.target()->scriptExecutionContext()` can result the either having a
+different script context from the one used when calling `willHandleEvent`, or the event target's context could be
+`nullptr`. This can occur when handling the event in `EventTarget::innerInvokeEventListeners` results in a
+context change for the event's target, like a MessagePort that has been `disentangle`d, which sets the script
+execution context to `nullptr`. Because we only need the script execution context to get the correct injected
+script, and the correct injected script for the action below will always be the same injected script used in
+`willHandleEvent`, we ignore the current script execution context of the event's target and use the context the
+event's target had when it began invoking event listeners.
+
+This change protects us both from the reported crash, as well as leaving an injected script in a bad state
+because we did not call `setEventValue` and `clearEventValue` on matching injected scripts for a single event.
+
+* inspector/InspectorInstrumentation.cpp:
+(WebCore::InspectorInstrumentation::willHandleEventImpl):
+(WebCore::InspectorInstrumentation::didHandleEventImpl):
+* inspector/InspectorInstrumentation.h:
+(WebCore::InspectorInstrumentation::willHandleEvent):
+(WebCore::InspectorInstrumentation::didHandleEvent):
+* inspector/agents/InspectorDOMDebuggerAgent.cpp:
+(WebCore::InspectorDOMDebuggerAgent::willHandleEvent):
+(WebCore::InspectorDOMDebuggerAgent::didHandleEvent):
+* inspector/agents/InspectorDOMDebuggerAgent.h:
+
 2022-03-01  Martin Robinson  
 
 When interpolating between transform lists partial prefix matches should not use matrix interpolation


Modified: trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp (290670 => 290671)

--- trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp	2022-03-01 21:02:20 UTC (rev 290670)
+++ trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp	2022-03-01 21:19:10 UTC (rev 290671)
@@ -419,22 +419,22 @@
 timelineAgent->willDispatchEvent(event, document.frame());
 }
 
-void InspectorInstrumentation::willHandleEventImpl(InstrumentingAgents& instrumentingAgents, Event& event, const RegisteredEventListener& listener)
+void 

[webkit-changes] [290510] trunk/Source/JavaScriptCore

2022-02-25 Thread pangle
Title: [290510] trunk/Source/_javascript_Core








Revision 290510
Author pan...@apple.com
Date 2022-02-25 08:32:10 -0800 (Fri, 25 Feb 2022)


Log Message
Web Inspector: [Cocoa] Split remote inspector message data into smaller chunks for large messages
https://bugs.webkit.org/show_bug.cgi?id=237110


Reviewed by Devin Rousso.

Messages over 2 MiB will now be split into multiple chunks, which allows us to not exceed any receiving daemon
process' memory limit under otherwise normal conditions. 2 MiB was chosen as a balance between not having to
split most messages at all and making sure that the messages (and any copies made during the relaying of the
messages) do not exceed the memory limits of the receiving daemon process.

In order to prevent us from sending chunked messages to a process that doesn't support them we check for a flag
to enable this functionality during connection setup.

* inspector/remote/RemoteInspector.h:
* inspector/remote/RemoteInspectorConstants.h:
* inspector/remote/cocoa/RemoteInspectorCocoa.mm:
(Inspector::RemoteInspector::sendMessageToRemote):
(Inspector::RemoteInspector::receivedSetupMessage):

Modified Paths

trunk/Source/_javascript_Core/ChangeLog
trunk/Source/_javascript_Core/inspector/remote/RemoteInspector.h
trunk/Source/_javascript_Core/inspector/remote/RemoteInspectorConstants.h
trunk/Source/_javascript_Core/inspector/remote/cocoa/RemoteInspectorCocoa.mm




Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (290509 => 290510)

--- trunk/Source/_javascript_Core/ChangeLog	2022-02-25 16:23:12 UTC (rev 290509)
+++ trunk/Source/_javascript_Core/ChangeLog	2022-02-25 16:32:10 UTC (rev 290510)
@@ -1,3 +1,25 @@
+2022-02-25  Patrick Angle  
+
+Web Inspector: [Cocoa] Split remote inspector message data into smaller chunks for large messages
+https://bugs.webkit.org/show_bug.cgi?id=237110
+
+
+Reviewed by Devin Rousso.
+
+Messages over 2 MiB will now be split into multiple chunks, which allows us to not exceed any receiving daemon
+process' memory limit under otherwise normal conditions. 2 MiB was chosen as a balance between not having to
+split most messages at all and making sure that the messages (and any copies made during the relaying of the
+messages) do not exceed the memory limits of the receiving daemon process.
+
+In order to prevent us from sending chunked messages to a process that doesn't support them we check for a flag
+to enable this functionality during connection setup.
+
+* inspector/remote/RemoteInspector.h:
+* inspector/remote/RemoteInspectorConstants.h:
+* inspector/remote/cocoa/RemoteInspectorCocoa.mm:
+(Inspector::RemoteInspector::sendMessageToRemote):
+(Inspector::RemoteInspector::receivedSetupMessage):
+
 2022-02-24  Chris Dumez  
 
 [Cocoa] Only clear ICU cache when time zone is changed


Modified: trunk/Source/_javascript_Core/inspector/remote/RemoteInspector.h (290509 => 290510)

--- trunk/Source/_javascript_Core/inspector/remote/RemoteInspector.h	2022-02-25 16:23:12 UTC (rev 290509)
+++ trunk/Source/_javascript_Core/inspector/remote/RemoteInspector.h	2022-02-25 16:32:10 UTC (rev 290510)
@@ -290,6 +290,7 @@
 ProcessID m_parentProcessIdentifier { 0 };
 #if PLATFORM(COCOA)
 RetainPtr m_parentProcessAuditData;
+bool m_messageDataTypeChunkSupported { false };
 #endif
 bool m_shouldSendParentProcessInformation { false };
 bool m_automaticInspectionEnabled { false };


Modified: trunk/Source/_javascript_Core/inspector/remote/RemoteInspectorConstants.h (290509 => 290510)

--- trunk/Source/_javascript_Core/inspector/remote/RemoteInspectorConstants.h	2022-02-25 16:23:12 UTC (rev 290509)
+++ trunk/Source/_javascript_Core/inspector/remote/RemoteInspectorConstants.h	2022-02-25 16:32:10 UTC (rev 290510)
@@ -56,6 +56,7 @@
 #define WIRUserInfoKey  @"WIRUserInfoKey"
 #define WIRApplicationDictionaryKey @"WIRApplicationDictionaryKey"
 #define WIRMessageDataKey   @"WIRMessageDataKey"
+#define WIRMessageDataTypeKey   @"WIRMessageDataTypeKey"
 #define WIRApplicationGetListingMessage @"WIRApplicationGetListingMessage"
 #define WIRApplicationWakeUpDebuggablesMessage  @"WIRApplicationWakeUpDebuggablesMessage"
 #define WIRIndicateMessage  @"WIRIndicateMessage"
@@ -82,7 +83,13 @@
 #define WIRTypeWeb  @"WIRTypeWeb" // COMPATIBILITY (iOS 13): "Web" was split into "Page" (WebCore::Page) and "WebPage" (WebKit::WebPageProxy).
 #define WIRTypeWebPage  @"WIRTypeWebPage"
 #define WIRAutomaticallyPause   @"WIRAutomaticallyPause"
+#define WIRMessageDataTypeChunkSupportedKey @"WIRMessageDataTypeChunkSupportedKey"
 
+// Allowed values for WIRMessageDataTypeKey.
+#define WIRMessageDataTypeFull  @"WIRMessageDataTypeFull"
+#define WIRMessageDataTypeChunk  

[webkit-changes] [290112] trunk/Source/WebCore

2022-02-17 Thread pangle
Title: [290112] trunk/Source/WebCore








Revision 290112
Author pan...@apple.com
Date 2022-02-17 21:21:37 -0800 (Thu, 17 Feb 2022)


Log Message
Web Inspector: [Flexbox] Add indicators for layout context in element tooltips
https://bugs.webkit.org/show_bug.cgi?id=236738

Reviewed by Devin Rousso.

* en.lproj/Localizable.strings:
* inspector/InspectorOverlay.cpp:
(WebCore::rendererIsFlexboxItem):
(WebCore::rendererIsGridItem):
(WebCore::InspectorOverlay::drawElementTitle):
- Add new `Flex Item`, `Flex`, `Grid Item`, and `Grid` bubblea to element tooltips to allow provide more
context about layout while selecting nodes on a page.
- Move the role into its own bubble with special color (based on the previous coloring of the `Role` text).

* inspector/InspectorOverlayLabel.cpp:
(WebCore::InspectorOverlayLabel::draw):
* inspector/InspectorOverlayLabel.h:
(WebCore::InspectorOverlayLabel::Content::encode const):
(WebCore::InspectorOverlayLabel::Content::decode):
(WebCore::InspectorOverlayLabel::Content::Decoration::encode const):
(WebCore::InspectorOverlayLabel::Content::Decoration::decode):
- Add the concept of text decoration (currently just bordered text).
- Create an intermediate `ComputedContentRun` to hold the intermediate representation of content with the
computed attributes of each piece of text. This allows us to better scale with the addition of the new text
decorations and other configuration properties instead of having to create even more Vectors of things that need
to be kept in sync with each other.

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/en.lproj/Localizable.strings
trunk/Source/WebCore/inspector/InspectorOverlay.cpp
trunk/Source/WebCore/inspector/InspectorOverlayLabel.cpp
trunk/Source/WebCore/inspector/InspectorOverlayLabel.h




Diff

Modified: trunk/Source/WebCore/ChangeLog (290111 => 290112)

--- trunk/Source/WebCore/ChangeLog	2022-02-18 04:52:02 UTC (rev 290111)
+++ trunk/Source/WebCore/ChangeLog	2022-02-18 05:21:37 UTC (rev 290112)
@@ -1,3 +1,32 @@
+2022-02-17  Patrick Angle  
+
+Web Inspector: [Flexbox] Add indicators for layout context in element tooltips
+https://bugs.webkit.org/show_bug.cgi?id=236738
+
+Reviewed by Devin Rousso.
+
+* en.lproj/Localizable.strings:
+* inspector/InspectorOverlay.cpp:
+(WebCore::rendererIsFlexboxItem):
+(WebCore::rendererIsGridItem):
+(WebCore::InspectorOverlay::drawElementTitle):
+- Add new `Flex Item`, `Flex`, `Grid Item`, and `Grid` bubblea to element tooltips to allow provide more
+context about layout while selecting nodes on a page.
+- Move the role into its own bubble with special color (based on the previous coloring of the `Role` text).
+
+* inspector/InspectorOverlayLabel.cpp:
+(WebCore::InspectorOverlayLabel::draw):
+* inspector/InspectorOverlayLabel.h:
+(WebCore::InspectorOverlayLabel::Content::encode const):
+(WebCore::InspectorOverlayLabel::Content::decode):
+(WebCore::InspectorOverlayLabel::Content::Decoration::encode const):
+(WebCore::InspectorOverlayLabel::Content::Decoration::decode):
+- Add the concept of text decoration (currently just bordered text).
+- Create an intermediate `ComputedContentRun` to hold the intermediate representation of content with the
+computed attributes of each piece of text. This allows us to better scale with the addition of the new text
+decorations and other configuration properties instead of having to create even more Vectors of things that need
+to be kept in sync with each other.
+
 2022-02-17  Simon Fraser  
 
 Crash under ScrollingCoordinatorMac::hasNodeWithAnimatedScrollChanged()


Modified: trunk/Source/WebCore/en.lproj/Localizable.strings (290111 => 290112)

--- trunk/Source/WebCore/en.lproj/Localizable.strings	2022-02-18 04:52:02 UTC (rev 290111)
+++ trunk/Source/WebCore/en.lproj/Localizable.strings	2022-02-18 05:21:37 UTC (rev 290112)
@@ -478,6 +478,12 @@
 /* Default application name for Open With context menu */
 "Finder" = "Finder";
 
+/* Inspector element selection tooltip text for Flexbox containers. */
+"Flex (Inspector Element Selection)" = "Flex";
+
+/* Inspector element selection tooltip text for items inside a Flexbox Container. */
+"Flex Item (Inspector Element Selection)" = "Flex Item";
+
 /* Font context sub-menu item */
 "Font" = "Font";
 
@@ -502,6 +508,12 @@
 /* Google Safe Browsing */
 "Google Safe Browsing" = "Google Safe Browsing";
 
+/* Inspector element selection tooltip text for Grid containers. */
+"Grid (Inspector Element Selection)" = "Grid";
+
+/* Inspector element selection tooltip text for items inside a Grid Container. */
+"Grid Item (Inspector Element Selection)" = "Grid Item";
+
 /* accessibility role description for web area */
 "HTML content" = "HTML content";
 


Modified: trunk/Source/WebCore/inspector/InspectorOverlay.cpp (290111 => 290112)


[webkit-changes] [290047] trunk/Source/WebCore

2022-02-17 Thread pangle
Title: [290047] trunk/Source/WebCore








Revision 290047
Author pan...@apple.com
Date 2022-02-17 12:05:29 -0800 (Thu, 17 Feb 2022)


Log Message
Web Inspector: [Flexbox] Gaps and free space do not have pattern fills when navigating to a page with Web Inspector already open
https://bugs.webkit.org/show_bug.cgi?id=236741

Reviewed by Devin Rousso.

Because calls to `getDocument` actually resets the `InspectorDOMAgent`, we don't want to clear cached layout
information inside `reset`. The cached layout information is in a WeakHashMap, we aren't going to end up keeping
stale references around anyways, and the under most circumstances the map will clean itself up as it is used.
We should, however go ahead and clear the cached layout information when we are forcing a re-layout to collect
the information again for a new document.

Additionally, if a new document is set, we want to trigger a layout just like we did for a fresh
`InspectorDOMAgent`.

* inspector/agents/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::didCreateFrontendAndBackend):
(WebCore::InspectorDOMAgent::reset):
(WebCore::InspectorDOMAgent::setDocument):
(WebCore::InspectorDOMAgent::relayoutDocument):
* inspector/agents/InspectorDOMAgent.h:

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/inspector/agents/InspectorDOMAgent.cpp
trunk/Source/WebCore/inspector/agents/InspectorDOMAgent.h




Diff

Modified: trunk/Source/WebCore/ChangeLog (290046 => 290047)

--- trunk/Source/WebCore/ChangeLog	2022-02-17 20:04:07 UTC (rev 290046)
+++ trunk/Source/WebCore/ChangeLog	2022-02-17 20:05:29 UTC (rev 290047)
@@ -1,3 +1,26 @@
+2022-02-17  Patrick Angle  
+
+Web Inspector: [Flexbox] Gaps and free space do not have pattern fills when navigating to a page with Web Inspector already open
+https://bugs.webkit.org/show_bug.cgi?id=236741
+
+Reviewed by Devin Rousso.
+
+Because calls to `getDocument` actually resets the `InspectorDOMAgent`, we don't want to clear cached layout
+information inside `reset`. The cached layout information is in a WeakHashMap, we aren't going to end up keeping
+stale references around anyways, and the under most circumstances the map will clean itself up as it is used.
+We should, however go ahead and clear the cached layout information when we are forcing a re-layout to collect
+the information again for a new document.
+
+Additionally, if a new document is set, we want to trigger a layout just like we did for a fresh
+`InspectorDOMAgent`.
+
+* inspector/agents/InspectorDOMAgent.cpp:
+(WebCore::InspectorDOMAgent::didCreateFrontendAndBackend):
+(WebCore::InspectorDOMAgent::reset):
+(WebCore::InspectorDOMAgent::setDocument):
+(WebCore::InspectorDOMAgent::relayoutDocument):
+* inspector/agents/InspectorDOMAgent.h:
+
 2022-02-17  Aditya Keerthi  
 
 [macOS] Light appearance text fields are invisible in Increased Contrast mode


Modified: trunk/Source/WebCore/inspector/agents/InspectorDOMAgent.cpp (290046 => 290047)

--- trunk/Source/WebCore/inspector/agents/InspectorDOMAgent.cpp	2022-02-17 20:04:07 UTC (rev 290046)
+++ trunk/Source/WebCore/inspector/agents/InspectorDOMAgent.cpp	2022-02-17 20:05:29 UTC (rev 290047)
@@ -309,8 +309,7 @@
 m_document = m_inspectedPage.mainFrame().document();
 
 // Force a layout so that we can collect additional information from the layout process.
-if (m_document)
-m_document->updateLayout();
+relayoutDocument();
 
 #if ENABLE(VIDEO)
 if (m_document)
@@ -362,7 +361,6 @@
 if (m_revalidateStyleAttrTask)
 m_revalidateStyleAttrTask->reset();
 m_document = nullptr;
-m_flexibleBoxRendererCachedItemsAtStartOfLine.clear();
 
 m_destroyedDetachedNodeIdentifiers.clear();
 m_destroyedAttachedNodeIdentifiers.clear();
@@ -379,6 +377,9 @@
 
 m_document = document;
 
+// Force a layout so that we can collect additional information from the layout process.
+relayoutDocument();
+
 if (!m_documentRequested)
 return;
 
@@ -387,6 +388,16 @@
 m_frontendDispatcher->documentUpdated();
 }
 
+void InspectorDOMAgent::relayoutDocument()
+{
+if (!m_document)
+return;
+
+m_flexibleBoxRendererCachedItemsAtStartOfLine.clear();
+
+m_document->updateLayout();
+}
+
 Protocol::DOM::NodeId InspectorDOMAgent::bind(Node& node)
 {
 return m_nodeToId.ensure(node, [&] {


Modified: trunk/Source/WebCore/inspector/agents/InspectorDOMAgent.h (290046 => 290047)

--- trunk/Source/WebCore/inspector/agents/InspectorDOMAgent.h	2022-02-17 20:04:07 UTC (rev 290046)
+++ trunk/Source/WebCore/inspector/agents/InspectorDOMAgent.h	2022-02-17 20:05:29 UTC (rev 290047)
@@ -254,6 +254,8 @@
 
 void destroyedNodesTimerFired();
 
+void relayoutDocument();
+
 Inspector::InjectedScriptManager& m_injectedScriptManager;
 std::unique_ptr m_frontendDispatcher;
 RefPtr 

[webkit-changes] [289875] trunk/Source/WebKit

2022-02-15 Thread pangle
Title: [289875] trunk/Source/WebKit








Revision 289875
Author pan...@apple.com
Date 2022-02-15 21:20:04 -0800 (Tue, 15 Feb 2022)


Log Message
Web Inspector: [Cocoa] Reentrancy in WebKit::WebInspectorUIProxy::open
https://bugs.webkit.org/show_bug.cgi?id=236672

Reviewed by Devin Rousso.

Speculative fix for non-reproducible reentrancy. Because `WebInspectorUIProxy::open` calls
`WebInspectorUIProxy::platformBringToFront`, which under some conditions can call `WebInspectorUIProxy::open`,
there was an opportunity for recurssion. This appears to happen when the window of the inspector view does not
match the window of the inspected web view, which in general should not be possible for a newly opened
inspector. My suspicion is that the web view is not actually attached to a window at the time the inspector is
being opened. This patch adds a fail-safe that will detach the inspector view into its own window when these
conditions are met while we are in middle of opening the inspector, and also adds logging to indicate if the
inspected web view was actually in a window. This should both prevent the crash from the re-entry as well as
provide more context when the issue does occur.

* UIProcess/Inspector/WebInspectorUIProxy.cpp:
(WebKit::WebInspectorUIProxy::open):
* UIProcess/Inspector/WebInspectorUIProxy.h:
* UIProcess/Inspector/mac/WebInspectorUIProxyMac.mm:
(WebKit::WebInspectorUIProxy::platformBringToFront):

Modified Paths

trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/UIProcess/Inspector/WebInspectorUIProxy.cpp
trunk/Source/WebKit/UIProcess/Inspector/WebInspectorUIProxy.h
trunk/Source/WebKit/UIProcess/Inspector/mac/WebInspectorUIProxyMac.mm




Diff

Modified: trunk/Source/WebKit/ChangeLog (289874 => 289875)

--- trunk/Source/WebKit/ChangeLog	2022-02-16 04:11:45 UTC (rev 289874)
+++ trunk/Source/WebKit/ChangeLog	2022-02-16 05:20:04 UTC (rev 289875)
@@ -1,3 +1,26 @@
+2022-02-15  Patrick Angle  
+
+Web Inspector: [Cocoa] Reentrancy in WebKit::WebInspectorUIProxy::open
+https://bugs.webkit.org/show_bug.cgi?id=236672
+
+Reviewed by Devin Rousso.
+
+Speculative fix for non-reproducible reentrancy. Because `WebInspectorUIProxy::open` calls
+`WebInspectorUIProxy::platformBringToFront`, which under some conditions can call `WebInspectorUIProxy::open`,
+there was an opportunity for recurssion. This appears to happen when the window of the inspector view does not
+match the window of the inspected web view, which in general should not be possible for a newly opened
+inspector. My suspicion is that the web view is not actually attached to a window at the time the inspector is
+being opened. This patch adds a fail-safe that will detach the inspector view into its own window when these
+conditions are met while we are in middle of opening the inspector, and also adds logging to indicate if the
+inspected web view was actually in a window. This should both prevent the crash from the re-entry as well as
+provide more context when the issue does occur.
+
+* UIProcess/Inspector/WebInspectorUIProxy.cpp:
+(WebKit::WebInspectorUIProxy::open):
+* UIProcess/Inspector/WebInspectorUIProxy.h:
+* UIProcess/Inspector/mac/WebInspectorUIProxyMac.mm:
+(WebKit::WebInspectorUIProxy::platformBringToFront):
+
 2022-02-15  Chris Dumez  
 
 Do preliminary work to pass domain names to CoreLocation


Modified: trunk/Source/WebKit/UIProcess/Inspector/WebInspectorUIProxy.cpp (289874 => 289875)

--- trunk/Source/WebKit/UIProcess/Inspector/WebInspectorUIProxy.cpp	2022-02-16 04:11:45 UTC (rev 289874)
+++ trunk/Source/WebKit/UIProcess/Inspector/WebInspectorUIProxy.cpp	2022-02-16 05:20:04 UTC (rev 289875)
@@ -500,9 +500,7 @@
 if (!m_inspectorPage)
 return;
 
-#if PLATFORM(GTK)
 SetForScope isOpening(m_isOpening, true);
-#endif
 
 m_isVisible = true;
 m_inspectorPage->send(Messages::WebInspectorUI::SetIsVisible(m_isVisible));


Modified: trunk/Source/WebKit/UIProcess/Inspector/WebInspectorUIProxy.h (289874 => 289875)

--- trunk/Source/WebKit/UIProcess/Inspector/WebInspectorUIProxy.h	2022-02-16 04:11:45 UTC (rev 289874)
+++ trunk/Source/WebKit/UIProcess/Inspector/WebInspectorUIProxy.h	2022-02-16 05:20:04 UTC (rev 289875)
@@ -305,6 +305,7 @@
 bool m_elementSelectionActive { false };
 bool m_ignoreElementSelectionChange { false };
 bool m_isActiveFrontend { false };
+bool m_isOpening { false };
 bool m_closing { false };
 
 AttachmentSide m_attachmentSide {AttachmentSide::Bottom};
@@ -325,7 +326,6 @@
 GtkWidget* m_inspectorWindow { nullptr };
 GtkWidget* m_headerBar { nullptr };
 String m_inspectedURLString;
-bool m_isOpening { false };
 #elif PLATFORM(WIN)
 HWND m_inspectedViewWindow { nullptr };
 HWND m_inspectedViewParentWindow { nullptr };


Modified: trunk/Source/WebKit/UIProcess/Inspector/mac/WebInspectorUIProxyMac.mm (289874 => 

[webkit-changes] [289769] trunk/Source/WebCore

2022-02-14 Thread pangle
Title: [289769] trunk/Source/WebCore








Revision 289769
Author pan...@apple.com
Date 2022-02-14 14:59:12 -0800 (Mon, 14 Feb 2022)


Log Message
Web Inspector: Element tooltips in overlays should use same encodable/decodable Label type as grid overlays
https://bugs.webkit.org/show_bug.cgi?id=235422

Reviewed by Devin Rousso.

The tooltip for elements previously used its own slightly different labels from those used for grid overlays,
which are implemented in such a way to support being sent to the UI process for iOS overlay support. This patch
adds support for the setting different colors for different runs of text along with multi-line labels to allow
the same label to be used for both Grid overlays as well as element tooltips.

The existing `WebCore::InspectorOverlay::Highlight::GridHighlightOverlay::Label` was moved to
`WebCore::InspectorOverlayLabel` as it is no longer exclusively used for grids.

With that support, we can now use InspectorOverlayLabel for element tooltips without needing duplicated layout
and drawing code. Additionally, the font used in the tooltip is now consistent with grid labels, where as
previously we used different font families for the grid and element labels.

* Headers.cmake:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:

* inspector/InspectorOverlay.cpp:
(WebCore::InspectorOverlay::drawElementTitle):
(WebCore::InspectorOverlay::drawGridOverlay):
(WebCore::InspectorOverlay::buildGridOverlay):
(WebCore::fontForLayoutLabel): Moved to InspectorOverlayLabel.cpp as `systemFont`.
(WebCore::backgroundPathForLayoutLabel): Moved to InspectorOverlayLabel.cpp as `backgroundPath`.
(WebCore::expectedSizeForLayoutLabel): Moved to InspectorOverlayLabel.cpp as `expectedSize`.
(WebCore::drawLayoutLabel): Moved to InspectorOverlayLabel.cpp as `draw`.
(WebCore::buildLabel): Deleted.

* inspector/InspectorOverlay.h:
(WebCore::InspectorOverlay::Highlight::GridHighlightOverlay::Label::encode const): Deleted.
(WebCore::InspectorOverlay::Highlight::GridHighlightOverlay::Label::decode): Deleted.

* inspector/InspectorOverlayLabel.cpp: Added.
(WebCore::InspectorOverlayLabel::InspectorOverlayLabel):
(WebCore::systemFont):
(WebCore::backgroundPath):
(WebCore::InspectorOverlayLabel::draw):
- Updated logic to handle multiple strings, including strings containing newlines. Strings are now each
converted to a TextRun, or multiple text runs for multi-line text, each of which is measured to determine the
overall height and width of the label, as well as to later in the drawing code give us the information necessary
to actually draw these strings in the proper locations.
- Use the width of the longest line for drawing the background of the label.
- Iterate through the computed TextRuns and draw the,, moving to the next line for each index that we had
previously computed to be the start of a new line.
(WebCore::InspectorOverlayLabel::expectedSize):
- Similar to `InspectorOverlayLabel::draw` we need to take in to account multi-line strings, but do not need to
keep the computed TextRuns or their widths, only the width of the longest line and the total number of lines, to
compute the expected size of the contents in a label.

* inspector/InspectorOverlayLabel.h: Added.
(WebCore::InspectorOverlayLabel::Arrow::Arrow):
(WebCore::InspectorOverlayLabel::encode const):
(WebCore::InspectorOverlayLabel::decode):
(WebCore::InspectorOverlayLabel::Arrow::encode const):
(WebCore::InspectorOverlayLabel::Arrow::decode):
(WebCore::InspectorOverlayLabel::Content::encode const):
(WebCore::InspectorOverlayLabel::Content::decode):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/Headers.cmake
trunk/Source/WebCore/Sources.txt
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
trunk/Source/WebCore/inspector/InspectorOverlay.cpp
trunk/Source/WebCore/inspector/InspectorOverlay.h


Added Paths

trunk/Source/WebCore/inspector/InspectorOverlayLabel.cpp
trunk/Source/WebCore/inspector/InspectorOverlayLabel.h




Diff

Modified: trunk/Source/WebCore/ChangeLog (289768 => 289769)

--- trunk/Source/WebCore/ChangeLog	2022-02-14 22:56:41 UTC (rev 289768)
+++ trunk/Source/WebCore/ChangeLog	2022-02-14 22:59:12 UTC (rev 289769)
@@ -1,3 +1,66 @@
+2022-02-14  Patrick Angle  
+
+Web Inspector: Element tooltips in overlays should use same encodable/decodable Label type as grid overlays
+https://bugs.webkit.org/show_bug.cgi?id=235422
+
+Reviewed by Devin Rousso.
+
+The tooltip for elements previously used its own slightly different labels from those used for grid overlays,
+which are implemented in such a way to support being sent to the UI process for iOS overlay support. This patch
+adds support for the setting different colors for different runs of text along with multi-line labels to allow
+the same label to be used for both Grid overlays as well as element tooltips.
+
+The existing `WebCore::InspectorOverlay::Highlight::GridHighlightOverlay::Label` was 

[webkit-changes] [289698] trunk/Source/WebCore

2022-02-12 Thread pangle
Title: [289698] trunk/Source/WebCore








Revision 289698
Author pan...@apple.com
Date 2022-02-12 11:25:51 -0800 (Sat, 12 Feb 2022)


Log Message
Web Inspector: [Flexbox] Show item bounds, gaps, and free space in flex overlays
https://bugs.webkit.org/show_bug.cgi?id=236410

Reviewed by Devin Rousso.

* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::flexibleBoxRendererBeganLayoutImpl):
(WebCore::InspectorInstrumentation::flexibleBoxRendererWrappedToNextLineImpl):
(WebCore::InspectorInstrumentation::instrumentingAgents):
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::flexibleBoxRendererBeganLayout):
(WebCore::InspectorInstrumentation::flexibleBoxRendererWrappedToNextLine):
* inspector/agents/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::willDestroyFrontendAndBackend):
(WebCore::InspectorDOMAgent::reset):
(WebCore::InspectorDOMAgent::flexibleBoxRendererBeganLayout):
(WebCore::InspectorDOMAgent::flexibleBoxRendererWrappedToNextLine):
(WebCore::InspectorDOMAgent::flexibleBoxRendererCachedItemsAtStartOfLine):
* inspector/agents/InspectorDOMAgent.h:
- Add instrumentation points specifically for flexbox renderers to keep track of which items start a new line
inside flex containers. The start of the first line is not recorded because it will always be zero.

(WebCore::InspectorDOMAgent::didCreateFrontendAndBackend):
- Force a layout of the document to ensure that our collection of flexbox line starts is correctly populated
when attaching an inspector, since without an inspector this information is not kept beyond layout.

* inspector/InspectorOverlay.cpp:
(WebCore::drawLayoutPattern):
- Generalize `drawLayoutHatching` to support different line styles in order to support the new stippling fill.
- In order to support "flipping" the pattern we now use a rectangle encompassing the provided quad as the edges
we follow for filling the pattern (the existing clipping ensures that the final product is still within the
quad). This also resolves an issue that could occur in transformed containers (non-rectangular) where the
spacing was inconsistent at different rotations/perspectives.

(WebCore::drawLayoutStippling):
- A new dot-pattern effect similar to hatching, but using small dots to fill the space instead.

(WebCore::drawLayoutHatching):
- Updated to use the new generic `drawLayoutPattern` helper.

(WebCore::InspectorOverlay::drawFlexOverlay):
(WebCore::InspectorOverlay::buildFlexOverlay):
- Handle iterating through the flex children to show their bounds as well as the spacing/gaps between them.
Almost all this work is done in relative terms, like leading/trailing/cross-axis/main-axis to make it easier to
reason about what should happen for different writing modes, text direction, flex direction, and flex wrapping.
To accomplish this coordinates of children are read through special `corrected*` helper functions that take in
to account the determined direction, main-axis reversal, and cross axis-reversal from all of the relevant
properties. This means there are only 8 (2^3) actual permutations of flex layout (since the layout inside each
individual child is irrelevant here). Throughout we are working with flex children frames that are relative to
their parent, which saves us from having to deal with transforms until after we have constructed most of our
overlay representation, only needing to be passed through `childQuadToRootQuad` before being added to the
appropriate part of the highlight object.

* inspector/InspectorOverlay.h:
(WebCore::InspectorOverlay::Highlight::FlexHighlightOverlay::encode const):
(WebCore::InspectorOverlay::Highlight::FlexHighlightOverlay::decode):

* rendering/RenderBox.h:
(WebCore::RenderBox::marginBox const):
- Add a way to get the entire margin box instead of its individual components.

* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::layoutFlexItems):
* rendering/RenderFlexibleBox.h:
- Make getting the computed inter-item and inter-line gap public so we can use them in the overlay.
- Add instrumentation calls to keep track of the indexes of items that start a new line during layout when an
Inspector is attached.

* platform/LayoutUnit.h:
(WebCore::operator!=):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp
trunk/Source/WebCore/inspector/InspectorInstrumentation.h
trunk/Source/WebCore/inspector/InspectorOverlay.cpp
trunk/Source/WebCore/inspector/InspectorOverlay.h
trunk/Source/WebCore/inspector/agents/InspectorDOMAgent.cpp
trunk/Source/WebCore/inspector/agents/InspectorDOMAgent.h
trunk/Source/WebCore/platform/LayoutUnit.h
trunk/Source/WebCore/rendering/RenderBox.h
trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp
trunk/Source/WebCore/rendering/RenderFlexibleBox.h




Diff

Modified: trunk/Source/WebCore/ChangeLog (289697 => 289698)

--- trunk/Source/WebCore/ChangeLog	2022-02-12 18:16:51 UTC (rev 289697)
+++ trunk/Source/WebCore/ChangeLog	2022-02-12 

[webkit-changes] [288996] trunk

2022-02-02 Thread pangle
Title: [288996] trunk








Revision 288996
Author pan...@apple.com
Date 2022-02-02 14:13:03 -0800 (Wed, 02 Feb 2022)


Log Message
No breakpoints hit on github.com, and some are invalid
https://bugs.webkit.org/show_bug.cgi?id=235607

Reviewed by Yusuke Suzuki.

Source/_javascript_Core:

Added test case in: inspector/debugger/breakpoints/resolved-dump-all-pause-locations.html

Previously not all line terminations resulted in setting the `m_lineStart` to the current m_code, which meant
that the location for pause-able locations and stack traces were inaccurate when they were on a line that
terminated multi-line comments, strings, or template strings. We now always update m_lineStart when shifting for
a line terminator, instead of only when the terminator appears outside a string or comment.

* debugger/Breakpoint.cpp:
(JSC::Breakpoint::resolve):
- The existing assertions were somewhat in conflict with each other. If we permit the line number to increase,
there is no guarantee that the column number will remain the same or increase, which can now more easily occur
with multi-line strings. Instead, we should make sure that the overall offset has increase.

* parser/Lexer.cpp:
(JSC::Lexer::shiftLineTerminator):
(JSC::Lexer::lexWithoutClearingLineTerminator):
(JSC::Lexer::scanTemplateString):
- Make sure the token start offset and start line offset are correctly set for strings.

LayoutTests:

Add test cases for resolving breakpoints on lines that begin with the end of multi-line strings, comments, and
template strings.

* inspector/debugger/breakpoints/resolved-dump-all-pause-locations-expected.txt:
* inspector/debugger/breakpoints/resolved-dump-all-pause-locations.html:
* inspector/debugger/breakpoints/resources/dump-multiline.js: Added.

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/inspector/debugger/breakpoints/resolved-dump-all-pause-locations-expected.txt
trunk/LayoutTests/inspector/debugger/breakpoints/resolved-dump-all-pause-locations.html
trunk/Source/_javascript_Core/ChangeLog
trunk/Source/_javascript_Core/debugger/Breakpoint.cpp
trunk/Source/_javascript_Core/parser/Lexer.cpp


Added Paths

trunk/LayoutTests/inspector/debugger/breakpoints/resources/dump-multiline.js




Diff

Modified: trunk/LayoutTests/ChangeLog (288995 => 288996)

--- trunk/LayoutTests/ChangeLog	2022-02-02 21:53:20 UTC (rev 288995)
+++ trunk/LayoutTests/ChangeLog	2022-02-02 22:13:03 UTC (rev 288996)
@@ -1,3 +1,17 @@
+2022-02-02  Patrick Angle  
+
+No breakpoints hit on github.com, and some are invalid
+https://bugs.webkit.org/show_bug.cgi?id=235607
+
+Reviewed by Yusuke Suzuki.
+
+Add test cases for resolving breakpoints on lines that begin with the end of multi-line strings, comments, and
+template strings.
+
+* inspector/debugger/breakpoints/resolved-dump-all-pause-locations-expected.txt:
+* inspector/debugger/breakpoints/resolved-dump-all-pause-locations.html:
+* inspector/debugger/breakpoints/resources/dump-multiline.js: Added.
+
 2022-02-02  Patrick Griffis  
 
 CSP: Fix returned WebAssembly error type when blocked


Modified: trunk/LayoutTests/inspector/debugger/breakpoints/resolved-dump-all-pause-locations-expected.txt (288995 => 288996)

--- trunk/LayoutTests/inspector/debugger/breakpoints/resolved-dump-all-pause-locations-expected.txt	2022-02-02 21:53:20 UTC (rev 288995)
+++ trunk/LayoutTests/inspector/debugger/breakpoints/resolved-dump-all-pause-locations-expected.txt	2022-02-02 22:13:03 UTC (rev 288996)
@@ -2814,3 +2814,82 @@
   4
 
 
+-- Running test case: Debugger.resolvedBreakpoint.dumpAllLocations.Multiline
+
+INSERTING AT: 0:0
+PAUSES AT: 1:4
+ ->   0#function test() {
+ =>   1|var x;
+  2}
+  3
+  4// Strings
+
+INSERTING AT: 1:5
+PAUSES AT: 2:0
+  0function test() {
+ ->   1v#ar x;
+ =>   2|}
+  3
+  4// Strings
+  5let multiline1 = "test\
+
+INSERTING AT: 2:1
+PAUSES AT: 5:0
+  0function test() {
+  1var x;
+ ->   2}#
+  3
+  4// Strings
+ =>   5|let multiline1 = "test\
+  6string", multiline2 = test();
+  7
+  8// Template Strings
+
+INSERTING AT: 5:1
+PAUSES AT: 6:9
+  2}
+  3
+  4// Strings
+ ->   5l#et multiline1 = "test\
+ =>   6string", |multiline2 = test();
+  7
+  8// Template Strings
+  9let multiline3 = `test
+
+INSERTING AT: 6:10
+PAUSES AT: 9:0
+  3
+  4// Strings
+  5let multiline1 = "test\
+ ->   6string", m#ultiline2 = test();
+  7
+  8// Template Strings
+ =>   9|let multiline3 = `test
+ 10string`, multiline4 = test();
+ 11
+ 12// Comments
+
+INSERTING AT: 9:1
+PAUSES AT: 10:9
+  6string", multiline2 = test();
+  7
+  8// Template Strings
+ ->   9l#et multiline3 = `test
+ =>  10string`, |multiline4 = test();
+ 11
+ 12// Comments

[webkit-changes] [288848] trunk/Source/WebKit

2022-01-31 Thread pangle
Title: [288848] trunk/Source/WebKit








Revision 288848
Author pan...@apple.com
Date 2022-01-31 15:04:08 -0800 (Mon, 31 Jan 2022)


Log Message
Web Inspector: [Cocoa] Crash in WebKit::WebInspectorUIProxy::attachmentViewDidChange
https://bugs.webkit.org/show_bug.cgi?id=235842

Reviewed by Timothy Hatcher.

Speculatively fix an occasional crash in WebKit::WebInspectorUIProxy::attachmentViewDidChange by ensuring that
the WebInspectorUIProxy still exists before calling `attachmentViewDidChange`.

Currently we are sometimes crashing while attempting to `m_objCAdapter.get()`, which is the first use of a
member variable in `WebInspectorUIProxy::attachmentViewDidChange`. This retain pointer should never be able to
not exists, since it storing `nil` is a valid state. This points to the WebInspectorUIProxy itself no longer
existing. The fix is to check that we actually have a `WebInspectorUIProxy` before calling
`attachmentViewDidChange`. This is also just good practice since `WebPageProxy::inspector()` is also able to
return `nullptr` under certain circumstances, and all other calls to it are guarded to check if the
WebInspectorUIProxy is still around first.

* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::setInspectorAttachmentView):

Modified Paths

trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm




Diff

Modified: trunk/Source/WebKit/ChangeLog (288847 => 288848)

--- trunk/Source/WebKit/ChangeLog	2022-01-31 22:52:12 UTC (rev 288847)
+++ trunk/Source/WebKit/ChangeLog	2022-01-31 23:04:08 UTC (rev 288848)
@@ -1,3 +1,24 @@
+2022-01-31  Patrick Angle  
+
+Web Inspector: [Cocoa] Crash in WebKit::WebInspectorUIProxy::attachmentViewDidChange
+https://bugs.webkit.org/show_bug.cgi?id=235842
+
+Reviewed by Timothy Hatcher.
+
+Speculatively fix an occasional crash in WebKit::WebInspectorUIProxy::attachmentViewDidChange by ensuring that
+the WebInspectorUIProxy still exists before calling `attachmentViewDidChange`.
+
+Currently we are sometimes crashing while attempting to `m_objCAdapter.get()`, which is the first use of a
+member variable in `WebInspectorUIProxy::attachmentViewDidChange`. This retain pointer should never be able to
+not exists, since it storing `nil` is a valid state. This points to the WebInspectorUIProxy itself no longer
+existing. The fix is to check that we actually have a `WebInspectorUIProxy` before calling
+`attachmentViewDidChange`. This is also just good practice since `WebPageProxy::inspector()` is also able to
+return `nullptr` under certain circumstances, and all other calls to it are guarded to check if the
+WebInspectorUIProxy is still around first.
+
+* UIProcess/Cocoa/WebViewImpl.mm:
+(WebKit::WebViewImpl::setInspectorAttachmentView):
+
 2022-01-31  Said Abou-Hallawa  
 
 [GPU Process] Remove the resource use counters from the remote resource cache


Modified: trunk/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm (288847 => 288848)

--- trunk/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm	2022-01-31 22:52:12 UTC (rev 288847)
+++ trunk/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm	2022-01-31 23:04:08 UTC (rev 288848)
@@ -4029,7 +4029,9 @@
 return;
 
 m_inspectorAttachmentView = newView;
-m_page->inspector()->attachmentViewDidChange(oldView ? oldView : m_view.getAutoreleased(), newView ? newView : m_view.getAutoreleased());
+
+if (auto* inspector = m_page->inspector())
+inspector->attachmentViewDidChange(oldView ? oldView : m_view.getAutoreleased(), newView ? newView : m_view.getAutoreleased());
 }
 
 NSView *WebViewImpl::inspectorAttachmentView()






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [288492] trunk

2022-01-24 Thread pangle
Title: [288492] trunk








Revision 288492
Author pan...@apple.com
Date 2022-01-24 17:11:15 -0800 (Mon, 24 Jan 2022)


Log Message
Web Inspector: [Flexbox] Add instrumentation/protocol bits for flex layout containers
https://bugs.webkit.org/show_bug.cgi?id=235454

Reviewed by Devin Rousso.

Source/_javascript_Core:

* inspector/protocol/CSS.json:

Source/WebCore:

Added tests in inspector/css/nodeLayoutContextTypeChanged.html.

Add instrumentation to RenderFlexibleBox to observe elements becoming/ceasing to be flex containers. We only
instrument RenderFlexibleBox created with an Element, not a Document, since all anonymous nodes will have their
document passed, which means we would attempt to track multiple different nodes against the same document,
resulting in unexpected results. Conversely, we only instrument in the destructor for non-anonymous nodes.

* inspector/agents/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::layoutContextTypeForRenderer):
* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::RenderFlexibleBox):
(WebCore::RenderFlexibleBox::~RenderFlexibleBox):

Source/WebInspectorUI:

* UserInterface/Models/DOMNode.js:

LayoutTests:

* inspector/css/nodeLayoutContextTypeChanged-expected.txt:
* inspector/css/nodeLayoutContextTypeChanged.html:

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/inspector/css/nodeLayoutContextTypeChanged-expected.txt
trunk/LayoutTests/inspector/css/nodeLayoutContextTypeChanged.html
trunk/Source/_javascript_Core/ChangeLog
trunk/Source/_javascript_Core/inspector/protocol/CSS.json
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/inspector/agents/InspectorCSSAgent.cpp
trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp
trunk/Source/WebInspectorUI/ChangeLog
trunk/Source/WebInspectorUI/UserInterface/Models/DOMNode.js




Diff

Modified: trunk/LayoutTests/ChangeLog (288491 => 288492)

--- trunk/LayoutTests/ChangeLog	2022-01-25 01:07:53 UTC (rev 288491)
+++ trunk/LayoutTests/ChangeLog	2022-01-25 01:11:15 UTC (rev 288492)
@@ -1,3 +1,13 @@
+2022-01-24  Patrick Angle  
+
+Web Inspector: [Flexbox] Add instrumentation/protocol bits for flex layout containers
+https://bugs.webkit.org/show_bug.cgi?id=235454
+
+Reviewed by Devin Rousso.
+
+* inspector/css/nodeLayoutContextTypeChanged-expected.txt:
+* inspector/css/nodeLayoutContextTypeChanged.html:
+
 2022-01-24  Eric Carlson  
 
 REGRESSION (iOS 15): HTMLAudioElement fails to load new audio when device is locked or safari is in background


Modified: trunk/LayoutTests/inspector/css/nodeLayoutContextTypeChanged-expected.txt (288491 => 288492)

--- trunk/LayoutTests/inspector/css/nodeLayoutContextTypeChanged-expected.txt	2022-01-25 01:07:53 UTC (rev 288491)
+++ trunk/LayoutTests/inspector/css/nodeLayoutContextTypeChanged-expected.txt	2022-01-25 01:11:15 UTC (rev 288492)
@@ -10,3 +10,15 @@
 PASS: Layout context should be `null`.
 PASS: Layout context should now be `grid`.
 
+-- Running test case: CSS.nodeLayoutContextTypeChanged.FlexToNonFlex
+PASS: Layout context should be `flex`.
+PASS: Layout context should now be `null`.
+
+-- Running test case: CSS.nodeLayoutContextTypeChanged.NonFlexToFlex
+PASS: Layout context should be `null`.
+PASS: Layout context should now be `flex`.
+
+-- Running test case: CSS.nodeLayoutContextTypeChanged.GridToFlex
+PASS: Layout context should now be `grid`.
+PASS: Layout context should now be `flex`.
+


Modified: trunk/LayoutTests/inspector/css/nodeLayoutContextTypeChanged.html (288491 => 288492)

--- trunk/LayoutTests/inspector/css/nodeLayoutContextTypeChanged.html	2022-01-25 01:07:53 UTC (rev 288491)
+++ trunk/LayoutTests/inspector/css/nodeLayoutContextTypeChanged.html	2022-01-25 01:11:15 UTC (rev 288492)
@@ -65,6 +65,54 @@
 }
 });
 
+addTestCase({
+name: "CSS.nodeLayoutContextTypeChanged.FlexToNonFlex",
+description: "Change a flex container to a non-flex container.",
+selector: "#flexToNonFlex",
+async domNodeHandler(domNode) {
+InspectorTest.expectEqual(domNode.layoutContextType, WI.DOMNode.LayoutContextType.Flex, "Layout context should be `flex`.");
+
+await Promise.all([
+domNode.awaitEvent(WI.DOMNode.Event.LayoutContextTypeChanged),
+changeElementDisplayValue("flexToNonFlex", "block"),
+]);
+
+InspectorTest.expectEqual(domNode.layoutContextType, null, "Layout context should now be `null`.");
+}
+});
+
+addTestCase({
+name: "CSS.nodeLayoutContextTypeChanged.NonFlexToFlex",
+description: "Change a non-flex container to a flex container.",
+selector: "#nonFlexToFlex",
+async domNodeHandler(domNode) {
+InspectorTest.expectEqual(domNode.layoutContextType, null, "Layout context should be `null`.");
+
+await Promise.all([
+domNode.awaitEvent(WI.DOMNode.Event.LayoutContextTypeChanged),
+

[webkit-changes] [287979] trunk

2022-01-13 Thread pangle
Title: [287979] trunk








Revision 287979
Author pan...@apple.com
Date 2022-01-13 08:22:10 -0800 (Thu, 13 Jan 2022)


Log Message
Web Inspector: Implement `frameURL` option for `devtools.inspectedWindow.eval` command
https://bugs.webkit.org/show_bug.cgi?id=222568

Reviewed by Devin Rousso.

Source/WebInspectorUI:

New test: Tools/TestWebKitAPI/Tests/WebKitCocoa/WKInspectorExtension.mm

Add support for evaluating script from an extension in a specific frame on the page by referring to it by the
frame's URL. Frame URLs are matched in three steps, first looking for an exact URL match, including query
parameters and fragment identifier. If no match is found and the provided `options.frameURL` does not have any
fragment identifier or query parameters, a check is then made against each known frame again, this time
excluding their fragment identifier. If that check still fails to find a frame for the URL, we perform one more
pass, this time excluding the fragment identifier and query parameters for each known frame.

* UserInterface/Controllers/WebInspectorExtensionController.js:
(WI.WebInspectorExtensionController.prototype.evaluateScriptForExtension):
(WI.WebInspectorExtensionController.prototype.reloadForExtension):
- Drive-by removal of trailing spaces.
(WI.WebInspectorExtensionController.prototype._frameForFrameURL):

Source/WebKit:

New test: Tools/TestWebKitAPI/Tests/WebKitCocoa/WKInspectorExtension.mm

Correct the API to indicate that `frameURL` and `contextSecurityOrigin` are nullable parameters.

* UIProcess/API/Cocoa/_WKInspectorExtension.h:

Tools:

Add test coverage for evaluating script on an inspected page from an extension, including evaluating on an inner
frame.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKitCocoa/WKInspectorExtension.mm:
(TEST):
* TestWebKitAPI/Tests/WebKitCocoa/WKInspectorExtensionEvaluateScriptOnPage.html: Added.
* TestWebKitAPI/Tests/WebKitCocoa/WKInspectorExtensionEvaluateScriptOnPageInnerFrame.html: Added.

Modified Paths

trunk/Source/WebInspectorUI/ChangeLog
trunk/Source/WebInspectorUI/UserInterface/Controllers/WebInspectorExtensionController.js
trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/UIProcess/API/Cocoa/_WKInspectorExtension.h
trunk/Tools/ChangeLog
trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKInspectorExtension.mm


Added Paths

trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKInspectorExtensionEvaluateScriptOnPage.html
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKInspectorExtensionEvaluateScriptOnPageInnerFrame.html




Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (287978 => 287979)

--- trunk/Source/WebInspectorUI/ChangeLog	2022-01-13 15:22:22 UTC (rev 287978)
+++ trunk/Source/WebInspectorUI/ChangeLog	2022-01-13 16:22:10 UTC (rev 287979)
@@ -1,3 +1,25 @@
+2022-01-13  Patrick Angle  
+
+Web Inspector: Implement `frameURL` option for `devtools.inspectedWindow.eval` command
+https://bugs.webkit.org/show_bug.cgi?id=222568
+
+Reviewed by Devin Rousso.
+
+New test: Tools/TestWebKitAPI/Tests/WebKitCocoa/WKInspectorExtension.mm
+
+Add support for evaluating script from an extension in a specific frame on the page by referring to it by the
+frame's URL. Frame URLs are matched in three steps, first looking for an exact URL match, including query
+parameters and fragment identifier. If no match is found and the provided `options.frameURL` does not have any
+fragment identifier or query parameters, a check is then made against each known frame again, this time
+excluding their fragment identifier. If that check still fails to find a frame for the URL, we perform one more
+pass, this time excluding the fragment identifier and query parameters for each known frame.
+
+* UserInterface/Controllers/WebInspectorExtensionController.js:
+(WI.WebInspectorExtensionController.prototype.evaluateScriptForExtension):
+(WI.WebInspectorExtensionController.prototype.reloadForExtension):
+- Drive-by removal of trailing spaces.
+(WI.WebInspectorExtensionController.prototype._frameForFrameURL):
+
 2022-01-12  Elliott Williams  
 
 [Xcode] Configure each project for the legacy build system


Modified: trunk/Source/WebInspectorUI/UserInterface/Controllers/WebInspectorExtensionController.js (287978 => 287979)

--- trunk/Source/WebInspectorUI/UserInterface/Controllers/WebInspectorExtensionController.js	2022-01-13 15:22:22 UTC (rev 287978)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/WebInspectorExtensionController.js	2022-01-13 16:22:10 UTC (rev 287979)
@@ -133,10 +133,10 @@
 return WI.WebInspectorExtension.ErrorCode.InvalidRequest;
 }
 
-// FIXME:  implement execution context selection options
-if (frameURL) {
-WI.reportInternalError("evaluateScriptForExtension: the 'frameURL' option is not 

[webkit-changes] [287786] trunk/Source/WebKit

2022-01-07 Thread pangle
Title: [287786] trunk/Source/WebKit








Revision 287786
Author pan...@apple.com
Date 2022-01-07 14:46:50 -0800 (Fri, 07 Jan 2022)


Log Message
REGRESSION(r286498): Web Inspector: Inspector^2 fails to load in release builds and crashes with an assertion in debug builds
https://bugs.webkit.org/show_bug.cgi?id=234968

Reviewed by Devin Rousso.

Inspector^2 would fail to open a local inspector frontend because m_inspectedPageIdentifier was not set before
it was used in `WebInspectorUIProxy::createFrontendPage`. To correct this, we now cache the inspected page
identifier immediately upon creating the WebInspectorUIProxy, instead of only in
`WebInspectorUIProxy::updateForNewPageProcess`. This also allows us to use the cached identifier in
`WebInspectorUIProxy::openLocalInspectorFrontend` as discussed in .

* UIProcess/Inspector/WebInspectorUIProxy.cpp:
(WebKit::WebInspectorUIProxy::WebInspectorUIProxy):
(WebKit::WebInspectorUIProxy::openLocalInspectorFrontend):

Modified Paths

trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/UIProcess/Inspector/WebInspectorUIProxy.cpp




Diff

Modified: trunk/Source/WebKit/ChangeLog (287785 => 287786)

--- trunk/Source/WebKit/ChangeLog	2022-01-07 22:46:16 UTC (rev 287785)
+++ trunk/Source/WebKit/ChangeLog	2022-01-07 22:46:50 UTC (rev 287786)
@@ -1,3 +1,20 @@
+2022-01-07  Patrick Angle  
+
+REGRESSION(r286498): Web Inspector: Inspector^2 fails to load in release builds and crashes with an assertion in debug builds
+https://bugs.webkit.org/show_bug.cgi?id=234968
+
+Reviewed by Devin Rousso.
+
+Inspector^2 would fail to open a local inspector frontend because m_inspectedPageIdentifier was not set before
+it was used in `WebInspectorUIProxy::createFrontendPage`. To correct this, we now cache the inspected page
+identifier immediately upon creating the WebInspectorUIProxy, instead of only in
+`WebInspectorUIProxy::updateForNewPageProcess`. This also allows us to use the cached identifier in
+`WebInspectorUIProxy::openLocalInspectorFrontend` as discussed in .
+
+* UIProcess/Inspector/WebInspectorUIProxy.cpp:
+(WebKit::WebInspectorUIProxy::WebInspectorUIProxy):
+(WebKit::WebInspectorUIProxy::openLocalInspectorFrontend):
+
 2022-01-07  Said Abou-Hallawa  
 
 [GPU Process] Remove the result FilterImage from FilterEffect


Modified: trunk/Source/WebKit/UIProcess/Inspector/WebInspectorUIProxy.cpp (287785 => 287786)

--- trunk/Source/WebKit/UIProcess/Inspector/WebInspectorUIProxy.cpp	2022-01-07 22:46:16 UTC (rev 287785)
+++ trunk/Source/WebKit/UIProcess/Inspector/WebInspectorUIProxy.cpp	2022-01-07 22:46:50 UTC (rev 287786)
@@ -67,6 +67,7 @@
 WebInspectorUIProxy::WebInspectorUIProxy(WebPageProxy& inspectedPage)
 : m_inspectedPage()
 , m_inspectorClient(makeUnique())
+, m_inspectedPageIdentifier(inspectedPage.identifier())
 #if PLATFORM(MAC)
 , m_closeFrontendAfterInactivityTimer(RunLoop::main(), this, ::closeFrontendAfterInactivityTimerFired)
 #endif
@@ -448,7 +449,7 @@
 if (!m_inspectorPage)
 return;
 
-m_inspectorPage->send(Messages::WebInspectorUI::EstablishConnection(m_inspectedPage->identifier(), infoForLocalDebuggable(), m_underTest, inspectionLevel()));
+m_inspectorPage->send(Messages::WebInspectorUI::EstablishConnection(m_inspectedPageIdentifier, infoForLocalDebuggable(), m_underTest, inspectionLevel()));
 
 ASSERT(!m_isActiveFrontend);
 m_isActiveFrontend = true;






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [287781] trunk/Source

2022-01-07 Thread pangle
Title: [287781] trunk/Source








Revision 287781
Author pan...@apple.com
Date 2022-01-07 13:52:15 -0800 (Fri, 07 Jan 2022)


Log Message
[Cocoa] Web Driver: WebSocket over TLS failing over WebDriver with acceptInsecureCerts on Big Sur
https://bugs.webkit.org/show_bug.cgi?id=234403

Reviewed by BJ Burg.
Source/WebCore:

* page/SocketProvider.cpp:
(WebCore::SocketProvider::createSocketStreamHandle):
* platform/network/cf/SocketStreamHandleImpl.h:
(WebCore::SocketStreamHandleImpl::create):
* platform/network/cf/SocketStreamHandleImplCFNet.cpp:
(WebCore::SocketStreamHandleImpl::SocketStreamHandleImpl):
(WebCore::SocketStreamHandleImpl::createStreams):
* platform/network/curl/SocketStreamHandleImpl.h:
(WebCore::SocketStreamHandleImpl::create):
* platform/network/soup/SocketStreamHandleImpl.h:

Source/WebKit:

macOS Big Sur and earlier do not use NSURLSession-based WebSockets, so we need a way to allow insecure
certificates under automation that does not rely on the `WKNavigationDelegate` to determine if an
authentication challenge should be accepted. In order to accomplish this we now plumb through an
`_shouldAcceptInsecureCertificatesForWebSockets` value from `_WKAutomationSessionConfiguration` to
`SocketStreamHandleImplCFNet` on platforms that do not `HAVE(NSURLSESSION_WEBSOCKET)`, which allows automation
clients to enable this behavior when the `acceptInsecureCerts` capability is set on a session.

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::createSocketStream):
* NetworkProcess/NetworkSession.cpp:
(WebKit::NetworkSession::NetworkSession):
* NetworkProcess/NetworkSession.h:
(WebKit::NetworkSession::shouldAcceptInsecureCertificatesForWebSockets const):
* NetworkProcess/NetworkSessionCreationParameters.cpp:
(WebKit::NetworkSessionCreationParameters::encode const):
(WebKit::NetworkSessionCreationParameters::decode):
* NetworkProcess/NetworkSessionCreationParameters.h:
* NetworkProcess/NetworkSocketStream.cpp:
(WebKit::NetworkSocketStream::create):
(WebKit::NetworkSocketStream::NetworkSocketStream):
* NetworkProcess/NetworkSocketStream.h:
* UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
* UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:
(-[_WKWebsiteDataStoreConfiguration _shouldAcceptInsecureCertificatesForWebSockets]):
(-[_WKWebsiteDataStoreConfiguration _setShouldAcceptInsecureCertificatesForWebSockets:]):
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::parameters):
* UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp:
(WebKit::WebsiteDataStoreConfiguration::copy const):
* UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h:
(WebKit::WebsiteDataStoreConfiguration::shouldAcceptInsecureCertificatesForWebSockets const):
(WebKit::WebsiteDataStoreConfiguration::setShouldAcceptInsecureCertificatesForWebSockets):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/page/SocketProvider.cpp
trunk/Source/WebCore/platform/network/cf/SocketStreamHandleImpl.h
trunk/Source/WebCore/platform/network/cf/SocketStreamHandleImplCFNet.cpp
trunk/Source/WebCore/platform/network/curl/SocketStreamHandleImpl.h
trunk/Source/WebCore/platform/network/soup/SocketStreamHandleImpl.h
trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp
trunk/Source/WebKit/NetworkProcess/NetworkSession.cpp
trunk/Source/WebKit/NetworkProcess/NetworkSession.h
trunk/Source/WebKit/NetworkProcess/NetworkSessionCreationParameters.cpp
trunk/Source/WebKit/NetworkProcess/NetworkSessionCreationParameters.h
trunk/Source/WebKit/NetworkProcess/NetworkSocketStream.cpp
trunk/Source/WebKit/NetworkProcess/NetworkSocketStream.h
trunk/Source/WebKit/UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h
trunk/Source/WebKit/UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm
trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp
trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp
trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h




Diff

Modified: trunk/Source/WebCore/ChangeLog (287780 => 287781)

--- trunk/Source/WebCore/ChangeLog	2022-01-07 21:25:37 UTC (rev 287780)
+++ trunk/Source/WebCore/ChangeLog	2022-01-07 21:52:15 UTC (rev 287781)
@@ -1,3 +1,21 @@
+2022-01-07  Patrick Angle  
+
+[Cocoa] Web Driver: WebSocket over TLS failing over WebDriver with acceptInsecureCerts on Big Sur
+https://bugs.webkit.org/show_bug.cgi?id=234403
+
+Reviewed by BJ Burg.
+
+* page/SocketProvider.cpp:
+(WebCore::SocketProvider::createSocketStreamHandle):
+* platform/network/cf/SocketStreamHandleImpl.h:
+(WebCore::SocketStreamHandleImpl::create):
+* platform/network/cf/SocketStreamHandleImplCFNet.cpp:
+(WebCore::SocketStreamHandleImpl::SocketStreamHandleImpl):
+(WebCore::SocketStreamHandleImpl::createStreams):
+* platform/network/curl/SocketStreamHandleImpl.h:
+

[webkit-changes] [287776] trunk/Source/WebInspectorUI

2022-01-07 Thread pangle
Title: [287776] trunk/Source/WebInspectorUI








Revision 287776
Author pan...@apple.com
Date 2022-01-07 12:20:58 -0800 (Fri, 07 Jan 2022)


Log Message
Uncaught Exception: Cannot step over because debugger is not paused
https://bugs.webkit.org/show_bug.cgi?id=234575

Reviewed by Devin Rousso.

Previously keyboard shortcuts for advancing the debugger did not check to make sure that the debugger was
actually paused before attempting to step. This led to an uncaught exception in engineering builds. We now
enable and disable these keyboard shortcuts based on the whether or not the debugger is currently paused.

* UserInterface/Base/Main.js:

Modified Paths

trunk/Source/WebInspectorUI/ChangeLog
trunk/Source/WebInspectorUI/UserInterface/Base/Main.js




Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (287775 => 287776)

--- trunk/Source/WebInspectorUI/ChangeLog	2022-01-07 19:57:05 UTC (rev 287775)
+++ trunk/Source/WebInspectorUI/ChangeLog	2022-01-07 20:20:58 UTC (rev 287776)
@@ -1,3 +1,16 @@
+2022-01-07  Patrick Angle  
+
+Uncaught Exception: Cannot step over because debugger is not paused
+https://bugs.webkit.org/show_bug.cgi?id=234575
+
+Reviewed by Devin Rousso.
+
+Previously keyboard shortcuts for advancing the debugger did not check to make sure that the debugger was
+actually paused before attempting to step. This led to an uncaught exception in engineering builds. We now
+enable and disable these keyboard shortcuts based on the whether or not the debugger is currently paused.
+
+* UserInterface/Base/Main.js:
+
 2022-01-07  Alex Christensen  
 
 Unreviewed, reverting r287698.


Modified: trunk/Source/WebInspectorUI/UserInterface/Base/Main.js (287775 => 287776)

--- trunk/Source/WebInspectorUI/UserInterface/Base/Main.js	2022-01-07 19:57:05 UTC (rev 287775)
+++ trunk/Source/WebInspectorUI/UserInterface/Base/Main.js	2022-01-07 20:20:58 UTC (rev 287776)
@@ -132,6 +132,7 @@
 
 // Register for events.
 WI.debuggerManager.addEventListener(WI.DebuggerManager.Event.Paused, WI._debuggerDidPause, WI);
+WI.debuggerManager.addEventListener(WI.DebuggerManager.Event.Resumed, WI._debuggerDidResume, WI);
 WI.domManager.addEventListener(WI.DOMManager.Event.InspectModeStateChanged, WI._inspectModeStateChanged, WI);
 WI.domManager.addEventListener(WI.DOMManager.Event.DOMNodeWasInspected, WI._domNodeWasInspected, WI);
 WI.domStorageManager.addEventListener(WI.DOMStorageManager.Event.DOMStorageObjectWasInspected, WI._domStorageWasInspected, WI);
@@ -342,6 +343,8 @@
 WI.stepNextAlternateKeyboardShortcut = new WI.KeyboardShortcut(WI.KeyboardShortcut.Modifier.Shift | WI.KeyboardShortcut.Modifier.CommandOrControl, WI.KeyboardShortcut.Key.SingleQuote, WI.debuggerStepNext);
 }
 
+WI._updateDebuggerKeyboardShortcuts();
+
 WI.settingsKeyboardShortcut = new WI.KeyboardShortcut(WI.KeyboardShortcut.Modifier.CommandOrControl, WI.KeyboardShortcut.Key.Comma, WI._handleSettingsKeyboardShortcut);
 
 WI._togglePreviousDockConfigurationKeyboardShortcut = new WI.KeyboardShortcut(WI.KeyboardShortcut.Modifier.CommandOrControl | WI.KeyboardShortcut.Modifier.Shift, "D", WI._togglePreviousDockConfiguration);
@@ -1669,10 +1672,34 @@
 WI._debuggerDidPause = function(event)
 {
 WI.showSourcesTab({showScopeChainSidebar: WI.settings.showScopeChainOnPause.value});
+WI._updateDebuggerKeyboardShortcuts();
 
 InspectorFrontendHost.bringToFront();
 };
 
+WI._debuggerDidResume = function(event)
+{
+WI._updateDebuggerKeyboardShortcuts();
+};
+
+WI._updateDebuggerKeyboardShortcuts = function()
+{
+let paused = WI.debuggerManager.paused;
+
+WI.stepOverKeyboardShortcut.disabled = !paused;
+WI.stepIntoKeyboardShortcut.disabled = !paused;
+WI.stepOutKeyboardShortcut.disabled = !paused;
+WI.stepOverAlternateKeyboardShortcut.disabled = !paused;
+WI.stepIntoAlternateKeyboardShortcut.disabled = !paused;
+WI.stepOutAlternateKeyboardShortcut.disabled = !paused;
+
+// COMPATIBILITY (iOS 13.4): Debugger.stepNext did not exist.
+if (InspectorBackend.hasCommand("Debugger.stepNext")) {
+WI.stepNextKeyboardShortcut.disabled = !paused;
+WI.stepNextAlternateKeyboardShortcut.disabled = !paused;
+}
+};
+
 WI._frameWasAdded = function(event)
 {
 if (!WI._frameIdentifierToShowSourceCodeWhenAvailable)






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [287636] trunk/Source/WebInspectorUI

2022-01-05 Thread pangle
Title: [287636] trunk/Source/WebInspectorUI








Revision 287636
Author pan...@apple.com
Date 2022-01-05 10:27:46 -0800 (Wed, 05 Jan 2022)


Log Message
Web Inspector: revert-layer should be autocompleted
https://bugs.webkit.org/show_bug.cgi?id=234646

Reviewed by Devin Rousso.

* UserInterface/Controllers/CSSManager.js:
* UserInterface/Models/CSSKeywordCompletions.js:

Modified Paths

trunk/Source/WebInspectorUI/ChangeLog
trunk/Source/WebInspectorUI/UserInterface/Controllers/CSSManager.js
trunk/Source/WebInspectorUI/UserInterface/Models/CSSKeywordCompletions.js




Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (287635 => 287636)

--- trunk/Source/WebInspectorUI/ChangeLog	2022-01-05 18:21:31 UTC (rev 287635)
+++ trunk/Source/WebInspectorUI/ChangeLog	2022-01-05 18:27:46 UTC (rev 287636)
@@ -1,3 +1,13 @@
+2022-01-05  Patrick Angle  
+
+Web Inspector: revert-layer should be autocompleted
+https://bugs.webkit.org/show_bug.cgi?id=234646
+
+Reviewed by Devin Rousso.
+
+* UserInterface/Controllers/CSSManager.js:
+* UserInterface/Models/CSSKeywordCompletions.js:
+
 2022-01-04  Devin Rousso  
 
 Web Inspector: Sources: expanding a grouping of blackboxed call frames should be persistent


Modified: trunk/Source/WebInspectorUI/UserInterface/Controllers/CSSManager.js (287635 => 287636)

--- trunk/Source/WebInspectorUI/UserInterface/Controllers/CSSManager.js	2022-01-05 18:21:31 UTC (rev 287635)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/CSSManager.js	2022-01-05 18:27:46 UTC (rev 287636)
@@ -81,7 +81,7 @@
 return;
 
 let propertyNamesForCodeMirror = {};
-let valueKeywordsForCodeMirror = {"inherit": true, "initial": true, "unset": true, "revert": true, "var": true, "env": true};
+let valueKeywordsForCodeMirror = {"inherit": true, "initial": true, "unset": true, "revert": true, "revert-layer": true, "var": true, "env": true};
 let colorKeywordsForCodeMirror = {};
 
 function nameForCodeMirror(name) {


Modified: trunk/Source/WebInspectorUI/UserInterface/Models/CSSKeywordCompletions.js (287635 => 287636)

--- trunk/Source/WebInspectorUI/UserInterface/Models/CSSKeywordCompletions.js	2022-01-05 18:21:31 UTC (rev 287635)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/CSSKeywordCompletions.js	2022-01-05 18:27:46 UTC (rev 287636)
@@ -138,7 +138,7 @@
 
 WI.CSSKeywordCompletions.forProperty = function(propertyName)
 {
-let acceptedKeywords = ["initial", "unset", "revert", "var()", "env()"];
+let acceptedKeywords = ["initial", "unset", "revert", "revert-layer", "var()", "env()"];
 
 function addKeywordsForName(name) {
 let isNotPrefixed = name.charAt(0) !== "-";






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [287346] trunk/Source/WebInspectorUI

2021-12-21 Thread pangle
Title: [287346] trunk/Source/WebInspectorUI








Revision 287346
Author pan...@apple.com
Date 2021-12-21 21:17:13 -0800 (Tue, 21 Dec 2021)


Log Message
Web Inspector: Assertion Failed removing subview in ContentViewContainer.prototype._disassociateFromContentView
https://bugs.webkit.org/show_bug.cgi?id=234572

Reviewed by Devin Rousso.

r283859 accidentally removed the checks that a content view is attached before attempting to remove it, leading
to an assertion.

* UserInterface/Views/ContentViewContainer.js:
(WI.ContentViewContainer.prototype._disassociateFromContentView):

Modified Paths

trunk/Source/WebInspectorUI/ChangeLog
trunk/Source/WebInspectorUI/UserInterface/Views/ContentViewContainer.js




Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (287345 => 287346)

--- trunk/Source/WebInspectorUI/ChangeLog	2021-12-22 05:15:33 UTC (rev 287345)
+++ trunk/Source/WebInspectorUI/ChangeLog	2021-12-22 05:17:13 UTC (rev 287346)
@@ -1,5 +1,18 @@
 2021-12-21  Patrick Angle  
 
+Web Inspector: Assertion Failed removing subview in ContentViewContainer.prototype._disassociateFromContentView
+https://bugs.webkit.org/show_bug.cgi?id=234572
+
+Reviewed by Devin Rousso.
+
+r283859 accidentally removed the checks that a content view is attached before attempting to remove it, leading
+to an assertion.
+
+* UserInterface/Views/ContentViewContainer.js:
+(WI.ContentViewContainer.prototype._disassociateFromContentView):
+
+2021-12-21  Patrick Angle  
+
 Web Inspector: Assertion Failed adding event listener in CSSPropertyNameCompletions.prototype._updateValuesWithLatestCSSVariablesIfNeeded
 https://bugs.webkit.org/show_bug.cgi?id=234570
 


Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ContentViewContainer.js (287345 => 287346)

--- trunk/Source/WebInspectorUI/UserInterface/Views/ContentViewContainer.js	2021-12-22 05:15:33 UTC (rev 287345)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ContentViewContainer.js	2021-12-22 05:17:13 UTC (rev 287346)
@@ -421,11 +421,14 @@
 return;
 }
 
-// Hidden/non-visible extension tabs must remain attached to the DOM to avoid reloading.
-if (contentView.constructor.shouldNotRemoveFromDOMWhenHidden() && !contentView.visible)
-return;
+if (contentView.constructor.shouldNotRemoveFromDOMWhenHidden()) {
+// Hidden/non-visible extension tabs must remain attached to the DOM to avoid reloading.
+if (!contentView.visible)
+return;
 
-this.removeSubview(contentView);
+if (contentView.isAttached)
+this.removeSubview(contentView);
+}
 
 console.assert(!contentView.isAttached);
 






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [287338] trunk/Source/WebInspectorUI

2021-12-21 Thread pangle
Title: [287338] trunk/Source/WebInspectorUI








Revision 287338
Author pan...@apple.com
Date 2021-12-21 17:39:27 -0800 (Tue, 21 Dec 2021)


Log Message
Web Inspector: Assertion Failed adding event listener in CSSPropertyNameCompletions.prototype._updateValuesWithLatestCSSVariablesIfNeeded
https://bugs.webkit.org/show_bug.cgi?id=234570

Reviewed by Devin Rousso.

Adding an event listener to listen for style changes every time we update the list of CSS variables isn't quite
correct because it means we may attempt to add the event listener multiple times. Instead, this should be done
in response to the InspectedNodeChanged event directly to avoid adding the event listener multiple time to the
same DOM node.

* UserInterface/Models/CSSPropertyNameCompletions.js:
(WI.CSSPropertyNameCompletions.prototype._updateValuesWithLatestCSSVariablesIfNeeded):
(WI.CSSPropertyNameCompletions.prototype._handleInspectedNodeChanged):

Modified Paths

trunk/Source/WebInspectorUI/ChangeLog
trunk/Source/WebInspectorUI/UserInterface/Models/CSSPropertyNameCompletions.js




Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (287337 => 287338)

--- trunk/Source/WebInspectorUI/ChangeLog	2021-12-22 00:14:33 UTC (rev 287337)
+++ trunk/Source/WebInspectorUI/ChangeLog	2021-12-22 01:39:27 UTC (rev 287338)
@@ -1,3 +1,19 @@
+2021-12-21  Patrick Angle  
+
+Web Inspector: Assertion Failed adding event listener in CSSPropertyNameCompletions.prototype._updateValuesWithLatestCSSVariablesIfNeeded
+https://bugs.webkit.org/show_bug.cgi?id=234570
+
+Reviewed by Devin Rousso.
+
+Adding an event listener to listen for style changes every time we update the list of CSS variables isn't quite
+correct because it means we may attempt to add the event listener multiple times. Instead, this should be done
+in response to the InspectedNodeChanged event directly to avoid adding the event listener multiple time to the
+same DOM node.
+
+* UserInterface/Models/CSSPropertyNameCompletions.js:
+(WI.CSSPropertyNameCompletions.prototype._updateValuesWithLatestCSSVariablesIfNeeded):
+(WI.CSSPropertyNameCompletions.prototype._handleInspectedNodeChanged):
+
 2021-12-21  Michael Saboff  
 
 Fix symlinks for alternate root framework locations


Modified: trunk/Source/WebInspectorUI/UserInterface/Models/CSSPropertyNameCompletions.js (287337 => 287338)

--- trunk/Source/WebInspectorUI/UserInterface/Models/CSSPropertyNameCompletions.js	2021-12-22 00:14:33 UTC (rev 287337)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/CSSPropertyNameCompletions.js	2021-12-22 01:39:27 UTC (rev 287338)
@@ -86,10 +86,7 @@
 return;
 }
 
-let nodeStyles = WI.cssManager.stylesForNode(WI.domManager.inspectedNode);
-nodeStyles.addEventListener(WI.DOMNodeStyles.Event.NeedsRefresh, this._handleNodesStylesNeedsRefresh, this);
-
-let values = Array.from(nodeStyles.allCSSVariables);
+let values = Array.from(WI.cssManager.stylesForNode(WI.domManager.inspectedNode).allCSSVariables);
 values.pushAll(this._cachedSortedPropertyNames);
 this.replaceValues(values);
 
@@ -98,13 +95,12 @@
 
 _handleInspectedNodeChanged(event)
 {
-if (this._needsVariablesFromInspectedNode || !event.data.lastInspectedNode)
-return;
-
 this._needsVariablesFromInspectedNode = true;
 
-let nodeStyles = WI.cssManager.stylesForNode(event.data.lastInspectedNode);
-nodeStyles.removeEventListener(WI.DOMNodeStyles.Event.NeedsRefresh, this._handleNodesStylesNeedsRefresh, this);
+if (event.data.lastInspectedNode)
+WI.cssManager.stylesForNode(event.data.lastInspectedNode).removeEventListener(WI.DOMNodeStyles.Event.NeedsRefresh, this._handleNodesStylesNeedsRefresh, this);
+
+WI.cssManager.stylesForNode(WI.domManager.inspectedNode).addEventListener(WI.DOMNodeStyles.Event.NeedsRefresh, this._handleNodesStylesNeedsRefresh, this);
 }
 
 _handleNodesStylesNeedsRefresh(event)






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [287046] trunk/Source/WebCore

2021-12-14 Thread pangle
Title: [287046] trunk/Source/WebCore








Revision 287046
Author pan...@apple.com
Date 2021-12-14 14:04:50 -0800 (Tue, 14 Dec 2021)


Log Message
Web Inspector: After r286657, anonymous layers are providing an empty string for their grouping text
https://bugs.webkit.org/show_bug.cgi?id=234012

Reviewed by Devin Rousso.

Covered by existing test: LayoutTests/inspector/css/getMatchedStylesForNodeLayerGrouping.html

For anonymous layers, we should not provide the `text` property to the frontend, as there is technically no
text, not an empty string, provided by the author. This is effectively a minor optimization, as the frontend
does correctly handle an empty string the same way it handles no string.

* inspector/InspectorStyleSheet.cpp:
(WebCore::buildArrayForGroupings):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/inspector/InspectorStyleSheet.cpp




Diff

Modified: trunk/Source/WebCore/ChangeLog (287045 => 287046)

--- trunk/Source/WebCore/ChangeLog	2021-12-14 21:31:59 UTC (rev 287045)
+++ trunk/Source/WebCore/ChangeLog	2021-12-14 22:04:50 UTC (rev 287046)
@@ -1,3 +1,19 @@
+2021-12-14  Patrick Angle  
+
+Web Inspector: After r286657, anonymous layers are providing an empty string for their grouping text
+https://bugs.webkit.org/show_bug.cgi?id=234012
+
+Reviewed by Devin Rousso.
+
+Covered by existing test: LayoutTests/inspector/css/getMatchedStylesForNodeLayerGrouping.html
+
+For anonymous layers, we should not provide the `text` property to the frontend, as there is technically no
+text, not an empty string, provided by the author. This is effectively a minor optimization, as the frontend
+does correctly handle an empty string the same way it handles no string.
+
+* inspector/InspectorStyleSheet.cpp:
+(WebCore::buildArrayForGroupings):
+
 2021-12-14  Alan Bujtas  
 
 [LFC][IFC] Take text-align offset into account when computing the RTL display box geometry


Modified: trunk/Source/WebCore/inspector/InspectorStyleSheet.cpp (287045 => 287046)

--- trunk/Source/WebCore/inspector/InspectorStyleSheet.cpp	2021-12-14 21:31:59 UTC (rev 287045)
+++ trunk/Source/WebCore/inspector/InspectorStyleSheet.cpp	2021-12-14 22:04:50 UTC (rev 287046)
@@ -478,7 +478,9 @@
 auto layerRulePayload = Protocol::CSS::Grouping::create()
 .setType(Protocol::CSS::Grouping::Type::LayerRule)
 .release();
-layerRulePayload->setText(downcast(parentRule)->name());
+auto layerName = downcast(parentRule)->name();
+if (!layerName.isEmpty())
+layerRulePayload->setText(layerName);
 ruleGroupingPayloads.append(WTFMove(layerRulePayload));
 }
 






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [286588] trunk/Source

2021-12-06 Thread pangle
Title: [286588] trunk/Source








Revision 286588
Author pan...@apple.com
Date 2021-12-06 22:20:45 -0800 (Mon, 06 Dec 2021)


Log Message
[Cocoa] Web Inspector: Unify Grid overlay drawing code
https://bugs.webkit.org/show_bug.cgi?id=233773

Reviewed by Devin Rousso.

Source/WebCore:

Expose InspectorOverlay::drawGridOverlay as a static method so that it can be used for iOS overlay drawing and
clean up other related drawing methods to be private static instead of instance methods or public static methods.

* inspector/InspectorOverlay.cpp:
(WebCore::drawLayoutHatching):
(WebCore::fontForLayoutLabel):
(WebCore::backgroundPathForLayoutLabel):
(WebCore::expectedSizeForLayoutLabel):
(WebCore::drawLayoutLabel):
(WebCore::InspectorOverlay::drawLayoutHatching): Deleted.
(WebCore::InspectorOverlay::fontForLayoutLabel): Deleted.
(WebCore::InspectorOverlay::backgroundPathForLayoutLabel): Deleted.
(WebCore::InspectorOverlay::drawLayoutLabel): Deleted.
* inspector/InspectorOverlay.h:

Source/WebKit:

Remove the (almost) 1-to-1 duplicated logic currently being used to turn Grid Overlays into a layer hierarchy
and instead use a graphics context to draw the overlays straight into the view to take advantage of the existing
drawing code we use for macOS in WebCore::InspectorOverlay. To accommodate this, we now correctly set the
content scale factor of the view itself (so that our drawing does not appear blurry) and set the frame of the
view equal to the current visible portion of the parent scroll view, which helps us to avoid having an
incredibly large graphics context to draw into (which we would if the view's frame was just set to match the
frame of the webpage's view). This frame will not always be the same size, such as when zooming in where less of
the frame is visible. Combined with the current content scale, this actually means that on zoom the effective
number of pixels that need to be drawn is consistent.

* UIProcess/Inspector/ios/WKInspectorHighlightView.h:
* UIProcess/Inspector/ios/WKInspectorHighlightView.mm:
(-[WKInspectorHighlightView initWithFrame:]):
- Explicitly set this view to be non-opaque so that page content can be seen below this view. This wasn't
previously necessary because the bounds of this view were a zero-rect, which meant the background was never
painted.

(-[WKInspectorHighlightView _removeAllLayers]):
(-[WKInspectorHighlightView _createLayers:]):
- Because the view's frame origin is now offset, we need to create the node highlight layers offset by the
negation of the frame's origin so that they still line up correctly with page content.

(-[WKInspectorHighlightView drawRect:]):
(-[WKInspectorHighlightView update:scale:frame:]):
(-[WKInspectorHighlightView _createGridOverlayLayers:scale:]): Deleted.
(createLayoutHatchingLayer): Deleted.
(createLayoutLabelLayer): Deleted.
(-[WKInspectorHighlightView _createGridOverlayLayer:scale:]): Deleted.
(-[WKInspectorHighlightView update:scale:]): Deleted.
* UIProcess/ios/WKContentView.mm:
(-[WKContentView _showInspectorHighlight:]):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/inspector/InspectorOverlay.cpp
trunk/Source/WebCore/inspector/InspectorOverlay.h
trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/UIProcess/Inspector/ios/WKInspectorHighlightView.h
trunk/Source/WebKit/UIProcess/Inspector/ios/WKInspectorHighlightView.mm
trunk/Source/WebKit/UIProcess/ios/WKContentView.mm




Diff

Modified: trunk/Source/WebCore/ChangeLog (286587 => 286588)

--- trunk/Source/WebCore/ChangeLog	2021-12-07 05:52:22 UTC (rev 286587)
+++ trunk/Source/WebCore/ChangeLog	2021-12-07 06:20:45 UTC (rev 286588)
@@ -1,3 +1,25 @@
+2021-12-06  Patrick Angle  
+
+[Cocoa] Web Inspector: Unify Grid overlay drawing code
+https://bugs.webkit.org/show_bug.cgi?id=233773
+
+Reviewed by Devin Rousso.
+
+Expose InspectorOverlay::drawGridOverlay as a static method so that it can be used for iOS overlay drawing and
+clean up other related drawing methods to be private static instead of instance methods or public static methods.
+
+* inspector/InspectorOverlay.cpp:
+(WebCore::drawLayoutHatching):
+(WebCore::fontForLayoutLabel):
+(WebCore::backgroundPathForLayoutLabel):
+(WebCore::expectedSizeForLayoutLabel):
+(WebCore::drawLayoutLabel):
+(WebCore::InspectorOverlay::drawLayoutHatching): Deleted.
+(WebCore::InspectorOverlay::fontForLayoutLabel): Deleted.
+(WebCore::InspectorOverlay::backgroundPathForLayoutLabel): Deleted.
+(WebCore::InspectorOverlay::drawLayoutLabel): Deleted.
+* inspector/InspectorOverlay.h:
+
 2021-12-06  Chris Dumez  
 
 's range should be reversible


Modified: trunk/Source/WebCore/inspector/InspectorOverlay.cpp (286587 => 286588)

--- trunk/Source/WebCore/inspector/InspectorOverlay.cpp	2021-12-07 05:52:22 UTC (rev 286587)
+++ trunk/Source/WebCore/inspector/InspectorOverlay.cpp	2021-12-07 06:20:45 UTC (rev 286588)

[webkit-changes] [286558] trunk

2021-12-06 Thread pangle
Title: [286558] trunk








Revision 286558
Author pan...@apple.com
Date 2021-12-06 11:45:45 -0800 (Mon, 06 Dec 2021)


Log Message
Web Inspector: Support Cascade Layers in the Styles sidebar
https://bugs.webkit.org/show_bug.cgi?id=233208

Reviewed by Devin Rousso.

Source/_javascript_Core:

Add new values to `CSS.Grouping`'s `type` enum for cascade layers and make the `text` optional since an
anonymous layer will not have a name or other text.

* inspector/protocol/CSS.json:

Source/WebCore:

Test: inspector/css/getMatchedStylesForNodeLayerGrouping.html

Add support for parsing and grouping CSS `@layer` rules in `InspectorStyleSheet` to the existing paths for
handling other groupings so that the frontend is made aware of rules wrapped inside a layer or multiple layers.

* Headers.cmake:
* WebCore.xcodeproj/project.pbxproj:
- CompiledSelector.h needs to be exported as a private header to include in WebKitLegacy's build, since it is
imported by StyleRule.h, which is now imported by CSSImportRule.h, which is imported in WebKitLegacy.

* css/CSSImportRule.cpp:
(WebCore::CSSImportRule::cascadeLayerName const):
* css/CSSImportRule.h:
* css/CSSLayerRule.cpp:
(WebCore::CSSLayerRule::cssText const):
(WebCore::CSSLayerRule::layerName const):
(WebCore::CSSLayerRule::stringFromCascadeLayerName):
* css/CSSLayerRule.h:
* inspector/InspectorStyleSheet.cpp:
(flattenSourceData):
(WebCore::asCSSRuleList):
(WebCore::buildArrayForGroupings):
* style/InspectorCSSOMWrappers.cpp:
(WebCore::Style::InspectorCSSOMWrappers::collect):

Source/WebInspectorUI:

* UserInterface/Models/CSSGrouping.js:
(WI.CSSGrouping):
(WI.CSSGrouping.prototype.get isLayer):
(WI.CSSGrouping.prototype.get prefix):
- Update `CSSGrouping` to support `@layer` rules, and make `text` optional for a grouping, since anonymous layers
will not have a name.

* UserInterface/Models/CSSStyleDeclaration.js:
(WI.CSSStyleDeclaration.prototype.generateFormattedText):
- Ensure that spacing remains correct and "null" isn't shown for groupings without text.

* UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
(WI.SpreadsheetCSSStyleDeclarationSection.prototype.initialLayout):
- When merging layer groups, ensure that a "." is used as a separator, and that each group has a name (to
prevent having a hanging period or the "null" text appearing).

LayoutTests:

Add new test cases for `CSS.getMatchesStyleForNode` to make sure that layer groupings are correctly determined,
and that rules nested in `@layer` rules and `@import layer()`s are correctly represented and sorted by the order
they are applied to an element.

* inspector/css/getMatchedStylesForNode-expected.txt:
- Re-baseline to account for change in order of CSSGrouping properties in the protocol due to `text` now being
optional.
* inspector/css/getMatchedStylesForNodeLayerGrouping-expected.txt: Added.
* inspector/css/getMatchedStylesForNodeLayerGrouping.html: Added.
* inspector/css/resources/external-layers.css: Added.

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/inspector/css/getMatchedStylesForNode-expected.txt
trunk/Source/_javascript_Core/ChangeLog
trunk/Source/_javascript_Core/inspector/protocol/CSS.json
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/Headers.cmake
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
trunk/Source/WebCore/css/CSSImportRule.cpp
trunk/Source/WebCore/css/CSSImportRule.h
trunk/Source/WebCore/css/CSSLayerRule.cpp
trunk/Source/WebCore/css/CSSLayerRule.h
trunk/Source/WebCore/inspector/InspectorStyleSheet.cpp
trunk/Source/WebCore/style/InspectorCSSOMWrappers.cpp
trunk/Source/WebInspectorUI/ChangeLog
trunk/Source/WebInspectorUI/UserInterface/Models/CSSGrouping.js
trunk/Source/WebInspectorUI/UserInterface/Models/CSSStyleDeclaration.js
trunk/Source/WebInspectorUI/UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js


Added Paths

trunk/LayoutTests/inspector/css/getMatchedStylesForNodeLayerGrouping-expected.txt
trunk/LayoutTests/inspector/css/getMatchedStylesForNodeLayerGrouping.html
trunk/LayoutTests/inspector/css/resources/external-layers.css




Diff

Modified: trunk/LayoutTests/ChangeLog (286557 => 286558)

--- trunk/LayoutTests/ChangeLog	2021-12-06 19:45:31 UTC (rev 286557)
+++ trunk/LayoutTests/ChangeLog	2021-12-06 19:45:45 UTC (rev 286558)
@@ -1,3 +1,21 @@
+2021-12-06  Patrick Angle  
+
+Web Inspector: Support Cascade Layers in the Styles sidebar
+https://bugs.webkit.org/show_bug.cgi?id=233208
+
+Reviewed by Devin Rousso.
+
+Add new test cases for `CSS.getMatchesStyleForNode` to make sure that layer groupings are correctly determined,
+and that rules nested in `@layer` rules and `@import layer()`s are correctly represented and sorted by the order
+they are applied to an element.
+
+* inspector/css/getMatchedStylesForNode-expected.txt:
+- Re-baseline to account for change in order of CSSGrouping properties in the protocol due to `text` now being
+optional.
+* 

[webkit-changes] [286412] trunk/Source/WebInspectorUI

2021-12-01 Thread pangle
Title: [286412] trunk/Source/WebInspectorUI








Revision 286412
Author pan...@apple.com
Date 2021-12-01 21:03:13 -0800 (Wed, 01 Dec 2021)


Log Message
Web Inspector: Console execution context can become an unexpected selection on refresh/navigation
https://bugs.webkit.org/show_bug.cgi?id=233349

Reviewed by Devin Rousso.

There are really three bugs here in `WI.QuickConsole.prototype._handleFrameExecutionContextsCleared`, each of
which contribute to unexpected execution context selections.

1. If the frame of the active execution context commits a provisional load, our code attempts to re-select the
new context for that frame, which results in clearing the `Auto` bit for selected context, which means the
context no longer will follow the selected DOM node. This is resolved by no longer following a frame's execution
context on navigation if the current selection is `Auto` (tracked by the `_useExecutionContextOfInspectedNode`
variable).

2. Because of the very short timeframe for the above to take place before bailing (previously 10ms) there are
many situations where other large payloads over the protocol, like a complex DOM tree, will cause the timeout to
fire before we receive an event telling us there is a new execution context for the frame, which means we end up
not following the frame anyways. This is improved by increasing the timeout to a still-brisk, but more
reasonable 100ms.

3. The timeout in (2) can lead to us having a selected execution context that may no longer be valid because the
fail-safe in `QuickConsole.prototype._handleFrameExecutionContextsCleared` doesn't really fail safely, since it
doesn't provide a new execution context to be active and instead seems to rely on the hope that the context will
still work for future invocations, which I believe is how many users are getting into the state of a blank
execution context picker (with a working drop down menu with actual contexts that are selectable) and are unable
to evaluate anything in the console until re-selecting an execution context.

Additional drive-by change to move the checks for whether or not we can use the execution context of a selected
node into its own method.

* UserInterface/Views/QuickConsole.js:
(WI.QuickConsole.prototype._populateActiveExecutionContextNavigationItemContextMenu):
(WI.QuickConsole.prototype._handleEngineeringShowInternalExecutionContextsSettingChanged):
(WI.QuickConsole.prototype._handleFrameExecutionContextsCleared):
(WI.QuickConsole.prototype._handleTargetRemoved):
(WI.QuickConsole.prototype._canUseExecutionContextOfInspectedNode):

Modified Paths

trunk/Source/WebInspectorUI/ChangeLog
trunk/Source/WebInspectorUI/UserInterface/Views/QuickConsole.js




Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (286411 => 286412)

--- trunk/Source/WebInspectorUI/ChangeLog	2021-12-02 04:58:54 UTC (rev 286411)
+++ trunk/Source/WebInspectorUI/ChangeLog	2021-12-02 05:03:13 UTC (rev 286412)
@@ -1,3 +1,42 @@
+2021-12-01  Patrick Angle  
+
+Web Inspector: Console execution context can become an unexpected selection on refresh/navigation
+https://bugs.webkit.org/show_bug.cgi?id=233349
+
+Reviewed by Devin Rousso.
+
+There are really three bugs here in `WI.QuickConsole.prototype._handleFrameExecutionContextsCleared`, each of
+which contribute to unexpected execution context selections.
+
+1. If the frame of the active execution context commits a provisional load, our code attempts to re-select the
+new context for that frame, which results in clearing the `Auto` bit for selected context, which means the
+context no longer will follow the selected DOM node. This is resolved by no longer following a frame's execution
+context on navigation if the current selection is `Auto` (tracked by the `_useExecutionContextOfInspectedNode`
+variable).
+
+2. Because of the very short timeframe for the above to take place before bailing (previously 10ms) there are
+many situations where other large payloads over the protocol, like a complex DOM tree, will cause the timeout to
+fire before we receive an event telling us there is a new execution context for the frame, which means we end up
+not following the frame anyways. This is improved by increasing the timeout to a still-brisk, but more
+reasonable 100ms.
+
+3. The timeout in (2) can lead to us having a selected execution context that may no longer be valid because the
+fail-safe in `QuickConsole.prototype._handleFrameExecutionContextsCleared` doesn't really fail safely, since it
+doesn't provide a new execution context to be active and instead seems to rely on the hope that the context will
+still work for future invocations, which I believe is how many users are getting into the state of a blank
+execution context picker (with a working drop down menu with actual contexts that are selectable) and are unable
+   

[webkit-changes] [285950] trunk

2021-11-17 Thread pangle
Title: [285950] trunk








Revision 285950
Author pan...@apple.com
Date 2021-11-17 12:33:05 -0800 (Wed, 17 Nov 2021)


Log Message
Update my (Patrick Angle's) status to reviewer
https://bugs.webkit.org/show_bug.cgi?id=233270

Unreviewed.

Update my status to reviewer, as well as drive-by updates to set my github name and update the area of
expertise.


* metadata/contributors.json:

Modified Paths

trunk/ChangeLog
trunk/metadata/contributors.json




Diff

Modified: trunk/ChangeLog (285949 => 285950)

--- trunk/ChangeLog	2021-11-17 20:22:11 UTC (rev 285949)
+++ trunk/ChangeLog	2021-11-17 20:33:05 UTC (rev 285950)
@@ -1,3 +1,15 @@
+2021-11-17  Patrick Angle  
+
+Update my (Patrick Angle's) status to reviewer
+https://bugs.webkit.org/show_bug.cgi?id=233270
+
+Unreviewed.
+
+Update my status to reviewer, as well as drive-by updates to set my github name and update the area of
+expertise.
+
+* metadata/contributors.json:
+
 2021-11-17  Chris Lord  
 
 Add Chris Lord's GitHub username to contributors.json


Modified: trunk/metadata/contributors.json (285949 => 285950)

--- trunk/metadata/contributors.json	2021-11-17 20:22:11 UTC (rev 285949)
+++ trunk/metadata/contributors.json	2021-11-17 20:33:05 UTC (rev 285950)
@@ -5170,12 +5170,13 @@
   "emails" : [
  "pan...@apple.com"
   ],
-  "expertise" : "Web Inspector",
+  "expertise" : "Developer Tools, Web Inspector, WebDriver",
+  "github" : "patrickangle",
   "name" : "Patrick Angle",
   "nicks" : [
  "pangle"
   ],
-  "status" : "committer"
+  "status" : "reviewer"
},
{
   "emails" : [






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [285851] trunk/Source/WebInspectorUI

2021-11-15 Thread pangle
Title: [285851] trunk/Source/WebInspectorUI








Revision 285851
Author pan...@apple.com
Date 2021-11-15 22:01:36 -0800 (Mon, 15 Nov 2021)


Log Message
Web Inspector: Styles: Autocomplete should support mid-line completions
https://bugs.webkit.org/show_bug.cgi?id=227411

Reviewed by Devin Rousso.

Autocompletion for CSS property values was lacking in the ability to perform mid-line completions, including
within functions, and a lack of support for multi-line CSS property values. This resolves those pain points by
making SpreadsheetTextField multi-line aware and allowing mid-line autocompletion.

* UserInterface/Views/SpreadsheetStyleProperty.js:
(WI.SpreadsheetStyleProperty.prototype._nameCompletionDataProvider):
(WI.SpreadsheetStyleProperty.prototype._valueCompletionDataProvider):

* UserInterface/Views/SpreadsheetTextField.js:
(WI.SpreadsheetTextField):
(WI.SpreadsheetTextField.prototype.valueWithoutSuggestion):
Because suggestions can occur anywhere within the value, we need to iterate through each of the nodes and
collect the text of any of them that are not the completion suggestion.

(WI.SpreadsheetTextField.prototype.set suggestionHint):
When removing the suggestion hint element, we should recombine the text nodes we may have split upon insertion
to prevent the text content from becoming endlessly fragmented into multiple text nodes unnecessarily.

(WI.SpreadsheetTextField.prototype.startEditing):
Reset the last known caret position when editing starts so that we don't mistake keys that are already down as
having moved the cursor to its initial position.

(WI.SpreadsheetTextField.prototype.completionSuggestionsSelectedCompletion):
We should only attempt to reattach the suggestion hint element if we have a suggestion hint to show, otherwise
we could end up with a phantom empty suggestion hint that isn't properly placed later.

(WI.SpreadsheetTextField.prototype.completionSuggestionsClickedCompletion):
Updated to use existing completion committing path to reduce duplicated logic.

(WI.SpreadsheetTextField.prototype._handleMouseDown):
When the user clicks inside the text field while suggestions are visible treat that as intent to stop
autocompletion similar to the escape key, since the new cursor location could be anywhere in the text field.
This behavior also matches other code editors like Xcode, where clicking outside a completion popup will dismiss
the completions list.

(WI.SpreadsheetTextField.prototype._handleKeyDown):
Keep track of where the caret was as well as if the the key event was handled by the suggestion view at the time
a key is pressed so that we can later compare the position to that of when the key is released to determine if
completions should be discarded.

(WI.SpreadsheetTextField.prototype._handleKeyDownForSuggestionView):
We can no longer assume that the current selection's offset will match the value's length, as the offset could
be on any line, or the suggestion could be in middle of a line. Because a suggestionHint only contains text when
we are in middle of autocompletion, it alone is an indicator that pressing the right arrow key should commit the
completion. `document.execCommand` is deprecated, so instead we now use the existing completion committing path
to reduce duplicated logic here.

Note that the left arrow key is still explicitly handled for dismissing autocompletion, as the new mechanism for
dismissing autocompletion won't trigger unless the caret has moved, and the caret will not move if you press the
left arrow key at the start of the text field.

(WI.SpreadsheetTextField.prototype._handleKeyUp):
When a key is released, we should check to see if the caret has moved as a result of the keystroke that we have
not already explicitly handled. If it has moved and was not handled, we dismiss the autocompletion suggestions.

(WI.SpreadsheetTextField.prototype._handleInput):

(WI.SpreadsheetTextField.prototype._updateCompletions):
Provide the current caret position to the completion provided.

(WI.SpreadsheetTextField.prototype._showSuggestionsView):
In order to correctly align the completion list with the current text content, it must be offset from the caret
position excluding the current prefix.

(WI.SpreadsheetTextField.prototype._getCaretPosition):
Added to get the index of the caret in the complete text value, accounting for multi-line values and mid-line
suggestions.

(WI.SpreadsheetTextField.prototype._getCaretRect):

(WI.SpreadsheetTextField.prototype._rangeAtCaretPosition):
Find the range for a caret at the given position. This compliments `_getCaretPosition`, and allows us to count
back some number of characters and create a range of which we later get the client rectangle.

(WI.SpreadsheetTextField.prototype._applyCompletionHint):
Add optional support for updating the caret position to be at the end of the newly inserted text.

(WI.SpreadsheetTextField.prototype._combineEditorElementChildren):
Added to handle combining the fragmented text nodes (and 

[webkit-changes] [285727] trunk/LayoutTests

2021-11-12 Thread pangle
Title: [285727] trunk/LayoutTests








Revision 285727
Author pan...@apple.com
Date 2021-11-12 09:37:01 -0800 (Fri, 12 Nov 2021)


Log Message
Web Inspector: Mark inspector/page/setShowPaintRects.html as flakey in test expectations for Mac
https://bugs.webkit.org/show_bug.cgi?id=233048

Unreviewed test gardening.


* platform/mac/TestExpectations: Add expectation for inspector/page/setShowPaintRects.html while the flakey
failure is investigated.

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/platform/mac/TestExpectations




Diff

Modified: trunk/LayoutTests/ChangeLog (285726 => 285727)

--- trunk/LayoutTests/ChangeLog	2021-11-12 16:53:57 UTC (rev 285726)
+++ trunk/LayoutTests/ChangeLog	2021-11-12 17:37:01 UTC (rev 285727)
@@ -1,3 +1,13 @@
+2021-11-12  Patrick Angle  
+
+Web Inspector: Mark inspector/page/setShowPaintRects.html as flakey in test expectations for Mac
+https://bugs.webkit.org/show_bug.cgi?id=233048
+
+Unreviewed test gardening.
+
+* platform/mac/TestExpectations: Add expectation for inspector/page/setShowPaintRects.html while the flakey
+failure is investigated. 
+
 2021-11-12  Chris Dumez  
 
 fast/dom/Geolocation/cached-position-iframe.html is frequently crashing on Mac-wk1


Modified: trunk/LayoutTests/platform/mac/TestExpectations (285726 => 285727)

--- trunk/LayoutTests/platform/mac/TestExpectations	2021-11-12 16:53:57 UTC (rev 285726)
+++ trunk/LayoutTests/platform/mac/TestExpectations	2021-11-12 17:37:01 UTC (rev 285727)
@@ -2424,6 +2424,8 @@
 
 webkit.org/b/231924 inspector/css/modify-css-property.html [ Pass Failure ]
 
+webkit.org/b/233047 inspector/page/setShowPaintRects.html [ Pass Failure ]
+
 # Plugins
 # FIXME: Remove these tests.
 platform/mac/plugins/testplugin-onnew-onpaint.html [ Skip ]






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [285164] trunk/Source

2021-11-02 Thread pangle
Title: [285164] trunk/Source








Revision 285164
Author pan...@apple.com
Date 2021-11-02 10:01:52 -0700 (Tue, 02 Nov 2021)


Log Message
WebDriver: [Cocoa] support `acceptInsecureCerts` capability
https://bugs.webkit.org/show_bug.cgi?id=231789

Reviewed by BJ Burg.

Add necessary plumbing to support the `acceptInsecureCerts` WebDriver capability.

Source/_javascript_Core:

* inspector/remote/RemoteInspectorConstants.h:
* inspector/remote/cocoa/RemoteInspectorCocoa.mm:
(Inspector::RemoteInspector::receivedAutomationSessionRequestMessage):

Source/WebKit:

* UIProcess/API/Cocoa/_WKAutomationSessionConfiguration.h:
* UIProcess/API/Cocoa/_WKAutomationSessionConfiguration.mm:
(-[_WKAutomationSessionConfiguration init]):
(-[_WKAutomationSessionConfiguration copyWithZone:]):
* UIProcess/Cocoa/AutomationClient.mm:
(WebKit::AutomationClient::requestAutomationSession):

Modified Paths

trunk/Source/_javascript_Core/ChangeLog
trunk/Source/_javascript_Core/inspector/remote/RemoteInspectorConstants.h
trunk/Source/_javascript_Core/inspector/remote/cocoa/RemoteInspectorCocoa.mm
trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/UIProcess/API/Cocoa/_WKAutomationSessionConfiguration.h
trunk/Source/WebKit/UIProcess/API/Cocoa/_WKAutomationSessionConfiguration.mm
trunk/Source/WebKit/UIProcess/Cocoa/AutomationClient.mm




Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (285163 => 285164)

--- trunk/Source/_javascript_Core/ChangeLog	2021-11-02 16:37:09 UTC (rev 285163)
+++ trunk/Source/_javascript_Core/ChangeLog	2021-11-02 17:01:52 UTC (rev 285164)
@@ -1,3 +1,16 @@
+2021-11-02  Patrick Angle  
+
+WebDriver: [Cocoa] support `acceptInsecureCerts` capability
+https://bugs.webkit.org/show_bug.cgi?id=231789
+
+Reviewed by BJ Burg.
+
+Add necessary plumbing to support the `acceptInsecureCerts` WebDriver capability.
+
+* inspector/remote/RemoteInspectorConstants.h:
+* inspector/remote/cocoa/RemoteInspectorCocoa.mm:
+(Inspector::RemoteInspector::receivedAutomationSessionRequestMessage):
+
 2021-11-01  Mark Lam  
 
 Remove some unused Heap fields.


Modified: trunk/Source/_javascript_Core/inspector/remote/RemoteInspectorConstants.h (285163 => 285164)

--- trunk/Source/_javascript_Core/inspector/remote/RemoteInspectorConstants.h	2021-11-02 16:37:09 UTC (rev 285163)
+++ trunk/Source/_javascript_Core/inspector/remote/RemoteInspectorConstants.h	2021-11-02 17:01:52 UTC (rev 285164)
@@ -103,6 +103,7 @@
 
 // The value for WIRSessionCapabilitiesKey is a dictionary that holds these capability key-value pairs.
 
+#define WIRAcceptInsecureCertificatesKey   @"org.webkit.webdriver.accept-insecure-certificates"
 #define WIRAllowInsecureMediaCaptureCapabilityKey  @"org.webkit.webdriver.webrtc.allow-insecure-media-capture"
 #define WIRSuppressICECandidateFilteringCapabilityKey  @"org.webkit.webdriver.webrtc.suppress-ice-candidate-filtering"
 


Modified: trunk/Source/_javascript_Core/inspector/remote/cocoa/RemoteInspectorCocoa.mm (285163 => 285164)

--- trunk/Source/_javascript_Core/inspector/remote/cocoa/RemoteInspectorCocoa.mm	2021-11-02 16:37:09 UTC (rev 285163)
+++ trunk/Source/_javascript_Core/inspector/remote/cocoa/RemoteInspectorCocoa.mm	2021-11-02 17:01:52 UTC (rev 285164)
@@ -729,6 +729,11 @@
 BAIL_IF_UNEXPECTED_TYPE_ALLOWING_NIL(forwardedCapabilities, [NSDictionary class]);
 
 Client::SessionCapabilities sessionCapabilities;
+if (NSNumber *value = forwardedCapabilities[WIRAcceptInsecureCertificatesKey]) {
+if ([value isKindOfClass:[NSNumber class]])
+sessionCapabilities.acceptInsecureCertificates = value.boolValue;
+}
+
 if (NSNumber *value = forwardedCapabilities[WIRAllowInsecureMediaCaptureCapabilityKey]) {
 if ([value isKindOfClass:[NSNumber class]])
 sessionCapabilities.allowInsecureMediaCapture = value.boolValue;


Modified: trunk/Source/WebKit/ChangeLog (285163 => 285164)

--- trunk/Source/WebKit/ChangeLog	2021-11-02 16:37:09 UTC (rev 285163)
+++ trunk/Source/WebKit/ChangeLog	2021-11-02 17:01:52 UTC (rev 285164)
@@ -1,3 +1,19 @@
+2021-11-02  Patrick Angle  
+
+WebDriver: [Cocoa] support `acceptInsecureCerts` capability
+https://bugs.webkit.org/show_bug.cgi?id=231789
+
+Reviewed by BJ Burg.
+
+Add necessary plumbing to support the `acceptInsecureCerts` WebDriver capability.
+
+* UIProcess/API/Cocoa/_WKAutomationSessionConfiguration.h:
+* UIProcess/API/Cocoa/_WKAutomationSessionConfiguration.mm:
+(-[_WKAutomationSessionConfiguration init]):
+(-[_WKAutomationSessionConfiguration copyWithZone:]):
+* UIProcess/Cocoa/AutomationClient.mm:
+(WebKit::AutomationClient::requestAutomationSession):
+
 2021-11-02  Kate Cheney  
 
 https://bugs.webkit.org/show_bug.cgi?id=232593


Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/_WKAutomationSessionConfiguration.h (285163 => 285164)

--- 

[webkit-changes] [283572] trunk/Source

2021-10-05 Thread pangle
Title: [283572] trunk/Source








Revision 283572
Author pan...@apple.com
Date 2021-10-05 15:12:56 -0700 (Tue, 05 Oct 2021)


Log Message
Web Inspector: Show color space for canvases in the Graphics tab on the overview cards
https://bugs.webkit.org/show_bug.cgi?id=231205

Reviewed by Devin Rousso.

Source/_javascript_Core:

Use an enum instead of strings for color space values sent to the frontend.

* inspector/protocol/Canvas.json:
* inspector/scripts/codegen/generator.py:

Source/WebCore:

Use an enum instead of strings for color space values sent to the frontend.

* inspector/InspectorCanvas.cpp:
(WebCore::buildObjectForCanvasContextAttributes):

Source/WebInspectorUI:

For canvas context's with a color space attribute, show the color space next to the context type in the header
of each context card in the Graphics tab.

* UserInterface/Models/Canvas.js:
(WI.Canvas.displayNameForColorSpace):
* UserInterface/Views/CanvasContentView.js:
(WI.CanvasContentView.prototype.initialLayout):
* UserInterface/Views/CanvasOverviewContentView.css:
(.content-view.canvas-overview > .content-view.canvas > header > .titles > :matches(.subtitle, .color-space),):
(.content-view.canvas-overview > .content-view.canvas > header .color-space::before):

Modified Paths

trunk/Source/_javascript_Core/ChangeLog
trunk/Source/_javascript_Core/inspector/protocol/Canvas.json
trunk/Source/_javascript_Core/inspector/scripts/codegen/generator.py
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/inspector/InspectorCanvas.cpp
trunk/Source/WebInspectorUI/ChangeLog
trunk/Source/WebInspectorUI/UserInterface/Models/Canvas.js
trunk/Source/WebInspectorUI/UserInterface/Views/CanvasContentView.js
trunk/Source/WebInspectorUI/UserInterface/Views/CanvasOverviewContentView.css




Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (283571 => 283572)

--- trunk/Source/_javascript_Core/ChangeLog	2021-10-05 22:04:30 UTC (rev 283571)
+++ trunk/Source/_javascript_Core/ChangeLog	2021-10-05 22:12:56 UTC (rev 283572)
@@ -1,3 +1,15 @@
+2021-10-05  Patrick Angle  
+
+Web Inspector: Show color space for canvases in the Graphics tab on the overview cards
+https://bugs.webkit.org/show_bug.cgi?id=231205
+
+Reviewed by Devin Rousso.
+
+Use an enum instead of strings for color space values sent to the frontend.
+
+* inspector/protocol/Canvas.json:
+* inspector/scripts/codegen/generator.py:
+
 2021-10-05  Mark Lam  
 
 CodeBlock should not add/remove LoopHintExecutionCounters.


Modified: trunk/Source/_javascript_Core/inspector/protocol/Canvas.json (283571 => 283572)

--- trunk/Source/_javascript_Core/inspector/protocol/Canvas.json	2021-10-05 22:04:30 UTC (rev 283571)
+++ trunk/Source/_javascript_Core/inspector/protocol/Canvas.json	2021-10-05 22:12:56 UTC (rev 283572)
@@ -16,6 +16,11 @@
 "description": "Unique shader program identifier."
 },
 {
+"id": "ColorSpace",
+"type": "string",
+"enum": ["srgb", "display-p3"]
+},
+{
 "id": "ContextType",
 "type": "string",
 "enum": ["canvas-2d", "bitmaprenderer", "webgl", "webgl2"],
@@ -39,7 +44,7 @@
 "description": "Drawing surface attributes.",
 "properties": [
 { "name": "alpha", "type": "boolean", "optional": true, "description": "WebGL, WebGL2, ImageBitmapRenderingContext" },
-{ "name": "colorSpace", "type": "string", "optional": true, "description": "2D" },
+{ "name": "colorSpace", "$ref": "ColorSpace", "optional": true, "description": "2D" },
 { "name": "desynchronized", "type": "boolean", "optional": true, "description": "2D" },
 { "name": "depth", "type": "boolean", "optional": true, "description": "WebGL, WebGL2" },
 { "name": "stencil", "type": "boolean", "optional": true, "description": "WebGL, WebGL2" },


Modified: trunk/Source/_javascript_Core/inspector/scripts/codegen/generator.py (283571 => 283572)

--- trunk/Source/_javascript_Core/inspector/scripts/codegen/generator.py	2021-10-05 22:04:30 UTC (rev 283571)
+++ trunk/Source/_javascript_Core/inspector/scripts/codegen/generator.py	2021-10-05 22:12:56 UTC (rev 283572)
@@ -42,7 +42,8 @@
 def ucfirst(str):
 return str[:1].upper() + str[1:]
 
-_ALWAYS_SPECIALCASED_ENUM_VALUE_SUBSTRINGS = set(['2D', 'API', 'CSS', 'DOM', 'HTML', 'JIT', 'XHR', 'XML', 'IOS', 'MacOS', '_javascript_', 'ServiceWorker'])
+
+_ALWAYS_SPECIALCASED_ENUM_VALUE_SUBSTRINGS = set(['2D', 'API', 'CSS', 'DOM', 'HTML', 'JIT', 'SRGB', 'XHR', 'XML', 'IOS', 'MacOS', '_javascript_', 'ServiceWorker'])
 _ALWAYS_SPECIALCASED_ENUM_VALUE_LOOKUP_TABLE = dict([(s.upper(), s) for s in _ALWAYS_SPECIALCASED_ENUM_VALUE_SUBSTRINGS])
 
 _ENUM_IDENTIFIER_RENAME_MAP = {


Modified: trunk/Source/WebCore/ChangeLog (283571 => 283572)

--- trunk/Source/WebCore/ChangeLog	2021-10-05 22:04:30 UTC (rev 283571)
+++ 

[webkit-changes] [282616] trunk/Source/WebInspectorUI

2021-09-16 Thread pangle
Title: [282616] trunk/Source/WebInspectorUI








Revision 282616
Author pan...@apple.com
Date 2021-09-16 16:05:55 -0700 (Thu, 16 Sep 2021)


Log Message
Web Inspector: Regression(r279613) Audit result scope toggles are missing
https://bugs.webkit.org/show_bug.cgi?id=230322

Reviewed by Devin Rousso.

The sizing calculations modified in r279613 were erroneously applied to both the minimum space calculation as
well as the navigation item hiding calculations, despite hiding navigation items never being done for non-sidebar
navigation bars. The logic in `WI.NavigationBar.prototype._calculateMinimumWidth` remains unchanged, as we still
need sidebars to provide a minimum width that can accommodate all items in a flex layout in order to avoid
flowing navigation items on to another row. The navigation bar in a sidebar is unique in this respect, as other
navigation bars will gracefully hide components if they truly don't have enough space, but a sidebar relies on
getting a minimum size that can actually accommodate all items in a single row.

* UserInterface/Views/NavigationBar.js:
(WI.NavigationBar.prototype.layout.calculateVisibleItemWidth):
(WI.NavigationBar.prototype.layout):

Modified Paths

trunk/Source/WebInspectorUI/ChangeLog
trunk/Source/WebInspectorUI/UserInterface/Views/NavigationBar.js




Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (282615 => 282616)

--- trunk/Source/WebInspectorUI/ChangeLog	2021-09-16 23:05:14 UTC (rev 282615)
+++ trunk/Source/WebInspectorUI/ChangeLog	2021-09-16 23:05:55 UTC (rev 282616)
@@ -1,5 +1,24 @@
 2021-09-16  Patrick Angle  
 
+Web Inspector: Regression(r279613) Audit result scope toggles are missing
+https://bugs.webkit.org/show_bug.cgi?id=230322
+
+Reviewed by Devin Rousso.
+
+The sizing calculations modified in r279613 were erroneously applied to both the minimum space calculation as
+well as the navigation item hiding calculations, despite hiding navigation items never being done for non-sidebar
+navigation bars. The logic in `WI.NavigationBar.prototype._calculateMinimumWidth` remains unchanged, as we still
+need sidebars to provide a minimum width that can accommodate all items in a flex layout in order to avoid
+flowing navigation items on to another row. The navigation bar in a sidebar is unique in this respect, as other
+navigation bars will gracefully hide components if they truly don't have enough space, but a sidebar relies on
+getting a minimum size that can actually accommodate all items in a single row.
+
+* UserInterface/Views/NavigationBar.js:
+(WI.NavigationBar.prototype.layout.calculateVisibleItemWidth):
+(WI.NavigationBar.prototype.layout):
+
+2021-09-16  Patrick Angle  
+
 Web Inspector: Don't maintain a back-forward stack for `ContentBrowser`/`ContentViewContainer` when not necessary
 https://bugs.webkit.org/show_bug.cgi?id=230286
 


Modified: trunk/Source/WebInspectorUI/UserInterface/Views/NavigationBar.js (282615 => 282616)

--- trunk/Source/WebInspectorUI/UserInterface/Views/NavigationBar.js	2021-09-16 23:05:14 UTC (rev 282615)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/NavigationBar.js	2021-09-16 23:05:55 UTC (rev 282616)
@@ -223,7 +223,7 @@
 let visibleNavigationItems = this._visibleNavigationItems;
 
 function calculateVisibleItemWidth() {
-return visibleNavigationItems.reduce((total, item) => total + Math.ceil(item.width), 0);
+return visibleNavigationItems.reduce((total, item) => total + item.width, 0);
 }
 
 let totalItemWidth = calculateVisibleItemWidth();
@@ -252,7 +252,7 @@
 
 while (totalItemWidth > barWidth && visibleNavigationItems.length) {
 let navigationItem = visibleNavigationItems.shift();
-totalItemWidth -= Math.ceil(navigationItem.width);
+totalItemWidth -= navigationItem.width;
 forceItemHidden(navigationItem, true);
 }
 






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [282610] trunk/Source/WebInspectorUI

2021-09-16 Thread pangle
Title: [282610] trunk/Source/WebInspectorUI








Revision 282610
Author pan...@apple.com
Date 2021-09-16 15:35:25 -0700 (Thu, 16 Sep 2021)


Log Message
Web Inspector: Don't maintain a back-forward stack for `ContentBrowser`/`ContentViewContainer` when not necessary
https://bugs.webkit.org/show_bug.cgi?id=230286

Reviewed by Devin Rousso.

We currently maintain a back/forward stack for all ContentViewContainers, even if other history entries won't be
used. Instead, subclasses of ContentBrowserTabContentView should be able to disable the history stack, which
helps us ensure that outdated content views are not kept around for these subclasses and their views.

This does not line up one-to-one with views that hide the back/forward buttons, as the back/forward stack is
used in some places to provide a memory of selection across different views, like in the Graphics tab.

* UserInterface/Views/AuditTabContentView.js:
(WI.AuditTabContentView):
* UserInterface/Views/ConsoleTabContentView.js:
(WI.ConsoleTabContentView):
* UserInterface/Views/ContentBrowser.js:
* UserInterface/Views/ContentBrowserTabContentView.js:
* UserInterface/Views/ContentViewContainer.js:
(WI.ContentViewContainer.prototype.showContentView):
(WI.ContentViewContainer.prototype.replaceContentView):
* UserInterface/Views/ElementsTabContentView.js:
(WI.ElementsTabContentView):
* UserInterface/Views/GraphicsTabContentView.js:
(WI.GraphicsTabContentView):
* UserInterface/Views/LayersTabContentView.js:
(WI.LayersTabContentView):
* UserInterface/Views/NetworkDetailView.js:
(WI.NetworkDetailView.prototype.initialLayout):
* UserInterface/Views/NetworkTabContentView.js:
(WI.NetworkTabContentView):
* UserInterface/Views/TimelineRecordingContentView.js:
(WI.TimelineRecordingContentView):

Modified Paths

trunk/Source/WebInspectorUI/ChangeLog
trunk/Source/WebInspectorUI/UserInterface/Views/AuditTabContentView.js
trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleTabContentView.js
trunk/Source/WebInspectorUI/UserInterface/Views/ContentBrowser.js
trunk/Source/WebInspectorUI/UserInterface/Views/ContentBrowserTabContentView.js
trunk/Source/WebInspectorUI/UserInterface/Views/ContentViewContainer.js
trunk/Source/WebInspectorUI/UserInterface/Views/ElementsTabContentView.js
trunk/Source/WebInspectorUI/UserInterface/Views/GraphicsTabContentView.js
trunk/Source/WebInspectorUI/UserInterface/Views/LayersTabContentView.js
trunk/Source/WebInspectorUI/UserInterface/Views/NetworkDetailView.js
trunk/Source/WebInspectorUI/UserInterface/Views/NetworkTabContentView.js
trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRecordingContentView.js




Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (282609 => 282610)

--- trunk/Source/WebInspectorUI/ChangeLog	2021-09-16 22:28:57 UTC (rev 282609)
+++ trunk/Source/WebInspectorUI/ChangeLog	2021-09-16 22:35:25 UTC (rev 282610)
@@ -1,5 +1,41 @@
 2021-09-16  Patrick Angle  
 
+Web Inspector: Don't maintain a back-forward stack for `ContentBrowser`/`ContentViewContainer` when not necessary
+https://bugs.webkit.org/show_bug.cgi?id=230286
+
+Reviewed by Devin Rousso.
+
+We currently maintain a back/forward stack for all ContentViewContainers, even if other history entries won't be
+used. Instead, subclasses of ContentBrowserTabContentView should be able to disable the history stack, which
+helps us ensure that outdated content views are not kept around for these subclasses and their views.
+
+This does not line up one-to-one with views that hide the back/forward buttons, as the back/forward stack is
+used in some places to provide a memory of selection across different views, like in the Graphics tab.
+
+* UserInterface/Views/AuditTabContentView.js:
+(WI.AuditTabContentView):
+* UserInterface/Views/ConsoleTabContentView.js:
+(WI.ConsoleTabContentView):
+* UserInterface/Views/ContentBrowser.js:
+* UserInterface/Views/ContentBrowserTabContentView.js:
+* UserInterface/Views/ContentViewContainer.js:
+(WI.ContentViewContainer.prototype.showContentView):
+(WI.ContentViewContainer.prototype.replaceContentView):
+* UserInterface/Views/ElementsTabContentView.js:
+(WI.ElementsTabContentView):
+* UserInterface/Views/GraphicsTabContentView.js:
+(WI.GraphicsTabContentView):
+* UserInterface/Views/LayersTabContentView.js:
+(WI.LayersTabContentView):
+* UserInterface/Views/NetworkDetailView.js:
+(WI.NetworkDetailView.prototype.initialLayout):
+* UserInterface/Views/NetworkTabContentView.js:
+(WI.NetworkTabContentView):
+* UserInterface/Views/TimelineRecordingContentView.js:
+(WI.TimelineRecordingContentView):
+
+2021-09-16  Patrick Angle  
+
 Web Inspector: `FrameDOMTreeContentView` may update after it has `closed` called, causing hangs on some webpages on reload
 

[webkit-changes] [282607] trunk/Source/WebInspectorUI

2021-09-16 Thread pangle
Title: [282607] trunk/Source/WebInspectorUI








Revision 282607
Author pan...@apple.com
Date 2021-09-16 15:23:15 -0700 (Thu, 16 Sep 2021)


Log Message
Web Inspector: `FrameDOMTreeContentView` may update after it has `closed` called, causing hangs on some webpages on reload
https://bugs.webkit.org/show_bug.cgi?id=230186

Reviewed by Devin Rousso.

`FrameDOMTreeContentView` may be `closed` between a call to `_requestRootDOMNode` and the response being
provided to `_rootDOMNodeAvailable`. This can result in an attempt to select a DOM node in an old and detached
DOM tree. To combat this, add a flag to `ContentView` to mark a closed `ContentView` as such, and then return
early from `_rootDOMNodeAvailable` if the `ContentView` is already closed.

* UserInterface/Views/ContentView.js:
(WI.ContentView):
(WI.ContentView.prototype.closed):
(WI.ContentView.prototype.get isClosed):
* UserInterface/Views/FrameDOMTreeContentView.js:
(WI.FrameDOMTreeContentView.prototype._rootDOMNodeAvailable):

Modified Paths

trunk/Source/WebInspectorUI/ChangeLog
trunk/Source/WebInspectorUI/UserInterface/Views/ContentView.js
trunk/Source/WebInspectorUI/UserInterface/Views/FrameDOMTreeContentView.js




Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (282606 => 282607)

--- trunk/Source/WebInspectorUI/ChangeLog	2021-09-16 22:20:35 UTC (rev 282606)
+++ trunk/Source/WebInspectorUI/ChangeLog	2021-09-16 22:23:15 UTC (rev 282607)
@@ -1,3 +1,22 @@
+2021-09-16  Patrick Angle  
+
+Web Inspector: `FrameDOMTreeContentView` may update after it has `closed` called, causing hangs on some webpages on reload
+https://bugs.webkit.org/show_bug.cgi?id=230186
+
+Reviewed by Devin Rousso.
+
+`FrameDOMTreeContentView` may be `closed` between a call to `_requestRootDOMNode` and the response being
+provided to `_rootDOMNodeAvailable`. This can result in an attempt to select a DOM node in an old and detached
+DOM tree. To combat this, add a flag to `ContentView` to mark a closed `ContentView` as such, and then return
+early from `_rootDOMNodeAvailable` if the `ContentView` is already closed.
+
+* UserInterface/Views/ContentView.js:
+(WI.ContentView):
+(WI.ContentView.prototype.closed):
+(WI.ContentView.prototype.get isClosed):
+* UserInterface/Views/FrameDOMTreeContentView.js:
+(WI.FrameDOMTreeContentView.prototype._rootDOMNodeAvailable):
+
 2021-09-15  Patrick Angle  
 
 Web Inspector: `TreeOutline` should return early when failing to find an ancestor while populating the tree


Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ContentView.js (282606 => 282607)

--- trunk/Source/WebInspectorUI/UserInterface/Views/ContentView.js	2021-09-16 22:20:35 UTC (rev 282606)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ContentView.js	2021-09-16 22:23:15 UTC (rev 282607)
@@ -37,6 +37,7 @@
 this.element.classList.add("content-view");
 
 this._parentContainer = null;
+this._isClosed = false;
 }
 
 // Static
@@ -338,6 +339,8 @@
 
 // Public
 
+get isClosed() { return this._isClosed; }
+
 get representedObject()
 {
 return this._representedObject;
@@ -393,6 +396,7 @@
 closed()
 {
 // Implemented by subclasses.
+this._isClosed = true;
 }
 
 saveToCookie(cookie)


Modified: trunk/Source/WebInspectorUI/UserInterface/Views/FrameDOMTreeContentView.js (282606 => 282607)

--- trunk/Source/WebInspectorUI/UserInterface/Views/FrameDOMTreeContentView.js	2021-09-16 22:20:35 UTC (rev 282606)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/FrameDOMTreeContentView.js	2021-09-16 22:23:15 UTC (rev 282607)
@@ -62,6 +62,9 @@
 
 _rootDOMNodeAvailable(rootDOMNode)
 {
+if (this.isClosed)
+return;
+
 this.domTreeOutline.rootDOMNode = rootDOMNode;
 
 if (!rootDOMNode) {






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [282477] trunk/Source/WebInspectorUI

2021-09-15 Thread pangle
Title: [282477] trunk/Source/WebInspectorUI








Revision 282477
Author pan...@apple.com
Date 2021-09-15 15:12:01 -0700 (Wed, 15 Sep 2021)


Log Message
Web Inspector: `TreeOutline` should return early when failing to find an ancestor while populating the tree
https://bugs.webkit.org/show_bug.cgi?id=230287

Reviewed by Devin Rousso.

When an ancestor can not be found, we should return to prevent additional work (which will fail) from being done.

* UserInterface/Views/TreeOutline.js:
(WI.TreeOutline.prototype.findTreeElement):

Modified Paths

trunk/Source/WebInspectorUI/ChangeLog
trunk/Source/WebInspectorUI/UserInterface/Views/TreeOutline.js




Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (282476 => 282477)

--- trunk/Source/WebInspectorUI/ChangeLog	2021-09-15 21:51:06 UTC (rev 282476)
+++ trunk/Source/WebInspectorUI/ChangeLog	2021-09-15 22:12:01 UTC (rev 282477)
@@ -1,5 +1,17 @@
 2021-09-15  Patrick Angle  
 
+Web Inspector: `TreeOutline` should return early when failing to find an ancestor while populating the tree
+https://bugs.webkit.org/show_bug.cgi?id=230287
+
+Reviewed by Devin Rousso.
+
+When an ancestor can not be found, we should return to prevent additional work (which will fail) from being done.
+
+* UserInterface/Views/TreeOutline.js:
+(WI.TreeOutline.prototype.findTreeElement):
+
+2021-09-15  Patrick Angle  
+
 Web Inspector: `DOMTreeUpdater` doesn't complete deferred updating/clear updated lists when a node isn't found in the tree
 https://bugs.webkit.org/show_bug.cgi?id=230289
 


Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TreeOutline.js (282476 => 282477)

--- trunk/Source/WebInspectorUI/UserInterface/Views/TreeOutline.js	2021-09-15 21:51:06 UTC (rev 282476)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TreeOutline.js	2021-09-15 22:12:01 UTC (rev 282477)
@@ -516,8 +516,10 @@
 // FIXME: we could do something faster than findTreeElement since we will know the next
 // ancestor exists in the tree.
 item = this.findTreeElement(ancestors[i], isAncestor, getParent);
-if (item)
-item.onpopulate();
+if (!item)
+return null;
+
+item.onpopulate();
 }
 
 return this.getCachedTreeElement(representedObject);






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [282475] trunk/Source/WebInspectorUI

2021-09-15 Thread pangle
Title: [282475] trunk/Source/WebInspectorUI








Revision 282475
Author pan...@apple.com
Date 2021-09-15 14:49:09 -0700 (Wed, 15 Sep 2021)


Log Message
Web Inspector: `DOMTreeUpdater` doesn't complete deferred updating/clear updated lists when a node isn't found in the tree
https://bugs.webkit.org/show_bug.cgi?id=230289

Reviewed by Devin Rousso.

Instead of an early return when a tree element can't be found, we should continue on to the next updated node
and finish out by clearing the collections of updated nodes, otherwise a node that will never be findable again
will cause extra work to be done on every update.

* UserInterface/Views/DOMTreeUpdater.js:
(WI.DOMTreeUpdater.prototype._updateModifiedNodes):

Modified Paths

trunk/Source/WebInspectorUI/ChangeLog
trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeUpdater.js




Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (282474 => 282475)

--- trunk/Source/WebInspectorUI/ChangeLog	2021-09-15 21:43:51 UTC (rev 282474)
+++ trunk/Source/WebInspectorUI/ChangeLog	2021-09-15 21:49:09 UTC (rev 282475)
@@ -1,3 +1,17 @@
+2021-09-15  Patrick Angle  
+
+Web Inspector: `DOMTreeUpdater` doesn't complete deferred updating/clear updated lists when a node isn't found in the tree
+https://bugs.webkit.org/show_bug.cgi?id=230289
+
+Reviewed by Devin Rousso.
+
+Instead of an early return when a tree element can't be found, we should continue on to the next updated node
+and finish out by clearing the collections of updated nodes, otherwise a node that will never be findable again
+will cause extra work to be done on every update.
+
+* UserInterface/Views/DOMTreeUpdater.js:
+(WI.DOMTreeUpdater.prototype._updateModifiedNodes):
+
 2021-09-13  Razvan Caliman  
 
 Web Inspector: Update naming of WI.CSSCompletions callback used for collecting supported CSS properties from the target


Modified: trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeUpdater.js (282474 => 282475)

--- trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeUpdater.js	2021-09-15 21:43:51 UTC (rev 282474)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeUpdater.js	2021-09-15 21:49:09 UTC (rev 282475)
@@ -143,7 +143,7 @@
 for (let node of this._recentlyModifiedNodes.values()) {
 let nodeTreeElement = this._treeOutline.findTreeElement(node);
 if (!nodeTreeElement)
-return;
+continue;
 
 for (let [attribute, nodes] of this._recentlyModifiedAttributes.entries()) {
 // Don't report textContent changes as attribute modifications.






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [282221] trunk/Source

2021-09-09 Thread pangle
Title: [282221] trunk/Source








Revision 282221
Author pan...@apple.com
Date 2021-09-09 10:02:27 -0700 (Thu, 09 Sep 2021)


Log Message
run-webkit-archive crashes with dyld error
https://bugs.webkit.org/show_bug.cgi?id=228060

Reviewed by Alex Christensen.

Source/_javascript_Core:

Add a compatibility symbol for the old `WTF::Optional` version of `BackendDispatcher::reportProtocolError` in
versions of Safari shipping with macOS Big Sur and earlier. This has the side effect of not surfacing protocol
errors and instead silently discarding them when crossing this API boundary. Newer versions of macOS ship using
the newer symbol and are therefor not affected and will continue to surface protocol errors to the frontend.

* runtime/SymbolStubsForSafariCompatibility.mm:
(Inspector::BackendDispatcher::reportProtocolError):

Source/WTF:

Bump the maximum macOS version that `HAVE_SAFARI_FOR_WEBKIT_DEVELOPMENT_REQUIRING_EXTRA_SYMBOLS` will be enabled
to provide compatibility with changes made in macOS 12.

* wtf/PlatformHave.h:

Modified Paths

trunk/Source/_javascript_Core/ChangeLog
trunk/Source/_javascript_Core/runtime/SymbolStubsForSafariCompatibility.mm
trunk/Source/WTF/ChangeLog
trunk/Source/WTF/wtf/PlatformHave.h




Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (282220 => 282221)

--- trunk/Source/_javascript_Core/ChangeLog	2021-09-09 16:49:51 UTC (rev 282220)
+++ trunk/Source/_javascript_Core/ChangeLog	2021-09-09 17:02:27 UTC (rev 282221)
@@ -1,3 +1,18 @@
+2021-09-09  Patrick Angle  
+
+run-webkit-archive crashes with dyld error
+https://bugs.webkit.org/show_bug.cgi?id=228060
+
+Reviewed by Alex Christensen.
+
+Add a compatibility symbol for the old `WTF::Optional` version of `BackendDispatcher::reportProtocolError` in
+versions of Safari shipping with macOS Big Sur and earlier. This has the side effect of not surfacing protocol
+errors and instead silently discarding them when crossing this API boundary. Newer versions of macOS ship using
+the newer symbol and are therefor not affected and will continue to surface protocol errors to the frontend.
+
+* runtime/SymbolStubsForSafariCompatibility.mm:
+(Inspector::BackendDispatcher::reportProtocolError):
+
 2021-09-09  Justin Michaud  
 
 Differential testing: incorrect constant propagation around Uint8ClampedArray


Modified: trunk/Source/_javascript_Core/runtime/SymbolStubsForSafariCompatibility.mm (282220 => 282221)

--- trunk/Source/_javascript_Core/runtime/SymbolStubsForSafariCompatibility.mm	2021-09-09 16:49:51 UTC (rev 282220)
+++ trunk/Source/_javascript_Core/runtime/SymbolStubsForSafariCompatibility.mm	2021-09-09 17:02:27 UTC (rev 282221)
@@ -37,6 +37,7 @@
 
 template class RefPtr { };
 template struct DumbPtrTraits { };
+template class Optional { };
 
 namespace JSONImpl {
 class Array { };
@@ -57,9 +58,13 @@
 namespace Inspector {
 
 class BackendDispatcher {
+enum CommonErrorCode { NotUsed };
+
 JS_EXPORT_PRIVATE void sendResponse(long, WTF::RefPtr>&&, bool);
+JS_EXPORT_PRIVATE void reportProtocolError(WTF::Optional, CommonErrorCode, const WTF::String&);
 };
 void BackendDispatcher::sendResponse(long, WTF::RefPtr>&&, bool) { }
+void BackendDispatcher::reportProtocolError(WTF::Optional, CommonErrorCode, const WTF::String&) { }
 
 } // namespace Inspector
 


Modified: trunk/Source/WTF/ChangeLog (282220 => 282221)

--- trunk/Source/WTF/ChangeLog	2021-09-09 16:49:51 UTC (rev 282220)
+++ trunk/Source/WTF/ChangeLog	2021-09-09 17:02:27 UTC (rev 282221)
@@ -1,3 +1,15 @@
+2021-09-09  Patrick Angle  
+
+run-webkit-archive crashes with dyld error
+https://bugs.webkit.org/show_bug.cgi?id=228060
+
+Reviewed by Alex Christensen.
+
+Bump the maximum macOS version that `HAVE_SAFARI_FOR_WEBKIT_DEVELOPMENT_REQUIRING_EXTRA_SYMBOLS` will be enabled
+to provide compatibility with changes made in macOS 12.
+
+* wtf/PlatformHave.h:
+
 2021-09-08  Jean-Yves Avenard  
 
 Safari TP 131 audio canPlayType() reports false negatives


Modified: trunk/Source/WTF/wtf/PlatformHave.h (282220 => 282221)

--- trunk/Source/WTF/wtf/PlatformHave.h	2021-09-09 16:49:51 UTC (rev 282220)
+++ trunk/Source/WTF/wtf/PlatformHave.h	2021-09-09 17:02:27 UTC (rev 282221)
@@ -457,7 +457,7 @@
 #define HAVE_CFNETWORK_METRICS_CONNECTION_PROPERTIES 1
 #endif
 
-#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED < 110300
+#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED < 12
 #define HAVE_SAFARI_FOR_WEBKIT_DEVELOPMENT_REQUIRING_EXTRA_SYMBOLS 1
 #endif
 






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [281787] trunk/Source/WebCore

2021-08-30 Thread pangle
Title: [281787] trunk/Source/WebCore








Revision 281787
Author pan...@apple.com
Date 2021-08-30 18:41:55 -0700 (Mon, 30 Aug 2021)


Log Message
Web Inspector: Refactor `WorkerInspectorAgent` to use weak pointers for `WorkerInspectorProxy`s
https://bugs.webkit.org/show_bug.cgi?id=229632

Reviewed by Chris Dumez.

Covered by existing tests in LayoutTests/inspector/worker/*

Make `WorkerInspectorProxy` reference counted, and use `WeakPtr`s to them in `InspectorWorkerAgent`.

* inspector/agents/InspectorWorkerAgent.cpp:
(WebCore::InspectorWorkerAgent::initialized):
(WebCore::InspectorWorkerAgent::sendMessageToWorker):
(WebCore::InspectorWorkerAgent::connectToAllWorkerInspectorProxiesForPage):
(WebCore::InspectorWorkerAgent::disconnectFromAllWorkerInspectorProxies):
(WebCore::InspectorWorkerAgent::connectToWorkerInspectorProxy):
* inspector/agents/InspectorWorkerAgent.h:
* workers/WorkerInspectorProxy.cpp:
(WebCore::WorkerInspectorProxy::allWorkerInspectorProxies):
(WebCore::WorkerInspectorProxy::workerStarted):
(WebCore::WorkerInspectorProxy::workerTerminated):
* workers/WorkerInspectorProxy.h:
(WebCore::WorkerInspectorProxy::create):
* workers/WorkerMessagingProxy.cpp:
(WebCore::WorkerMessagingProxy::WorkerMessagingProxy):
* workers/WorkerMessagingProxy.h:

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/inspector/agents/InspectorWorkerAgent.cpp
trunk/Source/WebCore/inspector/agents/InspectorWorkerAgent.h
trunk/Source/WebCore/workers/WorkerInspectorProxy.cpp
trunk/Source/WebCore/workers/WorkerInspectorProxy.h
trunk/Source/WebCore/workers/WorkerMessagingProxy.cpp
trunk/Source/WebCore/workers/WorkerMessagingProxy.h




Diff

Modified: trunk/Source/WebCore/ChangeLog (281786 => 281787)

--- trunk/Source/WebCore/ChangeLog	2021-08-31 01:08:48 UTC (rev 281786)
+++ trunk/Source/WebCore/ChangeLog	2021-08-31 01:41:55 UTC (rev 281787)
@@ -1,3 +1,31 @@
+2021-08-30  Patrick Angle  
+
+Web Inspector: Refactor `WorkerInspectorAgent` to use weak pointers for `WorkerInspectorProxy`s
+https://bugs.webkit.org/show_bug.cgi?id=229632
+
+Reviewed by Chris Dumez.
+
+Covered by existing tests in LayoutTests/inspector/worker/*
+
+Make `WorkerInspectorProxy` reference counted, and use `WeakPtr`s to them in `InspectorWorkerAgent`.
+
+* inspector/agents/InspectorWorkerAgent.cpp:
+(WebCore::InspectorWorkerAgent::initialized):
+(WebCore::InspectorWorkerAgent::sendMessageToWorker):
+(WebCore::InspectorWorkerAgent::connectToAllWorkerInspectorProxiesForPage):
+(WebCore::InspectorWorkerAgent::disconnectFromAllWorkerInspectorProxies):
+(WebCore::InspectorWorkerAgent::connectToWorkerInspectorProxy):
+* inspector/agents/InspectorWorkerAgent.h:
+* workers/WorkerInspectorProxy.cpp:
+(WebCore::WorkerInspectorProxy::allWorkerInspectorProxies):
+(WebCore::WorkerInspectorProxy::workerStarted):
+(WebCore::WorkerInspectorProxy::workerTerminated):
+* workers/WorkerInspectorProxy.h:
+(WebCore::WorkerInspectorProxy::create):
+* workers/WorkerMessagingProxy.cpp:
+(WebCore::WorkerMessagingProxy::WorkerMessagingProxy):
+* workers/WorkerMessagingProxy.h:
+
 2021-08-30  Johnson Zhou  
 
 Addition of CSSUnparsedValue. (TypedOM)


Modified: trunk/Source/WebCore/inspector/agents/InspectorWorkerAgent.cpp (281786 => 281787)

--- trunk/Source/WebCore/inspector/agents/InspectorWorkerAgent.cpp	2021-08-31 01:08:48 UTC (rev 281786)
+++ trunk/Source/WebCore/inspector/agents/InspectorWorkerAgent.cpp	2021-08-31 01:41:55 UTC (rev 281787)
@@ -28,6 +28,8 @@
 
 #include "Document.h"
 #include "InstrumentingAgents.h"
+#include 
+#include 
 
 
 namespace WebCore {
@@ -82,7 +84,7 @@
 
 Protocol::ErrorStringOr InspectorWorkerAgent::initialized(const String& workerId)
 {
-WorkerInspectorProxy* proxy = m_connectedProxies.get(workerId);
+RefPtr proxy = m_connectedProxies.get(workerId).get();
 if (!proxy)
 return makeUnexpected("Missing worker for given workerId"_s);
 
@@ -96,7 +98,7 @@
 if (!m_enabled)
 return makeUnexpected("Worker domain must be enabled"_s);
 
-WorkerInspectorProxy* proxy = m_connectedProxies.get(workerId);
+RefPtr proxy = m_connectedProxies.get(workerId).get();
 if (!proxy)
 return makeUnexpected("Missing worker for given workerId"_s);
 
@@ -135,22 +137,27 @@
 {
 ASSERT(m_connectedProxies.isEmpty());
 
-for (auto* proxy : WorkerInspectorProxy::allWorkerInspectorProxies()) {
+for (Ref proxy : WorkerInspectorProxy::allWorkerInspectorProxies()) {
 if (!is(proxy->scriptExecutionContext()))
 continue;
 
-Document& document = downcast(*proxy->scriptExecutionContext());
+auto& document = downcast(*proxy->scriptExecutionContext());
 if (document.page() != _page)
 continue;
 
-connectToWorkerInspectorProxy(*proxy);
+

[webkit-changes] [281658] trunk/LayoutTests

2021-08-26 Thread pangle
Title: [281658] trunk/LayoutTests








Revision 281658
Author pan...@apple.com
Date 2021-08-26 14:59:19 -0700 (Thu, 26 Aug 2021)


Log Message
[ EWS Catalina ] http/tests/websocket/tests/hybi/inspector/send-and-recieve-debugger.html is flaky timing out / failing
https://bugs.webkit.org/show_bug.cgi?id=229459

Reviewed by Devin Rousso.

Increase timings slightly to widen the window during which we receive messages while paused in the debugger and
also delay the echo server's response further.

* http/tests/websocket/tests/hybi/inspector/echo-delayed_wsh.py:
(web_socket_transfer_data):
* http/tests/websocket/tests/hybi/inspector/send-and-recieve-debugger.html:
* platform/mac/TestExpectations:

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/http/tests/websocket/tests/hybi/inspector/echo-delayed_wsh.py
trunk/LayoutTests/http/tests/websocket/tests/hybi/inspector/send-and-recieve-debugger.html
trunk/LayoutTests/platform/mac/TestExpectations




Diff

Modified: trunk/LayoutTests/ChangeLog (281657 => 281658)

--- trunk/LayoutTests/ChangeLog	2021-08-26 21:38:59 UTC (rev 281657)
+++ trunk/LayoutTests/ChangeLog	2021-08-26 21:59:19 UTC (rev 281658)
@@ -1,3 +1,18 @@
+2021-08-26  Patrick Angle  
+
+[ EWS Catalina ] http/tests/websocket/tests/hybi/inspector/send-and-recieve-debugger.html is flaky timing out / failing
+https://bugs.webkit.org/show_bug.cgi?id=229459
+
+Reviewed by Devin Rousso.
+
+Increase timings slightly to widen the window during which we receive messages while paused in the debugger and
+also delay the echo server's response further.
+
+* http/tests/websocket/tests/hybi/inspector/echo-delayed_wsh.py:
+(web_socket_transfer_data):
+* http/tests/websocket/tests/hybi/inspector/send-and-recieve-debugger.html:
+* platform/mac/TestExpectations:
+
 2021-08-26  Robert Jenner  
 
 [ Catalina+ wk1 ] css2.1/20110323/replaced-intrinsic-003.htm is a flaky text failure


Modified: trunk/LayoutTests/http/tests/websocket/tests/hybi/inspector/echo-delayed_wsh.py (281657 => 281658)

--- trunk/LayoutTests/http/tests/websocket/tests/hybi/inspector/echo-delayed_wsh.py	2021-08-26 21:38:59 UTC (rev 281657)
+++ trunk/LayoutTests/http/tests/websocket/tests/hybi/inspector/echo-delayed_wsh.py	2021-08-26 21:59:19 UTC (rev 281658)
@@ -9,5 +9,5 @@
 def web_socket_transfer_data(request):
 # Echo message back
 message = msgutil.receive_message(request)
-sleep(0.1)
+sleep(0.25)
 msgutil.send_message(request, message)


Modified: trunk/LayoutTests/http/tests/websocket/tests/hybi/inspector/send-and-recieve-debugger.html (281657 => 281658)

--- trunk/LayoutTests/http/tests/websocket/tests/hybi/inspector/send-and-recieve-debugger.html	2021-08-26 21:38:59 UTC (rev 281657)
+++ trunk/LayoutTests/http/tests/websocket/tests/hybi/inspector/send-and-recieve-debugger.html	2021-08-26 21:59:19 UTC (rev 281658)
@@ -50,12 +50,12 @@
 InspectorTest.log("Pausing script execution with `debugger` statement.");
 InspectorTest.evaluateInPage(`debugger`);
 
-// The WebSocket echos with a 100ms delay, so wait a bit longer than that before resuming to
+// The WebSocket echos with a 250ms delay, so wait a bit longer than that before resuming to
 // ensure we receive the message while still paused.
 setTimeout(() => {
 	InspectorTest.log("Resuming script execution.")
 	WI.debuggerManager.resume().catch(reject);
-}, 200);
+}, 500);
 } else if (frameAddedCount === 2) {
 
 InspectorTest.expectEqual(frame.data, "Hello World! Привет Мир!", "Frame data should be 'Hello World! Привет Мир!'");


Modified: trunk/LayoutTests/platform/mac/TestExpectations (281657 => 281658)

--- trunk/LayoutTests/platform/mac/TestExpectations	2021-08-26 21:38:59 UTC (rev 281657)
+++ trunk/LayoutTests/platform/mac/TestExpectations	2021-08-26 21:59:19 UTC (rev 281658)
@@ -656,8 +656,6 @@
 
 webkit.org/b/89153 http/tests/websocket/tests/hybi/workers/close.html [ Pass Failure ]
 
-webkit.org/b/229459 [ Debug ] http/tests/websocket/tests/hybi/inspector/send-and-recieve-debugger.html [ Pass Failure Timeout ]
-
 # 
 webkit.org/b/131886 webgl/1.0.3/conformance/textures/texture-size-limit.html [ Pass Failure ]
 webkit.org/b/131886 fast/canvas/webgl/webgl-compressed-texture-size-limit.html [ Pass Failure Timeout ]






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [281354] trunk

2021-08-20 Thread pangle
Title: [281354] trunk








Revision 281354
Author pan...@apple.com
Date 2021-08-20 17:35:46 -0700 (Fri, 20 Aug 2021)


Log Message
Web Inspector: Style rules declared after a rule whose selector has over 8192 components are not shown correctly
https://bugs.webkit.org/show_bug.cgi?id=229218

Reviewed by Devin Rousso.

Source/WebCore:

Test: inspector/css/getMatchedStylesForNodeLargeSelectors.html

CSS rules are limited to 8192 selector components in WebCore, and when more components are present the rule is
split into multiple `StyleRule` instances. This meant Web Inspector could not reliably resolve a `StyleRule`
back to its source data, which we do to enable things like editing, as well as to make sure we show the un-split
selector in the Styles sidebar of the Elements tab. Previously, the presences of multiple `StyleRule`s for a
single source data declaration was not accounted for, which meant that rules after the split rules would show a
mix of style information from the actual rule as well as a rule some number of declarations later in the same
style sheet. This is resolved by marking `StyleRule`s that have been split and marking the last of the split
rules. This allows us to then forgo incrementing the index for looking up raw declarations until we encounter
the last rule from a split `StyleRule`.

 * css/StyleRule.cpp:
(WebCore::StyleRule::StyleRule):
(WebCore::StyleRule::createForSplitting):
(WebCore::StyleRule::splitIntoMultipleRulesWithMaximumSelectorComponentCount const):

* css/StyleRule.h:
- Added two members to track rules that are split into multiple rules due to exceeding the 8192 component limit
for selectors in order to determine later which rules are effectively duplicates of each other. We use two
members here, one to track that the rule was split from a larger authored rule (`m_isSplitRule`), and one to
mark the last rule split from a given rule (`m_isLastRuleInSplitRule`). The second member prevents situations
where we might otherwise accidentally continue iterating into a list of `StyleRule` where two large authored
rules that had to be split are present next to each other in an ordered collection of `StyleRule`.

* inspector/InspectorStyleSheet.cpp:
(WebCore::selectorsFromSource):
- Use a vector of `CSSSelector`s for specificity information since we now collect selectors from potentially
multiple `CSSStyleRule`s.

(WebCore::InspectorStyleSheet::cssStyleRulesSplitFromSameRule):
- Find any neighboring CSSStyleRules that were split from the same original rule based on the order of rules as
well as the new flags in `StyleRule`

(WebCore::InspectorStyleSheet::selectorsForCSSStyleRule):
- Find all selectors for a given CSSStyleRule, including other `CSSStyleRule`s split from the same rule in a
style sheet.

(WebCore::InspectorStyleSheet::buildObjectForSelectorList):
- Use all CSSSelectors from for the CSSStyleRule and other rules that were split from the same rule in a style
sheet.

(WebCore::InspectorStyleSheet::ruleSourceDataFor const):
(WebCore::InspectorStyleSheet::ruleIndexByStyle const):
- When looking up an index to get rule source data, make sure we don't overcount split rules.

* inspector/InspectorStyleSheet.h:

LayoutTests:

Test very large (8192 individual component) selectors to ensure surrounding styles are correctly resolved.

* inspector/css/getMatchedStylesForNodeLargeSelectors-expected.txt: Added.
* inspector/css/getMatchedStylesForNodeLargeSelectors.html: Added.

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/css/StyleRule.cpp
trunk/Source/WebCore/css/StyleRule.h
trunk/Source/WebCore/inspector/InspectorStyleSheet.cpp
trunk/Source/WebCore/inspector/InspectorStyleSheet.h


Added Paths

trunk/LayoutTests/inspector/css/getMatchedStylesForNodeLargeSelectors-expected.txt
trunk/LayoutTests/inspector/css/getMatchedStylesForNodeLargeSelectors.html




Diff

Modified: trunk/LayoutTests/ChangeLog (281353 => 281354)

--- trunk/LayoutTests/ChangeLog	2021-08-21 00:19:21 UTC (rev 281353)
+++ trunk/LayoutTests/ChangeLog	2021-08-21 00:35:46 UTC (rev 281354)
@@ -1,3 +1,15 @@
+2021-08-20  Patrick Angle  
+
+Web Inspector: Style rules declared after a rule whose selector has over 8192 components are not shown correctly
+https://bugs.webkit.org/show_bug.cgi?id=229218
+
+Reviewed by Devin Rousso.
+
+Test very large (8192 individual component) selectors to ensure surrounding styles are correctly resolved.
+
+* inspector/css/getMatchedStylesForNodeLargeSelectors-expected.txt: Added.
+* inspector/css/getMatchedStylesForNodeLargeSelectors.html: Added.
+
 2021-08-20  Eric Hutchison  
 
 Update test expectations for fast/scrolling/ios/overflow-div-scrolling.html.


Added: trunk/LayoutTests/inspector/css/getMatchedStylesForNodeLargeSelectors-expected.txt (0 => 281354)

--- trunk/LayoutTests/inspector/css/getMatchedStylesForNodeLargeSelectors-expected.txt	(rev 0)
+++ 

[webkit-changes] [281323] trunk

2021-08-20 Thread pangle
Title: [281323] trunk








Revision 281323
Author pan...@apple.com
Date 2021-08-20 10:31:33 -0700 (Fri, 20 Aug 2021)


Log Message
Release assert in ScriptController::canExecuteScripts via WebCore::WebSocket::didReceiveMessage
https://bugs.webkit.org/show_bug.cgi?id=229301

Reviewed by Ryosuke Niwa.

Source/WebCore:

Test: http/tests/websocket/tests/hybi/inspector/send-and-recieve-debugger.html

`WebCore::WebSocket::didReceiveMessage` and other functions that fire JS events may be called while the
`WebSocketChannel` is being resumed, but it is not yet safe to evaluate _javascript_ during resuming. This was
already accounted for with some events like errors and closing, but it holds true for all events. We should
delay firing these events as well.

* Modules/websockets/WebSocket.cpp:
(WebCore::WebSocket::didConnect):
(WebCore::WebSocket::didReceiveMessage):
(WebCore::WebSocket::didReceiveBinaryData):

LayoutTests:

* http/tests/websocket/tests/hybi/inspector/echo-delayed_wsh.py: Added.
(web_socket_do_extra_handshake):
(web_socket_transfer_data):
- Similar to `echo_wsh.py`, respond with the provided message when received, but delay the response by 100ms.
* http/tests/websocket/tests/hybi/inspector/send-and-recieve-debugger-expected.txt: Added.
* http/tests/websocket/tests/hybi/inspector/send-and-recieve-debugger.html: Added.

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/Modules/websockets/WebSocket.cpp


Added Paths

trunk/LayoutTests/http/tests/websocket/tests/hybi/inspector/echo-delayed_wsh.py
trunk/LayoutTests/http/tests/websocket/tests/hybi/inspector/send-and-recieve-debugger-expected.txt
trunk/LayoutTests/http/tests/websocket/tests/hybi/inspector/send-and-recieve-debugger.html




Diff

Modified: trunk/LayoutTests/ChangeLog (281322 => 281323)

--- trunk/LayoutTests/ChangeLog	2021-08-20 17:12:40 UTC (rev 281322)
+++ trunk/LayoutTests/ChangeLog	2021-08-20 17:31:33 UTC (rev 281323)
@@ -1,3 +1,17 @@
+2021-08-20  Patrick Angle  
+
+Release assert in ScriptController::canExecuteScripts via WebCore::WebSocket::didReceiveMessage
+https://bugs.webkit.org/show_bug.cgi?id=229301
+
+Reviewed by Ryosuke Niwa.
+
+* http/tests/websocket/tests/hybi/inspector/echo-delayed_wsh.py: Added.
+(web_socket_do_extra_handshake):
+(web_socket_transfer_data):
+- Similar to `echo_wsh.py`, respond with the provided message when received, but delay the response by 100ms.
+* http/tests/websocket/tests/hybi/inspector/send-and-recieve-debugger-expected.txt: Added.
+* http/tests/websocket/tests/hybi/inspector/send-and-recieve-debugger.html: Added.
+
 2021-08-20  Ayumi Kojima  
 
 [ iOS Debug ] animations/unprefixed-events.html is flaky failing.


Added: trunk/LayoutTests/http/tests/websocket/tests/hybi/inspector/echo-delayed_wsh.py (0 => 281323)

--- trunk/LayoutTests/http/tests/websocket/tests/hybi/inspector/echo-delayed_wsh.py	(rev 0)
+++ trunk/LayoutTests/http/tests/websocket/tests/hybi/inspector/echo-delayed_wsh.py	2021-08-20 17:31:33 UTC (rev 281323)
@@ -0,0 +1,13 @@
+from mod_pywebsocket import msgutil
+from time import sleep
+
+
+def web_socket_do_extra_handshake(request):
+pass  # Always accept.
+
+
+def web_socket_transfer_data(request):
+# Echo message back
+message = msgutil.receive_message(request)
+sleep(0.1)
+msgutil.send_message(request, message)


Added: trunk/LayoutTests/http/tests/websocket/tests/hybi/inspector/send-and-recieve-debugger-expected.txt (0 => 281323)

--- trunk/LayoutTests/http/tests/websocket/tests/hybi/inspector/send-and-recieve-debugger-expected.txt	(rev 0)
+++ trunk/LayoutTests/http/tests/websocket/tests/hybi/inspector/send-and-recieve-debugger-expected.txt	2021-08-20 17:31:33 UTC (rev 281323)
@@ -0,0 +1,18 @@
+Tests sending and receiving WebSocket messages.
+
+
+== Running test suite: WebSocket.SendAndReceiveDebugger
+-- Running test case: WebSocket.SendAndReceiveDebugger.DefferedReceiveWhilePaused
+PASS: Resource size should be 33 bytes.
+PASS: Frame data should be 'Hello World! Привет Мир!'
+PASS: Frame should be text.
+PASS: Frame should be outgoing.
+PASS: Message is walltime.
+Pausing script execution with `debugger` statement.
+Resuming script execution.
+PASS: Resource size should double.
+PASS: Frame data should be 'Hello World! Привет Мир!'
+PASS: Frame should be text.
+PASS: Frame should be incoming.
+PASS: Frame walltime should be greater than the previous one.
+


Added: trunk/LayoutTests/http/tests/websocket/tests/hybi/inspector/send-and-recieve-debugger.html (0 => 281323)

--- trunk/LayoutTests/http/tests/websocket/tests/hybi/inspector/send-and-recieve-debugger.html	(rev 0)
+++ trunk/LayoutTests/http/tests/websocket/tests/hybi/inspector/send-and-recieve-debugger.html	2021-08-20 17:31:33 UTC (rev 281323)
@@ -0,0 +1,96 @@
+
+
+
+
+
+// Global variable to keep it 

[webkit-changes] [280989] trunk/Source/WebInspectorUI

2021-08-12 Thread pangle
Title: [280989] trunk/Source/WebInspectorUI








Revision 280989
Author pan...@apple.com
Date 2021-08-12 15:50:45 -0700 (Thu, 12 Aug 2021)


Log Message
Web Inspector: Adding execution contexts after page load doesn't show a hidden execution selector
https://bugs.webkit.org/show_bug.cgi?id=229053

Reviewed by Devin Rousso.

Add a handler for execution contexts being added to update the display of the execution context list, as when
there is only a single context at page load the dropdown will be hidden and thus needs to be shown when an
execution context is added after page load.

* UserInterface/Views/QuickConsole.js:
(WI.QuickConsole):
(WI.QuickConsole.prototype._handleFrameExecutionContextAdded):

Modified Paths

trunk/Source/WebInspectorUI/ChangeLog
trunk/Source/WebInspectorUI/UserInterface/Views/QuickConsole.js




Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (280988 => 280989)

--- trunk/Source/WebInspectorUI/ChangeLog	2021-08-12 22:27:09 UTC (rev 280988)
+++ trunk/Source/WebInspectorUI/ChangeLog	2021-08-12 22:50:45 UTC (rev 280989)
@@ -1,3 +1,18 @@
+2021-08-12  Patrick Angle  
+
+Web Inspector: Adding execution contexts after page load doesn't show a hidden execution selector
+https://bugs.webkit.org/show_bug.cgi?id=229053
+
+Reviewed by Devin Rousso.
+
+Add a handler for execution contexts being added to update the display of the execution context list, as when
+there is only a single context at page load the dropdown will be hidden and thus needs to be shown when an
+execution context is added after page load.
+
+* UserInterface/Views/QuickConsole.js:
+(WI.QuickConsole):
+(WI.QuickConsole.prototype._handleFrameExecutionContextAdded):
+
 2021-08-12  Nikita Vasilyev  
 
 REGRESSION (r271348): Web Inspector: Table headers have vertical scrollbar


Modified: trunk/Source/WebInspectorUI/UserInterface/Views/QuickConsole.js (280988 => 280989)

--- trunk/Source/WebInspectorUI/UserInterface/Views/QuickConsole.js	2021-08-12 22:27:09 UTC (rev 280988)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/QuickConsole.js	2021-08-12 22:50:45 UTC (rev 280989)
@@ -69,6 +69,7 @@
 
 WI.Frame.addEventListener(WI.Frame.Event.PageExecutionContextChanged, this._handleFramePageExecutionContextChanged, this);
 WI.Frame.addEventListener(WI.Frame.Event.ExecutionContextsCleared, this._handleFrameExecutionContextsCleared, this);
+WI.Frame.addEventListener(WI.Frame.Event.ExecutionContextAdded, this._handleFrameExecutionContextAdded, this);
 
 WI.debuggerManager.addEventListener(WI.DebuggerManager.Event.ActiveCallFrameDidChange, this._handleDebuggerActiveCallFrameDidChange, this);
 
@@ -372,6 +373,11 @@
 this._setActiveExecutionContext(frame.pageExecutionContext);
 }
 
+_handleFrameExecutionContextAdded(event)
+{
+this._updateActiveExecutionContextDisplay();
+}
+
 _handleFrameExecutionContextsCleared(event)
 {
 let {committingProvisionalLoad, contexts} = event.data;






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [280983] trunk/Tools

2021-08-12 Thread pangle
Title: [280983] trunk/Tools








Revision 280983
Author pan...@apple.com
Date 2021-08-12 13:35:58 -0700 (Thu, 12 Aug 2021)


Log Message
Add myself (Patrick Angle) to watchlist for Inspector code changes
https://bugs.webkit.org/show_bug.cgi?id=229046

Reviewed by Darin Adler.

* Scripts/webkitpy/common/config/watchlist:

Modified Paths

trunk/Tools/ChangeLog
trunk/Tools/Scripts/webkitpy/common/config/watchlist




Diff

Modified: trunk/Tools/ChangeLog (280982 => 280983)

--- trunk/Tools/ChangeLog	2021-08-12 20:28:37 UTC (rev 280982)
+++ trunk/Tools/ChangeLog	2021-08-12 20:35:58 UTC (rev 280983)
@@ -1,3 +1,12 @@
+2021-08-12  Patrick Angle  
+
+Add myself (Patrick Angle) to watchlist for Inspector code changes
+https://bugs.webkit.org/show_bug.cgi?id=229046
+
+Reviewed by Darin Adler.
+
+* Scripts/webkitpy/common/config/watchlist:
+
 2021-08-12  Sam Weinig  
 
 Allow testing of the final UIView tree on iOS platforms


Modified: trunk/Tools/Scripts/webkitpy/common/config/watchlist (280982 => 280983)

--- trunk/Tools/Scripts/webkitpy/common/config/watchlist	2021-08-12 20:28:37 UTC (rev 280982)
+++ trunk/Tools/Scripts/webkitpy/common/config/watchlist	2021-08-12 20:35:58 UTC (rev 280983)
@@ -462,11 +462,11 @@
 "WTF": [ "benja...@webkit.org", "cmarc...@webkit.org", "cdu...@apple.com" ],
 "WebGL": [ "d...@apple.com", "kondapallykal...@gmail.com" ],
 "WebIDL": [ "esprehn+aut...@chromium.org", "cdu...@apple.com", "kondapallykal...@gmail.com" ],
-"WebInspectorBackend": [ "joep...@webkit.org", "drou...@apple.com" ],
-"WebInspectorFrontend": [ "drou...@apple.com" ],
-"WebInspectorGenerator": [ "bb...@apple.com", "joep...@webkit.org", "drou...@apple.com" ],
-"WebInspectorRecording": [ "drou...@apple.com" ],
-"WebInspectorTests": [ "drou...@apple.com" ],
+"WebInspectorBackend": [ "joep...@webkit.org", "drou...@apple.com", "pan...@apple.com" ],
+"WebInspectorFrontend": [ "drou...@apple.com", "pan...@apple.com" ],
+"WebInspectorGenerator": [ "bb...@apple.com", "joep...@webkit.org", "drou...@apple.com", "pan...@apple.com" ],
+"WebInspectorRecording": [ "drou...@apple.com", "pan...@apple.com" ],
+"WebInspectorTests": [ "drou...@apple.com", "pan...@apple.com" ],
 "JSBuiltins": [ "joep...@webkit.org" ],
 "JSBuiltinsGenerator": [ "bb...@apple.com" ],
 "WPEDependencies": [ "ape...@igalia.com", "clo...@igalia.com" ],






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [280574] trunk/Source/WebInspectorUI

2021-08-02 Thread pangle
Title: [280574] trunk/Source/WebInspectorUI








Revision 280574
Author pan...@apple.com
Date 2021-08-02 17:55:06 -0700 (Mon, 02 Aug 2021)


Log Message
Web Inspector: [AppleWin] Speculative internal build fix for copying `InspectorBackendCommands.js`
https://bugs.webkit.org/show_bug.cgi?id=228716

Reviewed by Maciej Stachowiak.

Speculative fix for AppleWin port internal build by using the correct directory for JSC headers. Also update the
logging message to reflect that the file will by copied later in the build.

* WebInspectorUI.vcxproj/WebInspectorUI.make:
* WebInspectorUI.vcxproj/build-webinspectorui.pl:

Modified Paths

trunk/Source/WebInspectorUI/ChangeLog
trunk/Source/WebInspectorUI/WebInspectorUI.vcxproj/WebInspectorUI.make
trunk/Source/WebInspectorUI/WebInspectorUI.vcxproj/build-webinspectorui.pl




Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (280573 => 280574)

--- trunk/Source/WebInspectorUI/ChangeLog	2021-08-03 00:49:37 UTC (rev 280573)
+++ trunk/Source/WebInspectorUI/ChangeLog	2021-08-03 00:55:06 UTC (rev 280574)
@@ -1,3 +1,16 @@
+2021-08-02  Patrick Angle  
+
+Web Inspector: [AppleWin] Speculative internal build fix for copying `InspectorBackendCommands.js`
+https://bugs.webkit.org/show_bug.cgi?id=228716
+
+Reviewed by Maciej Stachowiak.
+
+Speculative fix for AppleWin port internal build by using the correct directory for JSC headers. Also update the
+logging message to reflect that the file will by copied later in the build.
+
+* WebInspectorUI.vcxproj/WebInspectorUI.make:
+* WebInspectorUI.vcxproj/build-webinspectorui.pl:
+
 2021-08-02  Nikita Vasilyev  
 
 Web Inspector: Network: sorting of transfer size for failed requests is causing the ordering to change every layout


Modified: trunk/Source/WebInspectorUI/WebInspectorUI.vcxproj/WebInspectorUI.make (280573 => 280574)

--- trunk/Source/WebInspectorUI/WebInspectorUI.vcxproj/WebInspectorUI.make	2021-08-03 00:49:37 UTC (rev 280573)
+++ trunk/Source/WebInspectorUI/WebInspectorUI.vcxproj/WebInspectorUI.make	2021-08-03 00:55:06 UTC (rev 280574)
@@ -9,7 +9,7 @@
 	@xcopy /y /e "..\UserInterface\*" "%ConfigurationBuildDir%\bin%PlatformArchitecture%\WebKit.resources\WebInspectorUI"
 	if errorlevel 1 exit 1
 
-	@xcopy /y /e "..\AppleInternal\include\private\_javascript_Core\inspector\InspectorBackendCommands.js" "%ConfigurationBuildDir%\bin%PlatformArchitecture%\WebKit.resources\WebInspectorUI\Protocol"
+	@xcopy /y /e "%_javascript_CORE_PRIVATE_HEADERS_DIR%\inspector\InspectorBackendCommands.js" "%ConfigurationBuildDir%\bin%PlatformArchitecture%\WebKit.resources\WebInspectorUI\Protocol"
 	if errorlevel 1 exit 1
 
 	if exist "%CONFIGURATIONBUILDDIR%\buildfailed" del "%CONFIGURATIONBUILDDIR%\buildfailed"


Modified: trunk/Source/WebInspectorUI/WebInspectorUI.vcxproj/build-webinspectorui.pl (280573 => 280574)

--- trunk/Source/WebInspectorUI/WebInspectorUI.vcxproj/build-webinspectorui.pl	2021-08-03 00:49:37 UTC (rev 280573)
+++ trunk/Source/WebInspectorUI/WebInspectorUI.vcxproj/build-webinspectorui.pl	2021-08-03 00:55:06 UTC (rev 280574)
@@ -75,9 +75,9 @@
 my $protocolDir = File::Spec->catdir($targetResourcePath, 'Protocol');
 
 # Copy over dynamically loaded files from other frameworks, even if we aren't combining resources.
-my $jsFrom = File::Spec->catfile($ENV{'_javascript_CORE_PRIVATE_HEADERS_DIR'}, 'InspectorBackendCommands.js');
+my $jsFrom = File::Spec->catfile(File::Spec->catdir($ENV{'_javascript_CORE_PRIVATE_HEADERS_DIR'}, 'inspector'), 'InspectorBackendCommands.js');
 my $jsTo = File::Spec->catfile($protocolDir, 'InspectorBackendCommands.js');
-print "Copying Inspector bindings from $jsFrom to $jsTo\n";
+print "Inspector bindings will be copied from $jsFrom to $jsTo\n";
 
 my $copyResourcesCommand = File::Spec->catfile($XSRCROOT, 'Scripts', 'copy-user-interface-resources.pl');
 do $copyResourcesCommand;






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [280370] trunk/Source/JavaScriptCore

2021-07-27 Thread pangle
Title: [280370] trunk/Source/_javascript_Core








Revision 280370
Author pan...@apple.com
Date 2021-07-27 19:32:49 -0700 (Tue, 27 Jul 2021)


Log Message
Web Inspector: [Cocoa] "RemoteInspector XPC connection to relay failed." messages are confusing in StdErr
https://bugs.webkit.org/show_bug.cgi?id=228303

Reviewed by Darin Adler.

Remove overly verbose and confusing `WTFLogAlways` messages added in r278413, which can confuse applications
listening to stderr of a process using _javascript_Core.

* inspector/remote/cocoa/RemoteInspectorCocoa.mm:
(Inspector::RemoteInspector::xpcConnectionFailed):

Modified Paths

trunk/Source/_javascript_Core/ChangeLog
trunk/Source/_javascript_Core/inspector/remote/cocoa/RemoteInspectorCocoa.mm




Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (280369 => 280370)

--- trunk/Source/_javascript_Core/ChangeLog	2021-07-28 02:20:42 UTC (rev 280369)
+++ trunk/Source/_javascript_Core/ChangeLog	2021-07-28 02:32:49 UTC (rev 280370)
@@ -1,3 +1,16 @@
+2021-07-27  Patrick Angle  
+
+Web Inspector: [Cocoa] "RemoteInspector XPC connection to relay failed." messages are confusing in StdErr
+https://bugs.webkit.org/show_bug.cgi?id=228303
+
+Reviewed by Darin Adler.
+
+Remove overly verbose and confusing `WTFLogAlways` messages added in r278413, which can confuse applications
+listening to stderr of a process using _javascript_Core.
+
+* inspector/remote/cocoa/RemoteInspectorCocoa.mm:
+(Inspector::RemoteInspector::xpcConnectionFailed):
+
 2021-07-27  Alexey Shvayka  
 
 ProxyObject callees should be skipped during Function.prototype.caller resolution


Modified: trunk/Source/_javascript_Core/inspector/remote/cocoa/RemoteInspectorCocoa.mm (280369 => 280370)

--- trunk/Source/_javascript_Core/inspector/remote/cocoa/RemoteInspectorCocoa.mm	2021-07-28 02:20:42 UTC (rev 280369)
+++ trunk/Source/_javascript_Core/inspector/remote/cocoa/RemoteInspectorCocoa.mm	2021-07-28 02:32:49 UTC (rev 280370)
@@ -373,13 +373,10 @@
 // The XPC connection will close itself.
 m_relayConnection = nullptr;
 
-if (!m_shouldReconnectToRelayOnFailure) {
-WTFLogAlways("RemoteInspector XPC connection to relay failed.");
+if (!m_shouldReconnectToRelayOnFailure)
 return;
-}
 
 m_shouldReconnectToRelayOnFailure = false;
-WTFLogAlways("RemoteInspector XPC connection to relay failed, reconnecting in 1 second...");
 
 // Schedule setting up a new connection, since we currently are holding a lock needed to create a new connection.
 dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 1 * NSEC_PER_SEC), dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [280039] trunk/Source/WebKit

2021-07-19 Thread pangle
Title: [280039] trunk/Source/WebKit








Revision 280039
Author pan...@apple.com
Date 2021-07-19 11:14:54 -0700 (Mon, 19 Jul 2021)


Log Message
[Cocoa] Web Inspector: Service workers can't be inspected in Safari Technology Preview
https://bugs.webkit.org/show_bug.cgi?id=228001

Reviewed by Per Arne Vollan.

For inspecting targets in the WebProcess, like Service Workers, we read the `ShowDevelopMenu` default on Cocoa
platforms to determine if remote inspection should be allowed, but the sandbox broker bundle identifier used to
read that preference is different for Safari Technology Preview. We need to read the preference with the
appropriate sandbox broker bundle identifier when the host application is Safari Technology Preview.

* UIProcess/Cocoa/WebProcessProxyCocoa.mm:
(WebKit::WebProcessProxy::shouldEnableRemoteInspector):

Modified Paths

trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/UIProcess/Cocoa/WebProcessProxyCocoa.mm




Diff

Modified: trunk/Source/WebKit/ChangeLog (280038 => 280039)

--- trunk/Source/WebKit/ChangeLog	2021-07-19 18:13:54 UTC (rev 280038)
+++ trunk/Source/WebKit/ChangeLog	2021-07-19 18:14:54 UTC (rev 280039)
@@ -1,5 +1,20 @@
 2021-07-19  Patrick Angle  
 
+[Cocoa] Web Inspector: Service workers can't be inspected in Safari Technology Preview
+https://bugs.webkit.org/show_bug.cgi?id=228001
+
+Reviewed by Per Arne Vollan.
+
+For inspecting targets in the WebProcess, like Service Workers, we read the `ShowDevelopMenu` default on Cocoa
+platforms to determine if remote inspection should be allowed, but the sandbox broker bundle identifier used to
+read that preference is different for Safari Technology Preview. We need to read the preference with the
+appropriate sandbox broker bundle identifier when the host application is Safari Technology Preview.
+
+* UIProcess/Cocoa/WebProcessProxyCocoa.mm:
+(WebKit::WebProcessProxy::shouldEnableRemoteInspector):
+
+2021-07-19  Patrick Angle  
+
 [Cocoa] Web Inspector: REGRESSION(r271294) Service workers on iOS can't be inspected
 https://bugs.webkit.org/show_bug.cgi?id=227971
 


Modified: trunk/Source/WebKit/UIProcess/Cocoa/WebProcessProxyCocoa.mm (280038 => 280039)

--- trunk/Source/WebKit/UIProcess/Cocoa/WebProcessProxyCocoa.mm	2021-07-19 18:13:54 UTC (rev 280038)
+++ trunk/Source/WebKit/UIProcess/Cocoa/WebProcessProxyCocoa.mm	2021-07-19 18:14:54 UTC (rev 280039)
@@ -37,6 +37,7 @@
 #import "WKTypeRefWrapper.h"
 #import "WebProcessMessages.h"
 #import "WebProcessPool.h"
+#import 
 #import 
 #import 
 #import 
@@ -203,7 +204,10 @@
 #if PLATFORM(IOS_FAMILY)
 return CFPreferencesGetAppIntegerValue(WIRRemoteInspectorEnabledKey, WIRRemoteInspectorDomainName, nullptr);
 #else
-return CFPreferencesGetAppIntegerValue(CFSTR("ShowDevelopMenu"), CFSTR("com.apple.Safari.SandboxBroker"), nullptr);
+auto sandboxBrokerBundleIdentifier = CFSTR("com.apple.Safari.SandboxBroker");
+if (WebCore::applicationBundleIdentifier() == "com.apple.SafariTechnologyPreview"_s)
+sandboxBrokerBundleIdentifier = CFSTR("com.apple.SafariTechnologyPreview.SandboxBroker");
+return CFPreferencesGetAppIntegerValue(CFSTR("ShowDevelopMenu"), sandboxBrokerBundleIdentifier, nullptr);
 #endif
 }
 






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [280038] trunk/Source/WebKit

2021-07-19 Thread pangle
Title: [280038] trunk/Source/WebKit








Revision 280038
Author pan...@apple.com
Date 2021-07-19 11:13:54 -0700 (Mon, 19 Jul 2021)


Log Message
[Cocoa] Web Inspector: REGRESSION(r271294) Service workers on iOS can't be inspected
https://bugs.webkit.org/show_bug.cgi?id=227971

Reviewed by Per Arne Vollan.

r271294 fixed inspecting Service Workers on macOS, but in the process broke inspecting Service Workers on iOS.
For iOS, previously a flag was set to mark RemoteInspector as needing to wait for a Sandbox Extension handle,
but after r271294 this flag will no longer be cleared properly, as the handle is acquired and consumed prior to
the point in initialization that iOS was special cased to wait for the handle. To resolve this, we now set the
flag once based on whether we were able to acquire a handle, which due to the changes in r270326 will already
have been done by the time we are initializing a WebProcess.

* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess):
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::platformInitializeWebProcess):

Modified Paths

trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/WebProcess/WebProcess.cpp
trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm




Diff

Modified: trunk/Source/WebKit/ChangeLog (280037 => 280038)

--- trunk/Source/WebKit/ChangeLog	2021-07-19 18:06:51 UTC (rev 280037)
+++ trunk/Source/WebKit/ChangeLog	2021-07-19 18:13:54 UTC (rev 280038)
@@ -1,3 +1,22 @@
+2021-07-19  Patrick Angle  
+
+[Cocoa] Web Inspector: REGRESSION(r271294) Service workers on iOS can't be inspected
+https://bugs.webkit.org/show_bug.cgi?id=227971
+
+Reviewed by Per Arne Vollan.
+
+r271294 fixed inspecting Service Workers on macOS, but in the process broke inspecting Service Workers on iOS.
+For iOS, previously a flag was set to mark RemoteInspector as needing to wait for a Sandbox Extension handle,
+but after r271294 this flag will no longer be cleared properly, as the handle is acquired and consumed prior to
+the point in initialization that iOS was special cased to wait for the handle. To resolve this, we now set the
+flag once based on whether we were able to acquire a handle, which due to the changes in r270326 will already
+have been done by the time we are initializing a WebProcess.
+
+* WebProcess/WebProcess.cpp:
+(WebKit::WebProcess::initializeWebProcess):
+* WebProcess/cocoa/WebProcessCocoa.mm:
+(WebKit::WebProcess::platformInitializeWebProcess):
+
 2021-07-19  Tim Horton  
 
 Fix the build.


Modified: trunk/Source/WebKit/WebProcess/WebProcess.cpp (280037 => 280038)

--- trunk/Source/WebKit/WebProcess/WebProcess.cpp	2021-07-19 18:06:51 UTC (rev 280037)
+++ trunk/Source/WebKit/WebProcess/WebProcess.cpp	2021-07-19 18:13:54 UTC (rev 280038)
@@ -525,9 +525,6 @@
 #endif
 
 #if ENABLE(REMOTE_INSPECTOR) && PLATFORM(COCOA)
-#if PLATFORM(IOS)
-Inspector::RemoteInspector::setNeedMachSandboxExtension(true);
-#endif
 if (std::optional auditToken = parentProcessConnection()->getAuditToken()) {
 RetainPtr auditData = adoptCF(CFDataCreate(nullptr, (const UInt8*)&*auditToken, sizeof(*auditToken)));
 Inspector::RemoteInspector::singleton().setParentProcessInformation(WebCore::presentingApplicationPID(), auditData);


Modified: trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm (280037 => 280038)

--- trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm	2021-07-19 18:06:51 UTC (rev 280037)
+++ trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm	2021-07-19 18:13:54 UTC (rev 280038)
@@ -292,8 +292,7 @@
 SandboxExtension::consumePermanently(parameters.containerTemporaryDirectoryExtensionHandle);
 #endif
 #if PLATFORM(COCOA) && ENABLE(REMOTE_INSPECTOR)
-if (SandboxExtension::consumePermanently(parameters.enableRemoteWebInspectorExtensionHandle))
-Inspector::RemoteInspector::setNeedMachSandboxExtension(false);
+Inspector::RemoteInspector::setNeedMachSandboxExtension(!SandboxExtension::consumePermanently(parameters.enableRemoteWebInspectorExtensionHandle));
 #endif
 #endif
 






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [280037] trunk/Source/WebInspectorUI

2021-07-19 Thread pangle
Title: [280037] trunk/Source/WebInspectorUI








Revision 280037
Author pan...@apple.com
Date 2021-07-19 11:06:51 -0700 (Mon, 19 Jul 2021)


Log Message
Web Inspector: Elements: selecting a sibling node in the breadcrumb navigation doesn't do anything
https://bugs.webkit.org/show_bug.cgi?id=227893

Reviewed by Devin Rousso.

The `WI.HierarchicalPathComponent.Event.Clicked` event is only fired when there are no sibling path components
to select, therefor we must also listen for the `WI.HierarchicalPathComponent.Event.SiblingWasSelected` event to
be able to then reveal and highlight the correct DOM node in the tree.

* UserInterface/Views/DOMTreeContentView.js:
(WI.DOMTreeContentView.prototype.get selectionPathComponents):
(WI.DOMTreeContentView.prototype._handlePathComponentSelected):
Drive-by to match our style of `_handle*` event handler naming.

Modified Paths

trunk/Source/WebInspectorUI/ChangeLog
trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeContentView.js




Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (280036 => 280037)

--- trunk/Source/WebInspectorUI/ChangeLog	2021-07-19 18:06:33 UTC (rev 280036)
+++ trunk/Source/WebInspectorUI/ChangeLog	2021-07-19 18:06:51 UTC (rev 280037)
@@ -1,5 +1,21 @@
 2021-07-19  Patrick Angle  
 
+Web Inspector: Elements: selecting a sibling node in the breadcrumb navigation doesn't do anything
+https://bugs.webkit.org/show_bug.cgi?id=227893
+
+Reviewed by Devin Rousso.
+
+The `WI.HierarchicalPathComponent.Event.Clicked` event is only fired when there are no sibling path components
+to select, therefor we must also listen for the `WI.HierarchicalPathComponent.Event.SiblingWasSelected` event to
+be able to then reveal and highlight the correct DOM node in the tree.
+
+* UserInterface/Views/DOMTreeContentView.js:
+(WI.DOMTreeContentView.prototype.get selectionPathComponents):
+(WI.DOMTreeContentView.prototype._handlePathComponentSelected):
+Drive-by to match our style of `_handle*` event handler naming.
+
+2021-07-19  Patrick Angle  
+
 Web Inspector: Add another Protocol Version (iOS 15.0)
 https://bugs.webkit.org/show_bug.cgi?id=228079
 


Modified: trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeContentView.js (280036 => 280037)

--- trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeContentView.js	2021-07-19 18:06:33 UTC (rev 280036)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeContentView.js	2021-07-19 18:06:51 UTC (rev 280037)
@@ -181,7 +181,8 @@
 }
 
 var pathComponent = new WI.DOMTreeElementPathComponent(treeElement, treeElement.representedObject);
-pathComponent.addEventListener(WI.HierarchicalPathComponent.Event.Clicked, this._pathComponentSelected, this);
+pathComponent.addEventListener(WI.HierarchicalPathComponent.Event.Clicked, this._handlePathComponentSelected, this);
+pathComponent.addEventListener(WI.HierarchicalPathComponent.Event.SiblingWasSelected, this._handlePathComponentSelected, this);
 pathComponents.unshift(pathComponent);
 treeElement = treeElement.parent;
 }
@@ -531,7 +532,7 @@
 this.dispatchEventToListeners(WI.ContentView.Event.SelectionPathComponentsDidChange);
 }
 
-_pathComponentSelected(event)
+_handlePathComponentSelected(event)
 {
 if (!event.data.pathComponent)
 return;






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [279862] trunk/Source/WebInspectorUI

2021-07-12 Thread pangle
Title: [279862] trunk/Source/WebInspectorUI








Revision 279862
Author pan...@apple.com
Date 2021-07-12 18:57:24 -0700 (Mon, 12 Jul 2021)


Log Message
Web Inspector: REGRESSION(r279510): Elements: Computed: an (i) button is shown for computed property traces
https://bugs.webkit.org/show_bug.cgi?id=227892

Reviewed by Devin Rousso.

Property traces need to opt out of displaying the (i) button as they do for things like the colon and semicolon.

* UserInterface/Views/ComputedStyleSection.css:
(.computed-style-section .property-trace-item .property .name,):

Modified Paths

trunk/Source/WebInspectorUI/ChangeLog
trunk/Source/WebInspectorUI/UserInterface/Views/ComputedStyleSection.css




Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (279861 => 279862)

--- trunk/Source/WebInspectorUI/ChangeLog	2021-07-13 01:47:47 UTC (rev 279861)
+++ trunk/Source/WebInspectorUI/ChangeLog	2021-07-13 01:57:24 UTC (rev 279862)
@@ -1,3 +1,15 @@
+2021-07-12  Patrick Angle  
+
+Web Inspector: REGRESSION(r279510): Elements: Computed: an (i) button is shown for computed property traces
+https://bugs.webkit.org/show_bug.cgi?id=227892
+
+Reviewed by Devin Rousso.
+
+Property traces need to opt out of displaying the (i) button as they do for things like the colon and semicolon.
+
+* UserInterface/Views/ComputedStyleSection.css:
+(.computed-style-section .property-trace-item .property .name,):
+
 2021-07-12  Commit Queue  
 
 Unreviewed, reverting r279493.


Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ComputedStyleSection.css (279861 => 279862)

--- trunk/Source/WebInspectorUI/UserInterface/Views/ComputedStyleSection.css	2021-07-13 01:47:47 UTC (rev 279861)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ComputedStyleSection.css	2021-07-13 01:57:24 UTC (rev 279862)
@@ -148,9 +148,7 @@
 color: var(--text-color-secondary);
 }
 
-.computed-style-section .property-trace-item .property .name,
-.computed-style-section .property-trace-item .property .colon,
-.computed-style-section .property-trace-item .property .semicolon {
+.computed-style-section .property-trace-item .property :is(.name, .colon, .semicolon, .contextual-documentation-button) {
 display: none;
 }
 






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [279790] trunk/Source/WebInspectorUI

2021-07-09 Thread pangle
Title: [279790] trunk/Source/WebInspectorUI








Revision 279790
Author pan...@apple.com
Date 2021-07-09 10:50:31 -0700 (Fri, 09 Jul 2021)


Log Message
Web Inspector: Perform sidebar panel and navigation bar layout asynchronously during resize
https://bugs.webkit.org/show_bug.cgi?id=227716

Reviewed by Devin Rousso.

Perform layout updates to the navigation bar and selected panel asynchronously so that they can be batched
together, instead of blocking on layout for each resize (of which there will be many during a dragging resize).

* UserInterface/Views/SingleSidebar.js:
(WI.SingleSidebar.prototype._recalculateWidth):

Modified Paths

trunk/Source/WebInspectorUI/ChangeLog
trunk/Source/WebInspectorUI/UserInterface/Views/SingleSidebar.js




Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (279789 => 279790)

--- trunk/Source/WebInspectorUI/ChangeLog	2021-07-09 17:36:12 UTC (rev 279789)
+++ trunk/Source/WebInspectorUI/ChangeLog	2021-07-09 17:50:31 UTC (rev 279790)
@@ -1,3 +1,16 @@
+2021-07-09  Patrick Angle  
+
+Web Inspector: Perform sidebar panel and navigation bar layout asynchronously during resize
+https://bugs.webkit.org/show_bug.cgi?id=227716
+
+Reviewed by Devin Rousso.
+
+Perform layout updates to the navigation bar and selected panel asynchronously so that they can be batched
+together, instead of blocking on layout for each resize (of which there will be many during a dragging resize).
+
+* UserInterface/Views/SingleSidebar.js:
+(WI.SingleSidebar.prototype._recalculateWidth):
+
 2021-07-06  Patrick Angle  
 
 Web Inspector: Elements Tab Details Sidebar navigation items sometime wrap to a second line


Modified: trunk/Source/WebInspectorUI/UserInterface/Views/SingleSidebar.js (279789 => 279790)

--- trunk/Source/WebInspectorUI/UserInterface/Views/SingleSidebar.js	2021-07-09 17:36:12 UTC (rev 279789)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/SingleSidebar.js	2021-07-09 17:50:31 UTC (rev 279790)
@@ -183,10 +183,10 @@
 return;
 
 if (this._navigationBar)
-this._navigationBar.updateLayout(WI.View.LayoutReason.Resize);
+this._navigationBar.needsLayout(WI.View.LayoutReason.Resize);
 
 if (this.selectedSidebarPanel)
-this.selectedSidebarPanel.updateLayout(WI.View.LayoutReason.Resize);
+this.selectedSidebarPanel.needsLayout(WI.View.LayoutReason.Resize);
 
 this.dispatchEventToListeners(WI.Sidebar.Event.WidthDidChange, {newWidth});
 }






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [279613] trunk/Source/WebInspectorUI

2021-07-06 Thread pangle
Title: [279613] trunk/Source/WebInspectorUI








Revision 279613
Author pan...@apple.com
Date 2021-07-06 13:25:48 -0700 (Tue, 06 Jul 2021)


Log Message
Web Inspector: Elements Tab Details Sidebar navigation items sometime wrap to a second line
https://bugs.webkit.org/show_bug.cgi?id=227707

Reviewed by Devin Rousso.

When resizing a sidebar, it was possible that the cumulative widths of each navigation item could add up to just
less than the actual amount of space necessary to lay out each item in a single row, leading to wrapping items
to the next line. This resolves that issue by taking the ceiling of each item's width when calculating the
total amount of space needed to display all the items. Additionally, every time a panel is added or removed from
the sidebar, we need to recalculate the width of the sidebar to make sure the new navigation item, or the
removal thereof, is accommodated.

* UserInterface/Views/NavigationBar.js:
(WI.NavigationBar.prototype.layout.calculateVisibleItemWidth):
(WI.NavigationBar.prototype._calculateMinimumWidth):
* UserInterface/Views/SingleSidebar.js:
(WI.SingleSidebar.prototype.didInsertSidebarPanel):
(WI.SingleSidebar.prototype.didRemoveSidebarPanel):

Modified Paths

trunk/Source/WebInspectorUI/ChangeLog
trunk/Source/WebInspectorUI/UserInterface/Views/NavigationBar.js
trunk/Source/WebInspectorUI/UserInterface/Views/SingleSidebar.js




Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (279612 => 279613)

--- trunk/Source/WebInspectorUI/ChangeLog	2021-07-06 20:19:59 UTC (rev 279612)
+++ trunk/Source/WebInspectorUI/ChangeLog	2021-07-06 20:25:48 UTC (rev 279613)
@@ -1,3 +1,24 @@
+2021-07-06  Patrick Angle  
+
+Web Inspector: Elements Tab Details Sidebar navigation items sometime wrap to a second line
+https://bugs.webkit.org/show_bug.cgi?id=227707
+
+Reviewed by Devin Rousso.
+
+When resizing a sidebar, it was possible that the cumulative widths of each navigation item could add up to just
+less than the actual amount of space necessary to lay out each item in a single row, leading to wrapping items
+to the next line. This resolves that issue by taking the ceiling of each item's width when calculating the
+total amount of space needed to display all the items. Additionally, every time a panel is added or removed from
+the sidebar, we need to recalculate the width of the sidebar to make sure the new navigation item, or the
+removal thereof, is accommodated.
+
+* UserInterface/Views/NavigationBar.js:
+(WI.NavigationBar.prototype.layout.calculateVisibleItemWidth):
+(WI.NavigationBar.prototype._calculateMinimumWidth):
+* UserInterface/Views/SingleSidebar.js:
+(WI.SingleSidebar.prototype.didInsertSidebarPanel):
+(WI.SingleSidebar.prototype.didRemoveSidebarPanel):
+
 2021-07-02  Harshil Ratnu  
 
 Web Inspector: add contextual documentation for CSS properties


Modified: trunk/Source/WebInspectorUI/UserInterface/Views/NavigationBar.js (279612 => 279613)

--- trunk/Source/WebInspectorUI/UserInterface/Views/NavigationBar.js	2021-07-06 20:19:59 UTC (rev 279612)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/NavigationBar.js	2021-07-06 20:25:48 UTC (rev 279613)
@@ -223,7 +223,7 @@
 let visibleNavigationItems = this._visibleNavigationItems;
 
 function calculateVisibleItemWidth() {
-return visibleNavigationItems.reduce((total, item) => total + item.width, 0);
+return visibleNavigationItems.reduce((total, item) => total + Math.ceil(item.width), 0);
 }
 
 let totalItemWidth = calculateVisibleItemWidth();
@@ -252,7 +252,7 @@
 
 while (totalItemWidth > barWidth && visibleNavigationItems.length) {
 let navigationItem = visibleNavigationItems.shift();
-totalItemWidth -= navigationItem.width;
+totalItemWidth -= Math.ceil(navigationItem.width);
 forceItemHidden(navigationItem, true);
 }
 
@@ -414,7 +414,7 @@
 if (!wasCollapsed)
 this.element.classList.add(WI.NavigationBar.CollapsedStyleClassName);
 
-let totalItemWidth = visibleNavigationItems.reduce((total, item) => total + item.minimumWidth, 0);
+let totalItemWidth = visibleNavigationItems.reduce((total, item) => total + Math.ceil(item.minimumWidth), 0);
 
 // Remove the collapsed style class if we were not collapsed before.
 if (!wasCollapsed)


Modified: trunk/Source/WebInspectorUI/UserInterface/Views/SingleSidebar.js (279612 => 279613)

--- trunk/Source/WebInspectorUI/UserInterface/Views/SingleSidebar.js	2021-07-06 20:19:59 UTC (rev 279612)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/SingleSidebar.js	2021-07-06 20:25:48 UTC (rev 279613)
@@ -83,18 +83,24 @@
 
 didInsertSidebarPanel(sidebarPanel, index)
 {
-if (this._navigationBar) {
-

[webkit-changes] [279493] trunk/Source/WebInspectorUI

2021-07-01 Thread pangle
Title: [279493] trunk/Source/WebInspectorUI








Revision 279493
Author pan...@apple.com
Date 2021-07-01 18:36:04 -0700 (Thu, 01 Jul 2021)


Log Message
Web Inspector: [Regression: r279271] Sources: Breakpoints section in navigation sidebar disappears when Web Inspector becomes taller than 650px
https://bugs.webkit.org/show_bug.cgi?id=227597

Reviewed by Devin Rousso.

As of r279271, flex base size is no longer clamped by max-height. As a result the non-clamped element
(`resources-container`) was sized to the full height of the container, leaving no space for the other sections
to be shown. Removing the `height: 100%;` declaration resolves this by allowing the flex container to lay out
its children as needed. Because the resources container has no maximum height constraint, it still occupies the
remaining height of the container. Each container will also continue to shrink/grow at their prescribed ratio
just as they did before r279271.

* UserInterface/Views/SourcesNavigationSidebarPanel.css:
(@media (min-height: 650px) .sidebar > .panel.navigation.sources > .content > :matches(.call-stack-container, .breakpoints-container, .resources-container, .local-overrides-container)):

Modified Paths

trunk/Source/WebInspectorUI/ChangeLog
trunk/Source/WebInspectorUI/UserInterface/Views/SourcesNavigationSidebarPanel.css




Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (279492 => 279493)

--- trunk/Source/WebInspectorUI/ChangeLog	2021-07-02 01:08:44 UTC (rev 279492)
+++ trunk/Source/WebInspectorUI/ChangeLog	2021-07-02 01:36:04 UTC (rev 279493)
@@ -1,3 +1,20 @@
+2021-07-01  Patrick Angle  
+
+Web Inspector: [Regression: r279271] Sources: Breakpoints section in navigation sidebar disappears when Web Inspector becomes taller than 650px
+https://bugs.webkit.org/show_bug.cgi?id=227597
+
+Reviewed by Devin Rousso.
+
+As of r279271, flex base size is no longer clamped by max-height. As a result the non-clamped element
+(`resources-container`) was sized to the full height of the container, leaving no space for the other sections
+to be shown. Removing the `height: 100%;` declaration resolves this by allowing the flex container to lay out
+its children as needed. Because the resources container has no maximum height constraint, it still occupies the
+remaining height of the container. Each container will also continue to shrink/grow at their prescribed ratio
+just as they did before r279271.
+
+* UserInterface/Views/SourcesNavigationSidebarPanel.css:
+(@media (min-height: 650px) .sidebar > .panel.navigation.sources > .content > :matches(.call-stack-container, .breakpoints-container, .resources-container, .local-overrides-container)):
+
 2021-06-30  Patrick Angle  
 
 Web Inspector: Styles: Autocomplete should support function completions


Modified: trunk/Source/WebInspectorUI/UserInterface/Views/SourcesNavigationSidebarPanel.css (279492 => 279493)

--- trunk/Source/WebInspectorUI/UserInterface/Views/SourcesNavigationSidebarPanel.css	2021-07-02 01:08:44 UTC (rev 279492)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/SourcesNavigationSidebarPanel.css	2021-07-02 01:36:04 UTC (rev 279493)
@@ -131,7 +131,6 @@
 }
 
 .sidebar > .panel.navigation.sources > .content > :matches(.call-stack-container, .breakpoints-container, .resources-container, .local-overrides-container) {
-height: 100%;
 overflow-y: auto;
 }
 






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [279422] trunk

2021-06-30 Thread pangle
Title: [279422] trunk








Revision 279422
Author pan...@apple.com
Date 2021-06-30 11:14:17 -0700 (Wed, 30 Jun 2021)


Log Message
Web Inspector: Styles: Autocomplete should support function completions
https://bugs.webkit.org/show_bug.cgi?id=227097

Reviewed by Devin Rousso.

Source/WebInspectorUI:

Covered by new test:
- inspector/unit-tests/css-keyword-completions.html

Add support for completing autocompleting values as part of a CSS function in the Styles sidebar panel.

* UserInterface/Models/CSSKeywordCompletions.js:
(WI.CSSKeywordCompletions.forPartialPropertyName):
(WI.CSSKeywordCompletions.forPartialPropertyValue):
Tokenize the provided partial value text to correct provide completion for functions, like `env(`.

* UserInterface/Views/SpreadsheetStyleProperty.js:
(WI.SpreadsheetStyleProperty.prototype._nameCompletionDataProvider):
(WI.SpreadsheetStyleProperty.prototype._valueCompletionDataProvider):
Moved logic to `WI.CSSKeywordCompletions`.

LayoutTests:

* inspector/unit-tests/css-keyword-completions-expected.txt: Added.
* inspector/unit-tests/css-keyword-completions.html: Added.

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/Source/WebInspectorUI/ChangeLog
trunk/Source/WebInspectorUI/UserInterface/Models/CSSKeywordCompletions.js
trunk/Source/WebInspectorUI/UserInterface/Views/SpreadsheetStyleProperty.js


Added Paths

trunk/LayoutTests/inspector/unit-tests/css-keyword-completions-expected.txt
trunk/LayoutTests/inspector/unit-tests/css-keyword-completions.html




Diff

Modified: trunk/LayoutTests/ChangeLog (279421 => 279422)

--- trunk/LayoutTests/ChangeLog	2021-06-30 17:45:06 UTC (rev 279421)
+++ trunk/LayoutTests/ChangeLog	2021-06-30 18:14:17 UTC (rev 279422)
@@ -1,3 +1,13 @@
+2021-06-30  Patrick Angle  
+
+Web Inspector: Styles: Autocomplete should support function completions
+https://bugs.webkit.org/show_bug.cgi?id=227097
+
+Reviewed by Devin Rousso.
+
+* inspector/unit-tests/css-keyword-completions-expected.txt: Added.
+* inspector/unit-tests/css-keyword-completions.html: Added.
+
 2021-06-30  Eric Hutchison  
 
 [MacOS wk1] fast/shadow-dom/style-resolver-sharing.html is a flaky failure


Added: trunk/LayoutTests/inspector/unit-tests/css-keyword-completions-expected.txt (0 => 279422)

--- trunk/LayoutTests/inspector/unit-tests/css-keyword-completions-expected.txt	(rev 0)
+++ trunk/LayoutTests/inspector/unit-tests/css-keyword-completions-expected.txt	2021-06-30 18:14:17 UTC (rev 279422)
@@ -0,0 +1,53 @@
+Testing WI.CSSKeywordCompletions.
+
+
+== Running test suite: WI.CSSKeywordCompletions
+-- Running test case: WI.CSSKeywordCompletions.forPartialPropertyName.emptyTextDisallowsEmptyPrefix
+PASS: Expected exactly 0 completion results.
+PASS: All expected completions were present.
+
+-- Running test case: WI.CSSKeywordCompletions.forPartialPropertyName.emptyTextAllowsEmptyPrefix
+PASS: All expected completions were present.
+
+-- Running test case: WI.CSSKeywordCompletions.forPartialPropertyName.singleCharacterMatches
+PASS: All expected completions were present.
+
+-- Running test case: WI.CSSKeywordCompletions.forPartialPropertyName.multipleCharacterMatches
+PASS: All expected completions were present.
+
+-- Running test case: WI.CSSKeywordCompletions.forPartialPropertyValue.EmptyTop
+PASS: Expected result prefix to be ""
+PASS: All expected completions were present.
+
+-- Running test case: WI.CSSKeywordCompletions.forPartialPropertyValue.EmptyColor
+PASS: Expected result prefix to be ""
+PASS: All expected completions were present.
+
+-- Running test case: WI.CSSKeywordCompletions.forPartialPropertyValue.PartialColor
+PASS: Expected result prefix to be "papaya"
+PASS: All expected completions were present.
+
+-- Running test case: WI.CSSKeywordCompletions.forPartialPropertyValue.EmptyWordSpacing
+PASS: Expected result prefix to be ""
+PASS: All expected completions were present.
+
+-- Running test case: WI.CSSKeywordCompletions.forPartialPropertyValue.MidLineBorder
+PASS: Expected result prefix to be ""
+PASS: All expected completions were present.
+
+-- Running test case: WI.CSSKeywordCompletions.forPartialPropertyValue.EnvironmentFunctionCompletion
+PASS: Expected result prefix to be ""
+PASS: All expected completions were present.
+
+-- Running test case: WI.CSSKeywordCompletions.forPartialPropertyValue.MidLineEnvironmentFunction
+PASS: Expected result prefix to be ""
+PASS: All expected completions were present.
+
+-- Running test case: WI.CSSKeywordCompletions.forPartialPropertyValue.PartialFunctionValue
+PASS: Expected result prefix to be "au"
+PASS: All expected completions were present.
+
+-- Running test case: WI.CSSKeywordCompletions.forPartialPropertyValue.ComplexMultiValueFunction
+PASS: Expected result prefix to be ""
+PASS: All expected completions were present.
+


Added: trunk/LayoutTests/inspector/unit-tests/css-keyword-completions.html (0 => 279422)

--- 

[webkit-changes] [279294] trunk/Source/WebInspectorUI

2021-06-25 Thread pangle
Title: [279294] trunk/Source/WebInspectorUI








Revision 279294
Author pan...@apple.com
Date 2021-06-25 11:50:15 -0700 (Fri, 25 Jun 2021)


Log Message
Web Inspector: Sources: Scope Chain sidebar panel is stripping repeating whitespace from strings
https://bugs.webkit.org/show_bug.cgi?id=227234

Reviewed by Devin Rousso.

String and Regular _expression_ values in Object Trees were having `white-space: nowrap;` applied to them, which
was redundant because `white-space: pre;` was already defined for `.formatted-string` and `.formatted-regexp`,
which makes sure that the text does not wrap unless it contains a newline, and these previews have newlines
replaced with a Unicode symbol to visually represent a newline without breaking to a new line.

* UserInterface/Views/ObjectTreeView.css:
(.object-tree-property :matches(.formatted-string, .formatted-regexp)): Deleted.

Modified Paths

trunk/Source/WebInspectorUI/ChangeLog
trunk/Source/WebInspectorUI/UserInterface/Views/ObjectTreeView.css




Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (279293 => 279294)

--- trunk/Source/WebInspectorUI/ChangeLog	2021-06-25 18:46:59 UTC (rev 279293)
+++ trunk/Source/WebInspectorUI/ChangeLog	2021-06-25 18:50:15 UTC (rev 279294)
@@ -1,3 +1,18 @@
+2021-06-25  Patrick Angle  
+
+Web Inspector: Sources: Scope Chain sidebar panel is stripping repeating whitespace from strings
+https://bugs.webkit.org/show_bug.cgi?id=227234
+
+Reviewed by Devin Rousso.
+
+String and Regular _expression_ values in Object Trees were having `white-space: nowrap;` applied to them, which
+was redundant because `white-space: pre;` was already defined for `.formatted-string` and `.formatted-regexp`,
+which makes sure that the text does not wrap unless it contains a newline, and these previews have newlines
+replaced with a Unicode symbol to visually represent a newline without breaking to a new line.
+
+* UserInterface/Views/ObjectTreeView.css:
+(.object-tree-property :matches(.formatted-string, .formatted-regexp)): Deleted.
+
 2021-06-14  Patrick Angle  
 
 [REGRESSION: r276616] Uncaught Exception: TypeError: undefined is not an object (evaluating 'this._setupCodeMirror.getValue')


Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ObjectTreeView.css (279293 => 279294)

--- trunk/Source/WebInspectorUI/UserInterface/Views/ObjectTreeView.css	2021-06-25 18:46:59 UTC (rev 279293)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ObjectTreeView.css	2021-06-25 18:50:15 UTC (rev 279294)
@@ -139,7 +139,3 @@
 margin-inline-start: 2px;
 vertical-align: -4px;
 }
-
-.object-tree-property :matches(.formatted-string, .formatted-regexp) {
-white-space: nowrap;
-}






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [278853] trunk/Source/WebInspectorUI

2021-06-14 Thread pangle
Title: [278853] trunk/Source/WebInspectorUI








Revision 278853
Author pan...@apple.com
Date 2021-06-14 17:46:19 -0700 (Mon, 14 Jun 2021)


Log Message
[REGRESSION: r276616] Uncaught Exception: TypeError: undefined is not an object (evaluating 'this._setupCodeMirror.getValue')
https://bugs.webkit.org/show_bug.cgi?id=226995

Reviewed by Devin Rousso.

Audit test groups share a single setup editor for all their test cases, leaving individual test cases without
their own setup editor. In this case, we should not attempt to save the setup script for every test, and instead
allow the instance of `AuditTestGroupContentView` that does have a setup editor to save the script.

* UserInterface/Views/AuditTestContentView.js:
(WI.AuditTestContentView.prototype.saveEditedData):

Modified Paths

trunk/Source/WebInspectorUI/ChangeLog
trunk/Source/WebInspectorUI/UserInterface/Views/AuditTestContentView.js




Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (278852 => 278853)

--- trunk/Source/WebInspectorUI/ChangeLog	2021-06-14 23:40:09 UTC (rev 278852)
+++ trunk/Source/WebInspectorUI/ChangeLog	2021-06-15 00:46:19 UTC (rev 278853)
@@ -1,3 +1,17 @@
+2021-06-14  Patrick Angle  
+
+[REGRESSION: r276616] Uncaught Exception: TypeError: undefined is not an object (evaluating 'this._setupCodeMirror.getValue')
+https://bugs.webkit.org/show_bug.cgi?id=226995
+
+Reviewed by Devin Rousso.
+
+Audit test groups share a single setup editor for all their test cases, leaving individual test cases without
+their own setup editor. In this case, we should not attempt to save the setup script for every test, and instead
+allow the instance of `AuditTestGroupContentView` that does have a setup editor to save the script.
+
+* UserInterface/Views/AuditTestContentView.js:
+(WI.AuditTestContentView.prototype.saveEditedData):
+
 2021-06-11  Patrick Angle  
 
 Web Inspector: Add instrumentation to node destruction for InspectorDOMAgent


Modified: trunk/Source/WebInspectorUI/UserInterface/Views/AuditTestContentView.js (278852 => 278853)

--- trunk/Source/WebInspectorUI/UserInterface/Views/AuditTestContentView.js	2021-06-14 23:40:09 UTC (rev 278852)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/AuditTestContentView.js	2021-06-15 00:46:19 UTC (rev 278853)
@@ -317,7 +317,8 @@
 saveEditedData()
 {
 console.assert(this.representedObject.editable, this.representedObject);
-this.representedObject.setup = this._setupCodeMirror.getValue().trim();
+if (this._setupCodeMirror)
+this.representedObject.setup = this._setupCodeMirror.getValue().trim();
 }
 
 showRunningPlaceholder()






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [278848] trunk

2021-06-14 Thread pangle
Title: [278848] trunk








Revision 278848
Author pan...@apple.com
Date 2021-06-14 13:01:30 -0700 (Mon, 14 Jun 2021)


Log Message
Web Inspector: CSS variables not handled as case sensitive
https://bugs.webkit.org/show_bug.cgi?id=226875

Reviewed by Devin Rousso.

Source/WebCore:

Test: inspector/css/overridden-property.html

CSS variables support distinct declarations with only differences in cases. Previously, we naively converted all
property names to lowercase, instead of properly providing variable names in their original case.

* inspector/InspectorStyleSheet.cpp:
(WebCore::InspectorStyle::styleWithProperties const):

LayoutTests:

Add a test to make sure that CSS variable declarations that vary only in case do not override each other.

* inspector/css/overridden-property-expected.txt:
* inspector/css/overridden-property.html:

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/inspector/css/overridden-property-expected.txt
trunk/LayoutTests/inspector/css/overridden-property.html
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/inspector/InspectorStyleSheet.cpp




Diff

Modified: trunk/LayoutTests/ChangeLog (278847 => 278848)

--- trunk/LayoutTests/ChangeLog	2021-06-14 19:54:50 UTC (rev 278847)
+++ trunk/LayoutTests/ChangeLog	2021-06-14 20:01:30 UTC (rev 278848)
@@ -1,3 +1,15 @@
+2021-06-14  Patrick Angle  
+
+Web Inspector: CSS variables not handled as case sensitive
+https://bugs.webkit.org/show_bug.cgi?id=226875
+
+Reviewed by Devin Rousso.
+
+Add a test to make sure that CSS variable declarations that vary only in case do not override each other.
+
+* inspector/css/overridden-property-expected.txt:
+* inspector/css/overridden-property.html:
+
 2021-06-14  Youenn Fablet  
 
 Fix RTCDataChannelInit::decode


Modified: trunk/LayoutTests/inspector/css/overridden-property-expected.txt (278847 => 278848)

--- trunk/LayoutTests/inspector/css/overridden-property-expected.txt	2021-06-14 19:54:50 UTC (rev 278847)
+++ trunk/LayoutTests/inspector/css/overridden-property-expected.txt	2021-06-14 20:01:30 UTC (rev 278848)
@@ -27,3 +27,7 @@
 PASS: border-color is NOT overridden.
 PASS: border-top-color is NOT overridden.
 
+-- Running test case: OverriddenProperty.MixedCaseVariablesNotOverridden
+PASS: `--foo` is NOT overridden.
+PASS: `--FOO` is NOT overridden.
+


Modified: trunk/LayoutTests/inspector/css/overridden-property.html (278847 => 278848)

--- trunk/LayoutTests/inspector/css/overridden-property.html	2021-06-14 19:54:50 UTC (rev 278847)
+++ trunk/LayoutTests/inspector/css/overridden-property.html	2021-06-14 20:01:30 UTC (rev 278848)
@@ -152,6 +152,22 @@
 }
 });
 
+suite.addTestCase({
+name: "OverriddenProperty.MixedCaseVariablesNotOverridden",
+test(resolve, reject) {
+getStyleDeclaration(".mixed-case-variables-not-overridden", (style) => {
+const dontCreateIfMissing = true;
+let lowercaseVariableProperty = style.propertyForName("--foo", dontCreateIfMissing);
+InspectorTest.expectFalse(lowercaseVariableProperty.overridden, "`--foo` is NOT overridden.");
+
+let uppercaseVariableProperty = style.propertyForName("--FOO", dontCreateIfMissing);
+InspectorTest.expectFalse(uppercaseVariableProperty.overridden, "`--FOO` is NOT overridden.");
+
+resolve();
+}, reject);
+}
+});
+
 suite.runTestCasesAndFinish();
 }
 
@@ -182,6 +198,11 @@
 border-color: green;
 border-top-color: red;
 }
+
+.mixed-case-variables-not-overridden {
+--foo: green;
+--FOO: red;
+}
 
 
 
@@ -188,5 +209,6 @@
 
 
 
+
 
 


Modified: trunk/Source/WebCore/ChangeLog (278847 => 278848)

--- trunk/Source/WebCore/ChangeLog	2021-06-14 19:54:50 UTC (rev 278847)
+++ trunk/Source/WebCore/ChangeLog	2021-06-14 20:01:30 UTC (rev 278848)
@@ -1,3 +1,18 @@
+2021-06-14  Patrick Angle  
+
+Web Inspector: CSS variables not handled as case sensitive
+https://bugs.webkit.org/show_bug.cgi?id=226875
+
+Reviewed by Devin Rousso.
+
+Test: inspector/css/overridden-property.html
+
+CSS variables support distinct declarations with only differences in cases. Previously, we naively converted all
+property names to lowercase, instead of properly providing variable names in their original case.
+
+* inspector/InspectorStyleSheet.cpp:
+(WebCore::InspectorStyle::styleWithProperties const):
+
 2021-06-14  Youenn Fablet  
 
 Fix RTCDataChannelInit::decode


Modified: trunk/Source/WebCore/inspector/InspectorStyleSheet.cpp (278847 => 278848)

--- trunk/Source/WebCore/inspector/InspectorStyleSheet.cpp	2021-06-14 19:54:50 UTC (rev 278847)
+++ trunk/Source/WebCore/inspector/InspectorStyleSheet.cpp	2021-06-14 20:01:30 UTC (rev 278848)
@@ -645,7 +645,7 @@
 auto status = it->disabled ? 

[webkit-changes] [278785] trunk

2021-06-11 Thread pangle
Title: [278785] trunk








Revision 278785
Author pan...@apple.com
Date 2021-06-11 15:37:40 -0700 (Fri, 11 Jun 2021)


Log Message
Web Inspector: Add instrumentation to node destruction for InspectorDOMAgent
https://bugs.webkit.org/show_bug.cgi?id=226624

Reviewed by Devin Rousso.

Source/_javascript_Core:

Add new `DOM.willDestroyDOMNode` event to inform the frontend of DOM nodes that no longer exist, even if they
weren't in the DOM tree. This work serves as a prelude to  (Web Inspector: preserve
DOM.NodeId if a node is removed and re-added) to eventually only forget about nodes upon destruction, instead of
removal from the DOM tree.

* inspector/protocol/DOM.json:

Source/WebCore:

Test: inspector/dom/willDestroyDOMNode.html

Add instrumentation for destruction of nodes in order to cease instrumenting nodes and inform the frontend that
the node no longer exists. This work serves as a prelude to  (Web Inspector:
preserve DOM.NodeId if a node is removed and re-added) to eventually only forget about nodes upon destruction,
instead of removal from the DOM tree. Additionally, the storage of nodes is simplified down to two inverse maps,
one that maps `Node` to `NodeId`, and another that maps `NodeId` to `Node`. These are kept in sync throughout,
and both attached and detached nodes are now handled as part of these two maps of Nodes.

* dom/Node.cpp:
(WebCore::Node::~Node):
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::willDestroyDOMNodeImpl):
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::didRemoveDOMNode):
(WebCore::InspectorInstrumentation::willDestroyDOMNode):
* inspector/agents/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::didRemoveDOMNode):
* inspector/agents/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::InspectorDOMAgent):
(WebCore::InspectorDOMAgent::reset):
(WebCore::InspectorDOMAgent::bind):
(WebCore::InspectorDOMAgent::unbind):
(WebCore::InspectorDOMAgent::getDocument):
(WebCore::InspectorDOMAgent::pushChildNodesToFrontend):
(WebCore::InspectorDOMAgent::discardBindings):
(WebCore::InspectorDOMAgent::pushNodePathToFrontend):
(WebCore::InspectorDOMAgent::boundNodeId):
- Add a check that the `Node*` is a valid key (not `nullptr`) before getting its id.
(WebCore::InspectorDOMAgent::buildObjectForNode):
(WebCore::InspectorDOMAgent::buildArrayForContainerChildren):
(WebCore::InspectorDOMAgent::buildArrayForPseudoElements):
(WebCore::InspectorDOMAgent::didCommitLoad):
(WebCore::InspectorDOMAgent::didInsertDOMNode):
(WebCore::InspectorDOMAgent::didRemoveDOMNode):
(WebCore::InspectorDOMAgent::willDestroyDOMNode):
(WebCore::InspectorDOMAgent::destroyedNodesTimerFired):
- Added instrumentation point for DOM nodes being destroyed so they can be removed from the agent, and the
frontend can also be informed of their ceasing to exist.
(WebCore::InspectorDOMAgent::characterDataModified):
(WebCore::InspectorDOMAgent::didInvalidateStyleAttr):
(WebCore::InspectorDOMAgent::didPushShadowRoot):
(WebCore::InspectorDOMAgent::willPopShadowRoot):
(WebCore::InspectorDOMAgent::didChangeCustomElementState):
(WebCore::InspectorDOMAgent::pseudoElementCreated):
(WebCore::InspectorDOMAgent::pseudoElementDestroyed):
(WebCore::InspectorDOMAgent::releaseDanglingNodes): Deleted.
- Removed usage of NodeToIdMap and nested maps of nodes throughout in favor of two inverse maps for relating
`Node`s and `NodeId`s. Because there is now a single set of canonical node maps, we no longer to to pass a
NodeToIdMap throughout the agent.
* inspector/agents/InspectorDOMAgent.h:
* inspector/agents/page/PageConsoleAgent.cpp:
(WebCore::PageConsoleAgent::PageConsoleAgent):
(WebCore::PageConsoleAgent::clearMessages):
* inspector/agents/page/PageConsoleAgent.h:
* inspector/agents/page/PageDOMDebuggerAgent.cpp:
(WebCore::PageDOMDebuggerAgent::willDestroyDOMNode):
* inspector/agents/page/PageDOMDebuggerAgent.h:

Source/WebInspectorUI:

Listen for the new `DOM.willDestroyDOMNode` event in order to cleanup and remaining references to that Node.
This work serves as a prelude to  (Web Inspector: preserve DOM.NodeId if a node is
removed and re-added) to eventually only forget about nodes upon destruction, instead of removal from the DOM
tree.

* UserInterface/Controllers/DOMManager.js:
(WI.DOMManager.prototype.willDestroyDOMNode):
* UserInterface/Protocol/DOMObserver.js:
(WI.DOMObserver.prototype.willDestroyDOMNode):
* UserInterface/Views/DOMTreeUpdater.js:
(WI.DOMTreeUpdater.prototype._nodeRemoved):

LayoutTests:

* inspector/dom/willDestroyDOMNode-expected.txt: Added.
* inspector/dom/willDestroyDOMNode.html: Added.

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/Source/_javascript_Core/ChangeLog
trunk/Source/_javascript_Core/inspector/protocol/DOM.json
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/dom/Node.cpp
trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp
trunk/Source/WebCore/inspector/InspectorInstrumentation.h

[webkit-changes] [278413] trunk/Source/JavaScriptCore

2021-06-03 Thread pangle
Title: [278413] trunk/Source/_javascript_Core








Revision 278413
Author pan...@apple.com
Date 2021-06-03 12:32:22 -0700 (Thu, 03 Jun 2021)


Log Message
Web Inspector: [Cocoa] `RemoteInspector` won't connect to a new relay if it hasn't yet failed to communicate with a previously connected relay
https://bugs.webkit.org/show_bug.cgi?id=226539

Reviewed by Devin Rousso.

`RemoteInspector` communicates with a relay daemon running on the same device in order to send updates like new
or removed inspectable targets and receive changes to settings like automatic debugging. The relay daemon then
communicates with a client that connects for debugging. Only one relay daemon should ever be running at a time,
and its lifecycle is managed separately from _javascript_Core.

RemoteInspector holds a RefPtr to its connection to this relay, and only clears this pointer upon a failure to
communicate over the XPC connection or a known disconnection. However, it is possible, and in some cases likely
(for example the relay restarting from a brief client disconnection and reconnection), that we can be informed
of a newly launched relay being available while still thinking we are connected to the old relay, as we have not
yet sent a message and triggered a failure in the interim period of time.

To correct this we now send a simple message any time `setupXPCConnectionIfNeeded` is called if we have an
existing RefPtr to a relay connection in order to verify the connection is still functional. We now also retry
to connect to a relay upon failure in order to create a new connection to the current relay.

In order to prevent entering a retry loop where every subsequent retry's failure results in another retry
forever, a flag to retry connecting is set when a call to setupXPCConnectionIfNeeded is made while we already
have a RefPtr to a relay connection. On failure if we are in this special state we will retry once to connect
but subsequent failures will not automatically reattempt a connection.

* inspector/remote/RemoteInspector.h:
* inspector/remote/cocoa/RemoteInspectorCocoa.mm:
(Inspector::RemoteInspector::stopInternal):
- Clear the retry connection flag when stopping in an orderly fashion.
(Inspector::RemoteInspector::setupXPCConnectionIfNeeded):
- Set the retry connection flag and send a simple message if we already have a relay connection in order to make
sure the connection is either still valid or is torn down properly on failure.
(Inspector::RemoteInspector::xpcConnectionFailed):
- If the retry flag is set, schedule a retry and clear the retry flag.

Modified Paths

trunk/Source/_javascript_Core/ChangeLog
trunk/Source/_javascript_Core/inspector/remote/RemoteInspector.h
trunk/Source/_javascript_Core/inspector/remote/cocoa/RemoteInspectorCocoa.mm




Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (278412 => 278413)

--- trunk/Source/_javascript_Core/ChangeLog	2021-06-03 18:04:30 UTC (rev 278412)
+++ trunk/Source/_javascript_Core/ChangeLog	2021-06-03 19:32:22 UTC (rev 278413)
@@ -1,3 +1,40 @@
+2021-06-03  Patrick Angle  
+
+Web Inspector: [Cocoa] `RemoteInspector` won't connect to a new relay if it hasn't yet failed to communicate with a previously connected relay
+https://bugs.webkit.org/show_bug.cgi?id=226539
+
+Reviewed by Devin Rousso.
+
+`RemoteInspector` communicates with a relay daemon running on the same device in order to send updates like new
+or removed inspectable targets and receive changes to settings like automatic debugging. The relay daemon then
+communicates with a client that connects for debugging. Only one relay daemon should ever be running at a time,
+and its lifecycle is managed separately from _javascript_Core.
+
+RemoteInspector holds a RefPtr to its connection to this relay, and only clears this pointer upon a failure to
+communicate over the XPC connection or a known disconnection. However, it is possible, and in some cases likely
+(for example the relay restarting from a brief client disconnection and reconnection), that we can be informed
+of a newly launched relay being available while still thinking we are connected to the old relay, as we have not 
+yet sent a message and triggered a failure in the interim period of time.
+
+To correct this we now send a simple message any time `setupXPCConnectionIfNeeded` is called if we have an
+existing RefPtr to a relay connection in order to verify the connection is still functional. We now also retry
+to connect to a relay upon failure in order to create a new connection to the current relay.
+
+In order to prevent entering a retry loop where every subsequent retry's failure results in another retry
+forever, a flag to retry connecting is set when a call to setupXPCConnectionIfNeeded is made while we already
+have a RefPtr to a relay connection. On failure if we are in this special state we will 

[webkit-changes] [277518] trunk/Source/WebKit

2021-05-14 Thread pangle
Title: [277518] trunk/Source/WebKit








Revision 277518
Author pan...@apple.com
Date 2021-05-14 16:34:45 -0700 (Fri, 14 May 2021)


Log Message
Web Inspector: `_WKInspector` leaks `WebInspectorUIProxy`
https://bugs.webkit.org/show_bug.cgi?id=225815

Reviewed by Tim Horton.

Add a missing call in `_WKInspector`'s destructor to destruct the `WebInspectorUIProxy` in API object storage.

* UIProcess/API/Cocoa/_WKInspector.mm:
(-[_WKInspector dealloc]):

Modified Paths

trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/UIProcess/API/Cocoa/_WKInspector.mm




Diff

Modified: trunk/Source/WebKit/ChangeLog (277517 => 277518)

--- trunk/Source/WebKit/ChangeLog	2021-05-14 23:30:03 UTC (rev 277517)
+++ trunk/Source/WebKit/ChangeLog	2021-05-14 23:34:45 UTC (rev 277518)
@@ -1,3 +1,15 @@
+2021-05-14  Patrick Angle  
+
+Web Inspector: `_WKInspector` leaks `WebInspectorUIProxy`
+https://bugs.webkit.org/show_bug.cgi?id=225815
+
+Reviewed by Tim Horton.
+
+Add a missing call in `_WKInspector`'s destructor to destruct the `WebInspectorUIProxy` in API object storage.
+
+* UIProcess/API/Cocoa/_WKInspector.mm:
+(-[_WKInspector dealloc]):
+
 2021-05-14  Chris Dumez  
 
 Drop "get" prefix from WTF::FileSystem's getFileModificationTime() / getFileCreationTime()


Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/_WKInspector.mm (277517 => 277518)

--- trunk/Source/WebKit/UIProcess/API/Cocoa/_WKInspector.mm	2021-05-14 23:30:03 UTC (rev 277517)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/_WKInspector.mm	2021-05-14 23:34:45 UTC (rev 277518)
@@ -213,6 +213,8 @@
 {
 if (WebCoreObjCScheduleDeallocateOnMainRunLoop(_WKInspector.class, self))
 return;
+
+_inspector->~WebInspectorUIProxy();
 
 [super dealloc];
 }






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [277477] trunk/Source/JavaScriptCore

2021-05-13 Thread pangle
Title: [277477] trunk/Source/_javascript_Core








Revision 277477
Author pan...@apple.com
Date 2021-05-13 19:13:53 -0700 (Thu, 13 May 2021)


Log Message
[REGRESSION: r271876] Web Inspector: [Cocoa] Remote inspection crashes when using WEB_THREAD
https://bugs.webkit.org/show_bug.cgi?id=225794

Reviewed by Devin Rousso.

For WEB_THREAD, move `callback` in `dispatchAsyncOnTarget` to `block` scope to ensure it is available for the
lifetime of the block.

* inspector/remote/cocoa/RemoteConnectionToTargetCocoa.mm:
(Inspector::RemoteConnectionToTarget::dispatchAsyncOnTarget):

Modified Paths

trunk/Source/_javascript_Core/ChangeLog
trunk/Source/_javascript_Core/inspector/remote/cocoa/RemoteConnectionToTargetCocoa.mm




Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (277476 => 277477)

--- trunk/Source/_javascript_Core/ChangeLog	2021-05-14 02:06:04 UTC (rev 277476)
+++ trunk/Source/_javascript_Core/ChangeLog	2021-05-14 02:13:53 UTC (rev 277477)
@@ -1,3 +1,16 @@
+2021-05-13  Patrick Angle  
+
+[REGRESSION: r271876] Web Inspector: [Cocoa] Remote inspection crashes when using WEB_THREAD
+https://bugs.webkit.org/show_bug.cgi?id=225794
+
+Reviewed by Devin Rousso.
+
+For WEB_THREAD, move `callback` in `dispatchAsyncOnTarget` to `block` scope to ensure it is available for the
+lifetime of the block.
+
+* inspector/remote/cocoa/RemoteConnectionToTargetCocoa.mm:
+(Inspector::RemoteConnectionToTarget::dispatchAsyncOnTarget):
+
 2021-05-13  Geoffrey Garen  
 
 m_calleeSaveRegisters should not be a pointer to a pointer


Modified: trunk/Source/_javascript_Core/inspector/remote/cocoa/RemoteConnectionToTargetCocoa.mm (277476 => 277477)

--- trunk/Source/_javascript_Core/inspector/remote/cocoa/RemoteConnectionToTargetCocoa.mm	2021-05-14 02:06:04 UTC (rev 277476)
+++ trunk/Source/_javascript_Core/inspector/remote/cocoa/RemoteConnectionToTargetCocoa.mm	2021-05-14 02:13:53 UTC (rev 277477)
@@ -145,7 +145,10 @@
 
 #if USE(WEB_THREAD)
 if (WebCoreWebThreadIsEnabled && WebCoreWebThreadIsEnabled()) {
-WebCoreWebThreadRun(^ { callback(); });
+__block auto blockCallback(WTFMove(callback));
+WebCoreWebThreadRun(^{
+blockCallback();
+});
 return;
 }
 #endif






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [277213] trunk/Source/WebInspectorUI

2021-05-07 Thread pangle
Title: [277213] trunk/Source/WebInspectorUI








Revision 277213
Author pan...@apple.com
Date 2021-05-07 17:01:30 -0700 (Fri, 07 May 2021)


Log Message
Web Inspector: Breakpoint action add/remove buttons are not vertically aligned with action dropdown
https://bugs.webkit.org/show_bug.cgi?id=225543

Reviewed by Devin Rousso.

Change the breakpoint action add/remove button's `margin-top` to `margin-block-start`, and adjust the value to
properly vertically center the buttons with the action type menu.

* UserInterface/Views/BreakpointActionView.css:
(:matches(.breakpoint-action-append-button, .breakpoint-action-remove-button)):

Modified Paths

trunk/Source/WebInspectorUI/ChangeLog
trunk/Source/WebInspectorUI/UserInterface/Views/BreakpointActionView.css




Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (277212 => 277213)

--- trunk/Source/WebInspectorUI/ChangeLog	2021-05-07 23:59:38 UTC (rev 277212)
+++ trunk/Source/WebInspectorUI/ChangeLog	2021-05-08 00:01:30 UTC (rev 277213)
@@ -1,5 +1,18 @@
 2021-05-07  Patrick Angle  
 
+Web Inspector: Breakpoint action add/remove buttons are not vertically aligned with action dropdown
+https://bugs.webkit.org/show_bug.cgi?id=225543
+
+Reviewed by Devin Rousso.
+
+Change the breakpoint action add/remove button's `margin-top` to `margin-block-start`, and adjust the value to
+properly vertically center the buttons with the action type menu.
+
+* UserInterface/Views/BreakpointActionView.css:
+(:matches(.breakpoint-action-append-button, .breakpoint-action-remove-button)):
+
+2021-05-07  Patrick Angle  
+
 Web Inspector: Default source for new test cases is minified
 https://bugs.webkit.org/show_bug.cgi?id=225546
 


Modified: trunk/Source/WebInspectorUI/UserInterface/Views/BreakpointActionView.css (277212 => 277213)

--- trunk/Source/WebInspectorUI/UserInterface/Views/BreakpointActionView.css	2021-05-07 23:59:38 UTC (rev 277212)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/BreakpointActionView.css	2021-05-08 00:01:30 UTC (rev 277213)
@@ -39,7 +39,7 @@
 background-origin: border-box;
 width: 13px;
 height: 13px;
-margin-top: 2px;
+margin-block-start: 5px;
 margin-inline-start: 5px;
 background-color: transparent;
 border: none;






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [277212] trunk/Source/WebInspectorUI

2021-05-07 Thread pangle
Title: [277212] trunk/Source/WebInspectorUI








Revision 277212
Author pan...@apple.com
Date 2021-05-07 16:59:38 -0700 (Fri, 07 May 2021)


Log Message
Web Inspector: Default source for new test cases is minified
https://bugs.webkit.org/show_bug.cgi?id=225546

Reviewed by Devin Rousso.

Move the placeholder test code to `WI.DefaultAudits` as part of the non-minified sources so that new audit test
cases do not have their default placeholder script minified. This also allows us to remove
`WI.AuditTestCase.stringifyFunction` as it is no longer needed.

* UserInterface/Models/AuditTestCase.js:
(WI.AuditTestCase.stringifyFunction): Deleted.
* UserInterface/NonMinified/DefaultAudits.js:
(WI.DefaultAudits.newAuditPlaceholder):
* UserInterface/Views/CreateAuditPopover.js:
(WI.CreateAuditPopover.prototype.dismiss):
(WI.CreateAuditPopover.prototype.dismiss.const.placeholderTestFunction): Deleted.

Modified Paths

trunk/Source/WebInspectorUI/ChangeLog
trunk/Source/WebInspectorUI/UserInterface/Models/AuditTestCase.js
trunk/Source/WebInspectorUI/UserInterface/NonMinified/DefaultAudits.js
trunk/Source/WebInspectorUI/UserInterface/Views/CreateAuditPopover.js




Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (277211 => 277212)

--- trunk/Source/WebInspectorUI/ChangeLog	2021-05-07 23:49:48 UTC (rev 277211)
+++ trunk/Source/WebInspectorUI/ChangeLog	2021-05-07 23:59:38 UTC (rev 277212)
@@ -1,3 +1,22 @@
+2021-05-07  Patrick Angle  
+
+Web Inspector: Default source for new test cases is minified
+https://bugs.webkit.org/show_bug.cgi?id=225546
+
+Reviewed by Devin Rousso.
+
+Move the placeholder test code to `WI.DefaultAudits` as part of the non-minified sources so that new audit test
+cases do not have their default placeholder script minified. This also allows us to remove
+`WI.AuditTestCase.stringifyFunction` as it is no longer needed.
+
+* UserInterface/Models/AuditTestCase.js:
+(WI.AuditTestCase.stringifyFunction): Deleted.
+* UserInterface/NonMinified/DefaultAudits.js:
+(WI.DefaultAudits.newAuditPlaceholder):
+* UserInterface/Views/CreateAuditPopover.js:
+(WI.CreateAuditPopover.prototype.dismiss):
+(WI.CreateAuditPopover.prototype.dismiss.const.placeholderTestFunction): Deleted.
+
 2021-05-04  Devin Rousso  
 
 Web Inspector: add assertion for `WI.View` re-entrancy


Modified: trunk/Source/WebInspectorUI/UserInterface/Models/AuditTestCase.js (277211 => 277212)

--- trunk/Source/WebInspectorUI/UserInterface/Models/AuditTestCase.js	2021-05-07 23:49:48 UTC (rev 277211)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/AuditTestCase.js	2021-05-07 23:59:38 UTC (rev 277212)
@@ -77,19 +77,6 @@
 return new WI.AuditTestCase(payload.name, payload.test, options);
 }
 
-static stringifyFunction(func, indentLevel)
-{
-let string = func.toString();
-
-// Remove spaces to make the function look unindented.
-string = string.replaceAll(new RegExp(`^ {${indentLevel}}`, "gm"), "");
-
-// Replace remaining indentations with the user set indent string.
-string = string.replaceAll(/^/gm, WI.indentString());
-
-return string;
-}
-
 // Public
 
 get test()


Modified: trunk/Source/WebInspectorUI/UserInterface/NonMinified/DefaultAudits.js (277211 => 277212)

--- trunk/Source/WebInspectorUI/UserInterface/NonMinified/DefaultAudits.js	2021-05-07 23:49:48 UTC (rev 277211)
+++ trunk/Source/WebInspectorUI/UserInterface/NonMinified/DefaultAudits.js	2021-05-07 23:59:38 UTC (rev 277212)
@@ -679,3 +679,10 @@
 let domNodes = Array.from(document.querySelectorAll(`[aria-hidden]:not([aria-hidden="true"], [aria-hidden="false"])`));
 return {level: domNodes.length ? "fail" : "pass", domNodes, domAttributes: ["aria-hidden"]};
 };
+
+WI.DefaultAudits.newAuditPlaceholder = function() {
+let result = {
+level: "pass",
+};
+return result;
+};


Modified: trunk/Source/WebInspectorUI/UserInterface/Views/CreateAuditPopover.js (277211 => 277212)

--- trunk/Source/WebInspectorUI/UserInterface/Views/CreateAuditPopover.js	2021-05-07 23:49:48 UTC (rev 277211)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/CreateAuditPopover.js	2021-05-07 23:59:38 UTC (rev 277212)
@@ -86,13 +86,7 @@
 
 dismiss()
 {
-const placeholderTestFunction = function() {
-let result = {
-level: "pass",
-};
-return result;
-};
-const placeholderTestFunctionString = WI.AuditTestCase.stringifyFunction(placeholderTestFunction, 8);
+const placeholderTestFunctionString = WI.DefaultAudits.newAuditPlaceholder.toString();
 
 let type = this._typeSelectElement.value;
 let name = this._nameInputElement.value;






___
webkit-changes mailing list
webkit-changes@lists.webkit.org

[webkit-changes] [276941] trunk/Source/WebKit

2021-05-03 Thread pangle
Title: [276941] trunk/Source/WebKit








Revision 276941
Author pan...@apple.com
Date 2021-05-03 19:03:04 -0700 (Mon, 03 May 2021)


Log Message
Web Inspector: [Cocoa] Grid overlay area names aren't centered within areas.
https://bugs.webkit.org/show_bug.cgi?id=225176

Reviewed by Devin Rousso.

Grid area names were changed to be centered in their area in r275519. On iOS, the label was changed to treat the
provided point as the center, but the label was still being anchored in the top-left corner. This patch corrects
that by using the center of the area as the anchor point for the label.

* UIProcess/Inspector/ios/WKInspectorHighlightView.mm:
(-[WKInspectorHighlightView _createGridOverlayLayer:scale:]):

Modified Paths

trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/UIProcess/Inspector/ios/WKInspectorHighlightView.mm




Diff

Modified: trunk/Source/WebKit/ChangeLog (276940 => 276941)

--- trunk/Source/WebKit/ChangeLog	2021-05-04 01:12:16 UTC (rev 276940)
+++ trunk/Source/WebKit/ChangeLog	2021-05-04 02:03:04 UTC (rev 276941)
@@ -1,3 +1,17 @@
+2021-05-03  Patrick Angle  
+
+Web Inspector: [Cocoa] Grid overlay area names aren't centered within areas.
+https://bugs.webkit.org/show_bug.cgi?id=225176
+
+Reviewed by Devin Rousso.
+
+Grid area names were changed to be centered in their area in r275519. On iOS, the label was changed to treat the
+provided point as the center, but the label was still being anchored in the top-left corner. This patch corrects
+that by using the center of the area as the anchor point for the label.
+
+* UIProcess/Inspector/ios/WKInspectorHighlightView.mm:
+(-[WKInspectorHighlightView _createGridOverlayLayer:scale:]):
+
 2021-05-03  Zhenchao Li  
 
 Add macOS Safari sandbox exception for com.apple.CFNetwork preferences


Modified: trunk/Source/WebKit/UIProcess/Inspector/ios/WKInspectorHighlightView.mm (276940 => 276941)

--- trunk/Source/WebKit/UIProcess/Inspector/ios/WKInspectorHighlightView.mm	2021-05-04 01:12:16 UTC (rev 276940)
+++ trunk/Source/WebKit/UIProcess/Inspector/ios/WKInspectorHighlightView.mm	2021-05-04 02:03:04 UTC (rev 276941)
@@ -435,7 +435,7 @@
 
 - (CALayer *)_createGridOverlayLayer:(const WebCore::InspectorOverlay::Highlight::GridHighlightOverlay&)overlay scale:(double)scale
 {
-// Keep implementation roughly equivilent to `WebCore::InspectorOverlay::drawGridOverlay`.
+// Keep implementation roughly equivalent to `WebCore::InspectorOverlay::drawGridOverlay`.
 CALayer *layer = [CALayer layer];
 
 auto gridLinesPath = adoptCF(CGPathCreateMutable());
@@ -464,7 +464,7 @@
 constexpr auto translucentLabelBackgroundColor = WebCore::Color::white.colorWithAlphaByte(230);
 
 for (auto area : overlay.areas)
-[layer addSublayer:createLayoutLabelLayer(area.name, area.quad.p1(), WebCore::InspectorOverlay::LabelArrowDirection::None, WebCore::InspectorOverlay::LabelArrowEdgePosition::None, translucentLabelBackgroundColor, overlay.color, scale, area.quad.boundingBox().width())];
+[layer addSublayer:createLayoutLabelLayer(area.name, area.quad.center(), WebCore::InspectorOverlay::LabelArrowDirection::None, WebCore::InspectorOverlay::LabelArrowEdgePosition::None, translucentLabelBackgroundColor, overlay.color, scale, area.quad.boundingBox().width())];
 
 for (auto label : overlay.labels)
 [layer addSublayer:createLayoutLabelLayer(label.text, label.location, label.arrowDirection, label.arrowEdgePosition, label.backgroundColor, overlay.color, scale)];






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [276681] trunk/Source/WebInspectorUI

2021-04-27 Thread pangle
Title: [276681] trunk/Source/WebInspectorUI








Revision 276681
Author pan...@apple.com
Date 2021-04-27 17:04:53 -0700 (Tue, 27 Apr 2021)


Log Message
Web Inspector: Rename "Open in New Tab" context menu item to "Open in New Window"
https://bugs.webkit.org/show_bug.cgi?id=225125

Reviewed by BJ Burg.

Update the context menu item label, as the "Open in..." context menu item opens the target item in a new window,
not a new tab.

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Views/ContextMenuUtilities.js:
(WI.appendContextMenuItemsForURL):

Modified Paths

trunk/Source/WebInspectorUI/ChangeLog
trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js
trunk/Source/WebInspectorUI/UserInterface/Views/ContextMenuUtilities.js




Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (276680 => 276681)

--- trunk/Source/WebInspectorUI/ChangeLog	2021-04-27 23:53:42 UTC (rev 276680)
+++ trunk/Source/WebInspectorUI/ChangeLog	2021-04-28 00:04:53 UTC (rev 276681)
@@ -1,5 +1,19 @@
 2021-04-27  Patrick Angle  
 
+Web Inspector: Rename "Open in New Tab" context menu item to "Open in New Window"
+https://bugs.webkit.org/show_bug.cgi?id=225125
+
+Reviewed by BJ Burg.
+
+Update the context menu item label, as the "Open in..." context menu item opens the target item in a new window,
+not a new tab.
+
+* Localizations/en.lproj/localizedStrings.js:
+* UserInterface/Views/ContextMenuUtilities.js:
+(WI.appendContextMenuItemsForURL):
+
+2021-04-27  Patrick Angle  
+
 Web Inspector: Default Audits script are minified in release builds
 https://bugs.webkit.org/show_bug.cgi?id=225009
 


Modified: trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js (276680 => 276681)

--- trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js	2021-04-27 23:53:42 UTC (rev 276680)
+++ trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js	2021-04-28 00:04:53 UTC (rev 276681)
@@ -1021,7 +1021,8 @@
 localizedStrings["Only show resources with issues"] = "Only show resources with issues";
 localizedStrings["Only show visual actions"] = "Only show visual actions";
 localizedStrings["Open"] = "Open";
-localizedStrings["Open in New Tab"] = "Open in New Tab";
+/* Context menu item for opening the target item in a new window. */
+localizedStrings["Open in New Window @ Context Menu Item"] = "Open in New Window";
 localizedStrings["Option-click to show source"] = "Option-click to show source";
 localizedStrings["Options"] = "Options";
 /* Property value for `font-variant-numeric: ordinal`. */


Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ContextMenuUtilities.js (276680 => 276681)

--- trunk/Source/WebInspectorUI/UserInterface/Views/ContextMenuUtilities.js	2021-04-27 23:53:42 UTC (rev 276680)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ContextMenuUtilities.js	2021-04-28 00:04:53 UTC (rev 276681)
@@ -212,7 +212,7 @@
 }
 
 if (!url.startsWith("_javascript_:") && !url.startsWith("data:")) {
-contextMenu.appendItem(WI.UIString("Open in New Tab"), () => {
+contextMenu.appendItem(WI.UIString("Open in New Window", "Open in New Window @ Context Menu Item", "Context menu item for opening the target item in a new window."), () => {
 const frame = null;
 WI.openURL(url, frame, {alwaysOpenExternally: true});
 });






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [276680] trunk

2021-04-27 Thread pangle
Title: [276680] trunk








Revision 276680
Author pan...@apple.com
Date 2021-04-27 16:53:42 -0700 (Tue, 27 Apr 2021)


Log Message
Web Inspector: Default Audits script are minified in release builds
https://bugs.webkit.org/show_bug.cgi?id=225009

Reviewed by BJ Burg.

Source/WebInspectorUI:

Covered by new test:
- inspector/audit/non-minified-default-audits.html

The default audits have been moved out of `AuditManager.js` and into a special `DefaultAudits.js` in the new
`NonMinified` directory, which contains _javascript_ sources that should be included in `Main.js` and
`TestCombined.js`, but should not have whitespace stripped from their contents because the whitespace is
important to the script. For example, the source for the default audits are visible to the user, and therefore
we want to present well-formatted source in those contexts.

* Scripts/combine-resources.pl:
- Added `NonMinified` directory to list of default `inputDirectoryPattern` exceptions for combining resources.
- Added `--skip-concatenate-tag` so that we don't add tags for script we will eventually append to another script.
* Scripts/copy-user-interface-resources.pl:
- Handle `NonMinified` directory for sources that will be appended to Main.js, but should not be minified.
- Handle `NonMinified` directory for sources that will be appended to TestCombined.js.
(combineOrStripResourcesForWebKitAdditions):
- Drive-by fix for typo in combineOrStripResourcesForWebKitAdditions that caused errors to be emitted during builds.
* UserInterface/Controllers/AuditManager.js:
(WI.AuditManager.prototype._addDefaultTests):
(WI.AuditManager):
(WI.AuditManager.prototype._addDefaultTests.const.levelPass): Deleted.
(WI.AuditManager.prototype._addDefaultTests.const.levelWarn): Deleted.
(WI.AuditManager.prototype._addDefaultTests.const.levelFail): Deleted.
(WI.AuditManager.prototype._addDefaultTests.const.levelError): Deleted.
(WI.AuditManager.prototype._addDefaultTests.const.levelUnsupported): Deleted.
(WI.AuditManager.prototype._addDefaultTests.const.dataDOMNodes): Deleted.
(WI.AuditManager.prototype._addDefaultTests.const.dataDOMAttributes): Deleted.
(WI.AuditManager.prototype._addDefaultTests.const.dataErrors): Deleted.
(WI.AuditManager.prototype._addDefaultTests.const.dataCustom): Deleted.
(WI.AuditManager.prototype._addDefaultTests.const.getElementsByComputedRole): Deleted.
(WI.AuditManager.prototype._addDefaultTests.const.getActiveDescendant): Deleted.
(WI.AuditManager.prototype._addDefaultTests.const.getChildNodes): Deleted.
(WI.AuditManager.prototype._addDefaultTests.const.getComputedProperties): Deleted.
(WI.AuditManager.prototype._addDefaultTests.const.getControlledNodes): Deleted.
(WI.AuditManager.prototype._addDefaultTests.const.getFlowedNodes): Deleted.
(WI.AuditManager.prototype._addDefaultTests.const.getMouseEventNode): Deleted.
(WI.AuditManager.prototype._addDefaultTests.const.getOwnedNodes): Deleted.
(WI.AuditManager.prototype._addDefaultTests.const.getParentNode): Deleted.
(WI.AuditManager.prototype._addDefaultTests.const.getSelectedChildNodes): Deleted.
(WI.AuditManager.prototype._addDefaultTests.const.hasEventListeners): Deleted.
(WI.AuditManager.prototype._addDefaultTests.const.hasEventListenersClick): Deleted.
(WI.AuditManager.prototype._addDefaultTests.const.getResources): Deleted.
(WI.AuditManager.prototype._addDefaultTests.const.getResourceContent): Deleted.
(WI.AuditManager.prototype._addDefaultTests.const.unsupported): Deleted.
(WI.AuditManager.prototype._addDefaultTests.hasChildWithRole): Deleted.
(WI.AuditManager.prototype._addDefaultTests.const.testMenuRoleForRequiredChildren): Deleted.
(WI.AuditManager.prototype._addDefaultTests.const.testGridRoleForRequiredChildren): Deleted.
(WI.AuditManager.prototype._addDefaultTests.const.testForAriaLabelledBySpelling): Deleted.
(WI.AuditManager.prototype._addDefaultTests.const.testForMultipleBanners): Deleted.
(WI.AuditManager.prototype._addDefaultTests.const.testForLinkLabels): Deleted.
(WI.AuditManager.prototype._addDefaultTests.const.testRowGroupRoleForRequiredChildren): Deleted.
(WI.AuditManager.prototype._addDefaultTests.const.testTableRoleForRequiredChildren): Deleted.
(WI.AuditManager.prototype._addDefaultTests.const.testForMultipleLiveRegions): Deleted.
(WI.AuditManager.prototype._addDefaultTests.const.testListBoxRoleForRequiredChildren): Deleted.
(WI.AuditManager.prototype._addDefaultTests.const.testImageLabels): Deleted.
(WI.AuditManager.prototype._addDefaultTests.const.testForAriaHiddenFalse): Deleted.
(WI.AuditManager.prototype._addDefaultTests.const.testTreeRoleForRequiredChildren): Deleted.
(WI.AuditManager.prototype._addDefaultTests.const.testRadioGroupRoleForRequiredChildren): Deleted.
(WI.AuditManager.prototype._addDefaultTests.const.testFeedRoleForRequiredChildren): Deleted.
(WI.AuditManager.prototype._addDefaultTests.const.testTabListRoleForRequiredChildren): Deleted.
(WI.AuditManager.prototype._addDefaultTests.const.testButtonLabels): Deleted.

[webkit-changes] [276278] trunk/Source/WebInspectorUI

2021-04-19 Thread pangle
Title: [276278] trunk/Source/WebInspectorUI








Revision 276278
Author pan...@apple.com
Date 2021-04-19 17:18:01 -0700 (Mon, 19 Apr 2021)


Log Message
REGRESSION (r268691 && r270134): Web Inspector: Clicking on go-to arrow in Computed panel no longer works
https://bugs.webkit.org/show_bug.cgi?id=224774

Reviewed by Devin Rousso.

The Styles panel will not always be part of the same sidebar as the Computed panel as of r268691, so we should
look for the Styles panel in WI.detailsSidebar, which will report all of the panels it manages across multiple
sidebars. Additionally, as of r270134, there is no longer a private `_visible` property for
`WI.StyleDetailsPanel`, so it can not be used by `WI.SpreadsheetRulesStyleDetailsPanel`. Instead, visibility
should be determined by checking if the panel is attached and not pending layout.

* UserInterface/Views/ComputedStyleDetailsSidebarPanel.js:
(WI.ComputedStyleDetailsSidebarPanel.prototype.computedStyleDetailsPanelShowProperty):
* UserInterface/Views/SpreadsheetRulesStyleDetailsPanel.js:
(WI.SpreadsheetRulesStyleDetailsPanel.prototype.scrollToSectionAndHighlightProperty):

Modified Paths

trunk/Source/WebInspectorUI/ChangeLog
trunk/Source/WebInspectorUI/UserInterface/Views/ComputedStyleDetailsSidebarPanel.js
trunk/Source/WebInspectorUI/UserInterface/Views/SpreadsheetRulesStyleDetailsPanel.js




Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (276277 => 276278)

--- trunk/Source/WebInspectorUI/ChangeLog	2021-04-19 23:37:20 UTC (rev 276277)
+++ trunk/Source/WebInspectorUI/ChangeLog	2021-04-20 00:18:01 UTC (rev 276278)
@@ -1,3 +1,21 @@
+2021-04-19  Patrick Angle  
+
+REGRESSION (r268691 && r270134): Web Inspector: Clicking on go-to arrow in Computed panel no longer works
+https://bugs.webkit.org/show_bug.cgi?id=224774
+
+Reviewed by Devin Rousso.
+
+The Styles panel will not always be part of the same sidebar as the Computed panel as of r268691, so we should
+look for the Styles panel in WI.detailsSidebar, which will report all of the panels it manages across multiple
+sidebars. Additionally, as of r270134, there is no longer a private `_visible` property for
+`WI.StyleDetailsPanel`, so it can not be used by `WI.SpreadsheetRulesStyleDetailsPanel`. Instead, visibility
+should be determined by checking if the panel is attached and not pending layout.
+
+* UserInterface/Views/ComputedStyleDetailsSidebarPanel.js:
+(WI.ComputedStyleDetailsSidebarPanel.prototype.computedStyleDetailsPanelShowProperty):
+* UserInterface/Views/SpreadsheetRulesStyleDetailsPanel.js:
+(WI.SpreadsheetRulesStyleDetailsPanel.prototype.scrollToSectionAndHighlightProperty):
+
 2021-04-19  Devin Rousso  
 
 Web Inspector: Graphics: add support for `steps()`/`spring()` CSS timing functions


Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ComputedStyleDetailsSidebarPanel.js (276277 => 276278)

--- trunk/Source/WebInspectorUI/UserInterface/Views/ComputedStyleDetailsSidebarPanel.js	2021-04-19 23:37:20 UTC (rev 276277)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ComputedStyleDetailsSidebarPanel.js	2021-04-20 00:18:01 UTC (rev 276278)
@@ -34,12 +34,12 @@
 
 computedStyleDetailsPanelShowProperty(property)
 {
-let styleRulesPanel = this.parentSidebar.sidebarPanels.find((panel) => panel instanceof WI.RulesStyleDetailsSidebarPanel);
+let styleRulesPanel = WI.detailsSidebar.sidebarPanels.find((panel) => panel instanceof WI.RulesStyleDetailsSidebarPanel);
 console.assert(styleRulesPanel, "Styles panel is missing.");
 if (!styleRulesPanel)
 return;
 
-this.parentSidebar.selectedSidebarPanel = styleRulesPanel;
+WI.detailsSidebar.selectedSidebarPanel = styleRulesPanel;
 styleRulesPanel.panel.scrollToSectionAndHighlightProperty(property);
 }
 };


Modified: trunk/Source/WebInspectorUI/UserInterface/Views/SpreadsheetRulesStyleDetailsPanel.js (276277 => 276278)

--- trunk/Source/WebInspectorUI/UserInterface/Views/SpreadsheetRulesStyleDetailsPanel.js	2021-04-19 23:37:20 UTC (rev 276277)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/SpreadsheetRulesStyleDetailsPanel.js	2021-04-20 00:18:01 UTC (rev 276278)
@@ -68,7 +68,7 @@
 
 scrollToSectionAndHighlightProperty(property)
 {
-if (!this._visible) {
+if (!this.isAttached || this.layoutPending) {
 this._propertyToSelectAndHighlight = property;
 return;
 }






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [276274] trunk/Source/WebCore

2021-04-19 Thread pangle
Title: [276274] trunk/Source/WebCore








Revision 276274
Author pan...@apple.com
Date 2021-04-19 14:18:00 -0700 (Mon, 19 Apr 2021)


Log Message
Web Inspector: Grid overlay column line label placement copy/paste error
https://bugs.webkit.org/show_bug.cgi?id=224777

Reviewed by Devin Rousso.

In grid overlays, a typo meant for all column line labels after the initial line, only the start of the line was
used for placement, where it is more accurate to use the start and end points to match the behavior of the first
line. This had no visual impact because subsequent lines do not currently have their labels adjusted further into
the grid, only flipped into the grid but still referencing the same point. This patch corrects the value of
`gapLabelLine` to always be a line on which the label can be placed, instead of a single point.

* inspector/InspectorOverlay.cpp:
(WebCore::InspectorOverlay::buildGridOverlay):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/inspector/InspectorOverlay.cpp




Diff

Modified: trunk/Source/WebCore/ChangeLog (276273 => 276274)

--- trunk/Source/WebCore/ChangeLog	2021-04-19 21:10:23 UTC (rev 276273)
+++ trunk/Source/WebCore/ChangeLog	2021-04-19 21:18:00 UTC (rev 276274)
@@ -1,3 +1,19 @@
+2021-04-19  Patrick Angle  
+
+Web Inspector: Grid overlay column line label placement copy/paste error
+https://bugs.webkit.org/show_bug.cgi?id=224777
+
+Reviewed by Devin Rousso.
+
+In grid overlays, a typo meant for all column line labels after the initial line, only the start of the line was
+used for placement, where it is more accurate to use the start and end points to match the behavior of the first
+line. This had no visual impact because subsequent lines do not currently have their labels adjusted further into
+the grid, only flipped into the grid but still referencing the same point. This patch corrects the value of
+`gapLabelLine` to always be a line on which the label can be placed, instead of a single point.
+
+* inspector/InspectorOverlay.cpp:
+(WebCore::InspectorOverlay::buildGridOverlay):
+
 2021-04-19  Zalan Bujtas  
 
 [LFC][IFC] LineCandidate.inlineContent should be ignored when reverting


Modified: trunk/Source/WebCore/inspector/InspectorOverlay.cpp (276273 => 276274)

--- trunk/Source/WebCore/inspector/InspectorOverlay.cpp	2021-04-19 21:10:23 UTC (rev 276273)
+++ trunk/Source/WebCore/inspector/InspectorOverlay.cpp	2021-04-19 21:18:00 UTC (rev 276274)
@@ -1768,7 +1768,7 @@
 gridHighlightOverlay.gaps.append({ previousColumnEndLine.start(), columnStartLine.start(), columnStartLine.end(), previousColumnEndLine.end() });
 FloatLine lineBetweenColumnTops = { columnStartLine.start(), previousColumnEndLine.start() };
 FloatLine lineBetweenColumnBottoms = { columnStartLine.end(), previousColumnEndLine.end() };
-gapLabelLine = { lineBetweenColumnTops.pointAtRelativeDistance(0.5), lineBetweenColumnTops.pointAtRelativeDistance(0.5) };
+gapLabelLine = { lineBetweenColumnTops.pointAtRelativeDistance(0.5), lineBetweenColumnBottoms.pointAtRelativeDistance(0.5) };
 }
 
 if (i < columnWidths.size() && i < columnPositions.size()) {






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [275560] trunk/Source

2021-04-06 Thread pangle
Title: [275560] trunk/Source








Revision 275560
Author pan...@apple.com
Date 2021-04-06 15:13:40 -0700 (Tue, 06 Apr 2021)


Log Message
Web Inspector: Grid overlay label style cleanup
https://bugs.webkit.org/show_bug.cgi?id=224240

Reviewed by BJ Burg.

Source/WebCore:

Clean up grid overlay label styling by:
- Make all labels use a translucent background. This patch chooses a middle ground between the existing
translucent labels that matched the color of the rulers, and the solid white background used by line
numbers/names for maximum legibility.
- Bumping the label padding by 1px to improve legibility.
- Bumping the label arrow size by 2px to make it easier to understand where a label is pointing, particularly
for labels where the edge position is not `Middle`.

* inspector/InspectorOverlay.cpp:
(WebCore::InspectorOverlay::drawGridOverlay):
(WebCore::InspectorOverlay::buildGridOverlay):

Source/WebKit:

Mirror changes to constants from `WebCore::InspectorOverlay`.

* UIProcess/Inspector/ios/WKInspectorHighlightView.mm:
(createLayoutLabelLayer):
(-[WKInspectorHighlightView _createGridOverlayLayer:scale:]):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/inspector/InspectorOverlay.cpp
trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/UIProcess/Inspector/ios/WKInspectorHighlightView.mm




Diff

Modified: trunk/Source/WebCore/ChangeLog (275559 => 275560)

--- trunk/Source/WebCore/ChangeLog	2021-04-06 22:09:25 UTC (rev 275559)
+++ trunk/Source/WebCore/ChangeLog	2021-04-06 22:13:40 UTC (rev 275560)
@@ -1,5 +1,24 @@
 2021-04-06  Patrick Angle  
 
+Web Inspector: Grid overlay label style cleanup
+https://bugs.webkit.org/show_bug.cgi?id=224240
+
+Reviewed by BJ Burg.
+
+Clean up grid overlay label styling by:
+- Make all labels use a translucent background. This patch chooses a middle ground between the existing
+translucent labels that matched the color of the rulers, and the solid white background used by line
+numbers/names for maximum legibility.
+- Bumping the label padding by 1px to improve legibility.
+- Bumping the label arrow size by 2px to make it easier to understand where a label is pointing, particularly
+for labels where the edge position is not `Middle`.
+
+* inspector/InspectorOverlay.cpp:
+(WebCore::InspectorOverlay::drawGridOverlay):
+(WebCore::InspectorOverlay::buildGridOverlay):
+
+2021-04-06  Patrick Angle  
+
 Web Inspector: Grid overlay track size labels should show implicit `auto` value and no computed size
 https://bugs.webkit.org/show_bug.cgi?id=224199
 


Modified: trunk/Source/WebCore/inspector/InspectorOverlay.cpp (275559 => 275560)

--- trunk/Source/WebCore/inspector/InspectorOverlay.cpp	2021-04-06 22:09:25 UTC (rev 275559)
+++ trunk/Source/WebCore/inspector/InspectorOverlay.cpp	2021-04-06 22:13:40 UTC (rev 275560)
@@ -85,8 +85,8 @@
 static constexpr float rulerSubStepIncrement = 5;
 static constexpr float rulerSubStepLength = 5;
 
-static constexpr float layoutLabelPadding = 3;
-static constexpr float layoutLabelArrowSize = 4;
+static constexpr float layoutLabelPadding = 4;
+static constexpr float layoutLabelArrowSize = 6;
 
 static constexpr UChar bullet = 0x2022;
 static constexpr UChar ellipsis = 0x2026;
@@ -1466,7 +1466,7 @@
 
 void InspectorOverlay::drawGridOverlay(GraphicsContext& context, const InspectorOverlay::Highlight::GridHighlightOverlay& gridOverlay)
 {
-constexpr auto translucentLabelBackgroundColor = Color::white.colorWithAlphaByte(153);
+constexpr auto translucentLabelBackgroundColor = Color::white.colorWithAlphaByte(230);
 
 GraphicsContextStateSaver saver(context);
 context.setStrokeThickness(1);
@@ -1623,7 +1623,7 @@
 return { };
 }
 
-constexpr auto translucentLabelBackgroundColor = Color::white.colorWithAlphaByte(153);
+constexpr auto translucentLabelBackgroundColor = Color::white.colorWithAlphaByte(230);
 
 FrameView* pageView = m_page.mainFrame().view();
 if (!pageView)
@@ -1828,7 +1828,7 @@
 gapLabelPosition = gapLabelLine.pointAtAbsoluteDistance(expectedLabelSize.height());
 }
 
-gridHighlightOverlay.labels.append(buildLabel(text, gapLabelPosition, Color::white, arrowDirection, arrowEdgePosition));
+gridHighlightOverlay.labels.append(buildLabel(text, gapLabelPosition, translucentLabelBackgroundColor, arrowDirection, arrowEdgePosition));
 }
 }
 
@@ -1901,7 +1901,7 @@
 if (gapLabelPosition.x() - expectedLabelSize.width() + scrollPosition.x() - viewportBounds.x() < 0)
 arrowDirection = correctedArrowDirection(LabelArrowDirection::Left, GridTrackSizingDirection::ForRows);
 
-gridHighlightOverlay.labels.append(buildLabel(text, gapLabelPosition, Color::white, arrowDirection, arrowEdgePosition));
+gridHighlightOverlay.labels.append(buildLabel(text, 

  1   2   >