WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-84183-v2.diff (text/plain), 2.74 KB, created by
Andreas Kling
on 2012-04-17 13:43:07 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Andreas Kling
Created:
2012-04-17 13:43:07 PDT
Size:
2.74 KB
patch
obsolete
>diff --git a/Source/WebKit/chromium/ChangeLog b/Source/WebKit/chromium/ChangeLog >index e461cde..f52ca41 100644 >--- a/Source/WebKit/chromium/ChangeLog >+++ b/Source/WebKit/chromium/ChangeLog >@@ -1,3 +1,21 @@ >+2012-04-17 Andreas Kling <kling@webkit.org> >+ >+ [chromium] Add simplified API for iterating over a WebElement's attributes. >+ <http://webkit.org/b/84183> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Add attributeCount(), attributeName(index) and attributeValue(index) to the >+ WebElement API so that call sites currently using WebNamedNodeMap can be >+ converted, which will ultimately allow us to refactor WebCore::Attribute >+ on <http://webkit.org/b/83440>. >+ >+ * public/WebElement.h: >+ * src/WebElement.cpp: >+ (WebKit::WebElement::attributeCount): >+ (WebKit::WebElement::attributeName): >+ (WebKit::WebElement::attributeValue): >+ > 2012-04-16 Terry Anderson <tdanderson@chromium.org> > > [chromium] Allow WebGestureEvent to store four floating point values >diff --git a/Source/WebKit/chromium/public/WebElement.h b/Source/WebKit/chromium/public/WebElement.h >index a3a0612..c9c19aef 100644 >--- a/Source/WebKit/chromium/public/WebElement.h >+++ b/Source/WebKit/chromium/public/WebElement.h >@@ -61,6 +61,9 @@ struct WebRect; > WEBKIT_EXPORT WebString innerText(); > WEBKIT_EXPORT WebDocument document() const; > WEBKIT_EXPORT void requestFullScreen(); >+ WEBKIT_EXPORT WebString attributeName(unsigned index) const; >+ WEBKIT_EXPORT WebString attributeValue(unsigned index) const; >+ WEBKIT_EXPORT unsigned attributeCount() const; > > // Returns the language code specified for this element. This attribute > // is inherited, so the returned value is drawn from the closest parent >diff --git a/Source/WebKit/chromium/src/WebElement.cpp b/Source/WebKit/chromium/src/WebElement.cpp >index e6a1b6e..5754453 100644 >--- a/Source/WebKit/chromium/src/WebElement.cpp >+++ b/Source/WebKit/chromium/src/WebElement.cpp >@@ -83,6 +83,27 @@ bool WebElement::setAttribute(const WebString& attrName, const WebString& attrVa > return !exceptionCode; > } > >+unsigned WebElement::attributeCount() const >+{ >+ if (!m_private->hasAttributes()) >+ return 0; >+ return m_private->attributeCount(); >+} >+ >+WebString WebElement::attributeName(unsigned index) const >+{ >+ if (index >= attributeCount()) >+ return WebString(); >+ return m_private->attributeItem(index)->name(); >+} >+ >+WebString WebElement::attributeValue(unsigned index) const >+{ >+ if (index >= attributeCount()) >+ return WebString(); >+ return m_private->attributeItem(index)->value(); >+} >+ > WebNamedNodeMap WebElement::attributes() const > { > return WebNamedNodeMap(m_private->attributes());
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
webkit.review.bot
:
commit-queue-
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 84183
:
137585
|
137595
|
137626
|
137789