mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 11:49:44 +00:00
Meta/LibWeb: Use correct shorthand range in is_inherited_property
This commit is contained in:
parent
2be45c1ccf
commit
78595f05d8
Notes:
github-actions[bot]
2024-12-22 11:35:07 +00:00
Author: https://github.com/shlyakpavel
Commit: 78595f05d8
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2984
Reviewed-by: https://github.com/alimpfard
Reviewed-by: https://github.com/gmta
3 changed files with 31 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue