| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2009 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2012 Google Inc. All rights reserved. | 3 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 } | 288 } |
| 289 | 289 |
| 290 if (!baseNode || !extentNode) | 290 if (!baseNode || !extentNode) |
| 291 UseCounter::count(m_frame, UseCounter::SelectionSetBaseAndExtentNull); | 291 UseCounter::count(m_frame, UseCounter::SelectionSetBaseAndExtentNull); |
| 292 | 292 |
| 293 if (!isValidForPosition(baseNode) || !isValidForPosition(extentNode)) | 293 if (!isValidForPosition(baseNode) || !isValidForPosition(extentNode)) |
| 294 return; | 294 return; |
| 295 | 295 |
| 296 VisiblePosition visibleBase = createVisiblePosition(createPosition(baseNode,
baseOffset)); | 296 VisiblePosition visibleBase = createVisiblePosition(createPosition(baseNode,
baseOffset)); |
| 297 VisiblePosition visibleExtent = createVisiblePosition(createPosition(extentN
ode, extentOffset)); | 297 VisiblePosition visibleExtent = createVisiblePosition(createPosition(extentN
ode, extentOffset)); |
| 298 | 298 const bool selectionHasDirection = true; |
| 299 m_frame->selection().moveTo(visibleBase, visibleExtent); | 299 m_frame->selection().setSelection(VisibleSelection(visibleBase, visibleExten
t, selectionHasDirection)); |
| 300 } | 300 } |
| 301 | 301 |
| 302 void DOMSelection::modify(const String& alterString, const String& directionStri
ng, const String& granularityString) | 302 void DOMSelection::modify(const String& alterString, const String& directionStri
ng, const String& granularityString) |
| 303 { | 303 { |
| 304 if (!isAvailable()) | 304 if (!isAvailable()) |
| 305 return; | 305 return; |
| 306 | 306 |
| 307 FrameSelection::EAlteration alter; | 307 FrameSelection::EAlteration alter; |
| 308 if (equalIgnoringCase(alterString, "extend")) | 308 if (equalIgnoringCase(alterString, "extend")) |
| 309 alter = FrameSelection::AlterationExtend; | 309 alter = FrameSelection::AlterationExtend; |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 586 m_treeScope->document().addConsoleMessage(ConsoleMessage::create(JSMessa
geSource, ErrorMessageLevel, message)); | 586 m_treeScope->document().addConsoleMessage(ConsoleMessage::create(JSMessa
geSource, ErrorMessageLevel, message)); |
| 587 } | 587 } |
| 588 | 588 |
| 589 DEFINE_TRACE(DOMSelection) | 589 DEFINE_TRACE(DOMSelection) |
| 590 { | 590 { |
| 591 visitor->trace(m_treeScope); | 591 visitor->trace(m_treeScope); |
| 592 DOMWindowProperty::trace(visitor); | 592 DOMWindowProperty::trace(visitor); |
| 593 } | 593 } |
| 594 | 594 |
| 595 } // namespace blink | 595 } // namespace blink |
| OLD | NEW |