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
TextDecoder: streaming decode, ignoreBOM #20431
TextDecoder: streaming decode, ignoreBOM #20431
Conversation
Heads up! This PR modifies the following files:
|
This PR also fixes the tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks really great! Thanks for working on this!
components/script/dom/textdecoder.rs
Outdated
#[ignore_malloc_size_of = "defined in encoding_rs"] | ||
decoder_: RefCell<Decoder>, | ||
in_stream_: RefCell<Vec<u8>>, | ||
do_not_flush_: Cell<bool>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: no need for the trailing _s
components/script/dom/textdecoder.rs
Outdated
s | ||
}; | ||
Ok(USVString(s.into_owned())) | ||
if !self.do_not_flush_.get() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add a // Step 1
comment here (and similar for the rest of this method).
ded3ffa
to
3990946
Compare
@bors-servo r+ |
📌 Commit 3990946 has been approved by |
TextDecoder: streaming decode, ignoreBOM <!-- Please describe your changes on the following line: --> Implement streaming decode and ignoreBOM flag for TextDecoder. https://encoding.spec.whatwg.org/#dom-textdecoder-decode https://encoding.spec.whatwg.org/#dom-textdecoder-ignorebom --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #13234 (github issue number if applicable). - [x] These changes fix #5600 (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [x] These changes do not require tests because the wpt tests are used for testing: * /encoding/textdecoder-fatal-streaming.html * /encoding/textdecoder-streaming.html * /encoding/textdecoder-ignorebom.html <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/20431) <!-- Reviewable:end -->
💔 Test failed - linux-rel-css |
Hooray, lots of other passing tests! |
To be clear - you will need to follow these steps and include the changes in this commit. |
@bors-servo r+ |
📌 Commit 36838d2 has been approved by |
TextDecoder: streaming decode, ignoreBOM <!-- Please describe your changes on the following line: --> Implement streaming decode and ignoreBOM flag for TextDecoder. https://encoding.spec.whatwg.org/#dom-textdecoder-decode https://encoding.spec.whatwg.org/#dom-textdecoder-ignorebom --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #13234 (github issue number if applicable). - [x] These changes fix #5600 (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [x] These changes do not require tests because the wpt tests are used for testing: * /encoding/textdecoder-fatal-streaming.html * /encoding/textdecoder-streaming.html * /encoding/textdecoder-ignorebom.html <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/20431) <!-- Reviewable:end -->
☀️ Test successful - android, arm32, arm64, linux-dev, linux-rel-css, linux-rel-wpt, mac-dev-unit, mac-rel-css1, mac-rel-css2, mac-rel-wpt1, mac-rel-wpt2, mac-rel-wpt3, mac-rel-wpt4, windows-msvc-dev |
Implement streaming decode and ignoreBOM flag for TextDecoder.
https://encoding.spec.whatwg.org/#dom-textdecoder-decode
https://encoding.spec.whatwg.org/#dom-textdecoder-ignorebom
./mach build -d
does not report any errors./mach test-tidy
does not report any errorsThis change is