StyleResolverState state(document().documentElement()); state.setStyle(style()); // sets the current style of the element state.fontBuilder().setup(document().styleScope()); // sets up the font builder for the current state
auto& styleResolver = document().styleResolver(); const auto& fontMetrics = document().fontCascade().fontMetrics(); auto state = StyleResolverState::create( &styleResolver, nullptr, fontMetrics, DisallowStyleSharing); auto* style = resolveStyleTreeSelector(*state, *rootStyle, *selector);This example creates a new StyleResolverState object and uses it to resolve a specific style selector for an element. It also sets the font metrics and specifies that style sharing should be disallowed. Package/Library: WebKit.