RawPtr<EditingStyle> StyledMarkupTraverser<Strategy>::createInlineStyle(Element& element)
{
    RawPtr<EditingStyle> inlineStyle = nullptr;

    if (shouldApplyWrappingStyle(element)) {
        inlineStyle = m_wrappingStyle->copy();
        inlineStyle->removePropertiesInElementDefaultStyle(&element);
        inlineStyle->removeStyleConflictingWithStyleOfElement(&element);
    } else {
        inlineStyle = EditingStyle::create();
    }

    if (element.isStyledElement() && element.inlineStyle())
        inlineStyle->overrideWithStyle(element.inlineStyle());

    if (element.isHTMLElement() && shouldAnnotate())
        inlineStyle->mergeStyleFromRulesForSerialization(&toHTMLElement(element));

    return inlineStyle;
}