Changeset 155520 in webkit
- Timestamp:
- Sep 11, 2013 5:05:10 AM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r155519 r155520 1 2013-09-11 Mario Sanchez Prada <mario.prada@samsung.com> 2 3 [GTK] Get rid of Pango/Gail dependencies in accessibility for ATK 4 https://bugs.webkit.org/show_bug.cgi?id=114867 5 6 Reviewed by Martin Robinson. 7 8 Removed all trace of Gail and Pango specific code from the AtkText 9 implementation, now everything has been reimplemented. 10 11 * accessibility/atk/WebKitAccessibleInterfaceText.cpp: 12 (webkitAccessibleTextGetTextForOffset): Removed fallback code 13 relying in Gail/Pango, now all the related code has been 14 removed. Also, replaced the collection of if statements with a 15 switch, for better readability of the code. 16 1 17 2013-09-11 Allan Sandfeld Jensen <allan.jensen@digia.com> 2 18 -
trunk/Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceText.cpp
r155516 r155520 55 55 #include <wtf/text/CString.h> 56 56 57 #if PLATFORM(GTK)58 #include <libgail-util/gail-util.h>59 #include <pango/pango.h>60 #endif61 62 57 using namespace WebCore; 63 58 … … 165 160 } 166 161 167 static gchar* webkitAccessibleTextGetText(AtkText*, gint startOffset, gint endOffset);168 169 #if PLATFORM(GTK)170 static GailTextUtil* getGailTextUtilForAtk(AtkText* textObject)171 {172 GailTextUtil* gailTextUtil = gail_text_util_new();173 GOwnPtr<char> text(webkitAccessibleTextGetText(textObject, 0, -1));174 gail_text_util_text_setup(gailTextUtil, text.get());175 return gailTextUtil;176 }177 178 static PangoLayout* getPangoLayoutForAtk(AtkText* textObject)179 {180 AccessibilityObject* coreObject = core(textObject);181 182 Document* document = coreObject->document();183 if (!document)184 return 0;185 186 HostWindow* hostWindow = document->view()->hostWindow();187 if (!hostWindow)188 return 0;189 PlatformPageClient webView = hostWindow->platformPageClient();190 if (!webView)191 return 0;192 193 // Create a string with the layout as it appears on the screen194 GOwnPtr<char> objectText(textForObject(coreObject));195 PangoLayout* layout = gtk_widget_create_pango_layout(static_cast<GtkWidget*>(webView), objectText.get());196 return layout;197 }198 #endif199 200 162 static int baselinePositionForRenderObject(RenderObject* renderObject) 201 163 { … … 368 330 return attributeSet1; 369 331 } 332 333 static gchar* webkitAccessibleTextGetText(AtkText*, gint startOffset, gint endOffset); 370 334 371 335 static guint accessibilityObjectLength(const AccessibilityObject* object) … … 1087 1051 return emptyTextSelectionAtOffset(0, startOffset, endOffset); 1088 1052 1089 if (boundaryType == ATK_TEXT_BOUNDARY_CHAR) 1053 switch (boundaryType) { 1054 case ATK_TEXT_BOUNDARY_CHAR: 1090 1055 return webkitAccessibleTextGetChar(text, offset, textPosition, startOffset, endOffset); 1091 1056 1092 if (boundaryType == ATK_TEXT_BOUNDARY_WORD_START || boundaryType == ATK_TEXT_BOUNDARY_WORD_END) 1057 case ATK_TEXT_BOUNDARY_WORD_START: 1058 case ATK_TEXT_BOUNDARY_WORD_END: 1093 1059 return webkitAccessibleTextWordForBoundary(text, offset, boundaryType, textPosition, startOffset, endOffset); 1094 1060 1095 if (boundaryType == ATK_TEXT_BOUNDARY_SENTENCE_START || boundaryType == ATK_TEXT_BOUNDARY_SENTENCE_END) 1061 case ATK_TEXT_BOUNDARY_LINE_START: 1062 case ATK_TEXT_BOUNDARY_LINE_END: 1063 return webkitAccessibleTextLineForBoundary(text, offset, boundaryType, textPosition, startOffset, endOffset); 1064 1065 case ATK_TEXT_BOUNDARY_SENTENCE_START: 1066 case ATK_TEXT_BOUNDARY_SENTENCE_END: 1096 1067 return webkitAccessibleTextSentenceForBoundary(text, offset, boundaryType, textPosition, startOffset, endOffset); 1097 1098 if (boundaryType == ATK_TEXT_BOUNDARY_LINE_START || boundaryType == ATK_TEXT_BOUNDARY_LINE_END)1099 return webkitAccessibleTextLineForBoundary(text, offset, boundaryType, textPosition, startOffset, endOffset);1100 1101 #if PLATFORM(GTK)1102 // FIXME: Get rid of the code below once every single part above1103 // has been properly implemented without using Pango/Cairo.1104 GailOffsetType offsetType = GAIL_AT_OFFSET;1105 switch (textPosition) {1106 case GetTextPositionBefore:1107 offsetType = GAIL_BEFORE_OFFSET;1108 break;1109 1110 case GetTextPositionAt:1111 break;1112 1113 case GetTextPositionAfter:1114 offsetType = GAIL_AFTER_OFFSET;1115 break;1116 1068 1117 1069 default: … … 1119 1071 } 1120 1072 1121 // Make sure we always return valid valid values for offsets. 1122 *startOffset = 0; 1123 *endOffset = 0; 1124 1125 return gail_text_util_get_text(getGailTextUtilForAtk(text), getPangoLayoutForAtk(text), offsetType, boundaryType, offset, startOffset, endOffset); 1126 #endif 1127 1128 notImplemented(); 1073 // This should never be reached. 1129 1074 return 0; 1130 1075 }
Note: See TracChangeset
for help on using the changeset viewer.