Преглед на файлове

LibWeb: Support CSSStyleDeclaration.cssFloat

Unlike all the other CSS properties, 'float' is special, and can only be
accessed via 'cssFloat' on CSSStyleDeclaration. So this patch adds
support for that. 1 point on ACID3! :^)
Andreas Kling преди 3 години
родител
ревизия
b45ed48ca7
променени са 1 файла, в които са добавени 4 реда и са изтрити 0 реда
  1. 4 0
      Userland/Libraries/LibWeb/Bindings/CSSStyleDeclarationWrapperCustom.cpp

+ 4 - 0
Userland/Libraries/LibWeb/Bindings/CSSStyleDeclarationWrapperCustom.cpp

@@ -12,6 +12,10 @@ namespace Web::Bindings {
 
 static CSS::PropertyID property_id_from_name(StringView name)
 {
+    // FIXME: Perhaps this should go in the code generator.
+    if (name == "cssFloat"sv)
+        return CSS::PropertyID::Float;
+
     if (auto property_id = CSS::property_id_from_camel_case_string(name); property_id != CSS::PropertyID::Invalid)
         return property_id;