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

Side by Side Diff: Source/core/accessibility/AccessibilityObject.cpp

Issue 20681004: Make first-letter style to work with editing Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 2013-08-08T13:29:08 Created 7 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008, 2009, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2008, 2009, 2011 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 798 matching lines...) Expand 10 before | Expand all | Expand 10 after
809 } 809 }
810 810
811 void AccessibilityObject::selectionChanged() 811 void AccessibilityObject::selectionChanged()
812 { 812 {
813 if (AccessibilityObject* parent = parentObjectIfExists()) 813 if (AccessibilityObject* parent = parentObjectIfExists())
814 parent->selectionChanged(); 814 parent->selectionChanged();
815 } 815 }
816 816
817 static VisiblePosition startOfStyleRange(const VisiblePosition& visiblePos) 817 static VisiblePosition startOfStyleRange(const VisiblePosition& visiblePos)
818 { 818 {
819 RenderObject* renderer = visiblePos.deepEquivalent().deprecatedNode()->rende rer(); 819 RenderObject* renderer = visiblePos.deepEquivalent().renderer();
820 RenderObject* startRenderer = renderer; 820 RenderObject* startRenderer = renderer;
821 RenderStyle* style = renderer->style(); 821 RenderStyle* style = renderer->style();
822 822
823 // traverse backward by renderer to look for style change 823 // traverse backward by renderer to look for style change
824 for (RenderObject* r = renderer->previousInPreOrder(); r; r = r->previousInP reOrder()) { 824 for (RenderObject* r = renderer->previousInPreOrder(); r; r = r->previousInP reOrder()) {
825 // skip non-leaf nodes 825 // skip non-leaf nodes
826 if (r->firstChild()) 826 if (r->firstChild())
827 continue; 827 continue;
828 828
829 // stop at style change 829 // stop at style change
830 if (r->style() != style) 830 if (r->style() != style)
831 break; 831 break;
832 832
833 // remember match 833 // remember match
834 startRenderer = r; 834 startRenderer = r;
835 } 835 }
836 836
837 return firstPositionInOrBeforeNode(startRenderer->node()); 837 return firstPositionInOrBeforeNode(startRenderer->node());
838 } 838 }
839 839
840 static VisiblePosition endOfStyleRange(const VisiblePosition& visiblePos) 840 static VisiblePosition endOfStyleRange(const VisiblePosition& visiblePos)
841 { 841 {
842 RenderObject* renderer = visiblePos.deepEquivalent().deprecatedNode()->rende rer(); 842 RenderObject* renderer = visiblePos.deepEquivalent().renderer();
843 RenderObject* endRenderer = renderer; 843 RenderObject* endRenderer = renderer;
844 RenderStyle* style = renderer->style(); 844 RenderStyle* style = renderer->style();
845 845
846 // traverse forward by renderer to look for style change 846 // traverse forward by renderer to look for style change
847 for (RenderObject* r = renderer->nextInPreOrder(); r; r = r->nextInPreOrder( )) { 847 for (RenderObject* r = renderer->nextInPreOrder(); r; r = r->nextInPreOrder( )) {
848 // skip non-leaf nodes 848 // skip non-leaf nodes
849 if (r->firstChild()) 849 if (r->firstChild())
850 continue; 850 continue;
851 851
852 // stop at style change 852 // stop at style change
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
967 967
968 for (AccessibilityObject* object = parentObject(); object; object = object-> parentObject()) { 968 for (AccessibilityObject* object = parentObject(); object; object = object-> parentObject()) {
969 if (equalIgnoringCase(object->getAttribute(aria_hiddenAttr), "true")) 969 if (equalIgnoringCase(object->getAttribute(aria_hiddenAttr), "true"))
970 return true; 970 return true;
971 } 971 }
972 972
973 return false; 973 return false;
974 } 974 }
975 975
976 } // namespace WebCore 976 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698