Explorar o código

LibWeb: Add support for "align-content: normal" in CSS parser

Aliaksandr Kalenik hai 1 ano
pai
achega
b395cfccb0

+ 1 - 1
Tests/LibWeb/Text/expected/css/getComputedStyle-print-all.txt

@@ -1,6 +1,6 @@
 -webkit-appearance: auto
 -webkit-appearance: auto
 accent-color: auto
 accent-color: auto
-align-content: stretch
+align-content: normal
 align-items: normal
 align-items: normal
 align-self: auto
 align-self: auto
 animation-delay: 0s
 animation-delay: 0s

+ 1 - 0
Userland/Libraries/LibWeb/CSS/Enums.json

@@ -1,5 +1,6 @@
 {
 {
   "align-content": [
   "align-content": [
+    "normal",
     "flex-start",
     "flex-start",
     "flex-end",
     "flex-end",
     "center",
     "center",

+ 1 - 1
Userland/Libraries/LibWeb/CSS/Properties.json

@@ -17,7 +17,7 @@
   },
   },
   "align-content": {
   "align-content": {
     "inherited": false,
     "inherited": false,
-    "initial": "stretch",
+    "initial": "normal",
     "valid-types": [
     "valid-types": [
       "align-content"
       "align-content"
     ]
     ]

+ 2 - 1
Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp

@@ -1637,6 +1637,7 @@ void FlexFormattingContext::align_all_flex_lines()
             break;
             break;
         }
         }
 
 
+        case CSS::AlignContent::Normal:
         case CSS::AlignContent::Stretch:
         case CSS::AlignContent::Stretch:
             start_of_current_line = 0;
             start_of_current_line = 0;
             break;
             break;
@@ -2146,7 +2147,7 @@ void FlexFormattingContext::handle_align_content_stretch()
         return;
         return;
 
 
     // align-content is stretch,
     // align-content is stretch,
-    if (flex_container().computed_values().align_content() != CSS::AlignContent::Stretch)
+    if (flex_container().computed_values().align_content() != CSS::AlignContent::Stretch && flex_container().computed_values().align_content() != CSS::AlignContent::Normal)
         return;
         return;
 
 
     // and the sum of the flex lines' cross sizes is less than the flex container’s inner cross size,
     // and the sum of the flex lines' cross sizes is less than the flex container’s inner cross size,