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

Side by Side Diff: third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp

Issue 2724333002: Get rid of VisibleSelection::firstRangeOf() (Closed)
Patch Set: 2017-03-03T13:18:27 DCHECK(!range) => DCHECK(range) Created 3 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2008 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 1773 matching lines...) Expand 10 before | Expand all | Expand 10 after
1784 return textSelection; 1784 return textSelection;
1785 1785
1786 if (!getNode() || !getLayoutObject()->frame()) 1786 if (!getNode() || !getLayoutObject()->frame())
1787 return AXRange(); 1787 return AXRange();
1788 1788
1789 VisibleSelection selection = 1789 VisibleSelection selection =
1790 getLayoutObject() 1790 getLayoutObject()
1791 ->frame() 1791 ->frame()
1792 ->selection() 1792 ->selection()
1793 .computeVisibleSelectionInDOMTreeDeprecated(); 1793 .computeVisibleSelectionInDOMTreeDeprecated();
1794 Range* selectionRange = firstRangeOf(selection); 1794 Range* selectionRange = createRange(firstEphemeralRangeOf(selection));
1795 ContainerNode* parentNode = getNode()->parentNode(); 1795 ContainerNode* parentNode = getNode()->parentNode();
1796 int nodeIndex = getNode()->nodeIndex(); 1796 int nodeIndex = getNode()->nodeIndex();
1797 if (!selectionRange 1797 if (!selectionRange
1798 // Selection is contained in node. 1798 // Selection is contained in node.
1799 || 1799 ||
1800 !(parentNode && 1800 !(parentNode &&
1801 selectionRange->comparePoint(parentNode, nodeIndex, 1801 selectionRange->comparePoint(parentNode, nodeIndex,
1802 IGNORE_EXCEPTION_FOR_TESTING) < 0 && 1802 IGNORE_EXCEPTION_FOR_TESTING) < 0 &&
1803 selectionRange->comparePoint(parentNode, nodeIndex + 1, 1803 selectionRange->comparePoint(parentNode, nodeIndex + 1,
1804 IGNORE_EXCEPTION_FOR_TESTING) > 0)) { 1804 IGNORE_EXCEPTION_FOR_TESTING) > 0)) {
(...skipping 688 matching lines...) Expand 10 before | Expand all | Expand 10 after
2493 2493
2494 bool AXLayoutObject::elementAttributeValue( 2494 bool AXLayoutObject::elementAttributeValue(
2495 const QualifiedName& attributeName) const { 2495 const QualifiedName& attributeName) const {
2496 if (!m_layoutObject) 2496 if (!m_layoutObject)
2497 return false; 2497 return false;
2498 2498
2499 return equalIgnoringCase(getAttribute(attributeName), "true"); 2499 return equalIgnoringCase(getAttribute(attributeName), "true");
2500 } 2500 }
2501 2501
2502 } // namespace blink 2502 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/editing/commands/InsertListCommand.cpp ('k') | third_party/WebKit/Source/web/TextFinder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698