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 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
435 granularity = kLineBoundary; | 435 granularity = kLineBoundary; |
436 else if (DeprecatedEqualIgnoringCase(granularity_string, "sentenceboundary")) | 436 else if (DeprecatedEqualIgnoringCase(granularity_string, "sentenceboundary")) |
437 granularity = kSentenceBoundary; | 437 granularity = kSentenceBoundary; |
438 else if (DeprecatedEqualIgnoringCase(granularity_string, "paragraphboundary")) | 438 else if (DeprecatedEqualIgnoringCase(granularity_string, "paragraphboundary")) |
439 granularity = kParagraphBoundary; | 439 granularity = kParagraphBoundary; |
440 else if (DeprecatedEqualIgnoringCase(granularity_string, "documentboundary")) | 440 else if (DeprecatedEqualIgnoringCase(granularity_string, "documentboundary")) |
441 granularity = kDocumentBoundary; | 441 granularity = kDocumentBoundary; |
442 else | 442 else |
443 return; | 443 return; |
444 | 444 |
| 445 // TODO(editing-dev): The use of updateStyleAndLayoutIgnorePendingStylesheets |
| 446 // needs to be audited. See http://crbug.com/590369 for more details. |
| 447 GetFrame()->GetDocument()->UpdateStyleAndLayoutIgnorePendingStylesheets(); |
| 448 |
445 Element* focused_element = GetFrame()->GetDocument()->FocusedElement(); | 449 Element* focused_element = GetFrame()->GetDocument()->FocusedElement(); |
446 GetFrame()->Selection().Modify(alter, direction, granularity); | 450 GetFrame()->Selection().Modify(alter, direction, granularity); |
447 if (GetFrame() && GetFrame()->GetDocument() && | 451 if (GetFrame() && GetFrame()->GetDocument() && |
448 focused_element != GetFrame()->GetDocument()->FocusedElement()) | 452 focused_element != GetFrame()->GetDocument()->FocusedElement()) |
449 UseCounter::Count(GetFrame(), UseCounter::kSelectionFuncionsChangeFocus); | 453 UseCounter::Count(GetFrame(), UseCounter::kSelectionFuncionsChangeFocus); |
450 } | 454 } |
451 | 455 |
452 // https://www.w3.org/TR/selection-api/#dom-selection-extend | 456 // https://www.w3.org/TR/selection-api/#dom-selection-extend |
453 void DOMSelection::extend(Node* node, | 457 void DOMSelection::extend(Node* node, |
454 unsigned offset, | 458 unsigned offset, |
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
824 tree_scope_->GetDocument().AddConsoleMessage( | 828 tree_scope_->GetDocument().AddConsoleMessage( |
825 ConsoleMessage::Create(kJSMessageSource, kErrorMessageLevel, message)); | 829 ConsoleMessage::Create(kJSMessageSource, kErrorMessageLevel, message)); |
826 } | 830 } |
827 | 831 |
828 DEFINE_TRACE(DOMSelection) { | 832 DEFINE_TRACE(DOMSelection) { |
829 visitor->Trace(tree_scope_); | 833 visitor->Trace(tree_scope_); |
830 ContextClient::Trace(visitor); | 834 ContextClient::Trace(visitor); |
831 } | 835 } |
832 | 836 |
833 } // namespace blink | 837 } // namespace blink |
OLD | NEW |