Code Monkey home page Code Monkey logo

kosmonaut's Introduction

Kosmonaut banner


Build Status Join the chat at https://gitter.im/kosmonaut-browser/community

Kosmonaut is a web browser prioritizing speed and privacy, serving as the vehicle for your journey across the world wide web.

The road to the stars is steep and dangerous. But we're not afraid...space flights can't be stopped.

- Yuri Gagarin

What can Kosmonaut do?

So far, not much. Only a very limited subset of CSS is currently supported, so most web pages will not work. However, given very basic HTML and CSS, Kosmonaut does render the right things โ€” see Kosmonaut's rendering of this code, compared with that of Firefox:

Kosmonaut and Firefox rendering HTML and CSS the same, resulting in a picture of some rainbow colored boxes.

Roadmap

Here is a summary of things Kosmonaut can do, things I'm currently working on, and things that are towards the front of the todo list.

  • Parse HTML and small subset of CSS into DOM and rules, cascade CSS and apply to DOM
  • Layout and paint of normal flow, block formatting context block-level boxes.
    • Partial support for abstract box layout with writing-mode and direction properties
    • Margin collapsing
  • Layout-tree-dump based testing
  • Text rendering with FreeType (without support for text layout โ€” see next item)
  • Support for normal flow, inline formatting context layout and paint

Build and test

Kosmonaut is built with Rust using OpenGL bindings via gl-rs, Glutin for window management and OpenGL context creation, Servo's html5ever and cssparser for HTML and CSS parsing, and various other auxiliary libraries.

To build from source:

  1. Install Rust: https://www.rust-lang.org/tools/install
  2. cargo build

Kosmonaut does not currently support any networking. To render HTML and CSS with Kosmonaut, you may instead run the executable you just built passing any number of HTML and CSS files via the --files (or -f) flag.

cargo run -- --files my.html my.css more.css

To run the rainbow divs example pictured above, try:

cargo run -- --files tests/websrc/rainbow-divs.html tests/websrc/rainbow-divs.css

To run the tests, both unit and layout, run:

cargo test

For layout tests, Kosmonaut transforms the given HTML and CSS into the layout tree and dumps that as text. Those text snapshots are verified with insta.

If you need to review / update snapshots, it is helpful to install the Cargo insta CLI tool like so:

cargo install cargo-insta

License and credits

Kosmonaut's current implementation is heavily inspired by Servo, sometimes taking code directly from it. Thus, Kosmonaut is licensed with the Mozilla Public License 2.0.

Kosmonaut also takes inspiration from Robinson. Thanks to mbrubeck for their great series of articles on browser engines.

Finally, Kosomonaut's DOM implementation was taken from Kuchiki and has been slightly modified to fit our needs.

kosmonaut's People

Contributors

gitter-badger avatar twilco avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.