Loading editor/src/htmlimport.cpp +13 −1 Original line number Diff line number Diff line Loading @@ -1096,12 +1096,24 @@ void blogi::htmlimport::htmlElementToWidgetXml( std::map<std::string,std::string> elementEnv = resolveCustomProperties(cssProps, frame.customPropertyEnv); // This element's own attributes, so a descendant's matched rule // can verify an attribute-selector condition on THIS ancestor // (e.g. the "[data-fit=fill]" in ".fade-box[data-fit=fill] img") // instead of it being ignored -- see AncestorFrame::attributes // and getCSSRules's own use of the same pattern for the target // element itself. std::map<std::string,std::string> elemAttrs; for (const libhtmlpp::HtmlElement::Attributes *attr = el->firstAttribute(); attr; attr = attr->nextAttribute()) { elemAttrs[attr->getKey()] = attr->getValue(); } // This element's own ancestor chain, for its children's matching // (see Frame::ancestorChain) -- appended once here and reused at // every childFrames.push_back below, rather than re-splitting // cssClass per push site. std::vector<libhtmlpp::AncestorFrame> childAncestorChain = frame.ancestorChain; childAncestorChain.push_back({tag, splitClassList(cssClass), elemId}); childAncestorChain.push_back({tag, splitClassList(cssClass), elemId, elemAttrs}); // ---- Map HTML tags to widget types ---- Loading Loading
editor/src/htmlimport.cpp +13 −1 Original line number Diff line number Diff line Loading @@ -1096,12 +1096,24 @@ void blogi::htmlimport::htmlElementToWidgetXml( std::map<std::string,std::string> elementEnv = resolveCustomProperties(cssProps, frame.customPropertyEnv); // This element's own attributes, so a descendant's matched rule // can verify an attribute-selector condition on THIS ancestor // (e.g. the "[data-fit=fill]" in ".fade-box[data-fit=fill] img") // instead of it being ignored -- see AncestorFrame::attributes // and getCSSRules's own use of the same pattern for the target // element itself. std::map<std::string,std::string> elemAttrs; for (const libhtmlpp::HtmlElement::Attributes *attr = el->firstAttribute(); attr; attr = attr->nextAttribute()) { elemAttrs[attr->getKey()] = attr->getValue(); } // This element's own ancestor chain, for its children's matching // (see Frame::ancestorChain) -- appended once here and reused at // every childFrames.push_back below, rather than re-splitting // cssClass per push site. std::vector<libhtmlpp::AncestorFrame> childAncestorChain = frame.ancestorChain; childAncestorChain.push_back({tag, splitClassList(cssClass), elemId}); childAncestorChain.push_back({tag, splitClassList(cssClass), elemId, elemAttrs}); // ---- Map HTML tags to widget types ---- Loading