[webkit-changes] [WebKit/WebKit] 7b6d03: Use document URL as source of ResizeObserver loop ...

Cameron McCormack noreply at github.com
Fri Apr 14 14:24:19 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 7b6d036d50a030bf898eedbe36ad583a50cb2b7f
      https://github.com/WebKit/WebKit/commit/7b6d036d50a030bf898eedbe36ad583a50cb2b7f
  Author: Cameron McCormack <heycam at apple.com>
  Date:   2023-04-14 (Fri, 14 Apr 2023)

  Changed paths:
    M LayoutTests/imported/w3c/web-platform-tests/resize-observer/calculate-depth-for-node-expected.txt
    M Source/WebCore/dom/Document.cpp

  Log Message:
  -----------
  Use document URL as source of ResizeObserver loop limit error
https://bugs.webkit.org/show_bug.cgi?id=255439
rdar://107905388

Reviewed by Simon Fraser.

In Document::updateResizeObservations we throw an error if we exceed
some limit for the number of times we loop processing ResizeObserver
notifications. This uses getParserLocation to get the location to use in
the error, which returns the empty string if parsing the document has
finished. But when we pass in the empty string to reportException, we
end up censoring the error message as "Script error." because we think
the error came from a different origin, and the "ResizeObserver loop
completed with undelivered notifications." message gets lost.

We can use the document URL here instead. There's no clear more specific
location to use, since when this error is thrown there is no JS on the
stack (updateResizeObservations is one of the rendering update steps),
and no specific ResizeObserver is necessarily the one that caused the
limit to be exceeded.

* LayoutTests/imported/w3c/web-platform-tests/resize-observer/calculate-depth-for-node-expected.txt:
* Source/WebCore/dom/Document.cpp:
(WebCore::Document::updateResizeObservations):

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




More information about the webkit-changes mailing list