tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 63fc8cb376519cd708411f78f542fb1b84d91100
parent 2ced0045c3ebd68a8ed9f30f4b7f4942bcfa2f43
Author: Jan Varga <jan.varga@gmail.com>
Date:   Sat, 15 Nov 2025 23:17:30 +0000

Bug 1998916 - Rename Servo_DeclarationBlock_GetPropertyValueById; r=emilio,firefox-style-system-reviewers,layout-reviewers

This patch renames Servo_DeclarationBlock_GetPropertyValueById to
Servo_DeclarationBlock_GetPropertyValueByNonCustomId to make its scope
explicit and allow adding Servo_DeclarationBlock_GetPropertyValueById that
takes a CSSPropertyId. No behavior changes.

This is needed before adding DeclarationBlock::GetPropertyValueById that takes
a CSSPropertyId.

Differential Revision: https://phabricator.services.mozilla.com/D271763

Diffstat:
Mlayout/inspector/InspectorUtils.cpp | 2+-
Mlayout/style/DeclarationBlock.h | 3++-
Mlayout/style/test/gtest/StyloParsingBench.cpp | 8++++----
Mservo/ports/geckolib/glue.rs | 6+++---
4 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/layout/inspector/InspectorUtils.cpp b/layout/inspector/InspectorUtils.cpp @@ -287,7 +287,7 @@ class ReadOnlyInspectorDeclaration final : public nsDOMCSSDeclaration { Servo_DeclarationBlock_GetPropertyValue(mRaw, &aPropName, &aValue); } void GetPropertyValue(NonCustomCSSPropertyId aId, nsACString& aValue) final { - Servo_DeclarationBlock_GetPropertyValueById(mRaw, aId, &aValue); + Servo_DeclarationBlock_GetPropertyValueByNonCustomId(mRaw, aId, &aValue); } void IndexedGetter(uint32_t aIndex, bool& aFound, nsACString& aPropName) final { diff --git a/layout/style/DeclarationBlock.h b/layout/style/DeclarationBlock.h @@ -181,7 +181,8 @@ class DeclarationBlock final { void GetPropertyValueById(NonCustomCSSPropertyId aPropId, nsACString& aValue) const { - Servo_DeclarationBlock_GetPropertyValueById(mRaw, aPropId, &aValue); + Servo_DeclarationBlock_GetPropertyValueByNonCustomId(mRaw, aPropId, + &aValue); } bool GetPropertyIsImportant(const nsACString& aProperty) const { diff --git a/layout/style/test/gtest/StyloParsingBench.cpp b/layout/style/test/gtest/StyloParsingBench.cpp @@ -69,7 +69,7 @@ static void ServoSetPropertyByIdBench(const nsACString& css) { } } -static void ServoGetPropertyValueById() { +static void ServoGetPropertyValueByNonCustomId() { RefPtr<StyleLockedDeclarationBlock> block = Servo_DeclarationBlock_CreateEmpty().Consume(); @@ -87,8 +87,8 @@ static void ServoGetPropertyValueById() { for (int i = 0; i < GETPROPERTY_REPETITIONS; i++) { nsAutoCString value; - Servo_DeclarationBlock_GetPropertyValueById(block, eCSSProperty_width, - &value); + Servo_DeclarationBlock_GetPropertyValueByNonCustomId( + block, eCSSProperty_width, &value); ASSERT_TRUE(value.EqualsLiteral("10px")); } } @@ -104,6 +104,6 @@ MOZ_GTEST_BENCH(Stylo, [] { ServoSetPropertyByIdBench(" 10px"_ns); }); MOZ_GTEST_BENCH(Stylo, Servo_DeclarationBlock_GetPropertyById_Bench, - ServoGetPropertyValueById); + ServoGetPropertyValueByNonCustomId); #endif diff --git a/servo/ports/geckolib/glue.rs b/servo/ports/geckolib/glue.rs @@ -5356,14 +5356,14 @@ pub unsafe extern "C" fn Servo_DeclarationBlock_GetPropertyValue( } #[no_mangle] -pub unsafe extern "C" fn Servo_DeclarationBlock_GetPropertyValueById( +pub unsafe extern "C" fn Servo_DeclarationBlock_GetPropertyValueByNonCustomId( declarations: &LockedDeclarationBlock, - property: NonCustomCSSPropertyId, + property_id: NonCustomCSSPropertyId, value: &mut nsACString, ) { get_property_value( declarations, - get_property_id_from_noncustomcsspropertyid!(property, ()), + get_property_id_from_noncustomcsspropertyid!(property_id, ()), value, ) }