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

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: Fixed test expectations. 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 409f370ab8feb683bce775a7b04fba663da97e89..bf68f5edb47b48c20677a2f3287ad51c4569c682 100644
--- a/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp
+++ b/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp
@@ -827,10 +827,10 @@ const AtomicString& AXLayoutObject::accessKey() const
RGBA32 AXLayoutObject::backgroundColor() const
{
- if (!m_layoutObject)
+ if (!getLayoutObject())
return AXNodeObject::backgroundColor();
- const ComputedStyle* style = m_layoutObject->style();
+ const ComputedStyle* style = getLayoutObject()->style();
if (!style || !style->hasBackground())
return AXNodeObject::backgroundColor();
@@ -840,10 +840,10 @@ RGBA32 AXLayoutObject::backgroundColor() const
RGBA32 AXLayoutObject::color() const
{
- if (!m_layoutObject || isColorWell())
+ if (!getLayoutObject() || isColorWell())
return AXNodeObject::color();
- const ComputedStyle* style = m_layoutObject->style();
+ const ComputedStyle* style = getLayoutObject()->style();
if (!style)
return AXNodeObject::color();
@@ -851,13 +851,26 @@ RGBA32 AXLayoutObject::color() const
return color.rgb();
}
+String AXLayoutObject::fontFamily() const
+{
+ if (!getLayoutObject())
+ return AXNodeObject::fontFamily();
+
+ const ComputedStyle* style = getLayoutObject()->style();
+ if (!style)
+ return AXNodeObject::fontFamily();
+
+ FontDescription& fontDescription = const_cast<FontDescription&>(style->getFontDescription());
+ return fontDescription.firstFamily().family();
+}
+
// Font size is in pixels.
float AXLayoutObject::fontSize() const
{
- if (!m_layoutObject)
+ if (!getLayoutObject())
return AXNodeObject::fontSize();
- const ComputedStyle* style = m_layoutObject->style();
+ const ComputedStyle* style = getLayoutObject()->style();
if (!style)
return AXNodeObject::fontSize();
@@ -867,10 +880,10 @@ float AXLayoutObject::fontSize() const
String AXLayoutObject::text() const
{
if (isPasswordFieldAndShouldHideValue()) {
- if (!m_layoutObject)
+ if (!getLayoutObject())
return String();
- const ComputedStyle* style = m_layoutObject->style();
+ const ComputedStyle* style = getLayoutObject()->style();
if (!style)
return String();
@@ -906,10 +919,10 @@ String AXLayoutObject::text() const
AccessibilityTextDirection AXLayoutObject::textDirection() const
{
- if (!m_layoutObject)
+ if (!getLayoutObject())
return AXNodeObject::textDirection();
- const ComputedStyle* style = m_layoutObject->style();
+ const ComputedStyle* style = getLayoutObject()->style();
if (!style)
return AXNodeObject::textDirection();
@@ -942,10 +955,10 @@ int AXLayoutObject::textLength() const
TextStyle AXLayoutObject::getTextStyle() const
{
- if (!m_layoutObject)
+ if (!getLayoutObject())
return AXNodeObject::getTextStyle();
- const ComputedStyle* style = m_layoutObject->style();
+ const ComputedStyle* style = getLayoutObject()->style();
if (!style)
return AXNodeObject::getTextStyle();

Powered by Google App Engine
This is Rietveld 408576698