| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 3 * Copyright (C) 2013 Apple Inc. All rights reserved. | 3 * Copyright (C) 2013 Apple 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 912 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 923 if (type != DocumentMarker::kSpelling && type != DocumentMarker::kGrammar) { | 923 if (type != DocumentMarker::kSpelling && type != DocumentMarker::kGrammar) { |
| 924 exception_state.ThrowDOMException(kSyntaxError, | 924 exception_state.ThrowDOMException(kSyntaxError, |
| 925 "internals.setMarker() currently only " | 925 "internals.setMarker() currently only " |
| 926 "supports spelling and grammar markers; " | 926 "supports spelling and grammar markers; " |
| 927 "attempted to add marker of type '" + | 927 "attempted to add marker of type '" + |
| 928 marker_type + "'."); | 928 marker_type + "'."); |
| 929 return; | 929 return; |
| 930 } | 930 } |
| 931 | 931 |
| 932 document->UpdateStyleAndLayoutIgnorePendingStylesheets(); | 932 document->UpdateStyleAndLayoutIgnorePendingStylesheets(); |
| 933 if (type == DocumentMarker::kSpelling) { | 933 if (type == DocumentMarker::kSpelling) |
| 934 document->Markers().AddSpellingMarker(range->StartPosition(), | 934 document->Markers().AddSpellingMarker(EphemeralRange(range)); |
| 935 range->EndPosition()); | 935 else |
| 936 } else { | 936 document->Markers().AddGrammarMarker(EphemeralRange(range)); |
| 937 document->Markers().AddGrammarMarker(range->StartPosition(), | |
| 938 range->EndPosition()); | |
| 939 } | |
| 940 } | 937 } |
| 941 | 938 |
| 942 unsigned Internals::markerCountForNode(Node* node, | 939 unsigned Internals::markerCountForNode(Node* node, |
| 943 const String& marker_type, | 940 const String& marker_type, |
| 944 ExceptionState& exception_state) { | 941 ExceptionState& exception_state) { |
| 945 DCHECK(node); | 942 DCHECK(node); |
| 946 WTF::Optional<DocumentMarker::MarkerTypes> marker_types = | 943 WTF::Optional<DocumentMarker::MarkerTypes> marker_types = |
| 947 MarkerTypesFrom(marker_type); | 944 MarkerTypesFrom(marker_type); |
| 948 if (!marker_types) { | 945 if (!marker_types) { |
| 949 exception_state.ThrowDOMException( | 946 exception_state.ThrowDOMException( |
| (...skipping 2343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3293 | 3290 |
| 3294 void Internals::crash() { | 3291 void Internals::crash() { |
| 3295 CHECK(false) << "Intentional crash"; | 3292 CHECK(false) << "Intentional crash"; |
| 3296 } | 3293 } |
| 3297 | 3294 |
| 3298 void Internals::setIsLowEndDevice(bool is_low_end_device) { | 3295 void Internals::setIsLowEndDevice(bool is_low_end_device) { |
| 3299 MemoryCoordinator::SetIsLowEndDeviceForTesting(is_low_end_device); | 3296 MemoryCoordinator::SetIsLowEndDeviceForTesting(is_low_end_device); |
| 3300 } | 3297 } |
| 3301 | 3298 |
| 3302 } // namespace blink | 3299 } // namespace blink |
| OLD | NEW |