[webkit-changes] [WebKit/WebKit] 813098: Test for parsing XML with WebCore and libxml2 in t...

Commit Queue noreply at github.com
Thu May 2 06:15:11 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 8130984fb35697a39df7b484d3f520b783d532d2
      https://github.com/WebKit/WebKit/commit/8130984fb35697a39df7b484d3f520b783d532d2
  Author: David Kilzer <ddkilzer at apple.com>
  Date:   2024-05-02 (Thu, 02 May 2024)

  Changed paths:
    M Tools/TestWebKitAPI/Configurations/TestWebKitAPI.xcconfig
    M Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
    A Tools/TestWebKitAPI/Tests/WebCore/cocoa/XMLParsing.mm
    A Tools/TestWebKitAPI/Tests/WebKit/test.xml

  Log Message:
  -----------
  Test for parsing XML with WebCore and libxml2 in the same process
https://bugs.webkit.org/show_bug.cgi?id=273553
<rdar://127295719>

Reviewed by Alex Christensen.

The xmlCtxtReadFile() function calls xmlLoadExternalEntity() as part of
its implementation (not sure why), which would then trigger the external
entity loader path.  Prior to the fix in 278168 at main, WebCore replaced
the global external entity loader function and didn't change it back
when it was done, which caused libxml2 loads to fail.  The fix restores
the default external entity loader function when WebCore is done parsing
XML, so making WebCore parse XMl content, then calling xmlCtxtReadFile()
is sufficient to test the fix.

API Test:  TestWebKitAPI.XMLParsing.WebCoreDoesNotBreakLibxml2

* Tools/TestWebKitAPI/Configurations/TestWebKitAPI.xcconfig:
(OTHER_LDFLAGS): Link libxml2 to TestWebKitAPI.
* Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
- Add XMLParsing.mm and test.xml to the project.
* Tools/TestWebKitAPI/Tests/WebCore/XMLParsing.mm: Add.
(TestWebKitAPI::TEST(XMLParsing, WebCoreDoesNotBreakLibxml2)):
* Tools/TestWebKitAPI/Tests/WebKit/test.xml: Add.

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



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


More information about the webkit-changes mailing list