mirror of
https://github.com/zebrajr/ladybird.git
synced 2025-12-06 00:19:53 +01:00
Meta/LibWeb: Use correct shorthand range in is_inherited_property
This commit is contained in:
parent
2be45c1ccf
commit
78595f05d8
|
|
@ -595,7 +595,7 @@ bool is_animatable_property(PropertyID property_id)
|
|||
|
||||
bool is_inherited_property(PropertyID property_id)
|
||||
{
|
||||
if (property_id >= first_inherited_shorthand_property_id && property_id <= last_inherited_longhand_property_id)
|
||||
if (property_id >= first_inherited_shorthand_property_id && property_id <= last_inherited_shorthand_property_id)
|
||||
return true;
|
||||
if (property_id >= first_inherited_longhand_property_id && property_id <= last_inherited_longhand_property_id)
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ set(TEST_SOURCES
|
|||
TestCSSIDSpeed.cpp
|
||||
TestCSSPixels.cpp
|
||||
TestCSSTokenStream.cpp
|
||||
TestCSSInheritedProperty.cpp
|
||||
TestFetchInfrastructure.cpp
|
||||
TestFetchURL.cpp
|
||||
TestHTMLTokenizer.cpp
|
||||
|
|
|
|||
29
Tests/LibWeb/TestCSSInheritedProperty.cpp
Normal file
29
Tests/LibWeb/TestCSSInheritedProperty.cpp
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
/*
|
||||
* Copyright (c) 2024, Pavel Shliak <shlyakpavel@gmail.com>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibTest/TestCase.h>
|
||||
#include <LibWeb/CSS/PropertyID.h>
|
||||
|
||||
namespace Web {
|
||||
|
||||
TEST_CASE(is_inherited_property_test)
|
||||
{
|
||||
// Test inherited properties
|
||||
EXPECT(CSS::is_inherited_property(CSS::PropertyID::Color));
|
||||
EXPECT(CSS::is_inherited_property(CSS::PropertyID::FontSize));
|
||||
EXPECT(CSS::is_inherited_property(CSS::PropertyID::Visibility));
|
||||
|
||||
// Test non-inherited properties
|
||||
EXPECT(!CSS::is_inherited_property(CSS::PropertyID::Margin));
|
||||
EXPECT(!CSS::is_inherited_property(CSS::PropertyID::Padding));
|
||||
EXPECT(!CSS::is_inherited_property(CSS::PropertyID::Border));
|
||||
|
||||
// Edge cases
|
||||
EXPECT(!CSS::is_inherited_property(CSS::PropertyID::Invalid));
|
||||
EXPECT(!CSS::is_inherited_property(CSS::PropertyID::All));
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user