| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2008, 2009, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 2008, 2009, 2010 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 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 951 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 962 if (selectStartTarget) { | 962 if (selectStartTarget) { |
| 963 const Document& expectedDocument = document(); | 963 const Document& expectedDocument = document(); |
| 964 if (selectStartTarget->dispatchEvent(Event::createCancelableBubble( | 964 if (selectStartTarget->dispatchEvent(Event::createCancelableBubble( |
| 965 EventTypeNames::selectstart)) != DispatchEventResult::NotCanceled) | 965 EventTypeNames::selectstart)) != DispatchEventResult::NotCanceled) |
| 966 return; | 966 return; |
| 967 // |root| may be detached due to selectstart event. | 967 // |root| may be detached due to selectstart event. |
| 968 if (!root->isConnected() || expectedDocument != root->document()) | 968 if (!root->isConnected() || expectedDocument != root->document()) |
| 969 return; | 969 return; |
| 970 } | 970 } |
| 971 | 971 |
| 972 // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets |
| 973 // needs to be audited. See http://crbug.com/590369 for more details. |
| 974 document().updateStyleAndLayoutIgnorePendingStylesheets(); |
| 975 |
| 972 VisibleSelection newSelection( | 976 VisibleSelection newSelection( |
| 973 VisibleSelection::selectionFromContentsOfNode(root)); | 977 VisibleSelection::selectionFromContentsOfNode(root)); |
| 974 setSelection(newSelection); | 978 setSelection(newSelection); |
| 975 selectFrameElementInParentIfFullySelected(); | 979 selectFrameElementInParentIfFullySelected(); |
| 976 notifyLayoutObjectOfSelectionChange(UserTriggered); | 980 notifyLayoutObjectOfSelectionChange(UserTriggered); |
| 977 } | 981 } |
| 978 | 982 |
| 979 bool FrameSelection::setSelectedRange(Range* range, | 983 bool FrameSelection::setSelectedRange(Range* range, |
| 980 TextAffinity affinity, | 984 TextAffinity affinity, |
| 981 SelectionDirectionalMode directional, | 985 SelectionDirectionalMode directional, |
| (...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1480 } | 1484 } |
| 1481 | 1485 |
| 1482 void showTree(const blink::FrameSelection* sel) { | 1486 void showTree(const blink::FrameSelection* sel) { |
| 1483 if (sel) | 1487 if (sel) |
| 1484 sel->showTreeForThis(); | 1488 sel->showTreeForThis(); |
| 1485 else | 1489 else |
| 1486 LOG(INFO) << "Cannot showTree for <null> FrameSelection."; | 1490 LOG(INFO) << "Cannot showTree for <null> FrameSelection."; |
| 1487 } | 1491 } |
| 1488 | 1492 |
| 1489 #endif | 1493 #endif |
| OLD | NEW |