Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 55ede1c42fd15bcd9b846e5d0282bd73ae6cc150
      
https://github.com/WebKit/WebKit/commit/55ede1c42fd15bcd9b846e5d0282bd73ae6cc150
  Author: Qianlang Chen <[email protected]>
  Date:   2026-06-23 (Tue, 23 Jun 2026)

  Changed paths:
    A 
LayoutTests/http/tests/site-isolation/inspector/css/css-node-commands-frame-target-expected.txt
    A 
LayoutTests/http/tests/site-isolation/inspector/css/css-node-commands-frame-target.html
    M 
LayoutTests/http/tests/site-isolation/inspector/css/resources/frame-with-stylesheet.html
    M Source/JavaScriptCore/inspector/protocol/CSS.json
    M Source/WebCore/Scripts/generate-unified-sources.sh
    M Source/WebCore/Sources.txt
    M Source/WebCore/UnifiedSources-output.xcfilelist
    M Source/WebCore/WebCore.xcodeproj/project.pbxproj
    M Source/WebCore/inspector/InspectorInstrumentation.cpp
    M Source/WebCore/inspector/agents/frame/FrameCSSAgent.cpp
    M Source/WebCore/inspector/agents/frame/FrameCSSAgent.h

  Log Message:
  -----------
  [Site Isolation] Web Inspector: Implement nodeId-dependent CSS commands for 
frame targets
https://bugs.webkit.org/show_bug.cgi?id=314424

Reviewed by BJ Burg.

Implement getComputedStyleForNode, getFontDataForNode,
getInlineStylesForNode, getMatchedStylesForNode, and forcePseudoState in
FrameCSSAgent. These commands resolve DOM nodeIds through FrameDOMAgent
and compute CSS information using the frame's local StyleResolver. No
cross-process communication is needed since styles are computed locally
within the frame's WebContent process.

The helper methods (buildObjectForRule, buildArrayForMatchedRuleList,
etc.) are intentionally duplicated from InspectorCSSAgent rather than
shared, following the same standalone-agent pattern as FrameDOMAgent.
This keeps the two agents fully decoupled, as InspectorCSSAgent will
eventually be silenced under site isolation when the frontend switches
to frame targets.

Test: 
http/tests/site-isolation/inspector/css/css-node-commands-frame-target.html

* Source/WebCore/Scripts/generate-unified-sources.sh:
* Source/WebCore/Sources.txt:
* Source/WebCore/UnifiedSources-output.xcfilelist:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
These changes were needed in place of adding `#include 
"StyleComputedStyle+GettersInlines.h"`
in FrameCSSAgent. Adding the #include runs into the style bot error:
  Source/WebCore/inspector/agents/frame/FrameCSSAgent.cpp:63: error:
    [build/include/computed-style-inlines] StyleComputedStyle+GettersInlines.h 
adds 6
    seconds of compile time per translation unit, and should only be used in 
core rendering
    engine code. Consider an out of line helper function instead.

* 
LayoutTests/http/tests/site-isolation/inspector/css/css-node-commands-frame-target-expected.txt:
 Added.
* 
LayoutTests/http/tests/site-isolation/inspector/css/css-node-commands-frame-target.html:
 Added.
* 
LayoutTests/http/tests/site-isolation/inspector/css/resources/frame-with-stylesheet.html:
* Source/JavaScriptCore/inspector/protocol/CSS.json:
* Source/WebCore/inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::forcePseudoStateImpl):
* Source/WebCore/inspector/agents/frame/FrameCSSAgent.cpp:
(WebCore::protocolValueForPseudoElementType):
(WebCore::FrameCSSAgent::getComputedStyleForNode):
(WebCore::FrameCSSAgent::getFontDataForNode):
(WebCore::FrameCSSAgent::getInlineStylesForNode):
(WebCore::FrameCSSAgent::getMatchedStylesForNode):
(WebCore::FrameCSSAgent::forcePseudoState):
(WebCore::FrameCSSAgent::reset):
(WebCore::FrameCSSAgent::elementForId):
(WebCore::FrameCSSAgent::asInspectorStyleSheet):
(WebCore::FrameCSSAgent::buildObjectForAttributesStyle):
(WebCore::FrameCSSAgent::buildObjectForRule):
(WebCore::FrameCSSAgent::buildArrayForMatchedRuleList):
* Source/WebCore/inspector/agents/frame/FrameCSSAgent.h:

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to