feat(render): implement basic CSS cascade matching from <style> blocks
This commit is contained in:
1 parent
bed6d6f619
commit
193e30deb5
5 files changed
+93
-17
No files matched your search
@@ -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() {
|
||||
|
||||
Reference in new issue
Block a user