[webkit-changes] [WebKit/WebKit] 47f7b5: HTMLFrameOwnerElement::getSVGDocument should retur...

Ahmad Saleem noreply at github.com
Mon Feb 6 11:43:28 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 47f7b571335b97a026780cede91b9232efbbbd44
      https://github.com/WebKit/WebKit/commit/47f7b571335b97a026780cede91b9232efbbbd44
  Author: Ahmad Saleem <ahmad.saleem792+github at gmail.com>
  Date:   2023-02-06 (Mon, 06 Feb 2023)

  Changed paths:
    M LayoutTests/fast/dom/getSVGDocument-on-object-crash-expected.txt
    A LayoutTests/svg/custom/getsvgdocument-null-expected.txt
    A LayoutTests/svg/custom/getsvgdocument-null.html
    M Source/WebCore/html/HTMLFrameOwnerElement.cpp
    M Source/WebCore/html/HTMLFrameOwnerElement.h

  Log Message:
  -----------
  HTMLFrameOwnerElement::getSVGDocument should return null rather than throwing

HTMLFrameOwnerElement::getSVGDocument should return null rather than throwing
https://bugs.webkit.org/show_bug.cgi?id=250758
rdar://problem/104641450

Reviewed by Ryosuke Niwa.

This patch is to align WebKit with Gecko / Firefox and Blink / Chromium.

Merge - https://chromium.googlesource.com/chromium/blink/+/cf7eb89e462b4f8b003025cab9c99a6770ef6c44

If the element's 'contentDocument' is not an SVG document (or does not exist) we currently
throw a NotSupportedError exception. This matches neither the spec[1] nor Firefox's /
Chrome's implementation.

This patch drops the exception and matches WebKit with other browser engines.

[1] https://www.w3.org/TR/SVG/struct.html#InterfaceGetSVGDocument

* Source/WebCore/html/HTMLFrameOwnerElement.cpp:
(HTMLFrameOwnerElement::getSVGDocument): Remove 'Exception' from function and also return 'nullptr' rather than 'exception'
* Source/WebCore/html/HTMLFrameOwnerElement.h: Remove 'Exception' from 'getSVGDocument' function
* LayoutTests/svg/custom/getsvgdocument-null.html: Add Test Case
* LayoutTests/svg/custom/getsvgdocument-null-expected.txt: Add Test Case Expectation
* LayoutTests/fast/dom/getSVGDocument-on-object-crash-expected.txt: Remove 'Console' message

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




More information about the webkit-changes mailing list