Files
cef/patch/patches/blink_web_element_4200240.patch
Marshall Greenblatt f8a746373e Update to Chromium version 138.0.7204.0 (#1465706)
Mac: Require Xcode 16.3 (16E140) and SDK 15.4 (24E241)
2025-06-03 14:20:59 -04:00

44 lines
1.6 KiB
Diff

diff --git third_party/blink/public/web/web_element.h third_party/blink/public/web/web_element.h
index 75e28e8088848..9abea1a35f11b 100644
--- third_party/blink/public/web/web_element.h
+++ third_party/blink/public/web/web_element.h
@@ -83,6 +83,9 @@ class BLINK_EXPORT WebElement : public WebNode {
WebString TextContent() const;
WebString TextContentAbridged(unsigned int max_length) const;
WebString InnerHTML() const;
+ WebString AttributeLocalName(unsigned index) const;
+ WebString AttributeValue(unsigned index) const;
+ unsigned AttributeCount() const;
void Focus();
diff --git third_party/blink/renderer/core/exported/web_element.cc third_party/blink/renderer/core/exported/web_element.cc
index 6859e192048d3..2b14176b6aa0d 100644
--- third_party/blink/renderer/core/exported/web_element.cc
+++ third_party/blink/renderer/core/exported/web_element.cc
@@ -124,6 +124,24 @@ void WebElement::SetAttribute(const WebString& attr_name,
IGNORE_EXCEPTION_FOR_TESTING);
}
+unsigned WebElement::AttributeCount() const {
+ if (!ConstUnwrap<Element>()->hasAttributes())
+ return 0;
+ return ConstUnwrap<Element>()->Attributes().size();
+}
+
+WebString WebElement::AttributeLocalName(unsigned index) const {
+ if (index >= AttributeCount())
+ return WebString();
+ return ConstUnwrap<Element>()->Attributes().at(index).LocalName();
+}
+
+WebString WebElement::AttributeValue(unsigned index) const {
+ if (index >= AttributeCount())
+ return WebString();
+ return ConstUnwrap<Element>()->Attributes().at(index).Value();
+}
+
WebString WebElement::TextContent() const {
return ConstUnwrap<Element>()->textContent();
}