Branch: refs/heads/webkitglib/2.46
  Home:   https://github.com/WebKit/WebKit
  Commit: 59f00aaa2f96708e668da0e2c47449a49558aab6
      
https://github.com/WebKit/WebKit/commit/59f00aaa2f96708e668da0e2c47449a49558aab6
  Author: Qianlang Chen <[email protected]>
  Date:   2024-09-25 (Wed, 25 Sep 2024)

  Changed paths:
    A LayoutTests/inspector/css/setStyleText-expected.txt
    A LayoutTests/inspector/css/setStyleText.html
    M Source/WebCore/inspector/InspectorStyleSheet.cpp
    M Source/WebCore/inspector/InspectorStyleSheet.h
    M Source/WebCore/inspector/agents/InspectorCSSAgent.cpp

  Log Message:
  -----------
  Cherry-pick 283950@main (227d5b5816c0). 
https://bugs.webkit.org/show_bug.cgi?id=271403

    Web Inspector: Glitches when trying to edit a style from a style sheet that 
has an @import statement
    rdar://125185110
    https://bugs.webkit.org/show_bug.cgi?id=271403

    Reviewed by BJ Burg.

    This commit optimizes the handling of CSS.setStyleText by using CSSOM
    to update the style declaration text directly, to avoid re-parsing the
    entire style sheet.

    The observed glitch is a combination of two bugs, both due to having to
    re-parse for any style edits:

       1. In the backend, when a style sheet with @import statements is
          re-parsed, it (not just the @import-ed ones) may get removed and
          re-added, causing the CSS agent to mistakenly send
          StyleSheetRemoved and StyleSheetAdded events for that parent
          style sheet. (https://webkit.org/b/279773)

       2. Due to @import-ed style sheets receiving new IDs as a result of
          re-parsing, the frontend thinks any edit to the parent style sheet
          is a "significant change." (Source: 
https://github.com/WebKit/WebKit/blob/24b5b087d18d4baa487dd73905c46589fa353da3/Source/WebInspectorUI/UserInterface/Models/DOMNodeStyles.js#L267)
          Handling a significant change triggers a re-render of the entire
          styles panel.

    Adjacent to this glitch, there's another notable consequence involving
    re-parsing:

       3. Re-parsing an @import-ed style sheet uses its original text from
          its source, meaning editing the parent style sheet will suddenly
          revert all edits made to any @import-ed style sheets.

    By avoiding re-parsing for style declaration edits, we fix the immediate
    glitch in the simplest fashion and move towards a more efficient
    approach to handle editing. This commit is a step in the direction of
    eliminating re-parsing for all style editing functions in the inspector:
       1. Editing the style declaration text is addressed by this PR.
       2. Editing the header of a style rule is already done through CSSOM: 
https://github.com/WebKit/WebKit/blob/6277bccb19de5ebd68797f369f8ff24fc4417f2e/Source/WebCore/inspector/InspectorStyleSheet.cpp#L1116-L1119.
       3. Editing the header of a non-style rule isn't directly supported by
          CSSOM but can be achieved equivalently by removing and
          re-inserting the updated rule using CSSOM.
       4. Adding and 5. removing rules can be optimized to use CSSOM in a
          similar way to this patch.

    (Functions 3, 4, and 5 may still malfunction with @import rules after
    this patch due to https://webkit.org/b/279773 as they're still done by
    re-parsing.)

    * Source/WebCore/inspector/InspectorStyleSheet.h:
    * Source/WebCore/inspector/InspectorStyleSheet.cpp:
    (WebCore::computeCanonicalRuleText):
    (WebCore::InspectorStyleSheet::setRuleStyleText):
       - Still canonicalize the rule body text to enable showing it in the
         Sources tab, but don't re-parse the whole style sheet just to apply
         the styles. Use CSSOM's support for that.

    (WebCore::InspectorStyleSheetForInlineStyle::setRuleStyleText):
       - Adapt to the signature change of setRuleStyleText.

    (WebCore::InspectorStyleSheet::styleSheetTextWithChangedStyle): Deleted.
       - Unused.

    * Source/WebCore/inspector/agents/InspectorCSSAgent.cpp:
       - Add field to record the old rule body text to enable faithful
         undoing.

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

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

Canonical link: https://commits.webkit.org/282416.136@webkitglib/2.46


  Commit: 5ec13d6e7ae361bdbeb280f82bc90f148e878573
      
https://github.com/WebKit/WebKit/commit/5ec13d6e7ae361bdbeb280f82bc90f148e878573
  Author: Alex Christensen <[email protected]>
  Date:   2024-09-25 (Wed, 25 Sep 2024)

  Changed paths:
    M Source/WebKit/WebProcess/Storage/WebSWClientConnection.cpp

  Log Message:
  -----------
  Cherry-pick 283969@main (8ff9aac9dafb). 
https://bugs.webkit.org/show_bug.cgi?id=280005

    Fix assertion in WebSWClientConnection::matchRegistration after network 
process crash
    https://bugs.webkit.org/show_bug.cgi?id=280005
    rdar://136310625

    Reviewed by Youenn Fablet.

    This fixes an assertion I saw on a bot with this stack trace:

    ASSERTION FAILED: Completion handler should always be called
    !m_function
    .../WebKitBuild/Debug/usr/local/include/wtf/CompletionHandler.h(66) : 
WTF::CompletionHandler<void 
(std::optional<WebCore::ServiceWorkerRegistrationData> 
&&)>::~CompletionHandler()
    1   WTF::CompletionHandler<void 
(std::__1::optional<WebCore::ServiceWorkerRegistrationData>&&)>::~CompletionHandler()
    2   WTF::CompletionHandler<void 
(std::__1::optional<WebCore::ServiceWorkerRegistrationData>&&)>::~CompletionHandler()
    3   
WebKit::WebSWClientConnection::matchRegistration(WebCore::SecurityOriginData&&, 
WTF::URL const&, WTF::CompletionHandler<void 
(std::__1::optional<WebCore::ServiceWorkerRegistrationData>&&)>&&)::$_10::~$_10()
    4   
WebKit::WebSWClientConnection::matchRegistration(WebCore::SecurityOriginData&&, 
WTF::URL const&, WTF::CompletionHandler<void 
(std::__1::optional<WebCore::ServiceWorkerRegistrationData>&&)>&&)::$_10::~$_10()
    5   
WTF::Detail::CallableWrapper<WebKit::WebSWClientConnection::matchRegistration(WebCore::SecurityOriginData&&,
 WTF::URL const&, WTF::CompletionHandler<void 
(std::__1::optional<WebCore::ServiceWorkerRegistrationData>&&)>&&)::$_10, 
void>::~CallableWrapper()
    6   
WTF::Detail::CallableWrapper<WebKit::WebSWClientConnection::matchRegistration(WebCore::SecurityOriginData&&,
 WTF::URL const&, WTF::CompletionHandler<void 
(std::__1::optional<WebCore::ServiceWorkerRegistrationData>&&)>&&)::$_10, 
void>::~CallableWrapper()
    7   
WTF::Detail::CallableWrapper<WebKit::WebSWClientConnection::matchRegistration(WebCore::SecurityOriginData&&,
 WTF::URL const&, WTF::CompletionHandler<void 
(std::__1::optional<WebCore::ServiceWorkerRegistrationData>&&)>&&)::$_10, 
void>::~CallableWrapper()
    8   
std::__1::default_delete<WTF::Detail::CallableWrapperBase<void>>::operator()[abi:sn170006](WTF::Detail::CallableWrapperBase<void>*)
 const
    9   std::__1::unique_ptr<WTF::Detail::CallableWrapperBase<void>, 
std::__1::default_delete<WTF::Detail::CallableWrapperBase<void>>>::reset[abi:sn170006](WTF::Detail::CallableWrapperBase<void>*)
    10  std::__1::unique_ptr<WTF::Detail::CallableWrapperBase<void>, 
std::__1::default_delete<WTF::Detail::CallableWrapperBase<void>>>::~unique_ptr[abi:sn170006]()
    11  std::__1::unique_ptr<WTF::Detail::CallableWrapperBase<void>, 
std::__1::default_delete<WTF::Detail::CallableWrapperBase<void>>>::~unique_ptr[abi:sn170006]()
    12  WTF::Function<void ()>::~Function()
    13  WTF::Function<void ()>::~Function()
    14  WTF::VectorDestructor<true, WTF::Function<void 
()>>::destruct(WTF::Function<void ()>*, WTF::Function<void ()>*)
    15  WTF::VectorTypeOperations<WTF::Function<void 
()>>::destruct(WTF::Function<void ()>*, WTF::Function<void ()>*)
    16  WTF::Deque<WTF::Function<void ()>, 0ul>::destroyAll()
    17  WTF::Deque<WTF::Function<void ()>, 0ul>::~Deque()
    18  WTF::Deque<WTF::Function<void ()>, 0ul>::~Deque()
    19  WebKit::WebSWClientConnection::~WebSWClientConnection()
    20  WebKit::WebSWClientConnection::~WebSWClientConnection()
    21  WebKit::WebSWClientConnection::~WebSWClientConnection()
    22  WTF::RefCounted<WebCore::SWClientConnection>::deref() const
    23  
WTF::DefaultRefDerefTraits<WebKit::WebSWClientConnection>::derefIfNotNull(WebKit::WebSWClientConnection*)
    24  WTF::RefPtr<WebKit::WebSWClientConnection, 
WTF::RawPtrTraits<WebKit::WebSWClientConnection>, 
WTF::DefaultRefDerefTraits<WebKit::WebSWClientConnection>>::~RefPtr()
    25  WTF::RefPtr<WebKit::WebSWClientConnection, 
WTF::RawPtrTraits<WebKit::WebSWClientConnection>, 
WTF::DefaultRefDerefTraits<WebKit::WebSWClientConnection>>::~RefPtr()
    26  WebKit::NetworkProcessConnection::didClose(IPC::Connection&)
    27  IPC::Connection::dispatchDidCloseAndInvalidate()::$_14::operator()() 
const
    28  
WTF::Detail::CallableWrapper<IPC::Connection::dispatchDidCloseAndInvalidate()::$_14,
 void>::call()
    29  WTF::Function<void ()>::operator()() const
    30  WTF::RunLoop::performWork()
    31  WTF::RunLoop::performWork(void*)

    * Source/WebKit/WebProcess/Storage/WebSWClientConnection.cpp:
    (WebKit::WebSWClientConnection::matchRegistration):

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

Canonical link: https://commits.webkit.org/282416.137@webkitglib/2.46


Compare: https://github.com/WebKit/WebKit/compare/2d193f108316...5ec13d6e7ae3

To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to