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

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

Issue 2437873008: Get rid of flat tree version of createVisibleSelection() taking two VisiblePosition (Closed)
Patch Set: 2016-10-24T13:35:49 Created 4 years, 1 month 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 1934 matching lines...) Expand 10 before | Expand all | Expand 10 after
1945 // accessibility nodes are based on visible indexes, which often skips 1945 // accessibility nodes are based on visible indexes, which often skips
1946 // redundant whitespace, for example. 1946 // redundant whitespace, for example.
1947 VisiblePosition anchorVisiblePosition = 1947 VisiblePosition anchorVisiblePosition =
1948 toVisiblePosition(anchorObject, selection.anchorOffset); 1948 toVisiblePosition(anchorObject, selection.anchorOffset);
1949 VisiblePosition focusVisiblePosition = 1949 VisiblePosition focusVisiblePosition =
1950 toVisiblePosition(focusObject, selection.focusOffset); 1950 toVisiblePosition(focusObject, selection.focusOffset);
1951 if (anchorVisiblePosition.isNull() || focusVisiblePosition.isNull()) 1951 if (anchorVisiblePosition.isNull() || focusVisiblePosition.isNull())
1952 return; 1952 return;
1953 1953
1954 frame->selection().setSelection( 1954 frame->selection().setSelection(
1955 createVisibleSelection(anchorVisiblePosition, focusVisiblePosition)); 1955 SelectionInDOMTree::Builder()
1956 .collapse(anchorVisiblePosition.toPositionWithAffinity())
1957 .extend(focusVisiblePosition.deepEquivalent())
1958 .build());
1956 } 1959 }
1957 1960
1958 bool AXLayoutObject::isValidSelectionBound(const AXObject* boundObject) const { 1961 bool AXLayoutObject::isValidSelectionBound(const AXObject* boundObject) const {
1959 return getLayoutObject() && boundObject && !boundObject->isDetached() && 1962 return getLayoutObject() && boundObject && !boundObject->isDetached() &&
1960 boundObject->isAXLayoutObject() && boundObject->getLayoutObject() && 1963 boundObject->isAXLayoutObject() && boundObject->getLayoutObject() &&
1961 boundObject->getLayoutObject()->frame() == 1964 boundObject->getLayoutObject()->frame() ==
1962 getLayoutObject()->frame() && 1965 getLayoutObject()->frame() &&
1963 &boundObject->axObjectCache() == &axObjectCache(); 1966 &boundObject->axObjectCache() == &axObjectCache();
1964 } 1967 }
1965 1968
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after
2446 2449
2447 bool AXLayoutObject::elementAttributeValue( 2450 bool AXLayoutObject::elementAttributeValue(
2448 const QualifiedName& attributeName) const { 2451 const QualifiedName& attributeName) const {
2449 if (!m_layoutObject) 2452 if (!m_layoutObject)
2450 return false; 2453 return false;
2451 2454
2452 return equalIgnoringCase(getAttribute(attributeName), "true"); 2455 return equalIgnoringCase(getAttribute(attributeName), "true");
2453 } 2456 }
2454 2457
2455 } // namespace blink 2458 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698