Changeset 148749 in webkit
- Timestamp:
- Apr 19, 2013 9:03:46 AM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r148748 r148749 1 2013-04-19 Mario Sanchez Prada <mario.prada@samsung.com> 2 3 [GTK] Minimize calls to GailTextUtil in AtkText implementation 4 https://bugs.webkit.org/show_bug.cgi?id=114868 5 6 Reviewed by Martin Robinson. 7 8 Create a new helper function to concentrate inside of it the calls to 9 gail_text_util_get_text(), so we can get rid of it later more easily. 10 11 * accessibility/atk/WebKitAccessibleInterfaceText.cpp: 12 (webkitAccessibleTextGetTextForOffset): New helper function. 13 (webkitAccessibleTextGetTextAfterOffset): Rely on the new function. 14 (webkitAccessibleTextGetTextAtOffset): Ditto. 15 (webkitAccessibleTextGetTextBeforeOffset): Ditto. 16 1 17 2013-04-19 Noam Rosenthal <noam@webkit.org> 2 18 -
trunk/Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceText.cpp
r142375 r148749 568 568 } 569 569 570 static gchar* webkitAccessibleTextGetTextAfterOffset(AtkText* text, gint offset, AtkTextBoundary boundaryType, gint* startOffset, gint* endOffset) 570 enum GetTextRelativePosition { 571 GetTextPositionAt, 572 GetTextPositionBefore, 573 GetTextPositionAfter 574 }; 575 576 static gchar* webkitAccessibleTextGetTextForOffset(AtkText* text, gint offset, AtkTextBoundary boundaryType, GetTextRelativePosition textPosition, gint* startOffset, gint* endOffset) 571 577 { 572 578 #if PLATFORM(GTK) 573 return gail_text_util_get_text(getGailTextUtilForAtk(text), getPangoLayoutForAtk(text), GAIL_AFTER_OFFSET, boundaryType, offset, startOffset, endOffset); 574 #else 579 // FIXME: Get rid of the code below once every single get_text_*_offset 580 // function has been properly implemented without using Pango/Cairo. 581 GailOffsetType offsetType; 582 switch (textPosition) { 583 case GetTextPositionBefore: 584 offsetType = GAIL_BEFORE_OFFSET; 585 break; 586 587 case GetTextPositionAt: 588 offsetType = GAIL_AT_OFFSET; 589 break; 590 591 case GetTextPositionAfter: 592 offsetType = GAIL_AFTER_OFFSET; 593 break; 594 595 default: 596 ASSERT_NOT_REACHED(); 597 } 598 599 return gail_text_util_get_text(getGailTextUtilForAtk(text), getPangoLayoutForAtk(text), offsetType, boundaryType, offset, startOffset, endOffset); 600 #endif 601 575 602 UNUSED_PARAM(text); 576 603 UNUSED_PARAM(offset); … … 581 608 notImplemented(); 582 609 return 0; 583 #endif 610 } 611 612 static gchar* webkitAccessibleTextGetTextAfterOffset(AtkText* text, gint offset, AtkTextBoundary boundaryType, gint* startOffset, gint* endOffset) 613 { 614 return webkitAccessibleTextGetTextForOffset(text, offset, boundaryType, GetTextPositionAfter, startOffset, endOffset); 584 615 } 585 616 586 617 static gchar* webkitAccessibleTextGetTextAtOffset(AtkText* text, gint offset, AtkTextBoundary boundaryType, gint* startOffset, gint* endOffset) 587 618 { 588 #if PLATFORM(GTK) 589 return gail_text_util_get_text(getGailTextUtilForAtk(text), getPangoLayoutForAtk(text), GAIL_AT_OFFSET, boundaryType, offset, startOffset, endOffset); 590 #else 591 UNUSED_PARAM(text); 592 UNUSED_PARAM(offset); 593 UNUSED_PARAM(boundaryType); 594 UNUSED_PARAM(startOffset); 595 UNUSED_PARAM(endOffset); 596 597 notImplemented(); 598 return 0; 599 #endif 619 return webkitAccessibleTextGetTextForOffset(text, offset, boundaryType, GetTextPositionAt, startOffset, endOffset); 600 620 } 601 621 602 622 static gchar* webkitAccessibleTextGetTextBeforeOffset(AtkText* text, gint offset, AtkTextBoundary boundaryType, gint* startOffset, gint* endOffset) 603 623 { 604 #if PLATFORM(GTK) 605 return gail_text_util_get_text(getGailTextUtilForAtk(text), getPangoLayoutForAtk(text), GAIL_BEFORE_OFFSET, boundaryType, offset, startOffset, endOffset); 606 #else 607 UNUSED_PARAM(text); 608 UNUSED_PARAM(offset); 609 UNUSED_PARAM(boundaryType); 610 UNUSED_PARAM(startOffset); 611 UNUSED_PARAM(endOffset); 612 613 notImplemented(); 614 return 0; 615 #endif 624 return webkitAccessibleTextGetTextForOffset(text, offset, boundaryType, GetTextPositionBefore, startOffset, endOffset); 616 625 } 617 626
Note: See TracChangeset
for help on using the changeset viewer.