ActivitiesAtom Feed

Displaying activities 1 - 25 of 71 in total

October 26, 2016

  • Secret Blog Post Revealed!

    Team JaM (Servo) [2016] — at October 26, 2016 07:00 UTC

    In our last blog (wow, it’s already been almost a month!) we mentioned a sEcReT bLoG pOsT! Here is our series on implementing the new Doge API for those are interested in contributing to Servo!: Part 1: How to implement a new DOM API for Servo Part 2: How to test a DOM API for Servo Yesterday … Read more.

October 01, 2016

  • Day 60: Last Day!

    Team JaM (Servo) [2016] — at October 1, 2016 00:12 UTC

    Today is the last day of RGSoC. We are incredibly sad, and proud of our summer!

    Things we did:

    • Both of us worked on a secret blog post. It will be ready soon!

    Things we learned:

    A couple failing tests and their reasons:
    assert_equals: response type is basic expected "basic" but got "default"
    - our API for returning responses (ie. process_response) doesn't differentiate between the different types yet, so we need to make that possible to make those tests pass. Josh thinks that FetchMetadata will need to be changed.

    assert_equals: Content-Type is text/html; charset=utf-8 expected "text/html;charset=utf-8" but got "text/html; charset=utf-8"
    There's a lot of debate what to do with a space.

    TODO:

    • Keep learning.
    • Improve Fetch so that it passes more tests!

September 30, 2016

  • Day 62: LAST DAY!

    Team JaM (Servo) [2016] — at September 30, 2016 07:00 UTC

    Today is the last day of RGSoC. We are incredibly sad, and proud of our summer! Things we did: Both of us worked on a secret blog post. It will be ready soon! Things we learned: A couple failing tests and their reasons: assert_equals: response type is basic expected "basic" but got … Read more.

September 29, 2016

  • Day 62: D-2 Body and Fetch are here!

    Team JaM (Servo) [2016] — at September 29, 2016 22:36 UTC

    We're having our end of summer party. We're going to see thousands of swift birds fly into a chimney for the night! So excited.

    Things we did:

    • Body
    • Fetch
    • Malisa
      • Spent the morning categorizing fetch/api/basic tests. >90% of failing tests were due to fetch is not defined. The remaining two failures were due to assert_equals: Request.text() should decode data as UTF-8 and assert_equals: Response.text() should decode data as UTF-8 expected. In the afternoon fetch got merged into master, so I retested response and basic at that point....now there is a lot of assert_equals: Request.text() should decode data as UTF-8 expected and assert_equals: Response's type is basic expected "basic" but got "default". Started trying to figure out what's wrong with body's text() Looked into request/request-consume.html and /basic/text-utf8.html....not sure how to fix!
    • Jeena
      • Started writing a blog post that is a secret yet!

    TODO:

    • Test Curation
      • Possibly update because fetch and body are now merged.

  • Day 62: D-1: Body and Fetch, woo! hoo!

    Team JaM (Servo) [2016] — at September 29, 2016 07:00 UTC

    We’re having our end of summer party. We’re going to see thousands of swift birds fly into a chimney for the night! So excited. Things we did: Body Body mixin methods are now supported! Fetch Fetch method is now supported too! Malisa Spent the … Read more.

September 28, 2016

  • Day 61: D-2: Last video call ;(

    Team JaM (Servo) [2016] — at September 28, 2016 23:45 UTC

    Our goodbye-blog post was published on the RGSoC blog! spoiler: fetch demo! :O

    Also, we had our very last team-wide video call! Boo hoo! Everyone (almost) teared up!

    Tonight we're going to Papers We Love PDX tonight!

    Things we did:

    • Body
      • Fixed up PR......the merge is just around the corner!
    • Test Curation
      • There are a lot more web platform tests than before, so I focused on the higher level summary of them.
      • Currently, I finished summarizing most tests except for those in fetch/api/basic!!

    TODO:

    • Test Curation
      • Finish summarizing!
    • Malisa
      • Figure out what to do next! I think I might try to help out with test curation and/or try to understand fetch better.

  • Day 61: D-2: Last video call ;(

    Team JaM (Servo) [2016] — at September 28, 2016 07:00 UTC

    Our goodbye-blog post was published on the RGSoC blog! spoiler: fetch demo! :O Also, we had our very last team-wide video call! Boo hoo! Everyone (almost) teared up! Tonight we’re going to Papers We Love PDX tonight! Things we did: Body Fixed up PR……the merge is just around the … Read more.

  • Day 60: Only 3 days left! :(

    Team JaM (Servo) [2016] — at September 28, 2016 00:13 UTC

    Things we did:

    • Body
      • Started fixing the Body implementation based on jdm's feedback
      • Filed issue #13465 related to allowing trait object in promise.rs.
      • Filed issue #13464 about rethrowing exceptions instead of clearing pending JS exceptions in Body's Json() method.
      • The error we were getting was due to having an error in the webidl! We should have used Primse<any> instead of Promise<JSON>.
      • Looked into form data crate for parsing Form Data. formdata::read_formdata requires a reader, and I'm not entirely sure how we can use this parser without stream or HttpReader.
    • General
      • We had lunch with Coach Stefan! :clap: We started thinking about what to do after this Friday when the summer of code is over...
      • We finished writing our end-of-summer blog post.
      • We went over the fetch method code to understand it better.
      • I wrote a blog post about Strange Loop (Jeena).
      • Tonight, we're going to Donut.js!

    Things we learned:

    • Trait object in Rust. Trait objects are the difference between fn foo(object: &Trait) (this is trait object) and fn foo<T: Trait>(object: &T). The former will result in the compiler generating less code, so the compile time will be faster. However, this puts a little more strain during run time, because it will have to check whether the parameter object implements the &Trait. The latter generates more code during compilation because it will create unique functions for each type that implements Trait. This saves time during run time because the functions for each type is already defined. As Josh said "classic tradeoff between time and space!"

    TODO:

    • Body
      • Continue fixing code for PR!
    • Test Curation
      • Go through the new tests, and categorize them.

September 27, 2016

  • Day 60: D-3: Only 3 days until last day

    Team JaM (Servo) [2016] — at September 27, 2016 07:00 UTC

    Things we did: Body Started fixing the Body implementation based on jdm’s feedback Filed issue #13465 related to allowing trait object in promise.rs. Filed issue #13464 about rethrowing exceptions instead of clearing pending JS exceptions in Body’s Json() method. The … Read more.

  • Day 59: D-4

    Team JaM (Servo) [2016] — at September 27, 2016 00:17 UTC

    Things we did:

    • Body
      • Spent the morning (!!) rebasing Body on top of master (did it the hard way using rebase the first time, until Jeena suggested I just reset and cherry-pick my commits on top...the latter way had only a few merge conflicts as opposed to a LOT). And a little rewriting to get things to compile. Still need to implement the BodyTrait for request.rs. More tests are passing now!! Yay :)
    • Fetch
      • Hmm, homu tests kept failing. Web platform tests related to cors/ and redirect/ seemed to fail intermittently, so we decided to skip those tests for now.
    • Package Data Algorithm
      • The parser for body when MIMEType is "multipart/form-data" is not clearly defined, so I decided to skip it for now.
    • General
      • We started writing our end-of-summer blog post. So sad!

    Things we learned:

    • git cherry-pick is sometimes easier than git rebase
    • git clean -f -d gets rid of untracked files and directories. I used this today right before a git reset.

    TODO:

    • Body
      • The JSON function still does not work. getting error: WebIDL.WebIDLError: error: Unresolved type '<unresolved scope>::JSON'
    • Test Curation
      • Go through the new tests, and categorize them.

September 26, 2016

  • Day 59: D-4

    Team JaM (Servo) [2016] — at September 26, 2016 07:00 UTC

    Things we did: Body Spent the morning (!!) rebasing Body on top of master (did it the hard way using rebase the first time, until Jeena suggested I just reset and cherry-pick my commits on top…the latter way had only a few merge conflicts as opposed to a LOT). And a little rewriting to … Read more.

September 25, 2016

  • Day 58: Sea of Commits

    Team JaM (Servo) [2016] — at September 25, 2016 18:34 UTC

    Things we did:

    • Body
      • Finished refactoring (for the most part) and pushed to a temporary branch for the Body API while Jeena adds her changes. I'll probably implement the BodyTrait for dom::request while she does that.
    • Package Data Algorithm
      • Added/Refactored the package data algorithm to the temporary branch! And it compiles!

    Things we learned:

    • You can directly access struct fields only if you're in the same file as the struct that you're trying to access. This at first seemed really weird and arbitrary to me, but apparently this turns out to be less of a headache (and fairly reasonable) compared to the way internal field access would be handles in C++ (according to our coach Nick). This is why it sometimes easier to implement a trait for a struct in the same file that the struct is defined (as opposed to, say, the file that the trait is defined).

    TODO:

    • Body (Malisa)
      • implement the BodyTrait for dom::request. Also, rebase on top of the current master (now that promises and fetch are merged in ^^)
    • Test Curation
      • Go through the new tests, and categorize them.
    • Package Data Algorithm
      • Figure out how to write FormData() when MIMEType is "multipart/form-data"
      • Clean up the code

September 23, 2016

  • Day 58: Sea of Commits

    Team JaM (Servo) [2016] — at September 23, 2016 07:00 UTC

    Things we did: Body Finished refactoring (for the most part) and pushed to a temporary branch for the Body API while Jeena adds her changes. I’ll probably implement the BodyTrait for dom::request while she does that. Package Data Algorithm Added/Refactored the … Read more.

  • Day 57: First Day of Fall! :(

    Team JaM (Servo) [2016] — at September 23, 2016 00:13 UTC

    Things we did:

    • Body
      • Started refactoring consumebody based on feedback and yesterday's planning. Created body.rs and pulled out `consumebodyandrunpackagedata_algorithminto it, and created aBodyTrait`. The project was oddly compiling without complaints for most of the day. I mentioned this to Jeena, who reminded me that I have to list new dom files it in dom/mod.rs......haha. :) I did, and then all my bugs were then revealed upon the next compile. :P
    • Promise in Fetch
      • net_traits had changed! So I had to modify the process_response() method to accomodate the changes. It is more secure now as it allows the fetched data to be filtered. Filter exists to protect sites from having their data stolen by other sites.
    • Package Data Algorithm
      • I implemented(though no guarantee it works :wink:) Json(), Blob(), and part of FormData().

    Things we learned:

    It's a little long today, so check it out at our blog.

    TODO:

    • Body
      • debug and finish refactoring. Push to github and then merge with Jeena's implementation of Blob() and FormData(). Then work on Body for Request.
    • Test Curation
      • Go through the new tests, and categorize them.
    • Package Data Algorithm
      • Figure out how to write FormData() when MIMEType is "multipart/form-data".

September 22, 2016

  • Day 57: First Day of Fall! :(

    Team JaM (Servo) [2016] — at September 22, 2016 07:00 UTC

    Things we did: Body Started refactoring consume_body based on feedback and yesterday’s planning. Created body.rs and pulled out consume_body and run_package_data_algorithm into it, and created a BodyTrait. The project was oddly compiling without complaints for most of the day. I … Read more.

  • Day 56: Next Steps

    Team JaM (Servo) [2016] — at September 22, 2016 00:03 UTC

    Things we did:

    • Body
      • Submitted PR last night for dom::Response's Body::text function. Got back some feedback. Spent some of this afternoon planning the next steps.
    • Blog
      • I (Malisa) spent some time writing my Strange Loop blog....will try to do some more coding tonight.
    • Promise in Fetch
      • Addressed review comments from the PR.
    • OpenEndedDictionary in Headers
      • Opened a PR and addressed review comments.

    TODO:

    • Body (Malisa)
      • Fix code based on jdm's feedback and refactor.
    • Test Curation
      • Go through the new tests, and categorize them.
    • Package Data Algorithm (Jeena)
      • We decided that I should work on implementing the rest of the package data algorithm. This decides what to do given a Body, depending on its type (a text, json, and etc). Malisa already implemented text, so that's great! Malisa will focus on going through review comments from her recent PR, and refactoring consume_body and making it into a public function. That way, it can be called by both Request and Response. At this moment, consume_body is customized for Response specifically, and it will be redundant to do the write the same function for Request.

September 21, 2016

  • Day 56: Next Steps

    Team JaM (Servo) [2016] — at September 21, 2016 07:00 UTC

    Things we did: Body Submitted PR last night for dom::Response’s Body::text function. Got back some feedback. Spent some of this afternoon planning the next steps. Blog I (Malisa) spent some time writing my Strange Loop blog….will try to do some more coding … Read more.

  • Day 55: Oooo another exciting day

    Team JaM (Servo) [2016] — at September 21, 2016 01:44 UTC

    Things we did:

    • OpenEndedDictionary in DOM (Jeena)

      • Ms2ger implemented OpenEndedDictionary! This is what will allow more Headers/Request/Response tests to pass. Woohoo!
      • So I modified our Headers and Request APIs to adapt to this change. I fought with the borrow checker a lot today, but overall, it was successful. Thanks rustc!
    • Body

      • Got dom::Response's Body text() function to the point that it compiles, but additional tests are not passing. I keep getting the same error Promise is not defined in testharness.js.

    Things we learned:

    • When T doesn't derive clone, or has a clone implementation, the compiler makes another reference when .clone() is called to a &T, ending up with &&T. When .clone() is called, the compiler derefs &T to T, realizes T cannot be cloned, and so it creates a clone to the reference, hence creating a double reference.

    TODO:

    • Promise in Fetch
      • Go through failing tests and figure out what I can fix.
    • Test Curation
      • Go through the new tests, and categorize them.
    • OpenEndedDictionary in DOM
      • Is it time for a PR?
    • Body
      • Figure out whether I have a bug. Ask jdm. Then submit PR.

September 20, 2016

  • Day 55: Oooo another exciting day

    Team JaM (Servo) [2016] — at September 20, 2016 07:00 UTC

    Things we did: OpenEndedDictionary in DOM (Jeena) Ms2ger implemented OpenEndedDictionary! This is what will allow more Headers/Request/Response tests to pass. Woohoo! So I modified our Headers and Request APIs to adapt to this change. I fought with the borrow checker a lot today, … Read more.

  • Day 54: Fetch, Test Curation, and Body

    Team JaM (Servo) [2016] — at September 20, 2016 00:28 UTC

    Today is our first day back from Strange Loop...more about that in the next couple days! P.S. It was really cool!

    Things we did:

    • Promise in Fetch
      • Opened a PR. This surprisingly took a while because while we were at StrangeLoop, many things happened in the other corners of the Servo codebase!
      • I still have to go through the failing tests and figure out what can be fixed now.
    • Test Curation
      • Realized that the web platform tests have been updated! So there are more tests, and more tests are failing. This made the test curation work I did outdated, so this will have to be redone.
    • Body
      • Worked on editing my current code in order to get it to a compiling state. Figured out details like function return types, whether or not I need to implement certain spec steps, etc.

    Things we learned:

    • [not Servo related] How interpreters work! Malisa and I wrote a simple interpreter in Rust yesterday! Thanks very much to our coach Nick.

    TODO:

    • Promise in Fetch
      • Go through failing tests and figure out what I can fix.
    • Test Curation (Jeena; lower priority)
      • Go through the new tests, and categorize them.
    • Body
      • Get the code to a compiling state. Then figure out if I should get some tests passing and if I should implement more functions (not just text()) prior to a PR.

September 17, 2016

  • Days 52 and 53: Looping Strangely

    Team JaM (Servo) [2016] — at September 17, 2016 00:35 UTC

    We just finished attending the Friday Strange Loop talks and are now looping strangely.
    P.S. The talks are great and we're meeting lots of interesting people from all over the tech world + more!

September 15, 2016

September 14, 2016

  • Day 50: Jammin' Open Source

    Team JaM (Servo) [2016] — at September 14, 2016 00:06 UTC

    Day 50! Today was a good day. We listened to our mentor Josh give a great talk about Optimizing your project for contribution. As mentees, we really appreciate all the work that's put into making Servo accessible to beginners.

    Things we did:

    • Promise in Fetch
      • So yesterday, we found that JSCompartment::wrap had a parameter with a null pointer, which was the reason Servo was crashing. Josh recommended looking at dom/testbinding.rs to see how JSAutoCompartment is used, and to copy it in fetch.rs. After a little bit of wrestling with fetch.rs (because I mistakenly looked at the wrong code), fetch, at least for now, works!
        • Some more explanation on JSCompartments is at the Today We Learned section. What was happening yesterday with the null pointer was that promise didn't enter any compartment, because JSAutoCompartment::new() wasn't called. promise had not entered any compartment, and therefore, when SpiderMonkey (JS Engine) called JSCompartment::wrap(), which would take a JSContext to the compartment of a JSObject, a null pointer was given. Apparently in order to enter a compartment, JSContext has to already have entered a compartment. And that's why Servo crashed!
        • We had been doing systems programming for two months, and this was our first time encountering a null pointer (which was in C++ code). Nick said that this shows how safe Rust is, because Rust would not have compiled in the first place. I haven't programmed in C++, but it must be annoying if a code compiles and so much time could pass until you find a memory pointer bug.
      • I submitted a PR to enable fetch API tests which will be useful in the (hopefully near) future.
    • Body
      • I still didn't get a lot of code-writing done, but I have a better idea of where I'm headed now. I was unsure how closely I should be following the spec for utf-8 decoding. I asked jdm, and it turns out the answer is "just closely enough" (my own words). So that's good, and I think I'm starting to understand how to not get super caught up in spec-reading loops of infinite link-following. It also turns out I can make use of the encoding crate, which I believe means a lot of the actual decoding part has already been written for me.

    Things we learned:

    • Spider Monkey specific: What is JSAutoCompartment? JSAutoCompartment helps a JSContext to enter a compartment, and leave the compartment when it is out of scope.
    • Spider Monkey specific: What is a Compartment? Every JSContext has a current Compartment, but it won't enter its current compartment until JSAutoCompartment::new() is called. In a browser, one tab (one window) will have at least one compartment. Two tabs will have at least two compartments. Compartment is important for security, because there can be little cross-over that will be strictly controlled. You wouldn't want data jumping back and forth between different compartments.

    TODO:

    • Body
    • Fetch Tests
      • It's time to go through the failing tests and see how to improve fetch.rs! {% highlight console %} Ran 104 tests finished in 100.0 seconds.
    • 53 ran as expected. 0 tests skipped.
    • 2 tests crashed unexpectedly
    • 4 tests timed out unexpectedly
    • 48 tests had unexpected subtest results {% endhighlight %}

September 13, 2016

  • Day 49: The Wonder-debugging-land

    Team JaM (Servo) [2016] — at September 13, 2016 00:14 UTC

    We went to RustConf last Saturday, and it was AWESOME.

    Malisa is sick and focused on getting better :(

    Things we did:

    • Updating Headers

    • Promise in Fetch

      • On Friday, wrapping Rc<Promise> with Trusted didn't work. Over the weekend Josh pushed another commit to enable Trusted<Promise> and TrustedPromise::root() that will return a Rc<Promise>. On Sunday, I encountered two borrow check errors:
        • process_response requires &mut self as a parameter (not mut self). When I try to get the root of TrustedPromise, it throws an error saying "cannot move out of borrowed content”. lines 122, 124, 136, and 138
        • the root() of TrustedPromise requires self parameter. In line 101, with let context = fetch_context.lock().unwrap(); which is type MutexGuard, which derefs to &T. When we try to access the Rc<Promise> via context.fetch_promise.root(), the compiler throws a borrow error.
      • Today, I struggled a lot with the borrow checker, but now I have a compiling code! So I wrote a short html page that uses fetch to run it on Servo! (Based on MDN's example)
      • That helped me learn that Fetch isn't working :scream:. I started debugging (which means, me = stressed out) and learned a few things:
        • metadata that is used for process_response looks good. It's Ok(_) and has the fields that look not incorrect.
        • After promise is taken from FetchContext through self.fetch_promise.take(), no other line is called... WEIRD. WHY. Well, luckily, I was working at the Mozilla Office, and three(!) people helped me debug. Special thanks to @sanxiyn, @fitzgen, and @jimblandy.
      • So, after using the debugger, this is what we learned:
        • Here is the stack backtrace.
        • Frame is older with higher frame number, i.e. frame #6 is called before frame #5.
        • frame #6 shows that to_jsval was called. This in turn calls JS_WrapValue in frame #5. This in turn calls JSCompartment::wrap in frame #4.
        • JSCompartment::wrap has a parameter that is this=&0x0. 0x0 is a null pointer!!! We have a memory-unsafe code here!!! Woohoo!
    • Body

      • Read the spec and some more about Unicode encodings in order to understand the UTF-8 decoder. Wrote a little code. Progress was slow due to being sick today.

    Things we learned:

    • When you write . after an object, it automatically derefs! For example, if I do fetch_context.lock(), I'm derefing fetch_context then applying the lock() method.
    • assigning different types to the same binding name (via let statements) seems to be acceptable practice, at least in some contexts.
    • 0x0 is the synonym to null pointer in C++! If your stack backtrace includes 0x0 that's probably not something you wanted :)
    • When debugging Servo, you can use the --debug tag, i.e. ./mach run -d ~/src/fetch_example.html --debug. Servo uses lldb debugger by default.
    • You can set a breakpoint, for example, if you want the code to pause when it calls rust_panic function, you can write b rust_panic <ENTER> run.
    • While you're at the breakpoint, (or maybe some other time too but I'm not too sure) you can type bt which will print all the backtrace! COOL.
    • Rc and Trusted has to maintain a 1:1 relationship, and therefore, Trusted should not have a &self parameter because that could break that 1:1 constraint. In Servo's promise, Rc counts the references, and therefore TrustedPromise has to be connected to the one and only Rc<Promise>, because otherwise, the reference count will be incorrect.

    TODO:

    • Promise in Fetch
      • Ask jdm about the null pointer!
    • Body

September 10, 2016

  • Day 48: RustConf Weekend!!1!

    Team JaM (Servo) [2016] — at September 10, 2016 00:32 UTC

    Things we did:

    • Promise in Fetch
      • Wrote process_response method. I think the remaining relevant FetchResponseListener methods are process_response_eof (invoked when fetching response is complete) and process_response_chunk (invoked when fetching response body). But process_response_eof requires response trailer support, which is not implemented, and process_response_chunk can probably wait until the response body is implemented.
      • Turns out when Josh said to create FetchContext later when it's necessary, he meant literally creating it further down in the method (like physically located further down). Haha oops! I started working on creating FetchContext!
    • Body
      • Started implementing the Body functions without ReadableStream. The spec refers to streams a lot, but servo doesn't implement ReadableStream, so I am trying to figure out how to write things correctly using Vec instead. Set up skeleton code for implementing text() for dom::Request and dom::Response. Then dug into dom::Response's text(), which led to writing bits of consume_body(), run_package_data_algorithm(), and utf8_decode().

    Things we learned:

    • In order to use Promise::maybe_resolve_native() and the like, it needs a JS Context parameter. JS Context can be obtained through self.global().r().get_cx(). JSContext is a context in which JS can be invoked, and is required by APIs that interact with the JS engine (or it can use a JSRuntime argument). It's confusing to me, but for now, I'll just think of it as a connector to the JS world! (probably not 100% accurate).
    • vec.drain(..3); removes the first 3 elements of a vec.

    TODO: