From 585eee34f955502a96d514c788659c385b00c7eb Mon Sep 17 00:00:00 2001 From: Able Date: Wed, 16 Mar 2022 02:51:20 -0500 Subject: [PATCH] layed out minimal structure --- .gitignore | 1 + Cargo.lock | 7 +++++++ Cargo.toml | 8 ++++++++ LICENSE.md | 21 +++++++++++++++++++++ src/css/mod.rs | 1 + src/html/mod.rs | 26 ++++++++++++++++++++++++++ src/js/mod.rs | 0 src/main.rs | 13 +++++++++++++ tests/minimal.html | 9 +++++++++ 9 files changed, 86 insertions(+) create mode 100644 .gitignore create mode 100644 Cargo.lock create mode 100644 Cargo.toml create mode 100644 LICENSE.md create mode 100644 src/css/mod.rs create mode 100644 src/html/mod.rs create mode 100644 src/js/mod.rs create mode 100644 src/main.rs create mode 100644 tests/minimal.html diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ea8c4bf --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/target diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..80a8f62 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "abrowser" +version = "0.1.0" diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..8c7778b --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "abrowser" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..cffbf47 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 Able + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/src/css/mod.rs b/src/css/mod.rs new file mode 100644 index 0000000..25db52d --- /dev/null +++ b/src/css/mod.rs @@ -0,0 +1 @@ +//! The CSS engine. diff --git a/src/html/mod.rs b/src/html/mod.rs new file mode 100644 index 0000000..acebcbf --- /dev/null +++ b/src/html/mod.rs @@ -0,0 +1,26 @@ +#![allow(missing_docs)] + +/// https://webidl.spec.whatwg.org/#idl-DOMString +pub type DOMString = String; + +/// https://dom.spec.whatwg.org/#interface-element + +pub struct Element { + pub id: DOMString, + pub class_name: DOMString, + + pub title: DOMString, + pub lang: DOMString, + pub translate: bool, + pub dir: DOMString, + pub hidden: bool, + pub inert: bool, + + pub access_key: DOMString, + pub access_key_label: DOMString, + pub draggable: bool, + pub spellcheck: bool, + pub autocapitalize: DOMString, + pub inner_text: DOMString, + pub outer_text: DOMString, +} diff --git a/src/js/mod.rs b/src/js/mod.rs new file mode 100644 index 0000000..e69de29 diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 0000000..d180b99 --- /dev/null +++ b/src/main.rs @@ -0,0 +1,13 @@ +//! A modern compliant Rust implementation of the HTML5/CSS3/JS specs bundled into a web browser. + +#![deny(missing_docs)] + +pub mod css; +pub mod html; +// pub mod js; + +fn main() { + let html = include_str!("../tests/minimal.html"); + + println!("{}", html); +} diff --git a/tests/minimal.html b/tests/minimal.html new file mode 100644 index 0000000..563ec57 --- /dev/null +++ b/tests/minimal.html @@ -0,0 +1,9 @@ + + + + +

My First Heading

+

My first paragraph.

+ + + \ No newline at end of file