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

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

Issue 1314253002: Removed the requirement to call setSelection directly on the text field in order to set its selecti… (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1997 matching lines...) Expand 10 before | Expand all | Expand 10 after
2008 return; 2008 return;
2009 2009
2010 if (selection.anchorObject && !isValidSelectionBound(selection.anchorObject. get())) 2010 if (selection.anchorObject && !isValidSelectionBound(selection.anchorObject. get()))
2011 return; 2011 return;
2012 2012
2013 if (selection.focusObject && !isValidSelectionBound(selection.focusObject.ge t())) 2013 if (selection.focusObject && !isValidSelectionBound(selection.focusObject.ge t()))
2014 return; 2014 return;
2015 2015
2016 AXObject* anchorObject = selection.anchorObject ? 2016 AXObject* anchorObject = selection.anchorObject ?
2017 selection.anchorObject.get() : this; 2017 selection.anchorObject.get() : this;
2018 AXObject* focusObject = selection.focusObject ? 2018 AXObject* focusObject = selection.focusObject ?
Peter Lundblad 2015/08/28 15:09:43 Perhaps the initial part of this function could be
2019 selection.focusObject.get() : this; 2019 selection.focusObject.get() : this;
2020 2020
2021 if (anchorObject == this && anchorObject == focusObject 2021 if (anchorObject == focusObject
2022 && layoutObject()->isTextControl()) { 2022 && anchorObject->layoutObject()->isTextControl()) {
2023 HTMLTextFormControlElement* textControl = toLayoutTextControl( 2023 HTMLTextFormControlElement* textControl = toLayoutTextControl(
2024 layoutObject())->textFormControlElement(); 2024 anchorObject->layoutObject())->textFormControlElement();
2025 textControl->setSelectionRange(selection.anchorOffset, selection.focusOf fset, 2025 textControl->setSelectionRange(selection.anchorOffset, selection.focusOf fset,
2026 SelectionHasNoDirection, NotDispatchSelectEvent); 2026 SelectionHasNoDirection, NotDispatchSelectEvent);
Peter Lundblad 2015/08/28 15:09:43 Why doesn't the direction depend on which one of t
2027 return; 2027 return;
2028 } 2028 }
2029 2029
2030 Node* anchorNode = nullptr; 2030 Node* anchorNode = nullptr;
2031 while (anchorObject && !anchorNode) { 2031 while (anchorObject && !anchorNode) {
2032 anchorNode = anchorObject->node(); 2032 anchorNode = anchorObject->node();
2033 anchorObject = anchorObject->parentObject(); 2033 anchorObject = anchorObject->parentObject();
2034 } 2034 }
2035 2035
2036 Node* focusNode = nullptr; 2036 Node* focusNode = nullptr;
(...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after
2647 if (label && label->layoutObject()) { 2647 if (label && label->layoutObject()) {
2648 LayoutRect labelRect = axObjectCache().getOrCreate(label)->elementRe ct(); 2648 LayoutRect labelRect = axObjectCache().getOrCreate(label)->elementRe ct();
2649 result.unite(labelRect); 2649 result.unite(labelRect);
2650 } 2650 }
2651 } 2651 }
2652 2652
2653 return result; 2653 return result;
2654 } 2654 }
2655 2655
2656 } // namespace blink 2656 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698