-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WebCore::XMLDocumentParserScope does not restore xmlStructuredErrorCo…
…ntext properly <https://bugs.webkit.org/show_bug.cgi?id=273665> <rdar://127468626> Reviewed by Alex Christensen. Prior to this change, XMLDocumentParserScope would restore xmlStructuredErrorContext using the saved value of xmlGenericErrorContext. The fix is to store the original value of xmlStructuredErrorContext in its own instance variable so it can be restored separately. If the structuredErrorContext parameter is not set when calling the XMLDocumentParserScope() constructor, the value of genericErrorContext is used for structuredErrorContext (as before). API Test: TestWebKitAPI.XMLParsing.WebCoreRestoresLibxml2GenericAndStructuredErrorState * Source/WebCore/xml/parser/XMLDocumentParserScope.cpp: (WebCore::XMLDocumentParserScope::XMLDocumentParserScope): - Add structuredErrorContext argument to constructor so that the single-argument constructor can pass in the correct value. - Store xmlStructuredErrorContext in m_oldStructuredErrorContext. - Set the structuredErrorContext using that argument, or fall back to genericErrorContext if structuredErrorContext is nullptr. (WebCore::XMLDocumentParserScope::~XMLDocumentParserScope): - Properly restore saved structuredErrorContext in m_oldStructuredErrorContext in the destructor. * Source/WebCore/xml/parser/XMLDocumentParserScope.h: (WebCore::XMLDocumentParserScope::XMLDocumentParserScope): - Declare optional structuredErrorContext argument. - Rename m_oldErrorContext to m_oldGenericErrorContext. - Add m_oldStructuredErrorContext. * Tools/TestWebKitAPI/Tests/WebCore/cocoa/XMLParsing.mm: (TestWebKitAPI::TEST_F(XMLParsing, WebCoreRestoresLibxml2GenericAndStructuredErrorState)): Add. - Add test for this change. Canonical link: https://commits.webkit.org/278436@main
- Loading branch information
Showing
3 changed files
with
43 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters