MCPcopy Create free account
hub / github.com/beginner-jhj/mini_browser / get_attribute

Method get_attribute

src/html/node.cpp:139–149  ·  view source on GitHub ↗

* \brief Retrieves an HTML attribute value by name. * * Looks up an attribute in the attributes map. Returns empty string if * the attribute doesn't exist. * * \param name The attribute name to retrieve. * \return The attribute value, or empty string if not found. */

Source from the content-addressed store, hash-verified

137 * \return The attribute value, or empty string if not found.
138 */
139std::string NODE::get_attribute(const std::string &name) const
140{
141 try
142 {
143 return m_attributes.at(name);
144 }
145 catch (...)
146 {
147 return "";
148 }
149}
150
151/**
152 * \brief Sets a CSS style property on this node.

Callers 5

mainFunction · 0.80
layout_image_elementFunction · 0.80
matchesMethod · 0.80
apply_styleFunction · 0.80
bubble_for_linkMethod · 0.80

Calls

no outgoing calls

Tested by 1

mainFunction · 0.64