Pārlūkot izejas kodu

LibWeb: Don't render list item markers for "list-style-type: none"

Andreas Kling 5 gadi atpakaļ
vecāks
revīzija
0d5be35c1f

+ 9 - 0
Libraries/LibWeb/CSS/StyleResolver.cpp

@@ -359,6 +359,15 @@ static void set_property_expanding_shorthands(StyleProperties& style, CSS::Prope
         return;
     }
 
+    if (property_id == CSS::PropertyID::ListStyle) {
+        auto parts = split_on_whitespace(value.to_string());
+        if (!parts.is_empty()) {
+            auto value = parse_css_value(parts[0]);
+            style.set_property(CSS::PropertyID::ListStyleType, value);
+        }
+        return;
+    }
+
     style.set_property(property_id, value);
 }
 

+ 4 - 0
Libraries/LibWeb/Layout/LayoutListItem.cpp

@@ -47,6 +47,10 @@ void LayoutListItem::layout(LayoutMode layout_mode)
 
     LayoutBlock::layout(layout_mode);
 
+    if (style().string_or_fallback(CSS::PropertyID::ListStyleType, "disc") == "none") {
+        return;
+    }
+
     if (!m_marker) {
         m_marker = adopt(*new LayoutListItemMarker);
         if (first_child())