Title: [290047] trunk/Source/WebCore
- Revision
- 290047
- Author
- [email protected]
- 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
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 <[email protected]>
+
+ 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 <[email protected]>
[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<Inspector::DOMFrontendDispatcher> m_frontendDispatcher;
RefPtr<Inspector::DOMBackendDispatcher> m_backendDispatcher;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes