1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 13:48:12 +00:00
serenity/Userland/Libraries/LibWeb
Sam Atkins c8c2a8df56 LibWeb: Make '0' always be both a number and a length in CSS
A '0' token can be interpreted both as a Number, and as a Length. This
is problematic as in our CSS parser, we often call parse_css_value()
first, to figure out what something is, and then assign it. So we do not
know in advance whether we want a Length or not. Previously, it always
got parsed as a Length, and then every place that expected a
NumericStyleValue had to also check for a Length(0), which is easy to
forget to do.

In particular, this was causing issues with the `flex` property parsing.

To solve this, we now always parse 0 as a NumericStyleValue, and NSVs of
0 pretend to be a Length(0px) when asked. In two places, we were casting
to a LengthStyleValue* based on is_length(), which no longer works, so
those have been adjusted to use `StyleValue::to_length()` instead. They
also now check for `is_numeric()` first, to avoid the extra conversion
to a Length and back.

Possibly this opens up new issues elsewhere. In my testing it seems
fine, but until we can get CSS test suites running, it's hard to know
for certain.
2021-08-14 12:45:01 +02:00
..
Bindings LibWeb: Switch to new CSS Parser :^) 2021-08-02 19:01:25 +04:30
CodeGenerators LibWeb: Remove unused header includes 2021-08-01 08:10:16 +02:00
Cookie Everywhere: Make use of container version of all_of 2021-08-03 10:46:43 +02:00
CSS LibWeb: Make '0' always be both a number and a length in CSS 2021-08-14 12:45:01 +02:00
DOM LibWeb: Ignore svg elements outside of <svg> when building layout tree 2021-08-05 20:17:08 +02:00
DumpLayoutTree Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
HighResolutionTime Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
HTML LibWeb: Remove pointless type casts 2021-08-12 21:10:44 +02:00
Layout Everywhere: Use tobyase@serenityos.org for my copyright headers 2021-08-09 21:43:05 +02:00
Loader Browser+LibWeb: Silence some debug spams 2021-08-08 00:33:14 +02:00
NavigationTiming Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
Page LibWeb: Handle when the last selected node does not contain text 2021-07-14 17:16:39 +02:00
Painting LibWeb: Clear SVG context after SVGSVGBox children are painted 2021-08-05 20:17:08 +02:00
Scripts Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
SVG LibWeb: Ignore svg elements outside of <svg> when building layout tree 2021-08-05 20:17:08 +02:00
Tests LibWeb: Fix syntax for Table test 2021-07-11 14:14:01 +02:00
UIEvents AK: Rename adopt() to adopt_ref() 2021-04-23 16:46:57 +02:00
WebAssembly LibWeb: Remove unused header includes 2021-08-01 08:10:16 +02:00
XHR LibJS: Rename Function => FunctionObject 2021-06-27 22:36:04 +02:00
CMakeLists.txt LibWeb: Switch to new CSS Parser :^) 2021-08-02 19:01:25 +04:30
DOMTreeJSONModel.cpp Everywhere: Replace Model::update() with Model::invalidate() 2021-08-06 19:14:31 +02:00
DOMTreeJSONModel.h Everywhere: Replace Model::update() with Model::invalidate() 2021-08-06 19:14:31 +02:00
DOMTreeModel.cpp Everywhere: Replace Model::update() with Model::invalidate() 2021-08-06 19:14:31 +02:00
DOMTreeModel.h Everywhere: Replace Model::update() with Model::invalidate() 2021-08-06 19:14:31 +02:00
Dump.cpp LibWeb: Fix dump_selector() handling of attribute selectors 2021-07-31 00:18:11 +02:00
Dump.h LibWeb: Convert CSS Dump, Selector, & SelectorEngine to east const 2021-07-14 13:31:00 +02:00
FontCache.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
FontCache.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
Forward.h LibWeb: Plumb calculated StyleValues into CSS::Length 2021-07-24 03:02:07 +04:30
InProcessWebView.cpp LibWeb: Remove unused header includes 2021-08-01 08:10:16 +02:00
InProcessWebView.h LibWeb: Remove now-duplicated actions from IPWV regarding text selection 2021-07-14 17:16:39 +02:00
LayoutTreeModel.cpp Everywhere: Replace Model::update() with Model::invalidate() 2021-08-06 19:14:31 +02:00
LayoutTreeModel.h Everywhere: Replace Model::update() with Model::invalidate() 2021-08-06 19:14:31 +02:00
Namespace.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
Namespace.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
Origin.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
OutOfProcessWebView.cpp LibGfx: Use "try_" prefix for static factory functions 2021-07-21 18:02:15 +02:00
OutOfProcessWebView.h LibWeb: Add OOPWV IPC for selecting all text 2021-07-14 17:16:39 +02:00
QualifiedName.h LibWeb: Use HTML-uppercased qualified name for the Element node name 2021-05-04 23:24:03 +01:00
StylePropertiesModel.cpp Everywhere: Replace Model::update() with Model::invalidate() 2021-08-06 19:14:31 +02:00
StylePropertiesModel.h Everywhere: Replace Model::update() with Model::invalidate() 2021-08-06 19:14:31 +02:00
TreeNode.h AK: Rename downcast<T> => verify_cast<T> 2021-06-24 19:57:01 +02:00
URLEncoder.cpp LibWeb: Use correct percent encode set for form submissions 2021-06-01 23:26:03 +04:30
URLEncoder.h LibWeb: Use correct percent encode set for form submissions 2021-06-01 23:26:03 +04:30
WebContentClient.cpp LibWeb+WebContent: Add IPC flow for Inspect DOM Tree 2021-06-29 23:06:48 +02:00
WebContentClient.h LibWeb+WebContent: Add IPC flow for Inspect DOM Tree 2021-06-29 23:06:48 +02:00
WebViewHooks.h LibWeb+WebContent: Add IPC flow for Inspect DOM Tree 2021-06-29 23:06:48 +02:00