Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(939)

Unified Diff: third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp

Issue 1768753003: Implemented the reporting of text style and language information on Windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated to using HashTable from base and GetInheritedStringAttribute instead of specialized methods… Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp
diff --git a/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp b/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp
index 52ecb9ff71f585200c1f3391178697417f1baa80..68ea5151aff987cef4dbe195ce369819c64ede17 100644
--- a/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp
+++ b/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp
@@ -824,10 +824,10 @@ const AtomicString& AXLayoutObject::accessKey() const
RGBA32 AXLayoutObject::backgroundColor() const
{
- if (!m_layoutObject)
+ if (!layoutObject())
return AXNodeObject::backgroundColor();
- const ComputedStyle* style = m_layoutObject->style();
+ const ComputedStyle* style = layoutObject()->style();
if (!style || !style->hasBackground())
return AXNodeObject::backgroundColor();
@@ -837,10 +837,10 @@ RGBA32 AXLayoutObject::backgroundColor() const
RGBA32 AXLayoutObject::color() const
{
- if (!m_layoutObject || isColorWell())
+ if (!layoutObject() || isColorWell())
return AXNodeObject::color();
- const ComputedStyle* style = m_layoutObject->style();
+ const ComputedStyle* style = layoutObject()->style();
if (!style)
return AXNodeObject::color();
@@ -848,13 +848,26 @@ RGBA32 AXLayoutObject::color() const
return color.rgb();
}
+String AXLayoutObject::fontFamily() const
+{
+ if (!layoutObject())
+ return AXNodeObject::fontFamily();
+
+ const ComputedStyle* style = layoutObject()->style();
+ if (!style)
+ return AXNodeObject::fontFamily();
+
+ FontDescription& fontDescription = const_cast<FontDescription&>(style->fontDescription());
+ return fontDescription.firstFamily().family();
+}
+
// Font size is in pixels.
float AXLayoutObject::fontSize() const
{
- if (!m_layoutObject)
+ if (!layoutObject())
return AXNodeObject::fontSize();
- const ComputedStyle* style = m_layoutObject->style();
+ const ComputedStyle* style = layoutObject()->style();
if (!style)
return AXNodeObject::fontSize();
@@ -939,10 +952,10 @@ int AXLayoutObject::textLength() const
TextStyle AXLayoutObject::getTextStyle() const
{
- if (!m_layoutObject)
+ if (!layoutObject())
return AXNodeObject::getTextStyle();
- const ComputedStyle* style = m_layoutObject->style();
+ const ComputedStyle* style = layoutObject()->style();
if (!style)
return AXNodeObject::getTextStyle();

Powered by Google App Engine
This is Rietveld 408576698