[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

cfleizach at apple.com cfleizach at apple.com
Thu Apr 8 02:19:35 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 93e0080f461b85added2a7e3afc14f31a013f082
Author: cfleizach at apple.com <cfleizach at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Mar 11 19:19:39 2010 +0000

    support lang attribute on <option> elements
    https://bugs.webkit.org/show_bug.cgi?id=36021
    
    Reviewed by Darin Adler.
    
    WebCore:
    
    Allow non AccessibilityRenderObject classes to access the lang
    attribute by moving the useful code into AccessibilityObject.
    
    Test: platform/mac/accessibility/option-with-lang.html
    
    * accessibility/AccessibilityListBoxOption.cpp:
    (WebCore::AccessibilityListBoxOption::language):
    * accessibility/AccessibilityListBoxOption.h:
    * accessibility/AccessibilityObject.cpp:
    (WebCore::AccessibilityObject::language):
    * accessibility/AccessibilityObject.h:
    * accessibility/AccessibilityRenderObject.cpp:
    (WebCore::AccessibilityRenderObject::language):
    * accessibility/AccessibilityRenderObject.h:
    
    LayoutTests:
    
    * platform/mac/accessibility/option-with-lang-expected.txt: Added.
    * platform/mac/accessibility/option-with-lang.html: Added.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55848 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 03d1817..4a29230 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,13 @@
+2010-03-11  Chris Fleizach  <cfleizach at apple.com>
+
+        Reviewed by Darin Adler.
+
+        support lang attribute on <option> elements
+        https://bugs.webkit.org/show_bug.cgi?id=36021
+
+        * platform/mac/accessibility/option-with-lang-expected.txt: Added.
+        * platform/mac/accessibility/option-with-lang.html: Added.
+
 2010-03-11  Diego Gonzalez  <diego.gonzalez at openbossa.org>
 
         Reviewed by Simon Hausmann.
diff --git a/LayoutTests/platform/mac/accessibility/option-with-lang-expected.txt b/LayoutTests/platform/mac/accessibility/option-with-lang-expected.txt
new file mode 100644
index 0000000..4fd8ce5
--- /dev/null
+++ b/LayoutTests/platform/mac/accessibility/option-with-lang-expected.txt
@@ -0,0 +1,12 @@
+
+This tests that the lang attribute is returned appropriately for option elements.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS selectbox.childAtIndex(0).language is 'AXLanguage: ar'
+PASS selectbox.childAtIndex(1).language is 'AXLanguage: en-US'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/platform/mac/accessibility/option-with-lang.html b/LayoutTests/platform/mac/accessibility/option-with-lang.html
new file mode 100644
index 0000000..47ff815
--- /dev/null
+++ b/LayoutTests/platform/mac/accessibility/option-with-lang.html
@@ -0,0 +1,38 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../../fast/js/resources/js-test-style.css">
+<script>
+var successfullyParsed = false;
+</script>
+<script src="../../../fast/js/resources/js-test-pre.js"></script>
+</head>
+<body id="body">
+
+<select size=10 id="deg1" lang="en-US" tabindex=0>
+   <option lang="ar">بث</option>
+   <option>Celsius</option>
+</select>
+
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+
+    description("This tests that the lang attribute is returned appropriately for option elements.");
+
+    if (window.accessibilityController) {
+
+        // Test the values in a multi-select list box.
+        document.getElementById("deg1").focus();
+        var selectbox = accessibilityController.focusedElement;
+        shouldBe("selectbox.childAtIndex(0).language", "'AXLanguage: ar'");
+        shouldBe("selectbox.childAtIndex(1).language", "'AXLanguage: en-US'");
+    }
+
+    successfullyParsed = true;
+</script>
+
+<script src="../../../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 3599015..173920a 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,25 @@
+2010-03-11  Chris Fleizach  <cfleizach at apple.com>
+
+        Reviewed by Darin Adler.
+
+        support lang attribute on <option> elements
+        https://bugs.webkit.org/show_bug.cgi?id=36021
+
+        Allow non AccessibilityRenderObject classes to access the lang
+        attribute by moving the useful code into AccessibilityObject.
+
+        Test: platform/mac/accessibility/option-with-lang.html
+
+        * accessibility/AccessibilityListBoxOption.cpp:
+        (WebCore::AccessibilityListBoxOption::language):
+        * accessibility/AccessibilityListBoxOption.h:
+        * accessibility/AccessibilityObject.cpp:
+        (WebCore::AccessibilityObject::language):
+        * accessibility/AccessibilityObject.h:
+        * accessibility/AccessibilityRenderObject.cpp:
+        (WebCore::AccessibilityRenderObject::language):
+        * accessibility/AccessibilityRenderObject.h:
+
 2010-03-11  Diego Gonzalez  <diego.gonzalez at openbossa.org>
 
         Reviewed by Simon Hausmann.
diff --git a/WebCore/accessibility/AccessibilityListBoxOption.cpp b/WebCore/accessibility/AccessibilityListBoxOption.cpp
index 685ea13..57519e3 100644
--- a/WebCore/accessibility/AccessibilityListBoxOption.cpp
+++ b/WebCore/accessibility/AccessibilityListBoxOption.cpp
@@ -115,6 +115,11 @@ bool AccessibilityListBoxOption::accessibilityIsIgnored() const
     
     return parentObject()->accessibilityIsIgnored();
 }
+    
+String AccessibilityListBoxOption::language() const
+{
+    return AccessibilityObject::language(m_optionElement);
+}
 
 bool AccessibilityListBoxOption::canSetSelectedAttribute() const
 {
diff --git a/WebCore/accessibility/AccessibilityListBoxOption.h b/WebCore/accessibility/AccessibilityListBoxOption.h
index 6b293e1..1da77e7 100644
--- a/WebCore/accessibility/AccessibilityListBoxOption.h
+++ b/WebCore/accessibility/AccessibilityListBoxOption.h
@@ -68,6 +68,7 @@ public:
 private:
     HTMLElement* m_optionElement;
     
+    virtual String language() const;
     virtual bool canHaveChildren() const { return false; }
     HTMLSelectElement* listBoxOptionParentNode() const;
     int listBoxOptionIndex() const;
diff --git a/WebCore/accessibility/AccessibilityObject.cpp b/WebCore/accessibility/AccessibilityObject.cpp
index 998a050..8dedc36 100644
--- a/WebCore/accessibility/AccessibilityObject.cpp
+++ b/WebCore/accessibility/AccessibilityObject.cpp
@@ -148,6 +148,15 @@ bool AccessibilityObject::press() const
     return true;
 }
     
+String AccessibilityObject::language(Node* node) const
+{
+    const AtomicString& lang = getAttribute(node, langAttr);
+    if (lang.isEmpty())
+        return AccessibilityObject::language();
+    
+    return lang;
+}
+    
 String AccessibilityObject::language() const
 {
     AccessibilityObject* parent = parentObject();
diff --git a/WebCore/accessibility/AccessibilityObject.h b/WebCore/accessibility/AccessibilityObject.h
index fb38274..4725f5e 100644
--- a/WebCore/accessibility/AccessibilityObject.h
+++ b/WebCore/accessibility/AccessibilityObject.h
@@ -414,6 +414,7 @@ public:
     virtual FrameView* topDocumentFrameView() const { return 0; }
     virtual FrameView* documentFrameView() const;
     virtual String language() const;
+    String language(Node*) const;
     virtual unsigned hierarchicalLevel() const { return 0; }
     
     virtual void setFocused(bool) { }
diff --git a/WebCore/accessibility/AccessibilityRenderObject.cpp b/WebCore/accessibility/AccessibilityRenderObject.cpp
index 4cd08f3..3908acb 100644
--- a/WebCore/accessibility/AccessibilityRenderObject.cpp
+++ b/WebCore/accessibility/AccessibilityRenderObject.cpp
@@ -768,18 +768,7 @@ String AccessibilityRenderObject::language() const
     if (!m_renderer)
         return String();
     
-    // Defer to parent if this element doesn't have a language set
-    Node* node = m_renderer->node();
-    if (!node)
-        return AccessibilityObject::language();
-    
-    if (!node->isElementNode())
-        return AccessibilityObject::language();
-    
-    String language = static_cast<Element*>(node)->getAttribute(langAttr);
-    if (language.isEmpty())
-        return AccessibilityObject::language();
-    return language;
+    return AccessibilityObject::language(m_renderer->node());
 }
 
 String AccessibilityRenderObject::textUnderElement() const
diff --git a/WebCore/accessibility/AccessibilityRenderObject.h b/WebCore/accessibility/AccessibilityRenderObject.h
index cf6f932..0e26787 100644
--- a/WebCore/accessibility/AccessibilityRenderObject.h
+++ b/WebCore/accessibility/AccessibilityRenderObject.h
@@ -193,7 +193,6 @@ public:
     virtual Widget* widgetForAttachmentView() const;
     virtual void getDocumentLinks(AccessibilityChildrenVector&);
     virtual FrameView* documentFrameView() const;
-    virtual String language() const;
     virtual unsigned hierarchicalLevel() const;
 
     virtual const AccessibilityChildrenVector& children();
@@ -275,6 +274,7 @@ private:
     bool isAllowedChildOfTree() const;
     bool hasTextAlternative() const;
     String positionalDescriptionForMSAA() const;
+    virtual String language() const;
 
     Element* menuElementForMenuButton() const;
     Element* menuItemElementForMenu() const;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list