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

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

Issue 2374183004: Make non-null VisibleSelections creatable only by createVisibleSelection[Deprecated] (Closed)
Patch Set: Fix mac compile error Created 4 years, 2 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 1897 matching lines...) Expand 10 before | Expand all | Expand 10 after
1908 // This callsite should probably move up the stack. 1908 // This callsite should probably move up the stack.
1909 frame->document()->updateStyleAndLayoutIgnorePendingStylesheets(); 1909 frame->document()->updateStyleAndLayoutIgnorePendingStylesheets();
1910 1910
1911 // Set the selection based on visible positions, because the offsets in acce ssibility nodes 1911 // Set the selection based on visible positions, because the offsets in acce ssibility nodes
1912 // are based on visible indexes, which often skips redundant whitespace, for example. 1912 // are based on visible indexes, which often skips redundant whitespace, for example.
1913 VisiblePosition anchorVisiblePosition = toVisiblePosition(anchorObject, sele ction.anchorOffset); 1913 VisiblePosition anchorVisiblePosition = toVisiblePosition(anchorObject, sele ction.anchorOffset);
1914 VisiblePosition focusVisiblePosition = toVisiblePosition(focusObject, select ion.focusOffset); 1914 VisiblePosition focusVisiblePosition = toVisiblePosition(focusObject, select ion.focusOffset);
1915 if (anchorVisiblePosition.isNull() || focusVisiblePosition.isNull()) 1915 if (anchorVisiblePosition.isNull() || focusVisiblePosition.isNull())
1916 return; 1916 return;
1917 1917
1918 frame->selection().setSelection(VisibleSelection(anchorVisiblePosition, focu sVisiblePosition)); 1918 frame->selection().setSelection(createVisibleSelection(anchorVisiblePosition , focusVisiblePosition));
yosin_UTC9 2016/09/30 01:20:35 Since AXLayoutObject holds |m_layoutObject|, when
1919 } 1919 }
1920 1920
1921 bool AXLayoutObject::isValidSelectionBound(const AXObject* boundObject) const 1921 bool AXLayoutObject::isValidSelectionBound(const AXObject* boundObject) const
1922 { 1922 {
1923 return getLayoutObject() && boundObject && !boundObject->isDetached() 1923 return getLayoutObject() && boundObject && !boundObject->isDetached()
1924 && boundObject->isAXLayoutObject() && boundObject->getLayoutObject() 1924 && boundObject->isAXLayoutObject() && boundObject->getLayoutObject()
1925 && boundObject->getLayoutObject()->frame() == getLayoutObject()->frame() 1925 && boundObject->getLayoutObject()->frame() == getLayoutObject()->frame()
1926 && &boundObject->axObjectCache() == &axObjectCache(); 1926 && &boundObject->axObjectCache() == &axObjectCache();
1927 } 1927 }
1928 1928
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after
2394 2394
2395 bool AXLayoutObject::elementAttributeValue(const QualifiedName& attributeName) c onst 2395 bool AXLayoutObject::elementAttributeValue(const QualifiedName& attributeName) c onst
2396 { 2396 {
2397 if (!m_layoutObject) 2397 if (!m_layoutObject)
2398 return false; 2398 return false;
2399 2399
2400 return equalIgnoringCase(getAttribute(attributeName), "true"); 2400 return equalIgnoringCase(getAttribute(attributeName), "true");
2401 } 2401 }
2402 2402
2403 } // namespace blink 2403 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698