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

TextDecoder: streaming decode, ignoreBOM #20431

Merged
merged 2 commits into from Mar 26, 2018

Conversation

@talklittle
Copy link
Contributor

talklittle commented Mar 26, 2018

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 errors
  • These changes fix #13234 (github issue number if applicable).
  • These changes fix #5600 (github issue number if applicable).
  • There are tests for these changes OR
  • 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

This change is Reviewable

@highfive
Copy link

highfive commented Mar 26, 2018

Heads up! This PR modifies the following files:

  • @asajeffrey: components/script/dom/textdecoder.rs, components/script/dom/webidls/TextDecoder.webidl, components/script/dom/bindings/trace.rs
  • @fitzgen: components/script/dom/textdecoder.rs, components/script/dom/webidls/TextDecoder.webidl, components/script/dom/bindings/trace.rs
  • @KiChjang: components/script/dom/textdecoder.rs, components/script/dom/webidls/TextDecoder.webidl, components/script/dom/bindings/trace.rs
@highfive
Copy link

highfive commented Mar 26, 2018

warning Warning warning

  • These commits modify script code, but no tests are modified. Please consider adding a test!
@talklittle
Copy link
Contributor Author

talklittle commented Mar 26, 2018

This PR also fixes the tests /encoding/textdecoder-byte-order-marks.html. Unsure if that means issue #13233 is considered fixed as well?

Copy link
Member

jdm left a comment

This looks really great! Thanks for working on this!

#[ignore_malloc_size_of = "defined in encoding_rs"]
decoder_: RefCell<Decoder>,
in_stream_: RefCell<Vec<u8>>,
do_not_flush_: Cell<bool>,

This comment has been minimized.

Copy link
@jdm

jdm Mar 26, 2018

Member

nit: no need for the trailing _s

s
};
Ok(USVString(s.into_owned()))
if !self.do_not_flush_.get() {

This comment has been minimized.

Copy link
@jdm

jdm Mar 26, 2018

Member

Let's add a // Step 1 comment here (and similar for the rest of this method).

@jdm jdm assigned jdm and unassigned pcwalton Mar 26, 2018
@talklittle talklittle force-pushed the talklittle:issues-13234-5600-squashed branch from ded3ffa to 3990946 Mar 26, 2018
@jdm
Copy link
Member

jdm commented Mar 26, 2018

@bors-servo
Copy link
Contributor

bors-servo commented Mar 26, 2018

📌 Commit 3990946 has been approved by jdm

@jdm
jdm approved these changes Mar 26, 2018
@bors-servo
Copy link
Contributor

bors-servo commented Mar 26, 2018

Testing commit 3990946 with merge fd19a43...

bors-servo added a commit that referenced this pull request Mar 26, 2018
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 -->
@bors-servo
Copy link
Contributor

bors-servo commented Mar 26, 2018

💔 Test failed - linux-rel-css

@jdm
Copy link
Member

jdm commented Mar 26, 2018

Hooray, lots of other passing tests!

@jdm
Copy link
Member

jdm commented Mar 26, 2018

To be clear - you will need to follow these steps and include the changes in this commit.

@jdm
Copy link
Member

jdm commented Mar 26, 2018

@bors-servo
Copy link
Contributor

bors-servo commented Mar 26, 2018

📌 Commit 36838d2 has been approved by jdm

@bors-servo
Copy link
Contributor

bors-servo commented Mar 26, 2018

Testing commit 36838d2 with merge 1981efc...

bors-servo added a commit that referenced this pull request Mar 26, 2018
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 -->
@bors-servo
Copy link
Contributor

bors-servo commented Mar 26, 2018

@bors-servo bors-servo merged commit 36838d2 into servo:master Mar 26, 2018
3 checks passed
3 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

5 participants
You can’t perform that action at this time.