void EnmlFormatter::removeInvalidAttributes(QWebElement &node) { // Remove any invalid attributes QStringList attributes = node.attributeNames(); for (int i=0; i<attributes.size(); i++) { if (!isAttributeValid(attributes[i])) { node.removeAttribute(attributes[i]); } } }
bool ClickToFlash::checkElement(QWebElement el) { if (argumentNames_ == el.attributeNames()) { foreach (const QString &name, argumentNames_) { if (argumentValues_.indexOf(el.attribute(name)) == -1) { return false; } } return true; }
extern QVariantMap toMap(QWebElement el, QStringList css_attrs) { QVariantMap map; map["isNull"] = false; map["classes"] = QVariant(el.classes()); map["tagName"] = QVariant(el.tagName()); QRect rect = el.geometry(); QVariantMap geo; geo["width"] = rect.width(); geo["height"] = rect.height(); geo["x"] = rect.x(); geo["y"] = rect.y(); map["geometry"] = QVariant(geo); QVariantMap attrs; QStringList attributes = el.attributeNames(); foreach(QString name,attributes) { attrs[name] = el.attribute(name); }