summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordmazzoni@chromium.org <dmazzoni@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-25 14:52:25 +0000
committerdmazzoni@chromium.org <dmazzoni@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-25 14:52:25 +0000
commit245bed0b07a12b2753e236eb741eeda661154c14 (patch)
treedfa5472f37268c0f55b4fd831472d2081871ec1e
parent1e1195e5b3e90338d9b8be979a75320902cee62f (diff)
downloadchromium_src-245bed0b07a12b2753e236eb741eeda661154c14.zip
chromium_src-245bed0b07a12b2753e236eb741eeda661154c14.tar.gz
chromium_src-245bed0b07a12b2753e236eb741eeda661154c14.tar.bz2
Revert 57327 - Re-landing. Add html node info (tag name, attributes, and computed display)
and document info (url, title, mimetype, doctype) to WebAccessibility. BUG=none TEST=Modified unit test: RenderMessagesUnittest.WebAccessibility Review URL: http://codereview.chromium.org/3013035 TBR=dmazzoni@chromium.org Review URL: http://codereview.chromium.org/3132040 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57330 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/common/render_messages.cc4
-rw-r--r--chrome/common/render_messages_unittest.cc13
-rw-r--r--webkit/glue/webaccessibility.cc34
-rw-r--r--webkit/glue/webaccessibility.h12
4 files changed, 0 insertions, 63 deletions
diff --git a/chrome/common/render_messages.cc b/chrome/common/render_messages.cc
index 10b22e4..3e17733 100644
--- a/chrome/common/render_messages.cc
+++ b/chrome/common/render_messages.cc
@@ -792,7 +792,6 @@ void ParamTraits<webkit_glue::WebAccessibility>::Write(Message* m,
WriteParam(m, p.location);
WriteParam(m, p.attributes);
WriteParam(m, p.children);
- WriteParam(m, p.html_attributes);
}
bool ParamTraits<webkit_glue::WebAccessibility>::Read(
@@ -814,7 +813,6 @@ bool ParamTraits<webkit_glue::WebAccessibility>::Read(
ret = ret && ReadParam(m, iter, &p->location);
ret = ret && ReadParam(m, iter, &p->attributes);
ret = ret && ReadParam(m, iter, &p->children);
- ret = ret && ReadParam(m, iter, &p->html_attributes);
return ret;
}
@@ -836,8 +834,6 @@ void ParamTraits<webkit_glue::WebAccessibility>::Log(const param_type& p,
LogParam(p.attributes, l);
l->append(", ");
LogParam(p.children, l);
- l->append(", ");
- LogParam(p.html_attributes, l);
l->append(")");
}
diff --git a/chrome/common/render_messages_unittest.cc b/chrome/common/render_messages_unittest.cc
index d45d5df..4fc0aab 100644
--- a/chrome/common/render_messages_unittest.cc
+++ b/chrome/common/render_messages_unittest.cc
@@ -23,10 +23,6 @@ TEST(RenderMessagesUnittest, WebAccessibility) {
(1 << webkit_glue::WebAccessibility::STATE_CHECKED) |
(1 << webkit_glue::WebAccessibility::STATE_FOCUSED);
input.location = WebKit::WebRect(11, 22, 333, 444);
- input.html_attributes.push_back(
- std::pair<string16, string16>(ASCIIToUTF16("id"), ASCIIToUTF16("a")));
- input.html_attributes.push_back(
- std::pair<string16, string16>(ASCIIToUTF16("class"), ASCIIToUTF16("b")));
IPC::Message msg(1, 2, IPC::Message::PRIORITY_NORMAL);
IPC::WriteParam(&msg, input);
@@ -43,15 +39,6 @@ TEST(RenderMessagesUnittest, WebAccessibility) {
EXPECT_EQ(input.state, output.state);
EXPECT_EQ(input.location, output.location);
EXPECT_EQ(input.children.size(), output.children.size());
- EXPECT_EQ(input.html_attributes.size(), output.html_attributes.size());
- EXPECT_EQ(input.html_attributes[0].first,
- output.html_attributes[0].first);
- EXPECT_EQ(input.html_attributes[0].second,
- output.html_attributes[0].second);
- EXPECT_EQ(input.html_attributes[1].first,
- output.html_attributes[1].first);
- EXPECT_EQ(input.html_attributes[1].second,
- output.html_attributes[1].second);
// Test a corrupt case.
IPC::Message bad_msg(1, 2, IPC::Message::PRIORITY_NORMAL);
diff --git a/webkit/glue/webaccessibility.cc b/webkit/glue/webaccessibility.cc
index 8b007d3..b6e0d5e 100644
--- a/webkit/glue/webaccessibility.cc
+++ b/webkit/glue/webaccessibility.cc
@@ -7,13 +7,6 @@
#include "third_party/WebKit/WebKit/chromium/public/WebAccessibilityCache.h"
#include "third_party/WebKit/WebKit/chromium/public/WebAccessibilityObject.h"
#include "third_party/WebKit/WebKit/chromium/public/WebAccessibilityRole.h"
-#include "third_party/WebKit/WebKit/chromium/public/WebAttribute.h"
-#include "third_party/WebKit/WebKit/chromium/public/WebDocument.h"
-#include "third_party/WebKit/WebKit/chromium/public/WebDocumentType.h"
-#include "third_party/WebKit/WebKit/chromium/public/WebElement.h"
-#include "third_party/WebKit/WebKit/chromium/public/WebFrame.h"
-#include "third_party/WebKit/WebKit/chromium/public/WebNamedNodeMap.h"
-#include "third_party/WebKit/WebKit/chromium/public/WebNode.h"
#include "third_party/WebKit/WebKit/chromium/public/WebString.h"
using WebKit::WebAccessibilityCache;
@@ -292,33 +285,6 @@ void WebAccessibility::Init(const WebKit::WebAccessibilityObject& src,
attributes[ATTR_HELP] = src.helpText();
if (src.keyboardShortcut().length())
attributes[ATTR_SHORTCUT] = src.keyboardShortcut();
- if (src.hasComputedStyle())
- attributes[ATTR_DISPLAY] = src.computedStyleDisplay();
-
- WebKit::WebNode node = src.node();
-
- if (!node.isNull() && node.isElementNode()) {
- WebKit::WebElement element = node.to<WebKit::WebElement>();
- attributes[ATTR_HTML_TAG] = element.tagName();
- for (unsigned i = 0; i < element.attributes().length(); i++) {
- html_attributes.push_back(
- std::pair<string16, string16>(
- element.attributes().attributeItem(i).localName(),
- element.attributes().attributeItem(i).value()));
- }
- }
-
- if (role == WebAccessibility::ROLE_DOCUMENT ||
- role == WebAccessibility::ROLE_WEB_AREA) {
- WebKit::WebDocument document = src.document();
- attributes[ATTR_DOC_TITLE] = document.title();
- attributes[ATTR_DOC_URL] = document.frame()->url().spec().utf16();
- if (document.isXHTMLDocument())
- attributes[ATTR_DOC_MIMETYPE] = WebKit::WebString("text/xhtml");
- else
- attributes[ATTR_DOC_MIMETYPE] = WebKit::WebString("text/html");
- attributes[ATTR_DOC_DOCTYPE] = document.doctype().name();
- }
// Add the source object to the cache and store its id.
id = cache->addOrGetId(src);
diff --git a/webkit/glue/webaccessibility.h b/webkit/glue/webaccessibility.h
index 1836948..305bc0ca 100644
--- a/webkit/glue/webaccessibility.h
+++ b/webkit/glue/webaccessibility.h
@@ -147,20 +147,9 @@ struct WebAccessibility {
STATE_UNAVAILABLE
};
- // Additional optional attributes that can be optionally attached to
- // a node.
enum Attribute {
- // Doc attributes: only make sense when applied to the top-level
- // Document node.
- ATTR_DOC_URL,
- ATTR_DOC_TITLE,
- ATTR_DOC_MIMETYPE,
- ATTR_DOC_DOCTYPE,
-
- // Attributes that could apply to any node.
ATTR_ACTION,
ATTR_DESCRIPTION,
- ATTR_DISPLAY,
ATTR_HELP,
ATTR_HTML_TAG,
ATTR_LINK_TARGET,
@@ -191,7 +180,6 @@ struct WebAccessibility {
WebKit::WebRect location;
std::map<int32, string16> attributes;
std::vector<WebAccessibility> children;
- std::vector<std::pair<string16, string16> > html_attributes;
};
} // namespace webkit_glue