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

The HTML fast parser may not parse HTML entities correctly #11888

Conversation

cdumez
Copy link
Contributor

@cdumez cdumez commented Mar 23, 2023

609c58e

The HTML fast parser may not parse HTML entities correctly
https://bugs.webkit.org/show_bug.cgi?id=254370

Reviewed by Ryosuke Niwa.

The code was assuming consumeHTMLEntity() consumes all the input, which is not
necessarily the case. This fixes cases where the reference is only part of the
text.

This is a cherry-pick from Blink:
- https://chromium-review.googlesource.com/c/chromium/src/+/4305159

* LayoutTests/fast/parser/fast-html-parser-consume-entity-expected.txt: Added.
* LayoutTests/fast/parser/fast-html-parser-consume-entity.html: Added.
* Source/WebCore/html/parser/HTMLDocumentParserFastPath.cpp:
(WebCore::HTMLFastPathParser::scanHTMLCharacterReference):

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

eb44a9e

Misc iOS, tvOS & watchOS macOS Linux Windows
βœ… πŸ§ͺ style βœ… πŸ›  ios βœ… πŸ›  mac βœ… πŸ›  wpe βœ… πŸ›  wincairo
βœ… πŸ§ͺ bindings βœ… πŸ›  ios-sim βœ… πŸ›  mac-AS-debug βœ… πŸ§ͺ wpe-wk2
βœ… πŸ§ͺ webkitperl   πŸ§ͺ ios-wk2 βœ… πŸ§ͺ api-mac βœ… πŸ›  gtk
  πŸ§ͺ api-ios βœ… πŸ§ͺ mac-wk1   πŸ§ͺ gtk-wk2
βœ… πŸ›  tv ❌ πŸ§ͺ mac-wk2 ⏳ πŸ§ͺ api-gtk
βœ… πŸ›  tv-sim   πŸ§ͺ mac-AS-debug-wk2
βœ… πŸ›  watch βœ… πŸ§ͺ mac-wk2-stress
βœ… πŸ›  πŸ§ͺ merge βœ… πŸ›  watch-sim

@cdumez cdumez requested a review from rniwa as a code owner March 23, 2023 21:35
@cdumez cdumez self-assigned this Mar 23, 2023
@cdumez cdumez added the DOM For bugs specific to XML/HTML DOM elements (including parsing). label Mar 23, 2023
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Mar 24, 2023
@cdumez cdumez added merge-queue Applied to send a pull request to merge-queue and removed merging-blocked Applied to prevent a change from being merged labels Mar 24, 2023
https://bugs.webkit.org/show_bug.cgi?id=254370

Reviewed by Ryosuke Niwa.

The code was assuming consumeHTMLEntity() consumes all the input, which is not
necessarily the case. This fixes cases where the reference is only part of the
text.

This is a cherry-pick from Blink:
- https://chromium-review.googlesource.com/c/chromium/src/+/4305159

* LayoutTests/fast/parser/fast-html-parser-consume-entity-expected.txt: Added.
* LayoutTests/fast/parser/fast-html-parser-consume-entity.html: Added.
* Source/WebCore/html/parser/HTMLDocumentParserFastPath.cpp:
(WebCore::HTMLFastPathParser::scanHTMLCharacterReference):

Canonical link: https://commits.webkit.org/262050@main
@webkit-commit-queue webkit-commit-queue force-pushed the 254370_HTMLFastParser_entity_parsing_fix branch from eb44a9e to 609c58e Compare March 24, 2023 01:21
@webkit-commit-queue
Copy link
Collaborator

Committed 262050@main (609c58e): https://commits.webkit.org/262050@main

Reviewed commits have been landed. Closing PR #11888 and removing active labels.

@webkit-commit-queue webkit-commit-queue merged commit 609c58e into WebKit:main Mar 24, 2023
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Mar 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DOM For bugs specific to XML/HTML DOM elements (including parsing).
Projects
None yet
5 participants