Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LibWeb: Implement XMLSerializer #14493

Merged
merged 1 commit into from
Jul 5, 2022

Conversation

Lubrsi
Copy link
Member

@Lubrsi Lubrsi commented Jul 5, 2022

The main thing that is missing is validating certain pieces of data
against XML productions in well-formed mode, but nothing uses
well-formed mode right now.

Required by Closure Library for sanitising HTML.
https://github.com/google/closure-library/blob/e687b3d8ab014787b9f10b08b3f597b637392480/closure/goog/html/sanitizer/safedomtreeprocessor.js#L117

Copy link
Member

@linusg linusg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Require by -> Required by

@Lubrsi Lubrsi force-pushed the xml-serilization branch from 05cd8b8 to 71824c1 Compare July 5, 2022 16:49
Userland/Libraries/LibWeb/DOMParsing/XMLSerializer.cpp Outdated Show resolved Hide resolved
Userland/Libraries/LibWeb/DOMParsing/XMLSerializer.cpp Outdated Show resolved Hide resolved
Userland/Libraries/LibWeb/DOMParsing/XMLSerializer.cpp Outdated Show resolved Hide resolved
Userland/Libraries/LibWeb/DOMParsing/XMLSerializer.cpp Outdated Show resolved Hide resolved
Userland/Libraries/LibWeb/DOMParsing/XMLSerializer.cpp Outdated Show resolved Hide resolved
if (require_well_formed == RequireWellFormed::Yes && attribute->value().is_empty())
return DOM::InvalidStateError::create("Attribute's value is empty");

// 4. [If] the attr's prefix matches the string "xmlns", then let candidate prefix be the string "xmlns".
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wanna file a spec issue for the missing If? :yakkie:

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Userland/Libraries/LibWeb/DOMParsing/XMLSerializer.cpp Outdated Show resolved Hide resolved
Userland/Libraries/LibWeb/DOMParsing/XMLSerializer.cpp Outdated Show resolved Hide resolved
The main thing that is missing is validating certain pieces of data
against XML productions in well-formed mode, but nothing uses
well-formed mode right now.

Required by Closure Library for sanitising HTML.
https://github.com/google/closure-library/blob/e687b3d8ab014787b9f10b08b3f597b637392480/closure/goog/html/sanitizer/safedomtreeprocessor.js#L117
@Lubrsi Lubrsi force-pushed the xml-serilization branch from 71824c1 to f855b1f Compare July 5, 2022 18:00
@awesomekling awesomekling merged commit de88e11 into SerenityOS:master Jul 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants