feat(render): implement basic CSS cascade matching from <style> blocks

This commit is contained in:
SGavrl committed 2026-07-02 19:47:08 +00:00
1 parent bed6d6f619
commit 193e30deb5
5 files changed
+93 -17

No files matched your search

+2 -2
View File
@@ -22,12 +22,12 @@ pub fn compute_style(tag: &str, inline_css: Option<&str>) -> LayoutStyle {
/// Built-in UA defaults. Inline elements currently map to block layout; real
/// inline/text layout arrives with the text/paint phase.
fn ua_style(tag: &str) -> LayoutStyle {
pub fn ua_style(tag: &str) -> LayoutStyle {
let _ = tag;
LayoutStyle { display: Display::Block, ..Default::default() }
}
fn apply_inline(style: &mut LayoutStyle, css: &str) {
pub fn apply_inline(style: &mut LayoutStyle, css: &str) {
for raw in css.split(';') {
let decl = raw.trim();
if decl.is_empty() {