Skip to content

Commit

Permalink
fix: display: inline-flex
Browse files Browse the repository at this point in the history
  • Loading branch information
hanclang committed Nov 22, 2024
1 parent f84f057 commit bb1939d
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 2 deletions.
3 changes: 1 addition & 2 deletions src/css/property-descriptors/display.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ const parseDisplayValue = (display: string): Display => {
case 'table':
return DISPLAY.TABLE;
case 'flex':
case 'inline-flex':
case '-webkit-flex':
return DISPLAY.FLEX;
case 'grid':
Expand Down Expand Up @@ -107,8 +108,6 @@ const parseDisplayValue = (display: string): Display => {
return DISPLAY.INLINE_LIST_ITEM;
case 'inline-table':
return DISPLAY.INLINE_TABLE;
case 'inline-flex':
return DISPLAY.INLINE_FLEX;
case 'inline-grid':
return DISPLAY.INLINE_GRID;
}
Expand Down
63 changes: 63 additions & 0 deletions tests/reftests/display/inline-flex.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<!DOCTYPE html>
<html>
<head>
<title>diaplay inline-flex attribute tests</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style>
.ul1 {
display: inline-flex;
list-style-type: none;
}

.ul1 li {
color: red;
font-size: 20px;
font-weight: bold;
-webkit-text-stroke: 1px blue;
}

.ul2 {
display: flex;
list-style-type: none;
}

.ul2 li icon {
border: 1px black solid;
background: lightblue;
border-radius: 5px;
display: inline-flex;
}
.ul2 li icon::before,
.ul2 li icon::after {
content: '';
width: 64px;
height: 64px;
}
.ul2 li icon::before {
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTNui8sowAAAAWdEVYdENyZWF0aW9uIFRpbWUAMDcvMjQvMjQbg7tCAAAFwUlEQVRYhe2XTWxT2RXHf882CYkS8FNwNNSCk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37K4GGfLFheGYRCJRIhGo5w8eZI9e/ZwF6iLQSQvmauBIdO69gEdJhusO2Ztt2lrtwPMA8uzs/9kYSFOPB7D5VqjpGQrO3bswOl0UlZWRk9PD/X19USAD2MQiW2ECJvQmCceAz7JFd9L+h0yANPAy4cP+5mfnyUeX8Tr9fDee5VcvnyZJ0+esLS0xNjYGNevX6e2ttaCAB7HLIFMg9x+LAbtMehev5UVzwJImgf+1N//iC++eE0qlWR6eo7FxTitra34fD6cTie1tbVI4sqVK/j9/hwICrRYDJqAu5bWaL64PQIAdxKJZLy39wbFxSmKipbZssXJq1evcLlcTE1NMT4+zvDwMKFQiEgkkg17NYXNxDpe03aokGsWQNLfgT88ejREOPwXvvrqX0Sj33DgwAE8Hg/FxcXs37+fffv2cfv2bV6/fk0AK+E2AwBr77Xtv2GgMcch52i0oKf37t2vTz/9tbZuLdalS5cUDAZVUVGh1tZW7d69W2DV8mSBNrTJuK38lAOx4Xy2lnX5gw9+rubmE3K7y1VeXiqPx52dIAAKFxDpse1+33XfDmEU+iw3DOMc8LuGhiPU1f2U1dVlJib+wb17n9MBtBUI9WPShZ22ANCF/dTZ4HcXaCr4USrp90Dw4cM/Ewo9Q0rxbTxVyBWA3lzxJmD0MVbd520VVK9DNQLmpl8q6ch0AMter0dHf/GTbPg60iEOp3+zcW1NrISTmc6LcPpqrvv2Zd72+yA+BJ4CcjhcORBtueL5xWBi7fcyN4L22cP9n0BsA34JPAHWyJ0sVkDcbn15/j32mwWTsJAZhmHvVmPlWQwrr/KXOt8Opf0fY+2I/z3A/8re+V+zdw7wb2NAKm4NtnzaAAAAAElFTkSuQmCC);
}
.ul2 li icon::after {
opacity: 0.5;
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTNui8sowAAAAWdEVYdENyZW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Gq0GIx/sLePmm0rJdmdttphNU0+B2WRy6XQ69COjfB4Kc05RyPT7QVEIhMKc0TROSzLtZhO906czkpVJZkcHG+9axUFZobuqBue3bbj7B7h2bIIFioRDUUDT6LDZ+FzTuP5iH6qqYrNZk/sHBqYCaGw6+0pVVfVvn9n2Ox7a9SIvVlWTPx7gm5Rk+jPSCLmzMM/KITXbTZ7Zgb+zl4OHt5OZcZbvzZ9H1h1rCSab6O6+wGv1Z3i16SyujnPM93hoNgQouraEHY/8itN19ZxpbNqXkJAwNQklSZKMRuPxp3c8ufCHty7nrfKj9GuC3Pxc0lSBf2SM5q4BhjraCXg9GI3D6M0+El16hgbCDA8YCYeTsObMpnBWBskuO11BhYbT9STrFO5ZsZzK49VseezJBq93eL4sy+PhcPgSAFVVyc7OoqWldceGB37+xE/vXktjYzOtLW3UdfnQf9dKkbeJOZl28h4uZtbKIlwkE3nihOnvauTU419xqraLY+pM+mfkMT/HTmFRAXn5s3nj1b28sWffTmCrqqqhYDA49RRYLBb8fj/Z2Vm0t3f+UlGUvHA4PAz8Hmuxun1pIVvnDsC8XFidwRgGAoxEs9iMlQn45CLUtvLyMSMbjzaAv7EX2G00GtPHx8erU1NTdns8PZE5ssyUCEiShMViZnTUjyzLcXRCiJnA80km4x33zE5h1aIc8n5djKNgBsboW8ZPmP6z52n862k+OtZGWUMXQyHtTeBRWZb7JElCkiRCoRB6vZ5AIBCzPRUATP0hxRRUWSaoaTcA9wHLrTaD0+12kugyI4Sgr3eUto4BxkaDPcDHwGs6idOh6H9Hli/9/jRN+y/70v/95/SqA/gPFLz+FFC6bkIAAAAASUVORK5CYII=);
}

canvas {
border: 1px solid black;
}
</style>
<script type="text/javascript" src="../../test.js"></script>
</head>

<body>
<ul class="ul1">
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ul>
<ul class="ul2">
<li><icon></icon></li>
<li><icon></icon></li>
<li><icon></icon></li>
</ul>
</body>
</html>

0 comments on commit bb1939d

Please sign in to comment.