mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-09-22 13:01:05 +03:00
Optimize CSS attribute selector matching:
Resolve standard property definitions and data-attribute classification when selectors are parsed, avoiding repeated specification lookups and attribute-name checks during matching. Fast-path existence-only data selectors without retrieving their values, while preserving all attribute operator behavior. Add standard-property coverage and an attribute-focused benchmark showing a 41.7% reduction in matching time.
This commit is contained in:
@@ -1552,6 +1552,10 @@ UTEST( UIHTML, DataProperties ) {
|
||||
EXPECT_EQ( sceneNode->getRoot()->querySelectorAll( "[data-id*=\"ser\"]" ).size(), (size_t)1 );
|
||||
EXPECT_EQ( sceneNode->getRoot()->querySelectorAll( "[data-empty]" ).size(), (size_t)1 );
|
||||
EXPECT_EQ( sceneNode->getRoot()->querySelectorAll( "[data-missing]" ).size(), (size_t)0 );
|
||||
EXPECT_TRUE( StyleSheetSelector( "[width]" ).select( target, false ) );
|
||||
EXPECT_TRUE( StyleSheetSelector( "[width=\"" + target->getPropertyString( "width" ) + "\"]" )
|
||||
.select( target, false ) );
|
||||
EXPECT_FALSE( StyleSheetSelector( "[unknown-property]" ).select( target, false ) );
|
||||
|
||||
EXPECT_TRUE( target->getDataPropertyString( "data-language" ) == "cpp" );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user